wherdr 0.0.0-stage → 1.2.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 (828) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/AgentView.DE2GDt4O.css +1 -0
  3. package/.output/public/_nuxt/BDI8xNSb.js +2 -0
  4. package/.output/public/_nuxt/BDNMzG2s.js +1 -0
  5. package/.output/public/_nuxt/BIA9pZvC.js +1 -0
  6. package/.output/public/_nuxt/Bd17z0YL.js +2 -0
  7. package/.output/public/_nuxt/BevNMnQ2.js +83 -0
  8. package/.output/public/_nuxt/BpQH8Ho1.js +1 -0
  9. package/.output/public/_nuxt/Bta8at9w.js +6 -0
  10. package/.output/public/_nuxt/CA9mI3eg.js +23 -0
  11. package/.output/public/_nuxt/CWwyK2XK.js +2 -0
  12. package/.output/public/_nuxt/CXG-cOdh.js +1 -0
  13. package/.output/public/_nuxt/Ci8N4mWR.js +1 -0
  14. package/.output/public/_nuxt/CjKICX3g.js +17 -0
  15. package/.output/public/_nuxt/D903WmCE.js +65 -0
  16. package/.output/public/_nuxt/DBu2-cEy.js +30 -0
  17. package/.output/public/_nuxt/DJE_XMLO.js +1 -0
  18. package/.output/public/_nuxt/DLLQgP0d.js +1 -0
  19. package/.output/public/_nuxt/DxO1TBoK.js +1 -0
  20. package/.output/public/_nuxt/SiL1FJ5s.js +3 -0
  21. package/.output/public/_nuxt/archivo-latin-ext-wght-normal.C4zznr8T.woff2 +0 -0
  22. package/.output/public/_nuxt/archivo-latin-wght-normal.E0tuGl4L.woff2 +0 -0
  23. package/.output/public/_nuxt/archivo-vietnamese-wght-normal.XAtsl5Q_.woff2 +0 -0
  24. package/.output/public/_nuxt/bLP7Jj-b.js +1 -0
  25. package/.output/public/_nuxt/builds/latest.json +1 -0
  26. package/.output/public/_nuxt/builds/meta/211609c0-be04-46c5-a6b0-566bc0c4a3dd.json +1 -0
  27. package/.output/public/_nuxt/e5N4AqCN.js +93 -0
  28. package/.output/public/_nuxt/entry.SHBiCXBL.css +2 -0
  29. package/.output/public/_nuxt/error-404.Bb87HomL.css +1 -0
  30. package/.output/public/_nuxt/error-500.Bwd7zAaE.css +1 -0
  31. package/.output/public/_nuxt/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
  32. package/.output/public/_nuxt/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
  33. package/.output/public/_nuxt/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
  34. package/.output/public/_nuxt/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
  35. package/.output/public/_nuxt/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
  36. package/.output/public/_nuxt/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
  37. package/.output/public/_nuxt/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
  38. package/.output/public/_nuxt/jetbrains-mono-cyrillic-wght-normal.D73BlboJ.woff2 +0 -0
  39. package/.output/public/_nuxt/jetbrains-mono-greek-wght-normal.Bw9x6K1M.woff2 +0 -0
  40. package/.output/public/_nuxt/jetbrains-mono-latin-ext-wght-normal.DBQx-q_a.woff2 +0 -0
  41. package/.output/public/_nuxt/jetbrains-mono-latin-wght-normal.B9CIFXIH.woff2 +0 -0
  42. package/.output/public/_nuxt/jetbrains-mono-vietnamese-wght-normal.Bt-aOZkq.woff2 +0 -0
  43. package/.output/public/_nuxt/wherdr-nerd-awesome.DQ3_iAfa.woff2 +0 -0
  44. package/.output/public/_nuxt/wherdr-nerd-codicons.CtEsfSAf.woff2 +0 -0
  45. package/.output/public/_nuxt/wherdr-nerd-devicons.ZMSFX1sW.woff2 +0 -0
  46. package/.output/public/_nuxt/wherdr-nerd-extension.Dai_ky39.woff2 +0 -0
  47. package/.output/public/_nuxt/wherdr-nerd-material-1.BdvqkCqW.woff2 +0 -0
  48. package/.output/public/_nuxt/wherdr-nerd-material-2.C_flbBWO.woff2 +0 -0
  49. package/.output/public/_nuxt/wherdr-nerd-material-3.8xz7iX-Y.woff2 +0 -0
  50. package/.output/public/_nuxt/wherdr-nerd-material-4.CO_PudDR.woff2 +0 -0
  51. package/.output/public/_nuxt/wherdr-nerd-octicons.Hl4VEx8m.woff2 +0 -0
  52. package/.output/public/_nuxt/wherdr-nerd-powerline.B_kAMxXr.woff2 +0 -0
  53. package/.output/public/_nuxt/wherdr-symbols.C1LsPKmg.woff2 +0 -0
  54. package/.output/public/_nuxt/yzABg5xl.js +1 -0
  55. package/.output/public/manifest-en.webmanifest +18 -0
  56. package/.output/public/manifest.webmanifest +18 -0
  57. package/.output/public/sw.js +99 -0
  58. package/.output/server/chunks/_/awake.mjs +170 -0
  59. package/.output/server/chunks/_/branding.mjs +28 -0
  60. package/.output/server/chunks/_/changes.mjs +199 -0
  61. package/.output/server/chunks/_/error-500.mjs +20 -0
  62. package/.output/server/chunks/_/machineOrder.mjs +40 -0
  63. package/.output/server/chunks/_/onboarding.mjs +26 -0
  64. package/.output/server/chunks/_/phone.mjs +343 -0
  65. package/.output/server/chunks/_/plugins.mjs +248 -0
  66. package/.output/server/chunks/_/projectBoard.mjs +275 -0
  67. package/.output/server/chunks/_/projectsActions.mjs +143 -0
  68. package/.output/server/chunks/_/projectsPlugin.mjs +56 -0
  69. package/.output/server/chunks/_/restart.mjs +459 -0
  70. package/.output/server/chunks/_/reveal.mjs +137 -0
  71. package/.output/server/chunks/_/worktrees.mjs +74 -0
  72. package/.output/server/chunks/_/ws.mjs +57 -0
  73. package/.output/server/chunks/nitro/nitro.mjs +20691 -0
  74. package/.output/server/chunks/raw/apple-touch-icon.mjs +7 -0
  75. package/.output/server/chunks/raw/build-nerd-font.mjs +7 -0
  76. package/.output/server/chunks/raw/build-terminal-font.mjs +7 -0
  77. package/.output/server/chunks/raw/check-leaks.mjs +5 -0
  78. package/.output/server/chunks/raw/dev.wherdr.open.mjs +7 -0
  79. package/.output/server/chunks/raw/docker-entrypoint.mjs +7 -0
  80. package/.output/server/chunks/raw/favicon-32.mjs +7 -0
  81. package/.output/server/chunks/raw/favicon.mjs +7 -0
  82. package/.output/server/chunks/raw/herdr-plugin.mjs +7 -0
  83. package/.output/server/chunks/raw/icon-192.mjs +7 -0
  84. package/.output/server/chunks/raw/icon-512-maskable.mjs +7 -0
  85. package/.output/server/chunks/raw/icon-512.mjs +7 -0
  86. package/.output/server/chunks/raw/icon-maskable.mjs +7 -0
  87. package/.output/server/chunks/raw/icon.mjs +7 -0
  88. package/.output/server/chunks/raw/install-claude-statusline.mjs +7 -0
  89. package/.output/server/chunks/raw/install-host-open.mjs +7 -0
  90. package/.output/server/chunks/raw/pack-output.mjs +5 -0
  91. package/.output/server/chunks/raw/reveal.mjs +7 -0
  92. package/.output/server/chunks/raw/wherdr-open.mjs +7 -0
  93. package/.output/server/chunks/routes/api/_..._.mjs +30 -0
  94. package/.output/server/chunks/routes/api/agents.post.mjs +30 -0
  95. package/.output/server/chunks/routes/api/ask-tab.post.mjs +49 -0
  96. package/.output/server/chunks/routes/api/attach.post.mjs +35 -0
  97. package/.output/server/chunks/routes/api/auth/disable.post.mjs +30 -0
  98. package/.output/server/chunks/routes/api/auth/lock-all.post.mjs +30 -0
  99. package/.output/server/chunks/routes/api/auth/lock.post.mjs +30 -0
  100. package/.output/server/chunks/routes/api/auth/login/options.post.mjs +30 -0
  101. package/.output/server/chunks/routes/api/auth/login/verify.post.mjs +30 -0
  102. package/.output/server/chunks/routes/api/auth/max-session.post.mjs +30 -0
  103. package/.output/server/chunks/routes/api/auth/register/options.post.mjs +30 -0
  104. package/.output/server/chunks/routes/api/auth/register/verify.post.mjs +30 -0
  105. package/.output/server/chunks/routes/api/auth/status.get.mjs +33 -0
  106. package/.output/server/chunks/routes/api/changes.get.mjs +38 -0
  107. package/.output/server/chunks/routes/api/chat/image.get.mjs +40 -0
  108. package/.output/server/chunks/routes/api/chat.get.mjs +93 -0
  109. package/.output/server/chunks/routes/api/choose.post.mjs +135 -0
  110. package/.output/server/chunks/routes/api/claude-statusline.post.mjs +35 -0
  111. package/.output/server/chunks/routes/api/close/status.get.mjs +36 -0
  112. package/.output/server/chunks/routes/api/close.post.mjs +37 -0
  113. package/.output/server/chunks/routes/api/codex-update.post.mjs +41 -0
  114. package/.output/server/chunks/routes/api/commands.get.mjs +42 -0
  115. package/.output/server/chunks/routes/api/config.get.mjs +86 -0
  116. package/.output/server/chunks/routes/api/dirs.get.mjs +33 -0
  117. package/.output/server/chunks/routes/api/dismiss.post.mjs +33 -0
  118. package/.output/server/chunks/routes/api/effort.post.mjs +36 -0
  119. package/.output/server/chunks/routes/api/efforts.get.mjs +37 -0
  120. package/.output/server/chunks/routes/api/file.post.mjs +34 -0
  121. package/.output/server/chunks/routes/api/gitroot.get.mjs +37 -0
  122. package/.output/server/chunks/routes/api/index.get.mjs +36 -0
  123. package/.output/server/chunks/routes/api/input.post.mjs +43 -0
  124. package/.output/server/chunks/routes/api/interrupt.post.mjs +48 -0
  125. package/.output/server/chunks/routes/api/isgit.get.mjs +37 -0
  126. package/.output/server/chunks/routes/api/machine/awake.get.mjs +39 -0
  127. package/.output/server/chunks/routes/api/machine/awake.post.mjs +40 -0
  128. package/.output/server/chunks/routes/api/machine/order.get.mjs +31 -0
  129. package/.output/server/chunks/routes/api/machine/order.post.mjs +36 -0
  130. package/.output/server/chunks/routes/api/machine/rename.post.mjs +39 -0
  131. package/.output/server/chunks/routes/api/menu.post.mjs +76 -0
  132. package/.output/server/chunks/routes/api/model.post.mjs +36 -0
  133. package/.output/server/chunks/routes/api/models.get.mjs +35 -0
  134. package/.output/server/chunks/routes/api/nav.post.mjs +58 -0
  135. package/.output/server/chunks/routes/api/onboarding.get.mjs +31 -0
  136. package/.output/server/chunks/routes/api/onboarding.post.mjs +34 -0
  137. package/.output/server/chunks/routes/api/phone.get.mjs +38 -0
  138. package/.output/server/chunks/routes/api/phone.post.mjs +38 -0
  139. package/.output/server/chunks/routes/api/plugins/actions.get.mjs +36 -0
  140. package/.output/server/chunks/routes/api/plugins/invoke.post.mjs +33 -0
  141. package/.output/server/chunks/routes/api/plugins/profiles.get.mjs +35 -0
  142. package/.output/server/chunks/routes/api/plugins/projects.get.mjs +37 -0
  143. package/.output/server/chunks/routes/api/plugins/projects.post.mjs +37 -0
  144. package/.output/server/chunks/routes/api/plugins/thread-limits.get.mjs +30 -0
  145. package/.output/server/chunks/routes/api/plugins/thread-limits.post.mjs +40 -0
  146. package/.output/server/chunks/routes/api/project/report.get.mjs +36 -0
  147. package/.output/server/chunks/routes/api/prompt.post.mjs +87 -0
  148. package/.output/server/chunks/routes/api/push/quiet.post.mjs +49 -0
  149. package/.output/server/chunks/routes/api/push/subscribe.post.mjs +51 -0
  150. package/.output/server/chunks/routes/api/push/test.post.mjs +32 -0
  151. package/.output/server/chunks/routes/api/push/unsubscribe.post.mjs +34 -0
  152. package/.output/server/chunks/routes/api/quotas.get.mjs +30 -0
  153. package/.output/server/chunks/routes/api/rename.post.mjs +36 -0
  154. package/.output/server/chunks/routes/api/requeue.post.mjs +34 -0
  155. package/.output/server/chunks/routes/api/restart.get.mjs +38 -0
  156. package/.output/server/chunks/routes/api/restart.post.mjs +39 -0
  157. package/.output/server/chunks/routes/api/reveal.post.mjs +31 -0
  158. package/.output/server/chunks/routes/api/screen-key.post.mjs +41 -0
  159. package/.output/server/chunks/routes/api/screen.get.mjs +76 -0
  160. package/.output/server/chunks/routes/api/search.get.mjs +76 -0
  161. package/.output/server/chunks/routes/api/seen.post.mjs +33 -0
  162. package/.output/server/chunks/routes/api/sessions.get.mjs +33 -0
  163. package/.output/server/chunks/routes/api/sessions.post.mjs +33 -0
  164. package/.output/server/chunks/routes/api/space.post.mjs +258 -0
  165. package/.output/server/chunks/routes/api/state.get.mjs +30 -0
  166. package/.output/server/chunks/routes/api/unqueue.post.mjs +35 -0
  167. package/.output/server/chunks/routes/api/update.get.mjs +78 -0
  168. package/.output/server/chunks/routes/api/upload.post.mjs +33 -0
  169. package/.output/server/chunks/routes/api/worktrees/remove.post.mjs +34 -0
  170. package/.output/server/chunks/routes/api/worktrees.get.mjs +31 -0
  171. package/.output/server/chunks/routes/favicon.ico.get.mjs +31 -0
  172. package/.output/server/chunks/routes/icons/_name_.get.mjs +31 -0
  173. package/.output/server/chunks/routes/renderer.mjs +358 -0
  174. package/.output/server/chunks/routes/uploads/_...name_.get.mjs +39 -0
  175. package/.output/server/chunks/routes/ws/_..._.mjs +32 -0
  176. package/.output/server/chunks/routes/ws/events.mjs +57 -0
  177. package/.output/server/chunks/routes/ws/mirror.mjs +157 -0
  178. package/.output/server/chunks/routes/ws/term.mjs +151 -0
  179. package/.output/server/chunks/virtual/_raw-helpers.mjs +12 -0
  180. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
  181. package/.output/server/chunks/virtual/precomputed.mjs +4 -0
  182. package/.output/server/index.mjs +26 -0
  183. package/.output/server/node_modules/@babel/parser/lib/index.js +14616 -0
  184. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  185. package/.output/server/node_modules/@hexagon/base64/package.json +73 -0
  186. package/.output/server/node_modules/@hexagon/base64/src/base64.js +190 -0
  187. package/.output/server/node_modules/@levischuck/tiny-cbor/esm/cbor/cbor.js +440 -0
  188. package/.output/server/node_modules/@levischuck/tiny-cbor/esm/cbor/cbor_internal.js +111 -0
  189. package/.output/server/node_modules/@levischuck/tiny-cbor/esm/index.js +1 -0
  190. package/.output/server/node_modules/@levischuck/tiny-cbor/esm/package.json +3 -0
  191. package/.output/server/node_modules/@levischuck/tiny-cbor/package.json +25 -0
  192. package/.output/server/node_modules/@peculiar/asn1-android/build/es2015/attestation.js +34 -0
  193. package/.output/server/node_modules/@peculiar/asn1-android/build/es2015/index.js +3 -0
  194. package/.output/server/node_modules/@peculiar/asn1-android/build/es2015/key_description.js +512 -0
  195. package/.output/server/node_modules/@peculiar/asn1-android/build/es2015/nonstandard.js +103 -0
  196. package/.output/server/node_modules/@peculiar/asn1-android/build/es2015/package.json +3 -0
  197. package/.output/server/node_modules/@peculiar/asn1-android/node_modules/tslib/modules/index.js +70 -0
  198. package/.output/server/node_modules/@peculiar/asn1-android/node_modules/tslib/modules/package.json +3 -0
  199. package/.output/server/node_modules/@peculiar/asn1-android/node_modules/tslib/package.json +47 -0
  200. package/.output/server/node_modules/@peculiar/asn1-android/node_modules/tslib/tslib.js +484 -0
  201. package/.output/server/node_modules/@peculiar/asn1-android/package.json +64 -0
  202. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/attribute.js +22 -0
  203. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/attributes/counter_signature.js +13 -0
  204. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/attributes/index.js +8 -0
  205. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/attributes/message_digest.js +8 -0
  206. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/attributes/signing_time.js +13 -0
  207. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/certificate_choices.js +64 -0
  208. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/content_info.js +22 -0
  209. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/encapsulated_content_info.js +40 -0
  210. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/encrypted_content_info.js +56 -0
  211. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/enveloped_data.js +60 -0
  212. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/index.js +24 -0
  213. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/issuer_and_serial_number.js +23 -0
  214. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/kek_recipient_info.js +53 -0
  215. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/key_agree_recipient_info.js +167 -0
  216. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/key_trans_recipient_info.js +51 -0
  217. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/object_identifiers.js +10 -0
  218. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/originator_info.js +31 -0
  219. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/other_key_attribute.js +22 -0
  220. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/password_recipient_info.js +32 -0
  221. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/recipient_info.js +75 -0
  222. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/recipient_infos.js +20 -0
  223. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/revocation_info_choice.js +54 -0
  224. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/signed_data.js +64 -0
  225. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/signer_identifier.js +28 -0
  226. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/signer_info.js +70 -0
  227. package/.output/server/node_modules/@peculiar/asn1-cms/build/cjs/types.js +51 -0
  228. package/.output/server/node_modules/@peculiar/asn1-cms/node_modules/tslib/modules/index.js +70 -0
  229. package/.output/server/node_modules/@peculiar/asn1-cms/node_modules/tslib/modules/package.json +3 -0
  230. package/.output/server/node_modules/@peculiar/asn1-cms/node_modules/tslib/package.json +47 -0
  231. package/.output/server/node_modules/@peculiar/asn1-cms/node_modules/tslib/tslib.js +484 -0
  232. package/.output/server/node_modules/@peculiar/asn1-cms/package.json +65 -0
  233. package/.output/server/node_modules/@peculiar/asn1-csr/build/cjs/attributes.js +20 -0
  234. package/.output/server/node_modules/@peculiar/asn1-csr/build/cjs/certification_request.js +29 -0
  235. package/.output/server/node_modules/@peculiar/asn1-csr/build/cjs/certification_request_info.js +34 -0
  236. package/.output/server/node_modules/@peculiar/asn1-csr/build/cjs/index.js +6 -0
  237. package/.output/server/node_modules/@peculiar/asn1-csr/node_modules/tslib/modules/index.js +70 -0
  238. package/.output/server/node_modules/@peculiar/asn1-csr/node_modules/tslib/modules/package.json +3 -0
  239. package/.output/server/node_modules/@peculiar/asn1-csr/node_modules/tslib/package.json +47 -0
  240. package/.output/server/node_modules/@peculiar/asn1-csr/node_modules/tslib/tslib.js +484 -0
  241. package/.output/server/node_modules/@peculiar/asn1-csr/package.json +65 -0
  242. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/algorithms.js +14 -0
  243. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/ec_parameters.js +27 -0
  244. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/ec_private_key.js +36 -0
  245. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/ec_signature_value.js +25 -0
  246. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/index.js +9 -0
  247. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/object_identifiers.js +26 -0
  248. package/.output/server/node_modules/@peculiar/asn1-ecc/build/cjs/rfc3279.js +95 -0
  249. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/algorithms.js +10 -0
  250. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/ec_parameters.js +24 -0
  251. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/ec_private_key.js +32 -0
  252. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/ec_signature_value.js +21 -0
  253. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/index.js +6 -0
  254. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/object_identifiers.js +23 -0
  255. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/package.json +3 -0
  256. package/.output/server/node_modules/@peculiar/asn1-ecc/build/es2015/rfc3279.js +90 -0
  257. package/.output/server/node_modules/@peculiar/asn1-ecc/node_modules/tslib/modules/index.js +70 -0
  258. package/.output/server/node_modules/@peculiar/asn1-ecc/node_modules/tslib/modules/package.json +3 -0
  259. package/.output/server/node_modules/@peculiar/asn1-ecc/node_modules/tslib/package.json +47 -0
  260. package/.output/server/node_modules/@peculiar/asn1-ecc/node_modules/tslib/tslib.js +484 -0
  261. package/.output/server/node_modules/@peculiar/asn1-ecc/package.json +66 -0
  262. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/attribute.js +36 -0
  263. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/authenticated_safe.js +20 -0
  264. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/cert_bag.js +26 -0
  265. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/crl_bag.js +25 -0
  266. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/index.js +9 -0
  267. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/key_bag.js +12 -0
  268. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/pkcs8_shrouded_key_bag.js +12 -0
  269. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/secret_bag.js +22 -0
  270. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/bags/types.js +11 -0
  271. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/index.js +10 -0
  272. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/mac_data.js +27 -0
  273. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/object_identifiers.js +14 -0
  274. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/pfx.js +28 -0
  275. package/.output/server/node_modules/@peculiar/asn1-pfx/build/cjs/safe_bag.js +45 -0
  276. package/.output/server/node_modules/@peculiar/asn1-pfx/node_modules/tslib/modules/index.js +70 -0
  277. package/.output/server/node_modules/@peculiar/asn1-pfx/node_modules/tslib/modules/package.json +3 -0
  278. package/.output/server/node_modules/@peculiar/asn1-pfx/node_modules/tslib/package.json +47 -0
  279. package/.output/server/node_modules/@peculiar/asn1-pfx/node_modules/tslib/tslib.js +484 -0
  280. package/.output/server/node_modules/@peculiar/asn1-pfx/package.json +67 -0
  281. package/.output/server/node_modules/@peculiar/asn1-pkcs8/build/cjs/encrypted_private_key_info.js +23 -0
  282. package/.output/server/node_modules/@peculiar/asn1-pkcs8/build/cjs/index.js +5 -0
  283. package/.output/server/node_modules/@peculiar/asn1-pkcs8/build/cjs/private_key_info.js +54 -0
  284. package/.output/server/node_modules/@peculiar/asn1-pkcs8/node_modules/tslib/modules/index.js +70 -0
  285. package/.output/server/node_modules/@peculiar/asn1-pkcs8/node_modules/tslib/modules/package.json +3 -0
  286. package/.output/server/node_modules/@peculiar/asn1-pkcs8/node_modules/tslib/package.json +47 -0
  287. package/.output/server/node_modules/@peculiar/asn1-pkcs8/node_modules/tslib/tslib.js +484 -0
  288. package/.output/server/node_modules/@peculiar/asn1-pkcs8/package.json +63 -0
  289. package/.output/server/node_modules/@peculiar/asn1-pkcs9/build/cjs/index.js +301 -0
  290. package/.output/server/node_modules/@peculiar/asn1-pkcs9/node_modules/tslib/modules/index.js +70 -0
  291. package/.output/server/node_modules/@peculiar/asn1-pkcs9/node_modules/tslib/modules/package.json +3 -0
  292. package/.output/server/node_modules/@peculiar/asn1-pkcs9/node_modules/tslib/package.json +47 -0
  293. package/.output/server/node_modules/@peculiar/asn1-pkcs9/node_modules/tslib/tslib.js +484 -0
  294. package/.output/server/node_modules/@peculiar/asn1-pkcs9/package.json +67 -0
  295. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/algorithms.js +40 -0
  296. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/index.js +9 -0
  297. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/object_identifiers.js +28 -0
  298. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/other_prime_info.js +46 -0
  299. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/index.js +6 -0
  300. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsaes_oaep.js +45 -0
  301. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsassa_pkcs1_v1_5.js +20 -0
  302. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsassa_pss.js +53 -0
  303. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/rsa_private_key.js +79 -0
  304. package/.output/server/node_modules/@peculiar/asn1-rsa/build/cjs/rsa_public_key.js +25 -0
  305. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/algorithms.js +36 -0
  306. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/index.js +6 -0
  307. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/object_identifiers.js +25 -0
  308. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/other_prime_info.js +42 -0
  309. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/package.json +3 -0
  310. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/index.js +3 -0
  311. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsaes_oaep.js +41 -0
  312. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pkcs1_v1_5.js +16 -0
  313. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pss.js +49 -0
  314. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/rsa_private_key.js +75 -0
  315. package/.output/server/node_modules/@peculiar/asn1-rsa/build/es2015/rsa_public_key.js +21 -0
  316. package/.output/server/node_modules/@peculiar/asn1-rsa/node_modules/tslib/modules/index.js +70 -0
  317. package/.output/server/node_modules/@peculiar/asn1-rsa/node_modules/tslib/modules/package.json +3 -0
  318. package/.output/server/node_modules/@peculiar/asn1-rsa/node_modules/tslib/package.json +47 -0
  319. package/.output/server/node_modules/@peculiar/asn1-rsa/node_modules/tslib/tslib.js +484 -0
  320. package/.output/server/node_modules/@peculiar/asn1-rsa/package.json +64 -0
  321. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/convert.js +25 -0
  322. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/converters.js +148 -0
  323. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/decorators.js +52 -0
  324. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/enums.js +40 -0
  325. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/errors/index.js +4 -0
  326. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/errors/schema_validation.js +7 -0
  327. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/helper.js +44 -0
  328. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/index.js +22 -0
  329. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/objects.js +17 -0
  330. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/parser.js +313 -0
  331. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/schema.js +165 -0
  332. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js +150 -0
  333. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/storage.js +5 -0
  334. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/types/bit_string.js +71 -0
  335. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/types/index.js +5 -0
  336. package/.output/server/node_modules/@peculiar/asn1-schema/build/cjs/types/octet_string.js +45 -0
  337. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/convert.js +20 -0
  338. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/converters.js +143 -0
  339. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/decorators.js +43 -0
  340. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/enums.js +37 -0
  341. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/errors/index.js +1 -0
  342. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js +3 -0
  343. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/helper.js +39 -0
  344. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/index.js +9 -0
  345. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/objects.js +13 -0
  346. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/package.json +3 -0
  347. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/parser.js +308 -0
  348. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/schema.js +160 -0
  349. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/serializer.js +145 -0
  350. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/storage.js +2 -0
  351. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/types/bit_string.js +66 -0
  352. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/types/index.js +2 -0
  353. package/.output/server/node_modules/@peculiar/asn1-schema/build/es2015/types/octet_string.js +40 -0
  354. package/.output/server/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/index.js +70 -0
  355. package/.output/server/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/package.json +3 -0
  356. package/.output/server/node_modules/@peculiar/asn1-schema/node_modules/tslib/package.json +47 -0
  357. package/.output/server/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.js +484 -0
  358. package/.output/server/node_modules/@peculiar/asn1-schema/package.json +74 -0
  359. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/algorithm_identifier.js +28 -0
  360. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/attribute.js +22 -0
  361. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/certificate.js +29 -0
  362. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/certificate_list.js +29 -0
  363. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extension.js +41 -0
  364. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/authority_information_access.js +36 -0
  365. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/authority_key_identifier.js +48 -0
  366. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/basic_constraints.js +27 -0
  367. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/certificate_issuer.js +19 -0
  368. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/certificate_policies.js +136 -0
  369. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_delta_indicator.js +14 -0
  370. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_distribution_points.js +132 -0
  371. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_freshest.js +22 -0
  372. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_issuing_distribution_point.js +68 -0
  373. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_number.js +20 -0
  374. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_reason.js +39 -0
  375. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/entrust_version_info.js +46 -0
  376. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/extended_key_usage.js +28 -0
  377. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/index.js +28 -0
  378. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/inhibit_any_policy.js +23 -0
  379. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/invalidity_date.js +22 -0
  380. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/issuer_alternative_name.js +19 -0
  381. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/key_usage.js +56 -0
  382. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/name_constraints.js +74 -0
  383. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/policy_constraints.js +33 -0
  384. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/policy_mappings.js +35 -0
  385. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/private_key_usage_period.js +31 -0
  386. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_alternative_name.js +19 -0
  387. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_directory_attributes.js +22 -0
  388. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_info_access.js +22 -0
  389. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_key_identifier.js +9 -0
  390. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/general_name.js +132 -0
  391. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/general_names.js +20 -0
  392. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/index.js +19 -0
  393. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/ip_converter.js +177 -0
  394. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/name.js +110 -0
  395. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/object_identifiers.js +16 -0
  396. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/subject_public_key_info.js +20 -0
  397. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/tbs_cert_list.js +83 -0
  398. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/tbs_certificate.js +78 -0
  399. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/time.js +43 -0
  400. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/types.js +9 -0
  401. package/.output/server/node_modules/@peculiar/asn1-x509/build/cjs/validity.js +23 -0
  402. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/algorithm_identifier.js +24 -0
  403. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/attribute.js +18 -0
  404. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/certificate.js +25 -0
  405. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/certificate_list.js +25 -0
  406. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extension.js +37 -0
  407. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_information_access.js +32 -0
  408. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_key_identifier.js +43 -0
  409. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/basic_constraints.js +23 -0
  410. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_issuer.js +16 -0
  411. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_policies.js +129 -0
  412. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_delta_indicator.js +11 -0
  413. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_distribution_points.js +127 -0
  414. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_freshest.js +19 -0
  415. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_issuing_distribution_point.js +64 -0
  416. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_number.js +17 -0
  417. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_reason.js +36 -0
  418. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/entrust_version_info.js +41 -0
  419. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/extended_key_usage.js +25 -0
  420. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/index.js +25 -0
  421. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/inhibit_any_policy.js +20 -0
  422. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/invalidity_date.js +19 -0
  423. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/issuer_alternative_name.js +16 -0
  424. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/key_usage.js +52 -0
  425. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/name_constraints.js +69 -0
  426. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_constraints.js +29 -0
  427. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_mappings.js +31 -0
  428. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/private_key_usage_period.js +27 -0
  429. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_alternative_name.js +16 -0
  430. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_directory_attributes.js +19 -0
  431. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_info_access.js +19 -0
  432. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_key_identifier.js +5 -0
  433. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/general_name.js +127 -0
  434. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/general_names.js +17 -0
  435. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/index.js +16 -0
  436. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/ip_converter.js +173 -0
  437. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/name.js +106 -0
  438. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/object_identifiers.js +13 -0
  439. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/package.json +3 -0
  440. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/subject_public_key_info.js +16 -0
  441. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/tbs_cert_list.js +78 -0
  442. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/tbs_certificate.js +74 -0
  443. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/time.js +40 -0
  444. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/types.js +6 -0
  445. package/.output/server/node_modules/@peculiar/asn1-x509/build/es2015/validity.js +19 -0
  446. package/.output/server/node_modules/@peculiar/asn1-x509/node_modules/tslib/modules/index.js +70 -0
  447. package/.output/server/node_modules/@peculiar/asn1-x509/node_modules/tslib/modules/package.json +3 -0
  448. package/.output/server/node_modules/@peculiar/asn1-x509/node_modules/tslib/package.json +47 -0
  449. package/.output/server/node_modules/@peculiar/asn1-x509/node_modules/tslib/tslib.js +484 -0
  450. package/.output/server/node_modules/@peculiar/asn1-x509/package.json +64 -0
  451. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/aa_clear_attrs.js +27 -0
  452. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/aa_controls.js +44 -0
  453. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_cert_issuer.js +31 -0
  454. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_cert_validity_period.js +19 -0
  455. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_spec.js +19 -0
  456. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/attribute_certificate.js +25 -0
  457. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/attribute_certificate_info.js +67 -0
  458. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/class_list.js +16 -0
  459. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/clearance.js +31 -0
  460. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/holder.js +41 -0
  461. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/ietf_attr_syntax.js +46 -0
  462. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/index.js +23 -0
  463. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/issuer_serial.js +30 -0
  464. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/object_digest_info.js +37 -0
  465. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/object_identifiers.js +17 -0
  466. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/proxy_info.js +20 -0
  467. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/role_syntax.js +29 -0
  468. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/security_category.js +27 -0
  469. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/svce_auth_info.js +27 -0
  470. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/target.js +79 -0
  471. package/.output/server/node_modules/@peculiar/asn1-x509-attr/build/cjs/v2_form.js +39 -0
  472. package/.output/server/node_modules/@peculiar/asn1-x509-attr/node_modules/tslib/modules/index.js +70 -0
  473. package/.output/server/node_modules/@peculiar/asn1-x509-attr/node_modules/tslib/modules/package.json +3 -0
  474. package/.output/server/node_modules/@peculiar/asn1-x509-attr/node_modules/tslib/package.json +47 -0
  475. package/.output/server/node_modules/@peculiar/asn1-x509-attr/node_modules/tslib/tslib.js +484 -0
  476. package/.output/server/node_modules/@peculiar/asn1-x509-attr/package.json +64 -0
  477. package/.output/server/node_modules/@peculiar/utils/build/cjs/bytes/buffer-source.js +115 -0
  478. package/.output/server/node_modules/@peculiar/utils/build/cjs/bytes/concat.js +41 -0
  479. package/.output/server/node_modules/@peculiar/utils/build/cjs/bytes/equal.js +17 -0
  480. package/.output/server/node_modules/@peculiar/utils/build/cjs/bytes/index.js +31 -0
  481. package/.output/server/node_modules/@peculiar/utils/build/cjs/bytes/sequence.js +161 -0
  482. package/.output/server/node_modules/@peculiar/utils/build/cjs/converters/convert.js +74 -0
  483. package/.output/server/node_modules/@peculiar/utils/build/cjs/converters/defaults.js +72 -0
  484. package/.output/server/node_modules/@peculiar/utils/build/cjs/converters/index.js +18 -0
  485. package/.output/server/node_modules/@peculiar/utils/build/cjs/converters/registry.js +188 -0
  486. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/base64.js +48 -0
  487. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/base64url.js +26 -0
  488. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/binary.js +26 -0
  489. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/hex.js +229 -0
  490. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/index.js +10 -0
  491. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/utf16.js +24 -0
  492. package/.output/server/node_modules/@peculiar/utils/build/cjs/encoding/utf8.js +13 -0
  493. package/.output/server/node_modules/@peculiar/utils/build/cjs/index.js +10 -0
  494. package/.output/server/node_modules/@peculiar/utils/build/cjs/legacy/buffer-source-converter.js +37 -0
  495. package/.output/server/node_modules/@peculiar/utils/build/cjs/legacy/convert.js +72 -0
  496. package/.output/server/node_modules/@peculiar/utils/build/cjs/legacy/functions.js +23 -0
  497. package/.output/server/node_modules/@peculiar/utils/build/cjs/legacy/index.js +11 -0
  498. package/.output/server/node_modules/@peculiar/utils/build/cjs/package.json +3 -0
  499. package/.output/server/node_modules/@peculiar/utils/build/cjs/pem/index.js +14 -0
  500. package/.output/server/node_modules/@peculiar/utils/build/cjs/pem/pem.js +140 -0
  501. package/.output/server/node_modules/@peculiar/utils/build/esm/bytes/buffer-source.js +101 -0
  502. package/.output/server/node_modules/@peculiar/utils/build/esm/bytes/concat.js +37 -0
  503. package/.output/server/node_modules/@peculiar/utils/build/esm/bytes/equal.js +14 -0
  504. package/.output/server/node_modules/@peculiar/utils/build/esm/bytes/index.js +4 -0
  505. package/.output/server/node_modules/@peculiar/utils/build/esm/bytes/sequence.js +150 -0
  506. package/.output/server/node_modules/@peculiar/utils/build/esm/converters/convert.js +71 -0
  507. package/.output/server/node_modules/@peculiar/utils/build/esm/converters/defaults.js +68 -0
  508. package/.output/server/node_modules/@peculiar/utils/build/esm/converters/index.js +3 -0
  509. package/.output/server/node_modules/@peculiar/utils/build/esm/converters/registry.js +185 -0
  510. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/base64.js +40 -0
  511. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/base64url.js +19 -0
  512. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/binary.js +20 -0
  513. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/hex.js +220 -0
  514. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/index.js +6 -0
  515. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/utf16.js +19 -0
  516. package/.output/server/node_modules/@peculiar/utils/build/esm/encoding/utf8.js +8 -0
  517. package/.output/server/node_modules/@peculiar/utils/build/esm/index.js +6 -0
  518. package/.output/server/node_modules/@peculiar/utils/build/esm/legacy/buffer-source-converter.js +33 -0
  519. package/.output/server/node_modules/@peculiar/utils/build/esm/legacy/convert.js +68 -0
  520. package/.output/server/node_modules/@peculiar/utils/build/esm/legacy/functions.js +18 -0
  521. package/.output/server/node_modules/@peculiar/utils/build/esm/legacy/index.js +3 -0
  522. package/.output/server/node_modules/@peculiar/utils/build/esm/pem/index.js +1 -0
  523. package/.output/server/node_modules/@peculiar/utils/build/esm/pem/pem.js +129 -0
  524. package/.output/server/node_modules/@peculiar/utils/node_modules/tslib/modules/index.js +70 -0
  525. package/.output/server/node_modules/@peculiar/utils/node_modules/tslib/modules/package.json +3 -0
  526. package/.output/server/node_modules/@peculiar/utils/node_modules/tslib/package.json +47 -0
  527. package/.output/server/node_modules/@peculiar/utils/node_modules/tslib/tslib.js +484 -0
  528. package/.output/server/node_modules/@peculiar/utils/package.json +111 -0
  529. package/.output/server/node_modules/@peculiar/x509/build/x509.cjs.js +3445 -0
  530. package/.output/server/node_modules/@peculiar/x509/node_modules/tslib/modules/index.js +70 -0
  531. package/.output/server/node_modules/@peculiar/x509/node_modules/tslib/modules/package.json +3 -0
  532. package/.output/server/node_modules/@peculiar/x509/node_modules/tslib/package.json +47 -0
  533. package/.output/server/node_modules/@peculiar/x509/node_modules/tslib/tslib.js +484 -0
  534. package/.output/server/node_modules/@peculiar/x509/package.json +94 -0
  535. package/.output/server/node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js +41 -0
  536. package/.output/server/node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js +171 -0
  537. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js +17 -0
  538. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js +21 -0
  539. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js +31 -0
  540. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js +11 -0
  541. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js +73 -0
  542. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/cose.js +90 -0
  543. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js +16 -0
  544. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js +34 -0
  545. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js +16 -0
  546. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js +11 -0
  547. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/fetch.js +14 -0
  548. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js +24 -0
  549. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js +20 -0
  550. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js +77 -0
  551. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/index.js +17 -0
  552. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js +96 -0
  553. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/index.js +11 -0
  554. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js +72 -0
  555. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js +35 -0
  556. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js +14 -0
  557. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js +11 -0
  558. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js +49 -0
  559. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.js +8 -0
  560. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/index.js +7 -0
  561. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +20 -0
  562. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +19 -0
  563. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +73 -0
  564. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js +32 -0
  565. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js +73 -0
  566. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js +51 -0
  567. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js +91 -0
  568. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js +79 -0
  569. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/logging.js +19 -0
  570. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/mapJWSAlgToCOSEAlg.js +31 -0
  571. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js +35 -0
  572. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js +41 -0
  573. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js +106 -0
  574. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js +25 -0
  575. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/toHash.js +12 -0
  576. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js +134 -0
  577. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js +34 -0
  578. package/.output/server/node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js +35 -0
  579. package/.output/server/node_modules/@simplewebauthn/server/esm/index.js +8 -0
  580. package/.output/server/node_modules/@simplewebauthn/server/esm/metadata/mdsTypes.js +17 -0
  581. package/.output/server/node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js +12 -0
  582. package/.output/server/node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js +159 -0
  583. package/.output/server/node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js +42 -0
  584. package/.output/server/node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js +59 -0
  585. package/.output/server/node_modules/@simplewebauthn/server/esm/package.json +3 -0
  586. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js +181 -0
  587. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js +137 -0
  588. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js +58 -0
  589. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js +94 -0
  590. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js +331 -0
  591. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js +120 -0
  592. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js +113 -0
  593. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js +58 -0
  594. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js +48 -0
  595. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js +113 -0
  596. package/.output/server/node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js +213 -0
  597. package/.output/server/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js +171 -0
  598. package/.output/server/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js +32 -0
  599. package/.output/server/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js +25 -0
  600. package/.output/server/node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js +74 -0
  601. package/.output/server/node_modules/@simplewebauthn/server/esm/services/metadataService.js +268 -0
  602. package/.output/server/node_modules/@simplewebauthn/server/esm/services/settingsService.js +74 -0
  603. package/.output/server/node_modules/@simplewebauthn/server/esm/types/index.js +1 -0
  604. package/.output/server/node_modules/@simplewebauthn/server/package.json +65 -0
  605. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6801 -0
  606. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  607. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +692 -0
  608. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  609. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1420 -0
  610. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  611. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1905 -0
  612. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  613. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +7006 -0
  614. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  615. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1867 -0
  616. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  617. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +904 -0
  618. package/.output/server/node_modules/@vue/server-renderer/package.json +53 -0
  619. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +655 -0
  620. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  621. package/.output/server/node_modules/agent-base/dist/helpers.js +66 -0
  622. package/.output/server/node_modules/agent-base/dist/index.js +178 -0
  623. package/.output/server/node_modules/agent-base/package.json +46 -0
  624. package/.output/server/node_modules/asn1.js/lib/asn1/api.js +57 -0
  625. package/.output/server/node_modules/asn1.js/lib/asn1/base/buffer.js +153 -0
  626. package/.output/server/node_modules/asn1.js/lib/asn1/base/index.js +8 -0
  627. package/.output/server/node_modules/asn1.js/lib/asn1/base/node.js +638 -0
  628. package/.output/server/node_modules/asn1.js/lib/asn1/base/reporter.js +123 -0
  629. package/.output/server/node_modules/asn1.js/lib/asn1/constants/der.js +58 -0
  630. package/.output/server/node_modules/asn1.js/lib/asn1/constants/index.js +21 -0
  631. package/.output/server/node_modules/asn1.js/lib/asn1/decoders/der.js +335 -0
  632. package/.output/server/node_modules/asn1.js/lib/asn1/decoders/index.js +6 -0
  633. package/.output/server/node_modules/asn1.js/lib/asn1/decoders/pem.js +51 -0
  634. package/.output/server/node_modules/asn1.js/lib/asn1/encoders/der.js +295 -0
  635. package/.output/server/node_modules/asn1.js/lib/asn1/encoders/index.js +6 -0
  636. package/.output/server/node_modules/asn1.js/lib/asn1/encoders/pem.js +23 -0
  637. package/.output/server/node_modules/asn1.js/lib/asn1.js +11 -0
  638. package/.output/server/node_modules/asn1.js/package.json +36 -0
  639. package/.output/server/node_modules/asn1js/build/index.js +3266 -0
  640. package/.output/server/node_modules/asn1js/package.json +86 -0
  641. package/.output/server/node_modules/bn.js/lib/bn.js +3463 -0
  642. package/.output/server/node_modules/bn.js/package.json +36 -0
  643. package/.output/server/node_modules/buffer-equal-constant-time/index.js +41 -0
  644. package/.output/server/node_modules/buffer-equal-constant-time/package.json +21 -0
  645. package/.output/server/node_modules/debug/package.json +64 -0
  646. package/.output/server/node_modules/debug/src/browser.js +272 -0
  647. package/.output/server/node_modules/debug/src/common.js +292 -0
  648. package/.output/server/node_modules/debug/src/index.js +10 -0
  649. package/.output/server/node_modules/debug/src/node.js +263 -0
  650. package/.output/server/node_modules/devalue/index.js +17 -0
  651. package/.output/server/node_modules/devalue/package.json +39 -0
  652. package/.output/server/node_modules/devalue/src/base64.js +60 -0
  653. package/.output/server/node_modules/devalue/src/constants.js +12 -0
  654. package/.output/server/node_modules/devalue/src/operations.js +221 -0
  655. package/.output/server/node_modules/devalue/src/parse.js +279 -0
  656. package/.output/server/node_modules/devalue/src/stringify.js +433 -0
  657. package/.output/server/node_modules/devalue/src/uneval.js +698 -0
  658. package/.output/server/node_modules/devalue/src/utils.js +190 -0
  659. package/.output/server/node_modules/ecdsa-sig-formatter/package.json +46 -0
  660. package/.output/server/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +187 -0
  661. package/.output/server/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +23 -0
  662. package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  663. package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
  664. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  665. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  666. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  667. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  668. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  669. package/.output/server/node_modules/entities/package.json +120 -0
  670. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  671. package/.output/server/node_modules/estree-walker/package.json +37 -0
  672. package/.output/server/node_modules/hookable/dist/index.mjs +257 -0
  673. package/.output/server/node_modules/hookable/package.json +54 -0
  674. package/.output/server/node_modules/http_ece/ece.js +528 -0
  675. package/.output/server/node_modules/http_ece/package.json +29 -0
  676. package/.output/server/node_modules/https-proxy-agent/dist/index.js +180 -0
  677. package/.output/server/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
  678. package/.output/server/node_modules/https-proxy-agent/package.json +50 -0
  679. package/.output/server/node_modules/inherits/inherits.js +9 -0
  680. package/.output/server/node_modules/inherits/inherits_browser.js +27 -0
  681. package/.output/server/node_modules/inherits/package.json +29 -0
  682. package/.output/server/node_modules/jwa/index.js +266 -0
  683. package/.output/server/node_modules/jwa/package.json +37 -0
  684. package/.output/server/node_modules/jws/index.js +22 -0
  685. package/.output/server/node_modules/jws/lib/data-stream.js +55 -0
  686. package/.output/server/node_modules/jws/lib/sign-stream.js +83 -0
  687. package/.output/server/node_modules/jws/lib/tostring.js +10 -0
  688. package/.output/server/node_modules/jws/lib/verify-stream.js +125 -0
  689. package/.output/server/node_modules/jws/package.json +34 -0
  690. package/.output/server/node_modules/minimalistic-assert/index.js +11 -0
  691. package/.output/server/node_modules/minimalistic-assert/package.json +19 -0
  692. package/.output/server/node_modules/ms/index.js +162 -0
  693. package/.output/server/node_modules/ms/package.json +38 -0
  694. package/.output/server/node_modules/nostics/dist/formatters/ansi.mjs +19 -0
  695. package/.output/server/node_modules/nostics/dist/index.mjs +194 -0
  696. package/.output/server/node_modules/nostics/package.json +126 -0
  697. package/.output/server/node_modules/pvtsutils/build/index.js +399 -0
  698. package/.output/server/node_modules/pvtsutils/package.json +76 -0
  699. package/.output/server/node_modules/pvutils/build/utils.js +361 -0
  700. package/.output/server/node_modules/pvutils/package.json +63 -0
  701. package/.output/server/node_modules/qrcode-terminal/package.json +47 -0
  702. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js +22 -0
  703. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js +38 -0
  704. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js +7 -0
  705. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js +10 -0
  706. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRMath.js +44 -0
  707. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRMode.js +6 -0
  708. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js +66 -0
  709. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js +298 -0
  710. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js +272 -0
  711. package/.output/server/node_modules/qrcode-terminal/vendor/QRCode/index.js +462 -0
  712. package/.output/server/node_modules/reflect-metadata/Reflect.js +1415 -0
  713. package/.output/server/node_modules/reflect-metadata/package.json +68 -0
  714. package/.output/server/node_modules/safe-buffer/index.js +65 -0
  715. package/.output/server/node_modules/safe-buffer/package.json +51 -0
  716. package/.output/server/node_modules/safer-buffer/package.json +34 -0
  717. package/.output/server/node_modules/safer-buffer/safer.js +77 -0
  718. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  719. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  720. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  721. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  722. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  723. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  724. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  725. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  726. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  727. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  728. package/.output/server/node_modules/source-map-js/package.json +71 -0
  729. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  730. package/.output/server/node_modules/supports-color/index.js +202 -0
  731. package/.output/server/node_modules/supports-color/package.json +64 -0
  732. package/.output/server/node_modules/tslib/modules/index.js +70 -0
  733. package/.output/server/node_modules/tslib/modules/package.json +3 -0
  734. package/.output/server/node_modules/tslib/package.json +47 -0
  735. package/.output/server/node_modules/tslib/tslib.js +484 -0
  736. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/auto-injectable.js +46 -0
  737. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/index.js +20 -0
  738. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/inject-all-with-transform.js +13 -0
  739. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/inject-all.js +12 -0
  740. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/inject-with-transform.js +10 -0
  741. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/inject.js +12 -0
  742. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/injectable.js +21 -0
  743. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/registry.js +14 -0
  744. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/scoped.js +13 -0
  745. package/.output/server/node_modules/tsyringe/dist/cjs/decorators/singleton.js +11 -0
  746. package/.output/server/node_modules/tsyringe/dist/cjs/dependency-container.js +341 -0
  747. package/.output/server/node_modules/tsyringe/dist/cjs/error-helpers.js +19 -0
  748. package/.output/server/node_modules/tsyringe/dist/cjs/factories/index.js +8 -0
  749. package/.output/server/node_modules/tsyringe/dist/cjs/factories/instance-caching-factory.js +12 -0
  750. package/.output/server/node_modules/tsyringe/dist/cjs/factories/instance-per-container-caching-factory.js +14 -0
  751. package/.output/server/node_modules/tsyringe/dist/cjs/factories/predicate-aware-class-factory.js +19 -0
  752. package/.output/server/node_modules/tsyringe/dist/cjs/index.js +15 -0
  753. package/.output/server/node_modules/tsyringe/dist/cjs/interceptors.js +17 -0
  754. package/.output/server/node_modules/tsyringe/dist/cjs/lazy-helpers.js +54 -0
  755. package/.output/server/node_modules/tsyringe/dist/cjs/providers/class-provider.js +7 -0
  756. package/.output/server/node_modules/tsyringe/dist/cjs/providers/factory-provider.js +7 -0
  757. package/.output/server/node_modules/tsyringe/dist/cjs/providers/index.js +12 -0
  758. package/.output/server/node_modules/tsyringe/dist/cjs/providers/injection-token.js +24 -0
  759. package/.output/server/node_modules/tsyringe/dist/cjs/providers/provider.js +14 -0
  760. package/.output/server/node_modules/tsyringe/dist/cjs/providers/token-provider.js +7 -0
  761. package/.output/server/node_modules/tsyringe/dist/cjs/providers/value-provider.js +7 -0
  762. package/.output/server/node_modules/tsyringe/dist/cjs/reflection-helpers.js +27 -0
  763. package/.output/server/node_modules/tsyringe/dist/cjs/registry-base.js +39 -0
  764. package/.output/server/node_modules/tsyringe/dist/cjs/registry.js +6 -0
  765. package/.output/server/node_modules/tsyringe/dist/cjs/resolution-context.js +8 -0
  766. package/.output/server/node_modules/tsyringe/dist/cjs/types/disposable.js +13 -0
  767. package/.output/server/node_modules/tsyringe/dist/cjs/types/index.js +4 -0
  768. package/.output/server/node_modules/tsyringe/dist/cjs/types/lifecycle.js +10 -0
  769. package/.output/server/node_modules/tsyringe/node_modules/tslib/package.json +37 -0
  770. package/.output/server/node_modules/tsyringe/node_modules/tslib/tslib.js +284 -0
  771. package/.output/server/node_modules/tsyringe/package.json +63 -0
  772. package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
  773. package/.output/server/node_modules/ufo/package.json +48 -0
  774. package/.output/server/node_modules/unhead/dist/client.mjs +22 -0
  775. package/.output/server/node_modules/unhead/dist/legacy.mjs +33 -0
  776. package/.output/server/node_modules/unhead/dist/minify.mjs +183 -0
  777. package/.output/server/node_modules/unhead/dist/parser.mjs +518 -0
  778. package/.output/server/node_modules/unhead/dist/plugins.mjs +746 -0
  779. package/.output/server/node_modules/unhead/dist/server.mjs +99 -0
  780. package/.output/server/node_modules/unhead/dist/shared/unhead.-hZVKou0.mjs +400 -0
  781. package/.output/server/node_modules/unhead/dist/shared/unhead.BEmVMkeA.mjs +673 -0
  782. package/.output/server/node_modules/unhead/dist/shared/unhead.BGFxPGPQ.mjs +47 -0
  783. package/.output/server/node_modules/unhead/dist/shared/unhead.BQWSw36o.mjs +192 -0
  784. package/.output/server/node_modules/unhead/dist/shared/unhead.Bf_fPVYA.mjs +6 -0
  785. package/.output/server/node_modules/unhead/dist/shared/unhead.Bjbp1C8D.mjs +224 -0
  786. package/.output/server/node_modules/unhead/dist/shared/unhead.Bm4Y6XQI.mjs +17 -0
  787. package/.output/server/node_modules/unhead/dist/shared/unhead.C5Bksi2B.mjs +49 -0
  788. package/.output/server/node_modules/unhead/dist/shared/unhead.CGPOfp5O.mjs +32 -0
  789. package/.output/server/node_modules/unhead/dist/shared/unhead.CHEy9ana.mjs +7 -0
  790. package/.output/server/node_modules/unhead/dist/shared/unhead.C_7zwq8E.mjs +11 -0
  791. package/.output/server/node_modules/unhead/dist/shared/unhead.D7HkBzZn.mjs +59 -0
  792. package/.output/server/node_modules/unhead/dist/shared/unhead.Dssd7L5I.mjs +196 -0
  793. package/.output/server/node_modules/unhead/dist/shared/unhead.jEy9BmRq.mjs +264 -0
  794. package/.output/server/node_modules/unhead/dist/shared/unhead.oZ7pkTV1.mjs +19 -0
  795. package/.output/server/node_modules/unhead/dist/shared/unhead.tQnRaXfX.mjs +240 -0
  796. package/.output/server/node_modules/unhead/dist/stream/client.mjs +33 -0
  797. package/.output/server/node_modules/unhead/dist/stream/iife.mjs +2 -0
  798. package/.output/server/node_modules/unhead/dist/stream/server.mjs +436 -0
  799. package/.output/server/node_modules/unhead/dist/utils.mjs +7 -0
  800. package/.output/server/node_modules/unhead/package.json +179 -0
  801. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  802. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  803. package/.output/server/node_modules/vue/index.js +7 -0
  804. package/.output/server/node_modules/vue/index.mjs +1 -0
  805. package/.output/server/node_modules/vue/package.json +112 -0
  806. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  807. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +687 -0
  808. package/.output/server/node_modules/vue-bundle-renderer/package.json +66 -0
  809. package/.output/server/node_modules/web-push/package.json +55 -0
  810. package/.output/server/node_modules/web-push/src/encryption-helper.js +62 -0
  811. package/.output/server/node_modules/web-push/src/index.js +21 -0
  812. package/.output/server/node_modules/web-push/src/urlsafe-base64-helper.js +13 -0
  813. package/.output/server/node_modules/web-push/src/vapid-helper.js +255 -0
  814. package/.output/server/node_modules/web-push/src/web-push-constants.js +17 -0
  815. package/.output/server/node_modules/web-push/src/web-push-error.js +16 -0
  816. package/.output/server/node_modules/web-push/src/web-push-lib.js +413 -0
  817. package/.output/server/package.json +67 -0
  818. package/LICENSE +21 -0
  819. package/README.md +963 -2
  820. package/bin/lib/commands.mjs +432 -0
  821. package/bin/lib/core.mjs +150 -0
  822. package/bin/lib/panel.mjs +208 -0
  823. package/bin/lib/runtime.mjs +74 -0
  824. package/bin/lib/service.mjs +133 -0
  825. package/bin/lib/tailnet.d.mts +32 -0
  826. package/bin/lib/tailnet.mjs +185 -0
  827. package/bin/wherdr.mjs +23 -0
  828. package/package.json +75 -4
@@ -0,0 +1,3266 @@
1
+ /*!
2
+ * Copyright (c) 2014, GMO GlobalSign
3
+ * Copyright (c) 2015-2022, Peculiar Ventures
4
+ * All rights reserved.
5
+ *
6
+ * Author 2014-2019, Yury Strozhevsky
7
+ *
8
+ * Redistribution and use in source and binary forms, with or without modification,
9
+ * are permitted provided that the following conditions are met:
10
+ *
11
+ * * Redistributions of source code must retain the above copyright notice, this
12
+ * list of conditions and the following disclaimer.
13
+ *
14
+ * * Redistributions in binary form must reproduce the above copyright notice, this
15
+ * list of conditions and the following disclaimer in the documentation and/or
16
+ * other materials provided with the distribution.
17
+ *
18
+ * * Neither the name of the copyright holder nor the names of its
19
+ * contributors may be used to endorse or promote products derived from
20
+ * this software without specific prior written permission.
21
+ *
22
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ *
33
+ */
34
+
35
+ 'use strict';
36
+
37
+ var pvtsutils = require('pvtsutils');
38
+ var pvutils = require('pvutils');
39
+
40
+ function _interopNamespaceDefault(e) {
41
+ var n = Object.create(null);
42
+ if (e) {
43
+ Object.keys(e).forEach(function (k) {
44
+ if (k !== 'default') {
45
+ var d = Object.getOwnPropertyDescriptor(e, k);
46
+ Object.defineProperty(n, k, d.get ? d : {
47
+ enumerable: true,
48
+ get: function () { return e[k]; }
49
+ });
50
+ }
51
+ });
52
+ }
53
+ n.default = e;
54
+ return Object.freeze(n);
55
+ }
56
+
57
+ var pvtsutils__namespace = /*#__PURE__*/_interopNamespaceDefault(pvtsutils);
58
+ var pvutils__namespace = /*#__PURE__*/_interopNamespaceDefault(pvutils);
59
+
60
+ function assertBigInt() {
61
+ if (typeof BigInt === "undefined") {
62
+ throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.");
63
+ }
64
+ }
65
+ function concat(buffers) {
66
+ let outputLength = 0;
67
+ let prevLength = 0;
68
+ for (let i = 0; i < buffers.length; i++) {
69
+ const buffer = buffers[i];
70
+ outputLength += buffer.byteLength;
71
+ }
72
+ const retView = new Uint8Array(outputLength);
73
+ for (let i = 0; i < buffers.length; i++) {
74
+ const buffer = buffers[i];
75
+ retView.set(new Uint8Array(buffer), prevLength);
76
+ prevLength += buffer.byteLength;
77
+ }
78
+ return retView.buffer;
79
+ }
80
+ function checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) {
81
+ if (!(inputBuffer instanceof Uint8Array)) {
82
+ baseBlock.error = "Wrong parameter: inputBuffer must be 'Uint8Array'";
83
+ return false;
84
+ }
85
+ if (!inputBuffer.byteLength) {
86
+ baseBlock.error = "Wrong parameter: inputBuffer has zero length";
87
+ return false;
88
+ }
89
+ if (inputOffset < 0) {
90
+ baseBlock.error = "Wrong parameter: inputOffset less than zero";
91
+ return false;
92
+ }
93
+ if (inputLength < 0) {
94
+ baseBlock.error = "Wrong parameter: inputLength less than zero";
95
+ return false;
96
+ }
97
+ if ((inputBuffer.byteLength - inputOffset - inputLength) < 0) {
98
+ baseBlock.error = "End of input reached before message was fully decoded (inconsistent offset and length values)";
99
+ return false;
100
+ }
101
+ return true;
102
+ }
103
+
104
+ class ViewWriter {
105
+ constructor() {
106
+ this.items = [];
107
+ }
108
+ write(buf) {
109
+ this.items.push(buf);
110
+ }
111
+ final() {
112
+ return concat(this.items);
113
+ }
114
+ }
115
+
116
+ const powers2 = [new Uint8Array([1])];
117
+ const digitsString = "0123456789";
118
+ const NAME = "name";
119
+ const VALUE_HEX_VIEW = "valueHexView";
120
+ const IS_HEX_ONLY = "isHexOnly";
121
+ const ID_BLOCK = "idBlock";
122
+ const TAG_CLASS = "tagClass";
123
+ const TAG_NUMBER = "tagNumber";
124
+ const IS_CONSTRUCTED = "isConstructed";
125
+ const FROM_BER = "fromBER";
126
+ const TO_BER = "toBER";
127
+ const LOCAL = "local";
128
+ const EMPTY_STRING = "";
129
+ const EMPTY_BUFFER = new ArrayBuffer(0);
130
+ const EMPTY_VIEW = new Uint8Array(0);
131
+ const END_OF_CONTENT_NAME = "EndOfContent";
132
+ const OCTET_STRING_NAME = "OCTET STRING";
133
+ const BIT_STRING_NAME = "BIT STRING";
134
+
135
+ function HexBlock(BaseClass) {
136
+ var _a;
137
+ return _a = class Some extends BaseClass {
138
+ get valueHex() {
139
+ return this.valueHexView.slice().buffer;
140
+ }
141
+ set valueHex(value) {
142
+ this.valueHexView = new Uint8Array(value);
143
+ }
144
+ constructor(...args) {
145
+ var _b;
146
+ super(...args);
147
+ const params = args[0] || {};
148
+ this.isHexOnly = (_b = params.isHexOnly) !== null && _b !== void 0 ? _b : false;
149
+ this.valueHexView = params.valueHex ? pvtsutils__namespace.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;
150
+ }
151
+ fromBER(inputBuffer, inputOffset, inputLength, _context) {
152
+ const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer;
153
+ if (!checkBufferParams(this, view, inputOffset, inputLength)) {
154
+ return -1;
155
+ }
156
+ const endLength = inputOffset + inputLength;
157
+ this.valueHexView = view.subarray(inputOffset, endLength);
158
+ if (!this.valueHexView.length) {
159
+ this.warnings.push("Zero buffer length");
160
+ return inputOffset;
161
+ }
162
+ this.blockLength = inputLength;
163
+ return endLength;
164
+ }
165
+ toBER(sizeOnly = false) {
166
+ if (!this.isHexOnly) {
167
+ this.error = "Flag 'isHexOnly' is not set, abort";
168
+ return EMPTY_BUFFER;
169
+ }
170
+ if (sizeOnly) {
171
+ return new ArrayBuffer(this.valueHexView.byteLength);
172
+ }
173
+ return (this.valueHexView.byteLength === this.valueHexView.buffer.byteLength)
174
+ ? this.valueHexView.buffer
175
+ : this.valueHexView.slice().buffer;
176
+ }
177
+ toJSON() {
178
+ return {
179
+ ...super.toJSON(),
180
+ isHexOnly: this.isHexOnly,
181
+ valueHex: pvtsutils__namespace.Convert.ToHex(this.valueHexView),
182
+ };
183
+ }
184
+ },
185
+ _a.NAME = "hexBlock",
186
+ _a;
187
+ }
188
+
189
+ class LocalBaseBlock {
190
+ static blockName() {
191
+ return this.NAME;
192
+ }
193
+ get valueBeforeDecode() {
194
+ return this.valueBeforeDecodeView.slice().buffer;
195
+ }
196
+ set valueBeforeDecode(value) {
197
+ this.valueBeforeDecodeView = new Uint8Array(value);
198
+ }
199
+ constructor({ blockLength = 0, error = EMPTY_STRING, warnings = [], valueBeforeDecode = EMPTY_VIEW, } = {}) {
200
+ this.blockLength = blockLength;
201
+ this.error = error;
202
+ this.warnings = warnings;
203
+ this.valueBeforeDecodeView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(valueBeforeDecode);
204
+ }
205
+ toJSON() {
206
+ return {
207
+ blockName: this.constructor.NAME,
208
+ blockLength: this.blockLength,
209
+ error: this.error,
210
+ warnings: this.warnings,
211
+ valueBeforeDecode: pvtsutils__namespace.Convert.ToHex(this.valueBeforeDecodeView),
212
+ };
213
+ }
214
+ }
215
+ LocalBaseBlock.NAME = "baseBlock";
216
+
217
+ class ValueBlock extends LocalBaseBlock {
218
+ fromBER(_inputBuffer, _inputOffset, _inputLength, _context) {
219
+ throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'");
220
+ }
221
+ toBER(_sizeOnly, _writer) {
222
+ throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'");
223
+ }
224
+ }
225
+ ValueBlock.NAME = "valueBlock";
226
+
227
+ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
228
+ constructor({ idBlock = {} } = {}) {
229
+ var _a, _b, _c, _d;
230
+ super();
231
+ if (idBlock) {
232
+ this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
233
+ this.valueHexView = idBlock.valueHex
234
+ ? pvtsutils__namespace.BufferSourceConverter.toUint8Array(idBlock.valueHex)
235
+ : EMPTY_VIEW;
236
+ this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
237
+ this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
238
+ this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
239
+ }
240
+ else {
241
+ this.tagClass = -1;
242
+ this.tagNumber = -1;
243
+ this.isConstructed = false;
244
+ }
245
+ }
246
+ toBER(sizeOnly = false) {
247
+ let firstOctet = 0;
248
+ switch (this.tagClass) {
249
+ case 1:
250
+ firstOctet |= 0x00;
251
+ break;
252
+ case 2:
253
+ firstOctet |= 0x40;
254
+ break;
255
+ case 3:
256
+ firstOctet |= 0x80;
257
+ break;
258
+ case 4:
259
+ firstOctet |= 0xC0;
260
+ break;
261
+ default:
262
+ this.error = "Unknown tag class";
263
+ return EMPTY_BUFFER;
264
+ }
265
+ if (this.isConstructed)
266
+ firstOctet |= 0x20;
267
+ if (this.tagNumber < 31 && !this.isHexOnly) {
268
+ const retView = new Uint8Array(1);
269
+ if (!sizeOnly) {
270
+ let number = this.tagNumber;
271
+ number &= 0x1F;
272
+ firstOctet |= number;
273
+ retView[0] = firstOctet;
274
+ }
275
+ return retView.buffer;
276
+ }
277
+ if (!this.isHexOnly) {
278
+ const encodedBuf = pvutils__namespace.utilToBase(this.tagNumber, 7);
279
+ const encodedView = new Uint8Array(encodedBuf);
280
+ const size = encodedBuf.byteLength;
281
+ const retView = new Uint8Array(size + 1);
282
+ retView[0] = (firstOctet | 0x1F);
283
+ if (!sizeOnly) {
284
+ for (let i = 0; i < (size - 1); i++)
285
+ retView[i + 1] = encodedView[i] | 0x80;
286
+ retView[size] = encodedView[size - 1];
287
+ }
288
+ return retView.buffer;
289
+ }
290
+ const retView = new Uint8Array(this.valueHexView.byteLength + 1);
291
+ retView[0] = (firstOctet | 0x1F);
292
+ if (!sizeOnly) {
293
+ const curView = this.valueHexView;
294
+ for (let i = 0; i < (curView.length - 1); i++)
295
+ retView[i + 1] = curView[i] | 0x80;
296
+ retView[this.valueHexView.byteLength] = curView[curView.length - 1];
297
+ }
298
+ return retView.buffer;
299
+ }
300
+ fromBER(inputBuffer, inputOffset, inputLength) {
301
+ const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
302
+ if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
303
+ return -1;
304
+ }
305
+ const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
306
+ if (intBuffer.length === 0) {
307
+ this.error = "Zero buffer length";
308
+ return -1;
309
+ }
310
+ const tagClassMask = intBuffer[0] & 0xC0;
311
+ switch (tagClassMask) {
312
+ case 0x00:
313
+ this.tagClass = (1);
314
+ break;
315
+ case 0x40:
316
+ this.tagClass = (2);
317
+ break;
318
+ case 0x80:
319
+ this.tagClass = (3);
320
+ break;
321
+ case 0xC0:
322
+ this.tagClass = (4);
323
+ break;
324
+ default:
325
+ this.error = "Unknown tag class";
326
+ return -1;
327
+ }
328
+ this.isConstructed = (intBuffer[0] & 0x20) === 0x20;
329
+ this.isHexOnly = false;
330
+ const tagNumberMask = intBuffer[0] & 0x1F;
331
+ if (tagNumberMask !== 0x1F) {
332
+ this.tagNumber = (tagNumberMask);
333
+ this.blockLength = 1;
334
+ }
335
+ else {
336
+ let count = 0;
337
+ while (true) {
338
+ const tagByteIndex = count + 1;
339
+ if (tagByteIndex >= intBuffer.length) {
340
+ this.error = "End of input reached before message was fully decoded";
341
+ return -1;
342
+ }
343
+ count++;
344
+ if ((intBuffer[tagByteIndex] & 0x80) === 0x00)
345
+ break;
346
+ }
347
+ this.blockLength = (count + 1);
348
+ const intTagNumberBuffer = this.valueHexView = new Uint8Array(count);
349
+ for (let i = 0; i < count; i++)
350
+ intTagNumberBuffer[i] = intBuffer[i + 1] & 0x7F;
351
+ if (this.blockLength <= 9)
352
+ this.tagNumber = pvutils__namespace.utilFromBase(intTagNumberBuffer, 7);
353
+ else {
354
+ this.isHexOnly = true;
355
+ this.warnings.push("Tag too long, represented as hex-coded");
356
+ }
357
+ }
358
+ if (((this.tagClass === 1))
359
+ && (this.isConstructed)) {
360
+ switch (this.tagNumber) {
361
+ case 1:
362
+ case 2:
363
+ case 5:
364
+ case 6:
365
+ case 9:
366
+ case 13:
367
+ case 14:
368
+ case 23:
369
+ case 24:
370
+ case 31:
371
+ case 32:
372
+ case 33:
373
+ case 34:
374
+ this.error = "Constructed encoding used for primitive type";
375
+ return -1;
376
+ }
377
+ }
378
+ return (inputOffset + this.blockLength);
379
+ }
380
+ toJSON() {
381
+ return {
382
+ ...super.toJSON(),
383
+ tagClass: this.tagClass,
384
+ tagNumber: this.tagNumber,
385
+ isConstructed: this.isConstructed,
386
+ };
387
+ }
388
+ }
389
+ LocalIdentificationBlock.NAME = "identificationBlock";
390
+
391
+ class LocalLengthBlock extends LocalBaseBlock {
392
+ constructor({ lenBlock = {} } = {}) {
393
+ var _a, _b, _c;
394
+ super();
395
+ this.isIndefiniteForm = (_a = lenBlock.isIndefiniteForm) !== null && _a !== void 0 ? _a : false;
396
+ this.longFormUsed = (_b = lenBlock.longFormUsed) !== null && _b !== void 0 ? _b : false;
397
+ this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
398
+ }
399
+ fromBER(inputBuffer, inputOffset, inputLength) {
400
+ const view = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
401
+ if (!checkBufferParams(this, view, inputOffset, inputLength)) {
402
+ return -1;
403
+ }
404
+ const intBuffer = view.subarray(inputOffset, inputOffset + inputLength);
405
+ if (intBuffer.length === 0) {
406
+ this.error = "Zero buffer length";
407
+ return -1;
408
+ }
409
+ if (intBuffer[0] === 0xFF) {
410
+ this.error = "Length block 0xFF is reserved by standard";
411
+ return -1;
412
+ }
413
+ this.isIndefiniteForm = intBuffer[0] === 0x80;
414
+ if (this.isIndefiniteForm) {
415
+ this.blockLength = 1;
416
+ return (inputOffset + this.blockLength);
417
+ }
418
+ this.longFormUsed = !!(intBuffer[0] & 0x80);
419
+ if (this.longFormUsed === false) {
420
+ this.length = (intBuffer[0]);
421
+ this.blockLength = 1;
422
+ return (inputOffset + this.blockLength);
423
+ }
424
+ const count = intBuffer[0] & 0x7F;
425
+ if (count > 8) {
426
+ this.error = "Too big integer";
427
+ return -1;
428
+ }
429
+ if ((count + 1) > intBuffer.length) {
430
+ this.error = "End of input reached before message was fully decoded";
431
+ return -1;
432
+ }
433
+ const lenOffset = inputOffset + 1;
434
+ const lengthBufferView = view.subarray(lenOffset, lenOffset + count);
435
+ if (lengthBufferView[count - 1] === 0x00)
436
+ this.warnings.push("Needlessly long encoded length");
437
+ this.length = pvutils__namespace.utilFromBase(lengthBufferView, 8);
438
+ if (this.longFormUsed && (this.length <= 127))
439
+ this.warnings.push("Unnecessary usage of long length form");
440
+ this.blockLength = count + 1;
441
+ return (inputOffset + this.blockLength);
442
+ }
443
+ toBER(sizeOnly = false) {
444
+ let retBuf;
445
+ let retView;
446
+ if (this.length > 127)
447
+ this.longFormUsed = true;
448
+ if (this.isIndefiniteForm) {
449
+ retBuf = new ArrayBuffer(1);
450
+ if (sizeOnly === false) {
451
+ retView = new Uint8Array(retBuf);
452
+ retView[0] = 0x80;
453
+ }
454
+ return retBuf;
455
+ }
456
+ if (this.longFormUsed) {
457
+ const encodedBuf = pvutils__namespace.utilToBase(this.length, 8);
458
+ if (encodedBuf.byteLength > 127) {
459
+ this.error = "Too big length";
460
+ return (EMPTY_BUFFER);
461
+ }
462
+ retBuf = new ArrayBuffer(encodedBuf.byteLength + 1);
463
+ if (sizeOnly)
464
+ return retBuf;
465
+ const encodedView = new Uint8Array(encodedBuf);
466
+ retView = new Uint8Array(retBuf);
467
+ retView[0] = encodedBuf.byteLength | 0x80;
468
+ for (let i = 0; i < encodedBuf.byteLength; i++)
469
+ retView[i + 1] = encodedView[i];
470
+ return retBuf;
471
+ }
472
+ retBuf = new ArrayBuffer(1);
473
+ if (sizeOnly === false) {
474
+ retView = new Uint8Array(retBuf);
475
+ retView[0] = this.length;
476
+ }
477
+ return retBuf;
478
+ }
479
+ toJSON() {
480
+ return {
481
+ ...super.toJSON(),
482
+ isIndefiniteForm: this.isIndefiniteForm,
483
+ longFormUsed: this.longFormUsed,
484
+ length: this.length,
485
+ };
486
+ }
487
+ }
488
+ LocalLengthBlock.NAME = "lengthBlock";
489
+
490
+ const typeStore = {};
491
+
492
+ class BaseBlock extends LocalBaseBlock {
493
+ constructor({ name = EMPTY_STRING, optional = false, primitiveSchema, ...parameters } = {}, valueBlockType) {
494
+ super(parameters);
495
+ this.name = name;
496
+ this.optional = optional;
497
+ if (primitiveSchema) {
498
+ this.primitiveSchema = primitiveSchema;
499
+ }
500
+ this.idBlock = new LocalIdentificationBlock(parameters);
501
+ this.lenBlock = new LocalLengthBlock(parameters);
502
+ this.valueBlock = valueBlockType ? new valueBlockType(parameters) : new ValueBlock(parameters);
503
+ }
504
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
505
+ const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm)
506
+ ? inputLength
507
+ : this.lenBlock.length, context);
508
+ if (resultOffset === -1) {
509
+ this.error = this.valueBlock.error;
510
+ return resultOffset;
511
+ }
512
+ if (!this.idBlock.error.length)
513
+ this.blockLength += this.idBlock.blockLength;
514
+ if (!this.lenBlock.error.length)
515
+ this.blockLength += this.lenBlock.blockLength;
516
+ if (!this.valueBlock.error.length)
517
+ this.blockLength += this.valueBlock.blockLength;
518
+ return resultOffset;
519
+ }
520
+ toBER(sizeOnly, writer) {
521
+ const _writer = writer || new ViewWriter();
522
+ if (!writer) {
523
+ prepareIndefiniteForm(this);
524
+ }
525
+ const idBlockBuf = this.idBlock.toBER(sizeOnly);
526
+ _writer.write(idBlockBuf);
527
+ if (this.lenBlock.isIndefiniteForm) {
528
+ _writer.write(new Uint8Array([0x80]).buffer);
529
+ this.valueBlock.toBER(sizeOnly, _writer);
530
+ _writer.write(new ArrayBuffer(2));
531
+ }
532
+ else {
533
+ const valueBlockBuf = this.valueBlock.toBER(sizeOnly);
534
+ this.lenBlock.length = valueBlockBuf.byteLength;
535
+ const lenBlockBuf = this.lenBlock.toBER(sizeOnly);
536
+ _writer.write(lenBlockBuf);
537
+ _writer.write(valueBlockBuf);
538
+ }
539
+ if (!writer) {
540
+ return _writer.final();
541
+ }
542
+ return EMPTY_BUFFER;
543
+ }
544
+ toJSON() {
545
+ const object = {
546
+ ...super.toJSON(),
547
+ idBlock: this.idBlock.toJSON(),
548
+ lenBlock: this.lenBlock.toJSON(),
549
+ valueBlock: this.valueBlock.toJSON(),
550
+ name: this.name,
551
+ optional: this.optional,
552
+ };
553
+ if (this.primitiveSchema)
554
+ object.primitiveSchema = this.primitiveSchema.toJSON();
555
+ return object;
556
+ }
557
+ toString(encoding = "ascii") {
558
+ if (encoding === "ascii") {
559
+ return this.onAsciiEncoding();
560
+ }
561
+ return pvtsutils__namespace.Convert.ToHex(this.toBER());
562
+ }
563
+ onAsciiEncoding() {
564
+ const name = this.constructor.NAME;
565
+ const value = pvtsutils__namespace.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);
566
+ return `${name} : ${value}`;
567
+ }
568
+ isEqual(other) {
569
+ if (this === other) {
570
+ return true;
571
+ }
572
+ if (!(other instanceof this.constructor)) {
573
+ return false;
574
+ }
575
+ const thisRaw = this.toBER();
576
+ const otherRaw = other.toBER();
577
+ return pvutils__namespace.isEqualBuffer(thisRaw, otherRaw);
578
+ }
579
+ }
580
+ BaseBlock.NAME = "BaseBlock";
581
+ function prepareIndefiniteForm(baseBlock) {
582
+ var _a;
583
+ if (baseBlock instanceof typeStore.Constructed) {
584
+ for (const value of baseBlock.valueBlock.value) {
585
+ if (prepareIndefiniteForm(value)) {
586
+ baseBlock.lenBlock.isIndefiniteForm = true;
587
+ }
588
+ }
589
+ }
590
+ return !!((_a = baseBlock.lenBlock) === null || _a === void 0 ? void 0 : _a.isIndefiniteForm);
591
+ }
592
+
593
+ class BaseStringBlock extends BaseBlock {
594
+ getValue() {
595
+ return this.valueBlock.value;
596
+ }
597
+ setValue(value) {
598
+ this.valueBlock.value = value;
599
+ }
600
+ constructor({ value = EMPTY_STRING, ...parameters } = {}, stringValueBlockType) {
601
+ super(parameters, stringValueBlockType);
602
+ if (value) {
603
+ this.fromString(value);
604
+ }
605
+ }
606
+ fromBER(inputBuffer, inputOffset, inputLength) {
607
+ const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm)
608
+ ? inputLength
609
+ : this.lenBlock.length);
610
+ if (resultOffset === -1) {
611
+ this.error = this.valueBlock.error;
612
+ return resultOffset;
613
+ }
614
+ this.fromBuffer(this.valueBlock.valueHexView);
615
+ if (!this.idBlock.error.length)
616
+ this.blockLength += this.idBlock.blockLength;
617
+ if (!this.lenBlock.error.length)
618
+ this.blockLength += this.lenBlock.blockLength;
619
+ if (!this.valueBlock.error.length)
620
+ this.blockLength += this.valueBlock.blockLength;
621
+ return resultOffset;
622
+ }
623
+ onAsciiEncoding() {
624
+ return `${this.constructor.NAME} : '${this.valueBlock.value}'`;
625
+ }
626
+ }
627
+ BaseStringBlock.NAME = "BaseStringBlock";
628
+
629
+ class LocalPrimitiveValueBlock extends HexBlock(ValueBlock) {
630
+ constructor({ isHexOnly = true, ...parameters } = {}) {
631
+ super(parameters);
632
+ this.isHexOnly = isHexOnly;
633
+ }
634
+ }
635
+ LocalPrimitiveValueBlock.NAME = "PrimitiveValueBlock";
636
+
637
+ var _a$w;
638
+ class Primitive extends BaseBlock {
639
+ constructor(parameters = {}) {
640
+ super(parameters, LocalPrimitiveValueBlock);
641
+ this.idBlock.isConstructed = false;
642
+ }
643
+ }
644
+ _a$w = Primitive;
645
+ (() => {
646
+ typeStore.Primitive = _a$w;
647
+ })();
648
+ Primitive.NAME = "PRIMITIVE";
649
+
650
+ const DEFAULT_MAX_DEPTH = 100;
651
+ const DEFAULT_MAX_NODES = 10000;
652
+ const DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024 * 1024;
653
+ const MAX_DEPTH_EXCEEDED_ERROR = "Maximum ASN.1 nesting depth exceeded";
654
+ const MAX_NODES_EXCEEDED_ERROR = "Maximum ASN.1 node count exceeded";
655
+ const MAX_CONTENT_LENGTH_EXCEEDED_ERROR = "Maximum ASN.1 content length exceeded";
656
+ function createFromBerContext(options = {}) {
657
+ var _a, _b, _c;
658
+ return {
659
+ depth: 0,
660
+ maxDepth: (_a = options.maxDepth) !== null && _a !== void 0 ? _a : DEFAULT_MAX_DEPTH,
661
+ nodesCount: 0,
662
+ maxNodes: (_b = options.maxNodes) !== null && _b !== void 0 ? _b : DEFAULT_MAX_NODES,
663
+ maxContentLength: (_c = options.maxContentLength) !== null && _c !== void 0 ? _c : DEFAULT_MAX_CONTENT_LENGTH,
664
+ };
665
+ }
666
+ function createErrorResult(error) {
667
+ const result = new BaseBlock({}, ValueBlock);
668
+ result.error = error;
669
+ return {
670
+ offset: -1,
671
+ result,
672
+ };
673
+ }
674
+ function checkNodesLimit(context) {
675
+ context.nodesCount += 1;
676
+ if (context.nodesCount > context.maxNodes) {
677
+ return MAX_NODES_EXCEEDED_ERROR;
678
+ }
679
+ return undefined;
680
+ }
681
+ function checkContentLengthLimit(inputLength, context) {
682
+ if (inputLength > context.maxContentLength) {
683
+ return MAX_CONTENT_LENGTH_EXCEEDED_ERROR;
684
+ }
685
+ return undefined;
686
+ }
687
+ function localFromBERWithChildContext(inputBuffer, inputOffset, inputLength, context) {
688
+ const childDepth = context.depth + 1;
689
+ if (childDepth > context.maxDepth) {
690
+ return createErrorResult(MAX_DEPTH_EXCEEDED_ERROR);
691
+ }
692
+ context.depth = childDepth;
693
+ try {
694
+ return localFromBER(inputBuffer, inputOffset, inputLength, context);
695
+ }
696
+ finally {
697
+ context.depth -= 1;
698
+ }
699
+ }
700
+ function localChangeType(inputObject, newType) {
701
+ if (inputObject instanceof newType) {
702
+ return inputObject;
703
+ }
704
+ const newObject = new newType();
705
+ newObject.idBlock = inputObject.idBlock;
706
+ newObject.lenBlock = inputObject.lenBlock;
707
+ newObject.warnings = inputObject.warnings;
708
+ newObject.valueBeforeDecodeView = inputObject.valueBeforeDecodeView;
709
+ return newObject;
710
+ }
711
+ function localFromBER(inputBuffer, inputOffset = 0, inputLength = inputBuffer.length, context = createFromBerContext()) {
712
+ const incomingOffset = inputOffset;
713
+ let returnObject = new BaseBlock({}, ValueBlock);
714
+ const baseBlock = new LocalBaseBlock();
715
+ if (!checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength)) {
716
+ returnObject.error = baseBlock.error;
717
+ return {
718
+ offset: -1,
719
+ result: returnObject,
720
+ };
721
+ }
722
+ const intBuffer = inputBuffer.subarray(inputOffset, inputOffset + inputLength);
723
+ if (!intBuffer.length) {
724
+ returnObject.error = "Zero buffer length";
725
+ return {
726
+ offset: -1,
727
+ result: returnObject,
728
+ };
729
+ }
730
+ const nodesLimitError = checkNodesLimit(context);
731
+ if (nodesLimitError) {
732
+ returnObject.error = nodesLimitError;
733
+ return {
734
+ offset: -1,
735
+ result: returnObject,
736
+ };
737
+ }
738
+ let resultOffset = returnObject.idBlock.fromBER(inputBuffer, inputOffset, inputLength);
739
+ if (returnObject.idBlock.warnings.length) {
740
+ returnObject.warnings.concat(returnObject.idBlock.warnings);
741
+ }
742
+ if (resultOffset === -1) {
743
+ returnObject.error = returnObject.idBlock.error;
744
+ return {
745
+ offset: -1,
746
+ result: returnObject,
747
+ };
748
+ }
749
+ inputOffset = resultOffset;
750
+ inputLength -= returnObject.idBlock.blockLength;
751
+ resultOffset = returnObject.lenBlock.fromBER(inputBuffer, inputOffset, inputLength);
752
+ if (returnObject.lenBlock.warnings.length) {
753
+ returnObject.warnings.concat(returnObject.lenBlock.warnings);
754
+ }
755
+ if (resultOffset === -1) {
756
+ returnObject.error = returnObject.lenBlock.error;
757
+ return {
758
+ offset: -1,
759
+ result: returnObject,
760
+ };
761
+ }
762
+ inputOffset = resultOffset;
763
+ inputLength -= returnObject.lenBlock.blockLength;
764
+ const valueLength = returnObject.lenBlock.isIndefiniteForm ? inputLength : returnObject.lenBlock.length;
765
+ const contentLengthError = checkContentLengthLimit(valueLength, context);
766
+ if (contentLengthError) {
767
+ returnObject.error = contentLengthError;
768
+ return {
769
+ offset: -1,
770
+ result: returnObject,
771
+ };
772
+ }
773
+ if (!returnObject.idBlock.isConstructed
774
+ && returnObject.lenBlock.isIndefiniteForm) {
775
+ returnObject.error = "Indefinite length form used for primitive encoding form";
776
+ return {
777
+ offset: -1,
778
+ result: returnObject,
779
+ };
780
+ }
781
+ let newASN1Type = BaseBlock;
782
+ switch (returnObject.idBlock.tagClass) {
783
+ case 1:
784
+ if ((returnObject.idBlock.tagNumber >= 37)
785
+ && (returnObject.idBlock.isHexOnly === false)) {
786
+ returnObject.error = "UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";
787
+ return {
788
+ offset: -1,
789
+ result: returnObject,
790
+ };
791
+ }
792
+ switch (returnObject.idBlock.tagNumber) {
793
+ case 0:
794
+ if ((returnObject.idBlock.isConstructed)
795
+ && (returnObject.lenBlock.length > 0)) {
796
+ returnObject.error = "Type [UNIVERSAL 0] is reserved";
797
+ return {
798
+ offset: -1,
799
+ result: returnObject,
800
+ };
801
+ }
802
+ newASN1Type = typeStore.EndOfContent;
803
+ break;
804
+ case 1:
805
+ newASN1Type = typeStore.Boolean;
806
+ break;
807
+ case 2:
808
+ newASN1Type = typeStore.Integer;
809
+ break;
810
+ case 3:
811
+ newASN1Type = typeStore.BitString;
812
+ break;
813
+ case 4:
814
+ newASN1Type = typeStore.OctetString;
815
+ break;
816
+ case 5:
817
+ newASN1Type = typeStore.Null;
818
+ break;
819
+ case 6:
820
+ newASN1Type = typeStore.ObjectIdentifier;
821
+ break;
822
+ case 10:
823
+ newASN1Type = typeStore.Enumerated;
824
+ break;
825
+ case 12:
826
+ newASN1Type = typeStore.Utf8String;
827
+ break;
828
+ case 13:
829
+ newASN1Type = typeStore.RelativeObjectIdentifier;
830
+ break;
831
+ case 14:
832
+ newASN1Type = typeStore.TIME;
833
+ break;
834
+ case 15:
835
+ returnObject.error = "[UNIVERSAL 15] is reserved by ASN.1 standard";
836
+ return {
837
+ offset: -1,
838
+ result: returnObject,
839
+ };
840
+ case 16:
841
+ newASN1Type = typeStore.Sequence;
842
+ break;
843
+ case 17:
844
+ newASN1Type = typeStore.Set;
845
+ break;
846
+ case 18:
847
+ newASN1Type = typeStore.NumericString;
848
+ break;
849
+ case 19:
850
+ newASN1Type = typeStore.PrintableString;
851
+ break;
852
+ case 20:
853
+ newASN1Type = typeStore.TeletexString;
854
+ break;
855
+ case 21:
856
+ newASN1Type = typeStore.VideotexString;
857
+ break;
858
+ case 22:
859
+ newASN1Type = typeStore.IA5String;
860
+ break;
861
+ case 23:
862
+ newASN1Type = typeStore.UTCTime;
863
+ break;
864
+ case 24:
865
+ newASN1Type = typeStore.GeneralizedTime;
866
+ break;
867
+ case 25:
868
+ newASN1Type = typeStore.GraphicString;
869
+ break;
870
+ case 26:
871
+ newASN1Type = typeStore.VisibleString;
872
+ break;
873
+ case 27:
874
+ newASN1Type = typeStore.GeneralString;
875
+ break;
876
+ case 28:
877
+ newASN1Type = typeStore.UniversalString;
878
+ break;
879
+ case 29:
880
+ newASN1Type = typeStore.CharacterString;
881
+ break;
882
+ case 30:
883
+ newASN1Type = typeStore.BmpString;
884
+ break;
885
+ case 31:
886
+ newASN1Type = typeStore.DATE;
887
+ break;
888
+ case 32:
889
+ newASN1Type = typeStore.TimeOfDay;
890
+ break;
891
+ case 33:
892
+ newASN1Type = typeStore.DateTime;
893
+ break;
894
+ case 34:
895
+ newASN1Type = typeStore.Duration;
896
+ break;
897
+ default: {
898
+ const newObject = returnObject.idBlock.isConstructed
899
+ ? new typeStore.Constructed()
900
+ : new typeStore.Primitive();
901
+ newObject.idBlock = returnObject.idBlock;
902
+ newObject.lenBlock = returnObject.lenBlock;
903
+ newObject.warnings = returnObject.warnings;
904
+ returnObject = newObject;
905
+ }
906
+ }
907
+ break;
908
+ case 2:
909
+ case 3:
910
+ case 4:
911
+ default: {
912
+ newASN1Type = returnObject.idBlock.isConstructed
913
+ ? typeStore.Constructed
914
+ : typeStore.Primitive;
915
+ }
916
+ }
917
+ returnObject = localChangeType(returnObject, newASN1Type);
918
+ resultOffset = returnObject.fromBER(inputBuffer, inputOffset, valueLength, context);
919
+ returnObject.valueBeforeDecodeView = inputBuffer.subarray(incomingOffset, incomingOffset + returnObject.blockLength);
920
+ return {
921
+ offset: resultOffset,
922
+ result: returnObject,
923
+ };
924
+ }
925
+ function fromBER(inputBuffer, options = {}) {
926
+ if (!inputBuffer.byteLength) {
927
+ const result = new BaseBlock({}, ValueBlock);
928
+ result.error = "Input buffer has zero length";
929
+ return {
930
+ offset: -1,
931
+ result,
932
+ };
933
+ }
934
+ return localFromBER(pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength, createFromBerContext(options));
935
+ }
936
+
937
+ function checkLen(indefiniteLength, length) {
938
+ if (indefiniteLength) {
939
+ return 1;
940
+ }
941
+ return length;
942
+ }
943
+ class LocalConstructedValueBlock extends ValueBlock {
944
+ constructor({ value = [], isIndefiniteForm = false, ...parameters } = {}) {
945
+ super(parameters);
946
+ this.value = value;
947
+ this.isIndefiniteForm = isIndefiniteForm;
948
+ }
949
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
950
+ const view = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
951
+ const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();
952
+ if (!checkBufferParams(this, view, inputOffset, inputLength)) {
953
+ return -1;
954
+ }
955
+ this.valueBeforeDecodeView = view.subarray(inputOffset, inputOffset + inputLength);
956
+ if (this.valueBeforeDecodeView.length === 0) {
957
+ this.warnings.push("Zero buffer length");
958
+ return inputOffset;
959
+ }
960
+ let currentOffset = inputOffset;
961
+ while (checkLen(this.isIndefiniteForm, inputLength) > 0) {
962
+ const returnObject = localFromBERWithChildContext(view, currentOffset, inputLength, parseContext);
963
+ if (returnObject.offset === -1) {
964
+ this.error = returnObject.result.error;
965
+ this.warnings.concat(returnObject.result.warnings);
966
+ return -1;
967
+ }
968
+ currentOffset = returnObject.offset;
969
+ this.blockLength += returnObject.result.blockLength;
970
+ inputLength -= returnObject.result.blockLength;
971
+ this.value.push(returnObject.result);
972
+ if (this.isIndefiniteForm && returnObject.result.constructor.NAME === END_OF_CONTENT_NAME) {
973
+ break;
974
+ }
975
+ }
976
+ if (this.isIndefiniteForm) {
977
+ if (this.value[this.value.length - 1].constructor.NAME === END_OF_CONTENT_NAME) {
978
+ this.value.pop();
979
+ }
980
+ else {
981
+ this.warnings.push("No EndOfContent block encoded");
982
+ }
983
+ }
984
+ return currentOffset;
985
+ }
986
+ toBER(sizeOnly, writer) {
987
+ const _writer = writer || new ViewWriter();
988
+ for (let i = 0; i < this.value.length; i++) {
989
+ this.value[i].toBER(sizeOnly, _writer);
990
+ }
991
+ if (!writer) {
992
+ return _writer.final();
993
+ }
994
+ return EMPTY_BUFFER;
995
+ }
996
+ toJSON() {
997
+ const object = {
998
+ ...super.toJSON(),
999
+ isIndefiniteForm: this.isIndefiniteForm,
1000
+ value: [],
1001
+ };
1002
+ for (const value of this.value) {
1003
+ object.value.push(value.toJSON());
1004
+ }
1005
+ return object;
1006
+ }
1007
+ }
1008
+ LocalConstructedValueBlock.NAME = "ConstructedValueBlock";
1009
+
1010
+ var _a$v;
1011
+ class Constructed extends BaseBlock {
1012
+ constructor(parameters = {}) {
1013
+ super(parameters, LocalConstructedValueBlock);
1014
+ this.idBlock.isConstructed = true;
1015
+ }
1016
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
1017
+ this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
1018
+ const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm) ? inputLength : this.lenBlock.length, context);
1019
+ if (resultOffset === -1) {
1020
+ this.error = this.valueBlock.error;
1021
+ return resultOffset;
1022
+ }
1023
+ if (!this.idBlock.error.length)
1024
+ this.blockLength += this.idBlock.blockLength;
1025
+ if (!this.lenBlock.error.length)
1026
+ this.blockLength += this.lenBlock.blockLength;
1027
+ if (!this.valueBlock.error.length)
1028
+ this.blockLength += this.valueBlock.blockLength;
1029
+ return resultOffset;
1030
+ }
1031
+ onAsciiEncoding() {
1032
+ const values = [];
1033
+ for (const value of this.valueBlock.value) {
1034
+ values.push(value.toString("ascii").split("\n").map((o) => ` ${o}`).join("\n"));
1035
+ }
1036
+ const blockName = this.idBlock.tagClass === 3
1037
+ ? `[${this.idBlock.tagNumber}]`
1038
+ : this.constructor.NAME;
1039
+ return values.length
1040
+ ? `${blockName} :\n${values.join("\n")}`
1041
+ : `${blockName} :`;
1042
+ }
1043
+ }
1044
+ _a$v = Constructed;
1045
+ (() => {
1046
+ typeStore.Constructed = _a$v;
1047
+ })();
1048
+ Constructed.NAME = "CONSTRUCTED";
1049
+
1050
+ class LocalEndOfContentValueBlock extends ValueBlock {
1051
+ fromBER(inputBuffer, inputOffset, _inputLength) {
1052
+ return inputOffset;
1053
+ }
1054
+ toBER(_sizeOnly) {
1055
+ return EMPTY_BUFFER;
1056
+ }
1057
+ }
1058
+ LocalEndOfContentValueBlock.override = "EndOfContentValueBlock";
1059
+
1060
+ var _a$u;
1061
+ class EndOfContent extends BaseBlock {
1062
+ constructor(parameters = {}) {
1063
+ super(parameters, LocalEndOfContentValueBlock);
1064
+ this.idBlock.tagClass = 1;
1065
+ this.idBlock.tagNumber = 0;
1066
+ }
1067
+ }
1068
+ _a$u = EndOfContent;
1069
+ (() => {
1070
+ typeStore.EndOfContent = _a$u;
1071
+ })();
1072
+ EndOfContent.NAME = END_OF_CONTENT_NAME;
1073
+
1074
+ var _a$t;
1075
+ class Null extends BaseBlock {
1076
+ constructor(parameters = {}) {
1077
+ super(parameters, ValueBlock);
1078
+ this.idBlock.tagClass = 1;
1079
+ this.idBlock.tagNumber = 5;
1080
+ }
1081
+ fromBER(inputBuffer, inputOffset, inputLength) {
1082
+ if (this.lenBlock.length > 0)
1083
+ this.warnings.push("Non-zero length of value block for Null type");
1084
+ if (!this.idBlock.error.length)
1085
+ this.blockLength += this.idBlock.blockLength;
1086
+ if (!this.lenBlock.error.length)
1087
+ this.blockLength += this.lenBlock.blockLength;
1088
+ this.blockLength += inputLength;
1089
+ if ((inputOffset + inputLength) > inputBuffer.byteLength) {
1090
+ this.error = "End of input reached before message was fully decoded (inconsistent offset and length values)";
1091
+ return -1;
1092
+ }
1093
+ return (inputOffset + inputLength);
1094
+ }
1095
+ toBER(sizeOnly, writer) {
1096
+ const retBuf = new ArrayBuffer(2);
1097
+ if (!sizeOnly) {
1098
+ const retView = new Uint8Array(retBuf);
1099
+ retView[0] = 0x05;
1100
+ retView[1] = 0x00;
1101
+ }
1102
+ if (writer) {
1103
+ writer.write(retBuf);
1104
+ }
1105
+ return retBuf;
1106
+ }
1107
+ onAsciiEncoding() {
1108
+ return `${this.constructor.NAME}`;
1109
+ }
1110
+ }
1111
+ _a$t = Null;
1112
+ (() => {
1113
+ typeStore.Null = _a$t;
1114
+ })();
1115
+ Null.NAME = "NULL";
1116
+
1117
+ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
1118
+ get value() {
1119
+ for (const octet of this.valueHexView) {
1120
+ if (octet > 0) {
1121
+ return true;
1122
+ }
1123
+ }
1124
+ return false;
1125
+ }
1126
+ set value(value) {
1127
+ this.valueHexView[0] = value ? 0xFF : 0x00;
1128
+ }
1129
+ constructor({ value, ...parameters } = {}) {
1130
+ super(parameters);
1131
+ if (parameters.valueHex) {
1132
+ this.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(parameters.valueHex);
1133
+ }
1134
+ else {
1135
+ this.valueHexView = new Uint8Array(1);
1136
+ }
1137
+ if (value) {
1138
+ this.value = value;
1139
+ }
1140
+ }
1141
+ fromBER(inputBuffer, inputOffset, inputLength) {
1142
+ const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
1143
+ if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
1144
+ return -1;
1145
+ }
1146
+ this.valueHexView = inputView.subarray(inputOffset, inputOffset + inputLength);
1147
+ if (inputLength > 1)
1148
+ this.warnings.push("Boolean value encoded in more then 1 octet");
1149
+ this.isHexOnly = true;
1150
+ pvutils__namespace.utilDecodeTC.call(this);
1151
+ this.blockLength = inputLength;
1152
+ return (inputOffset + inputLength);
1153
+ }
1154
+ toBER() {
1155
+ return this.valueHexView.slice();
1156
+ }
1157
+ toJSON() {
1158
+ return {
1159
+ ...super.toJSON(),
1160
+ value: this.value,
1161
+ };
1162
+ }
1163
+ }
1164
+ LocalBooleanValueBlock.NAME = "BooleanValueBlock";
1165
+
1166
+ var _a$s;
1167
+ class Boolean extends BaseBlock {
1168
+ getValue() {
1169
+ return this.valueBlock.value;
1170
+ }
1171
+ setValue(value) {
1172
+ this.valueBlock.value = value;
1173
+ }
1174
+ constructor(parameters = {}) {
1175
+ super(parameters, LocalBooleanValueBlock);
1176
+ this.idBlock.tagClass = 1;
1177
+ this.idBlock.tagNumber = 1;
1178
+ }
1179
+ onAsciiEncoding() {
1180
+ return `${this.constructor.NAME} : ${this.getValue}`;
1181
+ }
1182
+ }
1183
+ _a$s = Boolean;
1184
+ (() => {
1185
+ typeStore.Boolean = _a$s;
1186
+ })();
1187
+ Boolean.NAME = "BOOLEAN";
1188
+
1189
+ class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
1190
+ constructor({ isConstructed = false, ...parameters } = {}) {
1191
+ super(parameters);
1192
+ this.isConstructed = isConstructed;
1193
+ }
1194
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
1195
+ let resultOffset = 0;
1196
+ if (this.isConstructed) {
1197
+ this.isHexOnly = false;
1198
+ resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context);
1199
+ if (resultOffset === -1)
1200
+ return resultOffset;
1201
+ for (let i = 0; i < this.value.length; i++) {
1202
+ const currentBlockName = this.value[i].constructor.NAME;
1203
+ if (currentBlockName === END_OF_CONTENT_NAME) {
1204
+ if (this.isIndefiniteForm)
1205
+ break;
1206
+ else {
1207
+ this.error = "EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";
1208
+ return -1;
1209
+ }
1210
+ }
1211
+ if (currentBlockName !== OCTET_STRING_NAME) {
1212
+ this.error = "OCTET STRING may consists of OCTET STRINGs only";
1213
+ return -1;
1214
+ }
1215
+ }
1216
+ }
1217
+ else {
1218
+ this.isHexOnly = true;
1219
+ resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);
1220
+ this.blockLength = inputLength;
1221
+ }
1222
+ return resultOffset;
1223
+ }
1224
+ toBER(sizeOnly, writer) {
1225
+ if (this.isConstructed)
1226
+ return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);
1227
+ return sizeOnly
1228
+ ? new ArrayBuffer(this.valueHexView.byteLength)
1229
+ : this.valueHexView.slice().buffer;
1230
+ }
1231
+ toJSON() {
1232
+ return {
1233
+ ...super.toJSON(),
1234
+ isConstructed: this.isConstructed,
1235
+ };
1236
+ }
1237
+ }
1238
+ LocalOctetStringValueBlock.NAME = "OctetStringValueBlock";
1239
+
1240
+ var _a$r;
1241
+ class OctetString extends BaseBlock {
1242
+ constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
1243
+ var _b, _c;
1244
+ (_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
1245
+ super({
1246
+ idBlock: {
1247
+ isConstructed: parameters.isConstructed,
1248
+ ...idBlock,
1249
+ },
1250
+ lenBlock: {
1251
+ ...lenBlock,
1252
+ isIndefiniteForm: !!parameters.isIndefiniteForm,
1253
+ },
1254
+ ...parameters,
1255
+ }, LocalOctetStringValueBlock);
1256
+ this.idBlock.tagClass = 1;
1257
+ this.idBlock.tagNumber = 4;
1258
+ }
1259
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
1260
+ this.valueBlock.isConstructed = this.idBlock.isConstructed;
1261
+ this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
1262
+ if (inputLength === 0) {
1263
+ if (this.idBlock.error.length === 0)
1264
+ this.blockLength += this.idBlock.blockLength;
1265
+ if (this.lenBlock.error.length === 0)
1266
+ this.blockLength += this.lenBlock.blockLength;
1267
+ return inputOffset;
1268
+ }
1269
+ if (!this.valueBlock.isConstructed) {
1270
+ const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer;
1271
+ const buf = view.subarray(inputOffset, inputOffset + inputLength);
1272
+ try {
1273
+ if (buf.byteLength) {
1274
+ const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();
1275
+ const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext);
1276
+ if (asn.offset !== -1 && asn.offset === inputLength) {
1277
+ this.valueBlock.value = [asn.result];
1278
+ }
1279
+ }
1280
+ }
1281
+ catch {
1282
+ }
1283
+ }
1284
+ return super.fromBER(inputBuffer, inputOffset, inputLength, context);
1285
+ }
1286
+ onAsciiEncoding() {
1287
+ if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
1288
+ return Constructed.prototype.onAsciiEncoding.call(this);
1289
+ }
1290
+ const name = this.constructor.NAME;
1291
+ const value = pvtsutils__namespace.Convert.ToHex(this.valueBlock.valueHexView);
1292
+ return `${name} : ${value}`;
1293
+ }
1294
+ getValue() {
1295
+ if (!this.idBlock.isConstructed) {
1296
+ return this.valueBlock.valueHexView.slice().buffer;
1297
+ }
1298
+ const array = [];
1299
+ for (const content of this.valueBlock.value) {
1300
+ if (content instanceof _a$r) {
1301
+ array.push(content.valueBlock.valueHexView);
1302
+ }
1303
+ }
1304
+ return pvtsutils__namespace.BufferSourceConverter.concat(array);
1305
+ }
1306
+ }
1307
+ _a$r = OctetString;
1308
+ (() => {
1309
+ typeStore.OctetString = _a$r;
1310
+ })();
1311
+ OctetString.NAME = OCTET_STRING_NAME;
1312
+
1313
+ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
1314
+ constructor({ unusedBits = 0, isConstructed = false, ...parameters } = {}) {
1315
+ super(parameters);
1316
+ this.unusedBits = unusedBits;
1317
+ this.isConstructed = isConstructed;
1318
+ this.blockLength = this.valueHexView.byteLength;
1319
+ }
1320
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
1321
+ if (!inputLength) {
1322
+ return inputOffset;
1323
+ }
1324
+ let resultOffset = -1;
1325
+ if (this.isConstructed) {
1326
+ resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context);
1327
+ if (resultOffset === -1)
1328
+ return resultOffset;
1329
+ for (const value of this.value) {
1330
+ const currentBlockName = value.constructor.NAME;
1331
+ if (currentBlockName === END_OF_CONTENT_NAME) {
1332
+ if (this.isIndefiniteForm)
1333
+ break;
1334
+ else {
1335
+ this.error = "EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";
1336
+ return -1;
1337
+ }
1338
+ }
1339
+ if (currentBlockName !== BIT_STRING_NAME) {
1340
+ this.error = "BIT STRING may consists of BIT STRINGs only";
1341
+ return -1;
1342
+ }
1343
+ const valueBlock = value.valueBlock;
1344
+ if ((this.unusedBits > 0) && (valueBlock.unusedBits > 0)) {
1345
+ this.error = "Using of \"unused bits\" inside constructive BIT STRING allowed for least one only";
1346
+ return -1;
1347
+ }
1348
+ this.unusedBits = valueBlock.unusedBits;
1349
+ }
1350
+ return resultOffset;
1351
+ }
1352
+ const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
1353
+ if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
1354
+ return -1;
1355
+ }
1356
+ const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
1357
+ this.unusedBits = intBuffer[0];
1358
+ if (this.unusedBits > 7) {
1359
+ this.error = "Unused bits for BitString must be in range 0-7";
1360
+ return -1;
1361
+ }
1362
+ if (!this.unusedBits) {
1363
+ const buf = intBuffer.subarray(1);
1364
+ try {
1365
+ if (buf.byteLength) {
1366
+ const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();
1367
+ const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext);
1368
+ if (asn.offset !== -1 && asn.offset === (inputLength - 1)) {
1369
+ this.value = [asn.result];
1370
+ }
1371
+ }
1372
+ }
1373
+ catch {
1374
+ }
1375
+ }
1376
+ this.valueHexView = intBuffer.subarray(1);
1377
+ this.blockLength = intBuffer.length;
1378
+ return (inputOffset + inputLength);
1379
+ }
1380
+ toBER(sizeOnly, writer) {
1381
+ if (this.isConstructed) {
1382
+ return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);
1383
+ }
1384
+ if (sizeOnly) {
1385
+ return new ArrayBuffer(this.valueHexView.byteLength + 1);
1386
+ }
1387
+ if (!this.valueHexView.byteLength) {
1388
+ const empty = new Uint8Array(1);
1389
+ empty[0] = 0;
1390
+ return empty.buffer;
1391
+ }
1392
+ const retView = new Uint8Array(this.valueHexView.length + 1);
1393
+ retView[0] = this.unusedBits;
1394
+ retView.set(this.valueHexView, 1);
1395
+ return retView.buffer;
1396
+ }
1397
+ toJSON() {
1398
+ return {
1399
+ ...super.toJSON(),
1400
+ unusedBits: this.unusedBits,
1401
+ isConstructed: this.isConstructed,
1402
+ };
1403
+ }
1404
+ }
1405
+ LocalBitStringValueBlock.NAME = "BitStringValueBlock";
1406
+
1407
+ var _a$q;
1408
+ class BitString extends BaseBlock {
1409
+ constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
1410
+ var _b, _c;
1411
+ (_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
1412
+ super({
1413
+ idBlock: {
1414
+ isConstructed: parameters.isConstructed,
1415
+ ...idBlock,
1416
+ },
1417
+ lenBlock: {
1418
+ ...lenBlock,
1419
+ isIndefiniteForm: !!parameters.isIndefiniteForm,
1420
+ },
1421
+ ...parameters,
1422
+ }, LocalBitStringValueBlock);
1423
+ this.idBlock.tagClass = 1;
1424
+ this.idBlock.tagNumber = 3;
1425
+ }
1426
+ fromBER(inputBuffer, inputOffset, inputLength, context) {
1427
+ this.valueBlock.isConstructed = this.idBlock.isConstructed;
1428
+ this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
1429
+ return super.fromBER(inputBuffer, inputOffset, inputLength, context);
1430
+ }
1431
+ onAsciiEncoding() {
1432
+ if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
1433
+ return Constructed.prototype.onAsciiEncoding.call(this);
1434
+ }
1435
+ else {
1436
+ const bits = [];
1437
+ const valueHex = this.valueBlock.valueHexView;
1438
+ for (const byte of valueHex) {
1439
+ bits.push(byte.toString(2).padStart(8, "0"));
1440
+ }
1441
+ const bitsStr = bits.join("");
1442
+ const name = this.constructor.NAME;
1443
+ const value = bitsStr.substring(0, bitsStr.length - this.valueBlock.unusedBits);
1444
+ return `${name} : ${value}`;
1445
+ }
1446
+ }
1447
+ }
1448
+ _a$q = BitString;
1449
+ (() => {
1450
+ typeStore.BitString = _a$q;
1451
+ })();
1452
+ BitString.NAME = BIT_STRING_NAME;
1453
+
1454
+ var _a$p;
1455
+ function viewAdd(first, second) {
1456
+ const c = new Uint8Array([0]);
1457
+ const firstView = new Uint8Array(first);
1458
+ const secondView = new Uint8Array(second);
1459
+ let firstViewCopy = firstView.slice(0);
1460
+ const firstViewCopyLength = firstViewCopy.length - 1;
1461
+ const secondViewCopy = secondView.slice(0);
1462
+ const secondViewCopyLength = secondViewCopy.length - 1;
1463
+ let value = 0;
1464
+ const max = (secondViewCopyLength < firstViewCopyLength) ? firstViewCopyLength : secondViewCopyLength;
1465
+ let counter = 0;
1466
+ for (let i = max; i >= 0; i--, counter++) {
1467
+ switch (true) {
1468
+ case (counter < secondViewCopy.length):
1469
+ value = firstViewCopy[firstViewCopyLength - counter] + secondViewCopy[secondViewCopyLength - counter] + c[0];
1470
+ break;
1471
+ default:
1472
+ value = firstViewCopy[firstViewCopyLength - counter] + c[0];
1473
+ }
1474
+ c[0] = value / 10;
1475
+ switch (true) {
1476
+ case (counter >= firstViewCopy.length):
1477
+ firstViewCopy = pvutils__namespace.utilConcatView(new Uint8Array([value % 10]), firstViewCopy);
1478
+ break;
1479
+ default:
1480
+ firstViewCopy[firstViewCopyLength - counter] = value % 10;
1481
+ }
1482
+ }
1483
+ if (c[0] > 0)
1484
+ firstViewCopy = pvutils__namespace.utilConcatView(c, firstViewCopy);
1485
+ return firstViewCopy;
1486
+ }
1487
+ function power2(n) {
1488
+ if (n >= powers2.length) {
1489
+ for (let p = powers2.length; p <= n; p++) {
1490
+ const c = new Uint8Array([0]);
1491
+ let digits = (powers2[p - 1]).slice(0);
1492
+ for (let i = (digits.length - 1); i >= 0; i--) {
1493
+ const newValue = new Uint8Array([(digits[i] << 1) + c[0]]);
1494
+ c[0] = newValue[0] / 10;
1495
+ digits[i] = newValue[0] % 10;
1496
+ }
1497
+ if (c[0] > 0)
1498
+ digits = pvutils__namespace.utilConcatView(c, digits);
1499
+ powers2.push(digits);
1500
+ }
1501
+ }
1502
+ return powers2[n];
1503
+ }
1504
+ function viewSub(first, second) {
1505
+ let b = 0;
1506
+ const firstView = new Uint8Array(first);
1507
+ const secondView = new Uint8Array(second);
1508
+ const firstViewCopy = firstView.slice(0);
1509
+ const firstViewCopyLength = firstViewCopy.length - 1;
1510
+ const secondViewCopy = secondView.slice(0);
1511
+ const secondViewCopyLength = secondViewCopy.length - 1;
1512
+ let value;
1513
+ let counter = 0;
1514
+ for (let i = secondViewCopyLength; i >= 0; i--, counter++) {
1515
+ value = firstViewCopy[firstViewCopyLength - counter] - secondViewCopy[secondViewCopyLength - counter] - b;
1516
+ switch (true) {
1517
+ case (value < 0):
1518
+ b = 1;
1519
+ firstViewCopy[firstViewCopyLength - counter] = value + 10;
1520
+ break;
1521
+ default:
1522
+ b = 0;
1523
+ firstViewCopy[firstViewCopyLength - counter] = value;
1524
+ }
1525
+ }
1526
+ if (b > 0) {
1527
+ for (let i = (firstViewCopyLength - secondViewCopyLength + 1); i >= 0; i--, counter++) {
1528
+ value = firstViewCopy[firstViewCopyLength - counter] - b;
1529
+ if (value < 0) {
1530
+ b = 1;
1531
+ firstViewCopy[firstViewCopyLength - counter] = value + 10;
1532
+ }
1533
+ else {
1534
+ b = 0;
1535
+ firstViewCopy[firstViewCopyLength - counter] = value;
1536
+ break;
1537
+ }
1538
+ }
1539
+ }
1540
+ return firstViewCopy.slice();
1541
+ }
1542
+ class LocalIntegerValueBlock extends HexBlock(ValueBlock) {
1543
+ setValueHex() {
1544
+ if (this.valueHexView.length >= 4) {
1545
+ this.warnings.push("Too big Integer for decoding, hex only");
1546
+ this.isHexOnly = true;
1547
+ this._valueDec = 0;
1548
+ }
1549
+ else {
1550
+ this.isHexOnly = false;
1551
+ if (this.valueHexView.length > 0) {
1552
+ this._valueDec = pvutils__namespace.utilDecodeTC.call(this);
1553
+ }
1554
+ }
1555
+ }
1556
+ constructor({ value, ...parameters } = {}) {
1557
+ super(parameters);
1558
+ this._valueDec = 0;
1559
+ if (parameters.valueHex) {
1560
+ this.setValueHex();
1561
+ }
1562
+ if (value !== undefined) {
1563
+ this.valueDec = value;
1564
+ }
1565
+ }
1566
+ set valueDec(v) {
1567
+ this._valueDec = v;
1568
+ this.isHexOnly = false;
1569
+ this.valueHexView = new Uint8Array(pvutils__namespace.utilEncodeTC(v));
1570
+ }
1571
+ get valueDec() {
1572
+ return this._valueDec;
1573
+ }
1574
+ fromDER(inputBuffer, inputOffset, inputLength, expectedLength = 0) {
1575
+ const offset = this.fromBER(inputBuffer, inputOffset, inputLength);
1576
+ if (offset === -1)
1577
+ return offset;
1578
+ const view = this.valueHexView;
1579
+ if ((view[0] === 0x00) && ((view[1] & 0x80) !== 0)) {
1580
+ this.valueHexView = view.subarray(1);
1581
+ }
1582
+ else {
1583
+ if (expectedLength !== 0) {
1584
+ if (view.length < expectedLength) {
1585
+ if ((expectedLength - view.length) > 1)
1586
+ expectedLength = view.length + 1;
1587
+ this.valueHexView = view.subarray(expectedLength - view.length);
1588
+ }
1589
+ }
1590
+ }
1591
+ return offset;
1592
+ }
1593
+ toDER(sizeOnly = false) {
1594
+ const view = this.valueHexView;
1595
+ switch (true) {
1596
+ case ((view[0] & 0x80) !== 0):
1597
+ {
1598
+ const updatedView = new Uint8Array(this.valueHexView.length + 1);
1599
+ updatedView[0] = 0x00;
1600
+ updatedView.set(view, 1);
1601
+ this.valueHexView = updatedView;
1602
+ }
1603
+ break;
1604
+ case ((view[0] === 0x00) && ((view[1] & 0x80) === 0)):
1605
+ {
1606
+ this.valueHexView = this.valueHexView.subarray(1);
1607
+ }
1608
+ break;
1609
+ }
1610
+ return this.toBER(sizeOnly);
1611
+ }
1612
+ fromBER(inputBuffer, inputOffset, inputLength) {
1613
+ const resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);
1614
+ if (resultOffset === -1) {
1615
+ return resultOffset;
1616
+ }
1617
+ this.setValueHex();
1618
+ return resultOffset;
1619
+ }
1620
+ toBER(sizeOnly) {
1621
+ return sizeOnly
1622
+ ? new ArrayBuffer(this.valueHexView.length)
1623
+ : this.valueHexView.slice().buffer;
1624
+ }
1625
+ toJSON() {
1626
+ return {
1627
+ ...super.toJSON(),
1628
+ valueDec: this.valueDec,
1629
+ };
1630
+ }
1631
+ toString() {
1632
+ const firstBit = (this.valueHexView.length * 8) - 1;
1633
+ let digits = new Uint8Array((this.valueHexView.length * 8) / 3);
1634
+ let bitNumber = 0;
1635
+ let currentByte;
1636
+ const asn1View = this.valueHexView;
1637
+ let result = "";
1638
+ let flag = false;
1639
+ for (let byteNumber = (asn1View.byteLength - 1); byteNumber >= 0; byteNumber--) {
1640
+ currentByte = asn1View[byteNumber];
1641
+ for (let i = 0; i < 8; i++) {
1642
+ if ((currentByte & 1) === 1) {
1643
+ switch (bitNumber) {
1644
+ case firstBit:
1645
+ digits = viewSub(power2(bitNumber), digits);
1646
+ result = "-";
1647
+ break;
1648
+ default:
1649
+ digits = viewAdd(digits, power2(bitNumber));
1650
+ }
1651
+ }
1652
+ bitNumber++;
1653
+ currentByte >>= 1;
1654
+ }
1655
+ }
1656
+ for (let i = 0; i < digits.length; i++) {
1657
+ if (digits[i])
1658
+ flag = true;
1659
+ if (flag)
1660
+ result += digitsString.charAt(digits[i]);
1661
+ }
1662
+ if (flag === false)
1663
+ result += digitsString.charAt(0);
1664
+ return result;
1665
+ }
1666
+ }
1667
+ _a$p = LocalIntegerValueBlock;
1668
+ LocalIntegerValueBlock.NAME = "IntegerValueBlock";
1669
+ (() => {
1670
+ Object.defineProperty(_a$p.prototype, "valueHex", {
1671
+ set: function (v) {
1672
+ this.valueHexView = new Uint8Array(v);
1673
+ this.setValueHex();
1674
+ },
1675
+ get: function () {
1676
+ return this.valueHexView.slice().buffer;
1677
+ },
1678
+ });
1679
+ })();
1680
+
1681
+ var _a$o;
1682
+ class Integer extends BaseBlock {
1683
+ constructor(parameters = {}) {
1684
+ super(parameters, LocalIntegerValueBlock);
1685
+ this.idBlock.tagClass = 1;
1686
+ this.idBlock.tagNumber = 2;
1687
+ }
1688
+ toBigInt() {
1689
+ assertBigInt();
1690
+ return BigInt(this.valueBlock.toString());
1691
+ }
1692
+ static fromBigInt(value) {
1693
+ assertBigInt();
1694
+ const bigIntValue = BigInt(value);
1695
+ const writer = new ViewWriter();
1696
+ const hex = bigIntValue.toString(16).replace(/^-/, "");
1697
+ const view = new Uint8Array(pvtsutils__namespace.Convert.FromHex(hex));
1698
+ if (bigIntValue < 0) {
1699
+ const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
1700
+ first[0] |= 0x80;
1701
+ const firstInt = BigInt(`0x${pvtsutils__namespace.Convert.ToHex(first)}`);
1702
+ const secondInt = firstInt + bigIntValue;
1703
+ const second = pvtsutils__namespace.BufferSourceConverter.toUint8Array(pvtsutils__namespace.Convert.FromHex(secondInt.toString(16)));
1704
+ second[0] |= 0x80;
1705
+ writer.write(second);
1706
+ }
1707
+ else {
1708
+ if (view[0] & 0x80) {
1709
+ writer.write(new Uint8Array([0]));
1710
+ }
1711
+ writer.write(view);
1712
+ }
1713
+ const res = new _a$o({ valueHex: writer.final() });
1714
+ return res;
1715
+ }
1716
+ convertToDER() {
1717
+ const integer = new _a$o({ valueHex: this.valueBlock.valueHexView });
1718
+ integer.valueBlock.toDER();
1719
+ return integer;
1720
+ }
1721
+ convertFromDER() {
1722
+ return new _a$o({
1723
+ valueHex: this.valueBlock.valueHexView[0] === 0
1724
+ ? this.valueBlock.valueHexView.subarray(1)
1725
+ : this.valueBlock.valueHexView,
1726
+ });
1727
+ }
1728
+ onAsciiEncoding() {
1729
+ return `${this.constructor.NAME} : ${this.valueBlock.toString()}`;
1730
+ }
1731
+ }
1732
+ _a$o = Integer;
1733
+ (() => {
1734
+ typeStore.Integer = _a$o;
1735
+ })();
1736
+ Integer.NAME = "INTEGER";
1737
+
1738
+ var _a$n;
1739
+ class Enumerated extends Integer {
1740
+ constructor(parameters = {}) {
1741
+ super(parameters);
1742
+ this.idBlock.tagClass = 1;
1743
+ this.idBlock.tagNumber = 10;
1744
+ }
1745
+ }
1746
+ _a$n = Enumerated;
1747
+ (() => {
1748
+ typeStore.Enumerated = _a$n;
1749
+ })();
1750
+ Enumerated.NAME = "ENUMERATED";
1751
+
1752
+ class LocalSidValueBlock extends HexBlock(ValueBlock) {
1753
+ constructor({ valueDec = -1, isFirstSid = false, ...parameters } = {}) {
1754
+ super(parameters);
1755
+ this.valueDec = valueDec;
1756
+ this.isFirstSid = isFirstSid;
1757
+ }
1758
+ fromBER(inputBuffer, inputOffset, inputLength) {
1759
+ if (!inputLength) {
1760
+ return inputOffset;
1761
+ }
1762
+ const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
1763
+ if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
1764
+ return -1;
1765
+ }
1766
+ const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
1767
+ this.valueHexView = new Uint8Array(inputLength);
1768
+ for (let i = 0; i < inputLength; i++) {
1769
+ this.valueHexView[i] = intBuffer[i] & 0x7F;
1770
+ this.blockLength++;
1771
+ if ((intBuffer[i] & 0x80) === 0x00)
1772
+ break;
1773
+ }
1774
+ const tempView = new Uint8Array(this.blockLength);
1775
+ for (let i = 0; i < this.blockLength; i++) {
1776
+ tempView[i] = this.valueHexView[i];
1777
+ }
1778
+ this.valueHexView = tempView;
1779
+ if ((intBuffer[this.blockLength - 1] & 0x80) !== 0x00) {
1780
+ this.error = "End of input reached before message was fully decoded";
1781
+ return -1;
1782
+ }
1783
+ if (this.valueHexView[0] === 0x00)
1784
+ this.warnings.push("Needlessly long format of SID encoding");
1785
+ if (this.blockLength <= 8)
1786
+ this.valueDec = pvutils__namespace.utilFromBase(this.valueHexView, 7);
1787
+ else {
1788
+ this.isHexOnly = true;
1789
+ this.warnings.push("Too big SID for decoding, hex only");
1790
+ }
1791
+ return (inputOffset + this.blockLength);
1792
+ }
1793
+ set valueBigInt(value) {
1794
+ assertBigInt();
1795
+ let bits = BigInt(value).toString(2);
1796
+ while (bits.length % 7) {
1797
+ bits = "0" + bits;
1798
+ }
1799
+ const bytes = new Uint8Array(bits.length / 7);
1800
+ for (let i = 0; i < bytes.length; i++) {
1801
+ bytes[i] = parseInt(bits.slice(i * 7, i * 7 + 7), 2) + (i + 1 < bytes.length ? 0x80 : 0);
1802
+ }
1803
+ this.fromBER(bytes.buffer, 0, bytes.length);
1804
+ }
1805
+ toBER(sizeOnly) {
1806
+ if (this.isHexOnly) {
1807
+ if (sizeOnly)
1808
+ return (new ArrayBuffer(this.valueHexView.byteLength));
1809
+ const curView = this.valueHexView;
1810
+ const retView = new Uint8Array(this.blockLength);
1811
+ for (let i = 0; i < (this.blockLength - 1); i++)
1812
+ retView[i] = curView[i] | 0x80;
1813
+ retView[this.blockLength - 1] = curView[this.blockLength - 1];
1814
+ return retView.buffer;
1815
+ }
1816
+ const encodedBuf = pvutils__namespace.utilToBase(this.valueDec, 7);
1817
+ if (encodedBuf.byteLength === 0) {
1818
+ this.error = "Error during encoding SID value";
1819
+ return EMPTY_BUFFER;
1820
+ }
1821
+ const retView = new Uint8Array(encodedBuf.byteLength);
1822
+ if (!sizeOnly) {
1823
+ const encodedView = new Uint8Array(encodedBuf);
1824
+ const len = encodedBuf.byteLength - 1;
1825
+ for (let i = 0; i < len; i++)
1826
+ retView[i] = encodedView[i] | 0x80;
1827
+ retView[len] = encodedView[len];
1828
+ }
1829
+ return retView;
1830
+ }
1831
+ toString() {
1832
+ let result = "";
1833
+ if (this.isHexOnly)
1834
+ result = pvtsutils__namespace.Convert.ToHex(this.valueHexView);
1835
+ else {
1836
+ if (this.isFirstSid) {
1837
+ let sidValue = this.valueDec;
1838
+ if (this.valueDec <= 39)
1839
+ result = "0.";
1840
+ else {
1841
+ if (this.valueDec <= 79) {
1842
+ result = "1.";
1843
+ sidValue -= 40;
1844
+ }
1845
+ else {
1846
+ result = "2.";
1847
+ sidValue -= 80;
1848
+ }
1849
+ }
1850
+ result += sidValue.toString();
1851
+ }
1852
+ else
1853
+ result = this.valueDec.toString();
1854
+ }
1855
+ return result;
1856
+ }
1857
+ toJSON() {
1858
+ return {
1859
+ ...super.toJSON(),
1860
+ valueDec: this.valueDec,
1861
+ isFirstSid: this.isFirstSid,
1862
+ };
1863
+ }
1864
+ }
1865
+ LocalSidValueBlock.NAME = "sidBlock";
1866
+
1867
+ class LocalObjectIdentifierValueBlock extends ValueBlock {
1868
+ constructor({ value = EMPTY_STRING, ...parameters } = {}) {
1869
+ super(parameters);
1870
+ this.value = [];
1871
+ if (value) {
1872
+ this.fromString(value);
1873
+ }
1874
+ }
1875
+ fromBER(inputBuffer, inputOffset, inputLength) {
1876
+ let resultOffset = inputOffset;
1877
+ while (inputLength > 0) {
1878
+ const sidBlock = new LocalSidValueBlock();
1879
+ resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);
1880
+ if (resultOffset === -1) {
1881
+ this.blockLength = 0;
1882
+ this.error = sidBlock.error;
1883
+ return resultOffset;
1884
+ }
1885
+ if (this.value.length === 0)
1886
+ sidBlock.isFirstSid = true;
1887
+ this.blockLength += sidBlock.blockLength;
1888
+ inputLength -= sidBlock.blockLength;
1889
+ this.value.push(sidBlock);
1890
+ }
1891
+ return resultOffset;
1892
+ }
1893
+ toBER(sizeOnly) {
1894
+ const retBuffers = [];
1895
+ for (let i = 0; i < this.value.length; i++) {
1896
+ const valueBuf = this.value[i].toBER(sizeOnly);
1897
+ if (valueBuf.byteLength === 0) {
1898
+ this.error = this.value[i].error;
1899
+ return EMPTY_BUFFER;
1900
+ }
1901
+ retBuffers.push(valueBuf);
1902
+ }
1903
+ return concat(retBuffers);
1904
+ }
1905
+ fromString(string) {
1906
+ this.value = [];
1907
+ let pos1 = 0;
1908
+ let pos2 = 0;
1909
+ let sid = "";
1910
+ let flag = false;
1911
+ do {
1912
+ pos2 = string.indexOf(".", pos1);
1913
+ if (pos2 === -1)
1914
+ sid = string.substring(pos1);
1915
+ else
1916
+ sid = string.substring(pos1, pos2);
1917
+ pos1 = pos2 + 1;
1918
+ if (flag) {
1919
+ const sidBlock = this.value[0];
1920
+ let plus = 0;
1921
+ switch (sidBlock.valueDec) {
1922
+ case 0:
1923
+ break;
1924
+ case 1:
1925
+ plus = 40;
1926
+ break;
1927
+ case 2:
1928
+ plus = 80;
1929
+ break;
1930
+ default:
1931
+ this.value = [];
1932
+ return;
1933
+ }
1934
+ const parsedSID = parseInt(sid, 10);
1935
+ if (isNaN(parsedSID))
1936
+ return;
1937
+ sidBlock.valueDec = parsedSID + plus;
1938
+ flag = false;
1939
+ }
1940
+ else {
1941
+ const sidBlock = new LocalSidValueBlock();
1942
+ if (sid > Number.MAX_SAFE_INTEGER) {
1943
+ assertBigInt();
1944
+ const sidValue = BigInt(sid);
1945
+ sidBlock.valueBigInt = sidValue;
1946
+ }
1947
+ else {
1948
+ sidBlock.valueDec = parseInt(sid, 10);
1949
+ if (isNaN(sidBlock.valueDec))
1950
+ return;
1951
+ }
1952
+ if (!this.value.length) {
1953
+ sidBlock.isFirstSid = true;
1954
+ flag = true;
1955
+ }
1956
+ this.value.push(sidBlock);
1957
+ }
1958
+ } while (pos2 !== -1);
1959
+ }
1960
+ toString() {
1961
+ let result = "";
1962
+ let isHexOnly = false;
1963
+ for (let i = 0; i < this.value.length; i++) {
1964
+ isHexOnly = this.value[i].isHexOnly;
1965
+ let sidStr = this.value[i].toString();
1966
+ if (i !== 0)
1967
+ result = `${result}.`;
1968
+ if (isHexOnly) {
1969
+ sidStr = `{${sidStr}}`;
1970
+ if (this.value[i].isFirstSid)
1971
+ result = `2.{${sidStr} - 80}`;
1972
+ else
1973
+ result += sidStr;
1974
+ }
1975
+ else
1976
+ result += sidStr;
1977
+ }
1978
+ return result;
1979
+ }
1980
+ toJSON() {
1981
+ const object = {
1982
+ ...super.toJSON(),
1983
+ value: this.toString(),
1984
+ sidArray: [],
1985
+ };
1986
+ for (let i = 0; i < this.value.length; i++) {
1987
+ object.sidArray.push(this.value[i].toJSON());
1988
+ }
1989
+ return object;
1990
+ }
1991
+ }
1992
+ LocalObjectIdentifierValueBlock.NAME = "ObjectIdentifierValueBlock";
1993
+
1994
+ var _a$m;
1995
+ class ObjectIdentifier extends BaseBlock {
1996
+ getValue() {
1997
+ return this.valueBlock.toString();
1998
+ }
1999
+ setValue(value) {
2000
+ this.valueBlock.fromString(value);
2001
+ }
2002
+ constructor(parameters = {}) {
2003
+ super(parameters, LocalObjectIdentifierValueBlock);
2004
+ this.idBlock.tagClass = 1;
2005
+ this.idBlock.tagNumber = 6;
2006
+ }
2007
+ onAsciiEncoding() {
2008
+ return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`;
2009
+ }
2010
+ toJSON() {
2011
+ return {
2012
+ ...super.toJSON(),
2013
+ value: this.getValue(),
2014
+ };
2015
+ }
2016
+ }
2017
+ _a$m = ObjectIdentifier;
2018
+ (() => {
2019
+ typeStore.ObjectIdentifier = _a$m;
2020
+ })();
2021
+ ObjectIdentifier.NAME = "OBJECT IDENTIFIER";
2022
+
2023
+ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
2024
+ constructor({ valueDec = 0, ...parameters } = {}) {
2025
+ super(parameters);
2026
+ this.valueDec = valueDec;
2027
+ }
2028
+ fromBER(inputBuffer, inputOffset, inputLength) {
2029
+ if (inputLength === 0)
2030
+ return inputOffset;
2031
+ const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
2032
+ if (!checkBufferParams(this, inputView, inputOffset, inputLength))
2033
+ return -1;
2034
+ const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
2035
+ this.valueHexView = new Uint8Array(inputLength);
2036
+ for (let i = 0; i < inputLength; i++) {
2037
+ this.valueHexView[i] = intBuffer[i] & 0x7F;
2038
+ this.blockLength++;
2039
+ if ((intBuffer[i] & 0x80) === 0x00)
2040
+ break;
2041
+ }
2042
+ const tempView = new Uint8Array(this.blockLength);
2043
+ for (let i = 0; i < this.blockLength; i++)
2044
+ tempView[i] = this.valueHexView[i];
2045
+ this.valueHexView = tempView;
2046
+ if ((intBuffer[this.blockLength - 1] & 0x80) !== 0x00) {
2047
+ this.error = "End of input reached before message was fully decoded";
2048
+ return -1;
2049
+ }
2050
+ if (this.valueHexView[0] === 0x00)
2051
+ this.warnings.push("Needlessly long format of SID encoding");
2052
+ if (this.blockLength <= 8)
2053
+ this.valueDec = pvutils__namespace.utilFromBase(this.valueHexView, 7);
2054
+ else {
2055
+ this.isHexOnly = true;
2056
+ this.warnings.push("Too big SID for decoding, hex only");
2057
+ }
2058
+ return (inputOffset + this.blockLength);
2059
+ }
2060
+ toBER(sizeOnly) {
2061
+ if (this.isHexOnly) {
2062
+ if (sizeOnly)
2063
+ return (new ArrayBuffer(this.valueHexView.byteLength));
2064
+ const curView = this.valueHexView;
2065
+ const retView = new Uint8Array(this.blockLength);
2066
+ for (let i = 0; i < (this.blockLength - 1); i++)
2067
+ retView[i] = curView[i] | 0x80;
2068
+ retView[this.blockLength - 1] = curView[this.blockLength - 1];
2069
+ return retView.buffer;
2070
+ }
2071
+ const encodedBuf = pvutils__namespace.utilToBase(this.valueDec, 7);
2072
+ if (encodedBuf.byteLength === 0) {
2073
+ this.error = "Error during encoding SID value";
2074
+ return EMPTY_BUFFER;
2075
+ }
2076
+ const retView = new Uint8Array(encodedBuf.byteLength);
2077
+ if (!sizeOnly) {
2078
+ const encodedView = new Uint8Array(encodedBuf);
2079
+ const len = encodedBuf.byteLength - 1;
2080
+ for (let i = 0; i < len; i++)
2081
+ retView[i] = encodedView[i] | 0x80;
2082
+ retView[len] = encodedView[len];
2083
+ }
2084
+ return retView.buffer;
2085
+ }
2086
+ toString() {
2087
+ let result = "";
2088
+ if (this.isHexOnly)
2089
+ result = pvtsutils__namespace.Convert.ToHex(this.valueHexView);
2090
+ else {
2091
+ result = this.valueDec.toString();
2092
+ }
2093
+ return result;
2094
+ }
2095
+ toJSON() {
2096
+ return {
2097
+ ...super.toJSON(),
2098
+ valueDec: this.valueDec,
2099
+ };
2100
+ }
2101
+ }
2102
+ LocalRelativeSidValueBlock.NAME = "relativeSidBlock";
2103
+
2104
+ class LocalRelativeObjectIdentifierValueBlock extends ValueBlock {
2105
+ constructor({ value = EMPTY_STRING, ...parameters } = {}) {
2106
+ super(parameters);
2107
+ this.value = [];
2108
+ if (value) {
2109
+ this.fromString(value);
2110
+ }
2111
+ }
2112
+ fromBER(inputBuffer, inputOffset, inputLength) {
2113
+ let resultOffset = inputOffset;
2114
+ while (inputLength > 0) {
2115
+ const sidBlock = new LocalRelativeSidValueBlock();
2116
+ resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);
2117
+ if (resultOffset === -1) {
2118
+ this.blockLength = 0;
2119
+ this.error = sidBlock.error;
2120
+ return resultOffset;
2121
+ }
2122
+ this.blockLength += sidBlock.blockLength;
2123
+ inputLength -= sidBlock.blockLength;
2124
+ this.value.push(sidBlock);
2125
+ }
2126
+ return resultOffset;
2127
+ }
2128
+ toBER(sizeOnly, _writer) {
2129
+ const retBuffers = [];
2130
+ for (let i = 0; i < this.value.length; i++) {
2131
+ const valueBuf = this.value[i].toBER(sizeOnly);
2132
+ if (valueBuf.byteLength === 0) {
2133
+ this.error = this.value[i].error;
2134
+ return EMPTY_BUFFER;
2135
+ }
2136
+ retBuffers.push(valueBuf);
2137
+ }
2138
+ return concat(retBuffers);
2139
+ }
2140
+ fromString(string) {
2141
+ this.value = [];
2142
+ let pos1 = 0;
2143
+ let pos2 = 0;
2144
+ let sid = "";
2145
+ do {
2146
+ pos2 = string.indexOf(".", pos1);
2147
+ if (pos2 === -1)
2148
+ sid = string.substring(pos1);
2149
+ else
2150
+ sid = string.substring(pos1, pos2);
2151
+ pos1 = pos2 + 1;
2152
+ const sidBlock = new LocalRelativeSidValueBlock();
2153
+ sidBlock.valueDec = parseInt(sid, 10);
2154
+ if (isNaN(sidBlock.valueDec))
2155
+ return true;
2156
+ this.value.push(sidBlock);
2157
+ } while (pos2 !== -1);
2158
+ return true;
2159
+ }
2160
+ toString() {
2161
+ let result = "";
2162
+ let isHexOnly = false;
2163
+ for (let i = 0; i < this.value.length; i++) {
2164
+ isHexOnly = this.value[i].isHexOnly;
2165
+ let sidStr = this.value[i].toString();
2166
+ if (i !== 0)
2167
+ result = `${result}.`;
2168
+ if (isHexOnly) {
2169
+ sidStr = `{${sidStr}}`;
2170
+ result += sidStr;
2171
+ }
2172
+ else
2173
+ result += sidStr;
2174
+ }
2175
+ return result;
2176
+ }
2177
+ toJSON() {
2178
+ const object = {
2179
+ ...super.toJSON(),
2180
+ value: this.toString(),
2181
+ sidArray: [],
2182
+ };
2183
+ for (let i = 0; i < this.value.length; i++)
2184
+ object.sidArray.push(this.value[i].toJSON());
2185
+ return object;
2186
+ }
2187
+ }
2188
+ LocalRelativeObjectIdentifierValueBlock.NAME = "RelativeObjectIdentifierValueBlock";
2189
+
2190
+ var _a$l;
2191
+ class RelativeObjectIdentifier extends BaseBlock {
2192
+ getValue() {
2193
+ return this.valueBlock.toString();
2194
+ }
2195
+ setValue(value) {
2196
+ this.valueBlock.fromString(value);
2197
+ }
2198
+ constructor(parameters = {}) {
2199
+ super(parameters, LocalRelativeObjectIdentifierValueBlock);
2200
+ this.idBlock.tagClass = 1;
2201
+ this.idBlock.tagNumber = 13;
2202
+ }
2203
+ onAsciiEncoding() {
2204
+ return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`;
2205
+ }
2206
+ toJSON() {
2207
+ return {
2208
+ ...super.toJSON(),
2209
+ value: this.getValue(),
2210
+ };
2211
+ }
2212
+ }
2213
+ _a$l = RelativeObjectIdentifier;
2214
+ (() => {
2215
+ typeStore.RelativeObjectIdentifier = _a$l;
2216
+ })();
2217
+ RelativeObjectIdentifier.NAME = "RelativeObjectIdentifier";
2218
+
2219
+ var _a$k;
2220
+ class Sequence extends Constructed {
2221
+ constructor(parameters = {}) {
2222
+ super(parameters);
2223
+ this.idBlock.tagClass = 1;
2224
+ this.idBlock.tagNumber = 16;
2225
+ }
2226
+ }
2227
+ _a$k = Sequence;
2228
+ (() => {
2229
+ typeStore.Sequence = _a$k;
2230
+ })();
2231
+ Sequence.NAME = "SEQUENCE";
2232
+
2233
+ var _a$j;
2234
+ class Set extends Constructed {
2235
+ constructor(parameters = {}) {
2236
+ super(parameters);
2237
+ this.idBlock.tagClass = 1;
2238
+ this.idBlock.tagNumber = 17;
2239
+ }
2240
+ }
2241
+ _a$j = Set;
2242
+ (() => {
2243
+ typeStore.Set = _a$j;
2244
+ })();
2245
+ Set.NAME = "SET";
2246
+
2247
+ class LocalStringValueBlock extends HexBlock(ValueBlock) {
2248
+ constructor({ ...parameters } = {}) {
2249
+ super(parameters);
2250
+ this.isHexOnly = true;
2251
+ this.value = EMPTY_STRING;
2252
+ }
2253
+ toJSON() {
2254
+ return {
2255
+ ...super.toJSON(),
2256
+ value: this.value,
2257
+ };
2258
+ }
2259
+ }
2260
+ LocalStringValueBlock.NAME = "StringValueBlock";
2261
+
2262
+ class LocalSimpleStringValueBlock extends LocalStringValueBlock {
2263
+ }
2264
+ LocalSimpleStringValueBlock.NAME = "SimpleStringValueBlock";
2265
+
2266
+ class LocalSimpleStringBlock extends BaseStringBlock {
2267
+ constructor({ ...parameters } = {}) {
2268
+ super(parameters, LocalSimpleStringValueBlock);
2269
+ }
2270
+ fromBuffer(inputBuffer) {
2271
+ this.valueBlock.value = String.fromCharCode.apply(null, pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer));
2272
+ }
2273
+ fromString(inputString) {
2274
+ const strLen = inputString.length;
2275
+ const view = this.valueBlock.valueHexView = new Uint8Array(strLen);
2276
+ for (let i = 0; i < strLen; i++)
2277
+ view[i] = inputString.charCodeAt(i);
2278
+ this.valueBlock.value = inputString;
2279
+ }
2280
+ }
2281
+ LocalSimpleStringBlock.NAME = "SIMPLE STRING";
2282
+
2283
+ class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
2284
+ fromBuffer(inputBuffer) {
2285
+ this.valueBlock.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
2286
+ try {
2287
+ this.valueBlock.value = pvtsutils__namespace.Convert.ToUtf8String(inputBuffer);
2288
+ }
2289
+ catch (ex) {
2290
+ this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
2291
+ this.valueBlock.value = pvtsutils__namespace.Convert.ToBinary(inputBuffer);
2292
+ }
2293
+ }
2294
+ fromString(inputString) {
2295
+ this.valueBlock.valueHexView = new Uint8Array(pvtsutils__namespace.Convert.FromUtf8String(inputString));
2296
+ this.valueBlock.value = inputString;
2297
+ }
2298
+ }
2299
+ LocalUtf8StringValueBlock.NAME = "Utf8StringValueBlock";
2300
+
2301
+ var _a$i;
2302
+ class Utf8String extends LocalUtf8StringValueBlock {
2303
+ constructor(parameters = {}) {
2304
+ super(parameters);
2305
+ this.idBlock.tagClass = 1;
2306
+ this.idBlock.tagNumber = 12;
2307
+ }
2308
+ }
2309
+ _a$i = Utf8String;
2310
+ (() => {
2311
+ typeStore.Utf8String = _a$i;
2312
+ })();
2313
+ Utf8String.NAME = "UTF8String";
2314
+
2315
+ class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
2316
+ fromBuffer(inputBuffer) {
2317
+ this.valueBlock.value = pvtsutils__namespace.Convert.ToUtf16String(inputBuffer);
2318
+ this.valueBlock.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
2319
+ }
2320
+ fromString(inputString) {
2321
+ this.valueBlock.value = inputString;
2322
+ this.valueBlock.valueHexView = new Uint8Array(pvtsutils__namespace.Convert.FromUtf16String(inputString));
2323
+ }
2324
+ }
2325
+ LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
2326
+
2327
+ var _a$h;
2328
+ class BmpString extends LocalBmpStringValueBlock {
2329
+ constructor({ ...parameters } = {}) {
2330
+ super(parameters);
2331
+ this.idBlock.tagClass = 1;
2332
+ this.idBlock.tagNumber = 30;
2333
+ }
2334
+ }
2335
+ _a$h = BmpString;
2336
+ (() => {
2337
+ typeStore.BmpString = _a$h;
2338
+ })();
2339
+ BmpString.NAME = "BMPString";
2340
+
2341
+ class LocalUniversalStringValueBlock extends LocalSimpleStringBlock {
2342
+ fromBuffer(inputBuffer) {
2343
+ const copyBuffer = ArrayBuffer.isView(inputBuffer) ? inputBuffer.slice().buffer : inputBuffer.slice(0);
2344
+ const valueView = new Uint8Array(copyBuffer);
2345
+ for (let i = 0; i < valueView.length; i += 4) {
2346
+ valueView[i] = valueView[i + 3];
2347
+ valueView[i + 1] = valueView[i + 2];
2348
+ valueView[i + 2] = 0x00;
2349
+ valueView[i + 3] = 0x00;
2350
+ }
2351
+ this.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(copyBuffer));
2352
+ }
2353
+ fromString(inputString) {
2354
+ const strLength = inputString.length;
2355
+ const valueHexView = this.valueBlock.valueHexView = new Uint8Array(strLength * 4);
2356
+ for (let i = 0; i < strLength; i++) {
2357
+ const codeBuf = pvutils__namespace.utilToBase(inputString.charCodeAt(i), 8);
2358
+ const codeView = new Uint8Array(codeBuf);
2359
+ if (codeView.length > 4)
2360
+ continue;
2361
+ const dif = 4 - codeView.length;
2362
+ for (let j = (codeView.length - 1); j >= 0; j--)
2363
+ valueHexView[i * 4 + j + dif] = codeView[j];
2364
+ }
2365
+ this.valueBlock.value = inputString;
2366
+ }
2367
+ }
2368
+ LocalUniversalStringValueBlock.NAME = "UniversalStringValueBlock";
2369
+
2370
+ var _a$g;
2371
+ class UniversalString extends LocalUniversalStringValueBlock {
2372
+ constructor({ ...parameters } = {}) {
2373
+ super(parameters);
2374
+ this.idBlock.tagClass = 1;
2375
+ this.idBlock.tagNumber = 28;
2376
+ }
2377
+ }
2378
+ _a$g = UniversalString;
2379
+ (() => {
2380
+ typeStore.UniversalString = _a$g;
2381
+ })();
2382
+ UniversalString.NAME = "UniversalString";
2383
+
2384
+ var _a$f;
2385
+ class NumericString extends LocalSimpleStringBlock {
2386
+ constructor(parameters = {}) {
2387
+ super(parameters);
2388
+ this.idBlock.tagClass = 1;
2389
+ this.idBlock.tagNumber = 18;
2390
+ }
2391
+ }
2392
+ _a$f = NumericString;
2393
+ (() => {
2394
+ typeStore.NumericString = _a$f;
2395
+ })();
2396
+ NumericString.NAME = "NumericString";
2397
+
2398
+ var _a$e;
2399
+ class PrintableString extends LocalSimpleStringBlock {
2400
+ constructor(parameters = {}) {
2401
+ super(parameters);
2402
+ this.idBlock.tagClass = 1;
2403
+ this.idBlock.tagNumber = 19;
2404
+ }
2405
+ }
2406
+ _a$e = PrintableString;
2407
+ (() => {
2408
+ typeStore.PrintableString = _a$e;
2409
+ })();
2410
+ PrintableString.NAME = "PrintableString";
2411
+
2412
+ var _a$d;
2413
+ class TeletexString extends LocalSimpleStringBlock {
2414
+ constructor(parameters = {}) {
2415
+ super(parameters);
2416
+ this.idBlock.tagClass = 1;
2417
+ this.idBlock.tagNumber = 20;
2418
+ }
2419
+ }
2420
+ _a$d = TeletexString;
2421
+ (() => {
2422
+ typeStore.TeletexString = _a$d;
2423
+ })();
2424
+ TeletexString.NAME = "TeletexString";
2425
+
2426
+ var _a$c;
2427
+ class VideotexString extends LocalSimpleStringBlock {
2428
+ constructor(parameters = {}) {
2429
+ super(parameters);
2430
+ this.idBlock.tagClass = 1;
2431
+ this.idBlock.tagNumber = 21;
2432
+ }
2433
+ }
2434
+ _a$c = VideotexString;
2435
+ (() => {
2436
+ typeStore.VideotexString = _a$c;
2437
+ })();
2438
+ VideotexString.NAME = "VideotexString";
2439
+
2440
+ var _a$b;
2441
+ class IA5String extends LocalSimpleStringBlock {
2442
+ constructor(parameters = {}) {
2443
+ super(parameters);
2444
+ this.idBlock.tagClass = 1;
2445
+ this.idBlock.tagNumber = 22;
2446
+ }
2447
+ }
2448
+ _a$b = IA5String;
2449
+ (() => {
2450
+ typeStore.IA5String = _a$b;
2451
+ })();
2452
+ IA5String.NAME = "IA5String";
2453
+
2454
+ var _a$a;
2455
+ class GraphicString extends LocalSimpleStringBlock {
2456
+ constructor(parameters = {}) {
2457
+ super(parameters);
2458
+ this.idBlock.tagClass = 1;
2459
+ this.idBlock.tagNumber = 25;
2460
+ }
2461
+ }
2462
+ _a$a = GraphicString;
2463
+ (() => {
2464
+ typeStore.GraphicString = _a$a;
2465
+ })();
2466
+ GraphicString.NAME = "GraphicString";
2467
+
2468
+ var _a$9;
2469
+ class VisibleString extends LocalSimpleStringBlock {
2470
+ constructor(parameters = {}) {
2471
+ super(parameters);
2472
+ this.idBlock.tagClass = 1;
2473
+ this.idBlock.tagNumber = 26;
2474
+ }
2475
+ }
2476
+ _a$9 = VisibleString;
2477
+ (() => {
2478
+ typeStore.VisibleString = _a$9;
2479
+ })();
2480
+ VisibleString.NAME = "VisibleString";
2481
+
2482
+ var _a$8;
2483
+ class GeneralString extends LocalSimpleStringBlock {
2484
+ constructor(parameters = {}) {
2485
+ super(parameters);
2486
+ this.idBlock.tagClass = 1;
2487
+ this.idBlock.tagNumber = 27;
2488
+ }
2489
+ }
2490
+ _a$8 = GeneralString;
2491
+ (() => {
2492
+ typeStore.GeneralString = _a$8;
2493
+ })();
2494
+ GeneralString.NAME = "GeneralString";
2495
+
2496
+ var _a$7;
2497
+ class CharacterString extends LocalSimpleStringBlock {
2498
+ constructor(parameters = {}) {
2499
+ super(parameters);
2500
+ this.idBlock.tagClass = 1;
2501
+ this.idBlock.tagNumber = 29;
2502
+ }
2503
+ }
2504
+ _a$7 = CharacterString;
2505
+ (() => {
2506
+ typeStore.CharacterString = _a$7;
2507
+ })();
2508
+ CharacterString.NAME = "CharacterString";
2509
+
2510
+ var _a$6;
2511
+ class UTCTime extends VisibleString {
2512
+ constructor({ value, valueDate, ...parameters } = {}) {
2513
+ super(parameters);
2514
+ this.year = 0;
2515
+ this.month = 0;
2516
+ this.day = 0;
2517
+ this.hour = 0;
2518
+ this.minute = 0;
2519
+ this.second = 0;
2520
+ if (value) {
2521
+ this.fromString(value);
2522
+ this.valueBlock.valueHexView = new Uint8Array(value.length);
2523
+ for (let i = 0; i < value.length; i++)
2524
+ this.valueBlock.valueHexView[i] = value.charCodeAt(i);
2525
+ }
2526
+ if (valueDate) {
2527
+ this.fromDate(valueDate);
2528
+ this.valueBlock.valueHexView = new Uint8Array(this.toBuffer());
2529
+ }
2530
+ this.idBlock.tagClass = 1;
2531
+ this.idBlock.tagNumber = 23;
2532
+ }
2533
+ fromBuffer(inputBuffer) {
2534
+ this.fromString(String.fromCharCode.apply(null, pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer)));
2535
+ }
2536
+ toBuffer() {
2537
+ const str = this.toString();
2538
+ const buffer = new ArrayBuffer(str.length);
2539
+ const view = new Uint8Array(buffer);
2540
+ for (let i = 0; i < str.length; i++)
2541
+ view[i] = str.charCodeAt(i);
2542
+ return buffer;
2543
+ }
2544
+ fromDate(inputDate) {
2545
+ this.year = inputDate.getUTCFullYear();
2546
+ this.month = inputDate.getUTCMonth() + 1;
2547
+ this.day = inputDate.getUTCDate();
2548
+ this.hour = inputDate.getUTCHours();
2549
+ this.minute = inputDate.getUTCMinutes();
2550
+ this.second = inputDate.getUTCSeconds();
2551
+ }
2552
+ toDate() {
2553
+ return (new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second)));
2554
+ }
2555
+ fromString(inputString) {
2556
+ const parser = /(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig;
2557
+ const parserArray = parser.exec(inputString);
2558
+ if (parserArray === null) {
2559
+ this.error = "Wrong input string for conversion";
2560
+ return;
2561
+ }
2562
+ const year = parseInt(parserArray[1], 10);
2563
+ if (year >= 50)
2564
+ this.year = 1900 + year;
2565
+ else
2566
+ this.year = 2000 + year;
2567
+ this.month = parseInt(parserArray[2], 10);
2568
+ this.day = parseInt(parserArray[3], 10);
2569
+ this.hour = parseInt(parserArray[4], 10);
2570
+ this.minute = parseInt(parserArray[5], 10);
2571
+ this.second = parseInt(parserArray[6], 10);
2572
+ }
2573
+ toString(encoding = "iso") {
2574
+ if (encoding === "iso") {
2575
+ const outputArray = new Array(7);
2576
+ outputArray[0] = pvutils__namespace.padNumber(((this.year < 2000) ? (this.year - 1900) : (this.year - 2000)), 2);
2577
+ outputArray[1] = pvutils__namespace.padNumber(this.month, 2);
2578
+ outputArray[2] = pvutils__namespace.padNumber(this.day, 2);
2579
+ outputArray[3] = pvutils__namespace.padNumber(this.hour, 2);
2580
+ outputArray[4] = pvutils__namespace.padNumber(this.minute, 2);
2581
+ outputArray[5] = pvutils__namespace.padNumber(this.second, 2);
2582
+ outputArray[6] = "Z";
2583
+ return outputArray.join("");
2584
+ }
2585
+ return super.toString(encoding);
2586
+ }
2587
+ onAsciiEncoding() {
2588
+ return `${this.constructor.NAME} : ${this.toDate().toISOString()}`;
2589
+ }
2590
+ toJSON() {
2591
+ return {
2592
+ ...super.toJSON(),
2593
+ year: this.year,
2594
+ month: this.month,
2595
+ day: this.day,
2596
+ hour: this.hour,
2597
+ minute: this.minute,
2598
+ second: this.second,
2599
+ };
2600
+ }
2601
+ }
2602
+ _a$6 = UTCTime;
2603
+ (() => {
2604
+ typeStore.UTCTime = _a$6;
2605
+ })();
2606
+ UTCTime.NAME = "UTCTime";
2607
+
2608
+ var _a$5;
2609
+ class GeneralizedTime extends UTCTime {
2610
+ constructor(parameters = {}) {
2611
+ var _b;
2612
+ super(parameters);
2613
+ (_b = this.millisecond) !== null && _b !== void 0 ? _b : (this.millisecond = 0);
2614
+ this.idBlock.tagClass = 1;
2615
+ this.idBlock.tagNumber = 24;
2616
+ }
2617
+ fromDate(inputDate) {
2618
+ super.fromDate(inputDate);
2619
+ this.millisecond = inputDate.getUTCMilliseconds();
2620
+ }
2621
+ toDate() {
2622
+ const utcDate = Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond);
2623
+ return (new Date(utcDate));
2624
+ }
2625
+ fromString(inputString) {
2626
+ let isUTC = false;
2627
+ let timeString = "";
2628
+ let dateTimeString = "";
2629
+ let fractionPart = 0;
2630
+ let parser;
2631
+ let hourDifference = 0;
2632
+ let minuteDifference = 0;
2633
+ if (inputString[inputString.length - 1] === "Z") {
2634
+ timeString = inputString.substring(0, inputString.length - 1);
2635
+ isUTC = true;
2636
+ }
2637
+ else {
2638
+ const number = new Number(inputString[inputString.length - 1]);
2639
+ if (isNaN(number.valueOf()))
2640
+ throw new Error("Wrong input string for conversion");
2641
+ timeString = inputString;
2642
+ }
2643
+ if (isUTC) {
2644
+ if (timeString.indexOf("+") !== -1)
2645
+ throw new Error("Wrong input string for conversion");
2646
+ if (timeString.indexOf("-") !== -1)
2647
+ throw new Error("Wrong input string for conversion");
2648
+ }
2649
+ else {
2650
+ let multiplier = 1;
2651
+ let differencePosition = timeString.indexOf("+");
2652
+ let differenceString = "";
2653
+ if (differencePosition === -1) {
2654
+ differencePosition = timeString.indexOf("-");
2655
+ multiplier = -1;
2656
+ }
2657
+ if (differencePosition !== -1) {
2658
+ differenceString = timeString.substring(differencePosition + 1);
2659
+ timeString = timeString.substring(0, differencePosition);
2660
+ if ((differenceString.length !== 2) && (differenceString.length !== 4))
2661
+ throw new Error("Wrong input string for conversion");
2662
+ let number = parseInt(differenceString.substring(0, 2), 10);
2663
+ if (isNaN(number.valueOf()))
2664
+ throw new Error("Wrong input string for conversion");
2665
+ hourDifference = multiplier * number;
2666
+ if (differenceString.length === 4) {
2667
+ number = parseInt(differenceString.substring(2, 4), 10);
2668
+ if (isNaN(number.valueOf()))
2669
+ throw new Error("Wrong input string for conversion");
2670
+ minuteDifference = multiplier * number;
2671
+ }
2672
+ }
2673
+ }
2674
+ let fractionPointPosition = timeString.indexOf(".");
2675
+ if (fractionPointPosition === -1)
2676
+ fractionPointPosition = timeString.indexOf(",");
2677
+ if (fractionPointPosition !== -1) {
2678
+ const fractionPartCheck = new Number(`0${timeString.substring(fractionPointPosition)}`);
2679
+ if (isNaN(fractionPartCheck.valueOf()))
2680
+ throw new Error("Wrong input string for conversion");
2681
+ fractionPart = fractionPartCheck.valueOf();
2682
+ dateTimeString = timeString.substring(0, fractionPointPosition);
2683
+ }
2684
+ else
2685
+ dateTimeString = timeString;
2686
+ switch (true) {
2687
+ case (dateTimeString.length === 8):
2688
+ parser = /(\d{4})(\d{2})(\d{2})/ig;
2689
+ if (fractionPointPosition !== -1)
2690
+ throw new Error("Wrong input string for conversion");
2691
+ break;
2692
+ case (dateTimeString.length === 10):
2693
+ parser = /(\d{4})(\d{2})(\d{2})(\d{2})/ig;
2694
+ if (fractionPointPosition !== -1) {
2695
+ let fractionResult = 60 * fractionPart;
2696
+ this.minute = Math.floor(fractionResult);
2697
+ fractionResult = 60 * (fractionResult - this.minute);
2698
+ this.second = Math.floor(fractionResult);
2699
+ fractionResult = 1000 * (fractionResult - this.second);
2700
+ this.millisecond = Math.floor(fractionResult);
2701
+ }
2702
+ break;
2703
+ case (dateTimeString.length === 12):
2704
+ parser = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig;
2705
+ if (fractionPointPosition !== -1) {
2706
+ let fractionResult = 60 * fractionPart;
2707
+ this.second = Math.floor(fractionResult);
2708
+ fractionResult = 1000 * (fractionResult - this.second);
2709
+ this.millisecond = Math.floor(fractionResult);
2710
+ }
2711
+ break;
2712
+ case (dateTimeString.length === 14):
2713
+ parser = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig;
2714
+ if (fractionPointPosition !== -1) {
2715
+ const fractionResult = 1000 * fractionPart;
2716
+ this.millisecond = Math.floor(fractionResult);
2717
+ }
2718
+ break;
2719
+ default:
2720
+ throw new Error("Wrong input string for conversion");
2721
+ }
2722
+ const parserArray = parser.exec(dateTimeString);
2723
+ if (parserArray === null)
2724
+ throw new Error("Wrong input string for conversion");
2725
+ for (let j = 1; j < parserArray.length; j++) {
2726
+ switch (j) {
2727
+ case 1:
2728
+ this.year = parseInt(parserArray[j], 10);
2729
+ break;
2730
+ case 2:
2731
+ this.month = parseInt(parserArray[j], 10);
2732
+ break;
2733
+ case 3:
2734
+ this.day = parseInt(parserArray[j], 10);
2735
+ break;
2736
+ case 4:
2737
+ this.hour = parseInt(parserArray[j], 10) + hourDifference;
2738
+ break;
2739
+ case 5:
2740
+ this.minute = parseInt(parserArray[j], 10) + minuteDifference;
2741
+ break;
2742
+ case 6:
2743
+ this.second = parseInt(parserArray[j], 10);
2744
+ break;
2745
+ default:
2746
+ throw new Error("Wrong input string for conversion");
2747
+ }
2748
+ }
2749
+ if (isUTC === false) {
2750
+ const tempDate = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
2751
+ this.year = tempDate.getUTCFullYear();
2752
+ this.month = tempDate.getUTCMonth();
2753
+ this.day = tempDate.getUTCDay();
2754
+ this.hour = tempDate.getUTCHours();
2755
+ this.minute = tempDate.getUTCMinutes();
2756
+ this.second = tempDate.getUTCSeconds();
2757
+ this.millisecond = tempDate.getUTCMilliseconds();
2758
+ }
2759
+ }
2760
+ toString(encoding = "iso") {
2761
+ if (encoding === "iso") {
2762
+ const outputArray = [];
2763
+ outputArray.push(pvutils__namespace.padNumber(this.year, 4));
2764
+ outputArray.push(pvutils__namespace.padNumber(this.month, 2));
2765
+ outputArray.push(pvutils__namespace.padNumber(this.day, 2));
2766
+ outputArray.push(pvutils__namespace.padNumber(this.hour, 2));
2767
+ outputArray.push(pvutils__namespace.padNumber(this.minute, 2));
2768
+ outputArray.push(pvutils__namespace.padNumber(this.second, 2));
2769
+ if (this.millisecond !== 0) {
2770
+ outputArray.push(".");
2771
+ outputArray.push(pvutils__namespace.padNumber(this.millisecond, 3));
2772
+ }
2773
+ outputArray.push("Z");
2774
+ return outputArray.join("");
2775
+ }
2776
+ return super.toString(encoding);
2777
+ }
2778
+ toJSON() {
2779
+ return {
2780
+ ...super.toJSON(),
2781
+ millisecond: this.millisecond,
2782
+ };
2783
+ }
2784
+ }
2785
+ _a$5 = GeneralizedTime;
2786
+ (() => {
2787
+ typeStore.GeneralizedTime = _a$5;
2788
+ })();
2789
+ GeneralizedTime.NAME = "GeneralizedTime";
2790
+
2791
+ var _a$4;
2792
+ class DATE extends Utf8String {
2793
+ constructor(parameters = {}) {
2794
+ super(parameters);
2795
+ this.idBlock.tagClass = 1;
2796
+ this.idBlock.tagNumber = 31;
2797
+ }
2798
+ }
2799
+ _a$4 = DATE;
2800
+ (() => {
2801
+ typeStore.DATE = _a$4;
2802
+ })();
2803
+ DATE.NAME = "DATE";
2804
+
2805
+ var _a$3;
2806
+ class TimeOfDay extends Utf8String {
2807
+ constructor(parameters = {}) {
2808
+ super(parameters);
2809
+ this.idBlock.tagClass = 1;
2810
+ this.idBlock.tagNumber = 32;
2811
+ }
2812
+ }
2813
+ _a$3 = TimeOfDay;
2814
+ (() => {
2815
+ typeStore.TimeOfDay = _a$3;
2816
+ })();
2817
+ TimeOfDay.NAME = "TimeOfDay";
2818
+
2819
+ var _a$2;
2820
+ class DateTime extends Utf8String {
2821
+ constructor(parameters = {}) {
2822
+ super(parameters);
2823
+ this.idBlock.tagClass = 1;
2824
+ this.idBlock.tagNumber = 33;
2825
+ }
2826
+ }
2827
+ _a$2 = DateTime;
2828
+ (() => {
2829
+ typeStore.DateTime = _a$2;
2830
+ })();
2831
+ DateTime.NAME = "DateTime";
2832
+
2833
+ var _a$1;
2834
+ class Duration extends Utf8String {
2835
+ constructor(parameters = {}) {
2836
+ super(parameters);
2837
+ this.idBlock.tagClass = 1;
2838
+ this.idBlock.tagNumber = 34;
2839
+ }
2840
+ }
2841
+ _a$1 = Duration;
2842
+ (() => {
2843
+ typeStore.Duration = _a$1;
2844
+ })();
2845
+ Duration.NAME = "Duration";
2846
+
2847
+ var _a;
2848
+ class TIME extends Utf8String {
2849
+ constructor(parameters = {}) {
2850
+ super(parameters);
2851
+ this.idBlock.tagClass = 1;
2852
+ this.idBlock.tagNumber = 14;
2853
+ }
2854
+ }
2855
+ _a = TIME;
2856
+ (() => {
2857
+ typeStore.TIME = _a;
2858
+ })();
2859
+ TIME.NAME = "TIME";
2860
+
2861
+ class Any {
2862
+ constructor({ name = EMPTY_STRING, optional = false } = {}) {
2863
+ this.name = name;
2864
+ this.optional = optional;
2865
+ }
2866
+ }
2867
+
2868
+ class Choice extends Any {
2869
+ constructor({ value = [], ...parameters } = {}) {
2870
+ super(parameters);
2871
+ this.value = value;
2872
+ }
2873
+ }
2874
+
2875
+ class Repeated extends Any {
2876
+ constructor({ value = new Any(), local = false, ...parameters } = {}) {
2877
+ super(parameters);
2878
+ this.value = value;
2879
+ this.local = local;
2880
+ }
2881
+ }
2882
+
2883
+ class RawData {
2884
+ get data() {
2885
+ return this.dataView.slice().buffer;
2886
+ }
2887
+ set data(value) {
2888
+ this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(value);
2889
+ }
2890
+ constructor({ data = EMPTY_VIEW } = {}) {
2891
+ this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(data);
2892
+ }
2893
+ fromBER(inputBuffer, inputOffset, inputLength) {
2894
+ const endLength = inputOffset + inputLength;
2895
+ this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
2896
+ return endLength;
2897
+ }
2898
+ toBER(_sizeOnly) {
2899
+ return this.dataView.slice().buffer;
2900
+ }
2901
+ }
2902
+
2903
+ function compareSchema(root, inputData, inputSchema) {
2904
+ if (inputSchema instanceof Choice) {
2905
+ for (const element of inputSchema.value) {
2906
+ const result = compareSchema(root, inputData, element);
2907
+ if (result.verified) {
2908
+ return {
2909
+ verified: true,
2910
+ result: root,
2911
+ };
2912
+ }
2913
+ }
2914
+ {
2915
+ const _result = {
2916
+ verified: false,
2917
+ result: { error: "Wrong values for Choice type" },
2918
+ };
2919
+ if (inputSchema.hasOwnProperty(NAME))
2920
+ _result.name = inputSchema.name;
2921
+ return _result;
2922
+ }
2923
+ }
2924
+ if (inputSchema instanceof Any) {
2925
+ if (inputSchema.hasOwnProperty(NAME))
2926
+ root[inputSchema.name] = inputData;
2927
+ return {
2928
+ verified: true,
2929
+ result: root,
2930
+ };
2931
+ }
2932
+ if ((root instanceof Object) === false) {
2933
+ return {
2934
+ verified: false,
2935
+ result: { error: "Wrong root object" },
2936
+ };
2937
+ }
2938
+ if ((inputData instanceof Object) === false) {
2939
+ return {
2940
+ verified: false,
2941
+ result: { error: "Wrong ASN.1 data" },
2942
+ };
2943
+ }
2944
+ if ((inputSchema instanceof Object) === false) {
2945
+ return {
2946
+ verified: false,
2947
+ result: { error: "Wrong ASN.1 schema" },
2948
+ };
2949
+ }
2950
+ if ((ID_BLOCK in inputSchema) === false) {
2951
+ return {
2952
+ verified: false,
2953
+ result: { error: "Wrong ASN.1 schema" },
2954
+ };
2955
+ }
2956
+ if ((FROM_BER in inputSchema.idBlock) === false) {
2957
+ return {
2958
+ verified: false,
2959
+ result: { error: "Wrong ASN.1 schema" },
2960
+ };
2961
+ }
2962
+ if ((TO_BER in inputSchema.idBlock) === false) {
2963
+ return {
2964
+ verified: false,
2965
+ result: { error: "Wrong ASN.1 schema" },
2966
+ };
2967
+ }
2968
+ const encodedId = inputSchema.idBlock.toBER(false);
2969
+ if (encodedId.byteLength === 0) {
2970
+ return {
2971
+ verified: false,
2972
+ result: { error: "Error encoding idBlock for ASN.1 schema" },
2973
+ };
2974
+ }
2975
+ const decodedOffset = inputSchema.idBlock.fromBER(encodedId, 0, encodedId.byteLength);
2976
+ if (decodedOffset === -1) {
2977
+ return {
2978
+ verified: false,
2979
+ result: { error: "Error decoding idBlock for ASN.1 schema" },
2980
+ };
2981
+ }
2982
+ if (inputSchema.idBlock.hasOwnProperty(TAG_CLASS) === false) {
2983
+ return {
2984
+ verified: false,
2985
+ result: { error: "Wrong ASN.1 schema" },
2986
+ };
2987
+ }
2988
+ if (inputSchema.idBlock.tagClass !== inputData.idBlock.tagClass) {
2989
+ return {
2990
+ verified: false,
2991
+ result: root,
2992
+ };
2993
+ }
2994
+ if (inputSchema.idBlock.hasOwnProperty(TAG_NUMBER) === false) {
2995
+ return {
2996
+ verified: false,
2997
+ result: { error: "Wrong ASN.1 schema" },
2998
+ };
2999
+ }
3000
+ if (inputSchema.idBlock.tagNumber !== inputData.idBlock.tagNumber) {
3001
+ return {
3002
+ verified: false,
3003
+ result: root,
3004
+ };
3005
+ }
3006
+ if (inputSchema.idBlock.hasOwnProperty(IS_CONSTRUCTED) === false) {
3007
+ return {
3008
+ verified: false,
3009
+ result: { error: "Wrong ASN.1 schema" },
3010
+ };
3011
+ }
3012
+ if (inputSchema.idBlock.isConstructed !== inputData.idBlock.isConstructed) {
3013
+ return {
3014
+ verified: false,
3015
+ result: root,
3016
+ };
3017
+ }
3018
+ if (!(IS_HEX_ONLY in inputSchema.idBlock)) {
3019
+ return {
3020
+ verified: false,
3021
+ result: { error: "Wrong ASN.1 schema" },
3022
+ };
3023
+ }
3024
+ if (inputSchema.idBlock.isHexOnly !== inputData.idBlock.isHexOnly) {
3025
+ return {
3026
+ verified: false,
3027
+ result: root,
3028
+ };
3029
+ }
3030
+ if (inputSchema.idBlock.isHexOnly) {
3031
+ if ((VALUE_HEX_VIEW in inputSchema.idBlock) === false) {
3032
+ return {
3033
+ verified: false,
3034
+ result: { error: "Wrong ASN.1 schema" },
3035
+ };
3036
+ }
3037
+ const schemaView = inputSchema.idBlock.valueHexView;
3038
+ const asn1View = inputData.idBlock.valueHexView;
3039
+ if (schemaView.length !== asn1View.length) {
3040
+ return {
3041
+ verified: false,
3042
+ result: root,
3043
+ };
3044
+ }
3045
+ for (let i = 0; i < schemaView.length; i++) {
3046
+ if (schemaView[i] !== asn1View[1]) {
3047
+ return {
3048
+ verified: false,
3049
+ result: root,
3050
+ };
3051
+ }
3052
+ }
3053
+ }
3054
+ if (inputSchema.name) {
3055
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3056
+ if (inputSchema.name)
3057
+ root[inputSchema.name] = inputData;
3058
+ }
3059
+ if (inputSchema instanceof typeStore.Constructed) {
3060
+ let admission = 0;
3061
+ let result = {
3062
+ verified: false,
3063
+ result: { error: "Unknown error" },
3064
+ };
3065
+ let maxLength = inputSchema.valueBlock.value.length;
3066
+ if (maxLength > 0) {
3067
+ if (inputSchema.valueBlock.value[0] instanceof Repeated) {
3068
+ maxLength = inputData.valueBlock.value.length;
3069
+ }
3070
+ }
3071
+ if (maxLength === 0) {
3072
+ return {
3073
+ verified: true,
3074
+ result: root,
3075
+ };
3076
+ }
3077
+ if ((inputData.valueBlock.value.length === 0)
3078
+ && (inputSchema.valueBlock.value.length !== 0)) {
3079
+ let _optional = true;
3080
+ for (let i = 0; i < inputSchema.valueBlock.value.length; i++)
3081
+ _optional = _optional && (inputSchema.valueBlock.value[i].optional || false);
3082
+ if (_optional) {
3083
+ return {
3084
+ verified: true,
3085
+ result: root,
3086
+ };
3087
+ }
3088
+ if (inputSchema.name) {
3089
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3090
+ if (inputSchema.name)
3091
+ delete root[inputSchema.name];
3092
+ }
3093
+ root.error = "Inconsistent object length";
3094
+ return {
3095
+ verified: false,
3096
+ result: root,
3097
+ };
3098
+ }
3099
+ for (let i = 0; i < maxLength; i++) {
3100
+ if ((i - admission) >= inputData.valueBlock.value.length) {
3101
+ if (inputSchema.valueBlock.value[i].optional === false) {
3102
+ const _result = {
3103
+ verified: false,
3104
+ result: root,
3105
+ };
3106
+ root.error = "Inconsistent length between ASN.1 data and schema";
3107
+ if (inputSchema.name) {
3108
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3109
+ if (inputSchema.name) {
3110
+ delete root[inputSchema.name];
3111
+ _result.name = inputSchema.name;
3112
+ }
3113
+ }
3114
+ return _result;
3115
+ }
3116
+ }
3117
+ else {
3118
+ if (inputSchema.valueBlock.value[0] instanceof Repeated) {
3119
+ result = compareSchema(root, inputData.valueBlock.value[i], inputSchema.valueBlock.value[0].value);
3120
+ if (result.verified === false) {
3121
+ if (inputSchema.valueBlock.value[0].optional)
3122
+ admission++;
3123
+ else {
3124
+ if (inputSchema.name) {
3125
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3126
+ if (inputSchema.name)
3127
+ delete root[inputSchema.name];
3128
+ }
3129
+ return result;
3130
+ }
3131
+ }
3132
+ if ((NAME in inputSchema.valueBlock.value[0]) && (inputSchema.valueBlock.value[0].name.length > 0)) {
3133
+ let arrayRoot = {};
3134
+ if ((LOCAL in inputSchema.valueBlock.value[0]) && (inputSchema.valueBlock.value[0].local))
3135
+ arrayRoot = inputData;
3136
+ else
3137
+ arrayRoot = root;
3138
+ if (typeof arrayRoot[inputSchema.valueBlock.value[0].name] === "undefined")
3139
+ arrayRoot[inputSchema.valueBlock.value[0].name] = [];
3140
+ arrayRoot[inputSchema.valueBlock.value[0].name].push(inputData.valueBlock.value[i]);
3141
+ }
3142
+ }
3143
+ else {
3144
+ result = compareSchema(root, inputData.valueBlock.value[i - admission], inputSchema.valueBlock.value[i]);
3145
+ if (result.verified === false) {
3146
+ if (inputSchema.valueBlock.value[i].optional)
3147
+ admission++;
3148
+ else {
3149
+ if (inputSchema.name) {
3150
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3151
+ if (inputSchema.name)
3152
+ delete root[inputSchema.name];
3153
+ }
3154
+ return result;
3155
+ }
3156
+ }
3157
+ }
3158
+ }
3159
+ }
3160
+ if (result.verified === false) {
3161
+ const _result = {
3162
+ verified: false,
3163
+ result: root,
3164
+ };
3165
+ if (inputSchema.name) {
3166
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3167
+ if (inputSchema.name) {
3168
+ delete root[inputSchema.name];
3169
+ _result.name = inputSchema.name;
3170
+ }
3171
+ }
3172
+ return _result;
3173
+ }
3174
+ return {
3175
+ verified: true,
3176
+ result: root,
3177
+ };
3178
+ }
3179
+ if (inputSchema.primitiveSchema
3180
+ && (VALUE_HEX_VIEW in inputData.valueBlock)) {
3181
+ const asn1 = localFromBER(inputData.valueBlock.valueHexView);
3182
+ if (asn1.offset === -1) {
3183
+ const _result = {
3184
+ verified: false,
3185
+ result: asn1.result,
3186
+ };
3187
+ if (inputSchema.name) {
3188
+ inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
3189
+ if (inputSchema.name) {
3190
+ delete root[inputSchema.name];
3191
+ _result.name = inputSchema.name;
3192
+ }
3193
+ }
3194
+ return _result;
3195
+ }
3196
+ return compareSchema(root, asn1.result, inputSchema.primitiveSchema);
3197
+ }
3198
+ return {
3199
+ verified: true,
3200
+ result: root,
3201
+ };
3202
+ }
3203
+ function verifySchema(inputBuffer, inputSchema) {
3204
+ if ((inputSchema instanceof Object) === false) {
3205
+ return {
3206
+ verified: false,
3207
+ result: { error: "Wrong ASN.1 schema type" },
3208
+ };
3209
+ }
3210
+ const asn1 = localFromBER(pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer));
3211
+ if (asn1.offset === -1) {
3212
+ return {
3213
+ verified: false,
3214
+ result: asn1.result,
3215
+ };
3216
+ }
3217
+ return compareSchema(asn1.result, asn1.result, inputSchema);
3218
+ }
3219
+
3220
+ exports.Any = Any;
3221
+ exports.BaseBlock = BaseBlock;
3222
+ exports.BaseStringBlock = BaseStringBlock;
3223
+ exports.BitString = BitString;
3224
+ exports.BmpString = BmpString;
3225
+ exports.Boolean = Boolean;
3226
+ exports.CharacterString = CharacterString;
3227
+ exports.Choice = Choice;
3228
+ exports.Constructed = Constructed;
3229
+ exports.DATE = DATE;
3230
+ exports.DEFAULT_MAX_CONTENT_LENGTH = DEFAULT_MAX_CONTENT_LENGTH;
3231
+ exports.DEFAULT_MAX_DEPTH = DEFAULT_MAX_DEPTH;
3232
+ exports.DEFAULT_MAX_NODES = DEFAULT_MAX_NODES;
3233
+ exports.DateTime = DateTime;
3234
+ exports.Duration = Duration;
3235
+ exports.EndOfContent = EndOfContent;
3236
+ exports.Enumerated = Enumerated;
3237
+ exports.GeneralString = GeneralString;
3238
+ exports.GeneralizedTime = GeneralizedTime;
3239
+ exports.GraphicString = GraphicString;
3240
+ exports.HexBlock = HexBlock;
3241
+ exports.IA5String = IA5String;
3242
+ exports.Integer = Integer;
3243
+ exports.Null = Null;
3244
+ exports.NumericString = NumericString;
3245
+ exports.ObjectIdentifier = ObjectIdentifier;
3246
+ exports.OctetString = OctetString;
3247
+ exports.Primitive = Primitive;
3248
+ exports.PrintableString = PrintableString;
3249
+ exports.RawData = RawData;
3250
+ exports.RelativeObjectIdentifier = RelativeObjectIdentifier;
3251
+ exports.Repeated = Repeated;
3252
+ exports.Sequence = Sequence;
3253
+ exports.Set = Set;
3254
+ exports.TIME = TIME;
3255
+ exports.TeletexString = TeletexString;
3256
+ exports.TimeOfDay = TimeOfDay;
3257
+ exports.UTCTime = UTCTime;
3258
+ exports.UniversalString = UniversalString;
3259
+ exports.Utf8String = Utf8String;
3260
+ exports.ValueBlock = ValueBlock;
3261
+ exports.VideotexString = VideotexString;
3262
+ exports.ViewWriter = ViewWriter;
3263
+ exports.VisibleString = VisibleString;
3264
+ exports.compareSchema = compareSchema;
3265
+ exports.fromBER = fromBER;
3266
+ exports.verifySchema = verifySchema;