failproofai 1.0.13 → 1.0.15

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 (376) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +44 -44
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +6 -6
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js +2 -3
  8. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +6 -6
  16. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page.js +3 -4
  18. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.rsc +6 -6
  22. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +6 -6
  23. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  24. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  25. package/.next/standalone/.next/server/app/api/audit/invite/route.js +3 -4
  26. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/audit/run/route.js +22 -23
  28. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/audit/status/route.js +2 -3
  30. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/auth/login-request/route.js +4 -5
  32. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +4 -5
  34. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/auth/logout/route.js +4 -5
  36. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/auth/status/route.js +3 -4
  38. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +2 -3
  40. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/audit/page/build-manifest.json +6 -6
  42. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  43. package/.next/standalone/.next/server/app/audit/page.js +5 -6
  44. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/index.html +1 -1
  47. package/.next/standalone/.next/server/app/index.rsc +6 -6
  48. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  49. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +6 -6
  50. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  51. package/.next/standalone/.next/server/app/page/build-manifest.json +6 -6
  52. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  53. package/.next/standalone/.next/server/app/page.js +4 -5
  54. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +6 -6
  57. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  58. package/.next/standalone/.next/server/app/policies/page.js +4 -5
  59. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +6 -6
  62. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  63. package/.next/standalone/.next/server/app/project/[name]/page.js +20 -21
  64. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +6 -6
  67. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  68. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  69. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +8 -9
  70. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +6 -6
  73. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  74. package/.next/standalone/.next/server/app/projects/page.js +6 -7
  75. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/settings/page/build-manifest.json +6 -6
  78. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  79. package/.next/standalone/.next/server/app/settings/page.js +3 -4
  80. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1a2d0ewycsp6k._.js → [externals]__0h0p9dmv_e7r7._.js} +2 -2
  83. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__1am_1tz0o0aqz._.js → [externals]__1_407huhlmj1m._.js} +2 -2
  84. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__031qp1lkow_kc._.js → [externals]__1rlxpymm37wel._.js} +2 -2
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03s1za0hn71yp._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__048f1wnr8pysf._.js +63 -0
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07a0sa6fuw5_b._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-oi4gdtmlo5._.js +3 -0
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0spt0kv8azrpl._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yvyp5b7jmlc4._.js +1 -1
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__145vo_drnuvas._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1lh8c0mmhdrbj._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1oclamblhzhrf._.js +7 -7
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qjnp3fa0e5g3._.js +3 -0
  95. package/.next/standalone/.next/server/chunks/[turbopack]_runtime.js +7 -9
  96. package/.next/standalone/.next/server/chunks/_02sa8fcu9_9xo._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/_09dz7xva4ce_2._.js +18 -18
  98. package/.next/standalone/.next/server/chunks/_0hf5q4xzyg40j._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/_1-2owkp-1_987._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/_13ltj8a9z92o8._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/_15k37au70vjvg._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/_18rfu4__wjhwb._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/_19011-u44143j._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/_1ek68lnh2daur._.js +2 -2
  107. package/.next/standalone/.next/server/chunks/_1fz8m31sndkcu._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/_1ogwigfb0163w._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/_1vslkoe35wok6._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/lib_11qmqmccehybz._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/lib_1sezqnatvr8j-._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oigsgz07._.js +1 -2
  113. package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p77cu37y._.js +1 -2
  114. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/src_hooks_0_em82s16zfym._.js +2 -2
  116. package/.next/standalone/.next/server/chunks/ssr/[externals]__0ilfh9mfnzsth._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/ssr/[externals]__0ohnuzsaozaca._.js +3 -0
  118. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__097i34ct1o88x._.js → [externals]__12qr51qgrrt6o._.js} +2 -2
  119. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__021vebe-4il8s._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05-glpesefmmi._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0evgy902m9h5e._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ezoipo-r7_5k._.js +14 -0
  125. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h1jw32uvrhh0._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10v5cyxvj64j4._.js → [root-of-the-server]__0tfnj3v_mp6rv._.js} +1 -1
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-9s1nsw-5q8o._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15bi9em2xe0x2._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__20dt376-socef._.js → [root-of-the-server]__1e00l_e_8r_-g._.js} +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mc9-zlnh656_._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ob2uzmms1adf._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ed1zh4scn7-k._.js → [root-of-the-server]__1tq3x9i_3_860._.js} +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1utel1l1-u64v._.js +3 -0
  141. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vofkb2oq7p7e._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vxwetblyf8vp._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__2158020r_amn9._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/[turbopack]_runtime.js +7 -9
  145. package/.next/standalone/.next/server/chunks/ssr/_0-f9uotv7v2n9._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/_00e4_rvim31u_._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/_0bseae9u7g98r._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +2 -2
  149. package/.next/standalone/.next/server/chunks/ssr/_0ge1hz9485xpp._.js +3 -0
  150. package/.next/standalone/.next/server/chunks/ssr/_0kqw2_f1ywmpo._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/_0mouhaflye1ro._.js +1 -1
  152. package/.next/standalone/.next/server/chunks/ssr/_0ouu886szh6yj._.js +10 -10
  153. package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
  154. package/.next/standalone/.next/server/chunks/ssr/_0tfqha481f033._.js +2 -2
  155. package/.next/standalone/.next/server/chunks/ssr/_1_ozgifqv1ssi._.js +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/_1a516zcgtqius._.js +1 -1
  157. package/.next/standalone/.next/server/chunks/ssr/_1ddpc5gj57uuf._.js +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
  159. package/.next/standalone/.next/server/chunks/ssr/_1ew6ra24vt-ij._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/_1or8gixmrpv5i._.js +1 -1
  161. package/.next/standalone/.next/server/chunks/ssr/_1s8zk-upxzp00._.js +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/_1u9tpla2o6utw._.js +1 -1
  163. package/.next/standalone/.next/server/chunks/ssr/_1v4_ul3sj2lq_._.js +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/_1y3xzro8ca8t6._.js +1 -1
  165. package/.next/standalone/.next/server/chunks/ssr/_20hn4gn87nsjc._.js +1 -1
  166. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
  167. package/.next/standalone/.next/server/chunks/ssr/app_087bt9wus25zs._.js +1 -1
  168. package/.next/standalone/.next/server/chunks/ssr/app_0trz6ik19xz5_._.js +1 -1
  169. package/.next/standalone/.next/server/chunks/ssr/app_1fvisnppn1unv._.js +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/app_209u41o446my6._.js +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
  172. package/.next/standalone/.next/server/chunks/ssr/app_audit_0hku_y73ischw._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/lib_16jvhmthj_k3a._.js +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/node_modules_05vgn62--7c5e._.js +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/node_modules_0dad4au22rq0p._.js +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js +2 -2
  181. package/.next/standalone/.next/server/chunks/ssr/node_modules_0ptcnmeaxvd_a._.js +2 -2
  182. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_1cmkmhnty0-x7.js → node_modules_html-to-image_es_index_0e3yg5gbcfsai.js} +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_0bz67659f5z-3._.js +4 -4
  184. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0-amwqbrge23p._.js +6 -0
  185. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0ocrceo0c9psx._.js +4 -4
  186. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1alv566ojmz5j._.js +4 -4
  187. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1et9oq9q9-y3v._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1khq67j4vo9y4._.js +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j32_ibz4._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_shared_lib_0ftnv26hg1lry._.js +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dagmbznysrc2._.js +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js +1 -2
  193. package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
  194. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0-q0ummbuhlg5._.js +1 -1
  195. package/.next/standalone/.next/server/chunks/ssr/src_hooks_06kzv9ddabn3_._.js +2 -2
  196. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0agdmptetetdt._.js +2 -2
  197. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0g194syq7r7ql._.js +1 -1
  198. package/.next/standalone/.next/server/chunks/ssr/src_hooks_0mdwgjisv4fub._.js +2 -2
  199. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1cv9_c4l1tzrm._.js +2 -2
  200. package/.next/standalone/.next/server/chunks/ssr/src_hooks_1kx9e0dx_1-8o._.js +1 -1
  201. package/.next/standalone/.next/server/middleware-build-manifest.js +44 -44
  202. package/.next/standalone/.next/server/pages/404.html +1 -1
  203. package/.next/standalone/.next/server/pages/500.html +1 -1
  204. package/.next/standalone/.next/server/preview-props.json +3 -3
  205. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  206. package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
  207. package/.next/standalone/.next/static/chunks/05g1pu2r8o5q3.js +1 -0
  208. package/.next/standalone/.next/static/chunks/{0mm-e5t9denbu.js → 098vx6twrn-vk.js} +1 -1
  209. package/.next/standalone/.next/static/chunks/0oxlfb02aqo3e.js +1 -0
  210. package/.next/standalone/.next/static/chunks/0p14j2e6dnj1x.js +1 -0
  211. package/.next/standalone/.next/static/chunks/0tiuj32d-qcy3.js +1 -0
  212. package/.next/standalone/.next/static/chunks/0ztuix-ip2oiv.js +1 -0
  213. package/.next/standalone/.next/static/chunks/12ys9uaq6i1h2.js +6 -0
  214. package/.next/standalone/.next/static/chunks/1dudxmlwx2n3q.js +1 -0
  215. package/.next/standalone/.next/static/chunks/1i9zuw01f0ogt.js +22 -0
  216. package/.next/standalone/.next/static/chunks/1osrmi14e2jub.js +1 -0
  217. package/.next/standalone/.next/static/chunks/2hqfk_jgesiw2.js +1 -0
  218. package/.next/standalone/.next/static/chunks/2k6xp6kdy7lmd.js +1 -0
  219. package/.next/standalone/.next/static/chunks/2o8j51ujh1ox4.js +1 -0
  220. package/.next/standalone/.next/static/chunks/2zwsbp8xyfv__.js +1 -0
  221. package/.next/standalone/.next/static/chunks/34rjkinfk6d4p.js +31 -0
  222. package/.next/standalone/.next/static/chunks/38lnk75xvqiug.js +1 -0
  223. package/.next/standalone/.next/static/chunks/{1-0se0uwja_ny.js → 3d6_vjbvr0c2n.js} +1 -1
  224. package/.next/standalone/.next/static/chunks/3i_9ugyh1q1o1.js +1 -0
  225. package/.next/standalone/.next/static/chunks/3o30fiw7llng3.js +1 -0
  226. package/.next/standalone/.next/static/chunks/41ujrab732qi3.css +2 -0
  227. package/.next/standalone/.next/static/chunks/436g_rqa42mr7.js +1 -0
  228. package/.next/standalone/.next/static/chunks/436nql0jk__xy.js +1 -0
  229. package/.next/standalone/.next/static/chunks/{turbopack-3-ry682tkyiqk.js → turbopack-2u1d16houkiyo.js} +1 -1
  230. package/.next/standalone/SECURITY.md +19 -4
  231. package/.next/standalone/assets/logos/failproof-dark.png +0 -0
  232. package/.next/standalone/assets/logos/failproof-light.png +0 -0
  233. package/.next/standalone/fp-cloud-cli/CHANGELOG.md +34 -3
  234. package/.next/standalone/fp-cloud-cli/README.md +14 -7
  235. package/.next/standalone/fp-cloud-cli/fp_cli/_version.py +1 -1
  236. package/.next/standalone/fp-cloud-cli/fp_cli/app.py +2 -8
  237. package/.next/standalone/fp-cloud-cli/fp_cli/auth.py +325 -3
  238. package/.next/standalone/fp-cloud-cli/fp_cli/cloud_output.py +3 -3
  239. package/.next/standalone/fp-cloud-cli/fp_cli/commands/account_cmds.py +1 -11
  240. package/.next/standalone/fp-cloud-cli/fp_cli/commands/auth_cmds.py +218 -51
  241. package/.next/standalone/fp-cloud-cli/fp_cli/commands/orgs_cmds.py +1 -1
  242. package/.next/standalone/fp-cloud-cli/fp_cli/output.py +112 -135
  243. package/.next/standalone/fp-cloud-cli/fp_cli/permissions.py +10 -1
  244. package/.next/standalone/fp-cloud-cli/fp_cli/select.py +85 -6
  245. package/.next/standalone/fp-cloud-cli/fp_cli/theme.py +21 -21
  246. package/.next/standalone/fp-cloud-cli/pyproject.toml +1 -1
  247. package/.next/standalone/fp-cloud-cli/skill/SKILL.md +4 -4
  248. package/.next/standalone/fp-cloud-cli/skill/references/commands.md +4 -4
  249. package/.next/standalone/fp-cloud-cli/tests/fake_cloud_smoke.py +2 -2
  250. package/.next/standalone/fp-cloud-cli/tests/test_browser_login.py +943 -0
  251. package/.next/standalone/fp-cloud-cli/tests/test_cloud_account.py +0 -2
  252. package/.next/standalone/fp-cloud-cli/tests/test_cloud_agent.py +4 -8
  253. package/.next/standalone/fp-cloud-cli/tests/test_cloud_human_views.py +0 -4
  254. package/.next/standalone/fp-cloud-cli/tests/test_commands.py +3 -3
  255. package/.next/standalone/fp-cloud-cli/tests/test_dashboards_agent.py +3 -3
  256. package/.next/standalone/fp-cloud-cli/tests/test_facets.py +1 -1
  257. package/.next/standalone/fp-cloud-cli/tests/test_keys_queries.py +19 -2
  258. package/.next/standalone/fp-cloud-cli/tests/test_operator.py +1 -1
  259. package/.next/standalone/fp-cloud-cli/tests/test_orgs.py +1 -1
  260. package/.next/standalone/fp-cloud-cli/tests/test_output.py +19 -19
  261. package/.next/standalone/fp-cloud-cli/tests/test_round4_behaviour.py +3 -2
  262. package/.next/standalone/fp-cloud-cli/tests/test_screen_language.py +86 -25
  263. package/.next/standalone/fp-cloud-cli/tests/test_whoami.py +1 -1
  264. package/.next/standalone/fp-cloud-cli/uv.lock +200 -13
  265. package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
  266. package/.next/standalone/node_modules/@next/env/package.json +1 -1
  267. package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
  268. package/.next/standalone/node_modules/next/dist/compiled/fast-jwt/index.js +3 -0
  269. package/.next/standalone/node_modules/next/dist/compiled/fast-jwt/package.json +1 -0
  270. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +23 -23
  271. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +23 -23
  272. package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +1 -1
  273. package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +7 -7
  274. package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  275. package/.next/standalone/node_modules/next/dist/server/api-utils/node/api-resolver.js +8 -5
  276. package/.next/standalone/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +8 -2
  277. package/.next/standalone/node_modules/next/dist/server/app-render/app-render.js +52 -14
  278. package/.next/standalone/node_modules/next/dist/server/app-render/async-local-storage.js +1 -1
  279. package/.next/standalone/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +19 -3
  280. package/.next/standalone/node_modules/next/dist/server/app-render/turbopack-bootstrap-script.js +50 -0
  281. package/.next/standalone/node_modules/next/dist/server/base-http/node.js +7 -2
  282. package/.next/standalone/node_modules/next/dist/server/base-server.js +8 -0
  283. package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
  284. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +59 -10
  285. package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  286. package/.next/standalone/node_modules/next/dist/server/dev/turbopack-utils.js +15 -0
  287. package/.next/standalone/node_modules/next/dist/server/image-optimizer/detect-content-type.js +24 -20
  288. package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  289. package/.next/standalone/node_modules/next/dist/server/lib/dev-bundler-service.js +3 -0
  290. package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +1 -1
  291. package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
  292. package/.next/standalone/node_modules/next/dist/server/lib/trace/tracer.js +1 -1
  293. package/.next/standalone/node_modules/next/dist/server/next-server.js +10 -2
  294. package/.next/standalone/node_modules/next/dist/server/render.js +2 -2
  295. package/.next/standalone/node_modules/next/dist/server/route-modules/app-page/parse-request-headers.js +1 -2
  296. package/.next/standalone/node_modules/next/dist/server/send-response.js +12 -0
  297. package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +69 -6
  298. package/.next/standalone/node_modules/next/dist/server/web/adapter.js +5 -1
  299. package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  300. package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  301. package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
  302. package/.next/standalone/node_modules/next/package.json +10 -10
  303. package/.next/standalone/package.json +12 -12
  304. package/.next/standalone/sdk/python/skill/SKILL.md +5 -0
  305. package/.next/standalone/sdk/python/uv.lock +79 -47
  306. package/.next/standalone/sdk/typescript/CHANGELOG.md +48 -5
  307. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package-lock.json +0 -9
  308. package/.next/standalone/sdk/typescript/integration/fixtures/langchain-dup-core/package.json +2 -1
  309. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package-lock.json +72 -44
  310. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.11/package.json +2 -1
  311. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/package-lock.json +72 -44
  312. package/.next/standalone/sdk/typescript/integration/fixtures/llamaindex-0.12/package.json +3 -0
  313. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package-lock.json +18 -332
  314. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package.json +4 -2
  315. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package-lock.json +925 -296
  316. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-1/package.json +3 -8
  317. package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package-lock.json +319 -317
  318. package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package.json +3 -3
  319. package/.next/standalone/server.js +1 -1
  320. package/README.md +174 -83
  321. package/dist/cli.mjs +23 -13
  322. package/dist/worker.mjs +1 -1
  323. package/hermes-plugin/plugin.yaml +1 -1
  324. package/openclaw-plugin/daemon-client.js +95 -26
  325. package/openclaw-plugin/hooks.js +4 -1
  326. package/package.json +12 -12
  327. package/src/hooks/delivery-health.ts +11 -1
  328. package/.next/standalone/.next/server/chunks/[root-of-the-server]__038kwryp970nh._.js +0 -3
  329. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08atcie7jzswm._.js +0 -3
  330. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0car70pylmvor._.js +0 -3
  331. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1j6kfp0vzu5rw._.js +0 -3
  332. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1l0ayum_hqqsw._.js +0 -3
  333. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1o9rznwc0w7og._.js +0 -3
  334. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1v1-l-83czzsr._.js +0 -63
  335. package/.next/standalone/.next/server/chunks/node_modules_@opentelemetry_api_build_esm_index_0oo58a7rymoxh.js +0 -3
  336. package/.next/standalone/.next/server/chunks/node_modules_@opentelemetry_api_build_esm_index_1jp9ij0_ddtgk.js +0 -3
  337. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__075uro8t92s0_._.js +0 -14
  338. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0alpzjn3450sr._.js +0 -3
  339. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0aup10z2o8zc1._.js +0 -3
  340. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bioghlkjf7s7._.js +0 -3
  341. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nhm28v58ty9z._.js +0 -3
  342. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vse4qi496ol-._.js +0 -3
  343. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__190xwrr5zrfi3._.js +0 -3
  344. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1guwlpkyurdn9._.js +0 -3
  345. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1jq2bh84rafc7._.js +0 -3
  346. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1k96jctukf65_._.js +0 -3
  347. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1sj-wn2jp6va5._.js +0 -3
  348. package/.next/standalone/.next/server/chunks/ssr/_100nvr7rei3us._.js +0 -3
  349. package/.next/standalone/.next/server/chunks/ssr/node_modules_@opentelemetry_api_build_esm_index_0ntwr8lzj6p2i.js +0 -3
  350. package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +0 -6
  351. package/.next/standalone/.next/static/chunks/0rucj5pu307i4.js +0 -1
  352. package/.next/standalone/.next/static/chunks/1024g0jaymm46.js +0 -1
  353. package/.next/standalone/.next/static/chunks/165ezyyx0j1ft.js +0 -22
  354. package/.next/standalone/.next/static/chunks/173vw1xs-5m5g.js +0 -1
  355. package/.next/standalone/.next/static/chunks/20cme7d6wv6md.js +0 -1
  356. package/.next/standalone/.next/static/chunks/26c4gmdpsthv6.css +0 -2
  357. package/.next/standalone/.next/static/chunks/2_sj5ssr_m_wm.js +0 -1
  358. package/.next/standalone/.next/static/chunks/2mz-k_jt_76xt.js +0 -1
  359. package/.next/standalone/.next/static/chunks/2ojf3r8g4tn7s.js +0 -1
  360. package/.next/standalone/.next/static/chunks/2tjfp9dirxnku.js +0 -1
  361. package/.next/standalone/.next/static/chunks/2u1m0f-wnhz44.js +0 -1
  362. package/.next/standalone/.next/static/chunks/2ytnb83xmjn3u.js +0 -1
  363. package/.next/standalone/.next/static/chunks/2zyrjasvbmwpq.js +0 -1
  364. package/.next/standalone/.next/static/chunks/31fan-ze541d1.js +0 -1
  365. package/.next/standalone/.next/static/chunks/32s3y34p0t2pe.js +0 -1
  366. package/.next/standalone/.next/static/chunks/36re0fegaocq-.js +0 -1
  367. package/.next/standalone/.next/static/chunks/3fhk60ouw_ae6.js +0 -1
  368. package/.next/standalone/.next/static/chunks/3xgxl1s_in776.js +0 -31
  369. package/.next/standalone/.next/static/chunks/40g_e46c1-j4k.js +0 -6
  370. package/.next/standalone/.next/static/chunks/44yz8zx53euy1.js +0 -1
  371. package/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/index.js +0 -11
  372. package/.next/standalone/node_modules/next/dist/compiled/jsonwebtoken/package.json +0 -1
  373. package/.next/standalone/node_modules/next/dist/lib/semver-noop.js +0 -18
  374. /package/.next/standalone/.next/static/{4MgI0mZP1iVhhocpUivMm → -AugwIGiiIYcahO4J7mdM}/_buildManifest.js +0 -0
  375. /package/.next/standalone/.next/static/{4MgI0mZP1iVhhocpUivMm → -AugwIGiiIYcahO4J7mdM}/_clientMiddlewareManifest.js +0 -0
  376. /package/.next/standalone/.next/static/{4MgI0mZP1iVhhocpUivMm → -AugwIGiiIYcahO4J7mdM}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ (()=>{var e={4332:(e,t)=>{var r=/^(-?(?:\d+)?\.?\d+) *(m(?:illiseconds?|s(?:ecs?)?))?(s(?:ec(?:onds?|s)?)?)?(m(?:in(?:utes?|s)?)?)?(h(?:ours?|rs?)?)?(d(?:ays?)?)?(w(?:eeks?|ks?)?)?(y(?:ears?|rs?)?)?$/,i=1e3,n=i*60,o=n*60,s=o*24,a=s*365.25;function parse(e){var t,u=e.toLowerCase().match(r);if(u!=null&&(t=parseFloat(u[1]))){if(u[3]!=null)return t*i;if(u[4]!=null)return t*n;if(u[5]!=null)return t*o;if(u[6]!=null)return t*s;if(u[7]!=null)return t*s*7;if(u[8]!=null)return t*a;return t}}function fmt(e,t,r,i){var n=(e|0)===e?e:~~(e+.5);return t+n+(i?" "+r+(n!=1?"s":""):r[0])}function format(e,t){var r=e<0?"-":"",u=e<0?-e:e;if(u<i)return e+(t?" ms":"ms");if(u<n)return fmt(u/i,r,"second",t);if(u<o)return fmt(u/n,r,"minute",t);if(u<s)return fmt(u/o,r,"hour",t);if(u<a)return fmt(u/s,r,"day",t);return fmt(u/a,r,"year",t)}t.format=format;t.parse=parse},4782:(e,t,r)=>{"use strict";const i=t;i.bignum=r(5944);i.define=r(7773).define;i.base=r(8879);i.constants=r(4699);i.decoders=r(5451);i.encoders=r(7655)},7773:(e,t,r)=>{"use strict";const i=r(7655);const n=r(5451);const o=r(8013);const s=t;s.define=function define(e,t){return new Entity(e,t)};function Entity(e,t){this.name=e;this.body=t;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(e){const t=this.name;function Generated(e){this._initNamed(e,t)}o(Generated,e);Generated.prototype._initNamed=function _initNamed(t,r){e.call(this,t,r)};return new Generated(this)};Entity.prototype._getDecoder=function _getDecoder(e){e=e||"der";if(!this.decoders.hasOwnProperty(e))this.decoders[e]=this._createNamed(n[e]);return this.decoders[e]};Entity.prototype.decode=function decode(e,t,r){return this._getDecoder(t).decode(e,r)};Entity.prototype._getEncoder=function _getEncoder(e){e=e||"der";if(!this.encoders.hasOwnProperty(e))this.encoders[e]=this._createNamed(i[e]);return this.encoders[e]};Entity.prototype.encode=function encode(e,t,r){return this._getEncoder(t).encode(e,r)}},2761:(e,t,r)=>{"use strict";const i=r(8013);const n=r(8570).a;const o=r(9381).Buffer;function DecoderBuffer(e,t){n.call(this,t);if(!o.isBuffer(e)){this.error("Input not Buffer");return}this.base=e;this.offset=0;this.length=e.length}i(DecoderBuffer,n);t.t=DecoderBuffer;DecoderBuffer.isDecoderBuffer=function isDecoderBuffer(e){if(e instanceof DecoderBuffer){return true}const t=typeof e==="object"&&o.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset==="number"&&typeof e.length==="number"&&typeof e.save==="function"&&typeof e.restore==="function"&&typeof e.isEmpty==="function"&&typeof e.readUInt8==="function"&&typeof e.skip==="function"&&typeof e.raw==="function";return t};DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:n.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(e){const t=new DecoderBuffer(this.base);t.offset=e.offset;t.length=this.offset;this.offset=e.offset;n.prototype.restore.call(this,e.reporter);return t};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(e){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(e||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new DecoderBuffer(this.base);r._reporterState=this._reporterState;r.offset=this.offset;r.length=this.offset+e;this.offset+=e;return r};DecoderBuffer.prototype.raw=function raw(e){return this.base.slice(e?e.offset:this.offset,this.length)};function EncoderBuffer(e,t){if(Array.isArray(e)){this.length=0;this.value=e.map((function(e){if(!EncoderBuffer.isEncoderBuffer(e))e=new EncoderBuffer(e,t);this.length+=e.length;return e}),this)}else if(typeof e==="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e;this.length=1}else if(typeof e==="string"){this.value=e;this.length=o.byteLength(e)}else if(o.isBuffer(e)){this.value=e;this.length=e.length}else{return t.error("Unsupported type: "+typeof e)}}t.d=EncoderBuffer;EncoderBuffer.isEncoderBuffer=function isEncoderBuffer(e){if(e instanceof EncoderBuffer){return true}const t=typeof e==="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length==="number"&&typeof e.join==="function";return t};EncoderBuffer.prototype.join=function join(e,t){if(!e)e=o.alloc(this.length);if(!t)t=0;if(this.length===0)return e;if(Array.isArray(this.value)){this.value.forEach((function(r){r.join(e,t);t+=r.length}))}else{if(typeof this.value==="number")e[t]=this.value;else if(typeof this.value==="string")e.write(this.value,t);else if(o.isBuffer(this.value))this.value.copy(e,t);t+=this.length}return e}},8879:(e,t,r)=>{"use strict";const i=t;i.Reporter=r(8570).a;i.DecoderBuffer=r(2761).t;i.EncoderBuffer=r(2761).d;i.Node=r(7903)},7903:(e,t,r)=>{"use strict";const i=r(8570).a;const n=r(2761).d;const o=r(2761).t;const s=r(7551);const a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"];const u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);const l=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(e,t,r){const i={};this._baseState=i;i.name=r;i.enc=e;i.parent=t||null;i.children=null;i.tag=null;i.args=null;i.reverseArgs=null;i.choice=null;i.optional=false;i.any=false;i.obj=false;i.use=null;i.useDecoder=null;i.key=null;i["default"]=null;i.explicit=null;i.implicit=null;i.contains=null;if(!i.parent){i.children=[];this._wrap()}}e.exports=Node;const h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){const e=this._baseState;const t={};h.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);r._baseState=t;return r};Node.prototype._wrap=function wrap(){const e=this._baseState;u.forEach((function(t){this[t]=function _wrappedMethod(){const r=new this.constructor(this);e.children.push(r);return r[t].apply(r,arguments)}}),this)};Node.prototype._init=function init(e){const t=this._baseState;s(t.parent===null);e.call(this);t.children=t.children.filter((function(e){return e._baseState.parent===this}),this);s.equal(t.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(e){const t=this._baseState;const r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this);if(r.length!==0){s(t.children===null);t.children=r;r.forEach((function(e){e._baseState.parent=this}),this)}if(e.length!==0){s(t.args===null);t.args=e;t.reverseArgs=e.map((function(e){if(typeof e!=="object"||e.constructor!==Object)return e;const t={};Object.keys(e).forEach((function(r){if(r==(r|0))r|=0;const i=e[r];t[i]=r}));return t}))}};l.forEach((function(e){Node.prototype[e]=function _overrided(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}));a.forEach((function(e){Node.prototype[e]=function _tagMethod(){const t=this._baseState;const r=Array.prototype.slice.call(arguments);s(t.tag===null);t.tag=e;this._useArgs(r);return this}}));Node.prototype.use=function use(e){s(e);const t=this._baseState;s(t.use===null);t.use=e;return this};Node.prototype.optional=function optional(){const e=this._baseState;e.optional=true;return this};Node.prototype.def=function def(e){const t=this._baseState;s(t["default"]===null);t["default"]=e;t.optional=true;return this};Node.prototype.explicit=function explicit(e){const t=this._baseState;s(t.explicit===null&&t.implicit===null);t.explicit=e;return this};Node.prototype.implicit=function implicit(e){const t=this._baseState;s(t.explicit===null&&t.implicit===null);t.implicit=e;return this};Node.prototype.obj=function obj(){const e=this._baseState;const t=Array.prototype.slice.call(arguments);e.obj=true;if(t.length!==0)this._useArgs(t);return this};Node.prototype.key=function key(e){const t=this._baseState;s(t.key===null);t.key=e;return this};Node.prototype.any=function any(){const e=this._baseState;e.any=true;return this};Node.prototype.choice=function choice(e){const t=this._baseState;s(t.choice===null);t.choice=e;this._useArgs(Object.keys(e).map((function(t){return e[t]})));return this};Node.prototype.contains=function contains(e){const t=this._baseState;s(t.use===null);t.contains=e;return this};Node.prototype._decode=function decode(e,t){const r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));let i=r["default"];let n=true;let s=null;if(r.key!==null)s=e.enterKey(r.key);if(r.optional){let i=null;if(r.explicit!==null)i=r.explicit;else if(r.implicit!==null)i=r.implicit;else if(r.tag!==null)i=r.tag;if(i===null&&!r.any){const i=e.save();try{if(r.choice===null)this._decodeGeneric(r.tag,e,t);else this._decodeChoice(e,t);n=true}catch(e){n=false}e.restore(i)}else{n=this._peekTag(e,i,r.any);if(e.isError(n))return n}}let a;if(r.obj&&n)a=e.enterObject();if(n){if(r.explicit!==null){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(r.use===null&&r.choice===null){let t;if(r.any)t=e.save();const n=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(n))return n;if(r.any)i=e.raw(t);else e=n}if(t&&t.track&&r.tag!==null)t.track(e.path(),n,e.length,"tagged");if(t&&t.track&&r.tag!==null)t.track(e.path(),e.offset,e.length,"content");if(r.any){}else if(r.choice===null){i=this._decodeGeneric(r.tag,e,t)}else{i=this._decodeChoice(e,t)}if(e.isError(i))return i;if(!r.any&&r.choice===null&&r.children!==null){r.children.forEach((function decodeChildren(r){r._decode(e,t)}))}if(r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){const n=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}if(r.obj&&n)i=e.leaveObject(a);if(r.key!==null&&(i!==null||n===true))e.leaveKey(s,r.key,i);else if(s!==null)e.exitKey(s);return i};Node.prototype._decodeGeneric=function decodeGeneric(e,t,r){const i=this._baseState;if(e==="seq"||e==="set")return null;if(e==="seqof"||e==="setof")return this._decodeList(t,e,i.args[0],r);else if(/str$/.test(e))return this._decodeStr(t,e,r);else if(e==="objid"&&i.args)return this._decodeObjid(t,i.args[0],i.args[1],r);else if(e==="objid")return this._decodeObjid(t,null,null,r);else if(e==="gentime"||e==="utctime")return this._decodeTime(t,e,r);else if(e==="null_")return this._decodeNull(t,r);else if(e==="bool")return this._decodeBool(t,r);else if(e==="objDesc")return this._decodeStr(t,e,r);else if(e==="int"||e==="enum")return this._decodeInt(t,i.args&&i.args[0],r);if(i.use!==null){return this._getUse(i.use,t._reporterState.obj)._decode(t,r)}else{return t.error("unknown tag: "+e)}};Node.prototype._getUse=function _getUse(e,t){const r=this._baseState;r.useDecoder=this._use(e,t);s(r.useDecoder._baseState.parent===null);r.useDecoder=r.useDecoder._baseState.children[0];if(r.implicit!==r.useDecoder._baseState.implicit){r.useDecoder=r.useDecoder.clone();r.useDecoder._baseState.implicit=r.implicit}return r.useDecoder};Node.prototype._decodeChoice=function decodeChoice(e,t){const r=this._baseState;let i=null;let n=false;Object.keys(r.choice).some((function(o){const s=e.save();const a=r.choice[o];try{const r=a._decode(e,t);if(e.isError(r))return false;i={type:o,value:r};n=true}catch(t){e.restore(s);return false}return true}),this);if(!n)return e.error("Choice not matched");return i};Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new n(e,this.reporter)};Node.prototype._encode=function encode(e,t,r){const i=this._baseState;if(i["default"]!==null&&i["default"]===e)return;const n=this._encodeValue(e,t,r);if(n===undefined)return;if(this._skipDefault(n,t,r))return;return n};Node.prototype._encodeValue=function encode(e,t,r){const n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new i);let o=null;this.reporter=t;if(n.optional&&e===undefined){if(n["default"]!==null)e=n["default"];else return}let s=null;let a=false;if(n.any){o=this._createEncoderBuffer(e)}else if(n.choice){o=this._encodeChoice(e,t)}else if(n.contains){s=this._getUse(n.contains,r)._encode(e,t);a=true}else if(n.children){s=n.children.map((function(r){if(r._baseState.tag==="null_")return r._encode(null,t,e);if(r._baseState.key===null)return t.error("Child should have a key");const i=t.enterKey(r._baseState.key);if(typeof e!=="object")return t.error("Child expected, but input is not object");const n=r._encode(e[r._baseState.key],t,e);t.leaveKey(i);return n}),this).filter((function(e){return e}));s=this._createEncoderBuffer(s)}else{if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null;s=this._createEncoderBuffer(e.map((function(r){const i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)}),r))}else if(n.use!==null){o=this._getUse(n.use,r)._encode(e,t)}else{s=this._encodePrimitive(n.tag,e);a=true}}if(!n.any&&n.choice===null){const e=n.implicit!==null?n.implicit:n.tag;const r=n.implicit===null?"universal":"context";if(e===null){if(n.use===null)t.error("Tag could be omitted only for .use()")}else{if(n.use===null)o=this._encodeComposite(e,a,r,s)}}if(n.explicit!==null)o=this._encodeComposite(n.explicit,false,"context",o);return o};Node.prototype._encodeChoice=function encodeChoice(e,t){const r=this._baseState;const i=r.choice[e.type];if(!i){s(false,e.type+" not found in "+JSON.stringify(Object.keys(r.choice)))}return i._encode(e.value,t)};Node.prototype._encodePrimitive=function encodePrimitive(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);else if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);else if(e==="objid")return this._encodeObjid(t,null,null);else if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);else if(e==="null_")return this._encodeNull();else if(e==="int"||e==="enum")return this._encodeInt(t,r.args&&r.reverseArgs[0]);else if(e==="bool")return this._encodeBool(t);else if(e==="objDesc")return this._encodeStr(t,e);else throw new Error("Unsupported tag: "+e)};Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)};Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},8570:(e,t,r)=>{"use strict";const i=r(8013);function Reporter(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}t.a=Reporter;Reporter.prototype.isError=function isError(e){return e instanceof ReporterError};Reporter.prototype.save=function save(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Reporter.prototype.restore=function restore(e){const t=this._reporterState;t.obj=e.obj;t.path=t.path.slice(0,e.pathLen)};Reporter.prototype.enterKey=function enterKey(e){return this._reporterState.path.push(e)};Reporter.prototype.exitKey=function exitKey(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)};Reporter.prototype.leaveKey=function leaveKey(e,t,r){const i=this._reporterState;this.exitKey(e);if(i.obj!==null)i.obj[t]=r};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){const e=this._reporterState;const t=e.obj;e.obj={};return t};Reporter.prototype.leaveObject=function leaveObject(e){const t=this._reporterState;const r=t.obj;t.obj=e;return r};Reporter.prototype.error=function error(e){let t;const r=this._reporterState;const i=e instanceof ReporterError;if(i){t=e}else{t=new ReporterError(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack)}if(!r.options.partial)throw t;if(!i)r.errors.push(t);return t};Reporter.prototype.wrapResult=function wrapResult(e){const t=this._reporterState;if(!t.options.partial)return e;return{result:this.isError(e)?null:e,errors:t.errors}};function ReporterError(e,t){this.path=e;this.rethrow(t)}i(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(e){this.message=e+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(e){this.stack=e.stack}}return this}},6416:(e,t)=>{"use strict";function reverse(e){const t={};Object.keys(e).forEach((function(r){if((r|0)==r)r=r|0;const i=e[r];t[i]=r}));return t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"};t.tagClassByName=reverse(t.tagClass);t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};t.tagByName=reverse(t.tag)},4699:(e,t,r)=>{"use strict";const i=t;i._reverse=function reverse(e){const t={};Object.keys(e).forEach((function(r){if((r|0)==r)r=r|0;const i=e[r];t[i]=r}));return t};i.der=r(6416)},9344:(e,t,r)=>{"use strict";const i=r(8013);const n=r(5944);const o=r(2761).t;const s=r(7903);const a=r(6416);function DERDecoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DERDecoder;DERDecoder.prototype.decode=function decode(e,t){if(!o.isDecoderBuffer(e)){e=new o(e,t)}return this.tree._decode(e,t)};function DERNode(e){s.call(this,"der",e)}i(DERNode,s);DERNode.prototype._peekTag=function peekTag(e,t,r){if(e.isEmpty())return false;const i=e.save();const n=derDecodeTag(e,'Failed to peek tag: "'+t+'"');if(e.isError(n))return n;e.restore(i);return n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r};DERNode.prototype._decodeTag=function decodeTag(e,t,r){const i=derDecodeTag(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let n=derDecodeLen(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t){return e.error('Failed to match tag: "'+t+'"')}if(i.primitive||n!==null)return e.skip(n,'Failed to match body of: "'+t+'"');const o=e.save();const s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(s))return s;n=e.offset-o.offset;e.restore(o);return e.skip(n,'Failed to match body of: "'+t+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(e,t){for(;;){const r=derDecodeTag(e,t);if(e.isError(r))return r;const i=derDecodeLen(e,r.primitive,t);if(e.isError(i))return i;let n;if(r.primitive||i!==null)n=e.skip(i);else n=this._skipUntilEnd(e,t);if(e.isError(n))return n;if(r.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(e,t,r,i){const n=[];while(!e.isEmpty()){const t=this._peekTag(e,"end");if(e.isError(t))return t;const o=r.decode(e,"der",i);if(e.isError(o)&&t)break;n.push(o)}return n};DERNode.prototype._decodeStr=function decodeStr(e,t){if(t==="bitstr"){const t=e.readUInt8();if(e.isError(t))return t;return{unused:t,data:e.raw()}}else if(t==="bmpstr"){const t=e.raw();if(t.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++){r+=String.fromCharCode(t.readUInt16BE(e*2))}return r}else if(t==="numstr"){const t=e.raw().toString("ascii");if(!this._isNumstr(t)){return e.error("Decoding of string type: "+"numstr unsupported characters")}return t}else if(t==="octstr"){return e.raw()}else if(t==="objDesc"){return e.raw()}else if(t==="printstr"){const t=e.raw().toString("ascii");if(!this._isPrintstr(t)){return e.error("Decoding of string type: "+"printstr unsupported characters")}return t}else if(/str$/.test(t)){return e.raw().toString()}else{return e.error("Decoding of string type: "+t+" unsupported")}};DERNode.prototype._decodeObjid=function decodeObjid(e,t,r){let i;const n=[];let o=0;let s=0;while(!e.isEmpty()){s=e.readUInt8();o<<=7;o|=s&127;if((s&128)===0){n.push(o);o=0}}if(s&128)n.push(o);const a=n[0]/40|0;const u=n[0]%40;if(r)i=n;else i=[a,u].concat(n.slice(1));if(t){let e=t[i.join(" ")];if(e===undefined)e=t[i.join(".")];if(e!==undefined)i=e}return i};DERNode.prototype._decodeTime=function decodeTime(e,t){const r=e.raw().toString();let i;let n;let o;let s;let a;let u;if(t==="gentime"){i=r.slice(0,4)|0;n=r.slice(4,6)|0;o=r.slice(6,8)|0;s=r.slice(8,10)|0;a=r.slice(10,12)|0;u=r.slice(12,14)|0}else if(t==="utctime"){i=r.slice(0,2)|0;n=r.slice(2,4)|0;o=r.slice(4,6)|0;s=r.slice(6,8)|0;a=r.slice(8,10)|0;u=r.slice(10,12)|0;if(i<70)i=2e3+i;else i=1900+i}else{return e.error("Decoding "+t+" time is not supported yet")}return Date.UTC(i,n-1,o,s,a,u,0)};DERNode.prototype._decodeNull=function decodeNull(){return null};DERNode.prototype._decodeBool=function decodeBool(e){const t=e.readUInt8();if(e.isError(t))return t;else return t!==0};DERNode.prototype._decodeInt=function decodeInt(e,t){const r=e.raw();let i=new n(r);if(t)i=t[i.toString(10)]||i;return i};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getDecoder("der").tree};function derDecodeTag(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const i=a.tagClass[r>>6];const n=(r&32)===0;if((r&31)===31){let i=r;r=0;while((i&128)===128){i=e.readUInt8(t);if(e.isError(i))return i;r<<=7;r|=i&127}}else{r&=31}const o=a.tag[r];return{cls:i,primitive:n,tag:r,tagStr:o}}function derDecodeLen(e,t,r){let i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&i===128)return null;if((i&128)===0){return i}const n=i&127;if(n>4)return e.error("length octect is too long");i=0;for(let t=0;t<n;t++){i<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;i|=t}return i}},5451:(e,t,r)=>{"use strict";const i=t;i.der=r(9344);i.pem=r(8881)},8881:(e,t,r)=>{"use strict";const i=r(8013);const n=r(9381).Buffer;const o=r(9344);function PEMDecoder(e){o.call(this,e);this.enc="pem"}i(PEMDecoder,o);e.exports=PEMDecoder;PEMDecoder.prototype.decode=function decode(e,t){const r=e.toString().split(/[\r\n]+/g);const i=t.label.toUpperCase();const s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1;let u=-1;for(let e=0;e<r.length;e++){const t=r[e].match(s);if(t===null)continue;if(t[2]!==i)continue;if(a===-1){if(t[1]!=="BEGIN")break;a=e}else{if(t[1]!=="END")break;u=e;break}}if(a===-1||u===-1)throw new Error("PEM section not found for: "+i);const l=r.slice(a+1,u).join("");l.replace(/[^a-z0-9+/=]+/gi,"");const h=n.from(l,"base64");return o.prototype.decode.call(this,h,t)}},1268:(e,t,r)=>{"use strict";const i=r(8013);const n=r(9381).Buffer;const o=r(7903);const s=r(6416);function DEREncoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DEREncoder;DEREncoder.prototype.encode=function encode(e,t){return this.tree._encode(e,t).join()};function DERNode(e){o.call(this,"der",e)}i(DERNode,o);DERNode.prototype._encodeComposite=function encodeComposite(e,t,r,i){const o=encodeTag(e,t,r,this.reporter);if(i.length<128){const e=n.alloc(2);e[0]=o;e[1]=i.length;return this._createEncoderBuffer([e,i])}let s=1;for(let e=i.length;e>=256;e>>=8)s++;const a=n.alloc(1+1+s);a[0]=o;a[1]=128|s;for(let e=1+s,t=i.length;t>0;e--,t>>=8)a[e]=t&255;return this._createEncoderBuffer([a,i])};DERNode.prototype._encodeStr=function encodeStr(e,t){if(t==="bitstr"){return this._createEncoderBuffer([e.unused|0,e.data])}else if(t==="bmpstr"){const t=n.alloc(e.length*2);for(let r=0;r<e.length;r++){t.writeUInt16BE(e.charCodeAt(r),r*2)}return this._createEncoderBuffer(t)}else if(t==="numstr"){if(!this._isNumstr(e)){return this.reporter.error("Encoding of string type: numstr supports "+"only digits and space")}return this._createEncoderBuffer(e)}else if(t==="printstr"){if(!this._isPrintstr(e)){return this.reporter.error("Encoding of string type: printstr supports "+"only latin upper and lower case letters, "+"digits, space, apostrophe, left and rigth "+"parenthesis, plus sign, comma, hyphen, "+"dot, slash, colon, equal sign, "+"question mark")}return this._createEncoderBuffer(e)}else if(/str$/.test(t)){return this._createEncoderBuffer(e)}else if(t==="objDesc"){return this._createEncoderBuffer(e)}else{return this.reporter.error("Encoding of string type: "+t+" unsupported")}};DERNode.prototype._encodeObjid=function encodeObjid(e,t,r){if(typeof e==="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e)){return this.reporter.error("objid() should be either array or string, "+"got: "+JSON.stringify(e))}if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let t=0;t<e.length;t++){let r=e[t];for(i++;r>=128;r>>=7)i++}const o=n.alloc(i);let s=o.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];o[s--]=r&127;while((r>>=7)>0)o[s--]=128|r&127}return this._createEncoderBuffer(o)};function two(e){if(e<10)return"0"+e;else return e}DERNode.prototype._encodeTime=function encodeTime(e,t){let r;const i=new Date(e);if(t==="gentime"){r=[two(i.getUTCFullYear()),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else if(t==="utctime"){r=[two(i.getUTCFullYear()%100),two(i.getUTCMonth()+1),two(i.getUTCDate()),two(i.getUTCHours()),two(i.getUTCMinutes()),two(i.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+t+" time is not supported yet")}return this._encodeStr(r,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(e,t){if(typeof e==="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e))}e=t[e]}if(typeof e!=="number"&&!n.isBuffer(e)){const t=e.toArray();if(!e.sign&&t[0]&128){t.unshift(0)}e=n.from(t)}if(n.isBuffer(e)){let t=e.length;if(e.length===0)t++;const r=n.alloc(t);e.copy(r);if(e.length===0)r[0]=0;return this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const i=new Array(r);for(let t=i.length-1;t>=0;t--){i[t]=e&255;e>>=8}if(i[0]&128){i.unshift(0)}return this._createEncoderBuffer(n.from(i))};DERNode.prototype._encodeBool=function encodeBool(e){return this._createEncoderBuffer(e?255:0)};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(e,t,r){const i=this._baseState;let n;if(i["default"]===null)return false;const o=e.join();if(i.defaultBuffer===undefined)i.defaultBuffer=this._encodeValue(i["default"],t,r).join();if(o.length!==i.defaultBuffer.length)return false;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return false;return true};function encodeTag(e,t,r,i){let n;if(e==="seqof")e="seq";else if(e==="setof")e="set";if(s.tagByName.hasOwnProperty(e))n=s.tagByName[e];else if(typeof e==="number"&&(e|0)===e)n=e;else return i.error("Unknown tag: "+e);if(n>=31)return i.error("Multi-octet tag encoding unsupported");if(!t)n|=32;n|=s.tagClassByName[r||"universal"]<<6;return n}},7655:(e,t,r)=>{"use strict";const i=t;i.der=r(1268);i.pem=r(2517)},2517:(e,t,r)=>{"use strict";const i=r(8013);const n=r(1268);function PEMEncoder(e){n.call(this,e);this.enc="pem"}i(PEMEncoder,n);e.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(e,t){const r=n.prototype.encode.call(this,e);const i=r.toString("base64");const o=["-----BEGIN "+t.label+"-----"];for(let e=0;e<i.length;e+=64)o.push(i.slice(e,e+64));o.push("-----END "+t.label+"-----");return o.join("\n")}},5944:function(e,t,r){e=r.nmd(e);(function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}function BN(e,t,r){if(BN.isBN(e)){return e}this.negative=0;this.words=null;this.length=0;this.red=null;if(e!==null){if(t==="le"||t==="be"){r=t;t=10}this._init(e||0,t||10,r||"be")}}if(typeof e==="object"){e.exports=BN}else{t.BN=BN}BN.BN=BN;BN.wordSize=26;var i;try{i=r(181).Buffer}catch(e){}BN.isBN=function isBN(e){if(e instanceof BN){return true}return e!==null&&typeof e==="object"&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)};BN.max=function max(e,t){if(e.cmp(t)>0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var i=0;if(e[0]==="-"){i++}if(t===16){this._parseHex(e,i)}else{this._parseBase(e,t,i)}if(e[0]==="-"){this.negative=1}this.strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var i=0;i<this.length;i++){this.words[i]=0}var n,o;var s=0;if(r==="be"){for(i=e.length-1,n=0;i>=0;i-=3){o=e[i]|e[i-1]<<8|e[i-2]<<16;this.words[n]|=o<<s&67108863;this.words[n+1]=o>>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}else if(r==="le"){for(i=0,n=0;i<e.length;i+=3){o=e[i]|e[i+1]<<8|e[i+2]<<16;this.words[n]|=o<<s&67108863;this.words[n+1]=o>>>26-s&67108863;s+=24;if(s>=26){s-=26;n++}}}return this.strip()};function parseHex(e,t,r){var i=0;var n=Math.min(e.length,r);for(var o=t;o<n;o++){var s=e.charCodeAt(o)-48;i<<=4;if(s>=49&&s<=54){i|=s-49+10}else if(s>=17&&s<=22){i|=s-17+10}else{i|=s&15}}return i}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r<this.length;r++){this.words[r]=0}var i,n;var o=0;for(r=e.length-6,i=0;r>=t;r-=6){n=parseHex(e,r,r+6);this.words[i]|=n<<o&67108863;this.words[i+1]|=n>>>26-o&4194303;o+=24;if(o>=26){o-=26;i++}}if(r+6!==t){n=parseHex(e,t,r+6);this.words[i]|=n<<o&67108863;this.words[i+1]|=n>>>26-o&4194303}this.strip()};function parseBase(e,t,r,i){var n=0;var o=Math.min(e.length,r);for(var s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i;if(a>=49){n+=a-49+10}else if(a>=17){n+=a-17+10}else{n+=a}}return n}BN.prototype._parseBase=function _parseBase(e,t,r){this.words=[0];this.length=1;for(var i=0,n=1;n<=67108863;n*=t){i++}i--;n=n/t|0;var o=e.length-r;var s=o%i;var a=Math.min(o,o-s)+r;var u=0;for(var l=r;l<a;l+=i){u=parseBase(e,l,l+i,t);this.imuln(n);if(this.words[0]+u<67108864){this.words[0]+=u}else{this._iaddn(u)}}if(s!==0){var h=1;u=parseBase(e,l,e.length,t);for(l=0;l<s;l++){h*=t}this.imuln(h);if(this.words[0]+u<67108864){this.words[0]+=u}else{this._iaddn(u)}}};BN.prototype.copy=function copy(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++){e.words[t]=this.words[t]}e.length=this.length;e.negative=this.negative;e.red=this.red};BN.prototype.clone=function clone(){var e=new BN(null);this.copy(e);return e};BN.prototype._expand=function _expand(e){while(this.length<e){this.words[this.length++]=0}return this};BN.prototype.strip=function strip(){while(this.length>1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var n=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var s=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var i=0;var a=0;for(var u=0;u<this.length;u++){var l=this.words[u];var h=((l<<i|a)&16777215).toString(16);a=l>>>24-i&16777215;if(a!==0||u!==this.length-1){r=n[6-h.length]+h+r}else{r=h+r}i+=2;if(i>=26){i-=26;u--}}if(a!==0){r=a.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var f=o[e];var c=s[e];r="";var d=this.clone();d.negative=0;while(!d.isZero()){var p=d.modn(c).toString(e);d=d.idivn(c);if(!d.isZero()){r=n[f-p.length]+p+r}else{r=p+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(e,t){assert(typeof i!=="undefined");return this.toArrayLike(i,e,t)};BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){var i=this.byteLength();var n=r||Math.max(1,i);assert(i<=n,"byte array longer than desired length");assert(n>0,"Requested array length <= 0");this.strip();var o=t==="le";var s=new e(n);var a,u;var l=this.clone();if(!o){for(u=0;u<n-i;u++){s[u]=0}for(u=0;!l.isZero();u++){a=l.andln(255);l.iushrn(8);s[n-u-1]=a}}else{for(u=0;!l.isZero();u++){a=l.andln(255);l.iushrn(8);s[u]=a}for(;u<n;u++){s[u]=0}}return s};if(Math.clz32){BN.prototype._countBits=function _countBits(e){return 32-Math.clz32(e)}}else{BN.prototype._countBits=function _countBits(e){var t=e;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r<t.length;r++){var i=r/26|0;var n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);e+=r;if(r!==26)break}return e};BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)};BN.prototype.toTwos=function toTwos(e){if(this.negative!==0){return this.abs().inotn(e).iaddn(1)}return this.clone()};BN.prototype.fromTwos=function fromTwos(e){if(this.testn(e-1)){return this.notn(e).iaddn(1).ineg()}return this.clone()};BN.prototype.isNeg=function isNeg(){return this.negative!==0};BN.prototype.neg=function neg(){return this.clone().ineg()};BN.prototype.ineg=function ineg(){if(!this.isZero()){this.negative^=1}return this};BN.prototype.iuor=function iuor(e){while(this.length<e.length){this.words[this.length++]=0}for(var t=0;t<e.length;t++){this.words[t]=this.words[t]|e.words[t]}return this.strip()};BN.prototype.ior=function ior(e){assert((this.negative|e.negative)===0);return this.iuor(e)};BN.prototype.or=function or(e){if(this.length>e.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;r<t.length;r++){this.words[r]=this.words[r]&e.words[r]}this.length=t.length;return this.strip()};BN.prototype.iand=function iand(e){assert((this.negative|e.negative)===0);return this.iuand(e)};BN.prototype.and=function and(e){if(this.length>e.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var i=0;i<r.length;i++){this.words[i]=t.words[i]^r.words[i]}if(this!==t){for(;i<t.length;i++){this.words[i]=t.words[i]}}this.length=t.length;return this.strip()};BN.prototype.ixor=function ixor(e){assert((this.negative|e.negative)===0);return this.iuxor(e)};BN.prototype.xor=function xor(e){if(this.length>e.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var i=0;i<t;i++){this.words[i]=~this.words[i]&67108863}if(r>0){this.words[i]=~this.words[i]&67108863>>26-r}return this.strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var i=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<<i}else{this.words[r]=this.words[r]&~(1<<i)}return this.strip()};BN.prototype.iadd=function iadd(e){var t;if(this.negative!==0&&e.negative===0){this.negative=0;t=this.isub(e);this.negative^=1;return this._normSign()}else if(this.negative===0&&e.negative!==0){e.negative=0;t=this.isub(e);e.negative=1;return t._normSign()}var r,i;if(this.length>e.length){r=this;i=e}else{r=e;i=this}var n=0;for(var o=0;o<i.length;o++){t=(r.words[o]|0)+(i.words[o]|0)+n;this.words[o]=t&67108863;n=t>>>26}for(;n!==0&&o<r.length;o++){t=(r.words[o]|0)+n;this.words[o]=t&67108863;n=t>>>26}this.length=r.length;if(n!==0){this.words[this.length]=n;this.length++}else if(r!==this){for(;o<r.length;o++){this.words[o]=r.words[o]}}return this};BN.prototype.add=function add(e){var t;if(e.negative!==0&&this.negative===0){e.negative=0;t=this.sub(e);e.negative^=1;return t}else if(e.negative===0&&this.negative!==0){this.negative=0;t=e.sub(this);this.negative=1;return t}if(this.length>e.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var i,n;if(r>0){i=this;n=e}else{i=e;n=this}var o=0;for(var s=0;s<n.length;s++){t=(i.words[s]|0)-(n.words[s]|0)+o;o=t>>26;this.words[s]=t&67108863}for(;o!==0&&s<i.length;s++){t=(i.words[s]|0)+o;o=t>>26;this.words[s]=t&67108863}if(o===0&&s<i.length&&i!==this){for(;s<i.length;s++){this.words[s]=i.words[s]}}this.length=Math.max(this.length,s);if(i!==this){this.negative=1}return this.strip()};BN.prototype.sub=function sub(e){return this.clone().isub(e)};function smallMulTo(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i;i=i-1|0;var n=e.words[0]|0;var o=t.words[0]|0;var s=n*o;var a=s&67108863;var u=s/67108864|0;r.words[0]=a;for(var l=1;l<i;l++){var h=u>>>26;var f=u&67108863;var c=Math.min(l,t.length-1);for(var d=Math.max(0,l-e.length+1);d<=c;d++){var p=l-d|0;n=e.words[p]|0;o=t.words[d]|0;s=n*o+f;h+=s/67108864|0;f=s&67108863}r.words[l]=f|0;u=h|0}if(u!==0){r.words[l]=u|0}else{r.length--}return r.strip()}var a=function comb10MulTo(e,t,r){var i=e.words;var n=t.words;var o=r.words;var s=0;var a;var u;var l;var h=i[0]|0;var f=h&8191;var c=h>>>13;var d=i[1]|0;var p=d&8191;var m=d>>>13;var y=i[2]|0;var v=y&8191;var g=y>>>13;var w=i[3]|0;var b=w&8191;var M=w>>>13;var _=i[4]|0;var S=_&8191;var N=_>>>13;var E=i[5]|0;var T=E&8191;var B=E>>>13;var A=i[6]|0;var k=A&8191;var R=A>>>13;var C=i[7]|0;var O=C&8191;var I=C>>>13;var x=i[8]|0;var P=x&8191;var j=x>>>13;var D=i[9]|0;var U=D&8191;var L=D>>>13;var K=n[0]|0;var F=K&8191;var $=K>>>13;var H=n[1]|0;var q=H&8191;var J=H>>>13;var W=n[2]|0;var G=W&8191;var V=W>>>13;var z=n[3]|0;var Z=z&8191;var Y=z>>>13;var X=n[4]|0;var Q=X&8191;var ee=X>>>13;var te=n[5]|0;var re=te&8191;var ie=te>>>13;var ne=n[6]|0;var oe=ne&8191;var se=ne>>>13;var ae=n[7]|0;var ue=ae&8191;var le=ae>>>13;var he=n[8]|0;var fe=he&8191;var ce=he>>>13;var de=n[9]|0;var pe=de&8191;var me=de>>>13;r.negative=e.negative^t.negative;r.length=19;a=Math.imul(f,F);u=Math.imul(f,$);u=u+Math.imul(c,F)|0;l=Math.imul(c,$);var ye=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(ye>>>26)|0;ye&=67108863;a=Math.imul(p,F);u=Math.imul(p,$);u=u+Math.imul(m,F)|0;l=Math.imul(m,$);a=a+Math.imul(f,q)|0;u=u+Math.imul(f,J)|0;u=u+Math.imul(c,q)|0;l=l+Math.imul(c,J)|0;var ve=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(ve>>>26)|0;ve&=67108863;a=Math.imul(v,F);u=Math.imul(v,$);u=u+Math.imul(g,F)|0;l=Math.imul(g,$);a=a+Math.imul(p,q)|0;u=u+Math.imul(p,J)|0;u=u+Math.imul(m,q)|0;l=l+Math.imul(m,J)|0;a=a+Math.imul(f,G)|0;u=u+Math.imul(f,V)|0;u=u+Math.imul(c,G)|0;l=l+Math.imul(c,V)|0;var ge=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(ge>>>26)|0;ge&=67108863;a=Math.imul(b,F);u=Math.imul(b,$);u=u+Math.imul(M,F)|0;l=Math.imul(M,$);a=a+Math.imul(v,q)|0;u=u+Math.imul(v,J)|0;u=u+Math.imul(g,q)|0;l=l+Math.imul(g,J)|0;a=a+Math.imul(p,G)|0;u=u+Math.imul(p,V)|0;u=u+Math.imul(m,G)|0;l=l+Math.imul(m,V)|0;a=a+Math.imul(f,Z)|0;u=u+Math.imul(f,Y)|0;u=u+Math.imul(c,Z)|0;l=l+Math.imul(c,Y)|0;var we=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(we>>>26)|0;we&=67108863;a=Math.imul(S,F);u=Math.imul(S,$);u=u+Math.imul(N,F)|0;l=Math.imul(N,$);a=a+Math.imul(b,q)|0;u=u+Math.imul(b,J)|0;u=u+Math.imul(M,q)|0;l=l+Math.imul(M,J)|0;a=a+Math.imul(v,G)|0;u=u+Math.imul(v,V)|0;u=u+Math.imul(g,G)|0;l=l+Math.imul(g,V)|0;a=a+Math.imul(p,Z)|0;u=u+Math.imul(p,Y)|0;u=u+Math.imul(m,Z)|0;l=l+Math.imul(m,Y)|0;a=a+Math.imul(f,Q)|0;u=u+Math.imul(f,ee)|0;u=u+Math.imul(c,Q)|0;l=l+Math.imul(c,ee)|0;var be=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(be>>>26)|0;be&=67108863;a=Math.imul(T,F);u=Math.imul(T,$);u=u+Math.imul(B,F)|0;l=Math.imul(B,$);a=a+Math.imul(S,q)|0;u=u+Math.imul(S,J)|0;u=u+Math.imul(N,q)|0;l=l+Math.imul(N,J)|0;a=a+Math.imul(b,G)|0;u=u+Math.imul(b,V)|0;u=u+Math.imul(M,G)|0;l=l+Math.imul(M,V)|0;a=a+Math.imul(v,Z)|0;u=u+Math.imul(v,Y)|0;u=u+Math.imul(g,Z)|0;l=l+Math.imul(g,Y)|0;a=a+Math.imul(p,Q)|0;u=u+Math.imul(p,ee)|0;u=u+Math.imul(m,Q)|0;l=l+Math.imul(m,ee)|0;a=a+Math.imul(f,re)|0;u=u+Math.imul(f,ie)|0;u=u+Math.imul(c,re)|0;l=l+Math.imul(c,ie)|0;var Me=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Me>>>26)|0;Me&=67108863;a=Math.imul(k,F);u=Math.imul(k,$);u=u+Math.imul(R,F)|0;l=Math.imul(R,$);a=a+Math.imul(T,q)|0;u=u+Math.imul(T,J)|0;u=u+Math.imul(B,q)|0;l=l+Math.imul(B,J)|0;a=a+Math.imul(S,G)|0;u=u+Math.imul(S,V)|0;u=u+Math.imul(N,G)|0;l=l+Math.imul(N,V)|0;a=a+Math.imul(b,Z)|0;u=u+Math.imul(b,Y)|0;u=u+Math.imul(M,Z)|0;l=l+Math.imul(M,Y)|0;a=a+Math.imul(v,Q)|0;u=u+Math.imul(v,ee)|0;u=u+Math.imul(g,Q)|0;l=l+Math.imul(g,ee)|0;a=a+Math.imul(p,re)|0;u=u+Math.imul(p,ie)|0;u=u+Math.imul(m,re)|0;l=l+Math.imul(m,ie)|0;a=a+Math.imul(f,oe)|0;u=u+Math.imul(f,se)|0;u=u+Math.imul(c,oe)|0;l=l+Math.imul(c,se)|0;var _e=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(_e>>>26)|0;_e&=67108863;a=Math.imul(O,F);u=Math.imul(O,$);u=u+Math.imul(I,F)|0;l=Math.imul(I,$);a=a+Math.imul(k,q)|0;u=u+Math.imul(k,J)|0;u=u+Math.imul(R,q)|0;l=l+Math.imul(R,J)|0;a=a+Math.imul(T,G)|0;u=u+Math.imul(T,V)|0;u=u+Math.imul(B,G)|0;l=l+Math.imul(B,V)|0;a=a+Math.imul(S,Z)|0;u=u+Math.imul(S,Y)|0;u=u+Math.imul(N,Z)|0;l=l+Math.imul(N,Y)|0;a=a+Math.imul(b,Q)|0;u=u+Math.imul(b,ee)|0;u=u+Math.imul(M,Q)|0;l=l+Math.imul(M,ee)|0;a=a+Math.imul(v,re)|0;u=u+Math.imul(v,ie)|0;u=u+Math.imul(g,re)|0;l=l+Math.imul(g,ie)|0;a=a+Math.imul(p,oe)|0;u=u+Math.imul(p,se)|0;u=u+Math.imul(m,oe)|0;l=l+Math.imul(m,se)|0;a=a+Math.imul(f,ue)|0;u=u+Math.imul(f,le)|0;u=u+Math.imul(c,ue)|0;l=l+Math.imul(c,le)|0;var Se=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Se>>>26)|0;Se&=67108863;a=Math.imul(P,F);u=Math.imul(P,$);u=u+Math.imul(j,F)|0;l=Math.imul(j,$);a=a+Math.imul(O,q)|0;u=u+Math.imul(O,J)|0;u=u+Math.imul(I,q)|0;l=l+Math.imul(I,J)|0;a=a+Math.imul(k,G)|0;u=u+Math.imul(k,V)|0;u=u+Math.imul(R,G)|0;l=l+Math.imul(R,V)|0;a=a+Math.imul(T,Z)|0;u=u+Math.imul(T,Y)|0;u=u+Math.imul(B,Z)|0;l=l+Math.imul(B,Y)|0;a=a+Math.imul(S,Q)|0;u=u+Math.imul(S,ee)|0;u=u+Math.imul(N,Q)|0;l=l+Math.imul(N,ee)|0;a=a+Math.imul(b,re)|0;u=u+Math.imul(b,ie)|0;u=u+Math.imul(M,re)|0;l=l+Math.imul(M,ie)|0;a=a+Math.imul(v,oe)|0;u=u+Math.imul(v,se)|0;u=u+Math.imul(g,oe)|0;l=l+Math.imul(g,se)|0;a=a+Math.imul(p,ue)|0;u=u+Math.imul(p,le)|0;u=u+Math.imul(m,ue)|0;l=l+Math.imul(m,le)|0;a=a+Math.imul(f,fe)|0;u=u+Math.imul(f,ce)|0;u=u+Math.imul(c,fe)|0;l=l+Math.imul(c,ce)|0;var Ne=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Ne>>>26)|0;Ne&=67108863;a=Math.imul(U,F);u=Math.imul(U,$);u=u+Math.imul(L,F)|0;l=Math.imul(L,$);a=a+Math.imul(P,q)|0;u=u+Math.imul(P,J)|0;u=u+Math.imul(j,q)|0;l=l+Math.imul(j,J)|0;a=a+Math.imul(O,G)|0;u=u+Math.imul(O,V)|0;u=u+Math.imul(I,G)|0;l=l+Math.imul(I,V)|0;a=a+Math.imul(k,Z)|0;u=u+Math.imul(k,Y)|0;u=u+Math.imul(R,Z)|0;l=l+Math.imul(R,Y)|0;a=a+Math.imul(T,Q)|0;u=u+Math.imul(T,ee)|0;u=u+Math.imul(B,Q)|0;l=l+Math.imul(B,ee)|0;a=a+Math.imul(S,re)|0;u=u+Math.imul(S,ie)|0;u=u+Math.imul(N,re)|0;l=l+Math.imul(N,ie)|0;a=a+Math.imul(b,oe)|0;u=u+Math.imul(b,se)|0;u=u+Math.imul(M,oe)|0;l=l+Math.imul(M,se)|0;a=a+Math.imul(v,ue)|0;u=u+Math.imul(v,le)|0;u=u+Math.imul(g,ue)|0;l=l+Math.imul(g,le)|0;a=a+Math.imul(p,fe)|0;u=u+Math.imul(p,ce)|0;u=u+Math.imul(m,fe)|0;l=l+Math.imul(m,ce)|0;a=a+Math.imul(f,pe)|0;u=u+Math.imul(f,me)|0;u=u+Math.imul(c,pe)|0;l=l+Math.imul(c,me)|0;var Ee=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;a=Math.imul(U,q);u=Math.imul(U,J);u=u+Math.imul(L,q)|0;l=Math.imul(L,J);a=a+Math.imul(P,G)|0;u=u+Math.imul(P,V)|0;u=u+Math.imul(j,G)|0;l=l+Math.imul(j,V)|0;a=a+Math.imul(O,Z)|0;u=u+Math.imul(O,Y)|0;u=u+Math.imul(I,Z)|0;l=l+Math.imul(I,Y)|0;a=a+Math.imul(k,Q)|0;u=u+Math.imul(k,ee)|0;u=u+Math.imul(R,Q)|0;l=l+Math.imul(R,ee)|0;a=a+Math.imul(T,re)|0;u=u+Math.imul(T,ie)|0;u=u+Math.imul(B,re)|0;l=l+Math.imul(B,ie)|0;a=a+Math.imul(S,oe)|0;u=u+Math.imul(S,se)|0;u=u+Math.imul(N,oe)|0;l=l+Math.imul(N,se)|0;a=a+Math.imul(b,ue)|0;u=u+Math.imul(b,le)|0;u=u+Math.imul(M,ue)|0;l=l+Math.imul(M,le)|0;a=a+Math.imul(v,fe)|0;u=u+Math.imul(v,ce)|0;u=u+Math.imul(g,fe)|0;l=l+Math.imul(g,ce)|0;a=a+Math.imul(p,pe)|0;u=u+Math.imul(p,me)|0;u=u+Math.imul(m,pe)|0;l=l+Math.imul(m,me)|0;var Te=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Te>>>26)|0;Te&=67108863;a=Math.imul(U,G);u=Math.imul(U,V);u=u+Math.imul(L,G)|0;l=Math.imul(L,V);a=a+Math.imul(P,Z)|0;u=u+Math.imul(P,Y)|0;u=u+Math.imul(j,Z)|0;l=l+Math.imul(j,Y)|0;a=a+Math.imul(O,Q)|0;u=u+Math.imul(O,ee)|0;u=u+Math.imul(I,Q)|0;l=l+Math.imul(I,ee)|0;a=a+Math.imul(k,re)|0;u=u+Math.imul(k,ie)|0;u=u+Math.imul(R,re)|0;l=l+Math.imul(R,ie)|0;a=a+Math.imul(T,oe)|0;u=u+Math.imul(T,se)|0;u=u+Math.imul(B,oe)|0;l=l+Math.imul(B,se)|0;a=a+Math.imul(S,ue)|0;u=u+Math.imul(S,le)|0;u=u+Math.imul(N,ue)|0;l=l+Math.imul(N,le)|0;a=a+Math.imul(b,fe)|0;u=u+Math.imul(b,ce)|0;u=u+Math.imul(M,fe)|0;l=l+Math.imul(M,ce)|0;a=a+Math.imul(v,pe)|0;u=u+Math.imul(v,me)|0;u=u+Math.imul(g,pe)|0;l=l+Math.imul(g,me)|0;var Be=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Be>>>26)|0;Be&=67108863;a=Math.imul(U,Z);u=Math.imul(U,Y);u=u+Math.imul(L,Z)|0;l=Math.imul(L,Y);a=a+Math.imul(P,Q)|0;u=u+Math.imul(P,ee)|0;u=u+Math.imul(j,Q)|0;l=l+Math.imul(j,ee)|0;a=a+Math.imul(O,re)|0;u=u+Math.imul(O,ie)|0;u=u+Math.imul(I,re)|0;l=l+Math.imul(I,ie)|0;a=a+Math.imul(k,oe)|0;u=u+Math.imul(k,se)|0;u=u+Math.imul(R,oe)|0;l=l+Math.imul(R,se)|0;a=a+Math.imul(T,ue)|0;u=u+Math.imul(T,le)|0;u=u+Math.imul(B,ue)|0;l=l+Math.imul(B,le)|0;a=a+Math.imul(S,fe)|0;u=u+Math.imul(S,ce)|0;u=u+Math.imul(N,fe)|0;l=l+Math.imul(N,ce)|0;a=a+Math.imul(b,pe)|0;u=u+Math.imul(b,me)|0;u=u+Math.imul(M,pe)|0;l=l+Math.imul(M,me)|0;var Ae=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;a=Math.imul(U,Q);u=Math.imul(U,ee);u=u+Math.imul(L,Q)|0;l=Math.imul(L,ee);a=a+Math.imul(P,re)|0;u=u+Math.imul(P,ie)|0;u=u+Math.imul(j,re)|0;l=l+Math.imul(j,ie)|0;a=a+Math.imul(O,oe)|0;u=u+Math.imul(O,se)|0;u=u+Math.imul(I,oe)|0;l=l+Math.imul(I,se)|0;a=a+Math.imul(k,ue)|0;u=u+Math.imul(k,le)|0;u=u+Math.imul(R,ue)|0;l=l+Math.imul(R,le)|0;a=a+Math.imul(T,fe)|0;u=u+Math.imul(T,ce)|0;u=u+Math.imul(B,fe)|0;l=l+Math.imul(B,ce)|0;a=a+Math.imul(S,pe)|0;u=u+Math.imul(S,me)|0;u=u+Math.imul(N,pe)|0;l=l+Math.imul(N,me)|0;var ke=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(ke>>>26)|0;ke&=67108863;a=Math.imul(U,re);u=Math.imul(U,ie);u=u+Math.imul(L,re)|0;l=Math.imul(L,ie);a=a+Math.imul(P,oe)|0;u=u+Math.imul(P,se)|0;u=u+Math.imul(j,oe)|0;l=l+Math.imul(j,se)|0;a=a+Math.imul(O,ue)|0;u=u+Math.imul(O,le)|0;u=u+Math.imul(I,ue)|0;l=l+Math.imul(I,le)|0;a=a+Math.imul(k,fe)|0;u=u+Math.imul(k,ce)|0;u=u+Math.imul(R,fe)|0;l=l+Math.imul(R,ce)|0;a=a+Math.imul(T,pe)|0;u=u+Math.imul(T,me)|0;u=u+Math.imul(B,pe)|0;l=l+Math.imul(B,me)|0;var Re=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Re>>>26)|0;Re&=67108863;a=Math.imul(U,oe);u=Math.imul(U,se);u=u+Math.imul(L,oe)|0;l=Math.imul(L,se);a=a+Math.imul(P,ue)|0;u=u+Math.imul(P,le)|0;u=u+Math.imul(j,ue)|0;l=l+Math.imul(j,le)|0;a=a+Math.imul(O,fe)|0;u=u+Math.imul(O,ce)|0;u=u+Math.imul(I,fe)|0;l=l+Math.imul(I,ce)|0;a=a+Math.imul(k,pe)|0;u=u+Math.imul(k,me)|0;u=u+Math.imul(R,pe)|0;l=l+Math.imul(R,me)|0;var Ce=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;a=Math.imul(U,ue);u=Math.imul(U,le);u=u+Math.imul(L,ue)|0;l=Math.imul(L,le);a=a+Math.imul(P,fe)|0;u=u+Math.imul(P,ce)|0;u=u+Math.imul(j,fe)|0;l=l+Math.imul(j,ce)|0;a=a+Math.imul(O,pe)|0;u=u+Math.imul(O,me)|0;u=u+Math.imul(I,pe)|0;l=l+Math.imul(I,me)|0;var Oe=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Oe>>>26)|0;Oe&=67108863;a=Math.imul(U,fe);u=Math.imul(U,ce);u=u+Math.imul(L,fe)|0;l=Math.imul(L,ce);a=a+Math.imul(P,pe)|0;u=u+Math.imul(P,me)|0;u=u+Math.imul(j,pe)|0;l=l+Math.imul(j,me)|0;var Ie=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;a=Math.imul(U,pe);u=Math.imul(U,me);u=u+Math.imul(L,pe)|0;l=Math.imul(L,me);var xe=(s+a|0)+((u&8191)<<13)|0;s=(l+(u>>>13)|0)+(xe>>>26)|0;xe&=67108863;o[0]=ye;o[1]=ve;o[2]=ge;o[3]=we;o[4]=be;o[5]=Me;o[6]=_e;o[7]=Se;o[8]=Ne;o[9]=Ee;o[10]=Te;o[11]=Be;o[12]=Ae;o[13]=ke;o[14]=Re;o[15]=Ce;o[16]=Oe;o[17]=Ie;o[18]=xe;if(s!==0){o[19]=s;r.length++}return r};if(!Math.imul){a=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var i=0;var n=0;for(var o=0;o<r.length-1;o++){var s=n;n=0;var a=i&67108863;var u=Math.min(o,t.length-1);for(var l=Math.max(0,o-e.length+1);l<=u;l++){var h=o-l;var f=e.words[h]|0;var c=t.words[l]|0;var d=f*c;var p=d&67108863;s=s+(d/67108864|0)|0;p=p+a|0;a=p&67108863;s=s+(p>>>26)|0;n+=s>>>26;s&=67108863}r.words[o]=a;i=s;s=n}if(i!==0){r.words[o]=i}else{r.length--}return r.strip()}function jumboMulTo(e,t,r){var i=new FFTM;return i.mulp(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var i=this.length+e.length;if(this.length===10&&e.length===10){r=a(this,e,t)}else if(i<63){r=smallMulTo(this,e,t)}else if(i<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var i=0;i<e;i++){t[i]=this.revBin(i,r,e)}return t};FFTM.prototype.revBin=function revBin(e,t,r){if(e===0||e===r-1)return e;var i=0;for(var n=0;n<t;n++){i|=(e&1)<<t-n-1;e>>=1}return i};FFTM.prototype.permute=function permute(e,t,r,i,n,o){for(var s=0;s<o;s++){i[s]=t[e[s]];n[s]=r[e[s]]}};FFTM.prototype.transform=function transform(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1){var a=s<<1;var u=Math.cos(2*Math.PI/a);var l=Math.sin(2*Math.PI/a);for(var h=0;h<n;h+=a){var f=u;var c=l;for(var d=0;d<s;d++){var p=r[h+d];var m=i[h+d];var y=r[h+d+s];var v=i[h+d+s];var g=f*y-c*v;v=f*v+c*y;y=g;r[h+d]=p+y;i[h+d]=m+v;r[h+d+s]=p-y;i[h+d+s]=m-v;if(d!==a){g=u*f-l*c;c=u*c+l*f;f=g}}}}};FFTM.prototype.guessLen13b=function guessLen13b(e,t){var r=Math.max(t,e)|1;var i=r&1;var n=0;for(r=r/2|0;r;r=r>>>1){n++}return 1<<n+1+i};FFTM.prototype.conjugate=function conjugate(e,t,r){if(r<=1)return;for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1];e[r-i-1]=n;n=t[i];t[i]=-t[r-i-1];t[r-i-1]=-n}};FFTM.prototype.normalize13b=function normalize13b(e,t){var r=0;for(var i=0;i<t/2;i++){var n=Math.round(e[2*i+1]/t)*8192+Math.round(e[2*i]/t)+r;e[i]=n&67108863;if(n<67108864){r=0}else{r=n/67108864|0}}return e};FFTM.prototype.convert13b=function convert13b(e,t,r,i){var n=0;for(var o=0;o<t;o++){n=n+(e[o]|0);r[2*o]=n&8191;n=n>>>13;r[2*o+1]=n&8191;n=n>>>13}for(o=2*t;o<i;++o){r[o]=0}assert(n===0);assert((n&~8191)===0)};FFTM.prototype.stub=function stub(e){var t=new Array(e);for(var r=0;r<e;r++){t[r]=0}return t};FFTM.prototype.mulp=function mulp(e,t,r){var i=2*this.guessLen13b(e.length,t.length);var n=this.makeRBT(i);var o=this.stub(i);var s=new Array(i);var a=new Array(i);var u=new Array(i);var l=new Array(i);var h=new Array(i);var f=new Array(i);var c=r.words;c.length=i;this.convert13b(e.words,e.length,s,i);this.convert13b(t.words,t.length,l,i);this.transform(s,o,a,u,i,n);this.transform(l,o,h,f,i,n);for(var d=0;d<i;d++){var p=a[d]*h[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*h[d];a[d]=p}this.conjugate(a,u,i);this.transform(a,u,c,o,i,n);this.conjugate(c,o,i);this.normalize13b(c,i);r.negative=e.negative^t.negative;r.length=e.length+t.length;return r.strip()};BN.prototype.mul=function mul(e){var t=new BN(null);t.words=new Array(this.length+e.length);return this.mulTo(e,t)};BN.prototype.mulf=function mulf(e){var t=new BN(null);t.words=new Array(this.length+e.length);return jumboMulTo(this,e,t)};BN.prototype.imul=function imul(e){return this.clone().mulTo(e,this)};BN.prototype.imuln=function imuln(e){assert(typeof e==="number");assert(e<67108864);var t=0;for(var r=0;r<this.length;r++){var i=(this.words[r]|0)*e;var n=(i&67108863)+(t&67108863);t>>=26;t+=i/67108864|0;t+=n>>>26;this.words[r]=n&67108863}if(t!==0){this.words[r]=t;this.length++}return this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var i=0;i<t.length;i++,r=r.sqr()){if(t[i]!==0)break}if(++i<t.length){for(var n=r.sqr();i<t.length;i++,n=n.sqr()){if(t[i]===0)continue;r=r.mul(n)}}return r};BN.prototype.iushln=function iushln(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=67108863>>>26-t<<26-t;var n;if(t!==0){var o=0;for(n=0;n<this.length;n++){var s=this.words[n]&i;var a=(this.words[n]|0)-s<<t;this.words[n]=a|o;o=s>>>26-t}if(o){this.words[n]=o;this.length++}}if(r!==0){for(n=this.length-1;n>=0;n--){this.words[n+r]=this.words[n]}for(n=0;n<r;n++){this.words[n]=0}this.length+=r}return this.strip()};BN.prototype.ishln=function ishln(e){assert(this.negative===0);return this.iushln(e)};BN.prototype.iushrn=function iushrn(e,t,r){assert(typeof e==="number"&&e>=0);var i;if(t){i=(t-t%26)/26}else{i=0}var n=e%26;var o=Math.min((e-n)/26,this.length);var s=67108863^67108863>>>n<<n;var a=r;i-=o;i=Math.max(0,i);if(a){for(var u=0;u<o;u++){a.words[u]=this.words[u]}a.length=o}if(o===0){}else if(this.length>o){this.length-=o;for(u=0;u<this.length;u++){this.words[u]=this.words[u+o]}}else{this.words[0]=0;this.length=1}var l=0;for(u=this.length-1;u>=0&&(l!==0||u>=i);u--){var h=this.words[u]|0;this.words[u]=l<<26-n|h>>>n;l=h&s}if(a&&l!==0){a.words[a.length++]=l}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var i=1<<t;if(this.length<=r)return false;var n=this.words[r];return!!(n&i)};BN.prototype.imaskn=function imaskn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()};BN.prototype.maskn=function maskn(e){return this.clone().imaskn(e)};BN.prototype.iaddn=function iaddn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.isubn(-e);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<e){this.words[0]=e-(this.words[0]|0);this.negative=0;return this}this.negative=0;this.isubn(e);this.negative=1;return this}return this._iaddn(e)};BN.prototype._iaddn=function _iaddn(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t<this.length&&this.words[t]<0;t++){this.words[t]+=67108864;this.words[t+1]-=1}}return this.strip()};BN.prototype.addn=function addn(e){return this.clone().iaddn(e)};BN.prototype.subn=function subn(e){return this.clone().isubn(e)};BN.prototype.iabs=function iabs(){this.negative=0;return this};BN.prototype.abs=function abs(){return this.clone().iabs()};BN.prototype._ishlnsubmul=function _ishlnsubmul(e,t,r){var i=e.length+r;var n;this._expand(i);var o;var s=0;for(n=0;n<e.length;n++){o=(this.words[n+r]|0)+s;var a=(e.words[n]|0)*t;o-=a&67108863;s=(o>>26)-(a/67108864|0);this.words[n+r]=o&67108863}for(;n<this.length-r;n++){o=(this.words[n+r]|0)+s;s=o>>26;this.words[n+r]=o&67108863}if(s===0)return this.strip();assert(s===-1);s=0;for(n=0;n<this.length;n++){o=-(this.words[n]|0)+s;s=o>>26;this.words[n]=o&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var i=this.clone();var n=e;var o=n.words[n.length-1]|0;var s=this._countBits(o);r=26-s;if(r!==0){n=n.ushln(r);i.iushln(r);o=n.words[n.length-1]|0}var a=i.length-n.length;var u;if(t!=="mod"){u=new BN(null);u.length=a+1;u.words=new Array(u.length);for(var l=0;l<u.length;l++){u.words[l]=0}}var h=i.clone()._ishlnsubmul(n,1,a);if(h.negative===0){i=h;if(u){u.words[a]=1}}for(var f=a-1;f>=0;f--){var c=(i.words[n.length+f]|0)*67108864+(i.words[n.length+f-1]|0);c=Math.min(c/o|0,67108863);i._ishlnsubmul(n,c,f);while(i.negative!==0){c--;i.negative=0;i._ishlnsubmul(n,1,f);if(!i.isZero()){i.negative^=1}}if(u){u.words[f]=c}}if(u){u.strip()}i.strip();if(t!=="div"&&r!==0){i.iushrn(r)}return{div:u||null,mod:i}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var i,n,o;if(this.negative!==0&&e.negative===0){o=this.neg().divmod(e,t);if(t!=="mod"){i=o.div.neg()}if(t!=="div"){n=o.mod.neg();if(r&&n.negative!==0){n.iadd(e)}}return{div:i,mod:n}}if(this.negative===0&&e.negative!==0){o=this.divmod(e.neg(),t);if(t!=="mod"){i=o.div.neg()}return{div:i,mod:o.mod}}if((this.negative&e.negative)!==0){o=this.neg().divmod(e.neg(),t);if(t!=="div"){n=o.mod.neg();if(r&&n.negative!==0){n.isub(e)}}return{div:o.div,mod:n}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var i=e.ushrn(1);var n=e.andln(1);var o=r.cmp(i);if(o<0||n===1&&o===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modn=function modn(e){assert(e<=67108863);var t=(1<<26)%e;var r=0;for(var i=this.length-1;i>=0;i--){r=(t*r+(this.words[i]|0))%e}return r};BN.prototype.idivn=function idivn(e){assert(e<=67108863);var t=0;for(var r=this.length-1;r>=0;r--){var i=(this.words[r]|0)+t*67108864;this.words[r]=i/e|0;t=i%e}return this.strip()};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var o=new BN(0);var s=new BN(1);var a=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++a}var u=r.clone();var l=t.clone();while(!t.isZero()){for(var h=0,f=1;(t.words[0]&f)===0&&h<26;++h,f<<=1);if(h>0){t.iushrn(h);while(h-- >0){if(i.isOdd()||n.isOdd()){i.iadd(u);n.isub(l)}i.iushrn(1);n.iushrn(1)}}for(var c=0,d=1;(r.words[0]&d)===0&&c<26;++c,d<<=1);if(c>0){r.iushrn(c);while(c-- >0){if(o.isOdd()||s.isOdd()){o.iadd(u);s.isub(l)}o.iushrn(1);s.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(o);n.isub(s)}else{r.isub(t);o.isub(i);s.isub(n)}}return{a:o,b:s,gcd:r.iushln(a)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var i=new BN(1);var n=new BN(0);var o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var s=0,a=1;(t.words[0]&a)===0&&s<26;++s,a<<=1);if(s>0){t.iushrn(s);while(s-- >0){if(i.isOdd()){i.iadd(o)}i.iushrn(1)}}for(var u=0,l=1;(r.words[0]&l)===0&&u<26;++u,l<<=1);if(u>0){r.iushrn(u);while(u-- >0){if(n.isOdd()){n.iadd(o)}n.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);i.isub(n)}else{r.isub(t);n.isub(i)}}var h;if(t.cmpn(1)===0){h=i}else{h=n}if(h.cmpn(0)<0){h.iadd(e)}return h};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var n=t.cmp(r);if(n<0){var o=t;t=r;r=o}else if(n===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(i)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var i=1<<t;if(this.length<=r){this._expand(r+1);this.words[r]|=i;return this}var n=i;for(var o=r;n!==0&&o<this.length;o++){var s=this.words[o]|0;s+=n;n=s>>>26;s&=67108863;this.words[o]=s}if(n!==0){this.words[o]=n;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this.strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var i=this.words[0]|0;r=i===e?0:i<e?-1:1}if(this.negative!==0)return-r|0;return r};BN.prototype.cmp=function cmp(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var t=this.ucmp(e);if(this.negative!==0)return-t|0;return t};BN.prototype.ucmp=function ucmp(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;var t=0;for(var r=this.length-1;r>=0;r--){var i=this.words[r]|0;var n=e.words[r]|0;if(i===n)continue;if(i<n){t=-1}else if(i>n){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var u={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var i=r<this.n?-1:t.ucmp(this.p);if(i===0){t.words[0]=0;t.length=1}else if(i>0){t.isub(this.p)}else{if(t.strip!==undefined){t.strip()}else{t._strip()}}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(e,t){var r=4194303;var i=Math.min(e.length,9);for(var n=0;n<i;n++){t.words[n]=e.words[n]}t.length=i;if(e.length<=9){e.words[0]=0;e.length=1;return}var o=e.words[9];t.words[t.length++]=o&r;for(n=10;n<e.length;n++){var s=e.words[n]|0;e.words[n-10]=(s&r)<<4|o>>>22;o=s}o>>>=22;e.words[n-10]=o;if(o===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r<e.length;r++){var i=e.words[r]|0;t+=i*977;e.words[r]=t&67108863;t=i*64+(t/67108864|0)}if(e.words[e.length-1]===0){e.length--;if(e.words[e.length-1]===0){e.length--}}return e};function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}inherits(P224,MPrime);function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}inherits(P192,MPrime);function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}inherits(P25519,MPrime);P25519.prototype.imulK=function imulK(e){var t=0;for(var r=0;r<e.length;r++){var i=(e.words[r]|0)*19+t;var n=i&67108863;i>>>=26;e.words[r]=n;t=i}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(u[e])return u[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}u[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);return e.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var i=this.m.subn(1);var n=0;while(!i.isZero()&&i.andln(1)===0){n++;i.iushrn(1)}assert(!i.isZero());var o=new BN(1).toRed(this);var s=o.redNeg();var a=this.m.subn(1).iushrn(1);var u=this.m.bitLength();u=new BN(2*u*u).toRed(this);while(this.pow(u,a).cmp(s)!==0){u.redIAdd(s)}var l=this.pow(u,i);var h=this.pow(e,i.addn(1).iushrn(1));var f=this.pow(e,i);var c=n;while(f.cmp(o)!==0){var d=f;for(var p=0;d.cmp(o)!==0;p++){d=d.redSqr()}assert(p<c);var m=this.pow(l,new BN(1).iushln(c-p-1));h=h.redMul(m);l=m.redSqr();f=f.redMul(l);c=p}return h};Red.prototype.invm=function invm(e){var t=e._invmp(this.m);if(t.negative!==0){t.negative=0;return this.imod(t).redNeg()}else{return this.imod(t)}};Red.prototype.pow=function pow(e,t){if(t.isZero())return new BN(1).toRed(this);if(t.cmpn(1)===0)return e.clone();var r=4;var i=new Array(1<<r);i[0]=new BN(1).toRed(this);i[1]=e;for(var n=2;n<i.length;n++){i[n]=this.mul(i[n-1],e)}var o=i[0];var s=0;var a=0;var u=t.bitLength()%26;if(u===0){u=26}for(n=t.length-1;n>=0;n--){var l=t.words[n];for(var h=u-1;h>=0;h--){var f=l>>h&1;if(o!==i[0]){o=this.sqr(o)}if(f===0&&s===0){a=0;continue}s<<=1;s|=f;a++;if(a!==r&&(n!==0||h!==0))continue;o=this.mul(o,i[s]);a=0;s=0}u=26}return o};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var o=n;if(n.cmp(this.m)>=0){o=n.isub(this.m)}else if(n.cmpn(0)<0){o=n.iadd(this.m)}return o._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var n=r.isub(i).iushrn(this.shift);var o=n;if(n.cmp(this.m)>=0){o=n.isub(this.m)}else if(n.cmpn(0)<0){o=n.iadd(this.m)}return o._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(false||e,this)},8210:(e,t,r)=>{"use strict";var i=r(5725).Buffer;var n=r(4335);var o=128,s=0,a=32,u=16,l=2,h=u|a|s<<6,f=l|s<<6;function base64Url(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function signatureAsBuffer(e){if(i.isBuffer(e)){return e}else if("string"===typeof e){return i.from(e,"base64")}throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function derToJose(e,t){e=signatureAsBuffer(e);var r=n(t);var s=r+1;var a=e.length;var u=0;if(e[u++]!==h){throw new Error('Could not find expected "seq"')}var l=e[u++];if(l===(o|1)){l=e[u++]}if(a-u<l){throw new Error('"seq" specified length of "'+l+'", only "'+(a-u)+'" remaining')}if(e[u++]!==f){throw new Error('Could not find expected "int" for "r"')}var c=e[u++];if(a-u-2<c){throw new Error('"r" specified length of "'+c+'", only "'+(a-u-2)+'" available')}if(s<c){throw new Error('"r" specified length of "'+c+'", max of "'+s+'" is acceptable')}var d=u;u+=c;if(e[u++]!==f){throw new Error('Could not find expected "int" for "s"')}var p=e[u++];if(a-u!==p){throw new Error('"s" specified length of "'+p+'", expected "'+(a-u)+'"')}if(s<p){throw new Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable')}var m=u;u+=p;if(u!==a){throw new Error('Expected to consume entire buffer, but "'+(a-u)+'" bytes remain')}var y=r-c,v=r-p;var g=i.allocUnsafe(y+c+v+p);for(u=0;u<y;++u){g[u]=0}e.copy(g,u,d+Math.max(-y,0),d+c);u=r;for(var w=u;u<w+v;++u){g[u]=0}e.copy(g,u,m+Math.max(-v,0),m+p);g=g.toString("base64");g=base64Url(g);return g}function countPadding(e,t,r){var i=0;while(t+i<r&&e[t+i]===0){++i}var n=e[t+i]>=o;if(n){--i}return i}function joseToDer(e,t){e=signatureAsBuffer(e);var r=n(t);var s=e.length;if(s!==r*2){throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+s+'"')}var a=countPadding(e,0,r);var u=countPadding(e,r,e.length);var l=r-a;var c=r-u;var d=1+1+l+1+1+c;var p=d<o;var m=i.allocUnsafe((p?2:3)+d);var y=0;m[y++]=h;if(p){m[y++]=d}else{m[y++]=o|1;m[y++]=d&255}m[y++]=f;m[y++]=l;if(a<0){m[y++]=0;y+=e.copy(m,y,0,r)}else{y+=e.copy(m,y,a,r)}m[y++]=f;m[y++]=c;if(u<0){m[y++]=0;e.copy(m,y,r)}else{e.copy(m,y,r+u)}return m}e.exports={derToJose:derToJose,joseToDer:joseToDer}},4335:e=>{"use strict";function getParamSize(e){var t=(e/8|0)+(e%8===0?0:1);return t}var t={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};function getParamBytesForAlg(e){var r=t[e];if(r){return r}throw new Error('Unknown algorithm "'+e+'"')}e.exports=getParamBytesForAlg},2085:(e,t,r)=>{"use strict";const i=r(4782);const{createHmac:n,createVerify:o,createSign:s,timingSafeEqual:a,createPublicKey:u,constants:{RSA_PKCS1_PSS_PADDING:l,RSA_PSS_SALTLEN_DIGEST:h,RSA_PKCS1_PADDING:f,RSA_PSS_SALTLEN_MAX_SIGN:c,RSA_PSS_SALTLEN_AUTO:d},sign:p,verify:m}=r(7598);const{joseToDer:y,derToJose:v}=r(8210);const g=r(8285);const{TokenError:w}=r(2584);const b=/[=+/]/g;const M={"=":"","+":"-","/":"_"};const _=/^-----BEGIN(?: (RSA|EC|ENCRYPTED))? PRIVATE KEY-----/;const S=/^-----BEGIN(?: (RSA))? PUBLIC KEY-----/;const N="-----BEGIN CERTIFICATE-----";const E=new Set(["RSA","EC","OKP"]);const T=/-----BEGIN [A-Z0-9 ]+?-----/;const B=new g(1e3);const A=new g(1e3);const k=["HS256","HS384","HS512"];const R=["ES256","ES384","ES512"];const C=["RS256","RS384","RS512","PS256","PS384","PS512"];const O=["EdDSA"];const I={"1.2.840.10045.3.1.7":{bits:"256",names:["P-256","prime256v1"]},"1.3.132.0.10":{bits:"256",names:["secp256k1"]},"1.3.132.0.34":{bits:"384",names:["P-384","secp384r1"]},"1.3.132.0.35":{bits:"512",names:["P-521","secp521r1"]}};const x=i.define("PrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().objid()))}));const P=i.define("PublicKey",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().objid()))}));const j=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).optional().choice({namedCurve:this.objid()}))}));function base64UrlReplacer(e){return M[e]}function ensureSecretIsNotEmpty(e){if(e.length===0){throw new w(w.codes.invalidKey,"The key cannot be an empty string or buffer.")}}function cacheSet(e,t,r,i){e.set(t,[r,i]);return r||i}function isAsymmetricJwk(e){return Boolean(e)&&typeof e==="object"&&E.has(e.kty)}function isAsymmetricJwkJson(e){const t=e[0];if(t!=="{"&&t!=="["){return false}let r;try{r=JSON.parse(e)}catch{return false}return isAsymmetricJwk(r)||Array.isArray(r)&&r.some(isAsymmetricJwk)||Array.isArray(r.keys)&&r.keys.some(isAsymmetricJwk)}function locatePem(e){const t=e.search(T);if(t===-1){return{pem:null,isRawSecret:true}}return{pem:e.slice(t),isRawSecret:false}}function assertNotAsymmetricJwkJson(e){if(isAsymmetricJwkJson(e)){throw new w(w.codes.invalidKey,"Raw asymmetric JWK/JWKS JSON cannot be used as an HMAC secret.")}}function performDetectPrivateKeyAlgorithm(e,t){const r=e.trim();if(k.includes(t)){return t}const{pem:i,isRawSecret:n}=locatePem(r);if(n){assertNotAsymmetricJwkJson(r);return"HS256"}if(i.match(S)||i.startsWith(N)){throw new w(w.codes.invalidKey,"Public keys are not supported for signing.")}const o=i.match(_);if(!o){throw new w(w.codes.invalidKey,"Unsupported PEM private key.")}let s;let a;let u;switch(o[1]){case"RSA":return"RS256";case"EC":s=j.decode(i,"pem",{label:"EC PRIVATE KEY"});u=s.parameters.value.join(".");break;case"ENCRYPTED":return"ENCRYPTED";default:s=x.decode(i,"pem",{label:"PRIVATE KEY"});a=s.algorithm.algorithm.join(".");switch(a){case"1.2.840.113549.1.1.1":return"RS256";case"1.2.840.10045.2.1":u=s.algorithm.parameters.join(".");break;case"1.3.101.112":case"1.3.101.113":return"EdDSA";default:throw new w(w.codes.invalidKey,`Unsupported PEM PCKS8 private key with OID ${a}.`)}}const l=I[u];if(!l){throw new w(w.codes.invalidKey,`Unsupported EC private key with curve ${u}.`)}return`ES${l.bits}`}function performDetectPublicKeyAlgorithms(e){const t=e.trim();const{pem:r,isRawSecret:i}=locatePem(t);if(i){assertNotAsymmetricJwkJson(t);return k}const n=r.match(S);if(r.match(_)){throw new w(w.codes.invalidKey,"Private keys are not supported for verifying.")}else if(n&&n[1]==="RSA"){return C}else if(!n&&!r.startsWith(N)){throw new w(w.codes.invalidKey,"Unsupported PEM public key.")}let o=r;if(r.startsWith(N)){o=u(r).export({type:"spki",format:"pem"})}const s=P.decode(o,"pem",{label:"PUBLIC KEY"});const a=s.algorithm.algorithm.join(".");let l;switch(a){case"1.2.840.113549.1.1.1":return C;case"1.2.840.10045.2.1":l=s.algorithm.parameters.join(".");break;case"1.3.101.112":case"1.3.101.113":return["EdDSA"];default:throw new w(w.codes.invalidKey,`Unsupported PEM PCKS8 public key with OID ${a}.`)}const h=I[l];if(!h){throw new w(w.codes.invalidKey,`Unsupported EC public key with curve ${l}.`)}return[`ES${h.bits}`]}function detectPrivateKeyAlgorithm(e,t){if(e instanceof Buffer){e=e.toString("utf-8")}else if(typeof e!=="string"){throw new w(w.codes.invalidKey,"The private key must be a string or a buffer.")}const[r,i]=B.get(e)||[];if(r){return r}else if(i){throw i}try{const r=performDetectPrivateKeyAlgorithm(e,t);if(r==="ENCRYPTED"){return cacheSet(B,e,t)}return cacheSet(B,e,r)}catch(t){throw cacheSet(B,e,null,w.wrap(t,w.codes.invalidKey,"Unsupported PEM private key."))}}function detectPublicKeyAlgorithms(e,t){if(!e){return"none"}if(t&&t.length&&t.every((e=>k.includes(e)))){return t}const[r,i]=A.get(e)||[];if(r){return r}else if(i){throw i}try{if(e instanceof Buffer){e=e.toString("utf-8")}else if(typeof e!=="string"){throw new w(w.codes.invalidKey,"The public key must be a string or a buffer.")}return cacheSet(A,e,performDetectPublicKeyAlgorithms(e))}catch(t){throw cacheSet(A,e,null,w.wrap(t,w.codes.invalidKey,"Unsupported PEM public key."))}}function createSignature(e,t,r){try{const i=e.slice(0,2);const o=`sha${e.slice(2)}`;let a;let u;switch(i){case"HS":a=n(o,t).update(r).digest("base64");break;case"ES":a=v(p(o,Buffer.from(r,"utf-8"),t),e).toString("base64");break;case"RS":case"PS":u={key:t,padding:f,saltLength:c};if(i==="PS"){u.padding=l;u.saltLength=h}a=s(o).update(r).sign(u).toString("base64");break;case"Ed":a=p(undefined,Buffer.from(r,"utf-8"),t).toString("base64")}return a.replace(b,base64UrlReplacer)}catch(e){throw new w(w.codes.signError,"Cannot create the signature.",{originalError:e})}}function verifySignature(e,t,r,i){try{const s=e.slice(0,2);const u=`SHA${e.slice(2)}`;i=Buffer.from(i,"base64");if(s==="HS"){try{return a(n(u,t).update(r).digest(),i)}catch{return false}}else if(s==="Ed"){return m(undefined,Buffer.from(r,"utf-8"),t,i)}const c={key:t,padding:f,saltLength:d};if(s==="PS"){c.padding=l;c.saltLength=h}else if(s==="ES"){i=y(i,e)}return o("RSA-"+u).update(r).verify(c,i)}catch(e){throw new w(w.codes.verifyError,"Cannot verify the signature.",{originalError:e})}}e.exports={base64UrlMatcher:b,base64UrlReplacer:base64UrlReplacer,hsAlgorithms:k,rsaAlgorithms:C,esAlgorithms:R,edAlgorithms:O,detectPrivateKeyAlgorithm:detectPrivateKeyAlgorithm,detectPublicKeyAlgorithms:detectPublicKeyAlgorithms,ensureSecretIsNotEmpty:ensureSecretIsNotEmpty,createSignature:createSignature,verifySignature:verifySignature}},454:(e,t,r)=>{"use strict";const{TokenError:i}=r(2584);const n=/^[A-Za-z0-9_-]*$/;function decode({complete:e,checkTyp:t},r){if(r instanceof Buffer){r=r.toString("utf-8")}else if(typeof r!=="string"){throw new i(i.codes.invalidType,"The token must be a string or a buffer.")}const o=r.indexOf(".");const s=r.lastIndexOf(".");if(o===-1||o>=s){throw new i(i.codes.malformed,"The token is malformed.")}const a=r.slice(0,o);const u=r.slice(o+1,s);const l=r.slice(s+1);if(!n.test(a)){throw new i(i.codes.malformed,"The token header is not a valid base64url serialized JSON.")}if(!n.test(u)){throw new i(i.codes.malformed,"The token payload is not a valid base64url serialized JSON.")}if(!n.test(l)){throw new i(i.codes.invalidSignature,"The token signature is invalid.")}let h=false;try{const n=JSON.parse(Buffer.from(a,"base64").toString("utf-8"));if(!n||typeof n!=="object"||Array.isArray(n)){throw new i(i.codes.malformed,"The token header is not a valid JSON object.")}if(t&&n.typ!==t){throw new i(i.codes.invalidType,`The type must be "${t}".`,{header:n})}h=true;let o=Buffer.from(u,"base64").toString("utf-8");o=JSON.parse(o);if(!o||typeof o!=="object"||Array.isArray(o)){throw new i(i.codes.invalidPayload,"The payload must be an object",{payload:o})}return e?{header:n,payload:o,signature:l,input:r.slice(0,s)}:o}catch(e){throw i.wrap(e,i.codes.malformed,`The token ${h?"payload":"header"} is not a valid base64url serialized JSON.`)}}e.exports=function createDecoder(e={}){const t=e.complete||false;const r=e.checkTyp;return decode.bind(null,{complete:t,checkTyp:r})}},2584:e=>{"use strict";const t={invalidType:"FAST_JWT_INVALID_TYPE",invalidOption:"FAST_JWT_INVALID_OPTION",invalidAlgorithm:"FAST_JWT_INVALID_ALGORITHM",invalidClaimType:"FAST_JWT_INVALID_CLAIM_TYPE",invalidClaimValue:"FAST_JWT_INVALID_CLAIM_VALUE",invalidKey:"FAST_JWT_INVALID_KEY",invalidSignature:"FAST_JWT_INVALID_SIGNATURE",invalidPayload:"FAST_JWT_INVALID_PAYLOAD",malformed:"FAST_JWT_MALFORMED",inactive:"FAST_JWT_INACTIVE",expired:"FAST_JWT_EXPIRED",missingKey:"FAST_JWT_MISSING_KEY",keyFetchingError:"FAST_JWT_KEY_FETCHING_ERROR",signError:"FAST_JWT_SIGN_ERROR",verifyError:"FAST_JWT_VERIFY_ERROR",missingRequiredClaim:"FAST_JWT_MISSING_REQUIRED_CLAIM",missingSignature:"FAST_JWT_MISSING_SIGNATURE",invalidCritHeader:"FAST_JWT_INVALID_CRIT_HEADER"};class TokenError extends Error{constructor(e,t,r){super(t);Error.captureStackTrace(this,this.constructor);this.code=e;if(r){for(const e in r){this[e]=r[e]}}}}TokenError.codes=t;TokenError.wrap=function(e,t,r){if(e instanceof TokenError){return e}return new TokenError(t,r,{originalError:e})};e.exports={TokenError:TokenError,TOKEN_ERROR_CODES:t}},9714:(e,t,r)=>{"use strict";const{TokenError:i,TOKEN_ERROR_CODES:n}=r(2584);const o=r(454);const s=r(9250);const a=r(1946);e.exports={TokenError:i,TOKEN_ERROR_CODES:n,createDecoder:o,createVerifier:s,createSigner:a}},1946:(e,t,r)=>{"use strict";const{base64UrlMatcher:i,base64UrlReplacer:n,hsAlgorithms:o,esAlgorithms:s,rsaAlgorithms:a,edAlgorithms:u,detectPrivateKeyAlgorithm:l,ensureSecretIsNotEmpty:h,createSignature:f}=r(2085);const{TokenError:c}=r(2584);const{getAsyncKey:d,ensurePromiseCallback:p,assertFiniteNonNegativeNumber:m}=r(1299);const{createPrivateKey:y,createSecretKey:v}=r(7598);const{parse:g}=r(4332);const w=new Set([...o,...s,...a,...u,"none"]);const b=Array.from(w).join(", ");function checkIsCompatibleAlgorithm(e,t){const r=e.slice(0,2);const i=t.slice(0,2);let n=true;if(r==="RS"||r==="PS"){n=i==="RS"||r==="RS"&&t==="ENCRYPTED"}else if(r==="ES"||r==="Ed"){n=r===i||r==="ES"&&t==="ENCRYPTED"}if(!n){throw new c(c.codes.invalidKey,`Invalid private key provided for algorithm ${e}.`)}}function prepareKeyOrSecret(e,t){if(typeof e==="string"){e=Buffer.from(e,"utf-8")}if(t[0]==="H"){h(e);return v(e)}return y(e)}const M={code:"FAST_JWT_NON_FINITE_TIME_OPTION"};const _="This will throw an error in the next major version.";function warnIfTimeSpanIsInfinite(e,t,r){if(!Number.isFinite(e)){process.emitWarning(`The ${t} option is not a finite number, so it is ignored and does not set the ${r} claim. `+_,M)}}function warnIfClockTimestampIsNotFinite(e){if(typeof e==="number"&&!Number.isFinite(e)){process.emitWarning(Number.isNaN(e)?`The clockTimestamp option is NaN, so it is ignored as if it were unset. ${_}`:"The clockTimestamp option is Infinity, so the iat, exp and nbf claims computed from it are encoded as null. "+_,M)}}function sign({key:e,algorithm:t,noTimestamp:r,mutatePayload:o,clockTimestamp:s,expiresIn:a,notBefore:u,kid:h,typ:m,isAsync:y,additionalHeader:v,fixedPayload:g},w,b){const[M,_]=y?p(b):[];if(w===null||typeof w!=="object"){throw new c(c.codes.invalidType,"The payload must be an object.")}if(w.exp&&(!Number.isInteger(w.exp)||w.exp<0)){throw new c(c.codes.invalidClaimValue,"The exp claim must be a positive integer.")}if(w.nbf&&(!Number.isInteger(w.nbf)||w.nbf<0)){throw new c(c.codes.invalidClaimValue,"The nbf claim must be a positive integer.")}const S={alg:t,typ:m||"JWT",kid:h,...v};let N="";const E=w.iat!==undefined?w.iat*1e3:s??Date.now();const T={...w,...g,iat:r?undefined:Math.floor(E/1e3),exp:a!=null&&Number.isFinite(a)?Math.floor((E+a)/1e3):w.exp?w.exp:undefined,nbf:u!=null&&Number.isFinite(u)?Math.floor((E+u)/1e3):w.nbf?w.nbf:undefined};if(o){Object.assign(w,T)}N=Buffer.from(JSON.stringify(T),"utf-8").toString("base64").replace(i,n);if(!M){const r=Buffer.from(JSON.stringify(S),"utf-8").toString("base64").replace(i,n);const o=r+"."+N;const s=t==="none"?"":f(t,e,o);return o+"."+s}d(e,{header:S,payload:w},((e,r)=>{if(e){const t=c.wrap(e,c.codes.keyFetchingError,"Cannot fetch key.");return M(t)}if(typeof r==="string"){r=Buffer.from(r,"utf-8")}else if(!(r instanceof Buffer)){return M(new c(c.codes.keyFetchingError,"The key returned from the callback must be a string or a buffer containing a secret or a private key."))}let o;try{const e=l(r,t);if(t){checkIsCompatibleAlgorithm(t,e)}else{S.alg=t=e}r=prepareKeyOrSecret(r,t);const s=Buffer.from(JSON.stringify(S),"utf-8").toString("base64").replace(i,n);const a=s+"."+N;o=a+"."+f(t,r,a)}catch(e){return M(e)}M(null,o)}));return _}e.exports=function createSigner(e){let{key:t,algorithm:r,noTimestamp:i,mutatePayload:n,clockTimestamp:o,expiresIn:s,notBefore:a,jti:u,aud:h,iss:f,sub:d,nonce:p,kid:y,typ:v,header:M}={...e};if(r&&!w.has(r)){throw new c(c.codes.invalidOption,`The algorithm option must be one of the following values: ${b}.`)}const _=typeof t;const S=_==="object"&&t&&t.key&&t.passphrase;if(r==="none"){if(t){throw new c(c.codes.invalidOption,'The key option must not be provided when the algorithm option is "none".')}}else if(!t||_!=="string"&&!(t instanceof Buffer)&&_!=="function"&&!S){throw new c(c.codes.invalidOption,"The key option must be a string, a buffer, an object containing key/passphrase properties or a function returning the algorithm secret or private key.")}else if(S&&!r){throw new c(c.codes.invalidAlgorithm,"When using password protected key you must provide the algorithm option.")}if(t&&_!=="function"){const e=l(S?t.key:t,r);if(r){checkIsCompatibleAlgorithm(r,e)}else{r=e}t=prepareKeyOrSecret(t,r)}const N=s||Number.isNaN(s);if(N){if(typeof s==="string"){s=g(s)}if(typeof s!=="number"||Number.isNaN(s)){throw new c(c.codes.invalidOption,"The expiresIn option must be a positive number or a valid string.")}warnIfTimeSpanIsInfinite(s,"expiresIn","exp")}const E=a||Number.isNaN(a);if(E){if(typeof a==="string"){a=g(a)}if(typeof a!=="number"||Number.isNaN(a)||a<0){throw new c(c.codes.invalidOption,"The notBefore option must be a positive number or a valid string.")}warnIfTimeSpanIsInfinite(a,"notBefore","nbf")}m(o,"clockTimestamp");warnIfClockTimestampIsNotFinite(o);if(u&&typeof u!=="string"){throw new c(c.codes.invalidOption,"The jti option must be a string.")}if(h&&typeof h!=="string"&&!Array.isArray(h)){throw new c(c.codes.invalidOption,"The aud option must be a string or an array of strings.")}if(f&&typeof f!=="string"){throw new c(c.codes.invalidOption,"The iss option must be a string.")}if(d&&typeof d!=="string"){throw new c(c.codes.invalidOption,"The sub option must be a string.")}if(p&&typeof p!=="string"){throw new c(c.codes.invalidOption,"The nonce option must be a string.")}if(y&&typeof y!=="string"){throw new c(c.codes.invalidOption,"The kid option must be a string.")}if(M&&typeof M!=="object"){throw new c(c.codes.invalidOption,"The header option must be a object.")}const T={jti:u,aud:h,iss:f,sub:d,nonce:p};const B=Object.entries(T).reduce(((e,[t,r])=>{if(r!==undefined){e[t]=r}return e}),{});return sign.bind(null,{key:t,algorithm:r,noTimestamp:i,mutatePayload:n,clockTimestamp:o,expiresIn:s,notBefore:a,kid:y,typ:v,isAsync:_==="function",additionalHeader:M,fixedPayload:B})}},1299:(e,t,r)=>{"use strict";const{createHash:i}=r(7598);const{TokenError:n}=r(2584);const o=/"alg"\s*:\s*"[HERP]S(256|384)"/m;const s=/"alg"\s*:\s*"EdDSA"/m;const a=/"crv"\s*:\s*"Ed448"/m;function getAsyncKey(e,t,r){const i=e(t,r);if(i&&typeof i.then==="function"){i.then((e=>{process.nextTick((()=>r(null,e)))})).catch(r)}}function ensurePromiseCallback(e){if(typeof e==="function"){return[e]}let t,r;const i=new Promise(((e,i)=>{t=e;r=i}));return[function(e,i){if(e){return r(e)}return t(i)},i]}function hashToken(e){const t=e.split(".",1)[0];const r=Buffer.from(t,"base64").toString("utf-8");let n;if(r.match(s)&&r.match(a)){n=i("shake256",{outputLength:114})}else{const e=r.match(o);n=i(`sha${e?e[1]:"512"}`)}return n.update(e).digest("hex")}function assertFiniteNonNegativeNumber(e,t){if(e!==undefined&&(typeof e!=="number"||!Number.isFinite(e)||e<0)){throw new n(n.codes.invalidOption,`The ${t} option must be a finite, non-negative number.`)}}e.exports={getAsyncKey:getAsyncKey,ensurePromiseCallback:ensurePromiseCallback,hashToken:hashToken,assertFiniteNonNegativeNumber:assertFiniteNonNegativeNumber}},9250:(e,t,r)=>{"use strict";const{createPublicKey:i,createSecretKey:n}=r(7598);const{isRegExp:o}=r(7975).types;const s=r(8285);const a=r(346);const{hsAlgorithms:u,verifySignature:l,detectPublicKeyAlgorithms:h,ensureSecretIsNotEmpty:f}=r(2085);const c=r(454);const{TokenError:d}=r(2584);const{getAsyncKey:p,ensurePromiseCallback:m,hashToken:y,assertFiniteNonNegativeNumber:v}=r(1299);const g=1e3;function exactStringClaimMatcher(e,t){return e===t}function checkAreCompatibleAlgorithms(e,t){for(const r of e){if(t.includes(r)){return}}throw new d(d.codes.invalidKey,`Invalid public key provided for algorithms ${e.join(", ")}.`)}function prepareKeyOrSecret(e,t){if(typeof e==="string"){e=Buffer.from(e,"utf-8")}if(t){f(e);return n(e)}return i(e)}function isRegExpLike(e){return o(e)||e instanceof RegExp}function checkForUnsafeRegExp(e,t){const r=Array.isArray(e)?e:[e];for(const e of r){if(isRegExpLike(e)&&!a(e)){process.emitWarning(`The ${t} option contains an unsafe RegExp ${e} that may cause a ReDoS attack. Please review it. `+"See https://github.com/nearform/fast-jwt/security/advisories/GHSA-cjw9-ghj4-fwxf for details.",{code:"FAST_JWT_UNSAFE_REGEXP"})}}}function ensureStringClaimMatcher(e){if(!Array.isArray(e)){e=[e]}return e.filter((e=>e)).map((e=>{if(isRegExpLike(e)){return{test:t=>{try{e.lastIndex=0}catch{}return e.test(t)}}}if(e&&typeof e.test==="function"){return e}return{test:exactStringClaimMatcher.bind(null,e)}}))}function createCache(e){const t=parseInt(e===true?g:e,10);return t>0?new s(t):null}function cacheSet({cache:e,token:t,cacheTTL:r,payload:i,ignoreExpiration:n,ignoreNotBefore:o,maxAge:s,clockTimestamp:a=Date.now(),clockTolerance:u,errorCacheTTL:l,cacheKeyBuilder:h},f){if(!e){return f}const c=[f,0,0];if(f instanceof d){const r=typeof l==="function"?l(f):l;c[2]=a+u+r;e.set(h(t),c);return f}c[1]=!o&&typeof i.nbf==="number"?i.nbf*1e3-u:0;let p=a+u+r;if(!n&&typeof i.exp==="number"){p=Math.min(p,i.exp*1e3+u)}if(typeof s==="number"&&typeof i.iat==="number"){p=Math.min(p,i.iat*1e3+s)}c[2]=p;e.set(h(t),c);return f}function handleCachedResult(e,t,r){if(e instanceof d){if(!t){throw e}t(e)}else{if(!t){return e}t(null,e)}return r}function validateAlgorithmAndSignature(e,t,r,i,n){if(!n.includes(t.alg)){throw new d(d.codes.invalidAlgorithm,"The token algorithm is invalid.")}if(r&&!l(t.alg,i,e,r)){throw new d(d.codes.invalidSignature,"The token signature is invalid.")}}function validateClaimType(e,t,r,i,n){const o=r?`The ${t} claim must be a ${n} or an array of ${n}s.`:`The ${t} claim must be a ${n}.`;if(i&&!r){throw new d(d.codes.invalidClaimValue,o)}if(e.map((e=>typeof e)).some((e=>e!==n))){throw new d(d.codes.invalidClaimType,o)}}function validateClaimValues(e,t,r,i){const n=i?`None of ${t} claim values are allowed.`:`The ${t} claim value is not allowed.`;if(!e.some((e=>r.some((t=>t.test(e)))))){throw new d(d.codes.invalidClaimValue,n)}}function validateClaimDateValue(e,t,r,i,n,o){const s=e*1e3+(t||0);const a=i?r>=s:r<=s;if(!a){throw new d(d.codes[n],`The token ${o} at ${new Date(s).toISOString()}.`)}}const w=new Set(["alg","jku","jwk","kid","x5u","x5c","x5t","x5t#S256","typ","cty","crit"]);function validateCrit(e,t){if(!e.crit)return;if(!Array.isArray(e.crit)||e.crit.length===0){throw new d(d.codes.invalidCritHeader,"The crit header must be a non-empty array.")}const r=new Set;for(const i of e.crit){if(typeof i!=="string"){throw new d(d.codes.invalidCritHeader,"Each crit entry must be a string.")}if(w.has(i)){throw new d(d.codes.invalidCritHeader,`The crit header must not contain the standard header parameter name "${i}".`)}if(r.has(i)){throw new d(d.codes.invalidCritHeader,`Duplicate entry "${i}" in crit header.`)}r.add(i);if(!t.has(i)){throw new d(d.codes.invalidCritHeader,`Critical extension "${i}" is not supported.`)}if(!(i in e)){throw new d(d.codes.invalidCritHeader,`Critical extension "${i}" is listed in crit but is not present in the header.`)}}}function verifyToken(e,{input:t,header:r,payload:i,signature:n},{validators:o,allowedAlgorithms:s,checkTyp:a,clockTimestamp:u,requiredClaims:l,allowedCritHeaders:h}){const f=e instanceof Buffer?e.length:!!e;if(f&&!n){throw new d(d.codes.missingSignature,"The token signature is missing.")}else if(!f&&n){throw new d(d.codes.missingKey,"The key option is missing.")}validateAlgorithmAndSignature(t,r,n,e,s);validateCrit(r,h);if(a&&(typeof r.typ!=="string"||a!==r.typ.toLowerCase().replace(/^application\//,""))){throw new d(d.codes.invalidType,"Invalid typ.")}if(l){for(const e of l){if(!(e in i)){throw new d(d.codes.missingRequiredClaim,`The ${e} claim is required.`)}}}const c=u||Date.now();for(const{type:e,claim:t,allowed:r,array:n,modifier:s,greater:a,errorCode:u,errorVerb:l}of o){const o=i[t];const h=Array.isArray(o);const f=h?o:[o];if(!(t in i)){continue}validateClaimType(f,t,n,h,e==="date"?"number":"string");if(e==="date"){validateClaimDateValue(o,s,c,a,u,l)}else{validateClaimValues(f,t,r,h)}}}function verify({key:e,allowedAlgorithms:t,complete:r,cacheTTL:i,checkTyp:n,clockTimestamp:o,clockTolerance:s,ignoreExpiration:a,ignoreNotBefore:l,maxAge:f,isAsync:c,validators:y,decode:v,cache:g,requiredClaims:w,allowedCritHeaders:b,errorCacheTTL:M,cacheKeyBuilder:_},S,N){const[E,T]=c?m(N):[];if(!(S instanceof Buffer)&&typeof S!=="string"){const e=new d(d.codes.invalidType,"The token must be a string or a buffer.");if(E){E(e);return T}throw e}if(g){const[e,t,r]=g.get(_(S))||[undefined,0,0];const i=o||Date.now();if(typeof e!=="undefined"&&i>=t&&i<=r){return handleCachedResult(e,E,T)}}let B;try{B=v(S)}catch(e){if(E){E(e);return T}throw e}const{header:A,payload:k,signature:R,input:C}=B;const O={cache:g,token:S,cacheTTL:i,errorCacheTTL:M,ignoreExpiration:a,ignoreNotBefore:l,maxAge:f,clockTimestamp:o,clockTolerance:s,payload:k,cacheKeyBuilder:_};const I={validators:y,allowedAlgorithms:t,checkTyp:n,clockTimestamp:o,clockTolerance:s,requiredClaims:w,allowedCritHeaders:b};if(!E){try{verifyToken(e,B,I);return cacheSet(O,r?{header:A,payload:k,signature:R,input:C}:k)}catch(e){throw cacheSet(O,e)}}p(e,{header:A,payload:k,signature:R},((e,i)=>{if(e){return E(cacheSet(O,d.wrap(e,d.codes.keyFetchingError,"Cannot fetch key.")))}if(typeof i==="string"){i=Buffer.from(i,"utf-8")}else if(!(i instanceof Buffer)){return E(cacheSet(O,new d(d.codes.keyFetchingError,"The key returned from the callback must be a string or a buffer containing a secret or a public key.")))}try{const e=h(i);if(I.allowedAlgorithms.length){checkAreCompatibleAlgorithms(t,e)}else{I.allowedAlgorithms=e}i=prepareKeyOrSecret(i,e[0]===u[0]);verifyToken(i,B,I)}catch(e){return E(cacheSet(O,e))}E(null,cacheSet(O,r?{header:A,payload:k,signature:R,input:S}:k))}));return T}e.exports=function createVerifier(e){let{key:t,algorithms:r,complete:i,cache:n,cacheTTL:o,errorCacheTTL:s,checkTyp:a,clockTimestamp:l,clockTolerance:f,ignoreExpiration:p,ignoreNotBefore:m,maxAge:g,allowedJti:w,allowedAud:b,allowedIss:M,allowedSub:_,allowedNonce:S,requiredClaims:N,allowedCritHeaders:E,cacheKeyBuilder:T}={cacheTTL:6e5,clockTolerance:0,errorCacheTTL:-1,cacheKeyBuilder:y,...e};if(!Array.isArray(r)){r=[]}const B=typeof t;const A=r.length>0&&r.every((e=>e==="none"));if(A){if(t){throw new d(d.codes.invalidOption,'The key option must not be provided when the only allowed algorithm is "none".')}}else if(B!=="string"&&B!=="object"&&B!=="function"){throw new d(d.codes.invalidOption,"The key option must be a string, a buffer or a function returning the algorithm secret or public key.")}else if(!t&&B!=="function"){throw new d(d.codes.invalidKey,'The key option is required unless the only allowed algorithm is "none".')}if(t&&B!=="function"){const e=h(t,r);if(r.length){checkAreCompatibleAlgorithms(r,e)}else{r=e}t=prepareKeyOrSecret(t,u.includes(e[0]))}v(l,"clockTimestamp");v(f,"clockTolerance");if(o!==undefined&&(typeof o!=="number"||Number.isNaN(o)||o<0)){throw new d(d.codes.invalidOption,"The cacheTTL option must be a non-negative number.")}if(s&&typeof s!=="function"&&typeof s!=="number"||s<-1){throw new d(d.codes.invalidOption,"The errorCacheTTL option must be a number greater than -1 or a function.")}if(N&&!Array.isArray(N)){throw new d(d.codes.invalidOption,"The requiredClaims option must be an array.")}if(w)checkForUnsafeRegExp(w,"allowedJti");if(b)checkForUnsafeRegExp(b,"allowedAud");if(M)checkForUnsafeRegExp(M,"allowedIss");if(_)checkForUnsafeRegExp(_,"allowedSub");if(S)checkForUnsafeRegExp(S,"allowedNonce");if(E!==undefined&&(!Array.isArray(E)||E.some((e=>typeof e!=="string"||e.length===0)))){throw new d(d.codes.invalidOption,"The allowedCritHeaders option must be an array of strings.")}const k=new Set(E||[]);const R=createCache(n);if(R&&e?.cacheKeyBuilder){process.emitWarning("A custom cacheKeyBuilder is in use with caching enabled. "+"Cache key collisions can lead to identity/authorization bypass. "+"Make sure your cacheKeyBuilder generates unique keys for different tokens. "+"See https://github.com/nearform/fast-jwt/security/advisories/GHSA-rp9m-7r4c-75qg",{code:"FAST_JWT_CACHE_KEY_BUILDER_SECURITY_RISK"})}const C=[];if(!m){C.push({type:"date",claim:"nbf",errorCode:"inactive",errorVerb:"will be active",greater:true,modifier:-f})}if(!p){C.push({type:"date",claim:"exp",errorCode:"expired",errorVerb:"has expired",modifier:+f})}if(typeof g==="number"){C.push({type:"date",claim:"iat",errorCode:"expired",errorVerb:"has expired",modifier:g})}if(w){C.push({type:"string",claim:"jti",allowed:ensureStringClaimMatcher(w)})}if(b){C.push({type:"string",claim:"aud",allowed:ensureStringClaimMatcher(b),array:true})}if(M){C.push({type:"string",claim:"iss",allowed:ensureStringClaimMatcher(M)})}if(_){C.push({type:"string",claim:"sub",allowed:ensureStringClaimMatcher(_)})}if(S){C.push({type:"string",claim:"nonce",allowed:ensureStringClaimMatcher(S)})}const O=a?a.toLowerCase().replace(/^application\//,""):null;const I={key:t,allowedAlgorithms:r,complete:i,cacheTTL:o,errorCacheTTL:s,checkTyp:O,clockTimestamp:l,clockTolerance:f,ignoreExpiration:p,ignoreNotBefore:m,maxAge:g,isAsync:B==="function",validators:C,decode:c({complete:true}),cache:R,requiredClaims:N,allowedCritHeaders:k,cacheKeyBuilder:T};const x=verify.bind(null,I);x.cache=I.cache;return x}},8013:(e,t,r)=>{try{var i=r(9023);if(typeof i.inherits!=="function")throw"";e.exports=i.inherits}catch(t){e.exports=r(1638)}},1638:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},7551:e=>{e.exports=assert;function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}assert.equal=function assertEqual(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},8285:(e,t,r)=>{var i=r(8026),n=r(8168),o=r(9520),s=r(8362);function LRUCache(e,t,r){if(arguments.length<2){r=e;e=null;t=null}this.capacity=r;if(typeof this.capacity!=="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");else if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var i=o.getPointerArray(r);this.forward=new i(r);this.backward=new i(r);this.K=typeof e==="function"?new e(r):new Array(r);this.V=typeof t==="function"?new t(r):new Array(r);this.size=0;this.head=0;this.tail=0;this.items={}}LRUCache.prototype.clear=function(){this.size=0;this.head=0;this.tail=0;this.items={}};LRUCache.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var r=this.backward[e],i=this.forward[e];if(this.tail===e){this.tail=r}else{this.backward[i]=r}this.forward[r]=i;this.backward[t]=e;this.head=e;this.forward[e]=t;return this};LRUCache.prototype.set=function(e,t){var r=this.items[e];if(typeof r!=="undefined"){this.splayOnTop(r);this.V[r]=t;return}if(this.size<this.capacity){r=this.size++}else{r=this.tail;this.tail=this.backward[r];delete this.items[this.K[r]]}this.items[e]=r;this.K[r]=e;this.V[r]=t;this.forward[r]=this.head;this.backward[this.head]=r;this.head=r};LRUCache.prototype.setpop=function(e,t){var r=null;var i=null;var n=false;var o=this.items[e];if(typeof o!=="undefined"){this.splayOnTop(o);r=this.V[o];this.V[o]=t;return{evicted:false,key:e,value:r}}if(this.size<this.capacity){o=this.size++}else{o=this.tail;this.tail=this.backward[o];r=this.V[o];i=this.K[o];delete this.items[i];n=true}this.items[e]=o;this.K[o]=e;this.V[o]=t;this.forward[o]=this.head;this.backward[this.head]=o;this.head=o;if(n){return{evicted:true,key:i,value:r}}else{return null}};LRUCache.prototype.has=function(e){return e in this.items};LRUCache.prototype.get=function(e){var t=this.items[e];if(typeof t==="undefined")return;this.splayOnTop(t);return this.V[t]};LRUCache.prototype.peek=function(e){var t=this.items[e];if(typeof t==="undefined")return;return this.V[t]};LRUCache.prototype.forEach=function(e,t){t=arguments.length>1?t:this;var r=0,i=this.size;var n=this.head,o=this.K,s=this.V,a=this.forward;while(r<i){e.call(t,s[n],o[n],this);n=a[n];r++}};LRUCache.prototype.keys=function(){var e=0,t=this.size;var r=this.head,n=this.K,o=this.forward;return new i((function(){if(e>=t)return{done:true};var i=n[r];e++;if(e<t)r=o[r];return{done:false,value:i}}))};LRUCache.prototype.values=function(){var e=0,t=this.size;var r=this.head,n=this.V,o=this.forward;return new i((function(){if(e>=t)return{done:true};var i=n[r];e++;if(e<t)r=o[r];return{done:false,value:i}}))};LRUCache.prototype.entries=function(){var e=0,t=this.size;var r=this.head,n=this.K,o=this.V,s=this.forward;return new i((function(){if(e>=t)return{done:true};var i=n[r],a=o[r];e++;if(e<t)r=s[r];return{done:false,value:[i,a]}}))};if(typeof Symbol!=="undefined")LRUCache.prototype[Symbol.iterator]=LRUCache.prototype.entries;LRUCache.prototype.inspect=function(){var e=new Map;var t=this.entries(),r;while(r=t.next(),!r.done)e.set(r.value[0],r.value[1]);Object.defineProperty(e,"constructor",{value:LRUCache,enumerable:false});return e};if(typeof Symbol!=="undefined")LRUCache.prototype[Symbol.for("nodejs.util.inspect.custom")]=LRUCache.prototype.inspect;LRUCache.from=function(e,t,r,i){if(arguments.length<2){i=s.guessLength(e);if(typeof i!=="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else if(arguments.length===2){i=t;t=null;r=null}var o=new LRUCache(t,r,i);n(e,(function(e,t){o.set(t,e)}));return o};e.exports=LRUCache},8362:(e,t,r)=>{var i=r(8168);var n=r(9520);function isArrayLike(e){return Array.isArray(e)||n.isTypedArray(e)}function guessLength(e){if(typeof e.length==="number")return e.length;if(typeof e.size==="number")return e.size;return}function toArray(e){var t=guessLength(e);var r=typeof t==="number"?new Array(t):[];var n=0;i(e,(function(e){r[n++]=e}));return r}function toArrayWithIndices(e){var t=guessLength(e);var r=typeof t==="number"?n.getPointerArray(t):Array;var o=typeof t==="number"?new Array(t):[];var s=typeof t==="number"?new r(t):[];var a=0;i(e,(function(e){o[a]=e;s[a]=a++}));return[o,s]}t.isArrayLike=isArrayLike;t.guessLength=guessLength;t.toArray=toArray;t.toArrayWithIndices=toArrayWithIndices},9520:(e,t)=>{var r=Math.pow(2,8)-1,i=Math.pow(2,16)-1,n=Math.pow(2,32)-1;var o=Math.pow(2,7)-1,s=Math.pow(2,15)-1,a=Math.pow(2,31)-1;t.getPointerArray=function(e){var t=e-1;if(t<=r)return Uint8Array;if(t<=i)return Uint16Array;if(t<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")};t.getSignedPointerArray=function(e){var t=e-1;if(t<=o)return Int8Array;if(t<=s)return Int16Array;if(t<=a)return Int32Array;return Float64Array};t.getNumberType=function(e){if(e===(e|0)){if(Math.sign(e)===-1){if(e<=127&&e>=-128)return Int8Array;if(e<=32767&&e>=-32768)return Int16Array;return Int32Array}else{if(e<=255)return Uint8Array;if(e<=65535)return Uint16Array;return Uint32Array}}return Float64Array};var u={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(e,r){var i=null,n=0,o,s,a,l,h;for(l=0,h=e.length;l<h;l++){a=r?r(e[l]):e[l];s=t.getNumberType(a);o=u[s.name];if(o>n){n=o;i=s}}return i};t.isTypedArray=function(e){return typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(e)};t.concat=function(){var e=0,t,r,i;for(t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var n=new arguments[0].constructor(e);for(t=0,r=0;t<i;t++){n.set(arguments[t],r);r+=arguments[t].length}return n};t.indices=function(e){var r=t.getPointerArray(e);var i=new r(e);for(var n=0;n<e;n++)i[n]=n;return i}},8168:(e,t,r)=>{var i=r(7697);var n=i.ARRAY_BUFFER_SUPPORT;var o=i.SYMBOL_SUPPORT;e.exports=function forEach(e,t){var r,i,s,a,u;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if(typeof t!=="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||n&&ArrayBuffer.isView(e)||typeof e==="string"||e.toString()==="[object Arguments]"){for(s=0,a=e.length;s<a;s++)t(e[s],s);return}if(typeof e.forEach==="function"){e.forEach(t);return}if(o&&Symbol.iterator in e&&typeof e.next!=="function"){e=e[Symbol.iterator]()}if(typeof e.next==="function"){r=e;s=0;while(u=r.next(),u.done!==true){t(u.value,s);s++}return}for(i in e){if(e.hasOwnProperty(i)){t(e[i],i)}}return}},8026:e=>{function Iterator(e){if(typeof e!=="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}if(typeof Symbol!=="undefined")Iterator.prototype[Symbol.iterator]=function(){return this};Iterator.of=function(){var e=arguments,t=e.length,r=0;return new Iterator((function(){if(r>=t)return{done:true};return{done:false,value:e[r++]}}))};Iterator.empty=function(){var e=new Iterator((function(){return{done:true}}));return e};Iterator.fromSequence=function(e){var t=0,r=e.length;return new Iterator((function(){if(t>=r)return{done:true};return{done:false,value:e[t++]}}))};Iterator.is=function(e){if(e instanceof Iterator)return true;return typeof e==="object"&&e!==null&&typeof e.next==="function"};e.exports=Iterator},7697:(e,t)=>{t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer!=="undefined";t.SYMBOL_SUPPORT=typeof Symbol!=="undefined"},1566:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))i(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.types=void 0;const o=r(4140);Object.defineProperty(t,"types",{enumerable:true,get:function(){return o.types}});n(r(2747),t);n(r(2108),t);const s=r(2747);const a=r(2108);n(r(4140),t);t["default"]=s.tokenizer;e.exports=s.tokenizer;e.exports.types=o.types;e.exports.reconstruct=a.reconstruct},2108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.reconstruct=void 0;const i=r(4140);const n=r(2691);const reduceStack=e=>e.map(t.reconstruct).join("");const createAlternate=e=>{if("options"in e){return e.options.map(reduceStack).join("|")}else if("stack"in e){return reduceStack(e.stack)}else{throw new Error(`options or stack must be Root or Group token`)}};const reconstruct=e=>{switch(e.type){case i.types.ROOT:return createAlternate(e);case i.types.CHAR:{const t=String.fromCharCode(e.value);return(/[[\\{}$^.|?*+()]/.test(t)?"\\":"")+t}case i.types.POSITION:if(e.value==="^"||e.value==="$"){return e.value}else{return`\\${e.value}`}case i.types.REFERENCE:return`\\${e.value}`;case i.types.SET:return(0,n.writeSetTokens)(e);case i.types.GROUP:{const t=e.name?`?<${e.name}>`:e.remember?"":e.followedBy?"?=":e.notFollowedBy?"?!":"?:";return`(${t}${createAlternate(e)})`}case i.types.REPETITION:{const{min:r,max:i}=e;let n;if(r===0&&i===1){n="?"}else if(r===1&&i===Infinity){n="+"}else if(r===0&&i===Infinity){n="*"}else if(i===Infinity){n=`{${r},}`}else if(r===i){n=`{${r}}`}else{n=`{${r},${i}}`}return`${(0,t.reconstruct)(e.value)}${n}`}case i.types.RANGE:return`${(0,n.setChar)(e.from)}-${(0,n.setChar)(e.to)}`;default:throw new Error(`Invalid token type ${e}`)}};t.reconstruct=reconstruct},6080:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[t.length]=r;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=ownKeys(e),o=0;o<r.length;o++)if(r[o]!=="default")i(t,e,r[o]);n(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.NOTANYCHAR=t.WHITESPACE=t.WORDS=t.INTS=void 0;const s=o(r(4637));const a=r(4140);function setToLookup(e){let t={};let r=0;for(const i of e){if(i.type===a.types.CHAR){t[i.value]=true}if(i.type===a.types.RANGE){t[`${i.from}-${i.to}`]=true}r+=1}return{lookup:()=>Object.assign({},t),len:r}}t.INTS=setToLookup(s.ints().set);t.WORDS=setToLookup(s.words().set);t.WHITESPACE=setToLookup(s.whitespace().set);t.NOTANYCHAR=setToLookup(s.anyChar().set)},4637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.anyChar=t.notWhitespace=t.whitespace=t.notInts=t.ints=t.notWords=t.words=void 0;const i=r(4140);const INTS=()=>[{type:i.types.RANGE,from:48,to:57}];const WORDS=()=>[{type:i.types.CHAR,value:95},{type:i.types.RANGE,from:97,to:122},{type:i.types.RANGE,from:65,to:90},{type:i.types.RANGE,from:48,to:57}];const WHITESPACE=()=>[{type:i.types.CHAR,value:9},{type:i.types.CHAR,value:10},{type:i.types.CHAR,value:11},{type:i.types.CHAR,value:12},{type:i.types.CHAR,value:13},{type:i.types.CHAR,value:32},{type:i.types.CHAR,value:160},{type:i.types.CHAR,value:5760},{type:i.types.RANGE,from:8192,to:8202},{type:i.types.CHAR,value:8232},{type:i.types.CHAR,value:8233},{type:i.types.CHAR,value:8239},{type:i.types.CHAR,value:8287},{type:i.types.CHAR,value:12288},{type:i.types.CHAR,value:65279}];const NOTANYCHAR=()=>[{type:i.types.CHAR,value:10},{type:i.types.CHAR,value:13},{type:i.types.CHAR,value:8232},{type:i.types.CHAR,value:8233}];const words=()=>({type:i.types.SET,set:WORDS(),not:false});t.words=words;const notWords=()=>({type:i.types.SET,set:WORDS(),not:true});t.notWords=notWords;const ints=()=>({type:i.types.SET,set:INTS(),not:false});t.ints=ints;const notInts=()=>({type:i.types.SET,set:INTS(),not:true});t.notInts=notInts;const whitespace=()=>({type:i.types.SET,set:WHITESPACE(),not:false});t.whitespace=whitespace;const notWhitespace=()=>({type:i.types.SET,set:WHITESPACE(),not:true});t.notWhitespace=notWhitespace;const anyChar=()=>({type:i.types.SET,set:NOTANYCHAR(),not:true});t.anyChar=anyChar},2747:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[t.length]=r;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=ownKeys(e),o=0;o<r.length;o++)if(r[o]!=="default")i(t,e,r[o]);n(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.tokenizer=void 0;const s=o(r(3024));const a=r(4140);const u=o(r(4637));const l=/^[a-zA-Z_$]$/i;const h=/^[a-zA-Z0-9_$]$/i;const f=/\d/;const tokenizer=e=>{let t=0,r;let i={type:a.types.ROOT,stack:[]};let n=i;let o=i.stack;let c=[];let d=[];let p=0;const repeatErr=t=>{throw new SyntaxError(`Invalid regular expression: /${e}/: Nothing to repeat at column ${t-1}`)};let m=s.strToChars(e);while(t<m.length){switch(r=m[t++]){case"\\":if(t===m.length){throw new SyntaxError(`Invalid regular expression: /${e}/: \\ at end of pattern`)}switch(r=m[t++]){case"b":o.push({type:a.types.POSITION,value:"b"});break;case"B":o.push({type:a.types.POSITION,value:"B"});break;case"w":o.push(u.words());break;case"W":o.push(u.notWords());break;case"d":o.push(u.ints());break;case"D":o.push(u.notInts());break;case"s":o.push(u.whitespace());break;case"S":o.push(u.notWhitespace());break;default:if(f.test(r)){let e=r;while(t<m.length&&f.test(m[t])){e+=m[t++]}let i=parseInt(e,10);const n={type:a.types.REFERENCE,value:i};o.push(n);d.push({reference:n,stack:o,index:o.length-1})}else{o.push({type:a.types.CHAR,value:r.charCodeAt(0)})}}break;case"^":o.push({type:a.types.POSITION,value:"^"});break;case"$":o.push({type:a.types.POSITION,value:"$"});break;case"[":{let r;if(m[t]==="^"){r=true;t++}else{r=false}let i=s.tokenizeClass(m.slice(t),e);t+=i[1];o.push({type:a.types.SET,set:i[0],not:r});break}case".":o.push(u.anyChar());break;case"(":{let i={type:a.types.GROUP,stack:[],remember:true};if(m[t]==="?"){r=m[t+1];t+=2;if(r==="="){i.followedBy=true;i.remember=false}else if(r==="!"){i.notFollowedBy=true;i.remember=false}else if(r==="<"){let r="";if(l.test(m[t])){r+=m[t];t++}else{throw new SyntaxError(`Invalid regular expression: /${e}/: Invalid capture group name, character '${m[t]}'`+` after '<' at column ${t+1}`)}while(t<m.length&&h.test(m[t])){r+=m[t];t++}if(m[t]!==">"){throw new SyntaxError(`Invalid regular expression: /${e}/: Unclosed capture group name, expected '>', found`+` '${m[t]}' at column ${t+1}`)}i.name=r;t++}else if(r===":"){i.remember=false}else{throw new SyntaxError(`Invalid regular expression: /${e}/: Invalid group, character '${r}'`+` after '?' at column ${t-1}`)}}else{p+=1}o.push(i);c.push(n);n=i;o=i.stack;break}case")":if(c.length===0){throw new SyntaxError(`Invalid regular expression: /${e}/: Unmatched ) at column ${t-1}`)}n=c.pop();o=n.options?n.options[n.options.length-1]:n.stack;break;case"|":{if(!n.options){n.options=[n.stack];delete n.stack}let e=[];n.options.push(e);o=e;break}case"{":{let e=/^(\d+)(,(\d+)?)?\}/.exec(m.slice(t)),r,i;if(e!==null){if(o.length===0){repeatErr(t)}r=parseInt(e[1],10);i=e[2]?e[3]?parseInt(e[3],10):Infinity:r;t+=e[0].length;o.push({type:a.types.REPETITION,min:r,max:i,value:o.pop()})}else{o.push({type:a.types.CHAR,value:123})}break}case"?":if(o.length===0){repeatErr(t)}o.push({type:a.types.REPETITION,min:0,max:1,value:o.pop()});break;case"+":if(o.length===0){repeatErr(t)}o.push({type:a.types.REPETITION,min:1,max:Infinity,value:o.pop()});break;case"*":if(o.length===0){repeatErr(t)}o.push({type:a.types.REPETITION,min:0,max:Infinity,value:o.pop()});break;default:o.push({type:a.types.CHAR,value:r.charCodeAt(0)})}}if(c.length!==0){throw new SyntaxError(`Invalid regular expression: /${e}/: Unterminated group`)}updateReferences(d,p);return i};t.tokenizer=tokenizer;function updateReferences(e,t){for(const r of e.reverse()){if(t<r.reference.value){r.reference.type=a.types.CHAR;const e=r.reference.value.toString();r.reference.value=parseInt(e,8);if(!/^[0-7]+$/.test(e)){let t=0;while(e[t]!=="8"&&e[t]!=="9"){t+=1}if(t===0){r.reference.value=e.charCodeAt(0);t+=1}else{r.reference.value=parseInt(e.slice(0,t),8)}if(e.length>t){const i=r.stack.splice(r.index+1);for(const i of e.slice(t)){r.stack.push({type:a.types.CHAR,value:i.charCodeAt(0)})}r.stack.push(...i)}}}}}},4140:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))i(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(9524),t);n(r(9641),t);n(r(8895),t)},8895:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},9524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},9641:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.types=void 0;var r;(function(e){e[e["ROOT"]=0]="ROOT";e[e["GROUP"]=1]="GROUP";e[e["POSITION"]=2]="POSITION";e[e["SET"]=3]="SET";e[e["RANGE"]=4]="RANGE";e[e["REPETITION"]=5]="REPETITION";e[e["REFERENCE"]=6]="REFERENCE";e[e["CHAR"]=7]="CHAR"})(r||(t.types=r={}))},3024:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[t.length]=r;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=ownKeys(e),o=0;o<r.length;o++)if(r[o]!=="default")i(t,e,r[o]);n(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.tokenizeClass=t.strToChars=void 0;const s=r(4140);const a=o(r(4637));const u="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?";const strToChars=e=>{const t=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e.replace(t,((e,t,r,i,n,o,s)=>{if(r){return e}let a=t?8:i?parseInt(i,16):n?parseInt(n,16):o?u.indexOf(o):{0:0,t:9,n:10,v:11,f:12,r:13}[s];let l=String.fromCharCode(a);return/[[\]{}^$.|?*+()]/.test(l)?`\\${l}`:l}))};t.strToChars=strToChars;const tokenizeClass=(e,t="")=>{var r,i,n,o,u,l,h;let f=[],c,d;const p=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g;while((c=p.exec(e))!==null){const e=(h=(l=(u=(o=(n=(i=(r=c[1]&&a.words())!==null&&r!==void 0?r:c[2]&&a.ints())!==null&&i!==void 0?i:c[3]&&a.whitespace())!==null&&n!==void 0?n:c[4]&&a.notWords())!==null&&o!==void 0?o:c[5]&&a.notInts())!==null&&u!==void 0?u:c[6]&&a.notWhitespace())!==null&&l!==void 0?l:c[7]&&{type:s.types.RANGE,from:(c[8]||c[9]).charCodeAt(0),to:(d=c[10]).charCodeAt(d.length-1)})!==null&&h!==void 0?h:(d=c[16])&&{type:s.types.CHAR,value:d.charCodeAt(0)};if(e){f.push(e)}else{return[f,p.lastIndex]}}throw new SyntaxError(`Invalid regular expression: /${t}/: Unterminated character class`)};t.tokenizeClass=tokenizeClass},2691:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[t.length]=r;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=ownKeys(e),o=0;o<r.length;o++)if(r[o]!=="default")i(t,e,r[o]);n(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.setChar=setChar;t.writeSetTokens=writeSetTokens;const s=r(4140);const a=o(r(6080));function setChar(e){return e===94?"\\^":e===92?"\\\\":e===93?"\\]":e===45?"\\-":String.fromCharCode(e)}function isSameSet(e,{lookup:t,len:r}){if(r!==e.length){return false}const i=t();for(const t of e){if(t.type===s.types.SET){return false}const e=t.type===s.types.CHAR?t.value:`${t.from}-${t.to}`;if(i[e]){i[e]=false}else{return false}}return true}function writeSetTokens(e,t=false){if(isSameSet(e.set,a.INTS)){return e.not?"\\D":"\\d"}if(isSameSet(e.set,a.WORDS)){return e.not?"\\W":"\\w"}if(e.not&&isSameSet(e.set,a.NOTANYCHAR)){return"."}if(isSameSet(e.set,a.WHITESPACE)){return e.not?"\\S":"\\s"}let r="";for(let t=0;t<e.set.length;t++){const i=e.set[t];r+=writeSetToken(i)}const i=`${e.not?"^":""}${r}`;return t?i:`[${i}]`}function writeSetToken(e){if(e.type===s.types.CHAR){return setChar(e.value)}else if(e.type===s.types.RANGE){return`${setChar(e.from)}-${setChar(e.to)}`}return writeSetTokens(e,true)}},5725:(e,t,r)=>{
2
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
+ var i=r(181);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){e.exports=i}else{copyProps(i,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return n(e,t,r)}SafeBuffer.prototype=Object.create(n.prototype);copyProps(n,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return n(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var i=n(e);if(t!==undefined){if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}}else{i.fill(0)}return i};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i.SlowBuffer(e)}},9381:(e,t,r)=>{"use strict";var i=r(181);var n=i.Buffer;var o={};var s;for(s in i){if(!i.hasOwnProperty(s))continue;if(s==="SlowBuffer"||s==="Buffer")continue;o[s]=i[s]}var a=o.Buffer={};for(s in n){if(!n.hasOwnProperty(s))continue;if(s==="allocUnsafe"||s==="allocUnsafeSlow")continue;a[s]=n[s]}o.Buffer.prototype=n.prototype;if(!a.from||a.from===Uint8Array.from){a.from=function(e,t,r){if(typeof e==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e)}if(e&&typeof e.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}return n(e,t,r)}}if(!a.alloc){a.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof e)}if(e<0||e>=2*(1<<30)){throw new RangeError('The value "'+e+'" is invalid for option "size"')}var i=n(e);if(!t||t.length===0){i.fill(0)}else if(typeof r==="string"){i.fill(t,r)}else{i.fill(t)}return i}}if(!o.kStringMaxLength){try{o.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(e){}}if(!o.constants){o.constants={MAX_LENGTH:o.kMaxLength};if(o.kStringMaxLength){o.constants.MAX_STRING_LENGTH=o.kStringMaxLength}}e.exports=o},181:e=>{"use strict";e.exports=require("buffer")},7598:e=>{"use strict";e.exports=require("node:crypto")},7975:e=>{"use strict";e.exports=require("node:util")},9023:e=>{"use strict";e.exports=require("util")},346:(e,t,r)=>{"use strict";const i=r(1566);const{types:n}=r(1566);function walk(e,t,r){let i;let o;let s;if(e.type===n.REPETITION){r++;t.reps++;if(r>1)return false;if(t.reps>t.limit)return false}const a=e.options||e.value?.options;if(a){for(i=0,s=a.length;i<s;i++){o=walk({stack:a[i]},t,r);if(!o)return false}}const u=e.stack||e.value?.stack;if(!u)return true;for(i=0,s=u.length;i<s;i++){o=walk(u[i],t,r);if(!o)return false}return true}function safeRegex(e,t){const r={reps:0,limit:t?.limit??25};if(isRegExp(e))e=e.source;else if(typeof e!=="string")e=String(e);try{return walk(i(e),r,0)}catch{return false}}function isRegExp(e){return Object.prototype.toString.call(e)==="[object RegExp]"}e.exports=safeRegex;e.exports["default"]=safeRegex;e.exports.safeRegex=safeRegex}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={id:r,loaded:false,exports:{}};var o=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(9714);module.exports=r})();
@@ -0,0 +1 @@
1
+ {"name":"fast-jwt","main":"index.js","author":"NearForm Ltd","license":"Apache-2.0"}