@openlist-frontend/openlist-frontend 4.0.9 → 4.1.0
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/VERSION +1 -1
- package/dist/assets/{2fa-2cc2atzU.js → 2fa-QoYFzgIF.js} +1 -1
- package/dist/assets/{2fa-legacy-Bv6NDiiZ.js → 2fa-legacy-DAkfvuaM.js} +1 -1
- package/dist/assets/About-B7Kvo1aB.js +1 -0
- package/dist/assets/{About-legacy-QsfCSVxq.js → About-legacy-DVj51Yvw.js} +1 -1
- package/dist/assets/AddOrEdit-BO6ufF5N.js +1 -0
- package/dist/assets/{AddOrEdit-B2PSnD-9.js → AddOrEdit-BnhxwceZ.js} +1 -1
- package/dist/assets/{AddOrEdit-DKPH7EZ_.js → AddOrEdit-DjfJsYrk.js} +1 -1
- package/dist/assets/{AddOrEdit-legacy-DxIDnAk7.js → AddOrEdit-legacy-Bg4C0OQU.js} +1 -1
- package/dist/assets/{AddOrEdit-legacy-COHYBFCt.js → AddOrEdit-legacy-CyctaWfp.js} +1 -1
- package/dist/assets/AddOrEdit-legacy-f8K0IUMl.js +1 -0
- package/dist/assets/Common-Dpk1gc-_.js +1 -0
- package/dist/assets/Common-legacy-BmK8ewzu.js +1 -0
- package/dist/assets/{Copy-CENvweJK.js → Copy-CqqotY0z.js} +1 -1
- package/dist/assets/{Copy-legacy-D_8otiMK.js → Copy-legacy-BruqHTeV.js} +1 -1
- package/dist/assets/Decompress-DLkWzQ3S.js +1 -0
- package/dist/assets/{Decompress-legacy-Dv_Jku2u.js → Decompress-legacy-DAB5qPVJ.js} +1 -1
- package/dist/assets/{DeletePopover-BFBUMopn.js → DeletePopover-CJe1R9Ss.js} +1 -1
- package/dist/assets/{DeletePopover-legacy-BEDnzn-m.js → DeletePopover-legacy-DXKXbGri.js} +1 -1
- package/dist/assets/{File-DOBK5V8m.js → File-Dfqdcr_u.js} +2 -2
- package/dist/assets/{File-legacy-D1ODACuv.js → File-legacy-CQVS1Vpk.js} +1 -1
- package/dist/assets/{Folder-CGWdNP6D.js → Folder-1H_XPHli.js} +3 -3
- package/dist/assets/{Folder-legacy-YsG9JF-C.js → Folder-legacy-DBPPt3z3.js} +2 -2
- package/dist/assets/FolderTree-legacy-BSV4stNN.js +1 -0
- package/dist/assets/FolderTree-tZ6zUZ7j.js +1 -0
- package/dist/assets/Grid-BrJTEWW6.js +1 -0
- package/dist/assets/Grid-legacy-CmmbMWtK.js +1 -0
- package/dist/assets/GridItem-IiSsrrRE.js +1 -0
- package/dist/assets/GridItem-legacy-Dd_rurIk.js +1 -0
- package/dist/assets/{ImageWithError-gG_AK8KG.js → ImageWithError-CSUD2e5_.js} +1 -1
- package/dist/assets/{ImageWithError-legacy-B07XhroH.js → ImageWithError-legacy-bpUxh_rg.js} +1 -1
- package/dist/assets/Images-legacy-Bloy8aMr.js +1 -0
- package/dist/assets/Images-ohOuh-tZ.js +1 -0
- package/dist/assets/Layout-CTXbLLrz.js +6 -0
- package/dist/assets/Layout-legacy-BEddNSfP.js +6 -0
- package/dist/assets/List-CioFfC3F.js +1 -0
- package/dist/assets/List-legacy-3BnwxKd9.js +1 -0
- package/dist/assets/{Messenger-Dmz66wIv.js → Messenger-BwX5Ot-u.js} +1 -1
- package/dist/assets/{Messenger-legacy-DEa2mtGl.js → Messenger-legacy-BdURBipq.js} +1 -1
- package/dist/assets/{Metas-BV8fZzUC.js → Metas-C-KooGDN.js} +1 -1
- package/dist/assets/{Metas-legacy-Dsed9U0b.js → Metas-legacy-DNSLvcPZ.js} +1 -1
- package/dist/assets/{Move-CjmsQ4oK.js → Move-BmKqqWgw.js} +1 -1
- package/dist/assets/{Move-legacy-BJYFMCwm.js → Move-legacy-r10bw0e-.js} +1 -1
- package/dist/assets/Other-DvpG5x28.js +1 -0
- package/dist/assets/Other-legacy-CpHIszvT.js +1 -0
- package/dist/assets/PackageDownload-B9EgcsaJ.js +1 -0
- package/dist/assets/{PackageDownload-legacy-DghWe59X.js → PackageDownload-legacy-DSGHgtWt.js} +1 -1
- package/dist/assets/{Paginator-CfTq8QGy.js → Paginator-DRB7Z41C.js} +1 -1
- package/dist/assets/{Paginator-legacy-BBwW9rLz.js → Paginator-legacy-DTdrq2lp.js} +1 -1
- package/dist/assets/{Password-_jCVU1BX.js → Password-B11wTWqR.js} +1 -1
- package/dist/assets/{Password-legacy-B7VWpO0t.js → Password-legacy-BGfOD_8_.js} +1 -1
- package/dist/assets/{Profile-DQqzso6r.js → Profile-C1cliTl8.js} +1 -1
- package/dist/assets/{Profile-legacy-DxHXHWHS.js → Profile-legacy-GCM5na_Q.js} +1 -1
- package/dist/assets/{PublicKeys-BUewmKb-.js → PublicKeys-Bx-4Shpz.js} +1 -1
- package/dist/assets/{PublicKeys-legacy-L19QKXEm.js → PublicKeys-legacy-Dq05MCbe.js} +1 -1
- package/dist/assets/{ResponsiveGrid-DBqpPiu2.js → ResponsiveGrid-BoOhAULT.js} +1 -1
- package/dist/assets/{ResponsiveGrid-legacy-io27eqXp.js → ResponsiveGrid-legacy-1sf4PYbB.js} +1 -1
- package/dist/assets/{S3-Ue8_AwRX.js → S3-Do-y1BLJ.js} +1 -1
- package/dist/assets/{S3-legacy-BEIExV0a.js → S3-legacy-DpBe-p2k.js} +1 -1
- package/dist/assets/{SettingItem-CoyA-wst.js → SettingItem-CG5PkkHH.js} +1 -1
- package/dist/assets/{SettingItem-legacy-FkrTuUbn.js → SettingItem-legacy-B4Pb_Xz0.js} +1 -1
- package/dist/assets/{Storages-B0zOmRwd.js → Storages-C_m4s20G.js} +1 -1
- package/dist/assets/{Storages-legacy-CBl6TdCy.js → Storages-legacy-DXs5dP9Y.js} +1 -1
- package/dist/assets/{Upload-y6lHsBbS.js → Upload-CKRnF4DO.js} +1 -1
- package/dist/assets/{Upload-9DDOLajr.js → Upload-aH9yNoOD.js} +1 -1
- package/dist/assets/{Upload-legacy-uISx3f64.js → Upload-legacy-CxFEzbZB.js} +1 -1
- package/dist/assets/{Upload-legacy-BX35PWMt.js → Upload-legacy-Duci8WH8.js} +1 -1
- package/dist/assets/Users-BnHY9262.js +1 -0
- package/dist/assets/Users-legacy-_OwnC7o5.js +1 -0
- package/dist/assets/{Wether-enRDnS5x.js → Wether-CG_Kg5-q.js} +1 -1
- package/dist/assets/{Wether-legacy-CUYxMAIK.js → Wether-legacy-Bdidv3LZ.js} +1 -1
- package/dist/assets/{aliyun_office-4kFcJSQ7.js → aliyun_office-B1HBHrPf.js} +1 -1
- package/dist/assets/{aliyun_office-legacy-CeoV_l42.js → aliyun_office-legacy-DTmek5GS.js} +1 -1
- package/dist/{lite/assets/aliyun_video-b2790a1e.js → assets/aliyun_video-U-pLeC7E.js} +1 -1
- package/dist/assets/aliyun_video-legacy-DTBjmE9W.js +1 -0
- package/dist/assets/archive-DOr7Dqax.js +1 -0
- package/dist/assets/archive-legacy-wJmPUETd.js +1 -0
- package/dist/{lite/assets/asciinema-03a03960.js → assets/asciinema-ZQcYEkAW.js} +1 -1
- package/dist/assets/asciinema-legacy-zxAySqsq.js +1 -0
- package/dist/assets/audio-CRzHxaoi.js +1 -0
- package/dist/assets/audio-legacy-Feenv18g.js +1 -0
- package/dist/assets/{backup-restore-C5uaukNL.js → backup-restore-DI3_7B-r.js} +1 -1
- package/dist/assets/{backup-restore-legacy-BNzSREad.js → backup-restore-legacy-Buh90yQQ.js} +1 -1
- package/dist/assets/{entry-CzYCw4_c.js → entry-B8RFtHi3.js} +1 -1
- package/dist/assets/{entry-8adOMWDV.js → entry-B98kaxtp.js} +1 -1
- package/dist/assets/{entry-legacy-BJi3IsKO.js → entry-legacy-ClQCsMpg.js} +1 -1
- package/dist/assets/{entry-legacy-CPgG9LS1.js → entry-legacy-CvWDK9vA.js} +1 -1
- package/dist/assets/flash-06hWdflD.js +1 -0
- package/dist/assets/flash-legacy-CEkIWCeS.js +1 -0
- package/dist/assets/heic-Dcuye9xt.js +1 -0
- package/dist/assets/heic-legacy-C297mKdd.js +1 -0
- package/dist/{lite/assets/helper-59016ddf.js → assets/helper-D_ZwLK_B.js} +1 -1
- package/dist/assets/{helper-CJdkogiC.js → helper-EtkfBFKy.js} +1 -1
- package/dist/assets/{helper-legacy-B4Xut8Z5.js → helper-legacy-BZAtBbx-.js} +1 -1
- package/dist/assets/helper-legacy-Crstiw7Q.js +1 -0
- package/dist/assets/{hls-CdGSrFYh.js → hls-Ct2iKFyb.js} +1 -1
- package/dist/assets/{hls-legacy-BR5PAXA5.js → hls-legacy-D8ZW6jtp.js} +1 -1
- package/dist/{lite/assets/html-a748c03a.js → assets/html-Der_HXVQ.js} +1 -1
- package/dist/assets/{html-legacy-DS9vIClh.js → html-legacy-qRV9zl9j.js} +1 -1
- package/dist/assets/{icon-CgK9sKtW.js → icon-Di-A6oGV.js} +1 -1
- package/dist/assets/{icon-legacy-jbuQXJrW.js → icon-legacy-RrRPpu72.js} +1 -1
- package/dist/assets/image-Dcp8UQSC.js +1 -0
- package/dist/assets/image-legacy-MktRWNPk.js +1 -0
- package/dist/{lite/assets/index-b8211a8c.js → assets/index-39alBTSo.js} +1 -1
- package/dist/assets/{index-BS5bVjs5.js → index-BQ3fKbcZ.js} +1 -1
- package/dist/assets/{index-CSwg5QXS.js → index-BeFrtC4h.js} +6 -6
- package/dist/assets/{index-DOY4u_GJ.js → index-DQgSmKvW.js} +1 -1
- package/dist/{lite/assets/index-dfffd899.js → assets/index-DnhdS7oh.js} +1 -1
- package/dist/assets/{index-DqW5xUnX.js → index-KrJvblBL.js} +1 -1
- package/dist/assets/{index-BJaZW_cl.js → index-U2hEgx40.js} +1 -1
- package/dist/assets/{index-BClBcNEu.js → index-ZTxfPVQc.js} +1 -1
- package/dist/assets/{index-DV8SB530.js → index-cDisVFxX.js} +1 -1
- package/dist/assets/{index-legacy-CDfFAMGs.js → index-legacy--GMgRmYe.js} +1 -1
- package/dist/assets/{index-legacy-CwvCVg8-.js → index-legacy-B1wMIUVA.js} +1 -1
- package/dist/assets/{index-legacy-nH7bmAdo.js → index-legacy-BDBjlhRR.js} +1 -1
- package/dist/assets/{index-legacy-zjwrrR91.js → index-legacy-BDOGUGER.js} +1 -1
- package/dist/assets/{index-legacy-Ctuk5AXi.js → index-legacy-BHlOEqoB.js} +1 -1
- package/dist/assets/{index-legacy-DkZZKHvO.js → index-legacy-BZ7kWilP.js} +1 -1
- package/dist/assets/{index-legacy-C5X1tU4Z.js → index-legacy-BsAqemlM.js} +1 -1
- package/dist/assets/index-legacy-C_fp4R35.js +1 -0
- package/dist/assets/{index-legacy-CtC7fn6O.js → index-legacy-CfXu3iPN.js} +4 -4
- package/dist/assets/index-legacy-CiO_xwp7.js +1 -0
- package/dist/assets/index-uMglY6aV.js +2 -0
- package/dist/assets/{indexes-Ba0IqlDk.js → indexes-DHzNsR3X.js} +1 -1
- package/dist/assets/{indexes-legacy-DOV4Irpp.js → indexes-legacy-CYDIc_-J.js} +1 -1
- package/dist/assets/ipa-Bvq4GufD.js +1 -0
- package/dist/assets/ipa-legacy-CXj6nWH_.js +1 -0
- package/dist/assets/markdown-BTG5QgAB.js +1 -0
- package/dist/assets/markdown-legacy-B4FJ2KYb.js +1 -0
- package/dist/assets/markdown_with_word_wrap-legacy-BfAsPsKl.js +1 -0
- package/dist/assets/markdown_with_word_wrap-sqgjsEFq.js +1 -0
- package/dist/assets/offline_download-DSXlv_fS.js +1 -0
- package/dist/assets/{offline_download-legacy-TAKRiM_z.js → offline_download-legacy-IVHhY0Fl.js} +1 -1
- package/dist/assets/pdf-hzVb4Kgy.js +1 -0
- package/dist/assets/pdf-legacy-WbGyXlrg.js +45 -0
- package/dist/assets/{pdf.worker.min--PgD6g2g.mjs → pdf.worker.min-DbR_HJhJ.js} +4 -4
- package/dist/assets/plist-2Y50jjt-.js +1 -0
- package/dist/assets/plist-legacy-B8d_27Yt.js +1 -0
- package/dist/assets/{style-QIM1DiTv.js → style-Mplh4sB8.js} +1 -1
- package/dist/assets/{style-legacy-DqRFDAwL.js → style-legacy-Cxcb54Ge.js} +1 -1
- package/dist/assets/text-editor-DGAoQNZR.js +1 -0
- package/dist/assets/text-editor-legacy-B2-OWm_i.js +1 -0
- package/dist/assets/{url-BdlNs2qR.js → url-95TlThfV.js} +1 -1
- package/dist/assets/{url-legacy-BObEvUIa.js → url-legacy-BhY0uecs.js} +1 -1
- package/dist/assets/{useTitle-DVdBzpBf.js → useTitle-QM9-qgni.js} +1 -1
- package/dist/assets/{useTitle-legacy-CeyL-0_E.js → useTitle-legacy-D5B3yBZZ.js} +1 -1
- package/dist/assets/video-KiVJHX0P.js +7 -0
- package/dist/assets/video-legacy-BrJOpPW-.js +9 -0
- package/dist/assets/{video360-Ceo5Bzr3.js → video360-HOYCbLmb.js} +1 -1
- package/dist/assets/{video360-legacy-DKyKnnjk.js → video360-legacy-BHwShuvc.js} +1 -1
- package/dist/assets/{video_box-BSgDB9Qt.js → video_box-0_m4vtRE.js} +2 -2
- package/dist/assets/{video_box-legacy-OIbbmS-k.js → video_box-legacy-DVP4wTZQ.js} +1 -1
- package/dist/i18n.tar.gz +0 -0
- package/dist/index.html +11 -11
- package/dist/lite/VERSION +1 -1
- package/dist/lite/assets/2fa-Bpxh448n.js +1 -0
- package/dist/lite/assets/2fa-legacy-DwWWjhKd.js +1 -0
- package/dist/lite/assets/About-ArjASC3Q.js +1 -0
- package/dist/lite/assets/About-legacy-Bj3uriA_.js +1 -0
- package/dist/lite/assets/AddOrEdit-B3LjAnjt.js +1 -0
- package/dist/lite/assets/AddOrEdit-BAx3eDaB.js +1 -0
- package/dist/lite/assets/AddOrEdit-DF0Uwc_L.js +1 -0
- package/dist/lite/assets/AddOrEdit-legacy-BiTUAbBy.js +1 -0
- package/dist/lite/assets/AddOrEdit-legacy-CA9WRPx4.js +1 -0
- package/dist/lite/assets/AddOrEdit-legacy-Dfi2IkNZ.js +1 -0
- package/dist/lite/assets/Common-BzbR55Cb.js +1 -0
- package/dist/lite/assets/Common-legacy-3RN_unfO.js +1 -0
- package/dist/lite/assets/Copy-DiJEbe33.js +1 -0
- package/dist/lite/assets/Copy-legacy-Cde3ux6l.js +1 -0
- package/dist/lite/assets/Decompress-CFzo8jdo.js +1 -0
- package/dist/lite/assets/Decompress-legacy-DsqpmmrM.js +1 -0
- package/dist/lite/assets/{DeletePopover-239d6d9d.js → DeletePopover-Cvk3C2o6.js} +1 -1
- package/dist/lite/assets/DeletePopover-legacy-Dfx3CmJo.js +1 -0
- package/dist/lite/assets/File-cqzoU4-v.js +2 -0
- package/dist/lite/assets/File-legacy-DdJSf0C9.js +1 -0
- package/dist/lite/assets/Folder-Do8UmR7t.js +115 -0
- package/dist/lite/assets/Folder-legacy-CmfB2sKk.js +43 -0
- package/dist/lite/assets/{Folder-6651c4e8.css → Folder-pZUjROFs.css} +1 -1
- package/dist/lite/assets/FolderTree-CFJsWcYU.js +1 -0
- package/dist/lite/assets/FolderTree-legacy-CPmKKEH_.js +1 -0
- package/dist/lite/assets/Grid-Cb4KcOOA.js +1 -0
- package/dist/lite/assets/Grid-legacy-BS9-SmUZ.js +1 -0
- package/dist/lite/assets/GridItem-DWKtcQLG.js +1 -0
- package/dist/lite/assets/GridItem-legacy-D1hKWaXY.js +1 -0
- package/dist/lite/assets/{ImageWithError-7a45dab8.js → ImageWithError-BS_j8_6Y.js} +1 -1
- package/dist/lite/assets/ImageWithError-legacy-Ce8hrBNL.js +1 -0
- package/dist/lite/assets/Images-CMH8hgp4.js +1 -0
- package/dist/lite/assets/Images-legacy-CC9la4S2.js +1 -0
- package/dist/lite/assets/Layout-jFFnLZug.js +6 -0
- package/dist/lite/assets/Layout-legacy-sqNeJgu3.js +6 -0
- package/dist/lite/assets/List-BsIOu856.js +1 -0
- package/dist/lite/assets/List-legacy-Btd-Aw-v.js +1 -0
- package/dist/lite/assets/Messenger-h8Gtjg9d.js +1 -0
- package/dist/lite/assets/Messenger-legacy-MSqQNafv.js +1 -0
- package/dist/lite/assets/Metas-ChO30D8Y.js +1 -0
- package/dist/lite/assets/Metas-legacy-BYtt6Ssn.js +1 -0
- package/dist/lite/assets/Move-JKMnsjzW.js +1 -0
- package/dist/lite/assets/Move-legacy-io1yEHph.js +1 -0
- package/dist/lite/assets/Other-DkvzL5dr.js +1 -0
- package/dist/lite/assets/Other-legacy-en5g3QVf.js +1 -0
- package/dist/lite/assets/PackageDownload-A3XlgYaK.js +1 -0
- package/dist/lite/assets/PackageDownload-legacy-Bsc8kCYa.js +1 -0
- package/dist/lite/assets/{Paginator-c6bbb723.js → Paginator-DYHEaUXh.js} +1 -1
- package/dist/lite/assets/Paginator-legacy-CHY0GWFh.js +1 -0
- package/dist/lite/assets/Password-DFzvuu_a.js +1 -0
- package/dist/lite/assets/Password-legacy-D3G8Nj3a.js +1 -0
- package/dist/lite/assets/{Profile-8e13fe60.js → Profile-D7CiDttN.js} +1 -1
- package/dist/lite/assets/Profile-legacy-CWckDtrc.js +1 -0
- package/dist/lite/assets/PublicKeys-legacy-U88DZl4m.js +1 -0
- package/dist/lite/assets/PublicKeys-wq_H67SA.js +1 -0
- package/dist/lite/assets/ResponsiveGrid-legacy-q5IrbTkd.js +1 -0
- package/dist/lite/assets/ResponsiveGrid-xgt3u3bA.js +1 -0
- package/dist/lite/assets/S3-BbQW41ep.js +1 -0
- package/dist/lite/assets/S3-legacy-DGp5ZhSq.js +1 -0
- package/dist/lite/assets/SettingItem-legacy-DcZ5E_l_.js +1 -0
- package/dist/lite/assets/SettingItem-roKcFMua.js +1 -0
- package/dist/lite/assets/Storages-BaIcw41y.js +1 -0
- package/dist/lite/assets/Storages-legacy-CFy4b4ek.js +1 -0
- package/dist/lite/assets/Upload-DHbPCUwq.js +5 -0
- package/dist/lite/assets/Upload-RIL7iquw.js +1 -0
- package/dist/lite/assets/Upload-legacy-3NfgdpZd.js +1 -0
- package/dist/lite/assets/Upload-legacy-poADpzfh.js +6 -0
- package/dist/lite/assets/Users-BAqP24Qw.js +1 -0
- package/dist/lite/assets/Users-legacy-C0mMiKMz.js +1 -0
- package/dist/lite/assets/Wether-DK3WDUbh.js +1 -0
- package/dist/lite/assets/Wether-legacy-Cavl6pKD.js +1 -0
- package/dist/lite/assets/aliyun_office-DBqDX_hp.js +1 -0
- package/dist/lite/assets/aliyun_office-legacy-_79ghtZB.js +1 -0
- package/dist/lite/assets/aliyun_video-CZcF0Nna.js +1 -0
- package/dist/lite/assets/aliyun_video-legacy-Ct0Zt1SB.js +1 -0
- package/dist/lite/assets/archive-1Ny6qOnL.js +1 -0
- package/dist/lite/assets/archive-legacy-BkYvaOrc.js +1 -0
- package/dist/lite/assets/asciinema-legacy-vQ791H0a.js +1 -0
- package/dist/lite/assets/asciinema-sSQhDJ1O.js +1 -0
- package/dist/lite/assets/audio-CpqrlW8K.js +1 -0
- package/dist/lite/assets/{audio-43f4c02b.css → audio-DVCFhzL6.css} +1 -1
- package/dist/lite/assets/audio-legacy-BXgPWYfA.js +1 -0
- package/dist/lite/assets/{backup-restore-a1922c8b.js → backup-restore-DoLA2IME.js} +1 -1
- package/dist/lite/assets/backup-restore-legacy-DNPfsuAH.js +1 -0
- package/dist/lite/assets/entry-BtEOFyfY.js +1 -0
- package/dist/lite/assets/entry-DtuXLztK.js +1 -0
- package/dist/lite/assets/entry-legacy-BxiK1GJf.js +1 -0
- package/dist/lite/assets/entry-legacy-Du4R67kT.js +1 -0
- package/dist/lite/assets/{flash-9e68a05e.js → flash-Djj83tqh.js} +1 -1
- package/dist/lite/assets/flash-legacy-BRVpO4r6.js +1 -0
- package/dist/lite/assets/heic-NwUjtcuG.js +1 -0
- package/dist/lite/assets/heic-legacy-B3T6GJ6D.js +1 -0
- package/dist/lite/assets/helper-Ch7ToGeM.js +1 -0
- package/dist/lite/assets/helper-DwX_dOuD.js +1 -0
- package/dist/lite/assets/helper-legacy-B5KaTScg.js +1 -0
- package/dist/lite/assets/helper-legacy-DcsEUFIj.js +1 -0
- package/dist/lite/assets/hls-DBosaSUe.js +6 -0
- package/dist/lite/assets/hls-legacy-DgOWpufA.js +8 -0
- package/dist/{assets/html-CBeb2Gu_.js → lite/assets/html-Ba6vHZ_J.js} +1 -1
- package/dist/lite/assets/html-legacy-Mvg6eZYQ.js +1 -0
- package/dist/lite/assets/{icon-cb9eb834.js → icon-ceZ0r1RC.js} +1 -1
- package/dist/lite/assets/icon-legacy-BoOzfCLN.js +1 -0
- package/dist/lite/assets/image-Bu07NFPt.js +1 -0
- package/dist/lite/assets/image-legacy-N3F4kT0B.js +1 -0
- package/dist/lite/assets/index-B_TdULNl.js +21 -0
- package/dist/{assets/index-DNDW0loe.js → lite/assets/index-BcZBdJ0I.js} +1 -1
- package/dist/lite/assets/index-Bn2D_UmB.js +2 -0
- package/dist/lite/assets/index-C3V6yVI8.js +1 -0
- package/dist/lite/assets/{index-a14fae00.js → index-CRXmqRYq.js} +1 -1
- package/dist/lite/assets/{index-6a28cbb7.js → index-C_aiEtJn.js} +1 -1
- package/dist/lite/assets/index-C_jPYH9Z.js +1 -0
- package/dist/{assets/index-C7ih00qx.js → lite/assets/index-Dqq7pWSD.js} +1 -1
- package/dist/lite/assets/{index-67a90f4f.js → index-HMcyQa6d.js} +1 -1
- package/dist/lite/assets/index-e42Miit8.js +14 -0
- package/dist/lite/assets/index-legacy-BVyUBVta.js +1 -0
- package/dist/lite/assets/index-legacy-CLqrKPV_.js +1 -0
- package/dist/lite/assets/index-legacy-CVBschDa.js +1 -0
- package/dist/lite/assets/index-legacy-CzA4JGfb.js +28 -0
- package/dist/lite/assets/index-legacy-D0eoTtsv.js +1 -0
- package/dist/lite/assets/index-legacy-DCVYtsVs.js +1 -0
- package/dist/lite/assets/index-legacy-Dc8ardce.js +1 -0
- package/dist/lite/assets/index-legacy-DrvGupqT.js +1 -0
- package/dist/lite/assets/index-legacy-biWX0Baf.js +1 -0
- package/dist/lite/assets/index-legacy-d-CZR28M.js +18 -0
- package/dist/lite/assets/indexes-CR9gvSWH.js +1 -0
- package/dist/lite/assets/indexes-legacy-DFzWwoPv.js +1 -0
- package/dist/lite/assets/ipa-DwQ4X4s4.js +1 -0
- package/dist/lite/assets/ipa-legacy-BCZ_Zc3J.js +1 -0
- package/dist/lite/assets/item_type-legacy-NfhfVKtF.js +1 -0
- package/dist/lite/assets/markdown-B4ybtoLY.js +1 -0
- package/dist/lite/assets/markdown-legacy-DUdUSvRx.js +1 -0
- package/dist/lite/assets/markdown_with_word_wrap-C6ZJsL5G.js +1 -0
- package/dist/lite/assets/markdown_with_word_wrap-legacy-D6JpLTGQ.js +1 -0
- package/dist/lite/assets/offline_download-B5VAjVkY.js +1 -0
- package/dist/lite/assets/offline_download-legacy-iaAjOlRE.js +1 -0
- package/dist/lite/assets/plist-BPhLI2sw.js +1 -0
- package/dist/lite/assets/plist-legacy-D1tXE2us.js +1 -0
- package/dist/lite/assets/polyfills-legacy-fFt7otW2.js +4 -0
- package/dist/lite/assets/style-DhbY8MLj.js +1 -0
- package/dist/lite/assets/style-legacy-BCQSOKfk.js +1 -0
- package/dist/lite/assets/text-editor-CyJ0Qq4M.js +1 -0
- package/dist/lite/assets/text-editor-legacy-DShJUMbE.js +1 -0
- package/dist/lite/assets/url-CT_IfmFh.js +1 -0
- package/dist/lite/assets/url-legacy-Ct_LVIpR.js +1 -0
- package/dist/lite/assets/useTitle-Eavd_FAg.js +1 -0
- package/dist/lite/assets/useTitle-legacy-mcHxhUhu.js +1 -0
- package/dist/lite/assets/video-DbnoLf1P.js +7 -0
- package/dist/lite/assets/video-legacy-CwAVgHet.js +9 -0
- package/dist/lite/assets/video360-legacy-DXyquQE4.js +16 -0
- package/dist/lite/assets/video360-qu887L1T.js +14 -0
- package/dist/lite/assets/video_box-DtlDzrz5.js +6 -0
- package/dist/lite/assets/video_box-legacy-zTy3pZGq.js +8 -0
- package/dist/lite/assets/webauthn-json.browser-ponyfill-legacy-8XJfKV2b.js +1 -0
- package/dist/lite/i18n.tar.gz +0 -0
- package/dist/lite/index.html +12 -19
- package/dist/lite/static/manifest.json +1 -1
- package/package.json +1 -1
- package/dist/assets/About-Cu11TW0D.js +0 -1
- package/dist/assets/AddOrEdit-B7sPaR10.js +0 -1
- package/dist/assets/AddOrEdit-legacy-BLNrBEUZ.js +0 -1
- package/dist/assets/Common-CrTYhaeL.js +0 -1
- package/dist/assets/Common-legacy-CYNGdYU-.js +0 -1
- package/dist/assets/Decompress-CzLWbcw1.js +0 -1
- package/dist/assets/FolderTree-BopfuzE_.js +0 -1
- package/dist/assets/FolderTree-legacy-DH3Vf9XJ.js +0 -1
- package/dist/assets/Grid-DPqNI8Qb.js +0 -1
- package/dist/assets/Grid-legacy-BgCqAxPk.js +0 -1
- package/dist/assets/GridItem-DKsYPXRd.js +0 -1
- package/dist/assets/GridItem-legacy-B5BlOcYb.js +0 -1
- package/dist/assets/Images-OiLzswiq.js +0 -1
- package/dist/assets/Images-legacy-ByM1mPR1.js +0 -1
- package/dist/assets/Layout-CyS6jJ_b.js +0 -6
- package/dist/assets/Layout-legacy-D9Zk98K6.js +0 -6
- package/dist/assets/List-CZc2zrbB.js +0 -1
- package/dist/assets/List-legacy-CFAZAIBP.js +0 -1
- package/dist/assets/Other-DXc0kpSC.js +0 -1
- package/dist/assets/Other-legacy-38X7w6nZ.js +0 -1
- package/dist/assets/PackageDownload-CwKBLgrB.js +0 -1
- package/dist/assets/Users-BNQGZuWH.js +0 -1
- package/dist/assets/Users-legacy-BINPeiuk.js +0 -1
- package/dist/assets/aliyun_video-CwA2k3Pu.js +0 -1
- package/dist/assets/aliyun_video-legacy-BpsCIyHp.js +0 -1
- package/dist/assets/archive-96T1hx83.js +0 -1
- package/dist/assets/archive-legacy-DNLQfLr5.js +0 -1
- package/dist/assets/asciinema-CyHXgEN-.js +0 -1
- package/dist/assets/asciinema-legacy-t3iZqcax.js +0 -1
- package/dist/assets/audio-DSt_Oo19.js +0 -1
- package/dist/assets/audio-legacy-BhsBrhkI.js +0 -1
- package/dist/assets/flash-Be81XNne.js +0 -1
- package/dist/assets/flash-legacy-CPqjLHQp.js +0 -1
- package/dist/assets/heic-DpvwRot7.js +0 -1
- package/dist/assets/heic-legacy-BoU2N_4X.js +0 -1
- package/dist/assets/helper-Ha9z54Sm.js +0 -1
- package/dist/assets/helper-legacy-CiLX6aDH.js +0 -1
- package/dist/assets/image-DK0tWDig.js +0 -1
- package/dist/assets/image-legacy-BpyMVaKK.js +0 -1
- package/dist/assets/index-D0sWo-se.js +0 -2
- package/dist/assets/index-legacy-BYcwzmYP.js +0 -1
- package/dist/assets/index-legacy-DIduvs2M.js +0 -1
- package/dist/assets/ipa-CThENlHd.js +0 -1
- package/dist/assets/ipa-legacy-ruQ-749T.js +0 -1
- package/dist/assets/markdown-DAEQr1YU.js +0 -1
- package/dist/assets/markdown-legacy-DtXqlrxB.js +0 -1
- package/dist/assets/markdown_with_word_wrap-D_gGyBgt.js +0 -1
- package/dist/assets/markdown_with_word_wrap-legacy-D-tfNhGw.js +0 -1
- package/dist/assets/offline_download--qix7jck.js +0 -1
- package/dist/assets/pdf-DS1TLqP2.js +0 -1
- package/dist/assets/pdf-legacy-BF9lSw5M.js +0 -45
- package/dist/assets/plist-BdQrMloW.js +0 -1
- package/dist/assets/plist-legacy-Dzyq_tdc.js +0 -1
- package/dist/assets/text-editor-BvoSciLk.js +0 -1
- package/dist/assets/text-editor-legacy-AXNOcpgF.js +0 -1
- package/dist/assets/video-legacy-DYsnLlgJ.js +0 -9
- package/dist/assets/video-oPytqEM3.js +0 -7
- package/dist/lite/assets/2fa-d2e88785.js +0 -1
- package/dist/lite/assets/2fa-legacy-300dfa68.js +0 -1
- package/dist/lite/assets/About-e76de340.js +0 -1
- package/dist/lite/assets/About-legacy-79773dac.js +0 -1
- package/dist/lite/assets/AddOrEdit-3d3353a8.js +0 -1
- package/dist/lite/assets/AddOrEdit-807696e5.js +0 -1
- package/dist/lite/assets/AddOrEdit-d6caff63.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-8f86f1ff.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-9983f6e1.js +0 -1
- package/dist/lite/assets/AddOrEdit-legacy-d0c7c380.js +0 -1
- package/dist/lite/assets/Common-9c9167f7.js +0 -1
- package/dist/lite/assets/Common-legacy-d52fea2b.js +0 -1
- package/dist/lite/assets/Copy-104d7d48.js +0 -1
- package/dist/lite/assets/Copy-legacy-e1bce4e6.js +0 -1
- package/dist/lite/assets/Decompress-62fd7241.js +0 -1
- package/dist/lite/assets/Decompress-legacy-bd78eb4f.js +0 -1
- package/dist/lite/assets/DeletePopover-legacy-f4764c72.js +0 -1
- package/dist/lite/assets/File-9bb7b3b6.js +0 -1
- package/dist/lite/assets/File-legacy-dbaad256.js +0 -1
- package/dist/lite/assets/Folder-80505a0c.js +0 -114
- package/dist/lite/assets/Folder-legacy-dbe7957d.js +0 -49
- package/dist/lite/assets/FolderTree-a7545b65.js +0 -1
- package/dist/lite/assets/FolderTree-legacy-cc6e2591.js +0 -1
- package/dist/lite/assets/Grid-2ea09356.js +0 -1
- package/dist/lite/assets/Grid-legacy-7e146882.js +0 -1
- package/dist/lite/assets/GridItem-a16cc1c5.js +0 -1
- package/dist/lite/assets/GridItem-legacy-3d2048e2.js +0 -1
- package/dist/lite/assets/ImageWithError-legacy-c2f680e8.js +0 -1
- package/dist/lite/assets/Images-137f7509.js +0 -1
- package/dist/lite/assets/Images-legacy-a43b6098.js +0 -1
- package/dist/lite/assets/Layout-ac0937fd.js +0 -5
- package/dist/lite/assets/Layout-legacy-0be654c6.js +0 -6
- package/dist/lite/assets/List-64c7752c.js +0 -1
- package/dist/lite/assets/List-legacy-913c133e.js +0 -1
- package/dist/lite/assets/Messenger-254abffb.js +0 -1
- package/dist/lite/assets/Messenger-legacy-97283620.js +0 -1
- package/dist/lite/assets/Metas-1bad1832.js +0 -1
- package/dist/lite/assets/Metas-legacy-7042cb89.js +0 -1
- package/dist/lite/assets/Other-29b70647.js +0 -1
- package/dist/lite/assets/Other-legacy-607dbff6.js +0 -1
- package/dist/lite/assets/PackageDownload-e264bfda.js +0 -1
- package/dist/lite/assets/PackageDownload-legacy-55a29bc7.js +0 -1
- package/dist/lite/assets/Paginator-legacy-612bab7f.js +0 -1
- package/dist/lite/assets/Password-647ac2f5.js +0 -1
- package/dist/lite/assets/Password-legacy-2e2010d5.js +0 -1
- package/dist/lite/assets/Profile-legacy-93d7fe2b.js +0 -1
- package/dist/lite/assets/PublicKeys-7daab5c3.js +0 -1
- package/dist/lite/assets/PublicKeys-legacy-83570ba5.js +0 -1
- package/dist/lite/assets/ResponsiveGrid-f263846b.js +0 -1
- package/dist/lite/assets/ResponsiveGrid-legacy-a8200443.js +0 -1
- package/dist/lite/assets/S3-40b2a439.js +0 -1
- package/dist/lite/assets/S3-legacy-310983e4.js +0 -1
- package/dist/lite/assets/SettingItem-72aa2179.js +0 -1
- package/dist/lite/assets/SettingItem-legacy-91ff3c53.js +0 -1
- package/dist/lite/assets/Storages-90b21781.js +0 -1
- package/dist/lite/assets/Storages-legacy-49b7b995.js +0 -1
- package/dist/lite/assets/Upload-9447b1be.js +0 -5
- package/dist/lite/assets/Upload-98dd51d8.js +0 -1
- package/dist/lite/assets/Upload-legacy-3b92717c.js +0 -6
- package/dist/lite/assets/Upload-legacy-ac99e541.js +0 -1
- package/dist/lite/assets/Users-30333127.js +0 -1
- package/dist/lite/assets/Users-legacy-0719c277.js +0 -1
- package/dist/lite/assets/Wether-b430b024.js +0 -1
- package/dist/lite/assets/Wether-legacy-274cd4f2.js +0 -1
- package/dist/lite/assets/aliyun_office-b0b45663.js +0 -1
- package/dist/lite/assets/aliyun_office-legacy-2d148972.js +0 -1
- package/dist/lite/assets/aliyun_video-legacy-6a647909.js +0 -1
- package/dist/lite/assets/archive-25c8ef3b.js +0 -1
- package/dist/lite/assets/archive-legacy-348dc806.js +0 -1
- package/dist/lite/assets/asciinema-legacy-1917d686.js +0 -1
- package/dist/lite/assets/audio-ea14d1c5.js +0 -1
- package/dist/lite/assets/audio-legacy-303c3bd9.js +0 -1
- package/dist/lite/assets/backup-restore-legacy-d4b0f25c.js +0 -1
- package/dist/lite/assets/entry-27030f25.js +0 -1
- package/dist/lite/assets/entry-f2e52067.js +0 -1
- package/dist/lite/assets/entry-legacy-a1d93529.js +0 -1
- package/dist/lite/assets/entry-legacy-fd98eab3.js +0 -1
- package/dist/lite/assets/flash-legacy-80373572.js +0 -1
- package/dist/lite/assets/heic-2554ec65.js +0 -1
- package/dist/lite/assets/heic-legacy-2c1c78ca.js +0 -1
- package/dist/lite/assets/helper-af29c315.js +0 -1
- package/dist/lite/assets/helper-legacy-25bddff0.js +0 -1
- package/dist/lite/assets/helper-legacy-94b49e67.js +0 -1
- package/dist/lite/assets/hls-e031156d.js +0 -6
- package/dist/lite/assets/hls-legacy-20bdc1ee.js +0 -8
- package/dist/lite/assets/html-legacy-619368c0.js +0 -1
- package/dist/lite/assets/icon-legacy-eb0f5143.js +0 -1
- package/dist/lite/assets/image-c8b0bac2.js +0 -1
- package/dist/lite/assets/image-legacy-7afc3d49.js +0 -1
- package/dist/lite/assets/index-3f395f83.js +0 -14
- package/dist/lite/assets/index-53a1dd81.js +0 -20
- package/dist/lite/assets/index-83750b21.js +0 -1
- package/dist/lite/assets/index-9d2d674f.js +0 -1
- package/dist/lite/assets/index-b94004c5.js +0 -1
- package/dist/lite/assets/index-legacy-17656f04.js +0 -1
- package/dist/lite/assets/index-legacy-3d6bd4ab.js +0 -1
- package/dist/lite/assets/index-legacy-52bb5f2d.js +0 -1
- package/dist/lite/assets/index-legacy-6dddbd7f.js +0 -18
- package/dist/lite/assets/index-legacy-737b5776.js +0 -1
- package/dist/lite/assets/index-legacy-a79f37d7.js +0 -27
- package/dist/lite/assets/index-legacy-b6946699.js +0 -1
- package/dist/lite/assets/index-legacy-d4734338.js +0 -1
- package/dist/lite/assets/index-legacy-e78804fc.js +0 -1
- package/dist/lite/assets/index-legacy-e78c6961.js +0 -1
- package/dist/lite/assets/indexes-8d6a3830.js +0 -1
- package/dist/lite/assets/indexes-legacy-8aad9cf2.js +0 -1
- package/dist/lite/assets/ipa-14799eac.js +0 -1
- package/dist/lite/assets/ipa-legacy-05317cab.js +0 -1
- package/dist/lite/assets/item_type-legacy-d49ae974.js +0 -1
- package/dist/lite/assets/markdown-438acebf.js +0 -1
- package/dist/lite/assets/markdown-legacy-85cc7347.js +0 -1
- package/dist/lite/assets/markdown_with_word_wrap-02b3d898.js +0 -1
- package/dist/lite/assets/markdown_with_word_wrap-legacy-c80bbc34.js +0 -1
- package/dist/lite/assets/offline_download-64a4f5ec.js +0 -1
- package/dist/lite/assets/offline_download-legacy-13c80c46.js +0 -1
- package/dist/lite/assets/plist-caa63a1c.js +0 -1
- package/dist/lite/assets/plist-legacy-97df7129.js +0 -1
- package/dist/lite/assets/polyfills-legacy-84c7163c.js +0 -1
- package/dist/lite/assets/style-da60bdcd.js +0 -1
- package/dist/lite/assets/style-legacy-56f6ffc2.js +0 -1
- package/dist/lite/assets/text-editor-faffc12e.js +0 -1
- package/dist/lite/assets/text-editor-legacy-c28b9e68.js +0 -1
- package/dist/lite/assets/url-e7419bc0.js +0 -1
- package/dist/lite/assets/url-legacy-c605c2b3.js +0 -1
- package/dist/lite/assets/useTitle-3c39724b.js +0 -1
- package/dist/lite/assets/useTitle-legacy-f359aa82.js +0 -1
- package/dist/lite/assets/video-bdb2443b.js +0 -7
- package/dist/lite/assets/video-legacy-aaca36d8.js +0 -9
- package/dist/lite/assets/video360-8fe849f4.js +0 -14
- package/dist/lite/assets/video360-legacy-60cbacb5.js +0 -16
- package/dist/lite/assets/video_box-cfac536c.js +0 -6
- package/dist/lite/assets/video_box-legacy-6b3ebc5b.js +0 -8
- package/dist/lite/assets/webauthn-json.browser-ponyfill-legacy-456cc8e1.js +0 -1
- /package/dist/lite/assets/{asciinema-9107553b.css → asciinema-CxBn2iyI.css} +0 -0
- /package/dist/lite/assets/{index-c0564af7.css → index-DYLAoZjS.css} +0 -0
- /package/dist/lite/assets/{item_type-32dc6fdf.js → item_type-CV3e5W3l.js} +0 -0
- /package/dist/lite/assets/{lg-f2fe1c00.svg → lg-B0dIV2BS.svg} +0 -0
- /package/dist/lite/assets/{lg-fefc5c0d.woff → lg-CosQH4Cu.woff} +0 -0
- /package/dist/lite/assets/{lg-22b72ba5.ttf → lg-oyjwlqP2.ttf} +0 -0
- /package/dist/lite/assets/{loading-298ad3ff.gif → loading-BZOHaeKn.gif} +0 -0
- /package/dist/lite/assets/{style-a6d16836.css → style-qq4T_k44.css} +0 -0
- /package/dist/lite/assets/{subtitles-octopus-worker-f95f2186.js → subtitles-octopus-worker-BE_B0Qbi.js} +0 -0
- /package/dist/lite/assets/{subtitles-octopus-worker-62892886.wasm → subtitles-octopus-worker-DBPz2dPT.wasm} +0 -0
- /package/dist/lite/assets/{video360-f0192288.css → video360-Cpoa0Nlv.css} +0 -0
- /package/dist/lite/assets/{webauthn-json.browser-ponyfill-29d8152c.js → webauthn-json.browser-ponyfill-CVZeZdny.js} +0 -0
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
System.register(["./index-legacy-CtC7fn6O.js"],function(t,e){"use strict";var i,n,r,s,a,o,l,d,h,c,u,g,p,f,m,b,v,w,x,y,A,C,E,S,k,_,T,L,D,P,M,F,I,R,B,N,O,z,H,V,j,U,W,$,G,q,X;return{setters:[t=>{i=t.e5,n=t.dK,r=t.e6,s=t.bT,a=t.e7,o=t.B,l=t.e8,d=t.N,h=t.C,c=t.cu,u=t.av,g=t.e4,p=t.aZ,f=t.D,m=t.bV,b=t.V,v=t.ck,w=t.dH,x=t.e9,y=t.ea,A=t.aS,C=t.Q,E=t.aY,S=t.cR,k=t.am,_=t.a6,T=t.a3,L=t.o,D=t.aV,P=t.aA,M=t.ag,F=t.S,I=t.O,R=t.a4,B=t.eb,N=t.ec,O=t.di,z=t.ed,H=t.aJ,V=t.az,j=t.K,U=t.aF,W=t.ee,$=t.ef,G=t.aG,q=t.eg,X=t.I}],execute:function(){var Y=document.createElement("style");Y.textContent='.messageBar{--closing-button-icon:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M7.85822 8.84922L4.85322 11.8542C4.75891 11.9453 4.63261 11.9957 4.50151 11.9946C4.37042 11.9934 4.24501 11.9408 4.15231 11.8481C4.0596 11.7554 4.00702 11.63 4.00588 11.4989C4.00474 11.3678 4.05514 11.2415 4.14622 11.1472L7.15122 8.14222V7.85922L4.14622 4.85322C4.05514 4.75891 4.00474 4.63261 4.00588 4.50151C4.00702 4.37042 4.0596 4.24501 4.15231 4.15231C4.24501 4.0596 4.37042 4.00702 4.50151 4.00588C4.63261 4.00474 4.75891 4.05514 4.85322 4.14622L7.85822 7.15122H8.14122L11.1462 4.14622C11.2405 4.05514 11.3668 4.00474 11.4979 4.00588C11.629 4.00702 11.7544 4.0596 11.8471 4.15231C11.9398 4.24501 11.9924 4.37042 11.9936 4.50151C11.9947 4.63261 11.9443 4.75891 11.8532 4.85322L8.84822 7.85922V8.14222L11.8532 11.1472C11.9443 11.2415 11.9947 11.3678 11.9936 11.4989C11.9924 11.63 11.9398 11.7554 11.8471 11.8481C11.7544 11.9408 11.629 11.9934 11.4979 11.9946C11.3668 11.9957 11.2405 11.9453 11.1462 11.8542L8.14122 8.84922L8.14222 8.85022L7.85822 8.84922Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");--message-bar-close-button-color:var(--text-primary-color);--message-bar-close-button-color-hover:var(--text-primary-color);--message-bar-close-button-border-radius:4px;--message-bar-close-button-border:none;--csstools-light-dark-toggle--0:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--message-bar-close-button-hover-bg-color:var(--csstools-light-dark-toggle--0, rgb(21 20 26 / .14));--csstools-light-dark-toggle--1:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--message-bar-close-button-active-bg-color:var(--csstools-light-dark-toggle--1, rgb(21 20 26 / .21));--csstools-light-dark-toggle--2:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--message-bar-close-button-focus-bg-color:var(--csstools-light-dark-toggle--2, rgb(21 20 26 / .07))}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.messageBar{--message-bar-close-button-hover-bg-color:light-dark( rgb(21 20 26 / .14), rgb(251 251 254 / .14) );--message-bar-close-button-active-bg-color:light-dark( rgb(21 20 26 / .21), rgb(251 251 254 / .21) );--message-bar-close-button-focus-bg-color:light-dark( rgb(21 20 26 / .07), rgb(251 251 254 / .07) )}}@supports not (color: light-dark(tan,tan)){.messageBar *{--csstools-light-dark-toggle--0:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--message-bar-close-button-hover-bg-color:var(--csstools-light-dark-toggle--0, rgb(21 20 26 / .14));--csstools-light-dark-toggle--1:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--message-bar-close-button-active-bg-color:var(--csstools-light-dark-toggle--1, rgb(21 20 26 / .21));--csstools-light-dark-toggle--2:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--message-bar-close-button-focus-bg-color:var(--csstools-light-dark-toggle--2, rgb(21 20 26 / .07))}}@media screen and (forced-colors: active){.messageBar{--message-bar-close-button-color:ButtonText;--message-bar-close-button-border:1px solid ButtonText;--message-bar-close-button-hover-bg-color:ButtonText;--message-bar-close-button-active-bg-color:ButtonText;--message-bar-close-button-focus-bg-color:ButtonText;--message-bar-close-button-color-hover:HighlightText}}.messageBar{display:flex;position:relative;padding:8px 8px 8px 16px;flex-direction:column;justify-content:center;align-items:center;gap:8px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:4px;border:1px solid var(--message-bar-border-color);background:var(--message-bar-bg-color);color:var(--message-bar-fg-color)}.messageBar>div{display:flex;align-items:flex-start;gap:8px;align-self:stretch}:is(.messageBar>div):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--message-bar-icon);mask-image:var(--message-bar-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--message-bar-icon-color);flex-shrink:0}.messageBar button{cursor:pointer}:is(.messageBar button):focus-visible{outline:var(--focus-ring-outline);outline-offset:2px}.messageBar .closeButton{width:32px;height:32px;background:none;border-radius:var(--message-bar-close-button-border-radius);border:var(--message-bar-close-button-border);display:flex;align-items:center;justify-content:center}:is(.messageBar .closeButton):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--closing-button-icon);mask-image:var(--closing-button-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--message-bar-close-button-color)}:is(.messageBar .closeButton):is(:hover,:active,:focus):before{background-color:var(--message-bar-close-button-color-hover)}:is(.messageBar .closeButton):hover{background-color:var(--message-bar-close-button-hover-bg-color)}:is(.messageBar .closeButton):active{background-color:var(--message-bar-close-button-active-bg-color)}:is(.messageBar .closeButton):focus{background-color:var(--message-bar-close-button-focus-bg-color)}:is(.messageBar .closeButton)>span{display:inline-block;width:0;height:0;overflow:hidden}#editorUndoBar{--csstools-light-dark-toggle--3:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--3, #15141a);--message-bar-icon:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M7.625 0.5C6.64009 0.5 5.66482 0.693993 4.75487 1.0709C3.84493 1.44781 3.01814 2.00026 2.3217 2.6967C1.62526 3.39314 1.07281 4.21993 0.695904 5.12987C0.318993 6.03982 0.125 7.01509 0.125 8C0.125 8.98491 0.318993 9.96018 0.695904 10.8701C1.07281 11.7801 1.62526 12.6069 2.3217 13.3033C3.01814 13.9997 3.84493 14.5522 4.75487 14.9291C5.66482 15.306 6.64009 15.5 7.625 15.5C9.61412 15.5 11.5218 14.7098 12.9283 13.3033C14.3348 11.8968 15.125 9.98912 15.125 8C15.125 6.01088 14.3348 4.10322 12.9283 2.6967C11.5218 1.29018 9.61412 0.5 7.625 0.5ZM8.25 11.375C8.25 11.5408 8.18415 11.6997 8.06694 11.8169C7.94973 11.9342 7.79076 12 7.625 12C7.45924 12 7.30027 11.9342 7.18306 11.8169C7.06585 11.6997 7 11.5408 7 11.375V6.938C7 6.77224 7.06585 6.61327 7.18306 6.49606C7.30027 6.37885 7.45924 6.313 7.625 6.313C7.79076 6.313 7.94973 6.37885 8.06694 6.49606C8.18415 6.61327 8.25 6.77224 8.25 6.938V11.375ZM8.25 5L8 5.25H7.25L7 5V4.25L7.25 4H8L8.25 4.25V5Z%22 fill%3D%22black%22 %2F%3E%3C%2Fsvg%3E");--csstools-light-dark-toggle--4:var(--csstools-color-scheme--light) #73a7f3;--message-bar-icon-color:var(--csstools-light-dark-toggle--4, #0060df);--csstools-light-dark-toggle--5:var(--csstools-color-scheme--light) #003070;--message-bar-bg-color:var(--csstools-light-dark-toggle--5, #deeafc);--message-bar-fg-color:var(--text-primary-color);--csstools-light-dark-toggle--6:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--6, rgb(0 0 0 / .08));--csstools-light-dark-toggle--7:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--undo-button-bg-color:var(--csstools-light-dark-toggle--7, rgb(21 20 26 / .07));--csstools-light-dark-toggle--8:var(--csstools-color-scheme--light) rgb(255 255 255 / .14);--undo-button-bg-color-hover:var(--csstools-light-dark-toggle--8, rgb(21 20 26 / .14));--csstools-light-dark-toggle--9:var(--csstools-color-scheme--light) rgb(255 255 255 / .21);--undo-button-bg-color-active:var(--csstools-light-dark-toggle--9, rgb(21 20 26 / .21));--csstools-light-dark-toggle--10:var(--csstools-color-scheme--light) #0df;--undo-button-border:1px solid var(--csstools-light-dark-toggle--10, #0060df);--undo-button-fg-color:var(--message-bar-fg-color);--undo-button-fg-color-hover:var(--undo-button-fg-color);--undo-button-fg-color-active:var(--undo-button-fg-color)}@supports (color: light-dark(red,red)){#editorUndoBar{--text-primary-color:light-dark(#15141a, #fbfbfe);--message-bar-icon-color:light-dark(#0060df, #73a7f3);--message-bar-bg-color:light-dark(#deeafc, #003070)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){#editorUndoBar{--message-bar-border-color:light-dark( rgb(0 0 0 / .08), rgb(255 255 255 / .08) );--undo-button-bg-color:light-dark( rgb(21 20 26 / .07), rgb(255 255 255 / .08) );--undo-button-bg-color-hover:light-dark( rgb(21 20 26 / .14), rgb(255 255 255 / .14) );--undo-button-bg-color-active:light-dark( rgb(21 20 26 / .21), rgb(255 255 255 / .21) )}}@supports (color: light-dark(red,red)){#editorUndoBar{--undo-button-border:1px solid light-dark(#0060df, #0df)}}@supports not (color: light-dark(tan,tan)){#editorUndoBar *{--csstools-light-dark-toggle--3:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--3, #15141a);--csstools-light-dark-toggle--4:var(--csstools-color-scheme--light) #73a7f3;--message-bar-icon-color:var(--csstools-light-dark-toggle--4, #0060df);--csstools-light-dark-toggle--5:var(--csstools-color-scheme--light) #003070;--message-bar-bg-color:var(--csstools-light-dark-toggle--5, #deeafc);--csstools-light-dark-toggle--6:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--6, rgb(0 0 0 / .08));--csstools-light-dark-toggle--7:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--undo-button-bg-color:var(--csstools-light-dark-toggle--7, rgb(21 20 26 / .07));--csstools-light-dark-toggle--8:var(--csstools-color-scheme--light) rgb(255 255 255 / .14);--undo-button-bg-color-hover:var(--csstools-light-dark-toggle--8, rgb(21 20 26 / .14));--csstools-light-dark-toggle--9:var(--csstools-color-scheme--light) rgb(255 255 255 / .21);--undo-button-bg-color-active:var(--csstools-light-dark-toggle--9, rgb(21 20 26 / .21));--csstools-light-dark-toggle--10:var(--csstools-color-scheme--light) #0df;--undo-button-border:1px solid var(--csstools-light-dark-toggle--10, #0060df)}}@media screen and (forced-colors: active){#editorUndoBar{--text-primary-color:CanvasText;--message-bar-icon-color:CanvasText;--message-bar-bg-color:Canvas;--message-bar-border-color:CanvasText;--undo-button-bg-color:ButtonText;--undo-button-bg-color-hover:SelectedItem;--undo-button-bg-color-active:SelectedItem;--undo-button-fg-color:ButtonFace;--undo-button-fg-color-hover:SelectedItemText;--undo-button-fg-color-active:SelectedItemText;--undo-button-border:none}}#editorUndoBar{position:fixed;top:50px;left:50%;transform:translate(-50%);z-index:10;padding-block:8px;padding-inline:16px 8px;font:menu;font-size:15px;cursor:default}#editorUndoBar button{cursor:pointer}#editorUndoBar #editorUndoBarUndoButton{border-radius:4px;font-weight:590;line-height:19.5px;color:var(--undo-button-fg-color);border:var(--undo-button-border);padding:4px 16px;margin-inline-start:8px;height:32px;background-color:var(--undo-button-bg-color)}:is(#editorUndoBar #editorUndoBarUndoButton):hover{background-color:var(--undo-button-bg-color-hover);color:var(--undo-button-fg-color-hover)}:is(#editorUndoBar #editorUndoBarUndoButton):active{background-color:var(--undo-button-bg-color-active);color:var(--undo-button-fg-color-active)}#editorUndoBar>div{align-items:center}.dialog{--csstools-light-dark-toggle--11:var(--csstools-color-scheme--light) #1c1b22;--dialog-bg-color:var(--csstools-light-dark-toggle--11, white);--csstools-light-dark-toggle--12:var(--csstools-color-scheme--light) #1c1b22;--dialog-border-color:var(--csstools-light-dark-toggle--12, white);--csstools-light-dark-toggle--13:var(--csstools-color-scheme--light) #15141a;--dialog-shadow:0 2px 14px 0 var(--csstools-light-dark-toggle--13, rgb(58 57 68 / .2));--csstools-light-dark-toggle--14:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--14, #15141a);--csstools-light-dark-toggle--15:var(--csstools-color-scheme--light) #cfcfd8;--text-secondary-color:var(--csstools-light-dark-toggle--15, #5b5b66);--hover-filter:brightness(.9);--csstools-light-dark-toggle--16:var(--csstools-color-scheme--light) #0df;--link-fg-color:var(--csstools-light-dark-toggle--16, #0060df);--csstools-light-dark-toggle--17:var(--csstools-color-scheme--light) #80ebff;--link-hover-fg-color:var(--csstools-light-dark-toggle--17, #0250bb);--csstools-light-dark-toggle--18:var(--csstools-color-scheme--light) #52525e;--separator-color:var(--csstools-light-dark-toggle--18, #f0f0f4);--textarea-border-color:#8f8f9d;--csstools-light-dark-toggle--19:var(--csstools-color-scheme--light) #42414d;--textarea-bg-color:var(--csstools-light-dark-toggle--19, white);--textarea-fg-color:var(--text-secondary-color);--csstools-light-dark-toggle--20:var(--csstools-color-scheme--light) #2b2a33;--radio-bg-color:var(--csstools-light-dark-toggle--20, #f0f0f4);--csstools-light-dark-toggle--21:var(--csstools-color-scheme--light) #15141a;--radio-checked-bg-color:var(--csstools-light-dark-toggle--21, #fbfbfe);--radio-border-color:#8f8f9d;--csstools-light-dark-toggle--22:var(--csstools-color-scheme--light) #0df;--radio-checked-border-color:var(--csstools-light-dark-toggle--22, #0060df);--csstools-light-dark-toggle--23:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--button-secondary-bg-color:var(--csstools-light-dark-toggle--23, rgb(21 20 26 / .07));--button-secondary-fg-color:var(--text-primary-color);--button-secondary-border-color:var(--button-secondary-bg-color);--csstools-light-dark-toggle--24:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--button-secondary-active-bg-color:var(--csstools-light-dark-toggle--24, rgb(21 20 26 / .21));--button-secondary-active-fg-color:var(--button-secondary-fg-color);--button-secondary-active-border-color:var(--button-secondary-bg-color);--csstools-light-dark-toggle--25:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--button-secondary-hover-bg-color:var(--csstools-light-dark-toggle--25, rgb(21 20 26 / .14));--button-secondary-hover-fg-color:var(--button-secondary-fg-color);--button-secondary-hover-border-color:var(--button-secondary-hover-bg-color);--csstools-light-dark-toggle--26:var(--csstools-color-scheme--light) #0df;--button-primary-bg-color:var(--csstools-light-dark-toggle--26, #0060df);--csstools-light-dark-toggle--27:var(--csstools-color-scheme--light) #15141a;--button-primary-fg-color:var(--csstools-light-dark-toggle--27, #fbfbfe);--button-primary-border-color:var(--button-primary-bg-color);--csstools-light-dark-toggle--28:var(--csstools-color-scheme--light) #aaf2ff;--button-primary-active-bg-color:var(--csstools-light-dark-toggle--28, #054096);--button-primary-active-fg-color:var(--button-primary-fg-color);--button-primary-active-border-color:var(--button-primary-active-bg-color);--csstools-light-dark-toggle--29:var(--csstools-color-scheme--light) #80ebff;--button-primary-hover-bg-color:var(--csstools-light-dark-toggle--29, #0250bb);--button-primary-hover-fg-color:var(--button-primary-fg-color);--button-primary-hover-border-color:var(--button-primary-hover-bg-color);--button-disabled-bg-color:color-mix(in srgb, currentcolor, transparent 60%);--button-disabled-fg-color:var(--button-disabled-bg-color);--csstools-light-dark-toggle--30:var(--csstools-color-scheme--light) #42414d;--input-text-bg-color:var(--csstools-light-dark-toggle--30, white);--input-text-fg-color:var(--text-primary-color)}@supports (color: light-dark(red,red)){.dialog{--dialog-bg-color:light-dark(white, #1c1b22);--dialog-border-color:light-dark(white, #1c1b22)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.dialog{--dialog-shadow:0 2px 14px 0 light-dark(rgb(58 57 68 / .2), #15141a)}}@supports (color: light-dark(red,red)){.dialog{--text-primary-color:light-dark(#15141a, #fbfbfe);--text-secondary-color:light-dark(#5b5b66, #cfcfd8);--link-fg-color:light-dark(#0060df, #0df);--link-hover-fg-color:light-dark(#0250bb, #80ebff);--separator-color:light-dark(#f0f0f4, #52525e);--textarea-bg-color:light-dark(white, #42414d);--radio-bg-color:light-dark(#f0f0f4, #2b2a33);--radio-checked-bg-color:light-dark(#fbfbfe, #15141a);--radio-checked-border-color:light-dark(#0060df, #0df)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.dialog{--button-secondary-bg-color:light-dark( rgb(21 20 26 / .07), rgb(251 251 254 / .07) );--button-secondary-active-bg-color:light-dark( rgb(21 20 26 / .21), rgb(251 251 254 / .21) );--button-secondary-hover-bg-color:light-dark( rgb(21 20 26 / .14), rgb(251 251 254 / .14) )}}@supports (color: light-dark(red,red)){.dialog{--button-primary-bg-color:light-dark(#0060df, #0df);--button-primary-fg-color:light-dark(#fbfbfe, #15141a);--button-primary-active-bg-color:light-dark(#054096, #aaf2ff);--button-primary-hover-bg-color:light-dark(#0250bb, #80ebff);--input-text-bg-color:light-dark(white, #42414d)}}@supports not (color: light-dark(tan,tan)){.dialog *{--csstools-light-dark-toggle--11:var(--csstools-color-scheme--light) #1c1b22;--dialog-bg-color:var(--csstools-light-dark-toggle--11, white);--csstools-light-dark-toggle--12:var(--csstools-color-scheme--light) #1c1b22;--dialog-border-color:var(--csstools-light-dark-toggle--12, white);--csstools-light-dark-toggle--13:var(--csstools-color-scheme--light) #15141a;--dialog-shadow:0 2px 14px 0 var(--csstools-light-dark-toggle--13, rgb(58 57 68 / .2));--csstools-light-dark-toggle--14:var(--csstools-color-scheme--light) #fbfbfe;--text-primary-color:var(--csstools-light-dark-toggle--14, #15141a);--csstools-light-dark-toggle--15:var(--csstools-color-scheme--light) #cfcfd8;--text-secondary-color:var(--csstools-light-dark-toggle--15, #5b5b66);--csstools-light-dark-toggle--16:var(--csstools-color-scheme--light) #0df;--link-fg-color:var(--csstools-light-dark-toggle--16, #0060df);--csstools-light-dark-toggle--17:var(--csstools-color-scheme--light) #80ebff;--link-hover-fg-color:var(--csstools-light-dark-toggle--17, #0250bb);--csstools-light-dark-toggle--18:var(--csstools-color-scheme--light) #52525e;--separator-color:var(--csstools-light-dark-toggle--18, #f0f0f4);--csstools-light-dark-toggle--19:var(--csstools-color-scheme--light) #42414d;--textarea-bg-color:var(--csstools-light-dark-toggle--19, white);--csstools-light-dark-toggle--20:var(--csstools-color-scheme--light) #2b2a33;--radio-bg-color:var(--csstools-light-dark-toggle--20, #f0f0f4);--csstools-light-dark-toggle--21:var(--csstools-color-scheme--light) #15141a;--radio-checked-bg-color:var(--csstools-light-dark-toggle--21, #fbfbfe);--csstools-light-dark-toggle--22:var(--csstools-color-scheme--light) #0df;--radio-checked-border-color:var(--csstools-light-dark-toggle--22, #0060df);--csstools-light-dark-toggle--23:var(--csstools-color-scheme--light) rgb(251 251 254 / .07);--button-secondary-bg-color:var(--csstools-light-dark-toggle--23, rgb(21 20 26 / .07));--csstools-light-dark-toggle--24:var(--csstools-color-scheme--light) rgb(251 251 254 / .21);--button-secondary-active-bg-color:var(--csstools-light-dark-toggle--24, rgb(21 20 26 / .21));--csstools-light-dark-toggle--25:var(--csstools-color-scheme--light) rgb(251 251 254 / .14);--button-secondary-hover-bg-color:var(--csstools-light-dark-toggle--25, rgb(21 20 26 / .14));--csstools-light-dark-toggle--26:var(--csstools-color-scheme--light) #0df;--button-primary-bg-color:var(--csstools-light-dark-toggle--26, #0060df);--csstools-light-dark-toggle--27:var(--csstools-color-scheme--light) #15141a;--button-primary-fg-color:var(--csstools-light-dark-toggle--27, #fbfbfe);--csstools-light-dark-toggle--28:var(--csstools-color-scheme--light) #aaf2ff;--button-primary-active-bg-color:var(--csstools-light-dark-toggle--28, #054096);--csstools-light-dark-toggle--29:var(--csstools-color-scheme--light) #80ebff;--button-primary-hover-bg-color:var(--csstools-light-dark-toggle--29, #0250bb);--csstools-light-dark-toggle--30:var(--csstools-color-scheme--light) #42414d;--input-text-bg-color:var(--csstools-light-dark-toggle--30, white)}}@media (prefers-color-scheme: dark){.dialog{--hover-filter:brightness(1.4)}}@media screen and (forced-colors: active){.dialog{--dialog-bg-color:Canvas;--dialog-border-color:CanvasText;--dialog-shadow:none;--text-primary-color:CanvasText;--text-secondary-color:CanvasText;--hover-filter:none;--link-fg-color:LinkText;--link-hover-fg-color:LinkText;--separator-color:CanvasText;--textarea-border-color:ButtonBorder;--textarea-bg-color:Field;--textarea-fg-color:ButtonText;--radio-bg-color:ButtonFace;--radio-checked-bg-color:ButtonFace;--radio-border-color:ButtonText;--radio-checked-border-color:ButtonText;--button-secondary-bg-color:HighlightText;--button-secondary-fg-color:ButtonText;--button-secondary-border-color:ButtonText;--button-secondary-active-bg-color:HighlightText;--button-secondary-active-fg-color:SelectedItem;--button-secondary-active-border-color:ButtonText;--button-secondary-hover-bg-color:HighlightText;--button-secondary-hover-fg-color:SelectedItem;--button-secondary-hover-border-color:SelectedItem;--button-primary-bg-color:ButtonText;--button-primary-fg-color:HighlightText;--button-primary-border-color:ButtonText;--button-primary-active-bg-color:SelectedItem;--button-primary-active-fg-color:HighlightText;--button-primary-active-border-color:ButtonText;--button-primary-hover-bg-color:SelectedItem;--button-primary-hover-fg-color:HighlightText;--button-primary-hover-border-color:SelectedItem;--button-disabled-bg-color:GrayText;--button-disabled-fg-color:ButtonFace;--input-text-bg-color:HighlightText;--input-text-fg-color:FieldText}}.dialog{font:message-box;font-size:13px;font-weight:400;line-height:150%;border-radius:4px;padding:12px 16px;border:1px solid var(--dialog-border-color);background:var(--dialog-bg-color);color:var(--text-primary-color);box-shadow:var(--dialog-shadow)}:is(.dialog .mainContainer) *:focus-visible{outline:var(--focus-ring-outline);outline-offset:2px}:is(.dialog .mainContainer) .title{display:flex;width:auto;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:12px}:is(:is(.dialog .mainContainer) .title)>span{font-size:13px;font-style:normal;font-weight:590;line-height:150%}:is(.dialog .mainContainer) .dialogSeparator{width:100%;height:0;margin-block:4px;border-top:1px solid var(--separator-color);border-bottom:none}:is(.dialog .mainContainer) .dialogButtonsGroup{display:flex;gap:12px;align-self:flex-end}:is(.dialog .mainContainer) .radio{display:flex;flex-direction:column;align-items:flex-start;gap:4px}:is(:is(.dialog .mainContainer) .radio)>.radioButton{display:flex;gap:8px;align-self:stretch;align-items:center}:is(:is(:is(.dialog .mainContainer) .radio)>.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;width:16px;height:16px;border-radius:50%;background-color:var(--radio-bg-color);border:1px solid var(--radio-border-color)}:is(:is(:is(:is(.dialog .mainContainer) .radio)>.radioButton) input):hover{filter:var(--hover-filter)}:is(:is(:is(:is(.dialog .mainContainer) .radio)>.radioButton) input):checked{background-color:var(--radio-checked-bg-color);border:4px solid var(--radio-checked-border-color)}:is(:is(.dialog .mainContainer) .radio)>.radioLabel{display:flex;padding-inline-start:24px;align-items:flex-start;gap:10px;align-self:stretch}:is(:is(:is(.dialog .mainContainer) .radio)>.radioLabel)>span{flex:1 0 0;font-size:11px;color:var(--text-secondary-color)}:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton)){border-radius:4px;border:1px solid;font:menu;font-weight:590;font-size:13px;padding:4px 16px;width:auto;height:32px}:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):hover{cursor:pointer;filter:var(--hover-filter)}:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton)))>span{color:inherit;font:inherit}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))){color:var(--button-secondary-fg-color);background-color:var(--button-secondary-bg-color);border-color:var(--button-secondary-border-color)}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):hover{color:var(--button-secondary-hover-fg-color);background-color:var(--button-secondary-hover-bg-color);border-color:var(--button-secondary-hover-border-color)}.secondaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):active{color:var(--button-secondary-active-fg-color);background-color:var(--button-secondary-active-bg-color);border-color:var(--button-secondary-active-border-color)}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))){color:var(--button-primary-fg-color);background-color:var(--button-primary-bg-color);border-color:var(--button-primary-border-color);opacity:1}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):hover{color:var(--button-primary-hover-fg-color);background-color:var(--button-primary-hover-bg-color);border-color:var(--button-primary-hover-border-color)}.primaryButton:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):active{color:var(--button-primary-active-fg-color);background-color:var(--button-primary-active-bg-color);border-color:var(--button-primary-active-border-color)}:is(:is(.dialog .mainContainer) button:not(:is(.toggle-button,.closeButton,.clearInputButton))):disabled{color:var(--button-disabled-fg-color)!important;background-color:var(--button-disabled-bg-color);border-color:var(--button-disabled-bg-color);pointer-events:none}:is(.dialog .mainContainer) a{color:var(--link-fg-color)}:is(:is(.dialog .mainContainer) a):hover{color:var(--link-hover-fg-color)}:is(.dialog .mainContainer) textarea{font:inherit;padding:8px;resize:none;margin:0;box-sizing:border-box;border-radius:4px;border:1px solid var(--textarea-border-color);background:var(--textarea-bg-color);color:var(--textarea-fg-color)}:is(:is(.dialog .mainContainer) textarea):focus{outline-offset:0;border-color:transparent}:is(:is(.dialog .mainContainer) textarea):disabled{pointer-events:none;opacity:.4}:is(.dialog .mainContainer) input[type=text]{background-color:var(--input-text-bg-color);color:var(--input-text-fg-color)}:is(.dialog .mainContainer) .messageBar{--csstools-light-dark-toggle--31:var(--csstools-color-scheme--light) #5a3100;--message-bar-bg-color:var(--csstools-light-dark-toggle--31, #ffebcd);--csstools-light-dark-toggle--32:var(--csstools-color-scheme--light) #fbfbfe;--message-bar-fg-color:var(--csstools-light-dark-toggle--32, #15141a);--csstools-light-dark-toggle--33:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--33, rgb(0 0 0 / .08));--message-bar-icon:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M14.8748 12.037L9.37782 2.037C8.99682 1.346 8.31082 1 7.62482 1C6.93882 1 6.25282 1.346 5.87282 2.037L0.375823 12.037C-0.358177 13.37 0.606823 15 2.12782 15H13.1228C14.6428 15 15.6078 13.37 14.8748 12.037ZM8.24982 11.75L7.99982 12H7.24982L6.99982 11.75V11L7.24982 10.75H7.99982L8.24982 11V11.75ZM8.24982 9.062C8.24982 9.22776 8.18398 9.38673 8.06677 9.50394C7.94955 9.62115 7.79058 9.687 7.62482 9.687C7.45906 9.687 7.30009 9.62115 7.18288 9.50394C7.06567 9.38673 6.99982 9.22776 6.99982 9.062V5.625C6.99982 5.45924 7.06567 5.30027 7.18288 5.18306C7.30009 5.06585 7.45906 5 7.62482 5C7.79058 5 7.94955 5.06585 8.06677 5.18306C8.18398 5.30027 8.24982 5.45924 8.24982 5.625V9.062Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");--csstools-light-dark-toggle--34:var(--csstools-color-scheme--light) #e49c49;--message-bar-icon-color:var(--csstools-light-dark-toggle--34, #cd411e)}@supports (color: light-dark(red,red)){:is(.dialog .mainContainer) .messageBar{--message-bar-bg-color:light-dark(#ffebcd, #5a3100);--message-bar-fg-color:light-dark(#15141a, #fbfbfe)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){:is(.dialog .mainContainer) .messageBar{--message-bar-border-color:light-dark( rgb(0 0 0 / .08), rgb(255 255 255 / .08) )}}@supports (color: light-dark(red,red)){:is(.dialog .mainContainer) .messageBar{--message-bar-icon-color:light-dark(#cd411e, #e49c49)}}@supports not (color: light-dark(tan,tan)){:is(:is(.dialog .mainContainer) .messageBar) *{--csstools-light-dark-toggle--31:var(--csstools-color-scheme--light) #5a3100;--message-bar-bg-color:var(--csstools-light-dark-toggle--31, #ffebcd);--csstools-light-dark-toggle--32:var(--csstools-color-scheme--light) #fbfbfe;--message-bar-fg-color:var(--csstools-light-dark-toggle--32, #15141a);--csstools-light-dark-toggle--33:var(--csstools-color-scheme--light) rgb(255 255 255 / .08);--message-bar-border-color:var(--csstools-light-dark-toggle--33, rgb(0 0 0 / .08));--csstools-light-dark-toggle--34:var(--csstools-color-scheme--light) #e49c49;--message-bar-icon-color:var(--csstools-light-dark-toggle--34, #cd411e)}}@media screen and (forced-colors: active){:is(.dialog .mainContainer) .messageBar{--message-bar-bg-color:HighlightText;--message-bar-fg-color:CanvasText;--message-bar-border-color:CanvasText;--message-bar-icon-color:CanvasText}}:is(.dialog .mainContainer) .messageBar{align-self:stretch}:is(:is(:is(.dialog .mainContainer) .messageBar)>div):before,:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div{margin-block:4px}:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div{display:flex;flex-direction:column;align-items:flex-start;gap:8px;flex:1 0 0}:is(:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div) .title{font-size:13px;font-weight:590}:is(:is(:is(:is(.dialog .mainContainer) .messageBar)>div)>div) .description{font-size:13px}:is(.dialog .mainContainer) .toggler{display:flex;align-items:center;gap:8px;align-self:stretch}:is(:is(.dialog .mainContainer) .toggler)>.togglerLabel{-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:clip;opacity:1;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:CanvasText;z-index:0}.textLayer.highlighting{touch-action:none}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%}.textLayer>:not(.markedContent),.textLayer .markedContent span:not(.markedContent){z-index:1}.textLayer span.markedContent{top:0;height:0}.textLayer span[role=img]{-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default}.textLayer .highlight{--highlight-bg-color:rgb(180 0 170 / .25);--highlight-selected-bg-color:rgb(0 100 0 / .25);--highlight-backdrop-filter:none;--highlight-selected-backdrop-filter:none}@media screen and (forced-colors: active){.textLayer .highlight{--highlight-bg-color:transparent;--highlight-selected-bg-color:transparent;--highlight-backdrop-filter:var(--hcm-highlight-filter);--highlight-selected-backdrop-filter:var( --hcm-highlight-selected-filter )}}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);-webkit-backdrop-filter:var(--highlight-backdrop-filter);backdrop-filter:var(--highlight-backdrop-filter);border-radius:4px}.appended:is(.textLayer .highlight){position:initial}.begin:is(.textLayer .highlight){border-radius:4px 0 0 4px}.end:is(.textLayer .highlight){border-radius:0 4px 4px 0}.middle:is(.textLayer .highlight){border-radius:0}.selected:is(.textLayer .highlight){background-color:var(--highlight-selected-bg-color);-webkit-backdrop-filter:var(--highlight-selected-backdrop-filter);backdrop-filter:var(--highlight-selected-backdrop-filter)}.textLayer ::-moz-selection{background:rgba(0,0,255,.25);background:color-mix(in srgb,AccentColor,transparent 75%)}.textLayer ::selection{background:rgba(0,0,255,.25);background:color-mix(in srgb,AccentColor,transparent 75%)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:0;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer.selecting .endOfContent{top:0}.annotationLayer{--csstools-color-scheme--light:initial;color-scheme:only light;--annotation-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width=\'1px\' height=\'1px\' xmlns=\'http://www.w3.org/2000/svg\'><rect width=\'100%\' height=\'100%\' style=\'fill:rgba(0, 54, 255, 0.13);\'/></svg>");--input-focus-border-color:Highlight;--input-focus-outline:1px solid Canvas;--input-unfocused-border-color:transparent;--input-disabled-border-color:transparent;--input-hover-border-color:black;--link-outline:none}@media screen and (forced-colors: active){.annotationLayer{--input-focus-border-color:CanvasText;--input-unfocused-border-color:ActiveText;--input-disabled-border-color:GrayText;--input-hover-border-color:Highlight;--link-outline:1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation{outline:var(--link-outline)}:is(.annotationLayer .linkAnnotation):hover{-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter)}:is(.annotationLayer .linkAnnotation)>a:hover{opacity:0!important;background:none!important;box-shadow:none}.annotationLayer .popupAnnotation .popup{outline:calc(1.5px * var(--total-scale-factor)) solid CanvasText!important;background-color:ButtonFace!important;color:ButtonText!important}.annotationLayer .highlightArea:hover:after{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter);content:"";pointer-events:none}.annotationLayer .popupAnnotation.focused .popup{outline:calc(3px * var(--total-scale-factor)) solid Highlight!important}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer.disabled section,.annotationLayer.disabled .popup{pointer-events:none}.annotationLayer .annotationContent{position:absolute;width:100%;height:100%;pointer-events:none}.freetext:is(.annotationLayer .annotationContent){background:transparent;border:none;top:0;right:0;bottom:0;left:0;overflow:visible;white-space:nowrap;font:10px sans-serif;line-height:1.35}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}:is(.annotationLayer section):has(div.annotationContent) canvas.annotationContent{display:none}.textLayer.selecting~.annotationLayer section{pointer-events:none}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton):not(.hasBorder)>a:hover{opacity:.2;background-color:#ff0;box-shadow:0 2px 10px #ff0}.annotationLayer .linkAnnotation.hasBorder:hover{background-color:rgba(255,255,0,.2)}.annotationLayer .hasBorder{background-size:100% 100%}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--total-scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation [disabled]:is(input,textarea),.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:25%;top:25%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{height:100%;width:100%}.annotationLayer .popupAnnotation{position:absolute;font-size:calc(9px * var(--total-scale-factor));pointer-events:none;width:-moz-max-content;width:max-content;max-width:45%;height:auto}.annotationLayer .popup{background-color:#ff9;color:#000;box-shadow:0 calc(2px * var(--total-scale-factor)) calc(5px * var(--total-scale-factor)) #888;border-radius:calc(2px * var(--total-scale-factor));outline:1.5px solid rgb(255 255 74);padding:calc(6px * var(--total-scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto;-webkit-user-select:text;-moz-user-select:text;user-select:text}.annotationLayer .popupAnnotation.focused .popup{outline-width:3px}.annotationLayer .popup *{font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popup>.header{display:inline-block}.annotationLayer .popup>.header h1{display:inline}.annotationLayer .popup>.header .popupDate{display:inline-block;margin-left:calc(5px * var(--total-scale-factor));width:-moz-fit-content;width:fit-content}.annotationLayer .popupContent{border-top:1px solid rgb(51 51 51);margin-top:calc(2px * var(--total-scale-factor));padding-top:calc(2px * var(--total-scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popupTriggerArea{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}:is(.annotationLayer .annotationTextContent) span{width:100%;display:inline-block}.annotationLayer svg.quadrilateralsContainer{contain:strict;width:0;height:0;position:absolute;top:0;left:0;z-index:-1}:root{--xfa-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width=\'1px\' height=\'1px\' xmlns=\'http://www.w3.org/2000/svg\'><rect width=\'100%\' height=\'100%\' style=\'fill:rgba(0, 54, 255, 0.13);\'/></svg>");--xfa-focus-outline:auto}@media screen and (forced-colors: active){:root{--xfa-focus-outline:2px solid CanvasText}.xfaLayer *:required{outline:1.5px solid selectedItem}}.xfaLayer{--csstools-color-scheme--light:initial;color-scheme:only light;background-color:transparent}.xfaLayer .highlight{margin:-1px;padding:1px;background-color:#efcbed;border-radius:4px}.xfaLayer .highlight.appended{position:initial}.xfaLayer .highlight.begin{border-radius:4px 0 0 4px}.xfaLayer .highlight.end{border-radius:0 4px 4px 0}.xfaLayer .highlight.middle{border-radius:0}.xfaLayer .highlight.selected{background-color:#cbdfcb}.xfaPage{overflow:hidden;position:relative}.xfaContentarea{position:absolute}.xfaPrintOnly{display:none}.xfaLayer{position:absolute;text-align:initial;top:0;left:0;transform-origin:0 0;line-height:1.2}.xfaLayer *{color:inherit;font:inherit;font-style:inherit;font-weight:inherit;font-kerning:inherit;letter-spacing:-.01px;text-align:inherit;text-decoration:inherit;box-sizing:border-box;background-color:transparent;padding:0;margin:0;pointer-events:auto;line-height:inherit}.xfaLayer *:required{outline:1.5px solid red}.xfaLayer div,.xfaLayer svg,.xfaLayer svg *{pointer-events:none}.xfaLayer a{color:#00f}.xfaRich li{margin-left:3em}.xfaFont{color:#000;font-weight:400;font-kerning:none;font-size:10px;font-style:normal;letter-spacing:0;text-decoration:none;vertical-align:0}.xfaCaption{overflow:hidden;flex:0 0 auto}.xfaCaptionForCheckButton{overflow:hidden;flex:1 1 auto}.xfaLabel{height:100%;width:100%}.xfaLeft{display:flex;flex-direction:row;align-items:center}.xfaRight{display:flex;flex-direction:row-reverse;align-items:center}:is(.xfaLeft,.xfaRight)>:is(.xfaCaption,.xfaCaptionForCheckButton){max-height:100%}.xfaTop{display:flex;flex-direction:column;align-items:flex-start}.xfaBottom{display:flex;flex-direction:column-reverse;align-items:flex-start}:is(.xfaTop,.xfaBottom)>:is(.xfaCaption,.xfaCaptionForCheckButton){width:100%}.xfaBorder{background-color:transparent;position:absolute;pointer-events:none}.xfaWrapped{width:100%;height:100%}:is(.xfaTextfield,.xfaSelect):focus{background-image:none;background-color:transparent;outline:var(--xfa-focus-outline);outline-offset:-1px}:is(.xfaCheckbox,.xfaRadio):focus{outline:var(--xfa-focus-outline)}.xfaTextfield,.xfaSelect{height:100%;width:100%;flex:1 1 auto;border:none;resize:none;background-image:var(--xfa-unfocused-field-background)}.xfaSelect{padding-inline:2px}:is(.xfaTop,.xfaBottom)>:is(.xfaTextfield,.xfaSelect){flex:0 1 auto}.xfaButton{cursor:pointer;width:100%;height:100%;border:none;text-align:center}.xfaLink{width:100%;height:100%;position:absolute;top:0;left:0}.xfaCheckbox,.xfaRadio{width:100%;height:100%;flex:0 0 auto;border:none}.xfaRich{white-space:pre-wrap;width:100%;height:100%}.xfaImage{-o-object-position:left top;object-position:left top;-o-object-fit:contain;object-fit:contain;width:100%;height:100%}.xfaLrTb,.xfaRlTb,.xfaTb{display:flex;flex-direction:column;align-items:stretch}.xfaLr{display:flex;flex-direction:row;align-items:stretch}.xfaRl{display:flex;flex-direction:row-reverse;align-items:stretch}.xfaTb>div{justify-content:left}.xfaPosition,.xfaArea{position:relative}.xfaValignMiddle{display:flex;align-items:center}.xfaTable{display:flex;flex-direction:column;align-items:stretch}.xfaTable .xfaRow{display:flex;flex-direction:row;align-items:stretch}.xfaTable .xfaRlRow{display:flex;flex-direction:row-reverse;align-items:stretch;flex:1}.xfaTable .xfaRlRow>div{flex:1}:is(.xfaNonInteractive,.xfaDisabled,.xfaReadOnly) :is(input,textarea){background:initial}@media print{.xfaTextfield,.xfaSelect{background:transparent}.xfaSelect{-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:1px;text-overflow:""}}.canvasWrapper svg{transform:none}.moving:is(.canvasWrapper svg){z-index:100000}[data-main-rotation="90"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) mask,[data-main-rotation="90"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) use:not(.clip,.mask){transform:matrix(0,1,-1,0,1,0)}[data-main-rotation="180"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) mask,[data-main-rotation="180"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) use:not(.clip,.mask){transform:matrix(-1,0,0,-1,1,1)}[data-main-rotation="270"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) mask,[data-main-rotation="270"]:is(.highlight:is(.canvasWrapper svg),.highlightOutline:is(.canvasWrapper svg)) use:not(.clip,.mask){transform:matrix(0,-1,1,0,0,1)}.draw:is(.canvasWrapper svg){position:absolute;mix-blend-mode:normal}.draw[data-draw-rotation="90"]:is(.canvasWrapper svg){transform:rotate(90deg)}.draw[data-draw-rotation="180"]:is(.canvasWrapper svg){transform:rotate(180deg)}.draw[data-draw-rotation="270"]:is(.canvasWrapper svg){transform:rotate(270deg)}.highlight:is(.canvasWrapper svg){--blend-mode:multiply}@media screen and (forced-colors: active){.highlight:is(.canvasWrapper svg){--blend-mode:difference}}.highlight:is(.canvasWrapper svg){position:absolute;mix-blend-mode:var(--blend-mode)}.highlight:is(.canvasWrapper svg):not(.free){fill-rule:evenodd}.highlightOutline:is(.canvasWrapper svg){position:absolute;mix-blend-mode:normal;fill-rule:evenodd;fill:none}.highlightOutline.hovered:is(.canvasWrapper svg):not(.free):not(.selected){stroke:var(--hover-outline-color);stroke-width:var(--outline-width)}.highlightOutline.selected:is(.canvasWrapper svg):not(.free) .mainOutline{stroke:var(--outline-around-color);stroke-width:calc(var(--outline-width) + 2 * var(--outline-around-width))}.highlightOutline.selected:is(.canvasWrapper svg):not(.free) .secondaryOutline{stroke:var(--outline-color);stroke-width:var(--outline-width)}.highlightOutline.free.hovered:is(.canvasWrapper svg):not(.selected){stroke:var(--hover-outline-color);stroke-width:calc(2 * var(--outline-width))}.highlightOutline.free.selected:is(.canvasWrapper svg) .mainOutline{stroke:var(--outline-around-color);stroke-width:calc(2 * (var(--outline-width) + var(--outline-around-width)))}.highlightOutline.free.selected:is(.canvasWrapper svg) .secondaryOutline{stroke:var(--outline-color);stroke-width:calc(2 * var(--outline-width))}.toggle-button{--button-background-color:color-mix(in srgb, currentColor 7%, transparent);--button-background-color-hover:color-mix( in srgb, currentColor 14%, transparent );--button-background-color-active:color-mix( in srgb, currentColor 21%, transparent );--csstools-light-dark-toggle--35:var(--csstools-color-scheme--light) #0df;--color-accent-primary:var(--csstools-light-dark-toggle--35, #0060df);--csstools-light-dark-toggle--36:var(--csstools-color-scheme--light) #80ebff;--color-accent-primary-hover:var(--csstools-light-dark-toggle--36, #0250bb);--csstools-light-dark-toggle--37:var(--csstools-color-scheme--light) #aaf2ff;--color-accent-primary-active:var(--csstools-light-dark-toggle--37, #054096);--border-radius-circle:9999px;--border-width:1px;--size-item-small:16px;--size-item-large:32px;--csstools-light-dark-toggle--38:var(--csstools-color-scheme--light) #1c1b22;--color-canvas:var(--csstools-light-dark-toggle--38, white);--background-color-canvas:var(--color-canvas);--csstools-light-dark-toggle--39:var(--csstools-color-scheme--light) #f9f9fa;--border-color-interactive:var(--csstools-light-dark-toggle--39, #8f8f9d);--border-color-interactive-hover:var(--border-color-interactive);--border-color-interactive-active:var(--border-color-interactive)}@supports (color: light-dark(red,red)){.toggle-button{--color-accent-primary:light-dark(#0060df, #0df);--color-accent-primary-hover:light-dark(#0250bb, #80ebff);--color-accent-primary-active:light-dark(#054096, #aaf2ff);--color-canvas:light-dark(white, #1c1b22);--border-color-interactive:light-dark(#8f8f9d, #f9f9fa)}}@supports not (color: light-dark(tan,tan)){.toggle-button *{--csstools-light-dark-toggle--35:var(--csstools-color-scheme--light) #0df;--color-accent-primary:var(--csstools-light-dark-toggle--35, #0060df);--csstools-light-dark-toggle--36:var(--csstools-color-scheme--light) #80ebff;--color-accent-primary-hover:var(--csstools-light-dark-toggle--36, #0250bb);--csstools-light-dark-toggle--37:var(--csstools-color-scheme--light) #aaf2ff;--color-accent-primary-active:var(--csstools-light-dark-toggle--37, #054096);--csstools-light-dark-toggle--38:var(--csstools-color-scheme--light) #1c1b22;--color-canvas:var(--csstools-light-dark-toggle--38, white);--csstools-light-dark-toggle--39:var(--csstools-color-scheme--light) #f9f9fa;--border-color-interactive:var(--csstools-light-dark-toggle--39, #8f8f9d)}}@media (forced-colors: active){.toggle-button{--color-accent-primary:ButtonText;--color-accent-primary-hover:SelectedItem;--color-accent-primary-active:SelectedItem;--button-background-color:ButtonFace;--border-color-interactive:ButtonText;--border-color-interactive-hover:SelectedItem;--border-color-interactive-active:ButtonText;--color-canvas:ButtonText;--background-color-canvas:Canvas}}.toggle-button{--toggle-background-color:var(--button-background-color);--toggle-background-color-hover:var(--button-background-color-hover);--toggle-background-color-active:var(--button-background-color-active);--toggle-background-color-pressed:var(--color-accent-primary);--toggle-background-color-pressed-hover:var(--color-accent-primary-hover);--toggle-background-color-pressed-active:var(--color-accent-primary-active);--toggle-border-color:var(--border-color-interactive);--toggle-border-color-hover:var(--toggle-border-color);--toggle-border-color-active:var(--toggle-border-color);--toggle-border-radius:var(--border-radius-circle);--toggle-border-width:var(--border-width);--toggle-height:var(--size-item-small);--toggle-width:var(--size-item-large);--toggle-dot-background-color:var(--toggle-border-color);--toggle-dot-background-color-hover:var(--toggle-dot-background-color);--toggle-dot-background-color-active:var(--toggle-dot-background-color);--toggle-dot-background-color-on-pressed:var(--background-color-canvas);--toggle-dot-margin:1px;--toggle-dot-height:calc( var(--toggle-height) - 2 * var(--toggle-dot-margin) - 2 * var(--toggle-border-width) );--toggle-dot-width:var(--toggle-dot-height);--toggle-dot-transform-x:calc( var(--toggle-width) - 4 * var(--toggle-dot-margin) - var(--toggle-dot-width) );--input-width:var(--toggle-width);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:var(--toggle-border-width) solid var(--toggle-border-color);height:var(--toggle-height);width:var(--toggle-width);border-radius:var(--toggle-border-radius);background-color:var(--toggle-background-color);box-sizing:border-box}.toggle-button:focus-visible{outline:var(--focus-outline);outline-offset:var(--focus-outline-offset)}.toggle-button:enabled:hover{background-color:var(--toggle-background-color-hover);border-color:var(--toggle-border-color)}.toggle-button:enabled:hover:active{background-color:var(--toggle-background-color-active);border-color:var(--toggle-border-color)}.toggle-button:before{display:block;content:"";background-color:var(--toggle-dot-background-color);height:var(--toggle-dot-height);width:var(--toggle-dot-width);margin:var(--toggle-dot-margin);border-radius:var(--toggle-border-radius);translate:0}.toggle-button[aria-pressed=true]{background-color:var(--toggle-background-color-pressed);border-color:transparent}.toggle-button[aria-pressed=true]:enabled:hover{background-color:var(--toggle-background-color-pressed-hover);border-color:transparent}.toggle-button[aria-pressed=true]:enabled:hover:active{background-color:var(--toggle-background-color-pressed-active);border-color:transparent}.toggle-button[aria-pressed=true]:before{translate:var(--toggle-dot-transform-x);background-color:var(--toggle-dot-background-color-on-pressed)}.toggle-button[aria-pressed=true]:enabled:hover:before,.toggle-button[aria-pressed=true]:enabled:hover:active:before{background-color:var(--toggle-dot-background-color-on-pressed)}.toggle-button[aria-pressed=true]:-moz-locale-dir(rtl):before,[dir=rtl] .toggle-button[aria-pressed=true]:before{translate:calc(-1 * var(--toggle-dot-transform-x))}@media (prefers-reduced-motion: no-preference){.toggle-button:before{transition:translate .1s}}@media (prefers-contrast){.toggle-button:enabled:hover{border-color:var(--toggle-border-color-hover)}.toggle-button:enabled:hover:active{border-color:var(--toggle-border-color-active)}.toggle-button[aria-pressed=true]:enabled{border-color:var(--toggle-border-color);position:relative}.toggle-button[aria-pressed=true]:enabled:hover{border-color:var(--toggle-border-color-hover)}.toggle-button[aria-pressed=true]:enabled:hover:active{background-color:var(--toggle-dot-background-color-active);border-color:var(--toggle-dot-background-color-hover)}.toggle-button:enabled:hover:before,.toggle-button:enabled:hover:active:before{background-color:var(--toggle-dot-background-color-hover)}}@media (forced-colors){.toggle-button{--toggle-dot-background-color:var(--color-accent-primary);--toggle-dot-background-color-hover:var(--color-accent-primary-hover);--toggle-dot-background-color-active:var(--color-accent-primary-active);--toggle-dot-background-color-on-pressed:var(--button-background-color);--toggle-border-color-hover:var(--border-color-interactive-hover);--toggle-border-color-active:var(--border-color-interactive-active)}.toggle-button[aria-pressed=true]:enabled:after{border:1px solid var(--button-background-color);content:"";position:absolute;height:var(--toggle-height);width:var(--toggle-width);display:block;border-radius:var(--toggle-border-radius);top:-2px;right:-2px;bottom:-2px;left:-2px}.toggle-button[aria-pressed=true]:enabled:hover:active:after{border-color:var(--toggle-border-color-active)}}:root{--clear-signature-button-icon:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M11 3H13.6C14 3 14.3 3.3 14.3 3.6C14.3 3.9 14 4.2 13.7 4.2H13.3V14C13.3 15.1 12.4 16 11.3 16H4.80005C3.70005 16 2.80005 15.1 2.80005 14V4.2H2.40005C2.00005 4.2 1.80005 4 1.80005 3.6C1.80005 3.2 2.00005 3 2.40005 3H5.00005V2C5.00005 0.9 5.90005 0 7.00005 0H9.00005C10.1 0 11 0.9 11 2V3ZM6.90005 1.2L6.30005 1.8V3H9.80005V1.8L9.20005 1.2H6.90005ZM11.4 14.7L12 14.1V4.2H4.00005V14.1L4.60005 14.7H11.4ZM7.00005 12.4C7.00005 12.7 6.70005 13 6.40005 13C6.10005 13 5.80005 12.7 5.80005 12.4V7.6C5.70005 7.3 6.00005 7 6.40005 7C6.80005 7 7.00005 7.3 7.00005 7.6V12.4ZM10.2001 12.4C10.2001 12.7 9.90006 13 9.60006 13C9.30006 13 9.00006 12.7 9.00006 12.4V7.6C9.00006 7.3 9.30006 7 9.60006 7C9.90006 7 10.2001 7.3 10.2001 7.6V12.4Z%22 fill%3D%22black%22 %2F%3E%3C%2Fsvg%3E");--csstools-light-dark-toggle--40:var(--csstools-color-scheme--light) #2b2a33;--signature-bg:var(--csstools-light-dark-toggle--40, #f9f9fb);--csstools-light-dark-toggle--41:var(--csstools-color-scheme--light) var(--signature-bg);--signature-hover-bg:var(--csstools-light-dark-toggle--41, #f0f0f4);--button-signature-bg:transparent;--button-signature-color:var(--main-color);--csstools-light-dark-toggle--42:var(--csstools-color-scheme--light) #5b5b66;--button-signature-active-bg:var(--csstools-light-dark-toggle--42, #cfcfd8);--button-signature-active-border:none;--button-signature-active-color:var(--button-signature-color);--button-signature-border:none;--csstools-light-dark-toggle--43:var(--csstools-color-scheme--light) #52525e;--button-signature-hover-bg:var(--csstools-light-dark-toggle--43, #e0e0e6);--button-signature-hover-color:var(--button-signature-color)}@supports (color: light-dark(red,red)){:root{--signature-bg:light-dark(#f9f9fb, #2b2a33);--signature-hover-bg:light-dark(#f0f0f4, var(--signature-bg));--button-signature-active-bg:light-dark(#cfcfd8, #5b5b66);--button-signature-hover-bg:light-dark(#e0e0e6, #52525e)}}@supports not (color: light-dark(tan,tan)){:root *{--csstools-light-dark-toggle--40:var(--csstools-color-scheme--light) #2b2a33;--signature-bg:var(--csstools-light-dark-toggle--40, #f9f9fb);--csstools-light-dark-toggle--41:var(--csstools-color-scheme--light) var(--signature-bg);--signature-hover-bg:var(--csstools-light-dark-toggle--41, #f0f0f4);--csstools-light-dark-toggle--42:var(--csstools-color-scheme--light) #5b5b66;--button-signature-active-bg:var(--csstools-light-dark-toggle--42, #cfcfd8);--csstools-light-dark-toggle--43:var(--csstools-color-scheme--light) #52525e;--button-signature-hover-bg:var(--csstools-light-dark-toggle--43, #e0e0e6)}}@media screen and (forced-colors: active){:root{--signature-bg:HighlightText;--signature-hover-bg:var(--signature-bg);--button-signature-bg:HighlightText;--button-signature-color:ButtonText;--button-signature-active-bg:ButtonText;--button-signature-active-color:HighlightText;--button-signature-border:1px solid ButtonText;--button-signature-hover-bg:Highlight;--button-signature-hover-color:HighlightText}}.signatureDialog{--primary-color:var(--text-primary-color);--border-color:#8f8f9d;--open-link-fg:var(--link-fg-color);--open-link-hover-fg:var(--link-hover-fg-color)}@media screen and (forced-colors: active){.signatureDialog{--primary-color:ButtonText;--border-color:ButtonText;--open-link-fg:ButtonText;--open-link-hover-fg:ButtonText}}.signatureDialog{width:570px;max-width:100%;min-width:300px;padding:16px 0}.signatureDialog .mainContainer{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:12px}:is(.signatureDialog .mainContainer) span:not([role=sectionhead]){font-size:13px;font-style:normal;font-weight:400;line-height:normal}:is(.signatureDialog .mainContainer) .title{margin-inline-start:16px}.signatureDialog .inputWithClearButton{--button-dimension:24px;--clear-button-icon:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M7.85822 8.84922L4.85322 11.8542C4.75891 11.9453 4.63261 11.9957 4.50151 11.9946C4.37042 11.9934 4.24501 11.9408 4.15231 11.8481C4.0596 11.7554 4.00702 11.63 4.00588 11.4989C4.00474 11.3678 4.05514 11.2415 4.14622 11.1472L7.15122 8.14222V7.85922L4.14622 4.85322C4.05514 4.75891 4.00474 4.63261 4.00588 4.50151C4.00702 4.37042 4.0596 4.24501 4.15231 4.15231C4.24501 4.0596 4.37042 4.00702 4.50151 4.00588C4.63261 4.00474 4.75891 4.05514 4.85322 4.14622L7.85822 7.15122H8.14122L11.1462 4.14622C11.2405 4.05514 11.3668 4.00474 11.4979 4.00588C11.629 4.00702 11.7544 4.0596 11.8471 4.15231C11.9398 4.24501 11.9924 4.37042 11.9936 4.50151C11.9947 4.63261 11.9443 4.75891 11.8532 4.85322L8.84822 7.85922V8.14222L11.8532 11.1472C11.9443 11.2415 11.9947 11.3678 11.9936 11.4989C11.9924 11.63 11.9398 11.7554 11.8471 11.8481C11.7544 11.9408 11.629 11.9934 11.4979 11.9946C11.3668 11.9957 11.2405 11.9453 11.1462 11.8542L8.14122 8.84922L8.14222 8.85022L7.85822 8.84922Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");width:100%;position:relative;display:flex;align-items:center;justify-content:center}:is(.signatureDialog .inputWithClearButton)>input{width:100%;height:32px;padding-inline:8px calc(4px + var(--button-dimension));box-sizing:border-box;border-radius:4px;border:1px solid var(--border-color)}:is(.signatureDialog .inputWithClearButton) .clearInputButton{position:absolute;inset-block-start:4px;inset-inline-end:4px;display:inline-block;width:var(--button-dimension);height:var(--button-dimension);background-color:var(--input-text-fg-color);-webkit-mask-size:cover;mask-size:cover;-webkit-mask-image:var(--clear-button-icon);mask-image:var(--clear-button-icon);padding:0;border:0}#addSignatureDialog{--secondary-color:var(--text-secondary-color);--bg-hover:#e0e0e6;--tab-top-line-active-color:#0060df;--tab-top-line-active-hover-color:var(--tab-text-hover-color);--tab-top-line-hover-color:#8f8f9d;--tab-top-line-inactive-color:#cfcfd8;--tab-bottom-line-active-color:var(--tab-top-line-inactive-color);--tab-bottom-line-hover-color:var(--tab-top-line-inactive-color);--tab-bottom-line-inactive-color:var(--tab-top-line-inactive-color);--tab-bg:var(--dialog-bg-color);--tab-bg-active-color:var(--tab-bg);--tab-bg-active-hover-color:var(--bg-hover);--tab-bg-hover:var(--bg-hover);--tab-panel-border:none;--tab-panel-border-radius:4px;--tab-text-color:var(--primary-color);--tab-text-active-color:var(--tab-top-line-active-color);--tab-text-active-hover-color:var(--tab-text-hover-color);--tab-text-hover-color:var(--tab-text-color);--signature-placeholder-color:var(--secondary-color);--signature-draw-placeholder-color:var(--primary-color);--signature-color:var(--primary-color);--clear-signature-button-border-width:0;--clear-signature-button-border-style:solid;--clear-signature-button-border-color:transparent;--clear-signature-button-border-disabled-color:transparent;--clear-signature-button-color:var(--primary-color);--clear-signature-button-hover-color:var(--clear-signature-button-color);--clear-signature-button-active-color:var(--clear-signature-button-color);--clear-signature-button-disabled-color:var(--clear-signature-button-color);--clear-signature-button-focus-color:var(--clear-signature-button-color);--clear-signature-button-bg:var(--dialog-bg-color);--clear-signature-button-bg-hover:var(--bg-hover);--clear-signature-button-bg-active:#cfcfd8;--clear-signature-button-bg-focus:#f0f0f4;--clear-signature-button-bg-disabled:color-mix( in srgb, #f0f0f4, transparent 40% );--save-warning-color:var(--secondary-color);--thickness-bg:var(--dialog-bg-color);--thickness-label-color:var(--primary-color);--thickness-slider-color:var(--primary-color);--thickness-border:none;--draw-cursor:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M0.0189877 13.6645L0.612989 10.4635C0.687989 10.0545 0.884989 9.6805 1.18099 9.3825L9.98199 0.5805C10.756 -0.1925 12.015 -0.1945 12.792 0.5805L14.42 2.2085C15.194 2.9835 15.194 4.2435 14.42 5.0185L5.61599 13.8215C5.31999 14.1165 4.94599 14.3125 4.53799 14.3875L1.33599 14.9815C1.26599 14.9935 1.19799 15.0005 1.12999 15.0005C0.832989 15.0005 0.544988 14.8835 0.330988 14.6695C0.0679874 14.4055 -0.0490122 14.0305 0.0189877 13.6645Z%22 fill%3D%22white%22%2F%3E%3Cpath d%3D%22M0.0189877 13.6645L0.612989 10.4635C0.687989 10.0545 0.884989 9.6805 1.18099 9.3825L9.98199 0.5805C10.756 -0.1925 12.015 -0.1945 12.792 0.5805L14.42 2.2085C15.194 2.9835 15.194 4.2435 14.42 5.0185L5.61599 13.8215C5.31999 14.1165 4.94599 14.3125 4.53799 14.3875L1.33599 14.9815C1.26599 14.9935 1.19799 15.0005 1.12999 15.0005C0.832989 15.0005 0.544988 14.8835 0.330988 14.6695C0.0679874 14.4055 -0.0490122 14.0305 0.0189877 13.6645ZM12.472 5.1965L13.632 4.0365L13.631 3.1885L11.811 1.3675L10.963 1.3685L9.80299 2.5285L12.472 5.1965ZM4.31099 13.1585C4.47099 13.1285 4.61799 13.0515 4.73399 12.9345L11.587 6.0815L8.91899 3.4135L2.06599 10.2655C1.94899 10.3835 1.87199 10.5305 1.84099 10.6915L1.36699 13.2485L1.75199 13.6335L4.31099 13.1585Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") 0 16, pointer}@media (prefers-color-scheme: dark){#addSignatureDialog{--dialog-bg-color:#42414d;--bg-hover:#52525e;--primary-color:#fbfbfe;--secondary-color:#cfcfd8;--tab-top-line-active-color:#0df;--tab-top-line-inactive-color:#8f8f9d;--clear-signature-button-bg-active:#5b5b66;--clear-signature-button-bg-focus:#2b2a33;--clear-signature-button-bg-disabled:color-mix( in srgb, #2b2a33, transparent 40% )}}@media screen and (forced-colors: active){#addSignatureDialog{--secondary-color:ButtonText;--bg:HighlightText;--bg-hover:var(--bg);--tab-top-line-active-color:ButtonText;--tab-top-line-active-hover-color:HighlightText;--tab-top-line-hover-color:SelectedItem;--tab-top-line-inactive-color:ButtonText;--tab-bottom-line-active-color:var(--tab-top-line-active-color);--tab-bottom-line-hover-color:var(--tab-top-line-hover-color);--tab-bg:var(--bg);--tab-bg-active-color:SelectedItem;--tab-bg-active-hover-color:SelectedItem;--tab-panel-border:1px solid ButtonText;--tab-panel-border-radius:8px;--tab-text-color:ButtonText;--tab-text-active-color:HighlightText;--tab-text-active-hover-color:HighlightText;--tab-text-hover-color:SelectedItem;--signature-color:ButtonText;--clear-signature-button-border-width:1px;--clear-signature-button-border-style:solid;--clear-signature-button-border-color:ButtonText;--clear-signature-button-border-disabled-color:GrayText;--clear-signature-button-color:ButtonText;--clear-signature-button-hover-color:HighlightText;--clear-signature-button-active-color:SelectedItem;--clear-signature-button-focus-color:CanvasText;--clear-signature-button-disabled-color:GrayText;--clear-signature-button-bg:var(--bg);--clear-signature-button-bg-hover:SelectedItem;--clear-signature-button-bg-active:var(--bg);--clear-signature-button-bg-focus:var(--bg);--clear-signature-button-bg-disabled:var(--bg);--thickness-bg:Canvas;--thickness-label-color:CanvasText;--thickness-slider-color:ButtonText;--thickness-border:1px solid var(--border-color)}}#addSignatureDialog #addSignatureDialogLabel{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;width:0;height:0}#addSignatureDialog.waiting:after{content:"";cursor:wait;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}:is(#addSignatureDialog .mainContainer) [role=tablist]{width:100%;display:flex;align-items:flex-start;gap:0}:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]{flex:1 0 0;align-self:stretch;background-color:var(--tab-bg);padding-inline:0;cursor:default;border-inline:0;border-block-width:1px;border-block-style:solid;border-block-start-color:var(--tab-top-line-inactive-color);border-block-end-color:var(--tab-bottom-line-inactive-color);border-radius:0;font:menu;font-size:13px;font-style:normal;line-height:normal;font-weight:400;color:var(--tab-text-color)}:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]):hover{border-block-start-width:2px;border-block-start-color:var(--tab-top-line-hover-color);border-block-end-color:var(--tab-bottom-line-hover-color);background-color:var(--tab-bg-hover);color:var(--tab-text-hover-color)}:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]):focus-visible{outline:2px solid var(--tab-top-line-active-color);outline-offset:-2px}[aria-selected=true]:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]){border-block-start-width:2px;border-block-start-color:var(--tab-top-line-active-color);border-block-end-color:var(--tab-bottom-line-active-color);background-color:var(--tab-bg-active-color);font-weight:590;color:var(--tab-text-active-color)}[aria-selected=true]:is(:is(:is(#addSignatureDialog .mainContainer) [role=tablist])>[role=tab]):hover{border-block-start-color:var(--tab-top-line-active-hover-color);background-color:var(--tab-bg-active-hover-color);color:var(--tab-text-active-hover-color)}:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer{width:100%;height:auto;display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;gap:12px;padding-inline:16px;box-sizing:border-box}:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]{position:relative;width:100%;height:220px;background-color:var(--signature-bg);border:var(--tab-panel-border);border-radius:var(--tab-panel-border-radius)}:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:transparent}#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]){display:none}#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureTypeInput{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;padding:0;text-align:center;color:var(--signature-color);background-color:transparent;border-radius:var(--tab-panel-border-radius);font-family:Brush script,Apple Chancery,Segoe script,Freestyle Script,Palace Script MT,Brush Script MT,TK,cursive,serif;font-size:44px;font-style:italic;font-weight:400}:is(#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureTypeInput)::-moz-placeholder{color:var(--signature-placeholder-color);text-align:center;font:menu;font-style:normal;font-weight:274;font-size:44px;line-height:normal}:is(#addSignatureTypeContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureTypeInput)::placeholder{color:var(--signature-placeholder-color);text-align:center;font:menu;font-style:normal;font-weight:274;font-size:44px;line-height:normal}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]){display:none}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>span{position:absolute;top:0;left:0;width:100%;height:100%;display:grid;align-items:center;justify-content:center;background-color:transparent;color:var(--signature-placeholder-color);-webkit-user-select:none;-moz-user-select:none;user-select:none}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg{stroke:var(--signature-color);fill:none;stroke-opacity:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg):hover{cursor:var(--draw-cursor)}#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness{position:absolute;width:100%;inset-block-end:0;display:grid;align-items:center;justify-content:center;pointer-events:none}:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>span{color:var(--signature-draw-placeholder-color)}:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div{width:auto;height:auto;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px 8px 7px;margin:0;background-color:var(--thickness-bg);border-radius:4px 4px 0 0;border-inline:var(--thickness-border);border-top:var(--thickness-border);pointer-events:auto;position:relative;top:1px}:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>label{color:var(--thickness-label-color)}:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input{width:100px;height:14px;background-color:transparent}:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-webkit-slider-runnable-track,:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-moz-range-track,:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-moz-range-progress{background-color:var(--thickness-slider-color)}:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-webkit-slider-thumb,:is(:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input)::-moz-range-thumb{background-color:var(--thickness-bg)}:is(:is(#addSignatureDrawContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #thickness)>div)>input{border-radius:4.5px;border:0;color:var(--signature-color)}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]){display:none}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel])>svg{stroke:none;stroke-width:0;fill:var(--signature-color);fill-opacity:1}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center}:is(#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder) span{color:var(--signature-placeholder-color)}:is(#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder) a{color:var(--open-link-fg);text-decoration:underline;cursor:pointer}:is(:is(#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureImagePlaceholder) a):hover{color:var(--open-link-hover-fg)}#addSignatureImageContainer:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>[role=tabpanel]) #addSignatureFilePicker{visibility:hidden;position:relative;width:0;height:0}[data-selected=type]:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>#addSignatureTypeContainer,[data-selected=draw]:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>#addSignatureDrawContainer,[data-selected=image]:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer)>#addSignatureImageContainer{display:block}:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:12px;align-self:stretch}:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer{display:flex;align-items:flex-end;gap:16px;align-self:stretch}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #addSignatureDescriptionContainer{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 0 0}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #addSignatureDescriptionContainer):has(input:disabled)>label{opacity:.4}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #addSignatureDescriptionContainer)>label{width:auto}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton{display:flex;height:32px;padding:4px 8px;align-items:center;background-color:var(--clear-signature-button-bg);border-width:var(--clear-signature-button-border-width);border-style:var(--clear-signature-button-border-style);border-color:var(--clear-signature-button-border-color);border-radius:4px}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton)>span{display:flex;height:24px;align-items:center;gap:4px;flex-shrink:0;color:var(--clear-signature-button-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton)>span):after{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--clear-signature-button-icon);mask-image:var(--clear-signature-button-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--clear-signature-button-color);flex-shrink:0}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):hover{background-color:var(--clear-signature-button-bg-hover)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):hover>span{color:var(--clear-signature-button-hover-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):hover>span):after{background-color:var(--clear-signature-button-hover-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):active{background-color:var(--clear-signature-button-bg-active)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):active>span{color:var(--clear-signature-button-active-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):active>span):after{background-color:var(--clear-signature-button-active-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):focus-visible{background-color:var(--clear-signature-button-bg-focus)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):focus-visible>span{color:var(--clear-signature-button-focus-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):focus-visible>span):after{background-color:var(--clear-signature-button-focus-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):disabled{background-color:var(--clear-signature-button-bg-disabled);border-color:var(--clear-signature-button-border-disabled-color)}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):disabled>span{color:var(--clear-signature-button-disabled-color)}:is(:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #horizontalContainer) #clearSignatureButton):disabled>span):after{background-color:var( --clear-signature-button-disabled-color )}:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer{display:grid;grid-template-columns:max-content auto;gap:4px;width:100%}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer)>input{margin:0}:is(:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer)>input):disabled+label{opacity:.4}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer)>label{-webkit-user-select:none;-moz-user-select:none;user-select:none}:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer):not(.fullStorage) #addSignatureSaveWarning{display:none}.fullStorage:is(:is(:is(:is(#addSignatureDialog .mainContainer) #addSignatureActionContainer) #addSignatureControls) #addSignatureSaveContainer) #addSignatureSaveWarning{display:block;opacity:1;color:var(--save-warning-color);font-size:11px}#editSignatureDescriptionDialog .mainContainer{padding-inline:16px;box-sizing:border-box}:is(#editSignatureDescriptionDialog .mainContainer) .title{margin-inline-start:0}:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView{width:auto;display:flex;justify-content:flex-end;align-items:flex-start;gap:12px;align-self:stretch}:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView) #editSignatureDescriptionContainer{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1 1 auto}:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView)>svg{width:210px;height:180px;padding:8px;background-color:var(--signature-bg)}:is(:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView)>svg)>path{stroke:var(--button-signature-color);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;vector-effect:non-scaling-stroke;fill:none}.contours:is(:is(:is(:is(#editSignatureDescriptionDialog .mainContainer) #editSignatureDescriptionAndView)>svg)>path){fill:var(--button-signature-color);stroke-width:.5px}#editorSignatureParamsToolbar{padding:8px}#editorSignatureParamsToolbar #addSignatureDoorHanger{gap:8px;padding:2px}:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer{height:32px;display:flex;justify-content:space-between;align-items:center;align-self:stretch;gap:8px}:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button{border:var(--button-signature-border);border-radius:4px;background-color:var(--button-signature-bg);color:var(--button-signature-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):hover{background-color:var(--button-signature-hover-bg)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):active{border:var(--button-signature-active-border);background-color:var(--button-signature-active-bg);color:var(--button-signature-active-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):active:before{background-color:var(--button-signature-active-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):focus-visible{outline:var(--focus-ring-outline)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) button):focus-visible:before{background-color:var(--button-signature-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .deleteButton):before{-webkit-mask-image:var(--clear-signature-button-icon);mask-image:var(--clear-signature-button-icon)}:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton{width:auto;height:100%;min-height:var(--menuitem-height);aspect-ratio:unset;display:flex;align-items:center;justify-content:flex-start;outline:none;border-radius:4px;box-sizing:border-box;font:message-box;position:relative;flex:1 1 auto;padding:0;gap:8px;text-align:start;white-space:normal;cursor:default;overflow:hidden}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>svg{display:inline-block;height:100%;aspect-ratio:1;background-color:var(--signature-bg);flex:none;padding:4px;box-sizing:border-box;border:none;border-radius:4px}:is(:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>svg)>path{stroke:var(--button-signature-color);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;vector-effect:non-scaling-stroke;fill:none}.contours:is(:is(:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>svg)>path){fill:var(--button-signature-color);stroke-width:.5px}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):is(:hover,:active)>svg{border-radius:4px 0 0 4px;background-color:var(--signature-hover-bg)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):hover>span{color:var(--button-signature-hover-color)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):active{background-color:var(--button-signature-active-bg)}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton):is([disabled=disabled],[disabled]){opacity:.5;pointer-events:none}:is(:is(:is(#editorSignatureParamsToolbar #addSignatureDoorHanger) .toolbarAddSignatureButtonContainer) .toolbarAddSignatureButton)>span{height:auto;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto;font:menu;font-size:13px;font-style:normal;font-weight:400;line-height:normal;overflow:hidden}.editDescription.altText{--alt-text-add-image:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2217%22 viewBox%3D%220 0 16 17%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M14.9815 14.3461L14.3875 11.1451C14.3125 10.7361 14.1155 10.3621 13.8195 10.0641L5.0185 1.26214C4.2445 0.489141 2.9855 0.487141 2.2085 1.26214L0.5805 2.89014C-0.1935 3.66514 -0.1935 4.92514 0.5805 5.70014L9.3845 14.5031C9.6805 14.7981 10.0545 14.9941 10.4625 15.0691L13.6645 15.6631C13.7345 15.6751 13.8025 15.6821 13.8705 15.6821C14.1675 15.6821 14.4555 15.5651 14.6695 15.3511C14.9325 15.0871 15.0495 14.7121 14.9815 14.3461ZM2.5285 5.87814L1.3685 4.71814L1.3695 3.87014L3.1895 2.04914L4.0375 2.05014L5.1975 3.21014L2.5285 5.87814ZM10.6895 13.8401C10.5295 13.8101 10.3825 13.7331 10.2665 13.6161L3.4135 6.76314L6.0815 4.09514L12.9345 10.9471C13.0515 11.0651 13.1285 11.2121 13.1595 11.3731L13.6335 13.9301L13.2485 14.3151L10.6895 13.8401Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") !important}.editDescription.altText:before{width:16px!important;height:16px!important}:root{--outline-width:2px;--outline-color:#0060df;--outline-around-width:1px;--outline-around-color:#f0f0f4;--hover-outline-around-color:var(--outline-around-color);--focus-outline:solid var(--outline-width) var(--outline-color);--unfocus-outline:solid var(--outline-width) transparent;--focus-outline-around:solid var(--outline-around-width) var(--outline-around-color);--hover-outline-color:#8f8f9d;--hover-outline:solid var(--outline-width) var(--hover-outline-color);--hover-outline-around:solid var(--outline-around-width) var(--hover-outline-around-color);--freetext-line-height:1.35;--freetext-padding:2px;--resizer-bg-color:var(--outline-color);--resizer-size:6px;--resizer-shift:calc( 0px - (var(--outline-width) + var(--resizer-size)) / 2 - var(--outline-around-width) );--editorFreeText-editing-cursor:text;--editorInk-editing-cursor:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M0.0189877 13.6645L0.612989 10.4635C0.687989 10.0545 0.884989 9.6805 1.18099 9.3825L9.98199 0.5805C10.756 -0.1925 12.015 -0.1945 12.792 0.5805L14.42 2.2085C15.194 2.9835 15.194 4.2435 14.42 5.0185L5.61599 13.8215C5.31999 14.1165 4.94599 14.3125 4.53799 14.3875L1.33599 14.9815C1.26599 14.9935 1.19799 15.0005 1.12999 15.0005C0.832989 15.0005 0.544988 14.8835 0.330988 14.6695C0.0679874 14.4055 -0.0490122 14.0305 0.0189877 13.6645Z%22 fill%3D%22white%22%2F%3E%3Cpath d%3D%22M0.0189877 13.6645L0.612989 10.4635C0.687989 10.0545 0.884989 9.6805 1.18099 9.3825L9.98199 0.5805C10.756 -0.1925 12.015 -0.1945 12.792 0.5805L14.42 2.2085C15.194 2.9835 15.194 4.2435 14.42 5.0185L5.61599 13.8215C5.31999 14.1165 4.94599 14.3125 4.53799 14.3875L1.33599 14.9815C1.26599 14.9935 1.19799 15.0005 1.12999 15.0005C0.832989 15.0005 0.544988 14.8835 0.330988 14.6695C0.0679874 14.4055 -0.0490122 14.0305 0.0189877 13.6645ZM12.472 5.1965L13.632 4.0365L13.631 3.1885L11.811 1.3675L10.963 1.3685L9.80299 2.5285L12.472 5.1965ZM4.31099 13.1585C4.47099 13.1285 4.61799 13.0515 4.73399 12.9345L11.587 6.0815L8.91899 3.4135L2.06599 10.2655C1.94899 10.3835 1.87199 10.5305 1.84099 10.6915L1.36699 13.2485L1.75199 13.6335L4.31099 13.1585Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") 0 16, pointer;--editorHighlight-editing-cursor:url("data:image/svg+xml,%3Csvg width%3D%2229%22 height%3D%2232%22 viewBox%3D%220 0 29 32%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M28 16.75C28.2761 16.75 28.5 16.5261 28.5 16.25V15C28.5 14.7239 28.2761 14.5 28 14.5H26.358C25.9117 14.5 25.4773 14.6257 25.0999 14.8604L25.0989 14.8611L24 15.5484L22.9 14.861L22.8991 14.8604C22.5218 14.6257 22.0875 14.5 21.642 14.5H20C19.7239 14.5 19.5 14.7239 19.5 15V16.25C19.5 16.5261 19.7239 16.75 20 16.75H21.642C21.6648 16.75 21.6885 16.7564 21.7101 16.7697C21.7102 16.7698 21.7104 16.7699 21.7105 16.77L22.817 17.461C22.817 17.461 22.8171 17.4611 22.8171 17.4611C22.8171 17.4611 22.8171 17.4611 22.8171 17.4611C22.8552 17.4849 22.876 17.5229 22.876 17.567V22.625V27.683C22.876 27.7271 22.8552 27.765 22.8172 27.7889C22.8171 27.7889 22.8171 27.789 22.817 27.789L21.7095 28.48C21.7094 28.4801 21.7093 28.4802 21.7092 28.4803C21.6872 28.4938 21.6644 28.5 21.641 28.5H20C19.7239 28.5 19.5 28.7239 19.5 29V30.25C19.5 30.5261 19.7239 30.75 20 30.75H21.642C22.0883 30.75 22.5227 30.6243 22.9001 30.3896L22.9009 30.3891L24 29.7026L25.1 30.39L25.1009 30.3906C25.4783 30.6253 25.9127 30.751 26.359 30.751H28C28.2761 30.751 28.5 30.5271 28.5 30.251V29.001C28.5 28.7249 28.2761 28.501 28 28.501H26.358C26.3352 28.501 26.3115 28.4946 26.2899 28.4813C26.2897 28.4812 26.2896 28.4811 26.2895 28.481L25.183 27.79C25.183 27.79 25.183 27.79 25.1829 27.79C25.1829 27.7899 25.1829 27.7899 25.1829 27.7899C25.1462 27.7669 25.125 27.7297 25.125 27.684V22.625V17.567C25.125 17.5227 25.146 17.4844 25.1836 17.4606C25.1838 17.4605 25.1839 17.4604 25.184 17.4603L26.2895 16.77C26.2896 16.7699 26.2898 16.7698 26.2899 16.7697C26.3119 16.7562 26.3346 16.75 26.358 16.75H28Z%22 fill%3D%22black%22 stroke%3D%22%23FBFBFE%22 stroke-linejoin%3D%22round%22%2F%3E%3Cpath d%3D%22M24.625 17.567C24.625 17.35 24.735 17.152 24.918 17.037L26.026 16.345C26.126 16.283 26.24 16.25 26.358 16.25H28V15H26.358C26.006 15 25.663 15.099 25.364 15.285L24.256 15.978C24.161 16.037 24.081 16.113 24 16.187C23.918 16.113 23.839 16.037 23.744 15.978L22.635 15.285C22.336 15.099 21.993 15 21.642 15H20V16.25H21.642C21.759 16.25 21.874 16.283 21.974 16.345L23.082 17.037C23.266 17.152 23.376 17.35 23.376 17.567V22.625V27.683C23.376 27.9 23.266 28.098 23.082 28.213L21.973 28.905C21.873 28.967 21.759 29 21.641 29H20V30.25H21.642C21.994 30.25 22.337 30.151 22.636 29.965L23.744 29.273C23.84 29.213 23.919 29.137 24 29.064C24.081 29.137 24.161 29.213 24.256 29.273L25.365 29.966C25.664 30.152 26.007 30.251 26.359 30.251H28V29.001H26.358C26.241 29.001 26.126 28.968 26.026 28.906L24.918 28.214C24.734 28.099 24.625 27.901 24.625 27.684V22.625V17.567Z%22 fill%3D%22black%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M12.2 2.59C12.28 2.51 12.43 2.5 12.43 2.5C12.48 2.5 12.58 2.52 12.66 2.6L14.45 4.39C14.58 4.52 14.58 4.72 14.45 4.85L11.7713 7.52872L9.51628 5.27372L12.2 2.59ZM13.2658 4.62L11.7713 6.1145L10.9305 5.27372L12.425 3.77921L13.2658 4.62Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M5.98 8.82L8.23 11.07L10.7106 8.58938L8.45562 6.33438L5.98 8.81V8.82ZM8.23 9.65579L9.29641 8.58938L8.45562 7.74859L7.38921 8.815L8.23 9.65579Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M10.1526 12.6816L16.2125 6.6217C16.7576 6.08919 17.05 5.3707 17.05 4.62C17.05 3.86931 16.7576 3.15084 16.2126 2.61834L14.4317 0.837474C13.8992 0.29242 13.1807 0 12.43 0C11.6643 0 10.9529 0.312929 10.4329 0.832893L3.68289 7.58289C3.04127 8.22452 3.00459 9.25075 3.57288 9.93634L1.29187 12.2239C1.09186 12.4245 0.990263 12.6957 1.0007 12.9685L1 14C0.447715 14 0 14.4477 0 15V17C0 17.5523 0.447715 18 1 18H16C16.5523 18 17 17.5523 17 17V15C17 14.4477 16.5523 14 16 14H10.2325C9.83594 14 9.39953 13.4347 10.1526 12.6816ZM4.39 9.35L4.9807 9.9407L2.39762 12.5312H6.63877L7.10501 12.065L7.57125 12.5312H8.88875L15.51 5.91C15.86 5.57 16.05 5.11 16.05 4.62C16.05 4.13 15.86 3.67 15.51 3.33L13.72 1.54C13.38 1.19 12.92 1 12.43 1C11.94 1 11.48 1.2 11.14 1.54L4.39 8.29C4.1 8.58 4.1 9.06 4.39 9.35ZM16 17V15H1V17H16Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3Cpath d%3D%22M15.1616 5.55136L15.1616 5.55132L15.1564 5.55645L8.40645 12.3064C8.35915 12.3537 8.29589 12.38 8.23 12.38C8.16411 12.38 8.10085 12.3537 8.05355 12.3064L7.45857 11.7115L7.10501 11.3579L6.75146 11.7115L6.03289 12.43H3.20465L5.33477 10.2937L5.6873 9.94019L5.33426 9.58715L4.74355 8.99645C4.64882 8.90171 4.64882 8.73829 4.74355 8.64355L11.4936 1.89355C11.7436 1.64354 12.0779 1.5 12.43 1.5C12.7883 1.5 13.1179 1.63776 13.3614 1.88839L13.3613 1.88843L13.3664 1.89355L15.1564 3.68355L15.1564 3.68359L15.1616 3.68864C15.4122 3.93211 15.55 4.26166 15.55 4.62C15.55 4.97834 15.4122 5.30789 15.1616 5.55136ZM5.48 8.82V9.02711L5.62645 9.17355L7.87645 11.4236L8.23 11.7771L8.58355 11.4236L11.0642 8.94293L11.4177 8.58938L11.0642 8.23582L8.80918 5.98082L8.45562 5.62727L8.10207 5.98082L5.62645 8.45645L5.48 8.60289V8.81V8.82ZM11.4177 7.88227L11.7713 8.23582L12.1248 7.88227L14.8036 5.20355C15.1288 4.87829 15.1288 4.36171 14.8036 4.03645L13.0136 2.24645C12.8186 2.05146 12.5792 2 12.43 2H12.4134L12.3967 2.00111L12.43 2.5C12.3967 2.00111 12.3966 2.00112 12.3965 2.00112L12.3963 2.00114L12.3957 2.00117L12.3947 2.00125L12.3924 2.00142L12.387 2.00184L12.3732 2.00311C12.3628 2.00416 12.3498 2.00567 12.3346 2.00784C12.3049 2.01208 12.2642 2.01925 12.2178 2.03146C12.1396 2.05202 11.9797 2.10317 11.8464 2.23645L9.16273 4.92016L8.80918 5.27372L9.16273 5.62727L11.4177 7.88227ZM1.5 16.5V15.5H15.5V16.5H1.5Z%22 stroke%3D%22%2315141A%22%2F%3E%3C%2Fsvg%3E") 24 24, text;--editorFreeHighlight-editing-cursor:url("data:image/svg+xml,%3Csvg width%3D%2218%22 height%3D%2219%22 viewBox%3D%220 0 18 19%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M12.2 3.09C12.28 3.01 12.43 3 12.43 3C12.48 3 12.58 3.02 12.66 3.1L14.45 4.89C14.58 5.02 14.58 5.22 14.45 5.35L11.7713 8.02872L9.51628 5.77372L12.2 3.09ZM13.2658 5.12L11.7713 6.6145L10.9305 5.77372L12.425 4.27921L13.2658 5.12Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M5.98 9.32L8.23 11.57L10.7106 9.08938L8.45562 6.83438L5.98 9.31V9.32ZM8.23 10.1558L9.29641 9.08938L8.45562 8.24859L7.38921 9.315L8.23 10.1558Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M10.1526 13.1816L16.2125 7.1217C16.7576 6.58919 17.05 5.8707 17.05 5.12C17.05 4.36931 16.7576 3.65084 16.2126 3.11834L14.4317 1.33747C13.8992 0.79242 13.1807 0.5 12.43 0.5C11.6643 0.5 10.9529 0.812929 10.4329 1.33289L3.68289 8.08289C3.04127 8.72452 3.00459 9.75075 3.57288 10.4363L1.29187 12.7239C1.09186 12.9245 0.990263 13.1957 1.0007 13.4685L1 14.5C0.447715 14.5 0 14.9477 0 15.5V17.5C0 18.0523 0.447715 18.5 1 18.5H16C16.5523 18.5 17 18.0523 17 17.5V15.5C17 14.9477 16.5523 14.5 16 14.5H10.2325C9.83594 14.5 9.39953 13.9347 10.1526 13.1816ZM4.39 9.85L4.9807 10.4407L2.39762 13.0312H6.63877L7.10501 12.565L7.57125 13.0312H8.88875L15.51 6.41C15.86 6.07 16.05 5.61 16.05 5.12C16.05 4.63 15.86 4.17 15.51 3.83L13.72 2.04C13.38 1.69 12.92 1.5 12.43 1.5C11.94 1.5 11.48 1.7 11.14 2.04L4.39 8.79C4.1 9.08 4.1 9.56 4.39 9.85ZM16 17.5V15.5H1V17.5H16Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3Cpath d%3D%22M15.1616 6.05136L15.1616 6.05132L15.1564 6.05645L8.40645 12.8064C8.35915 12.8537 8.29589 12.88 8.23 12.88C8.16411 12.88 8.10085 12.8537 8.05355 12.8064L7.45857 12.2115L7.10501 11.8579L6.75146 12.2115L6.03289 12.93H3.20465L5.33477 10.7937L5.6873 10.4402L5.33426 10.0871L4.74355 9.49645C4.64882 9.40171 4.64882 9.23829 4.74355 9.14355L11.4936 2.39355C11.7436 2.14354 12.0779 2 12.43 2C12.7883 2 13.1179 2.13776 13.3614 2.38839L13.3613 2.38843L13.3664 2.39355L15.1564 4.18355L15.1564 4.18359L15.1616 4.18864C15.4122 4.43211 15.55 4.76166 15.55 5.12C15.55 5.47834 15.4122 5.80789 15.1616 6.05136ZM7.87645 11.9236L8.23 12.2771L8.58355 11.9236L11.0642 9.44293L11.4177 9.08938L11.0642 8.73582L8.80918 6.48082L8.45562 6.12727L8.10207 6.48082L5.62645 8.95645L5.48 9.10289V9.31V9.32V9.52711L5.62645 9.67355L7.87645 11.9236ZM11.4177 8.38227L11.7713 8.73582L12.1248 8.38227L14.8036 5.70355C15.1288 5.37829 15.1288 4.86171 14.8036 4.53645L13.0136 2.74645C12.8186 2.55146 12.5792 2.5 12.43 2.5H12.4134L12.3967 2.50111L12.43 3C12.3967 2.50111 12.3966 2.50112 12.3965 2.50112L12.3963 2.50114L12.3957 2.50117L12.3947 2.50125L12.3924 2.50142L12.387 2.50184L12.3732 2.50311C12.3628 2.50416 12.3498 2.50567 12.3346 2.50784C12.3049 2.51208 12.2642 2.51925 12.2178 2.53146C12.1396 2.55202 11.9797 2.60317 11.8464 2.73645L9.16273 5.42016L8.80918 5.77372L9.16273 6.12727L11.4177 8.38227ZM1.5 16H15.5V17H1.5V16Z%22 stroke%3D%22%2315141A%22%2F%3E%3C%2Fsvg%3E") 1 18, pointer;--new-alt-text-warning-image:url("data:image/svg+xml,%3Csvg width%3D%2217%22 height%3D%2216%22 viewBox%3D%220 0 17 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M8.78182 2.63903C8.58882 2.28803 8.25782 2.25003 8.12482 2.25003C7.99019 2.24847 7.85771 2.28393 7.74185 2.35253C7.62599 2.42113 7.5312 2.52023 7.46782 2.63903L1.97082 12.639C1.90673 12.7528 1.87406 12.8816 1.87617 13.0122C1.87828 13.1427 1.91509 13.2704 1.98282 13.382C2.04798 13.4951 2.14207 13.5888 2.25543 13.6535C2.36879 13.7182 2.49732 13.7515 2.62782 13.75H13.6218C13.7523 13.7515 13.8809 13.7182 13.9942 13.6535C14.1076 13.5888 14.2017 13.4951 14.2668 13.382C14.3346 13.2704 14.3714 13.1427 14.3735 13.0122C14.3756 12.8816 14.3429 12.7528 14.2788 12.639L8.78182 2.63903ZM6.37282 2.03703C6.75182 1.34603 7.43882 1.00003 8.12482 1.00003C8.48341 0.997985 8.83583 1.09326 9.14454 1.2757C9.45325 1.45814 9.70668 1.72092 9.87782 2.03603L15.3748 12.036C16.1078 13.369 15.1438 15 13.6228 15H2.62782C1.10682 15 0.141823 13.37 0.875823 12.037L6.37282 2.03703ZM8.74982 9.06203C8.74982 9.22779 8.68397 9.38676 8.56676 9.50397C8.44955 9.62118 8.29058 9.68703 8.12482 9.68703C7.95906 9.68703 7.80009 9.62118 7.68288 9.50397C7.56566 9.38676 7.49982 9.22779 7.49982 9.06203V5.62503C7.49982 5.45927 7.56566 5.3003 7.68288 5.18309C7.80009 5.06588 7.95906 5.00003 8.12482 5.00003C8.29058 5.00003 8.44955 5.06588 8.56676 5.18309C8.68397 5.3003 8.74982 5.45927 8.74982 5.62503V9.06203ZM7.74982 12L7.49982 11.75V11L7.74982 10.75H8.49982L8.74982 11V11.75L8.49982 12H7.74982Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E")}.visuallyHidden{position:absolute;top:0;left:0;border:0;margin:0;padding:0;width:0;height:0;overflow:hidden;white-space:nowrap;font-size:0}.textLayer.highlighting{cursor:var(--editorFreeHighlight-editing-cursor)}.textLayer.highlighting:not(.free) span{cursor:var(--editorHighlight-editing-cursor)}[role=img]:is(.textLayer.highlighting:not(.free) span){cursor:var(--editorFreeHighlight-editing-cursor)}.textLayer.highlighting.free span{cursor:var(--editorFreeHighlight-editing-cursor)}:is(#viewerContainer.pdfPresentationMode:fullscreen,.annotationEditorLayer.disabled) .noAltTextBadge{display:none!important}@media (-webkit-min-device-pixel-ratio: 1.1),(min-resolution: 1.1dppx){:root{--editorFreeText-editing-cursor:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M12 2.75H12.5V2.25V1V0.5H12H10.358C9.91165 0.5 9.47731 0.625661 9.09989 0.860442L9.09886 0.861087L8 1.54837L6.89997 0.860979L6.89911 0.860443C6.5218 0.625734 6.08748 0.5 5.642 0.5H4H3.5V1V2.25V2.75H4H5.642C5.66478 2.75 5.6885 2.75641 5.71008 2.76968C5.71023 2.76977 5.71038 2.76986 5.71053 2.76995L6.817 3.461C6.81704 3.46103 6.81709 3.46105 6.81713 3.46108C6.81713 3.46108 6.81713 3.46108 6.81714 3.46109C6.8552 3.48494 6.876 3.52285 6.876 3.567V8V12.433C6.876 12.4771 6.85523 12.515 6.81722 12.5389C6.81715 12.5389 6.81707 12.539 6.817 12.539L5.70953 13.23C5.70941 13.2301 5.70929 13.2302 5.70917 13.2303C5.68723 13.2438 5.6644 13.25 5.641 13.25H4H3.5V13.75V15V15.5H4H5.642C6.08835 15.5 6.52269 15.3743 6.90011 15.1396L6.90086 15.1391L8 14.4526L9.10003 15.14L9.10089 15.1406C9.47831 15.3753 9.91265 15.501 10.359 15.501H12H12.5V15.001V13.751V13.251H12H10.358C10.3352 13.251 10.3115 13.2446 10.2899 13.2313C10.2897 13.2312 10.2896 13.2311 10.2895 13.231L9.183 12.54C9.18298 12.54 9.18295 12.54 9.18293 12.54C9.18291 12.5399 9.18288 12.5399 9.18286 12.5399C9.14615 12.5169 9.125 12.4797 9.125 12.434V8V3.567C9.125 3.52266 9.14603 3.48441 9.18364 3.4606C9.18377 3.46052 9.1839 3.46043 9.18404 3.46035L10.2895 2.76995C10.2896 2.76985 10.2898 2.76975 10.2899 2.76966C10.3119 2.75619 10.3346 2.75 10.358 2.75H12Z%22 fill%3D%22black%22 stroke%3D%22white%22%2F%3E%3C%2Fsvg%3E") 0 16, text}}@media screen and (forced-colors: active){:root{--outline-color:CanvasText;--outline-around-color:ButtonFace;--resizer-bg-color:ButtonText;--hover-outline-color:Highlight;--hover-outline-around-color:SelectedItemText}}[data-editor-rotation="90"]{transform:rotate(90deg)}[data-editor-rotation="180"]{transform:rotate(180deg)}[data-editor-rotation="270"]{transform:rotate(270deg)}.annotationEditorLayer{background:transparent;position:absolute;top:0;right:0;bottom:0;left:0;font-size:calc(100px * var(--total-scale-factor));transform-origin:0 0;cursor:auto}.annotationEditorLayer .selectedEditor{z-index:100000!important}.annotationEditorLayer.drawing *{pointer-events:none!important}.annotationEditorLayer.waiting{content:"";cursor:wait;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.annotationEditorLayer.disabled{pointer-events:none}.annotationEditorLayer.freetextEditing{cursor:var(--editorFreeText-editing-cursor)}.annotationEditorLayer.inkEditing{cursor:var(--editorInk-editing-cursor)}.annotationEditorLayer .draw{box-sizing:border-box}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor){position:absolute;background:transparent;z-index:1;transform-origin:0 0;cursor:auto;max-width:100%;max-height:100%;border:var(--unfocus-outline)}.draggable.selectedEditor:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)){cursor:move}.selectedEditor:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)){border:var(--focus-outline);outline:var(--focus-outline-around)}.selectedEditor:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)):before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:var(--focus-outline-around);pointer-events:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)):hover:not(.selectedEditor){border:var(--hover-outline);outline:var(--hover-outline-around)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)):hover:not(.selectedEditor):before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:var(--focus-outline-around)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-delete-image:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M11 3H13.6C14 3 14.3 3.3 14.3 3.6C14.3 3.9 14 4.2 13.7 4.2H13.3V14C13.3 15.1 12.4 16 11.3 16H4.80005C3.70005 16 2.80005 15.1 2.80005 14V4.2H2.40005C2.00005 4.2 1.80005 4 1.80005 3.6C1.80005 3.2 2.00005 3 2.40005 3H5.00005V2C5.00005 0.9 5.90005 0 7.00005 0H9.00005C10.1 0 11 0.9 11 2V3ZM6.90005 1.2L6.30005 1.8V3H9.80005V1.8L9.20005 1.2H6.90005ZM11.4 14.7L12 14.1V4.2H4.00005V14.1L4.60005 14.7H11.4ZM7.00005 12.4C7.00005 12.7 6.70005 13 6.40005 13C6.10005 13 5.80005 12.7 5.80005 12.4V7.6C5.70005 7.3 6.00005 7 6.40005 7C6.80005 7 7.00005 7.3 7.00005 7.6V12.4ZM10.2001 12.4C10.2001 12.7 9.90006 13 9.60006 13C9.30006 13 9.00006 12.7 9.00006 12.4V7.6C9.00006 7.3 9.30006 7 9.60006 7C9.90006 7 10.2001 7.3 10.2001 7.6V12.4Z%22 fill%3D%22black%22 %2F%3E%3C%2Fsvg%3E");--csstools-light-dark-toggle--44:var(--csstools-color-scheme--light) #2b2a33;--editor-toolbar-bg-color:var(--csstools-light-dark-toggle--44, #f0f0f4);--editor-toolbar-highlight-image:url("data:image/svg+xml,%3Csvg width%3D%2217%22 height%3D%2216%22 viewBox%3D%220 0 17 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cg%3E %3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M7.10918 11.66C7.24918 11.8 7.43918 11.88 7.63918 11.88C7.83918 11.88 8.02918 11.8 8.16918 11.66L14.9192 4.91C15.2692 4.57 15.4592 4.11 15.4592 3.62C15.4592 3.13 15.2692 2.67 14.9192 2.33L13.1292 0.54C12.7892 0.19 12.3292 0 11.8392 0C11.3492 0 10.8892 0.2 10.5492 0.54L3.79918 7.29C3.50918 7.58 3.50918 8.06 3.79918 8.35L4.38988 8.9407L1.40918 11.93H5.64918L6.51419 11.065L7.10918 11.66ZM7.63918 10.07L5.38918 7.82V7.81L7.8648 5.33438L10.1198 7.58938L7.63918 10.07ZM11.1805 6.52872L13.8592 3.85C13.9892 3.72 13.9892 3.52 13.8592 3.39L12.0692 1.6C11.9892 1.52 11.8892 1.5 11.8392 1.5C11.8392 1.5 11.6892 1.51 11.6092 1.59L8.92546 4.27372L11.1805 6.52872Z%22 fill%3D%22%23000%22%2F%3E %3Cpath d%3D%22M0.40918 14H15.4092V16H0.40918V14Z%22 fill%3D%22%23000%22%2F%3E %3C%2Fg%3E %3C%2Fsvg%3E");--csstools-light-dark-toggle--45:var(--csstools-color-scheme--light) #fbfbfe;--editor-toolbar-fg-color:var(--csstools-light-dark-toggle--45, #2e2e56);--editor-toolbar-border-color:#8f8f9d;--editor-toolbar-hover-border-color:var(--editor-toolbar-border-color);--csstools-light-dark-toggle--46:var(--csstools-color-scheme--light) #52525e;--editor-toolbar-hover-bg-color:var(--csstools-light-dark-toggle--46, #e0e0e6);--editor-toolbar-hover-fg-color:var(--editor-toolbar-fg-color);--editor-toolbar-hover-outline:none;--csstools-light-dark-toggle--47:var(--csstools-color-scheme--light) #0df;--editor-toolbar-focus-outline-color:var(--csstools-light-dark-toggle--47, #0060df);--editor-toolbar-shadow:0 2px 6px 0 rgb(58 57 68 / .2);--editor-toolbar-vert-offset:6px;--editor-toolbar-height:28px;--editor-toolbar-padding:2px;--csstools-light-dark-toggle--48:var(--csstools-color-scheme--light) #54ffbd;--alt-text-done-color:var(--csstools-light-dark-toggle--48, #2ac3a2);--csstools-light-dark-toggle--49:var(--csstools-color-scheme--light) #80ebff;--alt-text-warning-color:var(--csstools-light-dark-toggle--49, #0090ed);--alt-text-hover-done-color:var(--alt-text-done-color);--alt-text-hover-warning-color:var(--alt-text-warning-color)}@supports (color: light-dark(red,red)){:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-bg-color:light-dark(#f0f0f4, #2b2a33);--editor-toolbar-fg-color:light-dark(#2e2e56, #fbfbfe);--editor-toolbar-hover-bg-color:light-dark(#e0e0e6, #52525e);--editor-toolbar-focus-outline-color:light-dark(#0060df, #0df);--alt-text-done-color:light-dark(#2ac3a2, #54ffbd);--alt-text-warning-color:light-dark(#0090ed, #80ebff)}}@supports not (color: light-dark(tan,tan)){:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) *{--csstools-light-dark-toggle--44:var(--csstools-color-scheme--light) #2b2a33;--editor-toolbar-bg-color:var(--csstools-light-dark-toggle--44, #f0f0f4);--csstools-light-dark-toggle--45:var(--csstools-color-scheme--light) #fbfbfe;--editor-toolbar-fg-color:var(--csstools-light-dark-toggle--45, #2e2e56);--csstools-light-dark-toggle--46:var(--csstools-color-scheme--light) #52525e;--editor-toolbar-hover-bg-color:var(--csstools-light-dark-toggle--46, #e0e0e6);--csstools-light-dark-toggle--47:var(--csstools-color-scheme--light) #0df;--editor-toolbar-focus-outline-color:var(--csstools-light-dark-toggle--47, #0060df);--csstools-light-dark-toggle--48:var(--csstools-color-scheme--light) #54ffbd;--alt-text-done-color:var(--csstools-light-dark-toggle--48, #2ac3a2);--csstools-light-dark-toggle--49:var(--csstools-color-scheme--light) #80ebff;--alt-text-warning-color:var(--csstools-light-dark-toggle--49, #0090ed)}}@media screen and (forced-colors: active){:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-bg-color:ButtonFace;--editor-toolbar-fg-color:ButtonText;--editor-toolbar-border-color:ButtonText;--editor-toolbar-hover-border-color:AccentColor;--editor-toolbar-hover-bg-color:ButtonFace;--editor-toolbar-hover-fg-color:AccentColor;--editor-toolbar-hover-outline:2px solid var(--editor-toolbar-hover-border-color);--editor-toolbar-focus-outline-color:ButtonBorder;--editor-toolbar-shadow:none;--alt-text-done-color:var(--editor-toolbar-fg-color);--alt-text-warning-color:var(--editor-toolbar-fg-color);--alt-text-hover-done-color:var(--editor-toolbar-hover-fg-color);--alt-text-hover-warning-color:var(--editor-toolbar-hover-fg-color)}}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{display:flex;width:-moz-fit-content;width:fit-content;height:var(--editor-toolbar-height);flex-direction:column;justify-content:center;align-items:center;cursor:default;pointer-events:auto;box-sizing:content-box;padding:var(--editor-toolbar-padding);position:absolute;inset-inline-end:0;inset-block-start:calc(100% + var(--editor-toolbar-vert-offset));border-radius:6px;background-color:var(--editor-toolbar-bg-color);border:1px solid var(--editor-toolbar-border-color);box-shadow:var(--editor-toolbar-shadow)}.hidden:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar){display:none}:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar):has(:focus-visible){border-color:transparent}[dir=ltr] :is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar){transform-origin:100% 0}[dir=rtl] :is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar){transform-origin:0 0}:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons{display:flex;justify-content:center;align-items:center;gap:0;height:100%}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) button{padding:0}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .divider{width:0;height:calc(2 * var(--editor-toolbar-padding) + var(--editor-toolbar-height));border-left:1px solid var(--editor-toolbar-border-color);border-right:none;display:inline-block;margin-inline:2px}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .highlightButton{width:var(--editor-toolbar-height)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .highlightButton):before{content:"";-webkit-mask-image:var(--editor-toolbar-highlight-image);mask-image:var(--editor-toolbar-highlight-image);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;background-color:var(--editor-toolbar-fg-color);width:100%;height:100%}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .highlightButton):hover:before{background-color:var(--editor-toolbar-hover-fg-color)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .delete{width:var(--editor-toolbar-height)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .delete):before{content:"";-webkit-mask-image:var(--editor-toolbar-delete-image);mask-image:var(--editor-toolbar-delete-image);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;background-color:var(--editor-toolbar-fg-color);width:100%;height:100%}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .delete):hover:before{background-color:var(--editor-toolbar-hover-fg-color)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>*{height:var(--editor-toolbar-height)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider){border:none;background-color:transparent;cursor:pointer}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider)):hover{border-radius:2px;background-color:var(--editor-toolbar-hover-bg-color);color:var(--editor-toolbar-hover-fg-color);outline:var(--editor-toolbar-hover-outline);outline-offset:1px}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider)):hover:active{outline:none}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons)>:not(.divider)):focus-visible{border-radius:2px;outline:2px solid var(--editor-toolbar-focus-outline-color)}:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText{--alt-text-add-image:url("data:image/svg+xml,%3Csvg width%3D%2212%22 height%3D%2213%22 viewBox%3D%220 0 12 13%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M5.375 7.625V11.875C5.375 12.0408 5.44085 12.1997 5.55806 12.3169C5.67527 12.4342 5.83424 12.5 6 12.5C6.16576 12.5 6.32473 12.4342 6.44194 12.3169C6.55915 12.1997 6.625 12.0408 6.625 11.875V7.625L7.125 7.125H11.375C11.5408 7.125 11.6997 7.05915 11.8169 6.94194C11.9342 6.82473 12 6.66576 12 6.5C12 6.33424 11.9342 6.17527 11.8169 6.05806C11.6997 5.94085 11.5408 5.875 11.375 5.875H7.125L6.625 5.375V1.125C6.625 0.95924 6.55915 0.800269 6.44194 0.683058C6.32473 0.565848 6.16576 0.5 6 0.5C5.83424 0.5 5.67527 0.565848 5.55806 0.683058C5.44085 0.800269 5.375 0.95924 5.375 1.125V5.375L4.875 5.875H0.625C0.45924 5.875 0.300269 5.94085 0.183058 6.05806C0.065848 6.17527 0 6.33424 0 6.5C0 6.66576 0.065848 6.82473 0.183058 6.94194C0.300269 7.05915 0.45924 7.125 0.625 7.125H4.762L5.375 7.625Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E ");--alt-text-done-image:url("data:image/svg+xml,%3Csvg width%3D%2212%22 height%3D%2213%22 viewBox%3D%220 0 12 13%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M6 0.5C5.21207 0.5 4.43185 0.655195 3.7039 0.956723C2.97595 1.25825 2.31451 1.70021 1.75736 2.25736C1.20021 2.81451 0.758251 3.47595 0.456723 4.2039C0.155195 4.93185 0 5.71207 0 6.5C0 7.28793 0.155195 8.06815 0.456723 8.7961C0.758251 9.52405 1.20021 10.1855 1.75736 10.7426C2.31451 11.2998 2.97595 11.7417 3.7039 12.0433C4.43185 12.3448 5.21207 12.5 6 12.5C7.5913 12.5 9.11742 11.8679 10.2426 10.7426C11.3679 9.61742 12 8.0913 12 6.5C12 4.9087 11.3679 3.38258 10.2426 2.25736C9.11742 1.13214 7.5913 0.5 6 0.5ZM5.06 8.9L2.9464 6.7856C2.85273 6.69171 2.80018 6.56446 2.80033 6.43183C2.80048 6.29921 2.85331 6.17207 2.9472 6.0784C3.04109 5.98473 3.16834 5.93218 3.30097 5.93233C3.43359 5.93248 3.56073 5.98531 3.6544 6.0792L5.3112 7.7368L8.3464 4.7008C8.44109 4.6109 8.56715 4.56153 8.69771 4.56322C8.82827 4.56492 8.95301 4.61754 9.04534 4.70986C9.13766 4.80219 9.19028 4.92693 9.19198 5.05749C9.19367 5.18805 9.1443 5.31411 9.0544 5.4088L5.5624 8.9H5.06Z%22 fill%3D%22%23FBFBFE%22%2F%3E%3C%2Fsvg%3E ");display:flex;align-items:center;justify-content:center;width:-moz-max-content;width:max-content;padding-inline:8px;pointer-events:all;font:menu;font-weight:590;font-size:12px;color:var(--editor-toolbar-fg-color)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):disabled{pointer-events:none}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{content:"";-webkit-mask-image:var(--alt-text-add-image);mask-image:var(--alt-text-add-image);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;width:12px;height:13px;background-color:var(--editor-toolbar-fg-color);margin-inline-end:4px}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):hover:before{background-color:var(--editor-toolbar-hover-fg-color)}.done:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{-webkit-mask-image:var(--alt-text-done-image);mask-image:var(--alt-text-done-image)}.new:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-warning-image);mask-image:var(--new-alt-text-warning-image);background-color:var(--alt-text-warning-color);-webkit-mask-size:cover;mask-size:cover}.new:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):hover:before{background-color:var(--alt-text-hover-warning-color)}.new.done:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):before{-webkit-mask-image:var(--alt-text-done-image);mask-image:var(--alt-text-done-image);background-color:var(--alt-text-done-color)}.new.done:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText):hover:before{background-color:var(--alt-text-hover-done-color)}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip{display:none;word-wrap:anywhere}.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--csstools-light-dark-toggle--50:var(--csstools-color-scheme--light) #1c1b22;--alt-text-tooltip-bg:var(--csstools-light-dark-toggle--50, #f0f0f4);--csstools-light-dark-toggle--51:var(--csstools-color-scheme--light) #fbfbfe;--alt-text-tooltip-fg:var(--csstools-light-dark-toggle--51, #15141a);--alt-text-tooltip-border:#8f8f9d;--csstools-light-dark-toggle--52:var(--csstools-color-scheme--light) #15141a;--alt-text-tooltip-shadow:0px 2px 6px 0px var(--csstools-light-dark-toggle--52, rgb(58 57 68 / .2))}@supports (color: light-dark(red,red)){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--alt-text-tooltip-bg:light-dark(#f0f0f4, #1c1b22);--alt-text-tooltip-fg:light-dark(#15141a, #fbfbfe)}}@supports (color: light-dark(red,red)) and (color: rgb(0 0 0 / 0)){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--alt-text-tooltip-shadow:0px 2px 6px 0px light-dark(rgb(58 57 68 / .2), #15141a)}}@supports not (color: light-dark(tan,tan)){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip) *{--csstools-light-dark-toggle--50:var(--csstools-color-scheme--light) #1c1b22;--alt-text-tooltip-bg:var(--csstools-light-dark-toggle--50, #f0f0f4);--csstools-light-dark-toggle--51:var(--csstools-color-scheme--light) #fbfbfe;--alt-text-tooltip-fg:var(--csstools-light-dark-toggle--51, #15141a);--csstools-light-dark-toggle--52:var(--csstools-color-scheme--light) #15141a;--alt-text-tooltip-shadow:0px 2px 6px 0px var(--csstools-light-dark-toggle--52, rgb(58 57 68 / .2))}}@media screen and (forced-colors: active){.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){--alt-text-tooltip-bg:Canvas;--alt-text-tooltip-fg:CanvasText;--alt-text-tooltip-border:CanvasText;--alt-text-tooltip-shadow:none}}.show:is(:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar) .buttons) .altText) .tooltip){display:inline-flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:calc(100% + 2px);inset-inline-start:0;padding-block:2px 3px;padding-inline:3px;max-width:300px;width:-moz-max-content;width:max-content;height:auto;font-size:12px;border:.5px solid var(--alt-text-tooltip-border);background:var(--alt-text-tooltip-bg);box-shadow:var(--alt-text-tooltip-shadow);color:var(--alt-text-tooltip-fg);pointer-events:none}.annotationEditorLayer .freeTextEditor{padding:calc(var(--freetext-padding) * var(--total-scale-factor));width:auto;height:auto;touch-action:none}.annotationEditorLayer .freeTextEditor .internal{background:transparent;border:none;top:0;right:0;bottom:0;left:0;overflow:visible;white-space:nowrap;font:10px sans-serif;line-height:var(--freetext-line-height);-webkit-user-select:none;-moz-user-select:none;user-select:none}.annotationEditorLayer .freeTextEditor .overlay{position:absolute;display:none;background:transparent;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.annotationEditorLayer freeTextEditor .overlay.enabled{display:block}.annotationEditorLayer .freeTextEditor .internal:empty:before{content:attr(default-content);color:gray}.annotationEditorLayer .freeTextEditor .internal:focus{outline:none;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto}.annotationEditorLayer .inkEditor{width:100%;height:100%}.annotationEditorLayer .inkEditor.editing{cursor:inherit}.annotationEditorLayer .inkEditor .inkEditorCanvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;touch-action:none}.annotationEditorLayer .stampEditor{width:auto;height:auto}:is(.annotationEditorLayer .stampEditor) canvas{position:absolute;width:100%;height:100%;margin:0;top:0;left:0}:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{--csstools-light-dark-toggle--53:var(--csstools-color-scheme--light) #52525e;--no-alt-text-badge-border-color:var(--csstools-light-dark-toggle--53, #f0f0f4);--csstools-light-dark-toggle--54:var(--csstools-color-scheme--light) #fbfbfe;--no-alt-text-badge-bg-color:var(--csstools-light-dark-toggle--54, #cfcfd8);--csstools-light-dark-toggle--55:var(--csstools-color-scheme--light) #15141a;--no-alt-text-badge-fg-color:var(--csstools-light-dark-toggle--55, #5b5b66)}@supports (color: light-dark(red,red)){:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{--no-alt-text-badge-border-color:light-dark(#f0f0f4, #52525e);--no-alt-text-badge-bg-color:light-dark(#cfcfd8, #fbfbfe);--no-alt-text-badge-fg-color:light-dark(#5b5b66, #15141a)}}@supports not (color: light-dark(tan,tan)){:is(:is(.annotationEditorLayer .stampEditor) .noAltTextBadge) *{--csstools-light-dark-toggle--53:var(--csstools-color-scheme--light) #52525e;--no-alt-text-badge-border-color:var(--csstools-light-dark-toggle--53, #f0f0f4);--csstools-light-dark-toggle--54:var(--csstools-color-scheme--light) #fbfbfe;--no-alt-text-badge-bg-color:var(--csstools-light-dark-toggle--54, #cfcfd8);--csstools-light-dark-toggle--55:var(--csstools-color-scheme--light) #15141a;--no-alt-text-badge-fg-color:var(--csstools-light-dark-toggle--55, #5b5b66)}}@media screen and (forced-colors: active){:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{--no-alt-text-badge-border-color:ButtonText;--no-alt-text-badge-bg-color:ButtonFace;--no-alt-text-badge-fg-color:ButtonText}}:is(.annotationEditorLayer .stampEditor) .noAltTextBadge{position:absolute;inset-inline-end:5px;inset-block-end:5px;display:inline-flex;width:32px;height:32px;padding:3px;justify-content:center;align-items:center;pointer-events:none;z-index:1;border-radius:2px;border:1px solid var(--no-alt-text-badge-border-color);background:var(--no-alt-text-badge-bg-color)}:is(:is(.annotationEditorLayer .stampEditor) .noAltTextBadge):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-warning-image);mask-image:var(--new-alt-text-warning-image);-webkit-mask-size:cover;mask-size:cover;background-color:var(--no-alt-text-badge-fg-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers{position:absolute;top:0;right:0;bottom:0;left:0}.hidden:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers){display:none}:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer{width:var(--resizer-size);height:var(--resizer-size);background:content-box var(--resizer-bg-color);border:var(--focus-outline-around);border-radius:2px;position:absolute}.topLeft:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:var(--resizer-shift);left:var(--resizer-shift)}.topMiddle:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:var(--resizer-shift);left:calc(50% + var(--resizer-shift))}.topRight:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:var(--resizer-shift);right:var(--resizer-shift)}.middleRight:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:calc(50% + var(--resizer-shift));right:var(--resizer-shift)}.bottomRight:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){bottom:var(--resizer-shift);right:var(--resizer-shift)}.bottomMiddle:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){bottom:var(--resizer-shift);left:calc(50% + var(--resizer-shift))}.bottomLeft:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){bottom:var(--resizer-shift);left:var(--resizer-shift)}.middleLeft:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor))>.resizers)>.resizer){top:calc(50% + var(--resizer-shift));left:var(--resizer-shift)}.topLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.bottomRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:nwse-resize}.topMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.bottomMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:ns-resize}.topRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.bottomLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:nesw-resize}.middleRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer),.middleLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer){cursor:ew-resize}.topLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.bottomRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:nesw-resize}.topMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.bottomMiddle:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:ew-resize}.topRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.bottomLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:nwse-resize}.middleRight:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer),.middleLeft:is(:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer){cursor:ns-resize}:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"])) .editToolbar{rotate:270deg}[dir=ltr] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"])) .editToolbar){inset-inline-end:calc(0px - var(--editor-toolbar-vert-offset));inset-block-start:0}[dir=rtl] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"])) .editToolbar){inset-inline-end:calc(100% + var(--editor-toolbar-vert-offset));inset-block-start:0}:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="180"],[data-main-rotation="90"] [data-editor-rotation="90"],[data-main-rotation="180"] [data-editor-rotation="0"],[data-main-rotation="270"] [data-editor-rotation="270"])) .editToolbar{rotate:180deg;inset-inline-end:100%;inset-block-start:calc(0pc - var(--editor-toolbar-vert-offset))}:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"])) .editToolbar{rotate:90deg}[dir=ltr] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"])) .editToolbar){inset-inline-end:calc(100% + var(--editor-toolbar-vert-offset));inset-block-start:100%}[dir=rtl] :is(:is(.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"])) .editToolbar){inset-inline-start:calc(0px - var(--editor-toolbar-vert-offset));inset-block-start:0}.dialog.altText::backdrop{-webkit-mask:url(#alttext-manager-mask);mask:url(#alttext-manager-mask)}.dialog.altText.positioned{margin:0}.dialog.altText #altTextContainer{width:300px;height:-moz-fit-content;height:fit-content;display:inline-flex;flex-direction:column;align-items:flex-start;gap:16px}:is(.dialog.altText #altTextContainer) #overallDescription{display:flex;flex-direction:column;align-items:flex-start;gap:4px;align-self:stretch}:is(:is(.dialog.altText #altTextContainer) #overallDescription) span{align-self:stretch}:is(:is(.dialog.altText #altTextContainer) #overallDescription) .title{font-size:13px;font-style:normal;font-weight:590}:is(.dialog.altText #altTextContainer) #addDescription{display:flex;flex-direction:column;align-items:stretch;gap:8px}:is(:is(.dialog.altText #altTextContainer) #addDescription) .descriptionArea{flex:1;padding-inline:24px 10px}:is(:is(:is(.dialog.altText #altTextContainer) #addDescription) .descriptionArea) textarea{width:100%;min-height:75px}:is(.dialog.altText #altTextContainer) #buttons{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;align-self:stretch}.dialog.newAltText{--new-alt-text-ai-disclaimer-icon:url("data:image/svg+xml,%3Csvg width%3D%2217%22 height%3D%2216%22 viewBox%3D%220 0 17 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M3.49073 1.3015L3.30873 2.1505C3.29349 2.22246 3.25769 2.28844 3.20568 2.34045C3.15368 2.39246 3.08769 2.42826 3.01573 2.4435L2.16673 2.6255C1.76473 2.7125 1.76473 3.2865 2.16673 3.3725L3.01573 3.5555C3.08769 3.57074 3.15368 3.60654 3.20568 3.65855C3.25769 3.71056 3.29349 3.77654 3.30873 3.8485L3.49073 4.6975C3.57773 5.0995 4.15173 5.0995 4.23773 4.6975L4.42073 3.8485C4.43598 3.77654 4.47177 3.71056 4.52378 3.65855C4.57579 3.60654 4.64178 3.57074 4.71373 3.5555L5.56173 3.3725C5.96373 3.2855 5.96373 2.7115 5.56173 2.6255L4.71273 2.4435C4.64083 2.42814 4.57491 2.3923 4.52292 2.34031C4.47093 2.28832 4.43509 2.2224 4.41973 2.1505L4.23773 1.3015C4.15073 0.8995 3.57673 0.8995 3.49073 1.3015ZM10.8647 13.9995C10.4853 14.0056 10.1158 13.8782 9.82067 13.6397C9.52553 13.4013 9.32347 13.0667 9.24973 12.6945L8.89273 11.0275C8.83676 10.7687 8.70738 10.5316 8.52009 10.3445C8.3328 10.1574 8.09554 10.0282 7.83673 9.9725L6.16973 9.6155C5.38873 9.4465 4.86473 8.7975 4.86473 7.9995C4.86473 7.2015 5.38873 6.5525 6.16973 6.3845L7.83673 6.0275C8.09551 5.97135 8.33267 5.84193 8.51992 5.65468C8.70716 5.46744 8.83658 5.23028 8.89273 4.9715L9.25073 3.3045C9.41773 2.5235 10.0667 1.9995 10.8647 1.9995C11.6627 1.9995 12.3117 2.5235 12.4797 3.3045L12.8367 4.9715C12.9507 5.4995 13.3647 5.9135 13.8927 6.0265L15.5597 6.3835C16.3407 6.5525 16.8647 7.2015 16.8647 7.9995C16.8647 8.7975 16.3407 9.4465 15.5597 9.6145L13.8927 9.9715C13.6337 10.0275 13.3963 10.157 13.209 10.3445C13.0217 10.5319 12.8925 10.7694 12.8367 11.0285L12.4787 12.6945C12.4054 13.0667 12.2036 13.4014 11.9086 13.6399C11.6135 13.8784 11.2441 14.0057 10.8647 13.9995ZM10.8647 3.2495C10.7667 3.2495 10.5337 3.2795 10.4727 3.5655L10.1147 5.2335C10.0081 5.72777 9.76116 6.18082 9.40361 6.53837C9.04606 6.89593 8.59301 7.14283 8.09873 7.2495L6.43173 7.6065C6.14573 7.6685 6.11473 7.9015 6.11473 7.9995C6.11473 8.0975 6.14573 8.3305 6.43173 8.3925L8.09873 8.7495C8.59301 8.85617 9.04606 9.10307 9.40361 9.46062C9.76116 9.81817 10.0081 10.2712 10.1147 10.7655L10.4727 12.4335C10.5337 12.7195 10.7667 12.7495 10.8647 12.7495C10.9627 12.7495 11.1957 12.7195 11.2567 12.4335L11.6147 10.7665C11.7212 10.272 11.9681 9.81878 12.3256 9.46103C12.6832 9.10329 13.1363 8.85624 13.6307 8.7495L15.2977 8.3925C15.5837 8.3305 15.6147 8.0975 15.6147 7.9995C15.6147 7.9015 15.5837 7.6685 15.2977 7.6065L13.6307 7.2495C13.1365 7.14283 12.6834 6.89593 12.3259 6.53837C11.9683 6.18082 11.7214 5.72777 11.6147 5.2335L11.2567 3.5655C11.1957 3.2795 10.9627 3.2495 10.8647 3.2495ZM3.30873 12.1505L3.49073 11.3015C3.57673 10.8995 4.15073 10.8995 4.23773 11.3015L4.41973 12.1505C4.43509 12.2224 4.47093 12.2883 4.52292 12.3403C4.57491 12.3923 4.64083 12.4281 4.71273 12.4435L5.56173 12.6255C5.96373 12.7115 5.96373 13.2855 5.56173 13.3725L4.71273 13.5545C4.64083 13.5699 4.57491 13.6057 4.52292 13.6577C4.47093 13.7097 4.43509 13.7756 4.41973 13.8475L4.23773 14.6965C4.15173 15.0985 3.57773 15.0985 3.49073 14.6965L3.30873 13.8475C3.29337 13.7756 3.25754 13.7097 3.20555 13.6577C3.15356 13.6057 3.08764 13.5699 3.01573 13.5545L2.16673 13.3725C1.76473 13.2865 1.76473 12.7125 2.16673 12.6255L3.01573 12.4435C3.08769 12.4283 3.15368 12.3925 3.20568 12.3405C3.25769 12.2884 3.29349 12.2225 3.30873 12.1505Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");--new-alt-text-spinner-icon:url("data:image/svg+xml,%3C!-- This Source Code Form is subject to the terms of the Mozilla Public - License%2C v. 2.0. If a copy of the MPL was not distributed with this - file%2C You can obtain one at http%3A%2F%2Fmozilla.org%2FMPL%2F2.0%2F. --%3E%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 16 16%22 width%3D%2216%22 height%3D%2216%22%3E %3Cstyle%3E %40media not (prefers-reduced-motion) %7B %40keyframes loadingRotate %7B from %7B rotate%3A 0%3B %7D to %7B rotate%3A 360deg %7D %7D %23circle-arrows %7B animation%3A loadingRotate 1.8s linear infinite%3B transform-origin%3A 50%25 50%25%3B %7D %23hourglass %7B display%3A none%3B %7D %7D %40media (prefers-reduced-motion) %7B %23circle-arrows %7B display%3A none%3B %7D %7D %3C%2Fstyle%3E %3Cpath id%3D%22circle-arrows%22 d%3D%22M9 5.528c0 .42.508.63.804.333l2.528-2.528a.47.47 0 0 0 0-.666L9.805.14A.471.471 0 0 0 9 .472v1.866A5.756 5.756 0 0 0 2.25 8c0 .942.232 1.83.635 2.615l1.143-1.143A4.208 4.208 0 0 1 3.75 8 4.254 4.254 0 0 1 8 3.75c.345 0 .68.042 1 .122v1.656zM7 10.472v1.656c.32.08.655.122 1 .122A4.254 4.254 0 0 0 12.25 8c0-.52-.107-1.013-.279-1.474l1.143-1.143c.404.786.636 1.674.636 2.617A5.756 5.756 0 0 1 7 13.662v1.866a.47.47 0 0 1-.804.333l-2.528-2.528a.47.47 0 0 1 0-.666l2.528-2.528a.47.47 0 0 1 .804.333z%22%2F%3E %3Cg id%3D%22hourglass%22%3E %3Cpath d%3D%22M13%2C1 C13.5522847%2C1 14%2C1.44771525 14%2C2 C14%2C2.55228475 13.5522847%2C3 13%2C3 L12.9854217%2C2.99990801 C12.9950817%2C3.16495885 13%2C3.33173274 13%2C3.5 C13%2C5.24679885 10.9877318%2C6.01090495 10.9877318%2C8.0017538 C10.9877318%2C9.99260264 13%2C10.7536922 13%2C12.5 C13%2C12.6686079 12.9950617%2C12.8357163 12.985363%2C13.0010943 L13%2C13 C13.5522847%2C13 14%2C13.4477153 14%2C14 C14%2C14.5522847 13.5522847%2C15 13%2C15 L3%2C15 C2.44771525%2C15 2%2C14.5522847 2%2C14 C2%2C13.4477153 2.44771525%2C13 3%2C13 L3.01463704%2C13.0010943 C3.00493827%2C12.8357163 3%2C12.6686079 3%2C12.5 C3%2C10.7536922 4.9877318%2C9.99260264 5%2C8.0017538 C5.0122682%2C6.01090495 3%2C5.24679885 3%2C3.5 C3%2C3.33173274 3.00491834%2C3.16495885 3.01457832%2C2.99990801 L3%2C3 C2.44771525%2C3 2%2C2.55228475 2%2C2 C2%2C1.44771525 2.44771525%2C1 3%2C1 L13%2C1 Z M10.987%2C3 L5.012%2C3 L5.00308914%2C3.24815712 C5.00103707%2C3.33163368 5%2C3.4155948 5%2C3.5 C5%2C5.36125069 6.99153646%2C6.01774089 6.99153646%2C8.0017538 C6.99153646%2C9.98576671 5%2C10.6393737 5%2C12.5 L5.00307746%2C12.7513676 L5.01222201%2C12.9998392 L5.60191711%2C12.9988344 L6.0425138%2C12.2959826 C7.02362731%2C10.7653275 7.67612271%2C10 8%2C10 C8.37014547%2C10 9.16950644%2C10.9996115 10.3980829%2C12.9988344 L10.987778%2C12.9998392 C10.9958674%2C12.8352104 11%2C12.66849 11%2C12.5 C11%2C10.6393737 8.98689779%2C10.0147381 8.98689779%2C8.0017538 C8.98689779%2C5.98876953 11%2C5.36125069 11%2C3.5 L10.9969109%2C3.24815712 L10.987%2C3 Z%22%2F%3E %3Cpath d%3D%22M6%2C4 L10%2C4 C8.95166016%2C6 8.28499349%2C7 8%2C7 C7.71500651%2C7 7.04833984%2C6 6%2C4 Z%22%2F%3E %3C%2Fg%3E%3C%2Fsvg%3E");--csstools-light-dark-toggle--56:var(--csstools-color-scheme--light) #2b2a33;--preview-image-bg-color:var(--csstools-light-dark-toggle--56, #f0f0f4);--preview-image-border:none}@supports (color: light-dark(red,red)){.dialog.newAltText{--preview-image-bg-color:light-dark(#f0f0f4, #2b2a33)}}@supports not (color: light-dark(tan,tan)){.dialog.newAltText *{--csstools-light-dark-toggle--56:var(--csstools-color-scheme--light) #2b2a33;--preview-image-bg-color:var(--csstools-light-dark-toggle--56, #f0f0f4)}}@media screen and (forced-colors: active){.dialog.newAltText{--preview-image-bg-color:ButtonFace;--preview-image-border:1px solid ButtonText}}.dialog.newAltText{width:80%;max-width:570px;min-width:300px;padding:0}.dialog.newAltText.noAi #newAltTextDisclaimer,.dialog.newAltText.noAi #newAltTextCreateAutomatically,.dialog.newAltText.aiInstalling #newAltTextCreateAutomatically{display:none!important}.dialog.newAltText.aiInstalling #newAltTextDownloadModel{display:flex!important}.dialog.newAltText.error #newAltTextNotNow{display:none!important}.dialog.newAltText.error #newAltTextCancel{display:inline-block!important}.dialog.newAltText:not(.error) #newAltTextError{display:none!important}.dialog.newAltText #newAltTextContainer{display:flex;width:auto;padding:16px;flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:12px;flex:0 1 auto;line-height:normal}:is(.dialog.newAltText #newAltTextContainer) #mainContent{display:flex;justify-content:flex-end;align-items:flex-start;gap:12px;align-self:stretch;flex:1 1 auto}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionAndSettings{display:flex;flex-direction:column;align-items:flex-start;gap:16px;flex:1 0 0;align-self:stretch}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction{display:flex;flex-direction:column;align-items:flex-start;gap:8px;align-self:stretch;flex:1 1 auto}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer{width:100%;height:70px;position:relative}:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea{width:100%;height:100%;padding:8px}:is(:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea)::-moz-placeholder{color:var(--text-secondary-color)}:is(:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea)::placeholder{color:var(--text-secondary-color)}:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) .altTextSpinner{display:none;position:absolute;width:16px;height:16px;inset-inline-start:8px;inset-block-start:8px;-webkit-mask-size:cover;mask-size:cover;background-color:var(--text-secondary-color);pointer-events:none}.loading:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea::-moz-placeholder{color:transparent}.loading:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) textarea::placeholder{color:transparent}.loading:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescriptionContainer) .altTextSpinner{display:inline-block;-webkit-mask-image:var(--new-alt-text-spinner-icon);mask-image:var(--new-alt-text-spinner-icon)}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDescription{font-size:11px}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDisclaimer{display:flex;flex-direction:row;align-items:flex-start;gap:4px;font-size:11px}:is(:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #descriptionInstruction) #newAltTextDisclaimer):before{content:"";display:inline-block;width:17px;height:16px;-webkit-mask-image:var(--new-alt-text-ai-disclaimer-icon);mask-image:var(--new-alt-text-ai-disclaimer-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--text-secondary-color);flex:1 0 auto}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextDownloadModel{display:flex;align-items:center;gap:4px;align-self:stretch}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextDownloadModel):before{content:"";display:inline-block;width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-spinner-icon);mask-image:var(--new-alt-text-spinner-icon);-webkit-mask-size:cover;mask-size:cover;background-color:var(--text-secondary-color)}:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextImagePreview{width:180px;aspect-ratio:1;display:flex;justify-content:center;align-items:center;flex:0 0 auto;background-color:var(--preview-image-bg-color);border:var(--preview-image-border)}:is(:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) #newAltTextImagePreview)>canvas{max-width:100%;max-height:100%}.colorPicker{--csstools-light-dark-toggle--57:var(--csstools-color-scheme--light) #80ebff;--hover-outline-color:var(--csstools-light-dark-toggle--57, #0250bb);--csstools-light-dark-toggle--58:var(--csstools-color-scheme--light) #aaf2ff;--selected-outline-color:var(--csstools-light-dark-toggle--58, #0060df);--csstools-light-dark-toggle--59:var(--csstools-color-scheme--light) #52525e;--swatch-border-color:var(--csstools-light-dark-toggle--59, #cfcfd8)}@supports (color: light-dark(red,red)){.colorPicker{--hover-outline-color:light-dark(#0250bb, #80ebff);--selected-outline-color:light-dark(#0060df, #aaf2ff);--swatch-border-color:light-dark(#cfcfd8, #52525e)}}@supports not (color: light-dark(tan,tan)){.colorPicker *{--csstools-light-dark-toggle--57:var(--csstools-color-scheme--light) #80ebff;--hover-outline-color:var(--csstools-light-dark-toggle--57, #0250bb);--csstools-light-dark-toggle--58:var(--csstools-color-scheme--light) #aaf2ff;--selected-outline-color:var(--csstools-light-dark-toggle--58, #0060df);--csstools-light-dark-toggle--59:var(--csstools-color-scheme--light) #52525e;--swatch-border-color:var(--csstools-light-dark-toggle--59, #cfcfd8)}}@media screen and (forced-colors: active){.colorPicker{--hover-outline-color:Highlight;--selected-outline-color:var(--hover-outline-color);--swatch-border-color:ButtonText}}.colorPicker .swatch{width:16px;height:16px;border:1px solid var(--swatch-border-color);border-radius:100%;outline-offset:2px;box-sizing:border-box;forced-color-adjust:none}.colorPicker button:is(:hover,.selected)>.swatch{border:none}.annotationEditorLayer[data-main-rotation="0"] .highlightEditor:not(.free)>.editToolbar{rotate:0deg}.annotationEditorLayer[data-main-rotation="90"] .highlightEditor:not(.free)>.editToolbar{rotate:270deg}.annotationEditorLayer[data-main-rotation="180"] .highlightEditor:not(.free)>.editToolbar{rotate:180deg}.annotationEditorLayer[data-main-rotation="270"] .highlightEditor:not(.free)>.editToolbar{rotate:90deg}.annotationEditorLayer .highlightEditor{position:absolute;background:transparent;z-index:1;cursor:auto;max-width:100%;max-height:100%;border:none;outline:none;pointer-events:none;transform-origin:0 0}:is(.annotationEditorLayer .highlightEditor):not(.free){transform:none}:is(.annotationEditorLayer .highlightEditor) .internal{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:auto}.disabled:is(.annotationEditorLayer .highlightEditor) .internal{pointer-events:none}.selectedEditor:is(.annotationEditorLayer .highlightEditor) .internal{cursor:pointer}:is(.annotationEditorLayer .highlightEditor) .editToolbar{--editor-toolbar-colorpicker-arrow-image:url("data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M8.23336 10.4664L11.8474 6.85339C11.894 6.8071 11.931 6.75203 11.9563 6.69136C11.9816 6.63069 11.9946 6.56562 11.9946 6.49989C11.9946 6.43417 11.9816 6.3691 11.9563 6.30843C11.931 6.24776 11.894 6.19269 11.8474 6.14639C11.7536 6.05266 11.6264 6 11.4939 6C11.3613 6 11.2341 6.05266 11.1404 6.14639L7.99236 9.29339L4.84736 6.14739C4.75305 6.05631 4.62675 6.00592 4.49566 6.00706C4.36456 6.0082 4.23915 6.06078 4.14645 6.15348C4.05374 6.24619 4.00116 6.37159 4.00002 6.50269C3.99888 6.63379 4.04928 6.76009 4.14036 6.85439L7.75236 10.4674L8.23336 10.4664Z%22 fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");transform-origin:center!important}:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker{position:relative;width:auto;display:flex;justify-content:center;align-items:center;gap:4px;padding:4px}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):after{content:"";-webkit-mask-image:var(--editor-toolbar-colorpicker-arrow-image);mask-image:var(--editor-toolbar-colorpicker-arrow-image);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;display:inline-block;background-color:var(--editor-toolbar-fg-color);width:12px;height:12px}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):hover:after{background-color:var(--editor-toolbar-hover-fg-color)}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):has(.dropdown:not(.hidden)){background-color:var(--editor-toolbar-hover-bg-color)}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker):has(.dropdown:not(.hidden)):after{scale:-1}:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown{position:absolute;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:11px;padding-block:8px;border-radius:6px;background-color:var(--editor-toolbar-bg-color);border:1px solid var(--editor-toolbar-border-color);box-shadow:var(--editor-toolbar-shadow);inset-block-start:calc(100% + 4px);width:calc(100% + 2 * var(--editor-toolbar-padding))}:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button{width:100%;height:auto;border:none;cursor:pointer;display:flex;justify-content:center;align-items:center;background:none}:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button):is(:active,:focus-visible){outline:none}:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button)>.swatch{outline-offset:2px}[aria-selected=true]:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button)>.swatch{outline:2px solid var(--selected-outline-color)}:is(:is(:is(:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) .colorPicker) .dropdown) button):is(:hover,:active,:focus-visible)>.swatch{outline:2px solid var(--hover-outline-color)}.editorParamsToolbar:has(#highlightParamsToolbarContainer){padding:unset}#highlightParamsToolbarContainer{gap:16px;padding-inline:10px;padding-block-end:12px}#highlightParamsToolbarContainer .colorPicker{display:flex;flex-direction:column;gap:8px}:is(#highlightParamsToolbarContainer .colorPicker) .dropdown{display:flex;justify-content:space-between;align-items:center;flex-direction:row;height:auto}:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button{width:auto;height:auto;border:none;cursor:pointer;display:flex;justify-content:center;align-items:center;background:none;flex:0 0 auto;padding:0}:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button) .swatch{width:24px;height:24px}:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button):is(:active,:focus-visible){outline:none}[aria-selected=true]:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button)>.swatch{outline:2px solid var(--selected-outline-color)}:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button):is(:hover,:active,:focus-visible)>.swatch{outline:2px solid var(--hover-outline-color)}#highlightParamsToolbarContainer #editorHighlightThickness{display:flex;flex-direction:column;align-items:center;gap:4px;align-self:stretch}:is(#highlightParamsToolbarContainer #editorHighlightThickness) .editorParamsLabel{height:auto;align-self:stretch}:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker{display:flex;justify-content:space-between;align-items:center;align-self:stretch;--csstools-light-dark-toggle--60:var(--csstools-color-scheme--light) #80808e;--example-color:var(--csstools-light-dark-toggle--60, #bfbfc9)}@supports (color: light-dark(red,red)){:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker{--example-color:light-dark(#bfbfc9, #80808e)}}@supports not (color: light-dark(tan,tan)){:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker) *{--csstools-light-dark-toggle--60:var(--csstools-color-scheme--light) #80808e;--example-color:var(--csstools-light-dark-toggle--60, #bfbfc9)}}@media screen and (forced-colors: active){:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker{--example-color:CanvasText}}:is(:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker)>.editorParamsSlider[disabled]){opacity:.4}:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker):before,:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker):after{content:"";width:8px;aspect-ratio:1;display:block;border-radius:100%;background-color:var(--example-color)}:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker):after{width:24px}:is(:is(#highlightParamsToolbarContainer #editorHighlightThickness) .thicknessPicker) .editorParamsSlider{width:unset;height:14px}#highlightParamsToolbarContainer #editorHighlightVisibility{display:flex;flex-direction:column;align-items:flex-start;gap:8px;align-self:stretch}:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{--csstools-light-dark-toggle--61:var(--csstools-color-scheme--light) #8f8f9d;--divider-color:var(--csstools-light-dark-toggle--61, #d7d7db)}@supports (color: light-dark(red,red)){:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{--divider-color:light-dark(#d7d7db, #8f8f9d)}}@supports not (color: light-dark(tan,tan)){:is(:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider) *{--csstools-light-dark-toggle--61:var(--csstools-color-scheme--light) #8f8f9d;--divider-color:var(--csstools-light-dark-toggle--61, #d7d7db)}}@media screen and (forced-colors: active){:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{--divider-color:CanvasText}}:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider{margin-block:4px;width:100%;height:1px;background-color:var(--divider-color)}:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .toggler{display:flex;justify-content:space-between;align-items:center;align-self:stretch}#altTextSettingsDialog{padding:16px}#altTextSettingsDialog #altTextSettingsContainer{display:flex;width:573px;flex-direction:column;gap:16px}:is(#altTextSettingsDialog #altTextSettingsContainer) .mainContainer{gap:16px}:is(#altTextSettingsDialog #altTextSettingsContainer) .description{color:var(--text-secondary-color)}:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings{display:flex;flex-direction:column;gap:12px}:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings) button{width:-moz-fit-content;width:fit-content}.download:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings) #deleteModelButton{display:none}:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings):not(.download) #downloadModelButton{display:none}:is(#altTextSettingsDialog #altTextSettingsContainer) #automaticAltText,:is(#altTextSettingsDialog #altTextSettingsContainer) #altTextEditor{display:flex;flex-direction:column;gap:8px}:is(#altTextSettingsDialog #altTextSettingsContainer) #createModelDescription,:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings,:is(#altTextSettingsDialog #altTextSettingsContainer) #showAltTextDialogDescription{padding-inline-start:40px}:is(#altTextSettingsDialog #altTextSettingsContainer) #automaticSettings{display:flex;flex-direction:column;gap:16px}:root{--csstools-color-scheme--light:initial;color-scheme:light dark;--viewer-container-height:0;--pdfViewer-padding-bottom:0;--page-margin:1px auto -8px;--page-border:9px solid transparent;--spreadHorizontalWrapped-margin-LR:-3.5px;--loading-icon-delay:.4s;--csstools-light-dark-toggle--62:var(--csstools-color-scheme--light) #0df;--focus-ring-color:var(--csstools-light-dark-toggle--62, #0060df);--focus-ring-outline:2px solid var(--focus-ring-color)}@supports (color: light-dark(red,red)){:root{--focus-ring-color:light-dark(#0060df, #0df)}}@supports not (color: light-dark(tan,tan)){:root *{--csstools-light-dark-toggle--62:var(--csstools-color-scheme--light) #0df;--focus-ring-color:var(--csstools-light-dark-toggle--62, #0060df)}}@media (prefers-color-scheme: dark){:root{--csstools-color-scheme--light:}}@media screen and (forced-colors: active){:root{--pdfViewer-padding-bottom:9px;--page-margin:8px auto -1px;--page-border:1px solid CanvasText;--spreadHorizontalWrapped-margin-LR:3.5px;--focus-ring-color:CanvasText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}#hiddenCopyElement,.hiddenCanvasElement{position:absolute;top:0;left:0;width:0;height:0;display:none}.pdfViewer{--scale-factor:1;--page-bg-color:unset;padding-bottom:var(--pdfViewer-padding-bottom);--hcm-highlight-filter:none;--hcm-highlight-selected-filter:none}@media screen and (forced-colors: active){.pdfViewer{--hcm-highlight-filter:invert(100%)}}.pdfViewer.copyAll{cursor:wait}.pdfViewer .canvasWrapper{overflow:hidden;width:100%;height:100%}:is(.pdfViewer .canvasWrapper) canvas{position:absolute;top:0;left:0;margin:0;display:block;width:100%;height:100%;contain:content}:is(:is(.pdfViewer .canvasWrapper) canvas) .structTree{contain:strict}.pdfViewer .page{--user-unit:1;--total-scale-factor:calc(var(--scale-factor) * var(--user-unit));--scale-round-x:1px;--scale-round-y:1px;direction:ltr;width:816px;height:1056px;margin:var(--page-margin);position:relative;overflow:visible;border:var(--page-border);background-clip:content-box;background-color:var(--page-bg-color, rgb(255 255 255))}.pdfViewer .dummyPage{position:relative;width:0;height:var(--viewer-container-height)}.pdfViewer.noUserSelect{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}.pdfViewer.singlePageView{display:inline-block}.pdfViewer.singlePageView .page{margin:0;border:none}.pdfViewer:is(.scrollHorizontal,.scrollWrapped),.spread{margin-inline:3.5px;text-align:center}.pdfViewer.scrollHorizontal,.spread{white-space:nowrap}.pdfViewer.removePageBorders,.pdfViewer:is(.scrollHorizontal,.scrollWrapped) .spread{margin-inline:0}.spread :is(.page,.dummyPage),.pdfViewer:is(.scrollHorizontal,.scrollWrapped) :is(.page,.spread){display:inline-block;vertical-align:middle}.spread .page,.pdfViewer:is(.scrollHorizontal,.scrollWrapped) .page{margin-inline:var(--spreadHorizontalWrapped-margin-LR)}.pdfViewer.removePageBorders .spread .page,.pdfViewer.removePageBorders:is(.scrollHorizontal,.scrollWrapped) .page{margin-inline:5px}.pdfViewer .page.loadingIcon:after{position:absolute;top:0;left:0;content:"";width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8OfwIchACH5BAkHAAAALAAAAAAYABgAAAW4ICCOJIAgZVoOBJkkpDKoo5EI43GMjNPSokXCINKJCI4HcCRIQEQvqIOhGhBHhUTDhGo4diOZyFAoKEQDxra2mAEgjghOpCgz3LTBIxJ5kgwMBShACREHZ1V4Kg1rS44pBAgMDAg/Sw0GBAQGDZGTlY+YmpyPpSQDiqYiDQoCliqZBqkGAgKIS5kEjQ21VwCyp76dBHiNvz+MR74AqSOdVwbQuo+abppo10ssjdkAnc0rf8vgl8YqIQAh+QQJBwAAACwAAAAAGAAYAAAFrCAgjiQgCGVaDgZZFCQxqKNRKGOSjMjR0qLXTyciHA7AkaLACMIAiwOC1iAxCrMToHHYjWQiA4NBEA0Q1RpWxHg4cMXxNDk4OBxNUkPAQAEXDgllKgMzQA1pSYopBgonCj9JEA8REQ8QjY+RQJOVl4ugoYssBJuMpYYjDQSliwasiQOwNakALKqsqbWvIohFm7V6rQAGP6+JQLlFg7KDQLKJrLjBKbvAor3IKiEAIfkECQcAAAAsAAAAABgAGAAABbUgII4koChlmhokw5DEoI4NQ4xFMQoJO4uuhignMiQWvxGBIQC+AJBEUyUcIRiyE6CR0CllW4HABxBURTUw4nC4FcWo5CDBRpQaCoF7VjgsyCUDYDMNZ0mHdwYEBAaGMwwHDg4HDA2KjI4qkJKUiJ6faJkiA4qAKQkRB3E0i6YpAw8RERAjA4tnBoMApCMQDhFTuySKoSKMJAq6rD4GzASiJYtgi6PUcs9Kew0xh7rNJMqIhYchACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJEAQZZo2JIKQxqCOjWCMDDMqxT2LAgELkBMZCoXfyCBQiFwiRsGpku0EshNgUNAtrYPT0GQVNRBWwSKBMp98P24iISgNDAS4ipGA6JUpA2WAhDR4eWM/CAkHBwkIDYcGiTOLjY+FmZkNlCN3eUoLDmwlDW+AAwcODl5bYl8wCVYMDw5UWzBtnAANEQ8kBIM0oAAGPgcREIQnVloAChEOqARjzgAQEbczg8YkWJq8nSUhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJGAYZZoOpKKQqDoORDMKwkgwtiwSBBYAJ2owGL5RgxBziQQMgkwoMkhNqAEDARPSaiMDFdDIiRSFQowMXE8Z6RdpYHWnEAWGPVkajPmARVZMPUkCBQkJBQINgwaFPoeJi4GVlQ2Qc3VJBQcLV0ptfAMJBwdcIl+FYjALQgimoGNWIhAQZA4HXSpLMQ8PIgkOSHxAQhERPw7ASTSFyCMMDqBTJL8tf3y2fCEAIfkECQcAAAAsAAAAABgAGAAABa8gII4k0DRlmg6kYZCoOg5EDBDEaAi2jLO3nEkgkMEIL4BLpBAkVy3hCTAQKGAznM0AFNFGBAbj2cA9jQixcGZAGgECBu/9HnTp+FGjjezJFAwFBQwKe2Z+KoCChHmNjVMqA21nKQwJEJRlbnUFCQlFXlpeCWcGBUACCwlrdw8RKGImBwktdyMQEQciB7oACwcIeA4RVwAODiIGvHQKERAjxyMIB5QlVSTLYLZ0sW8hACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWPM5wNiV0UDUIBNkdoepTfMkA7thIECiyRtUAGq8fm2O4jIBgMBA1eAZ6Knx+gHaJR4QwdCMKBxEJRggFDGgQEREPjjAMBQUKIwIRDhBDC2QNDDEKoEkDoiMHDigICGkJBS2dDA6TAAnAEAkCdQ8ORQcHTAkLcQQODLPMIgIJaCWxJMIkPIoAt3EhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWHM5wNiV0UN3xdLiqr+mENcWpM9TIbrsBkEck8oC0DQqBQGGIz+t3eXtob0ZTPgNrIwQJDgtGAgwCWSIMDg4HiiUIDAxFAAoODwxDBWINCEGdSTQkCQcoegADBaQ6MggHjwAFBZUFCm0HB0kJCUy9bAYHCCPGIwqmRq0jySMGmj6yRiEAIfkECQcAAAAsAAAAABgAGAAABbIgII4k0DRlmg6kYZCsOg4EKhLE2BCxDOAxnIiW84l2L4BLZKipBopW8XRLDkeCiAMyMvQAA+uON4JEIo+vqukkKQ6RhLHplVGN+LyKcXA4Dgx5DWwGDXx+gIKENnqNdzIDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==) center no-repeat;display:none;transition-property:display;transition-delay:var(--loading-icon-delay);z-index:5;contain:strict}.pdfViewer .page.loading:after{display:block}.pdfViewer .page:not(.loading):after{transition-property:none;display:none}.pdfPresentationMode .pdfViewer{padding-bottom:0}.pdfPresentationMode .spread{margin:0}.pdfPresentationMode .pdfViewer .page{margin:0 auto;border:2px solid transparent}:is(:is(:is(:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor),.textLayer) .editToolbar) .buttons) .delete):before{display:block!important}.pdfSlickViewer *,.pdfSlickViewer *:before,.pdfSlickViewer *:after{box-sizing:initial!important}.pdfSlick{scrollbar-color:rgba(0,0,0,.2) rgba(0,0,0,0);scrollbar-width:thin}.pdfSlick .page{box-sizing:initial}.pdfSlick *::-webkit-scrollbar{width:7px;height:7px}.pdfSlick *::-webkit-scrollbar-button{width:0;height:0;display:none}.pdfSlick *::-webkit-scrollbar-corner{background-color:transparent}.pdfSlick *::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2);-webkit-box-shadow:inset 1px 1px 0px rgb(0 0 0 / 10%),inset 0px -1px 0px rgb(0 0 0 / 7%)}:root{--main-color: rgb(12 12 13);--progressBar-color: rgb(10 132 255);--progressBar-bg-color: rgb(221 221 222);--progressBar-blend-color: rgb(116 177 239);--button-hover-color: color-mix(in srgb, currentColor 17%, transparent);--doorhanger-bg-color: rgb(255 255 255);--dialog-button-border: none;--dialog-button-bg-color: rgb(12 12 13 / .1);--dialog-button-hover-bg-color: rgb(12 12 13 / .3)}@media (prefers-color-scheme: dark){:root{--main-color: rgb(249 249 250);--doorhanger-bg-color: #42414d;--dialog-button-bg-color: rgb(92 92 97);--dialog-button-hover-bg-color: rgb(115 115 115)}}@media screen and (forced-colors: active){:root{--dialog-button-border: 1px solid Highlight;--dialog-button-hover-bg-color: Highlight;--dialog-button-hover-color: ButtonFace;--main-color: CanvasText}}.pdfSlick-dialog{margin:auto;padding:15px;border-spacing:4px;color:var(--main-color);font:message-box;font-size:12px;line-height:14px;background-color:var(--doorhanger-bg-color);border:1px solid rgb(0 0 0 / .5);border-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.3)}.pdfSlick-dialog::backdrop{background-color:rgba(0,0,0,.2)}.pdfSlick-dialog>.row{display:table-row}.pdfSlick-dialog>.row>*{display:table-cell}.pdfSlick-dialog :link{color:#fff}.pdfSlick-dialog .buttonRow{text-align:center;vertical-align:middle}.pdfSlick-dialog .dialogButton{border:none;background:none;width:28px;height:28px;outline:none}.pdfSlick-dialog .dialogButton:is(:hover,:focus-visible){background-color:var(--dialog-button-hover-bg-color)}.pdfSlick-dialog .dialogButton:is(:hover,:focus-visible)>span{color:var(--dialog-button-hover-color)}.pdfSlick-dialog .dialogButton{min-width:16px;margin:2px 1px;padding:2px 6px 0;border:none;border-radius:2px;color:var(--main-color);font-size:12px;line-height:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:default;box-sizing:border-box}.pdfSlick-dialog .dialogButton{width:auto;margin:3px 4px 2px!important;padding:2px 11px;color:var(--main-color);background-color:var(--dialog-button-bg-color);border:var(--dialog-button-border)!important}\n/*$vite$:1*/',document.head.appendChild(Y);
|
|
2
|
-
/**
|
|
3
|
-
* @licstart The following is the entire license notice for the
|
|
4
|
-
* JavaScript code in this page
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2024 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
|
-
const K=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),Q=[.001,0,0,.001,0,0],Z=1.35,J=1,tt=2,et=4,it=16,nt=32,rt=64,st=128,at=256,ot={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},lt="pdfjs_internal_editor_",dt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101},ht={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},ct=0,ut=1,gt=2,pt=3,ft=3,mt=4,bt={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},vt={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},wt=1,xt=2,yt=3,At=4,Ct=5,Et={ERRORS:0,WARNINGS:1,INFOS:5},St={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},kt=0,_t=1,Tt=2,Lt=3;let Dt=Et.WARNINGS;function Pt(t){Number.isInteger(t)&&(Dt=t)}function Mt(){return Dt}function Ft(t){Dt>=Et.INFOS&&console.log(`Info: ${t}`)}function It(t){Dt>=Et.WARNINGS&&console.log(`Warning: ${t}`)}function Rt(t){throw new Error(t)}function Bt(t,e){t||Rt(e)}function Nt(t,e=null,i=null){if(!t)return null;if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch{}}const n=e?URL.parse(t,e):URL.parse(t);return function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n)?n:null}function Ot(t,e,i=!1){const n=URL.parse(t);return n?(n.hash=e,n.href):i&&Nt(t,"http://example.com")?t.split("#",1)[0]+""+(e?`#${e}`:""):""}function zt(t,e,i,n=!1){return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const Ht=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=new Error,t.constructor=t,t}();class Vt extends Ht{constructor(t,e){super(t,"PasswordException"),this.code=e}}class jt extends Ht{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}let Ut=class extends Ht{constructor(t){super(t,"InvalidPDFException")}},Wt=class extends Ht{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}};class $t extends Ht{constructor(t){super(t,"FormatError")}}let Gt=class extends Ht{constructor(t){super(t,"AbortException")}};function qt(t){"object"==typeof t&&void 0!==t?.length||Rt("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let r=0;r<e;r+=i){const s=Math.min(r+i,e),a=t.subarray(r,s);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function Xt(t){"string"!=typeof t&&Rt("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}class Yt{static get isLittleEndian(){return zt(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return zt(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return zt(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return zt(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){const{platform:t,userAgent:e}=navigator;return zt(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return zt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Kt=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));let Qt=class{static makeHexColor(t,e,i){return`#${Kt[t]}${Kt[e]}${Kt[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e,i=0){const n=t[i],r=t[i+1];t[i]=n*e[0]+r*e[2]+e[4],t[i+1]=n*e[1]+r*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5];for(let d=0;d<6;d+=2){const e=t[i+d],h=t[i+d+1];t[i+d]=e*n+h*s+o,t[i+d+1]=e*r+h*a+l}}static applyInverseTransform(t,e){const i=t[0],n=t[1],r=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/r,t[1]=(-i*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/r}static axialAlignedBoundingBox(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],d=t[0],h=t[1],c=t[2],u=t[3];let g=n*d+o,p=g,f=n*c+o,m=f,b=a*h+l,v=b,w=a*u+l,x=w;if(0!==r||0!==s){const t=r*d,e=r*c,i=s*h,n=s*u;g+=i,m+=i,f+=n,p+=n,b+=t,x+=t,w+=e,v+=e}i[0]=Math.min(i[0],g,f,p,m),i[1]=Math.min(i[1],b,w,v,x),i[2]=Math.max(i[2],g,f,p,m),i[3]=Math.max(i[3],b,w,v,x)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],a=i**2+n**2,o=i*r+n*s,l=r**2+s**2,d=(a+l)/2,h=Math.sqrt(d**2-(a*l-o**2));e[0]=Math.sqrt(d+h||1),e[1]=Math.sqrt(d-h||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>s?null:[i,r,n,s]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,n,r){r[0]=Math.min(r[0],t,i),r[1]=Math.min(r[1],e,n),r[2]=Math.max(r[2],t,i),r[3]=Math.max(r[3],e,n)}static#t(t,e,i,n,r,s,a,o,l,d){if(l<=0||l>=1)return;const h=1-l,c=l*l,u=c*l,g=h*(h*(h*t+3*l*e)+3*c*i)+u*n,p=h*(h*(h*r+3*l*s)+3*c*a)+u*o;d[0]=Math.min(d[0],g),d[1]=Math.min(d[1],p),d[2]=Math.max(d[2],g),d[3]=Math.max(d[3],p)}static#e(t,e,i,n,r,s,a,o,l,d,h,c){if(Math.abs(l)<1e-12)return void(Math.abs(d)>=1e-12&&this.#t(t,e,i,n,r,s,a,o,-h/d,c));const u=d**2-4*h*l;if(u<0)return;const g=Math.sqrt(u),p=2*l;this.#t(t,e,i,n,r,s,a,o,(-d+g)/p,c),this.#t(t,e,i,n,r,s,a,o,(-d-g)/p,c)}static bezierBoundingBox(t,e,i,n,r,s,a,o,l){l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o),this.#e(t,i,r,a,e,n,s,o,3*(3*(i-r)-t+a),6*(t-2*i+r),3*(i-t),l),this.#e(t,i,r,a,e,n,s,o,3*(3*(n-s)-e+o),6*(e-2*n+s),3*(n-e),l)}},Zt=null,Jt=null;function te(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),qt(t)}const ee="pdfjs_internal_id_";function ie(t,e,i){return Math.min(Math.max(t,e),i)}function ne(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(qt(t))}"function"!=typeof Promise.try&&(Promise.try=function(t,...e){return new Promise(i=>{i(t(...e))})}),"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(t){return t.reduce((t,e)=>t+e,0)});const re="http://www.w3.org/2000/svg";let se=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function ae(t,e="text"){if(ge(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,n)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType=e,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE)if(200!==r.status&&0!==r.status)n(new Error(r.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(r.response)}i(r.responseText)}},r.send(null)})}class oe{constructor({viewBox:t,userUnit:e,scale:i,rotation:n,offsetX:r=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=n,this.offsetX=r,this.offsetY=s,i*=e;const o=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let d,h,c,u,g,p,f,m;switch((n%=360)<0&&(n+=360),n){case 180:d=-1,h=0,c=0,u=1;break;case 90:d=0,h=1,c=1,u=0;break;case 270:d=0,h=-1,c=-1,u=0;break;case 0:d=1,h=0,c=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(c=-c,u=-u),0===d?(g=Math.abs(l-t[1])*i+r,p=Math.abs(o-t[0])*i+s,f=(t[3]-t[1])*i,m=(t[2]-t[0])*i):(g=Math.abs(o-t[0])*i+r,p=Math.abs(l-t[1])*i+s,f=(t[2]-t[0])*i,m=(t[3]-t[1])*i),this.transform=[d*i,h*i,c*i,u*i,g-d*i*o-c*i*l,p-h*i*o-u*i*l],this.width=f,this.height=m}get rawDims(){const t=this.viewBox;return zt(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:r=!1}={}){return new oe({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}convertToViewportPoint(t,e){const i=[t,e];return Qt.applyTransform(i,this.transform),i}convertToViewportRectangle(t){const e=[t[0],t[1]];Qt.applyTransform(e,this.transform);const i=[t[2],t[3]];return Qt.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){const i=[t,e];return Qt.applyInverseTransform(i,this.transform),i}}let le=class extends Ht{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}};function de(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function he(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function ce(t,e="document.pdf"){if("string"!=typeof t)return e;if(de(t))return It('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=(t=>{try{return new URL(t)}catch{try{return new URL(decodeURIComponent(t))}catch{try{return new URL(t,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch{return null}}}}})(t);if(!i)return e;const n=t=>{try{let e=decodeURIComponent(t);return e.includes("/")?(e=e.split("/").at(-1),e.test(/^\.pdf$/i)?e:t):e}catch{return t}},r=/\.pdf$/i,s=i.pathname.split("/").at(-1);if(r.test(s))return n(s);if(i.searchParams.size>0){const t=Array.from(i.searchParams.values()).reverse();for(const i of t)if(r.test(i))return n(i);const e=Array.from(i.searchParams.keys()).reverse();for(const i of e)if(r.test(i))return n(i)}if(i.hash){const t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(t)return n(t[0])}return e}class ue{started=Object.create(null);times=[];time(t){t in this.started&&It(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||It(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:r}of this.times)t.push(`${i.padEnd(e)} ${r-n}ms\n`);return t.join("")}}function ge(t,e){const i=e?URL.parse(t,e):URL.parse(t);return"http:"===i?.protocol||"https:"===i?.protocol}function pe(t){t.preventDefault()}function fe(t){t.preventDefault(),t.stopPropagation()}let me=class{static#i;static toDateObject(t){if(!t||"string"!=typeof t)return null;this.#i||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#i.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===l?(s+=d,a+=h):"+"===l&&(s-=d,a-=h),new Date(Date.UTC(i,n,r,s,a,o))}};function be(t,{scale:e=1,rotation:i=0}){const{width:n,height:r}=t.attributes.style,s=[0,0,parseInt(n),parseInt(r)];return new oe({viewBox:s,userUnit:1,scale:e,rotation:i})}function ve(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(It(`Not a valid color format: "${t}"`),[0,0,0])}function we(t){const{a:e,b:i,c:n,d:r,e:s,f:a}=t.getTransform();return[e,i,n,r,s,a]}function xe(t){const{a:e,b:i,c:n,d:r,e:s,f:a}=t.getTransform().invertSelf();return[e,i,n,r,s,a]}function ye(t,e,i=!1,n=!0){if(e instanceof oe){const{pageWidth:n,pageHeight:r}=e.rawDims,{style:s}=t,a=Yt.isCSSRoundSupported,o=`var(--total-scale-factor) * ${n}px`,l=`var(--total-scale-factor) * ${r}px`,d=a?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,h=a?`round(down, ${l}, var(--scale-round-y))`:`calc(${l})`;i&&e.rotation%180!=0?(s.width=h,s.height=d):(s.width=d,s.height=h)}n&&t.setAttribute("data-main-rotation",e.rotation)}let Ae=class t{constructor(){const{pixelRatio:e}=t;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(e,i,n,r,s=-1){let a=1/0,o=1/0,l=1/0;(n=t.capPixels(n,s))>0&&(a=Math.sqrt(n/(e*i))),-1!==r&&(o=r/e,l=r/i);const d=Math.min(a,o,l);return(this.sx>d||this.sy>d)&&(this.sx=d,this.sy=d,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}};const Ce=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Ee{#n=null;#r=null;#s;#a=null;#o=null;#l=null;static#d=null;constructor(t){this.#s=t,Ee.#d||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#n=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#s._uiManager._signal;t.addEventListener("contextmenu",pe,{signal:e}),t.addEventListener("pointerdown",Ee.#h,{signal:e});const i=this.#a=document.createElement("div");i.className="buttons",t.append(i);const n=this.#s.toolbarPosition;if(n){const{style:e}=t,i="ltr"===this.#s._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd=100*i+"%",e.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#n}static#h(t){t.stopPropagation()}#c(t){this.#s._focusEventsAllowed=!1,fe(t)}#u(t){this.#s._focusEventsAllowed=!0,fe(t)}#g(t){const e=this.#s._uiManager._signal;t.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",pe,{signal:e})}hide(){this.#n.classList.add("hidden"),this.#r?.hideDropdown()}show(){this.#n.classList.remove("hidden"),this.#o?.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=this.#s,i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",Ee.#d[t]),this.#g(i),i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),this.#a.append(i)}get#p(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const e=await t.render();this.#g(e),this.#a.append(e,this.#p),this.#o=t}addColorPicker(t){this.#r=t;const e=t.renderButton();this.#g(e),this.#a.append(e,this.#p)}async addEditSignatureButton(t){const e=this.#l=await t.renderEditButton(this.#s);this.#g(e),this.#a.append(e,this.#p)}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton()}}updateEditSignatureButton(t){this.#l&&(this.#l.title=t)}remove(){this.#n.remove(),this.#r?.destroy(),this.#r=null}}class Se{#a=null;#n=null;#f;constructor(t){this.#f=t}#m(){const t=this.#n=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",pe,{signal:this.#f._signal});const e=this.#a=document.createElement("div");return e.className="buttons",t.append(e),this.#b(),t}#v(t,e){let i=0,n=0;for(const r of t){const t=r.y+r.height;if(t<i)continue;const s=r.x+(e?r.width:0);t>i?(n=s,i=t):e?s>n&&(n=s):s<n&&(n=s)}return[e?1-n:n,i]}show(t,e,i){const[n,r]=this.#v(e,i),{style:s}=this.#n||=this.#m();t.append(this.#n),s.insetInlineEnd=100*n+"%",s.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){this.#n.remove()}#b(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=this.#f._signal;t.addEventListener("contextmenu",pe,{signal:i}),t.addEventListener("click",()=>{this.#f.highlightSelection("floating_button")},{signal:i}),this.#a.append(t)}}function ke(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}class _e{#w=0;get id(){return`${lt}${this.#w++}`}}class Te{#x=te();#w=0;#y=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',zt(this,"_isSVGFittingCanvas",e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0])))}async#A(t,e){this.#y||=new Map;let i=this.#y.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#x}_${this.#w++}`,refCounter:0,isSvg:!1},"string"==typeof e?(i.url=e,t=await ae(e,"blob")):e instanceof File?t=i.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){const e=Te._isSVGFittingCanvas,n=new FileReader,r=new Image,s=new Promise((t,s)=>{r.onload=()=>{i.bitmap=r,i.isSvg=!0,t()},n.onload=async()=>{const t=i.svgUrl=n.result;r.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},r.onerror=n.onerror=s});n.readAsDataURL(t),await s}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(n){It(n),i=null}return this.#y.set(t,i),i&&this.#y.set(i.id,i),i}async getFromFile(t){const{lastModified:e,name:i,size:n,type:r}=t;return this.#A(`${e}_${i}_${n}_${r}`,t)}async getFromUrl(t){return this.#A(t,t)}async getFromBlob(t,e){const i=await e;return this.#A(t,i)}async getFromId(t){this.#y||=new Map;const e=this.#y.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#y||=new Map;let i=this.#y.get(t);if(i?.bitmap)return i.refCounter+=1,i;const n=new OffscreenCanvas(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),i={bitmap:n.transferToImageBitmap(),id:`image_${this.#x}_${this.#w++}`,refCounter:1,isSvg:!1},this.#y.set(t,i),this.#y.set(i.id,i),i}getSvgUrl(t){const e=this.#y.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#y||=new Map;const e=this.#y.get(t);if(!e)return;if(e.refCounter-=1,0!==e.refCounter)return;const{bitmap:i}=e;if(!e.url&&!e.file){const t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=t.convertToBlob()}i.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#x}_`)}}class Le{#C=[];#E=!1;#S;#k=-1;constructor(t=128){this.#S=t}add({cmd:t,undo:e,post:i,mustExec:n,type:r=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(n&&t(),this.#E)return;const o={cmd:t,undo:e,post:i,type:r};if(-1===this.#k)return this.#C.length>0&&(this.#C.length=0),this.#k=0,void this.#C.push(o);if(s&&this.#C[this.#k].type===r)return a&&(o.undo=this.#C[this.#k].undo),void(this.#C[this.#k]=o);const l=this.#k+1;l===this.#S?this.#C.splice(0,1):(this.#k=l,l<this.#C.length&&this.#C.splice(l)),this.#C.push(o)}undo(){if(-1===this.#k)return;this.#E=!0;const{undo:t,post:e}=this.#C[this.#k];t(),e?.(),this.#E=!1,this.#k-=1}redo(){if(this.#k<this.#C.length-1){this.#k+=1,this.#E=!0;const{cmd:t,post:e}=this.#C[this.#k];t(),e?.(),this.#E=!1}}hasSomethingToUndo(){return-1!==this.#k}hasSomethingToRedo(){return this.#k<this.#C.length-1}cleanType(t){if(-1!==this.#k){for(let e=this.#k;e>=0;e--)if(this.#C[e].type!==t)return this.#C.splice(e+1,this.#k-e),void(this.#k=e);this.#C.length=0,this.#k=-1}}destroy(){this.#C=null}}class De{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Yt.platform;for(const[i,n,r={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:r}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:n,options:r}),this.allKeys.add(t.split("+").at(-1)))}}#_(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(this.#_(e));if(!i)return;const{callback:n,options:{bubbles:r=!1,args:s=[],checker:a=null}}=i;a&&!a(t,e)||(n.bind(t,...s,e)(),r||fe(e))}}class Pe{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,ve(n))}e.remove()}(t),zt(this,"_colors",t)}convert(t){const e=ve(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every((t,i)=>t===e[i]))return Pe._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?Qt.makeHexColor(...e):t}}let Me=class t{#T=new AbortController;#L=null;#D=new Map;#P=new Map;#M=null;#F=null;#I=null;#R=new Le;#B=null;#N=null;#O=0;#z=new Set;#H=null;#V=null;#j=new Set;_editorUndoBar=null;#U=!1;#W=!1;#$=!1;#G=null;#q=null;#X=null;#Y=null;#K=!1;#Q=null;#Z=new _e;#J=!1;#tt=!1;#et=null;#it=null;#nt=null;#rt=null;#st=null;#at=dt.NONE;#ot=new Set;#lt=null;#dt=null;#ht=null;#ct=null;#ut={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#gt=[0,0];#pt=null;#ft=null;#mt=null;#bt=null;#vt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=t.prototype,i=t=>t.#ft.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),n=(t,{target:e})=>{if(e instanceof HTMLInputElement){const{type:t}=e;return"text"!==t&&"number"!==t}return!0},r=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return zt(this,"_keyboardManager",new De([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#ft.contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#ft.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-r,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[r,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-r],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:i}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,r],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:i}]]))}constructor(t,e,i,n,r,s,a,o,l,d,h,c,u,g,p){const f=this._signal=this.#T.signal;this.#ft=t,this.#mt=e,this.#bt=i,this.#M=n,this.#dt=r,this._eventBus=s,s._on("editingaction",this.onEditingAction.bind(this),{signal:f}),s._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),s._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),s._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),s._on("setpreference",this.onSetPreference.bind(this),{signal:f}),s._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:f}),this.#wt(),this.#xt(),this.#yt(),this.#F=a.annotationStorage,this.#G=a.filterFactory,this.#ht=o,this.#Y=l||null,this.#U=d,this.#W=h,this.#$=c,this.#st=u||null,this.viewParameters={realScale:se.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=!1!==p}destroy(){this.#vt?.resolve(),this.#vt=null,this.#T?.abort(),this.#T=null,this._signal=null;for(const t of this.#P.values())t.destroy();this.#P.clear(),this.#D.clear(),this.#j.clear(),this.#rt?.clear(),this.#L=null,this.#ot.clear(),this.#R.destroy(),this.#M?.destroy(),this.#dt?.destroy(),this.#Q?.hide(),this.#Q=null,this.#nt?.destroy(),this.#nt=null,this.#q&&(clearTimeout(this.#q),this.#q=null),this.#pt&&(clearTimeout(this.#pt),this.#pt=null),this._editorUndoBar?.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#st}get useNewAltTextFlow(){return this.#W}get useNewAltTextWhenAddingImage(){return this.#$}get hcmFilter(){return zt(this,"hcmFilter",this.#ht?this.#G.addHCMFilter(this.#ht.foreground,this.#ht.background):"none")}get direction(){return zt(this,"direction",getComputedStyle(this.#ft).direction)}get highlightColors(){return zt(this,"highlightColors",this.#Y?new Map(this.#Y.split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColorNames(){return zt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#N=t}setMainHighlightColorPicker(t){this.#nt=t}editAltText(t,e=!1){this.#M?.editAltText(this,t,e)}getSignature(t){this.#dt?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#dt}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){"enableNewAltTextWhenAddingImage"===t&&(this.#$=e)}onPageChanging({pageNumber:t}){this.#O=t-1}focusMainContainer(){this.#ft.focus()}findParent(t,e){for(const i of this.#P.values()){const{x:n,y:r,width:s,height:a}=i.div.getBoundingClientRect();if(t>=n&&t<=n+s&&e>=r&&e<=r+a)return i}return null}disableUserSelect(t=!1){this.#mt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#j.add(t)}removeShouldRescale(t){this.#j.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*se.PDF_TO_CSS_UNITS;for(const e of this.#j)e.onScaleChanging();this.#N?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#At({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#Ct(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of this.#P.values())if(i.hasTextLayer(t))return i;return null}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=e,a=e.toString(),o=this.#At(e).closest(".textLayer"),l=this.getSelectionBoxes(o);if(!l)return;e.empty();const d=this.#Ct(o),h=this.#at===dt.NONE,c=()=>{d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:l,anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s,text:a}),h&&this.showAllEditors("highlight",!0,!0)};h?this.switchToMode(dt.HIGHLIGHT,c):c()}#Et(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=this.#At(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#Q||=new Se(this),this.#Q.show(e,i,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#F||this.#F.has(t.id)||this.#F.setValue(t.id,t)}a11yAlert(t,e=null){const i=this.#bt;i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}#St(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#lt&&(this.#Q?.hide(),this.#lt=null,this.#kt({hasSelectedText:!1})));const{anchorNode:e}=t;if(e===this.#lt)return;const i=this.#At(t).closest(".textLayer");if(i){if(this.#Q?.hide(),this.#lt=e,this.#kt({hasSelectedText:!0}),(this.#at===dt.HIGHLIGHT||this.#at===dt.NONE)&&(this.#at===dt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#K=this.isShiftKeyDown,!this.isShiftKeyDown)){const t=this.#at===dt.HIGHLIGHT?this.#Ct(i):null;t?.toggleDrawing();const e=new AbortController,n=this.combinedSignal(e),r=i=>{"pointerup"===i.type&&0!==i.button||(e.abort(),t?.toggleDrawing(!0),"pointerup"===i.type&&this.#_t("main_toolbar"))};window.addEventListener("pointerup",r,{signal:n}),window.addEventListener("blur",r,{signal:n})}}else this.#lt&&(this.#Q?.hide(),this.#lt=null,this.#kt({hasSelectedText:!1}))}#_t(t=""){this.#at===dt.HIGHLIGHT?this.highlightSelection(t):this.#U&&this.#Et()}#wt(){document.addEventListener("selectionchange",this.#St.bind(this),{signal:this._signal})}#Tt(){if(this.#X)return;this.#X=new AbortController;const t=this.combinedSignal(this.#X);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#Lt(){this.#X?.abort(),this.#X=null}blur(){if(this.isShiftKeyDown=!1,this.#K&&(this.#K=!1,this.#_t("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#ot)if(e.div.contains(t)){this.#it=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#it)return;const[t,e]=this.#it;this.#it=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#yt(){if(this.#et)return;this.#et=new AbortController;const t=this.combinedSignal(this.#et);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#Dt(){this.#et?.abort(),this.#et=null}#Pt(){if(this.#B)return;this.#B=new AbortController;const t=this.combinedSignal(this.#B);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#Mt(){this.#B?.abort(),this.#B=null}#xt(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#yt(),this.#Pt()}removeEditListeners(){this.#Dt(),this.#Mt()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of this.#V)if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of this.#V)if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#L?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const i of this.#ot){const t=i.serialize(!0);t&&e.push(t)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const s of e.items)for(const t of this.#V)if(t.isHandlingMimeForPasting(s.type))return void t.paste(s,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(r){return void It(`paste: "${r.message}".`)}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const s of i){const e=await n.deserialize(s);if(!e)return;t.push(e)}const e=()=>{for(const e of t)this.#Ft(e);this.#It(t)},r=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:r,mustExec:!0})}catch(r){It(`paste: "${r.message}".`)}}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),this.#at===dt.NONE||this.isEditorHandlingKeyboard||t._keyboardManager.exec(this,e)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#K&&(this.#K=!1,this.#_t("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#kt(t){Object.entries(t).some(([t,e])=>this.#ut[t]!==e)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ut,t)}),this.#at===dt.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#Rt([[ht.HIGHLIGHT_FREE,!0]]))}#Rt(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Tt(),this.#Pt(),this.#kt({isEditing:this.#at!==dt.NONE,isEmpty:this.#Bt(),hasSomethingToUndo:this.#R.hasSomethingToUndo(),hasSomethingToRedo:this.#R.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Lt(),this.#Mt(),this.#kt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#V){this.#V=t;for(const t of this.#V)this.#Rt(t.defaultPropertiesToUpdate)}}getId(){return this.#Z.id}get currentLayer(){return this.#P.get(this.#O)}getLayer(t){return this.#P.get(t)}get currentPageIndex(){return this.#O}addLayer(t){this.#P.set(t.pageIndex,t),this.#J?t.enable():t.disable()}removeLayer(t){this.#P.delete(t.pageIndex)}async updateMode(t,e=null,i=!1,n=!1){if(this.#at!==t&&(!this.#vt||(await this.#vt.promise,this.#vt))){if(this.#vt=Promise.withResolvers(),this.#N?.commitOrRemove(),this.#at=t,t===dt.NONE)return this.setEditingState(!1),this.#Nt(),this._editorUndoBar?.hide(),void this.#vt.resolve();t===dt.SIGNATURE&&await(this.#dt?.loadSignatures()),this.setEditingState(!0),await this.#Ot(),this.unselectAll();for(const e of this.#P.values())e.updateMode(t);if(!e)return i&&this.addNewEditorFromKeyboard(),void this.#vt.resolve();for(const t of this.#D.values())t.annotationElementId===e||t.id===e?(this.setSelected(t),n&&t.enterInEditMode()):t.unselect();this.#vt.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#at&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#V){switch(t){case ht.CREATE:return void this.currentLayer.addNewEditor(e);case ht.HIGHLIGHT_DEFAULT_COLOR:this.#nt?.updateColor(e);break;case ht.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#ct||=new Map).set(t,e),this.showAllEditors("highlight",e)}for(const i of this.#ot)i.updateParams(t,e);for(const i of this.#V)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(const n of this.#D.values())n.editorType===t&&n.show(e);(this.#ct?.get(ht.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#Rt([[ht.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#tt!==t){this.#tt=t;for(const e of this.#P.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}async#Ot(){if(!this.#J){this.#J=!0;const t=[];for(const e of this.#P.values())t.push(e.enable());await Promise.all(t);for(const e of this.#D.values())e.enable()}}#Nt(){if(this.unselectAll(),this.#J){this.#J=!1;for(const t of this.#P.values())t.disable();for(const t of this.#D.values())t.disable()}}getEditors(t){const e=[];for(const i of this.#D.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#D.get(t)}addEditor(t){this.#D.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#q&&clearTimeout(this.#q),this.#q=setTimeout(()=>{this.focusMainContainer(),this.#q=null},0)),this.#D.delete(t.id),t.annotationElementId&&this.#rt?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#z.has(t.annotationElementId)||this.#F?.remove(t.id)}addDeletedAnnotationElement(t){this.#z.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#z.has(t)}removeDeletedAnnotationElement(t){this.#z.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#Ft(t){const e=this.#P.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#L!==t&&(this.#L=t,t&&this.#Rt(t.propertiesToUpdate))}get#zt(){let t=null;for(t of this.#ot);return t}updateUI(t){this.#zt===t&&this.#Rt(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#Rt(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#ot.has(t))return this.#ot.delete(t),t.unselect(),void this.#kt({hasSelectedEditor:this.hasSelection});this.#ot.add(t),t.select(),this.#Rt(t.propertiesToUpdate),this.#kt({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.id}),this.#N?.commitOrRemove();for(const e of this.#ot)e!==t&&e.unselect();this.#ot.clear(),this.#ot.add(t),t.select(),this.#Rt(t.propertiesToUpdate),this.#kt({hasSelectedEditor:!0})}isSelected(t){return this.#ot.has(t)}get firstSelectedEditor(){return this.#ot.values().next().value}unselect(t){t.unselect(),this.#ot.delete(t),this.#kt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#ot.size}get isEnterHandled(){return 1===this.#ot.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#R.undo(),this.#kt({hasSomethingToUndo:this.#R.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Bt()}),this._editorUndoBar?.hide()}redo(){this.#R.redo(),this.#kt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#R.hasSomethingToRedo(),isEmpty:this.#Bt()})}addCommands(t){this.#R.add(t),this.#kt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Bt()})}cleanUndoStack(t){this.#R.cleanType(t)}#Bt(){if(0===this.#D.size)return!0;if(1===this.#D.size)for(const t of this.#D.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...this.#ot],i=()=>{for(const t of e)this.#Ft(t)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(i,1===e.length?e[0].editorType:e.length);for(const t of e)t.remove()},undo:i,mustExec:!0})}commitOrRemove(){this.#L?.commitOrRemove()}hasSomethingToControl(){return this.#L||this.hasSelection}#It(t){for(const e of this.#ot)e.unselect();this.#ot.clear();for(const e of t)e.isEmpty()||(this.#ot.add(e),e.select());this.#kt({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#ot)t.commit();this.#It(this.#D.values())}unselectAll(){if((!this.#L||(this.#L.commitOrRemove(),this.#at===dt.NONE))&&!this.#N?.commitOrRemove()&&this.hasSelection){for(const t of this.#ot)t.unselect();this.#ot.clear(),this.#kt({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#gt[0]+=t,this.#gt[1]+=e;const[n,r]=this.#gt,s=[...this.#ot];this.#pt&&clearTimeout(this.#pt),this.#pt=setTimeout(()=>{this.#pt=null,this.#gt[0]=this.#gt[1]=0,this.addCommands({cmd:()=>{for(const t of s)this.#D.has(t.id)&&(t.translateInPage(n,r),t.translationDone())},undo:()=>{for(const t of s)this.#D.has(t.id)&&(t.translateInPage(-n,-r),t.translationDone())},mustExec:!1})},1e3);for(const a of s)a.translateInPage(t,e),a.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#H=new Map;for(const t of this.#ot)this.#H.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#H)return!1;this.disableUserSelect(!1);const t=this.#H;this.#H=null;let e=!1;for(const[{x:n,y:r,pageIndex:s},a]of t)a.newX=n,a.newY=r,a.newPageIndex=s,e||=n!==a.savedX||r!==a.savedY||s!==a.savedPageIndex;if(!e)return!1;const i=(t,e,i,n)=>{if(this.#D.has(t.id)){const r=this.#P.get(n);r?t._setParentAndPosition(r,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:r,newPageIndex:s}]of t)i(e,n,r,s)},undo:()=>{for(const[e,{savedX:n,savedY:r,savedPageIndex:s}]of t)i(e,n,r,s)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#H)for(const i of this.#H.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#ot.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#L===t}getActive(){return this.#L}getMode(){return this.#at}get imageManager(){return zt(this,"imageManager",new Te)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,d=e.rangeCount;l<d;l++)if(!t.contains(e.getRangeAt(l).commonAncestorContainer))return null;const{x:i,y:n,width:r,height:s}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(t,e,a,o)=>({x:(e-n)/s,y:1-(t+a-i)/r,width:o/s,height:a/r});break;case"180":a=(t,e,a,o)=>({x:1-(t+a-i)/r,y:1-(e+o-n)/s,width:a/r,height:o/s});break;case"270":a=(t,e,a,o)=>({x:1-(e+o-n)/s,y:(t-i)/r,width:o/s,height:a/r});break;default:a=(t,e,a,o)=>({x:(t-i)/r,y:(e-n)/s,width:a/r,height:o/s})}const o=[];for(let l=0,d=e.rangeCount;l<d;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:r}of t.getClientRects())0!==n&&0!==r&&o.push(a(e,i,n,r))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(this.#I||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#I?.delete(t)}renderAnnotationElement(t){const e=this.#I?.get(t.data.id);if(!e)return;const i=this.#F.getRawValue(e);i&&(this.#at!==dt.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}setMissingCanvas(t,e,i){const n=this.#rt?.get(t);n&&(n.setCanvas(e,i),this.#rt.delete(t))}addMissingCanvas(t,e){(this.#rt||=new Map).set(t,e)}};class Fe{#o=null;#Ht=!1;#Vt=null;#jt=null;#Ut=null;#Wt=null;#$t=!1;#Gt=null;#s=null;#qt=null;#Xt=null;#Yt=!1;static#Kt=null;static _l10n=null;constructor(t){this.#s=t,this.#Yt=t._uiManager.useNewAltTextFlow,Fe.#Kt||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){Fe._l10n??=t}async render(){const t=this.#Vt=document.createElement("button");t.className="altText",t.tabIndex="0";const e=this.#jt=document.createElement("span");t.append(e),this.#Yt?(t.classList.add("new"),t.setAttribute("data-l10n-id",Fe.#Kt.missing),e.setAttribute("data-l10n-id",Fe.#Kt["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=this.#s._uiManager._signal;t.addEventListener("contextmenu",pe,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});const n=t=>{t.preventDefault(),this.#s._uiManager.editAltText(this.#s),this.#Yt&&this.#s._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#Qt}})};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#$t=!0,n(e))},{signal:i}),await this.#Zt(),t}get#Qt(){return(this.#o?"added":null===this.#o&&this.guessedText&&"review")||"missing"}finish(){this.#Vt&&(this.#Vt.focus({focusVisible:this.#$t}),this.#$t=!1)}isEmpty(){return this.#Yt?null===this.#o:!this.#o&&!this.#Ht}hasData(){return this.#Yt?null!==this.#o||!!this.#qt:this.isEmpty()}get guessedText(){return this.#qt}async setGuessedText(t){null===this.#o&&(this.#qt=t,this.#Xt=await Fe._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#Zt())}toggleAltTextBadge(t=!1){if(!this.#Yt||this.#o)return this.#Gt?.remove(),void(this.#Gt=null);if(!this.#Gt){const t=this.#Gt=document.createElement("div");t.className="noAltTextBadge",this.#s.div.append(t)}this.#Gt.classList.toggle("hidden",!t)}serialize(t){let e=this.#o;return t||this.#qt!==e||(e=this.#Xt),{altText:e,decorative:this.#Ht,guessedText:this.#qt,textWithDisclaimer:this.#Xt}}get data(){return{altText:this.#o,decorative:this.#Ht}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:n,cancel:r=!1}){i&&(this.#qt=i,this.#Xt=n),this.#o===t&&this.#Ht===e||(r||(this.#o=t,this.#Ht=e),this.#Zt())}toggle(t=!1){this.#Vt&&(!t&&this.#Wt&&(clearTimeout(this.#Wt),this.#Wt=null),this.#Vt.disabled=!t)}shown(){this.#s._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#Qt}})}destroy(){this.#Vt?.remove(),this.#Vt=null,this.#jt=null,this.#Ut=null,this.#Gt?.remove(),this.#Gt=null}async#Zt(){const t=this.#Vt;if(!t)return;if(this.#Yt){if(t.classList.toggle("done",!!this.#o),t.setAttribute("data-l10n-id",Fe.#Kt[this.#Qt]),this.#jt?.setAttribute("data-l10n-id",Fe.#Kt[`${this.#Qt}-label`]),!this.#o)return void this.#Ut?.remove()}else{if(!this.#o&&!this.#Ht)return t.classList.remove("done"),void this.#Ut?.remove();t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#Ut;if(!e){this.#Ut=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#s.id}`;const i=100,n=this.#s._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#Wt),this.#Wt=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#Wt=setTimeout(()=>{this.#Wt=null,this.#Ut.classList.add("show"),this.#s._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:n}),t.addEventListener("mouseleave",()=>{this.#Wt&&(clearTimeout(this.#Wt),this.#Wt=null),this.#Ut?.classList.remove("show")},{signal:n})}this.#Ht?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#o),e.parentNode||t.append(e);const i=this.#s.getElementForAltText();i?.setAttribute("aria-describedby",e.id)}}let Ie=class t{#ft;#Jt=!1;#te=null;#ee;#ie;#ne;#re;#se=null;#ae;#oe=null;#le;#de=null;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:n=null,onPinching:r=null,onPinchEnd:s=null,signal:a}){this.#ft=t,this.#te=i,this.#ee=e,this.#ie=n,this.#ne=r,this.#re=s,this.#le=new AbortController,this.#ae=AbortSignal.any([a,this.#le.signal]),t.addEventListener("touchstart",this.#he.bind(this),{passive:!1,signal:this.#ae})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ae.pixelRatio}#he(t){if(this.#ee?.())return;if(1===t.touches.length){if(this.#se)return;const t=this.#se=new AbortController,e=AbortSignal.any([this.#ae,t.signal]),i=this.#ft,n={capture:!0,signal:e,passive:!1},r=t=>{"touch"===t.pointerType&&(this.#se?.abort(),this.#se=null)};return i.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(fe(t),r(t))},n),i.addEventListener("pointerup",r,n),void i.addEventListener("pointercancel",r,n)}if(!this.#de){this.#de=new AbortController;const t=AbortSignal.any([this.#ae,this.#de.signal]),e=this.#ft,i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",this.#ce.bind(this),i);const n=this.#ue.bind(this);e.addEventListener("touchend",n,i),e.addEventListener("touchcancel",n,i),i.capture=!0,e.addEventListener("pointerdown",fe,i),e.addEventListener("pointermove",fe,i),e.addEventListener("pointercancel",fe,i),e.addEventListener("pointerup",fe,i),this.#ie?.()}if(fe(t),2!==t.touches.length||this.#te?.())return void(this.#oe=null);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),this.#oe={touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY}}#ce(e){if(!this.#oe||2!==e.touches.length)return;fe(e);let[i,n]=e.touches;i.identifier>n.identifier&&([i,n]=[n,i]);const{screenX:r,screenY:s}=i,{screenX:a,screenY:o}=n,l=this.#oe,{touch0X:d,touch0Y:h,touch1X:c,touch1Y:u}=l,g=c-d,p=u-h,f=a-r,m=o-s,b=Math.hypot(f,m)||1,v=Math.hypot(g,p)||1;if(!this.#Jt&&Math.abs(v-b)<=t.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=r,l.touch0Y=s,l.touch1X=a,l.touch1Y=o,!this.#Jt)return void(this.#Jt=!0);const w=[(r+a)/2,(s+o)/2];this.#ne?.(w,v,b)}#ue(t){t.touches.length>=2||(this.#de&&(this.#de.abort(),this.#de=null,this.#re?.()),this.#oe&&(fe(t),this.#oe=null,this.#Jt=!1))}destroy(){this.#le?.abort(),this.#le=null,this.#se?.abort(),this.#se=null}};class Re{#ge=null;#pe=null;#o=null;#fe=!1;#me=null;#be="";#ve=!1;#we=null;#xe=null;#ye=null;#Ae=null;#Ce="";#Ee=!1;#Se=null;#ke=!1;#_e=!1;#Te=!1;#Le=null;#De=0;#Pe=0;#Me=null;#Fe=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#Ie=!1;#Re=Re._zIndex++;static _borderLineWidth=-1;static _colorManager=new Pe;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=Re.prototype._resizeWithKeyboard,e=Me.TRANSLATE_SMALL,i=Me.TRANSLATE_BIG;return zt(this,"_resizerKeyboardManager",new De([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],Re.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:r,pageY:s}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[r,s];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return zt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Be({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(Re._l10n??=t,Re._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==Re._borderLineWidth)return;const i=getComputedStyle(document.documentElement);Re._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Rt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#Ie}set _isDraggable(t){this.#Ie=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#Re}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#Be(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#Ee?this.#Ee=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;e?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[r,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/r,this.y=(e+n)/s,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n),this._onTranslated()}#Ne([t,e],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/t,this.y+=n/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,e){this.#Ne(this.parentDimensions,t,e)}translateInPage(t,e){this.#Se||=[this.x,this.y,this.width,this.height],this.#Ne(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#Se||=[this.x,this.y,this.width,this.height];const{div:i,parentDimensions:[n,r]}=this;if(this.x+=t/n,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[o,l]=this.getBaseTranslation();s+=o,a+=l;const{style:d}=i;d.left=`${(100*s).toFixed(2)}%`,d.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#Se&&(this.#Se[0]!==this.x||this.#Se[1]!==this.y)}get _hasBeenResized(){return!!this.#Se&&(this.#Se[2]!==this.width||this.#Se[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Re,n=i/t,r=i/e;switch(this.rotation){case 90:return[-n,r];case 180:return[n,r];case 270:return[n,-r];default:return[-n,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,n]}=this;let{x:r,y:s,width:a,height:o}=this;if(a*=i,o*=n,r*=i,s*=n,this._mustFixPosition)switch(t){case 0:r=ie(r,0,i-a),s=ie(s,0,n-o);break;case 90:r=ie(r,0,i-o),s=ie(s,a,n);break;case 180:r=ie(r,a,i),s=ie(s,o,n);break;case 270:r=ie(r,o,i),s=ie(s,0,n-a)}this.x=r/=i,this.y=s/=n;const[l,d]=this.getBaseTranslation();r+=l,s+=d,e.left=`${(100*r).toFixed(2)}%`,e.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#Oe(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return Re.#Oe(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return Re.#Oe(t,e,360-this.parentRotation)}#ze(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,n]=this.parentDimensions,{style:r}=this.div;r.width=`${(100*t/i).toFixed(2)}%`,this.#ve||(r.height=`${(100*e/n).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),r=!this.#ve&&e.endsWith("%");if(n&&r)return;const[s,a]=this.parentDimensions;n||(t.width=`${(100*parseFloat(i)/s).toFixed(2)}%`),this.#ve||r||(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#He(){if(this.#we)return;this.#we=document.createElement("div"),this.#we.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");this.#we.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#Ve.bind(this,i),{signal:e}),t.addEventListener("contextmenu",pe,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#we)}#Ve(t,e){e.preventDefault();const{isMac:i}=Yt.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#o?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1,this.#xe=[e.screenX,e.screenY];const r=new AbortController,s=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#je.bind(this,t),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",fe,{passive:!1,signal:s}),window.addEventListener("contextmenu",pe,{signal:s}),this.#ye={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const l=()=>{r.abort(),this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=a,this.div.style.cursor=o,this.#Ue()};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})}#We(t,e,i,n){this.width=i,this.height=n,this.x=t,this.y=e;const[r,s]=this.parentDimensions;this.setDims(r*i,s*n),this.fixAndSetPosition(),this._onResized()}_onResized(){}#Ue(){if(!this.#ye)return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=this.#ye;this.#ye=null;const r=this.x,s=this.y,a=this.width,o=this.height;r===t&&s===e&&a===i&&o===n||this.addCommands({cmd:this.#We.bind(this,r,s,a,o),undo:this.#We.bind(this,t,e,i,n),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#je(t,e){const[i,n]=this.parentDimensions,r=this.x,s=this.y,a=this.width,o=this.height,l=Re.MIN_SIZE/i,d=Re.MIN_SIZE/n,h=this.#ze(this.rotation),c=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],u=this.#ze(360-this.rotation);let g,p,f=!1,m=!1;switch(t){case"topLeft":f=!0,g=(t,e)=>[0,0],p=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],p=(t,e)=>[t/2,e];break;case"topRight":f=!0,g=(t,e)=>[t,0],p=(t,e)=>[0,e];break;case"middleRight":m=!0,g=(t,e)=>[t,e/2],p=(t,e)=>[0,e/2];break;case"bottomRight":f=!0,g=(t,e)=>[t,e],p=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],p=(t,e)=>[t/2,0];break;case"bottomLeft":f=!0,g=(t,e)=>[0,e],p=(t,e)=>[t,0];break;case"middleLeft":m=!0,g=(t,e)=>[0,e/2],p=(t,e)=>[t,e/2]}const b=g(a,o),v=p(a,o);let w=c(...v);const x=Re._round(r+w[0]),y=Re._round(s+w[1]);let A,C,E=1,S=1;if(e.fromKeyboard)({deltaX:A,deltaY:C}=e);else{const{screenX:t,screenY:i}=e,[n,r]=this.#xe;[A,C]=this.screenToPageTranslation(t-n,i-r),this.#xe[0]=t,this.#xe[1]=i}var k,_;if([A,C]=(k=A/i,_=C/n,[u[0]*k+u[2]*_,u[1]*k+u[3]*_]),f){const t=Math.hypot(a,o);E=S=Math.max(Math.min(Math.hypot(v[0]-b[0]-A,v[1]-b[1]-C)/t,1/a,1/o),l/a,d/o)}else m?E=ie(Math.abs(v[0]-b[0]-A),l,1)/a:S=ie(Math.abs(v[1]-b[1]-C),d,1)/o;const T=Re._round(a*E),L=Re._round(o*S);w=c(...p(T,L));const D=x-w[0],P=y-w[1];this.#Se||=[this.x,this.y,this.width,this.height],this.width=T,this.height=L,this.x=D,this.y=P,this.setDims(i*T,n*L),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#o?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_e)return this._editToolbar;this._editToolbar=new Ee(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,i]of t)await this._editToolbar.addButton(e,i);return this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#o?.destroy())}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#o||(Fe.initialize(Re._l10n),this.#o=new Fe(this),this.#ge&&(this.#o.data=this.#ge,this.#ge=null)),this.#o}get altTextData(){return this.#o?.data}set altTextData(t){this.#o&&(this.#o.data=t)}get guessedAltText(){return this.#o?.guessedText}async setGuessedAltText(t){await(this.#o?.setGuessedText(t))}serializeAltText(t){return this.#o?.serialize(t)}hasAltText(){return!!this.#o&&!this.#o.isEmpty()}hasAltTextData(){return this.#o?.hasData()??!1}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#fe?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#$e();const[e,i]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*i/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/i).toFixed(2)}%`);const[n,r]=this.getInitialTranslation();return this.translate(n,r),ke(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#Fe||=new Ie({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#Ge.bind(this),onPinching:this.#qe.bind(this),onPinchEnd:this.#Xe.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),t}#Ge(){this.#ye={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#o?.toggle(!1),this.parent.togglePointerEvents(!1)}#qe(t,e,i){let n=i/e*.7+1-.7;if(1===n)return;const r=this.#ze(this.rotation),s=(t,e)=>[r[0]*t+r[2]*e,r[1]*t+r[3]*e],[a,o]=this.parentDimensions,l=this.x,d=this.y,h=this.width,c=this.height,u=Re.MIN_SIZE/a,g=Re.MIN_SIZE/o;n=Math.max(Math.min(n,1/h,1/c),u/h,g/c);const p=Re._round(h*n),f=Re._round(c*n);if(p===h&&f===c)return;this.#Se||=[l,d,h,c];const m=s(h/2,c/2),b=Re._round(l+m[0]),v=Re._round(d+m[1]),w=s(p/2,f/2);this.x=b-w[0],this.y=v-w[1],this.width=p,this.height=f,this.setDims(a*p,o*f),this.fixAndSetPosition(),this._onResizing()}#Xe(){this.#o?.toggle(!0),this.parent.togglePointerEvents(!0),this.#Ue()}pointerdown(t){const{isMac:e}=Yt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#Ee=!0,this._isDraggable?this.#Ye(t):this.#Ke(t))}#Ke(t){const{isMac:e}=Yt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#Ye(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const n=new AbortController,r=this._uiManager.combinedSignal(n),s={capture:!0,passive:!1,signal:r},a=t=>{n.abort(),this.#me=null,this.#Ee=!1,this._uiManager.endDragSession()||this.#Ke(t),i&&this._onStopDragging()};e&&(this.#De=t.clientX,this.#Pe=t.clientY,this.#me=t.pointerId,this.#be=t.pointerType,window.addEventListener("pointermove",t=>{i||(i=!0,this._onStartDragging());const{clientX:e,clientY:n,pointerId:r}=t;if(r!==this.#me)return void fe(t);const[s,a]=this.screenToPageTranslation(e-this.#De,n-this.#Pe);this.#De=e,this.#Pe=n,this._uiManager.dragSelectedEditors(s,a)},s),window.addEventListener("touchmove",fe,s),window.addEventListener("pointerdown",t=>{t.pointerType===this.#be&&(this.#Fe||t.isPrimary)&&a(t),fe(t)},s));const o=t=>{this.#me&&this.#me!==t.pointerId?fe(t):a(t)};window.addEventListener("pointerup",o,{signal:r}),window.addEventListener("blur",o,{signal:r})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#Le&&clearTimeout(this.#Le),this.#Le=setTimeout(()=>{this.#Le=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,i=this.rotation){const n=this.parentScale,[r,s]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/n,d=e/n,h=this.x*r,c=this.y*s,u=this.width*r,g=this.height*s;switch(i){case 0:return[h+l+a,s-c-d-g+o,h+l+u+a,s-c-d+o];case 90:return[h+d+a,s-c+l+o,h+d+g+a,s-c+l+u+o];case 180:return[h-l-u+a,s-c+d+o,h-l+a,s-c+d+g+o];case 270:return[h-d-g+a,s-c-l-u+o,h-d+a,s-c-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,r,s]=t,a=r-i,o=s-n;switch(this.rotation){case 0:return[i,e-s,a,o];case 90:return[i,e-n,o,a];case 180:return[r,e-n,a,o];case 270:return[r,e-s,o,a];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_e=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#_e=!1,!0)}isInEditMode(){return this.#_e}shouldGetKeyboardEvents(){return this.#Te}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:n}=this.getClientDimensions(),{innerHeight:r,innerWidth:s}=window;return e<s&&n>0&&t<r&&i>0}#$e(){if(this.#Ae||!this.div)return;this.#Ae=new AbortController;const t=this._uiManager.combinedSignal(this.#Ae);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#$e()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){Rt("An editor must be serializable")}static async deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i,annotationElementId:t.annotationElementId});n.rotation=t.rotation,n.#ge=t.accessibilityData,n._isCopy=t.isCopy||!1;const[r,s]=n.pageDimensions,[a,o,l,d]=n.getRectInCurrentCoords(t.rect,s);return n.x=a/r,n.y=o/s,n.width=l/r,n.height=d/s,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#Ae?.abort(),this.#Ae=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Le&&(clearTimeout(this.#Le),this.#Le=null),this.#Be(),this.removeEditToolbar(),this.#Me){for(const t of this.#Me.values())clearTimeout(t);this.#Me=null}this.parent=null,this.#Fe?.destroy(),this.#Fe=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#He(),this.#we.classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#ye={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#we.children;if(!this.#pe){this.#pe=Array.from(e);const t=this.#Qe.bind(this),i=this.#Ze.bind(this),n=this._uiManager._signal;for(const e of this.#pe){const r=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",this.#Je.bind(this,r),{signal:n}),e.setAttribute("data-l10n-id",Re._l10nResizer[r])}}const i=this.#pe[0];let n=0;for(const s of e){if(s===i)break;n++}const r=(360-this.rotation+this.parentRotation)%360/90*(this.#pe.length/4);if(r!==n){if(r<n)for(let e=0;e<n-r;e++)this.#we.append(this.#we.firstChild);else if(r>n)for(let e=0;e<r-n;e++)this.#we.firstChild.before(this.#we.lastChild);let t=0;for(const i of e){const e=this.#pe[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",Re._l10nResizer[e])}}this.#ti(0),this.#Te=!0,this.#we.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#Qe(t){Re._resizerKeyboardManager.exec(this,t)}#Ze(t){this.#Te&&t.relatedTarget?.parentNode!==this.#we&&this.#Be()}#Je(t){this.#Ce=this.#Te?t:""}#ti(t){if(this.#pe)for(const e of this.#pe)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#Te&&this.#je(this.#Ce,{deltaX:t,deltaY:e,fromKeyboard:!0})}#Be(){this.#Te=!1,this.#ti(-1),this.#Ue()}_stopResizingWithKeyboard(){this.#Be(),this.div.focus()}select(){this.isSelected&&this._editToolbar||(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#o?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()}))}unselect(){this.isSelected&&(this.isSelected=!1,this.#we?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#o?.toggleAltTextBadge(!0))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#ke}set isEditing(t){this.#ke=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#ve=!0;const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#Me||=new Map;const{action:e}=t;let i=this.#Me.get(e);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#Me.delete(e),0===this.#Me.size&&(this.#Me=null)},Re._telemetryTimeout),void this.#Me.set(e,i)}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#fe=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#fe=!0}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e?.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class Be extends Re{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Ne=3285377520,Oe=4294901760,ze=65535;class He{constructor(t){this.h1=t?4294967295&t:Ne,this.h2=t?4294967295&t:Ne}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,r=t.length;n<r;n++){const r=t.charCodeAt(n);r<=255?e[i++]=r:(e[i++]=r>>>8,e[i++]=255&r)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,r=i-4*n,s=new Uint32Array(e.buffer,0,n);let a=0,o=0,l=this.h1,d=this.h2;const h=3432918353,c=461845907,u=11601,g=13715;for(let p=0;p<n;p++)1&p?(a=s[p],a=a*h&Oe|a*u&ze,a=a<<15|a>>>17,a=a*c&Oe|a*g&ze,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=s[p],o=o*h&Oe|o*u&ze,o=o<<15|o>>>17,o=o*c&Oe|o*g&ze,d^=o,d=d<<13|d>>>19,d=5*d+3864292196);switch(a=0,r){case 3:a^=e[4*n+2]<<16;case 2:a^=e[4*n+1]<<8;case 1:a^=e[4*n],a=a*h&Oe|a*u&ze,a=a<<15|a>>>17,a=a*c&Oe|a*g&ze,1&n?l^=a:d^=a}this.h1=l,this.h2=d}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&Oe|36045*t&ze,e=4283543511*e&Oe|(2950163797*(e<<16|t>>>16)&Oe)>>>16,t^=e>>>1,t=444984403*t&Oe|60499*t&ze,e=3301882366*e&Oe|(3120437893*(e<<16|t>>>16)&Oe)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const Ve=Object.freeze({map:null,hash:"",transfer:void 0});class je{#ei=!1;#ii=null;#ni=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=this.#ni.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#ni.get(t)}remove(t){if(this.#ni.delete(t),0===this.#ni.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of this.#ni.values())if(t instanceof Re)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this.#ni.get(t);let n=!1;if(void 0!==i)for(const[r,s]of Object.entries(e))i[r]!==s&&(n=!0,i[r]=s);else n=!0,this.#ni.set(t,e);n&&this.#ri(),e instanceof Re&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#ni.has(t)}get size(){return this.#ni.size}#ri(){this.#ei||(this.#ei=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#ei&&(this.#ei=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new Ue(this)}get serializable(){if(0===this.#ni.size)return Ve;const t=new Map,e=new He,i=[],n=Object.create(null);let r=!1;for(const[s,a]of this.#ni){const i=a instanceof Re?a.serialize(!1,n):a;i&&(t.set(s,i),e.update(`${s}:${JSON.stringify(i)}`),r||=!!i.bitmap)}if(r)for(const s of t.values())s.bitmap&&i.push(s.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:Ve}get editorStats(){let t=null;const e=new Map;for(const i of this.#ni.values()){if(!(i instanceof Re))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:r}=n;e.has(r)||e.set(r,Object.getPrototypeOf(i).constructor),t||=Object.create(null);const s=t[r]||=new Map;for(const[t,e]of Object.entries(n)){if("type"===t)continue;let i=s.get(t);i||(i=new Map,s.set(t,i));const n=i.get(e)??0;i.set(e,n+1)}}for(const[i,n]of e)t[i]=n.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#ii=null}get modifiedIds(){if(this.#ii)return this.#ii;const t=[];for(const e of this.#ni.values())e instanceof Re&&e.annotationElementId&&e.serialize()&&t.push(e.annotationElementId);return this.#ii={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#ni.entries()}}class Ue extends je{#si;constructor(t){super();const{map:e,hash:i,transfer:n}=t.serializable,r=structuredClone(e,n?{transfer:n}:null);this.#si={map:r,hash:i,transfer:n}}get print(){Rt("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#si}get modifiedIds(){return zt(this,"modifiedIds",{ids:new Set,hash:""})}}class We{#ai=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#ai.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(t&&!this.#ai.has(t.loadedName)){if(Bt(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:r}=t,s=new FontFace(e,n,r);this.addNativeFontFace(s);try{await s.load(),this.#ai.add(e),i?.(t)}catch{It(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}Rt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void(await this.loadSystemFont(t));if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw It(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){return zt(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return zt(this,"isSyncFontLoadingSupported",K||Yt.platform.isFirefox)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(Bt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return zt(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let r,s;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=n(h,976,d.length,d);const c=1482184792;let u=i(h,16);for(r=0,s=d.length-3;r<s;r+=4)u=u-c+i(d,r)|0;var g;r<d.length&&(u=u-c+i(d+"XXX",r)|0),h=n(h,16,4,(g=u,String.fromCharCode(g>>24&255,g>>16&255,g>>8&255,255&g)));const p=`@font-face {font-family:"${d}";src:url(data:font/opentype;base64,${btoa(h)});}`;this.insertRule(p);const f=this._document.createElement("div");f.style.visibility="hidden",f.style.width=f.style.height="10px",f.style.position="absolute",f.style.top=f.style.left="0px";for(const m of[t.loadedName,d]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=m,f.append(t)}this._document.body.append(f),function t(e,i){if(++l>30)return It("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(d,()=>{f.remove(),e.complete()})}}class $e{constructor(t,e=null){this.compiledGlyphs=Object.create(null);for(const i in t)this[i]=t[i];this._inspectFont=e}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${ne(this.data)});`;let e;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${t}}`}else e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let n;try{n=t.get(i)}catch(s){It(`getPathGenerator - ignoring character: "${s}".`)}const r=new Path2D(n||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=r}}function Ge(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const qe=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,Xe=function(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[n,r,...s]=i;if(!t(n)&&!Number.isInteger(n))return!1;if(!e(r))return!1;const a=s.length;let o=!0;switch(r.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(const l of s)if(!("number"==typeof l||o&&null===l))return!1;return!0}.bind(null,qe,t=>"object"==typeof t&&"string"==typeof t?.name);class Ye{#oi=new Map;#li=Promise.resolve();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#li.then(()=>{for(const[t]of this.#oi)t.call(this,i)})}addEventListener(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:r}=i;if(r.aborted)return void It("LoopbackPort - cannot use an `aborted` signal.");const s=()=>this.removeEventListener(t,e);n=()=>r.removeEventListener("abort",s),r.addEventListener("abort",s)}this.#oi.set(e,n)}removeEventListener(t,e){const i=this.#oi.get(e);i?.(),this.#oi.delete(e)}terminate(){for(const[,t]of this.#oi)t?.();this.#oi.clear()}}const Ke=1,Qe=2,Ze=1,Je=2,ti=3,ei=4,ii=5,ni=6,ri=7,si=8;function ai(){}function oi(t){if(t instanceof Gt||t instanceof Ut||t instanceof Vt||t instanceof Wt||t instanceof jt)return t;switch(t instanceof Error||"object"==typeof t&&null!==t||Rt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Gt(t.message);case"InvalidPDFException":return new Ut(t.message);case"PasswordException":return new Vt(t.message,t.code);case"ResponseException":return new Wt(t.message,t.status,t.missing);case"UnknownErrorException":return new jt(t.message,t.details)}return new jt(t.message,t.toString())}class li{#di=new AbortController;constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",this.#hi.bind(this),{signal:this.#di.signal})}#hi({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#ci(t);if(t.callback){const e=t.callbackId,i=this.callbackCapabilities[e];if(!i)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===Ke)i.resolve(t.data);else{if(t.callback!==Qe)throw new Error("Unexpected callback case");i.reject(oi(t.reason))}return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,n=t.sourceName,r=this.comObj;return void Promise.try(e,t.data).then(function(e){r.postMessage({sourceName:i,targetName:n,callback:Ke,callbackId:t.callbackId,data:e})},function(e){r.postMessage({sourceName:i,targetName:n,callback:Qe,callbackId:t.callbackId,reason:oi(e)})})}t.streamId?this.#ui(t):e(t.data)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[n]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(s){r.reject(s)}return r.promise}sendWithStream(t,e,i,n){const r=this.streamId++,s=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[r]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:s,targetName:a,action:t,streamId:r,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[r].pullCall=e,o.postMessage({sourceName:s,targetName:a,stream:ni,streamId:r,desiredSize:t.desiredSize}),e.promise},cancel:t=>{Bt(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[r].cancelCall=e,this.streamControllers[r].isClosed=!0,o.postMessage({sourceName:s,targetName:a,stream:Ze,streamId:r,reason:oi(t)}),e.promise}},i)}#ui(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,r=this.comObj,s=this,a=this.actionHandler[t.action],o={enqueue(t,s=1,a){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:i,targetName:n,stream:ei,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:n,stream:ti,streamId:e}),delete s.streamSinks[e])},error(t){Bt(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:n,stream:ii,streamId:e,reason:oi(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(a,t.data,o).then(function(){r.postMessage({sourceName:i,targetName:n,stream:si,streamId:e,success:!0})},function(t){r.postMessage({sourceName:i,targetName:n,stream:si,streamId:e,reason:oi(t)})})}#ci(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,r=this.comObj,s=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case si:t.success?s.startCall.resolve():s.startCall.reject(oi(t.reason));break;case ri:t.success?s.pullCall.resolve():s.pullCall.reject(oi(t.reason));break;case ni:if(!a){r.postMessage({sourceName:i,targetName:n,stream:ri,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||ai).then(function(){r.postMessage({sourceName:i,targetName:n,stream:ri,streamId:e,success:!0})},function(t){r.postMessage({sourceName:i,targetName:n,stream:ri,streamId:e,reason:oi(t)})});break;case ei:if(Bt(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(t.chunk);break;case ti:if(Bt(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this.#gi(s,e);break;case ii:Bt(s,"error should have stream controller"),s.controller.error(oi(t.reason)),this.#gi(s,e);break;case Je:t.success?s.cancelCall.resolve():s.cancelCall.reject(oi(t.reason)),this.#gi(s,e);break;case Ze:if(!a)break;const o=oi(t.reason);Promise.try(a.onCancel||ai,o).then(function(){r.postMessage({sourceName:i,targetName:n,stream:Je,streamId:e,success:!0})},function(t){r.postMessage({sourceName:i,targetName:n,stream:Je,streamId:e,reason:oi(t)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#gi(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#di?.abort(),this.#di=null}}class di{#pi=!1;constructor({enableHWA:t=!1}){this.#pi=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!this.#pi})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Rt("Abstract method `_createCanvas` called.")}}class hi extends di{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class ci{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(t=>({cMapData:t,isCompressed:this.isCompressed})).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){Rt("Abstract method `_fetch` called.")}}class ui extends ci{async _fetch(t){const e=await ae(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):Xt(e)}}class gi{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,r){return"none"}destroy(t=!1){}}class pi extends gi{#fi;#mi;#bi;#vi;#wi;#xi;#w=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#vi=t,this.#wi=e}get#y(){return this.#mi||=new Map}get#yi(){return this.#xi||=new Map}get#Ai(){if(!this.#bi){const t=this.#wi.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=this.#wi.createElementNS(re,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#bi=this.#wi.createElementNS(re,"defs"),t.append(i),i.append(this.#bi),this.#wi.body.append(t)}return this.#bi}#Ci(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,r=new Array(256),s=new Array(256),a=new Array(256);for(let o=0;o<256;o++)r[o]=e[o]/255,s[o]=i[o]/255,a[o]=n[o]/255;return[r.join(","),s.join(","),a.join(",")]}#Ei(t){if(void 0===this.#fi){this.#fi="";const t=this.#wi.URL;t!==this.#wi.baseURI&&(de(t)?It('#createUrl: ignore "data:"-URL for performance reasons.'):this.#fi=Ot(t,""))}return`url(${this.#fi}#${t})`}addFilter(t){if(!t)return"none";let e=this.#y.get(t);if(e)return e;const[i,n,r]=this.#Ci(t),s=1===t.length?i:`${i}${n}${r}`;if(e=this.#y.get(s),e)return this.#y.set(t,e),e;const a=`g_${this.#vi}_transfer_map_${this.#w++}`,o=this.#Ei(a);this.#y.set(t,o),this.#y.set(s,o);const l=this.#Si(a);return this.#ki(i,n,r,l),o}addHCMFilter(t,e){const i=`${t}-${e}`,n="base";let r=this.#yi.get(n);if(r?.key===i)return r.url;if(r?(r.filter?.remove(),r.key=i,r.url="none",r.filter=null):(r={key:i,url:"none",filter:null},this.#yi.set(n,r)),!t||!e)return r.url;const s=this.#_i(t);t=Qt.makeHexColor(...s);const a=this.#_i(e);if(e=Qt.makeHexColor(...a),this.#Ai.style.color="","#000000"===t&&"#ffffff"===e||t===e)return r.url;const o=new Array(256);for(let u=0;u<=255;u++){const t=u/255;o[u]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),d=`g_${this.#vi}_hcm_filter`,h=r.filter=this.#Si(d);this.#ki(l,l,l,h),this.#Ti(h);const c=(t,e)=>{const i=s[t]/255,n=a[t]/255,r=new Array(e+1);for(let s=0;s<=e;s++)r[s]=i+s/e*(n-i);return r.join(",")};return this.#ki(c(0,5),c(1,5),c(2,5),h),r.url=this.#Ei(d),r.url}addAlphaFilter(t){let e=this.#y.get(t);if(e)return e;const[i]=this.#Ci([t]),n=`alpha_${i}`;if(e=this.#y.get(n),e)return this.#y.set(t,e),e;const r=`g_${this.#vi}_alpha_map_${this.#w++}`,s=this.#Ei(r);this.#y.set(t,s),this.#y.set(n,s);const a=this.#Si(r);return this.#Li(i,a),s}addLuminosityFilter(t){let e,i,n=this.#y.get(t||"luminosity");if(n)return n;if(t?([e]=this.#Ci([t]),i=`luminosity_${e}`):i="luminosity",n=this.#y.get(i),n)return this.#y.set(t,n),n;const r=`g_${this.#vi}_luminosity_map_${this.#w++}`,s=this.#Ei(r);this.#y.set(t,s),this.#y.set(i,s);const a=this.#Si(r);return this.#Di(a),t&&this.#Li(e,a),s}addHighlightHCMFilter(t,e,i,n,r){const s=`${e}-${i}-${n}-${r}`;let a=this.#yi.get(t);if(a?.key===s)return a.url;if(a?(a.filter?.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},this.#yi.set(t,a)),!e||!i)return a.url;const[o,l]=[e,i].map(this.#_i.bind(this));let d=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),h=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[c,u]=[n,r].map(this.#_i.bind(this));h<d&&([d,h,c,u]=[h,d,u,c]),this.#Ai.style.color="";const g=(t,e,i)=>{const n=new Array(256),r=(h-d)/i,s=t/255,a=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(d+l*r),e=s+l*a;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},p=`g_${this.#vi}_hcm_${t}_filter`,f=a.filter=this.#Si(p);return this.#Ti(f),this.#ki(g(c[0],u[0],5),g(c[1],u[1],5),g(c[2],u[2],5),f),a.url=this.#Ei(p),a.url}destroy(t=!1){t&&this.#xi?.size||(this.#bi?.parentNode.parentNode.remove(),this.#bi=null,this.#mi?.clear(),this.#mi=null,this.#xi?.clear(),this.#xi=null,this.#w=0)}#Di(t){const e=this.#wi.createElementNS(re,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#Ti(t){const e=this.#wi.createElementNS(re,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#Si(t){const e=this.#wi.createElementNS(re,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#Ai.append(e),e}#Pi(t,e,i){const n=this.#wi.createElementNS(re,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}#ki(t,e,i,n){const r=this.#wi.createElementNS(re,"feComponentTransfer");n.append(r),this.#Pi(r,"feFuncR",t),this.#Pi(r,"feFuncG",e),this.#Pi(r,"feFuncB",i)}#Li(t,e){const i=this.#wi.createElementNS(re,"feComponentTransfer");e.append(i),this.#Pi(i,"feFuncA",t)}#_i(t){return this.#Ai.style.color=t,ve(getComputedStyle(this.#Ai).getPropertyValue("color"))}}class fi{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){Rt("Abstract method `_fetch` called.")}}class mi extends fi{async _fetch(t){const e=await ae(t,"arraybuffer");return new Uint8Array(e)}}class bi{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(t=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){Rt("Abstract method `_fetch` called.")}}class vi extends bi{async _fetch(t){const e=await ae(t,"arraybuffer");return new Uint8Array(e)}}async function wi(t){const e=process.getBuiltinModule("fs"),i=await e.promises.readFile(t);return new Uint8Array(i)}K&&It("Please use the `legacy` build in Node.js environments.");class xi extends gi{}class yi extends di{_createCanvas(t,i){return process.getBuiltinModule("module").createRequire(e.meta.url)("@napi-rs/canvas").createCanvas(t,i)}}class Ai extends ci{async _fetch(t){return wi(t)}}class Ci extends fi{async _fetch(t){return wi(t)}}class Ei extends bi{async _fetch(t){return wi(t)}}const Si="Fill",ki="Stroke",_i="Shading";function Ti(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],i,n),t.clip(r)}class Li{isModifyingCurrentTransform(){return!1}getPattern(){Rt("Abstract method `getPattern` called.")}}class Di extends Li{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let r;if(n===ki||n===Si){const s=e.current.getClippedPathBoundingBox(n,we(t))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,o=Math.ceil(s[3]-s[1])||1,l=e.cachedCanvases.getCanvas("pattern",a,o),d=l.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),i=Qt.transform(i,[1,0,0,1,s[0],s[1]]),d.transform(...e.baseTransform),this.matrix&&d.transform(...this.matrix),Ti(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),r=t.createPattern(l.canvas,"no-repeat");const h=new DOMMatrix(i);r.setTransform(h)}else Ti(t,this._bbox),r=this._createGradient(t);return r}}function Pi(t,e,i,n,r,s,a,o){const l=e.coords,d=e.colors,h=t.data,c=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=s,s=a,a=u),l[n+1]>l[r+1]&&(u=n,n=r,r=u,u=a,a=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=s,s=a,a=u);const g=(l[i]+e.offsetX)*e.scaleX,p=(l[i+1]+e.offsetY)*e.scaleY,f=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,b=(l[r]+e.offsetX)*e.scaleX,v=(l[r+1]+e.offsetY)*e.scaleY;if(p>=v)return;const w=d[s],x=d[s+1],y=d[s+2],A=d[a],C=d[a+1],E=d[a+2],S=d[o],k=d[o+1],_=d[o+2],T=Math.round(p),L=Math.round(v);let D,P,M,F,I,R,B,N;for(let O=T;O<=L;O++){if(O<m){const t=O<p?0:(p-O)/(p-m);D=g-(g-f)*t,P=w-(w-A)*t,M=x-(x-C)*t,F=y-(y-E)*t}else{let t;t=O>v?1:m===v?0:(m-O)/(m-v),D=f-(f-b)*t,P=A-(A-S)*t,M=C-(C-k)*t,F=E-(E-_)*t}let t;t=O<p?0:O>v?1:(p-O)/(p-v),I=g-(g-b)*t,R=w-(w-S)*t,B=x-(x-k)*t,N=y-(y-_)*t;const e=Math.round(Math.min(D,I)),i=Math.round(Math.max(D,I));let n=c*O+4*e;for(let r=e;r<=i;r++)t=(D-r)/(D-I),t<0?t=0:t>1&&(t=1),h[n++]=P-(P-R)*t|0,h[n++]=M-(M-B)*t|0,h[n++]=F-(F-N)*t|0,h[n++]=255}}function Mi(t,e,i){const n=e.coords,r=e.colors;let s,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,d=o-1;for(s=0;s<l;s++){let e=s*o;for(let s=0;s<d;s++,e++)Pi(t,i,n[e],n[e+1],n[e+o],r[e],r[e+1],r[e+o]),Pi(t,i,n[e+o+1],n[e+1],n[e+o],r[e+o+1],r[e+1],r[e+o])}break;case"triangles":for(s=0,a=n.length;s<a;s+=3)Pi(t,i,n[s],n[s+1],n[s+2],r[s],r[s+1],r[s+2]);break;default:throw new Error("illegal figure")}}class Fi extends Li{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),r=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-n,a=Math.ceil(this._bounds[3])-r,o=Math.min(Math.ceil(Math.abs(s*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),d=s/o,h=a/l,c={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-r,scaleX:1/d,scaleY:1/h},u=o+4,g=l+4,p=i.getCanvas("mesh",u,g),f=p.context,m=f.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const b of this._figures)Mi(m,b,c);return f.putImageData(m,2,2),{canvas:p.canvas,offsetX:n-2*d,offsetY:r-2*h,scaleX:d,scaleY:h}}isModifyingCurrentTransform(){return!0}getPattern(t,e,i,n){Ti(t,this._bbox);const r=new Float32Array(2);if(n===_i)Qt.singularValueDecompose2dScale(we(t),r);else if(this.matrix){Qt.singularValueDecompose2dScale(this.matrix,r);const[t,i]=r;Qt.singularValueDecompose2dScale(e.baseTransform,r),r[0]*=t,r[1]*=i}else Qt.singularValueDecompose2dScale(e.baseTransform,r);const s=this._createMeshCanvas(r,n===_i?null:this._background,e.cachedCanvases);return n!==_i&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(s.offsetX,s.offsetY),t.scale(s.scaleX,s.scaleY),t.createPattern(s.canvas,"no-repeat")}}class Ii extends Li{getPattern(){return"hotpink"}}const Ri=1,Bi=2;class Ni{static MAX_PATTERN_SIZE=3e3;constructor(t,e,i,n){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=i,this.baseTransform=n}createPatternCanvas(t){const{bbox:e,operatorList:i,paintType:n,tilingType:r,color:s,canvasGraphicsFactory:a}=this;let{xstep:o,ystep:l}=this;o=Math.abs(o),l=Math.abs(l),Ft("TilingType: "+r);const d=e[0],h=e[1],c=e[2],u=e[3],g=c-d,p=u-h,f=new Float32Array(2);Qt.singularValueDecompose2dScale(this.matrix,f);const[m,b]=f;Qt.singularValueDecompose2dScale(this.baseTransform,f);const v=m*f[0],w=b*f[1];let x=g,y=p,A=!1,C=!1;const E=Math.ceil(o*v),S=Math.ceil(l*w);E>=Math.ceil(g*v)?x=o:A=!0,S>=Math.ceil(p*w)?y=l:C=!0;const k=this.getSizeAndScale(x,this.ctx.canvas.width,v),_=this.getSizeAndScale(y,this.ctx.canvas.height,w),T=t.cachedCanvases.getCanvas("pattern",k.size,_.size),L=T.context,D=a.createCanvasGraphics(L);if(D.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(D,n,s),L.translate(-k.scale*d,-_.scale*h),D.transform(k.scale,0,0,_.scale,0,0),L.save(),this.clipBbox(D,d,h,c,u),D.baseTransform=we(D.ctx),D.executeOperatorList(i),D.endDrawing(),L.restore(),A||C){const e=T.canvas;A&&(x=o),C&&(y=l);const i=this.getSizeAndScale(x,this.ctx.canvas.width,v),n=this.getSizeAndScale(y,this.ctx.canvas.height,w),r=i.size,s=n.size,a=t.cachedCanvases.getCanvas("pattern-workaround",r,s),c=a.context,u=A?Math.floor(g/o):0,f=C?Math.floor(p/l):0;for(let t=0;t<=u;t++)for(let i=0;i<=f;i++)c.drawImage(e,r*t,s*i,r,s,0,0,r,s);return{canvas:a.canvas,scaleX:i.scale,scaleY:n.scale,offsetX:d,offsetY:h}}return{canvas:T.canvas,scaleX:k.scale,scaleY:_.scale,offsetX:d,offsetY:h}}getSizeAndScale(t,e,i){const n=Math.max(Ni.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);return r>=n?r=n:i=r/t,{scale:i,size:r}}clipBbox(t,e,i,n,r){const s=n-e,a=r-i;t.ctx.rect(e,i,s,a),Qt.axialAlignedBoundingBox([e,i,n,r],we(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,r=t.current;switch(e){case Ri:const{fillStyle:t,strokeStyle:s}=this.ctx;n.fillStyle=r.fillColor=t,n.strokeStyle=r.strokeColor=s;break;case Bi:n.fillStyle=n.strokeStyle=i,r.fillColor=r.strokeColor=i;break;default:throw new $t(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,i,n){let r=i;n!==_i&&(r=Qt.transform(r,e.baseTransform),this.matrix&&(r=Qt.transform(r,this.matrix)));const s=this.createPatternCanvas(e);let a=new DOMMatrix(r);a=a.translate(s.offsetX,s.offsetY),a=a.scale(1/s.scaleX,1/s.scaleY);const o=t.createPattern(s.canvas,"repeat");return o.setTransform(a),o}}function Oi({src:t,srcPos:e=0,dest:i,width:n,height:r,nonBlackColor:s=4294967295,inverseDecode:a=!1}){const o=Yt.isLittleEndian?4278190080:255,[l,d]=a?[s,o]:[o,s],h=n>>3,c=7&n,u=t.length;i=new Uint32Array(i.buffer);let g=0;for(let p=0;p<r;p++){for(const r=e+h;e<r;e++){const n=e<u?t[e]:255;i[g++]=128&n?d:l,i[g++]=64&n?d:l,i[g++]=32&n?d:l,i[g++]=16&n?d:l,i[g++]=8&n?d:l,i[g++]=4&n?d:l,i[g++]=2&n?d:l,i[g++]=1&n?d:l}if(0===c)continue;const n=e<u?t[e++]:255;for(let t=0;t<c;t++)i[g++]=n&1<<7-t?d:l}return{srcPos:e,destPos:g}}const zi=16,Hi=new DOMMatrix,Vi=new Float32Array(2),ji=new Float32Array([1/0,1/0,-1/0,-1/0]);class Ui{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Wi(t,e,i,n,r,s,a,o,l,d){const[h,c,u,g,p,f]=we(t);if(0===c&&0===u){const m=a*h+p,b=Math.round(m),v=o*g+f,w=Math.round(v),x=(a+l)*h+p,y=Math.abs(Math.round(x)-b)||1,A=(o+d)*g+f,C=Math.abs(Math.round(A)-w)||1;return t.setTransform(Math.sign(h),0,0,Math.sign(g),b,w),t.drawImage(e,i,n,r,s,0,0,y,C),t.setTransform(h,c,u,g,p,f),[y,C]}if(0===h&&0===g){const m=o*u+p,b=Math.round(m),v=a*c+f,w=Math.round(v),x=(o+d)*u+p,y=Math.abs(Math.round(x)-b)||1,A=(a+l)*c+f,C=Math.abs(Math.round(A)-w)||1;return t.setTransform(0,Math.sign(c),Math.sign(u),0,b,w),t.drawImage(e,i,n,r,s,0,0,C,y),t.setTransform(h,c,u,g,p,f),[C,y]}return t.drawImage(e,i,n,r,s,a,o,l,d),[Math.hypot(h,c)*l,Math.hypot(u,g)*d]}class $i{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=Q;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=ct;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,e){this.clipBox=new Float32Array([0,0,t,e]),this.minMax=ji.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Si,e=null){const i=this.minMax.slice();if(t===ki){e||Rt("Stroke bounding box must include transform."),Qt.singularValueDecompose2dScale(e,Vi);const t=Vi[0]*this.lineWidth/2,n=Vi[1]*this.lineWidth/2;i[0]-=t,i[1]-=n,i[2]+=t,i[3]+=n}return i}updateClipFromPath(){const t=Qt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(ji,0)}getClippedPathBoundingBox(t=Si,e=null){return Qt.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Gi(t,e){if(e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,r=i%zi,s=(i-r)/zi,a=0===r?s:s+1,o=t.createImageData(n,zi);let l,d=0;const h=e.data,c=o.data;let u,g,p,f;if(e.kind===bt.GRAYSCALE_1BPP){const e=h.byteLength,i=new Uint32Array(c.buffer,0,c.byteLength>>2),f=i.length,m=n+7>>3,b=4294967295,v=Yt.isLittleEndian?4278190080:255;for(u=0;u<a;u++){for(p=u<s?zi:r,l=0,g=0;g<p;g++){const t=e-d;let r=0;const s=t>m?n:8*t-7,a=-8&s;let o=0,c=0;for(;r<a;r+=8)c=h[d++],i[l++]=128&c?b:v,i[l++]=64&c?b:v,i[l++]=32&c?b:v,i[l++]=16&c?b:v,i[l++]=8&c?b:v,i[l++]=4&c?b:v,i[l++]=2&c?b:v,i[l++]=1&c?b:v;for(;r<s;r++)0===o&&(c=h[d++],o=128),i[l++]=c&o?b:v,o>>=1}for(;l<f;)i[l++]=0;t.putImageData(o,0,u*zi)}}else if(e.kind===bt.RGBA_32BPP){for(g=0,f=n*zi*4,u=0;u<s;u++)c.set(h.subarray(d,d+f)),d+=f,t.putImageData(o,0,g),g+=zi;u<a&&(f=n*r*4,c.set(h.subarray(d,d+f)),t.putImageData(o,0,g))}else{if(e.kind!==bt.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(p=zi,f=n*p,u=0;u<a;u++){for(u>=s&&(p=r,f=n*p),l=0,g=f;g--;)c[l++]=h[d++],c[l++]=h[d++],c[l++]=h[d++],c[l++]=255;t.putImageData(o,0,u*zi)}}}function qi(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,r=i%zi,s=(i-r)/zi,a=0===r?s:s+1,o=t.createImageData(n,zi);let l=0;const d=e.data,h=o.data;for(let c=0;c<a;c++){const e=c<s?zi:r;({srcPos:l}=Oi({src:d,srcPos:l,dest:h,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,c*zi)}}function Xi(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Yi(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}function Ki(t,e){if(e)return!0;Qt.singularValueDecompose2dScale(t,Vi);const i=Math.fround(Ae.pixelRatio*se.PDF_TO_CSS_UNITS);return Vi[0]<=i&&Vi[1]<=i}const Qi=["butt","round","square"],Zi=["miter","round","bevel"],Ji={},tn={};class en{constructor(t,e,i,n,r,{optionalContentConfig:s,markedContentStack:a=null},o,l){this.ctx=t,this.current=new $i(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=r,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=s,this.cachedCanvases=new Ui(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:n=null}){const r=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,r,s),this.ctx.fillStyle=a,i){const t=this.cachedCanvases.getCanvas("transparent",r,s);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...we(this.compositeCtx))}this.ctx.save(),Yi(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=we(this.ctx)}executeOperatorList(t,e,i,n){const r=t.argsArray,s=t.fnArray;let a=e||0;const o=r.length;if(o===a)return a;const l=o-a>10&&"function"==typeof i,d=l?Date.now()+15:0;let h=0;const c=this.commonObjs,u=this.objs;let g;for(;;){if(void 0!==n&&a===n.nextBreakPoint)return n.breakIt(a,i),a;if(g=s[a],g!==St.dependency)this[g].apply(this,r[a]);else for(const t of r[a]){const e=t.startsWith("g_")?c:u;if(!e.has(t))return e.get(t,i),a}if(a++,a===o)return a;if(l&&++h>10){if(Date.now()>d)return i(),a;h=0}}}#Mi(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),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)}endDrawing(){this.#Mi(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#Fi()}#Fi(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const i=t.width??t.displayWidth,n=t.height??t.displayHeight;let r,s,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,d=n,h="prescale1";for(;a>2&&l>1||o>2&&d>1;){let e=l,i=d;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&d>1&&(i=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2,o/=d/i),r=this.cachedCanvases.getCanvas(h,e,i),s=r.context,s.clearRect(0,0,e,i),s.drawImage(t,0,0,l,d,0,0,e,i),t=r.canvas,l=e,d=i,h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:d}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,r=this.current.fillColor,s=this.current.patternFill,a=we(e);let o,l,d,h;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(s?a:[a.slice(0,4),r]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!s)return{canvas:i,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])};d=i}d||(h=this.cachedCanvases.getCanvas("maskCanvas",i,n),qi(h.context,t));let c=Qt.transform(a,[1/i,0,0,-1/n,0,0]);c=Qt.transform(c,[1,0,0,1,0,-n]);const u=ji.slice();Qt.axialAlignedBoundingBox([0,0,i,n],c,u);const[g,p,f,m]=u,b=Math.round(f-g)||1,v=Math.round(m-p)||1,w=this.cachedCanvases.getCanvas("fillCanvas",b,v),x=w.context,y=g,A=p;x.translate(-y,-A),x.transform(...c),d||(d=this._scaleImage(h.canvas,xe(x)),d=d.img,o&&s&&o.set(l,d)),x.imageSmoothingEnabled=Ki(we(x),t.interpolate),Wi(x,d,0,0,d.width,d.height,0,0,i,n),x.globalCompositeOperation="source-in";const C=Qt.transform(xe(x),[1,0,0,1,-y,-A]);return x.fillStyle=s?r.getPattern(e,this,C,Si):r,x.fillRect(0,0,i,n),o&&!s&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,w.canvas)),{canvas:w.canvas,offsetX:Math.round(y),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Qi[t]}setLineJoin(t){this.ctx.lineJoin=Zi[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=i;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.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx;const r=this.ctx=n.context;r.setTransform(this.suspendedCtx.getTransform()),Xi(this.suspendedCtx,r),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,r,s,a){e.transform(t,i,n,r,s,a),this.__originalTransform(t,i,n,r,s,a)},t.setTransform=function(t,i,n,r,s,a){e.setTransform(t,i,n,r,s,a),this.__originalSetTransform(t,i,n,r,s,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,r,s,a){e.bezierCurveTo(t,i,n,r,s,a),this.__originalBezierCurveTo(t,i,n,r,s,a)},t.rect=function(t,i,n,r){e.rect(t,i,n,r),this.__originalRect(t,i,n,r)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(r,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Xi(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const r=n[0],s=n[1],a=n[2]-r,o=n[3]-s;0!==a&&0!==o&&(this.genericComposeSMask(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,r,s,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,r,s,a,o,l,d,h){let c=t.canvas,u=o-d,g=l-h;if(s)if(u<0||g<0||u+i>c.width||g+n>c.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(c,-u,-g),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over",c=t.canvas,u=g=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,g,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=s,t.fillRect(u,g,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===r&&a?e.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===r&&(e.filter=this.filterFactory.addLuminosityFilter(a));const p=new Path2D;p.rect(o,l,i,n),e.clip(p),e.globalCompositeOperation="destination-in",e.drawImage(c,u,g,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode&&Xi(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Xi(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(t,e,i,n,r,s){this.ctx.transform(t,e,i,n,r,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){let[n]=e;if(!i)return n||=e[0]=new Path2D,void this[t](n);if(!(n instanceof Path2D)){const t=e[0]=new Path2D;for(let e=0,i=n.length;e<i;)switch(n[e++]){case kt:t.moveTo(n[e++],n[e++]);break;case _t:t.lineTo(n[e++],n[e++]);break;case Tt:t.bezierCurveTo(n[e++],n[e++],n[e++],n[e++],n[e++],n[e++]);break;case Lt:t.closePath();break;default:It(`Unrecognized drawing path operator: ${n[e-1]}`)}n=t}Qt.axialAlignedBoundingBox(i,we(this.ctx),this.current.minMax),this[t](n)}closePath(){this.ctx.closePath()}stroke(t,e=!0){const i=this.ctx,n=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof n&&n?.getPattern){const e=n.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=n.getPattern(i,this,xe(i),ki),e){const n=new Path2D;n.addPath(t,i.getTransform().invertSelf().multiplySelf(e)),t=n}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);e&&this.consumePath(t,this.current.getClippedPathBoundingBox(ki,we(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,e=!0){const i=this.ctx,n=this.current.fillColor;let r=!1;if(this.current.patternFill){const e=n.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.fillStyle=n.getPattern(i,this,xe(i),Si),e){const n=new Path2D;n.addPath(t,i.getTransform().invertSelf().multiplySelf(e)),t=n}r=!0}const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),r&&i.restore(),e&&this.consumePath(t,s)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=Ji}eoClip(){this.pendingClip=tn}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0===t)return;const i=new Path2D,n=e.getTransform().invertSelf();for(const{transform:r,x:s,y:a,fontSize:o,path:l}of t)i.addPath(l,new DOMMatrix(r).preMultiplySelf(n).translate(s,a).scale(o,-o));e.clip(i),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),n=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||Q,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||It("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const r=i.loadedName||"sans-serif",s=i.systemFontInfo?.css||`"${r}", ${i.fallbackName}`;let a="normal";i.black?a="900":i.bold&&(a="bold");const o=i.italic?"italic":"normal";let l=e;e<16?l=16:e>100&&(l=100),this.current.fontSizeScale=e/l,this.ctx.font=`${o} ${a} ${l}px ${s}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t){const{current:e}=this;e.textMatrix=t,e.textMatrixScale=Math.hypot(t[0],t[1]),e.x=e.lineX=0,e.y=e.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#Ii(t,e,i){const n=new Path2D;return n.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),n}paintChar(t,e,i,n,r){const s=this.ctx,a=this.current,o=a.font,l=a.textRenderingMode,d=a.fontSize/a.fontSizeScale,h=l&ft,c=!!(l&mt),u=a.patternFill&&!o.missingFile,g=a.patternStroke&&!o.missingFile;let p;if((o.disableFontFace||c||u||g)&&(p=o.getPathGenerator(this.commonObjs,t)),o.disableFontFace||u||g){let t;if(s.save(),s.translate(e,i),s.scale(d,-d),h!==ct&&h!==gt||(n?(t=s.getTransform(),s.setTransform(...n),s.fill(this.#Ii(p,t,n))):s.fill(p)),h===ut||h===gt)if(r){t||=s.getTransform(),s.setTransform(...r);const{a:e,b:i,c:n,d:a}=t,o=Qt.inverseTransform(r),l=Qt.transform([e,i,n,a,0,0],o);Qt.singularValueDecompose2dScale(l,Vi),s.lineWidth*=Math.max(Vi[0],Vi[1])/d,s.stroke(this.#Ii(p,t,r))}else s.lineWidth/=d,s.stroke(p);s.restore()}else h!==ct&&h!==gt||s.fillText(t,e,i),h!==ut&&h!==gt||s.strokeText(t,e,i);c&&(this.pendingTextPaths||=[]).push({transform:we(s),x:e,y:i,fontSize:d,path:p})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return zt(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const r=this.ctx,s=e.fontSizeScale,a=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,d=e.textHScale*l,h=t.length,c=i.vertical,u=c?1:-1,g=i.defaultVMetrics,p=n*e.fontMatrix[0],f=e.textRenderingMode===ct&&!i.disableFontFace&&!e.patternFill;let m,b;if(r.save(),e.textMatrix&&r.transform(...e.textMatrix),r.translate(e.x,e.y+e.textRise),l>0?r.scale(d,-1):r.scale(d,1),e.patternFill){r.save();const t=e.fillColor.getPattern(r,this,xe(r),Si);m=we(r),r.restore(),r.fillStyle=t}if(e.patternStroke){r.save();const t=e.strokeColor.getPattern(r,this,xe(r),ki);b=we(r),r.restore(),r.strokeStyle=t}let v=e.lineWidth;const w=e.textMatrixScale;if(0===w||0===v){const t=e.textRenderingMode&ft;t!==ut&&t!==gt||(v=this.getSinglePixelWidth())}else v/=w;if(1!==s&&(r.scale(s,s),v/=s),r.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return r.fillText(i.join(""),0,0),e.x+=n*p*d,r.restore(),void this.compose()}let x,y=0;for(x=0;x<h;++x){const e=t[x];if("number"==typeof e){y+=u*e*n/1e3;continue}let d=!1;const h=(e.isSpace?o:0)+a,v=e.fontChar,w=e.accent;let A,C,E=e.width;if(c){const t=e.vmetric||g,i=-(e.vmetric?t[1]:.5*E)*p,n=t[2]*p;E=t?-t[0]:E,A=i/s,C=(y+n)/s}else A=y/s,C=0;if(i.remeasure&&E>0){const t=1e3*r.measureText(v).width/n*s;if(E<t&&this.isFontSubpixelAAEnabled){const e=E/t;d=!0,r.save(),r.scale(e,1),A/=e}else E!==t&&(A+=(E-t)/2e3*n/s)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(f&&!w)r.fillText(v,A,C);else if(this.paintChar(v,A,C,m,b),w){const t=A+n*w.offset.x/s,e=C-n*w.offset.y/s;this.paintChar(w.fontChar,t,e,m,b)}y+=c?E*p-h*l:E*p+h*l,d&&r.restore()}c?e.y-=y:e.x+=y*d,r.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,r=i.fontSize,s=i.fontDirection,a=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,d=i.textHScale*s,h=i.fontMatrix||Q,c=t.length;let u,g,p,f;if(i.textRenderingMode!==pt&&0!==r){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),i.textMatrix&&e.transform(...i.textMatrix),e.translate(i.x,i.y+i.textRise),e.scale(d,s),u=0;u<c;++u){if(g=t[u],"number"==typeof g){f=a*g*r/1e3,this.ctx.translate(f,0),i.x+=f*d;continue}const s=(g.isSpace?l:0)+o,c=n.charProcOperatorList[g.operatorListId];c?this.contentVisible&&(this.save(),e.scale(r,r),e.transform(...h),this.executeOperatorList(c),this.restore()):It(`Type3 character "${g.operatorListId}" is not available.`);const m=[g.width,0];Qt.applyTransform(m,h),p=m[0]*r+s,e.translate(p,0),i.x+=p*d}e.restore()}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,r,s){const a=new Path2D;a.rect(i,n,r-i,s-n),this.ctx.clip(a),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=this.baseTransform||we(this.ctx),n={createCanvasGraphics:t=>new en(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Ni(t,this.ctx,n,i)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function(t){switch(t[0]){case"RadialAxial":return new Di(t);case"Mesh":return new Fi(t);case"Dummy":return new Ii}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,xe(e),_i);const n=xe(e);if(n){const{width:t,height:i}=e.canvas,r=ji.slice();Qt.axialAlignedBoundingBox([0,0,t,i],n,r);const[s,a,o,l]=r;this.ctx.fillRect(s,a,o-s,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Rt("Should not call beginInlineImage")}beginImageData(){Rt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=we(this.ctx),e)){Qt.axialAlignedBoundingBox(e,this.baseTransform,this.current.minMax);const[t,i,n,r]=e,s=new Path2D;s.rect(t,i,n-t,r-i),this.ctx.clip(s),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||Ft("TODO: Support non-isolated groups."),t.knockout&&It("Knockout groups not supported.");const i=we(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=ji.slice();Qt.axialAlignedBoundingBox(t.bbox,we(e),n);const r=[0,0,e.canvas.width,e.canvas.height];n=Qt.intersect(n,r)||[0,0,0,0];const s=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-s,1),l=Math.max(Math.ceil(n[3])-a,1);this.current.startNewPathAndClipBox([0,0,o,l]);let d="groupAt"+this.groupLevel;t.smask&&(d+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(d,o,l),c=h.context;c.translate(-s,-a),c.transform(...i);let u=new Path2D;const[g,p,f,m]=t.bbox;if(u.rect(g,p,f-g,m-p),t.matrix){const e=new Path2D;e.addPath(u,new DOMMatrix(t.matrix)),u=e}c.clip(u),t.smask?this.smaskStack.push({canvas:h.canvas,context:c,offsetX:s,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(s,a),e.save()),Xi(e,c),this.ctx=c,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=we(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=ji.slice();Qt.axialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t,i),this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,r){if(this.#Mi(),Yi(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],s=e[3]-e[1];if(r&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=s,Qt.singularValueDecompose2dScale(we(this.ctx),Vi);const{viewportScale:r}=this,a=Math.ceil(n*this.outputScaleX*r),o=Math.ceil(s*this.outputScaleY*r);this.annotationCanvas=this.canvasFactory.create(a,o);const{canvas:l,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(Vi[0],0,0,-Vi[1],0,s*Vi[1]),Yi(this.ctx)}else{Yi(this.ctx),this.endPath();const t=new Path2D;t.rect(e[0],e[1],n,s),this.ctx.clip(t)}}this.current=new $i(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#Fi(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this._createMaskCanvas(t),r=n.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(r,n.offsetX,n.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,r,s){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const o=we(a);a.transform(e,i,n,r,0,0);const l=this._createMaskCanvas(t);a.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let d=0,h=s.length;d<h;d+=2){const t=Qt.transform(o,[e,i,n,r,s[d],s[d+1]]);a.drawImage(l.canvas,t[4],t[5])}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const r of t){const{data:t,width:s,height:a,transform:o}=r,l=this.cachedCanvases.getCanvas("maskCanvas",s,a),d=l.context;d.save(),qi(d,this.getObject(t,r)),d.globalCompositeOperation="source-in",d.fillStyle=n?i.getPattern(d,this,xe(e),Si):i,d.fillRect(0,0,s,a),d.restore(),e.save(),e.transform(...o),e.scale(1,-1),Wi(e,l.canvas,0,0,s,a,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):It("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const r=this.getObject(t);if(!r)return void It("Dependent image isn't ready yet");const s=r.width,a=r.height,o=[];for(let l=0,d=n.length;l<d;l+=2)o.push({transform:[e,0,0,i,n[l],n[l+1]],x:0,y:0,w:s,h:a});this.paintInlineImageXObjectGroup(r,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,r=this.cachedCanvases.getCanvas("inlineImage",i,n),s=r.context;return s.filter=this.current.transferMaps,s.drawImage(e,0,0),s.filter="none",r.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;this.save();const{filter:r}=n;let s;if("none"!==r&&""!==r&&(n.filter="none"),n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Gi(n,t),s=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(s,xe(n));n.imageSmoothingEnabled=Ki(we(n),t.interpolate),Wi(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,r=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Gi(r,t),n=this.applyTransferMapsToCanvas(r)}for(const r of e)i.save(),i.transform(...r.transform),i.scale(1,-1),Wi(i,n,r.x,r.y,r.w,r.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,e){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const n=this.ctx;this.pendingClip&&(i||(this.pendingClip===tn?n.clip(t,"evenodd"):n.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=we(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:r}=this.ctx.getTransform();let s,a;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(r);if(i===n)if(0===t)s=a=1/i;else{const e=i*t;s=a=e<1?1/e:1}else if(0===t)s=1/i,a=1/n;else{const e=i*t,r=n*t;s=e<1?1/e:1,a=r<1?1/r:1}}else{const o=Math.abs(e*r-i*n),l=Math.hypot(e,i),d=Math.hypot(n,r);if(0===t)s=d/o,a=l/o;else{const e=t*o;s=d>e?d/e:1,a=l>e?l/e:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:i,current:{lineWidth:n}}=this,[r,s]=this.getScaleForStroking();if(r===s)return i.lineWidth=(n||1)*r,void i.stroke(t);const a=i.getLineDash();e&&i.save(),i.scale(r,s),Hi.a=1/r,Hi.d=1/s;const o=new Path2D;if(o.addPath(t,Hi),a.length>0){const t=Math.max(r,s);i.setLineDash(a.map(e=>e/t)),i.lineDashOffset/=t}i.lineWidth=n||1,i.stroke(o),e&&i.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in St)void 0!==en.prototype[t]&&(en.prototype[St[t]]=en.prototype[t]);let nn=class{static#Ri=null;static#Bi="";static get workerPort(){return this.#Ri}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");this.#Ri=t}static get workerSrc(){return this.#Bi}static set workerSrc(t){if("string"!=typeof t)throw new Error("Invalid `workerSrc` type.");this.#Bi=t}};class rn{#Ni;#Oi;constructor({parsedData:t,rawData:e}){this.#Ni=t,this.#Oi=e}getRaw(){return this.#Oi}get(t){return this.#Ni.get(t)??null}[Symbol.iterator](){return this.#Ni.entries()}}const sn=Symbol("INTERNAL");class an{#zi=!1;#Hi=!1;#Vi=!1;#ji=!0;constructor(t,{name:e,intent:i,usage:n,rbGroups:r}){this.#zi=!!(t&tt),this.#Hi=!!(t&et),this.name=e,this.intent=i,this.usage=n,this.rbGroups=r}get visible(){if(this.#Vi)return this.#ji;if(!this.#ji)return!1;const{print:t,view:e}=this.usage;return this.#zi?"OFF"!==e?.viewState:!this.#Hi||"OFF"!==t?.printState}_setVisible(t,e,i=!1){t!==sn&&Rt("Internal method `_setVisible` called."),this.#Vi=i,this.#ji=e}}class on{#Ui=null;#Wi=new Map;#$i=null;#Gi=null;constructor(t,e=tt){if(this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,this.#Gi=t.order;for(const i of t.groups)this.#Wi.set(i.id,new an(e,i));if("OFF"===t.baseState)for(const t of this.#Wi.values())t._setVisible(sn,!1);for(const e of t.on)this.#Wi.get(e)._setVisible(sn,!0);for(const e of t.off)this.#Wi.get(e)._setVisible(sn,!1);this.#$i=this.getHash()}}#qi(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let r;if(Array.isArray(e))r=this.#qi(e);else{if(!this.#Wi.has(e))return It(`Optional content group not found: ${e}`),!0;r=this.#Wi.get(e).visible}switch(i){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===i}isVisible(t){if(0===this.#Wi.size)return!0;if(!t)return Ft("Optional content group not defined."),!0;if("OCG"===t.type)return this.#Wi.has(t.id)?this.#Wi.get(t.id).visible:(It(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#qi(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#Wi.has(e))return It(`Optional content group not found: ${e}`),!0;if(this.#Wi.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#Wi.has(e))return It(`Optional content group not found: ${e}`),!0;if(!this.#Wi.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#Wi.has(e))return It(`Optional content group not found: ${e}`),!0;if(!this.#Wi.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#Wi.has(e))return It(`Optional content group not found: ${e}`),!0;if(this.#Wi.get(e).visible)return!1}return!0}return It(`Unknown optional content policy ${t.policy}.`),!0}return It(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,i=!0){const n=this.#Wi.get(t);if(n){if(i&&e&&n.rbGroups.length)for(const e of n.rbGroups)for(const i of e)i!==t&&this.#Wi.get(i)?._setVisible(sn,!1,!0);n._setVisible(sn,!!e,!0),this.#Ui=null}else It(`Optional content group not found: ${t}`)}setOCGState({state:t,preserveRB:e}){let i;for(const n of t){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}const t=this.#Wi.get(n);if(t)switch(i){case"ON":this.setVisibility(n,!0,e);break;case"OFF":this.setVisibility(n,!1,e);break;case"Toggle":this.setVisibility(n,!t.visible,e)}}this.#Ui=null}get hasInitialVisibility(){return null===this.#$i||this.getHash()===this.#$i}getOrder(){return this.#Wi.size?this.#Gi?this.#Gi.slice():[...this.#Wi.keys()]:null}getGroup(t){return this.#Wi.get(t)||null}getHash(){if(null!==this.#Ui)return this.#Ui;const t=new He;for(const[e,i]of this.#Wi)t.update(`${e}:${i.visible}`);return this.#Ui=t.hexdigest()}[Symbol.iterator](){return this.#Wi.entries()}}class ln{constructor(t,{disableRange:e=!1,disableStream:i=!1}){Bt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:r,progressiveDone:s,contentDispositionFilename:a}=t;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,r?.length>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;void 0===t?this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i):Bt(this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(i),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Bt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new dn(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new hn(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class dn{constructor(t,e,i=!1,n=null){this._stream=t,this._done=i||!1,this._filename=he(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class hn{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function cn(t,e){const i=new Headers;if(!t||!e||"object"!=typeof e)return i;for(const n in e){const t=e[n];void 0!==t&&i.append(n,t)}return i}function un(t){return URL.parse(t)?.origin??null}function gn({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:n}){const r={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t.get("Content-Length"),10);return Number.isInteger(s)?(r.suggestedLength=s,s<=2*i||n||!e||"bytes"!==t.get("Accept-Ranges")||"identity"!==(t.get("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r):r}function pn(t){const e=t.get("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=a(i);return t=unescape(t),t=o(t),t=l(t),s(t)}if(i=function(t){const e=[];let i;const r=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=r.exec(t));){let[,t,n,r]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,r]}const s=[];for(let n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=a(i),t&&(i=unescape(i),0===n&&(i=o(i))),s.push(i)}return s.join("")}(t),i)return s(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=a(i);return t=l(t),s(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function r(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),r=Xt(i);i=n.decode(r),e=!1}catch{}}return i}function s(t){return e&&/[\x80-\xff]/.test(t)&&(t=r("utf-8",t),e&&(t=r("iso-8859-1",t))),t}function a(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:r(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,n){if("q"===i||"Q"===i)return r(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{n=atob(n)}catch{}return r(e,n)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(he(t))return t}return null}function fn(t,e){return new Wt(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,404===t||0===t&&e.startsWith("file:"))}function mn(t){return 200===t||206===t}function bn(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function vn(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(It(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class wn{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=cn(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Bt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new xn(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new yn(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class xn{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const i=new Headers(t.headers),n=e.url;fetch(n,bn(i,this._withCredentials,this._abortController)).then(e=>{if(t._responseOrigin=un(e.url),!mn(e.status))throw fn(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const i=e.headers,{allowRangeRequests:r,suggestedLength:s}=gn({responseHeaders:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=s||this._contentLength,this._filename=pn(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Gt("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:vn(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class yn{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const r=new Headers(t.headers);r.append("Range",`bytes=${e}-${i-1}`);const s=n.url;fetch(s,bn(r,this._withCredentials,this._abortController)).then(e=>{const i=un(e.url);if(i!==t._responseOrigin)throw new Error(`Expected range response-origin "${i}" to match "${t._responseOrigin}".`);if(!mn(e.status))throw fn(e.status,s);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:vn(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class An{_responseOrigin=null;constructor({url:t,httpHeaders:e,withCredentials:i}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=cn(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[r,s]of this.headers)e.setRequestHeader(r,s);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",Bt(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){const i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void i.onError(n.status);const r=n.status||200;if((200!==r||206!==i.expectedStatus)&&r!==i.expectedStatus)return void i.onError(n.status);const s=function(t){const e=t.response;return"string"!=typeof e?e:Xt(e).buffer}(n);if(206===r){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);e?i.onDone({begin:parseInt(e[1],10),chunk:s}):(It('Missing or invalid "Content-Range" header.'),i.onError(0))}else s?i.onDone({begin:0,chunk:s}):i.onError(n.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class Cn{constructor(t){this._source=t,this._manager=new An(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return Bt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new En(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Sn(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class En{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=un(e.responseURL);const i=e.getAllResponseHeaders(),n=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(t=>{const[e,...i]=t.split(": ");return[e,i.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:s}=gn({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=pn(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=fn(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Sn{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const t=un(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=fn(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const kn=/^[a-z][a-z0-9\-+.]+:/i;class _n{constructor(t){this.source=t,this.url=function(t){if(kn.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}(t.url),Bt("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Bt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Tn(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Ln(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Tn{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=fn(0,this._url.href)),this._storedError=t,this._headersCapability.reject(t)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Gt("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Ln{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=t.source;this._isStreamingSupported=!n.disableStream;const r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:e,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Dn=Symbol("INITIAL_DATA");class Pn{#Xi=Object.create(null);#Yi(t){return this.#Xi[t]||={...Promise.withResolvers(),data:Dn}}get(t,e=null){if(e){const i=this.#Yi(t);return i.promise.then(()=>e(i.data)),null}const i=this.#Xi[t];if(!i||i.data===Dn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=this.#Xi[t];return!!e&&e.data!==Dn}delete(t){const e=this.#Xi[t];return!(!e||e.data===Dn||(delete this.#Xi[t],0))}resolve(t,e=null){const i=this.#Yi(t);i.data=e,i.resolve()}clear(){for(const t in this.#Xi){const{data:e}=this.#Xi[t];e?.bitmap?.close()}this.#Xi=Object.create(null)}*[Symbol.iterator](){for(const t in this.#Xi){const{data:e}=this.#Xi[t];e!==Dn&&(yield[t,e])}}}let Mn=class t{#Ki=Promise.withResolvers();#ft=null;#Qi=!1;#Zi=!!globalThis.FontInspector?.enabled;#Ji=null;#tn=null;#en=0;#in=0;#nn=null;#rn=null;#sn=0;#an=0;#on=Object.create(null);#ln=[];#dn=null;#hn=[];#cn=new WeakMap;#un=null;static#gn=new Map;static#pn=new Map;static#fn=new WeakMap;static#mn=null;static#bn=new Set;constructor({textContentSource:e,container:i,viewport:n}){if(e instanceof ReadableStream)this.#dn=e;else{if("object"!=typeof e)throw new Error('No "textContentSource" parameter specified.');this.#dn=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#ft=this.#rn=i,this.#an=n.scale*Ae.pixelRatio,this.#sn=n.rotation,this.#tn={div:null,properties:null,ctx:null};const{pageWidth:r,pageHeight:s,pageX:a,pageY:o}=n.rawDims;this.#un=[1,0,0,-1,-a,o+s],this.#in=r,this.#en=s,t.#vn(),ye(i,n),this.#Ki.promise.finally(()=>{t.#bn.delete(this),this.#tn=null,this.#on=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=Yt.platform;return zt(this,"fontFamilyMap",new Map([["sans-serif",(t&&e?"Calibri, ":"")+"sans-serif"],["monospace",(t&&e?"Lucida Console, ":"")+"monospace"]]))}render(){const e=()=>{this.#nn.read().then(({value:t,done:i})=>{i?this.#Ki.resolve():(this.#Ji??=t.lang,Object.assign(this.#on,t.styles),this.#wn(t.items),e())},this.#Ki.reject)};return this.#nn=this.#dn.getReader(),t.#bn.add(this),e(),this.#Ki.promise}update({viewport:e,onBefore:i=null}){const n=e.scale*Ae.pixelRatio,r=e.rotation;if(r!==this.#sn&&(i?.(),this.#sn=r,ye(this.#rn,{rotation:r})),n!==this.#an){i?.(),this.#an=n;const e={div:null,properties:null,ctx:t.#xn(this.#Ji)};for(const t of this.#hn)e.properties=this.#cn.get(t),e.div=t,this.#yn(e)}}cancel(){const t=new Gt("TextLayer task cancelled.");this.#nn?.cancel(t).catch(()=>{}),this.#nn=null,this.#Ki.reject(t)}get textDivs(){return this.#hn}get textContentItemsStr(){return this.#ln}#wn(e){if(this.#Qi)return;this.#tn.ctx??=t.#xn(this.#Ji);const i=this.#hn,n=this.#ln;for(const t of e){if(i.length>1e5)return It("Ignoring additional textDivs for performance reasons."),void(this.#Qi=!0);if(void 0!==t.str)n.push(t.str),this.#An(t);else if("beginMarkedContentProps"===t.type||"beginMarkedContent"===t.type){const e=this.#ft;this.#ft=document.createElement("span"),this.#ft.classList.add("markedContent"),null!==t.id&&this.#ft.setAttribute("id",`${t.id}`),e.append(this.#ft)}else"endMarkedContent"===t.type&&(this.#ft=this.#ft.parentNode)}}#An(e){const i=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};this.#hn.push(i);const r=Qt.transform(this.#un,e.transform);let s=Math.atan2(r[1],r[0]);const a=this.#on[e.fontName];a.vertical&&(s+=Math.PI/2);let o=this.#Zi&&a.fontSubstitution||a.fontFamily;o=t.fontFamilyMap.get(o)||o;const l=Math.hypot(r[2],r[3]),d=l*t.#Cn(o,a,this.#Ji);let h,c;0===s?(h=r[4],c=r[5]-d):(h=r[4]+d*Math.sin(s),c=r[5]-d*Math.cos(s));const u="calc(var(--total-scale-factor) *",g=i.style;this.#ft===this.#rn?(g.left=`${(100*h/this.#in).toFixed(2)}%`,g.top=`${(100*c/this.#en).toFixed(2)}%`):(g.left=`${u}${h.toFixed(2)}px)`,g.top=`${u}${c.toFixed(2)}px)`),g.fontSize=`${u}${(t.#mn*l).toFixed(2)}px)`,g.fontFamily=o,n.fontSize=l,i.setAttribute("role","presentation"),i.textContent=e.str,i.dir=e.dir,this.#Zi&&(i.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),0!==s&&(n.angle=s*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),i=Math.abs(e.transform[3]);t!==i&&Math.max(t,i)/Math.min(t,i)>1.5&&(p=!0)}if(p&&(n.canvasWidth=a.vertical?e.height:e.width),this.#cn.set(i,n),this.#tn.div=i,this.#tn.properties=n,this.#yn(this.#tn),n.hasText&&this.#ft.append(i),n.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this.#ft.append(t)}}#yn(e){const{div:i,properties:n,ctx:r}=e,{style:s}=i;let a="";if(t.#mn>1&&(a=`scale(${1/t.#mn})`),0!==n.canvasWidth&&n.hasText){const{fontFamily:e}=s,{canvasWidth:o,fontSize:l}=n;t.#En(r,l*this.#an,e);const{width:d}=r.measureText(i.textContent);d>0&&(a=`scaleX(${o*this.#an/d}) ${a}`)}0!==n.angle&&(a=`rotate(${n.angle}deg) ${a}`),a.length>0&&(s.transform=a)}static cleanup(){if(!(this.#bn.size>0)){this.#gn.clear();for(const{canvas:t}of this.#pn.values())t.remove();this.#pn.clear()}}static#xn(t=null){let e=this.#pn.get(t||="");if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#pn.set(t,e),this.#fn.set(e,{size:0,family:""})}return e}static#En(t,e,i){const n=this.#fn.get(t);e===n.size&&i===n.family||(t.font=`${e}px ${i}`,n.size=e,n.family=i)}static#vn(){if(null!==this.#mn)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#mn=t.getBoundingClientRect().height,t.remove()}static#Cn(t,e,i){const n=this.#gn.get(t);if(n)return n;const r=this.#xn(i);r.canvas.width=r.canvas.height=30,this.#En(r,30,t);const s=r.measureText(""),a=s.fontBoundingBoxAscent,o=Math.abs(s.fontBoundingBoxDescent);r.canvas.width=r.canvas.height=0;let l=.8;return a?l=a/(a+o):(Yt.platform.isFirefox&&It("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?l=e.ascent:e.descent&&(l=1+e.descent)),this.#gn.set(t,l),l}};class Fn{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){if(!i)return;let n=null;const r=i.name;if("#text"===r)n=i.value;else{if(!Fn.shouldBuildText(r))return;i?.attributes?.textContent?n=i.attributes.textContent:i.value&&(n=i.value)}if(null!==n&&e.push({str:n}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}function In(t={}){"string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new Rn,{docId:i}=e,n=t.url?function(t){if(t instanceof URL)return t.href;if("string"==typeof t){if(K)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,r=t.data?function(t){if(K&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return Xt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,s=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof Bn?t.range:null,d=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536;let h=t.worker instanceof zn?t.worker:null;const c=t.verbosity,u="string"!=typeof t.docBaseUrl||de(t.docBaseUrl)?null:t.docBaseUrl,g=Ge(t.cMapUrl),p=!1!==t.cMapPacked,f=t.CMapReaderFactory||(K?Ai:ui),m=Ge(t.iccUrl),b=Ge(t.standardFontDataUrl),v=t.StandardFontDataFactory||(K?Ci:mi),w=Ge(t.wasmUrl),x=t.WasmFactory||(K?Ei:vi),y=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,C=!1!==t.isEvalSupported,E="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!K,S="boolean"==typeof t.isImageDecoderSupported?t.isImageDecoderSupported:!K&&(Yt.platform.isFirefox||!globalThis.chrome),k=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,_="boolean"==typeof t.disableFontFace?t.disableFontFace:K,T=!0===t.fontExtraProperties,L=!0===t.enableXfa,D=t.ownerDocument||globalThis.document,P=!0===t.disableRange,M=!0===t.disableStream,F=!0===t.disableAutoFetch,I=!0===t.pdfBug,R=t.CanvasFactory||(K?yi:hi),B=t.FilterFactory||(K?xi:pi),N=!0===t.enableHWA,O=!1!==t.useWasm,z=l?l.length:t.length??NaN,H="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!K&&!_,V="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:!!(f===ui&&v===mi&&x===vi&&g&&b&&w&&ge(g,document.baseURI)&&ge(b,document.baseURI)&&ge(w,document.baseURI));Pt(c);const j={canvasFactory:new R({ownerDocument:D,enableHWA:N}),filterFactory:new B({docId:i,ownerDocument:D}),cMapReaderFactory:V?null:new f({baseUrl:g,isCompressed:p}),standardFontDataFactory:V?null:new v({baseUrl:b}),wasmFactory:V?null:new x({baseUrl:w})};h||(h=zn.create({verbosity:c,port:nn.workerPort}),e._worker=h);const U={docId:i,apiVersion:"5.3.93",data:r,password:o,disableAutoFetch:F,rangeChunkSize:d,length:z,docBaseUrl:u,enableXfa:L,evaluatorOptions:{maxImageSize:A,disableFontFace:_,ignoreErrors:y,isEvalSupported:C,isOffscreenCanvasSupported:E,isImageDecoderSupported:S,canvasMaxAreaInBytes:k,fontExtraProperties:T,useSystemFonts:H,useWasm:O,useWorkerFetch:V,cMapUrl:g,iccUrl:m,standardFontDataUrl:b,wasmUrl:w}},W={ownerDocument:D,pdfBug:I,styleElement:null,loadingParams:{disableAutoFetch:F,enableXfa:L}};return h.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const t=h.messageHandler.sendWithPromise("GetDocRequest",U,r?[r.buffer]:null);let o;if(l)o=new ln(l,{disableRange:P,disableStream:M});else if(!r){if(!n)throw new Error("getDocument - no `url` parameter provided.");const t=ge(n)?wn:K?_n:Cn;o=new t({url:n,length:z,httpHeaders:s,withCredentials:a,rangeChunkSize:d,disableRange:P,disableStream:M})}return t.then(t=>{if(e.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const n=new li(i,t,h.port),r=new Hn(n,e,o,W,j);e._transport=r,n.send("Ready",null)})}).catch(e._capability.reject),e}class Rn{static#vi=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+Rn.#vi++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}let Bn=class{#Ki=Promise.withResolvers();#Sn=[];#kn=[];#_n=[];#Tn=[];constructor(t,e,i=!1,n=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n}addRangeListener(t){this.#Tn.push(t)}addProgressListener(t){this.#_n.push(t)}addProgressiveReadListener(t){this.#kn.push(t)}addProgressiveDoneListener(t){this.#Sn.push(t)}onDataRange(t,e){for(const i of this.#Tn)i(t,e)}onDataProgress(t,e){this.#Ki.promise.then(()=>{for(const i of this.#_n)i(t,e)})}onDataProgressiveRead(t){this.#Ki.promise.then(()=>{for(const e of this.#kn)e(t)})}onDataProgressiveDone(){this.#Ki.promise.then(()=>{for(const t of this.#Sn)t()})}transportReady(){this.#Ki.resolve()}requestDataRange(t,e){Rt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Nn{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return zt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class On{#Ln=!1;constructor(t,e,i,n=!1){this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new ue:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new Pn,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:r=!1}={}){return new oe({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return zt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:n=ot.ENABLE,transform:r=null,background:s=null,optionalContentConfigPromise:a=null,annotationCanvasMap:o=null,pageColors:l=null,printAnnotationStorage:d=null,isEditing:h=!1}){this._stats?.time("Overall");const c=this._transport.getRenderingIntent(i,n,d,h),{renderingIntent:u,cacheKey:g}=c;this.#Ln=!1,a||=this._transport.getOptionalContentConfig(u);let p=this._intentStates.get(g);p||(p=Object.create(null),this._intentStates.set(g,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const f=!!(u&et);p.displayReadyCapability||(p.displayReadyCapability=Promise.withResolvers(),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(c));const m=t=>{p.renderTasks.delete(b),f&&(this.#Ln=!0),this.#Dn(),t?(b.capability.reject(t),this._abortOperatorList({intentState:p,reason:t instanceof Error?t:new Error(t)})):b.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},b=new jn({callback:m,params:{canvasContext:t,viewport:e,transform:r,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:o,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!f,pdfBug:this._pdfBug,pageColors:l});(p.renderTasks||=new Set).add(b);const v=b.task;return Promise.all([p.displayReadyCapability.promise,a]).then(([t,e])=>{if(this.destroyed)m();else{if(this._stats?.time("Rendering"),!(e.renderingIntent&u))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");b.initializeGraphics({transparency:t,optionalContentConfig:e}),b.operatorListChanged()}}).catch(m),v}getOperatorList({intent:t="display",annotationMode:e=ot.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){const r=this._transport.getRenderingIntent(t,e,i,n,!0);let s,a=this._intentStates.get(r.cacheKey);return a||(a=Object.create(null),this._intentStates.set(r.cacheKey,a)),a.opListReadCapability||(s=Object.create(null),s.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(s))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(s),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(r)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>Fn.textContent(t));const e=this.streamTextContent(t);return new Promise(function(t,i){const n=e.getReader(),r={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then(function({value:i,done:n}){n?t(r):(r.lang??=i.lang,Object.assign(r.styles,i.styles),r.items.push(...i.items),e())},i)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#Ln=!1,Promise.all(t)}cleanup(t=!1){this.#Ln=!0;const e=this.#Dn();return t&&e&&(this._stats&&=new ue),e}#Dn(){if(!this.#Ln||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Ln=!1,!0}_startRenderPage(t,e){const i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&this.#Dn()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:n}){const{map:r,transfer:s}=i,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r,modifiedIds:n},s).getReader(),o=this._intentStates.get(e);o.streamReader=a;const l=()=>{a.read().then(({value:t,done:e})=>{e?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,o),l())},t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#Dn()}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}})};l()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof le){let i=100;return e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i))}}if(t.streamReader.cancel(new Gt(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}let zn=class t{#Ki=Promise.withResolvers();#Pn=null;#Ri=null;#Mn=null;static#Fn=0;static#In=!1;static#Rn=new WeakMap;static{K&&(this.#In=!0,nn.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!i?.origin||"null"===i.origin)return!1;const n=new URL(e,i);return i.origin===n.origin},this._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},this.fromPort=t=>{var e;if(e="`PDFWorker.fromPort` - please use `PDFWorker.create` instead.",console.log("Deprecated API usage: "+e),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(t)}}constructor({name:e=null,port:i=null,verbosity:n=Mt()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=n,i){if(t.#Rn.has(i))throw new Error("Cannot use more than one PDFWorker per port.");t.#Rn.set(i,this),this.#Bn(i)}else this.#Nn()}get promise(){return this.#Ki.promise}#On(){this.#Ki.resolve(),this.#Pn.send("configure",{verbosity:this.verbosity})}get port(){return this.#Ri}get messageHandler(){return this.#Pn}#Bn(t){this.#Ri=t,this.#Pn=new li("main","worker",t),this.#Pn.on("ready",()=>{}),this.#On()}#Nn(){if(t.#In||t.#zn)return void this.#Hn();let{workerSrc:e}=t;try{t._isSameOrigin(window.location,e)||(e=t._createCDNWrapper(new URL(e,window.location).href));const i=new Worker(e,{type:"module"}),n=new li("main","worker",i),r=()=>{s.abort(),n.destroy(),i.terminate(),this.destroyed?this.#Ki.reject(new Error("Worker was destroyed")):this.#Hn()},s=new AbortController;i.addEventListener("error",()=>{this.#Mn||r()},{signal:s.signal}),n.on("test",t=>{s.abort(),!this.destroyed&&t?(this.#Pn=n,this.#Ri=i,this.#Mn=i,this.#On()):r()}),n.on("ready",t=>{if(s.abort(),this.destroyed)r();else try{a()}catch{this.#Hn()}});const a=()=>{const t=new Uint8Array;n.send("test",t,[t.buffer])};return void a()}catch{Ft("The worker has been disabled.")}this.#Hn()}#Hn(){t.#In||(It("Setting up fake worker."),t.#In=!0),t._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this.#Ki.reject(new Error("Worker was destroyed"));const i=new Ye;this.#Ri=i;const n="fake"+t.#Fn++,r=new li(n+"_worker",n,i);e.setup(r,i),this.#Pn=new li(n,n+"_worker",i),this.#On()}).catch(t=>{this.#Ki.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this.#Mn?.terminate(),this.#Mn=null,t.#Rn.delete(this.#Ri),this.#Ri=null,this.#Pn?.destroy(),this.#Pn=null}static create(e){const i=this.#Rn.get(e?.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new t(e)}static get workerSrc(){if(nn.workerSrc)return nn.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#zn(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return zt(this,"_setupFakeWorkerGlobal",(async()=>this.#zn?this.#zn:(await e.import(this.workerSrc)).WorkerMessageHandler)())}};class Hn{#Vn=new Map;#jn=new Map;#Un=new Map;#Wn=new Map;#$n=null;constructor(t,e,i,n,r){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Pn,this.fontLoader=new We({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.wasmFactory=r.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Gn(t,e=null){const i=this.#Vn.get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return this.#Vn.set(t,n),n}get annotationStorage(){return zt(this,"annotationStorage",new je)}getRenderingIntent(t,e=ot.ENABLE,i=null,n=!1,r=!1){let s=tt,a=Ve;switch(t){case"any":s=J;break;case"display":break;case"print":s=et;break;default:It(`getRenderingIntent - invalid intent: ${t}`)}const o=s&et&&i instanceof Ue?i:this.annotationStorage;switch(e){case ot.DISABLE:s+=rt;break;case ot.ENABLE:break;case ot.ENABLE_FORMS:s+=it;break;case ot.ENABLE_STORAGE:s+=nt,a=o.serializable;break;default:It(`getRenderingIntent - invalid annotationMode: ${e}`)}n&&(s+=st),r&&(s+=at);const{ids:l,hash:d}=o.modifiedIds;return{renderingIntent:s,cacheKey:[s,a.hash,d].join("_"),annotationStorageSerializable:a,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#$n?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const i of this.#jn.values())t.push(i._destroy());this.#jn.clear(),this.#Un.clear(),this.#Wn.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Vn.clear(),this.filterFactory.destroy(),Mn.cleanup(),this._networkStream?.cancelAllRequests(new Gt("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{Bt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function({value:t,done:i}){i?e.close():(Bt(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",async t=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:n,contentLength:r}=this._fullReader;return i&&n||(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),{isStreamingSupported:i,isRangeSupported:n,contentLength:r}}),t.on("GetRangeReader",(t,e)=>{Bt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then(function({value:t,done:i}){i?e.close():(Bt(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}):e.close()}),t.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new Nn(t,this))}),t.on("DocException",t=>{e._capability.reject(oi(t))}),t.on("PasswordRequest",t=>{this.#$n=Promise.withResolvers();try{if(!e.onPassword)throw oi(t);const i=t=>{t instanceof Error?this.#$n.reject(t):this.#$n.resolve({password:t})};e.onPassword(i,t.code)}catch(i){this.#$n.reject(i)}return this.#$n.promise}),t.on("DataLoaded",t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||this.#jn.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([e,i,n])=>{if(this.destroyed)return null;if(this.commonObjs.has(e))return null;switch(i){case"Font":if("error"in n){const t=n.error;It(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}const r=this._params.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,s=new $e(n,r);this.fontLoader.bind(s).catch(()=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{!s.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(e,s)});break;case"CopyLocalImage":const{imageRef:a}=n;Bt(a,"The imageRef must be defined.");for(const t of this.#jn.values())for(const[,i]of t.objs)if(i?.ref===a)return i.dataLen?(this.commonObjs.resolve(e,structuredClone(i)),i.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,n);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([t,e,i,n])=>{if(this.destroyed)return;const r=this.#jn.get(e);if(!r.objs.has(t))if(0!==r._intentStates.size)switch(i){case"Image":case"Pattern":r.objs.resolve(t,n);break;default:throw new Error(`Got unknown object type ${i}`)}else n?.bitmap?.close()}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}),t.on("FetchBinaryData",async t=>{if(this.destroyed)throw new Error("Worker was destroyed.");const e=this[t.type];if(!e)throw new Error(`${t.type} not initialized, see the \`useWorkerFetch\` parameter.`);return e.fetch(t)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&It("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=this.#Un.get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&this.#Wn.set(i.refStr,t);const n=new On(e,i,this,this._params.pdfBug);return this.#jn.set(e,n),n});return this.#Un.set(e,n),n}getPageIndex(t){return qe(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#Gn("GetFieldObjects")}hasJSActions(){return this.#Gn("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#Gn("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#Gn("GetOptionalContentConfig").then(e=>new on(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#Vn.get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new rn(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#Vn.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#jn.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Vn.clear(),this.filterFactory.destroy(!0),Mn.cleanup()}}cachedPageNumber(t){if(!qe(t))return null;const e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#Wn.get(e)??null}}class Vn{#qn=null;onContinue=null;onError=null;constructor(t){this.#qn=t}get promise(){return this.#qn.capability.promise}cancel(t=0){this.#qn.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#qn.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#qn;return t.form||t.canvas&&e?.size>0}}class jn{#Xn=null;static#Yn=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:n,annotationCanvasMap:r,operatorList:s,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:d=!1,pdfBug:h=!1,pageColors:c=null}){this.callback=t,this.params=e,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=h,this.pageColors=c,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Vn(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=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(jn.#Yn.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.");jn.#Yn.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:n,transform:r,background:s}=this.params;this.gfx=new en(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:n,transparency:t,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#Xn&&(window.cancelAnimationFrame(this.#Xn),this.#Xn=null),jn.#Yn.delete(this._canvas),t||=new le(`Rendering cancelled, page ${this._pageIndex+1}`,e),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Xn=window.requestAnimationFrame(()=>{this.#Xn=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),jn.#Yn.delete(this._canvas),this.callback())))}}function Un(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Wn(t){return Math.max(0,Math.min(255,255*t))}class $n{static CMYK_G([t,e,i,n]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+n)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=Wn(t),t,t]}static G_HTML([t]){const e=Un(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(Wn)}static RGB_HTML(t){return`#${t.map(Un).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,n]){return["RGB",1-Math.min(1,t+n),1-Math.min(1,i+n),1-Math.min(1,e+n)]}static CMYK_rgb([t,e,i,n]){return[Wn(1-Math.min(1,t+n)),Wn(1-Math.min(1,i+n)),Wn(1-Math.min(1,e+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const n=1-t,r=1-e,s=1-i;return["CMYK",n,r,s,Math.min(n,r,s)]}}class Gn{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${t}px`),n.setAttribute("height",`${e}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${t} ${e}`),n}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Rt("Abstract method `_createSVG` called.")}}let qn=class extends Gn{_createSVG(t){return document.createElementNS(re,t)}},Xn=class{static setupStorage(t,e,i,n,r){const s=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==s.value&&(t.textContent=s.value),"print"===r)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(s.value===i.attributes.xfaOn?t.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===r)break;t.addEventListener("change",t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==s.value&&t.setAttribute("value",s.value),"print"===r)break;t.addEventListener("input",t=>{n.setValue(e,{value:t.target.value})})}break;case"select":if(null!==s.value){t.setAttribute("value",s.value);for(const t of i.children)t.attributes.value===s.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{const i=t.target.options,r=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:r})})}}static setAttributes({html:t,element:e,storage:i=null,intent:n,linkService:r}){const{attributes:s}=e,a=t instanceof HTMLAnchorElement;"radio"===s.type&&(s.name=`${s.name}-${n}`);for(const[o,l]of Object.entries(s))if(null!=l)switch(o){case"class":l.length&&t.setAttribute(o,l.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",l);break;case"style":Object.assign(t.style,l);break;case"textContent":t.textContent=l;break;default:(!a||"href"!==o&&"newWindow"!==o)&&t.setAttribute(o,l)}a&&r.addLinkAttributes(t,s.href,s.newWindow),i&&s.dataId&&this.setupStorage(t,s.dataId,e,i)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,r=t.intent||"display",s=document.createElement(n.name);n.attributes&&this.setAttributes({html:s,element:n,intent:r,linkService:i});const a="richText"!==r,o=t.div;if(o.append(s),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);s.append(t),a&&Fn.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const d=[[n,-1,s]];for(;d.length>0;){const[t,n,s]=d.at(-1);if(n+1===t.children.length){d.pop();continue}const o=t.children[++d.at(-1)[1]];if(null===o)continue;const{name:h}=o;if("#text"===h){const t=document.createTextNode(o.value);l.push(t),s.append(t);continue}const c=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,h):document.createElement(h);if(s.append(c),o.attributes&&this.setAttributes({html:c,element:o,storage:e,intent:r,linkService:i}),o.children?.length>0)d.push([o,-1,c]);else if(o.value){const t=document.createTextNode(o.value);a&&Fn.shouldBuildText(h)&&l.push(t),c.append(t)}}for(const h of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}};const Yn=new WeakSet;class Kn{static create(t){switch(t.data.annotationType){case vt.LINK:return new Zn(t);case vt.TEXT:return new Jn(t);case vt.WIDGET:switch(t.data.fieldType){case"Tx":return new er(t);case"Btn":return t.data.radioButton?new rr(t):t.data.checkBox?new nr(t):new sr(t);case"Ch":return new ar(t);case"Sig":return new ir(t)}return new tr(t);case vt.POPUP:return new or(t);case vt.FREETEXT:return new dr(t);case vt.LINE:return new hr(t);case vt.SQUARE:return new cr(t);case vt.CIRCLE:return new ur(t);case vt.POLYLINE:return new gr(t);case vt.CARET:return new fr(t);case vt.INK:return new mr(t);case vt.POLYGON:return new pr(t);case vt.HIGHLIGHT:return new br(t);case vt.UNDERLINE:return new vr(t);case vt.SQUIGGLY:return new wr(t);case vt.STRIKEOUT:return new xr(t);case vt.STAMP:return new yr(t);case vt.FILEATTACHMENT:return new Ar(t);default:return new Qn(t)}}}class Qn{#Kn=null;#Qn=!1;#Zn=null;constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!(!t?.str&&!e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Qn._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#Kn||={rect:this.data.rect.slice(0)};const{rect:e}=t;e&&this.#Jn(e),this.#Zn?.popup.updateEdited(t)}resetEdited(){this.#Kn&&(this.#Jn(this.#Kn.rect),this.#Zn?.popup.resetEdited(),this.#Kn=null)}#Jn(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:s,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t),e.left=100*(t[0]-a)/r+"%",e.top=100*(s-t[3]+o)/s+"%",0===n?(e.width=100*(t[2]-t[0])/r+"%",e.height=100*(t[3]-t[1])/s+"%"):this.setRotation(n)}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id),this instanceof tr||(r.tabIndex=0);const{style:s}=r;if(s.zIndex=this.parent.zIndex++,e.alternativeText&&(r.title=e.alternativeText),e.noRotate&&r.classList.add("norotate"),!e.rect||this instanceof or){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,r),r}const{width:a,height:o}=this;if(!t&&e.borderStyle.width>0){s.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--total-scale-factor)) / calc(${i}px * var(--total-scale-factor))`;s.borderRadius=e}else if(this instanceof rr){const t=`calc(${a}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`;s.borderRadius=t}switch(e.borderStyle.style){case wt:s.borderStyle="solid";break;case xt:s.borderStyle="dashed";break;case yt:It("Unimplemented border style: beveled");break;case At:It("Unimplemented border style: inset");break;case Ct:s.borderBottomStyle="solid"}const n=e.borderColor||null;n?(this.#Qn=!0,s.borderColor=Qt.makeHexColor(0|n[0],0|n[1],0|n[2])):s.borderWidth=0}const l=Qt.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:d,pageHeight:h,pageX:c,pageY:u}=n.rawDims;s.left=100*(l[0]-c)/d+"%",s.top=100*(l[1]-u)/h+"%";const{rotation:g}=e;return e.hasOwnCanvas||0===g?(s.width=100*a/d+"%",s.height=100*o/h+"%"):this.setRotation(g,r),r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims;let{width:r,height:s}=this;t%180!=0&&([r,s]=[s,r]),e.style.width=100*r/i+"%",e.style.height=100*s/n+"%",e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],r=n[0],s=n.slice(1);i.target.style[e]=$n[`${r}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[e]:$n[`${r}_rgb`](s)})};return zt(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const r=t[n]||i[n];r?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,r]of Object.entries(e)){const s=i[n];s&&(s({detail:{[n]:r},target:t}),delete e[n])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,r]=this.data.rect.map(t=>Math.fround(t));if(8===t.length){const[s,a,o,l]=t.subarray(2,6);if(n===s&&r===a&&e===o&&i===l)return}const{style:s}=this.container;let a;if(this.#Qn){const{borderColor:t,borderWidth:e}=s;s.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}const o=n-e,l=r-i,{svgFactory:d}=this,h=d.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const c=d.createElement("defs");h.append(c);const u=d.createElement("clipPath"),g=`clippath_${this.data.id}`;u.setAttribute("id",g),u.setAttribute("clipPathUnits","objectBoundingBox"),c.append(u);for(let p=2,f=t.length;p<f;p+=8){const i=t[p],n=t[p+1],s=t[p+2],h=t[p+3],c=d.createElement("rect"),g=(s-e)/o,f=(r-n)/l,m=(i-s)/o,b=(n-h)/l;c.setAttribute("x",g),c.setAttribute("y",f),c.setAttribute("width",m),c.setAttribute("height",b),u.append(c),a?.push(`<rect vector-effect="non-scaling-stroke" x="${g}" y="${f}" width="${m}" height="${b}"/>`)}this.#Qn&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath=`url(#${g})`}_createPopup(){const{data:t}=this,e=this.#Zn=new or({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},parent:this.parent,elements:[this]});this.parent.div.append(e.render())}render(){Rt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:r,exportValues:s}of n){if(-1===t)continue;if(r===e)continue;const n="string"==typeof s?s:null,a=document.querySelector(`[data-element-id="${r}"]`);!a||Yn.has(a)?i.push({id:r,exportValue:n,domElement:a}):It(`_getElementsByName - element not allowed: ${r}`)}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,r=n.getAttribute("data-element-id");r!==e&&Yn.has(n)&&i.push({id:r,exportValue:t,domElement:n})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class Zn extends Qn{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(this.#tr(i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(this.#er(i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}#ir(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#ir()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#ir()}#tr(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#ir()}#er(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#ir()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const r=i.get(n);r&&(t[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1))}t.onclick||(t.onclick=()=>!1),this.#ir()}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#ir(),!this._fieldObjects)return It('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{i?.();const{fields:t,refs:n,include:r}=e,s=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===r&&s.push(i)}else for(const e of Object.values(this._fieldObjects))s.push(...e);const a=this.annotationStorage,o=[];for(const e of s){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;a.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";a.setValue(t,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${t}"]`);i&&(Yn.has(i)?i.dispatchEvent(new Event("resetform")):It(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class Jn extends Qn{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class tr extends Qn{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Yt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,r){i.includes("mouse")?t.addEventListener(i,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(t)}})})}_setEventListeners(t,e,i,n){for(const[r,s]of i)("Action"===s||this.data.actions?.[s])&&("Focus"!==s&&"Blur"!==s||(e||={focused:!1}),this._setEventListener(t,e,r,s,n),"Focus"!==s||this.data.actions?.Blur?"Blur"!==s||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":Qt.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,r=t.style;let s;const a=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(Z*n))||1);s=Math.min(n,a(e/Z))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);s=Math.min(n,a(t/Z))}r.fontSize=`calc(${s}px * var(--total-scale-factor))`,r.color=Qt.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class er extends tr{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const r=this.annotationStorage;for(const s of this._getElementsByName(t.name,t.id))s.domElement&&(s.domElement[e]=i),r.setValue(s.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const n=t.getValue(e,{value:this.data.fieldValue});let r=n.value||"";const s=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;s&&r.length>s&&(r=r.slice(0,s));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:r,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=a??r,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type=this.data.password?"password":"text",i.setAttribute("value",a??r),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Yn.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=0;const l=this.data.dateFormat||this.data.timeFormat;l&&(i.title=l),this._setRequired(i,this.data.required),s&&(i.maxLength=s),i.addEventListener("input",n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),o.formattedValue=null}),i.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e,o.formattedValue=null});let d=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{if(o.focused)return;const{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);const n={value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){const{formattedValue:n}=i.detail;o.formattedValue=n,null!=n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{const{charLimit:n}=i.detail,{target:r}=i;if(0===n)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",n);let s=o.userValue;!s||s.length<=n||(s=s.slice(0,n),r.value=o.userValue=s,t.setValue(e,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)}),i.addEventListener("keydown",t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;const{value:n}=t.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const n=d;d=null,i.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),n(t)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;const{data:i,target:n}=t,{value:r,selectionStart:s,selectionEnd:a}=n;let l=s,d=a;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,s).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(s).match(/^[^\w]*\w*/);t&&(d+=t[0].length);break}case"deleteContentBackward":s===a&&(l-=1);break;case"deleteContentForward":s===a&&(d+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:i||"",willCommit:!1,selStart:l,selEnd:d}})}),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(d&&i.addEventListener("blur",d),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/s;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--total-scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class ir extends tr{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class nr extends tr{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return Yn.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=e.fieldName,n&&r.setAttribute("checked",!0),r.setAttribute("exportValue",e.exportValue),r.tabIndex=0,r.addEventListener("change",n=>{const{name:r,checked:s}=n.target;for(const a of this._getElementsByName(r,i)){const i=s&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=i),t.setValue(a.id,{value:i})}t.setValue(i,{value:s})}),r.addEventListener("resetform",t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class rr extends tr{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const s of this._getElementsByName(e.fieldName,i))t.setValue(s.id,{value:!1});const r=document.createElement("input");if(Yn.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=e.fieldName,n&&r.setAttribute("checked",!0),r.tabIndex=0,r.addEventListener("change",e=>{const{name:n,checked:r}=e.target;for(const s of this._getElementsByName(n,i))t.setValue(s.id,{value:!1});t.setValue(i,{value:r})}),r.addEventListener("resetform",t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;r.addEventListener("updatefromsandbox",e=>{const r={value:e=>{const r=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=r&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(r,e)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class sr extends Zn{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class ar extends tr{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Yn.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",t=>{const e=this.data.defaultFieldValue;for(const i of n.options)i.selected=i.value===e});for(const d of this.data.options){const t=document.createElement("option");t.textContent=d.displayValue,t.value=d.exportValue,i.value.includes(d.exportValue)&&(t.setAttribute("selected",!0),r=!1),n.append(t)}let s=null;if(r){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),s=()=>{t.remove(),n.removeEventListener("input",s),s=null},n.addEventListener("input",s)}const a=t=>{const e=t?"value":"textContent",{options:i,multiple:r}=n;return r?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=a(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",i=>{const r={value(i){s?.();const r=i.detail.value,l=new Set(Array.isArray(r)?r:[r]);for(const t of n.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){n.multiple=!0},remove(i){const r=n.options,s=i.detail.remove;r[s].selected=!1,n.remove(s),r.length>0&&-1===Array.prototype.findIndex.call(r,t=>t.selected)&&(r[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){const{index:r,displayValue:s,exportValue:d}=i.detail.insert,h=n.children[r],c=document.createElement("option");c.textContent=s,c.value=d,h?h.before(c):n.append(c),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){const{items:r}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of r){const{displayValue:e,exportValue:i}=t,r=document.createElement("option");r.textContent=e,r.value=i,n.append(r)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(r,i)}),n.addEventListener("input",i=>{const n=a(!0),r=a(!1);t.setValue(e,{value:n}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:r,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):n.addEventListener("input",function(i){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class or extends Qn{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Qn._hasPopupData(e)}),this.elements=i,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=new lr({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),i=[];for(const n of this.elements)n.popup=e,n.container.ariaHasPopup="dialog",i.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(t=>`${ee}${t}`).join(",")),this.container}}class lr{#nr=this.#rr.bind(this);#sr=this.#ar.bind(this);#or=this.#lr.bind(this);#dr=this.#hr.bind(this);#cr=null;#ft=null;#ur=null;#gr=null;#pr=null;#fr=null;#mr=null;#br=!1;#vr=null;#k=null;#wr=null;#xr=null;#yr=null;#Kn=null;#Ar=!1;constructor({container:t,color:e,elements:i,titleObj:n,modificationDate:r,contentsObj:s,richText:a,parent:o,rect:l,parentRect:d,open:h}){this.#ft=t,this.#yr=n,this.#ur=s,this.#xr=a,this.#fr=o,this.#cr=e,this.#wr=l,this.#mr=d,this.#pr=i,this.#gr=me.toDateObject(r),this.trigger=i.flatMap(t=>t.getElementsToTriggerPopup());for(const c of this.trigger)c.addEventListener("click",this.#dr),c.addEventListener("mouseenter",this.#or),c.addEventListener("mouseleave",this.#sr),c.classList.add("popupTriggerArea");for(const c of i)c.container?.addEventListener("keydown",this.#nr);this.#ft.hidden=!0,h&&this.#hr()}render(){if(this.#vr)return;const t=this.#vr=document.createElement("div");if(t.className="popup",this.#cr){const e=t.style.outlineColor=Qt.makeHexColor(...this.#cr);t.style.backgroundColor=`color-mix(in srgb, ${e} 30%, white)`}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=this.#yr),t.append(e),this.#gr){const t=document.createElement("time");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),t.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#gr.valueOf()})),t.dateTime=this.#gr.toISOString(),e.append(t)}const n=this.#Cr;if(n)Xn.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(this.#ur);t.append(e)}this.#ft.append(t)}get#Cr(){const t=this.#xr,e=this.#ur;return!t?.str||e?.str&&e.str!==t.str?null:this.#xr.html||null}get#Er(){return this.#Cr?.attributes?.style?.fontSize||0}get#Sr(){return this.#Cr?.attributes?.style?.color||null}#kr(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:this.#Sr,fontSize:this.#Er?`calc(${this.#Er}px * var(--total-scale-factor))`:""}};for(const r of t.split("\n"))e.push({name:"span",value:r,attributes:n});return i}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const n=t.split(/(?:\r\n?|\n)/);for(let r=0,s=n.length;r<s;++r){const t=n[r];i.append(document.createTextNode(t)),r<s-1&&i.append(document.createElement("br"))}return i}#rr(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#br)&&this.#hr()}updateEdited({rect:t,popupContent:e}){this.#Kn||={contentsObj:this.#ur,richText:this.#xr},t&&(this.#k=null),e&&(this.#xr=this.#kr(e),this.#ur=null),this.#vr?.remove(),this.#vr=null}resetEdited(){this.#Kn&&(({contentsObj:this.#ur,richText:this.#xr}=this.#Kn),this.#Kn=null,this.#vr?.remove(),this.#vr=null,this.#k=null)}#_r(){if(null!==this.#k)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:r}}}=this.#fr;let s=!!this.#mr,a=s?this.#mr:this.#wr;for(const u of this.#pr)if(!a||null!==Qt.intersect(u.data.rect,a)){a=u.data.rect,s=!0;break}const o=Qt.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),l=s?a[2]-a[0]+5:0,d=o[0]+l,h=o[1];this.#k=[100*(d-n)/e,100*(h-r)/i];const{style:c}=this.#ft;c.left=`${this.#k[0]}%`,c.top=`${this.#k[1]}%`}#hr(){this.#br=!this.#br,this.#br?(this.#lr(),this.#ft.addEventListener("click",this.#dr),this.#ft.addEventListener("keydown",this.#nr)):(this.#ar(),this.#ft.removeEventListener("click",this.#dr),this.#ft.removeEventListener("keydown",this.#nr))}#lr(){this.#vr||this.render(),this.isVisible?this.#br&&this.#ft.classList.add("focused"):(this.#_r(),this.#ft.hidden=!1,this.#ft.style.zIndex=parseInt(this.#ft.style.zIndex)+1e3)}#ar(){this.#ft.classList.remove("focused"),!this.#br&&this.isVisible&&(this.#ft.hidden=!0,this.#ft.style.zIndex=parseInt(this.#ft.style.zIndex)-1e3)}forceHide(){this.#Ar=this.isVisible,this.#Ar&&(this.#ft.hidden=!0)}maybeShow(){this.#Ar&&(this.#vr||this.#lr(),this.#Ar=!1,this.#ft.hidden=!1)}get isVisible(){return!1===this.#ft.hidden}}class dr extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=dt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class hr extends Qn{#Tr=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),r=this.#Tr=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),r.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),r.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),r.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Tr}addHighlightArea(){this.container.classList.add("highlightArea")}}class cr extends Qn{#Lr=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,s=this.#Lr=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",r/2),s.setAttribute("y",r/2),s.setAttribute("width",e-r),s.setAttribute("height",i-r),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Lr}addHighlightArea(){this.container.classList.add("highlightArea")}}class ur extends Qn{#Dr=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:t,width:e,height:i}=this,n=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,s=this.#Dr=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",e/2),s.setAttribute("cy",i/2),s.setAttribute("rx",e/2-r/2),s.setAttribute("ry",i/2-r/2),s.setAttribute("stroke-width",r||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Dr}addHighlightArea(){this.container.classList.add("highlightArea")}}class gr extends Qn{#Pr=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n},width:r,height:s}=this;if(!e)return this.container;const a=this.svgFactory.create(r,s,!0);let o=[];for(let d=0,h=e.length;d<h;d+=2){const i=e[d]-t[0],n=t[3]-e[d+1];o.push(`${i},${n}`)}o=o.join(" ");const l=this.#Pr=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),a.append(l),this.container.append(a),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Pr}addHighlightArea(){this.container.classList.add("highlightArea")}}class pr extends gr{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class fr extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class mr extends Qn{#Mr=null;#Fr=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?dt.HIGHLIGHT:dt.INK}#Ir(t,e){switch(t){case 90:return{transform:`rotate(90) translate(${-e[0]},${e[1]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};case 180:return{transform:`rotate(180) translate(${-e[2]},${e[1]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]};case 270:return{transform:`rotate(270) translate(${-e[2]},${e[3]}) scale(1,-1)`,width:e[3]-e[1],height:e[2]-e[0]};default:return{transform:`translate(${-e[0]},${e[3]}) scale(1,-1)`,width:e[2]-e[0],height:e[3]-e[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,rotation:e,inkLists:i,borderStyle:n,popupRef:r}}=this,{transform:s,width:a,height:o}=this.#Ir(e,t),l=this.svgFactory.create(a,o,!0),d=this.#Mr=this.svgFactory.createElement("svg:g");l.append(d),d.setAttribute("stroke-width",n.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",s);for(let h=0,c=i.length;h<c;h++){const t=this.svgFactory.createElement(this.svgElementName);this.#Fr.push(t),t.setAttribute("points",i[h].join(",")),d.append(t)}return!r&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);const{thickness:e,points:i,rect:n}=t,r=this.#Mr;if(e>=0&&r.setAttribute("stroke-width",e||1),i)for(let s=0,a=this.#Fr.length;s<a;s++)this.#Fr[s].setAttribute("points",i[s].join(","));if(n){const{transform:t,width:e,height:i}=this.#Ir(this.data.rotation,n);r.parentElement.setAttribute("viewBox",`0 0 ${e} ${i}`),r.setAttribute("transform",t)}}getElementsToTriggerPopup(){return this.#Fr}addHighlightArea(){this.container.classList.add("highlightArea")}}class br extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=dt.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const e=document.createElement("mark");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class vr extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class wr extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const e=document.createElement("u");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class xr extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:e}}=this;if(!e&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const e=document.createElement("s");e.classList.add("overlaidText"),e.textContent=t,this.container.append(e)}return this.container}}class yr extends Qn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=dt.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Ar extends Qn{#Rr=null;constructor(t){super(t,{isRenderable:!0});const{file:e}=this.data;this.filename=e.filename,this.content=e.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...e})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),i.addEventListener("dblclick",this.#Br.bind(this)),this.#Rr=i;const{isMac:n}=Yt.platform;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#Br()}),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return this.#Rr}addHighlightArea(){this.container.classList.add("highlightArea")}#Br(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}const Cr=/\r\n?|\n/g;class Er extends Re{#cr;#Nr="";#Or=`${this.id}-editor`;#zr=null;#Er;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const t=Er.prototype,e=t=>t.isEmpty(),i=Me.TRANSLATE_SMALL,n=Me.TRANSLATE_BIG;return zt(this,"_keyboardManager",new De([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}static _type="freetext";static _editorType=dt.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#cr=t.color||Er._defaultColor||Re._defaultLineColor,this.#Er=t.fontSize||Er._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static initialize(t,e){Re.initialize(t,e);const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case ht.FREETEXT_SIZE:Er._defaultFontSize=e;break;case ht.FREETEXT_COLOR:Er._defaultColor=e}}updateParams(t,e){switch(t){case ht.FREETEXT_SIZE:this.#Hr(e);break;case ht.FREETEXT_COLOR:this.#Vr(e)}}static get defaultPropertiesToUpdate(){return[[ht.FREETEXT_SIZE,Er._defaultFontSize],[ht.FREETEXT_COLOR,Er._defaultColor||Re._defaultLineColor]]}get propertiesToUpdate(){return[[ht.FREETEXT_SIZE,this.#Er],[ht.FREETEXT_COLOR,this.#cr]]}#Hr(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--total-scale-factor))`,this.translate(0,-(t-this.#Er)*this.parentScale),this.#Er=t,this.#jr()},i=this.#Er;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Vr(t){const e=t=>{this.#cr=this.editorDiv.style.color=t},i=this.#cr;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-Er._internalPadding*t,-(Er._internalPadding+this.#Er)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#zr=new AbortController;const t=this._uiManager.combinedSignal(this.#zr);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Or),this._isDraggable=!0,this.#zr?.abort(),this.#zr=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#Ur(){const t=[];this.editorDiv.normalize();let e=null;for(const i of this.editorDiv.childNodes)e?.nodeType===Node.TEXT_NODE&&"BR"===i.nodeName||(t.push(Er.#Wr(i)),e=i);return t.join("\n")}#jr(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,r=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",r)}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=this.#Nr,e=this.#Nr=this.#Ur().trimEnd();if(t===e)return;const i=t=>{this.#Nr=t,t?(this.#$r(),this._uiManager.rebuild(this),this.#jr()):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#jr()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){Er._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,e;(this._isCopy||this.annotationElementId)&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Or),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#Er}px * var(--total-scale-factor))`,i.color=this.#cr,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[s,a]=this.getInitialTranslation();[s,a]=this.pageTranslationToScreen(s,a);const[o,l]=this.pageDimensions,[d,h]=this.pageTranslation;let c,u;switch(this.rotation){case 0:c=t+(r[0]-d)/o,u=e+this.height-(r[1]-h)/l;break;case 90:c=t+(r[0]-d)/o,u=e-(r[1]-h)/l,[s,a]=[a,-s];break;case 180:c=t-this.width+(r[0]-d)/o,u=e-(r[1]-h)/l,[s,a]=[-s,-a];break;case 270:c=t+(r[0]-d-this.height*l)/o,u=e+(r[1]-h-this.width*o)/l,[s,a]=[-a,s]}this.setAt(c*i,u*n,s,a)}else this._moveAfterPaste(t,e);this.#$r(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#Wr(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(Cr,"")}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=Er.#Gr(e.getData("text")||"").replaceAll(Cr,"\n");if(!n)return;const r=window.getSelection();if(!r.rangeCount)return;this.editorDiv.normalize(),r.deleteFromDocument();const s=r.getRangeAt(0);if(!n.includes("\n"))return s.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void r.collapseToStart();const{startContainer:a,startOffset:o}=s,l=[],d=[];if(a.nodeType===Node.TEXT_NODE){const t=a.parentElement;if(d.push(a.nodeValue.slice(o).replaceAll(Cr,"")),t!==this.editorDiv){let e=l;for(const i of this.editorDiv.childNodes)i!==t?e.push(Er.#Wr(i)):e=d}l.push(a.nodeValue.slice(0,o).replaceAll(Cr,""))}else if(a===this.editorDiv){let t=l,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=d),t.push(Er.#Wr(i))}this.#Nr=`${l.join("\n")}${n}${d.join("\n")}`,this.#$r();const h=new Range;let c=Math.sumPrecise(l.map(t=>t.length));for(const{firstChild:u}of this.editorDiv.childNodes)if(u.nodeType===Node.TEXT_NODE){const t=u.nodeValue.length;if(c<=t){h.setStart(u,c),h.setEnd(u,c);break}c-=t}r.removeAllRanges(),r.addRange(h)}#$r(){if(this.editorDiv.replaceChildren(),this.#Nr)for(const t of this.#Nr.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#qr(){return this.#Nr.replaceAll(" "," ")}static#Gr(t){return t.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(t,e,i){let n=null;if(t instanceof dr){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:r,rotation:s,id:a,popupRef:o},textContent:l,textPosition:d,parent:{page:{pageNumber:h}}}=t;if(!l||0===l.length)return null;n=t={annotationType:dt.FREETEXT,color:Array.from(i),fontSize:e,value:l.join("\n"),position:d,pageIndex:h-1,rect:r.slice(0),rotation:s,annotationElementId:a,id:a,deleted:!1,popupRef:o}}const r=await super.deserialize(t,e,i);return r.#Er=t.fontSize,r.#cr=Qt.makeHexColor(...t.color),r.#Nr=Er.#Gr(t.value),r._initialData=n,r}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const e=Er._internalPadding*this.parentScale,i=this.getRect(e,e),n=Re._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#cr),r={annotationType:dt.FREETEXT,color:n,fontSize:this.#Er,value:this.#qr(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(r.isCopy=!0,r):this.annotationElementId&&!this.#Xr(r)?null:(r.id=this.annotationElementId,r)}#Xr(t){const{value:e,fontSize:i,color:n,pageIndex:r}=this._initialData;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==n[e])||t.pageIndex!==r}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize=`calc(${this.#Er}px * var(--total-scale-factor))`,i.color=this.#cr,e.replaceChildren();for(const r of this.#Nr.split("\n")){const t=document.createElement("div");t.append(r?document.createTextNode(r):document.createElement("br")),e.append(t)}const n=Er._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:this.#Nr}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}class Sr{static PRECISION=1e-4;toSVGPath(){Rt("Abstract method `toSVGPath` must be implemented.")}get box(){Rt("Abstract getter `box` must be implemented.")}serialize(t,e){Rt("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,n,r,s){s||=new Float32Array(t.length);for(let a=0,o=t.length;a<o;a+=2)s[a]=e+t[a]*n,s[a+1]=i+t[a+1]*r;return s}static _rescaleAndSwap(t,e,i,n,r,s){s||=new Float32Array(t.length);for(let a=0,o=t.length;a<o;a+=2)s[a]=e+t[a+1]*n,s[a+1]=i+t[a]*r;return s}static _translate(t,e,i,n){n||=new Float32Array(t.length);for(let r=0,s=t.length;r<s;r+=2)n[r]=e+t[r],n[r+1]=i+t[r+1];return n}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,e,i,n,r){switch(r){case 90:return[1-e/i,t/n];case 180:return[1-t/i,1-e/n];case 270:return[e/i,1-t/n];default:return[t/i,e/n]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,n,r,s){return[(t+5*i)/6,(e+5*n)/6,(5*i+r)/6,(5*n+s)/6,(i+r)/2,(n+s)/2]}}class kr{#Yr;#Kr=[];#Qr;#Zr;#Jr=[];#ts=new Float32Array(18);#es;#is;#ns;#rs;#ss;#as;#os=[];static#ls=8;static#ds=2;static#hs=kr.#ls+kr.#ds;constructor({x:t,y:e},i,n,r,s,a=0){this.#Yr=i,this.#as=r*n,this.#Zr=s,this.#ts.set([NaN,NaN,NaN,NaN,t,e],6),this.#Qr=a,this.#rs=kr.#ls*n,this.#ns=kr.#hs*n,this.#ss=n,this.#os.push(t,e)}isEmpty(){return isNaN(this.#ts[8])}#cs(){const t=this.#ts.subarray(4,6),e=this.#ts.subarray(16,18),[i,n,r,s]=this.#Yr;return[(this.#es+(t[0]-e[0])/2-i)/r,(this.#is+(t[1]-e[1])/2-n)/s,(this.#es+(e[0]-t[0])/2-i)/r,(this.#is+(e[1]-t[1])/2-n)/s]}add({x:t,y:e}){this.#es=t,this.#is=e;const[i,n,r,s]=this.#Yr;let[a,o,l,d]=this.#ts.subarray(8,12);const h=t-l,c=e-d,u=Math.hypot(h,c);if(u<this.#ns)return!1;const g=u-this.#rs,p=g/u,f=p*h,m=p*c;let b=a,v=o;a=l,o=d,l+=f,d+=m,this.#os?.push(t,e);const w=f/g,x=-m/g*this.#as,y=w*this.#as;return this.#ts.set(this.#ts.subarray(2,8),0),this.#ts.set([l+x,d+y],4),this.#ts.set(this.#ts.subarray(14,18),12),this.#ts.set([l-x,d-y],16),isNaN(this.#ts[6])?(0===this.#Jr.length&&(this.#ts.set([a+x,o+y],2),this.#Jr.push(NaN,NaN,NaN,NaN,(a+x-i)/r,(o+y-n)/s),this.#ts.set([a-x,o-y],14),this.#Kr.push(NaN,NaN,NaN,NaN,(a-x-i)/r,(o-y-n)/s)),this.#ts.set([b,v,a,o,l,d],6),!this.isEmpty()):(this.#ts.set([b,v,a,o,l,d],6),Math.abs(Math.atan2(v-o,b-a)-Math.atan2(m,f))<Math.PI/2?([a,o,l,d]=this.#ts.subarray(2,6),this.#Jr.push(NaN,NaN,NaN,NaN,((a+l)/2-i)/r,((o+d)/2-n)/s),[a,o,b,v]=this.#ts.subarray(14,18),this.#Kr.push(NaN,NaN,NaN,NaN,((b+a)/2-i)/r,((v+o)/2-n)/s),!0):([b,v,a,o,l,d]=this.#ts.subarray(0,6),this.#Jr.push(((b+5*a)/6-i)/r,((v+5*o)/6-n)/s,((5*a+l)/6-i)/r,((5*o+d)/6-n)/s,((a+l)/2-i)/r,((o+d)/2-n)/s),[l,d,a,o,b,v]=this.#ts.subarray(12,18),this.#Kr.push(((b+5*a)/6-i)/r,((v+5*o)/6-n)/s,((5*a+l)/6-i)/r,((5*o+d)/6-n)/s,((a+l)/2-i)/r,((o+d)/2-n)/s),!0))}toSVGPath(){if(this.isEmpty())return"";const t=this.#Jr,e=this.#Kr;if(isNaN(this.#ts[6])&&!this.isEmpty())return this.#us();const i=[];i.push(`M${t[4]} ${t[5]}`);for(let n=6;n<t.length;n+=6)isNaN(t[n])?i.push(`L${t[n+4]} ${t[n+5]}`):i.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);this.#gs(i);for(let n=e.length-6;n>=6;n-=6)isNaN(e[n])?i.push(`L${e[n+4]} ${e[n+5]}`):i.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);return this.#ps(i),i.join(" ")}#us(){const[t,e,i,n]=this.#Yr,[r,s,a,o]=this.#cs();return`M${(this.#ts[2]-t)/i} ${(this.#ts[3]-e)/n} L${(this.#ts[4]-t)/i} ${(this.#ts[5]-e)/n} L${r} ${s} L${a} ${o} L${(this.#ts[16]-t)/i} ${(this.#ts[17]-e)/n} L${(this.#ts[14]-t)/i} ${(this.#ts[15]-e)/n} Z`}#ps(t){const e=this.#Kr;t.push(`L${e[4]} ${e[5]} Z`)}#gs(t){const[e,i,n,r]=this.#Yr,s=this.#ts.subarray(4,6),a=this.#ts.subarray(16,18),[o,l,d,h]=this.#cs();t.push(`L${(s[0]-e)/n} ${(s[1]-i)/r} L${o} ${l} L${d} ${h} L${(a[0]-e)/n} ${(a[1]-i)/r}`)}newFreeDrawOutline(t,e,i,n,r,s){return new _r(t,e,i,n,r,s)}getOutlines(){const t=this.#Jr,e=this.#Kr,i=this.#ts,[n,r,s,a]=this.#Yr,o=new Float32Array((this.#os?.length??0)+2);for(let h=0,c=o.length-2;h<c;h+=2)o[h]=(this.#os[h]-n)/s,o[h+1]=(this.#os[h+1]-r)/a;if(o[o.length-2]=(this.#es-n)/s,o[o.length-1]=(this.#is-r)/a,isNaN(i[6])&&!this.isEmpty())return this.#fs(o);const l=new Float32Array(this.#Jr.length+24+this.#Kr.length);let d=t.length;for(let h=0;h<d;h+=2)isNaN(t[h])?l[h]=l[h+1]=NaN:(l[h]=t[h],l[h+1]=t[h+1]);d=this.#ms(l,d);for(let h=e.length-6;h>=6;h-=6)for(let t=0;t<6;t+=2)isNaN(e[h+t])?(l[d]=l[d+1]=NaN,d+=2):(l[d]=e[h+t],l[d+1]=e[h+t+1],d+=2);return this.#bs(l,d),this.newFreeDrawOutline(l,o,this.#Yr,this.#ss,this.#Qr,this.#Zr)}#fs(t){const e=this.#ts,[i,n,r,s]=this.#Yr,[a,o,l,d]=this.#cs(),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-i)/r,(e[3]-n)/s,NaN,NaN,NaN,NaN,(e[4]-i)/r,(e[5]-n)/s,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,l,d,NaN,NaN,NaN,NaN,(e[16]-i)/r,(e[17]-n)/s,NaN,NaN,NaN,NaN,(e[14]-i)/r,(e[15]-n)/s],0),this.newFreeDrawOutline(h,t,this.#Yr,this.#ss,this.#Qr,this.#Zr)}#bs(t,e){const i=this.#Kr;return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+6}#ms(t,e){const i=this.#ts.subarray(4,6),n=this.#ts.subarray(16,18),[r,s,a,o]=this.#Yr,[l,d,h,c]=this.#cs();return t.set([NaN,NaN,NaN,NaN,(i[0]-r)/a,(i[1]-s)/o,NaN,NaN,NaN,NaN,l,d,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,(n[0]-r)/a,(n[1]-s)/o],e),e+24}}class _r extends Sr{#Yr;#vs=new Float32Array(4);#Qr;#Zr;#os;#ss;#ws;constructor(t,e,i,n,r,s){super(),this.#ws=t,this.#os=e,this.#Yr=i,this.#ss=n,this.#Qr=r,this.#Zr=s,this.lastPoint=[NaN,NaN],this.#xs(s);const[a,o,l,d]=this.#vs;for(let h=0,c=t.length;h<c;h+=2)t[h]=(t[h]-a)/l,t[h+1]=(t[h+1]-o)/d;for(let h=0,c=e.length;h<c;h+=2)e[h]=(e[h]-a)/l,e[h+1]=(e[h+1]-o)/d}toSVGPath(){const t=[`M${this.#ws[4]} ${this.#ws[5]}`];for(let e=6,i=this.#ws.length;e<i;e+=6)isNaN(this.#ws[e])?t.push(`L${this.#ws[e+4]} ${this.#ws[e+5]}`):t.push(`C${this.#ws[e]} ${this.#ws[e+1]} ${this.#ws[e+2]} ${this.#ws[e+3]} ${this.#ws[e+4]} ${this.#ws[e+5]}`);return t.push("Z"),t.join(" ")}serialize([t,e,i,n],r){const s=i-t,a=n-e;let o,l;switch(r){case 0:o=Sr._rescale(this.#ws,t,n,s,-a),l=Sr._rescale(this.#os,t,n,s,-a);break;case 90:o=Sr._rescaleAndSwap(this.#ws,t,e,s,a),l=Sr._rescaleAndSwap(this.#os,t,e,s,a);break;case 180:o=Sr._rescale(this.#ws,i,e,-s,a),l=Sr._rescale(this.#os,i,e,-s,a);break;case 270:o=Sr._rescaleAndSwap(this.#ws,i,n,-s,-a),l=Sr._rescaleAndSwap(this.#os,i,n,-s,-a)}return{outline:Array.from(o),points:[Array.from(l)]}}#xs(t){const e=this.#ws;let i=e[4],n=e[5];const r=[i,n,i,n];let s=i,a=n;const o=t?Math.max:Math.min;for(let d=6,h=e.length;d<h;d+=6){const t=e[d+4],l=e[d+5];if(isNaN(e[d]))Qt.pointBoundingBox(t,l,r),a<l?(s=t,a=l):a===l&&(s=o(s,t));else{const t=[1/0,1/0,-1/0,-1/0];Qt.bezierBoundingBox(i,n,...e.slice(d,d+6),t),Qt.rectBoundingBox(...t,r),a<t[3]?(s=t[2],a=t[3]):a===t[3]&&(s=o(s,t[2]))}i=t,n=l}const l=this.#vs;l[0]=r[0]-this.#Qr,l[1]=r[1]-this.#Qr,l[2]=r[2]-r[0]+2*this.#Qr,l[3]=r[3]-r[1]+2*this.#Qr,this.lastPoint=[s,a]}get box(){return this.#vs}newOutliner(t,e,i,n,r,s=0){return new kr(t,e,i,n,r,s)}getNewOutline(t,e){const[i,n,r,s]=this.#vs,[a,o,l,d]=this.#Yr,h=r*l,c=s*d,u=i*l+a,g=n*d+o,p=this.newOutliner({x:this.#os[0]*h+u,y:this.#os[1]*c+g},this.#Yr,this.#ss,t,this.#Zr,e??this.#Qr);for(let f=2;f<this.#os.length;f+=2)p.add({x:this.#os[f]*h+u,y:this.#os[f+1]*c+g});return p.getOutlines()}}class Tr{#Yr;#ys;#As=[];#Cs=[];constructor(t,e=0,i=0,n=!0){const r=[1/0,1/0,-1/0,-1/0],s=10**-4;for(const{x:u,y:g,width:p,height:f}of t){const t=Math.floor((u-e)/s)*s,i=Math.ceil((u+p+e)/s)*s,n=Math.floor((g-e)/s)*s,a=Math.ceil((g+f+e)/s)*s,o=[t,n,a,!0],l=[i,n,a,!1];this.#As.push(o,l),Qt.rectBoundingBox(t,n,i,a,r)}const a=r[2]-r[0]+2*i,o=r[3]-r[1]+2*i,l=r[0]-i,d=r[1]-i,h=this.#As.at(n?-1:-2),c=[h[0],h[2]];for(const u of this.#As){const[t,e,i]=u;u[0]=(t-l)/a,u[1]=(e-d)/o,u[2]=(i-d)/o}this.#Yr=new Float32Array([l,d,a,o]),this.#ys=c}getOutlines(){this.#As.sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);const t=[];for(const e of this.#As)e[3]?(t.push(...this.#Es(e)),this.#Ss(e)):(this.#ks(e),t.push(...this.#Es(e)));return this.#_s(t)}#_s(t){const e=[],i=new Set;for(const s of t){const[t,i,n]=s;e.push([t,i,s],[t,n,s])}e.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let s=0,a=e.length;s<a;s+=2){const t=e[s][2],n=e[s+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let r;for(;i.size>0;){const t=i.values().next().value;let[e,s,a,o,l]=t;i.delete(t);let d=e,h=s;for(r=[e,a],n.push(r);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,s,a,o,l]=t,d!==e&&(r.push(d,h,e,h===s?s:a),d=e),h=h===s?a:s}r.push(d,h)}return new Lr(n,this.#Yr,this.#ys)}#Ts(t){const e=this.#Cs;let i=0,n=e.length-1;for(;i<=n;){const r=i+n>>1,s=e[r][0];if(s===t)return r;s<t?i=r+1:n=r-1}return n+1}#Ss([,t,e]){const i=this.#Ts(t);this.#Cs.splice(i,0,[t,e])}#ks([,t,e]){const i=this.#Ts(t);for(let n=i;n<this.#Cs.length;n++){const[i,r]=this.#Cs[n];if(i!==t)break;if(i===t&&r===e)return void this.#Cs.splice(n,1)}for(let n=i-1;n>=0;n--){const[i,r]=this.#Cs[n];if(i!==t)break;if(i===t&&r===e)return void this.#Cs.splice(n,1)}}#Es(t){const[e,i,n]=t,r=[[e,i,n]],s=this.#Ts(n);for(let a=0;a<s;a++){const[t,i]=this.#Cs[a];for(let n=0,s=r.length;n<s;n++){const[,a,o]=r[n];if(!(i<=a||o<=t))if(a>=t)if(o>i)r[n][1]=i;else{if(1===s)return[];r.splice(n,1),n--,s--}else r[n][2]=t,o>i&&r.push([e,i,o])}}return r}}class Lr extends Sr{#Yr;#Ls;constructor(t,e,i){super(),this.#Ls=t,this.#Yr=e,this.lastPoint=i}toSVGPath(){const t=[];for(const e of this.#Ls){let[i,n]=e;t.push(`M${i} ${n}`);for(let r=2;r<e.length;r+=2){const s=e[r],a=e[r+1];s===i?(t.push(`V${a}`),n=a):a===n&&(t.push(`H${s}`),i=s)}t.push("Z")}return t.join(" ")}serialize([t,e,i,n],r){const s=[],a=i-t,o=n-e;for(const l of this.#Ls){const e=new Array(l.length);for(let i=0;i<l.length;i+=2)e[i]=t+l[i]*a,e[i+1]=n-l[i+1]*o;s.push(e)}return s}get box(){return this.#Yr}get classNamesForOutlining(){return["highlightOutline"]}}class Dr extends kr{newFreeDrawOutline(t,e,i,n,r,s){return new Pr(t,e,i,n,r,s)}}class Pr extends _r{newOutliner(t,e,i,n,r,s=0){return new Dr(t,e,i,n,r,s)}}let Mr=class t{#Ds=null;#Ps=null;#Ms;#Fs=null;#Is=!1;#Rs=!1;#s=null;#Bs;#Ns=null;#f=null;#Os;static#zs=null;static get _keyboardManager(){return zt(this,"_keyboardManager",new De([[["Escape","mac+Escape"],t.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],t.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],t.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],t.prototype._moveToPrevious],[["Home","mac+Home"],t.prototype._moveToBeginning],[["End","mac+End"],t.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:i=null}){e?(this.#Rs=!1,this.#Os=ht.HIGHLIGHT_COLOR,this.#s=e):(this.#Rs=!0,this.#Os=ht.HIGHLIGHT_DEFAULT_COLOR),this.#f=e?._uiManager||i,this.#Bs=this.#f._eventBus,this.#Ms=e?.color?.toUpperCase()||this.#f?.highlightColors.values().next().value||"#FFFF98",t.#zs||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#Ds=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",this.#s&&(t.ariaControls=`${this.#s.id}_colorpicker_dropdown`);const e=this.#f._signal;t.addEventListener("click",this.#Hs.bind(this),{signal:e}),t.addEventListener("keydown",this.#rr.bind(this),{signal:e});const i=this.#Ps=document.createElement("span");return i.className="swatch",i.ariaHidden="true",i.style.backgroundColor=this.#Ms,t.append(i),t}renderMainDropdown(){const t=this.#Fs=this.#Vs();return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}#Vs(){const e=document.createElement("div"),i=this.#f._signal;e.addEventListener("contextmenu",pe,{signal:i}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#s&&(e.id=`${this.#s.id}_colorpicker_dropdown`);for(const[n,r]of this.#f.highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",r),s.title=n,s.setAttribute("data-l10n-id",t.#zs[n]);const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=r,s.ariaSelected=r===this.#Ms,s.addEventListener("click",this.#js.bind(this,r),{signal:i}),e.append(s)}return e.addEventListener("keydown",this.#rr.bind(this),{signal:i}),e}#js(t,e){e.stopPropagation(),this.#Bs.dispatch("switchannotationeditorparams",{source:this,type:this.#Os,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#Ds)return void this.#Hs(t);const e=t.target.getAttribute("data-color");e&&this.#js(e,t)}_moveToNext(t){this.#Us?t.target!==this.#Ds?t.target.nextSibling?.focus():this.#Fs.firstChild?.focus():this.#Hs(t)}_moveToPrevious(t){t.target!==this.#Fs?.firstChild&&t.target!==this.#Ds?(this.#Us||this.#Hs(t),t.target.previousSibling?.focus()):this.#Us&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){this.#Us?this.#Fs.firstChild?.focus():this.#Hs(t)}_moveToEnd(t){this.#Us?this.#Fs.lastChild?.focus():this.#Hs(t)}#rr(e){t._keyboardManager.exec(this,e)}#Hs(t){if(this.#Us)return void this.hideDropdown();if(this.#Is=0===t.detail,this.#Ns||(this.#Ns=new AbortController,window.addEventListener("pointerdown",this.#h.bind(this),{signal:this.#f.combinedSignal(this.#Ns)})),this.#Ds.ariaExpanded="true",this.#Fs)return void this.#Fs.classList.remove("hidden");const e=this.#Fs=this.#Vs();this.#Ds.append(e)}#h(t){this.#Fs?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#Fs?.classList.add("hidden"),this.#Ds.ariaExpanded="false",this.#Ns?.abort(),this.#Ns=null}get#Us(){return this.#Fs&&!this.#Fs.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#Rs||(this.#Us?(this.hideDropdown(),this.#Ds.focus({preventScroll:!0,focusVisible:this.#Is})):this.#s?.unselect())}updateColor(t){if(this.#Ps&&(this.#Ps.style.backgroundColor=t),!this.#Fs)return;const e=this.#f.highlightColors.values();for(const i of this.#Fs.children)i.ariaSelected=e.next().value===t.toUpperCase()}destroy(){this.#Ds?.remove(),this.#Ds=null,this.#Ps=null,this.#Fs?.remove(),this.#Fs=null}};class Fr extends Re{#Ws=null;#$s=0;#Gs;#qs=null;#r=null;#Xs=null;#Ys=null;#Ks=0;#Qs=null;#Zs=null;#w=null;#Js=!1;#ys=null;#ta;#ea=null;#ia="";#as;#na="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=dt.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const t=Fr.prototype;return zt(this,"_keyboardManager",new De([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||Fr._defaultColor,this.#as=t.thickness||Fr._defaultThickness,this.#ta=t.opacity||Fr._defaultOpacity,this.#Gs=t.boxes||null,this.#na=t.methodOfCreation||"",this.#ia=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#Js=!0,this.#ra(t),this.#sa()):this.#Gs&&(this.#Ws=t.anchorNode,this.#$s=t.anchorOffset,this.#Ys=t.focusNode,this.#Ks=t.focusOffset,this.#aa(),this.#sa(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#Js?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#as,methodOfCreation:this.#na}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#aa(){const t=new Tr(this.#Gs,.001);this.#Zs=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#Zs.box;const e=new Tr(this.#Gs,.0025,.001,"ltr"===this._uiManager.direction);this.#Xs=e.getOutlines();const{lastPoint:i}=this.#Xs;this.#ys=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#ra({highlightOutlines:t,highlightId:e,clipPathId:i}){if(this.#Zs=t,this.#Xs=t.getNewOutline(this.#as/2+1.5,.0025),e>=0)this.#w=e,this.#qs=i,this.parent.drawLayer.finalizeDraw(e,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#ea=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#Xs.box,path:{d:this.#Xs.toSVGPath()}},!0);else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#w,{bbox:Fr.#oa(this.#Zs.box,(e-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#ea,{bbox:Fr.#oa(this.#Xs.box,e),path:{d:this.#Xs.toSVGPath()}})}const[n,r,s,a]=t.box;switch(this.rotation){case 0:this.x=n,this.y=r,this.width=s,this.height=a;break;case 90:{const[t,e]=this.parentDimensions;this.x=r,this.y=1-n,this.width=s*e/t,this.height=a*t/e;break}case 180:this.x=1-n,this.y=1-r,this.width=s,this.height=a;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-r,this.y=n,this.width=s*e/t,this.height=a*t/e;break}}const{lastPoint:o}=this.#Xs;this.#ys=[(o[0]-n)/s,(o[1]-r)/a]}static initialize(t,e){Re.initialize(t,e),Fr._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case ht.HIGHLIGHT_DEFAULT_COLOR:Fr._defaultColor=e;break;case ht.HIGHLIGHT_THICKNESS:Fr._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#ys}updateParams(t,e){switch(t){case ht.HIGHLIGHT_COLOR:this.#Vr(e);break;case ht.HIGHLIGHT_THICKNESS:this.#la(e)}}static get defaultPropertiesToUpdate(){return[[ht.HIGHLIGHT_DEFAULT_COLOR,Fr._defaultColor],[ht.HIGHLIGHT_THICKNESS,Fr._defaultThickness]]}get propertiesToUpdate(){return[[ht.HIGHLIGHT_COLOR,this.color||Fr._defaultColor],[ht.HIGHLIGHT_THICKNESS,this.#as||Fr._defaultThickness],[ht.HIGHLIGHT_FREE,this.#Js]]}#Vr(t){const e=(t,e)=>{this.color=t,this.#ta=e,this.parent?.drawLayer.updateProperties(this.#w,{root:{fill:t,"fill-opacity":e}}),this.#r?.updateColor(t)},i=this.color,n=this.#ta;this.addCommands({cmd:e.bind(this,t,Fr._defaultOpacity),undo:e.bind(this,i,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#la(t){const e=this.#as,i=t=>{this.#as=t,this.#da(t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#r=new Mr({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#ha())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#ha())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#ca(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#sa(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#ca():t&&(this.#sa(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#da(t){if(!this.#Js)return;this.#ra({highlightOutlines:this.#Zs.getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#ca(){null!==this.#w&&this.parent&&(this.parent.drawLayer.remove(this.#w),this.#w=null,this.parent.drawLayer.remove(this.#ea),this.#ea=null)}#sa(t=this.parent){null===this.#w&&(({id:this.#w,clipPathId:this.#qs}=t.drawLayer.draw({bbox:this.#Zs.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#ta},rootClass:{highlight:!0,free:this.#Js},path:{d:this.#Zs.toSVGPath()}},!1,!0)),this.#ea=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#Js},bbox:this.#Xs.box,path:{d:this.#Xs.toSVGPath()}},this.#Js),this.#Qs&&(this.#Qs.style.clipPath=this.#qs))}static#oa([t,e,i,n],r){switch(r){case 90:return[1-e-n,t,n,i];case 180:return[1-t-i,1-e-n,i,n];case 270:return[e,1-t-i,n,i]}return[t,e,i,n]}rotate(t){const{drawLayer:e}=this.parent;let i;this.#Js?(t=(t-this.rotation+360)%360,i=Fr.#oa(this.#Zs.box,t)):i=Fr.#oa([this.x,this.y,this.width,this.height],t),e.updateProperties(this.#w,{bbox:i,root:{"data-main-rotation":t}}),e.updateProperties(this.#ea,{bbox:Fr.#oa(this.#Xs.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;const t=super.render();this.#ia&&(t.setAttribute("aria-label",this.#ia),t.setAttribute("role","mark")),this.#Js?t.classList.add("free"):this.div.addEventListener("keydown",this.#ua.bind(this),{signal:this._uiManager._signal});const e=this.#Qs=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#qs;const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),ke(this,this.#Qs,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ea,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#ea,{rootClass:{hovered:!1}})}#ua(t){Fr._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#ga(!0);break;case 1:case 3:this.#ga(!1)}}#ga(t){if(!this.#Ws)return;const e=window.getSelection();t?e.setPosition(this.#Ws,this.#$s):e.setPosition(this.#Ys,this.#Ks)}select(){super.select(),this.#ea&&this.parent?.drawLayer.updateProperties(this.#ea,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#ea&&(this.parent?.drawLayer.updateProperties(this.#ea,{rootClass:{selected:!1}}),this.#Js||this.#ga(!1))}get _mustFixPosition(){return!this.#Js}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#w,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#ea,{rootClass:{hidden:!t}}))}#ha(){return this.#Js?this.rotation:0}#pa(){if(this.#Js)return null;const[t,e]=this.pageDimensions,[i,n]=this.pageTranslation,r=this.#Gs,s=new Float32Array(8*r.length);let a=0;for(const{x:o,y:l,width:d,height:h}of r){const r=o*t+i,c=(1-l)*e+n;s[a]=s[a+4]=r,s[a+1]=s[a+3]=c,s[a+2]=s[a+6]=r+d*t,s[a+5]=s[a+7]=c-h*e,a+=8}return s}#fa(t){return this.#Zs.serialize(t,this.#ha())}static startHighlighting(t,e,{target:i,x:n,y:r}){const{x:s,y:a,width:o,height:l}=i.getBoundingClientRect(),d=new AbortController,h=t.combinedSignal(d),c=e=>{d.abort(),this.#ma(t,e)};window.addEventListener("blur",c,{signal:h}),window.addEventListener("pointerup",c,{signal:h}),window.addEventListener("pointerdown",fe,{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",pe,{signal:h}),i.addEventListener("pointermove",this.#ba.bind(this,t),{signal:h}),this._freeHighlight=new Dr({x:n,y:r},[s,a,o,l],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#ba(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#ma(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,e,i){let n=null;if(t instanceof br){const{data:{quadPoints:e,rect:i,rotation:r,id:s,color:a,opacity:o,popupRef:l},parent:{page:{pageNumber:d}}}=t;n=t={annotationType:dt.HIGHLIGHT,color:Array.from(a),opacity:o,quadPoints:e,boxes:null,pageIndex:d-1,rect:i.slice(0),rotation:r,annotationElementId:s,id:s,deleted:!1,popupRef:l}}else if(t instanceof mr){const{data:{inkLists:e,rect:i,rotation:r,id:s,color:a,borderStyle:{rawWidth:o},popupRef:l},parent:{page:{pageNumber:d}}}=t;n=t={annotationType:dt.HIGHLIGHT,color:Array.from(a),thickness:o,inkLists:e,boxes:null,pageIndex:d-1,rect:i.slice(0),rotation:r,annotationElementId:s,id:s,deleted:!1,popupRef:l}}const{color:r,quadPoints:s,inkLists:a,opacity:o}=t,l=await super.deserialize(t,e,i);l.color=Qt.makeHexColor(...r),l.#ta=o||1,a&&(l.#as=t.thickness),l._initialData=n;const[d,h]=l.pageDimensions,[c,u]=l.pageTranslation;if(s){const t=l.#Gs=[];for(let e=0;e<s.length;e+=8)t.push({x:(s[e]-c)/d,y:1-(s[e+1]-u)/h,width:(s[e+2]-s[e])/d,height:(s[e+1]-s[e+5])/h});l.#aa(),l.#sa(),l.rotate(l.rotation)}else if(a){l.#Js=!0;const t=a[0],i={x:t[0]-c,y:h-(t[1]-u)},n=new Dr(i,[0,0,d,h],1,l.#as/2,!0,.001);for(let e=0,a=t.length;e<a;e+=2)i.x=t[e]-c,i.y=h-(t[e+1]-u),n.add(i);const{id:r,clipPathId:s}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:n.toSVGPath()}},!0,!0);l.#ra({highlightOutlines:n.getOutlines(),highlightId:r,clipPathId:s}),l.#sa(),l.rotate(l.parentRotation)}return l}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();const e=this.getRect(0,0),i=Re._colorManager.convert(this.color),n={annotationType:dt.HIGHLIGHT,color:i,opacity:this.#ta,thickness:this.#as,quadPoints:this.#pa(),outlines:this.#fa(e),pageIndex:this.pageIndex,rect:e,rotation:this.#ha(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#Xr(n)?null:(n.id=this.annotationElementId,n)}#Xr(t){const{color:e}=this._initialData;return t.color.some((t,i)=>t!==e[i])}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Ir{#va=Object.create(null);updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,i)}updateSVGProperty(t,e){this.#va[t]=e}toSVGProperties(){const t=this.#va;return this.#va=Object.create(null),{root:t}}reset(){this.#va=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){Rt("Not implemented")}}class Rr extends Re{#wa=null;#xa;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#ya=null;static#Aa=null;static#Ca=null;static#Ea=NaN;static#Sa=null;static#ka=null;static#_a=NaN;static _INNER_MARGIN=3;constructor(t){super(t),this.#xa=t.mustBeCommitted||!1,this._addOutlines(t)}_addOutlines(t){t.drawOutlines&&(this.#Ta(t),this.#sa())}#Ta({drawOutlines:t,drawId:e,drawingOptions:i}){this.#wa=t,this._drawingOptions||=i,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),e>=0?(this._drawId=e,this.parent.drawLayer.finalizeDraw(e,t.defaultProperties)):this._drawId=this.#La(t,this.parent),this.#Da(t.box)}#La(t,e){const{id:i}=e.drawLayer.draw(Rr._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i}static _mergeSVGProperties(t,e){const i=new Set(Object.keys(t));for(const[n,r]of Object.entries(e))i.has(n)?Object.assign(t[n],r):t[n]=r;return t}static getDefaultDrawingOptions(t){Rt("Not implemented")}static get typesMap(){Rt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,e),this._currentParent&&(Rr.#ya.updateProperty(i,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,e)}static get defaultPropertiesToUpdate(){const t=[],e=this._defaultDrawingOptions;for(const[i,n]of this.typesMap)t.push([i,e[n]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:e}=this;for(const[i,n]of this.constructor.typesMap)t.push([i,e[n]]);return t}_updateProperty(t,e,i){const n=this._drawingOptions,r=n[e],s=t=>{n.updateProperty(e,t);const i=this.#wa.updateProperty(e,t);i&&this.#Da(i),this.parent?.drawLayer.updateProperties(this._drawId,n.toSVGProperties())};this.addCommands({cmd:s.bind(this,i),undo:s.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Rr._mergeSVGProperties(this.#wa.getPathResizingSVGProperties(this.#Pa()),{bbox:this.#Ma()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Rr._mergeSVGProperties(this.#wa.getPathResizedSVGProperties(this.#Pa()),{bbox:this.#Ma()}))}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Ma()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Rr._mergeSVGProperties(this.#wa.getPathTranslatedSVGProperties(this.#Pa(),this.parentDimensions),{bbox:this.#Ma()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#xa&&(this.#xa=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#ca(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#sa(),this.#Da(this.#wa.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#ca()):t&&(this._uiManager.addShouldRescale(this),this.#sa(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),e&&this.select()}#ca(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#sa(t=this.parent){null!==this._drawId&&this.parent===t||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=this.#La(this.#wa,t)):this.parent.drawLayer.updateParent(this._drawId,t.drawLayer))}#Fa([t,e,i,n]){const{parentDimensions:[r,s],rotation:a}=this;switch(a){case 90:return[e,1-t,i*(s/r),n*(r/s)];case 180:return[1-t,1-e,i,n];case 270:return[1-e,t,i*(s/r),n*(r/s)];default:return[t,e,i,n]}}#Pa(){const{x:t,y:e,width:i,height:n,parentDimensions:[r,s],rotation:a}=this;switch(a){case 90:return[1-e,t,i*(r/s),n*(s/r)];case 180:return[1-t,1-e,i,n];case 270:return[e,1-t,i*(r/s),n*(s/r)];default:return[t,e,i,n]}}#Da(t){if([this.x,this.y,this.width,this.height]=this.#Fa(t),this.div){this.fixAndSetPosition();const[t,e]=this.parentDimensions;this.setDims(this.width*t,this.height*e)}this._onResized()}#Ma(){const{x:t,y:e,width:i,height:n,rotation:r,parentRotation:s,parentDimensions:[a,o]}=this;switch((4*r+s)/90){case 1:return[1-e-n,t,n,i];case 2:return[1-t-i,1-e-n,i,n];case 3:return[e,1-t-i,n,i];case 4:return[t,e-i*(a/o),n*(o/a),i*(a/o)];case 5:return[1-e,t,i*(a/o),n*(o/a)];case 6:return[1-t-n*(o/a),1-e,n*(o/a),i*(a/o)];case 7:return[e-i*(a/o),1-t-n*(o/a),i*(a/o),n*(o/a)];case 8:return[t-i,e-n,i,n];case 9:return[1-e,t-i,n,i];case 10:return[1-t,1-e,i,n];case 11:return[e-n,1-t,n,i];case 12:return[t-n*(o/a),e,n*(o/a),i*(a/o)];case 13:return[1-e-i*(a/o),t-n*(o/a),i*(a/o),n*(o/a)];case 14:return[1-t,1-e-i*(a/o),n*(o/a),i*(a/o)];case 15:return[e,1-t,i*(a/o),n*(o/a)];default:return[t,e,i,n]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Rr._mergeSVGProperties({bbox:this.#Ma()},this.#wa.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#Da(this.#wa.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);const i=super.render();i.classList.add("draw");const n=document.createElement("div");i.append(n),n.setAttribute("aria-hidden","true"),n.className="internal";const[r,s]=this.parentDimensions;return this.setDims(this.width*r,this.height*s),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),i}static createDrawerInstance(t,e,i,n,r){Rt("Not implemented")}static startDrawing(t,e,i,n){const{target:r,offsetX:s,offsetY:a,pointerId:o,pointerType:l}=n;if(Rr.#Sa&&Rr.#Sa!==l)return;const{viewport:{rotation:d}}=t,{width:h,height:c}=r.getBoundingClientRect(),u=Rr.#Aa=new AbortController,g=t.combinedSignal(u);Rr.#Ea||=o,Rr.#Sa??=l,window.addEventListener("pointerup",t=>{Rr.#Ea===t.pointerId?this._endDraw(t):Rr.#ka?.delete(t.pointerId)},{signal:g}),window.addEventListener("pointercancel",t=>{Rr.#Ea===t.pointerId?this._currentParent.endDrawingSession():Rr.#ka?.delete(t.pointerId)},{signal:g}),window.addEventListener("pointerdown",t=>{Rr.#Sa===t.pointerType&&((Rr.#ka||=new Set).add(t.pointerId),Rr.#ya.isCancellable()&&(Rr.#ya.removeLastElement(),Rr.#ya.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",pe,{signal:g}),r.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),r.addEventListener("touchmove",t=>{t.timeStamp===Rr.#_a&&fe(t)},{signal:g}),t.toggleDrawing(),e._editorUndoBar?.hide(),Rr.#ya?t.drawLayer.updateProperties(this._currentDrawId,Rr.#ya.startNew(s,a,h,c,d)):(e.updateUIForDefaultProperties(this),Rr.#ya=this.createDrawerInstance(s,a,h,c,d),Rr.#Ca=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(Rr.#Ca.toSVGProperties(),Rr.#ya.defaultSVGProperties),!0,!1)))}static _drawMove(t){if(Rr.#_a=-1,!Rr.#ya)return;const{offsetX:e,offsetY:i,pointerId:n}=t;Rr.#Ea===n&&(Rr.#ka?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,Rr.#ya.add(e,i)),Rr.#_a=t.timeStamp,fe(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,Rr.#ya=null,Rr.#Ca=null,Rr.#Sa=null,Rr.#_a=NaN),Rr.#Aa&&(Rr.#Aa.abort(),Rr.#Aa=null,Rr.#Ea=NaN,Rr.#ka=null)}static _endDraw(t){const e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),t?.target===e.div&&e.drawLayer.updateProperties(this._currentDrawId,Rr.#ya.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const t=Rr.#ya,i=this._currentDrawId,n=t.getLastElement();return void e.addCommands({cmd:()=>{e.drawLayer.updateProperties(i,t.setLastElement(n))},undo:()=>{e.drawLayer.updateProperties(i,t.removeLastElement())},mustExec:!1,type:ht.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(ht.DRAW_STEP),!Rr.#ya.isEmpty()){const{pageDimensions:[i,n],scale:r}=e,s=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Rr.#ya.getOutlines(i*r,n*r,r,this._INNER_MARGIN),drawingOptions:Rr.#Ca,mustBeCommitted:!t});return this._cleanup(!0),s}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,i,n,r,s){Rt("Not implemented")}static async deserialize(t,e,i){const{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:a}}=e.viewport,o=this.deserializeDraw(s,a,n,r,this._INNER_MARGIN,t),l=await super.deserialize(t,e,i);return l.createDrawingOptions(t),l.#Ta({drawOutlines:o}),l.#sa(),l.onScaleChanging(),l.rotate(),l}serializeDraw(t){const[e,i]=this.pageTranslation,[n,r]=this.pageDimensions;return this.#wa.serialize([e,i,n,r],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Br{#ts=new Float64Array(6);#Tr;#Ia;#sn;#as;#os;#Ra="";#Ba=0;#Ls=new Nr;#Na;#Oa;constructor(t,e,i,n,r,s){this.#Na=i,this.#Oa=n,this.#sn=r,this.#as=s,[t,e]=this.#za(t,e);const a=this.#Tr=[NaN,NaN,NaN,NaN,t,e];this.#os=[t,e],this.#Ia=[{line:a,points:this.#os}],this.#ts.set(a,0)}updateProperty(t,e){"stroke-width"===t&&(this.#as=e)}#za(t,e){return Sr._normalizePoint(t,e,this.#Na,this.#Oa,this.#sn)}isEmpty(){return!this.#Ia||0===this.#Ia.length}isCancellable(){return this.#os.length<=10}add(t,e){[t,e]=this.#za(t,e);const[i,n,r,s]=this.#ts.subarray(2,6),a=t-r,o=e-s;return Math.hypot(this.#Na*a,this.#Oa*o)<=2?null:(this.#os.push(t,e),isNaN(i)?(this.#ts.set([r,s,t,e],2),this.#Tr.push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(this.#ts[0])&&this.#Tr.splice(6,6),this.#ts.set([i,n,r,s,t,e],0),this.#Tr.push(...Sr.createBezierPoints(i,n,r,s,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(2===this.#os.length?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,n,r){this.#Na=i,this.#Oa=n,this.#sn=r,[t,e]=this.#za(t,e);const s=this.#Tr=[NaN,NaN,NaN,NaN,t,e];this.#os=[t,e];const a=this.#Ia.at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),this.#Ia.push({line:s,points:this.#os}),this.#ts.set(s,0),this.#Ba=0,this.toSVGPath(),null}getLastElement(){return this.#Ia.at(-1)}setLastElement(t){return this.#Ia?(this.#Ia.push(t),this.#Tr=t.line,this.#os=t.points,this.#Ba=0,{path:{d:this.toSVGPath()}}):this.#Ls.setLastElement(t)}removeLastElement(){if(!this.#Ia)return this.#Ls.removeLastElement();this.#Ia.pop(),this.#Ra="";for(let t=0,e=this.#Ia.length;t<e;t++){const{line:e,points:i}=this.#Ia[t];this.#Tr=e,this.#os=i,this.#Ba=0,this.toSVGPath()}return{path:{d:this.#Ra}}}toSVGPath(){const t=Sr.svgRound(this.#Tr[4]),e=Sr.svgRound(this.#Tr[5]);if(2===this.#os.length)return this.#Ra=`${this.#Ra} M ${t} ${e} Z`,this.#Ra;if(this.#os.length<=6){const i=this.#Ra.lastIndexOf("M");this.#Ra=`${this.#Ra.slice(0,i)} M ${t} ${e}`,this.#Ba=6}if(4===this.#os.length){const t=Sr.svgRound(this.#Tr[10]),e=Sr.svgRound(this.#Tr[11]);return this.#Ra=`${this.#Ra} L ${t} ${e}`,this.#Ba=12,this.#Ra}const i=[];0===this.#Ba&&(i.push(`M ${t} ${e}`),this.#Ba=6);for(let n=this.#Ba,r=this.#Tr.length;n<r;n+=6){const[t,e,r,s,a,o]=this.#Tr.slice(n,n+6).map(Sr.svgRound);i.push(`C${t} ${e} ${r} ${s} ${a} ${o}`)}return this.#Ra+=i.join(" "),this.#Ba=this.#Tr.length,this.#Ra}getOutlines(t,e,i,n){const r=this.#Ia.at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),this.#Ls.build(this.#Ia,t,e,i,this.#sn,this.#as,n),this.#ts=null,this.#Tr=null,this.#Ia=null,this.#Ra=null,this.#Ls}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class Nr extends Sr{#vs;#Ha=0;#Qr;#Ia;#Na;#Oa;#Va;#sn;#as;build(t,e,i,n,r,s,a){this.#Na=e,this.#Oa=i,this.#Va=n,this.#sn=r,this.#as=s,this.#Qr=a??0,this.#Ia=t,this.#ja()}get thickness(){return this.#as}setLastElement(t){return this.#Ia.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#Ia.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const t=[];for(const{line:e}of this.#Ia)if(t.push(`M${Sr.svgRound(e[4])} ${Sr.svgRound(e[5])}`),6!==e.length)if(12===e.length&&isNaN(e[6]))t.push(`L${Sr.svgRound(e[10])} ${Sr.svgRound(e[11])}`);else for(let i=6,n=e.length;i<n;i+=6){const[n,r,s,a,o,l]=e.subarray(i,i+6).map(Sr.svgRound);t.push(`C${n} ${r} ${s} ${a} ${o} ${l}`)}else t.push("Z");return t.join("")}serialize([t,e,i,n],r){const s=[],a=[],[o,l,d,h]=this.#Ua();let c,u,g,p,f,m,b,v,w;switch(this.#sn){case 0:w=Sr._rescale,c=t,u=e+n,g=i,p=-n,f=t+o*i,m=e+(1-l-h)*n,b=t+(o+d)*i,v=e+(1-l)*n;break;case 90:w=Sr._rescaleAndSwap,c=t,u=e,g=i,p=n,f=t+l*i,m=e+o*n,b=t+(l+h)*i,v=e+(o+d)*n;break;case 180:w=Sr._rescale,c=t+i,u=e,g=-i,p=n,f=t+(1-o-d)*i,m=e+l*n,b=t+(1-o)*i,v=e+(l+h)*n;break;case 270:w=Sr._rescaleAndSwap,c=t+i,u=e+n,g=-i,p=-n,f=t+(1-l-h)*i,m=e+(1-o-d)*n,b=t+(1-l)*i,v=e+(1-o)*n}for(const{line:x,points:y}of this.#Ia)s.push(w(x,c,u,g,p,r?new Array(x.length):null)),a.push(w(y,c,u,g,p,r?new Array(y.length):null));return{lines:s,points:a,rect:[f,m,b,v]}}static deserialize(t,e,i,n,r,{paths:{lines:s,points:a},rotation:o,thickness:l}){const d=[];let h,c,u,g,p;switch(o){case 0:p=Sr._rescale,h=-t/i,c=e/n+1,u=1/i,g=-1/n;break;case 90:p=Sr._rescaleAndSwap,h=-e/n,c=-t/i,u=1/n,g=1/i;break;case 180:p=Sr._rescale,h=t/i+1,c=-e/n,u=-1/i,g=1/n;break;case 270:p=Sr._rescaleAndSwap,h=e/n+1,c=t/i+1,u=-1/n,g=-1/i}if(!s){s=[];for(const t of a){const e=t.length;if(2===e){s.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1]]));continue}if(4===e){s.push(new Float32Array([NaN,NaN,NaN,NaN,t[0],t[1],NaN,NaN,NaN,NaN,t[2],t[3]]));continue}const i=new Float32Array(3*(e-2));s.push(i);let[n,r,a,o]=t.subarray(0,4);i.set([NaN,NaN,NaN,NaN,n,r],0);for(let s=4;s<e;s+=2){const e=t[s],l=t[s+1];i.set(Sr.createBezierPoints(n,r,a,o,e,l),3*(s-2)),[n,r,a,o]=[a,o,e,l]}}}for(let m=0,b=s.length;m<b;m++)d.push({line:p(s[m].map(t=>t??NaN),h,c,u,g),points:p(a[m].map(t=>t??NaN),h,c,u,g)});const f=new this.prototype.constructor;return f.build(d,i,n,1,o,l,r),f}#Wa(t=this.#as){const e=this.#Qr+t/2*this.#Va;return this.#sn%180==0?[e/this.#Na,e/this.#Oa]:[e/this.#Oa,e/this.#Na]}#Ua(){const[t,e,i,n]=this.#vs,[r,s]=this.#Wa(0);return[t+r,e+s,i-2*r,n-2*s]}#ja(){const t=this.#vs=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:n}of this.#Ia){if(n.length<=12){for(let e=4,i=n.length;e<i;e+=6)Qt.pointBoundingBox(n[e],n[e+1],t);continue}let e=n[4],i=n[5];for(let r=6,s=n.length;r<s;r+=6){const[s,a,o,l,d,h]=n.subarray(r,r+6);Qt.bezierBoundingBox(e,i,s,a,o,l,d,h,t),e=d,i=h}}const[e,i]=this.#Wa();t[0]=ie(t[0]-e,0,1),t[1]=ie(t[1]-i,0,1),t[2]=ie(t[2]+e,0,1),t[3]=ie(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#vs}updateProperty(t,e){return"stroke-width"===t?this.#la(e):null}#la(t){const[e,i]=this.#Wa();this.#as=t;const[n,r]=this.#Wa(),[s,a]=[n-e,r-i],o=this.#vs;return o[0]-=s,o[1]-=a,o[2]+=2*s,o[3]+=2*a,o}updateParentDimensions([t,e],i){const[n,r]=this.#Wa();this.#Na=t,this.#Oa=e,this.#Va=i;const[s,a]=this.#Wa(),o=s-n,l=a-r,d=this.#vs;return d[0]-=o,d[1]-=l,d[2]+=2*o,d[3]+=2*l,d}updateRotation(t){return this.#Ha=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#vs.map(Sr.svgRound).join(" ")}get defaultProperties(){const[t,e]=this.#vs;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Sr.svgRound(t)} ${Sr.svgRound(e)}`}}}get rotationTransform(){const[,,t,e]=this.#vs;let i=0,n=0,r=0,s=0,a=0,o=0;switch(this.#Ha){case 90:n=e/t,r=-t/e,a=t;break;case 180:i=-1,s=-1,a=t,o=e;break;case 270:n=-e/t,r=t/e,o=e;break;default:return""}return`matrix(${i} ${n} ${r} ${s} ${Sr.svgRound(a)} ${Sr.svgRound(o)})`}getPathResizingSVGProperties([t,e,i,n]){const[r,s]=this.#Wa(),[a,o,l,d]=this.#vs;if(Math.abs(l-r)<=Sr.PRECISION||Math.abs(d-s)<=Sr.PRECISION){const r=t+i/2-(a+l/2),s=e+n/2-(o+d/2);return{path:{"transform-origin":`${Sr.svgRound(t)} ${Sr.svgRound(e)}`,transform:`${this.rotationTransform} translate(${r} ${s})`}}}const h=(i-2*r)/(l-2*r),c=(n-2*s)/(d-2*s),u=l/i,g=d/n;return{path:{"transform-origin":`${Sr.svgRound(a)} ${Sr.svgRound(o)}`,transform:`${this.rotationTransform} scale(${u} ${g}) translate(${Sr.svgRound(r)} ${Sr.svgRound(s)}) scale(${h} ${c}) translate(${Sr.svgRound(-r)} ${Sr.svgRound(-s)})`}}}getPathResizedSVGProperties([t,e,i,n]){const[r,s]=this.#Wa(),a=this.#vs,[o,l,d,h]=a;if(a[0]=t,a[1]=e,a[2]=i,a[3]=n,Math.abs(d-r)<=Sr.PRECISION||Math.abs(h-s)<=Sr.PRECISION){const r=t+i/2-(o+d/2),s=e+n/2-(l+h/2);for(const{line:t,points:e}of this.#Ia)Sr._translate(t,r,s,t),Sr._translate(e,r,s,e);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Sr.svgRound(t)} ${Sr.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const c=(i-2*r)/(d-2*r),u=(n-2*s)/(h-2*s),g=-c*(o+r)+t+r,p=-u*(l+s)+e+s;if(1!==c||1!==u||0!==g||0!==p)for(const{line:f,points:m}of this.#Ia)Sr._rescale(f,g,p,c,u,f),Sr._rescale(m,g,p,c,u,m);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Sr.svgRound(t)} ${Sr.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,e],i){const[n,r]=i,s=this.#vs,a=t-s[0],o=e-s[1];if(this.#Na===n&&this.#Oa===r)for(const{line:l,points:d}of this.#Ia)Sr._translate(l,a,o,l),Sr._translate(d,a,o,d);else{const t=this.#Na/n,e=this.#Oa/r;this.#Na=n,this.#Oa=r;for(const{line:i,points:n}of this.#Ia)Sr._rescale(i,a,o,t,e,i),Sr._rescale(n,a,o,t,e,n);s[2]*=t,s[3]*=e}return s[0]=t,s[1]=e,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Sr.svgRound(t)} ${Sr.svgRound(e)}`}}}get defaultSVGProperties(){const t=this.#vs;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Sr.svgRound(t[0])} ${Sr.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}}class Or extends Ir{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:Re._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){"stroke-width"===t&&(e??=this["stroke-width"],e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){const t=new Or(this._viewParameters);return t.updateAll(this),t}}class zr extends Rr{static _type="ink";static _editorType=dt.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){Re.initialize(t,e),this._defaultDrawingOptions=new Or(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return zt(this,"typesMap",new Map([[ht.INK_THICKNESS,"stroke-width"],[ht.INK_COLOR,"stroke"],[ht.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,i,n,r){return new Br(t,e,i,n,r,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,i,n,r,s){return Nr.deserialize(t,e,i,n,r,s)}static async deserialize(t,e,i){let n=null;if(t instanceof mr){const{data:{inkLists:e,rect:i,rotation:r,id:s,color:a,opacity:o,borderStyle:{rawWidth:l},popupRef:d},parent:{page:{pageNumber:h}}}=t;n=t={annotationType:dt.INK,color:Array.from(a),thickness:l,opacity:o,paths:{points:e},boxes:null,pageIndex:h-1,rect:i.slice(0),rotation:r,annotationElementId:s,id:s,deleted:!1,popupRef:d}}const r=await super.deserialize(t,e,i);return r._initialData=n,r}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:t,_drawingOptions:e,parent:i}=this;e.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){const t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:e,opacity:i}){this._drawingOptions=zr.getDefaultDrawingOptions({stroke:Qt.makeHexColor(...t),"stroke-width":e,"stroke-opacity":i})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:e,points:i,rect:n}=this.serializeDraw(t),{_drawingOptions:{stroke:r,"stroke-opacity":s,"stroke-width":a}}=this,o={annotationType:dt.INK,color:Re._colorManager.convert(r),opacity:s,thickness:a,paths:{lines:e,points:i},pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(o.isCopy=!0,o):this.annotationElementId&&!this.#Xr(o)?null:(o.id=this.annotationElementId,o)}#Xr(t){const{color:e,thickness:i,opacity:n,pageIndex:r}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||t.color.some((t,i)=>t!==e[i])||t.thickness!==i||t.opacity!==n||t.pageIndex!==r}renderAnnotationElement(t){const{points:e,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:e}),null}}class Hr extends Nr{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}let Vr=class{static#$a={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#Ga(t,e,i,n){return n-=e,0===(i-=t)?n>0?0:4:1===i?n+6:2-n}static#qa=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#Xa(t,e,i,n,r,s,a){const o=this.#Ga(i,n,r,s);for(let l=0;l<8;l++){const r=(-l+o-a+16)%8;if(0!==t[(i+this.#qa[2*r])*e+(n+this.#qa[2*r+1])])return r}return-1}static#Ya(t,e,i,n,r,s,a){const o=this.#Ga(i,n,r,s);for(let l=0;l<8;l++){const r=(l+o+a+16)%8;if(0!==t[(i+this.#qa[2*r])*e+(n+this.#qa[2*r+1])])return r}return-1}static#Ka(t,e,i,n){const r=t.length,s=new Int32Array(r);for(let d=0;d<r;d++)s[d]=t[d]<=n?1:0;for(let d=1;d<i-1;d++)s[d*e]=s[d*e+e-1]=0;for(let d=0;d<e;d++)s[d]=s[e*i-1-d]=0;let a,o=1;const l=[];for(let d=1;d<i-1;d++){a=1;for(let t=1;t<e-1;t++){const i=d*e+t,n=s[i];if(0===n)continue;let r=d,h=t;if(1===n&&0===s[i-1])o+=1,h-=1;else{if(!(n>=1&&0===s[i+1])){1!==n&&(a=Math.abs(n));continue}o+=1,h+=1,n>1&&(a=n)}const c=[t,d],u=h===t+1,g={isHole:u,points:c,id:o,parent:0};let p;l.push(g);for(const t of l)if(t.id===a){p=t;break}p?p.isHole?g.parent=u?p.parent:a:g.parent=u?a:p.parent:g.parent=u?a:0;const f=this.#Xa(s,e,d,t,r,h,0);if(-1===f){s[i]=-o,1!==s[i]&&(a=Math.abs(s[i]));continue}let m=this.#qa[2*f],b=this.#qa[2*f+1];const v=d+m,w=t+b;r=v,h=w;let x=d,y=t;for(;;){const n=this.#Ya(s,e,x,y,r,h,1);m=this.#qa[2*n],b=this.#qa[2*n+1];const l=x+m,u=y+b;c.push(u,l);const g=x*e+y;if(0===s[g+1]?s[g]=-o:1===s[g]&&(s[g]=o),l===d&&u===t&&x===v&&y===w){1!==s[i]&&(a=Math.abs(s[i]));break}r=x,h=y,x=l,y=u}}}return l}static#Qa(t,e,i,n){if(i-e<=4){for(let r=e;r<i-2;r+=2)n.push(t[r],t[r+1]);return}const r=t[e],s=t[e+1],a=t[i-4]-r,o=t[i-3]-s,l=Math.hypot(a,o),d=a/l,h=o/l,c=d*s-h*r,u=o/a,g=1/l,p=Math.atan(u),f=Math.cos(p),m=Math.sin(p),b=g*(Math.abs(f)+Math.abs(m)),v=g*(1-b+b**2),w=Math.max(Math.atan(Math.abs(m+f)*v),Math.atan(Math.abs(m-f)*v));let x=0,y=e;for(let A=e+2;A<i-2;A+=2){const e=Math.abs(c-d*t[A+1]+h*t[A]);e>x&&(y=A,x=e)}x>(l*w)**2?(this.#Qa(t,e,y+2,n),this.#Qa(t,y,i,n)):n.push(r,s)}static#Za(t){const e=[],i=t.length;return this.#Qa(t,0,i,e),e.push(t[i-2],t[i-1]),e.length<=4?null:e}static#Ja(t,e,i,n,r,s){const a=new Float32Array(s**2),o=-2*n**2,l=s>>1;for(let p=0;p<s;p++){const t=(p-l)**2;for(let e=0;e<s;e++)a[p*s+e]=Math.exp((t+(e-l)**2)/o)}const d=new Float32Array(256),h=-2*r**2;for(let p=0;p<256;p++)d[p]=Math.exp(p**2/h);const c=t.length,u=new Uint8Array(c),g=new Uint32Array(256);for(let p=0;p<i;p++)for(let n=0;n<e;n++){const r=p*e+n,o=t[r];let h=0,c=0;for(let u=0;u<s;u++){const r=p+u-l;if(!(r<0||r>=i))for(let i=0;i<s;i++){const g=n+i-l;if(g<0||g>=e)continue;const p=t[r*e+g],f=a[u*s+i]*d[Math.abs(p-o)];h+=p*f,c+=f}}g[u[r]=Math.round(h/c)]++}return[u,g]}static#to(t){const e=new Uint32Array(256);for(const i of t)e[i]++;return e}static#eo(t){const e=t.length,i=new Uint8ClampedArray(e>>2);let n=-1/0,r=1/0;for(let a=0,o=i.length;a<o;a++){if(0===t[3+(a<<2)]){n=i[a]=255;continue}const e=i[a]=t[a<<2];e>n&&(n=e),e<r&&(r=e)}const s=255/(n-r);for(let a=0;a<e;a++)i[a]=(i[a]-r)*s;return i}static#io(t){let e,i=-1/0,n=-1/0;const r=t.findIndex(t=>0!==t);let s=r,a=r;for(e=r;e<256;e++){const r=t[e];r>i&&(e-s>n&&(n=e-s,a=e-1),i=r,s=e)}for(e=a-1;e>=0&&!(t[e]>t[e+1]);e--);return e}static#no(t){const e=t,{width:i,height:n}=t,{maxDim:r}=this.#$a;let s=i,a=n;if(i>r||n>r){let o=i,l=n,d=Math.log2(Math.max(i,n)/r);const h=Math.floor(d);d=d===h?h-1:h;for(let i=0;i<d;i++){s=Math.ceil(o/2),a=Math.ceil(l/2);const i=new OffscreenCanvas(s,a);i.getContext("2d").drawImage(t,0,0,o,l,0,0,s,a),o=s,l=a,t!==e&&t.close(),t=i.transferToImageBitmap()}const c=Math.min(r/s,r/a);s=Math.round(s*c),a=Math.round(a*c)}const o=new OffscreenCanvas(s,a).getContext("2d",{willReadFrequently:!0});o.filter="grayscale(1)",o.drawImage(t,0,0,t.width,t.height,0,0,s,a);const l=o.getImageData(0,0,s,a).data;return[this.#eo(l),s,a]}static extractContoursFromText(t,{fontFamily:e,fontStyle:i,fontWeight:n},r,s,a,o){let l=new OffscreenCanvas(1,1),d=l.getContext("2d",{alpha:!1});const h=d.font=`${i} ${n} 200px ${e}`,{actualBoundingBoxLeft:c,actualBoundingBoxRight:u,actualBoundingBoxAscent:g,actualBoundingBoxDescent:p,fontBoundingBoxAscent:f,fontBoundingBoxDescent:m,width:b}=d.measureText(t),v=1.5,w=Math.ceil(Math.max(Math.abs(c)+Math.abs(u)||0,b)*v),x=Math.ceil(Math.max(Math.abs(g)+Math.abs(p)||200,Math.abs(f)+Math.abs(m)||200)*v);l=new OffscreenCanvas(w,x),d=l.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=h,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,w,x),d.fillStyle="black",d.fillText(t,.5*w/2,1.5*x/2);const y=this.#eo(d.getImageData(0,0,w,x).data),A=this.#to(y),C=this.#io(A),E=this.#Ka(y,w,x,C);return this.processDrawnLines({lines:{curves:E,width:w,height:x},pageWidth:r,pageHeight:s,rotation:a,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(t,e,i,n,r){const[s,a,o]=this.#no(t),[l,d]=this.#Ja(s,a,o,Math.hypot(a,o)*this.#$a.sigmaSFactor,this.#$a.sigmaR,this.#$a.kernelSize),h=this.#io(d),c=this.#Ka(l,a,o,h);return this.processDrawnLines({lines:{curves:c,width:a,height:o},pageWidth:e,pageHeight:i,rotation:n,innerMargin:r,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:r,mustSmooth:s,areContours:a}){n%180!=0&&([e,i]=[i,e]);const{curves:o,width:l,height:d}=t,h=t.thickness??0,c=[],u=Math.min(e/l,i/d),g=u/e,p=u/i,f=[];for(const{points:b}of o){const t=s?this.#Za(b):b;if(!t)continue;f.push(t);const e=t.length,i=new Float32Array(e),n=new Float32Array(3*(2===e?2:e-2));if(c.push({line:n,points:i}),2===e){i[0]=t[0]*g,i[1]=t[1]*p,n.set([NaN,NaN,NaN,NaN,i[0],i[1]],0);continue}let[r,a,o,l]=t;r*=g,a*=p,o*=g,l*=p,i.set([r,a,o,l],0),n.set([NaN,NaN,NaN,NaN,r,a],0);for(let s=4;s<e;s+=2){const e=i[s]=t[s]*g,d=i[s+1]=t[s+1]*p;n.set(Sr.createBezierPoints(r,a,o,l,e,d),3*(s-2)),[r,a,o,l]=[o,l,e,d]}}if(0===c.length)return null;const m=a?new Hr:new Nr;return m.build(c,e,i,1,n,a?0:h,r),{outline:m,newCurves:f,areContours:a,thickness:h,width:l,height:d}}static async compressSignature({outlines:t,areContours:e,thickness:i,width:n,height:r}){let s,a=1/0,o=-1/0,l=0;for(const b of t){l+=b.length;for(let t=2,e=b.length;t<e;t++){const e=b[t]-b[t-2];a=Math.min(a,e),o=Math.max(o,e)}}s=a>=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;const d=t.length,h=8+3*d,c=new Uint32Array(h);let u=0;c[u++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*d)*s.BYTES_PER_ELEMENT,c[u++]=0,c[u++]=n,c[u++]=r,c[u++]=e?0:1,c[u++]=Math.max(0,Math.floor(i??0)),c[u++]=d,c[u++]=s.BYTES_PER_ELEMENT;for(const b of t)c[u++]=b.length-2,c[u++]=b[0],c[u++]=b[1];const g=new CompressionStream("deflate-raw"),p=g.writable.getWriter();await p.ready,p.write(c);const f=s.prototype.constructor;for(const b of t){const t=new f(b.length-2);for(let e=2,i=b.length;e<i;e++)t[e-2]=b[e]-b[e-2];p.write(t)}p.close();const m=await new Response(g.readable).arrayBuffer();return ne(new Uint8Array(m))}static async decompressSignature(t){try{const i=(e=t,Uint8Array.fromBase64?Uint8Array.fromBase64(e):Xt(atob(e))),{readable:n,writable:r}=new DecompressionStream("deflate-raw"),s=r.getWriter();await s.ready,s.write(i).then(async()=>{await s.ready,await s.close()}).catch(()=>{});let a=null,o=0;for await(const t of n)a||=new Uint8Array(new Uint32Array(t.buffer,0,4)[0]),a.set(t,o),o+=t.length;const l=new Uint32Array(a.buffer,0,a.length>>2),d=l[1];if(0!==d)throw new Error(`Invalid version: ${d}`);const h=l[2],c=l[3],u=0===l[4],g=l[5],p=l[6],f=l[7],m=[],b=(8+3*p)*Uint32Array.BYTES_PER_ELEMENT;let v;switch(f){case Int8Array.BYTES_PER_ELEMENT:v=new Int8Array(a.buffer,b);break;case Int16Array.BYTES_PER_ELEMENT:v=new Int16Array(a.buffer,b);break;case Int32Array.BYTES_PER_ELEMENT:v=new Int32Array(a.buffer,b)}o=0;for(let t=0;t<p;t++){const e=l[3*t+8],i=new Float32Array(e+2);m.push(i);for(let n=0;n<2;n++)i[n]=l[3*t+8+n+1];for(let t=0;t<e;t++)i[t+2]=i[t]+v[o++]}return{areContours:u,thickness:g,outlines:m,width:h,height:c}}catch(i){return It(`decompressSignature: ${i}`),null}var e}};class jr extends Ir{constructor(){super(),super.updateProperties({fill:Re._defaultLineColor,"stroke-width":0})}clone(){const t=new jr;return t.updateAll(this),t}}class Ur extends Or{constructor(t){super(t),super.updateProperties({stroke:Re._defaultLineColor,"stroke-width":1})}clone(){const t=new Ur(this._viewParameters);return t.updateAll(this),t}}class Wr extends Rr{#ro=!1;#so=null;#ao=null;#oo=null;static _type="signature";static _editorType=dt.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#ao=t.signatureData||null,this.#so=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){Re.initialize(t,e),this._defaultDrawingOptions=new jr,this._defaultDrawnSignatureOptions=new Ur(e.viewParameters)}static getDefaultDrawingOptions(t){const e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return zt(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#so}}static computeTelemetryFinalData(t){const e=t.get("hasDescription");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),null===this._drawId)if(this.#ao){const{lines:t,mustSmooth:e,areContours:i,description:n,uuid:r,heightInPage:s}=this.#ao,{rawDims:{pageWidth:a,pageHeight:o},rotation:l}=this.parent.viewport,d=Vr.processDrawnLines({lines:t,pageWidth:a,pageHeight:o,rotation:l,innerMargin:Wr._INNER_MARGIN,mustSmooth:e,areContours:i});this.addSignature(d,s,n,r)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);return i&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){this.#oo=t,this.addEditToolbar()}getUuid(){return this.#oo}get description(){return this.#so}set description(t){this.#so=t,super.addEditToolbar().then(e=>{e?.updateEditSignatureButton(t)})}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:n,height:r}=this.#ao,s=Math.max(n,r);return{areContours:e,outline:Vr.processDrawnLines({lines:{curves:t.map(t=>({points:t})),thickness:i,width:n,height:r},pageWidth:s,pageHeight:s,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,i,n){const{x:r,y:s}=this,{outline:a}=this.#ao=t;let o;this.#ro=a instanceof Hr,this.description=i,this.div.setAttribute("data-l10n-args",JSON.stringify({description:i})),this.#ro?o=Wr.getDefaultDrawingOptions():(o=Wr._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[l,d]=this.parentDimensions,[,h]=this.pageDimensions;let c=e/h;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(l*this.width,d*this.height),this.x=r,this.y=s,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return Vr.process(t,e,i,n,Wr._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:n},rotation:r}=this.parent.viewport;return Vr.extractContoursFromText(t,e,i,n,r,Wr._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:n}=this.parent.viewport;return Vr.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:n,innerMargin:Wr._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){t?this._drawingOptions=Wr.getDefaultDrawingOptions():(this._drawingOptions=Wr._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":e}))}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:i,rect:n}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":r}}=this,s={annotationType:dt.SIGNATURE,isSignature:!0,areContours:this.#ro,color:[0,0,0],thickness:this.#ro?0:r,pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?(s.paths={lines:e,points:i},s.uuid=this.#oo,s.isCopy=!0):s.lines=e,this.#so&&(s.accessibilityData={type:"Figure",alt:this.#so}),s}static deserializeDraw(t,e,i,n,r,s){return s.areContours?Hr.deserialize(t,e,i,n,r,s):Nr.deserialize(t,e,i,n,r,s)}static async deserialize(t,e,i){const n=await super.deserialize(t,e,i);return n.#ro=t.areContours,n.#so=t.accessibilityData?.alt||"",n.#oo=t.uuid,n}}class $r extends Re{#lo=null;#do=null;#ho=null;#co=null;#uo=null;#go="";#po=null;#fo=!1;#mo=null;#bo=!1;#vo=!1;static _type="stamp";static _editorType=dt.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#co=t.bitmapUrl,this.#uo=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){Re.initialize(t,e)}static isHandlingMimeForPasting(t){return Ce.includes(t)}static paste(t,e){e.pasteEditor({mode:dt.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#wo(t,e=!1){t?(this.#lo=t.bitmap,e||(this.#do=t.id,this.#bo=t.isSvg),t.file&&(this.#go=t.file.name),this.#xo()):this.remove()}#yo(){if(this.#ho=null,this._uiManager.enableWaiting(!1),this.#po)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#lo)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#lo){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!(await i.isEnabledFor("altText")))throw new Error("ML isn't enabled for alt text.");const{data:n,width:r,height:s}=t||this.copyCanvas(null,null,!0).imageData,a=await i.guess({name:"altText",request:{data:n,width:r,height:s,channels:n.length/(r*s)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");const o=a.output;return await this.setGuessedAltText(o),e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#Ao(){if(this.#do)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#do).then(t=>this.#wo(t,!0)).finally(()=>this.#yo());if(this.#co){const t=this.#co;return this.#co=null,this._uiManager.enableWaiting(!0),void(this.#ho=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#wo(t)).finally(()=>this.#yo()))}if(this.#uo){const t=this.#uo;return this.#uo=null,this._uiManager.enableWaiting(!0),void(this.#ho=this._uiManager.imageManager.getFromFile(t).then(t=>this.#wo(t)).finally(()=>this.#yo()))}const t=document.createElement("input");t.type="file",t.accept=Ce.join(",");const e=this._uiManager._signal;this.#ho=new Promise(i=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#wo(e)}else this.remove();i()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:e})}).finally(()=>this.#yo()),t.click()}remove(){this.#do&&(this.#lo=null,this._uiManager.imageManager.deleteId(this.#do),this.#po?.remove(),this.#po=null,this.#mo&&(clearTimeout(this.#mo),this.#mo=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#do&&null===this.#po&&this.#Ao(),this.isAttachedToDOM||this.parent.add(this))):this.#do&&this.#Ao()}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#ho||this.#lo||this.#co||this.#uo||this.#do||this.#fo)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#fo||(this.#lo?this.#xo():this.#Ao()),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){const{id:i,bitmap:n}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(this.#do=i,n&&(this.#lo=n),this.#fo=!1,this.#xo())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(null!==this.#mo&&clearTimeout(this.#mo),this.#mo=setTimeout(()=>{this.#mo=null,this.#Co()},200))}#xo(){const{div:t}=this;let{width:e,height:i}=this.#lo;const[n,r]=this.pageDimensions,s=.75;if(this.width)e=this.width*n,i=this.height*r;else if(e>s*n||i>s*r){const t=Math.min(s*n/e,s*r/i);e*=t,i*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/n,i*o/r),this._uiManager.enableWaiting(!1);const l=this.#po=document.createElement("canvas");l.setAttribute("role","img"),this.addContainer(l),this.width=e/n,this.height=i/r,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1),this.#Co(),this.#vo||(this.parent.addUndoableEditor(this),this.#vo=!0),this._reportTelemetry({action:"inserted_image"}),this.#go&&this.div.setAttribute("aria-description",this.#go),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(t,e,i=!1){t||(t=224);const{width:n,height:r}=this.#lo,s=new Ae;let a=this.#lo,o=n,l=r,d=null;if(e){if(n>e||r>e){const t=Math.min(e/n,e/r);o=Math.floor(n*t),l=Math.floor(r*t)}d=document.createElement("canvas");const t=d.width=Math.ceil(o*s.sx),i=d.height=Math.ceil(l*s.sy);this.#bo||(a=this.#Eo(t,i));const h=d.getContext("2d");h.filter=this._uiManager.hcmFilter;let c="white",u="#cfcfd8";"none"!==this._uiManager.hcmFilter?u="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(c="#8f8f9d",u="#42414d");const g=15,p=g*s.sx,f=g*s.sy,m=new OffscreenCanvas(2*p,2*f),b=m.getContext("2d");b.fillStyle=c,b.fillRect(0,0,2*p,2*f),b.fillStyle=u,b.fillRect(0,0,p,f),b.fillRect(p,f,p,f),h.fillStyle=h.createPattern(m,"repeat"),h.fillRect(0,0,t,i),h.drawImage(a,0,0,a.width,a.height,0,0,t,i)}let h=null;if(i){let e,i;if(s.symmetric&&a.width<t&&a.height<t)e=a.width,i=a.height;else if(a=this.#lo,n>t||r>t){const s=Math.min(t/n,t/r);e=Math.floor(n*s),i=Math.floor(r*s),this.#bo||(a=this.#Eo(e,i))}const o=new OffscreenCanvas(e,i).getContext("2d",{willReadFrequently:!0});o.drawImage(a,0,0,a.width,a.height,0,0,e,i),h={width:e,height:i,data:o.getImageData(0,0,e,i).data}}return{canvas:d,width:o,height:l,imageData:h}}#Eo(t,e){const{width:i,height:n}=this.#lo;let r=i,s=n,a=this.#lo;for(;r>2*t||s>2*e;){const i=r,n=s;r>2*t&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),s>2*e&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));const o=new OffscreenCanvas(r,s);o.getContext("2d").drawImage(a,0,0,i,n,0,0,r,s),a=o.transferToImageBitmap()}return a}#Co(){const[t,e]=this.parentDimensions,{width:i,height:n}=this,r=new Ae,s=Math.ceil(i*t*r.sx),a=Math.ceil(n*e*r.sy),o=this.#po;if(!o||o.width===s&&o.height===a)return;o.width=s,o.height=a;const l=this.#bo?this.#lo:this.#Eo(s,a),d=o.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(l,0,0,l.width,l.height,0,0,s,a)}#So(t){if(t){if(this.#bo){const t=this._uiManager.imageManager.getSvgUrl(this.#do);if(t)return t}const t=document.createElement("canvas");return({width:t.width,height:t.height}=this.#lo),t.getContext("2d").drawImage(this.#lo,0,0),t.toDataURL()}if(this.#bo){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*se.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*se.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(i,n);return r.getContext("2d").drawImage(this.#lo,0,0,this.#lo.width,this.#lo.height,0,0,i,n),r.transferToImageBitmap()}return structuredClone(this.#lo)}static async deserialize(t,e,i){let n=null,r=!1;if(t instanceof yr){const{data:{rect:s,rotation:a,id:o,structParent:l,popupRef:d},container:h,parent:{page:{pageNumber:c}},canvas:u}=t;let g,p;u?(delete t.canvas,({id:g,bitmap:p}=i.imageManager.getFromCanvas(h.id,u)),u.remove()):(r=!0,t._hasNoCanvas=!0);const f=(await e._structTree.getAriaAttributes(`${ee}${o}`))?.get("aria-label")||"";n=t={annotationType:dt.STAMP,bitmapId:g,bitmap:p,pageIndex:c-1,rect:s.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:f},isSvg:!1,structParent:l,popupRef:d}}const s=await super.deserialize(t,e,i),{rect:a,bitmap:o,bitmapUrl:l,bitmapId:d,isSvg:h,accessibilityData:c}=t;r?(i.addMissingCanvas(t.id,s),s.#fo=!0):d&&i.imageManager.isValidId(d)?(s.#do=d,o&&(s.#lo=o)):s.#co=l,s.#bo=h;const[u,g]=s.pageDimensions;return s.width=(a[2]-a[0])/u,s.height=(a[3]-a[1])/g,c&&(s.altTextData=c),s._initialData=n,s.#vo=!!n,s}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i={annotationType:dt.STAMP,bitmapId:this.#do,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#bo,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#So(!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:n,altText:r}=this.serializeAltText(!1);if(!n&&r&&(i.accessibilityData={type:"Figure",alt:r}),this.annotationElementId){const t=this.#Xr(i);if(t.isSame)return null;t.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,null===e)return i;e.stamps||=new Map;const s=this.#bo?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#do)){if(this.#bo){const t=e.stamps.get(this.#do);s>t.area&&(t.area=s,t.serialized.bitmap.close(),t.serialized.bitmap=this.#So(!1))}}else e.stamps.set(this.#do,{area:s,serialized:i}),i.bitmap=this.#So(!1);return i}#Xr(t){const{pageIndex:e,accessibilityData:{altText:i}}=this._initialData,n=t.pageIndex===e,r=(t.accessibilityData?.alt||"")===i;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&n&&r,isSameAltText:r}}renderAnnotationElement(t){return t.updateEdited({rect:this.getRect(0,0)}),null}}let Gr=class t{#ko;#_o=!1;#To=null;#Lo=null;#Do=null;#Po=new Map;#Mo=!1;#Fo=!1;#Io=!1;#Ro=null;#Bo=null;#No=null;#Oo=null;#zo=null;#Ho=-1;#f;static _initialized=!1;static#V=new Map([Er,zr,$r,Fr,Wr].map(t=>[t._editorType,t]));constructor({uiManager:e,pageIndex:i,div:n,structTreeLayer:r,accessibilityManager:s,annotationLayer:a,drawLayer:o,textLayer:l,viewport:d,l10n:h}){const c=[...t.#V.values()];if(!t._initialized){t._initialized=!0;for(const t of c)t.initialize(h,e)}e.registerEditorTypes(c),this.#f=e,this.pageIndex=i,this.div=n,this.#ko=s,this.#To=a,this.viewport=d,this.#No=l,this.drawLayer=o,this._structTree=r,this.#f.addLayer(this)}get isEmpty(){return 0===this.#Po.size}get isInvisible(){return this.isEmpty&&this.#f.getMode()===dt.NONE}updateToolbar(t){this.#f.updateToolbar(t)}updateMode(e=this.#f.getMode()){switch(this.#Vo(),e){case dt.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case dt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case dt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const n of t.#V.values())i.toggle(`${n._type}Editing`,e===n._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#No?.div}setEditingState(t){this.#f.setEditingState(t)}addCommands(t){this.#f.addCommands(t)}cleanUndoStack(t){this.#f.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#To?.div.classList.toggle("disabled",!t)}async enable(){this.#Io=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.#zo?.abort(),this.#zo=null;const t=new Set;for(const i of this.#Po.values())i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#f.removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!this.#To)return void(this.#Io=!1);const e=this.#To.getEditableAnnotations();for(const i of e){if(i.hide(),this.#f.isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=await this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}this.#Io=!1}disable(){if(this.#Fo=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.#No&&!this.#zo){this.#zo=new AbortController;const t=this.#f.combinedSignal(this.#zo);this.#No.div.addEventListener("pointerdown",t=>{const{clientX:e,clientY:i,timeStamp:n}=t;if(n-this.#Ho>500)return void(this.#Ho=n);this.#Ho=-1;const{classList:r}=this.div;r.toggle("getElements",!0);const s=document.elementsFromPoint(e,i);if(r.toggle("getElements",!1),!this.div.contains(s[0]))return;let a;const o=new RegExp(`^${lt}[0-9]+$`);for(const d of s)if(o.test(d.id)){a=d.id;break}if(!a)return;const l=this.#Po.get(a);null===l?.annotationElementId&&(t.stopPropagation(),t.preventDefault(),l.dblclick())},{signal:t,capture:!0})}const e=new Map,i=new Map;for(const t of this.#Po.values())t.disableEditing(),t.annotationElementId&&(null===t.serialize()?(i.set(t.annotationElementId,t),this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()):e.set(t.annotationElementId,t));if(this.#To){const t=this.#To.getEditableAnnotations();for(const n of t){const{id:t}=n.data;if(this.#f.isDeletedAnnotationElement(t))continue;let r=i.get(t);r?(r.resetAnnotationElement(n),r.show(!1),n.show()):(r=e.get(t),r&&(this.#f.addChangedExistingAnnotation(r),r.renderAnnotationElement(n)&&r.show(!1)),n.show())}}this.#Vo(),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const r of t.#V.values())n.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Fo=!1}getEditableAnnotation(t){return this.#To?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#f.getActive()!==t&&this.#f.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#No?.div&&!this.#Oo){this.#Oo=new AbortController;const t=this.#f.combinedSignal(this.#Oo);this.#No.div.addEventListener("pointerdown",this.#jo.bind(this),{signal:t}),this.#No.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#No?.div&&this.#Oo&&(this.#Oo.abort(),this.#Oo=null,this.#No.div.classList.remove("highlighting"))}#jo(t){this.#f.unselectAll();const{target:e}=t;if(e===this.#No.div||("img"===e.getAttribute("role")||e.classList.contains("endOfContent"))&&this.#No.div.contains(e)){const{isMac:e}=Yt.platform;if(0!==t.button||t.ctrlKey&&e)return;this.#f.showAllEditors("highlight",!0,!0),this.#No.div.classList.add("free"),this.toggleDrawing(),Fr.startHighlighting(this,"ltr"===this.#f.direction,{target:this.#No.div,x:t.x,y:t.y}),this.#No.div.addEventListener("pointerup",()=>{this.#No.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#f._signal}),t.preventDefault()}}enableClick(){if(this.#Lo)return;this.#Lo=new AbortController;const t=this.#f.combinedSignal(this.#Lo);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){this.#Lo?.abort(),this.#Lo=null}attach(t){this.#Po.set(t.id,t);const{annotationElementId:e}=t;e&&this.#f.isDeletedAnnotationElement(e)&&this.#f.removeDeletedAnnotationElement(t)}detach(t){this.#Po.delete(t.id),this.#ko?.removePointerInTextLayer(t.contentDiv),!this.#Fo&&t.annotationElementId&&this.#f.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#f.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#f.addDeletedAnnotationElement(t.annotationElementId),Re.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#f.addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#Io),this.#f.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!this.#Do&&(t._focusEventsAllowed=!1,this.#Do=setTimeout(()=>{this.#Do=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#f._signal}),e.focus())},0)),t._structTreeParentId=this.#ko?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#f.getId()}get#Uo(){return t.#V.get(this.#f.getMode())}combinedSignal(t){return this.#f.combinedSignal(t)}#Wo(t){const e=this.#Uo;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#Uo?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await this.#f.updateMode(t.mode);const{offsetX:i,offsetY:n}=this.#$o(),r=this.getNextId(),s=this.#Wo({parent:this,id:r,x:i,y:n,uiManager:this.#f,isCentered:!0,...e});s&&this.add(s)}async deserialize(e){return await(t.#V.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#f))||null}createAndAddNewEditor(t,e,i={}){const n=this.getNextId(),r=this.#Wo({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#f,isCentered:e,...i});return r&&this.add(r),r}#$o(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),r=Math.max(0,t),s=Math.max(0,e),a=(r+Math.min(window.innerWidth,t+i))/2-t,o=(s+Math.min(window.innerHeight,e+n))/2-e,[l,d]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:d}}addNewEditor(t={}){this.createAndAddNewEditor(this.#$o(),!0,t)}setSelected(t){this.#f.setSelected(t)}toggleSelected(t){this.#f.toggleSelected(t)}unselect(t){this.#f.unselect(t)}pointerup(t){const{isMac:e}=Yt.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;if(!this.#Mo)return;if(this.#Mo=!1,this.#Uo?.isDrawer&&this.#Uo.supportMultipleDrawings)return;if(!this.#_o)return void(this.#_o=!0);const i=this.#f.getMode();i!==dt.STAMP&&i!==dt.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#f.unselectAll()}pointerdown(t){if(this.#f.getMode()===dt.HIGHLIGHT&&this.enableTextSelection(),this.#Mo)return void(this.#Mo=!1);const{isMac:e}=Yt.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;if(this.#Mo=!0,this.#Uo?.isDrawer)return void this.startDrawingSession(t);const i=this.#f.getActive();this.#_o=!i||i.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#Ro)return void this.#Uo.startDrawing(this,this.#f,!1,t);this.#f.setCurrentDrawingSession(this),this.#Ro=new AbortController;const e=this.#f.combinedSignal(this.#Ro);this.div.addEventListener("blur",({relatedTarget:t})=>{t&&!this.div.contains(t)&&(this.#Bo=null,this.commitOrRemove())},{signal:e}),this.#Uo.startDrawing(this,this.#f,!1,t)}pause(t){if(t){const{activeElement:t}=document;return void(this.div.contains(t)&&(this.#Bo=t))}this.#Bo&&setTimeout(()=>{this.#Bo?.focus(),this.#Bo=null},0)}endDrawingSession(t=!1){return this.#Ro?(this.#f.setCurrentDrawingSession(null),this.#Ro.abort(),this.#Ro=null,this.#Bo=null,this.#Uo.endDrawing(t)):null}findNewParent(t,e,i){const n=this.#f.findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}commitOrRemove(){return!!this.#Ro&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#Ro&&this.#Uo.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#f.getActive()?.parent===this&&(this.#f.commitOrRemove(),this.#f.setActiveEditor(null)),this.#Do&&(clearTimeout(this.#Do),this.#Do=null);for(const t of this.#Po.values())this.#ko?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Po.clear(),this.#f.removeLayer(this)}#Vo(){for(const t of this.#Po.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,ye(this.div,t);for(const e of this.#f.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){this.#f.commitOrRemove(),this.#Vo();const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,ye(this.div,{rotation:i}),e!==i)for(const n of this.#Po.values())n.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#f.viewParameters.realScale}};globalThis._pdfjsTestingUtils={HighlightOutliner:Tr},globalThis.pdfjsLib={AbortException:Gt,AnnotationEditorLayer:Gr,AnnotationEditorParamsType:ht,AnnotationEditorType:dt,AnnotationEditorUIManager:Me,AnnotationLayer:class t{#ko=null;#Go=null;#qo=new Map;#Xo=null;constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:n,page:r,viewport:s,structTreeLayer:a}){this.div=t,this.#ko=e,this.#Go=i,this.#Xo=a||null,this.page=r,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=n}hasEditableAnnotations(){return this.#qo.size>0}async#Yo(t,e,i){const n=t.firstChild||t,r=n.id=`${ee}${e}`,s=await(this.#Xo?.getAriaAttributes(r));if(s)for(const[a,o]of s)n.setAttribute(a,o);i?i.at(-1).container.after(t):(this.div.append(t),this.#ko?.moveElementInDOM(this.div,t,n,!1))}async render(t){const{annotations:e}=t,i=this.div;ye(i,this.viewport);const n=new Map,r={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new qn,annotationStorage:t.annotationStorage||new je,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const s of e){if(s.noHTML)continue;const t=s.annotationType===vt.POPUP;if(t){const t=n.get(s.id);if(!t)continue;r.elements=t}else if(s.rect[2]===s.rect[0]||s.rect[3]===s.rect[1])continue;r.data=s;const e=Kn.create(r);if(!e.isRenderable)continue;if(!t&&s.popupRef){const t=n.get(s.popupRef);t?t.push(e):n.set(s.popupRef,[e])}const i=e.render();s.hidden&&(i.style.visibility="hidden"),await this.#Yo(i,s.id,r.elements),e._isEditable&&(this.#qo.set(e.data.id,e),this._annotationEditorUIManager?.renderAnnotationElement(e))}this.#Ko()}async addLinkAnnotations(e,i){const n={data:null,layer:this.div,linkService:i,svgFactory:new qn,parent:this};for(const r of e){r.borderStyle||=t._defaultBorderStyle,n.data=r;const e=Kn.create(n);if(!e.isRenderable)continue;const i=e.render();await this.#Yo(i,r.id,null)}}update({viewport:t}){const e=this.div;this.viewport=t,ye(e,{rotation:t.rotation}),this.#Ko(),e.hidden=!1}#Ko(){if(!this.#Go)return;const t=this.div;for(const[e,i]of this.#Go){const n=t.querySelector(`[data-annotation-id="${e}"]`);if(!n)continue;i.className="annotationContent";const{firstChild:r}=n;r?"CANVAS"===r.nodeName?r.replaceWith(i):r.classList.contains("annotationContent")?r.after(i):r.before(i):n.append(i);const s=this.#qo.get(e);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(e,n.id,i),s._hasNoCanvas=!1):s.canvas=i)}this.#Go.clear()}getEditableAnnotations(){return Array.from(this.#qo.values())}getEditableAnnotation(t){return this.#qo.get(t)}static get _defaultBorderStyle(){return zt(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:wt,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},AnnotationMode:ot,AnnotationType:vt,build:"cbeef3233",ColorPicker:Mr,createValidAbsoluteUrl:Nt,DOMSVGFactory:qn,DrawLayer:class t{#fr=null;#Qo=new Map;#Zo=new Map;static#w=0;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(this.#fr){if(this.#fr!==t){if(this.#Qo.size>0)for(const e of this.#Qo.values())e.remove(),t.append(e);this.#fr=t}}else this.#fr=t}static get _svgFactory(){return zt(this,"_svgFactory",new qn)}static#Jo(t,[e,i,n,r]){const{style:s}=t;s.top=100*i+"%",s.left=100*e+"%",s.width=100*n+"%",s.height=100*r+"%"}#tl(){const e=t._svgFactory.create(1,1,!0);return this.#fr.append(e),e.setAttribute("aria-hidden",!0),e}#el(e,i){const n=t._svgFactory.createElement("clipPath");e.append(n);const r=`clip_${i}`;n.setAttribute("id",r),n.setAttribute("clipPathUnits","objectBoundingBox");const s=t._svgFactory.createElement("use");return n.append(s),s.setAttribute("href",`#${i}`),s.classList.add("clip"),r}#il(t,e){for(const[i,n]of Object.entries(e))null===n?t.removeAttribute(i):t.setAttribute(i,n)}draw(e,i=!1,n=!1){const r=t.#w++,s=this.#tl(),a=t._svgFactory.createElement("defs");s.append(a);const o=t._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${r}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),i&&this.#Zo.set(r,o);const d=n?this.#el(a,l):null,h=t._svgFactory.createElement("use");return s.append(h),h.setAttribute("href",`#${l}`),this.updateProperties(s,e),this.#Qo.set(r,s),{id:r,clipPathId:`url(#${d})`}}drawOutline(e,i){const n=t.#w++,r=this.#tl(),s=t._svgFactory.createElement("defs");r.append(s);const a=t._svgFactory.createElement("path");s.append(a);const o=`path_p${this.pageIndex}_${n}`;let l;if(a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke"),i){const e=t._svgFactory.createElement("mask");s.append(e),l=`mask_p${this.pageIndex}_${n}`,e.setAttribute("id",l),e.setAttribute("maskUnits","objectBoundingBox");const i=t._svgFactory.createElement("rect");e.append(i),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("fill","white");const r=t._svgFactory.createElement("use");e.append(r),r.setAttribute("href",`#${o}`),r.setAttribute("stroke","none"),r.setAttribute("fill","black"),r.setAttribute("fill-rule","nonzero"),r.classList.add("mask")}const d=t._svgFactory.createElement("use");r.append(d),d.setAttribute("href",`#${o}`),l&&d.setAttribute("mask",`url(#${l})`);const h=d.cloneNode();return r.append(h),d.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.updateProperties(r,e),this.#Qo.set(n,r),n}finalizeDraw(t,e){this.#Zo.delete(t),this.updateProperties(t,e)}updateProperties(e,i){if(!i)return;const{root:n,bbox:r,rootClass:s,path:a}=i,o="number"==typeof e?this.#Qo.get(e):e;if(o){if(n&&this.#il(o,n),r&&t.#Jo(o,r),s){const{classList:t}=o;for(const[e,i]of Object.entries(s))t.toggle(e,i)}if(a){const t=o.firstChild.firstChild;this.#il(t,a)}}}updateParent(t,e){if(e===this)return;const i=this.#Qo.get(t);i&&(e.#fr.append(i),this.#Qo.delete(t),e.#Qo.set(t,i))}remove(t){this.#Zo.delete(t),null!==this.#fr&&(this.#Qo.get(t).remove(),this.#Qo.delete(t))}destroy(){this.#fr=null;for(const t of this.#Qo.values())t.remove();this.#Qo.clear(),this.#Zo.clear()}},FeatureTest:Yt,fetchData:ae,getDocument:In,getFilenameFromUrl:function(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)},getPdfFilenameFromUrl:ce,getUuid:te,getXfaPageViewport:be,GlobalWorkerOptions:nn,ImageKind:bt,InvalidPDFException:Ut,isDataScheme:de,isPdfFile:he,isValidExplicitDest:Xe,MathClamp:ie,noContextMenu:pe,normalizeUnicode:function(t){return Zt||(Zt=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Jt=new Map([["ſt","ſt"]])),t.replaceAll(Zt,(t,e,i)=>e?e.normalize("NFKC"):Jt.get(i))},OPS:St,OutputScale:Ae,PasswordResponses:{NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PDFDataRangeTransport:Bn,PDFDateString:me,PDFWorker:zn,PermissionFlag:{PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},PixelsPerInch:se,RenderingCancelledException:le,ResponseException:Wt,setLayerDimensions:ye,shadow:zt,SignatureExtractor:Vr,stopEvent:fe,SupportedImageMimeTypes:Ce,TextLayer:Mn,TouchManager:Ie,updateUrlHash:Ot,Util:Qt,VerbosityLevel:Et,version:"5.3.93",XfaLayer:Xn};
|
|
24
|
-
/**
|
|
25
|
-
* @licstart The following is the entire license notice for the
|
|
26
|
-
* JavaScript code in this page
|
|
27
|
-
*
|
|
28
|
-
* Copyright 2024 Mozilla Foundation
|
|
29
|
-
*
|
|
30
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
31
|
-
* you may not use this file except in compliance with the License.
|
|
32
|
-
* You may obtain a copy of the License at
|
|
33
|
-
*
|
|
34
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
35
|
-
*
|
|
36
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
37
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
38
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
39
|
-
* See the License for the specific language governing permissions and
|
|
40
|
-
* limitations under the License.
|
|
41
|
-
*
|
|
42
|
-
* @licend The above is the entire license notice for the
|
|
43
|
-
* JavaScript code in this page
|
|
44
|
-
*/
|
|
45
|
-
const{AbortException:qr,AnnotationEditorLayer:Xr,AnnotationEditorParamsType:Yr,AnnotationEditorType:Kr,AnnotationEditorUIManager:Qr,AnnotationLayer:Zr,AnnotationMode:Jr,AnnotationType:ts,build:es,ColorPicker:is,createValidAbsoluteUrl:ns,DOMSVGFactory:rs,DrawLayer:ss,FeatureTest:as,fetchData:os,getDocument:ls,getFilenameFromUrl:ds,getPdfFilenameFromUrl:hs,getUuid:cs,getXfaPageViewport:us,GlobalWorkerOptions:gs,ImageKind:ps,InvalidPDFException:fs,isDataScheme:ms,isPdfFile:bs,isValidExplicitDest:vs,MathClamp:ws,noContextMenu:xs,normalizeUnicode:ys,OPS:As,OutputScale:Cs,PasswordResponses:Es,PDFDataRangeTransport:Ss,PDFDateString:ks,PDFWorker:_s,PermissionFlag:Ts,PixelsPerInch:Ls,RenderingCancelledException:Ds,ResponseException:Ps,setLayerDimensions:Ms,shadow:Fs,SignatureExtractor:Is,stopEvent:Rs,SupportedImageMimeTypes:Bs,TextLayer:Ns,TouchManager:Os,updateUrlHash:zs,Util:Hs,VerbosityLevel:Vs,version:js,XfaLayer:Us}=globalThis.pdfjsLib,Ws={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},$s=0,Gs=1,qs=2,Xs=3,Ys=0,Ks=1,Qs=2,Zs={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Js={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function ta(t,e,i=!1){let n=t.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let r=t.offsetTop+t.clientTop,s=t.offsetLeft+t.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&(n.classList.contains("markedContent")||"hidden"===getComputedStyle(n).overflow);)if(r+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent,!n)return;if(e&&(void 0!==e.top&&(r+=e.top),void 0!==e.left)){const i=t.getBoundingClientRect().width,r=ws((n.clientWidth-i)/2,20,400);s+=e.left-r,n.scrollLeft=s}n.scrollTop=r}function ea(t){const e=new Map;for(const[i,n]of new URLSearchParams(t))e.set(i.toLowerCase(),n);return e}const ia=/[\x00-\x1F]/g;function na(t,e=!1){return ia.test(t)?e?t.replaceAll(ia,t=>"\0"===t?"":" "):t.replaceAll("\0",""):t}function ra(t,e,i=0){let n=i,r=t.length-1;if(r<0||!e(t[r]))return t.length;if(e(t[n]))return n;for(;n<r;){const i=n+r>>1;e(t[i])?r=i:n=i+1}return n}function sa(t){if(Math.floor(t)===t)return[t,1];const e=1/t;if(e>8)return[1,8];if(Math.floor(e)===e)return[1,e];const i=t>1?e:t;let n,r=0,s=1,a=1,o=1;for(;;){const t=r+a,e=s+o;if(e>8)break;i<=t/e?(a=t,o=e):(r=t,s=e)}return n=i-r/s<a/o-i?i===t?[r,s]:[s,r]:i===t?[a,o]:[o,a],n}function aa(t,e){return t-t%e}function oa(t){return Number.isInteger(t)&&t%90==0}function la(t){return t.width<=t.height}new Promise(function(t){window.requestAnimationFrame(t)});const da=document.documentElement.style,ha=function(){const t=document.createElement("div");return t.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)","calc(1320px)"===t.style.width?Math.fround:t=>t}(),ca=0,ua=1,ga=2,pa=3,fa=4,ma=5,ba=6,va=7;function wa(t){return function(t){return t<11904}(t)?function(t){return!(65408&t)}(t)?function(t){return 32===t||9===t||13===t||10===t}(t)?ca:function(t){return t>=97&&t<=122||t>=65&&t<=90}(t)||function(t){return t>=48&&t<=57}(t)||95===t?ua:ga:function(t){return 3584==(65408&t)}(t)?va:160===t?ca:ua:function(t){return t>=13312&&t<=40959||t>=63744&&t<=64255}(t)?pa:function(t){return t>=12448&&t<=12543}(t)?fa:function(t){return t>=12352&&t<=12447}(t)?ma:function(t){return t>=65376&&t<=65439}(t)?ba:ua}let xa;const ya={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},Aa={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},Ca=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]);let Ea;const Sa=/\p{M}+/gu,ka=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,_a=/([^\p{M}])\p{M}*$/u,Ta=/^\p{M}*([^\p{M}])/u,La=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Da=new Map,Pa=new Map;let Ma=null,Fa=null;function Ia(t,e={}){const i=[];let n;for(;null!==(n=La.exec(t));){let{index:t}=n;for(const e of n[0]){let n=Da.get(e);n||(n=e.normalize("NFD").length,Da.set(e,n)),i.push([n,t++])}}const r=i.length>0,s=e.ignoreDashEOL??!1;let a;if(!r&&Ma)a=Ma;else if(r&&Fa)a=Fa;else{const t=Object.keys(Aa).join(""),e=(xa||=" ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩",xa);a=new RegExp([`[${t}]`,`[${e}]`,"(?:゙|゚)\\n","\\p{M}+(?:-\\n)?","\\p{Ll}-\\n(?=\\p{Ll})|\\p{Lu}-\\n(?=\\p{L})","\\S-\\n","(?:\\p{Ideographic}|[-ヿ])\\n","\\n",r?"[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]":"\\u0000"].map(t=>`(${t})`).join("|"),"gum"),r?Fa=a:Ma=a}const o=[];for(;null!==(n=Sa.exec(t));)o.push([n[0].length,n.index]);let l=t.normalize("NFD");const d=[0,0];let h=0,c=0,u=0,g=0,p=0,f=!1;l=l.replace(a,(t,e,n,r,a,l,m,b,v,w,x)=>{if(x-=g,e){const t=Aa[e],i=t.length;for(let e=1;e<i;e++)d.push(x-u+e,u-e);return u-=i-1,t}if(n){let t=Pa.get(n);t||(t=n.normalize("NFKC"),Pa.set(n,t));const e=t.length;for(let i=1;i<e;i++)d.push(x-u+i,u-i);return u-=e-1,t}if(r)return f=!0,x+p===o[h]?.[1]?++h:(d.push(x-1-u+1,u-1),u-=1,g+=1),d.push(x-u+1,u),g+=1,p+=1,r.charAt(0);if(a){const t=a.endsWith("\n"),e=t?a.length-2:a.length;f=!0;let i=e;x+p===o[h]?.[1]&&(i-=o[h][0],++h);for(let n=1;n<=i;n++)d.push(x-1-u+n,u-n);return u-=i,g+=i,t?(x+=e-1,d.push(x-u+1,1+u),u+=1,g+=1,p+=1,a.slice(0,e)):a}if(l){if(s)return g+=1,p+=1,l.slice(0,-1);const t=l.length-2;return d.push(x-u+t,1+u),u+=1,g+=1,p+=1,l.slice(0,-2)}if(m)return g+=1,p+=1,m.slice(0,-1);if(b){const t=b.length-1;return d.push(x-u+t,u),g+=1,p+=1,b.slice(0,-1)}if(v)return d.push(x-u+1,u-1),u-=1,g+=1,p+=1," ";if(x+p===i[c]?.[1]){const t=i[c][0]-1;++c;for(let e=1;e<=t;e++)d.push(x-(u-e),u-e);u-=t,g+=t}return w}),d.push(l.length,u);const m=new Uint32Array(d.length>>1),b=new Int32Array(d.length>>1);for(let v=0,w=d.length;v<w;v+=2)m[v>>1]=d[v],b[v>>1]=d[v+1];return[l,[m,b],f]}function Ra(t,e,i){if(!t)return[e,i];const[n,r]=t,s=e,a=e+i-1;let o=ra(n,t=>t>=s);n[o]>s&&--o;let l=ra(n,t=>t>=a,o);n[l]>a&&--l;const d=s+r[o];return[d,a+r[l]+1-d]}class Ba{#nl=null;#rl=!0;#sl=0;constructor({linkService:t,eventBus:e,updateMatchesCountOnProgress:i=!0}){this._linkService=t,this._eventBus=e,this.#rl=i,this.onIsPageVisible=null,this.#al(),e._on("find",this.#ol.bind(this)),e._on("findbarclose",this.#ll.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#nl}setDocument(t){this._pdfDocument&&this.#al(),t&&(this._pdfDocument=t,this._firstPageCapability.resolve())}#ol(t){if(!t)return;const e=this._pdfDocument,{type:i}=t;(null===this.#nl||this.#dl(t))&&(this._dirtyMatch=!0),this.#nl=t,"highlightallchange"!==i&&this.#hl(ya.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||e&&this._pdfDocument!==e)return;this.#Ur();const t=!this._highlightMatches,n=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?this.#cl():"again"===i?(this.#cl(),t&&this.#nl.highlightAll&&this.#ul()):"highlightallchange"===i?(n?this.#cl():this._highlightMatches=!0,this.#ul()):this.#cl():this._findTimeout=setTimeout(()=>{this.#cl(),this._findTimeout=null},250)})}scrollMatchIntoView({element:t=null,selectedLeft:e=0,pageIndex:i=-1,matchIndex:n=-1}){this._scrollMatches&&t&&-1!==n&&n===this._selected.matchIdx&&-1!==i&&i===this._selected.pageIdx&&(this._scrollMatches=!1,ta(t,{top:-50,left:e},!0))}#al(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#sl=0,this.#nl=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()}get#gl(){const{query:t}=this.#nl;return"string"==typeof t?(t!==this._rawQuery&&(this._rawQuery=t,[this._normalizedQuery]=Ia(t)),this._normalizedQuery):(t||[]).filter(t=>!!t).map(t=>Ia(t)[0])}#dl(t){const e=t.query,i=this.#nl.query,n=typeof e;if(n!==typeof i)return!0;if("string"===n){if(e!==i)return!0}else if(JSON.stringify(e)!==JSON.stringify(i))return!0;switch(t.type){case"again":const t=this._selected.pageIdx+1,e=this._linkService;return t>=1&&t<=e.pagesCount&&t!==e.page&&!(this.onIsPageVisible?.(t)??1);case"highlightallchange":return!1}return!0}#pl(t,e,i){let n=t.slice(0,e).match(_a);if(n){const i=t.charCodeAt(e),r=n[1].charCodeAt(0);if(wa(i)===wa(r))return!1}if(n=t.slice(e+i).match(Ta),n){const r=t.charCodeAt(e+i-1),s=n[1].charCodeAt(0);if(wa(r)===wa(s))return!1}return!0}#fl(t,e){const{matchDiacritics:i}=this.#nl;let n=!1;const r="[ ]*";return(t=t.replaceAll(ka,(t,r,s,a,o,l)=>r?`[ ]*\\${r}[ ]*`:s?`[ ]*${s}[ ]*`:a?"[ ]+":i?o||l:o?Ca.has(o.charCodeAt(0))?o:"":e?(n=!0,`${l}\\p{M}*`):l)).endsWith(r)&&(t=t.slice(0,t.length-4)),i&&e&&(Ea||=String.fromCharCode(...Ca),n=!0,t=`${t}(?=[${Ea}]|[^\\p{M}]|$)`),[n,t]}#ml(t){if(!this.#nl)return;const e=this.#gl;if(0===e.length)return;const i=this._pageContents[t],n=this.match(e,i,t),r=this._pageMatches[t]=[],s=this._pageMatchesLength[t]=[],a=this._pageDiffs[t];n?.forEach(({index:t,length:e})=>{const[i,n]=Ra(a,t,e);n&&(r.push(i),s.push(n))}),this.#nl.highlightAll&&this.#bl(t),this._resumePageIdx===t&&(this._resumePageIdx=null,this.#vl());const o=r.length;this._matchesCountTotal+=o,this.#rl?o>0&&this.#wl():++this.#sl===this._linkService.pagesCount&&this.#wl()}match(t,e,i){const n=this._hasDiacritics[i];let r=!1;if("string"==typeof t?[r,t]=this.#fl(t,n):t=t.sort().reverse().map(t=>{const[e,i]=this.#fl(t,n);return r||=e,`(${i})`}).join("|"),!t)return;const{caseSensitive:s,entireWord:a}=this.#nl;t=new RegExp(t,`g${r?"u":""}${s?"":"i"}`);const o=[];let l;for(;null!==(l=t.exec(e));)a&&!this.#pl(e,l.index,l[0].length)||o.push({index:l.index,length:l[0].length});return o}#Ur(){if(this._extractTextPromises.length>0)return;let t=Promise.resolve();const e={disableNormalization:!0},i=this._pdfDocument;for(let n=0,r=this._linkService.pagesCount;n<r;n++){const{promise:r,resolve:s}=Promise.withResolvers();this._extractTextPromises[n]=r,t=t.then(async()=>{i===this._pdfDocument?await i.getPage(n+1).then(t=>t.getTextContent(e)).then(t=>{const e=[];for(const i of t.items)e.push(i.str),i.hasEOL&&e.push("\n");[this._pageContents[n],this._pageDiffs[n],this._hasDiacritics[n]]=Ia(e.join("")),s()},t=>{console.error(`Unable to get text content for page ${n+1}`,t),this._pageContents[n]="",this._pageDiffs[n]=null,this._hasDiacritics[n]=!1,s()}):s()})}}#bl(t){this._scrollMatches&&this._selected.pageIdx===t&&(this._linkService.page=t+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})}#ul(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}#cl(){const t=this.#nl.findPrevious,e=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=e,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#sl=0,this._matchesCountTotal=0,this.#ul();for(let t=0;t<i;t++)this._pendingFindMatches.has(t)||(this._pendingFindMatches.add(t),this._extractTextPromises[t].then(()=>{this._pendingFindMatches.delete(t),this.#ml(t)}))}if(0===this.#gl.length)return void this.#hl(ya.FOUND);if(this._resumePageIdx)return;const n=this._offset;if(this._pagesToSearch=i,null!==n.matchIdx){const e=this._pageMatches[n.pageIdx].length;if(!t&&n.matchIdx+1<e||t&&n.matchIdx>0)return n.matchIdx=t?n.matchIdx-1:n.matchIdx+1,void this.#xl(!0);this.#yl(t)}this.#vl()}#Al(t){const e=this._offset,i=t.length,n=this.#nl.findPrevious;return i?(e.matchIdx=n?i-1:0,this.#xl(!0),!0):(this.#yl(n),!!(e.wrapped&&(e.matchIdx=null,this._pagesToSearch<0))&&(this.#xl(!1),!0))}#vl(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let t=null;do{const e=this._offset.pageIdx;if(t=this._pageMatches[e],!t){this._resumePageIdx=e;break}}while(!this.#Al(t))}#yl(t){const e=this._offset,i=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1,e.matchIdx=null,this._pagesToSearch--,(e.pageIdx>=i||e.pageIdx<0)&&(e.pageIdx=t?i-1:0,e.wrapped=!0)}#xl(t=!1){let e=ya.NOT_FOUND;const i=this._offset.wrapped;if(this._offset.wrapped=!1,t){const t=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,e=i?ya.WRAPPED:ya.FOUND,-1!==t&&t!==this._selected.pageIdx&&this.#bl(t)}this.#hl(e,this.#nl.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this.#bl(this._selected.pageIdx))}#ll(t){const e=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||e&&this._pdfDocument!==e||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#hl(ya.FOUND),this._highlightMatches=!1,this.#ul())})}#Cl(){const{pageIdx:t,matchIdx:e}=this._selected;let i=0,n=this._matchesCountTotal;if(-1!==e){for(let e=0;e<t;e++)i+=this._pageMatches[e]?.length||0;i+=e+1}return(i<1||i>n)&&(i=n=0),{current:i,total:n}}#wl(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this.#Cl()})}#hl(t,e=!1){(this.#rl||this.#sl===this._linkService.pagesCount&&t!==ya.PENDING)&&this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,entireWord:this.#nl?.entireWord??null,matchesCount:this.#Cl(),rawQuery:this.#nl?.query??null})}}const Na={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};class Oa{externalLinkEnabled=!0;constructor({eventBus:t,externalLinkTarget:e=null,externalLinkRel:i=null,ignoreDestinationZoom:n=!1}={}){this.eventBus=t,this.externalLinkTarget=e,this.externalLinkRel=i,this._ignoreDestinationZoom=n,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(t,e=null){this.baseUrl=e,this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setHistory(t){this.pdfHistory=t}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(t){this.pdfDocument&&(this.pdfViewer.currentPageNumber=t)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(t){this.pdfDocument&&(this.pdfViewer.pagesRotation=t)}get isInPresentationMode(){return!!this.pdfDocument&&this.pdfViewer.isInPresentationMode}async goToDestination(t){if(!this.pdfDocument)return;let e,i,n;if("string"==typeof t?(e=t,i=await this.pdfDocument.getDestination(t)):(e=null,i=await t),!Array.isArray(i))return void console.error(`goToDestination: "${i}" is not a valid destination array, for dest="${t}".`);const[r]=i;if(r&&"object"==typeof r){if(n=this.pdfDocument.cachedPageNumber(r),!n)try{n=await this.pdfDocument.getPageIndex(r)+1}catch{return void console.error(`goToDestination: "${r}" is not a valid page reference, for dest="${t}".`)}}else Number.isInteger(r)&&(n=r+1);!n||n<1||n>this.pagesCount?console.error(`goToDestination: "${n}" is not a valid page number, for dest="${t}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:e,explicitDest:i,pageNumber:n})),this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom}))}goToPage(t){if(!this.pdfDocument)return;const e="string"==typeof t&&this.pdfViewer.pageLabelToPageNumber(t)||0|t;Number.isInteger(e)&&e>0&&e<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(e)),this.pdfViewer.scrollPageIntoView({pageNumber:e})):console.error(`PDFLinkService.goToPage: "${t}" is not a valid page.`)}addLinkAttributes(t,e,i=!1){if(!e||"string"!=typeof e)throw new Error('A valid "url" parameter must provided.');const n=i?Na.BLANK:this.externalLinkTarget,r=this.externalLinkRel;this.externalLinkEnabled?t.href=t.title=e:(t.href="",t.title=`Disabled: ${e}`,t.onclick=()=>!1);let s="";switch(n){case Na.NONE:break;case Na.SELF:s="_self";break;case Na.BLANK:s="_blank";break;case Na.PARENT:s="_parent";break;case Na.TOP:s="_top"}t.target=s,t.rel="string"==typeof r?r:"noopener noreferrer nofollow"}getDestinationHash(t){if("string"==typeof t){if(t.length>0)return this.getAnchorUrl("#"+escape(t))}else if(Array.isArray(t)){const e=JSON.stringify(t);if(e.length>0)return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}getAnchorUrl(t){return this.baseUrl?this.baseUrl+t:t}setHash(t){if(!this.pdfDocument)return;let e,i;if(t.includes("=")){const n=ea(t);if(n.has("search")){const t=n.get("search").replaceAll('"',""),e="true"===n.get("phrase");this.eventBus.dispatch("findfromurlhash",{source:this,query:e?t:t.match(/\S+/g)})}if(n.has("page")&&(e=0|n.get("page")||1),n.has("zoom")){const t=n.get("zoom").split(","),e=t[0],r=parseFloat(e);e.includes("Fit")?"Fit"===e||"FitB"===e?i=[null,{name:e}]:"FitH"===e||"FitBH"===e||"FitV"===e||"FitBV"===e?i=[null,{name:e},t.length>1?0|t[1]:null]:"FitR"===e?5!==t.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:e},0|t[1],0|t[2],0|t[3],0|t[4]]:console.error(`PDFLinkService.setHash: "${e}" is not a valid zoom value.`):i=[null,{name:"XYZ"},t.length>1?0|t[1]:null,t.length>2?0|t[2]:null,r?r/100:e]}return i?this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:i,allowNegativeOffset:!0}):e&&(this.page=e),n.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:n.get("pagemode")}),void(n.has("nameddest")&&this.goToDestination(n.get("nameddest")))}i=unescape(t);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}"string"==typeof i||vs(i)?this.goToDestination(i):console.error(`PDFLinkService.setHash: "${unescape(t)}" is not a valid destination.`)}executeNamedAction(t){if(this.pdfDocument){switch(t){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:t})}}async executeSetOCGState(t){if(!this.pdfDocument)return;const e=this.pdfDocument,i=await this.pdfViewer.optionalContentConfigPromise;e===this.pdfDocument&&(i.setOCGState(t),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i))}}class za extends Oa{setDocument(t,e=null){}}class Ha{#El=null;#Sl=!1;#kl=null;#_l=null;#Tl=!1;constructor({pdfPage:t,linkService:e,downloadManager:i,annotationStorage:n=null,imageResourcesPath:r="",renderForms:s=!0,enableScripting:a=!1,hasJSActionsPromise:o=null,fieldObjectsPromise:l=null,annotationCanvasMap:d=null,accessibilityManager:h=null,annotationEditorUIManager:c=null,onAppend:u=null}){this.pdfPage=t,this.linkService=e,this.downloadManager=i,this.imageResourcesPath=r,this.renderForms=s,this.annotationStorage=n,this.enableScripting=a,this._hasJSActionsPromise=o||Promise.resolve(!1),this._fieldObjectsPromise=l||Promise.resolve(null),this._annotationCanvasMap=d,this._accessibilityManager=h,this._annotationEditorUIManager=c,this.#kl=u,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=e.eventBus}async render({viewport:t,intent:e="display",structTreeLayer:i=null}){if(this.div){if(this._cancelled||!this.annotationLayer)return;return void this.annotationLayer.update({viewport:t.clone({dontFlip:!0})})}const[n,r,s]=await Promise.all([this.pdfPage.getAnnotations({intent:e}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;const a=this.div=document.createElement("div");if(a.className="annotationLayer",this.#kl?.(a),0===n.length)return this.#El=n,void this.hide(!0);this.#Ll(t,i),await this.annotationLayer.render({annotations:n,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:r,fieldObjects:s}),this.#El=n,this.linkService.isInPresentationMode&&this.#Dl(Xs),this.#_l||(this.#_l=new AbortController,this._eventBus?._on("presentationmodechanged",t=>{this.#Dl(t.state)},{signal:this.#_l.signal}))}#Ll(t,e){this.annotationLayer=new Zr({div:this.div,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:t.clone({dontFlip:!0}),structTreeLayer:e})}cancel(){this._cancelled=!0,this.#_l?.abort(),this.#_l=null}hide(t=!1){this.#Sl=!t,this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}async injectLinkAnnotations({inferredLinks:t,viewport:e,structTreeLayer:i=null}){if(null===this.#El)throw new Error("`render` method must be called before `injectLinkAnnotations`.");if(this._cancelled||this.#Tl)return;this.#Tl=!0;const n=this.#El.length?this.#Pl(t):t;n.length&&(this.annotationLayer||(this.#Ll(e,i),Ms(this.div,e)),await this.annotationLayer.addLinkAnnotations(n,this.linkService),this.#Sl||(this.div.hidden=!1))}#Dl(t){if(!this.div)return;let e=!1;switch(t){case Xs:e=!0;break;case Gs:break;default:return}for(const i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=e)}#Pl(t){function e(t){if(!t.quadPoints)return[t.rect];const e=[];for(let i=2,n=t.quadPoints.length;i<n;i+=8){const n=t.quadPoints[i],r=t.quadPoints[i+1],s=t.quadPoints[i+2],a=t.quadPoints[i+3];e.push([s,a,n,r])}return e}function i(t,i){const n=[],r=e(t),s=e(i);for(const e of r)for(const t of s){const i=Hs.intersect(e,t);i&&n.push(i)}return n}function n(t){let e=0;for(const i of t)e+=Math.abs((i[2]-i[0])*(i[3]-i[1]));return e}return t.filter(t=>{let r;for(const s of this.#El){if(s.annotationType!==ts.LINK||!s.url)continue;const a=i(s,t);if(0!==a.length&&(r??=n(e(t)),n(a)/r>.5))return!1}return!0})}}function Va(t,e){const i=document.createElement("a");if(!i.click)throw new Error('DownloadManager: "a.click()" is not supported.');i.href=t,i.target="_parent","download"in i&&(i.download=e),(document.body||document.documentElement).append(i),i.click(),i.remove()}class ja{#Ml=new WeakMap;downloadData(t,e,i){Va(URL.createObjectURL(new Blob([t],{type:i})),e)}openOrDownloadData(t,e,i=null){const n=bs(e)?"application/pdf":"";return this.downloadData(t,e,n),!1}download(t,e,i){let n;if(t)n=URL.createObjectURL(new Blob([t],{type:"application/pdf"}));else{if(!ns(e,"http://example.com"))return void console.error(`download - not a valid URL: ${e}`);n=e+"#pdfjs.action=download"}Va(n,i)}}const Ua="event",Wa="timeout";class $a{#oi=Object.create(null);on(t,e,i=null){this._on(t,e,{external:!0,once:i?.once,signal:i?.signal})}off(t,e,i=null){this._off(t,e)}dispatch(t,e){const i=this.#oi[t];if(!i||0===i.length)return;let n;for(const{listener:r,external:s,once:a}of i.slice(0))a&&this._off(t,r),s?(n||=[]).push(r):r(e);if(n){for(const t of n)t(e);n=null}}_on(t,e,i=null){let n=null;if(i?.signal instanceof AbortSignal){const{signal:r}=i;if(r.aborted)return void console.error("Cannot use an `aborted` signal.");const s=()=>this._off(t,e);n=()=>r.removeEventListener("abort",s),r.addEventListener("abort",s)}(this.#oi[t]||=[]).push({listener:e,external:!0===i?.external,once:!0===i?.once,rmAbort:n})}_off(t,e,i=null){const n=this.#oi[t];if(n)for(let r=0,s=n.length;r<s;r++){const t=n[r];if(t.listener===e)return t.rmAbort?.(),void n.splice(r,1)}}}class Ga{constructor(t){this.value=t}valueOf(){return this.value}}class qa extends Ga{constructor(t="???"){super(t)}toString(t){return`{${this.value}}`}}class Xa extends Ga{constructor(t,e={}){super(t),this.opts=e}toString(t){if(t)try{return t.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return this.value.toString(10)}}class Ya extends Ga{static supportsValue(t){if("number"==typeof t)return!0;if(t instanceof Date)return!0;if(t instanceof Ga)return Ya.supportsValue(t.valueOf());if("Temporal"in globalThis){const e=globalThis.Temporal;if(t instanceof e.Instant||t instanceof e.PlainDateTime||t instanceof e.PlainDate||t instanceof e.PlainMonthDay||t instanceof e.PlainTime||t instanceof e.PlainYearMonth)return!0}return!1}constructor(t,e={}){t instanceof Ya?(e={...t.opts,...e},t=t.value):t instanceof Ga&&(t=t.valueOf()),"object"==typeof t&&"calendarId"in t&&void 0===e.calendar&&(e={...e,calendar:t.calendarId}),super(t),this.opts=e}[Symbol.toPrimitive](t){return"string"===t?this.toString():this.toNumber()}toNumber(){const t=this.value;if("number"==typeof t)return t;if(t instanceof Date)return t.getTime();if("epochMilliseconds"in t)return t.epochMilliseconds;if("toZonedDateTime"in t)return t.toZonedDateTime("UTC").epochMilliseconds;throw new TypeError("Unwrapping a non-number value as a number")}toString(t){if(t)try{return t.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(e){t.reportError(e)}return"number"==typeof this.value||this.value instanceof Date?new Date(this.value).toISOString():this.value.toString()}}function Ka(t,e,i){return i===e||(i instanceof Xa&&e instanceof Xa&&i.value===e.value||e instanceof Xa&&"string"==typeof i&&i===t.memoizeIntlObject(Intl.PluralRules,e.opts).select(e.value))}function Qa(t,e,i){return e[i]?eo(t,e[i].value):(t.reportError(new RangeError("No default")),new qa)}function Za(t,e){const i=[],n=Object.create(null);for(const r of e)"narg"===r.type?n[r.name]=Ja(t,r.value):i.push(Ja(t,r));return{positional:i,named:n}}function Ja(t,e){switch(e.type){case"str":return e.value;case"num":return new Xa(e.value,{minimumFractionDigits:e.precision});case"var":return function(t,{name:e}){let i;if(t.params){if(!Object.prototype.hasOwnProperty.call(t.params,e))return new qa(`$${e}`);i=t.params[e]}else{if(!t.args||!Object.prototype.hasOwnProperty.call(t.args,e))return t.reportError(new ReferenceError(`Unknown variable: $${e}`)),new qa(`$${e}`);i=t.args[e]}if(i instanceof Ga)return i;switch(typeof i){case"string":return i;case"number":return new Xa(i);case"object":if(Ya.supportsValue(i))return new Ya(i);default:return t.reportError(new TypeError(`Variable type not supported: $${e}, ${typeof i}`)),new qa(`$${e}`)}}(t,e);case"mesg":return function(t,{name:e,attr:i}){const n=t.bundle._messages.get(e);if(!n)return t.reportError(new ReferenceError(`Unknown message: ${e}`)),new qa(e);if(i){const r=n.attributes[i];return r?eo(t,r):(t.reportError(new ReferenceError(`Unknown attribute: ${i}`)),new qa(`${e}.${i}`))}return n.value?eo(t,n.value):(t.reportError(new ReferenceError(`No value: ${e}`)),new qa(e))}(t,e);case"term":return function(t,{name:e,attr:i,args:n}){const r=`-${e}`,s=t.bundle._terms.get(r);if(!s)return t.reportError(new ReferenceError(`Unknown term: ${r}`)),new qa(r);if(i){const e=s.attributes[i];if(e){t.params=Za(t,n).named;const i=eo(t,e);return t.params=null,i}return t.reportError(new ReferenceError(`Unknown attribute: ${i}`)),new qa(`${r}.${i}`)}t.params=Za(t,n).named;const a=eo(t,s.value);return t.params=null,a}(t,e);case"func":return function(t,{name:e,args:i}){let n=t.bundle._functions[e];if(!n)return t.reportError(new ReferenceError(`Unknown function: ${e}()`)),new qa(`${e}()`);if("function"!=typeof n)return t.reportError(new TypeError(`Function ${e}() is not callable`)),new qa(`${e}()`);try{let e=Za(t,i);return n(e.positional,e.named)}catch(r){return t.reportError(r),new qa(`${e}()`)}}(t,e);case"select":return function(t,{selector:e,variants:i,star:n}){let r=Ja(t,e);if(r instanceof qa)return Qa(t,i,n);for(const s of i)if(Ka(t,r,Ja(t,s.key)))return eo(t,s.value);return Qa(t,i,n)}(t,e);default:return new qa}}function to(t,e){if(t.dirty.has(e))return t.reportError(new RangeError("Cyclic reference")),new qa;t.dirty.add(e);const i=[],n=t.bundle._useIsolating&&e.length>1;for(const r of e)if("string"!=typeof r){if(t.placeables++,t.placeables>100)throw t.dirty.delete(e),new RangeError(`Too many placeables expanded: ${t.placeables}, max allowed is 100`);n&&i.push(""),i.push(Ja(t,r).toString(t)),n&&i.push("")}else i.push(t.bundle._transform(r));return t.dirty.delete(e),i.join("")}function eo(t,e){return"string"==typeof e?t.bundle._transform(e):to(t,e)}class io{constructor(t,e,i){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=t,this.errors=e,this.args=i}reportError(t){if(!(this.errors&&t instanceof Error))throw t;this.errors.push(t)}memoizeIntlObject(t,e){let i=this.bundle._intls.get(t);i||(i={},this.bundle._intls.set(t,i));let n=JSON.stringify(e);return i[n]||(i[n]=new t(this.bundle.locales,e)),i[n]}}function no(t,e){const i=Object.create(null);for(const[n,r]of Object.entries(t))e.includes(n)&&(i[n]=r.valueOf());return i}const ro=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function so(t,e){let i=t[0];if(i instanceof qa)return new qa(`NUMBER(${i.valueOf()})`);if(i instanceof Xa)return new Xa(i.valueOf(),{...i.opts,...no(e,ro)});if(i instanceof Ya)return new Xa(i.toNumber(),{...no(e,ro)});throw new TypeError("Invalid argument to NUMBER")}const ao=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function oo(t,e){let i=t[0];if(i instanceof qa)return new qa(`DATETIME(${i.valueOf()})`);if(i instanceof Ya||i instanceof Xa)return new Ya(i,no(e,ao));throw new TypeError("Invalid argument to DATETIME")}const lo=new Map;class ho{constructor(t,{functions:e,useIsolating:i=!0,transform:n=t=>t}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(t)?t:[t],this._functions={NUMBER:so,DATETIME:oo,...e},this._useIsolating=i,this._transform=n,this._intls=function(t){const e=Array.isArray(t)?t.join(" "):t;let i=lo.get(e);return void 0===i&&(i=new Map,lo.set(e,i)),i}(t)}hasMessage(t){return this._messages.has(t)}getMessage(t){return this._messages.get(t)}addResource(t,{allowOverrides:e=!1}={}){const i=[];for(let n=0;n<t.body.length;n++){let r=t.body[n];if(r.id.startsWith("-")){if(!1===e&&this._terms.has(r.id)){i.push(new Error(`Attempt to override an existing term: "${r.id}"`));continue}this._terms.set(r.id,r)}else{if(!1===e&&this._messages.has(r.id)){i.push(new Error(`Attempt to override an existing message: "${r.id}"`));continue}this._messages.set(r.id,r)}}return i}formatPattern(t,e=null,i=null){if("string"==typeof t)return this._transform(t);let n=new io(this,i,e);try{return to(n,t).toString(n)}catch(r){if(n.errors&&r instanceof Error)return n.errors.push(r),(new qa).toString(n);throw r}}}const co=/^(-?[a-zA-Z][\w-]*) *= */gm,uo=/\.([a-zA-Z][\w-]*) *= */y,go=/\*?\[/y,po=/(-?[0-9]+(?:\.([0-9]+))?)/y,fo=/([a-zA-Z][\w-]*)/y,mo=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,bo=/^[A-Z][A-Z0-9_-]*$/,vo=/([^{}\n\r]+)/y,wo=/([^\\"\n\r]*)/y,xo=/\\([\\"])/y,yo=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,Ao=/^\n+/,Co=/ +$/,Eo=/ *\r?\n/g,So=/( *)$/,ko=/{\s*/y,_o=/\s*}/y,To=/\[\s*/y,Lo=/\s*] */y,Do=/\s*\(\s*/y,Po=/\s*->\s*/y,Mo=/\s*:\s*/y,Fo=/\s*,?\s*/y,Io=/\s+/y;class Ro{constructor(t){this.body=[],co.lastIndex=0;let e=0;for(;;){let i=co.exec(t);if(null===i)break;e=co.lastIndex;try{this.body.push(o(i[1]))}catch(x){if(x instanceof SyntaxError)continue;throw x}}function i(i){return i.lastIndex=e,i.test(t)}function n(i,n){if(t[e]===i)return e++,!0;if(n)throw new n(`Expected ${i}`);return!1}function r(t,n){if(i(t))return e=t.lastIndex,!0;if(n)throw new n(`Expected ${t.toString()}`);return!1}function s(i){i.lastIndex=e;let n=i.exec(t);if(null===n)throw new SyntaxError(`Expected ${i.toString()}`);return e=i.lastIndex,n}function a(t){return s(t)[1]}function o(t){let e=l(),n=function(){let t=Object.create(null);for(;i(uo);){let e=a(uo),i=l();if(null===i)throw new SyntaxError("Expected attribute value");t[e]=i}return t}();if(null===e&&0===Object.keys(n).length)throw new SyntaxError("Expected message value or attributes");return{id:t,value:e,attributes:n}}function l(){let n;if(i(vo)&&(n=a(vo)),"{"===t[e]||"}"===t[e])return d(n?[n]:[],1/0);let r=b();return r?n?d([n,r],r.length):(r.value=v(r.value,Ao),d([r],r.length)):n?v(n,Co):null}function d(n=[],r){for(;;){if(i(vo)){n.push(a(vo));continue}if("{"===t[e]){n.push(h());continue}if("}"===t[e])throw new SyntaxError("Unbalanced closing brace");let s=b();if(!s)break;n.push(s),r=Math.min(r,s.length)}let s=n.length-1,o=n[s];"string"==typeof o&&(n[s]=v(o,Co));let l=[];for(let t of n)t instanceof Bo&&(t=t.value.slice(0,t.value.length-r)),t&&l.push(t);return l}function h(){r(ko,SyntaxError);let t=c();if(r(_o))return t;if(r(Po)){let e=function(){let t,e=[],r=0;for(;i(go);){n("*")&&(t=r);let i=g(),s=l();if(null===s)throw new SyntaxError("Expected variant value");e[r++]={key:i,value:s}}if(0===r)return null;if(void 0===t)throw new SyntaxError("Expected default variant");return{variants:e,star:t}}();return r(_o,SyntaxError),{type:"select",selector:t,...e}}throw new SyntaxError("Unclosed placeable")}function c(){if("{"===t[e])return h();if(i(mo)){let[,i,n,a=null]=s(mo);if("$"===i)return{type:"var",name:n};if(r(Do)){let s=function(){let i=[];for(;;){switch(t[e]){case")":return e++,i;case void 0:throw new SyntaxError("Unclosed argument list")}i.push(u()),r(Fo)}}();if("-"===i)return{type:"term",name:n,attr:a,args:s};if(bo.test(n))return{type:"func",name:n,args:s};throw new SyntaxError("Function names must be all upper-case")}return"-"===i?{type:"term",name:n,attr:a,args:[]}:{type:"mesg",name:n,attr:a}}return p()}function u(){let t=c();return"mesg"!==t.type?t:r(Mo)?{type:"narg",name:t.name,value:p()}:t}function g(){let t;return r(To,SyntaxError),t=i(po)?f():{type:"str",value:a(fo)},r(Lo,SyntaxError),t}function p(){if(i(po))return f();if('"'===t[e])return function(){n('"',SyntaxError);let i="";for(;;){if(i+=a(wo),"\\"!==t[e]){if(n('"'))return{type:"str",value:i};throw new SyntaxError("Unclosed string literal")}i+=m()}}();throw new SyntaxError("Invalid expression")}function f(){let[,t,e=""]=s(po),i=e.length;return{type:"num",value:parseFloat(t),precision:i}}function m(){if(i(xo))return a(xo);if(i(yo)){let[,t,e]=s(yo),i=parseInt(t||e,16);return i<=55295||57344<=i?String.fromCodePoint(i):"�"}throw new SyntaxError("Unknown escape sequence")}function b(){let i=e;switch(r(Io),t[e]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return w(t.slice(i,e))}return" "===t[e-1]&&w(t.slice(i,e))}function v(t,e){return t.replace(e,"")}function w(t){let e=t.replace(Eo,"\n"),i=So.exec(t)[1].length;return new Bo(e,i)}}}class Bo{constructor(t,e){this.value=t,this.length=e}}const No=/<|&#?\w+;/,Oo={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},zo={"http://www.w3.org/1999/xhtml":{global:["title","aria-description","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function Ho(t,e){const{value:i}=e;if("string"==typeof i)if("title"===t.localName&&"http://www.w3.org/1999/xhtml"===t.namespaceURI)t.textContent=i;else if(No.test(i)){const e=t.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");e.innerHTML=i,function(t,e){for(const i of t.childNodes)if(i.nodeType!==i.TEXT_NODE){if(i.hasAttribute("data-l10n-name")){const n=Uo(e,i);t.replaceChild(n,i);continue}if(Go(i)){const e=Wo(i);t.replaceChild(e,i);continue}console.warn(`An element of forbidden type "${i.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),t.replaceChild($o(i),i)}e.textContent="",e.appendChild(t)}(e.content,t)}else t.textContent=i;jo(e,t)}function Vo(t,e){if(!t)return!1;for(let i of t)if(i.name===e)return!0;return!1}function jo(t,e){const i=e.hasAttribute("data-l10n-attrs")?e.getAttribute("data-l10n-attrs").split(",").map(t=>t.trim()):null;for(const n of Array.from(e.attributes))qo(n.name,e,i)&&!Vo(t.attributes,n.name)&&e.removeAttribute(n.name);if(t.attributes)for(const n of Array.from(t.attributes))qo(n.name,e,i)&&e.getAttribute(n.name)!==n.value&&e.setAttribute(n.name,n.value)}function Uo(t,e){const i=e.getAttribute("data-l10n-name"),n=t.querySelector(`[data-l10n-name="${i}"]`);return n?n.localName!==e.localName?(console.warn(`An element named "${i}" was found in the translation but its type ${e.localName} didn't match the element found in the source (${n.localName}).`),$o(e)):(t.removeChild(n),Xo(e,n.cloneNode(!1))):(console.warn(`An element named "${i}" wasn't found in the source.`),$o(e))}function Wo(t){const e=t.ownerDocument.createElement(t.localName);return Xo(t,e)}function $o(t){return t.ownerDocument.createTextNode(t.textContent)}function Go(t){const e=Oo[t.namespaceURI];return e&&e.includes(t.localName)}function qo(t,e,i=null){if(i&&i.includes(t))return!0;const n=zo[e.namespaceURI];if(!n)return!1;const r=t.toLowerCase(),s=e.localName;if(n.global.includes(r))return!0;if(!n[s])return!1;if(n[s].includes(r))return!0;if("http://www.w3.org/1999/xhtml"===e.namespaceURI&&"input"===s&&"value"===r){const t=e.type.toLowerCase();if("submit"===t||"button"===t||"reset"===t)return!0}return!1}function Xo(t,e){return e.textContent=t.textContent,jo(t,e),e}class Yo extends Array{static from(t){return t instanceof this?t:new this(t)}}class Ko extends Yo{constructor(t){if(super(),Symbol.asyncIterator in Object(t))this.iterator=t[Symbol.asyncIterator]();else{if(!(Symbol.iterator in Object(t)))throw new TypeError("Argument must implement the iteration protocol.");this.iterator=t[Symbol.iterator]()}}[Symbol.asyncIterator](){const t=this;let e=0;return{next:async()=>(t.length<=e&&t.push(t.iterator.next()),t[e++])}}async touchNext(t=1){let e=0;for(;e++<t;){const t=this[this.length-1];if(t&&(await t).done)break;this.push(this.iterator.next())}return this[this.length-1]}}class Qo{constructor(t=[],e){this.resourceIds=t,this.generateBundles=e,this.onChange(!0)}addResourceIds(t,e=!1){return this.resourceIds.push(...t),this.onChange(e),this.resourceIds.length}removeResourceIds(t){return this.resourceIds=this.resourceIds.filter(e=>!t.includes(e)),this.onChange(),this.resourceIds.length}async formatWithFallback(t,e){const i=[];let n=!1;for await(const r of this.bundles){n=!0;const s=tl(e,r,t,i);if(0===s.size)break;if("undefined"!=typeof console){const t=r.locales[0],e=Array.from(s).join(", ");console.warn(`[fluent] Missing translations in ${t}: ${e}`)}}return n||"undefined"==typeof console||console.warn(`[fluent] Request for keys failed because no resource bundles got generated.\n keys: ${JSON.stringify(t)}.\n resourceIds: ${JSON.stringify(this.resourceIds)}.`),i}formatMessages(t){return this.formatWithFallback(t,Jo)}formatValues(t){return this.formatWithFallback(t,Zo)}async formatValue(t,e){const[i]=await this.formatValues([{id:t,args:e}]);return i}handleEvent(){this.onChange()}onChange(t=!1){this.bundles=Ko.from(this.generateBundles(this.resourceIds)),t&&this.bundles.touchNext(2)}}function Zo(t,e,i,n){return i.value?t.formatPattern(i.value,n,e):null}function Jo(t,e,i,n){const r={value:null,attributes:null};i.value&&(r.value=t.formatPattern(i.value,n,e));let s=Object.keys(i.attributes);if(s.length>0){r.attributes=new Array(s.length);for(let[a,o]of s.entries()){let s=t.formatPattern(i.attributes[o],n,e);r.attributes[a]={name:o,value:s}}}return r}function tl(t,e,i,n){const r=[],s=new Set;return i.forEach(({id:i,args:a},o)=>{if(void 0!==n[o])return;let l=e.getMessage(i);if(l){if(r.length=0,n[o]=t(e,r,l,a),r.length>0&&"undefined"!=typeof console){const t=e.locales[0],n=r.join(", ");console.warn(`[fluent][resolver] errors in ${t}/${i}: ${n}.`)}}else s.add(i)}),s}const el="data-l10n-id",il="data-l10n-args",nl=`[${el}]`;class rl extends Qo{constructor(t,e){super(t,e),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[el,il]}}onChange(t=!1){super.onChange(t),this.roots&&this.translateRoots()}setAttributes(t,e,i){return t.setAttribute(el,e),i?t.setAttribute(il,JSON.stringify(i)):t.removeAttribute(il),t}getAttributes(t){return{id:t.getAttribute(el),args:JSON.parse(t.getAttribute(il)||null)}}connectRoot(t){for(const e of this.roots)if(e===t||e.contains(t)||t.contains(e))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==t.ownerDocument.defaultView)throw new Error("Cannot connect a root:\n DOMLocalization already has a root from a different window.")}else this.windowElement=t.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(t=>this.translateMutations(t));this.roots.add(t),this.mutationObserver.observe(t,this.observerConfig)}disconnectRoot(t){return this.roots.delete(t),this.pauseObserving(),0===this.roots.size?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){const t=Array.from(this.roots);return Promise.all(t.map(t=>this.translateFragment(t)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(const t of this.roots)this.mutationObserver.observe(t,this.observerConfig)}translateMutations(t){for(const e of t)switch(e.type){case"attributes":e.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(e.target);break;case"childList":for(const t of e.addedNodes)if(t.nodeType===t.ELEMENT_NODE)if(t.childElementCount)for(const e of this.getTranslatables(t))this.pendingElements.add(e);else t.hasAttribute(el)&&this.pendingElements.add(t)}this.pendingElements.size>0&&null===this.pendingrAF&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(t){return this.translateElements(this.getTranslatables(t))}async translateElements(t){if(!t.length)return;const e=t.map(this.getKeysForElement),i=await this.formatMessages(e);return this.applyTranslations(t,i)}applyTranslations(t,e){this.pauseObserving();for(let i=0;i<t.length;i++)void 0!==e[i]&&Ho(t[i],e[i]);this.resumeObserving()}getTranslatables(t){const e=Array.from(t.querySelectorAll(nl));return"function"==typeof t.hasAttribute&&t.hasAttribute(el)&&e.push(t),e}getKeysForElement(t){return{id:t.getAttribute(el),args:JSON.parse(t.getAttribute(il)||null)}}}class sl{#Fl;#pr;#Ji;#Il;constructor({lang:t,isRTL:e},i=null){this.#Ji=sl.#Rl(t),this.#Il=i,this.#Fl=e??sl.#Bl(this.#Ji)?"rtl":"ltr"}_setL10n(t){this.#Il=t}getLanguage(){return this.#Ji}getDirection(){return this.#Fl}async get(t,e=null,i){if(Array.isArray(t))return t=t.map(t=>({id:t})),(await this.#Il.formatMessages(t)).map(t=>t.value);const n=await this.#Il.formatMessages([{id:t,args:e}]);return n[0]?.value||i}async translate(t){(this.#pr||=new Set).add(t);try{this.#Il.connectRoot(t),await this.#Il.translateRoots()}catch{}}async translateOnce(t){try{await this.#Il.translateElements([t])}catch(e){console.error("translateOnce:",e)}}async destroy(){if(this.#pr){for(const t of this.#pr)this.#Il.disconnectRoot(t);this.#pr.clear(),this.#pr=null}this.#Il.pauseObserving()}pause(){this.#Il.pauseObserving()}resume(){this.#Il.resumeObserving()}static#Rl(t){return{en:"en-us",es:"es-es",fy:"fy-nl",ga:"ga-ie",gu:"gu-in",hi:"hi-in",hy:"hy-am",nb:"nb-no",ne:"ne-np",nn:"nn-no",pa:"pa-in",pt:"pt-pt",sv:"sv-se",zh:"zh-cn"}[t=t?.toLowerCase()||"en-us"]||t}static#Bl(t){const e=t.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(e)}}function al(){const{isAndroid:t,isLinux:e,isMac:i,isWindows:n}=as.platform;return e?"linux":n?"windows":i?"macos":t?"android":"other"}function ol(t,e){const i=new Ro(e),n=new ho(t,{functions:{PLATFORM:al}}),r=n.addResource(i);return r.length&&console.error("L10n errors",r),n}class ll extends sl{constructor(t){super({lang:t});const e=t?ll.#Nl.bind(ll,"en-us",this.getLanguage()):ll.#Ol.bind(ll,this.getLanguage());this._setL10n(new rl([],e))}static async*#Nl(t,e){const{baseURL:i,paths:n}=await this.#zl(),r=[e];if(t!==e){const i=e.split("-",1)[0];i!==e&&r.push(i),r.push(t)}const s=r.map(t=>[t,this.#Hl(t,i,n)]);for(const[a,o]of s){const t=await o;t?yield t:"en-us"===a&&(yield this.#Vl(a))}}static async#Hl(t,e,i){const n=i[t];if(!n)return null;const r=new URL(n,e);return ol(t,await os(r,"text"))}static async#zl(){try{const{href:t}=document.querySelector('link[type="application/l10n"]'),e=await os(t,"json");return{baseURL:t.substring(0,t.lastIndexOf("/")+1)||"./",paths:e}}catch{}return{baseURL:"./",paths:Object.create(null)}}static async*#Ol(t){yield this.#Vl(t)}static async#Vl(t){return ol(t,'pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties…\npdfjs-document-properties-button-label = Document Properties…\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)\npdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing…\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document…\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-signature-button =\n .title = Add signature\npdfjs-editor-signature-button-label = Add signature\npdfjs-editor-highlight-editor =\n .aria-label = Highlight editor\npdfjs-editor-ink-editor =\n .aria-label = Drawing editor\npdfjs-editor-signature-editor1 =\n .aria-description = Signature editor: { $description }\npdfjs-editor-stamp-editor =\n .aria-label = Image editor\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-remove-signature-button =\n .title = Remove signature\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-editor-add-signature-container =\n .aria-label = Signature controls and saved signatures\npdfjs-editor-signature-add-signature-button =\n .title = Add new signature\npdfjs-editor-signature-add-signature-button-label = Add new signature\npdfjs-editor-add-saved-signature-button =\n .title = Saved signature: { $description }\npdfjs-free-text2 =\n .aria-label = Text Editor\n .default-content = Start typing…\npdfjs-editor-alt-text-button =\n .aria-label = Alt text\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button =\n .aria-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, “A young man sits down at a table to eat a meal”\npdfjs-editor-resizer-top-left =\n .aria-label = Top left corner — resize\npdfjs-editor-resizer-top-middle =\n .aria-label = Top middle — resize\npdfjs-editor-resizer-top-right =\n .aria-label = Top right corner — resize\npdfjs-editor-resizer-middle-right =\n .aria-label = Middle right — resize\npdfjs-editor-resizer-bottom-right =\n .aria-label = Bottom right corner — resize\npdfjs-editor-resizer-bottom-middle =\n .aria-label = Bottom middle — resize\npdfjs-editor-resizer-bottom-left =\n .aria-label = Bottom left corner — resize\npdfjs-editor-resizer-middle-left =\n .aria-label = Middle left — resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all\npdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)\npdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)\npdfjs-editor-new-alt-text-textarea =\n .placeholder = Write your description here…\npdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load.\npdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.\npdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more\npdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically\npdfjs-editor-new-alt-text-not-now-button = Not now\npdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically\npdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.\npdfjs-editor-new-alt-text-error-close-button = Close\npdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\n .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\npdfjs-editor-new-alt-text-added-button =\n .aria-label = Alt text added\npdfjs-editor-new-alt-text-added-button-label = Alt text added\npdfjs-editor-new-alt-text-missing-button =\n .aria-label = Missing alt text\npdfjs-editor-new-alt-text-missing-button-label = Missing alt text\npdfjs-editor-new-alt-text-to-review-button =\n .aria-label = Review alt text\npdfjs-editor-new-alt-text-to-review-button-label = Review alt text\npdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }\npdfjs-image-alt-text-settings-button =\n .title = Image alt text settings\npdfjs-image-alt-text-settings-button-label = Image alt text settings\npdfjs-editor-alt-text-settings-dialog-label = Image alt text settings\npdfjs-editor-alt-text-settings-automatic-title = Automatic alt text\npdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically\npdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load.\npdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)\npdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.\npdfjs-editor-alt-text-settings-delete-model-button = Delete\npdfjs-editor-alt-text-settings-download-model-button = Download\npdfjs-editor-alt-text-settings-downloading-model-button = Downloading…\npdfjs-editor-alt-text-settings-editor-title = Alt text editor\npdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image\npdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.\npdfjs-editor-alt-text-settings-close-button = Close\npdfjs-editor-highlight-added-alert = Highlight added\npdfjs-editor-freetext-added-alert = Text added\npdfjs-editor-ink-added-alert = Drawing added\npdfjs-editor-stamp-added-alert = Image added\npdfjs-editor-signature-added-alert = Signature added\npdfjs-editor-undo-bar-message-highlight = Highlight removed\npdfjs-editor-undo-bar-message-freetext = Text removed\npdfjs-editor-undo-bar-message-ink = Drawing removed\npdfjs-editor-undo-bar-message-stamp = Image removed\npdfjs-editor-undo-bar-message-signature = Signature removed\npdfjs-editor-undo-bar-message-multiple =\n { $count ->\n [one] { $count } annotation removed\n *[other] { $count } annotations removed\n }\npdfjs-editor-undo-bar-undo-button =\n .title = Undo\npdfjs-editor-undo-bar-undo-button-label = Undo\npdfjs-editor-undo-bar-close-button =\n .title = Close\npdfjs-editor-undo-bar-close-button-label = Close\npdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.\npdfjs-editor-add-signature-dialog-title = Add a signature\npdfjs-editor-add-signature-type-button = Type\n .title = Type\npdfjs-editor-add-signature-draw-button = Draw\n .title = Draw\npdfjs-editor-add-signature-image-button = Image\n .title = Image\npdfjs-editor-add-signature-type-input =\n .aria-label = Type your signature\n .placeholder = Type your signature\npdfjs-editor-add-signature-draw-placeholder = Draw your signature\npdfjs-editor-add-signature-draw-thickness-range-label = Thickness\npdfjs-editor-add-signature-draw-thickness-range =\n .title = Drawing thickness: { $thickness }\npdfjs-editor-add-signature-image-placeholder = Drag a file here to upload\npdfjs-editor-add-signature-image-browse-link =\n { PLATFORM() ->\n [macos] Or choose image files\n *[other] Or browse image files\n }\npdfjs-editor-add-signature-description-label = Description (alt text)\npdfjs-editor-add-signature-description-input =\n .title = Description (alt text)\npdfjs-editor-add-signature-description-default-when-drawing = Signature\npdfjs-editor-add-signature-clear-button-label = Clear signature\npdfjs-editor-add-signature-clear-button =\n .title = Clear signature\npdfjs-editor-add-signature-save-checkbox = Save signature\npdfjs-editor-add-signature-save-warning-message = You’ve reached the limit of 5 saved signatures. Remove one to save more.\npdfjs-editor-add-signature-image-upload-error-title = Couldn’t upload image\npdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.\npdfjs-editor-add-signature-error-close-button = Close\npdfjs-editor-add-signature-cancel-button = Cancel\npdfjs-editor-add-signature-add-button = Add\npdfjs-editor-delete-signature-button1 =\n .title = Remove saved signature\npdfjs-editor-delete-signature-button-label1 = Remove saved signature\npdfjs-editor-add-signature-edit-button-label = Edit description\npdfjs-editor-edit-signature-dialog-title = Edit description\npdfjs-editor-edit-signature-update-button = Update')}}function dl(){return document.location.hash}class hl{#To=null;#jl=null;#kl=null;#Xo=null;#No=null;#f;constructor(t){this.pdfPage=t.pdfPage,this.accessibilityManager=t.accessibilityManager,this.l10n=t.l10n,this.l10n||=new ll,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,this.#f=t.uiManager,this.#To=t.annotationLayer||null,this.#No=t.textLayer||null,this.#jl=t.drawLayer||null,this.#kl=t.onAppend||null,this.#Xo=t.structTreeLayer||null}async render({viewport:t,intent:e="display"}){if("display"!==e)return;if(this._cancelled)return;const i=t.clone({dontFlip:!0});if(this.div)return this.annotationEditorLayer.update({viewport:i}),void this.show();const n=this.div=document.createElement("div");n.className="annotationEditorLayer",n.hidden=!0,n.dir=this.#f.direction,this.#kl?.(n),this.annotationEditorLayer=new Xr({uiManager:this.#f,div:n,structTreeLayer:this.#Xo,accessibilityManager:this.accessibilityManager,pageIndex:this.pdfPage.pageNumber-1,l10n:this.l10n,viewport:i,annotationLayer:this.#To,textLayer:this.#No,drawLayer:this.#jl});const r={viewport:i,div:n,annotations:null,intent:e};this.annotationEditorLayer.render(r),this.show()}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.annotationEditorLayer.pause(!0),this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isInvisible&&(this.div.hidden=!1,this.annotationEditorLayer.pause(!1))}}{var cl=new Map;const{maxTouchPoints:t,platform:e,userAgent:i}=navigator,n=/Android/.test(i);(/\b(iPad|iPhone|iPod)(?=;)/.test(i)||"MacIntel"===e&&t>1||n)&&cl.set("maxCanvasPixels",5242880),n&&cl.set("useSystemFonts",!1)}const ul=1,gl=2,pl=4,fl=8,ml=16,bl=128,vl={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},wl={allowedGlobalEvents:{value:null,kind:ul},canvasMaxAreaInBytes:{value:-1,kind:ul+pl},isInAutomation:{value:!1,kind:ul},localeProperties:{value:{lang:navigator.language||"en-US"},kind:ul},maxCanvasDim:{value:32767,kind:ul+gl},nimbusDataStr:{value:"",kind:ul},supportsCaretBrowsingMode:{value:!1,kind:ul},supportsDocumentFonts:{value:!0,kind:ul},supportsIntegratedFind:{value:!1,kind:ul},supportsMouseWheelZoomCtrlKey:{value:!0,kind:ul},supportsMouseWheelZoomMetaKey:{value:!0,kind:ul},supportsPinchToZoom:{value:!0,kind:ul},supportsPrinting:{value:!0,kind:ul},toolbarDensity:{value:0,kind:ul+ml},altTextLearnMoreUrl:{value:"",kind:gl+bl},annotationEditorMode:{value:0,kind:gl+bl},annotationMode:{value:2,kind:gl+bl},capCanvasAreaFactor:{value:200,kind:gl+bl},cursorToolOnLoad:{value:0,kind:gl+bl},debuggerSrc:{value:"./debugger.mjs",kind:gl},defaultZoomDelay:{value:400,kind:gl+bl},defaultZoomValue:{value:"",kind:gl+bl},disableHistory:{value:!1,kind:gl},disablePageLabels:{value:!1,kind:gl+bl},enableAltText:{value:!1,kind:gl+bl},enableAltTextModelDownload:{value:!0,kind:gl+bl+ml},enableAutoLinking:{value:!0,kind:gl+bl},enableDetailCanvas:{value:!0,kind:gl},enableGuessAltText:{value:!0,kind:gl+bl+ml},enableHighlightFloatingButton:{value:!1,kind:gl+bl},enableNewAltTextWhenAddingImage:{value:!0,kind:gl+bl},enablePermissions:{value:!1,kind:gl+bl},enablePrintAutoRotate:{value:!0,kind:gl+bl},enableScripting:{value:!0,kind:gl+bl},enableSignatureEditor:{value:!1,kind:gl+bl},enableUpdatedAddImage:{value:!1,kind:gl+bl},externalLinkRel:{value:"noopener noreferrer nofollow",kind:gl},externalLinkTarget:{value:0,kind:gl+bl},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:gl+bl},historyUpdateUrl:{value:!1,kind:gl+bl},ignoreDestinationZoom:{value:!1,kind:gl+bl},imageResourcesPath:{value:"./images/",kind:gl},maxCanvasPixels:{value:2**25,kind:gl},minDurationToUpdateCanvas:{value:500,kind:gl},forcePageColors:{value:!1,kind:gl+bl},pageColorsBackground:{value:"Canvas",kind:gl+bl},pageColorsForeground:{value:"CanvasText",kind:gl+bl},pdfBugEnabled:{value:!1,kind:gl+bl},printResolution:{value:150,kind:gl},sidebarViewOnLoad:{value:-1,kind:gl+bl},scrollModeOnLoad:{value:-1,kind:gl+bl},spreadModeOnLoad:{value:-1,kind:gl+bl},textLayerMode:{value:1,kind:gl+bl},viewerCssTheme:{value:0,kind:gl+bl},viewOnLoad:{value:0,kind:gl+bl},cMapPacked:{value:!0,kind:pl},cMapUrl:{value:"../web/cmaps/",kind:pl},disableAutoFetch:{value:!1,kind:pl+bl},disableFontFace:{value:!1,kind:pl+bl},disableRange:{value:!1,kind:pl+bl},disableStream:{value:!1,kind:pl+bl},docBaseUrl:{value:"",kind:pl},enableHWA:{value:!0,kind:pl+gl+bl},enableXfa:{value:!0,kind:pl+bl},fontExtraProperties:{value:!1,kind:pl},iccUrl:{value:"../web/iccs/",kind:pl},isEvalSupported:{value:!0,kind:pl},isOffscreenCanvasSupported:{value:!0,kind:pl},maxImageSize:{value:-1,kind:pl},pdfBug:{value:!1,kind:pl},standardFontDataUrl:{value:"../web/standard_fonts/",kind:pl},useSystemFonts:{value:void 0,kind:pl,type:vl.BOOLEAN+vl.UNDEFINED},verbosity:{value:1,kind:pl},wasmUrl:{value:"../web/wasm/",kind:pl},workerPort:{value:null,kind:fl},workerSrc:{value:"../build/pdf.worker.mjs",kind:fl}};wl.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:gl},wl.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:gl},wl.enableFakeMLManager={value:!0,kind:gl},wl.disablePreferences={value:!1,kind:gl};class xl{static eventBus;static#Ul=new Map;static{for(const t in wl)this.#Ul.set(t,wl[t].value);for(const[t,e]of cl)this.#Ul.set(t,e);this._hasInvokedSet=!1,this._checkDisablePreferences=()=>!!this.get("disablePreferences")||(this._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)}static get(t){return this.#Ul.get(t)}static getAll(t=null,e=!1){const i=Object.create(null);for(const n in wl){const r=wl[n];(!t||t&r.kind)&&(i[n]=e?r.value:this.#Ul.get(n))}return i}static set(t,e){this.setAll({[t]:e})}static setAll(t,e=!1){let i;this._hasInvokedSet||=!0;for(const n in t){const r=wl[n],s=t[n];if(!r||!(typeof s==typeof r.value||vl[(typeof s).toUpperCase()]&r.type))continue;const{kind:a}=r;(!e||a&ul||a&bl)&&(this.eventBus&&a&ml&&(i||=new Map).set(n,s),this.#Ul.set(n,s))}if(i)for(const[n,r]of i)this.eventBus.dispatch(n.toLowerCase(),{source:this,value:r})}}function yl({width:t,height:e,left:i,top:n},r){if(0===t||0===e)return null;const s=r.textLayer.div.getBoundingClientRect(),a=r.getPagePoint(i-s.left,n-s.top),o=r.getPagePoint(i-s.left+t,n-s.top+e);return Hs.normalizeRect([a[0],a[1],o[0],o[1]])}function Al(t,e){const i=t.getClientRects();if(1===i.length)return{rect:yl(i[0],e)};const n=[1/0,1/0,-1/0,-1/0],r=[];let s=0;for(const a of i){const t=yl(a,e);null!==t&&(r[s]=r[s+4]=t[0],r[s+1]=r[s+3]=t[3],r[s+2]=r[s+6]=t[2],r[s+5]=r[s+7]=t[1],Hs.rectBoundingBox(...t,n),s+=8)}return{quadPoints:r,rect:n}}function Cl(t,e){let i=t;do{if(i.nodeType===Node.TEXT_NODE){const t=i.textContent.length;if(e<=t)return[i,e];e-=t}else if(i.firstChild){i=i.firstChild;continue}for(;!i.nextSibling&&i!==t;)i=i.parentNode;i!==t&&(i=i.nextSibling)}while(i!==t);throw new Error("Offset is bigger than container's contents length.")}class El{static#Wl=0;static#i;static findLinks(t){this.#i??=/\b(?:https?:\/\/|mailto:|www\.)(?:[\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}]|\/|[\0-\x08\x0E-\x1F!-Z\\\^-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uFEFE\uFF00-\u{10FFFF}]+[\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}])+|\b[\0-\x08\x0E-\x1F!-'\*-;=\?A-Z\\\^-z\|~-\x9F\xA1-\u0F39\u0F3E-\u167F\u1681-\u169A\u169D-\u1FFF\u200B-\u2019\u201B-\u201D\u201F-\u2027\u202A-\u202E\u2030-\u2044\u2047-\u205E\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2E21\u2E2A-\u2E41\u2E43-\u2E54\u2E5D-\u2FFF\u3001-\u3007\u3012\u3013\u301C\u3020-\uFD3D\uFD40-\uFE16\uFE19-\uFE34\uFE45\uFE46\uFE49-\uFE58\uFE5F-\uFEFE\uFF00-\uFF07\uFF0A-\uFF3A\uFF3C\uFF3E-\uFF5A\uFF5C\uFF5E\uFF61\uFF64-\u{10FFFF}]+@([\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}]+(?:\.[\0-\x08\x0E-\x1F\$\+0-9=A-Z\^`-z\|~-\x9F\xA2-\xA6\xA8-\xAA\xAC-\xB5\xB8-\xBA\xBC-\xBE\xC0-\u037D\u037F-\u0386\u0388-\u0559\u0560-\u0588\u058B-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0608\u060B\u060E-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06FF\u070E-\u07F6\u07FA-\u082F\u083F-\u085D\u085F-\u0963\u0966-\u096F\u0971-\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF1-\u0C76\u0C78-\u0C83\u0C85-\u0DF3\u0DF5-\u0E4E\u0E50-\u0E59\u0E5C-\u0F03\u0F13\u0F15-\u0F39\u0F3E-\u0F84\u0F86-\u0FCF\u0FD5-\u0FD8\u0FDB-\u1049\u1050-\u10FA\u10FC-\u135F\u1369-\u13FF\u1401-\u166D\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DB-\u17FF\u180B-\u1943\u1946-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B61-\u1B7C\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FFF\u200B-\u200F\u202A-\u202E\u2044\u2052\u2060-\u207C\u207F-\u208C\u208F-\u2307\u230C-\u2328\u232B-\u2767\u2776-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E50\u2E51\u2E5E-\u2FFF\u3004-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303C\u303E-\u309F\u30A1-\u30FA\u30FC-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAADD\uAAE0-\uAAEF\uAAF2-\uABEA\uABEC-\uFD3D\uFD40-\uFE0F\uFE1A-\uFE2F\uFE53\uFE62\uFE64-\uFE67\uFE69\uFE6C-\uFEFE\uFF00\uFF04\uFF0B\uFF10-\uFF19\uFF1C-\uFF1E\uFF21-\uFF3A\uFF3E\uFF40-\uFF5A\uFF5C\uFF5E\uFF66-\u{100FF}\u{10103}-\u{1039E}\u{103A0}-\u{103CF}\u{103D1}-\u{1056E}\u{10570}-\u{10856}\u{10858}-\u{1091E}\u{10920}-\u{1093E}\u{10940}-\u{10A4F}\u{10A59}-\u{10A7E}\u{10A80}-\u{10AEF}\u{10AF7}-\u{10B38}\u{10B40}-\u{10B98}\u{10B9D}-\u{10D6D}\u{10D6F}-\u{10EAC}\u{10EAE}-\u{10F54}\u{10F5A}-\u{10F85}\u{10F8A}-\u{11046}\u{1104E}-\u{110BA}\u{110BD}\u{110C2}-\u{1113F}\u{11144}-\u{11173}\u{11176}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}-\u{111DA}\u{111DC}\u{111E0}-\u{11237}\u{1123E}-\u{112A8}\u{112AA}-\u{113D3}\u{113D6}\u{113D9}-\u{1144A}\u{11450}-\u{11459}\u{1145C}\u{1145E}-\u{114C5}\u{114C7}-\u{115C0}\u{115D8}-\u{11640}\u{11644}-\u{1165F}\u{1166D}-\u{116B8}\u{116BA}-\u{1173B}\u{1173F}-\u{1183A}\u{1183C}-\u{11943}\u{11947}-\u{119E1}\u{119E3}-\u{11A3E}\u{11A47}-\u{11A99}\u{11A9D}\u{11AA3}-\u{11AFF}\u{11B0A}-\u{11BE0}\u{11BE2}-\u{11C40}\u{11C46}-\u{11C6F}\u{11C72}-\u{11EF6}\u{11EF9}-\u{11F42}\u{11F50}-\u{11FFE}\u{12000}-\u{1246F}\u{12475}-\u{12FF0}\u{12FF3}-\u{16A6D}\u{16A70}-\u{16AF4}\u{16AF6}-\u{16B36}\u{16B3C}-\u{16B43}\u{16B45}-\u{16D6C}\u{16D70}-\u{16E96}\u{16E9B}-\u{16FE1}\u{16FE3}-\u{1BC9E}\u{1BCA0}-\u{1DA86}\u{1DA8C}-\u{1E5FE}\u{1E600}-\u{1E95D}\u{1E960}-\u{10FFFF}]+)+)/gmu;const[e,i]=Ia(t,{ignoreDashEOL:!0}),n=e.matchAll(this.#i),r=[];for(const s of n){const[t,e]=s;let n;if(t.startsWith("www.")||t.startsWith("http://")||t.startsWith("https://"))n=t;else{if(!URL.canParse(`http://${e}`))continue;n=t.startsWith("mailto:")?t:`mailto:${t}`}const a=ns(n,null,{addDefaultProtocol:!0});if(a){const[e,n]=Ra(i,s.index,t.length);r.push({url:a.href,index:e,length:n})}}return r}static processLinks(t){return this.findLinks(t._textHighlighter.textContentItemsStr.join("\n")).map(e=>function({url:t,index:e,length:i},n,r){const s=n._textHighlighter,[{begin:a,end:o}]=s._convertMatches([e],[i]),l=new Range;return l.setStart(...Cl(s.textDivs[a.divIdx],a.offset)),l.setEnd(...Cl(s.textDivs[o.divIdx],o.offset)),{id:`inferred_link_${r}`,unsafeUrl:t,url:t,annotationType:ts.LINK,rotation:0,...Al(l,n),borderStyle:null}}(e,t,this.#Wl++))}}class Sl{#pi=!1;#$l=null;#Gl=0;#ql=null;#Xl=Ws.INITIAL;#Yl=null;#Kl=0;#Ql=null;canvas=null;div=null;eventBus=null;id=null;pageColors=null;renderingQueue=null;renderTask=null;resume=null;constructor(t){this.#pi=#pi in t?t.#pi:t.enableHWA||!1,this.eventBus=t.eventBus,this.id=t.id,this.pageColors=t.pageColors||null,this.renderingQueue=t.renderingQueue,this.#Gl=t.minDurationToUpdateCanvas??500}get renderingState(){return this.#Xl}set renderingState(t){if(t!==this.#Xl)switch(this.#Xl=t,this.#$l&&(clearTimeout(this.#$l),this.#$l=null),t){case Ws.PAUSED:this.div.classList.remove("loading"),this.#Kl=0,this.#Yl?.(!1);break;case Ws.RUNNING:this.div.classList.add("loadingIcon"),this.#$l=setTimeout(()=>{this.div.classList.add("loading"),this.#$l=null},0),this.#Kl=Date.now();break;case Ws.INITIAL:case Ws.FINISHED:this.div.classList.remove("loadingIcon","loading"),this.#Kl=0}}_createCanvas(t,e=!1){const{pageColors:i}=this,n=!(!i?.background||!i?.foreground),r=this.canvas,s=!r&&!n&&!e;let a=this.canvas=document.createElement("canvas");this.#Yl=e=>{if(s){let i=this.#Ql;if(!e&&this.#Gl>0){if(Date.now()-this.#Kl<this.#Gl)return;i||(i=this.#Ql=a,a=this.canvas=a.cloneNode(!1),t(a))}return i?(a.getContext("2d",{alpha:!1}).drawImage(i,0,0),void(e?this.#Zl():this.#Kl=Date.now())):(t(a),void(this.#Yl=null))}e&&(r?(r.replaceWith(a),r.width=r.height=0):t(a))};const o=a.getContext("2d",{alpha:!1,willReadFrequently:!this.#pi});return{canvas:a,prevCanvas:r,ctx:o}}#Jl=t=>{if(this.#Yl?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this))return this.renderingState=Ws.PAUSED,void(this.resume=()=>{this.renderingState=Ws.RUNNING,t()});t()};_resetCanvas(){const{canvas:t}=this;t&&(t.remove(),t.width=t.height=0,this.canvas=null,this.#Zl())}#Zl(){this.#Ql&&(this.#Ql.width=this.#Ql.height=0,this.#Ql=null)}async _drawCanvas(t,e,i){const n=this.renderTask=this.pdfPage.render(t);n.onContinue=this.#Jl,n.onError=t=>{t instanceof Ds&&(e(),this.#ql=null)};let r=null;try{await n.promise,this.#Yl?.(!0)}catch(s){if(s instanceof Ds)return;r=s,this.#Yl?.(!0)}finally{this.#ql=r,n===this.renderTask&&(this.renderTask=null)}if(this.renderingState=Ws.FINISHED,i(n),r)throw r}cancelRendering({cancelExtraDelay:t=0}={}){this.renderTask&&(this.renderTask.cancel(t),this.renderTask=null),this.resume=null}dispatchPageRender(){this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id})}dispatchPageRendered(t,e){this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:t,isDetailView:e,timestamp:performance.now(),error:this.#ql})}}class kl{#jl=null;constructor(t){this.pageIndex=t.pageIndex}async render({intent:t="display"}){"display"!==t||this.#jl||this._cancelled||(this.#jl=new ss({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,this.#jl&&(this.#jl.destroy(),this.#jl=null)}setParent(t){this.#jl?.setParent(t)}getDrawLayer(){return this.#jl}}class _l extends Sl{#td=null;renderingCancelled=!1;constructor({pageView:t}){super(t),this.pageView=t,this.renderingId="detail"+this.id,this.div=t.div}setPdfPage(t){this.pageView.setPdfPage(t)}get pdfPage(){return this.pageView.pdfPage}get renderingState(){return super.renderingState}set renderingState(t){this.renderingCancelled=!1,super.renderingState=t}reset({keepCanvas:t=!1}={}){const e=this.renderingCancelled||this.renderingState===Ws.RUNNING||this.renderingState===Ws.PAUSED;this.cancelRendering(),this.renderingState=Ws.INITIAL,this.renderingCancelled=e,t||this._resetCanvas()}#ed(t){if(!this.#td)return!0;const e=this.#td.minX,i=this.#td.minY,n=this.#td.width+e,r=this.#td.height+i;if(t.minX<e||t.minY<i||t.maxX>n||t.maxY>r)return!0;const{width:s,height:a,scale:o}=this.pageView.viewport;if(this.#td.scale!==o)return!0;const l=t.minX-e,d=n-t.maxX,h=t.minY-i,c=r-t.maxY;return e>0&&d/l>3||n<s&&l/d>3||i>0&&c/h>3||r<a&&h/c>3}update({visibleArea:t=null,underlyingViewUpdated:e=!1}={}){if(e)return this.cancelRendering(),void(this.renderingState=Ws.INITIAL);if(!this.#ed(t))return;const{viewport:i,maxCanvasPixels:n,capCanvasAreaFactor:r}=this.pageView,s=t.maxX-t.minX,a=t.maxY-t.minY,o=s*a*Cs.pixelRatio**2,l=(Math.sqrt(Cs.capPixels(n,r)/o)-1)/2;let d=Math.min(1,l);d<0&&(d=0);const h=s*d,c=a*d,u=Math.max(0,t.minX-h),g=Math.min(i.width,t.maxX+h),p=Math.max(0,t.minY-c),f=g-u,m=Math.min(i.height,t.maxY+c)-p;this.#td={minX:u,minY:p,width:f,height:m,scale:i.scale},this.reset({keepCanvas:!0})}async draw(){if(this.pageView.detailView!==this)return;const t=this.pageView.renderingState===Ws.FINISHED||this.renderingState===Ws.FINISHED;this.renderingState!==Ws.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,pdfPage:i,viewport:n}=this.pageView;if(!i)throw this.renderingState=Ws.FINISHED,new Error("pdfPage is not loaded");this.renderingState=Ws.RUNNING;const r=this.pageView._ensureCanvasWrapper(),{canvas:s,prevCanvas:a,ctx:o}=this._createCanvas(t=>{"CANVAS"===r.firstElementChild?.tagName?r.firstElementChild.after(t):r.prepend(t)},t);s.setAttribute("aria-hidden","true");const{width:l,height:d}=n,h=this.#td,{pixelRatio:c}=Cs,u=[c,0,0,c,-h.minX*c,-h.minY*c];s.width=h.width*c,s.height=h.height*c;const{style:g}=s;g.width=100*h.width/l+"%",g.height=100*h.height/d+"%",g.top=100*h.minY/d+"%",g.left=100*h.minX/l+"%";const p=this._drawCanvas(this.pageView._getRenderingContext(o,u),()=>{this.canvas?.remove(),this.canvas=a},()=>{this.dispatchPageRendered(!1,!0)});return e.setAttribute("data-loaded",!0),this.dispatchPageRender(),p}}const Tl={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Ll=/^H(\d+)$/;class Dl{#id;#nd=null;#rd;#sd=new Map;#ad;#od=null;constructor(t,e){this.#id=t.getStructTree(),this.#ad=e}async render(){if(this.#rd)return this.#rd;const{promise:t,resolve:e,reject:i}=Promise.withResolvers();this.#rd=t;try{this.#nd=this.#ld(await this.#id)}catch(n){i(n)}return this.#id=null,this.#nd?.classList.add("structTree"),e(this.#nd),t}async getAriaAttributes(t){try{return await this.render(),this.#sd.get(t)}catch{}return null}hide(){this.#nd&&!this.#nd.hidden&&(this.#nd.hidden=!0)}show(){this.#nd?.hidden&&(this.#nd.hidden=!1)}#dd(t,e){const{alt:i,id:n,lang:r}=t;if(void 0!==i){let n=!1;const r=na(i);for(const e of t.children)if("annotation"===e.type){let t=this.#sd.get(e.id);t||(t=new Map,this.#sd.set(e.id,t)),t.set("aria-label",r),n=!0}n||e.setAttribute("aria-label",r)}void 0!==n&&e.setAttribute("aria-owns",n),void 0!==r&&e.setAttribute("lang",na(r,!0))}#hd(t,e){const{alt:i,bbox:n,children:r}=t,s=r?.[0];if(!this.#ad||!i||!n||"content"!==s?.type)return!1;const{id:a}=s;if(!a)return!1;e.setAttribute("aria-owns",a);const o=document.createElement("span");(this.#od||=new Map).set(a,o),o.setAttribute("role","img"),o.setAttribute("aria-label",na(i));const{pageHeight:l,pageX:d,pageY:h}=this.#ad,c="calc(var(--total-scale-factor) *",{style:u}=o;return u.width=`${c}${n[2]-n[0]}px)`,u.height=`${c}${n[3]-n[1]}px)`,u.left=`${c}${n[0]-d}px)`,u.top=`${c}${l-n[3]+h}px)`,!0}addElementsToTextLayer(){if(this.#od){for(const[t,e]of this.#od)document.getElementById(t)?.append(e);this.#od.clear(),this.#od=null}}#ld(t){if(!t)return null;const e=document.createElement("span");if("role"in t){const{role:i}=t,n=i.match(Ll);if(n?(e.setAttribute("role","heading"),e.setAttribute("aria-level",n[1])):Tl[i]&&e.setAttribute("role",Tl[i]),"Figure"===i&&this.#hd(t,e))return e}if(this.#dd(t,e),t.children)if(1===t.children.length&&"id"in t.children[0])this.#dd(t.children[0],e);else for(const i of t.children)e.append(this.#ld(i));return e}}class Pl{#cd=!1;#ud=null;#gd=new Map;#pd=new Map;setTextMapping(t){this.#ud=t}static#fd(t,e){const i=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(0===i.width&&0===i.height)return 1;if(0===n.width&&0===n.height)return-1;const r=i.y,s=i.y+i.height,a=i.y+i.height/2,o=n.y,l=n.y+n.height,d=n.y+n.height/2;return a<=o&&d>=s?-1:d<=r&&a>=l?1:i.x+i.width/2-(n.x+n.width/2)}enable(){if(this.#cd)throw new Error("TextAccessibilityManager is already enabled.");if(!this.#ud)throw new Error("Text divs and strings have not been set.");if(this.#cd=!0,this.#ud=this.#ud.slice(),this.#ud.sort(Pl.#fd),this.#gd.size>0){const t=this.#ud;for(const[e,i]of this.#gd)document.getElementById(e)?this.#md(e,t[i]):this.#gd.delete(e)}for(const[t,e]of this.#pd)this.addPointerInTextLayer(t,e);this.#pd.clear()}disable(){this.#cd&&(this.#pd.clear(),this.#ud=null,this.#cd=!1)}removePointerInTextLayer(t){if(!this.#cd)return void this.#pd.delete(t);const e=this.#ud;if(!e||0===e.length)return;const{id:i}=t,n=this.#gd.get(i);if(void 0===n)return;const r=e[n];this.#gd.delete(i);let s=r.getAttribute("aria-owns");s?.includes(i)&&(s=s.split(" ").filter(t=>t!==i).join(" "),s?r.setAttribute("aria-owns",s):(r.removeAttribute("aria-owns"),r.setAttribute("role","presentation")))}#md(t,e){const i=e.getAttribute("aria-owns");i?.includes(t)||e.setAttribute("aria-owns",i?`${i} ${t}`:t),e.removeAttribute("role")}addPointerInTextLayer(t,e){const{id:i}=t;if(!i)return null;if(!this.#cd)return this.#pd.set(t,e),null;e&&this.removePointerInTextLayer(t);const n=this.#ud;if(!n||0===n.length)return null;const r=ra(n,e=>Pl.#fd(t,e)<0),s=Math.max(0,r-1),a=n[s];this.#md(i,a),this.#gd.set(i,s);const o=a.parentNode;return o?.classList.contains("markedContent")?o.id:null}moveElementInDOM(t,e,i,n){const r=this.addPointerInTextLayer(i,n);if(!t.hasChildNodes())return t.append(e),r;const s=Array.from(t.childNodes).filter(t=>t!==e);if(0===s.length)return r;const a=i||e,o=ra(s,t=>Pl.#fd(a,t)<0);return 0===o?s[0].before(e):s[o-1].after(e),r}}class Ml{#_l=null;constructor({findController:t,eventBus:e,pageIndex:i}){this.findController=t,this.matches=[],this.eventBus=e,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(t,e){this.textDivs=t,this.textContentItemsStr=e}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this.#_l||(this.#_l=new AbortController,this.eventBus._on("updatetextlayermatches",t=>{t.pageIndex!==this.pageIdx&&-1!==t.pageIndex||this._updateMatches()},{signal:this.#_l.signal})),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this.#_l?.abort(),this.#_l=null,this._updateMatches(!0))}_convertMatches(t,e){if(!t)return[];const{textContentItemsStr:i}=this;let n=0,r=0;const s=i.length-1,a=[];for(let o=0,l=t.length;o<l;o++){let l=t[o];for(;n!==s&&l>=r+i[n].length;)r+=i[n].length,n++;n===i.length&&console.error("Could not find a matching mapping");const d={begin:{divIdx:n,offset:l-r}};for(l+=e[o];n!==s&&l>r+i[n].length;)r+=i[n].length,n++;d.end={divIdx:n,offset:l-r},a.push(d)}return a}_renderMatches(t){if(0===t.length)return;const{findController:e,pageIdx:i}=this,{textContentItemsStr:n,textDivs:r}=this,s=i===e.selected.pageIdx,a=e.selected.matchIdx;let o=null;const l={offset:void 0};function d(t,e){const i=t.divIdx;return r[i].textContent="",h(i,0,t.offset,e)}function h(t,e,i,s){let a=r[t];if(a.nodeType===Node.TEXT_NODE){const e=document.createElement("span");a.before(e),e.append(a),r[t]=e,a=e}const o=n[t].substring(e,i),l=document.createTextNode(o);if(s){const t=document.createElement("span");if(t.className=`${s} appended`,t.append(l),a.append(t),s.includes("selected")){const{left:e}=t.getClientRects()[0];return e-a.getBoundingClientRect().left}return 0}return a.append(l),0}let c=a,u=c+1;if(e.state.highlightAll)c=0,u=t.length;else if(!s)return;let g=-1,p=-1;for(let f=c;f<u;f++){const n=t[f],c=n.begin;if(c.divIdx===g&&c.offset===p)continue;g=c.divIdx,p=c.offset;const u=n.end,m=s&&f===a,b=m?" selected":"";let v=0;if(o&&c.divIdx===o.divIdx?h(o.divIdx,o.offset,c.offset):(null!==o&&h(o.divIdx,o.offset,l.offset),d(c)),c.divIdx===u.divIdx)v=h(c.divIdx,c.offset,u.offset,"highlight"+b);else{v=h(c.divIdx,c.offset,l.offset,"highlight begin"+b);for(let t=c.divIdx+1,e=u.divIdx;t<e;t++)r[t].className="highlight middle"+b;d(u,"highlight end"+b)}o=u,m&&e.scrollMatchIntoView({element:r[c.divIdx],selectedLeft:v,pageIndex:i,matchIndex:a})}o&&h(o.divIdx,o.offset,l.offset)}_updateMatches(t=!1){if(!this.enabled&&!t)return;const{findController:e,matches:i,pageIdx:n}=this,{textContentItemsStr:r,textDivs:s}=this;let a=-1;for(const d of i){for(let t=Math.max(a,d.begin.divIdx),e=d.end.divIdx;t<=e;t++){const e=s[t];e.textContent=r[t],e.className=""}a=d.end.divIdx+1}if(!e?.highlightMatches||t)return;const o=e.pageMatches[n]||null,l=e.pageMatchesLength[n]||null;this.matches=this._convertMatches(o,l),this._renderMatches(this.matches)}}class Fl{#bd=!1;#kl=null;#vd=!1;#No=null;static#wd=new Map;static#xd=null;constructor({pdfPage:t,highlighter:e=null,accessibilityManager:i=null,enablePermissions:n=!1,onAppend:r=null}){this.pdfPage=t,this.highlighter=e,this.accessibilityManager=i,this.#bd=!0===n,this.#kl=r,this.div=document.createElement("div"),this.div.tabIndex=0,this.div.className="textLayer"}async render({viewport:t,textContentParams:e=null}){if(this.#vd&&this.#No)return this.#No.update({viewport:t,onBefore:this.hide.bind(this)}),void this.show();this.cancel(),this.#No=new Ns({textContentSource:this.pdfPage.streamTextContent(e||{includeMarkedContent:!0,disableNormalization:!0}),container:this.div,viewport:t});const{textDivs:i,textContentItemsStr:n}=this.#No;this.highlighter?.setTextMapping(i,n),this.accessibilityManager?.setTextMapping(i),await this.#No.render(),this.#vd=!0;const r=document.createElement("div");r.className="endOfContent",this.div.append(r),this.#yd(r),this.#kl?.(this.div),this.highlighter?.enable(),this.accessibilityManager?.enable()}hide(){!this.div.hidden&&this.#vd&&(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.#vd&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.#No?.cancel(),this.#No=null,this.highlighter?.disable(),this.accessibilityManager?.disable(),Fl.#Ad(this.div)}#yd(t){const{div:e}=this;e.addEventListener("mousedown",()=>{e.classList.add("selecting")}),e.addEventListener("copy",t=>{if(!this.#bd){const e=document.getSelection();t.clipboardData.setData("text/plain",na(ys(e.toString())))}Rs(t)}),Fl.#wd.set(e,t),Fl.#Cd()}static#Ad(t){this.#wd.delete(t),0===this.#wd.size&&(this.#xd?.abort(),this.#xd=null)}static#Cd(){if(this.#xd)return;this.#xd=new AbortController;const{signal:t}=this.#xd,e=(t,e)=>{e.append(t),t.style.width="",t.style.height="",e.classList.remove("selecting")};let i=!1;var n,r;document.addEventListener("pointerdown",()=>{i=!0},{signal:t}),document.addEventListener("pointerup",()=>{i=!1,this.#wd.forEach(e)},{signal:t}),window.addEventListener("blur",()=>{i=!1,this.#wd.forEach(e)},{signal:t}),document.addEventListener("keyup",()=>{i||this.#wd.forEach(e)},{signal:t}),document.addEventListener("selectionchange",()=>{const t=document.getSelection();if(0===t.rangeCount)return void this.#wd.forEach(e);const i=new Set;for(let e=0;e<t.rangeCount;e++){const n=t.getRangeAt(e);for(const t of this.#wd.keys())!i.has(t)&&n.intersectsNode(t)&&i.add(t)}for(const[n,r]of this.#wd)i.has(n)?n.classList.add("selecting"):e(r,n);if(n??="none"===getComputedStyle(this.#wd.values().next().value).getPropertyValue("-moz-user-select"),n)return;const s=t.getRangeAt(0),a=r&&(0===s.compareBoundaryPoints(Range.END_TO_END,r)||0===s.compareBoundaryPoints(Range.START_TO_END,r));let o=a?s.startContainer:s.endContainer;if(o.nodeType===Node.TEXT_NODE&&(o=o.parentNode),!a&&0===s.endOffset)do{for(;!o.previousSibling;)o=o.parentNode;o=o.previousSibling}while(!o.childNodes.length);const l=o.parentElement?.closest(".textLayer"),d=this.#wd.get(l);d&&(d.style.width=l.style.width,d.style.height=l.style.height,o.parentElement.insertBefore(d,a?o:o.nextSibling)),r=s.cloneRange()},{signal:t})}}class Il{constructor({pdfPage:t,annotationStorage:e=null,linkService:i,xfaHtml:n=null}){this.pdfPage=t,this.annotationStorage=e,this.linkService=i,this.xfaHtml=n,this.div=null,this._cancelled=!1}async render({viewport:t,intent:e="display"}){if("print"===e){const i={viewport:t.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:e};return this.div=document.createElement("div"),i.div=this.div,Us.render(i)}const i=await this.pdfPage.getXfa();if(this._cancelled||!i)return{textDivs:[]};const n={viewport:t.clone({dontFlip:!0}),div:this.div,xfaHtml:i,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:e};return this.div?Us.update(n):(this.div=document.createElement("div"),n.div=this.div,Us.render(n))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}const Rl={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new za}},Bl=new Map([["canvasWrapper",0],["textLayer",1],["annotationLayer",2],["annotationEditorLayer",3],["xfaLayer",3]]);class Nl extends Sl{#Ed=Jr.ENABLE_FORMS;#Sd=null;#kd=!0;#_d=!1;#ke=!1;#Td=null;#Ld=!1;#Dd=null;#Pd=null;#Md=1;#Fd=1;#Id=Ks;#Rd=1;#Bd={directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0};#Nd=[null,null,null,null];constructor(t){super(t);const e=t.container,i=t.defaultViewport;this.renderingId="page"+this.id,this.#Td=t.layerProperties||Rl,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=t.scale||1,this.viewport=i,this.pdfPageRotate=i.rotation,this._optionalContentConfigPromise=t.optionalContentConfigPromise||null,this.#Id=t.textLayerMode??Ks,this.#Ed=t.annotationMode??Jr.ENABLE_FORMS,this.imageResourcesPath=t.imageResourcesPath||"",this.enableDetailCanvas=t.enableDetailCanvas??!0,this.maxCanvasPixels=t.maxCanvasPixels??xl.get("maxCanvasPixels"),this.maxCanvasDim=t.maxCanvasDim||xl.get("maxCanvasDim"),this.capCanvasAreaFactor=t.capCanvasAreaFactor??xl.get("capCanvasAreaFactor"),this.#kd=!1!==t.enableAutoLinking,this.l10n=t.l10n,this.l10n||=new ll,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=e,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null,this.detailView=null;const n=document.createElement("div");if(n.className="page",n.setAttribute("data-page-number",this.id),n.setAttribute("role","region"),n.setAttribute("data-l10n-id","pdfjs-page-landmark"),n.setAttribute("data-l10n-args",JSON.stringify({page:this.id})),this.div=n,this.#Od(),e?.append(n),this._isStandalone){e?.style.setProperty("--scale-factor",this.scale*Ls.PDF_TO_CSS_UNITS),this.pageColors?.background&&e?.style.setProperty("--page-bg-color",this.pageColors.background);const{optionalContentConfigPromise:i}=t;i&&i.then(t=>{i===this._optionalContentConfigPromise&&(this.#Bd.initialOptionalContent=t.hasInitialVisibility)}),t.l10n||this.l10n.translate(this.div)}}#zd(t,e){const i=Bl.get(e),n=this.#Nd[i];if(this.#Nd[i]=t,n)n.replaceWith(t);else{for(let e=i-1;e>=0;e--){const i=this.#Nd[e];if(i)return void i.after(t)}this.div.prepend(t)}}#Od(){const{div:t,viewport:e}=this;if(e.userUnit!==this.#Rd&&(1!==e.userUnit?t.style.setProperty("--user-unit",e.userUnit):t.style.removeProperty("--user-unit"),this.#Rd=e.userUnit),this.pdfPage){if(this.#Pd===e.rotation)return;this.#Pd=e.rotation}Ms(t,e,!0,!1)}setPdfPage(t){!this._isStandalone||"CanvasText"!==this.pageColors?.foreground&&"Canvas"!==this.pageColors?.background||(this._container?.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),this._container?.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=t,this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:this.scale*Ls.PDF_TO_CSS_UNITS,rotation:e}),this.#Od(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}get _textHighlighter(){return Fs(this,"_textHighlighter",new Ml({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#Td.findController}))}#Hd(t,e){this.eventBus.dispatch(t,{source:this,pageNumber:this.id,error:e})}async#Vd(){let t=null;try{await this.annotationLayer.render({viewport:this.viewport,intent:"display",structTreeLayer:this.structTreeLayer})}catch(e){console.error("#renderAnnotationLayer:",e),t=e}finally{this.#Hd("annotationlayerrendered",t)}}async#jd(){let t=null;try{await this.annotationEditorLayer.render({viewport:this.viewport,intent:"display"})}catch(e){console.error("#renderAnnotationEditorLayer:",e),t=e}finally{this.#Hd("annotationeditorlayerrendered",t)}}async#Ud(){try{await this.drawLayer.render({intent:"display"})}catch(t){console.error("#renderDrawLayer:",t)}}async#Wd(){let t=null;try{const t=await this.xfaLayer.render({viewport:this.viewport,intent:"display"});t?.textDivs&&this._textHighlighter&&this.#$d(t.textDivs)}catch(e){console.error("#renderXfaLayer:",e),t=e}finally{this.xfaLayer?.div&&(this.l10n.pause(),this.#zd(this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),this.#Hd("xfalayerrendered",t)}}async#Gd(){if(!this.textLayer)return;let t=null;try{await this.textLayer.render({viewport:this.viewport})}catch(e){if(e instanceof qr)return;console.error("#renderTextLayer:",e),t=e}this.#Hd("textlayerrendered",t),this.#qd()}async#qd(){if(!this.textLayer)return;const t=await(this.structTreeLayer?.render());t&&(this.l10n.pause(),this.structTreeLayer?.addElementsToTextLayer(),this.canvas&&t.parentNode!==this.canvas&&this.canvas.append(t),this.l10n.resume()),this.structTreeLayer?.show()}async#$d(t){const e=await this.pdfPage.getTextContent(),i=[];for(const n of e.items)i.push(n.str);this._textHighlighter.setTextMapping(t,i),this._textHighlighter.enable()}async#Xd(t){try{if(await t,!this.annotationLayer)return;await this.annotationLayer.injectLinkAnnotations({inferredLinks:El.processLinks(this),viewport:this.viewport,structTreeLayer:this.structTreeLayer})}catch(e){console.error("#injectLinkAnnotations:",e)}}_resetCanvas(){super._resetCanvas(),this.#Dd=null}reset({keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:e=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,keepCanvasWrapper:r=!1,preserveDetailViewState:s=!1}={}){this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:e,keepXfaLayer:i,keepTextLayer:n}),this.renderingState=Ws.INITIAL;const a=this.div,o=a.childNodes,l=t&&this.annotationLayer?.div||null,d=e&&this.annotationEditorLayer?.div||null,h=i&&this.xfaLayer?.div||null,c=n&&this.textLayer?.div||null,u=r&&this.#Sd||null;for(let g=o.length-1;g>=0;g--){const t=o[g];switch(t){case l:case d:case h:case c:case u:continue}t.remove();const e=this.#Nd.indexOf(t);e>=0&&(this.#Nd[e]=null)}a.removeAttribute("data-loaded"),l&&this.annotationLayer.hide(),d&&this.annotationEditorLayer.hide(),h&&this.xfaLayer.hide(),c&&this.textLayer.hide(),this.structTreeLayer?.hide(),!r&&this.#Sd&&(this.#Sd=null,this._resetCanvas()),s||(this.detailView?.reset({keepCanvas:r}),r||(this.detailView=null))}toggleEditingMode(t){this.#ke=t,this.hasEditableAnnotations()&&this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}updateVisibleArea(t){this.enableDetailCanvas&&(this.#Ld&&this.maxCanvasPixels>0&&t?(this.detailView??=new _l({pageView:this}),this.detailView.update({visibleArea:t})):this.detailView&&(this.detailView.reset(),this.detailView=null))}update({scale:t=0,rotation:e=null,optionalContentConfigPromise:i=null,drawingDelay:n=-1}){this.scale=t||this.scale,"number"==typeof e&&(this.rotation=e),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then(t=>{i===this._optionalContentConfigPromise&&(this.#Bd.initialOptionalContent=t.hasInitialVisibility)})),this.#Bd.directDrawing=!0;const r=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Ls.PDF_TO_CSS_UNITS,rotation:r}),this.#Od(),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),this.#Yd(),this.canvas){const t=this.#_d&&this.#Ld,e=n>=0&&n<1e3;if(e||t)return e&&!t&&this.renderingState!==Ws.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:n}),this.renderingState=Ws.FINISHED,this.#Bd.directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!e,hideTextLayer:e}),void(e||(this.detailView?.update({underlyingViewUpdated:!0}),this.dispatchPageRendered(!0,!1)))}this.cssTransform({}),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0,preserveDetailViewState:!0}),this.detailView?.update({underlyingViewUpdated:!0})}#Yd(){const{width:t,height:e}=this.viewport,i=this.outputScale=new Cs;if(0===this.maxCanvasPixels){const t=1/this.scale;i.sx*=t,i.sy*=t,this.#Ld=!0}else this.#Ld=i.limitCanvas(t,e,this.maxCanvasPixels,this.maxCanvasDim,this.capCanvasAreaFactor)}cancelRendering({keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:e=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:r=0}={}){super.cancelRendering({cancelExtraDelay:r}),!this.textLayer||n&&this.textLayer.div||(this.textLayer.cancel(),this.textLayer=null),!this.annotationLayer||t&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),!this.annotationEditorLayer||e&&this.annotationEditorLayer.div||(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),!this.xfaLayer||i&&this.xfaLayer.div||(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:e=!1,redrawXfaLayer:i=!1,redrawTextLayer:n=!1,hideTextLayer:r=!1}){const{canvas:s}=this;if(!s)return;const a=this.#Dd;if(this.viewport!==a){const t=(360+this.viewport.rotation-a.rotation)%360;if(90===t||270===t){const{width:e,height:i}=this.viewport,n=i/e,r=e/i;s.style.transform=`rotate(${t}deg) scale(${n},${r})`}else s.style.transform=0===t?"":`rotate(${t}deg)`}t&&this.annotationLayer&&this.#Vd(),e&&this.annotationEditorLayer&&(this.drawLayer&&this.#Ud(),this.#jd()),i&&this.xfaLayer&&this.#Wd(),this.textLayer&&(r?(this.textLayer.hide(),this.structTreeLayer?.hide()):n&&this.#Gd())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(t,e){return this.viewport.convertToPdfPoint(t,e)}_ensureCanvasWrapper(){let t=this.#Sd;return t||(t=this.#Sd=document.createElement("div"),t.classList.add("canvasWrapper"),this.#zd(t,"canvasWrapper")),t}_getRenderingContext(t,e){return{canvasContext:t,transform:e,viewport:this.viewport,annotationMode:this.#Ed,optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors,isEditing:this.#ke}}async draw(){this.renderingState!==Ws.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:t,l10n:e,pdfPage:i,viewport:n}=this;if(!i)throw this.renderingState=Ws.FINISHED,new Error("pdfPage is not loaded");this.renderingState=Ws.RUNNING;const r=this._ensureCanvasWrapper();if(this.textLayer||this.#Id===Ys||i.isPureXfa||(this._accessibilityManager||=new Pl,this.textLayer=new Fl({pdfPage:i,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:this.#Id===Qs,onAppend:t=>{this.l10n.pause(),this.#zd(t,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&this.#Ed!==Jr.DISABLE){const{annotationStorage:t,annotationEditorUIManager:e,downloadManager:n,enableScripting:r,fieldObjectsPromise:s,hasJSActionsPromise:a,linkService:o}=this.#Td;this._annotationCanvasMap||=new Map,this.annotationLayer=new Ha({pdfPage:i,annotationStorage:t,imageResourcesPath:this.imageResourcesPath,renderForms:this.#Ed===Jr.ENABLE_FORMS,linkService:o,downloadManager:n,enableScripting:r,hasJSActionsPromise:a,fieldObjectsPromise:s,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:e,onAppend:t=>{this.#zd(t,"annotationLayer")}})}const{width:s,height:a}=n;this.#Dd=n;const{canvas:o,prevCanvas:l,ctx:d}=this._createCanvas(t=>{r.prepend(t)});o.setAttribute("role","presentation"),this.outputScale||this.#Yd();const{outputScale:h}=this;this.#_d=this.#Ld;const c=sa(h.sx),u=sa(h.sy),g=o.width=aa(ha(s*h.sx),c[0]),p=o.height=aa(ha(a*h.sy),u[0]),f=aa(ha(s),c[1]),m=aa(ha(a),u[1]);h.sx=g/f,h.sy=p/m,this.#Md!==c[1]&&(t.style.setProperty("--scale-round-x",`${c[1]}px`),this.#Md=c[1]),this.#Fd!==u[1]&&(t.style.setProperty("--scale-round-y",`${u[1]}px`),this.#Fd=u[1]);const b=h.scaled?[h.sx,0,0,h.sy,0,0]:null,v=this._drawCanvas(this._getRenderingContext(d,b),()=>{l?.remove(),this._resetCanvas()},t=>{this.#Bd.regularAnnotations=!t.separateAnnots,this.dispatchPageRendered(!1,!1)}).then(async()=>{this.structTreeLayer||=new Dl(i,n.rawDims);const t=this.#Gd();this.annotationLayer&&(await this.#Vd(),this.#kd&&this.annotationLayer&&this.textLayer&&await this.#Xd(t));const{annotationEditorUIManager:s}=this.#Td;s&&(this.drawLayer||=new kl({pageIndex:this.id}),await this.#Ud(),this.drawLayer.setParent(r),this.annotationEditorLayer||=new hl({uiManager:s,pdfPage:i,l10n:e,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:t=>{this.#zd(t,"annotationEditorLayer")}}),this.#jd())});if(i.isPureXfa){if(!this.xfaLayer){const{annotationStorage:t,linkService:e}=this.#Td;this.xfaLayer=new Il({pdfPage:i,annotationStorage:t,linkService:e})}this.#Wd()}return t.setAttribute("data-loaded",!0),this.dispatchPageRender(),v}setPageLabel(t){this.pageLabel="string"==typeof t?t:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:t,initialOptionalContent:e,regularAnnotations:i}=this.#Bd;return t&&e&&i?this.canvas:null}}class Ol{constructor(t){this._ready=new Promise((i,n)=>{e.import(t).then(t=>{i(t.QuickJSSandbox())}).catch(n)})}async createSandbox(t){(await this._ready).create(t)}async dispatchEventInSandbox(t){const e=await this._ready;setTimeout(()=>e.dispatchEvent(t),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}class zl{#Kd=null;#Qd=null;#Zd=null;#_l=null;#Bs=null;#Jd=null;#th=null;#eh=null;#ih=!1;#nh=null;#rh=null;constructor({eventBus:t,externalServices:e=null,docProperties:i=null}){this.#Bs=t,this.#Jd=e,this.#Zd=i}setViewer(t){this.#eh=t}async setDocument(t){if(this.#th&&await this.#sh(),this.#th=t,!t)return;const[e,i,n]=await Promise.all([t.getFieldObjects(),t.getCalculationOrderIds(),t.getJSActions()]);if(!e&&!n)return void(await this.#sh());if(t!==this.#th)return;try{this.#nh=this.#ah()}catch(a){return console.error("setDocument:",a),void(await this.#sh())}const r=this.#Bs;this.#_l=new AbortController;const{signal:s}=this.#_l;r._on("updatefromsandbox",t=>{t?.source===window&&this.#oh(t.detail)},{signal:s}),r._on("dispatcheventinsandbox",t=>{this.#nh?.dispatchEventInSandbox(t.detail)},{signal:s}),r._on("pagechanging",({pageNumber:t,previous:e})=>{t!==e&&(this.#lh(e),this.#dh(t))},{signal:s}),r._on("pagerendered",({pageNumber:t})=>{this._pageOpenPending.has(t)&&t===this.#eh.currentPageNumber&&this.#dh(t)},{signal:s}),r._on("pagesdestroy",async()=>{await this.#lh(this.#eh.currentPageNumber),await(this.#nh?.dispatchEventInSandbox({id:"doc",name:"WillClose"})),this.#Kd?.resolve()},{signal:s});try{const s=await this.#Zd(t);if(t!==this.#th)return;await this.#nh.createSandbox({objects:e,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...s,actions:n}}),r.dispatch("sandboxcreated",{source:this})}catch(a){return console.error("setDocument:",a),void(await this.#sh())}await(this.#nh?.dispatchEventInSandbox({id:"doc",name:"Open"})),await this.#dh(this.#eh.currentPageNumber,!0),Promise.resolve().then(()=>{t===this.#th&&(this.#ih=!0)})}async dispatchWillSave(){return this.#nh?.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){return this.#nh?.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){if(this.#nh){await(this.#rh?.promise),this.#rh=Promise.withResolvers();try{await this.#nh.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(t){throw this.#rh.resolve(),this.#rh=null,t}await this.#rh.promise}}async dispatchDidPrint(){return this.#nh?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){return this.#Qd?.promise||null}get ready(){return this.#ih}get _pageOpenPending(){return Fs(this,"_pageOpenPending",new Set)}get _visitedPages(){return Fs(this,"_visitedPages",new Map)}async#oh(t){const e=this.#eh,i=e.isInPresentationMode||e.isChangingPresentationMode,{id:n,siblings:r,command:s,value:a}=t;if(!n){switch(s){case"clear":console.clear();break;case"error":console.error(a);break;case"layout":if(!i){const t=function(t){let e=Zs.VERTICAL,i=Js.NONE;switch(t){case"SinglePage":e=Zs.PAGE;break;case"OneColumn":break;case"TwoPageLeft":e=Zs.PAGE;case"TwoColumnLeft":i=Js.ODD;break;case"TwoPageRight":e=Zs.PAGE;case"TwoColumnRight":i=Js.EVEN}return{scrollMode:e,spreadMode:i}}(a);e.spreadMode=t.spreadMode}break;case"page-num":e.currentPageNumber=a+1;break;case"print":await e.pagesPromise,this.#Bs.dispatch("print",{source:this});break;case"println":console.log(a);break;case"zoom":i||(e.currentScaleValue=a);break;case"SaveAs":this.#Bs.dispatch("download",{source:this});break;case"FirstPage":e.currentPageNumber=1;break;case"LastPage":e.currentPageNumber=e.pagesCount;break;case"NextPage":e.nextPage();break;case"PrevPage":e.previousPage();break;case"ZoomViewIn":i||e.increaseScale();break;case"ZoomViewOut":i||e.decreaseScale();break;case"WillPrintFinished":this.#rh?.resolve(),this.#rh=null}return}if(i&&t.focus)return;delete t.id,delete t.siblings;const o=r?[n,...r]:[n];for(const l of o){const e=document.querySelector(`[data-element-id="${l}"]`);e?e.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:t})):this.#th?.annotationStorage.setValue(l,t)}}async#dh(t,e=!1){const i=this.#th,n=this._visitedPages;if(e&&(this.#Kd=Promise.withResolvers()),!this.#Kd)return;const r=this.#eh.getPageView(t-1);if(r?.renderingState!==Ws.FINISHED)return void this._pageOpenPending.add(t);this._pageOpenPending.delete(t);const s=(async()=>{const e=await(n.has(t)?null:r.pdfPage?.getJSActions());i===this.#th&&await(this.#nh?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:t,actions:e}))})();n.set(t,s)}async#lh(t){const e=this.#th,i=this._visitedPages;if(!this.#Kd)return;if(this._pageOpenPending.has(t))return;const n=i.get(t);n&&(i.set(t,null),await n,e===this.#th&&await(this.#nh?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:t})))}#ah(){if(this.#Qd=Promise.withResolvers(),this.#nh)throw new Error("#initScripting: Scripting already exists.");return this.#Jd.createScripting()}async#sh(){if(!this.#nh)return this.#th=null,void this.#Qd?.resolve();this.#Kd&&(await Promise.race([this.#Kd.promise,new Promise(t=>{setTimeout(t,1e3)})]).catch(()=>{}),this.#Kd=null),this.#th=null;try{await this.#nh.destroySandbox()}catch{}this.#rh?.reject(new Error("Scripting destroyed.")),this.#rh=null,this.#_l?.abort(),this.#_l=null,this._pageOpenPending.clear(),this._visitedPages.clear(),this.#nh=null,this.#ih=!1,this.#Qd?.resolve()}}let Hl=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(t)||this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(t,e,i,n=!1,r=!1){const s=t.views,a=s.length;if(0===a)return null;for(let c=0;c<a;c++){const t=s[c].view;if(!this.isViewFinished(t))return t}if(!r)for(let c=0;c<a;c++){const{detailView:t}=s[c].view;if(t&&!this.isViewFinished(t))return t}const o=t.first.id,l=t.last.id;if(l-o+1>a){const n=t.ids;for(let t=1,r=l-o;t<r;t++){const r=i?o+t:l-t;if(n.has(r))continue;const s=e[r-1];if(!this.isViewFinished(s))return s}}let d=i?l:o-2,h=e[d];return h&&!this.isViewFinished(h)||n&&(d+=i?1:-1,h=e[d],h&&!this.isViewFinished(h))?h:null}isViewFinished(t){return t.renderingState===Ws.FINISHED}renderView(t){switch(t.renderingState){case Ws.FINISHED:return!1;case Ws.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case Ws.RUNNING:this.highestPriorityPage=t.renderingId;break;case Ws.INITIAL:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(t=>{t instanceof Ds||console.error("renderView:",t)})}return!0}};const Vl=1e4,jl=5e3,Ul=250;function Wl(t){return Object.values(Kr).includes(t)&&t!==Kr.DISABLE}class $l{#hh=new Set;#ch=0;constructor(t){this.#ch=t}push(t){const e=this.#hh;e.has(t)&&e.delete(t),e.add(t),e.size>this.#ch&&this.#uh()}resize(t,e=null){this.#ch=t;const i=this.#hh;if(e){const t=i.size;let n=1;for(const r of i)if(e.has(r.id)&&(i.delete(r),i.add(r)),++n>t)break}for(;i.size>this.#ch;)this.#uh()}has(t){return this.#hh.has(t)}[Symbol.iterator](){return this.#hh.keys()}#uh(){const t=this.#hh.keys().next().value;t?.destroy(),this.#hh.delete(t)}}class Gl{#gh=null;#M=null;#ph=null;#fh=Kr.NONE;#mh=null;#Ed=Jr.ENABLE_FORMS;#bh=null;#vh=null;#pi=!1;#U=!1;#bd=!1;#W=!1;#$=!1;#kd=!0;#_l=null;#Gl=0;#st=null;#wh=null;#xh=null;#yh=null;#Ah=!1;#Ch=null;#Eh=!1;#Sh=0;#kh=new ResizeObserver(this.#_h.bind(this));#Th=null;#Lh=null;#dt=null;#Dh=!0;#Id=Ks;#bt=null;constructor(t){const e="5.3.93";if(js!==e)throw new Error(`The API version "${js}" does not match the Viewer version "${e}".`);if(this.container=t.container,this.viewer=t.viewer||t.container.firstElementChild,this.#bt=t.viewerAlert||null,"DIV"!==this.container?.tagName||"DIV"!==this.viewer?.tagName)throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");this.#kh.observe(this.container),this.eventBus=t.eventBus,this.linkService=t.linkService||new za,this.downloadManager=t.downloadManager||null,this.findController=t.findController||null,this.#M=t.altTextManager||null,this.#dt=t.signatureManager||null,this.#vh=t.editorUndoBar||null,this.findController&&(this.findController.onIsPageVisible=t=>this._getVisiblePages().ids.has(t)),this._scriptingManager=t.scriptingManager||null,this.#Id=t.textLayerMode??Ks,this.#Ed=t.annotationMode??Jr.ENABLE_FORMS,this.#fh=t.annotationEditorMode??Kr.NONE,this.#ph=t.annotationEditorHighlightColors||null,this.#U=!0===t.enableHighlightFloatingButton,this.#W=!0===t.enableUpdatedAddImage,this.#$=!0===t.enableNewAltTextWhenAddingImage,this.imageResourcesPath=t.imageResourcesPath||"",this.enablePrintAutoRotate=t.enablePrintAutoRotate||!1,this.removePageBorders=t.removePageBorders||!1,this.maxCanvasPixels=t.maxCanvasPixels,this.maxCanvasDim=t.maxCanvasDim,this.capCanvasAreaFactor=t.capCanvasAreaFactor,this.enableDetailCanvas=t.enableDetailCanvas??!0,this.l10n=t.l10n,this.l10n||=new ll,this.#bd=t.enablePermissions||!1,this.pageColors=t.pageColors||null,this.#st=t.mlManager||null,this.#pi=t.enableHWA||!1,this.#Dh=!1!==t.supportsPinchToZoom,this.#kd=!1!==t.enableAutoLinking,this.#Gl=t.minDurationToUpdateCanvas??500,this.defaultRenderingQueue=!t.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new Hl,this.renderingQueue.setViewer(this)):this.renderingQueue=t.renderingQueue;const{abortSignal:i}=t;i?.addEventListener("abort",()=>{this.#kh.disconnect(),this.#kh=null},{once:!0}),this.scroll=function(t,e,i){const n=function(i){s||(s=window.requestAnimationFrame(function(){s=null;const i=t.scrollLeft,n=r.lastX;i!==n&&(r.right=i>n),r.lastX=i;const a=t.scrollTop,o=r.lastY;a!==o&&(r.down=a>o),r.lastY=a,e(r)}))},r={right:!0,down:!0,lastX:t.scrollLeft,lastY:t.scrollTop,_eventHandler:n};let s=null;return t.addEventListener("scroll",n,{useCapture:!0,signal:i}),i?.addEventListener("abort",()=>window.cancelAnimationFrame(s),{once:!0}),r}(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=$s,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),this.#Ph(),this.eventBus._on("thumbnailrendered",({pageNumber:t,pdfPage:e})=>{const i=this._pages[t-1];this.#gh.has(i)||e?.cleanup()}),t.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(t){return this._pages[t]}getCachedPageViews(){return new Set(this.#gh)}get pageViewsReady(){return this._pages.every(t=>t?.pdfPage)}get renderForms(){return this.#Ed===Jr.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(t){if(!Number.isInteger(t))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(t,!0)||console.error(`currentPageNumber: "${t}" is not a valid page.`))}_setCurrentPageNumber(t,e=!1){if(this._currentPageNumber===t)return e&&this.#Mh(),!0;if(!(0<t&&t<=this.pagesCount))return!1;const i=this._currentPageNumber;return this._currentPageNumber=t,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:this._pageLabels?.[t-1]??null,previous:i}),e&&this.#Mh(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(t){if(!this.pdfDocument)return;let e=0|t;if(this._pageLabels){const i=this._pageLabels.indexOf(t);i>=0&&(e=i+1)}this._setCurrentPageNumber(e,!0)||console.error(`currentPageLabel: "${t}" is not a valid page.`)}get currentScale(){return 0!==this._currentScale?this._currentScale:1}set currentScale(t){if(isNaN(t))throw new Error("Invalid numeric scale.");this.pdfDocument&&this.#Fh(t,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(t){this.pdfDocument&&this.#Fh(t,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!oa(t))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if((t%=360)<0&&(t+=360),this._pagesRotation===t)return;this._pagesRotation=t;const e=this._currentPageNumber;this.refresh(!0,{rotation:t}),this._currentScaleValue&&this.#Fh(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){const t=this;return Fs(this,"_layerProperties",{get annotationEditorUIManager(){return t.#mh},get annotationStorage(){return t.pdfDocument?.annotationStorage},get downloadManager(){return t.downloadManager},get enableScripting(){return!!t._scriptingManager},get fieldObjectsPromise(){return t.pdfDocument?.getFieldObjects()},get findController(){return t.findController},get hasJSActionsPromise(){return t.pdfDocument?.hasJSActions()},get linkService(){return t.linkService}})}#Ih(t){const e={annotationEditorMode:this.#fh,annotationMode:this.#Ed,textLayerMode:this.#Id};return t?(t.includes(Ts.COPY)||this.#Id!==Ks||(e.textLayerMode=Qs),t.includes(Ts.MODIFY_CONTENTS)||(e.annotationEditorMode=Kr.DISABLE),t.includes(Ts.MODIFY_ANNOTATIONS)||t.includes(Ts.FILL_INTERACTIVE_FORMS)||this.#Ed!==Jr.ENABLE_FORMS||(e.annotationMode=Jr.ENABLE),e):e}async#Rh(t){if("hidden"===document.visibilityState||!this.container.offsetParent||0===this._getVisiblePages().views.length)return;const e=Promise.withResolvers(),i=new AbortController;document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&e.resolve()},{signal:AbortSignal.any([t,i.signal])}),await Promise.race([this._onePageRenderedCapability.promise,e.promise]),i.abort()}async getAllText(){const t=[],e=[];for(let i=1,n=this.pdfDocument.numPages;i<=n;++i){if(this.#Eh)return null;e.length=0;const n=await this.pdfDocument.getPage(i),{items:r}=await n.getTextContent();for(const t of r)t.str&&e.push(t.str),t.hasEOL&&e.push("\n");t.push(na(e.join("")))}return t.join("\n")}#Bh(t,e){const i=document.getSelection(),{focusNode:n,anchorNode:r}=i;if(r&&n&&i.containsNode(this.#Ch)){if(this.#Ah||t===Qs)return void Rs(e);this.#Ah=!0;const{classList:i}=this.viewer;i.add("copyAll");const n=new AbortController;window.addEventListener("keydown",t=>this.#Eh="Escape"===t.key,{signal:n.signal}),this.getAllText().then(async t=>{null!==t&&await navigator.clipboard.writeText(t)}).catch(t=>{console.warn(`Something goes wrong when extracting the text: ${t.message}`)}).finally(()=>{this.#Ah=!1,this.#Eh=!1,n.abort(),i.remove("copyAll")}),Rs(e)}}setDocument(t){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#mh?.destroy(),this.#mh=null),this.pdfDocument=t,!t)return;const e=t.numPages,i=t.getPage(1),n=t.getOptionalContentConfig({intent:"display"}),r=this.#bd?t.getPermissions():Promise.resolve(),{eventBus:s,pageColors:a,viewer:o}=this;this.#_l=new AbortController;const{signal:l}=this.#_l;if(e>Vl){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const t=this._scrollMode=Zs.PAGE;s.dispatch("scrollmodechanged",{source:this,mode:t})}this._pagesCapability.promise.then(()=>{s.dispatch("pagesloaded",{source:this,pagesCount:e})},()=>{}),s._on("pagerender",t=>{const e=this._pages[t.pageNumber-1];e&&this.#gh.push(e)},{signal:l});const d=t=>{t.cssTransform||t.isDetailView||(this._onePageRenderedCapability.resolve({timestamp:t.timestamp}),s._off("pagerendered",d))};s._on("pagerendered",d,{signal:l}),Promise.all([i,r]).then(([i,r])=>{if(t!==this.pdfDocument)return;this._firstPageCapability.resolve(i),this._optionalContentConfigPromise=n;const{annotationEditorMode:d,annotationMode:h,textLayerMode:c}=this.#Ih(r);if(c!==Ys){const t=this.#Ch=document.createElement("div");t.id="hiddenCopyElement",o.before(t)}if(d!==Kr.DISABLE){const e=d;t.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):Wl(e)?(this.#mh=new Qr(this.container,o,this.#bt,this.#M,this.#dt,s,t,a,this.#ph,this.#U,this.#W,this.#$,this.#st,this.#vh,this.#Dh),s.dispatch("annotationeditoruimanager",{source:this,uiManager:this.#mh}),e!==Kr.NONE&&(this.#Nh(e),this.#mh.updateMode(e))):console.error(`Invalid AnnotationEditor mode: ${e}`)}const u=this._scrollMode===Zs.PAGE?null:o,g=this.currentScale,p=i.getViewport({scale:g*Ls.PDF_TO_CSS_UNITS});o.style.setProperty("--scale-factor",p.scale),a?.background&&o.style.setProperty("--page-bg-color",a.background),"CanvasText"!==a?.foreground&&"Canvas"!==a?.background||(o.style.setProperty("--hcm-highlight-filter",t.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),o.style.setProperty("--hcm-highlight-selected-filter",t.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let t=1;t<=e;++t){const e=new Nl({container:u,eventBus:s,id:t,scale:g,defaultViewport:p.clone(),optionalContentConfigPromise:n,renderingQueue:this.renderingQueue,textLayerMode:c,annotationMode:h,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableDetailCanvas:this.enableDetailCanvas,pageColors:a,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:this.#pi,enableAutoLinking:this.#kd,minDurationToUpdateCanvas:this.#Gl});this._pages.push(e)}this._pages[0]?.setPdfPage(i),this._scrollMode===Zs.PAGE?this.#Oh():this._spreadMode!==Js.NONE&&this._updateSpreadMode(),this.#Rh(l).then(async()=>{if(t!==this.pdfDocument)return;if(this.findController?.setDocument(t),this._scriptingManager?.setDocument(t),this.#Ch&&document.addEventListener("copy",this.#Bh.bind(this,c),{signal:l}),this.#mh&&s.dispatch("annotationeditormodechanged",{source:this,mode:this.#fh}),t.loadingParams.disableAutoFetch||e>jl)return void this._pagesCapability.resolve();let i=e-1;if(i<=0)this._pagesCapability.resolve();else for(let n=2;n<=e;++n){const e=t.getPage(n).then(t=>{const e=this._pages[n-1];e.pdfPage||e.setPdfPage(t),0===--i&&this._pagesCapability.resolve()},t=>{console.error(`Unable to get page ${n} to initialize viewer`,t),0===--i&&this._pagesCapability.resolve()});n%Ul===0&&await e}}),s.dispatch("pagesinit",{source:this}),t.getMetadata().then(({info:e})=>{t===this.pdfDocument&&e.Language&&(o.lang=e.Language)}),this.defaultRenderingQueue&&this.update()}).catch(t=>{console.error("Unable to initialize viewer",t),this._pagesCapability.reject(t)})}setPageLabels(t){if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let t=0,e=this._pages.length;t<e;t++)this._pages[t].setPageLabel(this._pageLabels?.[t]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=0,this._currentScaleValue=null,this._pageLabels=null,this.#gh=new $l(10),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=Zs.VERTICAL,this._previousScrollMode=Zs.UNKNOWN,this._spreadMode=Js.NONE,this.#Th={previousPageNumber:1,scrollDown:!0,pages:[]},this.#_l?.abort(),this.#_l=null,this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.#Ch?.remove(),this.#Ch=null,this.#zh(),this.#Hh()}#Oh(){if(this._scrollMode!==Zs.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const t=this._currentPageNumber,e=this.#Th,i=this.viewer;if(i.textContent="",e.pages.length=0,this._spreadMode!==Js.NONE||this.isInPresentationMode){const n=new Set,r=this._spreadMode-1;-1===r?n.add(t-1):t%2!==r?(n.add(t-1),n.add(t)):(n.add(t-2),n.add(t-1));const s=document.createElement("div");if(s.className="spread",this.isInPresentationMode){const t=document.createElement("div");t.className="dummyPage",s.append(t)}for(const t of n){const i=this._pages[t];i&&(s.append(i.div),e.pages.push(i))}i.append(s)}else{const n=this._pages[t-1];i.append(n.div),e.pages.push(n)}e.scrollDown=t>=e.previousPageNumber,e.previousPageNumber=t}_scrollUpdate(){0!==this.pagesCount&&(this.#wh&&clearTimeout(this.#wh),this.#wh=setTimeout(()=>{this.#wh=null,this.update()},100),this.update())}#Vh(t,e=null){const{div:i,id:n}=t;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===Zs.PAGE&&(this.#Oh(),this.update()),!e&&!this.isInPresentationMode){const t=i.offsetLeft+i.clientLeft,n=t+i.clientWidth,{scrollLeft:r,clientWidth:s}=this.container;(this._scrollMode===Zs.HORIZONTAL||t<r||n>r+s)&&(e={left:0,top:0})}ta(i,e),!this._currentScaleValue&&this._location&&(this._location=null)}#jh(t){return t===this._currentScale||Math.abs(t-this._currentScale)<1e-15}#Uh(t,e,{noScroll:i=!1,preset:n=!1,drawingDelay:r=-1,origin:s=null}){if(this._currentScaleValue=e.toString(),this.#jh(t))return void(n&&this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e}));this.viewer.style.setProperty("--scale-factor",t*Ls.PDF_TO_CSS_UNITS);const a=r>=0&&r<1e3;this.refresh(!0,{scale:t,drawingDelay:a?r:-1}),a&&(this.#Lh=setTimeout(()=>{this.#Lh=null,this.refresh()},r));const o=this._currentScale;if(this._currentScale=t,!i){let e,i=this._currentPageNumber;if(!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(i=this._location.pageNumber,e=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:i,destArray:e,allowNegativeOffset:!0}),Array.isArray(s)){const e=t/o-1,[i,n]=this.containerTopLeft;this.container.scrollLeft+=(s[0]-n)*e,this.container.scrollTop+=(s[1]-i)*e}}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:n?e:void 0}),this.defaultRenderingQueue&&this.update()}get#Wh(){return this._spreadMode!==Js.NONE&&this._scrollMode!==Zs.HORIZONTAL?2:1}#Fh(t,e){let i=parseFloat(t);if(i>0)e.preset=!1,this.#Uh(i,t,e);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let r=40,s=5;this.isInPresentationMode?(r=s=4,this._spreadMode!==Js.NONE&&(r*=2)):this.removePageBorders?r=s=0:this._scrollMode===Zs.HORIZONTAL&&([r,s]=[s,r]);const a=(this.container.clientWidth-r)/n.width*n.scale/this.#Wh,o=(this.container.clientHeight-s)/n.height*n.scale;switch(t){case"page-actual":i=1;break;case"page-width":i=a;break;case"page-height":i=o;break;case"page-fit":i=Math.min(a,o);break;case"auto":const e=la(n)?a:Math.min(o,a);i=Math.min(1.25,e);break;default:return void console.error(`#setScale: "${t}" is an unknown zoom value.`)}e.preset=!0,this.#Uh(i,t,e)}}#Mh(){const t=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#Fh(this._currentScaleValue,{noScroll:!0}),this.#Vh(t)}pageLabelToPageNumber(t){if(!this._pageLabels)return null;const e=this._pageLabels.indexOf(t);return e<0?null:e+1}scrollPageIntoView({pageNumber:t,destArray:e=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:n=!1}){if(!this.pdfDocument)return;const r=Number.isInteger(t)&&this._pages[t-1];if(!r)return void console.error(`scrollPageIntoView: "${t}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!e)return void this._setCurrentPageNumber(t,!0);let s,a,o=0,l=0,d=0,h=0;const c=r.rotation%180!=0,u=(c?r.height:r.width)/r.scale/Ls.PDF_TO_CSS_UNITS,g=(c?r.width:r.height)/r.scale/Ls.PDF_TO_CSS_UNITS;let p=0;switch(e[1].name){case"XYZ":o=e[2],l=e[3],p=e[4],o=null!==o?o:0,l=null!==l?l:g;break;case"Fit":case"FitB":p="page-fit";break;case"FitH":case"FitBH":l=e[2],p="page-width",null===l&&this._location?(o=this._location.left,l=this._location.top):("number"!=typeof l||l<0)&&(l=g);break;case"FitV":case"FitBV":o=e[2],d=u,h=g,p="page-height";break;case"FitR":o=e[2],l=e[3],d=e[4]-o,h=e[5]-l;let t=40,i=5;this.removePageBorders&&(t=i=0),s=(this.container.clientWidth-t)/d/Ls.PDF_TO_CSS_UNITS,a=(this.container.clientHeight-i)/h/Ls.PDF_TO_CSS_UNITS,p=Math.min(Math.abs(s),Math.abs(a));break;default:return void console.error(`scrollPageIntoView: "${e[1].name}" is not a valid destination type.`)}if(n||(p&&p!==this._currentScale?this.currentScaleValue=p:0===this._currentScale&&(this.currentScaleValue="auto")),"page-fit"===p&&!e[4])return void this.#Vh(r);const f=[r.viewport.convertToViewportPoint(o,l),r.viewport.convertToViewportPoint(o+d,l+h)];let m=Math.min(f[0][0],f[1][0]),b=Math.min(f[0][1],f[1][1]);i||(m=Math.max(m,0),b=Math.max(b,0)),this.#Vh(r,{left:m,top:b})}_updateLocation(t){const e=this._currentScale,i=this._currentScaleValue,n=parseFloat(i)===e?Math.round(1e4*e)/100:i,r=t.id,s=this._pages[r-1],a=this.container,o=s.getPagePoint(a.scrollLeft-t.x,a.scrollTop-t.y),l=Math.round(o[0]),d=Math.round(o[1]);let h=`#page=${r}`;this.isInPresentationMode||(h+=`&zoom=${n},${l},${d}`),this._location={pageNumber:r,scale:n,top:d,left:l,rotation:this._pagesRotation,pdfOpenParams:h}}update(){const t=this._getVisiblePages(),e=t.views,i=e.length;if(0===i)return;const n=Math.max(10,2*i+1);this.#gh.resize(n,t.ids);for(const{view:o,visibleArea:l}of e)o.updateVisibleArea(l);for(const o of this.#gh)t.ids.has(o.id)||o.updateVisibleArea(null);this.renderingQueue.renderHighestPriority(t);const r=this._spreadMode===Js.NONE&&(this._scrollMode===Zs.PAGE||this._scrollMode===Zs.VERTICAL),s=this._currentPageNumber;let a=!1;for(const o of e){if(o.percent<100)break;if(o.id===s&&r){a=!0;break}}this._setCurrentPageNumber(a?s:e[0].id),this._updateLocation(t.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}#$h(){const t=this._getVisiblePages(),e=[],{ids:i,views:n}=t;for(const r of n){const{view:t}=r;t.hasEditableAnnotations()?e.push(r):i.delete(t.id)}return 0===e.length?null:(this.renderingQueue.renderHighestPriority({first:e[0],last:e.at(-1),views:e,ids:i}),i)}containsElement(t){return this.container.contains(t)}focus(){this.container.focus()}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return this.presentationModeState===Xs}get isChangingPresentationMode(){return this.presentationModeState===qs}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const t=this._scrollMode===Zs.PAGE?this.#Th.pages:this._pages,e=this._scrollMode===Zs.HORIZONTAL,i=e&&this._isContainerRtl;return function({scrollEl:t,views:e,sortByVisibility:i=!1,horizontal:n=!1,rtl:r=!1}){const s=t.scrollTop,a=s+t.clientHeight,o=t.scrollLeft,l=o+t.clientWidth,d=[],h=new Set,c=e.length;let u=ra(e,n?function(t){const e=t.div,i=e.offsetLeft+e.clientLeft,n=i+e.clientWidth;return r?i<l:n>o}:function(t){const e=t.div;return e.offsetTop+e.clientTop+e.clientHeight>s});u>0&&u<c&&!n&&(u=function(t,e,i){if(t<2)return t;let n=e[t].div,r=n.offsetTop+n.clientTop;r>=i&&(n=e[t-1].div,r=n.offsetTop+n.clientTop);for(let s=t-2;s>=0&&(n=e[s].div,!(n.offsetTop+n.clientTop+n.clientHeight<=r));--s)t=s;return t}(u,e,s));let g=n?l:-1;for(let m=u;m<c;m++){const t=e[m],i=t.div,r=i.offsetLeft+i.clientLeft,c=i.offsetTop+i.clientTop,u=i.clientWidth,p=i.clientHeight,f=r+u,b=c+p;if(-1===g)b>=a&&(g=b);else if((n?r:c)>g)break;if(b<=s||c>=a||f<=o||r>=l)continue;const v=Math.max(0,s-c),w=Math.max(0,o-r),x=v+Math.max(0,b-a),y=(u-(w+Math.max(0,f-l)))/u,A=(p-x)/p*y*100|0;d.push({id:t.id,x:r,y:c,visibleArea:100===A?null:{minX:w,minY:v,maxX:Math.min(f,l)-r,maxY:Math.min(b,a)-c},view:t,percent:A,widthPercent:100*y|0}),h.add(t.id)}const p=d[0],f=d.at(-1);return i&&d.sort(function(t,e){const i=t.percent-e.percent;return Math.abs(i)>.001?-i:t.id-e.id}),{first:p,last:f,views:d,ids:h}}({scrollEl:this.container,views:t,sortByVisibility:!0,horizontal:e,rtl:i})}cleanup(){for(const t of this._pages)t.renderingState!==Ws.FINISHED&&t.reset()}_cancelRendering(){for(const t of this._pages)t.cancelRendering()}async#Gh(t){if(t.pdfPage)return t.pdfPage;try{const e=await this.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(e),e}catch(e){return console.error("Unable to get page for page view",e),null}}#qh(t){if(1===t.first?.id)return!0;if(t.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case Zs.PAGE:return this.#Th.scrollDown;case Zs.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(t){const e=t||this._getVisiblePages(),i=this.#qh(e),n=this._spreadMode!==Js.NONE&&this._scrollMode!==Zs.HORIZONTAL,r=null!==this.#Lh||null!==this.#wh&&e.views.some(t=>t.detailView?.renderingCancelled),s=this.renderingQueue.getHighestPriority(e,this._pages,i,n,r);return!!s&&(this.#Gh(s).then(()=>{this.renderingQueue.renderView(s)}),!0)}get hasEqualPageSizes(){const t=this._pages[0];for(let e=1,i=this._pages.length;e<i;++e){const i=this._pages[e];if(i.width!==t.width||i.height!==t.height)return!1}return!0}getPagesOverview(){let t;return this._pages.map(e=>{const i=e.pdfPage.getViewport({scale:1}),n=la(i);if(void 0===t)t=n;else if(this.enablePrintAutoRotate&&n!==t)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(t){if(!(t instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${t}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=t,this.refresh(!1,{optionalContentConfigPromise:t}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:t}))}get scrollMode(){return this._scrollMode}set scrollMode(t){if(this._scrollMode!==t){if(!function(t){return Number.isInteger(t)&&Object.values(Zs).includes(t)&&t!==Zs.UNKNOWN}(t))throw new Error(`Invalid scroll mode: ${t}`);this.pagesCount>Vl||(this._previousScrollMode=this._scrollMode,this._scrollMode=t,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(t=null){const e=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",e===Zs.HORIZONTAL),i.classList.toggle("scrollWrapped",e===Zs.WRAPPED),this.pdfDocument&&t&&(e===Zs.PAGE?this.#Oh():this._previousScrollMode===Zs.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Fh(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(t){if(this._spreadMode!==t){if(!function(t){return Number.isInteger(t)&&Object.values(Js).includes(t)&&t!==Js.UNKNOWN}(t))throw new Error(`Invalid spread mode: ${t}`);this._spreadMode=t,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(t=null){if(!this.pdfDocument)return;const e=this.viewer,i=this._pages;if(this._scrollMode===Zs.PAGE)this.#Oh();else if(e.textContent="",this._spreadMode===Js.NONE)for(const n of this._pages)e.append(n.div);else{const t=this._spreadMode-1;let n=null;for(let r=0,s=i.length;r<s;++r)null===n?(n=document.createElement("div"),n.className="spread",e.append(n)):r%2===t&&(n=n.cloneNode(!1),e.append(n)),n.append(i[r].div)}t&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#Fh(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(t,!0),this.update())}_getPageAdvance(t,e=!1){switch(this._scrollMode){case Zs.WRAPPED:{const{views:i}=this._getVisiblePages(),n=new Map;for(const{id:t,y:e,percent:r,widthPercent:s}of i){if(0===r||s<100)continue;let i=n.get(e);i||n.set(e,i||=[]),i.push(t)}for(const r of n.values()){const i=r.indexOf(t);if(-1===i)continue;const n=r.length;if(1===n)break;if(e)for(let e=i-1,s=0;e>=s;e--){const i=r[e],n=r[e+1]-1;if(i<n)return t-n}else for(let e=i+1,s=n;e<s;e++){const i=r[e],n=r[e-1]+1;if(i>n)return n-t}if(e){const e=r[0];if(e<t)return t-e+1}else{const e=r[n-1];if(e>t)return e-t+1}break}break}case Zs.HORIZONTAL:break;case Zs.PAGE:case Zs.VERTICAL:{if(this._spreadMode===Js.NONE)break;const i=this._spreadMode-1;if(e&&t%2!==i)break;if(!e&&t%2===i)break;const{views:n}=this._getVisiblePages(),r=e?t-1:t+1;for(const{id:t,percent:e,widthPercent:s}of n)if(t===r){if(e>0&&100===s)return 2;break}break}}return 1}nextPage(){const t=this._currentPageNumber,e=this.pagesCount;if(t>=e)return!1;const i=this._getPageAdvance(t,!1)||1;return this.currentPageNumber=Math.min(t+i,e),!0}previousPage(){const t=this._currentPageNumber;if(t<=1)return!1;const e=this._getPageAdvance(t,!0)||1;return this.currentPageNumber=Math.max(t-e,1),!0}updateScale({drawingDelay:t,scaleFactor:e=null,steps:i=null,origin:n}){if(null===i&&null===e)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let r=this._currentScale;if(e>0&&1!==e)r=Math.round(r*e*100)/100;else if(i){const t=i>0?1.1:1/1.1,e=i>0?Math.ceil:Math.floor;i=Math.abs(i);do{r=e(10*(r*t).toFixed(2))/10}while(--i>0)}r=ws(r,.1,10),this.#Fh(r,{noScroll:!1,drawingDelay:t,origin:n})}increaseScale(t={}){this.updateScale({...t,steps:t.steps??1})}decreaseScale(t={}){this.updateScale({...t,steps:-(t.steps??1)})}#Ph(t=this.container.clientHeight){t!==this.#Sh&&(this.#Sh=t,da.setProperty("--viewer-container-height",`${t}px`))}#_h(t){for(const e of t)if(e.target===this.container){this.#Ph(Math.floor(e.borderBoxSize[0].blockSize)),this.#bh=null;break}}get containerTopLeft(){return this.#bh||=[this.container.offsetTop,this.container.offsetLeft]}#zh(){null!==this.#Lh&&(clearTimeout(this.#Lh),this.#Lh=null),null!==this.#wh&&(clearTimeout(this.#wh),this.#wh=null)}#Hh(){this.#xh?.abort(),this.#xh=null,null!==this.#yh&&(clearTimeout(this.#yh),this.#yh=null)}#Nh(t){switch(t){case Kr.STAMP:this.#st?.loadModel("altText");break;case Kr.SIGNATURE:this.#dt?.loadSignatures()}}get annotationEditorMode(){return this.#mh?this.#fh:Kr.DISABLE}set annotationEditorMode({mode:t,editId:e=null,isFromKeyboard:i=!1,mustEnterInEditMode:n=!1}){if(!this.#mh)throw new Error("The AnnotationEditor is not enabled.");if(this.#fh===t)return;if(!Wl(t))throw new Error(`Invalid AnnotationEditor mode: ${t}`);if(!this.pdfDocument)return;this.#Nh(t);const{eventBus:r,pdfDocument:s}=this,a=async()=>{this.#Hh(),this.#fh=t,await this.#mh.updateMode(t,e,i,n),t===this.#fh&&s===this.pdfDocument&&r.dispatch("annotationeditormodechanged",{source:this,mode:t})};if(t===Kr.NONE||this.#fh===Kr.NONE){const e=t!==Kr.NONE;e||this.pdfDocument.annotationStorage.resetModifiedIds();for(const t of this._pages)t.toggleEditingMode(e);const i=this.#$h();if(e&&i){this.#Hh(),this.#xh=new AbortController;const t=AbortSignal.any([this.#_l.signal,this.#xh.signal]);return void r._on("pagerendered",({pageNumber:t})=>{i.delete(t),0===i.size&&(this.#yh=setTimeout(a,0))},{signal:t})}}a()}refresh(t=!1,e=Object.create(null)){if(this.pdfDocument){for(const t of this._pages)t.update(e);this.#zh(),t||this.update()}}}class ql extends Gl{_resetView(){super._resetView(),this._scrollMode=Zs.PAGE,this._spreadMode=Js.NONE}set scrollMode(t){}_updateScrollMode(){}set spreadMode(t){}_updateSpreadMode(){}}globalThis.pdfjsViewer={AnnotationLayerBuilder:Ha,DownloadManager:ja,EventBus:$a,FindState:ya,GenericL10n:ll,LinkTarget:Na,parseQueryString:ea,PDFFindController:Ba,PDFHistory:class{#_l=null;constructor({linkService:t,eventBus:e}){this.linkService=t,this.eventBus=e,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",t=>{this._isPagesLoaded=!!t.pagesCount},{once:!0})})}initialize({fingerprint:t,resetHistory:e=!1,updateUrl:i=!1}){if(!t||"string"!=typeof t)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const n=""!==this._fingerprint&&this._fingerprint!==t;this._fingerprint=t,this._updateUrl=!0===i,this._initialized=!0,this.#Xh();const r=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=dl(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this.#Yh(r,!0)||e){const{hash:t,page:i,rotation:r}=this.#Kh(!0);return!t||n||e?void this.#Qh(null,!0):void this.#Qh({hash:t,page:i,rotation:r},!0)}const s=r.destination;this.#Zh(s,r.uid,!0),void 0!==s.rotation&&(this._initialRotation=s.rotation),s.dest?(this._initialBookmark=JSON.stringify(s.dest),this._destination.page=null):s.hash?this._initialBookmark=s.hash:s.page&&(this._initialBookmark=`page=${s.page}`)}reset(){this._initialized&&(this.#Jh(),this._initialized=!1,this.#tc()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:t=null,explicitDest:e,pageNumber:i}){if(!this._initialized)return;if(t&&"string"!=typeof t)return void console.error(`PDFHistory.push: "${t}" is not a valid namedDest parameter.`);if(!Array.isArray(e))return void console.error(`PDFHistory.push: "${e}" is not a valid explicitDest parameter.`);if(!this.#ec(i)&&(null!==i||this._destination))return void console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);const n=t||JSON.stringify(e);if(!n)return;let r=!1;if(this._destination&&(s=this._destination.hash,a=n,"string"==typeof s&&"string"==typeof a&&(s===a||ea(s).get("nameddest")===a)||function(t,e){function i(t,e){if(typeof t!=typeof e)return!1;if(Array.isArray(t)||Array.isArray(e))return!1;if(null!==t&&"object"==typeof t&&null!==e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!i(t[n],e[n]))return!1;return!0}return t===e||Number.isNaN(t)&&Number.isNaN(e)}if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(!i(t[n],e[n]))return!1;return!0}(this._destination.dest,e))){if(this._destination.page)return;r=!0}var s,a;this._popStateInProgress&&!r||(this.#Qh({dest:e,hash:n,page:i,rotation:this.linkService.rotation},r),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(t){this._initialized&&(this.#ec(t)?this._destination?.page!==t&&(this._popStateInProgress||(this.#Qh({dest:null,hash:`page=${t}`,page:t,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))):console.error(`PDFHistory.pushPage: "${t}" is not a valid page number.`))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this.#ic()}back(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;this.#Yh(t)&&t.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const t=window.history.state;this.#Yh(t)&&t.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}#Qh(t,e=!1){const i=e||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:t};let r;if(this.#Zh(t,n.uid),this._updateUrl&&t?.hash){const{href:e,protocol:i}=document.location;"file:"!==i&&(r=zs(e,t.hash))}i?window.history.replaceState(n,"",r):window.history.pushState(n,"",r)}#ic(t=!1){if(!this._position)return;let e=this._position;if(t&&(e=Object.assign(Object.create(null),this._position),e.temporary=!0),!this._destination)return void this.#Qh(e);if(this._destination.temporary)return void this.#Qh(e,!0);if(this._destination.hash===e.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let i=!1;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(void 0!==this._destination.dest||!this._destination.first)return;i=!0}this.#Qh(e,i)}#ec(t){return Number.isInteger(t)&&t>0&&t<=this.linkService.pagesCount}#Yh(t,e=!1){if(!t)return!1;if(t.fingerprint!==this._fingerprint){if(!e)return!1;{if("string"!=typeof t.fingerprint||t.fingerprint.length!==this._fingerprint.length)return!1;const[e]=performance.getEntriesByType("navigation");if("reload"!==e?.type)return!1}}return!(!Number.isInteger(t.uid)||t.uid<0)&&null!==t.destination&&"object"==typeof t.destination}#Zh(t,e,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&t?.temporary&&delete t.temporary,this._destination=t,this._uid=e,this._maxUid=Math.max(this._maxUid,e),this._numPositionUpdates=0}#Kh(t=!1){const e=unescape(dl()).substring(1),i=ea(e),n=i.get("nameddest")||"";let r=0|i.get("page");return(!this.#ec(r)||t&&n.length>0)&&(r=null),{hash:e,page:r,rotation:this.linkService.rotation}}#nc({location:t}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:t.pdfOpenParams.substring(1),page:this.linkService.page,first:t.pageNumber,rotation:t.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this.#ic(!0),this._updateViewareaTimeout=null},1e3))}#rc({state:t}){const e=dl(),i=this._currentHash!==e;if(this._currentHash=e,!t){this._uid++;const{hash:t,page:e,rotation:i}=this.#Kh();return void this.#Qh({hash:t,page:e,rotation:i},!0)}if(!this.#Yh(t))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,async function({target:t,name:e,delay:i=0}){if("object"!=typeof t||!(Number.isInteger(i)&&i>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");const{promise:n,resolve:r}=Promise.withResolvers(),s=new AbortController;function a(t){s.abort(),clearTimeout(o),r(t)}t[t instanceof $a?"_on":"addEventListener"](e,a.bind(null,Ua),{signal:s.signal});const o=setTimeout(a.bind(null,Wa),i);return n}({target:window,name:"hashchange",delay:1e3}).then(()=>{this._blockHashChange--}));const n=t.destination;this.#Zh(n,t.uid,!0),oa(n.rotation)&&(this.linkService.rotation=n.rotation),n.dest?this.linkService.goToDestination(n.dest):n.hash?this.linkService.setHash(n.hash):n.page&&(this.linkService.page=n.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}#Jh(){this._destination&&!this._destination.temporary||this.#ic()}#Xh(){if(this.#_l)return;this.#_l=new AbortController;const{signal:t}=this.#_l;this.eventBus._on("updateviewarea",this.#nc.bind(this),{signal:t}),window.addEventListener("popstate",this.#rc.bind(this),{signal:t}),window.addEventListener("pagehide",this.#Jh.bind(this),{signal:t})}#tc(){this.#_l?.abort(),this.#_l=null}},PDFLinkService:Oa,PDFPageView:Nl,PDFScriptingManager:class extends zl{constructor(t){t.externalServices||window.addEventListener("updatefromsandbox",e=>{t.eventBus.dispatch("updatefromsandbox",{source:window,detail:e.detail})}),t.externalServices||={createScripting:()=>new Ol(t.sandboxBundleSrc)},t.docProperties||=t=>async function(t){const{info:e,metadata:i,contentDispositionFilename:n,contentLength:r}=await t.getMetadata();return{...e,baseURL:"",filesize:r||(await t.getDownloadInfo()).length,filename:n||hs(""),metadata:i?.getRaw(),authors:i?.get("dc:creator"),numPages:t.numPages,URL:""}}(t),super(t)}},PDFSinglePageViewer:ql,PDFViewer:Gl,ProgressBar:class{#sc=null;#ac=null;#oc=0;#lc=null;#ji=!0;constructor(t){this.#sc=t.classList,this.#lc=t.style}get percent(){return this.#oc}set percent(t){this.#oc=ws(t,0,100),isNaN(t)?this.#sc.add("indeterminate"):(this.#sc.remove("indeterminate"),this.#lc.setProperty("--progressBar-percent",`${this.#oc}%`))}setWidth(t){if(!t)return;const e=t.parentNode.offsetWidth-t.offsetWidth;e>0&&this.#lc.setProperty("--progressBar-end-offset",`${e}px`)}setDisableAutoFetch(t=5e3){100===this.#oc||isNaN(this.#oc)||(this.#ac&&clearTimeout(this.#ac),this.show(),this.#ac=setTimeout(()=>{this.#ac=null,this.hide()},t))}hide(){this.#ji&&(this.#ji=!1,this.#sc.add("hidden"))}show(){this.#ji||(this.#ji=!0,this.#sc.remove("hidden"))}},RenderingStates:Ws,ScrollMode:Zs,SimpleLinkService:za,SpreadMode:Js,StructTreeLayerBuilder:Dl,TextLayerBuilder:Fl,XfaLayerBuilder:Il};const Xl=t=>{let e;const i=new Set,n=(t,n)=>{const r="function"==typeof t?t(e):t;if(!Object.is(r,e)){const t=e;e=(null!=n?n:"object"!=typeof r||null===r)?r:Object.assign({},e,r),i.forEach(i=>i(e,t))}},r=()=>e,s={setState:n,getState:r,getInitialState:()=>a,subscribe:t=>(i.add(t),()=>i.delete(t))},a=e=t(n,r,s);return s};function Yl(t,e,i,n){return new(i||(i=Promise))(function(r,s){function a(t){try{l(n.next(t))}catch(e){s(e)}}function o(t){try{l(n.throw(t))}catch(e){s(e)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,o)}l((n=n.apply(t,e||[])).next())})}function Kl(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}function Ql(t,e,i,n,r){if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r?r.value=i:e.set(t,i),i}"function"==typeof SuppressedError&&SuppressedError;const Zl=0,Jl=1,td=2,ed=3,id=0,nd=1,rd=2,sd=3,ad=1,od={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},ld={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};class dd{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}}function hd(t){const e=t.deltaMode;let i=function(t){let e=Math.hypot(t.deltaX,t.deltaY);const i=Math.atan2(t.deltaY,t.deltaX);return-.25*Math.PI<i&&i<.75*Math.PI&&(e=-e),e}(t);return e===WheelEvent.DOM_DELTA_PIXEL?i/=900:e===WheelEvent.DOM_DELTA_LINE&&(i/=30),i}function cd(t){return Number.isInteger(t)&&t%90==0}new Promise(function(t){window.requestAnimationFrame(t)}),document.documentElement.style,function(){const t=document.createElement("div");t.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)","calc(1320px)"===t.style.width&&Math.fround}();class ud{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(t){this.pdfViewer=t}setThumbnailViewer(t){this.pdfThumbnailViewer=t}isHighestPriority(t){return this.highestPriorityPage===t.renderingId}renderHighestPriority(t){var e;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(t)||this.isThumbnailViewEnabled&&(null===(e=this.pdfThumbnailViewer)||void 0===e?void 0:e.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(t,e,i,n=!1){const r=t.views,s=r.length;if(0===s)return null;for(let h=0;h<s;h++){const t=r[h].view;if(!this.isViewFinished(t))return t}const a=t.first.id,o=t.last.id;if(o-a+1>s){const n=t.ids;for(let t=1,r=o-a;t<r;t++){const r=i?a+t:o-t;if(n.has(r))continue;const s=e[r-1];if(!this.isViewFinished(s))return s}}let l=i?o:a-2,d=e[l];return d&&!this.isViewFinished(d)||n&&(l+=i?1:-1,d=e[l],d&&!this.isViewFinished(d))?d:null}isViewFinished(t){return t.renderingState===ed}renderView(t){switch(t.renderingState){case ed:return!1;case td:this.highestPriorityPage=t.renderingId,t.resume();break;case Jl:this.highestPriorityPage=t.renderingId;break;case Zl:this.highestPriorityPage=t.renderingId,t.draw().finally(()=>{this.renderHighestPriority()}).catch(t=>{t instanceof le||console.error("renderView:",t)})}return!0}}var gd,pd,fd,md,bd,vd,wd,xd,yd,Ad,Cd,Ed,Sd,kd,_d;class Td{static getCanvas(t,e){const i=Ql(this,gd,Kl(this,gd,"f",pd)||document.createElement("canvas"),0,pd);i.width=t,i.height=e;const n=i.getContext("2d",{alpha:!1});return n.save(),n.fillStyle="rgb(255, 255, 255)",n.fillRect(0,0,t,e),n.restore(),[i,i.getContext("2d")]}static destroyCanvas(){const t=Kl(this,gd,"f",pd);t&&(t.width=0,t.height=0),Ql(this,gd,null,0,pd)}}gd=Td,pd={value:null};class Ld{constructor({container:t,eventBus:e,id:i,defaultViewport:n,optionalContentConfigPromise:r,linkService:s,renderingQueue:a,pageColors:o,enableHWA:l,store:d,thumbnailWidth:h}){fd.add(this),this.id=i,this.renderingId="thumbnail"+i,this.pageLabel=null,this.pdfPage=null,this.rotation=0,this.viewport=n,this.pdfPageRotate=n.rotation,this._optionalContentConfigPromise=r||null,this.pageColors=o||null,this.enableHWA=l||!1,this.eventBus=e,this.linkService=s,this.renderingQueue=a,this.renderTask=null,this.renderingState=Zl,this.resume=null,this.store=d,this.thumbnailWidth=h,this.loaded=!1;const c=document.createElement("div");c.className="thumbnail pdfSlickThumbHolder",c.setAttribute("data-page-number",this.id.toString()),this.div=c,Kl(this,fd,"m",md).call(this),t.append(c)}setPdfPage(t){this.pdfPage=t,this.pdfPageRotate=t.rotate;const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:1,rotation:e}),this.reset()}reset(){this.cancelRendering(),this.renderingState=Zl,this.div.removeAttribute("data-loaded"),this.loaded=!1,Kl(this,fd,"m",md).call(this)}update({rotation:t=null}){"number"==typeof t&&(this.rotation=t);const e=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:e}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}draw(){return Yl(this,void 0,void 0,function*(){if(this.renderingState!==Zl)return void console.error("Must be in new state before drawing");const{pdfPage:t}=this;if(!t)throw this.renderingState=ed,new Error("pdfPage is not loaded");this.renderingState=Jl;const{ctx:e,canvas:i,transform:n}=Kl(this,fd,"m",bd).call(this,2),r={canvasContext:e,transform:n,viewport:this.viewport.clone({scale:2*this.scale}),optionalContentConfigPromise:this._optionalContentConfigPromise,pageColors:this.pageColors},s=this.renderTask=t.render(r);s.onContinue=t=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=td,void(this.resume=()=>{this.renderingState=Jl,t()});t()};const a=s.promise.then(()=>Kl(this,fd,"m",wd).call(this,s,i),t=>Kl(this,fd,"m",wd).call(this,s,i,t));return a.finally(()=>{i.width=0,i.height=0,this.eventBus.dispatch("thumbnailrendered",{source:this,pageNumber:this.id,pdfPage:this.pdfPage})}),a})}setImage(t){if(this.renderingState!==Zl)return;const{thumbnailCanvas:e,pdfPage:i,scale:n}=t;e&&(this.pdfPage||this.setPdfPage(i),n<this.scale||(this.renderingState=ed,Kl(this,fd,"m",vd).call(this,e)))}setPageLabel(t){this.pageLabel="string"==typeof t?t:null}}fd=new WeakSet,md=function(){const{width:t,height:e}=this.viewport,i=t/e;this.canvasWidth=this.thumbnailWidth,this.canvasHeight=this.canvasWidth/i|0,this.scale=this.canvasWidth/t;const{style:n}=this.div;n.setProperty("--thumbnail-width",`${this.canvasWidth}px`),n.setProperty("--thumbnail-height",`${this.canvasHeight}px`)},bd=function(t=1,e=this.enableHWA){const i=document.createElement("canvas"),n=i.getContext("2d",{alpha:!1,willReadFrequently:!e}),r=new dd;return i.width=t*this.canvasWidth*r.sx|0,i.height=t*this.canvasHeight*r.sy|0,{ctx:n,canvas:i,transform:r.scaled?[r.sx,0,0,r.sy,0,0]:null}},vd=function(t){if(this.renderingState!==ed)throw new Error("#convertCanvasToImage: Rendering has not finished.");const e=Kl(this,fd,"m",xd).call(this,t);this.src=e.toDataURL(),this.div.setAttribute("data-loaded","true"),this.loaded=!0,this.store.getState()._setThumbnailView(this.id,this),e.width=0,e.height=0},wd=function(t,e){return Yl(this,arguments,void 0,function*(t,e,i=null){if(t===this.renderTask&&(this.renderTask=null),!(i instanceof le)&&(this.renderingState=ed,Kl(this,fd,"m",vd).call(this,e),i))throw i})},xd=function(t){const{ctx:e,canvas:i}=Kl(this,fd,"m",bd).call(this,1,!0);if(t.width<=2*i.width)return e.drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),i;let n=i.width<<3,r=i.height<<3;const[s,a]=Td.getCanvas(n,r);for(;n>t.width||r>t.height;)n>>=1,r>>=1;for(a.drawImage(t,0,0,t.width,t.height,0,0,n,r);n>2*i.width;)a.drawImage(s,0,0,n,r,0,0,n>>1,r>>1),n>>=1,r>>=1;return e.drawImage(s,0,0,n,r,0,0,i.width,i.height),i};const Dd="selected";class Pd{constructor({container:t,eventBus:e,linkService:i,renderingQueue:n,pageColors:r,abortSignal:s,enableHWA:a,store:o,thumbnailWidth:l}){yd.add(this),this.container=t,this.eventBus=e,this.linkService=i,this.renderingQueue=n,this.pageColors=r||null,this.enableHWA=a||!1,this.store=o,this.thumbnailWidth=l,this.scroll=function(t,e,i){const n=function(i){s||(s=window.requestAnimationFrame(function(){s=null;const i=t.scrollLeft,n=r.lastX;i!==n&&(r.right=i>n),r.lastX=i;const a=t.scrollTop,o=r.lastY;a!==o&&(r.down=a>o),r.lastY=a,e(r)}))},r={right:!0,down:!0,lastX:t.scrollLeft,lastY:t.scrollTop,_eventHandler:n};let s=null;return t.addEventListener("scroll",n,{useCapture:!0,signal:i}),null==i||i.addEventListener("abort",()=>window.cancelAnimationFrame(s),{once:!0}),r}(this.container,Kl(this,yd,"m",Ad).bind(this),s),Kl(this,yd,"m",Ed).call(this)}getThumbnail(t){return this._thumbnails[t]}scrollThumbnailIntoView(t){if(!this.pdfDocument)return;const e=this._thumbnails[t-1];if(!e)return void console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');t!==this._currentPageNumber&&(this._thumbnails[this._currentPageNumber-1].div.classList.remove(Dd),e.div.classList.add(Dd));const{first:i,last:n,views:r}=Kl(this,yd,"m",Cd).call(this);if(r.length>0){let s=!1;if(t<=i.id||t>=n.id)s=!0;else for(const{id:e,percent:i}of r)if(e===t){s=i<100;break}s&&function(t,e,i=!1){let n=t.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let r=t.offsetTop+t.clientTop,s=t.offsetLeft+t.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||i&&(n.classList.contains("markedContent")||"hidden"===getComputedStyle(n).overflow);)if(r+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent,!n)return;e&&(void 0!==e.top&&(r+=e.top),void 0!==e.left&&(s+=e.left,n.scrollLeft=s)),n.scrollTop=r}(e.div,{top:-19})}this._currentPageNumber=t}get pagesRotation(){return this._pagesRotation}set pagesRotation(t){if(!cd(t))throw new Error("Invalid thumbnails rotation angle.");if(!this.pdfDocument)return;if(this._pagesRotation===t)return;this._pagesRotation=t;const e={rotation:t};for(const i of this._thumbnails)i.update(e)}cleanup(){for(const t of this._thumbnails)t.renderingState!==ed&&t.reset();Td.destroyCanvas()}setDocument(t){if(this.pdfDocument&&(Kl(this,yd,"m",Sd).call(this),Kl(this,yd,"m",Ed).call(this)),this.pdfDocument=t,!t)return;const e=t.getPage(1),i=t.getOptionalContentConfig({intent:"display"});e.then(e=>{var n;const r=t.numPages,s=e.getViewport({scale:1});for(let t=1;t<=r;++t){const e=new Ld({container:this.container,eventBus:this.eventBus,id:t,defaultViewport:s.clone(),optionalContentConfigPromise:i,linkService:this.linkService,renderingQueue:this.renderingQueue,pageColors:this.pageColors,enableHWA:this.enableHWA,store:this.store,thumbnailWidth:this.thumbnailWidth});this._thumbnails.push(e)}null===(n=this._thumbnails[0])||void 0===n||n.setPdfPage(e),this._thumbnails[this._currentPageNumber-1].div.classList.add(Dd),this.store.getState()._setThumbnailsViews(this._thumbnails)}).catch(t=>{console.error("Unable to initialize thumbnail viewer",t)})}setPageLabels(t){var e,i;if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let t=0,n=this._thumbnails.length;t<n;t++)this._thumbnails[t].setPageLabel(null!==(i=null===(e=this._pageLabels)||void 0===e?void 0:e[t])&&void 0!==i?i:null)}}forceRendering(){const t=Kl(this,yd,"m",Cd).call(this),e=Kl(this,yd,"m",_d).call(this,t),i=this.renderingQueue.getHighestPriority(t,this._thumbnails,e);return!!i&&(Kl(this,yd,"m",kd).call(this,i).then(()=>{this.renderingQueue.renderView(i)}),!0)}}yd=new WeakSet,Ad=function(){this.renderingQueue.renderHighestPriority()},Cd=function(){return function({scrollEl:t,views:e,sortByVisibility:i=!1,horizontal:n=!1,rtl:r=!1}){const s=t.scrollTop,a=s+t.clientHeight,o=t.scrollLeft,l=o+t.clientWidth,d=[],h=new Set,c=e.length;let u=function(t,e,i=0){let n=i,r=t.length-1;if(r<0||!e(t[r]))return t.length;if(e(t[n]))return n;for(;n<r;){const i=n+r>>1;e(t[i])?r=i:n=i+1}return n}(e,n?function(t){const e=t.div,i=e.offsetLeft+e.clientLeft,n=i+e.clientWidth;return r?i<l:n>o}:function(t){const e=t.div;return e.offsetTop+e.clientTop+e.clientHeight>s});u>0&&u<c&&!n&&(u=function(t,e,i){if(t<2)return t;let n=e[t].div,r=n.offsetTop+n.clientTop;r>=i&&(n=e[t-1].div,r=n.offsetTop+n.clientTop);for(let s=t-2;s>=0&&(n=e[s].div,!(n.offsetTop+n.clientTop+n.clientHeight<=r));--s)t=s;return t}(u,e,s));let g=n?l:-1;for(let m=u;m<c;m++){const t=e[m],i=t.div,r=i.offsetLeft+i.clientLeft,c=i.offsetTop+i.clientTop,u=i.clientWidth,p=i.clientHeight,f=r+u,b=c+p;if(-1===g)b>=a&&(g=b);else if((n?r:c)>g)break;if(b<=s||c>=a||f<=o||r>=l)continue;const v=Math.max(0,s-c)+Math.max(0,b-a),w=(u-(Math.max(0,o-r)+Math.max(0,f-l)))/u,x=(p-v)/p*w*100|0;d.push({id:t.id,x:r,y:c,view:t,percent:x,widthPercent:100*w|0}),h.add(t.id)}const p=d[0],f=d.at(-1);return i&&d.sort(function(t,e){const i=t.percent-e.percent;return Math.abs(i)>.001?-i:t.id-e.id}),{first:p,last:f,views:d,ids:h}}({scrollEl:this.container,views:this._thumbnails})},Ed=function(){this._thumbnails=[],this._currentPageNumber=1,this._pageLabels=null,this._pagesRotation=0,this.container.textContent=""},Sd=function(){for(const t of this._thumbnails)t.cancelRendering()},kd=function(t){return Yl(this,void 0,void 0,function*(){if(t.pdfPage)return t.pdfPage;try{const e=yield this.pdfDocument.getPage(t.id);return t.pdfPage||t.setPdfPage(e),e}catch(e){return console.error("Unable to get page for thumb view",e),null}})},_d=function(t){var e,i;return 1===(null===(e=t.first)||void 0===e?void 0:e.id)||(null===(i=t.last)||void 0===i?void 0:i.id)!==this._thumbnails.length&&this.scroll.down};let Md=null;class Fd{constructor({pdfDocument:t,pagesOverview:e,printContainer:i,printResolution:n,printAnnotationStoragePromise:r=null}){this.pdfDocument=t,this.pagesOverview=e,this.printContainer=i,this._printResolution=n||150,this._optionalContentConfigPromise=t.getOptionalContentConfig({intent:"print"}),this._printAnnotationStoragePromise=r||Promise.resolve(),this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}layout(){this.throwIfInactive();const t=document.querySelector("body");t.setAttribute("data-pdfjsprinting","true");const{width:e,height:i}=this.pagesOverview[0];this.pagesOverview.every(t=>t.width===e&&t.height===i)||console.warn("Not all pages have the same size. The printed result may be incorrect!"),this.pageStyleSheet=document.createElement("style"),this.pageStyleSheet.textContent=`@page { size: ${e}pt ${i}pt;}`,t.append(this.pageStyleSheet)}destroy(){Md===this&&(this.printContainer.textContent="",document.querySelector("body").removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,Md=null)}renderPages(t){if(this.pdfDocument.isPureXfa)return function(t,e){const i=e.allXfaHtml,n=new za,r=Math.round(100*se.PDF_TO_CSS_UNITS)/100;for(const s of null==i?void 0:i.children){const i=document.createElement("div");i.className="xfaPrintedPage",t.append(i);const a=new Il({pdfPage:null,annotationStorage:e.annotationStorage,linkService:n,xfaHtml:s}),o=be(s,{scale:r});a.render({viewport:o,intent:"print"}),i.append(a.div)}}(this.printContainer,this.pdfDocument),Promise.resolve();const e=this.pagesOverview.length,i=(n,r)=>{if(this.throwIfInactive(),++this.currentPage>=e)return t({index:e,total:e}),void n();const s=this.currentPage;t({index:s,total:e}),function(t,e,i,n,r,s,a){const o=t.scratchCanvas,l=r/se.PDF;o.width=Math.floor(n.width*l),o.height=Math.floor(n.height*l);const d=o.getContext("2d");return d.save(),d.fillStyle="rgb(255, 255, 255)",d.fillRect(0,0,o.width,o.height),d.restore(),Promise.all([e.getPage(i),a]).then(function([t,e]){const i={canvasContext:d,transform:[l,0,0,l,0,0],viewport:t.getViewport({scale:1,rotation:n.rotation}),intent:"print",annotationMode:ot.ENABLE_STORAGE,optionalContentConfigPromise:s,printAnnotationStorage:e};return t.render(i).promise.catch(t=>{throw t instanceof le||console.error(t),t})})}(this,this.pdfDocument,s+1,this.pagesOverview[s],this._printResolution,this._optionalContentConfigPromise,this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then(function(){i(n,r)},r)};return new Promise(i)}useRenderedPage(){this.throwIfInactive();const t=document.createElement("img");this.scratchCanvas.toBlob(e=>{t.src=URL.createObjectURL(e)});const e=document.createElement("div");e.className="printedPage",e.append(t),this.printContainer.append(e);const{promise:i,resolve:n,reject:r}=Promise.withResolvers();return t.onload=n,t.onerror=r,i.catch(()=>{}).then(()=>{URL.revokeObjectURL(t.src)}),i}performPrint(){return this.throwIfInactive(),new Promise(t=>{setTimeout(()=>{this.active?(window.print(),setTimeout(t,20)):t()},0)})}get active(){return this===Md}throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}}const Id={instance:{supportsPrinting:!0,createPrintService(t){if(Md)throw new Error("The print service is created and active.");return Md=new Fd(t)}}};var Rd,Bd,Nd,Od,zd,Hd,Vd,jd,Ud,Wd,$d,Gd,qd,Xd,Yd,Kd,Qd,Zd,Jd;const th="pdfPresentationMode",eh="pdfPresentationModeControls",ih=Math.PI/6;class nh{constructor({container:t,pdfViewer:e,eventBus:i}){Rd.add(this),Bd.set(this,id),Nd.set(this,null),Od.set(this,null),zd.set(this,null),this.container=t,this.pdfViewer=e,this.eventBus=i,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null}request(){return Yl(this,void 0,void 0,function*(){const{container:t,pdfViewer:e}=this;if(this.active||!e.pagesCount||!t.requestFullscreen)return!1;Kl(this,Rd,"m",Zd).call(this),Kl(this,Rd,"m",Vd).call(this,rd);const i=t.requestFullscreen();Ql(this,Nd,{pageNumber:e.currentPageNumber,scaleValue:e.currentScaleValue,scrollMode:e.scrollMode,spreadMode:null,annotationEditorMode:null}),e.spreadMode===ld.NONE||e.pageViewsReady&&e.hasEqualPageSizes||(console.warn("Ignoring Spread modes when entering PresentationMode, since the document may contain varying page sizes."),Kl(this,Nd,"f").spreadMode=e.spreadMode),e.annotationEditorMode!==dt.DISABLE&&(Kl(this,Nd,"f").annotationEditorMode=e.annotationEditorMode);try{return yield i,e.focus(),!0}catch(gd){Kl(this,Rd,"m",Jd).call(this),Kl(this,Rd,"m",Vd).call(this,nd)}return!1})}get active(){return Kl(this,Bd,"f")===rd||Kl(this,Bd,"f")===sd}}Bd=new WeakMap,Nd=new WeakMap,Od=new WeakMap,zd=new WeakMap,Rd=new WeakSet,Hd=function(t){if(!this.active)return;t.preventDefault();const e=hd(t),i=Date.now(),n=this.mouseScrollTimeStamp;if(!(i>n&&i-n<50)&&((this.mouseScrollDelta>0&&e<0||this.mouseScrollDelta<0&&e>0)&&Kl(this,Rd,"m",Xd).call(this),this.mouseScrollDelta+=e,Math.abs(this.mouseScrollDelta)>=.1)){const t=this.mouseScrollDelta;Kl(this,Rd,"m",Xd).call(this),(t>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=i)}},Vd=function(t){Ql(this,Bd,t),this.eventBus.dispatch("presentationmodechanged",{source:this,state:t})},jd=function(){var t;Kl(this,Rd,"m",Vd).call(this,sd),this.container.classList.add(th),setTimeout(()=>{this.pdfViewer.scrollMode=od.PAGE,null!==Kl(this,Nd,"f").spreadMode&&(this.pdfViewer.spreadMode=ld.NONE),this.pdfViewer.currentPageNumber=Kl(this,Nd,"f").pageNumber,this.pdfViewer.currentScaleValue="page-fit",null!==Kl(this,Nd,"f").annotationEditorMode&&(this.pdfViewer.annotationEditorMode={mode:dt.NONE})},0),Kl(this,Rd,"m",Kd).call(this),Kl(this,Rd,"m",Gd).call(this),this.contextMenuOpen=!1,null===(t=document.getSelection())||void 0===t||t.empty()},Ud=function(){const t=this.pdfViewer.currentPageNumber;this.container.classList.remove(th),setTimeout(()=>{Kl(this,Rd,"m",Jd).call(this),Kl(this,Rd,"m",Vd).call(this,nd),this.pdfViewer.scrollMode=Kl(this,Nd,"f").scrollMode,null!==Kl(this,Nd,"f").spreadMode&&(this.pdfViewer.spreadMode=Kl(this,Nd,"f").spreadMode),this.pdfViewer.currentScaleValue=Kl(this,Nd,"f").scaleValue,this.pdfViewer.currentPageNumber=t,null!==Kl(this,Nd,"f").annotationEditorMode&&(this.pdfViewer.annotationEditorMode={mode:Kl(this,Nd,"f").annotationEditorMode}),Ql(this,Nd,null)},0),Kl(this,Rd,"m",Qd).call(this),Kl(this,Rd,"m",qd).call(this),Kl(this,Rd,"m",Xd).call(this),this.contextMenuOpen=!1},Wd=function(t){var e;if(this.contextMenuOpen)return this.contextMenuOpen=!1,void t.preventDefault();0===t.button&&(t.target.href&&(null===(e=t.target.parentNode)||void 0===e?void 0:e.hasAttribute("data-internal-link"))||(t.preventDefault(),t.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))},$d=function(){this.contextMenuOpen=!0},Gd=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(eh),this.controlsTimeout=setTimeout(()=>{this.container.classList.remove(eh),delete this.controlsTimeout},3e3)},qd=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(eh),delete this.controlsTimeout)},Xd=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},Yd=function(t){if(this.active)if(t.touches.length>1)this.touchSwipeState=null;else switch(t.type){case"touchstart":this.touchSwipeState={startX:t.touches[0].pageX,startY:t.touches[0].pageY,endX:t.touches[0].pageX,endY:t.touches[0].pageY};break;case"touchmove":if(null===this.touchSwipeState)return;this.touchSwipeState.endX=t.touches[0].pageX,this.touchSwipeState.endY=t.touches[0].pageY,t.preventDefault();break;case"touchend":if(null===this.touchSwipeState)return;let e=0;const i=this.touchSwipeState.endX-this.touchSwipeState.startX,n=this.touchSwipeState.endY-this.touchSwipeState.startY,r=Math.abs(Math.atan2(n,i));Math.abs(i)>50&&(r<=ih||r>=Math.PI-ih)?e=i:Math.abs(n)>50&&Math.abs(r-Math.PI/2)<=ih&&(e=n),e>0?this.pdfViewer.previousPage():e<0&&this.pdfViewer.nextPage()}},Kd=function(){if(Kl(this,zd,"f"))return;Ql(this,zd,new AbortController);const{signal:t}=Kl(this,zd,"f"),e=Kl(this,Rd,"m",Yd).bind(this);window.addEventListener("mousemove",Kl(this,Rd,"m",Gd).bind(this),{signal:t}),window.addEventListener("mousedown",Kl(this,Rd,"m",Wd).bind(this),{signal:t}),window.addEventListener("wheel",Kl(this,Rd,"m",Hd).bind(this),{passive:!1,signal:t}),window.addEventListener("keydown",Kl(this,Rd,"m",Xd).bind(this),{signal:t}),window.addEventListener("contextmenu",Kl(this,Rd,"m",$d).bind(this),{signal:t}),window.addEventListener("touchstart",e,{signal:t}),window.addEventListener("touchmove",e,{signal:t}),window.addEventListener("touchend",e,{signal:t})},Qd=function(){var t;null===(t=Kl(this,zd,"f"))||void 0===t||t.abort(),Ql(this,zd,null)},Zd=function(){Kl(this,Od,"f")||(Ql(this,Od,new AbortController),window.addEventListener("fullscreenchange",()=>{document.fullscreenElement?Kl(this,Rd,"m",jd).call(this):Kl(this,Rd,"m",Ud).call(this)},{signal:Kl(this,Od,"f").signal}))},Jd=function(){var t;null===(t=Kl(this,Od,"f"))||void 0===t||t.abort(),Ql(this,Od,null)};const rh={isDocumentLoaded:!1,pagesReady:!1,url:null,numPages:0,pageNumber:0,scale:0,scaleValue:"auto",pagesRotation:0,spreadMode:ld.UNKNOWN,scrollMode:od.UNKNOWN,documentOutline:null,attachments:new Map,thumbnails:new Map,thumbnailViews:new Map,annotationEditorMode:dt.NONE,pdfSlick:null},sh=()=>{return(t=(t,e)=>Object.assign(Object.assign({},rh),{_setThumbnailView:(i,n)=>{const r=new Map(e().thumbnails),s=new Map(e().thumbnailViews),{canvasWidth:a,canvasHeight:o,scale:l,rotation:d,loaded:h,pageLabel:c,src:u=null}=n;s.set(i,n),r.set(i,{pageNumber:i,width:a,height:o,scale:l,rotation:d,loaded:h,pageLabel:c,src:u}),t({thumbnailViews:s,thumbnails:r})},_setThumbnailsViews:e=>{const i=new Map(e.map(t=>[t.id,t])),n=new Map(e.map(t=>{const{canvasWidth:e,canvasHeight:i,scale:n,rotation:r,loaded:s,pageLabel:a,src:o=null}=t;return[t.id,{pageNumber:t.id,width:e,height:i,scale:n,rotation:r,loaded:s,pageLabel:a,src:o}]}));t({thumbnailViews:i,thumbnails:n})}}))?Xl(t):Xl;var t};var ah,oh,lh,dh,hh,ch,uh,gh,ph,fh,mh,bh,vh,wh,xh,yh,Ah,Ch,Eh,Sh,kh,_h,Th,Lh,Dh,Ph,Mh;class Fh{constructor({eventBus:t,slick:e,printDialog:i}){ah.add(this),oh.set(this,null),lh.set(this,null),dh.set(this,null),this.eventBus=t,this.slick=e,this.printDialog=null!=i?i:null,this.bindEvents()}get supportsPrinting(){return Id.instance.supportsPrinting}get printing(){return!!Kl(this,oh,"f")}print(){return Yl(this,void 0,void 0,function*(){var t,e;if(this.supportsPrinting)if(this.printing)console.warn("Ignored pdf print because of a pending print job.");else{yield null===(t=this.printDialog)||void 0===t?void 0:t.open({close:()=>this.abort()});try{this.eventBus.dispatch("beforeprint",{source:this})}finally{if(this.printing){const t=Kl(this,oh,"f");yield t.renderPages(t=>{var e;return null===(e=this.printDialog)||void 0===e?void 0:e.progress(t)}).then(()=>t.performPrint()).catch(()=>{}).then(()=>{t===Kl(this,oh,"f")&&this.abort()})}else console.error("Expected print service to be initialized."),null===(e=this.printDialog)||void 0===e||e.close()}}})}abort(){var t;Kl(this,oh,"f")&&(Kl(this,oh,"f").destroy(),null===(t=this.printDialog)||void 0===t||t.close(),this.eventBus.dispatch("afterprint",{source:this}))}bindEvents(){Ql(this,lh,new AbortController);const{signal:t}=Kl(this,lh,"f"),e={signal:t};this.eventBus._on("beforeprint",Kl(this,ah,"m",hh).bind(this),e),this.eventBus._on("afterprint",Kl(this,ah,"m",ch).bind(this),e),window.addEventListener("beforeprint",()=>this.eventBus.dispatch("beforeprint",{source:window}),e),window.addEventListener("afterprint",()=>this.eventBus.dispatch("afterprint",{source:window}),e),window.addEventListener("keydown",t=>{80!==t.keyCode||!t.ctrlKey&&!t.metaKey||t.altKey||t.shiftKey&&!window.chrome&&!window.opera||(this.print(),t.preventDefault(),t.stopImmediatePropagation())},{signal:t,capture:!0})}unbindEvents(){var t;null===(t=Kl(this,lh,"f"))||void 0===t||t.abort(),Ql(this,lh,null)}}oh=new WeakMap,lh=new WeakMap,dh=new WeakMap,ah=new WeakSet,hh=function(){Kl(this,oh,"f")||this.supportsPrinting&&(this.slick.viewer.pageViewsReady?(Ql(this,dh,function(){const t=document.createElement("div");t.classList.add("pdfSlickPrintContainer"),document.body.append(t);const e=document.createElement("style");return e.textContent="\n@page {\n margin: 0;\n}\n\n.pdfSlickPrintContainer {\n display: none;\n}\n\n@media print {\n body {\n background: rgb(0 0 0 / 0) none;\n }\n\n body[data-pdfjsprinting] > *:not(.pdfSlickPrintContainer) {\n display: none;\n }\n\n body[data-pdfjsprinting] .pdfSlickPrintContainer {\n display: block;\n }\n\n .pdfSlickPrintContainer {\n height: 100%;\n }\n\n /* wrapper around (scaled) print canvas elements */\n .pdfSlickPrintContainer > .printedPage {\n page-break-after: always;\n page-break-inside: avoid;\n\n /* The wrapper always cover the whole page. */\n height: 100%;\n width: 100%;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n .pdfSlickPrintContainer > .xfaPrintedPage .xfaPage {\n position: absolute;\n }\n\n .pdfSlickPrintContainer > .xfaPrintedPage {\n page-break-after: always;\n page-break-inside: avoid;\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n .pdfSlickPrintContainer > .printedPage :is(canvas, img) {\n /* The intrinsic canvas / image size will make sure that we fit the page. */\n max-width: 100%;\n max-height: 100%;\n\n direction: ltr;\n display: block;\n }\n}",document.body.append(e),{get element(){return t},remove:()=>{t.remove(),e.remove()}}}()),Ql(this,oh,Id.instance.createPrintService({pdfDocument:this.slick.document,pagesOverview:this.slick.viewer.getPagesOverview(),printContainer:Kl(this,dh,"f").element,printResolution:this.slick.printResolution,optionalContentConfigPromise:null,printAnnotationStoragePromise:null})),this.slick.forceRendering(),Kl(this,oh,"f").layout()):this.slick.l10n.get("printing_not_ready",null).then(t=>{window.alert(t)}))},ch=function(){var t,e,i;Kl(this,oh,"f")&&(Kl(this,oh,"f").destroy(),Ql(this,oh,null),null===(t=this.printDialog)||void 0===t||t.close(),null===(e=Kl(this,dh,"f"))||void 0===e||e.remove(),Ql(this,dh,null),null===(i=this.slick.document)||void 0===i||i.annotationStorage.resetModified()),this.slick.forceRendering()};class Ih{static create(){let t=document.querySelector("#printServiceDialog");if(!t){const e=(t,e,i)=>{const n=document.createElement(t);return Object.entries(e).forEach(([t,e])=>n.setAttribute(t,e)),n.append(...i),n};t=e("dialog",{id:"printServiceDialog",class:"pdfSlick-dialog",style:"min-width: 200px;"},[e("div",{class:"row"},[e("span",{"data-l10n-id":"pdfjs-print-progress-message"},["Preparing document for printing…"])]),e("div",{class:"row"},[e("progress",{value:"0",max:"100"},[]),e("span",{"data-l10n-id":"pdfjs-print-progress-percent","data-l10n-args":'{ "progress": 0 }',class:"relative-progress"},["0%"])]),e("div",{class:"buttonRow"},[e("button",{id:"printCancel",class:"dialogButton",type:"button"},[e("span",{"data-l10n-id":"pdfjs-print-progress-close-button"},["Cancel"])])])]),document.body.append(t)}return new Ih(t)}constructor(t){this.dialog=t}open(t){return Yl(this,void 0,void 0,function*(){const e=this.dialog.querySelector("#printCancel"),i=()=>{var n;this.dialog.removeEventListener("close",i),this.dialog.removeEventListener("cancel",i),null==e||e.removeEventListener("click",i),null===(n=null==t?void 0:t.close)||void 0===n||n.call(t),this.close()};this.dialog.addEventListener("close",i),this.dialog.addEventListener("cancel",i),null==e||e.addEventListener("click",i),this.dialog.showModal()})}close(){this.dialog.close()}progress({index:t,total:e}){const i=Math.round(100*t/e),n=this.dialog.querySelector("progress"),r=this.dialog.querySelector(".relative-progress");n.value=i,r.setAttribute("data-l10n-args",JSON.stringify({progress:i}))}}nn.workerSrc=new URL( window.__dynamic_base__+"/assets/pdf.worker.min--PgD6g2g.mjs",e.meta.url).toString();const Rh={"8.5x11":"Letter","8.5x14":"Legal"},Bh={"297x420":"A3","210x297":"A4"};function Nh(t,e,i){return i[`${e?t.width:t.height}x${e?t.height:t.width}`]}class Oh{constructor({container:t,viewer:e,thumbs:i,store:n=sh(),options:r,onError:s,printDialog:a}){var o,l,d,h,c,u,g,p,f,m,b,v,w,x,y;uh.add(this),gh.set(this,void 0),ph.set(this,void 0),fh.set(this,void 0),mh.set(this,void 0),bh.set(this,void 0),this.downloadManager=null,this.findController=null,this.pdfPresentationMode=null,this.document=null,vh.set(this,void 0),wh.set(this,void 0),xh.set(this,void 0),yh.set(this,void 0),Ql(this,ph,t),Ql(this,fh,e),Ql(this,mh,i),Ql(this,xh,s),this.l10n=null!==(o=null==r?void 0:r.l10n)&&void 0!==o?o:new ll(navigator.language),this.downloadManager=new ja,this.textLayerMode=null!==(l=null==r?void 0:r.textLayerMode)&&void 0!==l?l:ad,Ql(this,vh,null!==(d=null==r?void 0:r.annotationMode)&&void 0!==d?d:ot.ENABLE_FORMS),Ql(this,wh,null!==(h=null==r?void 0:r.annotationEditorMode)&&void 0!==h?h:dt.NONE),this.annotationEditorHighlightColors=null!==(c=null==r?void 0:r.annotationEditorHighlightColors)&&void 0!==c?c:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",this.removePageBorders=null!==(u=null==r?void 0:r.removePageBorders)&&void 0!==u&&u,this.singlePageViewer=null!==(g=null==r?void 0:r.singlePageViewer)&&void 0!==g&&g,this.enablePrintAutoRotate=null!==(p=null==r?void 0:r.enablePrintAutoRotate)&&void 0!==p&&p,this.useOnlyCssZoom=null!==(f=null==r?void 0:r.useOnlyCssZoom)&&void 0!==f&&f,this.pageColors=null!==(m=null==r?void 0:r.pageColors)&&void 0!==m?m:null,this.maxCanvasPixels=null!==(b=null==r?void 0:r.maxCanvasPixels)&&void 0!==b?b:16777216,this.printResolution=null!==(v=null==r?void 0:r.printResolution)&&void 0!==v?v:96,this.thumbnailWidth=null!==(w=null==r?void 0:r.thumbnailWidth)&&void 0!==w?w:125,this.getDocumentParams=null!==(x=null==r?void 0:r.getDocumentParams)&&void 0!==x?x:{},!this.pageColors||CSS.supports("color",this.pageColors.background)&&CSS.supports("color",this.pageColors.foreground)||((this.pageColors.background||this.pageColors.foreground)&&console.warn("PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."),this.pageColors=null),this.store=n;const A=new ud;A.onIdle=this._cleanup.bind(this),A.isThumbnailViewEnabled=!0,Ql(this,gh,A);const C=new $a,E=new Oa({eventBus:C,externalLinkTarget:2,externalLinkRel:"noopener noreferrer nofollow",ignoreDestinationZoom:!1}),S=new Ba({eventBus:C,linkService:E}),k=Object.assign(Object.assign({container:t},e&&{viewer:e}),{eventBus:C,linkService:E,findController:S,renderingQueue:A,textLayerMode:this.textLayerMode,annotationEditorHighlightColors:this.annotationEditorHighlightColors,l10n:this.l10n,annotationMode:Kl(this,vh,"f"),annotationEditorMode:Kl(this,wh,"f"),removePageBorders:this.removePageBorders,imageResourcesPath:"/images/"}),_=this.singlePageViewer?new ql(k):new Gl(k);A.setViewer(_),i&&(this.thumbnailViewer=new Pd({container:i,eventBus:C,linkService:E,renderingQueue:A,pageColors:this.pageColors,enableHWA:void 0,store:n,thumbnailWidth:this.thumbnailWidth}),A.setThumbnailViewer(this.thumbnailViewer)),document.fullscreenEnabled&&(this.pdfPresentationMode=new nh({container:t,pdfViewer:_,eventBus:C})),this.eventBus=C,this.linkService=E,this.findController=S,this.viewer=_,this.linkService.setViewer(_),Ql(this,bh,new Fh({eventBus:C,slick:this,printDialog:null!=a?a:Ih.create()}));const T=null!==(y=null==r?void 0:r.scaleValue)&&void 0!==y?y:"auto";this.store.setState({scaleValue:T})}loadDocument(t,e){return Yl(this,void 0,void 0,function*(){var i,n,r,s,a;if(this.url&&"string"==typeof this.url)try{URL.revokeObjectURL(this.url)}catch(o){}try{null===(i=this.document)||void 0===i||i.destroy(),null===(n=this.viewer)||void 0===n||n.cleanup(),t instanceof URL?this.url=t.toString():t instanceof ArrayBuffer?this.url=URL.createObjectURL(new Blob([t],{type:"application/pdf"})):this.url=t;const o=null!==(r=null==e?void 0:e.filename)&&void 0!==r?r:ce(null===(s=this.url)||void 0===s?void 0:s.toString());this.filename=o;const l=In(Object.assign(Object.assign({},this.getDocumentParams),{url:this.url,isEvalSupported:!1}));(null==e?void 0:e.onProgress)&&(l.onProgress=e.onProgress);const d=yield l.promise;this.document=d,this.viewer.setDocument(this.document),this.linkService.setDocument(this.document),this.thumbnailViewer&&(null===(a=this.thumbnailViewer)||void 0===a||a.setDocument(d)),Kl(this,uh,"m",Sh).call(this),yield Kl(this,uh,"m",Ah).call(this),this.store.setState({filename:o,numPages:d.numPages,pageNumber:1,isDocumentLoaded:!0,url:t.toString()});const h=yield d.getAttachments(),c=new Map(Object.keys(null!=h?h:{}).sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase())).map(t=>[t,h[t]]));this.store.setState({attachments:c}),yield Kl(this,uh,"m",Ch).call(this),this.forceRendering()}catch(o){Kl(this,xh,"f")&&Kl(this,xh,"f").call(this,o)}})}forceRendering(t=!0){Kl(this,gh,"f").printing=!!Kl(this,bh,"f").printing,Kl(this,gh,"f").isThumbnailViewEnabled=t,Kl(this,gh,"f").renderHighestPriority()}gotoPage(t){this.linkService.goToPage(t)}openOrDownloadData(t,e){var i;null===(i=this.downloadManager)||void 0===i||i.openOrDownloadData(t,e)}download(){return Yl(this,void 0,void 0,function*(){var t,e;const i=this.url,{filename:n}=this;try{const e=yield this.document.getData(),r=new Blob([e],{type:"application/pdf"});yield null===(t=this.downloadManager)||void 0===t?void 0:t.download(r,i,n)}catch(r){yield null===(e=this.downloadManager)||void 0===e?void 0:e.download(null,i,n)}})}save(){return Yl(this,void 0,void 0,function*(){var t;const e=this.url,{filename:i}=this;try{const n=yield this.document.saveDocument(),r=new Blob([n],{type:"application/pdf"});yield null===(t=this.downloadManager)||void 0===t?void 0:t.download(r,e,i)}catch(n){console.error(`Error when saving the document: ${n.message}`),yield this.download()}})}downloadOrSave(){var t;const{annotationStorage:e}=null!==(t=this.document)&&void 0!==t?t:{};e&&e.size>0?this.save():this.download()}get supportsPrinting(){return Kl(this,bh,"f").supportsPrinting}requestPresentationMode(){var t;null===(t=this.pdfPresentationMode)||void 0===t||t.request()}triggerPrinting(){Kl(this,bh,"f").print()}unbindEvents(){var t;null===(t=Kl(this,yh,"f"))||void 0===t||t.abort(),Ql(this,yh,null),Kl(this,bh,"f").unbindEvents()}_cleanup(){var t;if(this.document)try{this.viewer.cleanup(),null===(t=this.thumbnailViewer)||void 0===t||t.cleanup(),this.document.cleanup()}catch(e){console.error("Unable to perform cleanup",e)}}setAnnotationEditorMode(t){this.viewer.annotationEditorMode={mode:t},this.dispatch("switchannotationeditormode",{source:this,mode:t}),this.store.setState({annotationEditorMode:t})}setAnnotationEditorParams(t){const e=Array.isArray(t)?t:[t];for(const i of e)this.dispatch("switchannotationeditorparams",{source:this,type:i.type,value:i.value})}setHighlightDefaultColor(t){this.setAnnotationEditorMode(dt.HIGHLIGHT),this.setAnnotationEditorParams([{type:ht.HIGHLIGHT_DEFAULT_COLOR,value:t}]),this.store.setState({highlightDefaultColor:t})}setSpreadMode(t){var e;e=t,Number.isInteger(e)&&Object.values(ld).includes(e)&&e!==ld.UNKNOWN&&(this.viewer.spreadMode=t,this.dispatch("switchspreadmode",{mode:t}))}setScrollMode(t){var e;e=t,Number.isInteger(e)&&Object.values(od).includes(e)&&e!==od.UNKNOWN&&(this.viewer.scrollMode=t,this.dispatch("switchscrollmode",{mode:t}))}setRotation(t){cd(t)&&(this.viewer.pagesRotation=t)}getPagesOverview(){var t,e;try{return null!==(e=null===(t=this.viewer)||void 0===t?void 0:t.getPagesOverview())&&void 0!==e?e:[]}catch(i){return[]}}increaseScale(){this.viewer.increaseScale()}decreaseScale(){this.viewer.decreaseScale()}set currentScaleValue(t){this.viewer.currentScaleValue=t}set currentScale(t){this.viewer.currentScale=t}getPageView(t){return this.viewer.getPageView(t)}on(t,e,i){this.eventBus.on(t,e,i)}off(t,e,i){this.eventBus.off(t,e,i)}dispatch(t,e){this.eventBus.dispatch(t,e)}}gh=new WeakMap,ph=new WeakMap,fh=new WeakMap,mh=new WeakMap,bh=new WeakMap,vh=new WeakMap,wh=new WeakMap,xh=new WeakMap,yh=new WeakMap,uh=new WeakSet,Ah=function(){return Yl(this,void 0,void 0,function*(){var t;const e=this.document,i=null!==(t=yield e.getPageLabels())&&void 0!==t?t:[],n=i.length;let r=0,s=0;for(let l=0;l<n;l++){const t=i[l];if(t===(l+1).toString())r++;else{if(""!==t)break;s++}}if(r>=n||s>=n)return;const{viewer:a,thumbnailViewer:o}=this;a.setPageLabels(i),null==o||o.setPageLabels(i)})},Ch=function(){return Yl(this,void 0,void 0,function*(){const{info:t,contentLength:e}=yield this.document.getMetadata(),i=yield this.document.getPage(this.store.getState().pageNumber).then(t=>Kl(this,uh,"m",Eh).call(this,function({view:t,userUnit:e,rotate:i}){const[n,r,s,a]=t,o=i%180!=0,l=(s-n)/72*e,d=(a-r)/72*e;return{width:o?d:l,height:o?l:d}}(t),0));this.store.setState({filesize:e,title:t.Title,author:t.Author,subject:t.Subject,keywords:t.Keywords,creator:t.Creator,producer:t.Producer,version:t.PDFFormatVersion,creationDate:me.toDateObject(t.CreationDate),modificationDate:me.toDateObject(t.ModDate),isLinearized:t.IsLinearized,pageSize:i})})},Eh=function(t,e){return Yl(this,void 0,void 0,function*(){if(!t)return;e%180!=0&&(t={width:t.height,height:t.width});const i=(n=t).width<=n.height;var n;let r={width:Math.round(100*t.width)/100,height:Math.round(100*t.height)/100},s={width:Math.round(25.4*t.width*10)/10,height:Math.round(25.4*t.height*10)/10},a=Nh(r,i,Rh)||Nh(s,i,Bh);if(!(a||Number.isInteger(s.width)&&Number.isInteger(s.height))){const e={width:25.4*t.width,height:25.4*t.height},n={width:Math.round(s.width),height:Math.round(s.height)};Math.abs(e.width-n.width)<.1&&Math.abs(e.height-n.height)<.1&&(a=Nh(n,i,Bh),a&&(r={width:Math.round(n.width/25.4*100)/100,height:Math.round(n.height/25.4*100)/100},s=n))}const[{width:o,height:l},d,h,c]=yield Promise.all([r,this.l10n.get("document_properties_page_size_unit_inches",null),a&&this.l10n.get(`document_properties_page_size_name_${a.toLowerCase()}`,null),this.l10n.get("document_properties_page_size_orientation_"+(i?"portrait":"landscape"),null)]);return{width:o.toLocaleString(),height:l.toLocaleString(),unit:d,name:h,orientation:c}})},Sh=function(){Ql(this,yh,new AbortController);const{signal:t}=Kl(this,yh,"f"),e={signal:t};this.eventBus._on("pagesinit",Kl(this,uh,"m",kh).bind(this),e),this.eventBus._on("scalechanging",Kl(this,uh,"m",Dh).bind(this),e),this.eventBus._on("pagechanging",Kl(this,uh,"m",Ph).bind(this),e),this.eventBus._on("pagerendered",Kl(this,uh,"m",Mh).bind(this),e),this.eventBus._on("rotationchanging",Kl(this,uh,"m",_h).bind(this),e),this.eventBus._on("switchspreadmode",Kl(this,uh,"m",Th).bind(this),e),this.eventBus._on("switchscrollmode",Kl(this,uh,"m",Lh).bind(this),e)},kh=function(t){return Yl(this,arguments,void 0,function*({source:t}){var e;const i=yield null===(e=this.document)||void 0===e?void 0:e.getOutline(),n=this.store.getState().scaleValue;t.currentScale=1,t.currentScaleValue="auto",this.store.setState({documentOutline:i,pageNumber:1,scaleValue:n,pagesReady:!0})})},_h=function({pagesRotation:t,pageNumber:e}){this.store.setState({pagesRotation:t}),this.thumbnailViewer&&(this.thumbnailViewer.pagesRotation=t),this.forceRendering(),this.viewer.currentPageNumber=e},Th=function({mode:t}){this.store.setState({spreadMode:t})},Lh=function({mode:t}){this.store.setState({scrollMode:t})},Dh=function({scale:t,presetValue:e}){this.store.setState({scale:t,scaleValue:e}),this.viewer.update()},Ph=function({pageNumber:t}){var e;null===(e=this.thumbnailViewer)||void 0===e||e.scrollThumbnailIntoView(t),this.store.setState({pageNumber:t})},Mh=function({pageNumber:t,error:e}){var i;if(Kl(this,mh,"f")){const e=this.viewer.getPageView(t-1),n=null===(i=this.thumbnailViewer)||void 0===i?void 0:i.getThumbnail(t-1);e&&n&&n.setImage(e)}};const zh={width:null,height:null};function Hh(t){if(!t)return{...zh};const{width:e,height:i}=t.getBoundingClientRect();return{width:e,height:i}}function Vh(t){const e="function"==typeof t,[c,u]=function(t){const e={...t},l={...t},d={},h=t=>{let i=d[t];if(!i){if(!a())return e[t];d[t]=i=o(e[t],{internal:!0}),delete e[t]}return i[0]()};for(const i in t)Object.defineProperty(l,i,{get:()=>h(i),enumerable:!0});const c=(t,i)=>{const n=d[t];if(n)return n[1](i);t in e&&(e[t]=r(i,e[t]))};return[l,(t,e)=>{if(i(t)){const e=n(()=>Object.entries(r(t,l)));s(()=>{for(const[t,i]of e)c(t,()=>i)})}else c(t,e);return l}]}(l.context||e?zh:Hh(t)),g=new ResizeObserver(([t])=>u(Hh(t.target)));return d(()=>g.disconnect()),e?h(()=>{const e=t();e&&(u(Hh(e)),g.observe(e),d(()=>g.unobserve(e)))}):(g.observe(t),d(()=>g.unobserve(t))),c}var jh=u('<div id=viewerContainer><div id=viewer class="pdfSlickViewer pdfViewer">');function Uh(t){const[e,i]=o(),n=Vh(e);return h(()=>{n.width&&n.height&&(!t.store.pdfSlick||"auto"!==t.store.scaleValue&&"page-fit"!==t.store.scaleValue&&"page-width"!==t.store.scaleValue||(t.store.pdfSlick.viewer.currentScaleValue=t.store.scaleValue),t.store.pdfSlick?.viewer.update())}),r=jh(),g(e=>{t.viewerRef(e),i(e)},r),r.style.setProperty("position","absolute"),r.style.setProperty("inset","0"),r.style.setProperty("overflow","auto"),v(()=>w(r,`pdfSlickContainer ${t.class??""}`)),r;var r}var Wh=u("<div>");function $h(t){const[e,i]=o(),n=Vh(e);return h(()=>{n.width&&n.height&&t.store.pdfSlick?.forceRendering()}),r=Wh(),g(e=>{t.thumbsRef(e),i(e)},r),r.style.setProperty("position","absolute"),r.style.setProperty("overflow","auto"),r.style.setProperty("inset","0"),p(r,f(b,{get each(){return Array.from(t.store.thumbnailViews)},children:([e,i])=>f(m,{get mount(){return i.div},get children(){return t.children({pageNumber:e,width:i.canvasWidth,height:i.canvasHeight,scale:i.scale,src:i?.src??null,rotation:i.rotation,pageLabel:i.pageLabel,loaded:i.loaded})}})})),v(e=>{var i=t.class??"",n=t.classList??{};return i!==e.e&&w(r,e.e=i),e.t=x(r,n,e.t),e},{e:void 0,t:void 0}),r;var r}const Gh=(t,e)=>{const[i,n]=o(!1),[r,s]=o(!1),[a,l]=o(null),[u,g]=o(null),[p,f]=o(null),[m,b]=o(null),v=sh(),w=function(t,e=t.getState){const i=e(t.getState()),[n,r]=c(i),s=t.subscribe((t,i)=>{e(i);const n=e(t);r(y(n))});return d(()=>s()),n}(v);return h(()=>{if(t&&r()){const i=new Oh({container:a(),thumbs:u(),store:v,options:e,onError:t=>f(t)});b(i),v.setState({pdfSlick:i}),i.loadDocument(t,e).then(()=>{n(!0)})}}),{isDocumentLoaded:i,viewerRef:t=>{l(t),s(!0)},thumbsRef:t=>{g(t)},pdfSlick:m,pdfSlickStore:w,PDFSlickViewer:Uh,PDFSlickThumbnails:$h,error:p}};function qh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="m7.976 10.072 4.357-4.357.62.618L8.284 11h-.618L3 6.333l.619-.618 4.357 4.357z" clip-rule="evenodd"/>'},t)}function Xh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="m8.024 5.928-4.357 4.357-.62-.618L7.716 5h.618L13 9.667l-.619.618-4.357-4.357z" clip-rule="evenodd"/>'},t)}function Yh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="m8 8.707 3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z" clip-rule="evenodd"/>'},t)}function Kh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2 1 1 2v12l1 1h12l1-1V2l-1-1H2Zm0 13V2h4v12H2Zm5 0V2h7v12H7Z"/>'},t)}function Qh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M2 1 1 2v12l1 1h12l1-1V2l-1-1H2Zm12 13H7V2h7v12Z" clip-rule="evenodd"/>'},t)}function Zh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M2 5.56 2.413 5h11.194l.393.54L8.373 11h-.827L2 5.56z"/>'},t)}function Jh(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path d="M5.56 14 5 13.587V2.393L5.54 2 11 7.627v.827L5.56 14z"/>'},t)}function tc(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.027 6.149a5.52 5.52 0 0 1-1.27 3.908l4.26 4.26-.7.71-4.26-4.27a5.52 5.52 0 1 1 1.97-4.608zm-5.45 4.888a4.51 4.51 0 0 0 3.18-1.32l-.04.02a4.51 4.51 0 0 0 1.36-3.2 4.5 4.5 0 1 0-4.5 4.5zm2.44-4v-1h-2v-2h-1v2h-2v1h2v2h1v-2h2z" clip-rule="evenodd"/>'},t)}function ec(t){return A({a:{fill:"currentColor",viewBox:"0 0 16 16"},c:'<path fill-rule="evenodd" d="M12.027 6.149a5.52 5.52 0 0 1-1.27 3.908l4.26 4.26-.7.71-4.26-4.27a5.52 5.52 0 1 1 1.97-4.608zm-5.45 4.888a4.51 4.51 0 0 0 3.18-1.32l-.04.02a4.51 4.51 0 0 0 1.36-3.2 4.5 4.5 0 1 0-4.5 4.5zm-2.54-4.98h5v1h-5v-1z" clip-rule="evenodd"/>'},t)}var ic=u("<form>");t("default",()=>{const{viewerRef:t,pdfSlickStore:e,PDFSlickViewer:i}=Gh(C.raw_url),[n,r]=o(1),{isOpen:s,onToggle:a,onClose:l}=E(),c=t=>{t.preventDefault();const i=parseInt(n()+"");Number.isInteger(i)&&i>0&&i<=e.numPages?e.pdfSlick?.linkService.goToPage(i):r(e.pageNumber)},u=({pageNumber:t})=>r(t);return h(()=>{e.pdfSlick&&e.pdfSlick.on("pagechanging",u)}),d(()=>{e.pdfSlick&&e.pdfSlick.off("pagechanging",u)}),f(k,{w:"$full",h:"70vh",pos:"relative",display:"flex",get children(){return[f(sc,{store:e,get isOpen(){return s()},onClose:l}),f(S,{w:"$full",h:"$full",pos:"relative",flex:1,get children(){return[f(ac,{store:e,get isOpen(){return s()},onToggle:a,wantedPageNumber:n,onPageNumberChange:r,onPageNumberSubmit:c}),f(i,{store:e,viewerRef:t})]}})]}})});const nc=t=>{const[e,i]=o(!0),n=()=>t.item.items&&t.item.items.length>0,r=()=>{t.item.dest&&t.store.pdfSlick?.linkService&&t.store.pdfSlick.linkService.goToDestination(t.item.dest)};return f(k,{mb:"$1",get children(){return[f(_,{spacing:"$1",alignItems:"center",get children(){return[f(F,{get when(){return n()},get fallback(){return f(k,{w:"16px"})},get children(){return f(P,{size:"xs",variant:"ghost","aria-label":"Toggle",get icon(){return R(()=>!!e())()?f(Zh,{}):f(Jh,{})},minW:"16px",h:"16px",onClick:()=>i(!e())})}}),f(j,{variant:"ghost",size:"sm",justifyContent:"flex-start",flex:1,fontSize:"$sm",fontWeight:"$normal",py:"$1",px:"$2",h:"auto",minH:"$6",textAlign:"left",overflow:"hidden",onClick:r,_hover:{backgroundColor:"$neutral3"},get title(){return t.item.title},color:"$neutral12",get children(){return t.item.title}})]}}),f(F,{get when(){return R(()=>!!n())()&&e()},get children(){return f(k,{get pl(){return 16*(t.level+1)+"px"},get children(){return f(rc,{get items(){return t.item.items},get level(){return t.level+1},get store(){return t.store}})}})}})]}})},rc=t=>t.items&&0!==t.items.length?f(b,{get each(){return t.items},children:e=>f(nc,{item:e,get level(){return t.level||0},get store(){return t.store}})}):null,sc=t=>{const e=L();return f(F,{get when(){return t.isOpen},get children(){return f(k,{w:"280px",h:"$full",bgColor:"$neutral1",borderRight:"1px solid $neutral6",display:"flex",flexDirection:"column",transition:"all 0.3s ease",zIndex:"10",get children(){return[f(_,{spacing:"$2",p:"$3",borderBottom:"1px solid $neutral6",bgColor:"$neutral2",get children(){return[f(T,{fontWeight:"$semibold",color:"$neutral12",get children(){return e("home.preview.pdf.document_outline")}}),f(k,{flex:1}),f(D,{withArrow:!0,get label(){return e("home.preview.pdf.close_sidebar")},get children(){return f(P,{size:"sm",get"aria-label"(){return e("home.preview.pdf.close_sidebar")},get icon(){return f(Yh,{})},get onClick(){return t.onClose}})}})]}}),f(k,{flex:1,overflow:"auto",p:"$3",get children(){return f(M,{spacing:"$2",alignItems:"stretch",get children(){return f(F,{get when(){return t.store.documentOutline&&t.store.documentOutline.length>0},get fallback(){return f(T,{size:"sm",color:"$neutral11",textAlign:"center",mt:"$4",get children(){return e("home.preview.pdf.no_outline")}})},get children(){return f(rc,{get items(){return t.store.documentOutline},get store(){return t.store}})}})}})}})]}})}})},ac=t=>{const e=L();let i;const n=[["auto",e("home.preview.pdf.zoom_auto")],["page-actual",e("home.preview.pdf.zoom_actual")],["page-fit",e("home.preview.pdf.zoom_fit")],["page-width",e("home.preview.pdf.zoom_width")]],r=[[.5,e("home.preview.pdf.zoom_50")],[.75,e("home.preview.pdf.zoom_75")],[1,e("home.preview.pdf.zoom_100")],[1.25,e("home.preview.pdf.zoom_125")],[1.5,e("home.preview.pdf.zoom_150")],[2,e("home.preview.pdf.zoom_200")]],s=I(()=>{if(t.store.scaleValue){const e=n.find(([e])=>e===t.store.scaleValue);if(e)return e[1]}return`${Math.floor(100*t.store.scale)}%`}),a=()=>t.store.annotationEditorMode===dt.INK;return f(k,{pos:"absolute",left:"50%",transform:"translateX(-50%)",display:"flex",zIndex:"1",css:{top:"$2",bottom:"auto","@sm":{top:"auto",bottom:"$2"}},get children(){return f(_,{spacing:"$4",w:"auto",p:"$2",rounded:"$lg",shadow:"$lg",bgColor:"$neutral1",opacity:"0.7",transition:"all 0.2s ease-in-out",_hover:{opacity:"1"},css:{scale:"0.7","@sm":{scale:"1"}},get children(){return[f(F,{get when(){return t.store.documentOutline&&t.store.documentOutline.length>0},get children(){return f(D,{withArrow:!0,get label(){return e("home.preview.pdf.toggle_sidebar")},get children(){return f(P,{size:"sm",colorScheme:"neutral",get"aria-label"(){return e("home.preview.pdf.toggle_sidebar")},get icon(){return R(()=>!!t.isOpen)()?f(Kh,{}):f(Qh,{})},get onClick(){return t.onToggle}})}})}}),f(D,{withArrow:!0,get label(){return e("home.preview.pdf.toggle_pen")},get children(){return f(P,{size:"sm",get"aria-label"(){return e("home.preview.pdf.toggle_pen")},get colorScheme(){return a()?"primary":"neutral"},onClick:()=>{const e=a()?dt.NONE:dt.INK;t.store.pdfSlick?.setAnnotationEditorMode(e),t.store.pdfSlick?.setAnnotationEditorParams({type:ht.INK_COLOR,value:"#ff0000"})},get icon(){return R(()=>!!a())()&&f(B,{})||f(N,{})}})}}),f(O,{orientation:"vertical",h:"24px"}),f(z,{colorScheme:"neutral",attached:!0,get children(){return[f(D,{withArrow:!0,get label(){return e("home.preview.pdf.zoom_out")},get children(){return f(P,{size:"sm",get"aria-label"(){return e("home.preview.pdf.zoom_out")},get disabled(){return!t.store.pdfSlick||t.store.scale<=.25},onClick:()=>t.store.pdfSlick?.viewer?.decreaseScale(),get icon(){return f(ec,{})}})}}),f(H,{motionPreset:"scale-bottom-left",get children(){return[f(V,{as:j,size:"sm",minW:"60px",get children(){return f(T,{size:"sm",get children(){return R(()=>!!t.store.pdfSlick)()?s():e("home.preview.pdf.loading")}})}}),f(U,{get children(){return[f(W,{get children(){return[f($,{get children(){return e("home.preview.pdf.zoom_presets")}}),f(b,{each:n,children:e=>f(G,{onSelect:()=>{return i=e[0],void(t.store.pdfSlick&&(t.store.pdfSlick.currentScaleValue=i));var i},get children(){return e[1]}})})]}}),f(O,{role:"presentation",my:"$1"}),f(W,{get children(){return[f($,{get children(){return e("home.preview.pdf.zoom_levels")}}),f(b,{each:r,children:e=>f(G,{onSelect:()=>{return i=e[0],void(t.store.pdfSlick&&(t.store.pdfSlick.currentScale=i));var i},get children(){return e[1]}})})]}})]}})]}}),f(D,{withArrow:!0,get label(){return e("home.preview.pdf.zoom_in")},get children(){return f(P,{size:"sm",get"aria-label"(){return e("home.preview.pdf.zoom_in")},get disabled(){return!t.store.pdfSlick||t.store.scale>=5},onClick:()=>t.store.pdfSlick?.viewer?.increaseScale(),get icon(){return f(tc,{})}})}})]}}),f(O,{orientation:"vertical",h:"24px"}),f(_,{spacing:"$2",alignItems:"center",get children(){return[(e=ic(),q(e,"submit",t.onPageNumberSubmit),p(e,f(X,{size:"sm",ref(t){"function"==typeof i?i(t):i=t},type:"text",get value(){return t.wantedPageNumber()},w:"50px",textAlign:"center",onFocus:()=>i.select(),onChange:e=>t.onPageNumberChange(e.currentTarget.value)})),e),f(T,{size:"sm",minW:"$full",get children(){return["/ ",R(()=>t.store.numPages)]}})];var e}}),f(D,{withArrow:!0,get label(){return e("home.preview.pdf.prev_page")},get children(){return f(P,{size:"sm",get"aria-label"(){return e("home.preview.pdf.prev_page")},colorScheme:"neutral",get disabled(){return t.store.pageNumber<=1},onClick:()=>t.store.pdfSlick?.viewer?.previousPage(),get icon(){return f(Xh,{})}})}}),f(D,{withArrow:!0,get label(){return e("home.preview.pdf.next_page")},get children(){return f(P,{size:"sm",get"aria-label"(){return e("home.preview.pdf.next_page")},colorScheme:"neutral",get disabled(){return!t.store.pdfSlick||t.store.pageNumber>=t.store.numPages},onClick:()=>t.store.pdfSlick?.viewer?.nextPage(),get icon(){return f(qh,{})}})}})]}})}})}}}});
|