@peculiar/certificates-viewer 4.7.1-alpha.4 → 4.8.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.
Files changed (357) hide show
  1. package/components/actions.js +1 -2
  2. package/components/actions.js.map +1 -1
  3. package/components/arrow_top.js +2 -4
  4. package/components/arrow_top.js.map +1 -1
  5. package/components/attribute-certificate-viewer.js +7 -12
  6. package/components/attribute-certificate-viewer.js.map +1 -1
  7. package/components/button-menu.js +4 -2
  8. package/components/button-menu.js.map +1 -1
  9. package/components/button.js +5 -8
  10. package/components/button.js.map +1 -1
  11. package/components/certificate-chain-viewer.js +5 -3
  12. package/components/certificate-chain-viewer.js.map +1 -1
  13. package/components/certificate-viewer.js +4 -2
  14. package/components/certificate-viewer.js.map +1 -1
  15. package/components/circular-progress.js +4 -2
  16. package/components/circular-progress.js.map +1 -1
  17. package/components/crl-viewer.js +6 -7
  18. package/components/crl-viewer.js.map +1 -1
  19. package/components/cross.js +3 -6
  20. package/components/cross.js.map +1 -1
  21. package/components/csr-viewer.js +4 -2
  22. package/components/csr-viewer.js.map +1 -1
  23. package/components/download.js +93 -94
  24. package/components/download.js.map +1 -1
  25. package/components/highlight-words.js +4 -2
  26. package/components/highlight-words.js.map +1 -1
  27. package/components/index2.js +14 -49
  28. package/components/index2.js.map +1 -1
  29. package/components/issuer_name.js.map +1 -1
  30. package/components/miscellaneous.js +61 -153
  31. package/components/miscellaneous.js.map +1 -1
  32. package/components/peculiar-certificate-decoder.js +6 -4
  33. package/components/peculiar-certificate-decoder.js.map +1 -1
  34. package/components/peculiar-certificates-viewer.js +6 -16
  35. package/components/peculiar-certificates-viewer.js.map +1 -1
  36. package/components/pkcs10_certificate_request.js.map +1 -1
  37. package/components/row.js +6 -17
  38. package/components/row.js.map +1 -1
  39. package/components/ssh-certificate-viewer.js +5 -5
  40. package/components/ssh-certificate-viewer.js.map +1 -1
  41. package/components/subject_name.js.map +1 -1
  42. package/components/text-hider.js +4 -2
  43. package/components/text-hider.js.map +1 -1
  44. package/dist/cjs/{actions-ByC9jQU-.js → actions-mGiqn4uZ.js} +4 -5
  45. package/dist/cjs/{actions-ByC9jQU-.js.map → actions-mGiqn4uZ.js.map} +1 -1
  46. package/dist/cjs/{arrow_top-Cw9KN115.js → arrow_top-opfTrg-m.js} +5 -7
  47. package/dist/cjs/{arrow_top-Cw9KN115.js.map → arrow_top-opfTrg-m.js.map} +1 -1
  48. package/dist/cjs/{button-C8EWG_-r.js → button-B215SxsO.js} +8 -11
  49. package/dist/{esm-es5/button-Bbh7MwG6.js.map → cjs/button-B215SxsO.js.map} +1 -1
  50. package/dist/cjs/cross-DV79hJ_S.js +49 -0
  51. package/dist/cjs/{cross-3DqhA0G_.js.map → cross-DV79hJ_S.js.map} +1 -1
  52. package/dist/cjs/download-DAw3krU6.js +23 -0
  53. package/dist/cjs/{download-DQP0KR4o.js.map → download-DAw3krU6.js.map} +1 -1
  54. package/dist/cjs/{extension-DTtJlxk8.js → extension-BDpdRJkE.js} +3 -3
  55. package/dist/cjs/extension-BDpdRJkE.js.map +1 -0
  56. package/dist/cjs/{index-uHmGhObe.js → index-BDWR3dnW.js} +88 -47
  57. package/dist/cjs/index-BDWR3dnW.js.map +1 -0
  58. package/dist/cjs/index.cjs.js +9 -11
  59. package/dist/cjs/{link-Cgh8wnbs.js → link-BScgjwVZ.js} +5 -5
  60. package/dist/cjs/{link-Cgh8wnbs.js.map → link-BScgjwVZ.js.map} +1 -1
  61. package/dist/cjs/loader.cjs.js +2 -4
  62. package/dist/cjs/{miscellaneous-DCeacaAw.js → miscellaneous-Bomq8zQH.js} +75 -178
  63. package/dist/cjs/miscellaneous-Bomq8zQH.js.map +1 -0
  64. package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -1
  65. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js +30 -79
  66. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +3 -5
  67. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +8 -10
  68. package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
  69. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +8 -10
  70. package/dist/cjs/peculiar-certificate-viewer.entry.cjs.js.map +1 -1
  71. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +10 -24
  72. package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
  73. package/dist/cjs/peculiar-text-hider.cjs.entry.js +3 -5
  74. package/dist/cjs/peculiar.cjs.js +3 -5
  75. package/dist/cjs/peculiar.cjs.js.map +1 -1
  76. package/dist/cjs/{pkcs10_certificate_request-DE-0eDXE.js → pkcs10_certificate_request-DZLiHGCV.js} +3 -3
  77. package/dist/cjs/{pkcs10_certificate_request-DE-0eDXE.js.map → pkcs10_certificate_request-DZLiHGCV.js.map} +1 -1
  78. package/dist/cjs/{ssh_certificate-D2q_p49O.js → ssh_certificate-Bh14rhzR.js} +93 -93
  79. package/dist/cjs/ssh_certificate-Bh14rhzR.js.map +1 -0
  80. package/dist/cjs/{x509_certificate-Cto1q-eu.js → x509_certificate-p8RMn7Hw.js} +4 -4
  81. package/dist/cjs/{x509_certificate-Cto1q-eu.js.map → x509_certificate-p8RMn7Hw.js.map} +1 -1
  82. package/dist/cjs/{x509_crl-CgixMZrh.js → x509_crl-tjmX6l3R.js} +5 -5
  83. package/dist/cjs/{x509_crl-CgixMZrh.js.map → x509_crl-tjmX6l3R.js.map} +1 -1
  84. package/dist/collection/collection-manifest.json +2 -2
  85. package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +14 -14
  86. package/dist/collection/components/button-menu/button-menu.js +1 -2
  87. package/dist/collection/components/button-menu/button-menu.js.map +1 -1
  88. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.css +0 -447
  89. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js +2 -3
  90. package/dist/collection/components/certificate-chain-viewer/certificate-chain-viewer.js.map +1 -1
  91. package/dist/collection/components/certificate-decoder/certificate-decoder.js +3 -4
  92. package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
  93. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js +1 -1
  94. package/dist/collection/components/certificate-details-parts/extensions/certificate_transparency_extension.js.map +1 -1
  95. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js +1 -1
  96. package/dist/collection/components/certificate-details-parts/extensions/qc_statements_extension.js.map +1 -1
  97. package/dist/collection/components/certificate-viewer/certificate-viewer.js +16 -16
  98. package/dist/collection/components/certificates-viewer/certificates-viewer.js +4 -5
  99. package/dist/collection/components/certificates-viewer/certificates-viewer.js.map +1 -1
  100. package/dist/collection/components/circular-progress/circular-progress.js +2 -2
  101. package/dist/collection/components/crl-viewer/crl-viewer.js +12 -12
  102. package/dist/collection/components/csr-viewer/csr-viewer.js +10 -10
  103. package/dist/collection/components/highlight-words/highlight-words.js +2 -2
  104. package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js +1 -1
  105. package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js.map +1 -1
  106. package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +6 -6
  107. package/dist/collection/crypto/extensions/cabforganization_identifier.js.map +1 -1
  108. package/dist/collection/crypto/ssh_certificate.js +10 -5
  109. package/dist/collection/crypto/ssh_certificate.js.map +1 -1
  110. package/dist/collection/locales/en.json +0 -1
  111. package/dist/collection/utils/download.js +2 -2
  112. package/dist/collection/utils/download.js.map +1 -1
  113. package/dist/esm/{actions-BOY2Tl0T.js → actions-CabuIstu.js} +4 -5
  114. package/dist/esm/{actions-BOY2Tl0T.js.map → actions-CabuIstu.js.map} +1 -1
  115. package/dist/esm/{arrow_top-DL0RWe4n.js → arrow_top-CWdnzNJA.js} +5 -7
  116. package/dist/{esm-es5/arrow_top-DL0RWe4n.js.map → esm/arrow_top-CWdnzNJA.js.map} +1 -1
  117. package/dist/esm/{button-Bbh7MwG6.js → button-DoyFdU2L.js} +8 -11
  118. package/dist/esm/{button-Bbh7MwG6.js.map → button-DoyFdU2L.js.map} +1 -1
  119. package/dist/esm/cross-B4NPVkar.js +45 -0
  120. package/dist/{esm-es5/cross-G84H_-QL.js.map → esm/cross-B4NPVkar.js.map} +1 -1
  121. package/dist/esm/download-C7Viw-3R.js +21 -0
  122. package/dist/esm/{download-ykcxSgxU.js.map → download-C7Viw-3R.js.map} +1 -1
  123. package/dist/esm/{extension-DmlhftES.js → extension-xW03sQxn.js} +3 -3
  124. package/dist/esm/extension-xW03sQxn.js.map +1 -0
  125. package/dist/esm/{index-CwgZaF40.js → index-B0tLzdJT.js} +88 -47
  126. package/dist/esm/index-B0tLzdJT.js.map +1 -0
  127. package/dist/esm/index.js +9 -11
  128. package/dist/esm/{link-CGURvKy1.js → link-BDCg-T_l.js} +5 -5
  129. package/dist/esm/{link-CGURvKy1.js.map → link-BDCg-T_l.js.map} +1 -1
  130. package/dist/esm/loader.js +3 -5
  131. package/dist/esm/{miscellaneous-BTlqwN5_.js → miscellaneous-DxE6a1mr.js} +75 -178
  132. package/dist/esm/miscellaneous-DxE6a1mr.js.map +1 -0
  133. package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
  134. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js +30 -79
  135. package/dist/esm/peculiar-button-menu_3.entry.js +3 -5
  136. package/dist/esm/peculiar-certificate-decoder.entry.js +8 -10
  137. package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
  138. package/dist/esm/peculiar-certificate-viewer.entry.js +8 -10
  139. package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
  140. package/dist/esm/peculiar-certificates-viewer.entry.js +10 -24
  141. package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
  142. package/dist/esm/peculiar-text-hider.entry.js +3 -5
  143. package/dist/esm/peculiar.js +4 -6
  144. package/dist/esm/peculiar.js.map +1 -1
  145. package/dist/esm/{pkcs10_certificate_request-B5C1NYFc.js → pkcs10_certificate_request-Crr9FABo.js} +3 -3
  146. package/dist/{esm-es5/pkcs10_certificate_request-B5C1NYFc.js.map → esm/pkcs10_certificate_request-Crr9FABo.js.map} +1 -1
  147. package/dist/esm/{ssh_certificate-PCn0WXhQ.js → ssh_certificate-CmOVFH_Z.js} +93 -93
  148. package/dist/esm/ssh_certificate-CmOVFH_Z.js.map +1 -0
  149. package/dist/esm/{x509_certificate-BiAmXJ4S.js → x509_certificate-C2EVTspY.js} +4 -4
  150. package/dist/{esm-es5/x509_certificate-BiAmXJ4S.js.map → esm/x509_certificate-C2EVTspY.js.map} +1 -1
  151. package/dist/esm/{x509_crl-CCeoLLUZ.js → x509_crl-Bdnys_YT.js} +5 -5
  152. package/dist/{esm-es5/x509_crl-CCeoLLUZ.js.map → esm/x509_crl-Bdnys_YT.js.map} +1 -1
  153. package/dist/esm-es5/{actions-BOY2Tl0T.js → actions-CabuIstu.js} +3 -3
  154. package/dist/esm-es5/{actions-BOY2Tl0T.js.map → actions-CabuIstu.js.map} +1 -1
  155. package/dist/esm-es5/{arrow_top-DL0RWe4n.js → arrow_top-CWdnzNJA.js} +2 -2
  156. package/dist/{esm/arrow_top-DL0RWe4n.js.map → esm-es5/arrow_top-CWdnzNJA.js.map} +1 -1
  157. package/dist/esm-es5/{button-Bbh7MwG6.js → button-DoyFdU2L.js} +2 -2
  158. package/dist/{cjs/button-C8EWG_-r.js.map → esm-es5/button-DoyFdU2L.js.map} +1 -1
  159. package/dist/esm-es5/{cross-G84H_-QL.js → cross-B4NPVkar.js} +2 -2
  160. package/dist/{esm/cross-G84H_-QL.js.map → esm-es5/cross-B4NPVkar.js.map} +1 -1
  161. package/dist/esm-es5/{download-ykcxSgxU.js → download-C7Viw-3R.js} +2 -2
  162. package/dist/esm-es5/{download-ykcxSgxU.js.map → download-C7Viw-3R.js.map} +1 -1
  163. package/dist/esm-es5/{extension-DmlhftES.js → extension-xW03sQxn.js} +2 -2
  164. package/dist/esm-es5/extension-xW03sQxn.js.map +1 -0
  165. package/dist/esm-es5/index-B0tLzdJT.js +6 -0
  166. package/dist/esm-es5/index-B0tLzdJT.js.map +1 -0
  167. package/dist/esm-es5/index.js +1 -1
  168. package/dist/esm-es5/{link-CGURvKy1.js → link-BDCg-T_l.js} +3 -3
  169. package/dist/esm-es5/{link-CGURvKy1.js.map → link-BDCg-T_l.js.map} +1 -1
  170. package/dist/esm-es5/loader.js +2 -2
  171. package/dist/esm-es5/{miscellaneous-BTlqwN5_.js → miscellaneous-DxE6a1mr.js} +4 -4
  172. package/dist/esm-es5/miscellaneous-DxE6a1mr.js.map +1 -0
  173. package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
  174. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js +4 -4
  175. package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
  176. package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -1
  177. package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
  178. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
  179. package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
  180. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +2 -2
  181. package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
  182. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +2 -2
  183. package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
  184. package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
  185. package/dist/esm-es5/peculiar.js +2 -2
  186. package/dist/esm-es5/peculiar.js.map +1 -1
  187. package/dist/esm-es5/{pkcs10_certificate_request-B5C1NYFc.js → pkcs10_certificate_request-Crr9FABo.js} +3 -3
  188. package/dist/{esm/pkcs10_certificate_request-B5C1NYFc.js.map → esm-es5/pkcs10_certificate_request-Crr9FABo.js.map} +1 -1
  189. package/dist/esm-es5/{ssh_certificate-PCn0WXhQ.js → ssh_certificate-CmOVFH_Z.js} +7 -7
  190. package/dist/esm-es5/ssh_certificate-CmOVFH_Z.js.map +1 -0
  191. package/dist/esm-es5/{x509_certificate-BiAmXJ4S.js → x509_certificate-C2EVTspY.js} +4 -4
  192. package/dist/{esm/x509_certificate-BiAmXJ4S.js.map → esm-es5/x509_certificate-C2EVTspY.js.map} +1 -1
  193. package/dist/esm-es5/{x509_crl-CCeoLLUZ.js → x509_crl-Bdnys_YT.js} +4 -4
  194. package/dist/{esm/x509_crl-CCeoLLUZ.js.map → esm-es5/x509_crl-Bdnys_YT.js.map} +1 -1
  195. package/dist/peculiar/index.esm.js +1 -1
  196. package/dist/peculiar/locales/en.json +0 -1
  197. package/dist/peculiar/p--UIbyTPo.system.js.map +1 -0
  198. package/dist/peculiar/p-16bd5fac.system.entry.js +153 -0
  199. package/dist/peculiar/p-16bd5fac.system.entry.js.map +1 -0
  200. package/dist/peculiar/{p-71eab586.entry.js → p-26e1e392.entry.js} +3 -3
  201. package/dist/peculiar/p-26e1e392.entry.js.map +1 -0
  202. package/dist/peculiar/{p-7273601a.entry.js → p-2c5ec624.entry.js} +2 -2
  203. package/dist/peculiar/p-2c5ec624.entry.js.map +1 -0
  204. package/dist/peculiar/{p-27ae6a3a.entry.js → p-4111bd62.entry.js} +2 -2
  205. package/dist/peculiar/p-4111bd62.entry.js.map +1 -0
  206. package/dist/peculiar/{p-46c17c8d.system.entry.js → p-4b510453.system.entry.js} +3 -3
  207. package/dist/peculiar/p-4b510453.system.entry.js.map +1 -0
  208. package/dist/peculiar/{p-83bfd8e5.system.entry.js → p-4fc81fd0.system.entry.js} +3 -3
  209. package/dist/peculiar/p-4fc81fd0.system.entry.js.map +1 -0
  210. package/dist/peculiar/p-51832de2.entry.js +152 -0
  211. package/dist/peculiar/p-51832de2.entry.js.map +1 -0
  212. package/dist/peculiar/{p-B4PdAFCr.system.js → p-AHlPpL1z.system.js} +2 -2
  213. package/dist/peculiar/{p-B4PdAFCr.system.js.map → p-AHlPpL1z.system.js.map} +1 -1
  214. package/dist/peculiar/p-B0tLzdJT.js +6 -0
  215. package/dist/peculiar/p-B0tLzdJT.js.map +1 -0
  216. package/dist/peculiar/{p-h7XP7otl.js → p-B4vvBwd6.js} +2 -2
  217. package/dist/peculiar/{p-h7XP7otl.js.map → p-B4vvBwd6.js.map} +1 -1
  218. package/dist/peculiar/{p-Db41gPxb.js → p-B7cL9SBA.js} +4 -4
  219. package/dist/peculiar/{p-Db41gPxb.js.map → p-B7cL9SBA.js.map} +1 -1
  220. package/dist/peculiar/{p-DanjeXNk.js → p-BAAnYCav.js} +3 -3
  221. package/dist/peculiar/{p-DanjeXNk.js.map → p-BAAnYCav.js.map} +1 -1
  222. package/dist/peculiar/{p-CHnDlTqM.js → p-BLjDwIXV.js} +3 -3
  223. package/dist/peculiar/{p-CHnDlTqM.js.map → p-BLjDwIXV.js.map} +1 -1
  224. package/dist/peculiar/{p-CutTi-2B.js → p-BNRN5kAu.js} +2 -2
  225. package/dist/peculiar/{p-CutTi-2B.js.map → p-BNRN5kAu.js.map} +1 -1
  226. package/dist/peculiar/{p-Bi5mjeeg.system.js → p-BX5m4Pk2.system.js} +2 -2
  227. package/dist/peculiar/{p-Bi5mjeeg.system.js.map → p-BX5m4Pk2.system.js.map} +1 -1
  228. package/dist/peculiar/{p-N3w4Sc5c.system.js.map → p-BdGJr6Nw.system.js.map} +1 -1
  229. package/dist/peculiar/{p-DPbpwYQ8.system.js → p-Bfl7RVFY.system.js} +4 -4
  230. package/dist/peculiar/{p-DPbpwYQ8.system.js.map → p-Bfl7RVFY.system.js.map} +1 -1
  231. package/dist/peculiar/{p-DnOLjFJP.js → p-BjREwt05.js} +43 -43
  232. package/dist/peculiar/p-BjREwt05.js.map +1 -0
  233. package/dist/peculiar/{p-BGASC3UX.system.js → p-BjfN0sUP.system.js} +3 -3
  234. package/dist/peculiar/p-BjfN0sUP.system.js.map +1 -0
  235. package/dist/peculiar/{p-DMZr5ztF.js → p-BrjKJZAs.js} +2 -2
  236. package/dist/peculiar/{p-DMZr5ztF.js.map → p-BrjKJZAs.js.map} +1 -1
  237. package/dist/peculiar/{p-CstRxc9v.js → p-BxiR02Uf.js} +4 -4
  238. package/dist/peculiar/{p-CstRxc9v.js.map → p-BxiR02Uf.js.map} +1 -1
  239. package/dist/peculiar/{p-ZT6tVIen.js → p-C-zA8CWJ.js} +2 -2
  240. package/dist/peculiar/{p-ZT6tVIen.js.map → p-C-zA8CWJ.js.map} +1 -1
  241. package/dist/peculiar/{p-Bknpl7EO.system.js → p-C9U3cZjb.system.js} +3 -3
  242. package/dist/peculiar/{p-Bknpl7EO.system.js.map → p-C9U3cZjb.system.js.map} +1 -1
  243. package/dist/peculiar/{p-B5GO6_Ut.system.js → p-CCPSoWEH.system.js} +43 -43
  244. package/dist/peculiar/p-CCPSoWEH.system.js.map +1 -0
  245. package/dist/peculiar/{p-B2FH4Pv2.system.js → p-CGipIfjs.system.js} +4 -4
  246. package/dist/peculiar/{p-B2FH4Pv2.system.js.map → p-CGipIfjs.system.js.map} +1 -1
  247. package/dist/peculiar/{p-DMDALRLP.system.js → p-CLcRtCZ9.system.js} +7 -7
  248. package/dist/peculiar/p-CLcRtCZ9.system.js.map +1 -0
  249. package/dist/peculiar/{p-CdS84qJs.system.js → p-CNRpL2vk.system.js} +2 -2
  250. package/dist/peculiar/{p-CdS84qJs.system.js.map → p-CNRpL2vk.system.js.map} +1 -1
  251. package/dist/peculiar/{p-JyD6URnB.js → p-CVqAvraM.js} +2 -2
  252. package/dist/peculiar/{p-JyD6URnB.js.map → p-CVqAvraM.js.map} +1 -1
  253. package/dist/peculiar/{p-D8xU284r.system.js → p-CWwlqwKM.system.js} +2 -2
  254. package/dist/peculiar/{p-D8xU284r.system.js.map → p-CWwlqwKM.system.js.map} +1 -1
  255. package/dist/peculiar/p-CbJUBy06.system.js +5 -0
  256. package/dist/peculiar/p-CbJUBy06.system.js.map +1 -0
  257. package/dist/peculiar/p-CfHXB_pJ.system.js.map +1 -0
  258. package/dist/peculiar/p-Ckf8xErP.system.js +12 -0
  259. package/dist/peculiar/p-Ckf8xErP.system.js.map +1 -0
  260. package/dist/peculiar/{p-PCn0WXhQ.js → p-CmOVFH_Z.js} +6 -6
  261. package/dist/peculiar/p-CmOVFH_Z.js.map +1 -0
  262. package/dist/peculiar/{p-CbJQZ9Hh.system.js.map → p-Cp79UjaU.system.js.map} +1 -1
  263. package/dist/peculiar/p-D4MqnJ9p.system.js.map +1 -0
  264. package/dist/peculiar/p-D5BlV4_w.system.js +6 -0
  265. package/dist/peculiar/p-D5BlV4_w.system.js.map +1 -0
  266. package/dist/peculiar/{p-eziSY5IJ.system.js.map → p-DOSHmuRc.system.js.map} +1 -1
  267. package/dist/peculiar/p-DXA1451q.js +12 -0
  268. package/dist/peculiar/p-DXA1451q.js.map +1 -0
  269. package/dist/peculiar/{p-SjVQtfgD.system.js → p-DberG072.system.js} +5 -5
  270. package/dist/peculiar/{p-SjVQtfgD.system.js.map → p-DberG072.system.js.map} +1 -1
  271. package/dist/peculiar/{p-de857304.system.entry.js → p-ae88bf01.system.entry.js} +2 -2
  272. package/dist/peculiar/p-ae88bf01.system.entry.js.map +1 -0
  273. package/dist/peculiar/{p-24861cf6.system.entry.js → p-c4bbd44c.system.entry.js} +3 -3
  274. package/dist/peculiar/p-c4bbd44c.system.entry.js.map +1 -0
  275. package/dist/peculiar/{p-9d9f24bd.entry.js → p-d212830c.entry.js} +2 -2
  276. package/dist/peculiar/p-d212830c.entry.js.map +1 -0
  277. package/dist/peculiar/{p-98219569.entry.js → p-e40e47be.entry.js} +2 -2
  278. package/dist/peculiar/p-e40e47be.entry.js.map +1 -0
  279. package/dist/peculiar/{p-607d08e8.system.entry.js → p-ef52478f.system.entry.js} +2 -2
  280. package/dist/peculiar/p-ef52478f.system.entry.js.map +1 -0
  281. package/dist/peculiar/p-qOxEa6Ap.system.js.map +1 -0
  282. package/dist/peculiar/{p-NnCM1ETy.system.js → p-vusQjz44.system.js} +2 -2
  283. package/dist/peculiar/{p-NnCM1ETy.system.js.map → p-vusQjz44.system.js.map} +1 -1
  284. package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -1
  285. package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
  286. package/dist/peculiar/peculiar-certificate-viewer.entry.esm.js.map +1 -1
  287. package/dist/peculiar/peculiar-certificates-viewer.entry.esm.js.map +1 -1
  288. package/dist/peculiar/peculiar.esm.js +1 -1
  289. package/dist/peculiar/peculiar.esm.js.map +1 -1
  290. package/dist/peculiar/peculiar.js +1 -1
  291. package/dist/types/crypto/ssh_certificate.d.ts +2 -2
  292. package/dist/types/interface.d.ts +86 -86
  293. package/dist/types/stencil-public-runtime.d.ts +49 -2
  294. package/dist/types/utils/download.d.ts +1 -1
  295. package/dist/types/utils/l10n.d.ts +0 -1
  296. package/hydrate/index.d.ts +2 -0
  297. package/hydrate/index.js +373 -502
  298. package/hydrate/index.mjs +373 -502
  299. package/package.json +4 -4
  300. package/dist/cjs/cross-3DqhA0G_.js +0 -52
  301. package/dist/cjs/download-DQP0KR4o.js +0 -24
  302. package/dist/cjs/extension-DTtJlxk8.js.map +0 -1
  303. package/dist/cjs/index-uHmGhObe.js.map +0 -1
  304. package/dist/cjs/miscellaneous-DCeacaAw.js.map +0 -1
  305. package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +0 -1
  306. package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +0 -1
  307. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +0 -1
  308. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +0 -1
  309. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +0 -1
  310. package/dist/cjs/peculiar-text-hider.cjs.entry.js.map +0 -1
  311. package/dist/cjs/ssh_certificate-D2q_p49O.js.map +0 -1
  312. package/dist/esm/cross-G84H_-QL.js +0 -48
  313. package/dist/esm/download-ykcxSgxU.js +0 -22
  314. package/dist/esm/extension-DmlhftES.js.map +0 -1
  315. package/dist/esm/index-CwgZaF40.js.map +0 -1
  316. package/dist/esm/miscellaneous-BTlqwN5_.js.map +0 -1
  317. package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +0 -1
  318. package/dist/esm/peculiar-button-menu_3.entry.js.map +0 -1
  319. package/dist/esm/ssh_certificate-PCn0WXhQ.js.map +0 -1
  320. package/dist/esm-es5/extension-DmlhftES.js.map +0 -1
  321. package/dist/esm-es5/index-CwgZaF40.js +0 -6
  322. package/dist/esm-es5/index-CwgZaF40.js.map +0 -1
  323. package/dist/esm-es5/miscellaneous-BTlqwN5_.js.map +0 -1
  324. package/dist/esm-es5/ssh_certificate-PCn0WXhQ.js.map +0 -1
  325. package/dist/peculiar/p-24861cf6.system.entry.js.map +0 -1
  326. package/dist/peculiar/p-27ae6a3a.entry.js.map +0 -1
  327. package/dist/peculiar/p-46c17c8d.system.entry.js.map +0 -1
  328. package/dist/peculiar/p-607d08e8.system.entry.js.map +0 -1
  329. package/dist/peculiar/p-71cb31c6.entry.js +0 -152
  330. package/dist/peculiar/p-71cb31c6.entry.js.map +0 -1
  331. package/dist/peculiar/p-71eab586.entry.js.map +0 -1
  332. package/dist/peculiar/p-7273601a.entry.js.map +0 -1
  333. package/dist/peculiar/p-83bfd8e5.system.entry.js.map +0 -1
  334. package/dist/peculiar/p-98219569.entry.js.map +0 -1
  335. package/dist/peculiar/p-9MJeDspO.system.js.map +0 -1
  336. package/dist/peculiar/p-9d9f24bd.entry.js.map +0 -1
  337. package/dist/peculiar/p-AjXipXSl.system.js +0 -12
  338. package/dist/peculiar/p-AjXipXSl.system.js.map +0 -1
  339. package/dist/peculiar/p-B5GO6_Ut.system.js.map +0 -1
  340. package/dist/peculiar/p-B82-c-xr.system.js.map +0 -1
  341. package/dist/peculiar/p-BGASC3UX.system.js.map +0 -1
  342. package/dist/peculiar/p-BHpSDBz_.system.js.map +0 -1
  343. package/dist/peculiar/p-BwlcJAh0.js +0 -12
  344. package/dist/peculiar/p-BwlcJAh0.js.map +0 -1
  345. package/dist/peculiar/p-CSz5liuX.system.js.map +0 -1
  346. package/dist/peculiar/p-CwgZaF40.js +0 -6
  347. package/dist/peculiar/p-CwgZaF40.js.map +0 -1
  348. package/dist/peculiar/p-DKl0YViA.system.js +0 -6
  349. package/dist/peculiar/p-DKl0YViA.system.js.map +0 -1
  350. package/dist/peculiar/p-DMDALRLP.system.js.map +0 -1
  351. package/dist/peculiar/p-DnOLjFJP.js.map +0 -1
  352. package/dist/peculiar/p-PCn0WXhQ.js.map +0 -1
  353. package/dist/peculiar/p-cc01a2da.system.entry.js +0 -153
  354. package/dist/peculiar/p-cc01a2da.system.entry.js.map +0 -1
  355. package/dist/peculiar/p-dOkqMp-O.system.js +0 -5
  356. package/dist/peculiar/p-dOkqMp-O.system.js.map +0 -1
  357. package/dist/peculiar/p-de857304.system.entry.js.map +0 -1
@@ -39,7 +39,7 @@ function t(t,e,i,r="application/octet-stream"){const s=new Blob([t],{type:r});if
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */class o{}o.cert={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"cer","application/pkix-cert")},asDER:(e,i)=>{t(e,i,"cer","application/pkix-cert")}};o.attrCert={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"cer","application/pkix-attr-cert")},asDER:(e,i)=>{t(e,i,"cer","application/pkix-attr-cert")}};o.csr={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"csr","application/pkcs10")},asDER:(e,i)=>{t(e,i,"csr","application/pkcs10")}};o.crl={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"crl","application/pkix-crl")},asDER:(e,i)=>{t(e,i,"crl","application/pkix-crl")}};o.certSSH={asSSH:(e,i)=>{t(n.Convert.FromString(e),i,"cert","application/ssh-cert")}};
42
+ */class o{}o.cert={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"cer","application/pkix-cert")},asDER:(e,i)=>{t(e,i,"cer","application/pkix-cert")}};o.attrCert={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"cer","application/pkix-attr-cert")},asDER:(e,i)=>{t(e,i,"cer","application/pkix-attr-cert")}};o.csr={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"csr","application/pkcs10")},asDER:(e,i)=>{t(e,i,"csr","application/pkcs10")}};o.crl={asPEM:(e,i)=>{t(n.Convert.FromString(e),i,"crl","application/pkix-crl")},asDER:(e,i)=>{t(e,i,"crl","application/pkix-crl")}};o.certSSH={asPub:(e,i)=>{t(n.Convert.FromString(e),i,"pub","text/plain")}};
43
43
  /*!
44
44
  Copyright (c) Peculiar Ventures, LLC
45
45
  */function a(t,e){let i=0;if(t.length===1){return t[0]}for(let r=t.length-1;r>=0;r--){i+=t[t.length-1-r]*Math.pow(2,e*r)}return i}function c(t,e,i=-1){const r=i;let s=t;let n=0;let o=Math.pow(2,e);for(let i=1;i<8;i++){if(t<o){let t;if(r<0){t=new ArrayBuffer(i);n=i}else{if(r<i){return new ArrayBuffer(0)}t=new ArrayBuffer(r);n=r}const o=new Uint8Array(t);for(let t=i-1;t>=0;t--){const i=Math.pow(2,t*e);o[n-t-1]=Math.floor(s/i);s-=o[n-t-1]*i}return t}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function u(...t){let e=0;let i=0;for(const i of t){e+=i.length}const r=new ArrayBuffer(e);const s=new Uint8Array(r);for(const e of t){s.set(e,i);i+=e.length}return s}function l(){const t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const e=t[0]===255&&t[1]&128;const i=t[0]===0&&(t[1]&128)===0;if(e||i){this.warnings.push("Needlessly long format")}}const e=new ArrayBuffer(this.valueHex.byteLength);const i=new Uint8Array(e);for(let t=0;t<this.valueHex.byteLength;t++){i[t]=0}i[0]=t[0]&128;const r=a(i,8);const s=new ArrayBuffer(this.valueHex.byteLength);const n=new Uint8Array(s);for(let e=0;e<this.valueHex.byteLength;e++){n[e]=t[e]}n[0]&=127;const o=a(n,8);return o-r}function h(t){const e=t<0?t*-1:t;let i=128;for(let r=1;r<8;r++){if(e<=i){if(t<0){const t=i-e;const s=c(t,8,r);const n=new Uint8Array(s);n[0]|=128;return s}let s=c(e,8,r);let n=new Uint8Array(s);if(n[0]&128){const t=s.slice(0);const e=new Uint8Array(t);s=new ArrayBuffer(s.byteLength+1);n=new Uint8Array(s);for(let i=0;i<t.byteLength;i++){n[i+1]=e[i]}n[0]=0}return s}i*=Math.pow(2,8)}return new ArrayBuffer(0)}function p(t,e){if(t.byteLength!==e.byteLength){return false}const i=new Uint8Array(t);const r=new Uint8Array(e);for(let t=0;t<i.length;t++){if(i[t]!==r[t]){return false}}return true}function d(t,e){const i=t.toString(10);if(e<i.length){return""}const r=e-i.length;const s=new Array(r);for(let t=0;t<r;t++){s[t]="0"}const n=s.join("");return n.concat(i)}
@@ -75,14 +75,14 @@ function t(t,e,i,r="application/octet-stream"){const s=new Blob([t],{type:r});if
75
75
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
76
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
77
77
  *
78
- */function f(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function y(t){let e=0;let i=0;for(let i=0;i<t.length;i++){const r=t[i];e+=r.byteLength}const r=new Uint8Array(e);for(let e=0;e<t.length;e++){const s=t[e];r.set(new Uint8Array(s),i);i+=s.byteLength}return r.buffer}function S(t,e,i,r){if(!(e instanceof Uint8Array)){t.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!e.byteLength){t.error="Wrong parameter: inputBuffer has zero length";return false}if(i<0){t.error="Wrong parameter: inputOffset less than zero";return false}if(r<0){t.error="Wrong parameter: inputLength less than zero";return false}if(e.byteLength-i-r<0){t.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}class A{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return y(this.items)}}const v=[new Uint8Array([1])];const m="0123456789";const C="name";const g="valueHexView";const w="isHexOnly";const E="idBlock";const b="tagClass";const P="tagNumber";const D="isConstructed";const I="fromBER";const B="toBER";const x="local";const T="";const O=new ArrayBuffer(0);const k=new Uint8Array(0);const R="EndOfContent";const N="OCTET STRING";const M="BIT STRING";function K(t){var e;return e=class e extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(t){this.valueHexView=new Uint8Array(t)}constructor(...t){var e;super(...t);const i=t[0]||{};this.isHexOnly=(e=i.isHexOnly)!==null&&e!==void 0?e:false;this.valueHexView=i.valueHex?n.BufferSourceConverter.toUint8Array(i.valueHex):k}fromBER(t,e,i){const r=t instanceof ArrayBuffer?new Uint8Array(t):t;if(!S(this,r,e,i)){return-1}const s=e+i;this.valueHexView=r.subarray(e,s);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return e}this.blockLength=i;return s}toBER(t=false){if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return O}if(t){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:n.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class H{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}constructor({blockLength:t=0,error:e=T,warnings:i=[],valueBeforeDecode:r=k}={}){this.blockLength=t;this.error=e;this.warnings=i;this.valueBeforeDecodeView=n.BufferSourceConverter.toUint8Array(r)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:n.Convert.ToHex(this.valueBeforeDecodeView)}}}H.NAME="baseBlock";class U extends H{fromBER(t,e,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,e){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}U.NAME="valueBlock";class j extends(K(H)){constructor({idBlock:t={}}={}){var e,i,r,s;super();if(t){this.isHexOnly=(e=t.isHexOnly)!==null&&e!==void 0?e:false;this.valueHexView=t.valueHex?n.BufferSourceConverter.toUint8Array(t.valueHex):k;this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1;this.tagNumber=(r=t.tagNumber)!==null&&r!==void 0?r:-1;this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:false}else{this.tagClass=-1;this.tagNumber=-1;this.isConstructed=false}}toBER(t=false){let e=0;switch(this.tagClass){case 1:e|=0;break;case 2:e|=64;break;case 3:e|=128;break;case 4:e|=192;break;default:this.error="Unknown tag class";return O}if(this.isConstructed)e|=32;if(this.tagNumber<31&&!this.isHexOnly){const i=new Uint8Array(1);if(!t){let t=this.tagNumber;t&=31;e|=t;i[0]=e}return i.buffer}if(!this.isHexOnly){const i=c(this.tagNumber,7);const r=new Uint8Array(i);const s=i.byteLength;const n=new Uint8Array(s+1);n[0]=e|31;if(!t){for(let t=0;t<s-1;t++)n[t+1]=r[t]|128;n[s]=r[s-1]}return n.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);i[0]=e|31;if(!t){const t=this.valueHexView;for(let e=0;e<t.length-1;e++)i[e+1]=t[e]|128;i[this.valueHexView.byteLength]=t[t.length-1]}return i.buffer}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}const s=r.subarray(e,e+i);if(s.length===0){this.error="Zero buffer length";return-1}const o=s[0]&192;switch(o){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(s[0]&32)===32;this.isHexOnly=false;const c=s[0]&31;if(c!==31){this.tagNumber=c;this.blockLength=1}else{let t=1;let e=this.valueHexView=new Uint8Array(255);let i=255;while(s[t]&128){e[t-1]=s[t]&127;t++;if(t>=s.length){this.error="End of input reached before message was fully decoded";return-1}if(t===i){i+=255;const t=new Uint8Array(i);for(let i=0;i<e.length;i++)t[i]=e[i];e=this.valueHexView=new Uint8Array(i)}}this.blockLength=t+1;e[t-1]=s[t]&127;const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e[i];e=this.valueHexView=new Uint8Array(t);e.set(r);if(this.blockLength<=9)this.tagNumber=a(e,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return e+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}j.NAME="identificationBlock";class _ extends H{constructor({lenBlock:t={}}={}){var e,i,r;super();this.isIndefiniteForm=(e=t.isIndefiniteForm)!==null&&e!==void 0?e:false;this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:false;this.length=(r=t.length)!==null&&r!==void 0?r:0}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}const s=r.subarray(e,e+i);if(s.length===0){this.error="Zero buffer length";return-1}if(s[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=s[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return e+this.blockLength}this.longFormUsed=!!(s[0]&128);if(this.longFormUsed===false){this.length=s[0];this.blockLength=1;return e+this.blockLength}const o=s[0]&127;if(o>8){this.error="Too big integer";return-1}if(o+1>s.length){this.error="End of input reached before message was fully decoded";return-1}const c=e+1;const u=r.subarray(c,c+o);if(u[o-1]===0)this.warnings.push("Needlessly long encoded length");this.length=a(u,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=o+1;return e+this.blockLength}toBER(t=false){let e;let i;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=128}return e}if(this.longFormUsed){const r=c(this.length,8);if(r.byteLength>127){this.error="Too big length";return O}e=new ArrayBuffer(r.byteLength+1);if(t)return e;const s=new Uint8Array(r);i=new Uint8Array(e);i[0]=r.byteLength|128;for(let t=0;t<r.byteLength;t++)i[t+1]=s[t];return e}e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=this.length}return e}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}_.NAME="lengthBlock";const F={};class V extends H{constructor({name:t=T,optional:e=false,primitiveSchema:i,...r}={},s){super(r);this.name=t;this.optional=e;if(i){this.primitiveSchema=i}this.idBlock=new j(r);this.lenBlock=new _(r);this.valueBlock=s?new s(r):new U(r)}fromBER(t,e,i){const r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r}toBER(t,e){const i=e||new A;if(!e){L(this)}const r=this.idBlock.toBER(t);i.write(r);if(this.lenBlock.isIndefiniteForm){i.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(t,i);i.write(new ArrayBuffer(2))}else{const e=this.valueBlock.toBER(t);this.lenBlock.length=e.byteLength;const r=this.lenBlock.toBER(t);i.write(r);i.write(e)}if(!e){return i.final()}return O}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};if(this.primitiveSchema)t.primitiveSchema=this.primitiveSchema.toJSON();return t}toString(t="ascii"){if(t==="ascii"){return this.onAsciiEncoding()}return n.Convert.ToHex(this.toBER())}onAsciiEncoding(){const t=this.constructor.NAME;const e=n.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${t} : ${e}`}isEqual(t){if(this===t){return true}if(!(t instanceof this.constructor)){return false}const e=this.toBER();const i=t.toBER();return p(e,i)}}V.NAME="BaseBlock";function L(t){var e;if(t instanceof F.Constructed){for(const e of t.valueBlock.value){if(L(e)){t.lenBlock.isIndefiniteForm=true}}}return!!((e=t.lenBlock)===null||e===void 0?void 0:e.isIndefiniteForm)}class $ extends V{getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}constructor({value:t=T,...e}={},i){super(e,i);if(t){this.fromString(t)}}fromBER(t,e,i){const r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}$.NAME="BaseStringBlock";class G extends(K(U)){constructor({isHexOnly:t=true,...e}={}){super(e);this.isHexOnly=t}}G.NAME="PrimitiveValueBlock";var W;class Q extends V{constructor(t={}){super(t,G);this.idBlock.isConstructed=false}}W=Q;(()=>{F.Primitive=W})();Q.NAME="PRIMITIVE";function q(t,e){if(t instanceof e){return t}const i=new e;i.idBlock=t.idBlock;i.lenBlock=t.lenBlock;i.warnings=t.warnings;i.valueBeforeDecodeView=t.valueBeforeDecodeView;return i}function z(t,e=0,i=t.length){const r=e;let s=new V({},U);const n=new H;if(!S(n,t,e,i)){s.error=n.error;return{offset:-1,result:s}}const o=t.subarray(e,e+i);if(!o.length){s.error="Zero buffer length";return{offset:-1,result:s}}let a=s.idBlock.fromBER(t,e,i);if(s.idBlock.warnings.length){s.warnings.concat(s.idBlock.warnings)}if(a===-1){s.error=s.idBlock.error;return{offset:-1,result:s}}e=a;i-=s.idBlock.blockLength;a=s.lenBlock.fromBER(t,e,i);if(s.lenBlock.warnings.length){s.warnings.concat(s.lenBlock.warnings)}if(a===-1){s.error=s.lenBlock.error;return{offset:-1,result:s}}e=a;i-=s.lenBlock.blockLength;if(!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm){s.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:s}}let c=V;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===false){s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:s}}switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0){s.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:s}}c=F.EndOfContent;break;case 1:c=F.Boolean;break;case 2:c=F.Integer;break;case 3:c=F.BitString;break;case 4:c=F.OctetString;break;case 5:c=F.Null;break;case 6:c=F.ObjectIdentifier;break;case 10:c=F.Enumerated;break;case 12:c=F.Utf8String;break;case 13:c=F.RelativeObjectIdentifier;break;case 14:c=F.TIME;break;case 15:s.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:s};case 16:c=F.Sequence;break;case 17:c=F.Set;break;case 18:c=F.NumericString;break;case 19:c=F.PrintableString;break;case 20:c=F.TeletexString;break;case 21:c=F.VideotexString;break;case 22:c=F.IA5String;break;case 23:c=F.UTCTime;break;case 24:c=F.GeneralizedTime;break;case 25:c=F.GraphicString;break;case 26:c=F.VisibleString;break;case 27:c=F.GeneralString;break;case 28:c=F.UniversalString;break;case 29:c=F.CharacterString;break;case 30:c=F.BmpString;break;case 31:c=F.DATE;break;case 32:c=F.TimeOfDay;break;case 33:c=F.DateTime;break;case 34:c=F.Duration;break;default:{const t=s.idBlock.isConstructed?new F.Constructed:new F.Primitive;t.idBlock=s.idBlock;t.lenBlock=s.lenBlock;t.warnings=s.warnings;s=t}}break;case 2:case 3:case 4:default:{c=s.idBlock.isConstructed?F.Constructed:F.Primitive}}s=q(s,c);a=s.fromBER(t,e,s.lenBlock.isIndefiniteForm?i:s.lenBlock.length);s.valueBeforeDecodeView=t.subarray(r,r+s.blockLength);return{offset:a,result:s}}function J(t){if(!t.byteLength){const t=new V({},U);t.error="Input buffer has zero length";return{offset:-1,result:t}}return z(n.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}function Y(t,e){if(t){return 1}return e}class Z extends U{constructor({value:t=[],isIndefiniteForm:e=false,...i}={}){super(i);this.value=t;this.isIndefiniteForm=e}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}this.valueBeforeDecodeView=r.subarray(e,e+i);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return e}let s=e;while(Y(this.isIndefiniteForm,i)>0){const t=z(r,s,i);if(t.offset===-1){this.error=t.result.error;this.warnings.concat(t.result.warnings);return-1}s=t.offset;this.blockLength+=t.result.blockLength;i-=t.result.blockLength;this.value.push(t.result);if(this.isIndefiniteForm&&t.result.constructor.NAME===R){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===R){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return s}toBER(t,e){const i=e||new A;for(let e=0;e<this.value.length;e++){this.value[e].toBER(t,i)}if(!e){return i.final()}return O}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const e of this.value){t.value.push(e.toJSON())}return t}}Z.NAME="ConstructedValueBlock";var X;class tt extends V{constructor(t={}){super(t,Z);this.idBlock.isConstructed=true}fromBER(t,e,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r}onAsciiEncoding(){const t=[];for(const e of this.valueBlock.value){t.push(e.toString("ascii").split("\n").map((t=>` ${t}`)).join("\n"))}const e=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${e} :\n${t.join("\n")}`:`${e} :`}}X=tt;(()=>{F.Constructed=X})();tt.NAME="CONSTRUCTED";class et extends U{fromBER(t,e,i){return e}toBER(t){return O}}et.override="EndOfContentValueBlock";var it;class rt extends V{constructor(t={}){super(t,et);this.idBlock.tagClass=1;this.idBlock.tagNumber=0}}it=rt;(()=>{F.EndOfContent=it})();rt.NAME=R;var st;class nt extends V{constructor(t={}){super(t,U);this.idBlock.tagClass=1;this.idBlock.tagNumber=5}fromBER(t,e,i){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=i;if(e+i>t.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return e+i}toBER(t,e){const i=new ArrayBuffer(2);if(!t){const t=new Uint8Array(i);t[0]=5;t[1]=0}if(e){e.write(i)}return i}onAsciiEncoding(){return`${this.constructor.NAME}`}}st=nt;(()=>{F.Null=st})();nt.NAME="NULL";class ot extends(K(U)){get value(){for(const t of this.valueHexView){if(t>0){return true}}return false}set value(t){this.valueHexView[0]=t?255:0}constructor({value:t,...e}={}){super(e);if(e.valueHex){this.valueHexView=n.BufferSourceConverter.toUint8Array(e.valueHex)}else{this.valueHexView=new Uint8Array(1)}if(t){this.value=t}}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}this.valueHexView=r.subarray(e,e+i);if(i>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;l.call(this);this.blockLength=i;return e+i}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ot.NAME="BooleanValueBlock";var at;class ct extends V{getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}constructor(t={}){super(t,ot);this.idBlock.tagClass=1;this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}at=ct;(()=>{F.Boolean=at})();ct.NAME="BOOLEAN";class ut extends(K(Z)){constructor({isConstructed:t=false,...e}={}){super(e);this.isConstructed=t}fromBER(t,e,i){let r=0;if(this.isConstructed){this.isHexOnly=false;r=Z.prototype.fromBER.call(this,t,e,i);if(r===-1)return r;for(let t=0;t<this.value.length;t++){const e=this.value[t].constructor.NAME;if(e===R){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(e!==N){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;r=super.fromBER(t,e,i);this.blockLength=i}return r}toBER(t,e){if(this.isConstructed)return Z.prototype.toBER.call(this,t,e);return t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}ut.NAME="OctetStringValueBlock";var lt;let ht=class t extends V{constructor({idBlock:t={},lenBlock:e={},...i}={}){var r,s;(r=i.isConstructed)!==null&&r!==void 0?r:i.isConstructed=!!((s=i.value)===null||s===void 0?void 0:s.length);super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...e,isIndefiniteForm:!!i.isIndefiniteForm},...i},ut);this.idBlock.tagClass=1;this.idBlock.tagNumber=4}fromBER(t,e,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(i===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return e}if(!this.valueBlock.isConstructed){const r=t instanceof ArrayBuffer?new Uint8Array(t):t;const s=r.subarray(e,e+i);try{if(s.byteLength){const t=z(s,0,s.byteLength);if(t.offset!==-1&&t.offset===i){this.valueBlock.value=[t.result]}}}catch{}}return super.fromBER(t,e,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return tt.prototype.onAsciiEncoding.call(this)}const t=this.constructor.NAME;const e=n.Convert.ToHex(this.valueBlock.valueHexView);return`${t} : ${e}`}getValue(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}const t=[];for(const e of this.valueBlock.value){if(e instanceof lt){t.push(e.valueBlock.valueHexView)}}return n.BufferSourceConverter.concat(t)}};lt=ht;(()=>{F.OctetString=lt})();ht.NAME=N;class pt extends(K(Z)){constructor({unusedBits:t=0,isConstructed:e=false,...i}={}){super(i);this.unusedBits=t;this.isConstructed=e;this.blockLength=this.valueHexView.byteLength}fromBER(t,e,i){if(!i){return e}let r=-1;if(this.isConstructed){r=Z.prototype.fromBER.call(this,t,e,i);if(r===-1)return r;for(const t of this.value){const e=t.constructor.NAME;if(e===R){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(e!==M){this.error="BIT STRING may consists of BIT STRINGs only";return-1}const i=t.valueBlock;if(this.unusedBits>0&&i.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=i.unusedBits}return r}const s=n.BufferSourceConverter.toUint8Array(t);if(!S(this,s,e,i)){return-1}const o=s.subarray(e,e+i);this.unusedBits=o[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){const t=o.subarray(1);try{if(t.byteLength){const e=z(t,0,t.byteLength);if(e.offset!==-1&&e.offset===i-1){this.value=[e.result]}}}catch{}}this.valueHexView=o.subarray(1);this.blockLength=o.length;return e+i}toBER(t,e){if(this.isConstructed){return Z.prototype.toBER.call(this,t,e)}if(t){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return O}const i=new Uint8Array(this.valueHexView.length+1);i[0]=this.unusedBits;i.set(this.valueHexView,1);return i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}pt.NAME="BitStringValueBlock";var dt;let ft=class t extends V{constructor({idBlock:t={},lenBlock:e={},...i}={}){var r,s;(r=i.isConstructed)!==null&&r!==void 0?r:i.isConstructed=!!((s=i.value)===null||s===void 0?void 0:s.length);super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...e,isIndefiniteForm:!!i.isIndefiniteForm},...i},pt);this.idBlock.tagClass=1;this.idBlock.tagNumber=3}fromBER(t,e,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return super.fromBER(t,e,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return tt.prototype.onAsciiEncoding.call(this)}else{const t=[];const e=this.valueBlock.valueHexView;for(const i of e){t.push(i.toString(2).padStart(8,"0"))}const i=t.join("");const r=this.constructor.NAME;const s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${r} : ${s}`}}};dt=ft;(()=>{F.BitString=dt})();ft.NAME=M;var yt;function St(t,e){const i=new Uint8Array([0]);const r=new Uint8Array(t);const s=new Uint8Array(e);let n=r.slice(0);const o=n.length-1;const a=s.slice(0);const c=a.length-1;let l=0;const h=c<o?o:c;let p=0;for(let t=h;t>=0;t--,p++){switch(true){case p<a.length:l=n[o-p]+a[c-p]+i[0];break;default:l=n[o-p]+i[0]}i[0]=l/10;switch(true){case p>=n.length:n=u(new Uint8Array([l%10]),n);break;default:n[o-p]=l%10}}if(i[0]>0)n=u(i,n);return n}function At(t){if(t>=v.length){for(let e=v.length;e<=t;e++){const t=new Uint8Array([0]);let i=v[e-1].slice(0);for(let e=i.length-1;e>=0;e--){const r=new Uint8Array([(i[e]<<1)+t[0]]);t[0]=r[0]/10;i[e]=r[0]%10}if(t[0]>0)i=u(t,i);v.push(i)}}return v[t]}function vt(t,e){let i=0;const r=new Uint8Array(t);const s=new Uint8Array(e);const n=r.slice(0);const o=n.length-1;const a=s.slice(0);const c=a.length-1;let u;let l=0;for(let t=c;t>=0;t--,l++){u=n[o-l]-a[c-l]-i;switch(true){case u<0:i=1;n[o-l]=u+10;break;default:i=0;n[o-l]=u}}if(i>0){for(let t=o-c+1;t>=0;t--,l++){u=n[o-l]-i;if(u<0){i=1;n[o-l]=u+10}else{i=0;n[o-l]=u;break}}}return n.slice()}class mt extends(K(U)){setValueHex(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=l.call(this)}}}constructor({value:t,...e}={}){super(e);this._valueDec=0;if(e.valueHex){this.setValueHex()}if(t!==undefined){this.valueDec=t}}set valueDec(t){this._valueDec=t;this.isHexOnly=false;this.valueHexView=new Uint8Array(h(t))}get valueDec(){return this._valueDec}fromDER(t,e,i,r=0){const s=this.fromBER(t,e,i);if(s===-1)return s;const n=this.valueHexView;if(n[0]===0&&(n[1]&128)!==0){this.valueHexView=n.subarray(1)}else{if(r!==0){if(n.length<r){if(r-n.length>1)r=n.length+1;this.valueHexView=n.subarray(r-n.length)}}}return s}toDER(t=false){const e=this.valueHexView;switch(true){case(e[0]&128)!==0:{const t=new Uint8Array(this.valueHexView.length+1);t[0]=0;t.set(e,1);this.valueHexView=t}break;case e[0]===0&&(e[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(t)}fromBER(t,e,i){const r=super.fromBER(t,e,i);if(r===-1){return r}this.setValueHex();return r}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let e=new Uint8Array(this.valueHexView.length*8/3);let i=0;let r;const s=this.valueHexView;let n="";let o=false;for(let o=s.byteLength-1;o>=0;o--){r=s[o];for(let s=0;s<8;s++){if((r&1)===1){switch(i){case t:e=vt(At(i),e);n="-";break;default:e=St(e,At(i))}}i++;r>>=1}}for(let t=0;t<e.length;t++){if(e[t])o=true;if(o)n+=m.charAt(e[t])}if(o===false)n+=m.charAt(0);return n}}yt=mt;mt.NAME="IntegerValueBlock";(()=>{Object.defineProperty(yt.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var Ct;class gt extends V{constructor(t={}){super(t,mt);this.idBlock.tagClass=1;this.idBlock.tagNumber=2}toBigInt(){f();return BigInt(this.valueBlock.toString())}static fromBigInt(t){f();const e=BigInt(t);const i=new A;const r=e.toString(16).replace(/^-/,"");const s=new Uint8Array(n.Convert.FromHex(r));if(e<0){const t=new Uint8Array(s.length+(s[0]&128?1:0));t[0]|=128;const r=BigInt(`0x${n.Convert.ToHex(t)}`);const o=r+e;const a=n.BufferSourceConverter.toUint8Array(n.Convert.FromHex(o.toString(16)));a[0]|=128;i.write(a)}else{if(s[0]&128){i.write(new Uint8Array([0]))}i.write(s)}const o=new Ct({valueHex:i.final()});return o}convertToDER(){const t=new Ct({valueHex:this.valueBlock.valueHexView});t.valueBlock.toDER();return t}convertFromDER(){return new Ct({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ct=gt;(()=>{F.Integer=Ct})();gt.NAME="INTEGER";var wt;class Et extends gt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=10}}wt=Et;(()=>{F.Enumerated=wt})();Et.NAME="ENUMERATED";class bt extends(K(U)){constructor({valueDec:t=-1,isFirstSid:e=false,...i}={}){super(i);this.valueDec=t;this.isFirstSid=e}fromBER(t,e,i){if(!i){return e}const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}const s=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(let t=0;t<i;t++){this.valueHexView[t]=s[t]&127;this.blockLength++;if((s[t]&128)===0)break}const o=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength;t++){o[t]=this.valueHexView[t]}this.valueHexView=o;if((s[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=a(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength}set valueBigInt(t){f();let e=BigInt(t).toString(2);while(e.length%7){e="0"+e}const i=new Uint8Array(e.length/7);for(let t=0;t<i.length;t++){i[t]=parseInt(e.slice(t*7,t*7+7),2)+(t+1<i.length?128:0)}this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const e=this.valueHexView;const i=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength-1;t++)i[t]=e[t]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}const e=c(this.valueDec,7);if(e.byteLength===0){this.error="Error during encoding SID value";return O}const i=new Uint8Array(e.byteLength);if(!t){const t=new Uint8Array(e);const r=e.byteLength-1;for(let e=0;e<r;e++)i[e]=t[e]|128;i[r]=t[r]}return i}toString(){let t="";if(this.isHexOnly)t=n.Convert.ToHex(this.valueHexView);else{if(this.isFirstSid){let e=this.valueDec;if(this.valueDec<=39)t="0.";else{if(this.valueDec<=79){t="1.";e-=40}else{t="2.";e-=80}}t+=e.toString()}else t=this.valueDec.toString()}return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}bt.NAME="sidBlock";class Pt extends U{constructor({value:t=T,...e}={}){super(e);this.value=[];if(t){this.fromString(t)}}fromBER(t,e,i){let r=e;while(i>0){const e=new bt;r=e.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=e.error;return r}if(this.value.length===0)e.isFirstSid=true;this.blockLength+=e.blockLength;i-=e.blockLength;this.value.push(e)}return r}toBER(t){const e=[];for(let i=0;i<this.value.length;i++){const r=this.value[i].toBER(t);if(r.byteLength===0){this.error=this.value[i].error;return O}e.push(r)}return y(e)}fromString(t){this.value=[];let e=0;let i=0;let r="";let s=false;do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;if(s){const t=this.value[0];let e=0;switch(t.valueDec){case 0:break;case 1:e=40;break;case 2:e=80;break;default:this.value=[];return}const i=parseInt(r,10);if(isNaN(i))return;t.valueDec=i+e;s=false}else{const t=new bt;if(r>Number.MAX_SAFE_INTEGER){f();const e=BigInt(r);t.valueBigInt=e}else{t.valueDec=parseInt(r,10);if(isNaN(t.valueDec))return}if(!this.value.length){t.isFirstSid=true;s=true}this.value.push(t)}}while(i!==-1)}toString(){let t="";let e=false;for(let i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;let r=this.value[i].toString();if(i!==0)t=`${t}.`;if(e){r=`{${r}}`;if(this.value[i].isFirstSid)t=`2.{${r} - 80}`;else t+=r}else t+=r}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let e=0;e<this.value.length;e++){t.sidArray.push(this.value[e].toJSON())}return t}}Pt.NAME="ObjectIdentifierValueBlock";var Dt;class It extends V{getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}constructor(t={}){super(t,Pt);this.idBlock.tagClass=1;this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Dt=It;(()=>{F.ObjectIdentifier=Dt})();It.NAME="OBJECT IDENTIFIER";class Bt extends(K(H)){constructor({valueDec:t=0,...e}={}){super(e);this.valueDec=t}fromBER(t,e,i){if(i===0)return e;const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i))return-1;const s=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(let t=0;t<i;t++){this.valueHexView[t]=s[t]&127;this.blockLength++;if((s[t]&128)===0)break}const o=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength;t++)o[t]=this.valueHexView[t];this.valueHexView=o;if((s[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=a(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const e=this.valueHexView;const i=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength-1;t++)i[t]=e[t]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}const e=c(this.valueDec,7);if(e.byteLength===0){this.error="Error during encoding SID value";return O}const i=new Uint8Array(e.byteLength);if(!t){const t=new Uint8Array(e);const r=e.byteLength-1;for(let e=0;e<r;e++)i[e]=t[e]|128;i[r]=t[r]}return i.buffer}toString(){let t="";if(this.isHexOnly)t=n.Convert.ToHex(this.valueHexView);else{t=this.valueDec.toString()}return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Bt.NAME="relativeSidBlock";class xt extends U{constructor({value:t=T,...e}={}){super(e);this.value=[];if(t){this.fromString(t)}}fromBER(t,e,i){let r=e;while(i>0){const e=new Bt;r=e.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=e.error;return r}this.blockLength+=e.blockLength;i-=e.blockLength;this.value.push(e)}return r}toBER(t,e){const i=[];for(let e=0;e<this.value.length;e++){const r=this.value[e].toBER(t);if(r.byteLength===0){this.error=this.value[e].error;return O}i.push(r)}return y(i)}fromString(t){this.value=[];let e=0;let i=0;let r="";do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;const s=new Bt;s.valueDec=parseInt(r,10);if(isNaN(s.valueDec))return true;this.value.push(s)}while(i!==-1);return true}toString(){let t="";let e=false;for(let i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;let r=this.value[i].toString();if(i!==0)t=`${t}.`;if(e){r=`{${r}}`;t+=r}else t+=r}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let e=0;e<this.value.length;e++)t.sidArray.push(this.value[e].toJSON());return t}}xt.NAME="RelativeObjectIdentifierValueBlock";var Tt;class Ot extends V{getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}constructor(t={}){super(t,xt);this.idBlock.tagClass=1;this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Tt=Ot;(()=>{F.RelativeObjectIdentifier=Tt})();Ot.NAME="RelativeObjectIdentifier";var kt;class Rt extends tt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=16}}kt=Rt;(()=>{F.Sequence=kt})();Rt.NAME="SEQUENCE";var Nt;class Mt extends tt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=17}}Nt=Mt;(()=>{F.Set=Nt})();Mt.NAME="SET";class Kt extends(K(U)){constructor({...t}={}){super(t);this.isHexOnly=true;this.value=T}toJSON(){return{...super.toJSON(),value:this.value}}}Kt.NAME="StringValueBlock";class Ht extends Kt{}Ht.NAME="SimpleStringValueBlock";class Ut extends ${constructor({...t}={}){super(t,Ht)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,n.BufferSourceConverter.toUint8Array(t))}fromString(t){const e=t.length;const i=this.valueBlock.valueHexView=new Uint8Array(e);for(let r=0;r<e;r++)i[r]=t.charCodeAt(r);this.valueBlock.value=t}}Ut.NAME="SIMPLE STRING";class jt extends Ut{fromBuffer(t){this.valueBlock.valueHexView=n.BufferSourceConverter.toUint8Array(t);try{this.valueBlock.value=n.Convert.ToUtf8String(t)}catch(e){this.warnings.push(`Error during "decodeURIComponent": ${e}, using raw string`);this.valueBlock.value=n.Convert.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(n.Convert.FromUtf8String(t));this.valueBlock.value=t}}jt.NAME="Utf8StringValueBlock";var _t;class Ft extends jt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=12}}_t=Ft;(()=>{F.Utf8String=_t})();Ft.NAME="UTF8String";class Vt extends Ut{fromBuffer(t){this.valueBlock.value=n.Convert.ToUtf16String(t);this.valueBlock.valueHexView=n.BufferSourceConverter.toUint8Array(t)}fromString(t){this.valueBlock.value=t;this.valueBlock.valueHexView=new Uint8Array(n.Convert.FromUtf16String(t))}}Vt.NAME="BmpStringValueBlock";var Lt;class $t extends Vt{constructor({...t}={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=30}}Lt=$t;(()=>{F.BmpString=Lt})();$t.NAME="BMPString";class Gt extends Ut{fromBuffer(t){const e=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0);const i=new Uint8Array(e);for(let t=0;t<i.length;t+=4){i[t]=i[t+3];i[t+1]=i[t+2];i[t+2]=0;i[t+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(e))}fromString(t){const e=t.length;const i=this.valueBlock.valueHexView=new Uint8Array(e*4);for(let r=0;r<e;r++){const e=c(t.charCodeAt(r),8);const s=new Uint8Array(e);if(s.length>4)continue;const n=4-s.length;for(let t=s.length-1;t>=0;t--)i[r*4+t+n]=s[t]}this.valueBlock.value=t}}Gt.NAME="UniversalStringValueBlock";var Wt;class Qt extends Gt{constructor({...t}={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=28}}Wt=Qt;(()=>{F.UniversalString=Wt})();Qt.NAME="UniversalString";var qt;class zt extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=18}}qt=zt;(()=>{F.NumericString=qt})();zt.NAME="NumericString";var Jt;class Yt extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=19}}Jt=Yt;(()=>{F.PrintableString=Jt})();Yt.NAME="PrintableString";var Zt;class Xt extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=20}}Zt=Xt;(()=>{F.TeletexString=Zt})();Xt.NAME="TeletexString";var te;class ee extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=21}}te=ee;(()=>{F.VideotexString=te})();ee.NAME="VideotexString";var ie;class re extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=22}}ie=re;(()=>{F.IA5String=ie})();re.NAME="IA5String";var se;class ne extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=25}}se=ne;(()=>{F.GraphicString=se})();ne.NAME="GraphicString";var oe;class ae extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=26}}oe=ae;(()=>{F.VisibleString=oe})();ae.NAME="VisibleString";var ce;class ue extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=27}}ce=ue;(()=>{F.GeneralString=ce})();ue.NAME="GeneralString";var le;class he extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=29}}le=he;(()=>{F.CharacterString=le})();he.NAME="CharacterString";var pe;class de extends ae{constructor({value:t,valueDate:e,...i}={}){super(i);this.year=0;this.month=0;this.day=0;this.hour=0;this.minute=0;this.second=0;if(t){this.fromString(t);this.valueBlock.valueHexView=new Uint8Array(t.length);for(let e=0;e<t.length;e++)this.valueBlock.valueHexView[e]=t.charCodeAt(e)}if(e){this.fromDate(e);this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())}this.idBlock.tagClass=1;this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,n.BufferSourceConverter.toUint8Array(t)))}toBuffer(){const t=this.toString();const e=new ArrayBuffer(t.length);const i=new Uint8Array(e);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return e}fromDate(t){this.year=t.getUTCFullYear();this.month=t.getUTCMonth()+1;this.day=t.getUTCDate();this.hour=t.getUTCHours();this.minute=t.getUTCMinutes();this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const e=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;const i=e.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const r=parseInt(i[1],10);if(r>=50)this.year=1900+r;else this.year=2e3+r;this.month=parseInt(i[2],10);this.day=parseInt(i[3],10);this.hour=parseInt(i[4],10);this.minute=parseInt(i[5],10);this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const t=new Array(7);t[0]=d(this.year<2e3?this.year-1900:this.year-2e3,2);t[1]=d(this.month,2);t[2]=d(this.day,2);t[3]=d(this.hour,2);t[4]=d(this.minute,2);t[5]=d(this.second,2);t[6]="Z";return t.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}pe=de;(()=>{F.UTCTime=pe})();de.NAME="UTCTime";var fe;class ye extends de{constructor(t={}){var e;super(t);(e=this.millisecond)!==null&&e!==void 0?e:this.millisecond=0;this.idBlock.tagClass=1;this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t);this.millisecond=t.getUTCMilliseconds()}toDate(){const t=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(t)}fromString(t){let e=false;let i="";let r="";let s=0;let n;let o=0;let a=0;if(t[t.length-1]==="Z"){i=t.substring(0,t.length-1);e=true}else{const e=new Number(t[t.length-1]);if(isNaN(e.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(e){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let t=1;let e=i.indexOf("+");let r="";if(e===-1){e=i.indexOf("-");t=-1}if(e!==-1){r=i.substring(e+1);i=i.substring(0,e);if(r.length!==2&&r.length!==4)throw new Error("Wrong input string for conversion");let s=parseInt(r.substring(0,2),10);if(isNaN(s.valueOf()))throw new Error("Wrong input string for conversion");o=t*s;if(r.length===4){s=parseInt(r.substring(2,4),10);if(isNaN(s.valueOf()))throw new Error("Wrong input string for conversion");a=t*s}}}let c=i.indexOf(".");if(c===-1)c=i.indexOf(",");if(c!==-1){const t=new Number(`0${i.substring(c)}`);if(isNaN(t.valueOf()))throw new Error("Wrong input string for conversion");s=t.valueOf();r=i.substring(0,c)}else r=i;switch(true){case r.length===8:n=/(\d{4})(\d{2})(\d{2})/gi;if(c!==-1)throw new Error("Wrong input string for conversion");break;case r.length===10:n=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(c!==-1){let t=60*s;this.minute=Math.floor(t);t=60*(t-this.minute);this.second=Math.floor(t);t=1e3*(t-this.second);this.millisecond=Math.floor(t)}break;case r.length===12:n=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(c!==-1){let t=60*s;this.second=Math.floor(t);t=1e3*(t-this.second);this.millisecond=Math.floor(t)}break;case r.length===14:n=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(c!==-1){const t=1e3*s;this.millisecond=Math.floor(t)}break;default:throw new Error("Wrong input string for conversion")}const u=n.exec(r);if(u===null)throw new Error("Wrong input string for conversion");for(let t=1;t<u.length;t++){switch(t){case 1:this.year=parseInt(u[t],10);break;case 2:this.month=parseInt(u[t],10);break;case 3:this.day=parseInt(u[t],10);break;case 4:this.hour=parseInt(u[t],10)+o;break;case 5:this.minute=parseInt(u[t],10)+a;break;case 6:this.second=parseInt(u[t],10);break;default:throw new Error("Wrong input string for conversion")}}if(e===false){const t=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=t.getUTCFullYear();this.month=t.getUTCMonth();this.day=t.getUTCDay();this.hour=t.getUTCHours();this.minute=t.getUTCMinutes();this.second=t.getUTCSeconds();this.millisecond=t.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const t=[];t.push(d(this.year,4));t.push(d(this.month,2));t.push(d(this.day,2));t.push(d(this.hour,2));t.push(d(this.minute,2));t.push(d(this.second,2));if(this.millisecond!==0){t.push(".");t.push(d(this.millisecond,3))}t.push("Z");return t.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}fe=ye;(()=>{F.GeneralizedTime=fe})();ye.NAME="GeneralizedTime";var Se;class Ae extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=31}}Se=Ae;(()=>{F.DATE=Se})();Ae.NAME="DATE";var ve;class me extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=32}}ve=me;(()=>{F.TimeOfDay=ve})();me.NAME="TimeOfDay";var Ce;class ge extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=33}}Ce=ge;(()=>{F.DateTime=Ce})();ge.NAME="DateTime";var we;class Ee extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=34}}we=Ee;(()=>{F.Duration=we})();Ee.NAME="Duration";var be;class Pe extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=14}}be=Pe;(()=>{F.TIME=be})();Pe.NAME="TIME";class De{constructor({name:t=T,optional:e=false}={}){this.name=t;this.optional=e}}class Ie extends De{constructor({value:t=[],...e}={}){super(e);this.value=t}}class Be extends De{constructor({value:t=new De,local:e=false,...i}={}){super(i);this.value=t;this.local=e}}class xe{get data(){return this.dataView.slice().buffer}set data(t){this.dataView=n.BufferSourceConverter.toUint8Array(t)}constructor({data:t=k}={}){this.dataView=n.BufferSourceConverter.toUint8Array(t)}fromBER(t,e,i){const r=e+i;this.dataView=n.BufferSourceConverter.toUint8Array(t).subarray(e,r);return r}toBER(t){return this.dataView.slice().buffer}}function Te(t,e,i){if(i instanceof Ie){for(const r of i.value){const i=Te(t,e,r);if(i.verified){return{verified:true,result:t}}}{const t={verified:false,result:{error:"Wrong values for Choice type"}};if(i.hasOwnProperty(C))t.name=i.name;return t}}if(i instanceof De){if(i.hasOwnProperty(C))t[i.name]=e;return{verified:true,result:t}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(i instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(E in i===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(I in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(B in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}const r=i.idBlock.toBER(false);if(r.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}const s=i.idBlock.fromBER(r,0,r.byteLength);if(s===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(i.idBlock.hasOwnProperty(b)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagClass!==e.idBlock.tagClass){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(P)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagNumber!==e.idBlock.tagNumber){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(D)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isConstructed!==e.idBlock.isConstructed){return{verified:false,result:t}}if(!(w in i.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isHexOnly!==e.idBlock.isHexOnly){return{verified:false,result:t}}if(i.idBlock.isHexOnly){if(g in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}const r=i.idBlock.valueHexView;const s=e.idBlock.valueHexView;if(r.length!==s.length){return{verified:false,result:t}}for(let e=0;e<r.length;e++){if(r[e]!==s[1]){return{verified:false,result:t}}}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)t[i.name]=e}if(i instanceof F.Constructed){let r=0;let s={verified:false,result:{error:"Unknown error"}};let n=i.valueBlock.value.length;if(n>0){if(i.valueBlock.value[0]instanceof Be){n=e.valueBlock.value.length}}if(n===0){return{verified:true,result:t}}if(e.valueBlock.value.length===0&&i.valueBlock.value.length!==0){let e=true;for(let t=0;t<i.valueBlock.value.length;t++)e=e&&(i.valueBlock.value[t].optional||false);if(e){return{verified:true,result:t}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)delete t[i.name]}t.error="Inconsistent object length";return{verified:false,result:t}}for(let o=0;o<n;o++){if(o-r>=e.valueBlock.value.length){if(i.valueBlock.value[o].optional===false){const e={verified:false,result:t};t.error="Inconsistent length between ASN.1 data and schema";if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name){delete t[i.name];e.name=i.name}}return e}}else{if(i.valueBlock.value[0]instanceof Be){s=Te(t,e.valueBlock.value[o],i.valueBlock.value[0].value);if(s.verified===false){if(i.valueBlock.value[0].optional)r++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)delete t[i.name]}return s}}if(C in i.valueBlock.value[0]&&i.valueBlock.value[0].name.length>0){let r={};if(x in i.valueBlock.value[0]&&i.valueBlock.value[0].local)r=e;else r=t;if(typeof r[i.valueBlock.value[0].name]==="undefined")r[i.valueBlock.value[0].name]=[];r[i.valueBlock.value[0].name].push(e.valueBlock.value[o])}}else{s=Te(t,e.valueBlock.value[o-r],i.valueBlock.value[o]);if(s.verified===false){if(i.valueBlock.value[o].optional)r++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)delete t[i.name]}return s}}}}}if(s.verified===false){const e={verified:false,result:t};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name){delete t[i.name];e.name=i.name}}return e}return{verified:true,result:t}}if(i.primitiveSchema&&g in e.valueBlock){const r=z(e.valueBlock.valueHexView);if(r.offset===-1){const e={verified:false,result:r.result};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name){delete t[i.name];e.name=i.name}}return e}return Te(t,r.result,i.primitiveSchema)}return{verified:true,result:t}}function Oe(t,e){if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}const i=z(n.BufferSourceConverter.toUint8Array(t));if(i.offset===-1){return{verified:false,result:i.result}}return Te(i.result,i.result,e)}var ke=Object.freeze({__proto__:null,Any:De,BaseBlock:V,BaseStringBlock:$,BitString:ft,BmpString:$t,Boolean:ct,CharacterString:he,Choice:Ie,Constructed:tt,DATE:Ae,DateTime:ge,Duration:Ee,EndOfContent:rt,Enumerated:Et,GeneralString:ue,GeneralizedTime:ye,GraphicString:ne,HexBlock:K,IA5String:re,Integer:gt,Null:nt,NumericString:zt,ObjectIdentifier:It,OctetString:ht,Primitive:Q,PrintableString:Yt,RawData:xe,RelativeObjectIdentifier:Ot,Repeated:Be,Sequence:Rt,Set:Mt,TIME:Pe,TeletexString:Xt,TimeOfDay:me,UTCTime:de,UniversalString:Qt,Utf8String:Ft,ValueBlock:U,VideotexString:ee,ViewWriter:A,VisibleString:ae,compareSchema:Te,fromBER:J,verifySchema:Oe});var Re;(function(t){t[t["Sequence"]=0]="Sequence";t[t["Set"]=1]="Set";t[t["Choice"]=2]="Choice"})(Re||(Re={}));var Ne;(function(t){t[t["Any"]=1]="Any";t[t["Boolean"]=2]="Boolean";t[t["OctetString"]=3]="OctetString";t[t["BitString"]=4]="BitString";t[t["Integer"]=5]="Integer";t[t["Enumerated"]=6]="Enumerated";t[t["ObjectIdentifier"]=7]="ObjectIdentifier";t[t["Utf8String"]=8]="Utf8String";t[t["BmpString"]=9]="BmpString";t[t["UniversalString"]=10]="UniversalString";t[t["NumericString"]=11]="NumericString";t[t["PrintableString"]=12]="PrintableString";t[t["TeletexString"]=13]="TeletexString";t[t["VideotexString"]=14]="VideotexString";t[t["IA5String"]=15]="IA5String";t[t["GraphicString"]=16]="GraphicString";t[t["VisibleString"]=17]="VisibleString";t[t["GeneralString"]=18]="GeneralString";t[t["CharacterString"]=19]="CharacterString";t[t["UTCTime"]=20]="UTCTime";t[t["GeneralizedTime"]=21]="GeneralizedTime";t[t["DATE"]=22]="DATE";t[t["TimeOfDay"]=23]="TimeOfDay";t[t["DateTime"]=24]="DateTime";t[t["Duration"]=25]="Duration";t[t["TIME"]=26]="TIME";t[t["Null"]=27]="Null"})(Ne||(Ne={}));class Me{constructor(t,e=0){this.unusedBits=0;this.value=new ArrayBuffer(0);if(t){if(typeof t==="number"){this.fromNumber(t)}else if(n.BufferSourceConverter.isBufferSource(t)){this.unusedBits=e;this.value=n.BufferSourceConverter.toArrayBuffer(t)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}fromASN(t){if(!(t instanceof ft)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=t.valueBlock.unusedBits;this.value=t.valueBlock.valueHex;return this}toASN(){return new ft({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new ft({name:t})}toNumber(){let t="";const e=new Uint8Array(this.value);for(const i of e){t+=i.toString(2).padStart(8,"0")}t=t.split("").reverse().join("");if(this.unusedBits){t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(t,2)}fromNumber(t){let e=t.toString(2);const i=e.length+7>>3;this.unusedBits=(i<<3)-e.length;const r=new Uint8Array(i);e=e.padStart(i<<3,"0").split("").reverse().join("");let s=0;while(s<i){r[s]=parseInt(e.slice(s<<3,(s<<3)+8),2);s++}this.value=r.buffer}}class Ke{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){if(typeof t==="number"){this.buffer=new ArrayBuffer(t)}else{if(n.BufferSourceConverter.isBufferSource(t)){this.buffer=n.BufferSourceConverter.toArrayBuffer(t)}else if(Array.isArray(t)){this.buffer=new Uint8Array(t)}else{this.buffer=new ArrayBuffer(0)}}}fromASN(t){if(!(t instanceof ht)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=t.valueBlock.valueHex;return this}toASN(){return new ht({valueHex:this.buffer})}toSchema(t){return new ht({name:t})}}const He={fromASN:t=>t instanceof nt?null:t.valueBeforeDecodeView,toASN:t=>{if(t===null){return new nt}const e=J(t);if(e.result.error){throw new Error(e.result.error)}return e.result}};const Ue={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new gt({value:+t})};const je={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new Et({value:t})};const _e={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new gt({valueHex:t})};const Fe={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new ft({valueHex:t})};const Ve={fromASN:t=>t.valueBlock.toString(),toASN:t=>new It({value:t})};const Le={fromASN:t=>t.valueBlock.value,toASN:t=>new ct({value:t})};const $e={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new ht({valueHex:t})};const Ge={fromASN:t=>new Ke(t.getValue()),toASN:t=>t.toASN()};function We(t){return{fromASN:t=>t.valueBlock.value,toASN:e=>new t({value:e})}}const Qe=We(Ft);const qe=We($t);const ze=We(Qt);const Je=We(zt);const Ye=We(Yt);const Ze=We(Xt);const Xe=We(ee);const ti=We(re);const ei=We(ne);const ii=We(ae);const ri=We(ue);const si=We(he);const ni={fromASN:t=>t.toDate(),toASN:t=>new de({valueDate:t})};const oi={fromASN:t=>t.toDate(),toASN:t=>new ye({valueDate:t})};const ai={fromASN:()=>null,toASN:()=>new nt};function ci(t){switch(t){case Ne.Any:return He;case Ne.BitString:return Fe;case Ne.BmpString:return qe;case Ne.Boolean:return Le;case Ne.CharacterString:return si;case Ne.Enumerated:return je;case Ne.GeneralString:return ri;case Ne.GeneralizedTime:return oi;case Ne.GraphicString:return ei;case Ne.IA5String:return ti;case Ne.Integer:return Ue;case Ne.Null:return ai;case Ne.NumericString:return Je;case Ne.ObjectIdentifier:return Ve;case Ne.OctetString:return $e;case Ne.PrintableString:return Ye;case Ne.TeletexString:return Ze;case Ne.UTCTime:return ni;case Ne.UniversalString:return ze;case Ne.Utf8String:return Qe;case Ne.VideotexString:return Xe;case Ne.VisibleString:return ii;default:return null}}function ui(t){if(typeof t==="function"&&t.prototype){if(t.prototype.toASN&&t.prototype.fromASN){return true}else{return ui(t.prototype)}}else{return!!(t&&typeof t==="object"&&"toASN"in t&&"fromASN"in t)}}function li(t){var e;if(t){const i=Object.getPrototypeOf(t);if(((e=i===null||i===void 0?void 0:i.prototype)===null||e===void 0?void 0:e.constructor)===Array){return true}return li(i)}return false}function hi(t,e){if(!(t&&e)){return false}if(t.byteLength!==e.byteLength){return false}const i=new Uint8Array(t);const r=new Uint8Array(e);for(let e=0;e<t.byteLength;e++){if(i[e]!==r[e]){return false}}return true}class pi{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,e=false){const i=this.items.get(t);if(!i){throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`)}if(e&&!i.schema){throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`)}return i}cache(t){const e=this.get(t);if(!e.schema){e.schema=this.create(t,true)}}createDefault(t){const e={type:Re.Sequence,items:{}};const i=this.findParentSchema(t);if(i){Object.assign(e,i);e.items=Object.assign({},e.items,i.items)}return e}create(t,e){const i=this.items.get(t)||this.createDefault(t);const r=[];for(const t in i.items){const s=i.items[t];const n=e?t:"";let o;if(typeof s.type==="number"){const t=Ne[s.type];const e=ke[t];if(!e){throw new Error(`Cannot get ASN1 class by name '${t}'`)}o=new e({name:n})}else if(ui(s.type)){const t=new s.type;o=t.toSchema(n)}else if(s.optional){const t=this.get(s.type);if(t.type===Re.Choice){o=new De({name:n})}else{o=this.create(s.type,false);o.name=n}}else{o=new De({name:n})}const a=!!s.optional||s.defaultValue!==undefined;if(s.repeated){o.name="";const t=s.repeated==="set"?Mt:Rt;o=new t({name:"",value:[new Be({name:n,value:o})]})}if(s.context!==null&&s.context!==undefined){if(s.implicit){if(typeof s.type==="number"||ui(s.type)){const t=s.repeated?tt:Q;r.push(new t({name:n,optional:a,idBlock:{tagClass:3,tagNumber:s.context}}))}else{this.cache(s.type);const t=!!s.repeated;let e=!t?this.get(s.type,true).schema:o;e="valueBlock"in e?e.valueBlock.value:e.value;r.push(new tt({name:!t?n:"",optional:a,idBlock:{tagClass:3,tagNumber:s.context},value:e}))}}else{r.push(new tt({optional:a,idBlock:{tagClass:3,tagNumber:s.context},value:[o]}))}}else{o.optional=a;r.push(o)}}switch(i.type){case Re.Sequence:return new Rt({value:r,name:""});case Re.Set:return new Mt({value:r,name:""});case Re.Choice:return new Ie({value:r,name:""});default:throw new Error(`Unsupported ASN1 type in use`)}}set(t,e){this.items.set(t,e);return this}findParentSchema(t){const e=Object.getPrototypeOf(t);if(e){const t=this.items.get(e);return t||this.findParentSchema(e)}return null}}const di=new pi;const fi=t=>e=>{let i;if(!di.has(e)){i=di.createDefault(e);di.set(e,i)}else{i=di.get(e)}Object.assign(i,t)};const yi=t=>(e,i)=>{let r;if(!di.has(e.constructor)){r=di.createDefault(e.constructor);di.set(e.constructor,r)}else{r=di.get(e.constructor)}const s=Object.assign({},t);if(typeof s.type==="number"&&!s.converter){const r=ci(t.type);if(!r){throw new Error(`Cannot get default converter for property '${i}' of ${e.constructor.name}`)}s.converter=r}r.items[i]=s};class Si extends Error{constructor(){super(...arguments);this.schemas=[]}}class Ai{static parse(t,e){const i=J(t);if(i.result.error){throw new Error(i.result.error)}const r=this.fromASN(i.result,e);return r}static fromASN(t,e){try{if(ui(e)){const i=new e;return i.fromASN(t)}const i=di.get(e);di.cache(e);let r=i.schema;const s=this.handleChoiceTypes(t,i,e,r);if(s===null||s===void 0?void 0:s.result){return s.result}if(s===null||s===void 0?void 0:s.targetSchema){r=s.targetSchema}const n=this.handleSequenceTypes(t,i,e,r);if(n&&"isManualMapping"in n){return n.result}const o=n;const a=new e;if(li(e)){return this.handleArrayTypes(t,i,e)}this.processSchemaItems(i,o,a);return a}catch(t){if(t instanceof Si){t.schemas.push(e.name)}throw t}}static handleChoiceTypes(t,e,i,r){if(t.constructor===tt&&e.type===Re.Choice&&t.idBlock.tagClass===3){for(const r in e.items){const s=e.items[r];if(s.context===t.idBlock.tagNumber&&s.implicit){if(typeof s.type==="function"&&di.has(s.type)){const e=di.get(s.type);if(e&&e.type===Re.Sequence){const e=new Rt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in e.valueBlock){e.valueBlock.value=t.valueBlock.value;const n=this.fromASN(e,s.type);const o=new i;o[r]=n;return{result:o}}}}}}}else if(t.constructor===tt&&e.type!==Re.Choice){const i=new tt({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:e.schema.valueBlock.value});for(const i in e.items){delete t[i]}return{targetSchema:i}}return null}static handleSequenceTypes(t,e,i,r){if(e.type===Re.Sequence){const s=Object.keys(e.items).filter((t=>{const i=e.items[t];return i.optional&&typeof i.type==="function"&&di.has(i.type)&&di.get(i.type).type===Re.Choice}));if(s.length>0&&"value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&i.name==="CertReqMsg"){return this.handleManualMapping(t,e,i)}const n=Te({},t,r);if(!n.verified){throw new Si(`Data does not match to ${i.name} ASN1 schema. ${n.result.error}`)}return n}else{const e=Te({},t,r);if(!e.verified){throw new Si(`Data does not match to ${i.name} ASN1 schema. ${e.result.error}`)}return e}}static handleManualMapping(t,e,i){const r=new i;const s=t.valueBlock.value;const n=Object.keys(e.items);let o=0;for(let t=0;t<n.length;t++){const i=n[t];const a=e.items[i];if(o>=s.length)break;if(a.repeated){r[i]=this.processRepeatedField(s,o,a);break}else if(typeof a.type==="number"){r[i]=this.processPrimitiveField(s[o],a);o++}else if(this.isOptionalChoiceField(a)){const t=this.processOptionalChoiceField(s[o],a);if(t.processed){r[i]=t.value;o++}}else{r[i]=this.fromASN(s[o],a.type);o++}}return{result:r,verified:true,isManualMapping:true}}static processRepeatedField(t,e,i){let r=t.slice(e);if(r.length===1&&r[0].constructor.name==="Sequence"){const t=r[0];if(t.valueBlock&&t.valueBlock.value&&Array.isArray(t.valueBlock.value)){r=t.valueBlock.value}}if(typeof i.type==="number"){const t=ci(i.type);if(!t)throw new Error(`No converter for ASN.1 type ${i.type}`);return r.filter((t=>t&&t.valueBlock)).map((e=>{try{return t.fromASN(e)}catch{return undefined}})).filter((t=>t!==undefined))}else{return r.filter((t=>t&&t.valueBlock)).map((t=>{try{return this.fromASN(t,i.type)}catch{return undefined}})).filter((t=>t!==undefined))}}static processPrimitiveField(t,e){const i=ci(e.type);if(!i)throw new Error(`No converter for ASN.1 type ${e.type}`);return i.fromASN(t)}static isOptionalChoiceField(t){return t.optional&&typeof t.type==="function"&&di.has(t.type)&&di.get(t.type).type===Re.Choice}static processOptionalChoiceField(t,e){try{const i=this.fromASN(t,e.type);return{processed:true,value:i}}catch(t){if(t instanceof Si&&/Wrong values for Choice type/.test(t.message)){return{processed:false}}throw t}}static handleArrayTypes(t,e,i){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value))){throw new Error(`Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.`)}const r=e.itemType;if(typeof r==="number"){const e=ci(r);if(!e){throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`)}return i.from(t.valueBlock.value,(t=>e.fromASN(t)))}else{return i.from(t.valueBlock.value,(t=>this.fromASN(t,r)))}}static processSchemaItems(t,e,i){for(const r in t.items){const s=e.result[r];if(!s){continue}const n=t.items[r];const o=n.type;if(typeof o==="number"||ui(o)){i[r]=this.processPrimitiveSchemaItem(s,n,o)}else{i[r]=this.processComplexSchemaItem(s,n,o)}}}static processPrimitiveSchemaItem(t,e,i){var r;const s=(r=e.converter)!==null&&r!==void 0?r:ui(i)?new i:null;if(!s){throw new Error("Converter is empty")}if(e.repeated){return this.processRepeatedPrimitiveItem(t,e,s)}else{return this.processSinglePrimitiveItem(t,e,i,s)}}static processRepeatedPrimitiveItem(t,e,i){if(e.implicit){const r=e.repeated==="sequence"?Rt:Mt;const s=new r;s.valueBlock=t.valueBlock;const n=J(s.toBER(false));if(n.offset===-1){throw new Error(`Cannot parse the child item. ${n.result.error}`)}if(!("value"in n.result.valueBlock&&Array.isArray(n.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}const o=n.result.valueBlock.value;return Array.from(o,(t=>i.fromASN(t)))}else{return Array.from(t,(t=>i.fromASN(t)))}}static processSinglePrimitiveItem(t,e,i,r){let s=t;if(e.implicit){let t;if(ui(i)){t=(new i).toSchema("")}else{const e=Ne[i];const r=ke[e];if(!r){throw new Error(`Cannot get '${e}' class from asn1js module`)}t=new r}t.valueBlock=s.valueBlock;s=J(t.toBER(false)).result}return r.fromASN(s)}static processComplexSchemaItem(t,e,i){if(e.repeated){if(!Array.isArray(t)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}return Array.from(t,(t=>this.fromASN(t,i)))}else{const r=this.handleImplicitTagging(t,e,i);if(this.isOptionalChoiceField(e)){try{return this.fromASN(r,i)}catch(t){if(t instanceof Si&&/Wrong values for Choice type/.test(t.message)){return undefined}throw t}}else{return this.fromASN(r,i)}}}static handleImplicitTagging(t,e,i){if(e.implicit&&typeof e.context==="number"){const e=di.get(i);if(e.type===Re.Sequence){const e=new Rt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in e.valueBlock){e.valueBlock.value=t.valueBlock.value;return e}}else if(e.type===Re.Set){const e=new Mt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in e.valueBlock){e.valueBlock.value=t.valueBlock.value;return e}}}return t}}class vi{static serialize(t){if(t instanceof V){return t.toBER(false)}return this.toASN(t).toBER(false)}static toASN(t){if(t&&typeof t==="object"&&ui(t)){return t.toASN()}if(!(t&&typeof t==="object")){throw new TypeError("Parameter 1 should be type of Object.")}const e=t.constructor;const i=di.get(e);di.cache(e);let r=[];if(i.itemType){if(!Array.isArray(t)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof i.itemType==="number"){const s=ci(i.itemType);if(!s){throw new Error(`Cannot get default converter for array item of ${e.name} ASN1 schema`)}r=t.map((t=>s.toASN(t)))}else{r=t.map((t=>this.toAsnItem({type:i.itemType},"[]",e,t)))}}else{for(const s in i.items){const n=i.items[s];const o=t[s];if(o===undefined||n.defaultValue===o||typeof n.defaultValue==="object"&&typeof o==="object"&&hi(this.serialize(n.defaultValue),this.serialize(o))){continue}const a=vi.toAsnItem(n,s,e,o);if(typeof n.context==="number"){if(n.implicit){if(!n.repeated&&(typeof n.type==="number"||ui(n.type))){const t={};t.valueHex=a instanceof nt?a.valueBeforeDecodeView:a.valueBlock.toBER();r.push(new Q({optional:n.optional,idBlock:{tagClass:3,tagNumber:n.context},...t}))}else{r.push(new tt({optional:n.optional,idBlock:{tagClass:3,tagNumber:n.context},value:a.valueBlock.value}))}}else{r.push(new tt({optional:n.optional,idBlock:{tagClass:3,tagNumber:n.context},value:[a]}))}}else if(n.repeated){r=r.concat(a)}else{r.push(a)}}}let s;switch(i.type){case Re.Sequence:s=new Rt({value:r});break;case Re.Set:s=new Mt({value:r});break;case Re.Choice:if(!r[0]){throw new Error(`Schema '${e.name}' has wrong data. Choice cannot be empty.`)}s=r[0];break}return s}static toAsnItem(t,e,i,r){let s;if(typeof t.type==="number"){const n=t.converter;if(!n){throw new Error(`Property '${e}' doesn't have converter for type ${Ne[t.type]} in schema '${i.name}'`)}if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}const e=Array.from(r,(t=>n.toASN(t)));const i=t.repeated==="sequence"?Rt:Mt;s=new i({value:e})}else{s=n.toASN(r)}}else{if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}const e=Array.from(r,(t=>this.toASN(t)));const i=t.repeated==="sequence"?Rt:Mt;s=new i({value:e})}else{s=this.toASN(r)}}return s}}class mi extends Array{constructor(t=[]){if(typeof t==="number"){super(t)}else{super();for(const e of t){this.push(e)}}}}class Ci{static serialize(t){return vi.serialize(t)}static parse(t,e){return Ai.parse(t,e)}static toString(t){const e=n.BufferSourceConverter.isBufferSource(t)?n.BufferSourceConverter.toArrayBuffer(t):Ci.serialize(t);const i=J(e);if(i.offset===-1){throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`)}return i.result.toString()}}function gi(t,e,i,r){var s=arguments.length,n=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)if(o=t[a])n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n;return s>3&&n&&Object.defineProperty(e,i,n),n}typeof SuppressedError==="function"?SuppressedError:function(t,e,i){var r=new Error(i);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};class wi{static isIPv4(t){return/^(\d{1,3}\.){3}\d{1,3}$/.test(t)}static parseIPv4(t){const e=t.split(".");if(e.length!==4){throw new Error("Invalid IPv4 address")}return e.map((t=>{const e=parseInt(t,10);if(isNaN(e)||e<0||e>255){throw new Error("Invalid IPv4 address part")}return e}))}static parseIPv6(t){const e=this.expandIPv6(t);const i=e.split(":");if(i.length!==8){throw new Error("Invalid IPv6 address")}return i.reduce(((t,e)=>{const i=parseInt(e,16);if(isNaN(i)||i<0||i>65535){throw new Error("Invalid IPv6 address part")}t.push(i>>8&255);t.push(i&255);return t}),[])}static expandIPv6(t){if(!t.includes("::")){return t}const e=t.split("::");if(e.length>2){throw new Error("Invalid IPv6 address")}const i=e[0]?e[0].split(":"):[];const r=e[1]?e[1].split(":"):[];const s=8-(i.length+r.length);if(s<0){throw new Error("Invalid IPv6 address")}return[...i,...Array(s).fill("0"),...r].join(":")}static formatIPv6(t){const e=[];for(let i=0;i<16;i+=2){e.push((t[i]<<8|t[i+1]).toString(16))}return this.compressIPv6(e.join(":"))}static compressIPv6(t){const e=t.split(":");let i=-1;let r=0;let s=-1;let n=0;for(let t=0;t<e.length;t++){if(e[t]==="0"){if(s===-1){s=t}n++}else{if(n>r){i=s;r=n}s=-1;n=0}}if(n>r){i=s;r=n}if(r>1){const t=e.slice(0,i).join(":");const s=e.slice(i+r).join(":");return`${t}::${s}`}return t}static parseCIDR(t){const[e,i]=t.split("/");const r=parseInt(i,10);if(this.isIPv4(e)){if(r<0||r>32){throw new Error("Invalid IPv4 prefix length")}return[this.parseIPv4(e),r]}else{if(r<0||r>128){throw new Error("Invalid IPv6 prefix length")}return[this.parseIPv6(e),r]}}static decodeIP(t){if(t.length===64&&parseInt(t,16)===0){return"::/0"}if(t.length!==16){return t}const e=parseInt(t.slice(8),16).toString(2).split("").reduce(((t,e)=>t+ +e),0);let i=t.slice(0,8).replace(/(.{2})/g,(t=>`${parseInt(t,16)}.`));i=i.slice(0,-1);return`${i}/${e}`}static toString(t){const e=new Uint8Array(t);if(e.length===4){return Array.from(e).join(".")}if(e.length===16){return this.formatIPv6(e)}if(e.length===8||e.length===32){const t=e.length/2;const i=e.slice(0,t);const r=e.slice(t);const s=e.every((t=>t===0));if(s){return e.length===8?"0.0.0.0/0":"::/0"}const n=r.reduce(((t,e)=>t+(e.toString(2).match(/1/g)||[]).length),0);if(e.length===8){const t=Array.from(i).join(".");return`${t}/${n}`}else{const t=this.formatIPv6(i);return`${t}/${n}`}}return this.decodeIP(n.Convert.ToHex(t))}static fromString(t){if(t.includes("/")){const[e,i]=this.parseCIDR(t);const r=new Uint8Array(e.length);let s=i;for(let t=0;t<r.length;t++){if(s>=8){r[t]=255;s-=8}else if(s>0){r[t]=255<<8-s;s=0}}const n=new Uint8Array(e.length*2);n.set(e,0);n.set(r,e.length);return n.buffer}const e=this.isIPv4(t)?this.parseIPv4(t):this.parseIPv6(t);return new Uint8Array(e).buffer}}var Ei,bi,Pi;let Di=class t{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};gi([yi({type:Ne.TeletexString})],Di.prototype,"teletexString",void 0);gi([yi({type:Ne.PrintableString})],Di.prototype,"printableString",void 0);gi([yi({type:Ne.UniversalString})],Di.prototype,"universalString",void 0);gi([yi({type:Ne.Utf8String})],Di.prototype,"utf8String",void 0);gi([yi({type:Ne.BmpString})],Di.prototype,"bmpString",void 0);Di=gi([fi({type:Re.Choice})],Di);let Ii=class t extends Di{constructor(t={}){super(t);Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?n.Convert.ToHex(this.anyValue):super.toString())}};gi([yi({type:Ne.IA5String})],Ii.prototype,"ia5String",void 0);gi([yi({type:Ne.Any})],Ii.prototype,"anyValue",void 0);Ii=gi([fi({type:Re.Choice})],Ii);class Bi{constructor(t={}){this.type="";this.value=new Ii;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Bi.prototype,"type",void 0);gi([yi({type:Ii})],Bi.prototype,"value",void 0);let xi=Ei=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ei.prototype)}};xi=Ei=gi([fi({type:Re.Set,itemType:Bi})],xi);let Ti=bi=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,bi.prototype)}};Ti=bi=gi([fi({type:Re.Sequence,itemType:xi})],Ti);let Oi=Pi=class t extends Ti{constructor(t){super(t);Object.setPrototypeOf(this,Pi.prototype)}};Oi=Pi=gi([fi({type:Re.Sequence})],Oi);const ki={fromASN:t=>wi.toString($e.fromASN(t)),toASN:t=>$e.toASN(wi.fromString(t))};class Ri{constructor(t={}){this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Ri.prototype,"typeId",void 0);gi([yi({type:Ne.Any,context:0})],Ri.prototype,"value",void 0);class Ni{constructor(t={}){this.partyName=new Di;Object.assign(this,t)}}gi([yi({type:Di,optional:true,context:0,implicit:true})],Ni.prototype,"nameAssigner",void 0);gi([yi({type:Di,context:1,implicit:true})],Ni.prototype,"partyName",void 0);let Mi=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ri,context:0,implicit:true})],Mi.prototype,"otherName",void 0);gi([yi({type:Ne.IA5String,context:1,implicit:true})],Mi.prototype,"rfc822Name",void 0);gi([yi({type:Ne.IA5String,context:2,implicit:true})],Mi.prototype,"dNSName",void 0);gi([yi({type:Ne.Any,context:3,implicit:true})],Mi.prototype,"x400Address",void 0);gi([yi({type:Oi,context:4,implicit:false})],Mi.prototype,"directoryName",void 0);gi([yi({type:Ni,context:5})],Mi.prototype,"ediPartyName",void 0);gi([yi({type:Ne.IA5String,context:6,implicit:true})],Mi.prototype,"uniformResourceIdentifier",void 0);gi([yi({type:Ne.OctetString,context:7,implicit:true,converter:ki})],Mi.prototype,"iPAddress",void 0);gi([yi({type:Ne.ObjectIdentifier,context:8,implicit:true})],Mi.prototype,"registeredID",void 0);Mi=gi([fi({type:Re.Choice})],Mi);const Ki="1.3.6.1.5.5.7";const Hi=`${Ki}.1`;const Ui="2.5.29";var ji;const _i=`${Hi}.1`;class Fi{constructor(t={}){this.accessMethod="";this.accessLocation=new Mi;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Fi.prototype,"accessMethod",void 0);gi([yi({type:Mi})],Fi.prototype,"accessLocation",void 0);let Vi=ji=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ji.prototype)}};Vi=ji=gi([fi({type:Re.Sequence,itemType:Fi})],Vi);const Li=`${Ui}.35`;class $i extends Ke{}class Gi{constructor(t={}){if(t){Object.assign(this,t)}}}gi([yi({type:$i,context:0,optional:true,implicit:true})],Gi.prototype,"keyIdentifier",void 0);gi([yi({type:Mi,context:1,optional:true,implicit:true,repeated:"sequence"})],Gi.prototype,"authorityCertIssuer",void 0);gi([yi({type:Ne.Integer,context:2,optional:true,implicit:true,converter:_e})],Gi.prototype,"authorityCertSerialNumber",void 0);const Wi=`${Ui}.19`;class Qi{constructor(t={}){this.cA=false;Object.assign(this,t)}}gi([yi({type:Ne.Boolean,defaultValue:false})],Qi.prototype,"cA",void 0);gi([yi({type:Ne.Integer,optional:true})],Qi.prototype,"pathLenConstraint",void 0);var qi;let zi=qi=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,qi.prototype)}};zi=qi=gi([fi({type:Re.Sequence,itemType:Mi})],zi);var Ji;const Yi=`${Ui}.29`;let Zi=Ji=class t extends zi{constructor(t){super(t);Object.setPrototypeOf(this,Ji.prototype)}};Zi=Ji=gi([fi({type:Re.Sequence})],Zi);var Xi;const tr=`${Ui}.32`;let er=class t{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};gi([yi({type:Ne.IA5String})],er.prototype,"ia5String",void 0);gi([yi({type:Ne.VisibleString})],er.prototype,"visibleString",void 0);gi([yi({type:Ne.BmpString})],er.prototype,"bmpString",void 0);gi([yi({type:Ne.Utf8String})],er.prototype,"utf8String",void 0);er=gi([fi({type:Re.Choice})],er);class ir{constructor(t={}){this.organization=new er;this.noticeNumbers=[];Object.assign(this,t)}}gi([yi({type:er})],ir.prototype,"organization",void 0);gi([yi({type:Ne.Integer,repeated:"sequence"})],ir.prototype,"noticeNumbers",void 0);class rr{constructor(t={}){Object.assign(this,t)}}gi([yi({type:ir,optional:true})],rr.prototype,"noticeRef",void 0);gi([yi({type:er,optional:true})],rr.prototype,"explicitText",void 0);let sr=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.IA5String})],sr.prototype,"cPSuri",void 0);gi([yi({type:rr})],sr.prototype,"userNotice",void 0);sr=gi([fi({type:Re.Choice})],sr);class nr{constructor(t={}){this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],nr.prototype,"policyQualifierId",void 0);gi([yi({type:Ne.Any})],nr.prototype,"qualifier",void 0);class or{constructor(t={}){this.policyIdentifier="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],or.prototype,"policyIdentifier",void 0);gi([yi({type:nr,repeated:"sequence",optional:true})],or.prototype,"policyQualifiers",void 0);let ar=Xi=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Xi.prototype)}};ar=Xi=gi([fi({type:Re.Sequence,itemType:or})],ar);const cr=`${Ui}.20`;let ur=class t{constructor(t=0){this.value=t}};gi([yi({type:Ne.Integer})],ur.prototype,"value",void 0);ur=gi([fi({type:Re.Choice})],ur);const lr=`${Ui}.27`;let hr=class t extends ur{};hr=gi([fi({type:Re.Choice})],hr);var pr;const dr=`${Ui}.31`;var fr;(function(t){t[t["unused"]=1]="unused";t[t["keyCompromise"]=2]="keyCompromise";t[t["cACompromise"]=4]="cACompromise";t[t["affiliationChanged"]=8]="affiliationChanged";t[t["superseded"]=16]="superseded";t[t["cessationOfOperation"]=32]="cessationOfOperation";t[t["certificateHold"]=64]="certificateHold";t[t["privilegeWithdrawn"]=128]="privilegeWithdrawn";t[t["aACompromise"]=256]="aACompromise"})(fr||(fr={}));class yr extends Me{toJSON(){const t=[];const e=this.toNumber();if(e&fr.aACompromise){t.push("aACompromise")}if(e&fr.affiliationChanged){t.push("affiliationChanged")}if(e&fr.cACompromise){t.push("cACompromise")}if(e&fr.certificateHold){t.push("certificateHold")}if(e&fr.cessationOfOperation){t.push("cessationOfOperation")}if(e&fr.keyCompromise){t.push("keyCompromise")}if(e&fr.privilegeWithdrawn){t.push("privilegeWithdrawn")}if(e&fr.superseded){t.push("superseded")}if(e&fr.unused){t.push("unused")}return t}toString(){return`[${this.toJSON().join(", ")}]`}}let Sr=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Mi,context:0,repeated:"sequence",implicit:true})],Sr.prototype,"fullName",void 0);gi([yi({type:xi,context:1,implicit:true})],Sr.prototype,"nameRelativeToCRLIssuer",void 0);Sr=gi([fi({type:Re.Choice})],Sr);class Ar{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Sr,context:0,optional:true})],Ar.prototype,"distributionPoint",void 0);gi([yi({type:yr,context:1,optional:true,implicit:true})],Ar.prototype,"reasons",void 0);gi([yi({type:Mi,context:2,optional:true,repeated:"sequence",implicit:true})],Ar.prototype,"cRLIssuer",void 0);let vr=pr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,pr.prototype)}};vr=pr=gi([fi({type:Re.Sequence,itemType:Ar})],vr);var mr;let Cr=mr=class t extends vr{constructor(t){super(t);Object.setPrototypeOf(this,mr.prototype)}};Cr=mr=gi([fi({type:Re.Sequence,itemType:Ar})],Cr);const gr=`${Ui}.28`;class wr{constructor(t={}){this.onlyContainsUserCerts=wr.ONLY;this.onlyContainsCACerts=wr.ONLY;this.indirectCRL=wr.ONLY;this.onlyContainsAttributeCerts=wr.ONLY;Object.assign(this,t)}}wr.ONLY=false;gi([yi({type:Sr,context:0,optional:true})],wr.prototype,"distributionPoint",void 0);gi([yi({type:Ne.Boolean,context:1,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"onlyContainsUserCerts",void 0);gi([yi({type:Ne.Boolean,context:2,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"onlyContainsCACerts",void 0);gi([yi({type:yr,context:3,optional:true,implicit:true})],wr.prototype,"onlySomeReasons",void 0);gi([yi({type:Ne.Boolean,context:4,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"indirectCRL",void 0);gi([yi({type:Ne.Boolean,context:5,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"onlyContainsAttributeCerts",void 0);const Er=`${Ui}.21`;var br;(function(t){t[t["unspecified"]=0]="unspecified";t[t["keyCompromise"]=1]="keyCompromise";t[t["cACompromise"]=2]="cACompromise";t[t["affiliationChanged"]=3]="affiliationChanged";t[t["superseded"]=4]="superseded";t[t["cessationOfOperation"]=5]="cessationOfOperation";t[t["certificateHold"]=6]="certificateHold";t[t["removeFromCRL"]=8]="removeFromCRL";t[t["privilegeWithdrawn"]=9]="privilegeWithdrawn";t[t["aACompromise"]=10]="aACompromise"})(br||(br={}));let Pr=class t{constructor(t=br.unspecified){this.reason=br.unspecified;this.reason=t}toJSON(){return br[this.reason]}toString(){return this.toJSON()}};gi([yi({type:Ne.Enumerated})],Pr.prototype,"reason",void 0);Pr=gi([fi({type:Re.Choice})],Pr);var Dr;const Ir=`${Ui}.37`;let Br=Dr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Dr.prototype)}};Br=Dr=gi([fi({type:Re.Sequence,itemType:Ne.ObjectIdentifier})],Br);const xr=`${Ui}.54`;let Tr=class t{constructor(t=new ArrayBuffer(0)){this.value=t}};gi([yi({type:Ne.Integer,converter:_e})],Tr.prototype,"value",void 0);Tr=gi([fi({type:Re.Choice})],Tr);const Or=`${Ui}.24`;let kr=class t{constructor(t){this.value=new Date;if(t){this.value=t}}};gi([yi({type:Ne.GeneralizedTime})],kr.prototype,"value",void 0);kr=gi([fi({type:Re.Choice})],kr);var Rr;const Nr=`${Ui}.18`;let Mr=Rr=class t extends zi{constructor(t){super(t);Object.setPrototypeOf(this,Rr.prototype)}};Mr=Rr=gi([fi({type:Re.Sequence})],Mr);const Kr=`${Ui}.15`;var Hr;(function(t){t[t["digitalSignature"]=1]="digitalSignature";t[t["nonRepudiation"]=2]="nonRepudiation";t[t["keyEncipherment"]=4]="keyEncipherment";t[t["dataEncipherment"]=8]="dataEncipherment";t[t["keyAgreement"]=16]="keyAgreement";t[t["keyCertSign"]=32]="keyCertSign";t[t["cRLSign"]=64]="cRLSign";t[t["encipherOnly"]=128]="encipherOnly";t[t["decipherOnly"]=256]="decipherOnly"})(Hr||(Hr={}));class Ur extends Me{toJSON(){const t=this.toNumber();const e=[];if(t&Hr.cRLSign){e.push("crlSign")}if(t&Hr.dataEncipherment){e.push("dataEncipherment")}if(t&Hr.decipherOnly){e.push("decipherOnly")}if(t&Hr.digitalSignature){e.push("digitalSignature")}if(t&Hr.encipherOnly){e.push("encipherOnly")}if(t&Hr.keyAgreement){e.push("keyAgreement")}if(t&Hr.keyCertSign){e.push("keyCertSign")}if(t&Hr.keyEncipherment){e.push("keyEncipherment")}if(t&Hr.nonRepudiation){e.push("nonRepudiation")}return e}toString(){return`[${this.toJSON().join(", ")}]`}}var jr;const _r=`${Ui}.30`;class Fr{constructor(t={}){this.base=new Mi;this.minimum=0;Object.assign(this,t)}}gi([yi({type:Mi})],Fr.prototype,"base",void 0);gi([yi({type:Ne.Integer,context:0,defaultValue:0,implicit:true})],Fr.prototype,"minimum",void 0);gi([yi({type:Ne.Integer,context:1,optional:true,implicit:true})],Fr.prototype,"maximum",void 0);let Vr=jr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,jr.prototype)}};Vr=jr=gi([fi({type:Re.Sequence,itemType:Fr})],Vr);class Lr{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Vr,context:0,optional:true,implicit:true})],Lr.prototype,"permittedSubtrees",void 0);gi([yi({type:Vr,context:1,optional:true,implicit:true})],Lr.prototype,"excludedSubtrees",void 0);const $r=`${Ui}.36`;class Gr{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.Integer,context:0,implicit:true,optional:true,converter:_e})],Gr.prototype,"requireExplicitPolicy",void 0);gi([yi({type:Ne.Integer,context:1,implicit:true,optional:true,converter:_e})],Gr.prototype,"inhibitPolicyMapping",void 0);var Wr;const Qr=`${Ui}.33`;class qr{constructor(t={}){this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],qr.prototype,"issuerDomainPolicy",void 0);gi([yi({type:Ne.ObjectIdentifier})],qr.prototype,"subjectDomainPolicy",void 0);let zr=Wr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wr.prototype)}};zr=Wr=gi([fi({type:Re.Sequence,itemType:qr})],zr);var Jr;const Yr=`${Ui}.17`;let Zr=Jr=class t extends zi{constructor(t){super(t);Object.setPrototypeOf(this,Jr.prototype)}};Zr=Jr=gi([fi({type:Re.Sequence})],Zr);let Xr=class t{constructor(t={}){this.type="";this.values=[];Object.assign(this,t)}};gi([yi({type:Ne.ObjectIdentifier})],Xr.prototype,"type",void 0);gi([yi({type:Ne.Any,repeated:"set"})],Xr.prototype,"values",void 0);var ts;const es=`${Ui}.9`;let is=ts=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ts.prototype)}};is=ts=gi([fi({type:Re.Sequence,itemType:Xr})],is);const rs=`${Ui}.14`;class ss extends $i{}const ns=`${Ui}.16`;class os{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.GeneralizedTime,context:0,implicit:true,optional:true})],os.prototype,"notBefore",void 0);gi([yi({type:Ne.GeneralizedTime,context:1,implicit:true,optional:true})],os.prototype,"notAfter",void 0);const as="1.2.840.113533.7.65.0";var cs;(function(t){t[t["keyUpdateAllowed"]=1]="keyUpdateAllowed";t[t["newExtensions"]=2]="newExtensions";t[t["pKIXCertificate"]=4]="pKIXCertificate"})(cs||(cs={}));class us extends Me{toJSON(){const t=[];const e=this.toNumber();if(e&cs.pKIXCertificate){t.push("pKIXCertificate")}if(e&cs.newExtensions){t.push("newExtensions")}if(e&cs.keyUpdateAllowed){t.push("keyUpdateAllowed")}return t}toString(){return`[${this.toJSON().join(", ")}]`}}class ls{constructor(t={}){this.entrustVers="";this.entrustInfoFlags=new us;Object.assign(this,t)}}gi([yi({type:Ne.GeneralString})],ls.prototype,"entrustVers",void 0);gi([yi({type:us})],ls.prototype,"entrustInfoFlags",void 0);var hs;const ps=`${Hi}.11`;let ds=hs=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,hs.prototype)}};ds=hs=gi([fi({type:Re.Sequence,itemType:Fi})],ds);class fs{constructor(t={}){this.algorithm="";Object.assign(this,t)}isEqual(t){return t instanceof fs&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&n.isEqual(t.parameters,this.parameters)||t.parameters===this.parameters)}}gi([yi({type:Ne.ObjectIdentifier})],fs.prototype,"algorithm",void 0);gi([yi({type:Ne.Any,optional:true})],fs.prototype,"parameters",void 0);class ys{constructor(t={}){this.algorithm=new fs;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:fs})],ys.prototype,"algorithm",void 0);gi([yi({type:Ne.BitString})],ys.prototype,"subjectPublicKey",void 0);let Ss=class t{constructor(t){if(t){if(typeof t==="string"||typeof t==="number"||t instanceof Date){const e=new Date(t);if(e.getUTCFullYear()>2049){this.generalTime=e}else{this.utcTime=e}}else{Object.assign(this,t)}}}getTime(){const t=this.utcTime||this.generalTime;if(!t){throw new Error("Cannot get time from CHOICE object")}return t}};gi([yi({type:Ne.UTCTime})],Ss.prototype,"utcTime",void 0);gi([yi({type:Ne.GeneralizedTime})],Ss.prototype,"generalTime",void 0);Ss=gi([fi({type:Re.Choice})],Ss);class As{constructor(t){this.notBefore=new Ss(new Date);this.notAfter=new Ss(new Date);if(t){this.notBefore=new Ss(t.notBefore);this.notAfter=new Ss(t.notAfter)}}}gi([yi({type:Ss})],As.prototype,"notBefore",void 0);gi([yi({type:Ss})],As.prototype,"notAfter",void 0);var vs;let ms=class t{constructor(e={}){this.extnID="";this.critical=t.CRITICAL;this.extnValue=new Ke;Object.assign(this,e)}};ms.CRITICAL=false;gi([yi({type:Ne.ObjectIdentifier})],ms.prototype,"extnID",void 0);gi([yi({type:Ne.Boolean,defaultValue:ms.CRITICAL})],ms.prototype,"critical",void 0);gi([yi({type:Ke})],ms.prototype,"extnValue",void 0);let Cs=vs=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,vs.prototype)}};Cs=vs=gi([fi({type:Re.Sequence,itemType:ms})],Cs);var gs;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2";t[t["v3"]=2]="v3"})(gs||(gs={}));class ws{constructor(t={}){this.version=gs.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new fs;this.issuer=new Oi;this.validity=new As;this.subject=new Oi;this.subjectPublicKeyInfo=new ys;Object.assign(this,t)}}gi([yi({type:Ne.Integer,context:0,defaultValue:gs.v1})],ws.prototype,"version",void 0);gi([yi({type:Ne.Integer,converter:_e})],ws.prototype,"serialNumber",void 0);gi([yi({type:fs})],ws.prototype,"signature",void 0);gi([yi({type:Oi})],ws.prototype,"issuer",void 0);gi([yi({type:As})],ws.prototype,"validity",void 0);gi([yi({type:Oi})],ws.prototype,"subject",void 0);gi([yi({type:ys})],ws.prototype,"subjectPublicKeyInfo",void 0);gi([yi({type:Ne.BitString,context:1,implicit:true,optional:true})],ws.prototype,"issuerUniqueID",void 0);gi([yi({type:Ne.BitString,context:2,implicit:true,optional:true})],ws.prototype,"subjectUniqueID",void 0);gi([yi({type:Cs,context:3,optional:true})],ws.prototype,"extensions",void 0);class Es{constructor(t={}){this.tbsCertificate=new ws;this.signatureAlgorithm=new fs;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:ws})],Es.prototype,"tbsCertificate",void 0);gi([yi({type:fs})],Es.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],Es.prototype,"signatureValue",void 0);class bs{constructor(t={}){this.userCertificate=new ArrayBuffer(0);this.revocationDate=new Ss;Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],bs.prototype,"userCertificate",void 0);gi([yi({type:Ss})],bs.prototype,"revocationDate",void 0);gi([yi({type:ms,optional:true,repeated:"sequence"})],bs.prototype,"crlEntryExtensions",void 0);class Ps{constructor(t={}){this.signature=new fs;this.issuer=new Oi;this.thisUpdate=new Ss;Object.assign(this,t)}}gi([yi({type:Ne.Integer,optional:true})],Ps.prototype,"version",void 0);gi([yi({type:fs})],Ps.prototype,"signature",void 0);gi([yi({type:Oi})],Ps.prototype,"issuer",void 0);gi([yi({type:Ss})],Ps.prototype,"thisUpdate",void 0);gi([yi({type:Ss,optional:true})],Ps.prototype,"nextUpdate",void 0);gi([yi({type:bs,repeated:"sequence",optional:true})],Ps.prototype,"revokedCertificates",void 0);gi([yi({type:ms,optional:true,context:0,repeated:"sequence"})],Ps.prototype,"crlExtensions",void 0);class Ds{constructor(t={}){this.tbsCertList=new Ps;this.signatureAlgorithm=new fs;this.signature=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ps})],Ds.prototype,"tbsCertList",void 0);gi([yi({type:fs})],Ds.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],Ds.prototype,"signature",void 0);const Is="1.2.840.10045.2.1";const Bs="1.2.840.10045.4.1";const xs="1.2.840.10045.4.3.1";const Ts="1.2.840.10045.4.3.2";const Os="1.2.840.10045.4.3.3";const ks="1.2.840.10045.4.3.4";function Rs(t){return new fs({algorithm:t})}Rs(Bs);Rs(xs);Rs(Ts);Rs(Os);Rs(ks);let Ns=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.ObjectIdentifier})],Ns.prototype,"fieldType",void 0);gi([yi({type:Ne.Any})],Ns.prototype,"parameters",void 0);Ns=gi([fi({type:Re.Sequence})],Ns);class Ms extends Ke{}let Ks=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.OctetString})],Ks.prototype,"a",void 0);gi([yi({type:Ne.OctetString})],Ks.prototype,"b",void 0);gi([yi({type:Ne.BitString,optional:true})],Ks.prototype,"seed",void 0);Ks=gi([fi({type:Re.Sequence})],Ks);var Hs;(function(t){t[t["ecpVer1"]=1]="ecpVer1"})(Hs||(Hs={}));let Us=class t{constructor(t={}){this.version=Hs.ecpVer1;Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Us.prototype,"version",void 0);gi([yi({type:Ns})],Us.prototype,"fieldID",void 0);gi([yi({type:Ks})],Us.prototype,"curve",void 0);gi([yi({type:Ms})],Us.prototype,"base",void 0);gi([yi({type:Ne.Integer,converter:_e})],Us.prototype,"order",void 0);gi([yi({type:Ne.Integer,optional:true})],Us.prototype,"cofactor",void 0);Us=gi([fi({type:Re.Sequence})],Us);let js=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.ObjectIdentifier})],js.prototype,"namedCurve",void 0);gi([yi({type:Ne.Null})],js.prototype,"implicitCurve",void 0);gi([yi({type:Us})],js.prototype,"specifiedCurve",void 0);js=gi([fi({type:Re.Choice})],js);class _s{constructor(t={}){this.version=1;this.privateKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],_s.prototype,"version",void 0);gi([yi({type:Ke})],_s.prototype,"privateKey",void 0);gi([yi({type:js,context:0,optional:true})],_s.prototype,"parameters",void 0);gi([yi({type:Ne.BitString,context:1,optional:true})],_s.prototype,"publicKey",void 0);class Fs{constructor(t={}){this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],Fs.prototype,"r",void 0);gi([yi({type:Ne.Integer,converter:_e})],Fs.prototype,"s",void 0);const Vs="1.2.840.113549.1.1";const Ls=`${Vs}.1`;const $s=`${Vs}.7`;const Gs=`${Vs}.9`;const Ws=`${Vs}.10`;const Qs=`${Vs}.2`;const qs=`${Vs}.4`;const zs=`${Vs}.5`;const Js=`${Vs}.12`;const Ys=`${Vs}.13`;const Zs=`${Vs}.15`;const Xs=`${Vs}.16`;const tn="1.3.14.3.2.26";const en="2.16.840.1.101.3.4.2.4";const rn="2.16.840.1.101.3.4.2.1";const sn="2.16.840.1.101.3.4.2.2";const nn="2.16.840.1.101.3.4.2.3";const on="2.16.840.1.101.3.4.2.5";const an="2.16.840.1.101.3.4.2.6";const cn="1.2.840.113549.2.2";const un="1.2.840.113549.2.5";const ln=`${Vs}.8`;function hn(t){return new fs({algorithm:t,parameters:null})}hn(cn);hn(un);const pn=hn(tn);hn(en);hn(rn);hn(sn);hn(nn);hn(on);hn(an);const dn=new fs({algorithm:ln,parameters:Ci.serialize(pn)});const fn=new fs({algorithm:Gs,parameters:Ci.serialize($e.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});hn(Ls);hn(Qs);hn(qs);hn(zs);hn(Zs);hn(Xs);hn(Js);hn(Ys);hn(Zs);hn(Xs);class yn{constructor(t={}){this.hashAlgorithm=new fs(pn);this.maskGenAlgorithm=new fs({algorithm:ln,parameters:Ci.serialize(pn)});this.pSourceAlgorithm=new fs(fn);Object.assign(this,t)}}gi([yi({type:fs,context:0,defaultValue:pn})],yn.prototype,"hashAlgorithm",void 0);gi([yi({type:fs,context:1,defaultValue:dn})],yn.prototype,"maskGenAlgorithm",void 0);gi([yi({type:fs,context:2,defaultValue:fn})],yn.prototype,"pSourceAlgorithm",void 0);new fs({algorithm:$s,parameters:Ci.serialize(new yn)});class Sn{constructor(t={}){this.hashAlgorithm=new fs(pn);this.maskGenAlgorithm=new fs({algorithm:ln,parameters:Ci.serialize(pn)});this.saltLength=20;this.trailerField=1;Object.assign(this,t)}}gi([yi({type:fs,context:0,defaultValue:pn})],Sn.prototype,"hashAlgorithm",void 0);gi([yi({type:fs,context:1,defaultValue:dn})],Sn.prototype,"maskGenAlgorithm",void 0);gi([yi({type:Ne.Integer,context:2,defaultValue:20})],Sn.prototype,"saltLength",void 0);gi([yi({type:Ne.Integer,context:3,defaultValue:1})],Sn.prototype,"trailerField",void 0);new fs({algorithm:Ws,parameters:Ci.serialize(new Sn)});class An{constructor(t={}){this.digestAlgorithm=new fs;this.digest=new Ke;Object.assign(this,t)}}gi([yi({type:fs})],An.prototype,"digestAlgorithm",void 0);gi([yi({type:Ke})],An.prototype,"digest",void 0);var vn;class mn{constructor(t={}){this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],mn.prototype,"prime",void 0);gi([yi({type:Ne.Integer,converter:_e})],mn.prototype,"exponent",void 0);gi([yi({type:Ne.Integer,converter:_e})],mn.prototype,"coefficient",void 0);let Cn=vn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,vn.prototype)}};Cn=vn=gi([fi({type:Re.Sequence,itemType:mn})],Cn);class gn{constructor(t={}){this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer})],gn.prototype,"version",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"modulus",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"publicExponent",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"privateExponent",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"prime1",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"prime2",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"exponent1",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"exponent2",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"coefficient",void 0);gi([yi({type:Cn,optional:true})],gn.prototype,"otherPrimeInfos",void 0);class wn{constructor(t={}){this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],wn.prototype,"modulus",void 0);gi([yi({type:Ne.Integer,converter:_e})],wn.prototype,"publicExponent",void 0);var En,bn;const Pn="1.3.6.1.4.1.18227.2.1";let Dn=En=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,En.prototype)}};Dn=En=gi([fi({type:Re.Sequence,itemType:fs})],Dn);let In=bn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,bn.prototype)}};In=bn=gi([fi({type:Re.Sequence,itemType:Ne.BitString})],In);class Bn extends Ke{}let xn=class t{constructor(t={}){this.encryptionAlgorithm=new fs;this.encryptedData=new Bn;Object.assign(this,t)}};gi([yi({type:fs})],xn.prototype,"encryptionAlgorithm",void 0);gi([yi({type:Bn})],xn.prototype,"encryptedData",void 0);var Tn;var On;(function(t){t[t["v1"]=0]="v1"})(On||(On={}));class kn extends Ke{}let Rn=Tn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Tn.prototype)}};Rn=Tn=gi([fi({type:Re.Sequence,itemType:Xr})],Rn);let Nn=class t{constructor(t={}){this.version=On.v1;this.privateKeyAlgorithm=new fs;this.privateKey=new kn;Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Nn.prototype,"version",void 0);gi([yi({type:fs})],Nn.prototype,"privateKeyAlgorithm",void 0);gi([yi({type:kn})],Nn.prototype,"privateKey",void 0);gi([yi({type:Rn,implicit:true,context:0,optional:true})],Nn.prototype,"attributes",void 0);var Mn;var Kn;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2"})(Kn||(Kn={}));let Hn=class t extends fs{};Hn=gi([fi({type:Re.Sequence})],Hn);let Un=class t{constructor(){this.version=Kn.v1;this.privateKeyAlgorithm=new fs;this.privateKey=new ArrayBuffer(0)}};gi([yi({type:Ne.Integer})],Un.prototype,"version",void 0);gi([yi({type:fs})],Un.prototype,"privateKeyAlgorithm",void 0);gi([yi({type:Ne.OctetString})],Un.prototype,"privateKey",void 0);gi([yi({type:Rn,context:0,implicit:true,optional:true})],Un.prototype,"attributes",void 0);gi([yi({type:Ne.BitString,context:1,implicit:true,optional:true})],Un.prototype,"publicKey",void 0);Un=gi([fi({type:Re.Sequence})],Un);let jn=class t extends Un{};jn=gi([fi({type:Re.Sequence})],jn);let _n=Mn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Mn.prototype)}};_n=Mn=gi([fi({type:Re.Sequence,itemType:Un})],_n);var Fn,Vn;const Ln="2.16.840.1.114027.80.4.1";let $n=class t extends fs{};$n=gi([fi({type:Re.Sequence})],$n);let Gn=Fn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Fn.prototype)}};Gn=Fn=gi([fi({type:Re.Sequence,itemType:ys})],Gn);let Wn=Vn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Vn.prototype)}};Wn=Vn=gi([fi({type:Re.Sequence,itemType:Un})],Wn);var Qn={exports:{}};var qn=Qn.exports;var zn;function Jn(){if(zn)return Qn.exports;zn=1;(function(t,e){!function(e,i){t.exports=i()}(qn,(function(){var t=1e3,e=6e4,i=36e5,r="millisecond",s="second",n="minute",o="hour",a="day",c="week",u="month",l="quarter",h="year",p="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},A=function(t,e,i){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(i)+t},v={s:A,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),r=Math.floor(i/60),s=i%60;return(e<=0?"+":"-")+A(r,2,"0")+":"+A(s,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var r=12*(i.year()-e.year())+(i.month()-e.month()),s=e.clone().add(r,u),n=i-s<0,o=e.clone().add(r+(n?-1:1),u);return+(-(r+(i-s)/(n?s-o:o-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:h,w:c,d:a,D:p,h:o,m:n,s,ms:r,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",C={};C[m]=S;var g="$isDayjsObject",w=function(t){return t instanceof D||!(!t||!t[g])},E=function t(e,i,r){var s;if(!e)return m;if("string"==typeof e){var n=e.toLowerCase();C[n]&&(s=n),i&&(C[n]=i,s=n);var o=e.split("-");if(!s&&o.length>1)return t(o[0])}else{var a=e.name;C[a]=e,s=a}return!r&&s&&(m=s),s||!r&&m},b=function(t,e){if(w(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new D(i)},P=v;P.l=E,P.i=w,P.w=function(t,e){return b(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var D=function(){function S(t){this.$L=E(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[g]=true}var A=S.prototype;return A.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(P.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(f);if(r){var s=r[2]-1||0,n=(r[7]||"0").substring(0,3);return i?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,n)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,n)}}return new Date(e)}(t),this.init()},A.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return!(this.$d.toString()===d)},A.isSame=function(t,e){var i=b(t);return this.startOf(e)<=i&&i<=this.endOf(e)},A.isAfter=function(t,e){return b(t)<this.startOf(e)},A.isBefore=function(t,e){return this.endOf(e)<b(t)},A.$g=function(t,e,i){return P.u(t)?this[e]:this.set(i,t)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(t,e){var i=this,r=!!P.u(e)||e,l=P.p(t),d=function(t,e){var s=P.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return r?s:s.endOf(a)},f=function(t,e){return P.w(i.toDate()[t].apply(i.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},y=this.$W,S=this.$M,A=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case h:return r?d(1,0):d(31,11);case u:return r?d(1,S):d(0,S+1);case c:var m=this.$locale().weekStart||0,C=(y<m?y+7:y)-m;return d(r?A-C:A+(6-C),S);case a:case p:return f(v+"Hours",0);case o:return f(v+"Minutes",1);case n:return f(v+"Seconds",2);case s:return f(v+"Milliseconds",3);default:return this.clone()}},A.endOf=function(t){return this.startOf(t,false)},A.$set=function(t,e){var i,c=P.p(t),l="set"+(this.$u?"UTC":""),d=(i={},i[a]=l+"Date",i[p]=l+"Date",i[u]=l+"Month",i[h]=l+"FullYear",i[o]=l+"Hours",i[n]=l+"Minutes",i[s]=l+"Seconds",i[r]=l+"Milliseconds",i)[c],f=c===a?this.$D+(e-this.$W):e;if(c===u||c===h){var y=this.clone().set(p,1);y.$d[d](f),y.init(),this.$d=y.set(p,Math.min(this.$D,y.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},A.set=function(t,e){return this.clone().$set(t,e)},A.get=function(t){return this[P.p(t)]()},A.add=function(r,l){var p,d=this;r=Number(r);var f=P.p(l),y=function(t){var e=b(d);return P.w(e.date(e.date()+Math.round(t*r)),d)};if(f===u)return this.set(u,this.$M+r);if(f===h)return this.set(h,this.$y+r);if(f===a)return y(1);if(f===c)return y(7);var S=(p={},p[n]=e,p[o]=i,p[s]=t,p)[f]||1,A=this.$d.getTime()+r*S;return P.w(A,this)},A.subtract=function(t,e){return this.add(-1*t,e)},A.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var r=t||"YYYY-MM-DDTHH:mm:ssZ",s=P.z(this),n=this.$H,o=this.$m,a=this.$M,c=i.weekdays,u=i.months,l=i.meridiem,h=function(t,i,s,n){return t&&(t[i]||t(e,r))||s[i].slice(0,n)},p=function(t){return P.s(n%12||12,t,"0")},f=l||function(t,e,i){var r=t<12?"AM":"PM";return i?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return P.s(e.$y,4,"0");case"M":return a+1;case"MM":return P.s(a+1,2,"0");case"MMM":return h(i.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return e.$D;case"DD":return P.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(i.weekdaysMin,e.$W,c,2);case"ddd":return h(i.weekdaysShort,e.$W,c,3);case"dddd":return c[e.$W];case"H":return String(n);case"HH":return P.s(n,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(n,o,true);case"A":return f(n,o,false);case"m":return String(o);case"mm":return P.s(o,2,"0");case"s":return String(e.$s);case"ss":return P.s(e.$s,2,"0");case"SSS":return P.s(e.$ms,3,"0");case"Z":return s}return null}(t)||s.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(r,p,d){var f,y=this,S=P.p(p),A=b(r),v=(A.utcOffset()-this.utcOffset())*e,m=this-A,C=function(){return P.m(y,A)};switch(S){case h:f=C()/12;break;case u:f=C();break;case l:f=C()/3;break;case c:f=(m-v)/6048e5;break;case a:f=(m-v)/864e5;break;case o:f=m/i;break;case n:f=m/e;break;case s:f=m/t;break;default:f=m}return d?f:P.a(f)},A.daysInMonth=function(){return this.endOf(u).$D},A.$locale=function(){return C[this.$L]},A.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),r=E(t,e,true);return r&&(i.$L=r),i},A.clone=function(){return P.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},S}(),I=D.prototype;return b.prototype=I,[["$ms",r],["$s",s],["$m",n],["$H",o],["$W",a],["$M",u],["$y",h],["$D",p]].forEach((function(t){I[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),b.extend=function(t,e){return t.$i||(t(e,D,b),t.$i=true),b},b.locale=E,b.isDayjs=w,b.unix=function(t){return b(1e3*t)},b.en=C[m],b.Ls=C,b.p={},b}))})(Qn);return Qn.exports}var Yn=Jn();var Zn=e(Yn);var Xn={exports:{}};var to=Xn.exports;var eo;function io(){if(eo)return Xn.exports;eo=1;(function(t,e){!function(e,i){t.exports=i()}(to,(function(){return function(t,e,i){t=t||{};var r=e.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function n(t,e,i,s){return r.fromToBase(t,e,i,s)}i.en.relativeTime=s,r.fromToBase=function(e,r,n,o,a){for(var c,u,l,h=n.$locale().relativeTime||s,p=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],d=p.length,f=0;f<d;f+=1){var y=p[f];y.d&&(c=o?i(e).diff(n,y.d,true):n.diff(e,y.d,true));var S=(t.rounding||Math.round)(Math.abs(c));if(l=c>0,S<=y.r||!y.r){S<=1&&f>0&&(y=p[f-1]);var A=h[y.l];a&&(S=a(""+S)),u="string"==typeof A?A.replace("%d",S):A(S,r,y.l,l);break}}if(r)return u;var v=l?h.future:h.past;return"function"==typeof v?v(u):v.replace("%s",u)},r.to=function(t,e){return n(t,e,this,true)},r.from=function(t,e){return n(t,e,this)};var o=function(t){return t.$u?i.utc():i()};r.toNow=function(t){return this.to(o(this),t)},r.fromNow=function(t){return this.from(o(this),t)}}}))})(Xn);return Xn.exports}var ro=io();var so=e(ro);
78
+ */function f(){if(typeof BigInt==="undefined"){throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}}function y(t){let e=0;let i=0;for(let i=0;i<t.length;i++){const r=t[i];e+=r.byteLength}const r=new Uint8Array(e);for(let e=0;e<t.length;e++){const s=t[e];r.set(new Uint8Array(s),i);i+=s.byteLength}return r.buffer}function S(t,e,i,r){if(!(e instanceof Uint8Array)){t.error="Wrong parameter: inputBuffer must be 'Uint8Array'";return false}if(!e.byteLength){t.error="Wrong parameter: inputBuffer has zero length";return false}if(i<0){t.error="Wrong parameter: inputOffset less than zero";return false}if(r<0){t.error="Wrong parameter: inputLength less than zero";return false}if(e.byteLength-i-r<0){t.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return false}return true}class A{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return y(this.items)}}const v=[new Uint8Array([1])];const m="0123456789";const C="name";const g="valueHexView";const w="isHexOnly";const E="idBlock";const b="tagClass";const P="tagNumber";const D="isConstructed";const I="fromBER";const B="toBER";const x="local";const T="";const O=new ArrayBuffer(0);const k=new Uint8Array(0);const R="EndOfContent";const N="OCTET STRING";const M="BIT STRING";function K(t){var e;return e=class e extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(t){this.valueHexView=new Uint8Array(t)}constructor(...t){var e;super(...t);const i=t[0]||{};this.isHexOnly=(e=i.isHexOnly)!==null&&e!==void 0?e:false;this.valueHexView=i.valueHex?n.BufferSourceConverter.toUint8Array(i.valueHex):k}fromBER(t,e,i){const r=t instanceof ArrayBuffer?new Uint8Array(t):t;if(!S(this,r,e,i)){return-1}const s=e+i;this.valueHexView=r.subarray(e,s);if(!this.valueHexView.length){this.warnings.push("Zero buffer length");return e}this.blockLength=i;return s}toBER(t=false){if(!this.isHexOnly){this.error="Flag 'isHexOnly' is not set, abort";return O}if(t){return new ArrayBuffer(this.valueHexView.byteLength)}return this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:n.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class H{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}constructor({blockLength:t=0,error:e=T,warnings:i=[],valueBeforeDecode:r=k}={}){this.blockLength=t;this.error=e;this.warnings=i;this.valueBeforeDecodeView=n.BufferSourceConverter.toUint8Array(r)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:n.Convert.ToHex(this.valueBeforeDecodeView)}}}H.NAME="baseBlock";class U extends H{fromBER(t,e,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,e){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}U.NAME="valueBlock";class j extends(K(H)){constructor({idBlock:t={}}={}){var e,i,r,s;super();if(t){this.isHexOnly=(e=t.isHexOnly)!==null&&e!==void 0?e:false;this.valueHexView=t.valueHex?n.BufferSourceConverter.toUint8Array(t.valueHex):k;this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1;this.tagNumber=(r=t.tagNumber)!==null&&r!==void 0?r:-1;this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:false}else{this.tagClass=-1;this.tagNumber=-1;this.isConstructed=false}}toBER(t=false){let e=0;switch(this.tagClass){case 1:e|=0;break;case 2:e|=64;break;case 3:e|=128;break;case 4:e|=192;break;default:this.error="Unknown tag class";return O}if(this.isConstructed)e|=32;if(this.tagNumber<31&&!this.isHexOnly){const i=new Uint8Array(1);if(!t){let t=this.tagNumber;t&=31;e|=t;i[0]=e}return i.buffer}if(!this.isHexOnly){const i=c(this.tagNumber,7);const r=new Uint8Array(i);const s=i.byteLength;const n=new Uint8Array(s+1);n[0]=e|31;if(!t){for(let t=0;t<s-1;t++)n[t+1]=r[t]|128;n[s]=r[s-1]}return n.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);i[0]=e|31;if(!t){const t=this.valueHexView;for(let e=0;e<t.length-1;e++)i[e+1]=t[e]|128;i[this.valueHexView.byteLength]=t[t.length-1]}return i.buffer}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}const s=r.subarray(e,e+i);if(s.length===0){this.error="Zero buffer length";return-1}const o=s[0]&192;switch(o){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:this.error="Unknown tag class";return-1}this.isConstructed=(s[0]&32)===32;this.isHexOnly=false;const c=s[0]&31;if(c!==31){this.tagNumber=c;this.blockLength=1}else{let t=1;let e=this.valueHexView=new Uint8Array(255);let i=255;while(s[t]&128){e[t-1]=s[t]&127;t++;if(t>=s.length){this.error="End of input reached before message was fully decoded";return-1}if(t===i){i+=255;const t=new Uint8Array(i);for(let i=0;i<e.length;i++)t[i]=e[i];e=this.valueHexView=new Uint8Array(i)}}this.blockLength=t+1;e[t-1]=s[t]&127;const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e[i];e=this.valueHexView=new Uint8Array(t);e.set(r);if(this.blockLength<=9)this.tagNumber=a(e,7);else{this.isHexOnly=true;this.warnings.push("Tag too long, represented as hex-coded")}}if(this.tagClass===1&&this.isConstructed){switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:this.error="Constructed encoding used for primitive type";return-1}}return e+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}j.NAME="identificationBlock";class _ extends H{constructor({lenBlock:t={}}={}){var e,i,r;super();this.isIndefiniteForm=(e=t.isIndefiniteForm)!==null&&e!==void 0?e:false;this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:false;this.length=(r=t.length)!==null&&r!==void 0?r:0}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}const s=r.subarray(e,e+i);if(s.length===0){this.error="Zero buffer length";return-1}if(s[0]===255){this.error="Length block 0xFF is reserved by standard";return-1}this.isIndefiniteForm=s[0]===128;if(this.isIndefiniteForm){this.blockLength=1;return e+this.blockLength}this.longFormUsed=!!(s[0]&128);if(this.longFormUsed===false){this.length=s[0];this.blockLength=1;return e+this.blockLength}const o=s[0]&127;if(o>8){this.error="Too big integer";return-1}if(o+1>s.length){this.error="End of input reached before message was fully decoded";return-1}const c=e+1;const u=r.subarray(c,c+o);if(u[o-1]===0)this.warnings.push("Needlessly long encoded length");this.length=a(u,8);if(this.longFormUsed&&this.length<=127)this.warnings.push("Unnecessary usage of long length form");this.blockLength=o+1;return e+this.blockLength}toBER(t=false){let e;let i;if(this.length>127)this.longFormUsed=true;if(this.isIndefiniteForm){e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=128}return e}if(this.longFormUsed){const r=c(this.length,8);if(r.byteLength>127){this.error="Too big length";return O}e=new ArrayBuffer(r.byteLength+1);if(t)return e;const s=new Uint8Array(r);i=new Uint8Array(e);i[0]=r.byteLength|128;for(let t=0;t<r.byteLength;t++)i[t+1]=s[t];return e}e=new ArrayBuffer(1);if(t===false){i=new Uint8Array(e);i[0]=this.length}return e}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}_.NAME="lengthBlock";const F={};class V extends H{constructor({name:t=T,optional:e=false,primitiveSchema:i,...r}={},s){super(r);this.name=t;this.optional=e;if(i){this.primitiveSchema=i}this.idBlock=new j(r);this.lenBlock=new _(r);this.valueBlock=s?new s(r):new U(r)}fromBER(t,e,i){const r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r}toBER(t,e){const i=e||new A;if(!e){L(this)}const r=this.idBlock.toBER(t);i.write(r);if(this.lenBlock.isIndefiniteForm){i.write(new Uint8Array([128]).buffer);this.valueBlock.toBER(t,i);i.write(new ArrayBuffer(2))}else{const e=this.valueBlock.toBER(t);this.lenBlock.length=e.byteLength;const r=this.lenBlock.toBER(t);i.write(r);i.write(e)}if(!e){return i.final()}return O}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};if(this.primitiveSchema)t.primitiveSchema=this.primitiveSchema.toJSON();return t}toString(t="ascii"){if(t==="ascii"){return this.onAsciiEncoding()}return n.Convert.ToHex(this.toBER())}onAsciiEncoding(){const t=this.constructor.NAME;const e=n.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${t} : ${e}`}isEqual(t){if(this===t){return true}if(!(t instanceof this.constructor)){return false}const e=this.toBER();const i=t.toBER();return p(e,i)}}V.NAME="BaseBlock";function L(t){var e;if(t instanceof F.Constructed){for(const e of t.valueBlock.value){if(L(e)){t.lenBlock.isIndefiniteForm=true}}}return!!((e=t.lenBlock)===null||e===void 0?void 0:e.isIndefiniteForm)}class $ extends V{getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}constructor({value:t=T,...e}={},i){super(e,i);if(t){this.fromString(t)}}fromBER(t,e,i){const r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}this.fromBuffer(this.valueBlock.valueHexView);if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}$.NAME="BaseStringBlock";class G extends(K(U)){constructor({isHexOnly:t=true,...e}={}){super(e);this.isHexOnly=t}}G.NAME="PrimitiveValueBlock";var W;class Q extends V{constructor(t={}){super(t,G);this.idBlock.isConstructed=false}}W=Q;(()=>{F.Primitive=W})();Q.NAME="PRIMITIVE";function q(t,e){if(t instanceof e){return t}const i=new e;i.idBlock=t.idBlock;i.lenBlock=t.lenBlock;i.warnings=t.warnings;i.valueBeforeDecodeView=t.valueBeforeDecodeView;return i}function z(t,e=0,i=t.length){const r=e;let s=new V({},U);const n=new H;if(!S(n,t,e,i)){s.error=n.error;return{offset:-1,result:s}}const o=t.subarray(e,e+i);if(!o.length){s.error="Zero buffer length";return{offset:-1,result:s}}let a=s.idBlock.fromBER(t,e,i);if(s.idBlock.warnings.length){s.warnings.concat(s.idBlock.warnings)}if(a===-1){s.error=s.idBlock.error;return{offset:-1,result:s}}e=a;i-=s.idBlock.blockLength;a=s.lenBlock.fromBER(t,e,i);if(s.lenBlock.warnings.length){s.warnings.concat(s.lenBlock.warnings)}if(a===-1){s.error=s.lenBlock.error;return{offset:-1,result:s}}e=a;i-=s.lenBlock.blockLength;if(!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm){s.error="Indefinite length form used for primitive encoding form";return{offset:-1,result:s}}let c=V;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===false){s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";return{offset:-1,result:s}}switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0){s.error="Type [UNIVERSAL 0] is reserved";return{offset:-1,result:s}}c=F.EndOfContent;break;case 1:c=F.Boolean;break;case 2:c=F.Integer;break;case 3:c=F.BitString;break;case 4:c=F.OctetString;break;case 5:c=F.Null;break;case 6:c=F.ObjectIdentifier;break;case 10:c=F.Enumerated;break;case 12:c=F.Utf8String;break;case 13:c=F.RelativeObjectIdentifier;break;case 14:c=F.TIME;break;case 15:s.error="[UNIVERSAL 15] is reserved by ASN.1 standard";return{offset:-1,result:s};case 16:c=F.Sequence;break;case 17:c=F.Set;break;case 18:c=F.NumericString;break;case 19:c=F.PrintableString;break;case 20:c=F.TeletexString;break;case 21:c=F.VideotexString;break;case 22:c=F.IA5String;break;case 23:c=F.UTCTime;break;case 24:c=F.GeneralizedTime;break;case 25:c=F.GraphicString;break;case 26:c=F.VisibleString;break;case 27:c=F.GeneralString;break;case 28:c=F.UniversalString;break;case 29:c=F.CharacterString;break;case 30:c=F.BmpString;break;case 31:c=F.DATE;break;case 32:c=F.TimeOfDay;break;case 33:c=F.DateTime;break;case 34:c=F.Duration;break;default:{const t=s.idBlock.isConstructed?new F.Constructed:new F.Primitive;t.idBlock=s.idBlock;t.lenBlock=s.lenBlock;t.warnings=s.warnings;s=t}}break;case 2:case 3:case 4:default:{c=s.idBlock.isConstructed?F.Constructed:F.Primitive}}s=q(s,c);a=s.fromBER(t,e,s.lenBlock.isIndefiniteForm?i:s.lenBlock.length);s.valueBeforeDecodeView=t.subarray(r,r+s.blockLength);return{offset:a,result:s}}function J(t){if(!t.byteLength){const t=new V({},U);t.error="Input buffer has zero length";return{offset:-1,result:t}}return z(n.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength)}function Y(t,e){if(t){return 1}return e}class Z extends U{constructor({value:t=[],isIndefiniteForm:e=false,...i}={}){super(i);this.value=t;this.isIndefiniteForm=e}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}this.valueBeforeDecodeView=r.subarray(e,e+i);if(this.valueBeforeDecodeView.length===0){this.warnings.push("Zero buffer length");return e}let s=e;while(Y(this.isIndefiniteForm,i)>0){const t=z(r,s,i);if(t.offset===-1){this.error=t.result.error;this.warnings.concat(t.result.warnings);return-1}s=t.offset;this.blockLength+=t.result.blockLength;i-=t.result.blockLength;this.value.push(t.result);if(this.isIndefiniteForm&&t.result.constructor.NAME===R){break}}if(this.isIndefiniteForm){if(this.value[this.value.length-1].constructor.NAME===R){this.value.pop()}else{this.warnings.push("No EndOfContent block encoded")}}return s}toBER(t,e){const i=e||new A;for(let e=0;e<this.value.length;e++){this.value[e].toBER(t,i)}if(!e){return i.final()}return O}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const e of this.value){t.value.push(e.toJSON())}return t}}Z.NAME="ConstructedValueBlock";var X;class tt extends V{constructor(t={}){super(t,Z);this.idBlock.isConstructed=true}fromBER(t,e,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const r=this.valueBlock.fromBER(t,e,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);if(r===-1){this.error=this.valueBlock.error;return r}if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;if(!this.valueBlock.error.length)this.blockLength+=this.valueBlock.blockLength;return r}onAsciiEncoding(){const t=[];for(const e of this.valueBlock.value){t.push(e.toString("ascii").split("\n").map((t=>` ${t}`)).join("\n"))}const e=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${e} :\n${t.join("\n")}`:`${e} :`}}X=tt;(()=>{F.Constructed=X})();tt.NAME="CONSTRUCTED";class et extends U{fromBER(t,e,i){return e}toBER(t){return O}}et.override="EndOfContentValueBlock";var it;class rt extends V{constructor(t={}){super(t,et);this.idBlock.tagClass=1;this.idBlock.tagNumber=0}}it=rt;(()=>{F.EndOfContent=it})();rt.NAME=R;var st;class nt extends V{constructor(t={}){super(t,U);this.idBlock.tagClass=1;this.idBlock.tagNumber=5}fromBER(t,e,i){if(this.lenBlock.length>0)this.warnings.push("Non-zero length of value block for Null type");if(!this.idBlock.error.length)this.blockLength+=this.idBlock.blockLength;if(!this.lenBlock.error.length)this.blockLength+=this.lenBlock.blockLength;this.blockLength+=i;if(e+i>t.byteLength){this.error="End of input reached before message was fully decoded (inconsistent offset and length values)";return-1}return e+i}toBER(t,e){const i=new ArrayBuffer(2);if(!t){const t=new Uint8Array(i);t[0]=5;t[1]=0}if(e){e.write(i)}return i}onAsciiEncoding(){return`${this.constructor.NAME}`}}st=nt;(()=>{F.Null=st})();nt.NAME="NULL";class ot extends(K(U)){get value(){for(const t of this.valueHexView){if(t>0){return true}}return false}set value(t){this.valueHexView[0]=t?255:0}constructor({value:t,...e}={}){super(e);if(e.valueHex){this.valueHexView=n.BufferSourceConverter.toUint8Array(e.valueHex)}else{this.valueHexView=new Uint8Array(1)}if(t){this.value=t}}fromBER(t,e,i){const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}this.valueHexView=r.subarray(e,e+i);if(i>1)this.warnings.push("Boolean value encoded in more then 1 octet");this.isHexOnly=true;l.call(this);this.blockLength=i;return e+i}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ot.NAME="BooleanValueBlock";var at;class ct extends V{getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}constructor(t={}){super(t,ot);this.idBlock.tagClass=1;this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}at=ct;(()=>{F.Boolean=at})();ct.NAME="BOOLEAN";class ut extends(K(Z)){constructor({isConstructed:t=false,...e}={}){super(e);this.isConstructed=t}fromBER(t,e,i){let r=0;if(this.isConstructed){this.isHexOnly=false;r=Z.prototype.fromBER.call(this,t,e,i);if(r===-1)return r;for(let t=0;t<this.value.length;t++){const e=this.value[t].constructor.NAME;if(e===R){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";return-1}}if(e!==N){this.error="OCTET STRING may consists of OCTET STRINGs only";return-1}}}else{this.isHexOnly=true;r=super.fromBER(t,e,i);this.blockLength=i}return r}toBER(t,e){if(this.isConstructed)return Z.prototype.toBER.call(this,t,e);return t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}ut.NAME="OctetStringValueBlock";var lt;let ht=class t extends V{constructor({idBlock:t={},lenBlock:e={},...i}={}){var r,s;(r=i.isConstructed)!==null&&r!==void 0?r:i.isConstructed=!!((s=i.value)===null||s===void 0?void 0:s.length);super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...e,isIndefiniteForm:!!i.isIndefiniteForm},...i},ut);this.idBlock.tagClass=1;this.idBlock.tagNumber=4}fromBER(t,e,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;if(i===0){if(this.idBlock.error.length===0)this.blockLength+=this.idBlock.blockLength;if(this.lenBlock.error.length===0)this.blockLength+=this.lenBlock.blockLength;return e}if(!this.valueBlock.isConstructed){const r=t instanceof ArrayBuffer?new Uint8Array(t):t;const s=r.subarray(e,e+i);try{if(s.byteLength){const t=z(s,0,s.byteLength);if(t.offset!==-1&&t.offset===i){this.valueBlock.value=[t.result]}}}catch{}}return super.fromBER(t,e,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return tt.prototype.onAsciiEncoding.call(this)}const t=this.constructor.NAME;const e=n.Convert.ToHex(this.valueBlock.valueHexView);return`${t} : ${e}`}getValue(){if(!this.idBlock.isConstructed){return this.valueBlock.valueHexView.slice().buffer}const t=[];for(const e of this.valueBlock.value){if(e instanceof lt){t.push(e.valueBlock.valueHexView)}}return n.BufferSourceConverter.concat(t)}};lt=ht;(()=>{F.OctetString=lt})();ht.NAME=N;class pt extends(K(Z)){constructor({unusedBits:t=0,isConstructed:e=false,...i}={}){super(i);this.unusedBits=t;this.isConstructed=e;this.blockLength=this.valueHexView.byteLength}fromBER(t,e,i){if(!i){return e}let r=-1;if(this.isConstructed){r=Z.prototype.fromBER.call(this,t,e,i);if(r===-1)return r;for(const t of this.value){const e=t.constructor.NAME;if(e===R){if(this.isIndefiniteForm)break;else{this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";return-1}}if(e!==M){this.error="BIT STRING may consists of BIT STRINGs only";return-1}const i=t.valueBlock;if(this.unusedBits>0&&i.unusedBits>0){this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only';return-1}this.unusedBits=i.unusedBits}return r}const s=n.BufferSourceConverter.toUint8Array(t);if(!S(this,s,e,i)){return-1}const o=s.subarray(e,e+i);this.unusedBits=o[0];if(this.unusedBits>7){this.error="Unused bits for BitString must be in range 0-7";return-1}if(!this.unusedBits){const t=o.subarray(1);try{if(t.byteLength){const e=z(t,0,t.byteLength);if(e.offset!==-1&&e.offset===i-1){this.value=[e.result]}}}catch{}}this.valueHexView=o.subarray(1);this.blockLength=o.length;return e+i}toBER(t,e){if(this.isConstructed){return Z.prototype.toBER.call(this,t,e)}if(t){return new ArrayBuffer(this.valueHexView.byteLength+1)}if(!this.valueHexView.byteLength){return O}const i=new Uint8Array(this.valueHexView.length+1);i[0]=this.unusedBits;i.set(this.valueHexView,1);return i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}pt.NAME="BitStringValueBlock";var dt;let ft=class t extends V{constructor({idBlock:t={},lenBlock:e={},...i}={}){var r,s;(r=i.isConstructed)!==null&&r!==void 0?r:i.isConstructed=!!((s=i.value)===null||s===void 0?void 0:s.length);super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...e,isIndefiniteForm:!!i.isIndefiniteForm},...i},pt);this.idBlock.tagClass=1;this.idBlock.tagNumber=3}fromBER(t,e,i){this.valueBlock.isConstructed=this.idBlock.isConstructed;this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;return super.fromBER(t,e,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length){return tt.prototype.onAsciiEncoding.call(this)}else{const t=[];const e=this.valueBlock.valueHexView;for(const i of e){t.push(i.toString(2).padStart(8,"0"))}const i=t.join("");const r=this.constructor.NAME;const s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${r} : ${s}`}}};dt=ft;(()=>{F.BitString=dt})();ft.NAME=M;var yt;function St(t,e){const i=new Uint8Array([0]);const r=new Uint8Array(t);const s=new Uint8Array(e);let n=r.slice(0);const o=n.length-1;const a=s.slice(0);const c=a.length-1;let l=0;const h=c<o?o:c;let p=0;for(let t=h;t>=0;t--,p++){switch(true){case p<a.length:l=n[o-p]+a[c-p]+i[0];break;default:l=n[o-p]+i[0]}i[0]=l/10;switch(true){case p>=n.length:n=u(new Uint8Array([l%10]),n);break;default:n[o-p]=l%10}}if(i[0]>0)n=u(i,n);return n}function At(t){if(t>=v.length){for(let e=v.length;e<=t;e++){const t=new Uint8Array([0]);let i=v[e-1].slice(0);for(let e=i.length-1;e>=0;e--){const r=new Uint8Array([(i[e]<<1)+t[0]]);t[0]=r[0]/10;i[e]=r[0]%10}if(t[0]>0)i=u(t,i);v.push(i)}}return v[t]}function vt(t,e){let i=0;const r=new Uint8Array(t);const s=new Uint8Array(e);const n=r.slice(0);const o=n.length-1;const a=s.slice(0);const c=a.length-1;let u;let l=0;for(let t=c;t>=0;t--,l++){u=n[o-l]-a[c-l]-i;switch(true){case u<0:i=1;n[o-l]=u+10;break;default:i=0;n[o-l]=u}}if(i>0){for(let t=o-c+1;t>=0;t--,l++){u=n[o-l]-i;if(u<0){i=1;n[o-l]=u+10}else{i=0;n[o-l]=u;break}}}return n.slice()}class mt extends(K(U)){setValueHex(){if(this.valueHexView.length>=4){this.warnings.push("Too big Integer for decoding, hex only");this.isHexOnly=true;this._valueDec=0}else{this.isHexOnly=false;if(this.valueHexView.length>0){this._valueDec=l.call(this)}}}constructor({value:t,...e}={}){super(e);this._valueDec=0;if(e.valueHex){this.setValueHex()}if(t!==undefined){this.valueDec=t}}set valueDec(t){this._valueDec=t;this.isHexOnly=false;this.valueHexView=new Uint8Array(h(t))}get valueDec(){return this._valueDec}fromDER(t,e,i,r=0){const s=this.fromBER(t,e,i);if(s===-1)return s;const n=this.valueHexView;if(n[0]===0&&(n[1]&128)!==0){this.valueHexView=n.subarray(1)}else{if(r!==0){if(n.length<r){if(r-n.length>1)r=n.length+1;this.valueHexView=n.subarray(r-n.length)}}}return s}toDER(t=false){const e=this.valueHexView;switch(true){case(e[0]&128)!==0:{const t=new Uint8Array(this.valueHexView.length+1);t[0]=0;t.set(e,1);this.valueHexView=t}break;case e[0]===0&&(e[1]&128)===0:{this.valueHexView=this.valueHexView.subarray(1)}break}return this.toBER(t)}fromBER(t,e,i){const r=super.fromBER(t,e,i);if(r===-1){return r}this.setValueHex();return r}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let e=new Uint8Array(this.valueHexView.length*8/3);let i=0;let r;const s=this.valueHexView;let n="";let o=false;for(let o=s.byteLength-1;o>=0;o--){r=s[o];for(let s=0;s<8;s++){if((r&1)===1){switch(i){case t:e=vt(At(i),e);n="-";break;default:e=St(e,At(i))}}i++;r>>=1}}for(let t=0;t<e.length;t++){if(e[t])o=true;if(o)n+=m.charAt(e[t])}if(o===false)n+=m.charAt(0);return n}}yt=mt;mt.NAME="IntegerValueBlock";(()=>{Object.defineProperty(yt.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t);this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}})})();var Ct;class gt extends V{constructor(t={}){super(t,mt);this.idBlock.tagClass=1;this.idBlock.tagNumber=2}toBigInt(){f();return BigInt(this.valueBlock.toString())}static fromBigInt(t){f();const e=BigInt(t);const i=new A;const r=e.toString(16).replace(/^-/,"");const s=new Uint8Array(n.Convert.FromHex(r));if(e<0){const t=new Uint8Array(s.length+(s[0]&128?1:0));t[0]|=128;const r=BigInt(`0x${n.Convert.ToHex(t)}`);const o=r+e;const a=n.BufferSourceConverter.toUint8Array(n.Convert.FromHex(o.toString(16)));a[0]|=128;i.write(a)}else{if(s[0]&128){i.write(new Uint8Array([0]))}i.write(s)}const o=new Ct({valueHex:i.final()});return o}convertToDER(){const t=new Ct({valueHex:this.valueBlock.valueHexView});t.valueBlock.toDER();return t}convertFromDER(){return new Ct({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ct=gt;(()=>{F.Integer=Ct})();gt.NAME="INTEGER";var wt;class Et extends gt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=10}}wt=Et;(()=>{F.Enumerated=wt})();Et.NAME="ENUMERATED";class bt extends(K(U)){constructor({valueDec:t=-1,isFirstSid:e=false,...i}={}){super(i);this.valueDec=t;this.isFirstSid=e}fromBER(t,e,i){if(!i){return e}const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i)){return-1}const s=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(let t=0;t<i;t++){this.valueHexView[t]=s[t]&127;this.blockLength++;if((s[t]&128)===0)break}const o=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength;t++){o[t]=this.valueHexView[t]}this.valueHexView=o;if((s[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=a(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength}set valueBigInt(t){f();let e=BigInt(t).toString(2);while(e.length%7){e="0"+e}const i=new Uint8Array(e.length/7);for(let t=0;t<i.length;t++){i[t]=parseInt(e.slice(t*7,t*7+7),2)+(t+1<i.length?128:0)}this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const e=this.valueHexView;const i=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength-1;t++)i[t]=e[t]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}const e=c(this.valueDec,7);if(e.byteLength===0){this.error="Error during encoding SID value";return O}const i=new Uint8Array(e.byteLength);if(!t){const t=new Uint8Array(e);const r=e.byteLength-1;for(let e=0;e<r;e++)i[e]=t[e]|128;i[r]=t[r]}return i}toString(){let t="";if(this.isHexOnly)t=n.Convert.ToHex(this.valueHexView);else{if(this.isFirstSid){let e=this.valueDec;if(this.valueDec<=39)t="0.";else{if(this.valueDec<=79){t="1.";e-=40}else{t="2.";e-=80}}t+=e.toString()}else t=this.valueDec.toString()}return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}bt.NAME="sidBlock";class Pt extends U{constructor({value:t=T,...e}={}){super(e);this.value=[];if(t){this.fromString(t)}}fromBER(t,e,i){let r=e;while(i>0){const e=new bt;r=e.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=e.error;return r}if(this.value.length===0)e.isFirstSid=true;this.blockLength+=e.blockLength;i-=e.blockLength;this.value.push(e)}return r}toBER(t){const e=[];for(let i=0;i<this.value.length;i++){const r=this.value[i].toBER(t);if(r.byteLength===0){this.error=this.value[i].error;return O}e.push(r)}return y(e)}fromString(t){this.value=[];let e=0;let i=0;let r="";let s=false;do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;if(s){const t=this.value[0];let e=0;switch(t.valueDec){case 0:break;case 1:e=40;break;case 2:e=80;break;default:this.value=[];return}const i=parseInt(r,10);if(isNaN(i))return;t.valueDec=i+e;s=false}else{const t=new bt;if(r>Number.MAX_SAFE_INTEGER){f();const e=BigInt(r);t.valueBigInt=e}else{t.valueDec=parseInt(r,10);if(isNaN(t.valueDec))return}if(!this.value.length){t.isFirstSid=true;s=true}this.value.push(t)}}while(i!==-1)}toString(){let t="";let e=false;for(let i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;let r=this.value[i].toString();if(i!==0)t=`${t}.`;if(e){r=`{${r}}`;if(this.value[i].isFirstSid)t=`2.{${r} - 80}`;else t+=r}else t+=r}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let e=0;e<this.value.length;e++){t.sidArray.push(this.value[e].toJSON())}return t}}Pt.NAME="ObjectIdentifierValueBlock";var Dt;class It extends V{getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}constructor(t={}){super(t,Pt);this.idBlock.tagClass=1;this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Dt=It;(()=>{F.ObjectIdentifier=Dt})();It.NAME="OBJECT IDENTIFIER";class Bt extends(K(H)){constructor({valueDec:t=0,...e}={}){super(e);this.valueDec=t}fromBER(t,e,i){if(i===0)return e;const r=n.BufferSourceConverter.toUint8Array(t);if(!S(this,r,e,i))return-1;const s=r.subarray(e,e+i);this.valueHexView=new Uint8Array(i);for(let t=0;t<i;t++){this.valueHexView[t]=s[t]&127;this.blockLength++;if((s[t]&128)===0)break}const o=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength;t++)o[t]=this.valueHexView[t];this.valueHexView=o;if((s[this.blockLength-1]&128)!==0){this.error="End of input reached before message was fully decoded";return-1}if(this.valueHexView[0]===0)this.warnings.push("Needlessly long format of SID encoding");if(this.blockLength<=8)this.valueDec=a(this.valueHexView,7);else{this.isHexOnly=true;this.warnings.push("Too big SID for decoding, hex only")}return e+this.blockLength}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const e=this.valueHexView;const i=new Uint8Array(this.blockLength);for(let t=0;t<this.blockLength-1;t++)i[t]=e[t]|128;i[this.blockLength-1]=e[this.blockLength-1];return i.buffer}const e=c(this.valueDec,7);if(e.byteLength===0){this.error="Error during encoding SID value";return O}const i=new Uint8Array(e.byteLength);if(!t){const t=new Uint8Array(e);const r=e.byteLength-1;for(let e=0;e<r;e++)i[e]=t[e]|128;i[r]=t[r]}return i.buffer}toString(){let t="";if(this.isHexOnly)t=n.Convert.ToHex(this.valueHexView);else{t=this.valueDec.toString()}return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Bt.NAME="relativeSidBlock";class xt extends U{constructor({value:t=T,...e}={}){super(e);this.value=[];if(t){this.fromString(t)}}fromBER(t,e,i){let r=e;while(i>0){const e=new Bt;r=e.fromBER(t,r,i);if(r===-1){this.blockLength=0;this.error=e.error;return r}this.blockLength+=e.blockLength;i-=e.blockLength;this.value.push(e)}return r}toBER(t,e){const i=[];for(let e=0;e<this.value.length;e++){const r=this.value[e].toBER(t);if(r.byteLength===0){this.error=this.value[e].error;return O}i.push(r)}return y(i)}fromString(t){this.value=[];let e=0;let i=0;let r="";do{i=t.indexOf(".",e);if(i===-1)r=t.substring(e);else r=t.substring(e,i);e=i+1;const s=new Bt;s.valueDec=parseInt(r,10);if(isNaN(s.valueDec))return true;this.value.push(s)}while(i!==-1);return true}toString(){let t="";let e=false;for(let i=0;i<this.value.length;i++){e=this.value[i].isHexOnly;let r=this.value[i].toString();if(i!==0)t=`${t}.`;if(e){r=`{${r}}`;t+=r}else t+=r}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let e=0;e<this.value.length;e++)t.sidArray.push(this.value[e].toJSON());return t}}xt.NAME="RelativeObjectIdentifierValueBlock";var Tt;class Ot extends V{getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}constructor(t={}){super(t,xt);this.idBlock.tagClass=1;this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Tt=Ot;(()=>{F.RelativeObjectIdentifier=Tt})();Ot.NAME="RelativeObjectIdentifier";var kt;class Rt extends tt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=16}}kt=Rt;(()=>{F.Sequence=kt})();Rt.NAME="SEQUENCE";var Nt;class Mt extends tt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=17}}Nt=Mt;(()=>{F.Set=Nt})();Mt.NAME="SET";class Kt extends(K(U)){constructor({...t}={}){super(t);this.isHexOnly=true;this.value=T}toJSON(){return{...super.toJSON(),value:this.value}}}Kt.NAME="StringValueBlock";class Ht extends Kt{}Ht.NAME="SimpleStringValueBlock";class Ut extends ${constructor({...t}={}){super(t,Ht)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,n.BufferSourceConverter.toUint8Array(t))}fromString(t){const e=t.length;const i=this.valueBlock.valueHexView=new Uint8Array(e);for(let r=0;r<e;r++)i[r]=t.charCodeAt(r);this.valueBlock.value=t}}Ut.NAME="SIMPLE STRING";class jt extends Ut{fromBuffer(t){this.valueBlock.valueHexView=n.BufferSourceConverter.toUint8Array(t);try{this.valueBlock.value=n.Convert.ToUtf8String(t)}catch(e){this.warnings.push(`Error during "decodeURIComponent": ${e}, using raw string`);this.valueBlock.value=n.Convert.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(n.Convert.FromUtf8String(t));this.valueBlock.value=t}}jt.NAME="Utf8StringValueBlock";var _t;class Ft extends jt{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=12}}_t=Ft;(()=>{F.Utf8String=_t})();Ft.NAME="UTF8String";class Vt extends Ut{fromBuffer(t){this.valueBlock.value=n.Convert.ToUtf16String(t);this.valueBlock.valueHexView=n.BufferSourceConverter.toUint8Array(t)}fromString(t){this.valueBlock.value=t;this.valueBlock.valueHexView=new Uint8Array(n.Convert.FromUtf16String(t))}}Vt.NAME="BmpStringValueBlock";var Lt;class $t extends Vt{constructor({...t}={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=30}}Lt=$t;(()=>{F.BmpString=Lt})();$t.NAME="BMPString";class Gt extends Ut{fromBuffer(t){const e=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0);const i=new Uint8Array(e);for(let t=0;t<i.length;t+=4){i[t]=i[t+3];i[t+1]=i[t+2];i[t+2]=0;i[t+3]=0}this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(e))}fromString(t){const e=t.length;const i=this.valueBlock.valueHexView=new Uint8Array(e*4);for(let r=0;r<e;r++){const e=c(t.charCodeAt(r),8);const s=new Uint8Array(e);if(s.length>4)continue;const n=4-s.length;for(let t=s.length-1;t>=0;t--)i[r*4+t+n]=s[t]}this.valueBlock.value=t}}Gt.NAME="UniversalStringValueBlock";var Wt;class Qt extends Gt{constructor({...t}={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=28}}Wt=Qt;(()=>{F.UniversalString=Wt})();Qt.NAME="UniversalString";var qt;class zt extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=18}}qt=zt;(()=>{F.NumericString=qt})();zt.NAME="NumericString";var Jt;class Yt extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=19}}Jt=Yt;(()=>{F.PrintableString=Jt})();Yt.NAME="PrintableString";var Zt;class Xt extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=20}}Zt=Xt;(()=>{F.TeletexString=Zt})();Xt.NAME="TeletexString";var te;class ee extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=21}}te=ee;(()=>{F.VideotexString=te})();ee.NAME="VideotexString";var ie;class re extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=22}}ie=re;(()=>{F.IA5String=ie})();re.NAME="IA5String";var se;class ne extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=25}}se=ne;(()=>{F.GraphicString=se})();ne.NAME="GraphicString";var oe;class ae extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=26}}oe=ae;(()=>{F.VisibleString=oe})();ae.NAME="VisibleString";var ce;class ue extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=27}}ce=ue;(()=>{F.GeneralString=ce})();ue.NAME="GeneralString";var le;class he extends Ut{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=29}}le=he;(()=>{F.CharacterString=le})();he.NAME="CharacterString";var pe;class de extends ae{constructor({value:t,valueDate:e,...i}={}){super(i);this.year=0;this.month=0;this.day=0;this.hour=0;this.minute=0;this.second=0;if(t){this.fromString(t);this.valueBlock.valueHexView=new Uint8Array(t.length);for(let e=0;e<t.length;e++)this.valueBlock.valueHexView[e]=t.charCodeAt(e)}if(e){this.fromDate(e);this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())}this.idBlock.tagClass=1;this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,n.BufferSourceConverter.toUint8Array(t)))}toBuffer(){const t=this.toString();const e=new ArrayBuffer(t.length);const i=new Uint8Array(e);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return e}fromDate(t){this.year=t.getUTCFullYear();this.month=t.getUTCMonth()+1;this.day=t.getUTCDate();this.hour=t.getUTCHours();this.minute=t.getUTCMinutes();this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const e=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;const i=e.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const r=parseInt(i[1],10);if(r>=50)this.year=1900+r;else this.year=2e3+r;this.month=parseInt(i[2],10);this.day=parseInt(i[3],10);this.hour=parseInt(i[4],10);this.minute=parseInt(i[5],10);this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const t=new Array(7);t[0]=d(this.year<2e3?this.year-1900:this.year-2e3,2);t[1]=d(this.month,2);t[2]=d(this.day,2);t[3]=d(this.hour,2);t[4]=d(this.minute,2);t[5]=d(this.second,2);t[6]="Z";return t.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}pe=de;(()=>{F.UTCTime=pe})();de.NAME="UTCTime";var fe;class ye extends de{constructor(t={}){var e;super(t);(e=this.millisecond)!==null&&e!==void 0?e:this.millisecond=0;this.idBlock.tagClass=1;this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t);this.millisecond=t.getUTCMilliseconds()}toDate(){const t=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(t)}fromString(t){let e=false;let i="";let r="";let s=0;let n;let o=0;let a=0;if(t[t.length-1]==="Z"){i=t.substring(0,t.length-1);e=true}else{const e=new Number(t[t.length-1]);if(isNaN(e.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(e){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let t=1;let e=i.indexOf("+");let r="";if(e===-1){e=i.indexOf("-");t=-1}if(e!==-1){r=i.substring(e+1);i=i.substring(0,e);if(r.length!==2&&r.length!==4)throw new Error("Wrong input string for conversion");let s=parseInt(r.substring(0,2),10);if(isNaN(s.valueOf()))throw new Error("Wrong input string for conversion");o=t*s;if(r.length===4){s=parseInt(r.substring(2,4),10);if(isNaN(s.valueOf()))throw new Error("Wrong input string for conversion");a=t*s}}}let c=i.indexOf(".");if(c===-1)c=i.indexOf(",");if(c!==-1){const t=new Number(`0${i.substring(c)}`);if(isNaN(t.valueOf()))throw new Error("Wrong input string for conversion");s=t.valueOf();r=i.substring(0,c)}else r=i;switch(true){case r.length===8:n=/(\d{4})(\d{2})(\d{2})/gi;if(c!==-1)throw new Error("Wrong input string for conversion");break;case r.length===10:n=/(\d{4})(\d{2})(\d{2})(\d{2})/gi;if(c!==-1){let t=60*s;this.minute=Math.floor(t);t=60*(t-this.minute);this.second=Math.floor(t);t=1e3*(t-this.second);this.millisecond=Math.floor(t)}break;case r.length===12:n=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(c!==-1){let t=60*s;this.second=Math.floor(t);t=1e3*(t-this.second);this.millisecond=Math.floor(t)}break;case r.length===14:n=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;if(c!==-1){const t=1e3*s;this.millisecond=Math.floor(t)}break;default:throw new Error("Wrong input string for conversion")}const u=n.exec(r);if(u===null)throw new Error("Wrong input string for conversion");for(let t=1;t<u.length;t++){switch(t){case 1:this.year=parseInt(u[t],10);break;case 2:this.month=parseInt(u[t],10);break;case 3:this.day=parseInt(u[t],10);break;case 4:this.hour=parseInt(u[t],10)+o;break;case 5:this.minute=parseInt(u[t],10)+a;break;case 6:this.second=parseInt(u[t],10);break;default:throw new Error("Wrong input string for conversion")}}if(e===false){const t=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=t.getUTCFullYear();this.month=t.getUTCMonth();this.day=t.getUTCDay();this.hour=t.getUTCHours();this.minute=t.getUTCMinutes();this.second=t.getUTCSeconds();this.millisecond=t.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const t=[];t.push(d(this.year,4));t.push(d(this.month,2));t.push(d(this.day,2));t.push(d(this.hour,2));t.push(d(this.minute,2));t.push(d(this.second,2));if(this.millisecond!==0){t.push(".");t.push(d(this.millisecond,3))}t.push("Z");return t.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}fe=ye;(()=>{F.GeneralizedTime=fe})();ye.NAME="GeneralizedTime";var Se;class Ae extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=31}}Se=Ae;(()=>{F.DATE=Se})();Ae.NAME="DATE";var ve;class me extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=32}}ve=me;(()=>{F.TimeOfDay=ve})();me.NAME="TimeOfDay";var Ce;class ge extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=33}}Ce=ge;(()=>{F.DateTime=Ce})();ge.NAME="DateTime";var we;class Ee extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=34}}we=Ee;(()=>{F.Duration=we})();Ee.NAME="Duration";var be;class Pe extends Ft{constructor(t={}){super(t);this.idBlock.tagClass=1;this.idBlock.tagNumber=14}}be=Pe;(()=>{F.TIME=be})();Pe.NAME="TIME";class De{constructor({name:t=T,optional:e=false}={}){this.name=t;this.optional=e}}class Ie extends De{constructor({value:t=[],...e}={}){super(e);this.value=t}}class Be extends De{constructor({value:t=new De,local:e=false,...i}={}){super(i);this.value=t;this.local=e}}class xe{get data(){return this.dataView.slice().buffer}set data(t){this.dataView=n.BufferSourceConverter.toUint8Array(t)}constructor({data:t=k}={}){this.dataView=n.BufferSourceConverter.toUint8Array(t)}fromBER(t,e,i){const r=e+i;this.dataView=n.BufferSourceConverter.toUint8Array(t).subarray(e,r);return r}toBER(t){return this.dataView.slice().buffer}}function Te(t,e,i){if(i instanceof Ie){for(const r of i.value){const i=Te(t,e,r);if(i.verified){return{verified:true,result:t}}}{const t={verified:false,result:{error:"Wrong values for Choice type"}};if(i.hasOwnProperty(C))t.name=i.name;return t}}if(i instanceof De){if(i.hasOwnProperty(C))t[i.name]=e;return{verified:true,result:t}}if(t instanceof Object===false){return{verified:false,result:{error:"Wrong root object"}}}if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 data"}}}if(i instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(E in i===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(I in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(B in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}const r=i.idBlock.toBER(false);if(r.byteLength===0){return{verified:false,result:{error:"Error encoding idBlock for ASN.1 schema"}}}const s=i.idBlock.fromBER(r,0,r.byteLength);if(s===-1){return{verified:false,result:{error:"Error decoding idBlock for ASN.1 schema"}}}if(i.idBlock.hasOwnProperty(b)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagClass!==e.idBlock.tagClass){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(P)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.tagNumber!==e.idBlock.tagNumber){return{verified:false,result:t}}if(i.idBlock.hasOwnProperty(D)===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isConstructed!==e.idBlock.isConstructed){return{verified:false,result:t}}if(!(w in i.idBlock)){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}if(i.idBlock.isHexOnly!==e.idBlock.isHexOnly){return{verified:false,result:t}}if(i.idBlock.isHexOnly){if(g in i.idBlock===false){return{verified:false,result:{error:"Wrong ASN.1 schema"}}}const r=i.idBlock.valueHexView;const s=e.idBlock.valueHexView;if(r.length!==s.length){return{verified:false,result:t}}for(let e=0;e<r.length;e++){if(r[e]!==s[1]){return{verified:false,result:t}}}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)t[i.name]=e}if(i instanceof F.Constructed){let r=0;let s={verified:false,result:{error:"Unknown error"}};let n=i.valueBlock.value.length;if(n>0){if(i.valueBlock.value[0]instanceof Be){n=e.valueBlock.value.length}}if(n===0){return{verified:true,result:t}}if(e.valueBlock.value.length===0&&i.valueBlock.value.length!==0){let e=true;for(let t=0;t<i.valueBlock.value.length;t++)e=e&&(i.valueBlock.value[t].optional||false);if(e){return{verified:true,result:t}}if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)delete t[i.name]}t.error="Inconsistent object length";return{verified:false,result:t}}for(let o=0;o<n;o++){if(o-r>=e.valueBlock.value.length){if(i.valueBlock.value[o].optional===false){const e={verified:false,result:t};t.error="Inconsistent length between ASN.1 data and schema";if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name){delete t[i.name];e.name=i.name}}return e}}else{if(i.valueBlock.value[0]instanceof Be){s=Te(t,e.valueBlock.value[o],i.valueBlock.value[0].value);if(s.verified===false){if(i.valueBlock.value[0].optional)r++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)delete t[i.name]}return s}}if(C in i.valueBlock.value[0]&&i.valueBlock.value[0].name.length>0){let r={};if(x in i.valueBlock.value[0]&&i.valueBlock.value[0].local)r=e;else r=t;if(typeof r[i.valueBlock.value[0].name]==="undefined")r[i.valueBlock.value[0].name]=[];r[i.valueBlock.value[0].name].push(e.valueBlock.value[o])}}else{s=Te(t,e.valueBlock.value[o-r],i.valueBlock.value[o]);if(s.verified===false){if(i.valueBlock.value[o].optional)r++;else{if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name)delete t[i.name]}return s}}}}}if(s.verified===false){const e={verified:false,result:t};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name){delete t[i.name];e.name=i.name}}return e}return{verified:true,result:t}}if(i.primitiveSchema&&g in e.valueBlock){const r=z(e.valueBlock.valueHexView);if(r.offset===-1){const e={verified:false,result:r.result};if(i.name){i.name=i.name.replace(/^\s+|\s+$/g,T);if(i.name){delete t[i.name];e.name=i.name}}return e}return Te(t,r.result,i.primitiveSchema)}return{verified:true,result:t}}function Oe(t,e){if(e instanceof Object===false){return{verified:false,result:{error:"Wrong ASN.1 schema type"}}}const i=z(n.BufferSourceConverter.toUint8Array(t));if(i.offset===-1){return{verified:false,result:i.result}}return Te(i.result,i.result,e)}var ke=Object.freeze({__proto__:null,Any:De,BaseBlock:V,BaseStringBlock:$,BitString:ft,BmpString:$t,Boolean:ct,CharacterString:he,Choice:Ie,Constructed:tt,DATE:Ae,DateTime:ge,Duration:Ee,EndOfContent:rt,Enumerated:Et,GeneralString:ue,GeneralizedTime:ye,GraphicString:ne,HexBlock:K,IA5String:re,Integer:gt,Null:nt,NumericString:zt,ObjectIdentifier:It,OctetString:ht,Primitive:Q,PrintableString:Yt,RawData:xe,RelativeObjectIdentifier:Ot,Repeated:Be,Sequence:Rt,Set:Mt,TIME:Pe,TeletexString:Xt,TimeOfDay:me,UTCTime:de,UniversalString:Qt,Utf8String:Ft,ValueBlock:U,VideotexString:ee,ViewWriter:A,VisibleString:ae,compareSchema:Te,fromBER:J,verifySchema:Oe});var Re;(function(t){t[t["Sequence"]=0]="Sequence";t[t["Set"]=1]="Set";t[t["Choice"]=2]="Choice"})(Re||(Re={}));var Ne;(function(t){t[t["Any"]=1]="Any";t[t["Boolean"]=2]="Boolean";t[t["OctetString"]=3]="OctetString";t[t["BitString"]=4]="BitString";t[t["Integer"]=5]="Integer";t[t["Enumerated"]=6]="Enumerated";t[t["ObjectIdentifier"]=7]="ObjectIdentifier";t[t["Utf8String"]=8]="Utf8String";t[t["BmpString"]=9]="BmpString";t[t["UniversalString"]=10]="UniversalString";t[t["NumericString"]=11]="NumericString";t[t["PrintableString"]=12]="PrintableString";t[t["TeletexString"]=13]="TeletexString";t[t["VideotexString"]=14]="VideotexString";t[t["IA5String"]=15]="IA5String";t[t["GraphicString"]=16]="GraphicString";t[t["VisibleString"]=17]="VisibleString";t[t["GeneralString"]=18]="GeneralString";t[t["CharacterString"]=19]="CharacterString";t[t["UTCTime"]=20]="UTCTime";t[t["GeneralizedTime"]=21]="GeneralizedTime";t[t["DATE"]=22]="DATE";t[t["TimeOfDay"]=23]="TimeOfDay";t[t["DateTime"]=24]="DateTime";t[t["Duration"]=25]="Duration";t[t["TIME"]=26]="TIME";t[t["Null"]=27]="Null"})(Ne||(Ne={}));class Me{constructor(t,e=0){this.unusedBits=0;this.value=new ArrayBuffer(0);if(t){if(typeof t==="number"){this.fromNumber(t)}else if(n.BufferSourceConverter.isBufferSource(t)){this.unusedBits=e;this.value=n.BufferSourceConverter.toArrayBuffer(t)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}fromASN(t){if(!(t instanceof ft)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=t.valueBlock.unusedBits;this.value=t.valueBlock.valueHex;return this}toASN(){return new ft({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new ft({name:t})}toNumber(){let t="";const e=new Uint8Array(this.value);for(const i of e){t+=i.toString(2).padStart(8,"0")}t=t.split("").reverse().join("");if(this.unusedBits){t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(t,2)}fromNumber(t){let e=t.toString(2);const i=e.length+7>>3;this.unusedBits=(i<<3)-e.length;const r=new Uint8Array(i);e=e.padStart(i<<3,"0").split("").reverse().join("");let s=0;while(s<i){r[s]=parseInt(e.slice(s<<3,(s<<3)+8),2);s++}this.value=r.buffer}}class Ke{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){if(typeof t==="number"){this.buffer=new ArrayBuffer(t)}else{if(n.BufferSourceConverter.isBufferSource(t)){this.buffer=n.BufferSourceConverter.toArrayBuffer(t)}else if(Array.isArray(t)){this.buffer=new Uint8Array(t)}else{this.buffer=new ArrayBuffer(0)}}}fromASN(t){if(!(t instanceof ht)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=t.valueBlock.valueHex;return this}toASN(){return new ht({valueHex:this.buffer})}toSchema(t){return new ht({name:t})}}const He={fromASN:t=>t instanceof nt?null:t.valueBeforeDecodeView,toASN:t=>{if(t===null){return new nt}const e=J(t);if(e.result.error){throw new Error(e.result.error)}return e.result}};const Ue={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new gt({value:+t})};const je={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new Et({value:t})};const _e={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new gt({valueHex:t})};const Fe={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new ft({valueHex:t})};const Ve={fromASN:t=>t.valueBlock.toString(),toASN:t=>new It({value:t})};const Le={fromASN:t=>t.valueBlock.value,toASN:t=>new ct({value:t})};const $e={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new ht({valueHex:t})};const Ge={fromASN:t=>new Ke(t.getValue()),toASN:t=>t.toASN()};function We(t){return{fromASN:t=>t.valueBlock.value,toASN:e=>new t({value:e})}}const Qe=We(Ft);const qe=We($t);const ze=We(Qt);const Je=We(zt);const Ye=We(Yt);const Ze=We(Xt);const Xe=We(ee);const ti=We(re);const ei=We(ne);const ii=We(ae);const ri=We(ue);const si=We(he);const ni={fromASN:t=>t.toDate(),toASN:t=>new de({valueDate:t})};const oi={fromASN:t=>t.toDate(),toASN:t=>new ye({valueDate:t})};const ai={fromASN:()=>null,toASN:()=>new nt};function ci(t){switch(t){case Ne.Any:return He;case Ne.BitString:return Fe;case Ne.BmpString:return qe;case Ne.Boolean:return Le;case Ne.CharacterString:return si;case Ne.Enumerated:return je;case Ne.GeneralString:return ri;case Ne.GeneralizedTime:return oi;case Ne.GraphicString:return ei;case Ne.IA5String:return ti;case Ne.Integer:return Ue;case Ne.Null:return ai;case Ne.NumericString:return Je;case Ne.ObjectIdentifier:return Ve;case Ne.OctetString:return $e;case Ne.PrintableString:return Ye;case Ne.TeletexString:return Ze;case Ne.UTCTime:return ni;case Ne.UniversalString:return ze;case Ne.Utf8String:return Qe;case Ne.VideotexString:return Xe;case Ne.VisibleString:return ii;default:return null}}function ui(t){if(typeof t==="function"&&t.prototype){if(t.prototype.toASN&&t.prototype.fromASN){return true}else{return ui(t.prototype)}}else{return!!(t&&typeof t==="object"&&"toASN"in t&&"fromASN"in t)}}function li(t){var e;if(t){const i=Object.getPrototypeOf(t);if(((e=i===null||i===void 0?void 0:i.prototype)===null||e===void 0?void 0:e.constructor)===Array){return true}return li(i)}return false}function hi(t,e){if(!(t&&e)){return false}if(t.byteLength!==e.byteLength){return false}const i=new Uint8Array(t);const r=new Uint8Array(e);for(let e=0;e<t.byteLength;e++){if(i[e]!==r[e]){return false}}return true}class pi{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,e=false){const i=this.items.get(t);if(!i){throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`)}if(e&&!i.schema){throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`)}return i}cache(t){const e=this.get(t);if(!e.schema){e.schema=this.create(t,true)}}createDefault(t){const e={type:Re.Sequence,items:{}};const i=this.findParentSchema(t);if(i){Object.assign(e,i);e.items=Object.assign({},e.items,i.items)}return e}create(t,e){const i=this.items.get(t)||this.createDefault(t);const r=[];for(const t in i.items){const s=i.items[t];const n=e?t:"";let o;if(typeof s.type==="number"){const t=Ne[s.type];const e=ke[t];if(!e){throw new Error(`Cannot get ASN1 class by name '${t}'`)}o=new e({name:n})}else if(ui(s.type)){const t=new s.type;o=t.toSchema(n)}else if(s.optional){const t=this.get(s.type);if(t.type===Re.Choice){o=new De({name:n})}else{o=this.create(s.type,false);o.name=n}}else{o=new De({name:n})}const a=!!s.optional||s.defaultValue!==undefined;if(s.repeated){o.name="";const t=s.repeated==="set"?Mt:Rt;o=new t({name:"",value:[new Be({name:n,value:o})]})}if(s.context!==null&&s.context!==undefined){if(s.implicit){if(typeof s.type==="number"||ui(s.type)){const t=s.repeated?tt:Q;r.push(new t({name:n,optional:a,idBlock:{tagClass:3,tagNumber:s.context}}))}else{this.cache(s.type);const t=!!s.repeated;let e=!t?this.get(s.type,true).schema:o;e="valueBlock"in e?e.valueBlock.value:e.value;r.push(new tt({name:!t?n:"",optional:a,idBlock:{tagClass:3,tagNumber:s.context},value:e}))}}else{r.push(new tt({optional:a,idBlock:{tagClass:3,tagNumber:s.context},value:[o]}))}}else{o.optional=a;r.push(o)}}switch(i.type){case Re.Sequence:return new Rt({value:r,name:""});case Re.Set:return new Mt({value:r,name:""});case Re.Choice:return new Ie({value:r,name:""});default:throw new Error(`Unsupported ASN1 type in use`)}}set(t,e){this.items.set(t,e);return this}findParentSchema(t){const e=Object.getPrototypeOf(t);if(e){const t=this.items.get(e);return t||this.findParentSchema(e)}return null}}const di=new pi;const fi=t=>e=>{let i;if(!di.has(e)){i=di.createDefault(e);di.set(e,i)}else{i=di.get(e)}Object.assign(i,t)};const yi=t=>(e,i)=>{let r;if(!di.has(e.constructor)){r=di.createDefault(e.constructor);di.set(e.constructor,r)}else{r=di.get(e.constructor)}const s=Object.assign({},t);if(typeof s.type==="number"&&!s.converter){const r=ci(t.type);if(!r){throw new Error(`Cannot get default converter for property '${i}' of ${e.constructor.name}`)}s.converter=r}s.raw=t.raw;r.items[i]=s};class Si extends Error{constructor(){super(...arguments);this.schemas=[]}}class Ai{static parse(t,e){const i=J(t);if(i.result.error){throw new Error(i.result.error)}const r=this.fromASN(i.result,e);return r}static fromASN(t,e){try{if(ui(e)){const i=new e;return i.fromASN(t)}const i=di.get(e);di.cache(e);let r=i.schema;const s=this.handleChoiceTypes(t,i,e,r);if(s===null||s===void 0?void 0:s.result){return s.result}if(s===null||s===void 0?void 0:s.targetSchema){r=s.targetSchema}const n=this.handleSequenceTypes(t,i,e,r);const o=new e;if(li(e)){return this.handleArrayTypes(t,i,e)}this.processSchemaItems(i,n,o);return o}catch(t){if(t instanceof Si){t.schemas.push(e.name)}throw t}}static handleChoiceTypes(t,e,i,r){if(t.constructor===tt&&e.type===Re.Choice&&t.idBlock.tagClass===3){for(const r in e.items){const s=e.items[r];if(s.context===t.idBlock.tagNumber&&s.implicit){if(typeof s.type==="function"&&di.has(s.type)){const e=di.get(s.type);if(e&&e.type===Re.Sequence){const e=new Rt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in e.valueBlock){e.valueBlock.value=t.valueBlock.value;const n=this.fromASN(e,s.type);const o=new i;o[r]=n;return{result:o}}}}}}}else if(t.constructor===tt&&e.type!==Re.Choice){const i=new tt({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:e.schema.valueBlock.value});for(const i in e.items){delete t[i]}return{targetSchema:i}}return null}static handleSequenceTypes(t,e,i,r){if(e.type===Re.Sequence){const e=Te({},t,r);if(!e.verified){throw new Si(`Data does not match to ${i.name} ASN1 schema.${e.result.error?` ${e.result.error}`:""}`)}return e}else{const e=Te({},t,r);if(!e.verified){throw new Si(`Data does not match to ${i.name} ASN1 schema.${e.result.error?` ${e.result.error}`:""}`)}return e}}static processRepeatedField(t,e,i){let r=t.slice(e);if(r.length===1&&r[0].constructor.name==="Sequence"){const t=r[0];if(t.valueBlock&&t.valueBlock.value&&Array.isArray(t.valueBlock.value)){r=t.valueBlock.value}}if(typeof i.type==="number"){const t=ci(i.type);if(!t)throw new Error(`No converter for ASN.1 type ${i.type}`);return r.filter((t=>t&&t.valueBlock)).map((e=>{try{return t.fromASN(e)}catch{return undefined}})).filter((t=>t!==undefined))}else{return r.filter((t=>t&&t.valueBlock)).map((t=>{try{return this.fromASN(t,i.type)}catch{return undefined}})).filter((t=>t!==undefined))}}static processPrimitiveField(t,e){const i=ci(e.type);if(!i)throw new Error(`No converter for ASN.1 type ${e.type}`);return i.fromASN(t)}static isOptionalChoiceField(t){return t.optional&&typeof t.type==="function"&&di.has(t.type)&&di.get(t.type).type===Re.Choice}static processOptionalChoiceField(t,e){try{const i=this.fromASN(t,e.type);return{processed:true,value:i}}catch(t){if(t instanceof Si&&/Wrong values for Choice type/.test(t.message)){return{processed:false}}throw t}}static handleArrayTypes(t,e,i){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value))){throw new Error(`Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.`)}const r=e.itemType;if(typeof r==="number"){const e=ci(r);if(!e){throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`)}return i.from(t.valueBlock.value,(t=>e.fromASN(t)))}else{return i.from(t.valueBlock.value,(t=>this.fromASN(t,r)))}}static processSchemaItems(t,e,i){for(const r in t.items){const s=e.result[r];if(!s){continue}const n=t.items[r];const o=n.type;let a;if(typeof o==="number"||ui(o)){a=this.processPrimitiveSchemaItem(s,n,o)}else{a=this.processComplexSchemaItem(s,n,o)}if(a&&typeof a==="object"&&"value"in a&&"raw"in a){i[r]=a.value;i[`${r}Raw`]=a.raw}else{i[r]=a}}}static processPrimitiveSchemaItem(t,e,i){var r;const s=(r=e.converter)!==null&&r!==void 0?r:ui(i)?new i:null;if(!s){throw new Error("Converter is empty")}if(e.repeated){return this.processRepeatedPrimitiveItem(t,e,s)}else{return this.processSinglePrimitiveItem(t,e,i,s)}}static processRepeatedPrimitiveItem(t,e,i){if(e.implicit){const r=e.repeated==="sequence"?Rt:Mt;const s=new r;s.valueBlock=t.valueBlock;const n=J(s.toBER(false));if(n.offset===-1){throw new Error(`Cannot parse the child item. ${n.result.error}`)}if(!("value"in n.result.valueBlock&&Array.isArray(n.result.valueBlock.value))){throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.")}const o=n.result.valueBlock.value;return Array.from(o,(t=>i.fromASN(t)))}else{return Array.from(t,(t=>i.fromASN(t)))}}static processSinglePrimitiveItem(t,e,i,r){let s=t;if(e.implicit){let t;if(ui(i)){t=(new i).toSchema("")}else{const e=Ne[i];const r=ke[e];if(!r){throw new Error(`Cannot get '${e}' class from asn1js module`)}t=new r}t.valueBlock=s.valueBlock;s=J(t.toBER(false)).result}return r.fromASN(s)}static processComplexSchemaItem(t,e,i){if(e.repeated){if(!Array.isArray(t)){throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.")}return Array.from(t,(t=>this.fromASN(t,i)))}else{const r=this.handleImplicitTagging(t,e,i);if(this.isOptionalChoiceField(e)){try{return this.fromASN(r,i)}catch(t){if(t instanceof Si&&/Wrong values for Choice type/.test(t.message)){return undefined}throw t}}else{const s=this.fromASN(r,i);if(e.raw){return{value:s,raw:t.valueBeforeDecodeView}}return s}}}static handleImplicitTagging(t,e,i){if(e.implicit&&typeof e.context==="number"){const e=di.get(i);if(e.type===Re.Sequence){const e=new Rt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in e.valueBlock){e.valueBlock.value=t.valueBlock.value;return e}}else if(e.type===Re.Set){const e=new Mt;if("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)&&"value"in e.valueBlock){e.valueBlock.value=t.valueBlock.value;return e}}}return t}}class vi{static serialize(t){if(t instanceof V){return t.toBER(false)}return this.toASN(t).toBER(false)}static toASN(t){if(t&&typeof t==="object"&&ui(t)){return t.toASN()}if(!(t&&typeof t==="object")){throw new TypeError("Parameter 1 should be type of Object.")}const e=t.constructor;const i=di.get(e);di.cache(e);let r=[];if(i.itemType){if(!Array.isArray(t)){throw new TypeError("Parameter 1 should be type of Array.")}if(typeof i.itemType==="number"){const s=ci(i.itemType);if(!s){throw new Error(`Cannot get default converter for array item of ${e.name} ASN1 schema`)}r=t.map((t=>s.toASN(t)))}else{r=t.map((t=>this.toAsnItem({type:i.itemType},"[]",e,t)))}}else{for(const s in i.items){const n=i.items[s];const o=t[s];if(o===undefined||n.defaultValue===o||typeof n.defaultValue==="object"&&typeof o==="object"&&hi(this.serialize(n.defaultValue),this.serialize(o))){continue}const a=vi.toAsnItem(n,s,e,o);if(typeof n.context==="number"){if(n.implicit){if(!n.repeated&&(typeof n.type==="number"||ui(n.type))){const t={};t.valueHex=a instanceof nt?a.valueBeforeDecodeView:a.valueBlock.toBER();r.push(new Q({optional:n.optional,idBlock:{tagClass:3,tagNumber:n.context},...t}))}else{r.push(new tt({optional:n.optional,idBlock:{tagClass:3,tagNumber:n.context},value:a.valueBlock.value}))}}else{r.push(new tt({optional:n.optional,idBlock:{tagClass:3,tagNumber:n.context},value:[a]}))}}else if(n.repeated){r=r.concat(a)}else{r.push(a)}}}let s;switch(i.type){case Re.Sequence:s=new Rt({value:r});break;case Re.Set:s=new Mt({value:r});break;case Re.Choice:if(!r[0]){throw new Error(`Schema '${e.name}' has wrong data. Choice cannot be empty.`)}s=r[0];break}return s}static toAsnItem(t,e,i,r){let s;if(typeof t.type==="number"){const n=t.converter;if(!n){throw new Error(`Property '${e}' doesn't have converter for type ${Ne[t.type]} in schema '${i.name}'`)}if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}const e=Array.from(r,(t=>n.toASN(t)));const i=t.repeated==="sequence"?Rt:Mt;s=new i({value:e})}else{s=n.toASN(r)}}else{if(t.repeated){if(!Array.isArray(r)){throw new TypeError("Parameter 'objProp' should be type of Array.")}const e=Array.from(r,(t=>this.toASN(t)));const i=t.repeated==="sequence"?Rt:Mt;s=new i({value:e})}else{s=this.toASN(r)}}return s}}class mi extends Array{constructor(t=[]){if(typeof t==="number"){super(t)}else{super();for(const e of t){this.push(e)}}}}class Ci{static serialize(t){return vi.serialize(t)}static parse(t,e){return Ai.parse(t,e)}static toString(t){const e=n.BufferSourceConverter.isBufferSource(t)?n.BufferSourceConverter.toArrayBuffer(t):Ci.serialize(t);const i=J(e);if(i.offset===-1){throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`)}return i.result.toString()}}function gi(t,e,i,r){var s=arguments.length,n=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)if(o=t[a])n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n;return s>3&&n&&Object.defineProperty(e,i,n),n}typeof SuppressedError==="function"?SuppressedError:function(t,e,i){var r=new Error(i);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};class wi{static isIPv4(t){return/^(\d{1,3}\.){3}\d{1,3}$/.test(t)}static parseIPv4(t){const e=t.split(".");if(e.length!==4){throw new Error("Invalid IPv4 address")}return e.map((t=>{const e=parseInt(t,10);if(isNaN(e)||e<0||e>255){throw new Error("Invalid IPv4 address part")}return e}))}static parseIPv6(t){const e=this.expandIPv6(t);const i=e.split(":");if(i.length!==8){throw new Error("Invalid IPv6 address")}return i.reduce(((t,e)=>{const i=parseInt(e,16);if(isNaN(i)||i<0||i>65535){throw new Error("Invalid IPv6 address part")}t.push(i>>8&255);t.push(i&255);return t}),[])}static expandIPv6(t){if(!t.includes("::")){return t}const e=t.split("::");if(e.length>2){throw new Error("Invalid IPv6 address")}const i=e[0]?e[0].split(":"):[];const r=e[1]?e[1].split(":"):[];const s=8-(i.length+r.length);if(s<0){throw new Error("Invalid IPv6 address")}return[...i,...Array(s).fill("0"),...r].join(":")}static formatIPv6(t){const e=[];for(let i=0;i<16;i+=2){e.push((t[i]<<8|t[i+1]).toString(16))}return this.compressIPv6(e.join(":"))}static compressIPv6(t){const e=t.split(":");let i=-1;let r=0;let s=-1;let n=0;for(let t=0;t<e.length;t++){if(e[t]==="0"){if(s===-1){s=t}n++}else{if(n>r){i=s;r=n}s=-1;n=0}}if(n>r){i=s;r=n}if(r>1){const t=e.slice(0,i).join(":");const s=e.slice(i+r).join(":");return`${t}::${s}`}return t}static parseCIDR(t){const[e,i]=t.split("/");const r=parseInt(i,10);if(this.isIPv4(e)){if(r<0||r>32){throw new Error("Invalid IPv4 prefix length")}return[this.parseIPv4(e),r]}else{if(r<0||r>128){throw new Error("Invalid IPv6 prefix length")}return[this.parseIPv6(e),r]}}static decodeIP(t){if(t.length===64&&parseInt(t,16)===0){return"::/0"}if(t.length!==16){return t}const e=parseInt(t.slice(8),16).toString(2).split("").reduce(((t,e)=>t+ +e),0);let i=t.slice(0,8).replace(/(.{2})/g,(t=>`${parseInt(t,16)}.`));i=i.slice(0,-1);return`${i}/${e}`}static toString(t){const e=new Uint8Array(t);if(e.length===4){return Array.from(e).join(".")}if(e.length===16){return this.formatIPv6(e)}if(e.length===8||e.length===32){const t=e.length/2;const i=e.slice(0,t);const r=e.slice(t);const s=e.every((t=>t===0));if(s){return e.length===8?"0.0.0.0/0":"::/0"}const n=r.reduce(((t,e)=>t+(e.toString(2).match(/1/g)||[]).length),0);if(e.length===8){const t=Array.from(i).join(".");return`${t}/${n}`}else{const t=this.formatIPv6(i);return`${t}/${n}`}}return this.decodeIP(n.Convert.ToHex(t))}static fromString(t){if(t.includes("/")){const[e,i]=this.parseCIDR(t);const r=new Uint8Array(e.length);let s=i;for(let t=0;t<r.length;t++){if(s>=8){r[t]=255;s-=8}else if(s>0){r[t]=255<<8-s;s=0}}const n=new Uint8Array(e.length*2);n.set(e,0);n.set(r,e.length);return n.buffer}const e=this.isIPv4(t)?this.parseIPv4(t):this.parseIPv6(t);return new Uint8Array(e).buffer}}var Ei,bi,Pi;let Di=class t{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};gi([yi({type:Ne.TeletexString})],Di.prototype,"teletexString",void 0);gi([yi({type:Ne.PrintableString})],Di.prototype,"printableString",void 0);gi([yi({type:Ne.UniversalString})],Di.prototype,"universalString",void 0);gi([yi({type:Ne.Utf8String})],Di.prototype,"utf8String",void 0);gi([yi({type:Ne.BmpString})],Di.prototype,"bmpString",void 0);Di=gi([fi({type:Re.Choice})],Di);let Ii=class t extends Di{constructor(t={}){super(t);Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?n.Convert.ToHex(this.anyValue):super.toString())}};gi([yi({type:Ne.IA5String})],Ii.prototype,"ia5String",void 0);gi([yi({type:Ne.Any})],Ii.prototype,"anyValue",void 0);Ii=gi([fi({type:Re.Choice})],Ii);class Bi{constructor(t={}){this.type="";this.value=new Ii;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Bi.prototype,"type",void 0);gi([yi({type:Ii})],Bi.prototype,"value",void 0);let xi=Ei=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ei.prototype)}};xi=Ei=gi([fi({type:Re.Set,itemType:Bi})],xi);let Ti=bi=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,bi.prototype)}};Ti=bi=gi([fi({type:Re.Sequence,itemType:xi})],Ti);let Oi=Pi=class t extends Ti{constructor(t){super(t);Object.setPrototypeOf(this,Pi.prototype)}};Oi=Pi=gi([fi({type:Re.Sequence})],Oi);const ki={fromASN:t=>wi.toString($e.fromASN(t)),toASN:t=>$e.toASN(wi.fromString(t))};class Ri{constructor(t={}){this.typeId="";this.value=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Ri.prototype,"typeId",void 0);gi([yi({type:Ne.Any,context:0})],Ri.prototype,"value",void 0);class Ni{constructor(t={}){this.partyName=new Di;Object.assign(this,t)}}gi([yi({type:Di,optional:true,context:0,implicit:true})],Ni.prototype,"nameAssigner",void 0);gi([yi({type:Di,context:1,implicit:true})],Ni.prototype,"partyName",void 0);let Mi=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ri,context:0,implicit:true})],Mi.prototype,"otherName",void 0);gi([yi({type:Ne.IA5String,context:1,implicit:true})],Mi.prototype,"rfc822Name",void 0);gi([yi({type:Ne.IA5String,context:2,implicit:true})],Mi.prototype,"dNSName",void 0);gi([yi({type:Ne.Any,context:3,implicit:true})],Mi.prototype,"x400Address",void 0);gi([yi({type:Oi,context:4,implicit:false})],Mi.prototype,"directoryName",void 0);gi([yi({type:Ni,context:5})],Mi.prototype,"ediPartyName",void 0);gi([yi({type:Ne.IA5String,context:6,implicit:true})],Mi.prototype,"uniformResourceIdentifier",void 0);gi([yi({type:Ne.OctetString,context:7,implicit:true,converter:ki})],Mi.prototype,"iPAddress",void 0);gi([yi({type:Ne.ObjectIdentifier,context:8,implicit:true})],Mi.prototype,"registeredID",void 0);Mi=gi([fi({type:Re.Choice})],Mi);const Ki="1.3.6.1.5.5.7";const Hi=`${Ki}.1`;const Ui="2.5.29";var ji;const _i=`${Hi}.1`;class Fi{constructor(t={}){this.accessMethod="";this.accessLocation=new Mi;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Fi.prototype,"accessMethod",void 0);gi([yi({type:Mi})],Fi.prototype,"accessLocation",void 0);let Vi=ji=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ji.prototype)}};Vi=ji=gi([fi({type:Re.Sequence,itemType:Fi})],Vi);const Li=`${Ui}.35`;class $i extends Ke{}class Gi{constructor(t={}){if(t){Object.assign(this,t)}}}gi([yi({type:$i,context:0,optional:true,implicit:true})],Gi.prototype,"keyIdentifier",void 0);gi([yi({type:Mi,context:1,optional:true,implicit:true,repeated:"sequence"})],Gi.prototype,"authorityCertIssuer",void 0);gi([yi({type:Ne.Integer,context:2,optional:true,implicit:true,converter:_e})],Gi.prototype,"authorityCertSerialNumber",void 0);const Wi=`${Ui}.19`;class Qi{constructor(t={}){this.cA=false;Object.assign(this,t)}}gi([yi({type:Ne.Boolean,defaultValue:false})],Qi.prototype,"cA",void 0);gi([yi({type:Ne.Integer,optional:true})],Qi.prototype,"pathLenConstraint",void 0);var qi;let zi=qi=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,qi.prototype)}};zi=qi=gi([fi({type:Re.Sequence,itemType:Mi})],zi);var Ji;const Yi=`${Ui}.29`;let Zi=Ji=class t extends zi{constructor(t){super(t);Object.setPrototypeOf(this,Ji.prototype)}};Zi=Ji=gi([fi({type:Re.Sequence})],Zi);var Xi;const tr=`${Ui}.32`;let er=class t{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};gi([yi({type:Ne.IA5String})],er.prototype,"ia5String",void 0);gi([yi({type:Ne.VisibleString})],er.prototype,"visibleString",void 0);gi([yi({type:Ne.BmpString})],er.prototype,"bmpString",void 0);gi([yi({type:Ne.Utf8String})],er.prototype,"utf8String",void 0);er=gi([fi({type:Re.Choice})],er);class ir{constructor(t={}){this.organization=new er;this.noticeNumbers=[];Object.assign(this,t)}}gi([yi({type:er})],ir.prototype,"organization",void 0);gi([yi({type:Ne.Integer,repeated:"sequence"})],ir.prototype,"noticeNumbers",void 0);class rr{constructor(t={}){Object.assign(this,t)}}gi([yi({type:ir,optional:true})],rr.prototype,"noticeRef",void 0);gi([yi({type:er,optional:true})],rr.prototype,"explicitText",void 0);let sr=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.IA5String})],sr.prototype,"cPSuri",void 0);gi([yi({type:rr})],sr.prototype,"userNotice",void 0);sr=gi([fi({type:Re.Choice})],sr);class nr{constructor(t={}){this.policyQualifierId="";this.qualifier=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],nr.prototype,"policyQualifierId",void 0);gi([yi({type:Ne.Any})],nr.prototype,"qualifier",void 0);class or{constructor(t={}){this.policyIdentifier="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],or.prototype,"policyIdentifier",void 0);gi([yi({type:nr,repeated:"sequence",optional:true})],or.prototype,"policyQualifiers",void 0);let ar=Xi=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Xi.prototype)}};ar=Xi=gi([fi({type:Re.Sequence,itemType:or})],ar);const cr=`${Ui}.20`;let ur=class t{constructor(t=0){this.value=t}};gi([yi({type:Ne.Integer})],ur.prototype,"value",void 0);ur=gi([fi({type:Re.Choice})],ur);const lr=`${Ui}.27`;let hr=class t extends ur{};hr=gi([fi({type:Re.Choice})],hr);var pr;const dr=`${Ui}.31`;var fr;(function(t){t[t["unused"]=1]="unused";t[t["keyCompromise"]=2]="keyCompromise";t[t["cACompromise"]=4]="cACompromise";t[t["affiliationChanged"]=8]="affiliationChanged";t[t["superseded"]=16]="superseded";t[t["cessationOfOperation"]=32]="cessationOfOperation";t[t["certificateHold"]=64]="certificateHold";t[t["privilegeWithdrawn"]=128]="privilegeWithdrawn";t[t["aACompromise"]=256]="aACompromise"})(fr||(fr={}));class yr extends Me{toJSON(){const t=[];const e=this.toNumber();if(e&fr.aACompromise){t.push("aACompromise")}if(e&fr.affiliationChanged){t.push("affiliationChanged")}if(e&fr.cACompromise){t.push("cACompromise")}if(e&fr.certificateHold){t.push("certificateHold")}if(e&fr.cessationOfOperation){t.push("cessationOfOperation")}if(e&fr.keyCompromise){t.push("keyCompromise")}if(e&fr.privilegeWithdrawn){t.push("privilegeWithdrawn")}if(e&fr.superseded){t.push("superseded")}if(e&fr.unused){t.push("unused")}return t}toString(){return`[${this.toJSON().join(", ")}]`}}let Sr=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Mi,context:0,repeated:"sequence",implicit:true})],Sr.prototype,"fullName",void 0);gi([yi({type:xi,context:1,implicit:true})],Sr.prototype,"nameRelativeToCRLIssuer",void 0);Sr=gi([fi({type:Re.Choice})],Sr);class Ar{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Sr,context:0,optional:true})],Ar.prototype,"distributionPoint",void 0);gi([yi({type:yr,context:1,optional:true,implicit:true})],Ar.prototype,"reasons",void 0);gi([yi({type:Mi,context:2,optional:true,repeated:"sequence",implicit:true})],Ar.prototype,"cRLIssuer",void 0);let vr=pr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,pr.prototype)}};vr=pr=gi([fi({type:Re.Sequence,itemType:Ar})],vr);var mr;let Cr=mr=class t extends vr{constructor(t){super(t);Object.setPrototypeOf(this,mr.prototype)}};Cr=mr=gi([fi({type:Re.Sequence,itemType:Ar})],Cr);const gr=`${Ui}.28`;class wr{constructor(t={}){this.onlyContainsUserCerts=wr.ONLY;this.onlyContainsCACerts=wr.ONLY;this.indirectCRL=wr.ONLY;this.onlyContainsAttributeCerts=wr.ONLY;Object.assign(this,t)}}wr.ONLY=false;gi([yi({type:Sr,context:0,optional:true})],wr.prototype,"distributionPoint",void 0);gi([yi({type:Ne.Boolean,context:1,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"onlyContainsUserCerts",void 0);gi([yi({type:Ne.Boolean,context:2,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"onlyContainsCACerts",void 0);gi([yi({type:yr,context:3,optional:true,implicit:true})],wr.prototype,"onlySomeReasons",void 0);gi([yi({type:Ne.Boolean,context:4,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"indirectCRL",void 0);gi([yi({type:Ne.Boolean,context:5,defaultValue:wr.ONLY,implicit:true})],wr.prototype,"onlyContainsAttributeCerts",void 0);const Er=`${Ui}.21`;var br;(function(t){t[t["unspecified"]=0]="unspecified";t[t["keyCompromise"]=1]="keyCompromise";t[t["cACompromise"]=2]="cACompromise";t[t["affiliationChanged"]=3]="affiliationChanged";t[t["superseded"]=4]="superseded";t[t["cessationOfOperation"]=5]="cessationOfOperation";t[t["certificateHold"]=6]="certificateHold";t[t["removeFromCRL"]=8]="removeFromCRL";t[t["privilegeWithdrawn"]=9]="privilegeWithdrawn";t[t["aACompromise"]=10]="aACompromise"})(br||(br={}));let Pr=class t{constructor(t=br.unspecified){this.reason=br.unspecified;this.reason=t}toJSON(){return br[this.reason]}toString(){return this.toJSON()}};gi([yi({type:Ne.Enumerated})],Pr.prototype,"reason",void 0);Pr=gi([fi({type:Re.Choice})],Pr);var Dr;const Ir=`${Ui}.37`;let Br=Dr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Dr.prototype)}};Br=Dr=gi([fi({type:Re.Sequence,itemType:Ne.ObjectIdentifier})],Br);const xr=`${Ui}.54`;let Tr=class t{constructor(t=new ArrayBuffer(0)){this.value=t}};gi([yi({type:Ne.Integer,converter:_e})],Tr.prototype,"value",void 0);Tr=gi([fi({type:Re.Choice})],Tr);const Or=`${Ui}.24`;let kr=class t{constructor(t){this.value=new Date;if(t){this.value=t}}};gi([yi({type:Ne.GeneralizedTime})],kr.prototype,"value",void 0);kr=gi([fi({type:Re.Choice})],kr);var Rr;const Nr=`${Ui}.18`;let Mr=Rr=class t extends zi{constructor(t){super(t);Object.setPrototypeOf(this,Rr.prototype)}};Mr=Rr=gi([fi({type:Re.Sequence})],Mr);const Kr=`${Ui}.15`;var Hr;(function(t){t[t["digitalSignature"]=1]="digitalSignature";t[t["nonRepudiation"]=2]="nonRepudiation";t[t["keyEncipherment"]=4]="keyEncipherment";t[t["dataEncipherment"]=8]="dataEncipherment";t[t["keyAgreement"]=16]="keyAgreement";t[t["keyCertSign"]=32]="keyCertSign";t[t["cRLSign"]=64]="cRLSign";t[t["encipherOnly"]=128]="encipherOnly";t[t["decipherOnly"]=256]="decipherOnly"})(Hr||(Hr={}));class Ur extends Me{toJSON(){const t=this.toNumber();const e=[];if(t&Hr.cRLSign){e.push("crlSign")}if(t&Hr.dataEncipherment){e.push("dataEncipherment")}if(t&Hr.decipherOnly){e.push("decipherOnly")}if(t&Hr.digitalSignature){e.push("digitalSignature")}if(t&Hr.encipherOnly){e.push("encipherOnly")}if(t&Hr.keyAgreement){e.push("keyAgreement")}if(t&Hr.keyCertSign){e.push("keyCertSign")}if(t&Hr.keyEncipherment){e.push("keyEncipherment")}if(t&Hr.nonRepudiation){e.push("nonRepudiation")}return e}toString(){return`[${this.toJSON().join(", ")}]`}}var jr;const _r=`${Ui}.30`;class Fr{constructor(t={}){this.base=new Mi;this.minimum=0;Object.assign(this,t)}}gi([yi({type:Mi})],Fr.prototype,"base",void 0);gi([yi({type:Ne.Integer,context:0,defaultValue:0,implicit:true})],Fr.prototype,"minimum",void 0);gi([yi({type:Ne.Integer,context:1,optional:true,implicit:true})],Fr.prototype,"maximum",void 0);let Vr=jr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,jr.prototype)}};Vr=jr=gi([fi({type:Re.Sequence,itemType:Fr})],Vr);class Lr{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Vr,context:0,optional:true,implicit:true})],Lr.prototype,"permittedSubtrees",void 0);gi([yi({type:Vr,context:1,optional:true,implicit:true})],Lr.prototype,"excludedSubtrees",void 0);const $r=`${Ui}.36`;class Gr{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.Integer,context:0,implicit:true,optional:true,converter:_e})],Gr.prototype,"requireExplicitPolicy",void 0);gi([yi({type:Ne.Integer,context:1,implicit:true,optional:true,converter:_e})],Gr.prototype,"inhibitPolicyMapping",void 0);var Wr;const Qr=`${Ui}.33`;class qr{constructor(t={}){this.issuerDomainPolicy="";this.subjectDomainPolicy="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],qr.prototype,"issuerDomainPolicy",void 0);gi([yi({type:Ne.ObjectIdentifier})],qr.prototype,"subjectDomainPolicy",void 0);let zr=Wr=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wr.prototype)}};zr=Wr=gi([fi({type:Re.Sequence,itemType:qr})],zr);var Jr;const Yr=`${Ui}.17`;let Zr=Jr=class t extends zi{constructor(t){super(t);Object.setPrototypeOf(this,Jr.prototype)}};Zr=Jr=gi([fi({type:Re.Sequence})],Zr);let Xr=class t{constructor(t={}){this.type="";this.values=[];Object.assign(this,t)}};gi([yi({type:Ne.ObjectIdentifier})],Xr.prototype,"type",void 0);gi([yi({type:Ne.Any,repeated:"set"})],Xr.prototype,"values",void 0);var ts;const es=`${Ui}.9`;let is=ts=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ts.prototype)}};is=ts=gi([fi({type:Re.Sequence,itemType:Xr})],is);const rs=`${Ui}.14`;class ss extends $i{}const ns=`${Ui}.16`;class os{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.GeneralizedTime,context:0,implicit:true,optional:true})],os.prototype,"notBefore",void 0);gi([yi({type:Ne.GeneralizedTime,context:1,implicit:true,optional:true})],os.prototype,"notAfter",void 0);const as="1.2.840.113533.7.65.0";var cs;(function(t){t[t["keyUpdateAllowed"]=1]="keyUpdateAllowed";t[t["newExtensions"]=2]="newExtensions";t[t["pKIXCertificate"]=4]="pKIXCertificate"})(cs||(cs={}));class us extends Me{toJSON(){const t=[];const e=this.toNumber();if(e&cs.pKIXCertificate){t.push("pKIXCertificate")}if(e&cs.newExtensions){t.push("newExtensions")}if(e&cs.keyUpdateAllowed){t.push("keyUpdateAllowed")}return t}toString(){return`[${this.toJSON().join(", ")}]`}}class ls{constructor(t={}){this.entrustVers="";this.entrustInfoFlags=new us;Object.assign(this,t)}}gi([yi({type:Ne.GeneralString})],ls.prototype,"entrustVers",void 0);gi([yi({type:us})],ls.prototype,"entrustInfoFlags",void 0);var hs;const ps=`${Hi}.11`;let ds=hs=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,hs.prototype)}};ds=hs=gi([fi({type:Re.Sequence,itemType:Fi})],ds);class fs{constructor(t={}){this.algorithm="";Object.assign(this,t)}isEqual(t){return t instanceof fs&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&n.isEqual(t.parameters,this.parameters)||t.parameters===this.parameters)}}gi([yi({type:Ne.ObjectIdentifier})],fs.prototype,"algorithm",void 0);gi([yi({type:Ne.Any,optional:true})],fs.prototype,"parameters",void 0);class ys{constructor(t={}){this.algorithm=new fs;this.subjectPublicKey=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:fs})],ys.prototype,"algorithm",void 0);gi([yi({type:Ne.BitString})],ys.prototype,"subjectPublicKey",void 0);let Ss=class t{constructor(t){if(t){if(typeof t==="string"||typeof t==="number"||t instanceof Date){const e=new Date(t);if(e.getUTCFullYear()>2049){this.generalTime=e}else{this.utcTime=e}}else{Object.assign(this,t)}}}getTime(){const t=this.utcTime||this.generalTime;if(!t){throw new Error("Cannot get time from CHOICE object")}return t}};gi([yi({type:Ne.UTCTime})],Ss.prototype,"utcTime",void 0);gi([yi({type:Ne.GeneralizedTime})],Ss.prototype,"generalTime",void 0);Ss=gi([fi({type:Re.Choice})],Ss);class As{constructor(t){this.notBefore=new Ss(new Date);this.notAfter=new Ss(new Date);if(t){this.notBefore=new Ss(t.notBefore);this.notAfter=new Ss(t.notAfter)}}}gi([yi({type:Ss})],As.prototype,"notBefore",void 0);gi([yi({type:Ss})],As.prototype,"notAfter",void 0);var vs;let ms=class t{constructor(e={}){this.extnID="";this.critical=t.CRITICAL;this.extnValue=new Ke;Object.assign(this,e)}};ms.CRITICAL=false;gi([yi({type:Ne.ObjectIdentifier})],ms.prototype,"extnID",void 0);gi([yi({type:Ne.Boolean,defaultValue:ms.CRITICAL})],ms.prototype,"critical",void 0);gi([yi({type:Ke})],ms.prototype,"extnValue",void 0);let Cs=vs=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,vs.prototype)}};Cs=vs=gi([fi({type:Re.Sequence,itemType:ms})],Cs);var gs;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2";t[t["v3"]=2]="v3"})(gs||(gs={}));class ws{constructor(t={}){this.version=gs.v1;this.serialNumber=new ArrayBuffer(0);this.signature=new fs;this.issuer=new Oi;this.validity=new As;this.subject=new Oi;this.subjectPublicKeyInfo=new ys;Object.assign(this,t)}}gi([yi({type:Ne.Integer,context:0,defaultValue:gs.v1})],ws.prototype,"version",void 0);gi([yi({type:Ne.Integer,converter:_e})],ws.prototype,"serialNumber",void 0);gi([yi({type:fs})],ws.prototype,"signature",void 0);gi([yi({type:Oi})],ws.prototype,"issuer",void 0);gi([yi({type:As})],ws.prototype,"validity",void 0);gi([yi({type:Oi})],ws.prototype,"subject",void 0);gi([yi({type:ys})],ws.prototype,"subjectPublicKeyInfo",void 0);gi([yi({type:Ne.BitString,context:1,implicit:true,optional:true})],ws.prototype,"issuerUniqueID",void 0);gi([yi({type:Ne.BitString,context:2,implicit:true,optional:true})],ws.prototype,"subjectUniqueID",void 0);gi([yi({type:Cs,context:3,optional:true})],ws.prototype,"extensions",void 0);class Es{constructor(t={}){this.tbsCertificate=new ws;this.signatureAlgorithm=new fs;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:ws,raw:true})],Es.prototype,"tbsCertificate",void 0);gi([yi({type:fs})],Es.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],Es.prototype,"signatureValue",void 0);class bs{constructor(t={}){this.userCertificate=new ArrayBuffer(0);this.revocationDate=new Ss;Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],bs.prototype,"userCertificate",void 0);gi([yi({type:Ss})],bs.prototype,"revocationDate",void 0);gi([yi({type:ms,optional:true,repeated:"sequence"})],bs.prototype,"crlEntryExtensions",void 0);class Ps{constructor(t={}){this.signature=new fs;this.issuer=new Oi;this.thisUpdate=new Ss;Object.assign(this,t)}}gi([yi({type:Ne.Integer,optional:true})],Ps.prototype,"version",void 0);gi([yi({type:fs})],Ps.prototype,"signature",void 0);gi([yi({type:Oi})],Ps.prototype,"issuer",void 0);gi([yi({type:Ss})],Ps.prototype,"thisUpdate",void 0);gi([yi({type:Ss,optional:true})],Ps.prototype,"nextUpdate",void 0);gi([yi({type:bs,repeated:"sequence",optional:true})],Ps.prototype,"revokedCertificates",void 0);gi([yi({type:ms,optional:true,context:0,repeated:"sequence"})],Ps.prototype,"crlExtensions",void 0);class Ds{constructor(t={}){this.tbsCertList=new Ps;this.signatureAlgorithm=new fs;this.signature=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ps,raw:true})],Ds.prototype,"tbsCertList",void 0);gi([yi({type:fs})],Ds.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],Ds.prototype,"signature",void 0);const Is="1.2.840.10045.2.1";const Bs="1.2.840.10045.4.1";const xs="1.2.840.10045.4.3.1";const Ts="1.2.840.10045.4.3.2";const Os="1.2.840.10045.4.3.3";const ks="1.2.840.10045.4.3.4";function Rs(t){return new fs({algorithm:t})}Rs(Bs);Rs(xs);Rs(Ts);Rs(Os);Rs(ks);let Ns=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.ObjectIdentifier})],Ns.prototype,"fieldType",void 0);gi([yi({type:Ne.Any})],Ns.prototype,"parameters",void 0);Ns=gi([fi({type:Re.Sequence})],Ns);class Ms extends Ke{}let Ks=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.OctetString})],Ks.prototype,"a",void 0);gi([yi({type:Ne.OctetString})],Ks.prototype,"b",void 0);gi([yi({type:Ne.BitString,optional:true})],Ks.prototype,"seed",void 0);Ks=gi([fi({type:Re.Sequence})],Ks);var Hs;(function(t){t[t["ecpVer1"]=1]="ecpVer1"})(Hs||(Hs={}));let Us=class t{constructor(t={}){this.version=Hs.ecpVer1;Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Us.prototype,"version",void 0);gi([yi({type:Ns})],Us.prototype,"fieldID",void 0);gi([yi({type:Ks})],Us.prototype,"curve",void 0);gi([yi({type:Ms})],Us.prototype,"base",void 0);gi([yi({type:Ne.Integer,converter:_e})],Us.prototype,"order",void 0);gi([yi({type:Ne.Integer,optional:true})],Us.prototype,"cofactor",void 0);Us=gi([fi({type:Re.Sequence})],Us);let js=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.ObjectIdentifier})],js.prototype,"namedCurve",void 0);gi([yi({type:Ne.Null})],js.prototype,"implicitCurve",void 0);gi([yi({type:Us})],js.prototype,"specifiedCurve",void 0);js=gi([fi({type:Re.Choice})],js);class _s{constructor(t={}){this.version=1;this.privateKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],_s.prototype,"version",void 0);gi([yi({type:Ke})],_s.prototype,"privateKey",void 0);gi([yi({type:js,context:0,optional:true})],_s.prototype,"parameters",void 0);gi([yi({type:Ne.BitString,context:1,optional:true})],_s.prototype,"publicKey",void 0);class Fs{constructor(t={}){this.r=new ArrayBuffer(0);this.s=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],Fs.prototype,"r",void 0);gi([yi({type:Ne.Integer,converter:_e})],Fs.prototype,"s",void 0);const Vs="1.2.840.113549.1.1";const Ls=`${Vs}.1`;const $s=`${Vs}.7`;const Gs=`${Vs}.9`;const Ws=`${Vs}.10`;const Qs=`${Vs}.2`;const qs=`${Vs}.4`;const zs=`${Vs}.5`;const Js=`${Vs}.12`;const Ys=`${Vs}.13`;const Zs=`${Vs}.15`;const Xs=`${Vs}.16`;const tn="1.3.14.3.2.26";const en="2.16.840.1.101.3.4.2.4";const rn="2.16.840.1.101.3.4.2.1";const sn="2.16.840.1.101.3.4.2.2";const nn="2.16.840.1.101.3.4.2.3";const on="2.16.840.1.101.3.4.2.5";const an="2.16.840.1.101.3.4.2.6";const cn="1.2.840.113549.2.2";const un="1.2.840.113549.2.5";const ln=`${Vs}.8`;function hn(t){return new fs({algorithm:t,parameters:null})}hn(cn);hn(un);const pn=hn(tn);hn(en);hn(rn);hn(sn);hn(nn);hn(on);hn(an);const dn=new fs({algorithm:ln,parameters:Ci.serialize(pn)});const fn=new fs({algorithm:Gs,parameters:Ci.serialize($e.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});hn(Ls);hn(Qs);hn(qs);hn(zs);hn(Zs);hn(Xs);hn(Js);hn(Ys);hn(Zs);hn(Xs);class yn{constructor(t={}){this.hashAlgorithm=new fs(pn);this.maskGenAlgorithm=new fs({algorithm:ln,parameters:Ci.serialize(pn)});this.pSourceAlgorithm=new fs(fn);Object.assign(this,t)}}gi([yi({type:fs,context:0,defaultValue:pn})],yn.prototype,"hashAlgorithm",void 0);gi([yi({type:fs,context:1,defaultValue:dn})],yn.prototype,"maskGenAlgorithm",void 0);gi([yi({type:fs,context:2,defaultValue:fn})],yn.prototype,"pSourceAlgorithm",void 0);new fs({algorithm:$s,parameters:Ci.serialize(new yn)});class Sn{constructor(t={}){this.hashAlgorithm=new fs(pn);this.maskGenAlgorithm=new fs({algorithm:ln,parameters:Ci.serialize(pn)});this.saltLength=20;this.trailerField=1;Object.assign(this,t)}}gi([yi({type:fs,context:0,defaultValue:pn})],Sn.prototype,"hashAlgorithm",void 0);gi([yi({type:fs,context:1,defaultValue:dn})],Sn.prototype,"maskGenAlgorithm",void 0);gi([yi({type:Ne.Integer,context:2,defaultValue:20})],Sn.prototype,"saltLength",void 0);gi([yi({type:Ne.Integer,context:3,defaultValue:1})],Sn.prototype,"trailerField",void 0);new fs({algorithm:Ws,parameters:Ci.serialize(new Sn)});class An{constructor(t={}){this.digestAlgorithm=new fs;this.digest=new Ke;Object.assign(this,t)}}gi([yi({type:fs})],An.prototype,"digestAlgorithm",void 0);gi([yi({type:Ke})],An.prototype,"digest",void 0);var vn;class mn{constructor(t={}){this.prime=new ArrayBuffer(0);this.exponent=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],mn.prototype,"prime",void 0);gi([yi({type:Ne.Integer,converter:_e})],mn.prototype,"exponent",void 0);gi([yi({type:Ne.Integer,converter:_e})],mn.prototype,"coefficient",void 0);let Cn=vn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,vn.prototype)}};Cn=vn=gi([fi({type:Re.Sequence,itemType:mn})],Cn);class gn{constructor(t={}){this.version=0;this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);this.privateExponent=new ArrayBuffer(0);this.prime1=new ArrayBuffer(0);this.prime2=new ArrayBuffer(0);this.exponent1=new ArrayBuffer(0);this.exponent2=new ArrayBuffer(0);this.coefficient=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer})],gn.prototype,"version",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"modulus",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"publicExponent",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"privateExponent",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"prime1",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"prime2",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"exponent1",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"exponent2",void 0);gi([yi({type:Ne.Integer,converter:_e})],gn.prototype,"coefficient",void 0);gi([yi({type:Cn,optional:true})],gn.prototype,"otherPrimeInfos",void 0);class wn{constructor(t={}){this.modulus=new ArrayBuffer(0);this.publicExponent=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer,converter:_e})],wn.prototype,"modulus",void 0);gi([yi({type:Ne.Integer,converter:_e})],wn.prototype,"publicExponent",void 0);var En,bn;const Pn="1.3.6.1.4.1.18227.2.1";let Dn=En=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,En.prototype)}};Dn=En=gi([fi({type:Re.Sequence,itemType:fs})],Dn);let In=bn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,bn.prototype)}};In=bn=gi([fi({type:Re.Sequence,itemType:Ne.BitString})],In);class Bn extends Ke{}let xn=class t{constructor(t={}){this.encryptionAlgorithm=new fs;this.encryptedData=new Bn;Object.assign(this,t)}};gi([yi({type:fs})],xn.prototype,"encryptionAlgorithm",void 0);gi([yi({type:Bn})],xn.prototype,"encryptedData",void 0);var Tn;var On;(function(t){t[t["v1"]=0]="v1"})(On||(On={}));class kn extends Ke{}let Rn=Tn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Tn.prototype)}};Rn=Tn=gi([fi({type:Re.Sequence,itemType:Xr})],Rn);let Nn=class t{constructor(t={}){this.version=On.v1;this.privateKeyAlgorithm=new fs;this.privateKey=new kn;Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Nn.prototype,"version",void 0);gi([yi({type:fs})],Nn.prototype,"privateKeyAlgorithm",void 0);gi([yi({type:kn})],Nn.prototype,"privateKey",void 0);gi([yi({type:Rn,implicit:true,context:0,optional:true})],Nn.prototype,"attributes",void 0);var Mn;var Kn;(function(t){t[t["v1"]=0]="v1";t[t["v2"]=1]="v2"})(Kn||(Kn={}));let Hn=class t extends fs{};Hn=gi([fi({type:Re.Sequence})],Hn);let Un=class t{constructor(){this.version=Kn.v1;this.privateKeyAlgorithm=new fs;this.privateKey=new ArrayBuffer(0)}};gi([yi({type:Ne.Integer})],Un.prototype,"version",void 0);gi([yi({type:fs})],Un.prototype,"privateKeyAlgorithm",void 0);gi([yi({type:Ne.OctetString})],Un.prototype,"privateKey",void 0);gi([yi({type:Rn,context:0,implicit:true,optional:true})],Un.prototype,"attributes",void 0);gi([yi({type:Ne.BitString,context:1,implicit:true,optional:true})],Un.prototype,"publicKey",void 0);Un=gi([fi({type:Re.Sequence})],Un);let jn=class t extends Un{};jn=gi([fi({type:Re.Sequence})],jn);let _n=Mn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Mn.prototype)}};_n=Mn=gi([fi({type:Re.Sequence,itemType:Un})],_n);var Fn,Vn;const Ln="2.16.840.1.114027.80.4.1";let $n=class t extends fs{};$n=gi([fi({type:Re.Sequence})],$n);let Gn=Fn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Fn.prototype)}};Gn=Fn=gi([fi({type:Re.Sequence,itemType:ys})],Gn);let Wn=Vn=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Vn.prototype)}};Wn=Vn=gi([fi({type:Re.Sequence,itemType:Un})],Wn);var Qn={exports:{}};var qn=Qn.exports;var zn;function Jn(){if(zn)return Qn.exports;zn=1;(function(t,e){!function(e,i){t.exports=i()}(qn,(function(){var t=1e3,e=6e4,i=36e5,r="millisecond",s="second",n="minute",o="hour",a="day",c="week",u="month",l="quarter",h="year",p="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},A=function(t,e,i){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(i)+t},v={s:A,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),r=Math.floor(i/60),s=i%60;return(e<=0?"+":"-")+A(r,2,"0")+":"+A(s,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var r=12*(i.year()-e.year())+(i.month()-e.month()),s=e.clone().add(r,u),n=i-s<0,o=e.clone().add(r+(n?-1:1),u);return+(-(r+(i-s)/(n?s-o:o-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:h,w:c,d:a,D:p,h:o,m:n,s,ms:r,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",C={};C[m]=S;var g="$isDayjsObject",w=function(t){return t instanceof D||!(!t||!t[g])},E=function t(e,i,r){var s;if(!e)return m;if("string"==typeof e){var n=e.toLowerCase();C[n]&&(s=n),i&&(C[n]=i,s=n);var o=e.split("-");if(!s&&o.length>1)return t(o[0])}else{var a=e.name;C[a]=e,s=a}return!r&&s&&(m=s),s||!r&&m},b=function(t,e){if(w(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new D(i)},P=v;P.l=E,P.i=w,P.w=function(t,e){return b(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var D=function(){function S(t){this.$L=E(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[g]=true}var A=S.prototype;return A.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(P.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(f);if(r){var s=r[2]-1||0,n=(r[7]||"0").substring(0,3);return i?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,n)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,n)}}return new Date(e)}(t),this.init()},A.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return!(this.$d.toString()===d)},A.isSame=function(t,e){var i=b(t);return this.startOf(e)<=i&&i<=this.endOf(e)},A.isAfter=function(t,e){return b(t)<this.startOf(e)},A.isBefore=function(t,e){return this.endOf(e)<b(t)},A.$g=function(t,e,i){return P.u(t)?this[e]:this.set(i,t)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(t,e){var i=this,r=!!P.u(e)||e,l=P.p(t),d=function(t,e){var s=P.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return r?s:s.endOf(a)},f=function(t,e){return P.w(i.toDate()[t].apply(i.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},y=this.$W,S=this.$M,A=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case h:return r?d(1,0):d(31,11);case u:return r?d(1,S):d(0,S+1);case c:var m=this.$locale().weekStart||0,C=(y<m?y+7:y)-m;return d(r?A-C:A+(6-C),S);case a:case p:return f(v+"Hours",0);case o:return f(v+"Minutes",1);case n:return f(v+"Seconds",2);case s:return f(v+"Milliseconds",3);default:return this.clone()}},A.endOf=function(t){return this.startOf(t,false)},A.$set=function(t,e){var i,c=P.p(t),l="set"+(this.$u?"UTC":""),d=(i={},i[a]=l+"Date",i[p]=l+"Date",i[u]=l+"Month",i[h]=l+"FullYear",i[o]=l+"Hours",i[n]=l+"Minutes",i[s]=l+"Seconds",i[r]=l+"Milliseconds",i)[c],f=c===a?this.$D+(e-this.$W):e;if(c===u||c===h){var y=this.clone().set(p,1);y.$d[d](f),y.init(),this.$d=y.set(p,Math.min(this.$D,y.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},A.set=function(t,e){return this.clone().$set(t,e)},A.get=function(t){return this[P.p(t)]()},A.add=function(r,l){var p,d=this;r=Number(r);var f=P.p(l),y=function(t){var e=b(d);return P.w(e.date(e.date()+Math.round(t*r)),d)};if(f===u)return this.set(u,this.$M+r);if(f===h)return this.set(h,this.$y+r);if(f===a)return y(1);if(f===c)return y(7);var S=(p={},p[n]=e,p[o]=i,p[s]=t,p)[f]||1,A=this.$d.getTime()+r*S;return P.w(A,this)},A.subtract=function(t,e){return this.add(-1*t,e)},A.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var r=t||"YYYY-MM-DDTHH:mm:ssZ",s=P.z(this),n=this.$H,o=this.$m,a=this.$M,c=i.weekdays,u=i.months,l=i.meridiem,h=function(t,i,s,n){return t&&(t[i]||t(e,r))||s[i].slice(0,n)},p=function(t){return P.s(n%12||12,t,"0")},f=l||function(t,e,i){var r=t<12?"AM":"PM";return i?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return P.s(e.$y,4,"0");case"M":return a+1;case"MM":return P.s(a+1,2,"0");case"MMM":return h(i.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return e.$D;case"DD":return P.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(i.weekdaysMin,e.$W,c,2);case"ddd":return h(i.weekdaysShort,e.$W,c,3);case"dddd":return c[e.$W];case"H":return String(n);case"HH":return P.s(n,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(n,o,true);case"A":return f(n,o,false);case"m":return String(o);case"mm":return P.s(o,2,"0");case"s":return String(e.$s);case"ss":return P.s(e.$s,2,"0");case"SSS":return P.s(e.$ms,3,"0");case"Z":return s}return null}(t)||s.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(r,p,d){var f,y=this,S=P.p(p),A=b(r),v=(A.utcOffset()-this.utcOffset())*e,m=this-A,C=function(){return P.m(y,A)};switch(S){case h:f=C()/12;break;case u:f=C();break;case l:f=C()/3;break;case c:f=(m-v)/6048e5;break;case a:f=(m-v)/864e5;break;case o:f=m/i;break;case n:f=m/e;break;case s:f=m/t;break;default:f=m}return d?f:P.a(f)},A.daysInMonth=function(){return this.endOf(u).$D},A.$locale=function(){return C[this.$L]},A.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),r=E(t,e,true);return r&&(i.$L=r),i},A.clone=function(){return P.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},S}(),I=D.prototype;return b.prototype=I,[["$ms",r],["$s",s],["$m",n],["$H",o],["$W",a],["$M",u],["$y",h],["$D",p]].forEach((function(t){I[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),b.extend=function(t,e){return t.$i||(t(e,D,b),t.$i=true),b},b.locale=E,b.isDayjs=w,b.unix=function(t){return b(1e3*t)},b.en=C[m],b.Ls=C,b.p={},b}))})(Qn);return Qn.exports}var Yn=Jn();var Zn=e(Yn);var Xn={exports:{}};var to=Xn.exports;var eo;function io(){if(eo)return Xn.exports;eo=1;(function(t,e){!function(e,i){t.exports=i()}(to,(function(){return function(t,e,i){t=t||{};var r=e.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function n(t,e,i,s){return r.fromToBase(t,e,i,s)}i.en.relativeTime=s,r.fromToBase=function(e,r,n,o,a){for(var c,u,l,h=n.$locale().relativeTime||s,p=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],d=p.length,f=0;f<d;f+=1){var y=p[f];y.d&&(c=o?i(e).diff(n,y.d,true):n.diff(e,y.d,true));var S=(t.rounding||Math.round)(Math.abs(c));if(l=c>0,S<=y.r||!y.r){S<=1&&f>0&&(y=p[f-1]);var A=h[y.l];a&&(S=a(""+S)),u="string"==typeof A?A.replace("%d",S):A(S,r,y.l,l);break}}if(r)return u;var v=l?h.future:h.past;return"function"==typeof v?v(u):v.replace("%s",u)},r.to=function(t,e){return n(t,e,this,true)},r.from=function(t,e){return n(t,e,this)};var o=function(t){return t.$u?i.utc():i()};r.toNow=function(t){return this.to(o(this),t)},r.fromNow=function(t){return this.from(o(this),t)}}}))})(Xn);return Xn.exports}var ro=io();var so=e(ro);
79
79
  /**
80
80
  * @license
81
81
  * Copyright (c) Peculiar Ventures, LLC.
82
82
  *
83
83
  * This source code is licensed under the MIT license found in the
84
84
  * LICENSE file in the root directory of this source tree.
85
- */Zn.extend(so);const no=t=>new Date(t).toUTCString();const oo=(t,e)=>{if(!t||!e){return""}const i=Zn(t);const r=Zn(e);return i.to(r,true)};const ao="Basic Information";const co="Subject Name";const uo="Issuer Name";const lo="Public Key Info";const ho="Signature";const po="Extensions";const fo="Miscellaneous";const yo="Download";const So="Serial Number";const Ao="Version";const vo="Validity";const mo="Issued";const Co="Expired";const go="Last Update";const wo="Next Update";const Eo="Algorithm";const bo="Named Curve";const Po="Exponent";const Do="Modulus";const Io="Value";const Bo="Valid";const xo="Revoked";const To="Issuer";const Oo="Name";const ko="Public Key";const Ro="Fingerprint";const No="Fingerprints";const Mo="Test URLs";const Ko="Certificate Details";const Ho="Holder";const Uo="Digest Info";const jo="Type";const _o="Revoked Certificates";const Fo="Revocation Date";const Vo="Yes";const Lo="No";const $o="Only User Certificates";const Go="Only Attribute Certificates";const Wo="Only CA Certificates";const Qo="Indirect CRL";const qo="Only Reasons";const zo="CRL Entry Extensions";const Jo="Preview certificate";const Yo="View details";const Zo="Download options";const Xo="Key ID";const ta="Principals";const ea="Critical Options";const ia="Signing CA";var ra={basicInformation:ao,subjectName:co,issuerName:uo,publicKeyInfo:lo,signature:ho,extensions:po,miscellaneous:fo,download:yo,"download.pem":"Download PEM","download.der":"Download DER","download.ssh":"Download SSH",serialNumber:So,version:Ao,validity:vo,issued:mo,expired:Co,lastUpdate:go,nextUpdate:wo,algorithm:Eo,namedCurve:bo,exponent:Po,modulus:Do,value:Io,valid:Bo,revoked:xo,issuer:To,name:Oo,publicKey:ko,fingerprint:Ro,fingerprints:No,testURLs:Mo,certificateDetails:Ko,holder:Ho,digestInfo:Uo,type:jo,revokedCertificates:_o,revocationDate:Fo,yes:Vo,no:Lo,onlyUserCertificates:$o,onlyAttributeCertificates:Go,onlyCACertificates:Wo,indirectCRL:Qo,onlyReasons:qo,crlEntryExtensions:zo,previewCertificate:Jo,viewDetails:Yo,downloadOptions:Zo,keyId:Xo,principals:ta,criticalOptions:ea,signingCA:ia};
85
+ */Zn.extend(so);const no=t=>new Date(t).toUTCString();const oo=(t,e)=>{if(!t||!e){return""}const i=Zn(t);const r=Zn(e);return i.to(r,true)};const ao="Basic Information";const co="Subject Name";const uo="Issuer Name";const lo="Public Key Info";const ho="Signature";const po="Extensions";const fo="Miscellaneous";const yo="Download";const So="Serial Number";const Ao="Version";const vo="Validity";const mo="Issued";const Co="Expired";const go="Last Update";const wo="Next Update";const Eo="Algorithm";const bo="Named Curve";const Po="Exponent";const Do="Modulus";const Io="Value";const Bo="Valid";const xo="Revoked";const To="Issuer";const Oo="Name";const ko="Public Key";const Ro="Fingerprint";const No="Fingerprints";const Mo="Test URLs";const Ko="Certificate Details";const Ho="Holder";const Uo="Digest Info";const jo="Type";const _o="Revoked Certificates";const Fo="Revocation Date";const Vo="Yes";const Lo="No";const $o="Only User Certificates";const Go="Only Attribute Certificates";const Wo="Only CA Certificates";const Qo="Indirect CRL";const qo="Only Reasons";const zo="CRL Entry Extensions";const Jo="Preview certificate";const Yo="View details";const Zo="Download options";const Xo="Key ID";const ta="Principals";const ea="Critical Options";const ia="Signing CA";var ra={basicInformation:ao,subjectName:co,issuerName:uo,publicKeyInfo:lo,signature:ho,extensions:po,miscellaneous:fo,download:yo,"download.pem":"Download PEM","download.der":"Download DER",serialNumber:So,version:Ao,validity:vo,issued:mo,expired:Co,lastUpdate:go,nextUpdate:wo,algorithm:Eo,namedCurve:bo,exponent:Po,modulus:Do,value:Io,valid:Bo,revoked:xo,issuer:To,name:Oo,publicKey:ko,fingerprint:Ro,fingerprints:No,testURLs:Mo,certificateDetails:Ko,holder:Ho,digestInfo:Uo,type:jo,revokedCertificates:_o,revocationDate:Fo,yes:Vo,no:Lo,onlyUserCertificates:$o,onlyAttributeCertificates:Go,onlyCACertificates:Wo,indirectCRL:Qo,onlyReasons:qo,crlEntryExtensions:zo,previewCertificate:Jo,viewDetails:Yo,downloadOptions:Zo,keyId:Xo,principals:ta,criticalOptions:ea,signingCA:ia};
86
86
  /**
87
87
  * @license
88
88
  * Copyright (c) Peculiar Ventures, LLC.
@@ -103,7 +103,7 @@ function t(t,e,i,r="application/octet-stream"){const s=new Blob([t],{type:r});if
103
103
  *
104
104
  * This source code is licensed under the MIT license found in the
105
105
  * LICENSE file in the root directory of this source tree.
106
- */var ua=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var la=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var ha;class pa{constructor(t){ha.set(this,new Oi);if(n.BufferSourceConverter.isBufferSource(t)){ua(this,ha,Ai.parse(t,Oi),"f")}else{ua(this,ha,t,"f")}}toJSON(){const t=[];la(this,ha,"f").forEach((e=>e.forEach((e=>{t.push({type:e.type,name:ca[e.type],shortName:aa[e.type],value:e.value.toString()})}))));return t}}ha=new WeakMap;var da;const fa=`${Hi}.2`;var ya;(function(t){t[t["picture"]=0]="picture";t[t["handwrittenSignature"]=1]="handwrittenSignature"})(ya||(ya={}));let Sa=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Sa.prototype,"predefinedBiometricType",void 0);gi([yi({type:Ne.ObjectIdentifier})],Sa.prototype,"biometricDataOid",void 0);Sa=gi([fi({type:Re.Choice})],Sa);class Aa{constructor(t={}){this.typeOfBiometricData=new Sa;this.hashAlgorithm=new fs;this.biometricDataHash=new Ke;Object.assign(this,t)}}gi([yi({type:Sa})],Aa.prototype,"typeOfBiometricData",void 0);gi([yi({type:fs})],Aa.prototype,"hashAlgorithm",void 0);gi([yi({type:Ke})],Aa.prototype,"biometricDataHash",void 0);gi([yi({type:Ne.IA5String,optional:true})],Aa.prototype,"sourceDataUri",void 0);let va=da=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,da.prototype)}};va=da=gi([fi({type:Re.Sequence,itemType:Aa})],va);const ma=`${Ki}.11`;var Ca,ga;const wa=`${Hi}.3`;class Ea{constructor(){this.statementId="";this.statementInfo=new ArrayBuffer(0)}}gi([yi({type:Ne.ObjectIdentifier})],Ea.prototype,"statementId",void 0);gi([yi({type:Ne.Any,optional:true})],Ea.prototype,"statementInfo",void 0);const ba=`${ma}.2`;let Pa=Ca=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ca.prototype)}};Pa=Ca=gi([fi({type:Re.Sequence,itemType:Mi})],Pa);class Da{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier,optional:true})],Da.prototype,"semanticsIdentifier",void 0);gi([yi({type:Pa,optional:true})],Da.prototype,"nameRegistrationAuthorities",void 0);let Ia=ga=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ga.prototype)}};Ia=ga=gi([fi({type:Re.Sequence,itemType:Ea})],Ia);let Ba=class t extends Di{};Ba=gi([fi({type:Re.Choice})],Ba);var xa;(function(t){t["M"]="M";t["F"]="F";t["m"]="m";t["f"]="f"})(xa||(xa={}));var Ta;let Oa=Ta=class t extends ar{constructor(t){super(t);Object.setPrototypeOf(this,Ta.prototype)}};Oa=Ta=gi([fi({type:Re.Sequence})],Oa);const ka="1.3.6.1.4.1.311.21.7";class Ra{constructor(t={}){this.templateID="";this.templateMajorVersion=0;this.templateMinorVersion=0;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Ra.prototype,"templateID",void 0);gi([yi({type:Ne.Integer})],Ra.prototype,"templateMajorVersion",void 0);gi([yi({type:Ne.Integer})],Ra.prototype,"templateMinorVersion",void 0);const Na="1.3.6.1.4.1.311.20.2";class Ma{constructor(t={}){this.name="";Object.assign(this,t)}}gi([yi({type:Ne.Utf8String})],Ma.prototype,"name",void 0);let Ka=class t{constructor(t={}){Object.assign(this,t)}toString(){var t,e;return((t=this.name)===null||t===void 0?void 0:t.toString())||((e=this.spec)===null||e===void 0?void 0:e.name)||""}};gi([yi({type:Di})],Ka.prototype,"name",void 0);gi([yi({type:Ma})],Ka.prototype,"spec",void 0);Ka=gi([fi({type:Re.Choice})],Ka);const Ha="1.3.6.1.4.1.311.21.1";let Ua=class t{constructor(){this.value=new ArrayBuffer(0)}toString(){const t=this.getVersion();return`V${t.certificateIndex}.${t.keyIndex}`}getVersion(){let t=new Uint8Array(this.value);if(this.value.byteLength<4){t=new Uint8Array(4);t.set(new Uint8Array(this.value),4-this.value.byteLength)}return{keyIndex:parseInt(n.Convert.ToHex(t.slice(0,2)),16),certificateIndex:parseInt(n.Convert.ToHex(t.slice(2)),16)}}};gi([yi({type:Ne.Integer,converter:_e})],Ua.prototype,"value",void 0);Ua=gi([fi({type:Re.Choice})],Ua);let ja=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.NumericString})],ja.prototype,"numericString",void 0);gi([yi({type:Ne.PrintableString})],ja.prototype,"printableString",void 0);gi([yi({type:Ne.TeletexString})],ja.prototype,"teletexString",void 0);gi([yi({type:Ne.VideotexString})],ja.prototype,"videotexString",void 0);gi([yi({type:Ne.IA5String})],ja.prototype,"ia5String",void 0);gi([yi({type:Ne.GraphicString})],ja.prototype,"graphicString",void 0);gi([yi({type:Ne.VisibleString})],ja.prototype,"visibleString",void 0);gi([yi({type:Ne.GeneralString})],ja.prototype,"generalString",void 0);gi([yi({type:Ne.UniversalString})],ja.prototype,"universalString",void 0);gi([yi({type:Ne.BmpString})],ja.prototype,"bmpString",void 0);ja=gi([fi({type:Re.Choice})],ja);let _a=class t{constructor(t=new ArrayBuffer(0)){this.value=t}};gi([yi({type:Ne.Any})],_a.prototype,"value",void 0);_a=gi([fi({type:Re.Choice})],_a);var Fa;let Va=Fa=class t extends Cs{constructor(t){super(t);Object.setPrototypeOf(this,Fa.prototype)}};Va=Fa=gi([fi({type:Re.Sequence})],Va);class La{constructor(t={}){this.keySpec=0;this.cspName="";this.signature=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer})],La.prototype,"keySpec",void 0);gi([yi({type:Ne.BmpString})],La.prototype,"cspName",void 0);gi([yi({type:Ne.BitString})],La.prototype,"signature",void 0);var $a;let Ga=$a=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,$a.prototype)}};Ga=$a=gi([fi({type:Re.Sequence,itemType:Ne.Any})],Ga);var Wa;let Qa=Wa=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wa.prototype)}};Qa=Wa=gi([fi({type:Re.Sequence,itemType:Ne.Any})],Qa);var qa;class za{constructor(t={}){this.name="";this.value="";Object.assign(this,t)}}gi([yi({type:Ne.BmpString})],za.prototype,"name",void 0);gi([yi({type:Ne.BmpString})],za.prototype,"value",void 0);let Ja=qa=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,qa.prototype)}};Ja=qa=gi([fi({type:Re.Sequence,itemType:za})],Ja);let Ya=class t extends Ri{};Ya=gi([fi({type:Re.Sequence})],Ya);let Za=class t extends Ri{};Za=gi([fi({type:Re.Sequence})],Za);let Xa=class t extends Es{};Xa=gi([fi({type:Re.Sequence})],Xa);class tc{constructor(t={}){this.clientId=0;this.machineName="";this.userName="";this.processName="";Object.assign(this,t)}}gi([yi({type:Ne.Integer})],tc.prototype,"clientId",void 0);gi([yi({type:Ne.Utf8String})],tc.prototype,"machineName",void 0);gi([yi({type:Ne.Utf8String})],tc.prototype,"userName",void 0);gi([yi({type:Ne.Utf8String})],tc.prototype,"processName",void 0);const ec="2.16.840.1.113730";const ic=`${ec}.1`;let rc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],rc.prototype,"value",void 0);rc=gi([fi({type:Re.Choice})],rc);let sc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],sc.prototype,"value",void 0);sc=gi([fi({type:Re.Choice})],sc);let nc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],nc.prototype,"value",void 0);nc=gi([fi({type:Re.Choice})],nc);let oc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],oc.prototype,"value",void 0);oc=gi([fi({type:Re.Choice})],oc);const ac=`${ic}.1`;var cc;(function(t){t[t["sslClient"]=1]="sslClient";t[t["sslServer"]=2]="sslServer";t[t["sMime"]=4]="sMime";t[t["objectSigning"]=8]="objectSigning";t[t["sslCa"]=32]="sslCa";t[t["sMimeCa"]=64]="sMimeCa";t[t["objectSigningCa"]=128]="objectSigningCa"})(cc||(cc={}));class uc extends Me{toJSON(){const t=this.toNumber();const e=[];if(t&cc.objectSigning){e.push("objectSigning")}if(t&cc.objectSigningCa){e.push("objectSigningCa")}if(t&cc.sMime){e.push("sMime")}if(t&cc.sMimeCa){e.push("sMimeCa")}if(t&cc.sslCa){e.push("sslCa")}if(t&cc.sslClient){e.push("sslClient")}if(t&cc.sslServer){e.push("sslServer")}return e}toString(){return`[${this.toJSON().join(", ")}]`}}const lc=`${ic}.13`;let hc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],hc.prototype,"value",void 0);hc=gi([fi({type:Re.Choice})],hc);let pc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],pc.prototype,"value",void 0);pc=gi([fi({type:Re.Choice})],pc);let dc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],dc.prototype,"value",void 0);dc=gi([fi({type:Re.Choice})],dc);const fc="1.3.6.1.4.1.52266.1";let yc=class t{constructor(t={}){this.leiCode="";Object.assign(this,t)}};gi([yi({type:Yt})],yc.prototype,"leiCode",void 0);gi([yi({type:Yt,context:0,optional:true})],yc.prototype,"leiRole",void 0);yc=gi([fi({type:Re.Sequence})],yc);let Sc=class t{get text(){if(this.bmpString!==undefined){return this.bmpString}if(this.ia5String!==undefined){return this.ia5String}if(this.printableString!==undefined){return this.printableString}if(this.utf8String!==undefined){return this.utf8String}if(this.visibleString!==undefined){return this.visibleString}return undefined}set text(t){this.printableString=t}constructor(t){if(t){this.text=t}}};gi([yi({type:Ne.IA5String})],Sc.prototype,"ia5String",void 0);gi([yi({type:Ne.VisibleString})],Sc.prototype,"visibleString",void 0);gi([yi({type:Ne.BmpString})],Sc.prototype,"bmpString",void 0);gi([yi({type:Ne.Utf8String})],Sc.prototype,"utf8String",void 0);gi([yi({type:Ne.PrintableString})],Sc.prototype,"printableString",void 0);Sc=gi([fi({type:Re.Choice})],Sc);let Ac=class t extends Sc{constructor(t){super();if(typeof t==="string"){this.text=t}else if(t instanceof yc){this.struct=t}}};gi([yi({type:yc})],Ac.prototype,"struct",void 0);Ac=gi([fi({type:Re.Choice})],Ac);const vc="1.3.6.1.4.1.52266.2";let mc=class t extends Sc{};mc=gi([fi({type:Re.Choice})],mc);class Cc{get position(){return this.offset}constructor(t){this.offset=0;this.view=n.BufferSourceConverter.toUint8Array(t)}read(t=1){const e=this.view.slice(this.offset,this.offset+t);this.offset=this.offset+e.length;return e}readByte(){const t=this.read();if(!t.length){throw new Error("End of stream")}return t[0]}readNumber(t){const e=this.read(t);const i=n.Convert.ToHex(e);return parseInt(i,16)}readEnd(){return this.read(this.view.length-this.offset)}reset(){this.offset=0}}class gc{static createStream(t){const e=n.BufferSourceConverter.toUint8Array(t);return new Cc(e)}}var wc;(function(t){t[t["certificateTimestamp"]=0]="certificateTimestamp";t[t["treeHash"]=1]="treeHash"})(wc||(wc={}));var Ec;(function(t){t[t["none"]=0]="none";t[t["md5"]=1]="md5";t[t["sha1"]=2]="sha1";t[t["sha224"]=3]="sha224";t[t["sha256"]=4]="sha256";t[t["sha384"]=5]="sha384";t[t["sha512"]=6]="sha512"})(Ec||(Ec={}));var bc;(function(t){t[t["anonymous"]=0]="anonymous";t[t["rsa"]=1]="rsa";t[t["dsa"]=2]="dsa";t[t["ecdsa"]=3]="ecdsa"})(bc||(bc={}));class Pc extends gc{constructor(t){super();this.version=0;this.logId=new ArrayBuffer(32);this.timestamp=new Date;this.extensions=new ArrayBuffer(0);this.hashAlgorithm=0;this.signatureAlgorithm=0;this.signature=new ArrayBuffer(0);if(t){this.parse(t)}}parse(t){this.version=t.readByte();t.read(2);this.logId=n.BufferSourceConverter.toArrayBuffer(t.read(32));this.timestamp=new Date(t.readNumber(8));const e=t.readNumber(2);this.extensions=t.read(e).buffer;this.hashAlgorithm=t.readByte();this.signatureAlgorithm=t.readByte();this.signature=t.read(t.readNumber(2)).buffer}toJSON(){return{version:this.version,logId:n.Convert.ToHex(this.logId),timestamp:this.timestamp,extensions:n.Convert.ToBase64(this.extensions),hashAlgorithm:Ec[this.hashAlgorithm]||"undefined",signatureAlgorithm:bc[this.signatureAlgorithm]||"undefined",signature:n.Convert.ToBase64(this.signature)}}}var Dc;(function(t){t[t["v1"]=1]="v1"})(Dc||(Dc={}));const Ic="1.2.840.113583.1.1.9.2";class Bc{constructor(t={}){this.version=Dc.v1;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Bc.prototype,"version",void 0);const xc="1.2.840.113583.1.1.9.1";class Tc{constructor(t={}){this.version=Dc.v1;this.location=new Mi;this.requiresAuth=false;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Tc.prototype,"version",void 0);gi([yi({type:Mi})],Tc.prototype,"location",void 0);gi([yi({type:Ne.Boolean,defaultValue:false,optional:true})],Tc.prototype,"requiresAuth",void 0);class Oc{constructor(t={}){this.hashAlg=new fs;this.hashValue=new Ke;Object.assign(this,t)}}gi([yi({type:fs})],Oc.prototype,"hashAlg",void 0);gi([yi({type:Ke})],Oc.prototype,"hashValue",void 0);class kc{constructor(t={}){this.mediaType="";this.logotypeHash=[];this.logotypeURI=[];Object.assign(this,t)}}gi([yi({type:Ne.IA5String})],kc.prototype,"mediaType",void 0);gi([yi({type:Oc,repeated:"sequence"})],kc.prototype,"logotypeHash",void 0);gi([yi({type:Ne.IA5String,repeated:"sequence"})],kc.prototype,"logotypeURI",void 0);var Rc;(function(t){t[t["mono"]=1]="mono";t[t["stereo"]=2]="stereo";t[t["quad"]=4]="quad"})(Rc||(Rc={}));class Nc{constructor(t={}){this.fileSize=0;this.playTime=0;this.channels=Rc.mono;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Nc.prototype,"fileSize",void 0);gi([yi({type:Ne.Integer})],Nc.prototype,"playTime",void 0);gi([yi({type:Ne.Integer})],Nc.prototype,"channels",void 0);gi([yi({type:Ne.Integer,implicit:true,context:3,optional:true})],Nc.prototype,"sampleRate",void 0);gi([yi({type:Ne.IA5String,implicit:true,context:4,optional:true})],Nc.prototype,"language",void 0);class Mc{constructor(t={}){this.audioDetails=new kc;Object.assign(this,t)}}gi([yi({type:kc})],Mc.prototype,"audioDetails",void 0);gi([yi({type:Nc,optional:true})],Mc.prototype,"audioInfo",void 0);let Kc=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.Integer,context:1,implicit:true})],Kc.prototype,"numBits",void 0);gi([yi({type:Ne.Integer,context:2,implicit:true})],Kc.prototype,"tableSize",void 0);Kc=gi([fi({type:Re.Choice})],Kc);var Hc;(function(t){t[t["grayScale"]=0]="grayScale";t[t["color"]=1]="color"})(Hc||(Hc={}));class Uc{constructor(t={}){this.type=Hc.color;this.fileSize=0;this.xSize=0;this.ySize=0;Object.assign(this,t)}}gi([yi({type:Ne.Integer,context:0,implicit:true,defaultValue:Hc.color})],Uc.prototype,"type",void 0);gi([yi({type:Ne.Integer})],Uc.prototype,"fileSize",void 0);gi([yi({type:Ne.Integer})],Uc.prototype,"xSize",void 0);gi([yi({type:Ne.Integer})],Uc.prototype,"ySize",void 0);gi([yi({type:Kc})],Uc.prototype,"resolution",void 0);gi([yi({type:Ne.IA5String,context:4,implicit:true,optional:true})],Uc.prototype,"language",void 0);class jc{constructor(t={}){this.imageDetails=new kc;Object.assign(this,t)}}gi([yi({type:kc})],jc.prototype,"imageDetails",void 0);gi([yi({type:Uc,optional:true})],jc.prototype,"imageInfo",void 0);class _c{constructor(t={}){Object.assign(this,t)}}gi([yi({type:jc,repeated:"sequence",optional:true})],_c.prototype,"image",void 0);gi([yi({type:Mc,repeated:"sequence",context:1,optional:true})],_c.prototype,"audio",void 0);class Fc{constructor(t={}){this.refStructHash=[];this.refStructURI=[];Object.assign(this,t)}}gi([yi({type:Oc,repeated:"sequence"})],Fc.prototype,"refStructHash",void 0);gi([yi({type:Ne.IA5String,repeated:"sequence"})],Fc.prototype,"refStructURI",void 0);let Vc=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:_c,implicit:true,context:0})],Vc.prototype,"direct",void 0);gi([yi({type:Fc,implicit:true,context:1})],Vc.prototype,"indirect",void 0);Vc=gi([fi({type:Re.Choice})],Vc);class Lc{constructor(t={}){this.logotypeType="";this.info=new Vc;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Lc.prototype,"logotypeType",void 0);gi([yi({type:Vc})],Lc.prototype,"info",void 0);class $c{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Vc,context:0,repeated:"sequence",optional:true})],$c.prototype,"communityLogos",void 0);gi([yi({type:Vc,context:1,optional:true})],$c.prototype,"issuerLogo",void 0);gi([yi({type:Vc,context:2,optional:true})],$c.prototype,"subjectLogo",void 0);gi([yi({type:Lc,context:3,repeated:"sequence",optional:true})],$c.prototype,"otherLogos",void 0);var Gc,Wc,Qc;const qc="1.3.6.1.5.5.7";const zc=`${qc}.1`;let Jc=Gc=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Gc.prototype)}};Jc=Gc=gi([fi({type:Re.Sequence,itemType:Ne.IA5String})],Jc);class Yc{constructor(t={}){this.claim="";this.permitted=[];Object.assign(this,t)}}gi([yi({type:Ne.IA5String})],Yc.prototype,"claim",void 0);gi([yi({type:Ne.Utf8String,repeated:"sequence"})],Yc.prototype,"permitted",void 0);let Zc=Wc=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wc.prototype)}};Zc=Wc=gi([fi({type:Re.Sequence,itemType:Yc})],Zc);class Xc{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Jc,optional:true,context:0})],Xc.prototype,"mustInclude",void 0);gi([yi({type:Zc,optional:true,context:1})],Xc.prototype,"permittedValues",void 0);const tu=`${zc}.26`;class eu{constructor(){this.start="";this.count=2}}gi([yi({type:Ne.IA5String})],eu.prototype,"start",void 0);gi([yi({type:Ne.Integer})],eu.prototype,"count",void 0);let iu=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.IA5String,context:0})],iu.prototype,"spc",void 0);gi([yi({type:eu,context:1})],iu.prototype,"range",void 0);gi([yi({type:Ne.IA5String,context:2})],iu.prototype,"one",void 0);iu=gi([fi({type:Re.Choice})],iu);let ru=Qc=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Qc.prototype)}};ru=Qc=gi([fi({type:Re.Sequence,itemType:iu})],ru);var su;const nu="1.3.6.1.4.1.11129.2.1.17";var ou;(function(t){t[t["verified"]=0]="verified";t[t["selfSigned"]=1]="selfSigned";t[t["unverified"]=2]="unverified";t[t["failed"]=3]="failed"})(ou||(ou={}));class au{constructor(t={}){this.verifiedBootKey=new Ke;this.deviceLocked=false;this.verifiedBootState=ou.verified;Object.assign(this,t)}}gi([yi({type:Ke})],au.prototype,"verifiedBootKey",void 0);gi([yi({type:Ne.Boolean})],au.prototype,"deviceLocked",void 0);gi([yi({type:Ne.Enumerated})],au.prototype,"verifiedBootState",void 0);gi([yi({type:Ke,optional:true})],au.prototype,"verifiedBootHash",void 0);let cu=su=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,su.prototype)}};cu=su=gi([fi({type:Re.Set,itemType:Ne.Integer})],cu);class uu{constructor(t={}){Object.assign(this,t)}}gi([yi({context:1,type:cu,optional:true})],uu.prototype,"purpose",void 0);gi([yi({context:2,type:Ne.Integer,optional:true})],uu.prototype,"algorithm",void 0);gi([yi({context:3,type:Ne.Integer,optional:true})],uu.prototype,"keySize",void 0);gi([yi({context:5,type:cu,optional:true})],uu.prototype,"digest",void 0);gi([yi({context:6,type:cu,optional:true})],uu.prototype,"padding",void 0);gi([yi({context:10,type:Ne.Integer,optional:true})],uu.prototype,"ecCurve",void 0);gi([yi({context:200,type:Ne.Integer,optional:true})],uu.prototype,"rsaPublicExponent",void 0);gi([yi({context:203,type:cu,optional:true})],uu.prototype,"mgfDigest",void 0);gi([yi({context:303,type:Ne.Null,optional:true})],uu.prototype,"rollbackResistance",void 0);gi([yi({context:305,type:Ne.Null,optional:true})],uu.prototype,"earlyBootOnly",void 0);gi([yi({context:400,type:Ne.Integer,optional:true})],uu.prototype,"activeDateTime",void 0);gi([yi({context:401,type:Ne.Integer,optional:true})],uu.prototype,"originationExpireDateTime",void 0);gi([yi({context:402,type:Ne.Integer,optional:true})],uu.prototype,"usageExpireDateTime",void 0);gi([yi({context:405,type:Ne.Integer,optional:true})],uu.prototype,"usageCountLimit",void 0);gi([yi({context:503,type:Ne.Null,optional:true})],uu.prototype,"noAuthRequired",void 0);gi([yi({context:504,type:Ne.Integer,optional:true})],uu.prototype,"userAuthType",void 0);gi([yi({context:505,type:Ne.Integer,optional:true})],uu.prototype,"authTimeout",void 0);gi([yi({context:506,type:Ne.Null,optional:true})],uu.prototype,"allowWhileOnBody",void 0);gi([yi({context:507,type:Ne.Null,optional:true})],uu.prototype,"trustedUserPresenceRequired",void 0);gi([yi({context:508,type:Ne.Null,optional:true})],uu.prototype,"trustedConfirmationRequired",void 0);gi([yi({context:509,type:Ne.Null,optional:true})],uu.prototype,"unlockedDeviceRequired",void 0);gi([yi({context:600,type:Ne.Null,optional:true})],uu.prototype,"allApplications",void 0);gi([yi({context:601,type:Ke,optional:true})],uu.prototype,"applicationId",void 0);gi([yi({context:701,type:Ne.Integer,optional:true})],uu.prototype,"creationDateTime",void 0);gi([yi({context:702,type:Ne.Integer,optional:true})],uu.prototype,"origin",void 0);gi([yi({context:703,type:Ne.Null,optional:true})],uu.prototype,"rollbackResistant",void 0);gi([yi({context:704,type:au,optional:true})],uu.prototype,"rootOfTrust",void 0);gi([yi({context:705,type:Ne.Integer,optional:true})],uu.prototype,"osVersion",void 0);gi([yi({context:706,type:Ne.Integer,optional:true})],uu.prototype,"osPatchLevel",void 0);gi([yi({context:709,type:Ke,optional:true})],uu.prototype,"attestationApplicationId",void 0);gi([yi({context:710,type:Ke,optional:true})],uu.prototype,"attestationIdBrand",void 0);gi([yi({context:711,type:Ke,optional:true})],uu.prototype,"attestationIdDevice",void 0);gi([yi({context:712,type:Ke,optional:true})],uu.prototype,"attestationIdProduct",void 0);gi([yi({context:713,type:Ke,optional:true})],uu.prototype,"attestationIdSerial",void 0);gi([yi({context:714,type:Ke,optional:true})],uu.prototype,"attestationIdImei",void 0);gi([yi({context:715,type:Ke,optional:true})],uu.prototype,"attestationIdMeid",void 0);gi([yi({context:716,type:Ke,optional:true})],uu.prototype,"attestationIdManufacturer",void 0);gi([yi({context:717,type:Ke,optional:true})],uu.prototype,"attestationIdModel",void 0);gi([yi({context:718,type:Ne.Integer,optional:true})],uu.prototype,"vendorPatchLevel",void 0);gi([yi({context:719,type:Ne.Integer,optional:true})],uu.prototype,"bootPatchLevel",void 0);gi([yi({context:720,type:Ne.Null,optional:true})],uu.prototype,"deviceUniqueAttestation",void 0);gi([yi({context:723,type:Ke,optional:true})],uu.prototype,"attestationIdSecondImei",void 0);gi([yi({context:724,type:Ke,optional:true})],uu.prototype,"moduleHash",void 0);var lu;(function(t){t[t["software"]=0]="software";t[t["trustedEnvironment"]=1]="trustedEnvironment";t[t["strongBox"]=2]="strongBox"})(lu||(lu={}));var hu;(function(t){t[t["KM2"]=1]="KM2";t[t["KM3"]=2]="KM3";t[t["KM4"]=3]="KM4";t[t["KM4_1"]=4]="KM4_1";t[t["keyMint1"]=100]="keyMint1";t[t["keyMint2"]=200]="keyMint2";t[t["keyMint3"]=300]="keyMint3";t[t["keyMint4"]=400]="keyMint4"})(hu||(hu={}));class pu{constructor(t={}){this.attestationVersion=hu.KM4;this.attestationSecurityLevel=lu.software;this.keymasterVersion=0;this.keymasterSecurityLevel=lu.software;this.attestationChallenge=new Ke;this.uniqueId=new Ke;this.softwareEnforced=new uu;this.teeEnforced=new uu;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],pu.prototype,"attestationVersion",void 0);gi([yi({type:Ne.Enumerated})],pu.prototype,"attestationSecurityLevel",void 0);gi([yi({type:Ne.Integer})],pu.prototype,"keymasterVersion",void 0);gi([yi({type:Ne.Enumerated})],pu.prototype,"keymasterSecurityLevel",void 0);gi([yi({type:Ke})],pu.prototype,"attestationChallenge",void 0);gi([yi({type:Ke})],pu.prototype,"uniqueId",void 0);gi([yi({type:uu})],pu.prototype,"softwareEnforced",void 0);gi([yi({type:uu})],pu.prototype,"teeEnforced",void 0);class du{constructor(t={}){this.attestationVersion=hu.keyMint4;this.attestationSecurityLevel=lu.software;this.keyMintVersion=0;this.keyMintSecurityLevel=lu.software;this.attestationChallenge=new Ke;this.uniqueId=new Ke;this.softwareEnforced=new uu;this.hardwareEnforced=new uu;Object.assign(this,t)}toLegacyKeyDescription(){return new pu({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})}static fromLegacyKeyDescription(t){return new du({attestationVersion:t.attestationVersion,attestationSecurityLevel:t.attestationSecurityLevel,keyMintVersion:t.keymasterVersion,keyMintSecurityLevel:t.keymasterSecurityLevel,attestationChallenge:t.attestationChallenge,uniqueId:t.uniqueId,softwareEnforced:t.softwareEnforced,hardwareEnforced:t.teeEnforced})}}gi([yi({type:Ne.Integer})],du.prototype,"attestationVersion",void 0);gi([yi({type:Ne.Enumerated})],du.prototype,"attestationSecurityLevel",void 0);gi([yi({type:Ne.Integer})],du.prototype,"keyMintVersion",void 0);gi([yi({type:Ne.Enumerated})],du.prototype,"keyMintSecurityLevel",void 0);gi([yi({type:Ke})],du.prototype,"attestationChallenge",void 0);gi([yi({type:Ke})],du.prototype,"uniqueId",void 0);gi([yi({type:uu})],du.prototype,"softwareEnforced",void 0);gi([yi({type:uu})],du.prototype,"hardwareEnforced",void 0);var fu;let yu=class t extends uu{};yu=gi([fi({type:Re.Choice})],yu);let Su=fu=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,fu.prototype)}findProperty(t){const e=this.find((e=>t in e));if(e){return e[t]}return undefined}};Su=fu=gi([fi({type:Re.Sequence,itemType:yu})],Su);class Au{get keyMintVersion(){return this.keymasterVersion}set keyMintVersion(t){this.keymasterVersion=t}get keyMintSecurityLevel(){return this.keymasterSecurityLevel}set keyMintSecurityLevel(t){this.keymasterSecurityLevel=t}get hardwareEnforced(){return this.teeEnforced}set hardwareEnforced(t){this.teeEnforced=t}constructor(t={}){this.attestationVersion=hu.KM4;this.attestationSecurityLevel=lu.software;this.keymasterVersion=0;this.keymasterSecurityLevel=lu.software;this.attestationChallenge=new Ke;this.uniqueId=new Ke;this.softwareEnforced=new Su;this.teeEnforced=new Su;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Au.prototype,"attestationVersion",void 0);gi([yi({type:Ne.Enumerated})],Au.prototype,"attestationSecurityLevel",void 0);gi([yi({type:Ne.Integer})],Au.prototype,"keymasterVersion",void 0);gi([yi({type:Ne.Enumerated})],Au.prototype,"keymasterSecurityLevel",void 0);gi([yi({type:Ke})],Au.prototype,"attestationChallenge",void 0);gi([yi({type:Ke})],Au.prototype,"uniqueId",void 0);gi([yi({type:Su})],Au.prototype,"softwareEnforced",void 0);gi([yi({type:Su})],Au.prototype,"teeEnforced",void 0);let vu=class t extends Au{constructor(t={}){if("keymasterVersion"in t&&!("keyMintVersion"in t)){t.keyMintVersion=t.keymasterVersion}if("keymasterSecurityLevel"in t&&!("keyMintSecurityLevel"in t)){t.keyMintSecurityLevel=t.keymasterSecurityLevel}if("teeEnforced"in t&&!("hardwareEnforced"in t)){t.hardwareEnforced=t.teeEnforced}super(t)}};vu=gi([fi({type:Re.Sequence})],vu);class mu{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.OctetString})],mu.prototype,"packageName",void 0);gi([yi({type:Ne.Integer})],mu.prototype,"version",void 0);class Cu{constructor(t={}){Object.assign(this,t)}}gi([yi({type:mu,repeated:"set"})],Cu.prototype,"packageInfos",void 0);gi([yi({type:Ne.OctetString,repeated:"set"})],Cu.prototype,"signatureDigests",void 0);var gu=undefined&&undefined.__decorate||function(t,e,i,r){var s=arguments.length,n=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)if(o=t[a])n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n;return s>3&&n&&Object.defineProperty(e,i,n),n};const wu="2.23.140.3.1";class Eu{constructor(t={}){Object.assign(this,t)}}gu([yi({type:Ne.PrintableString})],Eu.prototype,"registrationSchemeIdentifier",void 0);gu([yi({type:Ne.PrintableString})],Eu.prototype,"registrationCountry",void 0);gu([yi({type:Ne.PrintableString,optional:true,context:0,implicit:true})],Eu.prototype,"registrationStateOrProvince",void 0);gu([yi({type:Ne.Utf8String})],Eu.prototype,"registrationReference",void 0);
106
+ */var ua=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var la=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var ha;class pa{constructor(t){ha.set(this,new Oi);if(n.BufferSourceConverter.isBufferSource(t)){ua(this,ha,Ai.parse(t,Oi),"f")}else{ua(this,ha,t,"f")}}toJSON(){const t=[];la(this,ha,"f").forEach((e=>e.forEach((e=>{t.push({type:e.type,name:ca[e.type],shortName:aa[e.type],value:e.value.toString()})}))));return t}}ha=new WeakMap;var da;const fa=`${Hi}.2`;var ya;(function(t){t[t["picture"]=0]="picture";t[t["handwrittenSignature"]=1]="handwrittenSignature"})(ya||(ya={}));let Sa=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Sa.prototype,"predefinedBiometricType",void 0);gi([yi({type:Ne.ObjectIdentifier})],Sa.prototype,"biometricDataOid",void 0);Sa=gi([fi({type:Re.Choice})],Sa);class Aa{constructor(t={}){this.typeOfBiometricData=new Sa;this.hashAlgorithm=new fs;this.biometricDataHash=new Ke;Object.assign(this,t)}}gi([yi({type:Sa})],Aa.prototype,"typeOfBiometricData",void 0);gi([yi({type:fs})],Aa.prototype,"hashAlgorithm",void 0);gi([yi({type:Ke})],Aa.prototype,"biometricDataHash",void 0);gi([yi({type:Ne.IA5String,optional:true})],Aa.prototype,"sourceDataUri",void 0);let va=da=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,da.prototype)}};va=da=gi([fi({type:Re.Sequence,itemType:Aa})],va);const ma=`${Ki}.11`;var Ca,ga;const wa=`${Hi}.3`;class Ea{constructor(){this.statementId=""}}gi([yi({type:Ne.ObjectIdentifier})],Ea.prototype,"statementId",void 0);gi([yi({type:Ne.Any,optional:true})],Ea.prototype,"statementInfo",void 0);const ba=`${ma}.2`;let Pa=Ca=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ca.prototype)}};Pa=Ca=gi([fi({type:Re.Sequence,itemType:Mi})],Pa);class Da{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier,optional:true})],Da.prototype,"semanticsIdentifier",void 0);gi([yi({type:Pa,optional:true})],Da.prototype,"nameRegistrationAuthorities",void 0);let Ia=ga=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ga.prototype)}};Ia=ga=gi([fi({type:Re.Sequence,itemType:Ea})],Ia);let Ba=class t extends Di{};Ba=gi([fi({type:Re.Choice})],Ba);var xa;(function(t){t["M"]="M";t["F"]="F";t["m"]="m";t["f"]="f"})(xa||(xa={}));var Ta;let Oa=Ta=class t extends ar{constructor(t){super(t);Object.setPrototypeOf(this,Ta.prototype)}};Oa=Ta=gi([fi({type:Re.Sequence})],Oa);const ka="1.3.6.1.4.1.311.21.7";class Ra{constructor(t={}){this.templateID="";this.templateMajorVersion=0;this.templateMinorVersion=0;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Ra.prototype,"templateID",void 0);gi([yi({type:Ne.Integer})],Ra.prototype,"templateMajorVersion",void 0);gi([yi({type:Ne.Integer})],Ra.prototype,"templateMinorVersion",void 0);const Na="1.3.6.1.4.1.311.20.2";class Ma{constructor(t={}){this.name="";Object.assign(this,t)}}gi([yi({type:Ne.Utf8String})],Ma.prototype,"name",void 0);let Ka=class t{constructor(t={}){Object.assign(this,t)}toString(){var t,e;return((t=this.name)===null||t===void 0?void 0:t.toString())||((e=this.spec)===null||e===void 0?void 0:e.name)||""}};gi([yi({type:Di})],Ka.prototype,"name",void 0);gi([yi({type:Ma})],Ka.prototype,"spec",void 0);Ka=gi([fi({type:Re.Choice})],Ka);const Ha="1.3.6.1.4.1.311.21.1";let Ua=class t{constructor(){this.value=new ArrayBuffer(0)}toString(){const t=this.getVersion();return`V${t.certificateIndex}.${t.keyIndex}`}getVersion(){let t=new Uint8Array(this.value);if(this.value.byteLength<4){t=new Uint8Array(4);t.set(new Uint8Array(this.value),4-this.value.byteLength)}return{keyIndex:parseInt(n.Convert.ToHex(t.slice(0,2)),16),certificateIndex:parseInt(n.Convert.ToHex(t.slice(2)),16)}}};gi([yi({type:Ne.Integer,converter:_e})],Ua.prototype,"value",void 0);Ua=gi([fi({type:Re.Choice})],Ua);let ja=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.NumericString})],ja.prototype,"numericString",void 0);gi([yi({type:Ne.PrintableString})],ja.prototype,"printableString",void 0);gi([yi({type:Ne.TeletexString})],ja.prototype,"teletexString",void 0);gi([yi({type:Ne.VideotexString})],ja.prototype,"videotexString",void 0);gi([yi({type:Ne.IA5String})],ja.prototype,"ia5String",void 0);gi([yi({type:Ne.GraphicString})],ja.prototype,"graphicString",void 0);gi([yi({type:Ne.VisibleString})],ja.prototype,"visibleString",void 0);gi([yi({type:Ne.GeneralString})],ja.prototype,"generalString",void 0);gi([yi({type:Ne.UniversalString})],ja.prototype,"universalString",void 0);gi([yi({type:Ne.BmpString})],ja.prototype,"bmpString",void 0);ja=gi([fi({type:Re.Choice})],ja);let _a=class t{constructor(t=new ArrayBuffer(0)){this.value=t}};gi([yi({type:Ne.Any})],_a.prototype,"value",void 0);_a=gi([fi({type:Re.Choice})],_a);var Fa;let Va=Fa=class t extends Cs{constructor(t){super(t);Object.setPrototypeOf(this,Fa.prototype)}};Va=Fa=gi([fi({type:Re.Sequence})],Va);class La{constructor(t={}){this.keySpec=0;this.cspName="";this.signature=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Integer})],La.prototype,"keySpec",void 0);gi([yi({type:Ne.BmpString})],La.prototype,"cspName",void 0);gi([yi({type:Ne.BitString})],La.prototype,"signature",void 0);var $a;let Ga=$a=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,$a.prototype)}};Ga=$a=gi([fi({type:Re.Sequence,itemType:Ne.Any})],Ga);var Wa;let Qa=Wa=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wa.prototype)}};Qa=Wa=gi([fi({type:Re.Sequence,itemType:Ne.Any})],Qa);var qa;class za{constructor(t={}){this.name="";this.value="";Object.assign(this,t)}}gi([yi({type:Ne.BmpString})],za.prototype,"name",void 0);gi([yi({type:Ne.BmpString})],za.prototype,"value",void 0);let Ja=qa=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,qa.prototype)}};Ja=qa=gi([fi({type:Re.Sequence,itemType:za})],Ja);let Ya=class t extends Ri{};Ya=gi([fi({type:Re.Sequence})],Ya);let Za=class t extends Ri{};Za=gi([fi({type:Re.Sequence})],Za);let Xa=class t extends Es{};Xa=gi([fi({type:Re.Sequence})],Xa);class tc{constructor(t={}){this.clientId=0;this.machineName="";this.userName="";this.processName="";Object.assign(this,t)}}gi([yi({type:Ne.Integer})],tc.prototype,"clientId",void 0);gi([yi({type:Ne.Utf8String})],tc.prototype,"machineName",void 0);gi([yi({type:Ne.Utf8String})],tc.prototype,"userName",void 0);gi([yi({type:Ne.Utf8String})],tc.prototype,"processName",void 0);const ec="2.16.840.1.113730";const ic=`${ec}.1`;let rc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],rc.prototype,"value",void 0);rc=gi([fi({type:Re.Choice})],rc);let sc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],sc.prototype,"value",void 0);sc=gi([fi({type:Re.Choice})],sc);let nc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],nc.prototype,"value",void 0);nc=gi([fi({type:Re.Choice})],nc);let oc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],oc.prototype,"value",void 0);oc=gi([fi({type:Re.Choice})],oc);const ac=`${ic}.1`;var cc;(function(t){t[t["sslClient"]=1]="sslClient";t[t["sslServer"]=2]="sslServer";t[t["sMime"]=4]="sMime";t[t["objectSigning"]=8]="objectSigning";t[t["sslCa"]=32]="sslCa";t[t["sMimeCa"]=64]="sMimeCa";t[t["objectSigningCa"]=128]="objectSigningCa"})(cc||(cc={}));class uc extends Me{toJSON(){const t=this.toNumber();const e=[];if(t&cc.objectSigning){e.push("objectSigning")}if(t&cc.objectSigningCa){e.push("objectSigningCa")}if(t&cc.sMime){e.push("sMime")}if(t&cc.sMimeCa){e.push("sMimeCa")}if(t&cc.sslCa){e.push("sslCa")}if(t&cc.sslClient){e.push("sslClient")}if(t&cc.sslServer){e.push("sslServer")}return e}toString(){return`[${this.toJSON().join(", ")}]`}}const lc=`${ic}.13`;let hc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],hc.prototype,"value",void 0);hc=gi([fi({type:Re.Choice})],hc);let pc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],pc.prototype,"value",void 0);pc=gi([fi({type:Re.Choice})],pc);let dc=class t{constructor(t){this.value="";if(t){this.value=t}}};gi([yi({type:Ne.IA5String})],dc.prototype,"value",void 0);dc=gi([fi({type:Re.Choice})],dc);const fc="1.3.6.1.4.1.52266.1";let yc=class t{constructor(t={}){this.leiCode="";Object.assign(this,t)}};gi([yi({type:Yt})],yc.prototype,"leiCode",void 0);gi([yi({type:Yt,context:0,optional:true})],yc.prototype,"leiRole",void 0);yc=gi([fi({type:Re.Sequence})],yc);let Sc=class t{get text(){if(this.bmpString!==undefined){return this.bmpString}if(this.ia5String!==undefined){return this.ia5String}if(this.printableString!==undefined){return this.printableString}if(this.utf8String!==undefined){return this.utf8String}if(this.visibleString!==undefined){return this.visibleString}return undefined}set text(t){this.printableString=t}constructor(t){if(t){this.text=t}}};gi([yi({type:Ne.IA5String})],Sc.prototype,"ia5String",void 0);gi([yi({type:Ne.VisibleString})],Sc.prototype,"visibleString",void 0);gi([yi({type:Ne.BmpString})],Sc.prototype,"bmpString",void 0);gi([yi({type:Ne.Utf8String})],Sc.prototype,"utf8String",void 0);gi([yi({type:Ne.PrintableString})],Sc.prototype,"printableString",void 0);Sc=gi([fi({type:Re.Choice})],Sc);let Ac=class t extends Sc{constructor(t){super();if(typeof t==="string"){this.text=t}else if(t instanceof yc){this.struct=t}}};gi([yi({type:yc})],Ac.prototype,"struct",void 0);Ac=gi([fi({type:Re.Choice})],Ac);const vc="1.3.6.1.4.1.52266.2";let mc=class t extends Sc{};mc=gi([fi({type:Re.Choice})],mc);class Cc{get position(){return this.offset}constructor(t){this.offset=0;this.view=n.BufferSourceConverter.toUint8Array(t)}read(t=1){const e=this.view.slice(this.offset,this.offset+t);this.offset=this.offset+e.length;return e}readByte(){const t=this.read();if(!t.length){throw new Error("End of stream")}return t[0]}readNumber(t){const e=this.read(t);const i=n.Convert.ToHex(e);return parseInt(i,16)}readEnd(){return this.read(this.view.length-this.offset)}reset(){this.offset=0}}class gc{static createStream(t){const e=n.BufferSourceConverter.toUint8Array(t);return new Cc(e)}}var wc;(function(t){t[t["certificateTimestamp"]=0]="certificateTimestamp";t[t["treeHash"]=1]="treeHash"})(wc||(wc={}));var Ec;(function(t){t[t["none"]=0]="none";t[t["md5"]=1]="md5";t[t["sha1"]=2]="sha1";t[t["sha224"]=3]="sha224";t[t["sha256"]=4]="sha256";t[t["sha384"]=5]="sha384";t[t["sha512"]=6]="sha512"})(Ec||(Ec={}));var bc;(function(t){t[t["anonymous"]=0]="anonymous";t[t["rsa"]=1]="rsa";t[t["dsa"]=2]="dsa";t[t["ecdsa"]=3]="ecdsa"})(bc||(bc={}));class Pc extends gc{constructor(t){super();this.version=0;this.logId=new ArrayBuffer(32);this.timestamp=new Date;this.extensions=new ArrayBuffer(0);this.hashAlgorithm=0;this.signatureAlgorithm=0;this.signature=new ArrayBuffer(0);if(t){this.parse(t)}}parse(t){this.version=t.readByte();t.read(2);this.logId=n.BufferSourceConverter.toArrayBuffer(t.read(32));this.timestamp=new Date(t.readNumber(8));const e=t.readNumber(2);this.extensions=t.read(e).buffer;this.hashAlgorithm=t.readByte();this.signatureAlgorithm=t.readByte();this.signature=t.read(t.readNumber(2)).buffer}toJSON(){return{version:this.version,logId:n.Convert.ToHex(this.logId),timestamp:this.timestamp,extensions:n.Convert.ToBase64(this.extensions),hashAlgorithm:Ec[this.hashAlgorithm]||"undefined",signatureAlgorithm:bc[this.signatureAlgorithm]||"undefined",signature:n.Convert.ToBase64(this.signature)}}}var Dc;(function(t){t[t["v1"]=1]="v1"})(Dc||(Dc={}));const Ic="1.2.840.113583.1.1.9.2";class Bc{constructor(t={}){this.version=Dc.v1;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Bc.prototype,"version",void 0);const xc="1.2.840.113583.1.1.9.1";class Tc{constructor(t={}){this.version=Dc.v1;this.location=new Mi;this.requiresAuth=false;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Tc.prototype,"version",void 0);gi([yi({type:Mi})],Tc.prototype,"location",void 0);gi([yi({type:Ne.Boolean,defaultValue:false,optional:true})],Tc.prototype,"requiresAuth",void 0);class Oc{constructor(t={}){this.hashAlg=new fs;this.hashValue=new Ke;Object.assign(this,t)}}gi([yi({type:fs})],Oc.prototype,"hashAlg",void 0);gi([yi({type:Ke})],Oc.prototype,"hashValue",void 0);class kc{constructor(t={}){this.mediaType="";this.logotypeHash=[];this.logotypeURI=[];Object.assign(this,t)}}gi([yi({type:Ne.IA5String})],kc.prototype,"mediaType",void 0);gi([yi({type:Oc,repeated:"sequence"})],kc.prototype,"logotypeHash",void 0);gi([yi({type:Ne.IA5String,repeated:"sequence"})],kc.prototype,"logotypeURI",void 0);var Rc;(function(t){t[t["mono"]=1]="mono";t[t["stereo"]=2]="stereo";t[t["quad"]=4]="quad"})(Rc||(Rc={}));class Nc{constructor(t={}){this.fileSize=0;this.playTime=0;this.channels=Rc.mono;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Nc.prototype,"fileSize",void 0);gi([yi({type:Ne.Integer})],Nc.prototype,"playTime",void 0);gi([yi({type:Ne.Integer})],Nc.prototype,"channels",void 0);gi([yi({type:Ne.Integer,implicit:true,context:3,optional:true})],Nc.prototype,"sampleRate",void 0);gi([yi({type:Ne.IA5String,implicit:true,context:4,optional:true})],Nc.prototype,"language",void 0);class Mc{constructor(t={}){this.audioDetails=new kc;Object.assign(this,t)}}gi([yi({type:kc})],Mc.prototype,"audioDetails",void 0);gi([yi({type:Nc,optional:true})],Mc.prototype,"audioInfo",void 0);let Kc=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.Integer,context:1,implicit:true})],Kc.prototype,"numBits",void 0);gi([yi({type:Ne.Integer,context:2,implicit:true})],Kc.prototype,"tableSize",void 0);Kc=gi([fi({type:Re.Choice})],Kc);var Hc;(function(t){t[t["grayScale"]=0]="grayScale";t[t["color"]=1]="color"})(Hc||(Hc={}));class Uc{constructor(t={}){this.type=Hc.color;this.fileSize=0;this.xSize=0;this.ySize=0;Object.assign(this,t)}}gi([yi({type:Ne.Integer,context:0,implicit:true,defaultValue:Hc.color})],Uc.prototype,"type",void 0);gi([yi({type:Ne.Integer})],Uc.prototype,"fileSize",void 0);gi([yi({type:Ne.Integer})],Uc.prototype,"xSize",void 0);gi([yi({type:Ne.Integer})],Uc.prototype,"ySize",void 0);gi([yi({type:Kc})],Uc.prototype,"resolution",void 0);gi([yi({type:Ne.IA5String,context:4,implicit:true,optional:true})],Uc.prototype,"language",void 0);class jc{constructor(t={}){this.imageDetails=new kc;Object.assign(this,t)}}gi([yi({type:kc})],jc.prototype,"imageDetails",void 0);gi([yi({type:Uc,optional:true})],jc.prototype,"imageInfo",void 0);class _c{constructor(t={}){Object.assign(this,t)}}gi([yi({type:jc,repeated:"sequence",optional:true})],_c.prototype,"image",void 0);gi([yi({type:Mc,repeated:"sequence",context:1,optional:true})],_c.prototype,"audio",void 0);class Fc{constructor(t={}){this.refStructHash=[];this.refStructURI=[];Object.assign(this,t)}}gi([yi({type:Oc,repeated:"sequence"})],Fc.prototype,"refStructHash",void 0);gi([yi({type:Ne.IA5String,repeated:"sequence"})],Fc.prototype,"refStructURI",void 0);let Vc=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:_c,implicit:true,context:0})],Vc.prototype,"direct",void 0);gi([yi({type:Fc,implicit:true,context:1})],Vc.prototype,"indirect",void 0);Vc=gi([fi({type:Re.Choice})],Vc);class Lc{constructor(t={}){this.logotypeType="";this.info=new Vc;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Lc.prototype,"logotypeType",void 0);gi([yi({type:Vc})],Lc.prototype,"info",void 0);class $c{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Vc,context:0,repeated:"sequence",optional:true})],$c.prototype,"communityLogos",void 0);gi([yi({type:Vc,context:1,optional:true})],$c.prototype,"issuerLogo",void 0);gi([yi({type:Vc,context:2,optional:true})],$c.prototype,"subjectLogo",void 0);gi([yi({type:Lc,context:3,repeated:"sequence",optional:true})],$c.prototype,"otherLogos",void 0);var Gc,Wc,Qc;const qc="1.3.6.1.5.5.7";const zc=`${qc}.1`;let Jc=Gc=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Gc.prototype)}};Jc=Gc=gi([fi({type:Re.Sequence,itemType:Ne.IA5String})],Jc);class Yc{constructor(t={}){this.claim="";this.permitted=[];Object.assign(this,t)}}gi([yi({type:Ne.IA5String})],Yc.prototype,"claim",void 0);gi([yi({type:Ne.Utf8String,repeated:"sequence"})],Yc.prototype,"permitted",void 0);let Zc=Wc=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wc.prototype)}};Zc=Wc=gi([fi({type:Re.Sequence,itemType:Yc})],Zc);class Xc{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Jc,optional:true,context:0})],Xc.prototype,"mustInclude",void 0);gi([yi({type:Zc,optional:true,context:1})],Xc.prototype,"permittedValues",void 0);const tu=`${zc}.26`;class eu{constructor(){this.start="";this.count=2}}gi([yi({type:Ne.IA5String})],eu.prototype,"start",void 0);gi([yi({type:Ne.Integer})],eu.prototype,"count",void 0);let iu=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ne.IA5String,context:0})],iu.prototype,"spc",void 0);gi([yi({type:eu,context:1})],iu.prototype,"range",void 0);gi([yi({type:Ne.IA5String,context:2})],iu.prototype,"one",void 0);iu=gi([fi({type:Re.Choice})],iu);let ru=Qc=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Qc.prototype)}};ru=Qc=gi([fi({type:Re.Sequence,itemType:iu})],ru);var su;const nu="1.3.6.1.4.1.11129.2.1.17";var ou;(function(t){t[t["verified"]=0]="verified";t[t["selfSigned"]=1]="selfSigned";t[t["unverified"]=2]="unverified";t[t["failed"]=3]="failed"})(ou||(ou={}));class au{constructor(t={}){this.verifiedBootKey=new Ke;this.deviceLocked=false;this.verifiedBootState=ou.verified;Object.assign(this,t)}}gi([yi({type:Ke})],au.prototype,"verifiedBootKey",void 0);gi([yi({type:Ne.Boolean})],au.prototype,"deviceLocked",void 0);gi([yi({type:Ne.Enumerated})],au.prototype,"verifiedBootState",void 0);gi([yi({type:Ke,optional:true})],au.prototype,"verifiedBootHash",void 0);let cu=su=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,su.prototype)}};cu=su=gi([fi({type:Re.Set,itemType:Ne.Integer})],cu);class uu{constructor(t={}){Object.assign(this,t)}}gi([yi({context:1,type:cu,optional:true})],uu.prototype,"purpose",void 0);gi([yi({context:2,type:Ne.Integer,optional:true})],uu.prototype,"algorithm",void 0);gi([yi({context:3,type:Ne.Integer,optional:true})],uu.prototype,"keySize",void 0);gi([yi({context:5,type:cu,optional:true})],uu.prototype,"digest",void 0);gi([yi({context:6,type:cu,optional:true})],uu.prototype,"padding",void 0);gi([yi({context:10,type:Ne.Integer,optional:true})],uu.prototype,"ecCurve",void 0);gi([yi({context:200,type:Ne.Integer,optional:true})],uu.prototype,"rsaPublicExponent",void 0);gi([yi({context:203,type:cu,optional:true})],uu.prototype,"mgfDigest",void 0);gi([yi({context:303,type:Ne.Null,optional:true})],uu.prototype,"rollbackResistance",void 0);gi([yi({context:305,type:Ne.Null,optional:true})],uu.prototype,"earlyBootOnly",void 0);gi([yi({context:400,type:Ne.Integer,optional:true})],uu.prototype,"activeDateTime",void 0);gi([yi({context:401,type:Ne.Integer,optional:true})],uu.prototype,"originationExpireDateTime",void 0);gi([yi({context:402,type:Ne.Integer,optional:true})],uu.prototype,"usageExpireDateTime",void 0);gi([yi({context:405,type:Ne.Integer,optional:true})],uu.prototype,"usageCountLimit",void 0);gi([yi({context:503,type:Ne.Null,optional:true})],uu.prototype,"noAuthRequired",void 0);gi([yi({context:504,type:Ne.Integer,optional:true})],uu.prototype,"userAuthType",void 0);gi([yi({context:505,type:Ne.Integer,optional:true})],uu.prototype,"authTimeout",void 0);gi([yi({context:506,type:Ne.Null,optional:true})],uu.prototype,"allowWhileOnBody",void 0);gi([yi({context:507,type:Ne.Null,optional:true})],uu.prototype,"trustedUserPresenceRequired",void 0);gi([yi({context:508,type:Ne.Null,optional:true})],uu.prototype,"trustedConfirmationRequired",void 0);gi([yi({context:509,type:Ne.Null,optional:true})],uu.prototype,"unlockedDeviceRequired",void 0);gi([yi({context:600,type:Ne.Null,optional:true})],uu.prototype,"allApplications",void 0);gi([yi({context:601,type:Ke,optional:true})],uu.prototype,"applicationId",void 0);gi([yi({context:701,type:Ne.Integer,optional:true})],uu.prototype,"creationDateTime",void 0);gi([yi({context:702,type:Ne.Integer,optional:true})],uu.prototype,"origin",void 0);gi([yi({context:703,type:Ne.Null,optional:true})],uu.prototype,"rollbackResistant",void 0);gi([yi({context:704,type:au,optional:true})],uu.prototype,"rootOfTrust",void 0);gi([yi({context:705,type:Ne.Integer,optional:true})],uu.prototype,"osVersion",void 0);gi([yi({context:706,type:Ne.Integer,optional:true})],uu.prototype,"osPatchLevel",void 0);gi([yi({context:709,type:Ke,optional:true})],uu.prototype,"attestationApplicationId",void 0);gi([yi({context:710,type:Ke,optional:true})],uu.prototype,"attestationIdBrand",void 0);gi([yi({context:711,type:Ke,optional:true})],uu.prototype,"attestationIdDevice",void 0);gi([yi({context:712,type:Ke,optional:true})],uu.prototype,"attestationIdProduct",void 0);gi([yi({context:713,type:Ke,optional:true})],uu.prototype,"attestationIdSerial",void 0);gi([yi({context:714,type:Ke,optional:true})],uu.prototype,"attestationIdImei",void 0);gi([yi({context:715,type:Ke,optional:true})],uu.prototype,"attestationIdMeid",void 0);gi([yi({context:716,type:Ke,optional:true})],uu.prototype,"attestationIdManufacturer",void 0);gi([yi({context:717,type:Ke,optional:true})],uu.prototype,"attestationIdModel",void 0);gi([yi({context:718,type:Ne.Integer,optional:true})],uu.prototype,"vendorPatchLevel",void 0);gi([yi({context:719,type:Ne.Integer,optional:true})],uu.prototype,"bootPatchLevel",void 0);gi([yi({context:720,type:Ne.Null,optional:true})],uu.prototype,"deviceUniqueAttestation",void 0);gi([yi({context:723,type:Ke,optional:true})],uu.prototype,"attestationIdSecondImei",void 0);gi([yi({context:724,type:Ke,optional:true})],uu.prototype,"moduleHash",void 0);var lu;(function(t){t[t["software"]=0]="software";t[t["trustedEnvironment"]=1]="trustedEnvironment";t[t["strongBox"]=2]="strongBox"})(lu||(lu={}));var hu;(function(t){t[t["KM2"]=1]="KM2";t[t["KM3"]=2]="KM3";t[t["KM4"]=3]="KM4";t[t["KM4_1"]=4]="KM4_1";t[t["keyMint1"]=100]="keyMint1";t[t["keyMint2"]=200]="keyMint2";t[t["keyMint3"]=300]="keyMint3";t[t["keyMint4"]=400]="keyMint4"})(hu||(hu={}));class pu{constructor(t={}){this.attestationVersion=hu.KM4;this.attestationSecurityLevel=lu.software;this.keymasterVersion=0;this.keymasterSecurityLevel=lu.software;this.attestationChallenge=new Ke;this.uniqueId=new Ke;this.softwareEnforced=new uu;this.teeEnforced=new uu;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],pu.prototype,"attestationVersion",void 0);gi([yi({type:Ne.Enumerated})],pu.prototype,"attestationSecurityLevel",void 0);gi([yi({type:Ne.Integer})],pu.prototype,"keymasterVersion",void 0);gi([yi({type:Ne.Enumerated})],pu.prototype,"keymasterSecurityLevel",void 0);gi([yi({type:Ke})],pu.prototype,"attestationChallenge",void 0);gi([yi({type:Ke})],pu.prototype,"uniqueId",void 0);gi([yi({type:uu})],pu.prototype,"softwareEnforced",void 0);gi([yi({type:uu})],pu.prototype,"teeEnforced",void 0);class du{constructor(t={}){this.attestationVersion=hu.keyMint4;this.attestationSecurityLevel=lu.software;this.keyMintVersion=0;this.keyMintSecurityLevel=lu.software;this.attestationChallenge=new Ke;this.uniqueId=new Ke;this.softwareEnforced=new uu;this.hardwareEnforced=new uu;Object.assign(this,t)}toLegacyKeyDescription(){return new pu({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})}static fromLegacyKeyDescription(t){return new du({attestationVersion:t.attestationVersion,attestationSecurityLevel:t.attestationSecurityLevel,keyMintVersion:t.keymasterVersion,keyMintSecurityLevel:t.keymasterSecurityLevel,attestationChallenge:t.attestationChallenge,uniqueId:t.uniqueId,softwareEnforced:t.softwareEnforced,hardwareEnforced:t.teeEnforced})}}gi([yi({type:Ne.Integer})],du.prototype,"attestationVersion",void 0);gi([yi({type:Ne.Enumerated})],du.prototype,"attestationSecurityLevel",void 0);gi([yi({type:Ne.Integer})],du.prototype,"keyMintVersion",void 0);gi([yi({type:Ne.Enumerated})],du.prototype,"keyMintSecurityLevel",void 0);gi([yi({type:Ke})],du.prototype,"attestationChallenge",void 0);gi([yi({type:Ke})],du.prototype,"uniqueId",void 0);gi([yi({type:uu})],du.prototype,"softwareEnforced",void 0);gi([yi({type:uu})],du.prototype,"hardwareEnforced",void 0);var fu;let yu=class t extends uu{};yu=gi([fi({type:Re.Choice})],yu);let Su=fu=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,fu.prototype)}findProperty(t){const e=this.find((e=>t in e));if(e){return e[t]}return undefined}};Su=fu=gi([fi({type:Re.Sequence,itemType:yu})],Su);class Au{get keyMintVersion(){return this.keymasterVersion}set keyMintVersion(t){this.keymasterVersion=t}get keyMintSecurityLevel(){return this.keymasterSecurityLevel}set keyMintSecurityLevel(t){this.keymasterSecurityLevel=t}get hardwareEnforced(){return this.teeEnforced}set hardwareEnforced(t){this.teeEnforced=t}constructor(t={}){this.attestationVersion=hu.KM4;this.attestationSecurityLevel=lu.software;this.keymasterVersion=0;this.keymasterSecurityLevel=lu.software;this.attestationChallenge=new Ke;this.uniqueId=new Ke;this.softwareEnforced=new Su;this.teeEnforced=new Su;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Au.prototype,"attestationVersion",void 0);gi([yi({type:Ne.Enumerated})],Au.prototype,"attestationSecurityLevel",void 0);gi([yi({type:Ne.Integer})],Au.prototype,"keymasterVersion",void 0);gi([yi({type:Ne.Enumerated})],Au.prototype,"keymasterSecurityLevel",void 0);gi([yi({type:Ke})],Au.prototype,"attestationChallenge",void 0);gi([yi({type:Ke})],Au.prototype,"uniqueId",void 0);gi([yi({type:Su})],Au.prototype,"softwareEnforced",void 0);gi([yi({type:Su})],Au.prototype,"teeEnforced",void 0);let vu=class t extends Au{constructor(t={}){if("keymasterVersion"in t&&!("keyMintVersion"in t)){t.keyMintVersion=t.keymasterVersion}if("keymasterSecurityLevel"in t&&!("keyMintSecurityLevel"in t)){t.keyMintSecurityLevel=t.keymasterSecurityLevel}if("teeEnforced"in t&&!("hardwareEnforced"in t)){t.hardwareEnforced=t.teeEnforced}super(t)}};vu=gi([fi({type:Re.Sequence})],vu);class mu{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ne.OctetString})],mu.prototype,"packageName",void 0);gi([yi({type:Ne.Integer})],mu.prototype,"version",void 0);class Cu{constructor(t={}){Object.assign(this,t)}}gi([yi({type:mu,repeated:"set"})],Cu.prototype,"packageInfos",void 0);gi([yi({type:Ne.OctetString,repeated:"set"})],Cu.prototype,"signatureDigests",void 0);var gu=undefined&&undefined.__decorate||function(t,e,i,r){var s=arguments.length,n=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)if(o=t[a])n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n;return s>3&&n&&Object.defineProperty(e,i,n),n};const wu="2.23.140.3.1";class Eu{constructor(t={}){Object.assign(this,t)}}gu([yi({type:Ne.PrintableString})],Eu.prototype,"registrationSchemeIdentifier",void 0);gu([yi({type:Ne.PrintableString})],Eu.prototype,"registrationCountry",void 0);gu([yi({type:Ne.PrintableString,optional:true,context:0,implicit:true})],Eu.prototype,"registrationStateOrProvince",void 0);gu([yi({type:Ne.Utf8String})],Eu.prototype,"registrationReference",void 0);
107
107
  /**
108
108
  * @license
109
109
  * Copyright (c) Peculiar Ventures, LLC.
@@ -131,5 +131,5 @@ function t(t,e,i,r="application/octet-stream"){const s=new Blob([t],{type:r});if
131
131
  *
132
132
  * This source code is licensed under the MIT license found in the
133
133
  * LICENSE file in the root directory of this source tree.
134
- */const Lu=t=>{if(_u.isPem(t)){return _u.decode(t)[0]}if(n.Convert.isHex(t)){return n.Convert.FromHex(t)}if(n.Convert.isBase64(t)){return n.Convert.FromBase64(t)}if(n.Convert.isBase64Url(t)){return n.Convert.FromBase64Url(t)}return n.Convert.FromBinary(t)};const $u=async(t,e)=>{const i=Vu.get();if(i.subtle){return i.subtle.digest(t,e)}return undefined};class Gu{constructor(t={}){this.acIssuer=new Mi;this.acSerial=0;this.attrs=[];Object.assign(this,t)}}gi([yi({type:Mi})],Gu.prototype,"acIssuer",void 0);gi([yi({type:Ne.Integer})],Gu.prototype,"acSerial",void 0);gi([yi({type:Xr,repeated:"sequence"})],Gu.prototype,"attrs",void 0);var Wu;let Qu=Wu=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wu.prototype)}};Qu=Wu=gi([fi({type:Re.Sequence,itemType:Ne.ObjectIdentifier})],Qu);class qu{constructor(t={}){this.permitUnSpecified=true;Object.assign(this,t)}}gi([yi({type:Ne.Integer,optional:true})],qu.prototype,"pathLenConstraint",void 0);gi([yi({type:Qu,implicit:true,context:0,optional:true})],qu.prototype,"permittedAttrs",void 0);gi([yi({type:Qu,implicit:true,context:1,optional:true})],qu.prototype,"excludedAttrs",void 0);gi([yi({type:Ne.Boolean,defaultValue:true})],qu.prototype,"permitUnSpecified",void 0);class zu{constructor(t={}){this.issuer=new zi;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:zi})],zu.prototype,"issuer",void 0);gi([yi({type:Ne.Integer,converter:_e})],zu.prototype,"serial",void 0);gi([yi({type:Ne.BitString,optional:true})],zu.prototype,"issuerUID",void 0);var Ju;(function(t){t[t["publicKey"]=0]="publicKey";t[t["publicKeyCert"]=1]="publicKeyCert";t[t["otherObjectTypes"]=2]="otherObjectTypes"})(Ju||(Ju={}));class Yu{constructor(t={}){this.digestedObjectType=Ju.publicKey;this.digestAlgorithm=new fs;this.objectDigest=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Enumerated})],Yu.prototype,"digestedObjectType",void 0);gi([yi({type:Ne.ObjectIdentifier,optional:true})],Yu.prototype,"otherObjectTypeID",void 0);gi([yi({type:fs})],Yu.prototype,"digestAlgorithm",void 0);gi([yi({type:Ne.BitString})],Yu.prototype,"objectDigest",void 0);class Zu{constructor(t={}){Object.assign(this,t)}}gi([yi({type:zi,optional:true})],Zu.prototype,"issuerName",void 0);gi([yi({type:zu,context:0,implicit:true,optional:true})],Zu.prototype,"baseCertificateID",void 0);gi([yi({type:Yu,context:1,implicit:true,optional:true})],Zu.prototype,"objectDigestInfo",void 0);let Xu=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Mi,repeated:"sequence"})],Xu.prototype,"v1Form",void 0);gi([yi({type:Zu,context:0,implicit:true})],Xu.prototype,"v2Form",void 0);Xu=gi([fi({type:Re.Choice})],Xu);class tl{constructor(t={}){this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,t)}}gi([yi({type:Ne.GeneralizedTime})],tl.prototype,"notBeforeTime",void 0);gi([yi({type:Ne.GeneralizedTime})],tl.prototype,"notAfterTime",void 0);class el{constructor(t={}){Object.assign(this,t)}}gi([yi({type:zu,implicit:true,context:0,optional:true})],el.prototype,"baseCertificateID",void 0);gi([yi({type:zi,implicit:true,context:1,optional:true})],el.prototype,"entityName",void 0);gi([yi({type:Yu,implicit:true,context:2,optional:true})],el.prototype,"objectDigestInfo",void 0);var il;(function(t){t[t["v2"]=1]="v2"})(il||(il={}));class rl{constructor(t={}){this.version=il.v2;this.holder=new el;this.issuer=new Xu;this.signature=new fs;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new tl;this.attributes=[];Object.assign(this,t)}}gi([yi({type:Ne.Integer})],rl.prototype,"version",void 0);gi([yi({type:el})],rl.prototype,"holder",void 0);gi([yi({type:Xu})],rl.prototype,"issuer",void 0);gi([yi({type:fs})],rl.prototype,"signature",void 0);gi([yi({type:Ne.Integer,converter:_e})],rl.prototype,"serialNumber",void 0);gi([yi({type:tl})],rl.prototype,"attrCertValidityPeriod",void 0);gi([yi({type:Xr,repeated:"sequence"})],rl.prototype,"attributes",void 0);gi([yi({type:Ne.BitString,optional:true})],rl.prototype,"issuerUniqueID",void 0);gi([yi({type:Cs,optional:true})],rl.prototype,"extensions",void 0);class sl{constructor(t={}){this.acinfo=new rl;this.signatureAlgorithm=new fs;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:rl})],sl.prototype,"acinfo",void 0);gi([yi({type:fs})],sl.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],sl.prototype,"signatureValue",void 0);var nl;(function(t){t[t["unmarked"]=1]="unmarked";t[t["unclassified"]=2]="unclassified";t[t["restricted"]=4]="restricted";t[t["confidential"]=8]="confidential";t[t["secret"]=16]="secret";t[t["topSecret"]=32]="topSecret"})(nl||(nl={}));class ol extends Me{}class al{constructor(t={}){this.type="";this.value=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier,implicit:true,context:0})],al.prototype,"type",void 0);gi([yi({type:Ne.Any,implicit:true,context:1})],al.prototype,"value",void 0);class cl{constructor(t={}){this.policyId="";this.classList=new ol(nl.unclassified);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],cl.prototype,"policyId",void 0);gi([yi({type:ol,defaultValue:new ol(nl.unclassified)})],cl.prototype,"classList",void 0);gi([yi({type:al,repeated:"set"})],cl.prototype,"securityCategories",void 0);class ul{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ke})],ul.prototype,"cotets",void 0);gi([yi({type:Ne.ObjectIdentifier})],ul.prototype,"oid",void 0);gi([yi({type:Ne.Utf8String})],ul.prototype,"string",void 0);class ll{constructor(t={}){this.values=[];Object.assign(this,t)}}gi([yi({type:zi,implicit:true,context:0,optional:true})],ll.prototype,"policyAuthority",void 0);gi([yi({type:ul,repeated:"sequence"})],ll.prototype,"values",void 0);var hl;class pl{constructor(t={}){this.targetCertificate=new zu;Object.assign(this,t)}}gi([yi({type:zu})],pl.prototype,"targetCertificate",void 0);gi([yi({type:Mi,optional:true})],pl.prototype,"targetName",void 0);gi([yi({type:Yu,optional:true})],pl.prototype,"certDigestInfo",void 0);let dl=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Mi,context:0,implicit:true})],dl.prototype,"targetName",void 0);gi([yi({type:Mi,context:1,implicit:true})],dl.prototype,"targetGroup",void 0);gi([yi({type:pl,context:2,implicit:true})],dl.prototype,"targetCert",void 0);dl=gi([fi({type:Re.Choice})],dl);let fl=hl=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,hl.prototype)}};fl=hl=gi([fi({type:Re.Sequence,itemType:dl})],fl);var yl;let Sl=yl=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,yl.prototype)}};Sl=yl=gi([fi({type:Re.Sequence,itemType:fl})],Sl);class Al{constructor(t={}){Object.assign(this,t)}}gi([yi({type:zi,implicit:true,context:0,optional:true})],Al.prototype,"roleAuthority",void 0);gi([yi({type:Mi,implicit:true,context:1})],Al.prototype,"roleName",void 0);class vl{constructor(t={}){this.service=new Mi;this.ident=new Mi;Object.assign(this,t)}}gi([yi({type:Mi})],vl.prototype,"service",void 0);gi([yi({type:Mi})],vl.prototype,"ident",void 0);gi([yi({type:Ke,optional:true})],vl.prototype,"authInfo",void 0);const ml="0.4.0.9496";const Cl=`${ml}.6`;let gl=class t{constructor(t={}){this.codeAuthority=new Mi;this.codeId=new Mi;this.shortName="";this.shortDescription="";Object.assign(this,t)}};gi([yi({type:Mi,context:0})],gl.prototype,"codeAuthority",void 0);gi([yi({type:Mi,context:1})],gl.prototype,"codeId",void 0);gi([yi({type:Ne.Utf8String,context:2})],gl.prototype,"shortName",void 0);gi([yi({type:Ne.Utf8String,context:3})],gl.prototype,"shortDescription",void 0);gl=gi([fi({type:Re.Sequence})],gl);let wl=class t extends Oi{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};wl=gi([fi({type:Re.Sequence})],wl);const El=`${ml}.1`;let bl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};bl=gi([fi({type:Re.Sequence})],bl);const Pl=`${ml}.2`;let Dl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};Dl=gi([fi({type:Re.Sequence})],Dl);const Il=`${ml}.3`;let Bl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};Bl=gi([fi({type:Re.Sequence})],Bl);const xl=`${ml}.4`;let Tl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};Tl=gi([fi({type:Re.Sequence})],Tl);const Ol=`${ml}.8`;let kl=class t{constructor(t={}){this.location="";this.base=0;this.degree=0;Object.assign(this,t)}toString(){return`${this.base} x 10^${this.degree} ${this.location}`}};gi([yi({type:Ne.PrintableString})],kl.prototype,"location",void 0);gi([yi({type:Ne.Integer})],kl.prototype,"base",void 0);gi([yi({type:Ne.Integer})],kl.prototype,"degree",void 0);kl=gi([fi({type:Re.Sequence})],kl);const Rl=`${ml}.9`;let Nl=class t{constructor(t={}){this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Nl.prototype,"stars5",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars4",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars3",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars2",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars1",void 0);Nl=gi([fi({type:Re.Sequence})],Nl);const Ml=`${ml}.5`;let Kl=class t{constructor(t={}){this.DNBvsDNO=new Me(0);this.DNBvsDNT=new Me(0);this.DNOvsDNT=new Me(0);Object.assign(this,t)}};gi([yi({type:Me,context:0})],Kl.prototype,"DNBvsDNO",void 0);gi([yi({type:Me,context:1})],Kl.prototype,"DNBvsDNT",void 0);gi([yi({type:Me,context:2})],Kl.prototype,"DNOvsDNT",void 0);Kl=gi([fi({type:Re.Sequence})],Kl);const Hl=`${ml}.7`;let Ul=class t{constructor(t={}){this.assessmentAuthority=new Mi;this.assessmentRef=new Mi;this.assessmentLocation=new Mi;this.dataStorageTerritory="";this.description="";Object.assign(this,t)}};gi([yi({type:Mi,context:0})],Ul.prototype,"assessmentAuthority",void 0);gi([yi({type:Mi,context:1})],Ul.prototype,"assessmentRef",void 0);gi([yi({type:Mi,context:2})],Ul.prototype,"assessmentLocation",void 0);gi([yi({type:Ne.PrintableString,context:3})],Ul.prototype,"dataStorageTerritory",void 0);gi([yi({type:Ne.Utf8String,context:4})],Ul.prototype,"description",void 0);Ul=gi([fi({type:Re.Sequence})],Ul);class jl{constructor(t={}){this.issuer=new Oi;this.serialNumber=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Oi})],jl.prototype,"issuer",void 0);gi([yi({type:Ne.Integer,converter:_e})],jl.prototype,"serialNumber",void 0);let _l=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:ss,context:0,implicit:true})],_l.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:jl})],_l.prototype,"issuerAndSerialNumber",void 0);_l=gi([fi({type:Re.Choice})],_l);var Fl;(function(t){t[t["v0"]=0]="v0";t[t["v1"]=1]="v1";t[t["v2"]=2]="v2";t[t["v3"]=3]="v3";t[t["v4"]=4]="v4";t[t["v5"]=5]="v5"})(Fl||(Fl={}));let Vl=class t extends fs{};Vl=gi([fi({type:Re.Sequence})],Vl);let Ll=class t extends fs{};Ll=gi([fi({type:Re.Sequence})],Ll);let $l=class t extends fs{};$l=gi([fi({type:Re.Sequence})],$l);let Gl=class t extends fs{};Gl=gi([fi({type:Re.Sequence})],Gl);let Wl=class t extends fs{};Wl=gi([fi({type:Re.Sequence})],Wl);let Ql=class t extends fs{};Ql=gi([fi({type:Re.Sequence})],Ql);class ql{constructor(t={}){this.attrType="";this.attrValues=[];Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],ql.prototype,"attrType",void 0);gi([yi({type:Ne.Any,repeated:"set"})],ql.prototype,"attrValues",void 0);var zl;class Jl{constructor(t={}){this.version=Fl.v0;this.sid=new _l;this.digestAlgorithm=new Vl;this.signatureAlgorithm=new Ll;this.signature=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Jl.prototype,"version",void 0);gi([yi({type:_l})],Jl.prototype,"sid",void 0);gi([yi({type:Vl})],Jl.prototype,"digestAlgorithm",void 0);gi([yi({type:ql,repeated:"set",context:0,implicit:true,optional:true})],Jl.prototype,"signedAttrs",void 0);gi([yi({type:Ll})],Jl.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ke})],Jl.prototype,"signature",void 0);gi([yi({type:ql,repeated:"set",context:1,implicit:true,optional:true})],Jl.prototype,"unsignedAttrs",void 0);let Yl=zl=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,zl.prototype)}};Yl=zl=gi([fi({type:Re.Set,itemType:Jl})],Yl);let Zl=class t extends Ss{};Zl=gi([fi({type:Re.Choice})],Zl);let Xl=class t extends Jl{};Xl=gi([fi({type:Re.Sequence})],Xl);var th;class eh{constructor(t={}){this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],eh.prototype,"otherCertFormat",void 0);gi([yi({type:Ne.Any})],eh.prototype,"otherCert",void 0);let ih=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Es})],ih.prototype,"certificate",void 0);gi([yi({type:sl,context:2,implicit:true})],ih.prototype,"v2AttrCert",void 0);gi([yi({type:eh,context:3,implicit:true})],ih.prototype,"other",void 0);ih=gi([fi({type:Re.Choice})],ih);let rh=th=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,th.prototype)}};rh=th=gi([fi({type:Re.Set,itemType:ih})],rh);class sh{constructor(t={}){this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],sh.prototype,"contentType",void 0);gi([yi({type:Ne.Any,context:0})],sh.prototype,"content",void 0);let nh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ke})],nh.prototype,"single",void 0);gi([yi({type:Ne.Any})],nh.prototype,"any",void 0);nh=gi([fi({type:Re.Choice})],nh);class oh{constructor(t={}){this.eContentType="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],oh.prototype,"eContentType",void 0);gi([yi({type:nh,context:0,optional:true})],oh.prototype,"eContent",void 0);let ah=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ke,context:0,implicit:true,optional:true})],ah.prototype,"value",void 0);gi([yi({type:Ke,converter:Ge,context:0,implicit:true,optional:true,repeated:"sequence"})],ah.prototype,"constructedValue",void 0);ah=gi([fi({type:Re.Choice})],ah);class ch{constructor(t={}){this.contentType="";this.contentEncryptionAlgorithm=new Gl;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],ch.prototype,"contentType",void 0);gi([yi({type:Gl})],ch.prototype,"contentEncryptionAlgorithm",void 0);gi([yi({type:ah,optional:true})],ch.prototype,"encryptedContent",void 0);class uh{constructor(t={}){this.keyAttrId="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],uh.prototype,"keyAttrId",void 0);gi([yi({type:Ne.Any,optional:true})],uh.prototype,"keyAttr",void 0);var lh;class hh{constructor(t={}){this.subjectKeyIdentifier=new ss;Object.assign(this,t)}}gi([yi({type:ss})],hh.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:Ne.GeneralizedTime,optional:true})],hh.prototype,"date",void 0);gi([yi({type:uh,optional:true})],hh.prototype,"other",void 0);let ph=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:hh,context:0,implicit:true,optional:true})],ph.prototype,"rKeyId",void 0);gi([yi({type:jl,optional:true})],ph.prototype,"issuerAndSerialNumber",void 0);ph=gi([fi({type:Re.Choice})],ph);class dh{constructor(t={}){this.rid=new ph;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:ph})],dh.prototype,"rid",void 0);gi([yi({type:Ke})],dh.prototype,"encryptedKey",void 0);let fh=lh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,lh.prototype)}};fh=lh=gi([fi({type:Re.Sequence,itemType:dh})],fh);class yh{constructor(t={}){this.algorithm=new fs;this.publicKey=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:fs})],yh.prototype,"algorithm",void 0);gi([yi({type:Ne.BitString})],yh.prototype,"publicKey",void 0);let Sh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:ss,context:0,implicit:true,optional:true})],Sh.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:yh,context:1,implicit:true,optional:true})],Sh.prototype,"originatorKey",void 0);gi([yi({type:jl,optional:true})],Sh.prototype,"issuerAndSerialNumber",void 0);Sh=gi([fi({type:Re.Choice})],Sh);class Ah{constructor(t={}){this.version=Fl.v3;this.originator=new Sh;this.keyEncryptionAlgorithm=new $l;this.recipientEncryptedKeys=new fh;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Ah.prototype,"version",void 0);gi([yi({type:Sh,context:0})],Ah.prototype,"originator",void 0);gi([yi({type:Ke,context:1,optional:true})],Ah.prototype,"ukm",void 0);gi([yi({type:$l})],Ah.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:fh})],Ah.prototype,"recipientEncryptedKeys",void 0);let vh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:ss,context:0,implicit:true})],vh.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:jl})],vh.prototype,"issuerAndSerialNumber",void 0);vh=gi([fi({type:Re.Choice})],vh);class mh{constructor(t={}){this.version=Fl.v0;this.rid=new vh;this.keyEncryptionAlgorithm=new $l;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],mh.prototype,"version",void 0);gi([yi({type:vh})],mh.prototype,"rid",void 0);gi([yi({type:$l})],mh.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:Ke})],mh.prototype,"encryptedKey",void 0);class Ch{constructor(t={}){this.keyIdentifier=new Ke;Object.assign(this,t)}}gi([yi({type:Ke})],Ch.prototype,"keyIdentifier",void 0);gi([yi({type:Ne.GeneralizedTime,optional:true})],Ch.prototype,"date",void 0);gi([yi({type:uh,optional:true})],Ch.prototype,"other",void 0);class gh{constructor(t={}){this.version=Fl.v4;this.kekid=new Ch;this.keyEncryptionAlgorithm=new $l;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],gh.prototype,"version",void 0);gi([yi({type:Ch})],gh.prototype,"kekid",void 0);gi([yi({type:$l})],gh.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:Ke})],gh.prototype,"encryptedKey",void 0);class wh{constructor(t={}){this.version=Fl.v0;this.keyEncryptionAlgorithm=new $l;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],wh.prototype,"version",void 0);gi([yi({type:Ql,context:0,optional:true})],wh.prototype,"keyDerivationAlgorithm",void 0);gi([yi({type:$l})],wh.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:Ke})],wh.prototype,"encryptedKey",void 0);class Eh{constructor(t={}){this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Eh.prototype,"oriType",void 0);gi([yi({type:Ne.Any})],Eh.prototype,"oriValue",void 0);let bh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:mh,optional:true})],bh.prototype,"ktri",void 0);gi([yi({type:Ah,context:1,implicit:true,optional:true})],bh.prototype,"kari",void 0);gi([yi({type:gh,context:2,implicit:true,optional:true})],bh.prototype,"kekri",void 0);gi([yi({type:wh,context:3,implicit:true,optional:true})],bh.prototype,"pwri",void 0);gi([yi({type:Eh,context:4,implicit:true,optional:true})],bh.prototype,"ori",void 0);bh=gi([fi({type:Re.Choice})],bh);var Ph;let Dh=Ph=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ph.prototype)}};Dh=Ph=gi([fi({type:Re.Set,itemType:bh})],Dh);var Ih;class Bh{constructor(t={}){this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Bh.prototype,"otherRevInfoFormat",void 0);gi([yi({type:Ne.Any})],Bh.prototype,"otherRevInfo",void 0);let xh=class t{constructor(t={}){this.other=new Bh;Object.assign(this,t)}};gi([yi({type:Bh,context:1,implicit:true})],xh.prototype,"other",void 0);xh=gi([fi({type:Re.Choice})],xh);let Th=Ih=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ih.prototype)}};Th=Ih=gi([fi({type:Re.Set,itemType:xh})],Th);class Oh{constructor(t={}){Object.assign(this,t)}}gi([yi({type:rh,context:0,implicit:true,optional:true})],Oh.prototype,"certs",void 0);gi([yi({type:Th,context:1,implicit:true,optional:true})],Oh.prototype,"crls",void 0);var kh;let Rh=kh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,kh.prototype)}};Rh=kh=gi([fi({type:Re.Set,itemType:ql})],Rh);class Nh{constructor(t={}){this.version=Fl.v0;this.recipientInfos=new Dh;this.encryptedContentInfo=new ch;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Nh.prototype,"version",void 0);gi([yi({type:Oh,context:0,implicit:true,optional:true})],Nh.prototype,"originatorInfo",void 0);gi([yi({type:Dh})],Nh.prototype,"recipientInfos",void 0);gi([yi({type:ch})],Nh.prototype,"encryptedContentInfo",void 0);gi([yi({type:Rh,context:1,implicit:true,optional:true})],Nh.prototype,"unprotectedAttrs",void 0);var Mh;let Kh=Mh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Mh.prototype)}};Kh=Mh=gi([fi({type:Re.Set,itemType:Vl})],Kh);class Hh{constructor(t={}){this.version=Fl.v0;this.digestAlgorithms=new Kh;this.encapContentInfo=new oh;this.signerInfos=new Yl;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Hh.prototype,"version",void 0);gi([yi({type:Kh})],Hh.prototype,"digestAlgorithms",void 0);gi([yi({type:oh})],Hh.prototype,"encapContentInfo",void 0);gi([yi({type:rh,context:0,implicit:true,optional:true})],Hh.prototype,"certificates",void 0);gi([yi({type:Th,context:1,implicit:true,optional:true})],Hh.prototype,"crls",void 0);gi([yi({type:Yl})],Hh.prototype,"signerInfos",void 0);var Uh;class jh{constructor(t={}){this.attrId="";this.attrValues=[];Object.assign(t)}}gi([yi({type:Ne.ObjectIdentifier})],jh.prototype,"attrId",void 0);gi([yi({type:Ne.Any,repeated:"set"})],jh.prototype,"attrValues",void 0);let _h=Uh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Uh.prototype)}};_h=Uh=gi([fi({type:Re.Sequence,itemType:jh})],_h);var Fh;let Vh=Fh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Fh.prototype)}};Vh=Fh=gi([fi({type:Re.Sequence,itemType:sh})],Vh);class Lh{constructor(t={}){this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Lh.prototype,"certId",void 0);gi([yi({type:Ne.Any,context:0})],Lh.prototype,"certValue",void 0);class $h{constructor(t={}){this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],$h.prototype,"crlId",void 0);gi([yi({type:Ne.Any,context:0})],$h.prototype,"crltValue",void 0);let Gh=class t extends Nn{};Gh=gi([fi({type:Re.Sequence})],Gh);let Wh=class t extends xn{};Wh=gi([fi({type:Re.Sequence})],Wh);class Qh{constructor(t={}){this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Qh.prototype,"secretTypeId",void 0);gi([yi({type:Ne.Any,context:0})],Qh.prototype,"secretValue",void 0);class qh{constructor(t={}){this.mac=new An;this.macSalt=new Ke;this.iterations=1;Object.assign(this,t)}}gi([yi({type:An})],qh.prototype,"mac",void 0);gi([yi({type:Ke})],qh.prototype,"macSalt",void 0);gi([yi({type:Ne.Integer,defaultValue:1})],qh.prototype,"iterations",void 0);class zh{constructor(t={}){this.version=3;this.authSafe=new sh;this.macData=new qh;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],zh.prototype,"version",void 0);gi([yi({type:sh})],zh.prototype,"authSafe",void 0);gi([yi({type:qh,optional:true})],zh.prototype,"macData",void 0);var Jh;class Yh{constructor(t={}){this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Yh.prototype,"bagId",void 0);gi([yi({type:Ne.Any,context:0})],Yh.prototype,"bagValue",void 0);gi([yi({type:jh,repeated:"set",optional:true})],Yh.prototype,"bagAttributes",void 0);let Zh=Jh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Jh.prototype)}};Zh=Jh=gi([fi({type:Re.Sequence,itemType:Yh})],Zh);var Xh,tp,ep;const ip="1.2.840.113549.1.9";const rp=`${ip}.2`;const sp=`${ip}.7`;const np=`${ip}.14`;let op=class t extends Di{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};gi([yi({type:Ne.IA5String})],op.prototype,"ia5String",void 0);op=gi([fi({type:Re.Choice})],op);let ap=class t extends sh{};ap=gi([fi({type:Re.Sequence})],ap);let cp=class t extends zh{};cp=gi([fi({type:Re.Sequence})],cp);let up=class t extends xn{};up=gi([fi({type:Re.Sequence})],up);let lp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.IA5String})],lp.prototype,"value",void 0);lp=gi([fi({type:Re.Choice})],lp);let hp=class t extends op{};hp=gi([fi({type:Re.Choice})],hp);let pp=class t extends Di{};pp=gi([fi({type:Re.Choice})],pp);let dp=class t{constructor(t=new Date){this.value=t}};gi([yi({type:Ne.GeneralizedTime})],dp.prototype,"value",void 0);dp=gi([fi({type:Re.Choice})],dp);let fp=class t extends Di{};fp=gi([fi({type:Re.Choice})],fp);let yp=class t{constructor(t="M"){this.value=t}toString(){return this.value}};gi([yi({type:Ne.PrintableString})],yp.prototype,"value",void 0);yp=gi([fi({type:Re.Choice})],yp);let Sp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.PrintableString})],Sp.prototype,"value",void 0);Sp=gi([fi({type:Re.Choice})],Sp);let Ap=class t extends Sp{};Ap=gi([fi({type:Re.Choice})],Ap);let vp=class t extends Di{};vp=gi([fi({type:Re.Choice})],vp);let mp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.ObjectIdentifier})],mp.prototype,"value",void 0);mp=gi([fi({type:Re.Choice})],mp);let Cp=class t extends Ss{};Cp=gi([fi({type:Re.Choice})],Cp);let gp=class t{constructor(t=0){this.value=t}toString(){return this.value.toString()}};gi([yi({type:Ne.Integer})],gp.prototype,"value",void 0);gp=gi([fi({type:Re.Choice})],gp);let wp=class t extends Jl{};wp=gi([fi({type:Re.Sequence})],wp);let Ep=class t extends Di{};Ep=gi([fi({type:Re.Choice})],Ep);let bp=Xh=class t extends Cs{constructor(t){super(t);Object.setPrototypeOf(this,Xh.prototype)}};bp=Xh=gi([fi({type:Re.Sequence})],bp);let Pp=tp=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,tp.prototype)}};Pp=tp=gi([fi({type:Re.Set,itemType:ql})],Pp);let Dp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.BmpString})],Dp.prototype,"value",void 0);Dp=gi([fi({type:Re.Choice})],Dp);let Ip=class t extends fs{};Ip=gi([fi({type:Re.Sequence})],Ip);let Bp=ep=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ep.prototype)}};Bp=ep=gi([fi({type:Re.Sequence,itemType:Ip})],Bp);const xp="1.3.6.1.4.1.22112.2.1";let Tp=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:jl})],Tp.prototype,"signer",void 0);gi([yi({type:Es,optional:true})],Tp.prototype,"cert",void 0);Tp=gi([fi({type:Re.Sequence})],Tp);var Op;let kp=Op=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Op.prototype)}};kp=Op=gi([fi({type:Re.Sequence,itemType:Xr})],kp);class Rp{constructor(t={}){this.version=0;this.subject=new Oi;this.subjectPKInfo=new ys;this.attributes=new kp;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Rp.prototype,"version",void 0);gi([yi({type:Oi})],Rp.prototype,"subject",void 0);gi([yi({type:ys})],Rp.prototype,"subjectPKInfo",void 0);gi([yi({type:kp,implicit:true,context:0})],Rp.prototype,"attributes",void 0);class Np{constructor(t={}){this.certificationRequestInfo=new Rp;this.signatureAlgorithm=new fs;this.signature=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Rp})],Np.prototype,"certificationRequestInfo",void 0);gi([yi({type:fs})],Np.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],Np.prototype,"signature",void 0);let Mp=globalThis.crypto;function Kp(){return Mp}class Hp extends Error{code;constructor(t,e){super(t);this.code=e;this.name=this.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}class Up extends Hp{constructor(t,e){const i=e?` Supported: ${e.join(", ")}`:"";super(`Unsupported algorithm: ${t}.${i}`,"UNSUPPORTED_ALGORITHM")}}class jp extends Hp{constructor(t,e){const i=e?` Expected: ${e}`:"";super(`Invalid format: ${t}.${i}`,"INVALID_FORMAT")}}class _p extends Hp{constructor(t,e){const i=e?` Supported: ${e.join(", ")}`:"";super(`Unsupported key type: ${t}.${i}`,"UNSUPPORTED_KEY_TYPE")}}class Fp extends Hp{constructor(t){const e=t?`Invalid SSH private key format: ${t}`:"Invalid SSH private key format";super(e,"INVALID_PRIVATE_KEY_FORMAT")}}class Vp extends Hp{constructor(t){const e=t?`Encrypted SSH private keys are not supported (cipher: ${t})`:"Encrypted SSH private keys are not supported";super(e,"ENCRYPTED_KEY_NOT_SUPPORTED")}}class Lp extends Hp{constructor(t){const e=t?`Invalid key data: ${t}`:"Invalid key data";super(e,"INVALID_KEY_DATA")}}class $p extends Hp{constructor(t,e){const i=t!==undefined&&e!==undefined?` Expected ${t} bytes, got ${e}`:"";super(`Unexpected end of data${i}`,"UNEXPECTED_EOF")}}const Gp=new TextEncoder;const Wp=new TextDecoder;class Qp{buffer;offset;constructor(t){this.buffer=t;this.offset=0}readUint8(){if(this.offset>=this.buffer.length){throw new $p(1,0)}return this.buffer[this.offset++]}readUint32(){const t=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return t>>>0}readUint64(){const t=this.readUint32();const e=this.readUint32();return BigInt(t)<<32n|BigInt(e)}readBytes(t){if(t<0){throw new jp(`Invalid length: ${t}`)}if(this.offset+t>this.buffer.length){throw new $p(t,this.buffer.length-this.offset)}const e=this.buffer.subarray(this.offset,this.offset+t);this.offset+=t;return e}readString(){const t=this.readUint32();const e=this.readBytes(t);return Wp.decode(e)}peekString(t){if(this.offset+t>this.buffer.length){throw new $p(t,this.buffer.length-this.offset)}const e=this.buffer.subarray(this.offset,this.offset+t);return Wp.decode(e)}readMpInt(t=false){const e=this.readUint32();const i=this.readBytes(e);if(t&&i.length>1&&i[0]===0){return i.subarray(1)}return i}readMpIntSsh(){return this.readMpInt(true)}remaining(){return this.buffer.length-this.offset}getOffset(){return this.offset}seek(t){if(t<0||t>this.buffer.length){throw new jp(`Invalid offset: ${t}. Buffer length: ${this.buffer.length}`)}this.offset=t}}class qp{buffer;offset;constructor(t=1024){this.buffer=new Uint8Array(t);this.offset=0}ensureCapacity(t){const e=this.offset+t;if(e>this.buffer.length){const t=Math.max(e,this.buffer.length*2);const i=new Uint8Array(t);i.set(this.buffer.subarray(0,this.offset));this.buffer=i}}reserve(t){if(t>this.buffer.length){const e=new Uint8Array(t);e.set(this.buffer.subarray(0,this.offset));this.buffer=e}}writeUint8(t){this.ensureCapacity(1);this.buffer[this.offset++]=t&255}writeUint32(t){this.ensureCapacity(4);this.buffer[this.offset++]=t>>>24&255;this.buffer[this.offset++]=t>>>16&255;this.buffer[this.offset++]=t>>>8&255;this.buffer[this.offset++]=t&255}writeUint64(t){this.ensureCapacity(8);const e=Number(t>>32n);const i=Number(t&0xffffffffn);this.writeUint32(e);this.writeUint32(i)}writeBytes(t){this.ensureCapacity(t.length);this.buffer.set(t,this.offset);this.offset+=t.length}writeString(t){const e=Gp.encode(t);this.writeUint32(e.length);this.writeBytes(e)}writeMpInt(t,e=false){if(e&&t.length>0&&(t[0]&128)!==0){const e=new Uint8Array(t.length+1);e[0]=0;e.set(t,1);this.writeUint32(e.length);this.writeBytes(e)}else{this.writeUint32(t.length);this.writeBytes(t)}}writeMpIntSsh(t){this.writeMpInt(t,true)}toUint8Array(){return this.buffer.subarray(0,this.offset)}getOffset(){return this.offset}seek(t){if(t<0||t>this.buffer.length){throw new jp("Invalid offset")}this.offset=t}}class zp{hash="SHA-256";constructor(t="SHA-256"){this.hash=t}async importPublicSsh(t){const{blob:e,crypto:i}=t;const r=new Qp(e);r.readString();const s=r.readMpInt(true);const o=r.readMpInt(true);const a={kty:"RSA",n:n.Convert.ToBase64Url(o),e:n.Convert.ToBase64Url(s)};return i.subtle.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])}async exportPublicSsh(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("jwk",e);if(!r.n||!r.e){throw new Lp("RSA JWK missing required parameters (n, e)")}const s=n.BufferSourceConverter.toUint8Array(n.Convert.FromBase64Url(r.n));const o=n.BufferSourceConverter.toUint8Array(n.Convert.FromBase64Url(r.e));const a=new qp;a.writeString("ssh-rsa");a.writeMpInt(o,true);a.writeMpInt(s,true);return a.toUint8Array()}async importPublicSpki(t){const{spki:e,crypto:i}=t;return i.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])}async exportPublicSpki(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("spki",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivatePkcs8(t){const{pkcs8:e,crypto:i}=t;return i.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])}async exportPrivatePkcs8(t){const{privateKey:e,crypto:i}=t;const r=await i.subtle.exportKey("pkcs8",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivateSsh(t){const{sshKey:e,crypto:i}=t;const r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");const s=n.Convert.FromBase64(r);const o=new Qp(n.BufferSourceConverter.toUint8Array(s));const a=o.readBytes(15);if(n.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new Fp("invalid magic string")}const c=o.readString();o.readString();o.readString();if(c!=="none"){throw new Vp(c)}const u=o.readUint32();if(u!==1){throw new Fp("multiple keys not supported")}const l=o.readUint32();o.readBytes(l);const h=o.readUint32();const p=o.readBytes(h);const d=new Qp(p);const f=d.readUint32();const y=d.readUint32();if(f!==y){throw new Fp("invalid checkints")}d.readString();const S=d.readMpInt(true);const A=d.readMpInt(true);const v=d.readMpInt(true);const m=d.readMpInt(true);const C=d.readMpInt(true);const g=d.readMpInt(true);d.readString();const w=BigInt("0x"+n.Convert.ToHex(v));const E=BigInt("0x"+n.Convert.ToHex(C));const b=BigInt("0x"+n.Convert.ToHex(g));const P=w%(E-1n);const D=w%(b-1n);const I=n.Convert.FromHex(P.toString(16).padStart(C.length*2,"0"));const B=n.Convert.FromHex(D.toString(16).padStart(g.length*2,"0"));const x={kty:"RSA",n:n.Convert.ToBase64Url(S),e:n.Convert.ToBase64Url(A),d:n.Convert.ToBase64Url(v),p:n.Convert.ToBase64Url(C),q:n.Convert.ToBase64Url(g),dp:n.Convert.ToBase64Url(I),dq:n.Convert.ToBase64Url(B),qi:n.Convert.ToBase64Url(m)};return i.subtle.importKey("jwk",x,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])}async exportPrivateSsh(t){const{privateKey:e,crypto:i,jwk:r}=t;const s=r||await i.subtle.exportKey("jwk",e);if(!s.n||!s.e||!s.d||!s.p||!s.q){throw new Lp("RSA JWK missing required parameters")}const o=new Uint8Array(n.Convert.FromBase64Url(s.n));const a=new Uint8Array(n.Convert.FromBase64Url(s.e));const c=new Uint8Array(n.Convert.FromBase64Url(s.d));const u=new Uint8Array(n.Convert.FromBase64Url(s.p));const l=new Uint8Array(n.Convert.FromBase64Url(s.q));const h=s.qi?new Uint8Array(n.Convert.FromBase64Url(s.qi)):new Uint8Array;const p=new qp;p.writeString("ssh-rsa");p.writeMpInt(o,true);p.writeMpInt(a,true);p.writeMpInt(c,true);p.writeMpInt(h,true);p.writeMpInt(u,true);p.writeMpInt(l,true);return p.toUint8Array()}async sign(t){const{privateKey:e,data:i,crypto:r,hash:s}=t;if(s&&s!==this.hash){throw new Lp(`Hash ${s} not supported for this RSA algorithm`)}if(!e.extractable){throw new Lp("Private key is not extractable")}const o=await this.exportPrivatePkcs8({privateKey:e,crypto:r});const a=await this.importPrivatePkcs8({pkcs8:new Uint8Array(o),crypto:r});const c=await r.subtle.sign("RSASSA-PKCS1-v1_5",a,i);return n.BufferSourceConverter.toUint8Array(c)}async verify(t){const{publicKey:e,signature:i,data:r,crypto:s,hash:n}=t;if(n&&n!==this.hash){return false}if(!e.extractable){throw new Lp("Public key is not extractable")}const o=await this.exportPublicSpki({publicKey:e,crypto:s});const a=await this.importPublicSpki({spki:new Uint8Array(o),crypto:s});return s.subtle.verify("RSASSA-PKCS1-v1_5",a,i,r)}encodeSignature(t){const{signature:e,algo:i}=t;const r=new qp;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()}decodeSignature(t){const{signature:e}=t;const i=new Qp(e);const r=i.readString();const s=i.readUint32();const n=i.readBytes(s);return{signature:n,algo:r}}supportsCryptoKey(t){return t.algorithm.name==="RSASSA-PKCS1-v1_5"}parsePublicKey(t){const e=t.readBytes(t.readUint32());const i=t.readBytes(t.readUint32());const r=new qp;r.writeString("ssh-rsa");r.writeMpInt(e);r.writeMpInt(i);return{type:"ssh-rsa",keyData:r.toUint8Array()}}writePublicKey(t,e){const i=new Qp(e.keyData);i.readString();const r=i.readMpInt();const s=i.readMpInt();t.writeUint32(r.length);t.writeBytes(r);t.writeUint32(s.length);t.writeBytes(s)}getCertificateType(){return"ssh-rsa-cert-v01@openssh.com"}getSignatureAlgo(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"}}class Jp{curveName;sshType;namedCurve;constructor(t,e,i){this.curveName=t;this.sshType=e;this.namedCurve=i}getHashAlgorithm(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}}getExpectedLength(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}}getSignatureCoordLength(){return this.getExpectedLength()}async importPublicSsh(t){const{blob:e,crypto:i}=t;const r=new Qp(e);r.readString();const s=r.readString();if(s!==this.curveName){throw new Lp(`ECDSA curve name ${s}, expected ${this.curveName}`)}const o=r.readMpInt();const a=Math.floor((o.length-1)/2);const c={kty:"EC",crv:this.namedCurve,x:n.Convert.ToBase64Url(o.slice(1,1+a)),y:n.Convert.ToBase64Url(o.slice(1+a))};return i.subtle.importKey("jwk",c,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])}async exportPublicSsh(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("jwk",e);if(!r.x||!r.y){throw new Lp("ECDSA JWK missing x or y parameters")}const s=new Uint8Array(n.Convert.FromBase64Url(r.x));const o=new Uint8Array(n.Convert.FromBase64Url(r.y));const a=new Uint8Array(1+s.length+o.length);a[0]=4;a.set(s,1);a.set(o,1+s.length);const c=new qp;c.writeString(this.sshType);c.writeString(this.curveName);c.writeMpInt(a);return c.toUint8Array()}async importPublicSpki(t){const{spki:e,crypto:i}=t;return i.subtle.importKey("spki",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])}async exportPublicSpki(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("spki",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivatePkcs8(t){const{pkcs8:e,crypto:i}=t;return i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])}async exportPrivatePkcs8(t){const{privateKey:e,crypto:i}=t;const r=await i.subtle.exportKey("pkcs8",e);return n.BufferSourceConverter.toUint8Array(r)}async exportPrivateSsh(t){const{privateKey:e,crypto:i,jwk:r}=t;const s=r||await i.subtle.exportKey("jwk",e);if(!s.d||!s.x||!s.y){throw new Lp("ECDSA private key JWK missing required parameters")}const o=new Uint8Array(n.Convert.FromBase64Url(s.x));const a=new Uint8Array(n.Convert.FromBase64Url(s.y));const c=new Uint8Array(n.Convert.FromBase64Url(s.d));const u=new Uint8Array(1+o.length+a.length);u[0]=4;u.set(o,1);u.set(a,1+o.length);const l=new qp;l.writeString(this.sshType);l.writeString(this.curveName);l.writeMpInt(u);l.writeMpInt(c);return l.toUint8Array()}async importPrivateSsh(t){const{sshKey:e,crypto:i}=t;const r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");const s=n.Convert.FromBase64(r);const o=new Qp(n.BufferSourceConverter.toUint8Array(s));const a=o.readBytes(15);if(n.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new Fp("invalid magic string")}const c=o.readString();o.readString();o.readString();if(c!=="none"){throw new Vp(c)}const u=o.readUint32();if(u!==1){throw new Fp("multiple keys not supported")}const l=o.readUint32();o.readBytes(l);const h=o.readUint32();const p=o.readBytes(h);const d=new Qp(p);const f=d.readUint32();const y=d.readUint32();if(f!==y){throw new Fp("invalid checkints")}d.readString();d.readString();const S=d.readMpInt();const A=d.readMpInt();d.readString();if(S[0]!==4){throw new Lp("invalid ECDSA public key point format")}const v=Math.floor((S.length-1)/2);const m=S.slice(1,1+v);const C=S.slice(1+v);const g={kty:"EC",crv:this.namedCurve,x:n.Convert.ToBase64Url(m),y:n.Convert.ToBase64Url(C),d:n.Convert.ToBase64Url(A)};return i.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])}async sign(t){const{privateKey:e,data:i,crypto:r,hash:s}=t;const o=this.getHashAlgorithm();if(s&&s!==o){throw new Lp(`ECDSA ${this.namedCurve} requires ${o}, got ${s}`)}const a=await r.subtle.sign({name:"ECDSA",hash:o},e,i);return n.BufferSourceConverter.toUint8Array(a)}async verify(t){const{publicKey:e,signature:i,data:r,crypto:s,hash:n}=t;const o=this.getHashAlgorithm();if(n&&n!==o){throw new Lp(`ECDSA ${this.namedCurve} requires ${o}, got ${n}`)}return s.subtle.verify({name:"ECDSA",hash:o},e,i,r)}encodeSignature(t){const{signature:e,algo:i}=t;if(i.startsWith("ecdsa-sha2-")){const t=this.getSignatureCoordLength();const r=e.subarray(0,t);const s=e.subarray(t);const n=new qp;n.writeString(i);const o=new qp;o.writeMpInt(r,true);o.writeMpInt(s,true);const a=o.toUint8Array();n.writeUint32(a.length);n.writeBytes(a);return n.toUint8Array()}const r=new qp;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()}decodeSignature(t){const{signature:e}=t;const i=new Qp(e);const r=i.readString();const s=i.readUint32();const n=i.readBytes(s);if(r.startsWith("ecdsa-sha2-")){const t=new Qp(n);let e=t.readMpInt();let i=t.readMpInt();if(e[0]===0&&e.length>1&&(e[1]&128)===0){e=e.slice(1)}if(i[0]===0&&i.length>1&&(i[1]&128)===0){i=i.slice(1)}const s=this.getExpectedLength();const o=new Uint8Array(s);const a=new Uint8Array(s);if(e.length<=s){o.set(e,s-e.length)}else{o.set(e.slice(e.length-s),0)}if(i.length<=s){a.set(i,s-i.length)}else{a.set(i.slice(i.length-s),0)}const c=new Uint8Array([...o,...a]);return{signature:c,algo:r}}return{signature:n,algo:r}}supportsCryptoKey(t){return t.algorithm.name==="ECDSA"&&t.algorithm.namedCurve===this.namedCurve}parsePublicKey(t){const e=t.readString();if(e!==this.curveName){throw new Lp(`ECDSA certificate curve name ${e}, expected ${this.curveName}`)}const i=t.readBytes(t.readUint32());const r=new qp;r.writeString(this.sshType);r.writeString(e);r.writeMpInt(i);return{type:this.sshType,keyData:r.toUint8Array()}}writePublicKey(t,e){const i=new Qp(e.keyData);i.readString();const r=i.readString();const s=i.readMpInt();t.writeString(r);t.writeUint32(s.length);t.writeBytes(s)}getCertificateType(){return`${this.sshType}-cert-v01@openssh.com`}getSignatureAlgo(){return this.sshType}}const Yp=new Jp("nistp256","ecdsa-sha2-nistp256","P-256");const Zp=new Jp("nistp384","ecdsa-sha2-nistp384","P-384");const Xp=new Jp("nistp521","ecdsa-sha2-nistp521","P-521");class td{async importPublicSsh(t){const{blob:e,crypto:i}=t;const r=new Qp(e);r.readString();const s=r.readUint32();if(s!==32){throw new Lp(`Ed25519 key length ${s}, expected 32`)}const n=r.readBytes(s);return i.subtle.importKey("raw",n,"Ed25519",true,["verify"])}async exportPublicSsh(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("jwk",e);if(!r.x){throw new Lp("Ed25519 JWK missing x parameter")}const s=new Uint8Array(n.Convert.FromBase64Url(r.x));const o=new qp;o.writeString("ssh-ed25519");o.writeUint32(s.length);o.writeBytes(s);return o.toUint8Array()}async importPublicSpki(t){const{spki:e,crypto:i}=t;return i.subtle.importKey("spki",e,"Ed25519",true,["verify"])}async exportPublicSpki(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("spki",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivatePkcs8(t){const{pkcs8:e,crypto:i}=t;return i.subtle.importKey("pkcs8",e,"Ed25519",true,["sign"])}async exportPrivatePkcs8(t){const{privateKey:e,crypto:i}=t;const r=await i.subtle.exportKey("pkcs8",e);return n.BufferSourceConverter.toUint8Array(r)}async exportPrivateSsh(t){const{privateKey:e,crypto:i,jwk:r}=t;const s=r||await i.subtle.exportKey("jwk",e);if(!s.d||!s.x){throw new Lp("Ed25519 private key JWK missing required parameters")}const o=new Uint8Array(n.Convert.FromBase64Url(s.d));const a=new Uint8Array(n.Convert.FromBase64Url(s.x));const c=new qp;c.writeString("ssh-ed25519");c.writeUint32(a.length);c.writeBytes(a);const u=new Uint8Array(64);u.set(o,0);u.set(a,32);c.writeUint32(u.length);c.writeBytes(u);return c.toUint8Array()}async importPrivateSsh(t){const{sshKey:e,crypto:i}=t;const r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");const s=n.Convert.FromBase64(r);const o=new Qp(n.BufferSourceConverter.toUint8Array(s));const a=o.readBytes(15);if(n.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new Fp("invalid magic string")}const c=o.readString();o.readString();o.readString();if(c!=="none"){throw new Vp(c)}const u=o.readUint32();if(u!==1){throw new Fp("multiple keys not supported")}const l=o.readUint32();o.readBytes(l);const h=o.readUint32();const p=o.readBytes(h);const d=new Qp(p);const f=d.readUint32();const y=d.readUint32();if(f!==y){throw new Fp("invalid checkints")}d.readString();const S=d.readUint32();const A=d.readBytes(S);const v=d.readUint32();const m=d.readBytes(v);d.readString();const C=m.slice(0,32);const g={kty:"OKP",crv:"Ed25519",d:n.Convert.ToBase64Url(C),x:n.Convert.ToBase64Url(A)};return i.subtle.importKey("jwk",g,"Ed25519",true,["sign"])}async sign(t){const{privateKey:e,data:i,crypto:r}=t;const s=await r.subtle.sign("Ed25519",e,i);return n.BufferSourceConverter.toUint8Array(s)}async verify(t){const{publicKey:e,signature:i,data:r,crypto:s}=t;return s.subtle.verify("Ed25519",e,i,r)}encodeSignature(t){const{signature:e,algo:i}=t;const r=new Uint8Array(e);const s=new qp;s.writeString(i);s.writeUint32(r.length);s.writeBytes(r);return s.toUint8Array()}decodeSignature(t){const{signature:e}=t;const i=new Qp(e);const r=i.readString();const s=i.readUint32();const n=i.readBytes(s);return{signature:n,algo:r}}supportsCryptoKey(t){return t.algorithm.name==="Ed25519"}parsePublicKey(t){const e=t.readBytes(t.readUint32());const i=new qp;i.writeString("ssh-ed25519");i.writeUint32(e.length);i.writeBytes(e);return{type:"ssh-ed25519",keyData:i.toUint8Array()}}writePublicKey(t,e){const i=new Qp(e.keyData);i.readString();const r=i.readUint32();const s=i.readBytes(r);t.writeUint32(s.length);t.writeBytes(s)}getCertificateType(){return"ssh-ed25519-cert-v01@openssh.com"}getSignatureAlgo(){return"ssh-ed25519"}}const ed=new Map;class id{static get(t){const e=ed.get(t);if(!e){throw new _p(t,Array.from(ed.keys()))}return e}static register(t,e){ed.set(t,e)}static getSshTypeFromCryptoKey(t){for(const[e,i]of ed.entries()){if(i.supportsCryptoKey(t)){return e}}throw new _p(t.algorithm.name,Array.from(ed.keys()))}static certTypeToKeyType(t){const e={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return e[t]}static getSupportedCertTypes(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})}}id.register("ssh-ed25519",new td);id.register("ssh-rsa",new zp("SHA-256"));id.register("rsa-sha2-256",new zp("SHA-256"));id.register("rsa-sha2-512",new zp("SHA-512"));id.register("ecdsa-sha2-nistp256",Yp);id.register("ecdsa-sha2-nistp384",Zp);id.register("ecdsa-sha2-nistp521",Xp);function rd(t){const e=typeof t==="string"?t.trim().split(/\s+/):null;if(!e||e.length<2){throw new jp("Invalid SSH public key format")}const i=e[0];const r=new Uint8Array(n.Convert.FromBase64(e[1]));const s=e.length>2?e.slice(2).join(" "):undefined;const o=new Qp(r);const a=o.readString();if(a!==i){throw new jp("Key type mismatch")}return{type:i,keyData:r,comment:s}}function sd(t){const e=n.Convert.ToBase64(t.keyData);const i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function nd(t){if(typeof t==="string"){const e=t.trim().split(/\s+/);if(e.length<2){throw new jp("SSH certificate string","type base64 [comment]")}const i=e[0];const r=new Uint8Array(n.Convert.FromBase64(e[1]));const s=e.length>2?e.slice(2).join(" "):undefined;const o=new Qp(r);const a=o.readString();if(a!==i){throw new jp(`certificate blob type ${a}`,`expected ${i}`)}return{type:i,keyData:r,comment:s}}else{const e=new Qp(t);const i=e.readString();const r=t.slice(e.getOffset());return{type:i,keyData:r}}}function od(t){const e=new Qp(t);const i=e.readString();const r=e.readBytes(e.readUint32());const s=id.certTypeToKeyType(i);if(!s){throw new Up(i,id.getSupportedCertTypes())}const n=id.get(s);const o=n.parsePublicKey(e);const a=s;const c=e.readUint64();const u=e.readUint32();const l=u===1?"user":"host";const h=e.readString();const p=e.readUint32();const d=e.readBytes(p);const f=[];if(d.length>0){const t=new Qp(d);while(t.getOffset()<d.length){try{const e=t.readString();f.push(e)}catch{break}}}const y=e.readUint64();const S=e.readUint64();const A={};const v=e.readUint32();const m=e.readBytes(v);if(m.length>0){const t=new Qp(m);while(t.getOffset()<m.length){try{const e=t.readString();const i=t.readBytes(t.readUint32());const r=i.length===0?"":Wp.decode(i);A[e]=r}catch{break}}}const C={};const g=e.readUint32();const w=e.readBytes(g);if(w.length>0){const t=new Qp(w);while(t.getOffset()<w.length){try{const e=t.readString();const i=t.readBytes(t.readUint32());const r=i.length===0?"":Wp.decode(i);C[e]=r}catch{break}}}const E=e.readUint32();const b=e.readBytes(E);const P=e.readUint32();const D=e.readBytes(P);const I=new Qp(D);const B=I.readString();const x={type:B,keyData:D};const T=e.readUint32();const O=e.readBytes(T);return{nonce:r,keyType:a,publicKey:o,serial:c,type:l,keyId:h,validPrincipals:f,validAfter:y,validBefore:S,criticalOptions:A,extensions:C,reserved:b,signatureKey:x,signature:O}}function ad(t){const e=n.Convert.ToBase64(t.keyData);const i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function cd(t){const e=new Qp(t);if(t.length>=6&&(new TextDecoder).decode(t.subarray(0,6))==="SSHSIG"){return ud(e)}else{return ld(e)}}function ud(t){const e=t.readBytes(6);const i=(new TextDecoder).decode(e);if(i!=="SSHSIG"){throw new jp(i,"SSHSIG")}const r=t.readUint32();const s=t.readUint32();const n=t.readBytes(s);const o=t.readString();const a=t.readString();const c=t.readString();const u=t.readUint32();const l=t.readBytes(u);const h=new Qp(l);const p=h.readString();const d=h.readUint32();const f=h.readBytes(d);return{format:"ssh-signature",algorithm:p,signature:f,version:r,publicKey:n,namespace:o,reserved:a,hashAlgorithm:c}}function ld(t){const e=t.readString();const i=t.readUint32();const r=t.readBytes(i);return{format:"legacy",algorithm:e,signature:r}}function hd(t){if(t.format==="ssh-signature"){return pd(t)}else{return dd(t)}}function pd(t){const e=new qp;e.writeBytes((new TextEncoder).encode("SSHSIG"));e.writeUint32(t.version||1);if(t.publicKey){e.writeUint32(t.publicKey.length);e.writeBytes(t.publicKey)}else{e.writeUint32(0)}e.writeString(t.namespace||"file");e.writeString(t.reserved||"");e.writeString(t.hashAlgorithm||"sha512");const i=new qp;i.writeString(t.algorithm);i.writeUint32(t.signature.length);i.writeBytes(t.signature);const r=i.toUint8Array();e.writeUint32(r.length);e.writeBytes(r);return e.toUint8Array()}function dd(t){const e=new qp;e.writeString(t.algorithm);e.writeUint32(t.signature.length);e.writeBytes(t.signature);return e.toUint8Array()}class fd{}class yd extends fd{static TYPE="public-key";type=yd.TYPE;blob;cachedCryptoKey;constructor(t){super();this.blob=t}async getCryptoKey(t=Kp()){if(!this.cachedCryptoKey){const e=id.get(this.blob.type);this.cachedCryptoKey=await e.importPublicSsh({blob:this.blob.keyData,crypto:t})}return this.cachedCryptoKey}static async fromSSH(t,e=Kp()){const i=rd(t);const r=id.get(i.type);await r.importPublicSsh({blob:i.keyData,crypto:e});return new yd(i)}static async fromSPKI(t,e,i=Kp()){const r=id.get(e);const s=await r.importPublicSpki({spki:t,crypto:i});const n=await r.exportPublicSsh({publicKey:s,crypto:i});const o={type:e,keyData:n};return new yd(o)}static async fromWebCrypto(t,e,i=Kp()){const r=e||id.getSshTypeFromCryptoKey(t);const s=id.get(r);const n=await s.exportPublicSsh({publicKey:t,crypto:i});const o={type:r,keyData:n};return new yd(o)}async export(t="ssh",e=Kp()){if(t==="ssh"){return sd(this.blob)}else if(t==="spki"){const t=await this.getCryptoKey(e);const i=id.get(this.blob.type);const r=await i.exportPublicSpki({publicKey:t,crypto:e});return new Uint8Array(r)}throw new _p(`Unsupported export format: ${t}`)}async toSSH(){const t=await this.export("ssh");return t}async toSPKI(){const t=await this.export("spki");return t}async toWebCrypto(t=Kp()){return this.getCryptoKey(t)}async verify(t,e,i,r=Kp()){const s=id.get(t);const n=await this.toWebCrypto(r);return s.verify({publicKey:n,signature:e,data:i,crypto:r})}get keyType(){return this.blob.type}get comment(){return this.blob.comment}getBlob(){return{...this.blob}}async thumbprint(t="sha256",e=Kp()){const i=t==="sha256"?"SHA-256":"SHA-512";const r=this.blob.keyData;const s=await e.subtle.digest(i,r);return new Uint8Array(s)}}class Sd extends fd{static TYPE="signature";type=Sd.TYPE;blob;format;algorithm;signature;version;publicKey;namespace;reserved;hashAlgorithm;constructor(t){super();this.blob=t;this.format=t.format;this.algorithm=t.algorithm;this.signature=t.signature;this.version=t.version;this.namespace=t.namespace;this.reserved=t.reserved;this.hashAlgorithm=t.hashAlgorithm;if(t.publicKey){const e=new Qp(t.publicKey);const i=e.readString();this.publicKey=new yd({type:i,keyData:t.publicKey})}}static parse(t){const e=cd(t);return new Sd(e)}static fromBlob(t){return new Sd(t)}static fromBase64(t){const e=new Uint8Array(n.Convert.FromBase64(t));return Sd.parse(e)}static fromText(t){const e=t.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return Sd.fromBase64(e)}serialize(){return hd(this.blob)}toBase64(){return n.Convert.ToBase64(this.serialize())}toText(){const t=this.toBase64();const e=[];for(let i=0;i<t.length;i+=70){e.push(t.substring(i,i+70))}return["-----BEGIN SSH SIGNATURE-----",...e,"-----END SSH SIGNATURE-----"].join("\n")}async toSSH(){return this.toText()}async verify(t,e){const i=id.get(this.algorithm);const r=await e["getCryptoKey"]();const s=Kp();let n=t;if(this.format==="ssh-signature"){const e=this.hashAlgorithm||"sha512";const i=this.namespace||"file";const r=this.reserved||"";const o=e==="sha256"?"SHA-256":"SHA-512";const a=await s.subtle.digest(o,t);const c=new Uint8Array(a);const u=new qp;u.writeBytes((new TextEncoder).encode("SSHSIG"));u.writeString(i);u.writeString(r);u.writeString(e);u.writeUint32(c.length);u.writeBytes(c);n=u.toUint8Array()}let o;if(this.algorithm==="rsa-sha2-256"){o="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){o="SHA-512"}let a;if(this.format==="legacy"||this.format==="ssh-signature"){const t=new qp;t.writeString(this.algorithm);t.writeUint32(this.signature.length);t.writeBytes(this.signature);const e=t.toUint8Array();const r=i.decodeSignature({signature:e});a=r.signature}else{a=this.signature}return i.verify({publicKey:r,signature:a,data:n,crypto:s,hash:o})}static fromLegacy(t,e){const i=id.get(t);const r=i.encodeSignature({signature:e,algo:t});const s=new Qp(r);s.readString();const n=s.readUint32();const o=s.readBytes(n);return new Sd({format:"legacy",algorithm:t,signature:o})}static fromSshSignature(t,e,i={}){const r={format:"ssh-signature",algorithm:t,signature:e,version:i.version||1,publicKey:i.publicKey?i.publicKey.getBlob().keyData:undefined,namespace:i.namespace||"file",reserved:i.reserved||"",hashAlgorithm:i.hashAlgorithm||"sha512"};return new Sd(r)}static async sign(t,e,i,r={}){const{format:s="legacy",namespace:n="file"}=r;if(s==="legacy"){const r=await e.sign(t,i);const s=t||e.keyType;return Sd.fromLegacy(s,r)}else{const r=t;const s=id.get(r);const o=t==="rsa-sha2-256"?"sha256":"sha512";const a=await e.getPublicKey();const c=Kp();const u=o==="sha256"?"SHA-256":"SHA-512";const l=await c.subtle.digest(u,i);const h=new Uint8Array(l);const p=new qp;p.writeBytes((new TextEncoder).encode("SSHSIG"));p.writeString(n);p.writeString("");p.writeString(o);p.writeUint32(h.length);p.writeBytes(h);const d=p.toUint8Array();const f=await e.sign(r,d);const y=s.encodeSignature({signature:f,algo:r});const S=new Qp(y);S.readString();const A=S.readUint32();const v=S.readBytes(A);return Sd.fromSshSignature(r,v,{namespace:n,hashAlgorithm:o,publicKey:a})}}}let Ad=class t extends fd{static TYPE="certificate";type=t.TYPE;_blob;data;_validAfter;_validBefore;keyId;principals;certType;serial;validAfter;validBefore;publicKey;signatureKey;criticalOptions;extensions;constructor(t){super();this._blob=t;this.data=od(t.keyData);this._validAfter=this.data.validAfter;this._validBefore=this.data.validBefore;this.keyId=this.data.keyId;this.principals=this.data.validPrincipals;this.certType=this.data.type;this.serial=this.data.serial;this.validAfter=new Date(Number(this.data.validAfter)*1e3);this.validBefore=new Date(Number(this.data.validBefore)*1e3);this.publicKey=new yd(this.data.publicKey);this.signatureKey=new yd(this.data.signatureKey);this.criticalOptions={...this.data.criticalOptions};this.extensions={...this.data.extensions}}static async fromSSH(e){const i=nd(e);return new t(i)}static async fromBlob(e){return new t(e)}async toSSH(){return ad(this._blob)}toBlob(){return{...this._blob}}get blob(){return this.toBlob()}validate(t=new Date){const e=BigInt(Math.floor(t.getTime()/1e3));const i=this._validAfter;const r=this._validBefore;const s=0xffffffffffffffffn;const n=r===s?e:r;return e>=i&&e<=n}async verify(t,e=Kp()){const i=t||this.signatureKey;const r=this.getSignedData();const s=Sd.parse(this.data.signature);const n=id.get(s.algorithm);const o=await i.toWebCrypto(e);return n.verify({publicKey:o,signature:s.signature,data:r,crypto:e})}getSignedData(){const t=new Qp(this._blob.keyData);t.readString();t.readBytes(t.readUint32());if(this.data.keyType==="ssh-ed25519"){t.readBytes(t.readUint32())}else if(this.data.keyType==="ssh-rsa"){t.readBytes(t.readUint32());t.readBytes(t.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){t.readString();t.readBytes(t.readUint32())}t.readUint64();t.readUint32();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readUint64();t.readUint64();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());const e=t.getOffset();return this._blob.keyData.slice(0,e)}};var vd=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var md=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var Cd;class gd{constructor(t){Cd.set(this,void 0);const e=nd(t.trim());vd(this,Cd,new Ad(e),"f");this.notBefore=md(this,Cd,"f").validAfter;this.notAfter=md(this,Cd,"f").validBefore;this.validity=oo(this.notBefore,this.notAfter);this.type=[md(this,Cd,"f").blob.type,md(this,Cd,"f").certType,md(this,Cd,"f").type].join(" ");this.serialNumber=md(this,Cd,"f").serial.toString();this.keyId=md(this,Cd,"f").keyId;this.principals=md(this,Cd,"f").principals;this.extensions=md(this,Cd,"f").extensions;this.criticalOptions=md(this,Cd,"f").criticalOptions}async parseSignatureKey(){const t=await md(this,Cd,"f").signatureKey.toWebCrypto();const e=md(this,Cd,"f").signatureKey.getBlob();const i=await md(this,Cd,"f").signatureKey.thumbprint("sha256");this.signatureKey={algorithm:t.algorithm.name,type:e.type,value:await md(this,Cd,"f").signatureKey.toSSH(),thumbprint:n.Convert.ToBase64(i)}}async parsePublicKey(){const t=await md(this,Cd,"f").publicKey.toWebCrypto();const e=md(this,Cd,"f").publicKey.getBlob();const i=await md(this,Cd,"f").publicKey.thumbprint("sha256");this.publicKey={algorithm:t.algorithm.name,type:e.type,value:await md(this,Cd,"f").publicKey.toSSH(),thumbprint:n.Convert.ToBase64(i)}}async toString(t="pem"){return md(this,Cd,"f").toSSH()}get commonName(){return md(this,Cd,"f").principals.join("_")||md(this,Cd,"f").keyId||md(this,Cd,"f").certType}async downloadAsSSH(t){o.certSSH.asSSH(await this.toString(),t||this.commonName)}}Cd=new WeakMap;export{ca as $,Bu as A,np as B,Es as C,o as D,js as E,rp as F,sp as G,Rl as H,kl as I,Ol as J,Hl as K,Cl as L,Ml as M,pa as N,xl as O,_u as P,Il as Q,wn as R,Pl as S,Kl as T,hp as U,Nl as V,Ul as W,El as X,Np as Y,oa as Z,no as _,oo as a,es as a$,Ke as a0,Cc as a1,Pc as a2,ms as a3,Eu as a4,Au as a5,hr as a6,ur as a7,ds as a8,ru as a9,wr as aA,vr as aB,ar as aC,Zi as aD,Qi as aE,Gi as aF,Vi as aG,wu as aH,nu as aI,lr as aJ,cr as aK,ps as aL,tu as aM,fa as aN,as as aO,ns as aP,Ic as aQ,xc as aR,vc as aS,fc as aT,Ha as aU,ac as aV,lc as aW,Na as aX,ka as aY,wa as aZ,rs as a_,$c as aa,va as ab,ls as ac,os as ad,Bc as ae,Tc as af,mc as ag,Ac as ah,Ua as ai,uc as aj,hc as ak,Ka as al,Ra as am,Ia as an,ss as ao,is as ap,Zr as aq,zr as ar,Gr as as,Lr as at,Ur as au,Mr as av,kr as aw,Tr as ax,Br as ay,Pr as az,n as b,Yr as b0,Qr as b1,$r as b2,_r as b3,Kr as b4,Nr as b5,Or as b6,xr as b7,Ir as b8,Er as b9,_e as bA,Cu as bB,au as bC,cu as bD,gr as ba,dr as bb,tr as bc,Yi as bd,Wi as be,Li as bf,_i as bg,Hh as bh,nh as bi,rh as bj,ih as bk,sh as bl,gd as bm,Oi as bn,Ri as bo,er as bp,rr as bq,Ni as br,gi as bs,yi as bt,Ne as bu,fi as bv,Re as bw,mi as bx,ba as by,Da as bz,Lu as c,t as d,Ci as e,Ls as f,Ln as g,Gn as h,Is as i,Pn as j,In as k,Dn as l,$u as m,sl as n,Ds as o,Xr as p,Ai as q,Tp as r,bp as s,Ep as t,gl as u,Tl as v,Bl as w,Dl as x,bl as y,xp as z};
135
- //# sourceMappingURL=p-PCn0WXhQ.js.map
134
+ */const Lu=t=>{if(_u.isPem(t)){return _u.decode(t)[0]}if(n.Convert.isHex(t)){return n.Convert.FromHex(t)}if(n.Convert.isBase64(t)){return n.Convert.FromBase64(t)}if(n.Convert.isBase64Url(t)){return n.Convert.FromBase64Url(t)}return n.Convert.FromBinary(t)};const $u=async(t,e)=>{const i=Vu.get();if(i.subtle){return i.subtle.digest(t,e)}return undefined};class Gu{constructor(t={}){this.acIssuer=new Mi;this.acSerial=0;this.attrs=[];Object.assign(this,t)}}gi([yi({type:Mi})],Gu.prototype,"acIssuer",void 0);gi([yi({type:Ne.Integer})],Gu.prototype,"acSerial",void 0);gi([yi({type:Xr,repeated:"sequence"})],Gu.prototype,"attrs",void 0);var Wu;let Qu=Wu=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Wu.prototype)}};Qu=Wu=gi([fi({type:Re.Sequence,itemType:Ne.ObjectIdentifier})],Qu);class qu{constructor(t={}){this.permitUnSpecified=true;Object.assign(this,t)}}gi([yi({type:Ne.Integer,optional:true})],qu.prototype,"pathLenConstraint",void 0);gi([yi({type:Qu,implicit:true,context:0,optional:true})],qu.prototype,"permittedAttrs",void 0);gi([yi({type:Qu,implicit:true,context:1,optional:true})],qu.prototype,"excludedAttrs",void 0);gi([yi({type:Ne.Boolean,defaultValue:true})],qu.prototype,"permitUnSpecified",void 0);class zu{constructor(t={}){this.issuer=new zi;this.serial=new ArrayBuffer(0);this.issuerUID=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:zi})],zu.prototype,"issuer",void 0);gi([yi({type:Ne.Integer,converter:_e})],zu.prototype,"serial",void 0);gi([yi({type:Ne.BitString,optional:true})],zu.prototype,"issuerUID",void 0);var Ju;(function(t){t[t["publicKey"]=0]="publicKey";t[t["publicKeyCert"]=1]="publicKeyCert";t[t["otherObjectTypes"]=2]="otherObjectTypes"})(Ju||(Ju={}));class Yu{constructor(t={}){this.digestedObjectType=Ju.publicKey;this.digestAlgorithm=new fs;this.objectDigest=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.Enumerated})],Yu.prototype,"digestedObjectType",void 0);gi([yi({type:Ne.ObjectIdentifier,optional:true})],Yu.prototype,"otherObjectTypeID",void 0);gi([yi({type:fs})],Yu.prototype,"digestAlgorithm",void 0);gi([yi({type:Ne.BitString})],Yu.prototype,"objectDigest",void 0);class Zu{constructor(t={}){Object.assign(this,t)}}gi([yi({type:zi,optional:true})],Zu.prototype,"issuerName",void 0);gi([yi({type:zu,context:0,implicit:true,optional:true})],Zu.prototype,"baseCertificateID",void 0);gi([yi({type:Yu,context:1,implicit:true,optional:true})],Zu.prototype,"objectDigestInfo",void 0);let Xu=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Mi,repeated:"sequence"})],Xu.prototype,"v1Form",void 0);gi([yi({type:Zu,context:0,implicit:true})],Xu.prototype,"v2Form",void 0);Xu=gi([fi({type:Re.Choice})],Xu);class tl{constructor(t={}){this.notBeforeTime=new Date;this.notAfterTime=new Date;Object.assign(this,t)}}gi([yi({type:Ne.GeneralizedTime})],tl.prototype,"notBeforeTime",void 0);gi([yi({type:Ne.GeneralizedTime})],tl.prototype,"notAfterTime",void 0);class el{constructor(t={}){Object.assign(this,t)}}gi([yi({type:zu,implicit:true,context:0,optional:true})],el.prototype,"baseCertificateID",void 0);gi([yi({type:zi,implicit:true,context:1,optional:true})],el.prototype,"entityName",void 0);gi([yi({type:Yu,implicit:true,context:2,optional:true})],el.prototype,"objectDigestInfo",void 0);var il;(function(t){t[t["v2"]=1]="v2"})(il||(il={}));class rl{constructor(t={}){this.version=il.v2;this.holder=new el;this.issuer=new Xu;this.signature=new fs;this.serialNumber=new ArrayBuffer(0);this.attrCertValidityPeriod=new tl;this.attributes=[];Object.assign(this,t)}}gi([yi({type:Ne.Integer})],rl.prototype,"version",void 0);gi([yi({type:el})],rl.prototype,"holder",void 0);gi([yi({type:Xu})],rl.prototype,"issuer",void 0);gi([yi({type:fs})],rl.prototype,"signature",void 0);gi([yi({type:Ne.Integer,converter:_e})],rl.prototype,"serialNumber",void 0);gi([yi({type:tl})],rl.prototype,"attrCertValidityPeriod",void 0);gi([yi({type:Xr,repeated:"sequence"})],rl.prototype,"attributes",void 0);gi([yi({type:Ne.BitString,optional:true})],rl.prototype,"issuerUniqueID",void 0);gi([yi({type:Cs,optional:true})],rl.prototype,"extensions",void 0);class sl{constructor(t={}){this.acinfo=new rl;this.signatureAlgorithm=new fs;this.signatureValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:rl})],sl.prototype,"acinfo",void 0);gi([yi({type:fs})],sl.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],sl.prototype,"signatureValue",void 0);var nl;(function(t){t[t["unmarked"]=1]="unmarked";t[t["unclassified"]=2]="unclassified";t[t["restricted"]=4]="restricted";t[t["confidential"]=8]="confidential";t[t["secret"]=16]="secret";t[t["topSecret"]=32]="topSecret"})(nl||(nl={}));class ol extends Me{}class al{constructor(t={}){this.type="";this.value=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier,implicit:true,context:0})],al.prototype,"type",void 0);gi([yi({type:Ne.Any,implicit:true,context:1})],al.prototype,"value",void 0);class cl{constructor(t={}){this.policyId="";this.classList=new ol(nl.unclassified);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],cl.prototype,"policyId",void 0);gi([yi({type:ol,defaultValue:new ol(nl.unclassified)})],cl.prototype,"classList",void 0);gi([yi({type:al,repeated:"set"})],cl.prototype,"securityCategories",void 0);class ul{constructor(t={}){Object.assign(this,t)}}gi([yi({type:Ke})],ul.prototype,"cotets",void 0);gi([yi({type:Ne.ObjectIdentifier})],ul.prototype,"oid",void 0);gi([yi({type:Ne.Utf8String})],ul.prototype,"string",void 0);class ll{constructor(t={}){this.values=[];Object.assign(this,t)}}gi([yi({type:zi,implicit:true,context:0,optional:true})],ll.prototype,"policyAuthority",void 0);gi([yi({type:ul,repeated:"sequence"})],ll.prototype,"values",void 0);var hl;class pl{constructor(t={}){this.targetCertificate=new zu;Object.assign(this,t)}}gi([yi({type:zu})],pl.prototype,"targetCertificate",void 0);gi([yi({type:Mi,optional:true})],pl.prototype,"targetName",void 0);gi([yi({type:Yu,optional:true})],pl.prototype,"certDigestInfo",void 0);let dl=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Mi,context:0,implicit:true})],dl.prototype,"targetName",void 0);gi([yi({type:Mi,context:1,implicit:true})],dl.prototype,"targetGroup",void 0);gi([yi({type:pl,context:2,implicit:true})],dl.prototype,"targetCert",void 0);dl=gi([fi({type:Re.Choice})],dl);let fl=hl=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,hl.prototype)}};fl=hl=gi([fi({type:Re.Sequence,itemType:dl})],fl);var yl;let Sl=yl=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,yl.prototype)}};Sl=yl=gi([fi({type:Re.Sequence,itemType:fl})],Sl);class Al{constructor(t={}){Object.assign(this,t)}}gi([yi({type:zi,implicit:true,context:0,optional:true})],Al.prototype,"roleAuthority",void 0);gi([yi({type:Mi,implicit:true,context:1})],Al.prototype,"roleName",void 0);class vl{constructor(t={}){this.service=new Mi;this.ident=new Mi;Object.assign(this,t)}}gi([yi({type:Mi})],vl.prototype,"service",void 0);gi([yi({type:Mi})],vl.prototype,"ident",void 0);gi([yi({type:Ke,optional:true})],vl.prototype,"authInfo",void 0);const ml="0.4.0.9496";const Cl=`${ml}.6`;let gl=class t{constructor(t={}){this.codeAuthority=new Mi;this.codeId=new Mi;this.shortName="";this.shortDescription="";Object.assign(this,t)}};gi([yi({type:Mi,context:0})],gl.prototype,"codeAuthority",void 0);gi([yi({type:Mi,context:1})],gl.prototype,"codeId",void 0);gi([yi({type:Ne.Utf8String,context:2})],gl.prototype,"shortName",void 0);gi([yi({type:Ne.Utf8String,context:3})],gl.prototype,"shortDescription",void 0);gl=gi([fi({type:Re.Sequence})],gl);let wl=class t extends Oi{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};wl=gi([fi({type:Re.Sequence})],wl);const El=`${ml}.1`;let bl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};bl=gi([fi({type:Re.Sequence})],bl);const Pl=`${ml}.2`;let Dl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};Dl=gi([fi({type:Re.Sequence})],Dl);const Il=`${ml}.3`;let Bl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};Bl=gi([fi({type:Re.Sequence})],Bl);const xl=`${ml}.4`;let Tl=class t extends wl{constructor(t){super(t);Object.setPrototypeOf(this,Oi.prototype)}};Tl=gi([fi({type:Re.Sequence})],Tl);const Ol=`${ml}.8`;let kl=class t{constructor(t={}){this.location="";this.base=0;this.degree=0;Object.assign(this,t)}toString(){return`${this.base} x 10^${this.degree} ${this.location}`}};gi([yi({type:Ne.PrintableString})],kl.prototype,"location",void 0);gi([yi({type:Ne.Integer})],kl.prototype,"base",void 0);gi([yi({type:Ne.Integer})],kl.prototype,"degree",void 0);kl=gi([fi({type:Re.Sequence})],kl);const Rl=`${ml}.9`;let Nl=class t{constructor(t={}){this.stars5=0;this.stars4=0;this.stars3=0;this.stars2=0;this.stars1=0;Object.assign(this,t)}};gi([yi({type:Ne.Integer})],Nl.prototype,"stars5",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars4",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars3",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars2",void 0);gi([yi({type:Ne.Integer})],Nl.prototype,"stars1",void 0);Nl=gi([fi({type:Re.Sequence})],Nl);const Ml=`${ml}.5`;let Kl=class t{constructor(t={}){this.DNBvsDNO=new Me(0);this.DNBvsDNT=new Me(0);this.DNOvsDNT=new Me(0);Object.assign(this,t)}};gi([yi({type:Me,context:0})],Kl.prototype,"DNBvsDNO",void 0);gi([yi({type:Me,context:1})],Kl.prototype,"DNBvsDNT",void 0);gi([yi({type:Me,context:2})],Kl.prototype,"DNOvsDNT",void 0);Kl=gi([fi({type:Re.Sequence})],Kl);const Hl=`${ml}.7`;let Ul=class t{constructor(t={}){this.assessmentAuthority=new Mi;this.assessmentRef=new Mi;this.assessmentLocation=new Mi;this.dataStorageTerritory="";this.description="";Object.assign(this,t)}};gi([yi({type:Mi,context:0})],Ul.prototype,"assessmentAuthority",void 0);gi([yi({type:Mi,context:1})],Ul.prototype,"assessmentRef",void 0);gi([yi({type:Mi,context:2})],Ul.prototype,"assessmentLocation",void 0);gi([yi({type:Ne.PrintableString,context:3})],Ul.prototype,"dataStorageTerritory",void 0);gi([yi({type:Ne.Utf8String,context:4})],Ul.prototype,"description",void 0);Ul=gi([fi({type:Re.Sequence})],Ul);class jl{constructor(t={}){this.issuer=new Oi;this.serialNumber=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Oi})],jl.prototype,"issuer",void 0);gi([yi({type:Ne.Integer,converter:_e})],jl.prototype,"serialNumber",void 0);let _l=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:ss,context:0,implicit:true})],_l.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:jl})],_l.prototype,"issuerAndSerialNumber",void 0);_l=gi([fi({type:Re.Choice})],_l);var Fl;(function(t){t[t["v0"]=0]="v0";t[t["v1"]=1]="v1";t[t["v2"]=2]="v2";t[t["v3"]=3]="v3";t[t["v4"]=4]="v4";t[t["v5"]=5]="v5"})(Fl||(Fl={}));let Vl=class t extends fs{};Vl=gi([fi({type:Re.Sequence})],Vl);let Ll=class t extends fs{};Ll=gi([fi({type:Re.Sequence})],Ll);let $l=class t extends fs{};$l=gi([fi({type:Re.Sequence})],$l);let Gl=class t extends fs{};Gl=gi([fi({type:Re.Sequence})],Gl);let Wl=class t extends fs{};Wl=gi([fi({type:Re.Sequence})],Wl);let Ql=class t extends fs{};Ql=gi([fi({type:Re.Sequence})],Ql);class ql{constructor(t={}){this.attrType="";this.attrValues=[];Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],ql.prototype,"attrType",void 0);gi([yi({type:Ne.Any,repeated:"set"})],ql.prototype,"attrValues",void 0);var zl;class Jl{constructor(t={}){this.version=Fl.v0;this.sid=new _l;this.digestAlgorithm=new Vl;this.signatureAlgorithm=new Ll;this.signature=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Jl.prototype,"version",void 0);gi([yi({type:_l})],Jl.prototype,"sid",void 0);gi([yi({type:Vl})],Jl.prototype,"digestAlgorithm",void 0);gi([yi({type:ql,repeated:"set",context:0,implicit:true,optional:true,raw:true})],Jl.prototype,"signedAttrs",void 0);gi([yi({type:Ll})],Jl.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ke})],Jl.prototype,"signature",void 0);gi([yi({type:ql,repeated:"set",context:1,implicit:true,optional:true})],Jl.prototype,"unsignedAttrs",void 0);let Yl=zl=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,zl.prototype)}};Yl=zl=gi([fi({type:Re.Set,itemType:Jl})],Yl);let Zl=class t extends Jl{};Zl=gi([fi({type:Re.Sequence})],Zl);let Xl=class t extends Ss{};Xl=gi([fi({type:Re.Choice})],Xl);var th;class eh{constructor(t={}){this.otherCertFormat="";this.otherCert=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],eh.prototype,"otherCertFormat",void 0);gi([yi({type:Ne.Any})],eh.prototype,"otherCert",void 0);let ih=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Es})],ih.prototype,"certificate",void 0);gi([yi({type:sl,context:2,implicit:true})],ih.prototype,"v2AttrCert",void 0);gi([yi({type:eh,context:3,implicit:true})],ih.prototype,"other",void 0);ih=gi([fi({type:Re.Choice})],ih);let rh=th=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,th.prototype)}};rh=th=gi([fi({type:Re.Set,itemType:ih})],rh);class sh{constructor(t={}){this.contentType="";this.content=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],sh.prototype,"contentType",void 0);gi([yi({type:Ne.Any,context:0})],sh.prototype,"content",void 0);let nh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ke})],nh.prototype,"single",void 0);gi([yi({type:Ne.Any})],nh.prototype,"any",void 0);nh=gi([fi({type:Re.Choice})],nh);class oh{constructor(t={}){this.eContentType="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],oh.prototype,"eContentType",void 0);gi([yi({type:nh,context:0,optional:true})],oh.prototype,"eContent",void 0);let ah=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:Ke,context:0,implicit:true,optional:true})],ah.prototype,"value",void 0);gi([yi({type:Ke,converter:Ge,context:0,implicit:true,optional:true,repeated:"sequence"})],ah.prototype,"constructedValue",void 0);ah=gi([fi({type:Re.Choice})],ah);class ch{constructor(t={}){this.contentType="";this.contentEncryptionAlgorithm=new Gl;Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],ch.prototype,"contentType",void 0);gi([yi({type:Gl})],ch.prototype,"contentEncryptionAlgorithm",void 0);gi([yi({type:ah,optional:true})],ch.prototype,"encryptedContent",void 0);class uh{constructor(t={}){this.keyAttrId="";Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],uh.prototype,"keyAttrId",void 0);gi([yi({type:Ne.Any,optional:true})],uh.prototype,"keyAttr",void 0);var lh;class hh{constructor(t={}){this.subjectKeyIdentifier=new ss;Object.assign(this,t)}}gi([yi({type:ss})],hh.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:Ne.GeneralizedTime,optional:true})],hh.prototype,"date",void 0);gi([yi({type:uh,optional:true})],hh.prototype,"other",void 0);let ph=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:hh,context:0,implicit:true,optional:true})],ph.prototype,"rKeyId",void 0);gi([yi({type:jl,optional:true})],ph.prototype,"issuerAndSerialNumber",void 0);ph=gi([fi({type:Re.Choice})],ph);class dh{constructor(t={}){this.rid=new ph;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:ph})],dh.prototype,"rid",void 0);gi([yi({type:Ke})],dh.prototype,"encryptedKey",void 0);let fh=lh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,lh.prototype)}};fh=lh=gi([fi({type:Re.Sequence,itemType:dh})],fh);class yh{constructor(t={}){this.algorithm=new fs;this.publicKey=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:fs})],yh.prototype,"algorithm",void 0);gi([yi({type:Ne.BitString})],yh.prototype,"publicKey",void 0);let Sh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:ss,context:0,implicit:true,optional:true})],Sh.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:yh,context:1,implicit:true,optional:true})],Sh.prototype,"originatorKey",void 0);gi([yi({type:jl,optional:true})],Sh.prototype,"issuerAndSerialNumber",void 0);Sh=gi([fi({type:Re.Choice})],Sh);class Ah{constructor(t={}){this.version=Fl.v3;this.originator=new Sh;this.keyEncryptionAlgorithm=new $l;this.recipientEncryptedKeys=new fh;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Ah.prototype,"version",void 0);gi([yi({type:Sh,context:0})],Ah.prototype,"originator",void 0);gi([yi({type:Ke,context:1,optional:true})],Ah.prototype,"ukm",void 0);gi([yi({type:$l})],Ah.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:fh})],Ah.prototype,"recipientEncryptedKeys",void 0);let vh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:ss,context:0,implicit:true})],vh.prototype,"subjectKeyIdentifier",void 0);gi([yi({type:jl})],vh.prototype,"issuerAndSerialNumber",void 0);vh=gi([fi({type:Re.Choice})],vh);class mh{constructor(t={}){this.version=Fl.v0;this.rid=new vh;this.keyEncryptionAlgorithm=new $l;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],mh.prototype,"version",void 0);gi([yi({type:vh})],mh.prototype,"rid",void 0);gi([yi({type:$l})],mh.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:Ke})],mh.prototype,"encryptedKey",void 0);class Ch{constructor(t={}){this.keyIdentifier=new Ke;Object.assign(this,t)}}gi([yi({type:Ke})],Ch.prototype,"keyIdentifier",void 0);gi([yi({type:Ne.GeneralizedTime,optional:true})],Ch.prototype,"date",void 0);gi([yi({type:uh,optional:true})],Ch.prototype,"other",void 0);class gh{constructor(t={}){this.version=Fl.v4;this.kekid=new Ch;this.keyEncryptionAlgorithm=new $l;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],gh.prototype,"version",void 0);gi([yi({type:Ch})],gh.prototype,"kekid",void 0);gi([yi({type:$l})],gh.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:Ke})],gh.prototype,"encryptedKey",void 0);class wh{constructor(t={}){this.version=Fl.v0;this.keyEncryptionAlgorithm=new $l;this.encryptedKey=new Ke;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],wh.prototype,"version",void 0);gi([yi({type:Ql,context:0,optional:true})],wh.prototype,"keyDerivationAlgorithm",void 0);gi([yi({type:$l})],wh.prototype,"keyEncryptionAlgorithm",void 0);gi([yi({type:Ke})],wh.prototype,"encryptedKey",void 0);class Eh{constructor(t={}){this.oriType="";this.oriValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Eh.prototype,"oriType",void 0);gi([yi({type:Ne.Any})],Eh.prototype,"oriValue",void 0);let bh=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:mh,optional:true})],bh.prototype,"ktri",void 0);gi([yi({type:Ah,context:1,implicit:true,optional:true})],bh.prototype,"kari",void 0);gi([yi({type:gh,context:2,implicit:true,optional:true})],bh.prototype,"kekri",void 0);gi([yi({type:wh,context:3,implicit:true,optional:true})],bh.prototype,"pwri",void 0);gi([yi({type:Eh,context:4,implicit:true,optional:true})],bh.prototype,"ori",void 0);bh=gi([fi({type:Re.Choice})],bh);var Ph;let Dh=Ph=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ph.prototype)}};Dh=Ph=gi([fi({type:Re.Set,itemType:bh})],Dh);var Ih;class Bh{constructor(t={}){this.otherRevInfoFormat="";this.otherRevInfo=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Bh.prototype,"otherRevInfoFormat",void 0);gi([yi({type:Ne.Any})],Bh.prototype,"otherRevInfo",void 0);let xh=class t{constructor(t={}){this.other=new Bh;Object.assign(this,t)}};gi([yi({type:Bh,context:1,implicit:true})],xh.prototype,"other",void 0);xh=gi([fi({type:Re.Choice})],xh);let Th=Ih=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Ih.prototype)}};Th=Ih=gi([fi({type:Re.Set,itemType:xh})],Th);class Oh{constructor(t={}){Object.assign(this,t)}}gi([yi({type:rh,context:0,implicit:true,optional:true})],Oh.prototype,"certs",void 0);gi([yi({type:Th,context:1,implicit:true,optional:true})],Oh.prototype,"crls",void 0);var kh;let Rh=kh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,kh.prototype)}};Rh=kh=gi([fi({type:Re.Set,itemType:ql})],Rh);class Nh{constructor(t={}){this.version=Fl.v0;this.recipientInfos=new Dh;this.encryptedContentInfo=new ch;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Nh.prototype,"version",void 0);gi([yi({type:Oh,context:0,implicit:true,optional:true})],Nh.prototype,"originatorInfo",void 0);gi([yi({type:Dh})],Nh.prototype,"recipientInfos",void 0);gi([yi({type:ch})],Nh.prototype,"encryptedContentInfo",void 0);gi([yi({type:Rh,context:1,implicit:true,optional:true})],Nh.prototype,"unprotectedAttrs",void 0);var Mh;let Kh=Mh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Mh.prototype)}};Kh=Mh=gi([fi({type:Re.Set,itemType:Vl})],Kh);class Hh{constructor(t={}){this.version=Fl.v0;this.digestAlgorithms=new Kh;this.encapContentInfo=new oh;this.signerInfos=new Yl;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Hh.prototype,"version",void 0);gi([yi({type:Kh})],Hh.prototype,"digestAlgorithms",void 0);gi([yi({type:oh})],Hh.prototype,"encapContentInfo",void 0);gi([yi({type:rh,context:0,implicit:true,optional:true})],Hh.prototype,"certificates",void 0);gi([yi({type:Th,context:1,implicit:true,optional:true})],Hh.prototype,"crls",void 0);gi([yi({type:Yl})],Hh.prototype,"signerInfos",void 0);var Uh;class jh{constructor(t={}){this.attrId="";this.attrValues=[];Object.assign(t)}}gi([yi({type:Ne.ObjectIdentifier})],jh.prototype,"attrId",void 0);gi([yi({type:Ne.Any,repeated:"set"})],jh.prototype,"attrValues",void 0);let _h=Uh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Uh.prototype)}};_h=Uh=gi([fi({type:Re.Sequence,itemType:jh})],_h);var Fh;let Vh=Fh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Fh.prototype)}};Vh=Fh=gi([fi({type:Re.Sequence,itemType:sh})],Vh);class Lh{constructor(t={}){this.certId="";this.certValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Lh.prototype,"certId",void 0);gi([yi({type:Ne.Any,context:0})],Lh.prototype,"certValue",void 0);class $h{constructor(t={}){this.crlId="";this.crltValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],$h.prototype,"crlId",void 0);gi([yi({type:Ne.Any,context:0})],$h.prototype,"crltValue",void 0);let Gh=class t extends Nn{};Gh=gi([fi({type:Re.Sequence})],Gh);let Wh=class t extends xn{};Wh=gi([fi({type:Re.Sequence})],Wh);class Qh{constructor(t={}){this.secretTypeId="";this.secretValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Qh.prototype,"secretTypeId",void 0);gi([yi({type:Ne.Any,context:0})],Qh.prototype,"secretValue",void 0);class qh{constructor(t={}){this.mac=new An;this.macSalt=new Ke;this.iterations=1;Object.assign(this,t)}}gi([yi({type:An})],qh.prototype,"mac",void 0);gi([yi({type:Ke})],qh.prototype,"macSalt",void 0);gi([yi({type:Ne.Integer,defaultValue:1})],qh.prototype,"iterations",void 0);class zh{constructor(t={}){this.version=3;this.authSafe=new sh;this.macData=new qh;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],zh.prototype,"version",void 0);gi([yi({type:sh})],zh.prototype,"authSafe",void 0);gi([yi({type:qh,optional:true})],zh.prototype,"macData",void 0);var Jh;class Yh{constructor(t={}){this.bagId="";this.bagValue=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Ne.ObjectIdentifier})],Yh.prototype,"bagId",void 0);gi([yi({type:Ne.Any,context:0})],Yh.prototype,"bagValue",void 0);gi([yi({type:jh,repeated:"set",optional:true})],Yh.prototype,"bagAttributes",void 0);let Zh=Jh=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Jh.prototype)}};Zh=Jh=gi([fi({type:Re.Sequence,itemType:Yh})],Zh);var Xh,tp,ep;const ip="1.2.840.113549.1.9";const rp=`${ip}.2`;const sp=`${ip}.7`;const np=`${ip}.14`;let op=class t extends Di{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};gi([yi({type:Ne.IA5String})],op.prototype,"ia5String",void 0);op=gi([fi({type:Re.Choice})],op);let ap=class t extends sh{};ap=gi([fi({type:Re.Sequence})],ap);let cp=class t extends zh{};cp=gi([fi({type:Re.Sequence})],cp);let up=class t extends xn{};up=gi([fi({type:Re.Sequence})],up);let lp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.IA5String})],lp.prototype,"value",void 0);lp=gi([fi({type:Re.Choice})],lp);let hp=class t extends op{};hp=gi([fi({type:Re.Choice})],hp);let pp=class t extends Di{};pp=gi([fi({type:Re.Choice})],pp);let dp=class t{constructor(t=new Date){this.value=t}};gi([yi({type:Ne.GeneralizedTime})],dp.prototype,"value",void 0);dp=gi([fi({type:Re.Choice})],dp);let fp=class t extends Di{};fp=gi([fi({type:Re.Choice})],fp);let yp=class t{constructor(t="M"){this.value=t}toString(){return this.value}};gi([yi({type:Ne.PrintableString})],yp.prototype,"value",void 0);yp=gi([fi({type:Re.Choice})],yp);let Sp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.PrintableString})],Sp.prototype,"value",void 0);Sp=gi([fi({type:Re.Choice})],Sp);let Ap=class t extends Sp{};Ap=gi([fi({type:Re.Choice})],Ap);let vp=class t extends Di{};vp=gi([fi({type:Re.Choice})],vp);let mp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.ObjectIdentifier})],mp.prototype,"value",void 0);mp=gi([fi({type:Re.Choice})],mp);let Cp=class t extends Ss{};Cp=gi([fi({type:Re.Choice})],Cp);let gp=class t{constructor(t=0){this.value=t}toString(){return this.value.toString()}};gi([yi({type:Ne.Integer})],gp.prototype,"value",void 0);gp=gi([fi({type:Re.Choice})],gp);let wp=class t extends Jl{};wp=gi([fi({type:Re.Sequence})],wp);let Ep=class t extends Di{};Ep=gi([fi({type:Re.Choice})],Ep);let bp=Xh=class t extends Cs{constructor(t){super(t);Object.setPrototypeOf(this,Xh.prototype)}};bp=Xh=gi([fi({type:Re.Sequence})],bp);let Pp=tp=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,tp.prototype)}};Pp=tp=gi([fi({type:Re.Set,itemType:ql})],Pp);let Dp=class t{constructor(t=""){this.value=t}toString(){return this.value}};gi([yi({type:Ne.BmpString})],Dp.prototype,"value",void 0);Dp=gi([fi({type:Re.Choice})],Dp);let Ip=class t extends fs{};Ip=gi([fi({type:Re.Sequence})],Ip);let Bp=ep=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,ep.prototype)}};Bp=ep=gi([fi({type:Re.Sequence,itemType:Ip})],Bp);const xp="1.3.6.1.4.1.22112.2.1";let Tp=class t{constructor(t={}){Object.assign(this,t)}};gi([yi({type:jl})],Tp.prototype,"signer",void 0);gi([yi({type:Es,optional:true})],Tp.prototype,"cert",void 0);Tp=gi([fi({type:Re.Sequence})],Tp);var Op;let kp=Op=class t extends mi{constructor(t){super(t);Object.setPrototypeOf(this,Op.prototype)}};kp=Op=gi([fi({type:Re.Sequence,itemType:Xr})],kp);class Rp{constructor(t={}){this.version=0;this.subject=new Oi;this.subjectPKInfo=new ys;this.attributes=new kp;Object.assign(this,t)}}gi([yi({type:Ne.Integer})],Rp.prototype,"version",void 0);gi([yi({type:Oi})],Rp.prototype,"subject",void 0);gi([yi({type:ys})],Rp.prototype,"subjectPKInfo",void 0);gi([yi({type:kp,implicit:true,context:0,optional:true})],Rp.prototype,"attributes",void 0);class Np{constructor(t={}){this.certificationRequestInfo=new Rp;this.signatureAlgorithm=new fs;this.signature=new ArrayBuffer(0);Object.assign(this,t)}}gi([yi({type:Rp,raw:true})],Np.prototype,"certificationRequestInfo",void 0);gi([yi({type:fs})],Np.prototype,"signatureAlgorithm",void 0);gi([yi({type:Ne.BitString})],Np.prototype,"signature",void 0);let Mp=globalThis.crypto;function Kp(){return Mp}class Hp extends Error{code;constructor(t,e){super(t);this.code=e;this.name=this.constructor.name;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}class Up extends Hp{constructor(t,e){const i=e?` Supported: ${e.join(", ")}`:"";super(`Unsupported algorithm: ${t}.${i}`,"UNSUPPORTED_ALGORITHM")}}class jp extends Hp{constructor(t,e){const i=e?` Expected: ${e}`:"";super(`Invalid format: ${t}.${i}`,"INVALID_FORMAT")}}class _p extends Hp{constructor(t,e){const i=e?` Supported: ${e.join(", ")}`:"";super(`Unsupported key type: ${t}.${i}`,"UNSUPPORTED_KEY_TYPE")}}class Fp extends Hp{constructor(t){const e=t?`Invalid SSH private key format: ${t}`:"Invalid SSH private key format";super(e,"INVALID_PRIVATE_KEY_FORMAT")}}class Vp extends Hp{constructor(t){const e=t?`Encrypted SSH private keys are not supported (cipher: ${t})`:"Encrypted SSH private keys are not supported";super(e,"ENCRYPTED_KEY_NOT_SUPPORTED")}}class Lp extends Hp{constructor(t){const e=t?`Invalid key data: ${t}`:"Invalid key data";super(e,"INVALID_KEY_DATA")}}class $p extends Hp{constructor(t,e){const i=t!==undefined&&e!==undefined?` Expected ${t} bytes, got ${e}`:"";super(`Unexpected end of data${i}`,"UNEXPECTED_EOF")}}const Gp=new TextEncoder;const Wp=new TextDecoder;class Qp{buffer;offset;constructor(t){this.buffer=t;this.offset=0}readUint8(){if(this.offset>=this.buffer.length){throw new $p(1,0)}return this.buffer[this.offset++]}readUint32(){const t=this.readUint8()<<24|this.readUint8()<<16|this.readUint8()<<8|this.readUint8();return t>>>0}readUint64(){const t=this.readUint32();const e=this.readUint32();return BigInt(t)<<32n|BigInt(e)}readBytes(t){if(t<0){throw new jp(`Invalid length: ${t}`)}if(this.offset+t>this.buffer.length){throw new $p(t,this.buffer.length-this.offset)}const e=this.buffer.subarray(this.offset,this.offset+t);this.offset+=t;return e}readString(){const t=this.readUint32();const e=this.readBytes(t);return Wp.decode(e)}peekString(t){if(this.offset+t>this.buffer.length){throw new $p(t,this.buffer.length-this.offset)}const e=this.buffer.subarray(this.offset,this.offset+t);return Wp.decode(e)}readMpInt(t=false){const e=this.readUint32();const i=this.readBytes(e);if(t&&i.length>1&&i[0]===0){return i.subarray(1)}return i}readMpIntSsh(){return this.readMpInt(true)}remaining(){return this.buffer.length-this.offset}getOffset(){return this.offset}seek(t){if(t<0||t>this.buffer.length){throw new jp(`Invalid offset: ${t}. Buffer length: ${this.buffer.length}`)}this.offset=t}}class qp{buffer;offset;constructor(t=1024){this.buffer=new Uint8Array(t);this.offset=0}ensureCapacity(t){const e=this.offset+t;if(e>this.buffer.length){const t=Math.max(e,this.buffer.length*2);const i=new Uint8Array(t);i.set(this.buffer.subarray(0,this.offset));this.buffer=i}}reserve(t){if(t>this.buffer.length){const e=new Uint8Array(t);e.set(this.buffer.subarray(0,this.offset));this.buffer=e}}writeUint8(t){this.ensureCapacity(1);this.buffer[this.offset++]=t&255}writeUint32(t){this.ensureCapacity(4);this.buffer[this.offset++]=t>>>24&255;this.buffer[this.offset++]=t>>>16&255;this.buffer[this.offset++]=t>>>8&255;this.buffer[this.offset++]=t&255}writeUint64(t){this.ensureCapacity(8);const e=Number(t>>32n);const i=Number(t&0xffffffffn);this.writeUint32(e);this.writeUint32(i)}writeBytes(t){this.ensureCapacity(t.length);this.buffer.set(t,this.offset);this.offset+=t.length}writeString(t){const e=Gp.encode(t);this.writeUint32(e.length);this.writeBytes(e)}writeMpInt(t,e=false){if(e&&t.length>0&&(t[0]&128)!==0){const e=new Uint8Array(t.length+1);e[0]=0;e.set(t,1);this.writeUint32(e.length);this.writeBytes(e)}else{this.writeUint32(t.length);this.writeBytes(t)}}writeMpIntSsh(t){this.writeMpInt(t,true)}toUint8Array(){return this.buffer.subarray(0,this.offset)}getOffset(){return this.offset}seek(t){if(t<0||t>this.buffer.length){throw new jp("Invalid offset")}this.offset=t}}class zp{hash="SHA-256";constructor(t="SHA-256"){this.hash=t}async importPublicSsh(t){const{blob:e,crypto:i}=t;const r=new Qp(e);r.readString();const s=r.readMpInt(true);const o=r.readMpInt(true);const a={kty:"RSA",n:n.Convert.ToBase64Url(o),e:n.Convert.ToBase64Url(s)};return i.subtle.importKey("jwk",a,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])}async exportPublicSsh(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("jwk",e);if(!r.n||!r.e){throw new Lp("RSA JWK missing required parameters (n, e)")}const s=n.BufferSourceConverter.toUint8Array(n.Convert.FromBase64Url(r.n));const o=n.BufferSourceConverter.toUint8Array(n.Convert.FromBase64Url(r.e));const a=new qp;a.writeString("ssh-rsa");a.writeMpInt(o,true);a.writeMpInt(s,true);return a.toUint8Array()}async importPublicSpki(t){const{spki:e,crypto:i}=t;return i.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["verify"])}async exportPublicSpki(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("spki",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivatePkcs8(t){const{pkcs8:e,crypto:i}=t;return i.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])}async exportPrivatePkcs8(t){const{privateKey:e,crypto:i}=t;const r=await i.subtle.exportKey("pkcs8",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivateSsh(t){const{sshKey:e,crypto:i}=t;const r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");const s=n.Convert.FromBase64(r);const o=new Qp(n.BufferSourceConverter.toUint8Array(s));const a=o.readBytes(15);if(n.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new Fp("invalid magic string")}const c=o.readString();o.readString();o.readString();if(c!=="none"){throw new Vp(c)}const u=o.readUint32();if(u!==1){throw new Fp("multiple keys not supported")}const l=o.readUint32();o.readBytes(l);const h=o.readUint32();const p=o.readBytes(h);const d=new Qp(p);const f=d.readUint32();const y=d.readUint32();if(f!==y){throw new Fp("invalid checkints")}d.readString();const S=d.readMpInt(true);const A=d.readMpInt(true);const v=d.readMpInt(true);const m=d.readMpInt(true);const C=d.readMpInt(true);const g=d.readMpInt(true);d.readString();const w=BigInt("0x"+n.Convert.ToHex(v));const E=BigInt("0x"+n.Convert.ToHex(C));const b=BigInt("0x"+n.Convert.ToHex(g));const P=w%(E-1n);const D=w%(b-1n);const I=n.Convert.FromHex(P.toString(16).padStart(C.length*2,"0"));const B=n.Convert.FromHex(D.toString(16).padStart(g.length*2,"0"));const x={kty:"RSA",n:n.Convert.ToBase64Url(S),e:n.Convert.ToBase64Url(A),d:n.Convert.ToBase64Url(v),p:n.Convert.ToBase64Url(C),q:n.Convert.ToBase64Url(g),dp:n.Convert.ToBase64Url(I),dq:n.Convert.ToBase64Url(B),qi:n.Convert.ToBase64Url(m)};return i.subtle.importKey("jwk",x,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},true,["sign"])}async exportPrivateSsh(t){const{privateKey:e,crypto:i,jwk:r}=t;const s=r||await i.subtle.exportKey("jwk",e);if(!s.n||!s.e||!s.d||!s.p||!s.q){throw new Lp("RSA JWK missing required parameters")}const o=new Uint8Array(n.Convert.FromBase64Url(s.n));const a=new Uint8Array(n.Convert.FromBase64Url(s.e));const c=new Uint8Array(n.Convert.FromBase64Url(s.d));const u=new Uint8Array(n.Convert.FromBase64Url(s.p));const l=new Uint8Array(n.Convert.FromBase64Url(s.q));const h=s.qi?new Uint8Array(n.Convert.FromBase64Url(s.qi)):new Uint8Array;const p=new qp;p.writeString("ssh-rsa");p.writeMpInt(o,true);p.writeMpInt(a,true);p.writeMpInt(c,true);p.writeMpInt(h,true);p.writeMpInt(u,true);p.writeMpInt(l,true);return p.toUint8Array()}async sign(t){const{privateKey:e,data:i,crypto:r,hash:s}=t;if(s&&s!==this.hash){throw new Lp(`Hash ${s} not supported for this RSA algorithm`)}if(!e.extractable){throw new Lp("Private key is not extractable")}const o=await this.exportPrivatePkcs8({privateKey:e,crypto:r});const a=await this.importPrivatePkcs8({pkcs8:new Uint8Array(o),crypto:r});const c=await r.subtle.sign("RSASSA-PKCS1-v1_5",a,i);return n.BufferSourceConverter.toUint8Array(c)}async verify(t){const{publicKey:e,signature:i,data:r,crypto:s,hash:n}=t;if(n&&n!==this.hash){return false}if(!e.extractable){throw new Lp("Public key is not extractable")}const o=await this.exportPublicSpki({publicKey:e,crypto:s});const a=await this.importPublicSpki({spki:new Uint8Array(o),crypto:s});return s.subtle.verify("RSASSA-PKCS1-v1_5",a,i,r)}encodeSignature(t){const{signature:e,algo:i}=t;const r=new qp;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()}decodeSignature(t){const{signature:e}=t;const i=new Qp(e);const r=i.readString();const s=i.readUint32();const n=i.readBytes(s);return{signature:n,algo:r}}supportsCryptoKey(t){return t.algorithm.name==="RSASSA-PKCS1-v1_5"}parsePublicKey(t){const e=t.readBytes(t.readUint32());const i=t.readBytes(t.readUint32());const r=new qp;r.writeString("ssh-rsa");r.writeMpInt(e);r.writeMpInt(i);return{type:"ssh-rsa",keyData:r.toUint8Array()}}writePublicKey(t,e){const i=new Qp(e.keyData);i.readString();const r=i.readMpInt();const s=i.readMpInt();t.writeUint32(r.length);t.writeBytes(r);t.writeUint32(s.length);t.writeBytes(s)}getCertificateType(){return"ssh-rsa-cert-v01@openssh.com"}getSignatureAlgo(){return this.hash==="SHA-256"?"rsa-sha2-256":"rsa-sha2-512"}}class Jp{curveName;sshType;namedCurve;constructor(t,e,i){this.curveName=t;this.sshType=e;this.namedCurve=i}getHashAlgorithm(){switch(this.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:return"SHA-256"}}getExpectedLength(){switch(this.namedCurve){case"P-256":return 32;case"P-384":return 48;case"P-521":return 66;default:return 32}}getSignatureCoordLength(){return this.getExpectedLength()}async importPublicSsh(t){const{blob:e,crypto:i}=t;const r=new Qp(e);r.readString();const s=r.readString();if(s!==this.curveName){throw new Lp(`ECDSA curve name ${s}, expected ${this.curveName}`)}const o=r.readMpInt();const a=Math.floor((o.length-1)/2);const c={kty:"EC",crv:this.namedCurve,x:n.Convert.ToBase64Url(o.slice(1,1+a)),y:n.Convert.ToBase64Url(o.slice(1+a))};return i.subtle.importKey("jwk",c,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])}async exportPublicSsh(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("jwk",e);if(!r.x||!r.y){throw new Lp("ECDSA JWK missing x or y parameters")}const s=new Uint8Array(n.Convert.FromBase64Url(r.x));const o=new Uint8Array(n.Convert.FromBase64Url(r.y));const a=new Uint8Array(1+s.length+o.length);a[0]=4;a.set(s,1);a.set(o,1+s.length);const c=new qp;c.writeString(this.sshType);c.writeString(this.curveName);c.writeMpInt(a);return c.toUint8Array()}async importPublicSpki(t){const{spki:e,crypto:i}=t;return i.subtle.importKey("spki",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["verify"])}async exportPublicSpki(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("spki",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivatePkcs8(t){const{pkcs8:e,crypto:i}=t;return i.subtle.importKey("pkcs8",e,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])}async exportPrivatePkcs8(t){const{privateKey:e,crypto:i}=t;const r=await i.subtle.exportKey("pkcs8",e);return n.BufferSourceConverter.toUint8Array(r)}async exportPrivateSsh(t){const{privateKey:e,crypto:i,jwk:r}=t;const s=r||await i.subtle.exportKey("jwk",e);if(!s.d||!s.x||!s.y){throw new Lp("ECDSA private key JWK missing required parameters")}const o=new Uint8Array(n.Convert.FromBase64Url(s.x));const a=new Uint8Array(n.Convert.FromBase64Url(s.y));const c=new Uint8Array(n.Convert.FromBase64Url(s.d));const u=new Uint8Array(1+o.length+a.length);u[0]=4;u.set(o,1);u.set(a,1+o.length);const l=new qp;l.writeString(this.sshType);l.writeString(this.curveName);l.writeMpInt(u);l.writeMpInt(c);return l.toUint8Array()}async importPrivateSsh(t){const{sshKey:e,crypto:i}=t;const r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");const s=n.Convert.FromBase64(r);const o=new Qp(n.BufferSourceConverter.toUint8Array(s));const a=o.readBytes(15);if(n.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new Fp("invalid magic string")}const c=o.readString();o.readString();o.readString();if(c!=="none"){throw new Vp(c)}const u=o.readUint32();if(u!==1){throw new Fp("multiple keys not supported")}const l=o.readUint32();o.readBytes(l);const h=o.readUint32();const p=o.readBytes(h);const d=new Qp(p);const f=d.readUint32();const y=d.readUint32();if(f!==y){throw new Fp("invalid checkints")}d.readString();d.readString();const S=d.readMpInt();const A=d.readMpInt();d.readString();if(S[0]!==4){throw new Lp("invalid ECDSA public key point format")}const v=Math.floor((S.length-1)/2);const m=S.slice(1,1+v);const C=S.slice(1+v);const g={kty:"EC",crv:this.namedCurve,x:n.Convert.ToBase64Url(m),y:n.Convert.ToBase64Url(C),d:n.Convert.ToBase64Url(A)};return i.subtle.importKey("jwk",g,{name:"ECDSA",namedCurve:this.namedCurve},true,["sign"])}async sign(t){const{privateKey:e,data:i,crypto:r,hash:s}=t;const o=this.getHashAlgorithm();if(s&&s!==o){throw new Lp(`ECDSA ${this.namedCurve} requires ${o}, got ${s}`)}const a=await r.subtle.sign({name:"ECDSA",hash:o},e,i);return n.BufferSourceConverter.toUint8Array(a)}async verify(t){const{publicKey:e,signature:i,data:r,crypto:s,hash:n}=t;const o=this.getHashAlgorithm();if(n&&n!==o){throw new Lp(`ECDSA ${this.namedCurve} requires ${o}, got ${n}`)}return s.subtle.verify({name:"ECDSA",hash:o},e,i,r)}encodeSignature(t){const{signature:e,algo:i}=t;if(i.startsWith("ecdsa-sha2-")){const t=this.getSignatureCoordLength();const r=e.subarray(0,t);const s=e.subarray(t);const n=new qp;n.writeString(i);const o=new qp;o.writeMpInt(r,true);o.writeMpInt(s,true);const a=o.toUint8Array();n.writeUint32(a.length);n.writeBytes(a);return n.toUint8Array()}const r=new qp;r.writeString(i);r.writeUint32(e.byteLength);r.writeBytes(e);return r.toUint8Array()}decodeSignature(t){const{signature:e}=t;const i=new Qp(e);const r=i.readString();const s=i.readUint32();const n=i.readBytes(s);if(r.startsWith("ecdsa-sha2-")){const t=new Qp(n);let e=t.readMpInt();let i=t.readMpInt();if(e[0]===0&&e.length>1&&(e[1]&128)===0){e=e.slice(1)}if(i[0]===0&&i.length>1&&(i[1]&128)===0){i=i.slice(1)}const s=this.getExpectedLength();const o=new Uint8Array(s);const a=new Uint8Array(s);if(e.length<=s){o.set(e,s-e.length)}else{o.set(e.slice(e.length-s),0)}if(i.length<=s){a.set(i,s-i.length)}else{a.set(i.slice(i.length-s),0)}const c=new Uint8Array([...o,...a]);return{signature:c,algo:r}}return{signature:n,algo:r}}supportsCryptoKey(t){return t.algorithm.name==="ECDSA"&&t.algorithm.namedCurve===this.namedCurve}parsePublicKey(t){const e=t.readString();if(e!==this.curveName){throw new Lp(`ECDSA certificate curve name ${e}, expected ${this.curveName}`)}const i=t.readBytes(t.readUint32());const r=new qp;r.writeString(this.sshType);r.writeString(e);r.writeMpInt(i);return{type:this.sshType,keyData:r.toUint8Array()}}writePublicKey(t,e){const i=new Qp(e.keyData);i.readString();const r=i.readString();const s=i.readMpInt();t.writeString(r);t.writeUint32(s.length);t.writeBytes(s)}getCertificateType(){return`${this.sshType}-cert-v01@openssh.com`}getSignatureAlgo(){return this.sshType}}const Yp=new Jp("nistp256","ecdsa-sha2-nistp256","P-256");const Zp=new Jp("nistp384","ecdsa-sha2-nistp384","P-384");const Xp=new Jp("nistp521","ecdsa-sha2-nistp521","P-521");class td{async importPublicSsh(t){const{blob:e,crypto:i}=t;const r=new Qp(e);r.readString();const s=r.readUint32();if(s!==32){throw new Lp(`Ed25519 key length ${s}, expected 32`)}const n=r.readBytes(s);return i.subtle.importKey("raw",n,"Ed25519",true,["verify"])}async exportPublicSsh(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("jwk",e);if(!r.x){throw new Lp("Ed25519 JWK missing x parameter")}const s=new Uint8Array(n.Convert.FromBase64Url(r.x));const o=new qp;o.writeString("ssh-ed25519");o.writeUint32(s.length);o.writeBytes(s);return o.toUint8Array()}async importPublicSpki(t){const{spki:e,crypto:i}=t;return i.subtle.importKey("spki",e,"Ed25519",true,["verify"])}async exportPublicSpki(t){const{publicKey:e,crypto:i}=t;const r=await i.subtle.exportKey("spki",e);return n.BufferSourceConverter.toUint8Array(r)}async importPrivatePkcs8(t){const{pkcs8:e,crypto:i}=t;return i.subtle.importKey("pkcs8",e,"Ed25519",true,["sign"])}async exportPrivatePkcs8(t){const{privateKey:e,crypto:i}=t;const r=await i.subtle.exportKey("pkcs8",e);return n.BufferSourceConverter.toUint8Array(r)}async exportPrivateSsh(t){const{privateKey:e,crypto:i,jwk:r}=t;const s=r||await i.subtle.exportKey("jwk",e);if(!s.d||!s.x){throw new Lp("Ed25519 private key JWK missing required parameters")}const o=new Uint8Array(n.Convert.FromBase64Url(s.d));const a=new Uint8Array(n.Convert.FromBase64Url(s.x));const c=new qp;c.writeString("ssh-ed25519");c.writeUint32(a.length);c.writeBytes(a);const u=new Uint8Array(64);u.set(o,0);u.set(a,32);c.writeUint32(u.length);c.writeBytes(u);return c.toUint8Array()}async importPrivateSsh(t){const{sshKey:e,crypto:i}=t;const r=e.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/,"").replace(/-----END OPENSSH PRIVATE KEY-----/,"").replace(/\s/g,"");const s=n.Convert.FromBase64(r);const o=new Qp(n.BufferSourceConverter.toUint8Array(s));const a=o.readBytes(15);if(n.Convert.ToHex(a)!=="6f70656e7373682d6b65792d763100"){throw new Fp("invalid magic string")}const c=o.readString();o.readString();o.readString();if(c!=="none"){throw new Vp(c)}const u=o.readUint32();if(u!==1){throw new Fp("multiple keys not supported")}const l=o.readUint32();o.readBytes(l);const h=o.readUint32();const p=o.readBytes(h);const d=new Qp(p);const f=d.readUint32();const y=d.readUint32();if(f!==y){throw new Fp("invalid checkints")}d.readString();const S=d.readUint32();const A=d.readBytes(S);const v=d.readUint32();const m=d.readBytes(v);d.readString();const C=m.slice(0,32);const g={kty:"OKP",crv:"Ed25519",d:n.Convert.ToBase64Url(C),x:n.Convert.ToBase64Url(A)};return i.subtle.importKey("jwk",g,"Ed25519",true,["sign"])}async sign(t){const{privateKey:e,data:i,crypto:r}=t;const s=await r.subtle.sign("Ed25519",e,i);return n.BufferSourceConverter.toUint8Array(s)}async verify(t){const{publicKey:e,signature:i,data:r,crypto:s}=t;return s.subtle.verify("Ed25519",e,i,r)}encodeSignature(t){const{signature:e,algo:i}=t;const r=new Uint8Array(e);const s=new qp;s.writeString(i);s.writeUint32(r.length);s.writeBytes(r);return s.toUint8Array()}decodeSignature(t){const{signature:e}=t;const i=new Qp(e);const r=i.readString();const s=i.readUint32();const n=i.readBytes(s);return{signature:n,algo:r}}supportsCryptoKey(t){return t.algorithm.name==="Ed25519"}parsePublicKey(t){const e=t.readBytes(t.readUint32());const i=new qp;i.writeString("ssh-ed25519");i.writeUint32(e.length);i.writeBytes(e);return{type:"ssh-ed25519",keyData:i.toUint8Array()}}writePublicKey(t,e){const i=new Qp(e.keyData);i.readString();const r=i.readUint32();const s=i.readBytes(r);t.writeUint32(s.length);t.writeBytes(s)}getCertificateType(){return"ssh-ed25519-cert-v01@openssh.com"}getSignatureAlgo(){return"ssh-ed25519"}}const ed=new Map;class id{static get(t){const e=ed.get(t);if(!e){throw new _p(t,Array.from(ed.keys()))}return e}static register(t,e){ed.set(t,e)}static getSshTypeFromCryptoKey(t){for(const[e,i]of ed.entries()){if(i.supportsCryptoKey(t)){return e}}throw new _p(t.algorithm.name,Array.from(ed.keys()))}static certTypeToKeyType(t){const e={"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"};return e[t]}static getSupportedCertTypes(){return Object.keys({"ssh-rsa-cert-v01@openssh.com":"ssh-rsa","ssh-ed25519-cert-v01@openssh.com":"ssh-ed25519","ecdsa-sha2-nistp256-cert-v01@openssh.com":"ecdsa-sha2-nistp256","ecdsa-sha2-nistp384-cert-v01@openssh.com":"ecdsa-sha2-nistp384","ecdsa-sha2-nistp521-cert-v01@openssh.com":"ecdsa-sha2-nistp521"})}}id.register("ssh-ed25519",new td);id.register("ssh-rsa",new zp("SHA-256"));id.register("rsa-sha2-256",new zp("SHA-256"));id.register("rsa-sha2-512",new zp("SHA-512"));id.register("ecdsa-sha2-nistp256",Yp);id.register("ecdsa-sha2-nistp384",Zp);id.register("ecdsa-sha2-nistp521",Xp);function rd(t){const e=typeof t==="string"?t.trim().split(/\s+/):null;if(!e||e.length<2){throw new jp("Invalid SSH public key format")}const i=e[0];const r=new Uint8Array(n.Convert.FromBase64(e[1]));const s=e.length>2?e.slice(2).join(" "):undefined;const o=new Qp(r);const a=o.readString();if(a!==i){throw new jp("Key type mismatch")}return{type:i,keyData:r,comment:s}}function sd(t){const e=n.Convert.ToBase64(t.keyData);const i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function nd(t){if(typeof t==="string"){const e=t.trim().split(/\s+/);if(e.length<2){throw new jp("SSH certificate string","type base64 [comment]")}const i=e[0];const r=new Uint8Array(n.Convert.FromBase64(e[1]));const s=e.length>2?e.slice(2).join(" "):undefined;const o=new Qp(r);const a=o.readString();if(a!==i){throw new jp(`certificate blob type ${a}`,`expected ${i}`)}return{type:i,keyData:r,comment:s}}else{const e=new Qp(t);const i=e.readString();const r=t.slice(e.getOffset());return{type:i,keyData:r}}}function od(t){const e=new Qp(t);const i=e.readString();const r=e.readBytes(e.readUint32());const s=id.certTypeToKeyType(i);if(!s){throw new Up(i,id.getSupportedCertTypes())}const n=id.get(s);const o=n.parsePublicKey(e);const a=s;const c=e.readUint64();const u=e.readUint32();const l=u===1?"user":"host";const h=e.readString();const p=e.readUint32();const d=e.readBytes(p);const f=[];if(d.length>0){const t=new Qp(d);while(t.getOffset()<d.length){try{const e=t.readString();f.push(e)}catch{break}}}const y=e.readUint64();const S=e.readUint64();const A={};const v=e.readUint32();const m=e.readBytes(v);if(m.length>0){const t=new Qp(m);while(t.getOffset()<m.length){try{const e=t.readString();const i=t.readBytes(t.readUint32());const r=i.length===0?"":Wp.decode(i);A[e]=r}catch{break}}}const C={};const g=e.readUint32();const w=e.readBytes(g);if(w.length>0){const t=new Qp(w);while(t.getOffset()<w.length){try{const e=t.readString();const i=t.readBytes(t.readUint32());const r=i.length===0?"":Wp.decode(i);C[e]=r}catch{break}}}const E=e.readUint32();const b=e.readBytes(E);const P=e.readUint32();const D=e.readBytes(P);const I=new Qp(D);const B=I.readString();const x={type:B,keyData:D};const T=e.readUint32();const O=e.readBytes(T);return{nonce:r,keyType:a,publicKey:o,serial:c,type:l,keyId:h,validPrincipals:f,validAfter:y,validBefore:S,criticalOptions:A,extensions:C,reserved:b,signatureKey:x,signature:O}}function ad(t){const e=n.Convert.ToBase64(t.keyData);const i=[t.type,e];if(t.comment){i.push(t.comment)}return i.join(" ")}function cd(t){const e=new Qp(t);if(t.length>=6&&(new TextDecoder).decode(t.subarray(0,6))==="SSHSIG"){return ud(e)}else{return ld(e)}}function ud(t){const e=t.readBytes(6);const i=(new TextDecoder).decode(e);if(i!=="SSHSIG"){throw new jp(i,"SSHSIG")}const r=t.readUint32();const s=t.readUint32();const n=t.readBytes(s);const o=t.readString();const a=t.readString();const c=t.readString();const u=t.readUint32();const l=t.readBytes(u);const h=new Qp(l);const p=h.readString();const d=h.readUint32();const f=h.readBytes(d);return{format:"ssh-signature",algorithm:p,signature:f,version:r,publicKey:n,namespace:o,reserved:a,hashAlgorithm:c}}function ld(t){const e=t.readString();const i=t.readUint32();const r=t.readBytes(i);return{format:"legacy",algorithm:e,signature:r}}function hd(t){if(t.format==="ssh-signature"){return pd(t)}else{return dd(t)}}function pd(t){const e=new qp;e.writeBytes((new TextEncoder).encode("SSHSIG"));e.writeUint32(t.version||1);if(t.publicKey){e.writeUint32(t.publicKey.length);e.writeBytes(t.publicKey)}else{e.writeUint32(0)}e.writeString(t.namespace||"file");e.writeString(t.reserved||"");e.writeString(t.hashAlgorithm||"sha512");const i=new qp;i.writeString(t.algorithm);i.writeUint32(t.signature.length);i.writeBytes(t.signature);const r=i.toUint8Array();e.writeUint32(r.length);e.writeBytes(r);return e.toUint8Array()}function dd(t){const e=new qp;e.writeString(t.algorithm);e.writeUint32(t.signature.length);e.writeBytes(t.signature);return e.toUint8Array()}class fd{}class yd extends fd{static TYPE="public-key";type=yd.TYPE;blob;cachedCryptoKey;constructor(t){super();this.blob=t}async getCryptoKey(t=Kp()){if(!this.cachedCryptoKey){const e=id.get(this.blob.type);this.cachedCryptoKey=await e.importPublicSsh({blob:this.blob.keyData,crypto:t})}return this.cachedCryptoKey}static async fromSSH(t,e=Kp()){const i=rd(t);const r=id.get(i.type);await r.importPublicSsh({blob:i.keyData,crypto:e});return new yd(i)}static async fromSPKI(t,e,i=Kp()){const r=id.get(e);const s=await r.importPublicSpki({spki:t,crypto:i});const n=await r.exportPublicSsh({publicKey:s,crypto:i});const o={type:e,keyData:n};return new yd(o)}static async fromWebCrypto(t,e,i=Kp()){const r=e||id.getSshTypeFromCryptoKey(t);const s=id.get(r);const n=await s.exportPublicSsh({publicKey:t,crypto:i});const o={type:r,keyData:n};return new yd(o)}async export(t="ssh",e=Kp()){if(t==="ssh"){return sd(this.blob)}else if(t==="spki"){const t=await this.getCryptoKey(e);const i=id.get(this.blob.type);const r=await i.exportPublicSpki({publicKey:t,crypto:e});return new Uint8Array(r)}throw new _p(`Unsupported export format: ${t}`)}async toSSH(){const t=await this.export("ssh");return t}async toSPKI(){const t=await this.export("spki");return t}async toWebCrypto(t=Kp()){return this.getCryptoKey(t)}async verify(t,e,i,r=Kp()){const s=id.get(t);const n=await this.toWebCrypto(r);return s.verify({publicKey:n,signature:e,data:i,crypto:r})}get keyType(){return this.blob.type}get comment(){return this.blob.comment}getBlob(){return{...this.blob}}async thumbprint(t="sha256",e=Kp()){const i=t==="sha256"?"SHA-256":"SHA-512";const r=this.blob.keyData;const s=await e.subtle.digest(i,r);return new Uint8Array(s)}}class Sd extends fd{static TYPE="signature";type=Sd.TYPE;blob;format;algorithm;signature;version;publicKey;namespace;reserved;hashAlgorithm;constructor(t){super();this.blob=t;this.format=t.format;this.algorithm=t.algorithm;this.signature=t.signature;this.version=t.version;this.namespace=t.namespace;this.reserved=t.reserved;this.hashAlgorithm=t.hashAlgorithm;if(t.publicKey){const e=new Qp(t.publicKey);const i=e.readString();this.publicKey=new yd({type:i,keyData:t.publicKey})}}static parse(t){const e=cd(t);return new Sd(e)}static fromBlob(t){return new Sd(t)}static fromBase64(t){const e=new Uint8Array(n.Convert.FromBase64(t));return Sd.parse(e)}static fromText(t){const e=t.replace(/-----BEGIN SSH SIGNATURE-----/,"").replace(/-----END SSH SIGNATURE-----/,"").replace(/[\r\n\s]/g,"");return Sd.fromBase64(e)}serialize(){return hd(this.blob)}toBase64(){return n.Convert.ToBase64(this.serialize())}toText(){const t=this.toBase64();const e=[];for(let i=0;i<t.length;i+=70){e.push(t.substring(i,i+70))}return["-----BEGIN SSH SIGNATURE-----",...e,"-----END SSH SIGNATURE-----"].join("\n")}async toSSH(){return this.toText()}async verify(t,e){const i=id.get(this.algorithm);const r=await e["getCryptoKey"]();const s=Kp();let n=t;if(this.format==="ssh-signature"){const e=this.hashAlgorithm||"sha512";const i=this.namespace||"file";const r=this.reserved||"";const o=e==="sha256"?"SHA-256":"SHA-512";const a=await s.subtle.digest(o,t);const c=new Uint8Array(a);const u=new qp;u.writeBytes((new TextEncoder).encode("SSHSIG"));u.writeString(i);u.writeString(r);u.writeString(e);u.writeUint32(c.length);u.writeBytes(c);n=u.toUint8Array()}let o;if(this.algorithm==="rsa-sha2-256"){o="SHA-256"}else if(this.algorithm==="rsa-sha2-512"){o="SHA-512"}let a;if(this.format==="legacy"||this.format==="ssh-signature"){const t=new qp;t.writeString(this.algorithm);t.writeUint32(this.signature.length);t.writeBytes(this.signature);const e=t.toUint8Array();const r=i.decodeSignature({signature:e});a=r.signature}else{a=this.signature}return i.verify({publicKey:r,signature:a,data:n,crypto:s,hash:o})}static fromLegacy(t,e){const i=id.get(t);const r=i.encodeSignature({signature:e,algo:t});const s=new Qp(r);s.readString();const n=s.readUint32();const o=s.readBytes(n);return new Sd({format:"legacy",algorithm:t,signature:o})}static fromSshSignature(t,e,i={}){const r={format:"ssh-signature",algorithm:t,signature:e,version:i.version||1,publicKey:i.publicKey?i.publicKey.getBlob().keyData:undefined,namespace:i.namespace||"file",reserved:i.reserved||"",hashAlgorithm:i.hashAlgorithm||"sha512"};return new Sd(r)}static async sign(t,e,i,r={}){const{format:s="legacy",namespace:n="file"}=r;if(s==="legacy"){const r=await e.sign(t,i);const s=t||e.keyType;return Sd.fromLegacy(s,r)}else{const r=t;const s=id.get(r);const o=t==="rsa-sha2-256"?"sha256":"sha512";const a=await e.getPublicKey();const c=Kp();const u=o==="sha256"?"SHA-256":"SHA-512";const l=await c.subtle.digest(u,i);const h=new Uint8Array(l);const p=new qp;p.writeBytes((new TextEncoder).encode("SSHSIG"));p.writeString(n);p.writeString("");p.writeString(o);p.writeUint32(h.length);p.writeBytes(h);const d=p.toUint8Array();const f=await e.sign(r,d);const y=s.encodeSignature({signature:f,algo:r});const S=new Qp(y);S.readString();const A=S.readUint32();const v=S.readBytes(A);return Sd.fromSshSignature(r,v,{namespace:n,hashAlgorithm:o,publicKey:a})}}}let Ad=class t extends fd{static TYPE="certificate";type=t.TYPE;_blob;data;_validAfter;_validBefore;keyId;principals;certType;serial;validAfter;validBefore;publicKey;signatureKey;criticalOptions;extensions;constructor(t){super();this._blob=t;this.data=od(t.keyData);this._validAfter=this.data.validAfter;this._validBefore=this.data.validBefore;this.keyId=this.data.keyId;this.principals=this.data.validPrincipals;this.certType=this.data.type;this.serial=this.data.serial;this.validAfter=new Date(Number(this.data.validAfter)*1e3);this.validBefore=new Date(Number(this.data.validBefore)*1e3);this.publicKey=new yd(this.data.publicKey);this.signatureKey=new yd(this.data.signatureKey);this.criticalOptions={...this.data.criticalOptions};this.extensions={...this.data.extensions}}static async fromSSH(e){const i=nd(e);return new t(i)}static async fromBlob(e){return new t(e)}async toSSH(){return ad(this._blob)}toBlob(){return{...this._blob}}get blob(){return this.toBlob()}validate(t=new Date){const e=BigInt(Math.floor(t.getTime()/1e3));const i=this._validAfter;const r=this._validBefore;const s=0xffffffffffffffffn;const n=r===s?e:r;return e>=i&&e<=n}async verify(t,e=Kp()){const i=t||this.signatureKey;const r=this.getSignedData();const s=Sd.parse(this.data.signature);const n=id.get(s.algorithm);const o=await i.toWebCrypto(e);return n.verify({publicKey:o,signature:s.signature,data:r,crypto:e})}getSignedData(){const t=new Qp(this._blob.keyData);t.readString();t.readBytes(t.readUint32());if(this.data.keyType==="ssh-ed25519"){t.readBytes(t.readUint32())}else if(this.data.keyType==="ssh-rsa"){t.readBytes(t.readUint32());t.readBytes(t.readUint32())}else if(this.data.keyType.startsWith("ecdsa-sha2-")){t.readString();t.readBytes(t.readUint32())}t.readUint64();t.readUint32();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readUint64();t.readUint64();t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());t.readBytes(t.readUint32());const e=t.getOffset();return this._blob.keyData.slice(0,e)}};var vd=undefined&&undefined.__classPrivateFieldSet||function(t,e,i,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e==="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,i):s?s.value=i:e.set(t,i),i};var md=undefined&&undefined.__classPrivateFieldGet||function(t,e,i,r){if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e==="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?r:i==="a"?r.call(t):r?r.value:e.get(t)};var Cd;class gd{constructor(t){Cd.set(this,void 0);const e=nd(n.Convert.isBase64Url(t.trim())?n.Convert.ToString(n.Convert.FromBase64Url(t.trim())):t.trim());vd(this,Cd,new Ad(e),"f");this.notBefore=md(this,Cd,"f").validAfter;this.notAfter=md(this,Cd,"f").validBefore;this.validity=oo(this.notBefore,this.notAfter);this.type=[md(this,Cd,"f").blob.type,md(this,Cd,"f").certType,md(this,Cd,"f").type].join(" ");this.serialNumber=md(this,Cd,"f").serial.toString();this.keyId=md(this,Cd,"f").keyId;this.principals=md(this,Cd,"f").principals;this.extensions=md(this,Cd,"f").extensions;this.criticalOptions=md(this,Cd,"f").criticalOptions}async parseSignatureKey(){const t=await md(this,Cd,"f").signatureKey.toWebCrypto();const e=md(this,Cd,"f").signatureKey.getBlob();const i=await md(this,Cd,"f").signatureKey.thumbprint("sha256");this.signatureKey={algorithm:t.algorithm.name,type:e.type,value:await md(this,Cd,"f").signatureKey.toSSH(),thumbprint:n.Convert.ToBase64(i)}}async parsePublicKey(){const t=await md(this,Cd,"f").publicKey.toWebCrypto();const e=md(this,Cd,"f").publicKey.getBlob();const i=await md(this,Cd,"f").publicKey.thumbprint("sha256");this.publicKey={algorithm:t.algorithm.name,type:e.type,value:await md(this,Cd,"f").publicKey.toSSH(),thumbprint:n.Convert.ToBase64(i)}}async toString(t="pem"){if(t==="base64url"){const t=await md(this,Cd,"f").toSSH();return n.Convert.ToBase64Url(n.Convert.FromString(t))}return md(this,Cd,"f").toSSH()}get commonName(){return md(this,Cd,"f").principals.join("_")||md(this,Cd,"f").keyId||md(this,Cd,"f").certType}async downloadAsPub(t){o.certSSH.asPub(await this.toString(),t||[this.commonName,"cert"].join("-"))}}Cd=new WeakMap;export{ca as $,Bu as A,np as B,Es as C,o as D,js as E,rp as F,sp as G,Rl as H,kl as I,Ol as J,Hl as K,Cl as L,Ml as M,pa as N,xl as O,_u as P,Il as Q,wn as R,Pl as S,Kl as T,hp as U,Nl as V,Ul as W,El as X,Np as Y,oa as Z,no as _,oo as a,es as a$,Ke as a0,Cc as a1,Pc as a2,ms as a3,Eu as a4,Au as a5,hr as a6,ur as a7,ds as a8,ru as a9,wr as aA,vr as aB,ar as aC,Zi as aD,Qi as aE,Gi as aF,Vi as aG,wu as aH,nu as aI,lr as aJ,cr as aK,ps as aL,tu as aM,fa as aN,as as aO,ns as aP,Ic as aQ,xc as aR,vc as aS,fc as aT,Ha as aU,ac as aV,lc as aW,Na as aX,ka as aY,wa as aZ,rs as a_,$c as aa,va as ab,ls as ac,os as ad,Bc as ae,Tc as af,mc as ag,Ac as ah,Ua as ai,uc as aj,hc as ak,Ka as al,Ra as am,Ia as an,ss as ao,is as ap,Zr as aq,zr as ar,Gr as as,Lr as at,Ur as au,Mr as av,kr as aw,Tr as ax,Br as ay,Pr as az,n as b,Yr as b0,Qr as b1,$r as b2,_r as b3,Kr as b4,Nr as b5,Or as b6,xr as b7,Ir as b8,Er as b9,_e as bA,Cu as bB,au as bC,cu as bD,gr as ba,dr as bb,tr as bc,Yi as bd,Wi as be,Li as bf,_i as bg,Hh as bh,nh as bi,rh as bj,ih as bk,sh as bl,gd as bm,Oi as bn,Ri as bo,er as bp,rr as bq,Ni as br,gi as bs,yi as bt,Ne as bu,fi as bv,Re as bw,mi as bx,ba as by,Da as bz,Lu as c,t as d,Ci as e,Ls as f,Ln as g,Gn as h,Is as i,Pn as j,In as k,Dn as l,$u as m,sl as n,Ds as o,Xr as p,Ai as q,Tp as r,bp as s,Ep as t,gl as u,Tl as v,Bl as w,Dl as x,bl as y,xp as z};
135
+ //# sourceMappingURL=p-CmOVFH_Z.js.map