nfets 0.0.13 → 0.0.14

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 (638) hide show
  1. package/README.md +4 -0
  2. package/dist/chunk-3WPW27WV.mjs +24 -0
  3. package/dist/chunk-VB5FKAWY.mjs +7 -0
  4. package/dist/{chunk-Z2TLKKAE.mjs → chunk-W6MRGYXP.mjs} +0 -1
  5. package/dist/chunk-XYOTPYUB.mjs +238 -0
  6. package/dist/core/index.cjs +261 -0
  7. package/dist/core/index.d.cts +576 -0
  8. package/dist/core/index.d.ts +576 -0
  9. package/dist/core/index.mjs +1 -0
  10. package/dist/either-CdHd_Yt7.d.cts +20 -0
  11. package/dist/either-CdHd_Yt7.d.ts +20 -0
  12. package/dist/index.cjs +82 -77
  13. package/dist/index.d.cts +70 -677
  14. package/dist/index.d.ts +70 -677
  15. package/dist/index.mjs +1 -260
  16. package/dist/nfe/index.cjs +30 -0
  17. package/dist/nfe/index.d.cts +4622 -0
  18. package/dist/nfe/index.d.ts +4622 -0
  19. package/dist/nfe/index.mjs +1 -0
  20. package/dist/src-NRIPS2N7.mjs +7 -0
  21. package/package.json +17 -6
  22. package/packages/nfe/schemas/PL_009_V4/110150_v1.00.xsd +88 -0
  23. package/packages/nfe/schemas/PL_009_V4/Averb_v1.00.xsd +11 -0
  24. package/packages/nfe/schemas/PL_009_V4/CCe_v1.00.xsd +11 -0
  25. package/packages/nfe/schemas/PL_009_V4/EPEC_v1.00.xsd +9 -0
  26. package/packages/nfe/schemas/PL_009_V4/EPP1.xml +13 -0
  27. package/packages/nfe/schemas/PL_009_V4/ERP1.xml +19 -0
  28. package/packages/nfe/schemas/PL_009_V4/EventoCancEConf_v1.00.xsd +9 -0
  29. package/packages/nfe/schemas/PL_009_V4/EventoCancInsucessoNFe_v1.00.xsd +9 -0
  30. package/packages/nfe/schemas/PL_009_V4/EventoEConf_v1.00.xsd +9 -0
  31. package/packages/nfe/schemas/PL_009_V4/EventoInsucessoNFe_v1.00.xsd +9 -0
  32. package/packages/nfe/schemas/PL_009_V4/MT_inutNFe_v4.00.xsd +9 -0
  33. package/packages/nfe/schemas/PL_009_V4/SuframaInternaliza_v1.00.xsd +9 -0
  34. package/packages/nfe/schemas/PL_009_V4/SuframaVistoria_v1.00.xsd +9 -0
  35. package/packages/nfe/schemas/PL_009_V4/confRecebto_v1.00.xsd +9 -0
  36. package/packages/nfe/schemas/PL_009_V4/consCad_v2.00.xsd +9 -0
  37. package/packages/nfe/schemas/PL_009_V4/consGTIN_v1.00.xsd +10 -0
  38. package/packages/nfe/schemas/PL_009_V4/consNFeDest_v1.01.xsd +10 -0
  39. package/packages/nfe/schemas/PL_009_V4/consReciNFe_v3.10.xsd +9 -0
  40. package/packages/nfe/schemas/PL_009_V4/consReciNFe_v4.00.xsd +9 -0
  41. package/packages/nfe/schemas/PL_009_V4/consSitNFe_v3.10.xsd +9 -0
  42. package/packages/nfe/schemas/PL_009_V4/consSitNFe_v4.00.xsd +9 -0
  43. package/packages/nfe/schemas/PL_009_V4/consStatServ_v3.10.xsd +9 -0
  44. package/packages/nfe/schemas/PL_009_V4/consStatServ_v4.00.xsd +9 -0
  45. package/packages/nfe/schemas/PL_009_V4/distDFeInt_v1.00.xsd +71 -0
  46. package/packages/nfe/schemas/PL_009_V4/distDFeInt_v1.01.xsd +97 -0
  47. package/packages/nfe/schemas/PL_009_V4/downloadNFe_v1.00.xsd +10 -0
  48. package/packages/nfe/schemas/PL_009_V4/e110110_v1.00.xsd +58 -0
  49. package/packages/nfe/schemas/PL_009_V4/e110111_v1.00.xsd +42 -0
  50. package/packages/nfe/schemas/PL_009_V4/e110112_v1.00.xsd +69 -0
  51. package/packages/nfe/schemas/PL_009_V4/e110130_v1.00.xsd +102 -0
  52. package/packages/nfe/schemas/PL_009_V4/e110131_v1.00.xsd +51 -0
  53. package/packages/nfe/schemas/PL_009_V4/e110140NFCe_v1.00.xsd +118 -0
  54. package/packages/nfe/schemas/PL_009_V4/e110140NFe_v1.00.xsd +124 -0
  55. package/packages/nfe/schemas/PL_009_V4/e110140_v1.00.xsd +124 -0
  56. package/packages/nfe/schemas/PL_009_V4/e110150_v1.00.xsd +88 -0
  57. package/packages/nfe/schemas/PL_009_V4/e110192_v1.00.xsd +106 -0
  58. package/packages/nfe/schemas/PL_009_V4/e110193_v1.00.xsd +40 -0
  59. package/packages/nfe/schemas/PL_009_V4/e110750_v1.00.xsd +138 -0
  60. package/packages/nfe/schemas/PL_009_V4/e110751_v1.00.xsd +39 -0
  61. package/packages/nfe/schemas/PL_009_V4/e111500_v1.00.xsd +69 -0
  62. package/packages/nfe/schemas/PL_009_V4/e111501_v1.00.xsd +69 -0
  63. package/packages/nfe/schemas/PL_009_V4/e111502_v1.00.xsd +50 -0
  64. package/packages/nfe/schemas/PL_009_V4/e111503_v1.00.xsd +50 -0
  65. package/packages/nfe/schemas/PL_009_V4/e210200_v1.00.xsd +31 -0
  66. package/packages/nfe/schemas/PL_009_V4/e210210_v1.00.xsd +31 -0
  67. package/packages/nfe/schemas/PL_009_V4/e210220_v1.00.xsd +44 -0
  68. package/packages/nfe/schemas/PL_009_V4/e210240_v1.00.xsd +44 -0
  69. package/packages/nfe/schemas/PL_009_V4/e411500_v1.00.xsd +134 -0
  70. package/packages/nfe/schemas/PL_009_V4/e411501_v1.00.xsd +134 -0
  71. package/packages/nfe/schemas/PL_009_V4/e411502_v1.00.xsd +95 -0
  72. package/packages/nfe/schemas/PL_009_V4/e411503_v1.00.xsd +95 -0
  73. package/packages/nfe/schemas/PL_009_V4/e610130_v1.00.xsd +128 -0
  74. package/packages/nfe/schemas/PL_009_V4/e610131_v1.00.xsd +68 -0
  75. package/packages/nfe/schemas/PL_009_V4/e790700_v1.00.xsd +125 -0
  76. package/packages/nfe/schemas/PL_009_V4/e990900_v1.00.xsd +87 -0
  77. package/packages/nfe/schemas/PL_009_V4/e990910_v1.00.xsd +81 -0
  78. package/packages/nfe/schemas/PL_009_V4/envAverb_v1.00.xsd +9 -0
  79. package/packages/nfe/schemas/PL_009_V4/envCCe_v1.00.xsd +10 -0
  80. package/packages/nfe/schemas/PL_009_V4/envCancelPProrrogNFe_v1.0.xsd +50 -0
  81. package/packages/nfe/schemas/PL_009_V4/envComprovanteEntregaNFe_v1.00.xsd +11 -0
  82. package/packages/nfe/schemas/PL_009_V4/envConfRecebto_v1.00.xsd +9 -0
  83. package/packages/nfe/schemas/PL_009_V4/envEPEC_v1.00.xsd +9 -0
  84. package/packages/nfe/schemas/PL_009_V4/envEventoAtorInteressado_v1.00.xsd +9 -0
  85. package/packages/nfe/schemas/PL_009_V4/envEventoCancEConf_v1.00.xsd +10 -0
  86. package/packages/nfe/schemas/PL_009_V4/envEventoCancEntregaNFe_v1.00.xsd +10 -0
  87. package/packages/nfe/schemas/PL_009_V4/envEventoCancInsucessoNFe_v1.00.xsd +10 -0
  88. package/packages/nfe/schemas/PL_009_V4/envEventoCancNFe_v1.00.xsd +9 -0
  89. package/packages/nfe/schemas/PL_009_V4/envEventoCancSubst_v1.00.xsd +9 -0
  90. package/packages/nfe/schemas/PL_009_V4/envEventoEConf_v1.00.xsd +10 -0
  91. package/packages/nfe/schemas/PL_009_V4/envEventoEntregaNFe_v1.00.xsd +10 -0
  92. package/packages/nfe/schemas/PL_009_V4/envEventoInsucessoNFe_v1.00.xsd +10 -0
  93. package/packages/nfe/schemas/PL_009_V4/envEvento_v1.00.xsd +9 -0
  94. package/packages/nfe/schemas/PL_009_V4/envFiscoNfe_v1.0.xsd +179 -0
  95. package/packages/nfe/schemas/PL_009_V4/envPProrrogNFe_v1.0.xsd +65 -0
  96. package/packages/nfe/schemas/PL_009_V4/envRemIndus_v1.00.xsd +9 -0
  97. package/packages/nfe/schemas/PL_009_V4/envSuframaInternaliza_v1.00.xsd +10 -0
  98. package/packages/nfe/schemas/PL_009_V4/envSuframaVistoria_v1.00.xsd +10 -0
  99. package/packages/nfe/schemas/PL_009_V4/enviNFe_v3.10.xsd +9 -0
  100. package/packages/nfe/schemas/PL_009_V4/enviNFe_v4.00.xsd +9 -0
  101. package/packages/nfe/schemas/PL_009_V4/eventoAtorInteressado_v1.00.xsd +9 -0
  102. package/packages/nfe/schemas/PL_009_V4/eventoCancEntregaNFe_v1.00.xsd +9 -0
  103. package/packages/nfe/schemas/PL_009_V4/eventoCancNFe_v1.00.xsd +9 -0
  104. package/packages/nfe/schemas/PL_009_V4/eventoCancSubst_v1.00.xsd +9 -0
  105. package/packages/nfe/schemas/PL_009_V4/eventoEPEC_v0.01.xsd +267 -0
  106. package/packages/nfe/schemas/PL_009_V4/eventoEPEC_v1.00.xsd +231 -0
  107. package/packages/nfe/schemas/PL_009_V4/eventoEntregaNFe_v1.00.xsd +9 -0
  108. package/packages/nfe/schemas/PL_009_V4/eventoRemIndus_v1.00.xsd +9 -0
  109. package/packages/nfe/schemas/PL_009_V4/inutNFe_v3.10.xsd +9 -0
  110. package/packages/nfe/schemas/PL_009_V4/inutNFe_v4.00.xsd +9 -0
  111. package/packages/nfe/schemas/PL_009_V4/leiauteAverb_v1.00.xsd +482 -0
  112. package/packages/nfe/schemas/PL_009_V4/leiauteCCe_v1.00.xsd +382 -0
  113. package/packages/nfe/schemas/PL_009_V4/leiauteCcgConsGTIN_v1.00.xsd +94 -0
  114. package/packages/nfe/schemas/PL_009_V4/leiauteComprovanteEntregaNFe_v1.00.xsd +487 -0
  115. package/packages/nfe/schemas/PL_009_V4/leiauteConfRecebto_v1.00.xsd +369 -0
  116. package/packages/nfe/schemas/PL_009_V4/leiauteConsNFeDest_v1.01.xsd +483 -0
  117. package/packages/nfe/schemas/PL_009_V4/leiauteConsSitNFe_v3.10.xsd +502 -0
  118. package/packages/nfe/schemas/PL_009_V4/leiauteConsSitNFe_v4.00.xsd +502 -0
  119. package/packages/nfe/schemas/PL_009_V4/leiauteConsStatServ_v3.10.xsd +98 -0
  120. package/packages/nfe/schemas/PL_009_V4/leiauteConsStatServ_v4.00.xsd +98 -0
  121. package/packages/nfe/schemas/PL_009_V4/leiauteConsultaCadastro_v2.00.xsd +404 -0
  122. package/packages/nfe/schemas/PL_009_V4/leiauteDownloadNFe_v1.00.xsd +149 -0
  123. package/packages/nfe/schemas/PL_009_V4/leiauteEPEC_v1.00.xsd +423 -0
  124. package/packages/nfe/schemas/PL_009_V4/leiauteEventoAtorInteressado_v1.00.xsd +384 -0
  125. package/packages/nfe/schemas/PL_009_V4/leiauteEventoCancEConf_v1.00.xsd +296 -0
  126. package/packages/nfe/schemas/PL_009_V4/leiauteEventoCancEntregaNFe_v1.00.xsd +307 -0
  127. package/packages/nfe/schemas/PL_009_V4/leiauteEventoCancInsucessoNFe_v1.00.xsd +297 -0
  128. package/packages/nfe/schemas/PL_009_V4/leiauteEventoCancNFe_v1.00.xsd +358 -0
  129. package/packages/nfe/schemas/PL_009_V4/leiauteEventoCancSubst_v1.00.xsd +366 -0
  130. package/packages/nfe/schemas/PL_009_V4/leiauteEventoEConf_v1.00.xsd +296 -0
  131. package/packages/nfe/schemas/PL_009_V4/leiauteEventoEntregaNFe_v1.00.xsd +321 -0
  132. package/packages/nfe/schemas/PL_009_V4/leiauteEventoInsucessoNFe_v1.00.xsd +297 -0
  133. package/packages/nfe/schemas/PL_009_V4/leiauteEvento_v1.00.xsd +335 -0
  134. package/packages/nfe/schemas/PL_009_V4/leiauteInutNFe_v3.10.xsd +193 -0
  135. package/packages/nfe/schemas/PL_009_V4/leiauteInutNFe_v4.00.xsd +193 -0
  136. package/packages/nfe/schemas/PL_009_V4/leiauteInutNFe_v4.00_MT.xsd +200 -0
  137. package/packages/nfe/schemas/PL_009_V4/leiauteNFe_v3.10.xsd +6060 -0
  138. package/packages/nfe/schemas/PL_009_V4/leiauteNFe_v4.00.xsd +7339 -0
  139. package/packages/nfe/schemas/PL_009_V4/leiauteRemIndus_v1.00.xsd +344 -0
  140. package/packages/nfe/schemas/PL_009_V4/leiauteSuframaInternaliza_v1.00.xsd +642 -0
  141. package/packages/nfe/schemas/PL_009_V4/leiauteSuframaVistoria_v1.00.xsd +648 -0
  142. package/packages/nfe/schemas/PL_009_V4/nfe_v3.10.xsd +9 -0
  143. package/packages/nfe/schemas/PL_009_V4/nfe_v4.00.xsd +9 -0
  144. package/packages/nfe/schemas/PL_009_V4/procAverbNFe_v1.00.xsd +10 -0
  145. package/packages/nfe/schemas/PL_009_V4/procCCeNFe_v1.00.xsd +10 -0
  146. package/packages/nfe/schemas/PL_009_V4/procComprovanteEntregaNFe_v1.00.xsd +10 -0
  147. package/packages/nfe/schemas/PL_009_V4/procConfRecebtoNFe_v1.00.xsd +9 -0
  148. package/packages/nfe/schemas/PL_009_V4/procEPEC_v1.00.xsd +9 -0
  149. package/packages/nfe/schemas/PL_009_V4/procEventoAtorInteressado_v1.00.xsd +9 -0
  150. package/packages/nfe/schemas/PL_009_V4/procEventoCancEConf_v1.00.xsd +9 -0
  151. package/packages/nfe/schemas/PL_009_V4/procEventoCancEntregaNFe_v1.00.xsd +9 -0
  152. package/packages/nfe/schemas/PL_009_V4/procEventoCancInsucessoNFe_v1.00.xsd +9 -0
  153. package/packages/nfe/schemas/PL_009_V4/procEventoCancNFe_v1.00.xsd +9 -0
  154. package/packages/nfe/schemas/PL_009_V4/procEventoCancSubst_v1.00.xsd +9 -0
  155. package/packages/nfe/schemas/PL_009_V4/procEventoEConf_v1.00.xsd +9 -0
  156. package/packages/nfe/schemas/PL_009_V4/procEventoEntregaNFe_v1.00.xsd +9 -0
  157. package/packages/nfe/schemas/PL_009_V4/procEventoInsucessoNFe_v1.00.xsd +9 -0
  158. package/packages/nfe/schemas/PL_009_V4/procEventoNFe_v1.00.xsd +9 -0
  159. package/packages/nfe/schemas/PL_009_V4/procEventoNFe_v99.99.xsd +37 -0
  160. package/packages/nfe/schemas/PL_009_V4/procInutNFe_v3.10.xsd +9 -0
  161. package/packages/nfe/schemas/PL_009_V4/procInutNFe_v4.00.xsd +9 -0
  162. package/packages/nfe/schemas/PL_009_V4/procNFe_v3.10.xsd +9 -0
  163. package/packages/nfe/schemas/PL_009_V4/procNFe_v4.00.xsd +9 -0
  164. package/packages/nfe/schemas/PL_009_V4/procRemIndus_v1.00.xsd +9 -0
  165. package/packages/nfe/schemas/PL_009_V4/prod_leiauteNFe_v4.00.xsd +6736 -0
  166. package/packages/nfe/schemas/PL_009_V4/resEvento_v1.00.xsd +94 -0
  167. package/packages/nfe/schemas/PL_009_V4/resEvento_v1.01.xsd +108 -0
  168. package/packages/nfe/schemas/PL_009_V4/resNFe_v1.00.xsd +110 -0
  169. package/packages/nfe/schemas/PL_009_V4/resNFe_v1.01.xsd +122 -0
  170. package/packages/nfe/schemas/PL_009_V4/retComprovanteEntregaNFe_v1.00.xsd +10 -0
  171. package/packages/nfe/schemas/PL_009_V4/retConsCad_v2.00.xsd +9 -0
  172. package/packages/nfe/schemas/PL_009_V4/retConsGTIN_v1.00.xsd +9 -0
  173. package/packages/nfe/schemas/PL_009_V4/retConsReciNFe_v3.10.xsd +9 -0
  174. package/packages/nfe/schemas/PL_009_V4/retConsReciNFe_v4.00.xsd +9 -0
  175. package/packages/nfe/schemas/PL_009_V4/retConsSitNFe_v3.10.xsd +9 -0
  176. package/packages/nfe/schemas/PL_009_V4/retConsSitNFe_v4.00.xsd +9 -0
  177. package/packages/nfe/schemas/PL_009_V4/retConsStatServ_v3.10.xsd +9 -0
  178. package/packages/nfe/schemas/PL_009_V4/retConsStatServ_v4.00.xsd +9 -0
  179. package/packages/nfe/schemas/PL_009_V4/retDistDFeInt_v1.00.xsd +84 -0
  180. package/packages/nfe/schemas/PL_009_V4/retDistDFeInt_v1.01.xsd +99 -0
  181. package/packages/nfe/schemas/PL_009_V4/retDownloadNFe_v1.00.xsd +9 -0
  182. package/packages/nfe/schemas/PL_009_V4/retEnvAverb_v1.00.xsd +9 -0
  183. package/packages/nfe/schemas/PL_009_V4/retEnvAverb_v1.00_1.xsd +9 -0
  184. package/packages/nfe/schemas/PL_009_V4/retEnvCCe_v1.00.xsd +10 -0
  185. package/packages/nfe/schemas/PL_009_V4/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
  186. package/packages/nfe/schemas/PL_009_V4/retEnvConfRecebto_v1.00.xsd +9 -0
  187. package/packages/nfe/schemas/PL_009_V4/retEnvEPEC_v1.00.xsd +9 -0
  188. package/packages/nfe/schemas/PL_009_V4/retEnvEventoAtorInteressado_v1.00.xsd +9 -0
  189. package/packages/nfe/schemas/PL_009_V4/retEnvEventoCancNFe_v1.00.xsd +9 -0
  190. package/packages/nfe/schemas/PL_009_V4/retEnvEventoCancSubst_v1.00.xsd +9 -0
  191. package/packages/nfe/schemas/PL_009_V4/retEnvEvento_v1.00.xsd +9 -0
  192. package/packages/nfe/schemas/PL_009_V4/retEnvFiscoNFe_v1.0.xsd +234 -0
  193. package/packages/nfe/schemas/PL_009_V4/retEnvRemIndus_v1.00.xsd +9 -0
  194. package/packages/nfe/schemas/PL_009_V4/retEnvSuframaInternaliza_v1.00.xsd +9 -0
  195. package/packages/nfe/schemas/PL_009_V4/retEnvSuframaVistoria_v1.00.xsd +9 -0
  196. package/packages/nfe/schemas/PL_009_V4/retEnviNFe_v3.10.xsd +9 -0
  197. package/packages/nfe/schemas/PL_009_V4/retEnviNFe_v4.00.xsd +9 -0
  198. package/packages/nfe/schemas/PL_009_V4/retEventoCancEConf_v1.00.xsd +9 -0
  199. package/packages/nfe/schemas/PL_009_V4/retEventoCancEntregaNFe_v1.00.xsd +9 -0
  200. package/packages/nfe/schemas/PL_009_V4/retEventoCancInsucessoNFe_v1.00.xsd +9 -0
  201. package/packages/nfe/schemas/PL_009_V4/retEventoEConf_v1.00.xsd +9 -0
  202. package/packages/nfe/schemas/PL_009_V4/retEventoEPEC_v0.01.xsd +207 -0
  203. package/packages/nfe/schemas/PL_009_V4/retEventoEntregaNFe_v1.00.xsd +9 -0
  204. package/packages/nfe/schemas/PL_009_V4/retEventoInsucessoNFe_v1.00.xsd +9 -0
  205. package/packages/nfe/schemas/PL_009_V4/retInutNFe_v3.10.xsd +9 -0
  206. package/packages/nfe/schemas/PL_009_V4/retInutNFe_v4.00.xsd +9 -0
  207. package/packages/nfe/schemas/PL_009_V4/retPProrrogNFe_v1.0.xsd +233 -0
  208. package/packages/nfe/schemas/PL_009_V4/retconsNFeDest_v1.01.xsd +9 -0
  209. package/packages/nfe/schemas/PL_009_V4/tiposBasico_v1.03.xsd +873 -0
  210. package/packages/nfe/schemas/PL_009_V4/tiposBasico_v3.10.xsd +571 -0
  211. package/packages/nfe/schemas/PL_009_V4/tiposBasico_v4.00.xsd +598 -0
  212. package/packages/nfe/schemas/PL_009_V4/tiposBasicosCcgConsGTIN_v1.00.xsd +84 -0
  213. package/packages/nfe/schemas/PL_009_V4/tiposDistDFe_v1.00.xsd +217 -0
  214. package/packages/nfe/schemas/PL_009_V4/tiposDistDFe_v1.01.xsd +222 -0
  215. package/packages/nfe/schemas/PL_009_V4/xmldsig-core-schema_v1.01.xsd +98 -0
  216. package/packages/nfe/schemas/PL_010_V1/110150_v1.00.xsd +88 -0
  217. package/packages/nfe/schemas/PL_010_V1/Averb_v1.00.xsd +11 -0
  218. package/packages/nfe/schemas/PL_010_V1/CCe_v1.00.xsd +11 -0
  219. package/packages/nfe/schemas/PL_010_V1/DFeTiposBasicos_v1.00.xsd +1088 -0
  220. package/packages/nfe/schemas/PL_010_V1/EPEC_v1.00.xsd +9 -0
  221. package/packages/nfe/schemas/PL_010_V1/EPP1.xml +13 -0
  222. package/packages/nfe/schemas/PL_010_V1/ERP1.xml +19 -0
  223. package/packages/nfe/schemas/PL_010_V1/EventoCancEConf_v1.00.xsd +9 -0
  224. package/packages/nfe/schemas/PL_010_V1/EventoCancInsucessoNFe_v1.00.xsd +9 -0
  225. package/packages/nfe/schemas/PL_010_V1/EventoEConf_v1.00.xsd +9 -0
  226. package/packages/nfe/schemas/PL_010_V1/EventoInsucessoNFe_v1.00.xsd +9 -0
  227. package/packages/nfe/schemas/PL_010_V1/MT_inutNFe_v4.00.xsd +9 -0
  228. package/packages/nfe/schemas/PL_010_V1/SuframaInternaliza_v1.00.xsd +9 -0
  229. package/packages/nfe/schemas/PL_010_V1/SuframaVistoria_v1.00.xsd +9 -0
  230. package/packages/nfe/schemas/PL_010_V1/confRecebto_v1.00.xsd +9 -0
  231. package/packages/nfe/schemas/PL_010_V1/consCad_v2.00.xsd +9 -0
  232. package/packages/nfe/schemas/PL_010_V1/consGTIN_v1.00.xsd +10 -0
  233. package/packages/nfe/schemas/PL_010_V1/consNFeDest_v1.01.xsd +10 -0
  234. package/packages/nfe/schemas/PL_010_V1/consReciNFe_v3.10.xsd +9 -0
  235. package/packages/nfe/schemas/PL_010_V1/consReciNFe_v4.00.xsd +9 -0
  236. package/packages/nfe/schemas/PL_010_V1/consSitNFe_v3.10.xsd +9 -0
  237. package/packages/nfe/schemas/PL_010_V1/consSitNFe_v4.00.xsd +9 -0
  238. package/packages/nfe/schemas/PL_010_V1/consStatServ_v3.10.xsd +9 -0
  239. package/packages/nfe/schemas/PL_010_V1/consStatServ_v4.00.xsd +9 -0
  240. package/packages/nfe/schemas/PL_010_V1/distDFeInt_v1.00.xsd +71 -0
  241. package/packages/nfe/schemas/PL_010_V1/distDFeInt_v1.01.xsd +97 -0
  242. package/packages/nfe/schemas/PL_010_V1/downloadNFe_v1.00.xsd +10 -0
  243. package/packages/nfe/schemas/PL_010_V1/e110001_v1.00.xsd +73 -0
  244. package/packages/nfe/schemas/PL_010_V1/e110110_v1.00.xsd +58 -0
  245. package/packages/nfe/schemas/PL_010_V1/e110111_v1.00.xsd +42 -0
  246. package/packages/nfe/schemas/PL_010_V1/e110112_v1.00.xsd +69 -0
  247. package/packages/nfe/schemas/PL_010_V1/e110130_v1.00.xsd +102 -0
  248. package/packages/nfe/schemas/PL_010_V1/e110131_v1.00.xsd +51 -0
  249. package/packages/nfe/schemas/PL_010_V1/e110140NFCe_v1.00.xsd +118 -0
  250. package/packages/nfe/schemas/PL_010_V1/e110140NFe_v1.00.xsd +124 -0
  251. package/packages/nfe/schemas/PL_010_V1/e110140_v1.00.xsd +124 -0
  252. package/packages/nfe/schemas/PL_010_V1/e110150_v1.00.xsd +88 -0
  253. package/packages/nfe/schemas/PL_010_V1/e110192_v1.00.xsd +106 -0
  254. package/packages/nfe/schemas/PL_010_V1/e110193_v1.00.xsd +40 -0
  255. package/packages/nfe/schemas/PL_010_V1/e110750_v1.00.xsd +138 -0
  256. package/packages/nfe/schemas/PL_010_V1/e110751_v1.00.xsd +39 -0
  257. package/packages/nfe/schemas/PL_010_V1/e111500_v1.00.xsd +69 -0
  258. package/packages/nfe/schemas/PL_010_V1/e111501_v1.00.xsd +69 -0
  259. package/packages/nfe/schemas/PL_010_V1/e111502_v1.00.xsd +50 -0
  260. package/packages/nfe/schemas/PL_010_V1/e111503_v1.00.xsd +50 -0
  261. package/packages/nfe/schemas/PL_010_V1/e112110_v1.00.xsd +69 -0
  262. package/packages/nfe/schemas/PL_010_V1/e112120_v1.00 .xsd +107 -0
  263. package/packages/nfe/schemas/PL_010_V1/e112130_v1.00.xsd +119 -0
  264. package/packages/nfe/schemas/PL_010_V1/e112140_v1.00.xsd +107 -0
  265. package/packages/nfe/schemas/PL_010_V1/e210200_v1.00.xsd +31 -0
  266. package/packages/nfe/schemas/PL_010_V1/e210210_v1.00.xsd +31 -0
  267. package/packages/nfe/schemas/PL_010_V1/e210220_v1.00.xsd +44 -0
  268. package/packages/nfe/schemas/PL_010_V1/e210240_v1.00.xsd +44 -0
  269. package/packages/nfe/schemas/PL_010_V1/e211110_v1.00.xsd +134 -0
  270. package/packages/nfe/schemas/PL_010_V1/e211120_v1.00.xsd +124 -0
  271. package/packages/nfe/schemas/PL_010_V1/e211124_v1.00.xsd +107 -0
  272. package/packages/nfe/schemas/PL_010_V1/e211128_v1.00.xsd +69 -0
  273. package/packages/nfe/schemas/PL_010_V1/e211130_v1.00.xsd +107 -0
  274. package/packages/nfe/schemas/PL_010_V1/e211140_v1.00.xsd +107 -0
  275. package/packages/nfe/schemas/PL_010_V1/e211150_v1.00.xsd +85 -0
  276. package/packages/nfe/schemas/PL_010_V1/e212110_v1.00.xsd +70 -0
  277. package/packages/nfe/schemas/PL_010_V1/e212120_v1.00.xsd +69 -0
  278. package/packages/nfe/schemas/PL_010_V1/e411500_v1.00.xsd +134 -0
  279. package/packages/nfe/schemas/PL_010_V1/e411501_v1.00.xsd +134 -0
  280. package/packages/nfe/schemas/PL_010_V1/e411502_v1.00.xsd +95 -0
  281. package/packages/nfe/schemas/PL_010_V1/e411503_v1.00.xsd +95 -0
  282. package/packages/nfe/schemas/PL_010_V1/e412120_v1.00.xsd +88 -0
  283. package/packages/nfe/schemas/PL_010_V1/e412130_v1.00.xsd +88 -0
  284. package/packages/nfe/schemas/PL_010_V1/e610130_v1.00.xsd +128 -0
  285. package/packages/nfe/schemas/PL_010_V1/e610131_v1.00.xsd +68 -0
  286. package/packages/nfe/schemas/PL_010_V1/e790700_v1.00.xsd +148 -0
  287. package/packages/nfe/schemas/PL_010_V1/e990900_v1.00.xsd +87 -0
  288. package/packages/nfe/schemas/PL_010_V1/e990910_v1.00.xsd +81 -0
  289. package/packages/nfe/schemas/PL_010_V1/envAverb_v1.00.xsd +9 -0
  290. package/packages/nfe/schemas/PL_010_V1/envCCe_v1.00.xsd +10 -0
  291. package/packages/nfe/schemas/PL_010_V1/envCancelPProrrogNFe_v1.0.xsd +50 -0
  292. package/packages/nfe/schemas/PL_010_V1/envComprovanteEntregaNFe_v1.00.xsd +11 -0
  293. package/packages/nfe/schemas/PL_010_V1/envConfRecebto_v1.00.xsd +9 -0
  294. package/packages/nfe/schemas/PL_010_V1/envEPEC_v1.00.xsd +9 -0
  295. package/packages/nfe/schemas/PL_010_V1/envEventoAtorInteressado_v1.00.xsd +9 -0
  296. package/packages/nfe/schemas/PL_010_V1/envEventoCancEConf_v1.00.xsd +10 -0
  297. package/packages/nfe/schemas/PL_010_V1/envEventoCancEntregaNFe_v1.00.xsd +10 -0
  298. package/packages/nfe/schemas/PL_010_V1/envEventoCancInsucessoNFe_v1.00.xsd +10 -0
  299. package/packages/nfe/schemas/PL_010_V1/envEventoCancNFe_v1.00.xsd +9 -0
  300. package/packages/nfe/schemas/PL_010_V1/envEventoCancSubst_v1.00.xsd +9 -0
  301. package/packages/nfe/schemas/PL_010_V1/envEventoEConf_v1.00.xsd +10 -0
  302. package/packages/nfe/schemas/PL_010_V1/envEventoEntregaNFe_v1.00.xsd +10 -0
  303. package/packages/nfe/schemas/PL_010_V1/envEventoInsucessoNFe_v1.00.xsd +10 -0
  304. package/packages/nfe/schemas/PL_010_V1/envEvento_v1.00.xsd +9 -0
  305. package/packages/nfe/schemas/PL_010_V1/envFiscoNfe_v1.0.xsd +179 -0
  306. package/packages/nfe/schemas/PL_010_V1/envPProrrogNFe_v1.0.xsd +65 -0
  307. package/packages/nfe/schemas/PL_010_V1/envRemIndus_v1.00.xsd +9 -0
  308. package/packages/nfe/schemas/PL_010_V1/envSuframaInternaliza_v1.00.xsd +10 -0
  309. package/packages/nfe/schemas/PL_010_V1/envSuframaVistoria_v1.00.xsd +10 -0
  310. package/packages/nfe/schemas/PL_010_V1/enviNFe_v3.10.xsd +9 -0
  311. package/packages/nfe/schemas/PL_010_V1/enviNFe_v4.00.xsd +9 -0
  312. package/packages/nfe/schemas/PL_010_V1/eventoAtorInteressado_v1.00.xsd +9 -0
  313. package/packages/nfe/schemas/PL_010_V1/eventoCancEntregaNFe_v1.00.xsd +9 -0
  314. package/packages/nfe/schemas/PL_010_V1/eventoCancNFe_v1.00.xsd +9 -0
  315. package/packages/nfe/schemas/PL_010_V1/eventoCancSubst_v1.00.xsd +9 -0
  316. package/packages/nfe/schemas/PL_010_V1/eventoEPEC_v0.01.xsd +267 -0
  317. package/packages/nfe/schemas/PL_010_V1/eventoEPEC_v1.00.xsd +231 -0
  318. package/packages/nfe/schemas/PL_010_V1/eventoEntregaNFe_v1.00.xsd +9 -0
  319. package/packages/nfe/schemas/PL_010_V1/eventoRemIndus_v1.00.xsd +9 -0
  320. package/packages/nfe/schemas/PL_010_V1/inutNFe_v3.10.xsd +9 -0
  321. package/packages/nfe/schemas/PL_010_V1/inutNFe_v4.00.xsd +9 -0
  322. package/packages/nfe/schemas/PL_010_V1/leiauteAverb_v1.00.xsd +468 -0
  323. package/packages/nfe/schemas/PL_010_V1/leiauteCCe_v1.00.xsd +382 -0
  324. package/packages/nfe/schemas/PL_010_V1/leiauteCcgConsGTIN_v1.00.xsd +94 -0
  325. package/packages/nfe/schemas/PL_010_V1/leiauteComprovanteEntregaNFe_v1.00.xsd +487 -0
  326. package/packages/nfe/schemas/PL_010_V1/leiauteConfRecebto_v1.00.xsd +369 -0
  327. package/packages/nfe/schemas/PL_010_V1/leiauteConsNFeDest_v1.01.xsd +483 -0
  328. package/packages/nfe/schemas/PL_010_V1/leiauteConsSitNFe_v3.10.xsd +502 -0
  329. package/packages/nfe/schemas/PL_010_V1/leiauteConsSitNFe_v4.00.xsd +502 -0
  330. package/packages/nfe/schemas/PL_010_V1/leiauteConsStatServ_v3.10.xsd +98 -0
  331. package/packages/nfe/schemas/PL_010_V1/leiauteConsStatServ_v4.00.xsd +98 -0
  332. package/packages/nfe/schemas/PL_010_V1/leiauteConsultaCadastro_v2.00.xsd +404 -0
  333. package/packages/nfe/schemas/PL_010_V1/leiauteDownloadNFe_v1.00.xsd +149 -0
  334. package/packages/nfe/schemas/PL_010_V1/leiauteEPEC_v1.00.xsd +423 -0
  335. package/packages/nfe/schemas/PL_010_V1/leiauteEventoAtorInteressado_v1.00.xsd +384 -0
  336. package/packages/nfe/schemas/PL_010_V1/leiauteEventoCancEConf_v1.00.xsd +296 -0
  337. package/packages/nfe/schemas/PL_010_V1/leiauteEventoCancEntregaNFe_v1.00.xsd +307 -0
  338. package/packages/nfe/schemas/PL_010_V1/leiauteEventoCancInsucessoNFe_v1.00.xsd +297 -0
  339. package/packages/nfe/schemas/PL_010_V1/leiauteEventoCancNFe_v1.00.xsd +358 -0
  340. package/packages/nfe/schemas/PL_010_V1/leiauteEventoCancSubst_v1.00.xsd +366 -0
  341. package/packages/nfe/schemas/PL_010_V1/leiauteEventoEConf_v1.00.xsd +296 -0
  342. package/packages/nfe/schemas/PL_010_V1/leiauteEventoEntregaNFe_v1.00.xsd +321 -0
  343. package/packages/nfe/schemas/PL_010_V1/leiauteEventoInsucessoNFe_v1.00.xsd +297 -0
  344. package/packages/nfe/schemas/PL_010_V1/leiauteEvento_v1.00.xsd +335 -0
  345. package/packages/nfe/schemas/PL_010_V1/leiauteInutNFe_v3.10.xsd +193 -0
  346. package/packages/nfe/schemas/PL_010_V1/leiauteInutNFe_v4.00.xsd +193 -0
  347. package/packages/nfe/schemas/PL_010_V1/leiauteInutNFe_v4.00_MT.xsd +200 -0
  348. package/packages/nfe/schemas/PL_010_V1/leiauteNFe_v3.10.xsd +6060 -0
  349. package/packages/nfe/schemas/PL_010_V1/leiauteNFe_v4.00.xsd +7557 -0
  350. package/packages/nfe/schemas/PL_010_V1/leiauteRemIndus_v1.00.xsd +344 -0
  351. package/packages/nfe/schemas/PL_010_V1/leiauteSuframaInternaliza_v1.00.xsd +642 -0
  352. package/packages/nfe/schemas/PL_010_V1/leiauteSuframaVistoria_v1.00.xsd +648 -0
  353. package/packages/nfe/schemas/PL_010_V1/nfe_v3.10.xsd +9 -0
  354. package/packages/nfe/schemas/PL_010_V1/nfe_v4.00.xsd +10 -0
  355. package/packages/nfe/schemas/PL_010_V1/procAverbNFe_v1.00.xsd +10 -0
  356. package/packages/nfe/schemas/PL_010_V1/procCCeNFe_v1.00.xsd +10 -0
  357. package/packages/nfe/schemas/PL_010_V1/procComprovanteEntregaNFe_v1.00.xsd +10 -0
  358. package/packages/nfe/schemas/PL_010_V1/procConfRecebtoNFe_v1.00.xsd +9 -0
  359. package/packages/nfe/schemas/PL_010_V1/procEPEC_v1.00.xsd +9 -0
  360. package/packages/nfe/schemas/PL_010_V1/procEventoAtorInteressado_v1.00.xsd +9 -0
  361. package/packages/nfe/schemas/PL_010_V1/procEventoCancEConf_v1.00.xsd +9 -0
  362. package/packages/nfe/schemas/PL_010_V1/procEventoCancEntregaNFe_v1.00.xsd +9 -0
  363. package/packages/nfe/schemas/PL_010_V1/procEventoCancInsucessoNFe_v1.00.xsd +9 -0
  364. package/packages/nfe/schemas/PL_010_V1/procEventoCancNFe_v1.00.xsd +9 -0
  365. package/packages/nfe/schemas/PL_010_V1/procEventoCancSubst_v1.00.xsd +9 -0
  366. package/packages/nfe/schemas/PL_010_V1/procEventoEConf_v1.00.xsd +9 -0
  367. package/packages/nfe/schemas/PL_010_V1/procEventoEntregaNFe_v1.00.xsd +9 -0
  368. package/packages/nfe/schemas/PL_010_V1/procEventoInsucessoNFe_v1.00.xsd +9 -0
  369. package/packages/nfe/schemas/PL_010_V1/procEventoNFe_v1.00.xsd +9 -0
  370. package/packages/nfe/schemas/PL_010_V1/procEventoNFe_v99.99.xsd +37 -0
  371. package/packages/nfe/schemas/PL_010_V1/procInutNFe_v3.10.xsd +9 -0
  372. package/packages/nfe/schemas/PL_010_V1/procInutNFe_v4.00.xsd +9 -0
  373. package/packages/nfe/schemas/PL_010_V1/procNFe_v3.10.xsd +9 -0
  374. package/packages/nfe/schemas/PL_010_V1/procNFe_v4.00.xsd +9 -0
  375. package/packages/nfe/schemas/PL_010_V1/procRemIndus_v1.00.xsd +9 -0
  376. package/packages/nfe/schemas/PL_010_V1/prod_leiauteNFe_v4.00.xsd +6736 -0
  377. package/packages/nfe/schemas/PL_010_V1/resEvento_v1.00.xsd +94 -0
  378. package/packages/nfe/schemas/PL_010_V1/resEvento_v1.01.xsd +108 -0
  379. package/packages/nfe/schemas/PL_010_V1/resNFe_v1.00.xsd +110 -0
  380. package/packages/nfe/schemas/PL_010_V1/resNFe_v1.01.xsd +122 -0
  381. package/packages/nfe/schemas/PL_010_V1/retComprovanteEntregaNFe_v1.00.xsd +10 -0
  382. package/packages/nfe/schemas/PL_010_V1/retConsCad_v2.00.xsd +9 -0
  383. package/packages/nfe/schemas/PL_010_V1/retConsGTIN_v1.00.xsd +9 -0
  384. package/packages/nfe/schemas/PL_010_V1/retConsReciNFe_v3.10.xsd +9 -0
  385. package/packages/nfe/schemas/PL_010_V1/retConsReciNFe_v4.00.xsd +9 -0
  386. package/packages/nfe/schemas/PL_010_V1/retConsSitNFe_v3.10.xsd +9 -0
  387. package/packages/nfe/schemas/PL_010_V1/retConsSitNFe_v4.00.xsd +9 -0
  388. package/packages/nfe/schemas/PL_010_V1/retConsStatServ_v3.10.xsd +9 -0
  389. package/packages/nfe/schemas/PL_010_V1/retConsStatServ_v4.00.xsd +9 -0
  390. package/packages/nfe/schemas/PL_010_V1/retDistDFeInt_v1.00.xsd +84 -0
  391. package/packages/nfe/schemas/PL_010_V1/retDistDFeInt_v1.01.xsd +99 -0
  392. package/packages/nfe/schemas/PL_010_V1/retDownloadNFe_v1.00.xsd +9 -0
  393. package/packages/nfe/schemas/PL_010_V1/retEnvAverb_v1.00.xsd +9 -0
  394. package/packages/nfe/schemas/PL_010_V1/retEnvAverb_v1.00_1.xsd +9 -0
  395. package/packages/nfe/schemas/PL_010_V1/retEnvCCe_v1.00.xsd +10 -0
  396. package/packages/nfe/schemas/PL_010_V1/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
  397. package/packages/nfe/schemas/PL_010_V1/retEnvConfRecebto_v1.00.xsd +9 -0
  398. package/packages/nfe/schemas/PL_010_V1/retEnvEPEC_v1.00.xsd +9 -0
  399. package/packages/nfe/schemas/PL_010_V1/retEnvEventoAtorInteressado_v1.00.xsd +9 -0
  400. package/packages/nfe/schemas/PL_010_V1/retEnvEventoCancNFe_v1.00.xsd +9 -0
  401. package/packages/nfe/schemas/PL_010_V1/retEnvEventoCancSubst_v1.00.xsd +9 -0
  402. package/packages/nfe/schemas/PL_010_V1/retEnvEvento_v1.00.xsd +9 -0
  403. package/packages/nfe/schemas/PL_010_V1/retEnvFiscoNFe_v1.0.xsd +234 -0
  404. package/packages/nfe/schemas/PL_010_V1/retEnvRemIndus_v1.00.xsd +9 -0
  405. package/packages/nfe/schemas/PL_010_V1/retEnvSuframaInternaliza_v1.00.xsd +9 -0
  406. package/packages/nfe/schemas/PL_010_V1/retEnvSuframaVistoria_v1.00.xsd +9 -0
  407. package/packages/nfe/schemas/PL_010_V1/retEnviNFe_v3.10.xsd +9 -0
  408. package/packages/nfe/schemas/PL_010_V1/retEnviNFe_v4.00.xsd +9 -0
  409. package/packages/nfe/schemas/PL_010_V1/retEventoCancEConf_v1.00.xsd +9 -0
  410. package/packages/nfe/schemas/PL_010_V1/retEventoCancEntregaNFe_v1.00.xsd +9 -0
  411. package/packages/nfe/schemas/PL_010_V1/retEventoCancInsucessoNFe_v1.00.xsd +9 -0
  412. package/packages/nfe/schemas/PL_010_V1/retEventoEConf_v1.00.xsd +9 -0
  413. package/packages/nfe/schemas/PL_010_V1/retEventoEPEC_v0.01.xsd +207 -0
  414. package/packages/nfe/schemas/PL_010_V1/retEventoEntregaNFe_v1.00.xsd +9 -0
  415. package/packages/nfe/schemas/PL_010_V1/retEventoInsucessoNFe_v1.00.xsd +9 -0
  416. package/packages/nfe/schemas/PL_010_V1/retInutNFe_v3.10.xsd +9 -0
  417. package/packages/nfe/schemas/PL_010_V1/retInutNFe_v4.00.xsd +9 -0
  418. package/packages/nfe/schemas/PL_010_V1/retPProrrogNFe_v1.0.xsd +233 -0
  419. package/packages/nfe/schemas/PL_010_V1/retconsNFeDest_v1.01.xsd +9 -0
  420. package/packages/nfe/schemas/PL_010_V1/tiposBasico_v1.03.xsd +872 -0
  421. package/packages/nfe/schemas/PL_010_V1/tiposBasico_v3.10.xsd +571 -0
  422. package/packages/nfe/schemas/PL_010_V1/tiposBasico_v4.00.xsd +598 -0
  423. package/packages/nfe/schemas/PL_010_V1/tiposBasicosCcgConsGTIN_v1.00.xsd +84 -0
  424. package/packages/nfe/schemas/PL_010_V1/tiposDistDFe_v1.00.xsd +217 -0
  425. package/packages/nfe/schemas/PL_010_V1/tiposDistDFe_v1.01.xsd +222 -0
  426. package/packages/nfe/schemas/PL_010_V1/xmldsig-core-schema_v1.01.xsd +98 -0
  427. package/packages/nfe/schemas/PL_010_V1.21/110150_v1.00.xsd +88 -0
  428. package/packages/nfe/schemas/PL_010_V1.21/Averb_v1.00.xsd +11 -0
  429. package/packages/nfe/schemas/PL_010_V1.21/CCe_v1.00.xsd +11 -0
  430. package/packages/nfe/schemas/PL_010_V1.21/DFeTiposBasicos_v1.00.xsd +1097 -0
  431. package/packages/nfe/schemas/PL_010_V1.21/EPEC_v1.00.xsd +9 -0
  432. package/packages/nfe/schemas/PL_010_V1.21/EPP1.xml +13 -0
  433. package/packages/nfe/schemas/PL_010_V1.21/ERP1.xml +19 -0
  434. package/packages/nfe/schemas/PL_010_V1.21/EventoCancEConf_v1.00.xsd +9 -0
  435. package/packages/nfe/schemas/PL_010_V1.21/EventoCancInsucessoNFe_v1.00.xsd +9 -0
  436. package/packages/nfe/schemas/PL_010_V1.21/EventoEConf_v1.00.xsd +9 -0
  437. package/packages/nfe/schemas/PL_010_V1.21/EventoInsucessoNFe_v1.00.xsd +9 -0
  438. package/packages/nfe/schemas/PL_010_V1.21/MT_inutNFe_v4.00.xsd +9 -0
  439. package/packages/nfe/schemas/PL_010_V1.21/SuframaInternaliza_v1.00.xsd +9 -0
  440. package/packages/nfe/schemas/PL_010_V1.21/SuframaVistoria_v1.00.xsd +9 -0
  441. package/packages/nfe/schemas/PL_010_V1.21/confRecebto_v1.00.xsd +9 -0
  442. package/packages/nfe/schemas/PL_010_V1.21/consCad_v2.00.xsd +9 -0
  443. package/packages/nfe/schemas/PL_010_V1.21/consGTIN_v1.00.xsd +10 -0
  444. package/packages/nfe/schemas/PL_010_V1.21/consNFeDest_v1.01.xsd +10 -0
  445. package/packages/nfe/schemas/PL_010_V1.21/consReciNFe_v3.10.xsd +9 -0
  446. package/packages/nfe/schemas/PL_010_V1.21/consReciNFe_v4.00.xsd +9 -0
  447. package/packages/nfe/schemas/PL_010_V1.21/consSitNFe_v3.10.xsd +9 -0
  448. package/packages/nfe/schemas/PL_010_V1.21/consSitNFe_v4.00.xsd +9 -0
  449. package/packages/nfe/schemas/PL_010_V1.21/consStatServ_v3.10.xsd +9 -0
  450. package/packages/nfe/schemas/PL_010_V1.21/consStatServ_v4.00.xsd +9 -0
  451. package/packages/nfe/schemas/PL_010_V1.21/distDFeInt_v1.00.xsd +71 -0
  452. package/packages/nfe/schemas/PL_010_V1.21/distDFeInt_v1.01.xsd +97 -0
  453. package/packages/nfe/schemas/PL_010_V1.21/downloadNFe_v1.00.xsd +10 -0
  454. package/packages/nfe/schemas/PL_010_V1.21/e110001_v1.00.xsd +73 -0
  455. package/packages/nfe/schemas/PL_010_V1.21/e110110_v1.00.xsd +58 -0
  456. package/packages/nfe/schemas/PL_010_V1.21/e110111_v1.00.xsd +42 -0
  457. package/packages/nfe/schemas/PL_010_V1.21/e110112_v1.00.xsd +69 -0
  458. package/packages/nfe/schemas/PL_010_V1.21/e110130_v1.00.xsd +102 -0
  459. package/packages/nfe/schemas/PL_010_V1.21/e110131_v1.00.xsd +51 -0
  460. package/packages/nfe/schemas/PL_010_V1.21/e110140NFCe_v1.00.xsd +118 -0
  461. package/packages/nfe/schemas/PL_010_V1.21/e110140NFe_v1.00.xsd +124 -0
  462. package/packages/nfe/schemas/PL_010_V1.21/e110140_v1.00.xsd +124 -0
  463. package/packages/nfe/schemas/PL_010_V1.21/e110150_v1.00.xsd +88 -0
  464. package/packages/nfe/schemas/PL_010_V1.21/e110192_v1.00.xsd +106 -0
  465. package/packages/nfe/schemas/PL_010_V1.21/e110193_v1.00.xsd +40 -0
  466. package/packages/nfe/schemas/PL_010_V1.21/e110750_v1.00.xsd +138 -0
  467. package/packages/nfe/schemas/PL_010_V1.21/e110751_v1.00.xsd +39 -0
  468. package/packages/nfe/schemas/PL_010_V1.21/e111500_v1.00.xsd +69 -0
  469. package/packages/nfe/schemas/PL_010_V1.21/e111501_v1.00.xsd +69 -0
  470. package/packages/nfe/schemas/PL_010_V1.21/e111502_v1.00.xsd +50 -0
  471. package/packages/nfe/schemas/PL_010_V1.21/e111503_v1.00.xsd +50 -0
  472. package/packages/nfe/schemas/PL_010_V1.21/e112110_v1.00.xsd +69 -0
  473. package/packages/nfe/schemas/PL_010_V1.21/e112120_v1.00 .xsd +107 -0
  474. package/packages/nfe/schemas/PL_010_V1.21/e112130_v1.00.xsd +119 -0
  475. package/packages/nfe/schemas/PL_010_V1.21/e112140_v1.00.xsd +107 -0
  476. package/packages/nfe/schemas/PL_010_V1.21/e210200_v1.00.xsd +31 -0
  477. package/packages/nfe/schemas/PL_010_V1.21/e210210_v1.00.xsd +31 -0
  478. package/packages/nfe/schemas/PL_010_V1.21/e210220_v1.00.xsd +44 -0
  479. package/packages/nfe/schemas/PL_010_V1.21/e210240_v1.00.xsd +44 -0
  480. package/packages/nfe/schemas/PL_010_V1.21/e211110_v1.00.xsd +134 -0
  481. package/packages/nfe/schemas/PL_010_V1.21/e211120_v1.00.xsd +124 -0
  482. package/packages/nfe/schemas/PL_010_V1.21/e211124_v1.00.xsd +107 -0
  483. package/packages/nfe/schemas/PL_010_V1.21/e211128_v1.00.xsd +69 -0
  484. package/packages/nfe/schemas/PL_010_V1.21/e211130_v1.00.xsd +107 -0
  485. package/packages/nfe/schemas/PL_010_V1.21/e211140_v1.00.xsd +107 -0
  486. package/packages/nfe/schemas/PL_010_V1.21/e211150_v1.00.xsd +85 -0
  487. package/packages/nfe/schemas/PL_010_V1.21/e212110_v1.00.xsd +70 -0
  488. package/packages/nfe/schemas/PL_010_V1.21/e212120_v1.00.xsd +69 -0
  489. package/packages/nfe/schemas/PL_010_V1.21/e411500_v1.00.xsd +134 -0
  490. package/packages/nfe/schemas/PL_010_V1.21/e411501_v1.00.xsd +134 -0
  491. package/packages/nfe/schemas/PL_010_V1.21/e411502_v1.00.xsd +95 -0
  492. package/packages/nfe/schemas/PL_010_V1.21/e411503_v1.00.xsd +95 -0
  493. package/packages/nfe/schemas/PL_010_V1.21/e412120_v1.00.xsd +88 -0
  494. package/packages/nfe/schemas/PL_010_V1.21/e412130_v1.00.xsd +88 -0
  495. package/packages/nfe/schemas/PL_010_V1.21/e610130_v1.00.xsd +128 -0
  496. package/packages/nfe/schemas/PL_010_V1.21/e610131_v1.00.xsd +68 -0
  497. package/packages/nfe/schemas/PL_010_V1.21/e790700_v1.00.xsd +148 -0
  498. package/packages/nfe/schemas/PL_010_V1.21/e990900_v1.00.xsd +87 -0
  499. package/packages/nfe/schemas/PL_010_V1.21/e990910_v1.00.xsd +81 -0
  500. package/packages/nfe/schemas/PL_010_V1.21/envAverb_v1.00.xsd +9 -0
  501. package/packages/nfe/schemas/PL_010_V1.21/envCCe_v1.00.xsd +10 -0
  502. package/packages/nfe/schemas/PL_010_V1.21/envCancelPProrrogNFe_v1.0.xsd +50 -0
  503. package/packages/nfe/schemas/PL_010_V1.21/envComprovanteEntregaNFe_v1.00.xsd +11 -0
  504. package/packages/nfe/schemas/PL_010_V1.21/envConfRecebto_v1.00.xsd +9 -0
  505. package/packages/nfe/schemas/PL_010_V1.21/envEPEC_v1.00.xsd +9 -0
  506. package/packages/nfe/schemas/PL_010_V1.21/envEventoAtorInteressado_v1.00.xsd +9 -0
  507. package/packages/nfe/schemas/PL_010_V1.21/envEventoCancEConf_v1.00.xsd +10 -0
  508. package/packages/nfe/schemas/PL_010_V1.21/envEventoCancEntregaNFe_v1.00.xsd +10 -0
  509. package/packages/nfe/schemas/PL_010_V1.21/envEventoCancInsucessoNFe_v1.00.xsd +10 -0
  510. package/packages/nfe/schemas/PL_010_V1.21/envEventoCancNFe_v1.00.xsd +9 -0
  511. package/packages/nfe/schemas/PL_010_V1.21/envEventoCancSubst_v1.00.xsd +9 -0
  512. package/packages/nfe/schemas/PL_010_V1.21/envEventoEConf_v1.00.xsd +10 -0
  513. package/packages/nfe/schemas/PL_010_V1.21/envEventoEntregaNFe_v1.00.xsd +10 -0
  514. package/packages/nfe/schemas/PL_010_V1.21/envEventoInsucessoNFe_v1.00.xsd +10 -0
  515. package/packages/nfe/schemas/PL_010_V1.21/envEvento_v1.00.xsd +9 -0
  516. package/packages/nfe/schemas/PL_010_V1.21/envFiscoNfe_v1.0.xsd +179 -0
  517. package/packages/nfe/schemas/PL_010_V1.21/envPProrrogNFe_v1.0.xsd +65 -0
  518. package/packages/nfe/schemas/PL_010_V1.21/envRemIndus_v1.00.xsd +9 -0
  519. package/packages/nfe/schemas/PL_010_V1.21/envSuframaInternaliza_v1.00.xsd +10 -0
  520. package/packages/nfe/schemas/PL_010_V1.21/envSuframaVistoria_v1.00.xsd +10 -0
  521. package/packages/nfe/schemas/PL_010_V1.21/enviNFe_v3.10.xsd +9 -0
  522. package/packages/nfe/schemas/PL_010_V1.21/enviNFe_v4.00.xsd +9 -0
  523. package/packages/nfe/schemas/PL_010_V1.21/eventoAtorInteressado_v1.00.xsd +9 -0
  524. package/packages/nfe/schemas/PL_010_V1.21/eventoCancEntregaNFe_v1.00.xsd +9 -0
  525. package/packages/nfe/schemas/PL_010_V1.21/eventoCancNFe_v1.00.xsd +9 -0
  526. package/packages/nfe/schemas/PL_010_V1.21/eventoCancSubst_v1.00.xsd +9 -0
  527. package/packages/nfe/schemas/PL_010_V1.21/eventoEPEC_v0.01.xsd +267 -0
  528. package/packages/nfe/schemas/PL_010_V1.21/eventoEPEC_v1.00.xsd +231 -0
  529. package/packages/nfe/schemas/PL_010_V1.21/eventoEntregaNFe_v1.00.xsd +9 -0
  530. package/packages/nfe/schemas/PL_010_V1.21/eventoRemIndus_v1.00.xsd +9 -0
  531. package/packages/nfe/schemas/PL_010_V1.21/inutNFe_v3.10.xsd +9 -0
  532. package/packages/nfe/schemas/PL_010_V1.21/inutNFe_v4.00.xsd +9 -0
  533. package/packages/nfe/schemas/PL_010_V1.21/leiauteAverb_v1.00.xsd +468 -0
  534. package/packages/nfe/schemas/PL_010_V1.21/leiauteCCe_v1.00.xsd +382 -0
  535. package/packages/nfe/schemas/PL_010_V1.21/leiauteCcgConsGTIN_v1.00.xsd +94 -0
  536. package/packages/nfe/schemas/PL_010_V1.21/leiauteComprovanteEntregaNFe_v1.00.xsd +487 -0
  537. package/packages/nfe/schemas/PL_010_V1.21/leiauteConfRecebto_v1.00.xsd +369 -0
  538. package/packages/nfe/schemas/PL_010_V1.21/leiauteConsNFeDest_v1.01.xsd +483 -0
  539. package/packages/nfe/schemas/PL_010_V1.21/leiauteConsSitNFe_v3.10.xsd +502 -0
  540. package/packages/nfe/schemas/PL_010_V1.21/leiauteConsSitNFe_v4.00.xsd +502 -0
  541. package/packages/nfe/schemas/PL_010_V1.21/leiauteConsStatServ_v3.10.xsd +98 -0
  542. package/packages/nfe/schemas/PL_010_V1.21/leiauteConsStatServ_v4.00.xsd +98 -0
  543. package/packages/nfe/schemas/PL_010_V1.21/leiauteConsultaCadastro_v2.00.xsd +404 -0
  544. package/packages/nfe/schemas/PL_010_V1.21/leiauteDownloadNFe_v1.00.xsd +149 -0
  545. package/packages/nfe/schemas/PL_010_V1.21/leiauteEPEC_v1.00.xsd +423 -0
  546. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoAtorInteressado_v1.00.xsd +384 -0
  547. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoCancEConf_v1.00.xsd +296 -0
  548. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoCancEntregaNFe_v1.00.xsd +307 -0
  549. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoCancInsucessoNFe_v1.00.xsd +297 -0
  550. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoCancNFe_v1.00.xsd +358 -0
  551. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoCancSubst_v1.00.xsd +366 -0
  552. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoEConf_v1.00.xsd +296 -0
  553. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoEntregaNFe_v1.00.xsd +321 -0
  554. package/packages/nfe/schemas/PL_010_V1.21/leiauteEventoInsucessoNFe_v1.00.xsd +297 -0
  555. package/packages/nfe/schemas/PL_010_V1.21/leiauteEvento_v1.00.xsd +335 -0
  556. package/packages/nfe/schemas/PL_010_V1.21/leiauteInutNFe_v3.10.xsd +193 -0
  557. package/packages/nfe/schemas/PL_010_V1.21/leiauteInutNFe_v4.00.xsd +193 -0
  558. package/packages/nfe/schemas/PL_010_V1.21/leiauteInutNFe_v4.00_MT.xsd +200 -0
  559. package/packages/nfe/schemas/PL_010_V1.21/leiauteNFe_v3.10.xsd +6060 -0
  560. package/packages/nfe/schemas/PL_010_V1.21/leiauteNFe_v4.00.xsd +7558 -0
  561. package/packages/nfe/schemas/PL_010_V1.21/leiauteRemIndus_v1.00.xsd +344 -0
  562. package/packages/nfe/schemas/PL_010_V1.21/leiauteSuframaInternaliza_v1.00.xsd +642 -0
  563. package/packages/nfe/schemas/PL_010_V1.21/leiauteSuframaVistoria_v1.00.xsd +648 -0
  564. package/packages/nfe/schemas/PL_010_V1.21/nfe_v3.10.xsd +9 -0
  565. package/packages/nfe/schemas/PL_010_V1.21/nfe_v4.00.xsd +10 -0
  566. package/packages/nfe/schemas/PL_010_V1.21/procAverbNFe_v1.00.xsd +10 -0
  567. package/packages/nfe/schemas/PL_010_V1.21/procCCeNFe_v1.00.xsd +10 -0
  568. package/packages/nfe/schemas/PL_010_V1.21/procComprovanteEntregaNFe_v1.00.xsd +10 -0
  569. package/packages/nfe/schemas/PL_010_V1.21/procConfRecebtoNFe_v1.00.xsd +9 -0
  570. package/packages/nfe/schemas/PL_010_V1.21/procEPEC_v1.00.xsd +9 -0
  571. package/packages/nfe/schemas/PL_010_V1.21/procEventoAtorInteressado_v1.00.xsd +9 -0
  572. package/packages/nfe/schemas/PL_010_V1.21/procEventoCancEConf_v1.00.xsd +9 -0
  573. package/packages/nfe/schemas/PL_010_V1.21/procEventoCancEntregaNFe_v1.00.xsd +9 -0
  574. package/packages/nfe/schemas/PL_010_V1.21/procEventoCancInsucessoNFe_v1.00.xsd +9 -0
  575. package/packages/nfe/schemas/PL_010_V1.21/procEventoCancNFe_v1.00.xsd +9 -0
  576. package/packages/nfe/schemas/PL_010_V1.21/procEventoCancSubst_v1.00.xsd +9 -0
  577. package/packages/nfe/schemas/PL_010_V1.21/procEventoEConf_v1.00.xsd +9 -0
  578. package/packages/nfe/schemas/PL_010_V1.21/procEventoEntregaNFe_v1.00.xsd +9 -0
  579. package/packages/nfe/schemas/PL_010_V1.21/procEventoInsucessoNFe_v1.00.xsd +9 -0
  580. package/packages/nfe/schemas/PL_010_V1.21/procEventoNFe_v1.00.xsd +9 -0
  581. package/packages/nfe/schemas/PL_010_V1.21/procEventoNFe_v99.99.xsd +37 -0
  582. package/packages/nfe/schemas/PL_010_V1.21/procInutNFe_v3.10.xsd +9 -0
  583. package/packages/nfe/schemas/PL_010_V1.21/procInutNFe_v4.00.xsd +9 -0
  584. package/packages/nfe/schemas/PL_010_V1.21/procNFe_v3.10.xsd +9 -0
  585. package/packages/nfe/schemas/PL_010_V1.21/procNFe_v4.00.xsd +9 -0
  586. package/packages/nfe/schemas/PL_010_V1.21/procRemIndus_v1.00.xsd +9 -0
  587. package/packages/nfe/schemas/PL_010_V1.21/prod_leiauteNFe_v4.00.xsd +6736 -0
  588. package/packages/nfe/schemas/PL_010_V1.21/resEvento_v1.00.xsd +94 -0
  589. package/packages/nfe/schemas/PL_010_V1.21/resEvento_v1.01.xsd +108 -0
  590. package/packages/nfe/schemas/PL_010_V1.21/resNFe_v1.00.xsd +110 -0
  591. package/packages/nfe/schemas/PL_010_V1.21/resNFe_v1.01.xsd +122 -0
  592. package/packages/nfe/schemas/PL_010_V1.21/retComprovanteEntregaNFe_v1.00.xsd +10 -0
  593. package/packages/nfe/schemas/PL_010_V1.21/retConsCad_v2.00.xsd +9 -0
  594. package/packages/nfe/schemas/PL_010_V1.21/retConsGTIN_v1.00.xsd +9 -0
  595. package/packages/nfe/schemas/PL_010_V1.21/retConsReciNFe_v3.10.xsd +9 -0
  596. package/packages/nfe/schemas/PL_010_V1.21/retConsReciNFe_v4.00.xsd +9 -0
  597. package/packages/nfe/schemas/PL_010_V1.21/retConsSitNFe_v3.10.xsd +9 -0
  598. package/packages/nfe/schemas/PL_010_V1.21/retConsSitNFe_v4.00.xsd +9 -0
  599. package/packages/nfe/schemas/PL_010_V1.21/retConsStatServ_v3.10.xsd +9 -0
  600. package/packages/nfe/schemas/PL_010_V1.21/retConsStatServ_v4.00.xsd +9 -0
  601. package/packages/nfe/schemas/PL_010_V1.21/retDistDFeInt_v1.00.xsd +84 -0
  602. package/packages/nfe/schemas/PL_010_V1.21/retDistDFeInt_v1.01.xsd +99 -0
  603. package/packages/nfe/schemas/PL_010_V1.21/retDownloadNFe_v1.00.xsd +9 -0
  604. package/packages/nfe/schemas/PL_010_V1.21/retEnvAverb_v1.00.xsd +9 -0
  605. package/packages/nfe/schemas/PL_010_V1.21/retEnvAverb_v1.00_1.xsd +9 -0
  606. package/packages/nfe/schemas/PL_010_V1.21/retEnvCCe_v1.00.xsd +10 -0
  607. package/packages/nfe/schemas/PL_010_V1.21/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
  608. package/packages/nfe/schemas/PL_010_V1.21/retEnvConfRecebto_v1.00.xsd +9 -0
  609. package/packages/nfe/schemas/PL_010_V1.21/retEnvEPEC_v1.00.xsd +9 -0
  610. package/packages/nfe/schemas/PL_010_V1.21/retEnvEventoAtorInteressado_v1.00.xsd +9 -0
  611. package/packages/nfe/schemas/PL_010_V1.21/retEnvEventoCancNFe_v1.00.xsd +9 -0
  612. package/packages/nfe/schemas/PL_010_V1.21/retEnvEventoCancSubst_v1.00.xsd +9 -0
  613. package/packages/nfe/schemas/PL_010_V1.21/retEnvEvento_v1.00.xsd +9 -0
  614. package/packages/nfe/schemas/PL_010_V1.21/retEnvFiscoNFe_v1.0.xsd +234 -0
  615. package/packages/nfe/schemas/PL_010_V1.21/retEnvRemIndus_v1.00.xsd +9 -0
  616. package/packages/nfe/schemas/PL_010_V1.21/retEnvSuframaInternaliza_v1.00.xsd +9 -0
  617. package/packages/nfe/schemas/PL_010_V1.21/retEnvSuframaVistoria_v1.00.xsd +9 -0
  618. package/packages/nfe/schemas/PL_010_V1.21/retEnviNFe_v3.10.xsd +9 -0
  619. package/packages/nfe/schemas/PL_010_V1.21/retEnviNFe_v4.00.xsd +9 -0
  620. package/packages/nfe/schemas/PL_010_V1.21/retEventoCancEConf_v1.00.xsd +9 -0
  621. package/packages/nfe/schemas/PL_010_V1.21/retEventoCancEntregaNFe_v1.00.xsd +9 -0
  622. package/packages/nfe/schemas/PL_010_V1.21/retEventoCancInsucessoNFe_v1.00.xsd +9 -0
  623. package/packages/nfe/schemas/PL_010_V1.21/retEventoEConf_v1.00.xsd +9 -0
  624. package/packages/nfe/schemas/PL_010_V1.21/retEventoEPEC_v0.01.xsd +207 -0
  625. package/packages/nfe/schemas/PL_010_V1.21/retEventoEntregaNFe_v1.00.xsd +9 -0
  626. package/packages/nfe/schemas/PL_010_V1.21/retEventoInsucessoNFe_v1.00.xsd +9 -0
  627. package/packages/nfe/schemas/PL_010_V1.21/retInutNFe_v3.10.xsd +9 -0
  628. package/packages/nfe/schemas/PL_010_V1.21/retInutNFe_v4.00.xsd +9 -0
  629. package/packages/nfe/schemas/PL_010_V1.21/retPProrrogNFe_v1.0.xsd +233 -0
  630. package/packages/nfe/schemas/PL_010_V1.21/retconsNFeDest_v1.01.xsd +9 -0
  631. package/packages/nfe/schemas/PL_010_V1.21/tiposBasico_v1.03.xsd +872 -0
  632. package/packages/nfe/schemas/PL_010_V1.21/tiposBasico_v3.10.xsd +571 -0
  633. package/packages/nfe/schemas/PL_010_V1.21/tiposBasico_v4.00.xsd +598 -0
  634. package/packages/nfe/schemas/PL_010_V1.21/tiposBasicosCcgConsGTIN_v1.00.xsd +84 -0
  635. package/packages/nfe/schemas/PL_010_V1.21/tiposDistDFe_v1.00.xsd +217 -0
  636. package/packages/nfe/schemas/PL_010_V1.21/tiposDistDFe_v1.01.xsd +222 -0
  637. package/packages/nfe/schemas/PL_010_V1.21/xmldsig-core-schema_v1.01.xsd +98 -0
  638. package/dist/src-QBEIGHGM.mjs +0 -8
@@ -0,0 +1,238 @@
1
+ import{a as pw,b as AK,c as CK,d as bK}from"./chunk-3WPW27WV.mjs";import{a as o,b as gt,d as ye,f as hw}from"./chunk-W6MRGYXP.mjs";var $t=ye((Fle,PP)=>{"use strict";PP.exports={options:{usePureJavaScript:!1}}});var LP=ye((qle,kP)=>{"use strict";var Vb={};kP.exports=Vb;var OP={};Vb.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=D$(r,e);else{var s=0,i=e.length,a=e.charAt(0),u=[0];for(s=0;s<r.length;++s){for(var l=0,f=r[s];l<u.length;++l)f+=u[l]<<8,u[l]=f%i,f=f/i|0;for(;f>0;)u.push(f%i),f=f/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=u.length-1;s>=0;--s)n+=e[u[s]]}if(t){var h=new RegExp(".{1,"+t+"}","g");n=n.match(h).join(`\r
2
+ `)}return n};Vb.decode=function(r,e){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var t=OP[e];if(!t){t=OP[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var s=e.length,i=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var l=0,f=u;l<a.length;++l)f+=a[l]*s,a[l]=f&255,f>>=8;for(;f>0;)a.push(f&255),f>>=8}for(var h=0;r[h]===i&&h<r.length-1;++h)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function D$(r,e){var t=0,n=e.length,s=e.charAt(0),i=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<i.length;++a)u+=i[a]<<8,i[a]=u%n,u=u/n|0;for(;u>0;)i.push(u%n),u=u/n|0}var l="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)l+=s;for(t=i.length-1;t>=0;--t)l+=e[i[t]];return l}o(D$,"_encodeWithByteBuffer")});var ur=ye((Kle,jP)=>{"use strict";var VP=$t(),UP=LP(),re=jP.exports=VP.util=VP.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){re.nextTick=process.nextTick,typeof setImmediate=="function"?re.setImmediate=setImmediate:re.setImmediate=re.nextTick;return}if(typeof setImmediate=="function"){re.setImmediate=function(){return setImmediate.apply(void 0,arguments)},re.nextTick=function(u){return setImmediate(u)};return}if(re.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(l){if(l.source===window&&l.data===r){l.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(h){h()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];re.setImmediate=function(l){e.push(l),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var l=e.slice();e.length=0,l.forEach(function(f){f()})}).observe(s,{attributes:!0});var i=re.setImmediate;re.setImmediate=function(l){Date.now()-t>15?(t=Date.now(),i(l)):(e.push(l),e.length===1&&s.setAttribute("a",n=!n))}}re.nextTick=re.setImmediate})();re.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;re.globalScope=(function(){return re.isNodejs?global:typeof self>"u"?window:self})();re.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};re.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};re.isArrayBufferView=function(r){return r&&re.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function gm(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(gm,"_checkBitsParam");re.ByteBuffer=Ub;function Ub(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(re.isArrayBuffer(r)||re.isArrayBufferView(r))if(typeof Buffer<"u"&&r instanceof Buffer)this.data=r.toString("binary");else{var e=new Uint8Array(r);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var t=0;t<e.length;++t)this.putByte(e[t])}}else(r instanceof Ub||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(Ub,"ByteStringBuffer");re.ByteStringBuffer=Ub;var _$=4096;re.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>_$&&(this.data.substr(0,1),this._constructedStringLength=0)};re.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};re.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};re.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};re.ByteStringBuffer.prototype.fillWithByte=function(r,e){r=String.fromCharCode(r);for(var t=this.data;e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return this.data=t,this._optimizeConstructedString(e),this};re.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};re.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(re.encodeUtf8(r))};re.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt32=function(r){return this.putBytes(String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};re.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};re.ByteStringBuffer.prototype.putInt32Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>24&255))};re.ByteStringBuffer.prototype.putInt=function(r,e){gm(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};re.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};re.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};re.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};re.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};re.ByteStringBuffer.prototype.getInt24=function(){var r=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,r};re.ByteStringBuffer.prototype.getInt32=function(){var r=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,r};re.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};re.ByteStringBuffer.prototype.getInt24Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,r};re.ByteStringBuffer.prototype.getInt32Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,r};re.ByteStringBuffer.prototype.getInt=function(r){gm(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};re.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};re.ByteStringBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};re.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};re.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};re.ByteStringBuffer.prototype.setAt=function(r,e){return this.data=this.data.substr(0,this.read+r)+String.fromCharCode(e)+this.data.substr(this.read+r+1),this};re.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};re.ByteStringBuffer.prototype.copy=function(){var r=re.createBuffer(this.data);return r.read=this.read,r};re.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};re.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};re.ByteStringBuffer.prototype.truncate=function(r){var e=Math.max(0,this.length()-r);return this.data=this.data.substr(this.read,e),this.read=0,this};re.ByteStringBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.length;++e){var t=this.data.charCodeAt(e);t<16&&(r+="0"),r+=t.toString(16)}return r};re.ByteStringBuffer.prototype.toString=function(){return re.decodeUtf8(this.bytes())};function R$(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=re.isArrayBuffer(r),n=re.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(R$,"DataBuffer");re.DataBuffer=R$;re.DataBuffer.prototype.length=function(){return this.write-this.read};re.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};re.DataBuffer.prototype.accommodate=function(r,e){if(this.length()>=r)return this;e=Math.max(e||this.growSize,r);var t=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(t),this.data=new DataView(n.buffer),this};re.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};re.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};re.DataBuffer.prototype.putBytes=function(r,e){if(re.isArrayBufferView(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),n=t.byteLength-t.byteOffset;this.accommodate(n);var s=new Uint8Array(this.data.buffer,this.write);return s.set(t),this.write+=n,this}if(re.isArrayBuffer(r)){var t=new Uint8Array(r);this.accommodate(t.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(t,this.write),this.write+=t.byteLength,this}if(r instanceof re.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&re.isArrayBufferView(r.data)){var t=new Uint8Array(r.data.byteLength,r.read,r.length());this.accommodate(t.byteLength);var s=new Uint8Array(r.data.byteLength,this.write);return s.set(t),this.write+=t.byteLength,this}if(r instanceof re.ByteStringBuffer&&(r=r.data,e="binary"),e=e||"binary",typeof r=="string"){var i;if(e==="hex")return this.accommodate(Math.ceil(r.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.hex.decode(r,i,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(r.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.base64.decode(r,i,this.write),this;if(e==="utf8"&&(r=re.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(r.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=re.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};re.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};re.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};re.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};re.DataBuffer.prototype.putInt24=function(r){return this.accommodate(3),this.data.setInt16(this.write,r>>8&65535),this.data.setInt8(this.write,r>>16&255),this.write+=3,this};re.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};re.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};re.DataBuffer.prototype.putInt24Le=function(r){return this.accommodate(3),this.data.setInt8(this.write,r>>16&255),this.data.setInt16(this.write,r>>8&65535,!0),this.write+=3,this};re.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};re.DataBuffer.prototype.putInt=function(r,e){gm(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};re.DataBuffer.prototype.putSignedInt=function(r,e){return gm(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};re.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};re.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};re.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};re.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};re.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};re.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};re.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};re.DataBuffer.prototype.getInt=function(r){gm(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};re.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};re.DataBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};re.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};re.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};re.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};re.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};re.DataBuffer.prototype.copy=function(){return new re.DataBuffer(this)};re.DataBuffer.prototype.compact=function(){if(this.read>0){var r=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(r.byteLength);e.set(r),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};re.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};re.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};re.DataBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.byteLength;++e){var t=this.data.getUint8(e);t<16&&(r+="0"),r+=t.toString(16)}return r};re.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return re.binary.raw.encode(e);if(r==="hex")return re.binary.hex.encode(e);if(r==="base64")return re.binary.base64.encode(e);if(r==="utf8")return re.text.utf8.decode(e);if(r==="utf16")return re.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};re.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=re.encodeUtf8(r)),new re.ByteBuffer(r)};re.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};re.xorBytes=function(r,e,t){for(var n="",s="",i="",a=0,u=0;t>0;--t,++a)s=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=i,i="",u=0),i+=String.fromCharCode(s),++u;return n+=i,n};re.hexToBytes=function(r){var e="",t=0;for(r.length&!0&&(t=1,e+=String.fromCharCode(parseInt(r[0],16)));t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substr(t,2),16));return e};re.bytesToHex=function(r){return re.createBuffer(r).toHex()};re.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",yu=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],MP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";re.encode64=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.length;)s=r.charCodeAt(u++),i=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=gu.charAt(s>>2),t+=gu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=gu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":gu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
+ `,t=t.substr(e));return n+=t,n};re.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,s,i,a=0;a<r.length;)t=yu[r.charCodeAt(a++)-43],n=yu[r.charCodeAt(a++)-43],s=yu[r.charCodeAt(a++)-43],i=yu[r.charCodeAt(a++)-43],e+=String.fromCharCode(t<<2|n>>4),s!==64&&(e+=String.fromCharCode((n&15)<<4|s>>2),i!==64&&(e+=String.fromCharCode((s&3)<<6|i)));return e};re.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};re.decodeUtf8=function(r){return decodeURIComponent(escape(r))};re.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:UP.encode,decode:UP.decode}};re.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};re.binary.raw.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};re.binary.hex.encode=re.bytesToHex;re.binary.hex.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/2))),t=t||0;var s=0,i=t;for(r.length&1&&(s=1,n[i++]=parseInt(r[0],16));s<r.length;s+=2)n[i++]=parseInt(r.substr(s,2),16);return e?i-t:n};re.binary.base64.encode=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.byteLength;)s=r[u++],i=r[u++],a=r[u++],t+=gu.charAt(s>>2),t+=gu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=gu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":gu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
4
+ `,t=t.substr(e));return n+=t,n};re.binary.base64.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/4)*3)),r=r.replace(/[^A-Za-z0-9\+\/\=]/g,""),t=t||0;for(var s,i,a,u,l=0,f=t;l<r.length;)s=yu[r.charCodeAt(l++)-43],i=yu[r.charCodeAt(l++)-43],a=yu[r.charCodeAt(l++)-43],u=yu[r.charCodeAt(l++)-43],n[f++]=s<<2|i>>4,a!==64&&(n[f++]=(i&15)<<4|a>>2,u!==64&&(n[f++]=(a&3)<<6|u));return e?f-t:n.subarray(0,f)};re.binary.base58.encode=function(r,e){return re.binary.baseN.encode(r,MP,e)};re.binary.base58.decode=function(r,e){return re.binary.baseN.decode(r,MP,e)};re.text={utf8:{},utf16:{}};re.text.utf8.encode=function(r,e,t){r=re.encodeUtf8(r);var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};re.text.utf8.decode=function(r){return re.decodeUtf8(String.fromCharCode.apply(null,r))};re.text.utf16.encode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length*2));var s=new Uint16Array(n.buffer);t=t||0;for(var i=t,a=t,u=0;u<r.length;++u)s[a++]=r.charCodeAt(u),i+=2;return e?i-t:n};re.text.utf16.decode=function(r){return String.fromCharCode.apply(null,new Uint16Array(r.buffer))};re.deflate=function(r,e,t){if(e=re.decode64(r.deflate(re.encode64(e)).rval),t){var n=2,s=e.charCodeAt(1);s&32&&(n=6),e=e.substring(n,e.length-4)}return e};re.inflate=function(r,e,t){var n=r.inflate(re.encode64(e)).rval;return n===null?null:re.decode64(n)};var Mb=o(function(r,e,t){if(!r)throw new Error("WebStorage not available.");var n;if(t===null?n=r.removeItem(e):(t=re.encode64(JSON.stringify(t)),n=r.setItem(e,t)),typeof n<"u"&&n.rval!==!0){var s=new Error(n.error.message);throw s.id=n.error.id,s.name=n.error.name,s}},"_setStorageObject"),jb=o(function(r,e){if(!r)throw new Error("WebStorage not available.");var t=r.getItem(e);if(r.init)if(t.rval===null){if(t.error){var n=new Error(t.error.message);throw n.id=t.error.id,n.name=t.error.name,n}t=null}else t=t.rval;return t!==null&&(t=JSON.parse(re.decode64(t))),t},"_getStorageObject"),P$=o(function(r,e,t,n){var s=jb(r,e);s===null&&(s={}),s[t]=n,Mb(r,e,s)},"_setItem"),O$=o(function(r,e,t){var n=jb(r,e);return n!==null&&(n=t in n?n[t]:null),n},"_getItem"),k$=o(function(r,e,t){var n=jb(r,e);if(n!==null&&t in n){delete n[t];var s=!0;for(var i in n){s=!1;break}s&&(n=null),Mb(r,e,n)}},"_removeItem"),L$=o(function(r,e){Mb(r,e,null)},"_clearItems"),Cw=o(function(r,e,t){var n=null;typeof t>"u"&&(t=["web","flash"]);var s,i=!1,a=null;for(var u in t){s=t[u];try{if(s==="flash"||s==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=r.apply(this,e),i=s==="flash"}(s==="web"||s==="both")&&(e[0]=localStorage,n=r.apply(this,e),i=!0)}catch(l){a=l}if(i)break}if(!i)throw a;return n},"_callStorageFunction");re.setItem=function(r,e,t,n,s){Cw(P$,arguments,s)};re.getItem=function(r,e,t,n){return Cw(O$,arguments,n)};re.removeItem=function(r,e,t,n){Cw(k$,arguments,n)};re.clearItems=function(r,e,t){Cw(L$,arguments,t)};re.isEmpty=function(r){for(var e in r)if(r.hasOwnProperty(e))return!1;return!0};re.format=function(r){for(var e=/%./g,t,n,s=0,i=[],a=0;t=e.exec(r);){n=r.substring(a,e.lastIndex-2),n.length>0&&i.push(n),a=e.lastIndex;var u=t[0][1];switch(u){case"s":case"o":s<arguments.length?i.push(arguments[s+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+u+"?>")}}return i.push(r.substring(a)),i.join("")};re.formatNumber=function(r,e,t,n){var s=r,i=isNaN(e=Math.abs(e))?2:e,a=t===void 0?",":t,u=n===void 0?".":n,l=s<0?"-":"",f=parseInt(s=Math.abs(+s||0).toFixed(i),10)+"",h=f.length>3?f.length%3:0;return l+(h?f.substr(0,h)+u:"")+f.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+u)+(i?a+Math.abs(s-f).toFixed(i).slice(2):"")};re.formatSize=function(r){return r>=1073741824?r=re.formatNumber(r/1073741824,2,".","")+" GiB":r>=1048576?r=re.formatNumber(r/1048576,2,".","")+" MiB":r>=1024?r=re.formatNumber(r/1024,0)+" KiB":r=re.formatNumber(r,0)+" bytes",r};re.bytesFromIP=function(r){return r.indexOf(".")!==-1?re.bytesFromIPv4(r):r.indexOf(":")!==-1?re.bytesFromIPv6(r):null};re.bytesFromIPv4=function(r){if(r=r.split("."),r.length!==4)return null;for(var e=re.createBuffer(),t=0;t<r.length;++t){var n=parseInt(r[t],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};re.bytesFromIPv6=function(r){var e=0;r=r.split(":").filter(function(a){return a.length===0&&++e,!0});for(var t=(8-r.length+e)*2,n=re.createBuffer(),s=0;s<8;++s){if(!r[s]||r[s].length===0){n.fillWithByte(0,t),t=0;continue}var i=re.hexToBytes(r[s]);i.length<2&&n.putByte(0),n.putBytes(i)}return n.getBytes()};re.bytesToIP=function(r){return r.length===4?re.bytesToIPv4(r):r.length===16?re.bytesToIPv6(r):null};re.bytesToIPv4=function(r){if(r.length!==4)return null;for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e.join(".")};re.bytesToIPv6=function(r){if(r.length!==16)return null;for(var e=[],t=[],n=0,s=0;s<r.length;s+=2){for(var i=re.bytesToHex(r[s]+r[s+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var a=t[t.length-1],u=e.length;!a||u!==a.end+1?t.push({start:u,end:u}):(a.end=u,a.end-a.start>t[n].end-t[n].start&&(n=t.length-1))}e.push(i)}if(t.length>0){var l=t[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),l.start===0&&e.unshift(""),l.end===7&&e.push(""))}return e.join(":")};re.estimateCores=function(r,e){if(typeof r=="function"&&(e=r,r={}),r=r||{},"cores"in re&&!r.update)return e(null,re.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return re.cores=navigator.hardwareConcurrency,e(null,re.cores);if(typeof Worker>"u")return re.cores=1,e(null,re.cores);if(typeof Blob>"u")return re.cores=2,e(null,re.cores);var t=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(a){for(var u=Date.now(),l=u+4;Date.now()<l;);self.postMessage({st:u,et:l})})}).toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,u,l){if(u===0){var f=Math.floor(a.reduce(function(h,m){return h+m},0)/a.length);return re.cores=Math.max(1,f),URL.revokeObjectURL(t),e(null,re.cores)}s(l,function(h,m){a.push(i(l,m)),n(a,u-1,l)})}o(n,"sample");function s(a,u){for(var l=[],f=[],h=0;h<a;++h){var m=new Worker(t);m.addEventListener("message",function(g){if(f.push(g.data),f.length===a){for(var w=0;w<a;++w)l[w].terminate();u(null,f)}}),l.push(m)}for(var h=0;h<a;++h)l[h].postMessage(h)}o(s,"map");function i(a,u){for(var l=[],f=0;f<a;++f)for(var h=u[f],m=l[f]=[],g=0;g<a;++g)if(f!==g){var w=u[g];(h.st>w.st&&h.st<w.et||w.st>h.st&&w.st<h.et)&&m.push(g)}return l.reduce(function(y,S){return Math.max(y,S.length)},0)}o(i,"reduce")}});var bw=ye((Xle,FP)=>{"use strict";var An=$t();ur();FP.exports=An.cipher=An.cipher||{};An.cipher.algorithms=An.cipher.algorithms||{};An.cipher.createCipher=function(r,e){var t=r;if(typeof t=="string"&&(t=An.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new An.cipher.BlockCipher({algorithm:t,key:e,decrypt:!1})};An.cipher.createDecipher=function(r,e){var t=r;if(typeof t=="string"&&(t=An.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new An.cipher.BlockCipher({algorithm:t,key:e,decrypt:!0})};An.cipher.registerAlgorithm=function(r,e){r=r.toUpperCase(),An.cipher.algorithms[r]=e};An.cipher.getAlgorithm=function(r){return r=r.toUpperCase(),r in An.cipher.algorithms?An.cipher.algorithms[r]:null};var Fb=An.cipher.BlockCipher=function(r){this.algorithm=r.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=r.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=r.decrypt,this.algorithm.initialize(r)};Fb.prototype.start=function(r){r=r||{};var e={};for(var t in r)e[t]=r[t];e.decrypt=this._decrypt,this._finish=!1,this._input=An.util.createBuffer(),this.output=r.output||An.util.createBuffer(),this.mode.start(e)};Fb.prototype.update=function(r){for(r&&this._input.putBuffer(r);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Fb.prototype.finish=function(r){r&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(t){return r(this.blockSize,t,!1)},this.mode.unpad=function(t){return r(this.blockSize,t,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Hb=ye((Gle,qP)=>{"use strict";var Cn=$t();ur();Cn.cipher=Cn.cipher||{};var zt=qP.exports=Cn.cipher.modes=Cn.cipher.modes||{};zt.ecb=function(r){r=r||{},this.name="ECB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};zt.ecb.prototype.start=function(r){};zt.ecb.prototype.encrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};zt.ecb.prototype.decrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};zt.ecb.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};zt.ecb.prototype.unpad=function(r,e){if(e.overflow>0)return!1;var t=r.length(),n=r.at(t-1);return n>this.blockSize<<2?!1:(r.truncate(n),!0)};zt.cbc=function(r){r=r||{},this.name="CBC",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};zt.cbc.prototype.start=function(r){if(r.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in r)this._iv=xw(r.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};zt.cbc.prototype.encrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^r.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};zt.cbc.prototype.decrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};zt.cbc.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};zt.cbc.prototype.unpad=function(r,e){if(e.overflow>0)return!1;var t=r.length(),n=r.at(t-1);return n>this.blockSize<<2?!1:(r.truncate(n),!0)};zt.cfb=function(r){r=r||{},this.name="CFB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0};zt.cfb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=xw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.cfb.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=r.getInt32()^this._outBlock[s],e.putInt32(this._inBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=r.getInt32()^this._outBlock[s],this._partialOutput.putInt32(this._partialBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};zt.cfb.prototype.decrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=r.getInt32(),e.putInt32(this._inBlock[s]^this._outBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=r.getInt32(),this._partialOutput.putInt32(this._partialBlock[s]^this._outBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};zt.ofb=function(r){r=r||{},this.name="OFB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0};zt.ofb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=xw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.ofb.prototype.encrypt=function(r,e,t){var n=r.length();if(r.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(r.getInt32()^this._outBlock[s]),this._inBlock[s]=this._outBlock[s];return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._outBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};zt.ofb.prototype.decrypt=zt.ofb.prototype.encrypt;zt.ctr=function(r){r=r||{},this.name="CTR",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0};zt.ctr.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=xw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.ctr.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var s=0;s<this._ints;++s)e.putInt32(r.getInt32()^this._outBlock[s]);else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i>0&&(r.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Nw(this._inBlock)};zt.ctr.prototype.decrypt=zt.ctr.prototype.encrypt;zt.gcm=function(r){r=r||{},this.name="GCM",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Cn.util.createBuffer(),this._partialBytes=0,this._R=3774873600};zt.gcm.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");var e=Cn.util.createBuffer(r.iv);this._cipherLength=0;var t;if("additionalData"in r?t=Cn.util.createBuffer(r.additionalData):t=Cn.util.createBuffer(),"tagLength"in r?this._tagLength=r.tagLength:this._tagLength=128,this._tag=null,r.decrypt&&(this._tag=Cn.util.createBuffer(r.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(qb(n*8)))}this._inBlock=this._j0.slice(0),Nw(this._inBlock),this._partialBytes=0,t=Cn.util.createBuffer(t),this._aDataLength=qb(t.length()*8);var s=t.length()%this.blockSize;for(s&&t.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])};zt.gcm.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^=r.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i<=0||t){if(t){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(var s=0;s<this._ints;++s)this._outBlock[s]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return r.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Nw(this._inBlock)};zt.gcm.prototype.decrypt=function(r,e,t){var n=r.length();if(n<this.blockSize&&!(t&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Nw(this._inBlock),this._hashBlock[0]=r.getInt32(),this._hashBlock[1]=r.getInt32(),this._hashBlock[2]=r.getInt32(),this._hashBlock[3]=r.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^this._hashBlock[s]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};zt.gcm.prototype.afterFinish=function(r,e){var t=!0;e.decrypt&&e.overflow&&r.truncate(this.blockSize-e.overflow),this.tag=Cn.util.createBuffer();var n=this._aDataLength.concat(qb(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var s=[];this.cipher.encrypt(this._j0,s);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^s[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(t=!1),t};zt.gcm.prototype.multiply=function(r,e){for(var t=[0,0,0,0],n=e.slice(0),s=0;s<128;++s){var i=r[s/32|0]&1<<31-s%32;i&&(t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]),this.pow(n,n)}return t};zt.gcm.prototype.pow=function(r,e){for(var t=r[3]&1,n=3;n>0;--n)e[n]=r[n]>>>1|(r[n-1]&1)<<31;e[0]=r[0]>>>1,t&&(e[0]^=this._R)};zt.gcm.prototype.tableMultiply=function(r){for(var e=[0,0,0,0],t=0;t<32;++t){var n=t/8|0,s=r[n]>>>(7-t%8)*4&15,i=this._m[t][s];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e};zt.gcm.prototype.ghash=function(r,e,t){return e[0]^=t[0],e[1]^=t[1],e[2]^=t[2],e[3]^=t[3],this.tableMultiply(e)};zt.gcm.prototype.generateHashTable=function(r,e){for(var t=8/e,n=4*t,s=16*t,i=new Array(s),a=0;a<s;++a){var u=[0,0,0,0],l=a/n|0,f=(n-1-a%n)*e;u[l]=1<<e-1<<f,i[a]=this.generateSubHashTable(this.multiply(u,r),e)}return i};zt.gcm.prototype.generateSubHashTable=function(r,e){var t=1<<e,n=t>>>1,s=new Array(t);s[n]=r.slice(0);for(var i=n>>>1;i>0;)this.pow(s[2*i],s[i]=[]),i>>=1;for(i=2;i<n;){for(var a=1;a<i;++a){var u=s[i],l=s[a];s[i+a]=[u[0]^l[0],u[1]^l[1],u[2]^l[2],u[3]^l[3]]}i*=2}for(s[0]=[0,0,0,0],i=n+1;i<t;++i){var f=s[i^n];s[i]=[r[0]^f[0],r[1]^f[1],r[2]^f[2],r[3]^f[3]]}return s};function xw(r,e){if(typeof r=="string"&&(r=Cn.util.createBuffer(r)),Cn.util.isArray(r)&&r.length>4){var t=r;r=Cn.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}if(r.length()<e)throw new Error("Invalid IV length; got "+r.length()+" bytes and expected "+e+" bytes.");if(!Cn.util.isArray(r)){for(var s=[],i=e/4,n=0;n<i;++n)s.push(r.getInt32());r=s}return r}o(xw,"transformIV");function Nw(r){r[r.length-1]=r[r.length-1]+1&4294967295}o(Nw,"inc32");function qb(r){return[r/4294967296|0,r&4294967295]}o(qb,"from64To32")});var vu=ye((Jle,XP)=>{"use strict";var Ir=$t();bw();Hb();ur();XP.exports=Ir.aes=Ir.aes||{};Ir.aes.startEncrypting=function(r,e,t,n){var s=Tw({key:r,output:t,decrypt:!1,mode:n});return s.start(e),s};Ir.aes.createEncryptionCipher=function(r,e){return Tw({key:r,output:null,decrypt:!1,mode:e})};Ir.aes.startDecrypting=function(r,e,t,n){var s=Tw({key:r,output:t,decrypt:!0,mode:n});return s.start(e),s};Ir.aes.createDecryptionCipher=function(r,e){return Tw({key:r,output:null,decrypt:!0,mode:e})};Ir.aes.Algorithm=function(r,e){Xb||KP();var t=this;t.name=r,t.mode=new e({blockSize:16,cipher:{encrypt:o(function(n,s){return $b(t._w,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return $b(t._w,n,s,!0)},"decrypt")}}),t._init=!1};Ir.aes.Algorithm.prototype.initialize=function(r){if(!this._init){var e=r.key,t;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Ir.util.createBuffer(e);else if(Ir.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){t=e,e=Ir.util.createBuffer();for(var n=0;n<t.length;++n)e.putByte(t[n])}if(!Ir.util.isArray(e)){t=e,e=[];var s=t.length();if(s===16||s===24||s===32){s=s>>>2;for(var n=0;n<s;++n)e.push(t.getInt32())}}if(!Ir.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,a=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=$P(e,r.decrypt&&!a),this._init=!0}};Ir.aes._expandKey=function(r,e){return Xb||KP(),$P(r,e)};Ir.aes._updateBlock=$b;jh("AES-ECB",Ir.cipher.modes.ecb);jh("AES-CBC",Ir.cipher.modes.cbc);jh("AES-CFB",Ir.cipher.modes.cfb);jh("AES-OFB",Ir.cipher.modes.ofb);jh("AES-CTR",Ir.cipher.modes.ctr);jh("AES-GCM",Ir.cipher.modes.gcm);function jh(r,e){var t=o(function(){return new Ir.aes.Algorithm(r,e)},"factory");Ir.cipher.registerAlgorithm(r,t)}o(jh,"registerAlgorithm");var Xb=!1,Mh=4,us,Kb,HP,fc,ji;function KP(){Xb=!0,HP=[0,1,2,4,8,16,32,64,128,27,54];for(var r=new Array(256),e=0;e<128;++e)r[e]=e<<1,r[e+128]=e+128<<1^283;us=new Array(256),Kb=new Array(256),fc=new Array(4),ji=new Array(4);for(var e=0;e<4;++e)fc[e]=new Array(256),ji[e]=new Array(256);for(var t=0,n=0,s,i,a,u,l,f,h,e=0;e<256;++e){u=n^n<<1^n<<2^n<<3^n<<4,u=u>>8^u&255^99,us[t]=u,Kb[u]=t,l=r[u],s=r[t],i=r[s],a=r[i],f=l<<24^u<<16^u<<8^(u^l),h=(s^i^a)<<24^(t^a)<<16^(t^i^a)<<8^(t^s^a);for(var m=0;m<4;++m)fc[m][t]=f,ji[m][u]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;t===0?t=n=1:(t=s^r[r[r[s^a]]],n^=r[r[n]])}}o(KP,"initialize");function $P(r,e){for(var t=r.slice(0),n,s=1,i=t.length,a=i+6+1,u=Mh*a,l=i;l<u;++l)n=t[l-1],l%i===0?(n=us[n>>>16&255]<<24^us[n>>>8&255]<<16^us[n&255]<<8^us[n>>>24]^HP[s]<<24,s++):i>6&&l%i===4&&(n=us[n>>>24]<<24^us[n>>>16&255]<<16^us[n>>>8&255]<<8^us[n&255]),t[l]=t[l-i]^n;if(e){var f,h=ji[0],m=ji[1],g=ji[2],w=ji[3],y=t.slice(0);u=t.length;for(var l=0,S=u-Mh;l<u;l+=Mh,S-=Mh)if(l===0||l===u-Mh)y[l]=t[S],y[l+1]=t[S+3],y[l+2]=t[S+2],y[l+3]=t[S+1];else for(var E=0;E<Mh;++E)f=t[S+E],y[l+(3&-E)]=h[us[f>>>24]]^m[us[f>>>16&255]]^g[us[f>>>8&255]]^w[us[f&255]];t=y}return t}o($P,"_expandKey");function $b(r,e,t,n){var s=r.length/4-1,i,a,u,l,f;n?(i=ji[0],a=ji[1],u=ji[2],l=ji[3],f=Kb):(i=fc[0],a=fc[1],u=fc[2],l=fc[3],f=us);var h,m,g,w,y,S,E;h=e[0]^r[0],m=e[n?3:1]^r[1],g=e[2]^r[2],w=e[n?1:3]^r[3];for(var b=3,T=1;T<s;++T)y=i[h>>>24]^a[m>>>16&255]^u[g>>>8&255]^l[w&255]^r[++b],S=i[m>>>24]^a[g>>>16&255]^u[w>>>8&255]^l[h&255]^r[++b],E=i[g>>>24]^a[w>>>16&255]^u[h>>>8&255]^l[m&255]^r[++b],w=i[w>>>24]^a[h>>>16&255]^u[m>>>8&255]^l[g&255]^r[++b],h=y,m=S,g=E;t[0]=f[h>>>24]<<24^f[m>>>16&255]<<16^f[g>>>8&255]<<8^f[w&255]^r[++b],t[n?3:1]=f[m>>>24]<<24^f[g>>>16&255]<<16^f[w>>>8&255]<<8^f[h&255]^r[++b],t[2]=f[g>>>24]<<24^f[w>>>16&255]<<16^f[h>>>8&255]<<8^f[m&255]^r[++b],t[n?1:3]=f[w>>>24]<<24^f[h>>>16&255]<<16^f[m>>>8&255]<<8^f[g&255]^r[++b]}o($b,"_updateBlock");function Tw(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="AES-"+e,n;r.decrypt?n=Ir.cipher.createDecipher(t,r.key):n=Ir.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof Ir.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(Tw,"_createCipher")});var wu=ye((Yle,GP)=>{"use strict";var ym=$t();ym.pki=ym.pki||{};var Gb=GP.exports=ym.pki.oids=ym.oids=ym.oids||{};function Ue(r,e){Gb[r]=e,Gb[e]=r}o(Ue,"_IN");function yr(r,e){Gb[r]=e}o(yr,"_I_");Ue("1.2.840.113549.1.1.1","rsaEncryption");Ue("1.2.840.113549.1.1.4","md5WithRSAEncryption");Ue("1.2.840.113549.1.1.5","sha1WithRSAEncryption");Ue("1.2.840.113549.1.1.7","RSAES-OAEP");Ue("1.2.840.113549.1.1.8","mgf1");Ue("1.2.840.113549.1.1.9","pSpecified");Ue("1.2.840.113549.1.1.10","RSASSA-PSS");Ue("1.2.840.113549.1.1.11","sha256WithRSAEncryption");Ue("1.2.840.113549.1.1.12","sha384WithRSAEncryption");Ue("1.2.840.113549.1.1.13","sha512WithRSAEncryption");Ue("1.3.101.112","EdDSA25519");Ue("1.2.840.10040.4.3","dsa-with-sha1");Ue("1.3.14.3.2.7","desCBC");Ue("1.3.14.3.2.26","sha1");Ue("1.3.14.3.2.29","sha1WithRSASignature");Ue("2.16.840.1.101.3.4.2.1","sha256");Ue("2.16.840.1.101.3.4.2.2","sha384");Ue("2.16.840.1.101.3.4.2.3","sha512");Ue("2.16.840.1.101.3.4.2.4","sha224");Ue("2.16.840.1.101.3.4.2.5","sha512-224");Ue("2.16.840.1.101.3.4.2.6","sha512-256");Ue("1.2.840.113549.2.2","md2");Ue("1.2.840.113549.2.5","md5");Ue("1.2.840.113549.1.7.1","data");Ue("1.2.840.113549.1.7.2","signedData");Ue("1.2.840.113549.1.7.3","envelopedData");Ue("1.2.840.113549.1.7.4","signedAndEnvelopedData");Ue("1.2.840.113549.1.7.5","digestedData");Ue("1.2.840.113549.1.7.6","encryptedData");Ue("1.2.840.113549.1.9.1","emailAddress");Ue("1.2.840.113549.1.9.2","unstructuredName");Ue("1.2.840.113549.1.9.3","contentType");Ue("1.2.840.113549.1.9.4","messageDigest");Ue("1.2.840.113549.1.9.5","signingTime");Ue("1.2.840.113549.1.9.6","counterSignature");Ue("1.2.840.113549.1.9.7","challengePassword");Ue("1.2.840.113549.1.9.8","unstructuredAddress");Ue("1.2.840.113549.1.9.14","extensionRequest");Ue("1.2.840.113549.1.9.20","friendlyName");Ue("1.2.840.113549.1.9.21","localKeyId");Ue("1.2.840.113549.1.9.22.1","x509Certificate");Ue("1.2.840.113549.1.12.10.1.1","keyBag");Ue("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");Ue("1.2.840.113549.1.12.10.1.3","certBag");Ue("1.2.840.113549.1.12.10.1.4","crlBag");Ue("1.2.840.113549.1.12.10.1.5","secretBag");Ue("1.2.840.113549.1.12.10.1.6","safeContentsBag");Ue("1.2.840.113549.1.5.13","pkcs5PBES2");Ue("1.2.840.113549.1.5.12","pkcs5PBKDF2");Ue("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");Ue("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");Ue("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");Ue("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");Ue("1.2.840.113549.2.7","hmacWithSHA1");Ue("1.2.840.113549.2.8","hmacWithSHA224");Ue("1.2.840.113549.2.9","hmacWithSHA256");Ue("1.2.840.113549.2.10","hmacWithSHA384");Ue("1.2.840.113549.2.11","hmacWithSHA512");Ue("1.2.840.113549.3.7","des-EDE3-CBC");Ue("2.16.840.1.101.3.4.1.2","aes128-CBC");Ue("2.16.840.1.101.3.4.1.22","aes192-CBC");Ue("2.16.840.1.101.3.4.1.42","aes256-CBC");Ue("2.5.4.3","commonName");Ue("2.5.4.4","surname");Ue("2.5.4.5","serialNumber");Ue("2.5.4.6","countryName");Ue("2.5.4.7","localityName");Ue("2.5.4.8","stateOrProvinceName");Ue("2.5.4.9","streetAddress");Ue("2.5.4.10","organizationName");Ue("2.5.4.11","organizationalUnitName");Ue("2.5.4.12","title");Ue("2.5.4.13","description");Ue("2.5.4.15","businessCategory");Ue("2.5.4.17","postalCode");Ue("2.5.4.42","givenName");Ue("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");Ue("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");Ue("2.16.840.1.113730.1.1","nsCertType");Ue("2.16.840.1.113730.1.13","nsComment");yr("2.5.29.1","authorityKeyIdentifier");yr("2.5.29.2","keyAttributes");yr("2.5.29.3","certificatePolicies");yr("2.5.29.4","keyUsageRestriction");yr("2.5.29.5","policyMapping");yr("2.5.29.6","subtreesConstraint");yr("2.5.29.7","subjectAltName");yr("2.5.29.8","issuerAltName");yr("2.5.29.9","subjectDirectoryAttributes");yr("2.5.29.10","basicConstraints");yr("2.5.29.11","nameConstraints");yr("2.5.29.12","policyConstraints");yr("2.5.29.13","basicConstraints");Ue("2.5.29.14","subjectKeyIdentifier");Ue("2.5.29.15","keyUsage");yr("2.5.29.16","privateKeyUsagePeriod");Ue("2.5.29.17","subjectAltName");Ue("2.5.29.18","issuerAltName");Ue("2.5.29.19","basicConstraints");yr("2.5.29.20","cRLNumber");yr("2.5.29.21","cRLReason");yr("2.5.29.22","expirationDate");yr("2.5.29.23","instructionCode");yr("2.5.29.24","invalidityDate");yr("2.5.29.25","cRLDistributionPoints");yr("2.5.29.26","issuingDistributionPoint");yr("2.5.29.27","deltaCRLIndicator");yr("2.5.29.28","issuingDistributionPoint");yr("2.5.29.29","certificateIssuer");yr("2.5.29.30","nameConstraints");Ue("2.5.29.31","cRLDistributionPoints");Ue("2.5.29.32","certificatePolicies");yr("2.5.29.33","policyMappings");yr("2.5.29.34","policyConstraints");Ue("2.5.29.35","authorityKeyIdentifier");yr("2.5.29.36","policyConstraints");Ue("2.5.29.37","extKeyUsage");yr("2.5.29.46","freshestCRL");yr("2.5.29.54","inhibitAnyPolicy");Ue("1.3.6.1.4.1.11129.2.4.2","timestampList");Ue("1.3.6.1.5.5.7.1.1","authorityInfoAccess");Ue("1.3.6.1.5.5.7.3.1","serverAuth");Ue("1.3.6.1.5.5.7.3.2","clientAuth");Ue("1.3.6.1.5.5.7.3.3","codeSigning");Ue("1.3.6.1.5.5.7.3.4","emailProtection");Ue("1.3.6.1.5.5.7.3.8","timeStamping")});var Fi=ye((Zle,JP)=>{"use strict";var Lr=$t();ur();wu();var Qe=JP.exports=Lr.asn1=Lr.asn1||{};Qe.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Qe.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};Qe.create=function(r,e,t,n,s){if(Lr.util.isArray(n)){for(var i=[],a=0;a<n.length;++a)n[a]!==void 0&&i.push(n[a]);n=i}var u={tagClass:r,type:e,constructed:t,composed:t||Lr.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=Qe.copy(u)),u};Qe.copy=function(r,e){var t;if(Lr.util.isArray(r)){t=[];for(var n=0;n<r.length;++n)t.push(Qe.copy(r[n],e));return t}return typeof r=="string"?r:(t={tagClass:r.tagClass,type:r.type,constructed:r.constructed,composed:r.composed,value:Qe.copy(r.value,e)},e&&!e.excludeBitStringContents&&(t.bitStringContents=r.bitStringContents),t)};Qe.equals=function(r,e,t){if(Lr.util.isArray(r)){if(!Lr.util.isArray(e)||r.length!==e.length)return!1;for(var n=0;n<r.length;++n)if(!Qe.equals(r[n],e[n]))return!1;return!0}if(typeof r!=typeof e)return!1;if(typeof r=="string")return r===e;var s=r.tagClass===e.tagClass&&r.type===e.type&&r.constructed===e.constructed&&r.composed===e.composed&&Qe.equals(r.value,e.value);return t&&t.includeBitStringContents&&(s=s&&r.bitStringContents===e.bitStringContents),s};Qe.getBerValueLength=function(r){var e=r.getByte();if(e!==128){var t,n=e&128;return n?t=r.getInt((e&127)<<3):t=e,t}};function vm(r,e,t){if(t>e){var n=new Error("Too few bytes to parse DER.");throw n.available=r.length(),n.remaining=e,n.requested=t,n}}o(vm,"_checkBufferLength");var V$=o(function(r,e){var t=r.getByte();if(e--,t!==128){var n,s=t&128;if(!s)n=t;else{var i=t&127;vm(r,e,i),n=r.getInt(i<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");Qe.fromDer=function(r,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof r=="string"&&(r=Lr.util.createBuffer(r));var t=r.length(),n=Iw(r,r.length(),0,e);if(e.parseAllBytes&&r.length()!==0){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=t,s.remaining=r.length(),s}return n};function Iw(r,e,t,n){var s;vm(r,e,2);var i=r.getByte();e--;var a=i&192,u=i&31;s=r.length();var l=V$(r,e);if(e-=s-r.length(),l!==void 0&&l>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=r.length(),f.remaining=e,f.requested=l,f}l=e}var h,m,g=(i&32)===32;if(g)if(h=[],l===void 0)for(;;){if(vm(r,e,2),r.bytes(2)==="\0\0"){r.getBytes(2),e-=2;break}s=r.length(),h.push(Iw(r,e,t+1,n)),e-=s-r.length()}else for(;l>0;)s=r.length(),h.push(Iw(r,l,t+1,n)),e-=s-r.length(),l-=s-r.length();if(h===void 0&&a===Qe.Class.UNIVERSAL&&u===Qe.Type.BITSTRING&&(m=r.bytes(l)),h===void 0&&n.decodeBitStrings&&a===Qe.Class.UNIVERSAL&&u===Qe.Type.BITSTRING&&l>1){var w=r.read,y=e,S=0;if(u===Qe.Type.BITSTRING&&(vm(r,e,1),S=r.getByte(),e--),S===0)try{s=r.length();var E={strict:!0,decodeBitStrings:!0},b=Iw(r,e,t+1,E),T=s-r.length();e-=T,u==Qe.Type.BITSTRING&&T++;var A=b.tagClass;T===l&&(A===Qe.Class.UNIVERSAL||A===Qe.Class.CONTEXT_SPECIFIC)&&(h=[b])}catch{}h===void 0&&(r.read=w,e=y)}if(h===void 0){if(l===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=e}if(u===Qe.Type.BMPSTRING)for(h="";l>0;l-=2)vm(r,e,2),h+=String.fromCharCode(r.getInt16()),e-=2;else h=r.getBytes(l),e-=l}var C=m===void 0?null:{bitStringContents:m};return Qe.create(a,u,g,h,C)}o(Iw,"_fromDer");Qe.toDer=function(r){var e=Lr.util.createBuffer(),t=r.tagClass|r.type,n=Lr.util.createBuffer(),s=!1;if("bitStringContents"in r&&(s=!0,r.original&&(s=Qe.equals(r,r.original))),s)n.putBytes(r.bitStringContents);else if(r.composed){r.constructed?t|=32:n.putByte(0);for(var i=0;i<r.value.length;++i)r.value[i]!==void 0&&n.putBuffer(Qe.toDer(r.value[i]))}else if(r.type===Qe.Type.BMPSTRING)for(var i=0;i<r.value.length;++i)n.putInt16(r.value.charCodeAt(i));else r.type===Qe.Type.INTEGER&&r.value.length>1&&(r.value.charCodeAt(0)===0&&(r.value.charCodeAt(1)&128)===0||r.value.charCodeAt(0)===255&&(r.value.charCodeAt(1)&128)===128)?n.putBytes(r.value.substr(1)):n.putBytes(r.value);if(e.putByte(t),n.length()<=127)e.putByte(n.length()&127);else{var a=n.length(),u="";do u+=String.fromCharCode(a&255),a=a>>>8;while(a>0);e.putByte(u.length|128);for(var i=u.length-1;i>=0;--i)e.putByte(u.charCodeAt(i))}return e.putBuffer(n),e};Qe.oidToDer=function(r){var e=r.split("."),t=Lr.util.createBuffer();t.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,s,i,a,u=2;u<e.length;++u){n=!0,s=[],i=parseInt(e[u],10);do a=i&127,i=i>>>7,n||(a|=128),s.push(a),n=!1;while(i>0);for(var l=s.length-1;l>=0;--l)t.putByte(s[l])}return t};Qe.derToOid=function(r){var e;typeof r=="string"&&(r=Lr.util.createBuffer(r));var t=r.getByte();e=Math.floor(t/40)+"."+t%40;for(var n=0;r.length()>0;)t=r.getByte(),n=n<<7,t&128?n+=t&127:(e+="."+(n+t),n=0);return e};Qe.utcTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,2),10);t=t>=50?1900+t:2e3+t;var n=parseInt(r.substr(2,2),10)-1,s=parseInt(r.substr(4,2),10),i=parseInt(r.substr(6,2),10),a=parseInt(r.substr(8,2),10),u=0;if(r.length>11){var l=r.charAt(10),f=10;l!=="+"&&l!=="-"&&(u=parseInt(r.substr(10,2),10),f+=2)}if(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,0),f&&(l=r.charAt(f),l==="+"||l==="-")){var h=parseInt(r.substr(f+1,2),10),m=parseInt(r.substr(f+4,2),10),g=h*60+m;g*=6e4,l==="+"?e.setTime(+e-g):e.setTime(+e+g)}return e};Qe.generalizedTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,4),10),n=parseInt(r.substr(4,2),10)-1,s=parseInt(r.substr(6,2),10),i=parseInt(r.substr(8,2),10),a=parseInt(r.substr(10,2),10),u=parseInt(r.substr(12,2),10),l=0,f=0,h=!1;r.charAt(r.length-1)==="Z"&&(h=!0);var m=r.length-5,g=r.charAt(m);if(g==="+"||g==="-"){var w=parseInt(r.substr(m+1,2),10),y=parseInt(r.substr(m+4,2),10);f=w*60+y,f*=6e4,g==="+"&&(f*=-1),h=!0}return r.charAt(14)==="."&&(l=parseFloat(r.substr(14),10)*1e3),h?(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,l),e.setTime(+e+f)):(e.setFullYear(t,n,s),e.setHours(i,a,u,l)),e};Qe.dateToUtcTime=function(r){if(typeof r=="string")return r;var e="",t=[];t.push((""+r.getUTCFullYear()).substr(2)),t.push(""+(r.getUTCMonth()+1)),t.push(""+r.getUTCDate()),t.push(""+r.getUTCHours()),t.push(""+r.getUTCMinutes()),t.push(""+r.getUTCSeconds());for(var n=0;n<t.length;++n)t[n].length<2&&(e+="0"),e+=t[n];return e+="Z",e};Qe.dateToGeneralizedTime=function(r){if(typeof r=="string")return r;var e="",t=[];t.push(""+r.getUTCFullYear()),t.push(""+(r.getUTCMonth()+1)),t.push(""+r.getUTCDate()),t.push(""+r.getUTCHours()),t.push(""+r.getUTCMinutes()),t.push(""+r.getUTCSeconds());for(var n=0;n<t.length;++n)t[n].length<2&&(e+="0"),e+=t[n];return e+="Z",e};Qe.integerToDer=function(r){var e=Lr.util.createBuffer();if(r>=-128&&r<128)return e.putSignedInt(r,8);if(r>=-32768&&r<32768)return e.putSignedInt(r,16);if(r>=-8388608&&r<8388608)return e.putSignedInt(r,24);if(r>=-2147483648&&r<2147483648)return e.putSignedInt(r,32);var t=new Error("Integer too large; max is 32-bits.");throw t.integer=r,t};Qe.derToInteger=function(r){typeof r=="string"&&(r=Lr.util.createBuffer(r));var e=r.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return r.getSignedInt(e)};Qe.validate=function(r,e,t,n){var s=!1;if((r.tagClass===e.tagClass||typeof e.tagClass>"u")&&(r.type===e.type||typeof e.type>"u"))if(r.constructed===e.constructed||typeof e.constructed>"u"){if(s=!0,e.value&&Lr.util.isArray(e.value))for(var i=0,a=0;s&&a<e.value.length;++a)s=e.value[a].optional||!1,r.value[i]&&(s=Qe.validate(r.value[i],e.value[a],t,n),s?++i:e.value[a].optional&&(s=!0)),!s&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+r.value.length+'"');if(s&&t&&(e.capture&&(t[e.capture]=r.value),e.captureAsn1&&(t[e.captureAsn1]=r),e.captureBitStringContents&&"bitStringContents"in r&&(t[e.captureBitStringContents]=r.bitStringContents),e.captureBitStringValue&&"bitStringContents"in r)){var u;if(r.bitStringContents.length<2)t[e.captureBitStringValue]="";else{var l=r.bitStringContents.charCodeAt(0);if(l!==0)throw new Error("captureBitStringValue only supported for zero unused bits");t[e.captureBitStringValue]=r.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+r.constructed+'"');else n&&(r.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+r.tagClass+'"'),r.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+r.type+'"'));return s};var WP=/[^\\u0000-\\u00ff]/;Qe.prettyPrint=function(r,e,t){var n="";e=e||0,t=t||2,e>0&&(n+=`
5
+ `);for(var s="",i=0;i<e*t;++i)s+=" ";switch(n+=s+"Tag: ",r.tagClass){case Qe.Class.UNIVERSAL:n+="Universal:";break;case Qe.Class.APPLICATION:n+="Application:";break;case Qe.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case Qe.Class.PRIVATE:n+="Private:";break}if(r.tagClass===Qe.Class.UNIVERSAL)switch(n+=r.type,r.type){case Qe.Type.NONE:n+=" (None)";break;case Qe.Type.BOOLEAN:n+=" (Boolean)";break;case Qe.Type.INTEGER:n+=" (Integer)";break;case Qe.Type.BITSTRING:n+=" (Bit string)";break;case Qe.Type.OCTETSTRING:n+=" (Octet string)";break;case Qe.Type.NULL:n+=" (Null)";break;case Qe.Type.OID:n+=" (Object Identifier)";break;case Qe.Type.ODESC:n+=" (Object Descriptor)";break;case Qe.Type.EXTERNAL:n+=" (External or Instance of)";break;case Qe.Type.REAL:n+=" (Real)";break;case Qe.Type.ENUMERATED:n+=" (Enumerated)";break;case Qe.Type.EMBEDDED:n+=" (Embedded PDV)";break;case Qe.Type.UTF8:n+=" (UTF8)";break;case Qe.Type.ROID:n+=" (Relative Object Identifier)";break;case Qe.Type.SEQUENCE:n+=" (Sequence)";break;case Qe.Type.SET:n+=" (Set)";break;case Qe.Type.PRINTABLESTRING:n+=" (Printable String)";break;case Qe.Type.IA5String:n+=" (IA5String (ASCII))";break;case Qe.Type.UTCTIME:n+=" (UTC time)";break;case Qe.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case Qe.Type.BMPSTRING:n+=" (BMP String)";break}else n+=r.type;if(n+=`
6
+ `,n+=s+"Constructed: "+r.constructed+`
7
+ `,r.composed){for(var a=0,u="",i=0;i<r.value.length;++i)r.value[i]!==void 0&&(a+=1,u+=Qe.prettyPrint(r.value[i],e+1,t),i+1<r.value.length&&(u+=","));n+=s+"Sub values: "+a+u}else{if(n+=s+"Value: ",r.type===Qe.Type.OID){var l=Qe.derToOid(r.value);n+=l,Lr.pki&&Lr.pki.oids&&l in Lr.pki.oids&&(n+=" ("+Lr.pki.oids[l]+") ")}if(r.type===Qe.Type.INTEGER)try{n+=Qe.derToInteger(r.value)}catch{n+="0x"+Lr.util.bytesToHex(r.value)}else if(r.type===Qe.Type.BITSTRING){if(r.value.length>1?n+="0x"+Lr.util.bytesToHex(r.value.slice(1)):n+="(none)",r.value.length>0){var f=r.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(r.type===Qe.Type.OCTETSTRING)WP.test(r.value)||(n+="("+r.value+") "),n+="0x"+Lr.util.bytesToHex(r.value);else if(r.type===Qe.Type.UTF8)try{n+=Lr.util.decodeUtf8(r.value)}catch(h){if(h.message==="URI malformed")n+="0x"+Lr.util.bytesToHex(r.value)+" (malformed UTF8)";else throw h}else r.type===Qe.Type.PRINTABLESTRING||r.type===Qe.Type.IA5String?n+=r.value:WP.test(r.value)?n+="0x"+Lr.util.bytesToHex(r.value):r.value.length===0?n+="[null]":n+=r.value}return n}});var da=ye((tce,zP)=>{"use strict";var Bw=$t();zP.exports=Bw.md=Bw.md||{};Bw.md.algorithms=Bw.md.algorithms||{}});var Fh=ye((rce,YP)=>{"use strict";var fo=$t();da();ur();var U$=YP.exports=fo.hmac=fo.hmac||{};U$.create=function(){var r=null,e=null,t=null,n=null,s={};return s.start=function(i,a){if(i!==null)if(typeof i=="string")if(i=i.toLowerCase(),i in fo.md.algorithms)e=fo.md.algorithms[i].create();else throw new Error('Unknown hash algorithm "'+i+'"');else e=i;if(a===null)a=r;else{if(typeof a=="string")a=fo.util.createBuffer(a);else if(fo.util.isArray(a)){var u=a;a=fo.util.createBuffer();for(var l=0;l<u.length;++l)a.putByte(u[l])}var f=a.length();f>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),t=fo.util.createBuffer(),n=fo.util.createBuffer(),f=a.length();for(var l=0;l<f;++l){var u=a.at(l);t.putByte(54^u),n.putByte(92^u)}if(f<e.blockLength)for(var u=e.blockLength-f,l=0;l<u;++l)t.putByte(54),n.putByte(92);r=a,t=t.bytes(),n=n.bytes()}e.start(),e.update(t)},s.update=function(i){e.update(i)},s.getMac=function(){var i=e.digest().bytes();return e.start(),e.update(n),e.update(i),e.digest()},s.digest=s.getMac,s}});var _w=ye((nce,tO)=>{"use strict";var ma=$t();da();ur();var ZP=tO.exports=ma.md5=ma.md5||{};ma.md.md5=ma.md.algorithms.md5=ZP;ZP.create=function(){eO||M$();var r=null,e=ma.util.createBuffer(),t=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=ma.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=ma.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),QP(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=ma.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(Wb.substr(0,n.blockLength-a));for(var u,l=0,f=n.fullMessageLength.length-1;f>=0;--f)u=n.fullMessageLength[f]*8+l,l=u/4294967296>>>0,s.putInt32Le(u>>>0);var h={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3};QP(h,t,s);var m=ma.util.createBuffer();return m.putInt32Le(h.h0),m.putInt32Le(h.h1),m.putInt32Le(h.h2),m.putInt32Le(h.h3),m},n};var Wb=null,Dw=null,wm=null,qh=null,eO=!1;function M$(){Wb="\x80",Wb+=ma.util.fillString("\0",64),Dw=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],wm=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],qh=new Array(64);for(var r=0;r<64;++r)qh[r]=Math.floor(Math.abs(Math.sin(r+1))*4294967296);eO=!0}o(M$,"_init");function QP(r,e,t){for(var n,s,i,a,u,l,f,h,m=t.length();m>=64;){for(s=r.h0,i=r.h1,a=r.h2,u=r.h3,h=0;h<16;++h)e[h]=t.getInt32Le(),l=u^i&(a^u),n=s+l+qh[h]+e[h],f=wm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<32;++h)l=a^u&(i^a),n=s+l+qh[h]+e[Dw[h]],f=wm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<48;++h)l=i^a^u,n=s+l+qh[h]+e[Dw[h]],f=wm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<64;++h)l=a^(i|~u),n=s+l+qh[h]+e[Dw[h]],f=wm[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+u|0,m-=64}}o(QP,"_update")});var hc=ye((ice,nO)=>{"use strict";var Pw=$t();ur();var rO=nO.exports=Pw.pem=Pw.pem||{};rO.encode=function(r,e){e=e||{};var t="-----BEGIN "+r.type+`-----\r
8
+ `,n;if(r.procType&&(n={name:"Proc-Type",values:[String(r.procType.version),r.procType.type]},t+=Rw(n)),r.contentDomain&&(n={name:"Content-Domain",values:[r.contentDomain]},t+=Rw(n)),r.dekInfo&&(n={name:"DEK-Info",values:[r.dekInfo.algorithm]},r.dekInfo.parameters&&n.values.push(r.dekInfo.parameters),t+=Rw(n)),r.headers)for(var s=0;s<r.headers.length;++s)t+=Rw(r.headers[s]);return r.procType&&(t+=`\r
9
+ `),t+=Pw.util.encode64(r.body,e.maxline||64)+`\r
10
+ `,t+="-----END "+r.type+`-----\r
11
+ `,t};rO.decode=function(r){for(var e=[],t=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/,i;i=t.exec(r),!!i;){var a=i[1];a==="NEW CERTIFICATE REQUEST"&&(a="CERTIFICATE REQUEST");var u={type:a,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Pw.util.decode64(i[3])};if(e.push(u),!!i[2]){for(var l=i[2].split(s),f=0;i&&f<l.length;){for(var h=l[f].replace(/\s+$/,""),m=f+1;m<l.length;++m){var g=l[m];if(!/\s/.test(g[0]))break;h+=g,f=m}if(i=h.match(n),i){for(var w={name:i[1],values:[]},y=i[2].split(","),S=0;S<y.length;++S)w.values.push(j$(y[S]));if(u.procType)if(!u.contentDomain&&w.name==="Content-Domain")u.contentDomain=y[0]||"";else if(!u.dekInfo&&w.name==="DEK-Info"){if(w.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.headers.push(w);else{if(w.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(w.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++f}if(u.procType==="ENCRYPTED"&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(e.length===0)throw new Error("Invalid PEM formatted message.");return e};function Rw(r){for(var e=r.name+": ",t=[],n=o(function(l,f){return" "+f},"insertSpace"),s=0;s<r.values.length;++s)t.push(r.values[s].replace(/^(\S+\r\n)/,n));e+=t.join(",")+`\r
12
+ `;for(var i=0,a=-1,s=0;s<e.length;++s,++i)if(i>65&&a!==-1){var u=e[a];u===","?(++a,e=e.substr(0,a)+`\r
13
+ `+e.substr(a)):e=e.substr(0,a)+`\r
14
+ `+u+e.substr(a+1),i=s-a-1,a=-1,++s}else(e[s]===" "||e[s]===" "||e[s]===",")&&(a=s);return e}o(Rw,"foldHeader");function j$(r){return r.replace(/^\s+/,"")}o(j$,"ltrim")});var Sm=ye((oce,iO)=>{"use strict";var jr=$t();bw();Hb();ur();iO.exports=jr.des=jr.des||{};jr.des.startEncrypting=function(r,e,t,n){var s=Ow({key:r,output:t,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};jr.des.createEncryptionCipher=function(r,e){return Ow({key:r,output:null,decrypt:!1,mode:e})};jr.des.startDecrypting=function(r,e,t,n){var s=Ow({key:r,output:t,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};jr.des.createDecryptionCipher=function(r,e){return Ow({key:r,output:null,decrypt:!0,mode:e})};jr.des.Algorithm=function(r,e){var t=this;t.name=r,t.mode=new e({blockSize:8,cipher:{encrypt:o(function(n,s){return sO(t._keys,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return sO(t._keys,n,s,!0)},"decrypt")}}),t._init=!1};jr.des.Algorithm.prototype.initialize=function(r){if(!this._init){var e=jr.util.createBuffer(r.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=J$(e),this._init=!0}};ga("DES-ECB",jr.cipher.modes.ecb);ga("DES-CBC",jr.cipher.modes.cbc);ga("DES-CFB",jr.cipher.modes.cfb);ga("DES-OFB",jr.cipher.modes.ofb);ga("DES-CTR",jr.cipher.modes.ctr);ga("3DES-ECB",jr.cipher.modes.ecb);ga("3DES-CBC",jr.cipher.modes.cbc);ga("3DES-CFB",jr.cipher.modes.cfb);ga("3DES-OFB",jr.cipher.modes.ofb);ga("3DES-CTR",jr.cipher.modes.ctr);function ga(r,e){var t=o(function(){return new jr.des.Algorithm(r,e)},"factory");jr.cipher.registerAlgorithm(r,t)}o(ga,"registerAlgorithm");var F$=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],q$=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],H$=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],K$=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],$$=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],X$=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],G$=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],W$=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function J$(r){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],m=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],g=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],w=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],S=r.length()>8?3:1,E=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],T=0,A,C=0;C<S;C++){var x=r.getInt32(),B=r.getInt32();A=(x>>>4^B)&252645135,B^=A,x^=A<<4,A=(B>>>-16^x)&65535,x^=A,B^=A<<-16,A=(x>>>2^B)&858993459,B^=A,x^=A<<2,A=(B>>>-16^x)&65535,x^=A,B^=A<<-16,A=(x>>>1^B)&1431655765,B^=A,x^=A<<1,A=(B>>>8^x)&16711935,x^=A,B^=A<<8,A=(x>>>1^B)&1431655765,B^=A,x^=A<<1,A=x<<8|B>>>20&240,x=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=A;for(var F=0;F<b.length;++F){b[F]?(x=x<<2|x>>>26,B=B<<2|B>>>26):(x=x<<1|x>>>27,B=B<<1|B>>>27),x&=-15,B&=-15;var R=e[x>>>28]|t[x>>>24&15]|n[x>>>20&15]|s[x>>>16&15]|i[x>>>12&15]|a[x>>>8&15]|u[x>>>4&15],H=l[B>>>28]|f[B>>>24&15]|h[B>>>20&15]|m[B>>>16&15]|g[B>>>12&15]|w[B>>>8&15]|y[B>>>4&15];A=(H>>>16^R)&65535,E[T++]=R^A,E[T++]=H^A<<16}}return E}o(J$,"_createKeys");function sO(r,e,t,n){var s=r.length===32?3:9,i;s===3?i=n?[30,-2,-2]:[0,32,2]:i=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var a,u=e[0],l=e[1];a=(u>>>4^l)&252645135,l^=a,u^=a<<4,a=(u>>>16^l)&65535,l^=a,u^=a<<16,a=(l>>>2^u)&858993459,u^=a,l^=a<<2,a=(l>>>8^u)&16711935,u^=a,l^=a<<8,a=(u>>>1^l)&1431655765,l^=a,u^=a<<1,u=u<<1|u>>>31,l=l<<1|l>>>31;for(var f=0;f<s;f+=3){for(var h=i[f+1],m=i[f+2],g=i[f];g!=h;g+=m){var w=l^r[g],y=(l>>>4|l<<28)^r[g+1];a=u,u=l,l=a^(q$[w>>>24&63]|K$[w>>>16&63]|X$[w>>>8&63]|W$[w&63]|F$[y>>>24&63]|H$[y>>>16&63]|$$[y>>>8&63]|G$[y&63])}a=u,u=l,l=a}u=u>>>1|u<<31,l=l>>>1|l<<31,a=(u>>>1^l)&1431655765,l^=a,u^=a<<1,a=(l>>>8^u)&16711935,u^=a,l^=a<<8,a=(l>>>2^u)&858993459,u^=a,l^=a<<2,a=(u>>>16^l)&65535,l^=a,u^=a<<16,a=(u>>>4^l)&252645135,l^=a,u^=a<<4,t[0]=u,t[1]=l}o(sO,"_updateBlock");function Ow(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="DES-"+e,n;r.decrypt?n=jr.cipher.createDecipher(t,r.key):n=jr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof jr.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(Ow,"_createCipher")});var kw=ye((lce,aO)=>{"use strict";var ls=$t();Fh();da();ur();var z$=ls.pkcs5=ls.pkcs5||{},ho;ls.util.isNodejs&&!ls.options.usePureJavaScript&&(ho=gt("crypto"));aO.exports=ls.pbkdf2=z$.pbkdf2=function(r,e,t,n,s,i){if(typeof s=="function"&&(i=s,s=null),ls.util.isNodejs&&!ls.options.usePureJavaScript&&ho.pbkdf2&&(s===null||typeof s!="object")&&(ho.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),e=Buffer.from(e,"binary"),i?ho.pbkdf2Sync.length===4?ho.pbkdf2(r,e,t,n,function(A,C){if(A)return i(A);i(null,C.toString("binary"))}):ho.pbkdf2(r,e,t,n,s,function(A,C){if(A)return i(A);i(null,C.toString("binary"))}):ho.pbkdf2Sync.length===4?ho.pbkdf2Sync(r,e,t,n).toString("binary"):ho.pbkdf2Sync(r,e,t,n,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in ls.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=ls.md[s].create()}var a=s.digestLength;if(n>4294967295*a){var u=new Error("Derived key is too long.");if(i)return i(u);throw u}var l=Math.ceil(n/a),f=n-(l-1)*a,h=ls.hmac.create();h.start(s,r);var m="",g,w,y;if(!i){for(var S=1;S<=l;++S){h.start(null,null),h.update(e),h.update(ls.util.int32ToBytes(S)),g=y=h.digest().getBytes();for(var E=2;E<=t;++E)h.start(null,null),h.update(y),w=h.digest().getBytes(),g=ls.util.xorBytes(g,w,a),y=w;m+=S<l?g:g.substr(0,f)}return m}var S=1,E;function b(){if(S>l)return i(null,m);h.start(null,null),h.update(e),h.update(ls.util.int32ToBytes(S)),g=y=h.digest().getBytes(),E=2,T()}o(b,"outer");function T(){if(E<=t)return h.start(null,null),h.update(y),w=h.digest().getBytes(),g=ls.util.xorBytes(g,w,a),y=w,++E,ls.util.setImmediate(T);m+=S<l?g:g.substr(0,f),++S,b()}o(T,"inner"),b()}});var zb=ye((fce,fO)=>{"use strict";var ya=$t();da();ur();var uO=fO.exports=ya.sha256=ya.sha256||{};ya.md.sha256=ya.md.algorithms.sha256=uO;uO.create=function(){lO||Y$();var r=null,e=ya.util.createBuffer(),t=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=ya.util.createBuffer(),r={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=ya.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),oO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=ya.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(Jb.substr(0,n.blockLength-a));for(var u,l,f=n.fullMessageLength[0]*8,h=0;h<n.fullMessageLength.length-1;++h)u=n.fullMessageLength[h+1]*8,l=u/4294967296>>>0,f+=l,s.putInt32(f>>>0),f=u>>>0;s.putInt32(f);var m={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4,h5:r.h5,h6:r.h6,h7:r.h7};oO(m,t,s);var g=ya.util.createBuffer();return g.putInt32(m.h0),g.putInt32(m.h1),g.putInt32(m.h2),g.putInt32(m.h3),g.putInt32(m.h4),g.putInt32(m.h5),g.putInt32(m.h6),g.putInt32(m.h7),g},n};var Jb=null,lO=!1,cO=null;function Y$(){Jb="\x80",Jb+=ya.util.fillString("\0",64),cO=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],lO=!0}o(Y$,"_init");function oO(r,e,t){for(var n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T=t.length();T>=64;){for(f=0;f<16;++f)e[f]=t.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,s=e[f-15],s=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,e[f]=n+e[f-7]+s+e[f-16]|0;for(h=r.h0,m=r.h1,g=r.h2,w=r.h3,y=r.h4,S=r.h5,E=r.h6,b=r.h7,f=0;f<64;++f)a=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),u=E^y&(S^E),i=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),l=h&m|g&(h^m),n=b+a+u+cO[f]+e[f],s=i+l,b=E,E=S,S=y,y=w+n>>>0,w=g,g=m,m=h,h=n+s>>>0;r.h0=r.h0+h|0,r.h1=r.h1+m|0,r.h2=r.h2+g|0,r.h3=r.h3+w|0,r.h4=r.h4+y|0,r.h5=r.h5+S|0,r.h6=r.h6+E|0,r.h7=r.h7+b|0,T-=64}}o(oO,"_update")});var Yb=ye((pce,hO)=>{"use strict";var va=$t();ur();var Lw=null;va.util.isNodejs&&!va.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Lw=gt("crypto"));var Q$=hO.exports=va.prng=va.prng||{};Q$.create=function(r){for(var e={plugin:r,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},t=r.md,n=new Array(32),s=0;s<32;++s)n[s]=t.create();e.pools=n,e.pool=0,e.generate=function(f,h){if(!h)return e.generateSync(f);var m=e.plugin.cipher,g=e.plugin.increment,w=e.plugin.formatKey,y=e.plugin.formatSeed,S=va.util.createBuffer();e.key=null,E();function E(b){if(b)return h(b);if(S.length()>=f)return h(null,S.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return va.util.nextTick(function(){i(E)});var T=m(e.key,e.seed);e.generated+=T.length,S.putBytes(T),e.key=w(m(e.key,g(e.seed))),e.seed=y(m(e.key,e.seed)),va.util.setImmediate(E)}o(E,"generate")},e.generateSync=function(f){var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,w=e.plugin.formatSeed;e.key=null;for(var y=va.util.createBuffer();y.length()<f;){e.generated>1048575&&(e.key=null),e.key===null&&a();var S=h(e.key,e.seed);e.generated+=S.length,y.putBytes(S),e.key=g(h(e.key,m(e.seed))),e.seed=w(h(e.key,e.seed))}return y.getBytes(f)};function i(f){if(e.pools[0].messageLength>=32)return u(),f();var h=32-e.pools[0].messageLength<<5;e.seedFile(h,function(m,g){if(m)return f(m);e.collect(g),u(),f()})}o(i,"_reseed");function a(){if(e.pools[0].messageLength>=32)return u();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),u()}o(a,"_reseedSync");function u(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var h=1,m=0;m<32;++m)e.reseeds%h===0&&(f.update(e.pools[m].digest().getBytes()),e.pools[m].start()),h=h<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var g=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(g),e.generated=0}o(u,"_seed");function l(f){var h=null,m=va.util.globalScope,g=m.crypto||m.msCrypto;g&&g.getRandomValues&&(h=o(function(x){return g.getRandomValues(x)},"getRandomValues"));var w=va.util.createBuffer();if(h)for(;w.length()<f;){var y=Math.max(1,Math.min(f-w.length(),65536)/4),S=new Uint32Array(Math.floor(y));try{h(S);for(var E=0;E<S.length;++E)w.putInt32(S[E])}catch(x){if(!(typeof QuotaExceededError<"u"&&x instanceof QuotaExceededError))throw x}}if(w.length()<f)for(var b,T,A,C=Math.floor(Math.random()*65536);w.length()<f;){T=16807*(C&65535),b=16807*(C>>16),T+=(b&32767)<<16,T+=b>>15,T=(T&2147483647)+(T>>31),C=T&4294967295;for(var E=0;E<3;++E)A=C>>>(E<<3),A^=Math.floor(Math.random()*256),w.putByte(A&255)}return w.getBytes(f)}return o(l,"defaultSeedFile"),Lw?(e.seedFile=function(f,h){Lw.randomBytes(f,function(m,g){if(m)return h(m);h(null,g.toString())})},e.seedFileSync=function(f){return Lw.randomBytes(f).toString()}):(e.seedFile=function(f,h){try{h(null,l(f))}catch(m){h(m)}},e.seedFileSync=l),e.collect=function(f){for(var h=f.length,m=0;m<h;++m)e.pools[e.pool].update(f.substr(m,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(f,h){for(var m="",g=0;g<h;g+=8)m+=String.fromCharCode(f>>g&255);e.collect(m)},e.registerWorker=function(f){if(f===self)e.seedFile=function(m,g){function w(y){var S=y.data;S.forge&&S.forge.prng&&(self.removeEventListener("message",w),g(S.forge.prng.err,S.forge.prng.bytes))}o(w,"listener"),self.addEventListener("message",w),self.postMessage({forge:{prng:{needed:m}}})};else{var h=o(function(m){var g=m.data;g.forge&&g.forge.prng&&e.seedFile(g.forge.prng.needed,function(w,y){f.postMessage({forge:{prng:{err:w,bytes:y}}})})},"listener");f.addEventListener("message",h)}},e}});var ci=ye((mce,Qb)=>{"use strict";var bn=$t();vu();zb();Yb();ur();(function(){if(bn.random&&bn.random.getBytes){Qb.exports=bn.random;return}(function(r){var e={},t=new Array(4),n=bn.util.createBuffer();e.formatKey=function(m){var g=bn.util.createBuffer(m);return m=new Array(4),m[0]=g.getInt32(),m[1]=g.getInt32(),m[2]=g.getInt32(),m[3]=g.getInt32(),bn.aes._expandKey(m,!1)},e.formatSeed=function(m){var g=bn.util.createBuffer(m);return m=new Array(4),m[0]=g.getInt32(),m[1]=g.getInt32(),m[2]=g.getInt32(),m[3]=g.getInt32(),m},e.cipher=function(m,g){return bn.aes._updateBlock(m,g,t,!1),n.putInt32(t[0]),n.putInt32(t[1]),n.putInt32(t[2]),n.putInt32(t[3]),n.getBytes()},e.increment=function(m){return++m[3],m},e.md=bn.md.sha256;function s(){var m=bn.prng.create(e);return m.getBytes=function(g,w){return m.generate(g,w)},m.getBytesSync=function(g){return m.generate(g)},m}o(s,"spawnPrng");var i=s(),a=null,u=bn.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(a=o(function(m){return l.getRandomValues(m)},"getRandomValues")),bn.options.usePureJavaScript||!bn.util.isNodejs&&!a){if(typeof window>"u"||window.document,i.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var h in navigator)try{typeof navigator[h]=="string"&&(f+=navigator[h])}catch{}i.collect(f),f=null}r&&(r().mousemove(function(m){i.collectInt(m.clientX,16),i.collectInt(m.clientY,16)}),r().keypress(function(m){i.collectInt(m.charCode,8)}))}if(!bn.random)bn.random=i;else for(var h in i)bn.random[h]=i[h];bn.random.createInstance=s,Qb.exports=bn.random})(typeof jQuery<"u"?jQuery:null)})()});var ex=ye((yce,mO)=>{"use strict";var Es=$t();ur();var Zb=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],pO=[1,2,3,5],Z$=o(function(r,e){return r<<e&65535|(r&65535)>>16-e},"rol"),eX=o(function(r,e){return(r&65535)>>e|r<<16-e&65535},"ror");mO.exports=Es.rc2=Es.rc2||{};Es.rc2.expandKey=function(r,e){typeof r=="string"&&(r=Es.util.createBuffer(r)),e=e||128;var t=r,n=r.length(),s=e,i=Math.ceil(s/8),a=255>>(s&7),u;for(u=n;u<128;u++)t.putByte(Zb[t.at(u-1)+t.at(u-n)&255]);for(t.setAt(128-i,Zb[t.at(128-i)&a]),u=127-i;u>=0;u--)t.setAt(u,Zb[t.at(u+1)^t.at(u+i)]);return t};var dO=o(function(r,e,t){var n=!1,s=null,i=null,a=null,u,l,f,h,m=[];for(r=Es.rc2.expandKey(r,e),f=0;f<64;f++)m.push(r.getInt16Le());t?(u=o(function(y){for(f=0;f<4;f++)y[f]+=m[h]+(y[(f+3)%4]&y[(f+2)%4])+(~y[(f+3)%4]&y[(f+1)%4]),y[f]=Z$(y[f],pO[f]),h++},"mixRound"),l=o(function(y){for(f=0;f<4;f++)y[f]+=m[y[(f+3)%4]&63]},"mashRound")):(u=o(function(y){for(f=3;f>=0;f--)y[f]=eX(y[f],pO[f]),y[f]-=m[h]+(y[(f+3)%4]&y[(f+2)%4])+(~y[(f+3)%4]&y[(f+1)%4]),h--},"mixRound"),l=o(function(y){for(f=3;f>=0;f--)y[f]-=m[y[(f+3)%4]&63]},"mashRound"));var g=o(function(y){var S=[];for(f=0;f<4;f++){var E=s.getInt16Le();a!==null&&(t?E^=a.getInt16Le():a.putInt16Le(E)),S.push(E&65535)}h=t?0:63;for(var b=0;b<y.length;b++)for(var T=0;T<y[b][0];T++)y[b][1](S);for(f=0;f<4;f++)a!==null&&(t?a.putInt16Le(S[f]):S[f]^=a.getInt16Le()),i.putInt16Le(S[f])},"runPlan"),w=null;return w={start:o(function(y,S){y&&typeof y=="string"&&(y=Es.util.createBuffer(y)),n=!1,s=Es.util.createBuffer(),i=S||new Es.util.createBuffer,a=y,w.output=i},"start"),update:o(function(y){for(n||s.putBuffer(y);s.length()>=8;)g([[5,u],[1,l],[6,u],[1,l],[5,u]])},"update"),finish:o(function(y){var S=!0;if(t)if(y)S=y(8,s,!t);else{var E=s.length()===8?8:8-s.length();s.fillWithByte(E,E)}if(S&&(n=!0,w.update()),!t&&(S=s.length()===0,S))if(y)S=y(8,i,!t);else{var b=i.length(),T=i.at(b-1);T>b?S=!1:i.truncate(T)}return S},"finish")},w},"createCipher");Es.rc2.startEncrypting=function(r,e,t){var n=Es.rc2.createEncryptionCipher(r,128);return n.start(e,t),n};Es.rc2.createEncryptionCipher=function(r,e){return dO(r,e,!0)};Es.rc2.startDecrypting=function(r,e,t){var n=Es.rc2.createDecryptionCipher(r,128);return n.start(e,t),n};Es.rc2.createDecryptionCipher=function(r,e){return dO(r,e,!1)}});var Am=ye((wce,CO)=>{"use strict";var tx=$t();CO.exports=tx.jsbn=tx.jsbn||{};var po,tX=0xdeadbeefcafe,gO=(tX&16777215)==15715070;function Oe(r,e,t){this.data=[],r!=null&&(typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}o(Oe,"BigInteger");tx.jsbn.BigInteger=Oe;function lr(){return new Oe(null)}o(lr,"nbi");function rX(r,e,t,n,s,i){for(;--i>=0;){var a=e*this.data[r++]+t.data[n]+s;s=Math.floor(a/67108864),t.data[n++]=a&67108863}return s}o(rX,"am1");function nX(r,e,t,n,s,i){for(var a=e&32767,u=e>>15;--i>=0;){var l=this.data[r]&32767,f=this.data[r++]>>15,h=u*l+f*a;l=a*l+((h&32767)<<15)+t.data[n]+(s&1073741823),s=(l>>>30)+(h>>>15)+u*f+(s>>>30),t.data[n++]=l&1073741823}return s}o(nX,"am2");function yO(r,e,t,n,s,i){for(var a=e&16383,u=e>>14;--i>=0;){var l=this.data[r]&16383,f=this.data[r++]>>14,h=u*l+f*a;l=a*l+((h&16383)<<14)+t.data[n]+s,s=(l>>28)+(h>>14)+u*f,t.data[n++]=l&268435455}return s}o(yO,"am3");typeof navigator>"u"?(Oe.prototype.am=yO,po=28):gO&&navigator.appName=="Microsoft Internet Explorer"?(Oe.prototype.am=nX,po=30):gO&&navigator.appName!="Netscape"?(Oe.prototype.am=rX,po=26):(Oe.prototype.am=yO,po=28);Oe.prototype.DB=po;Oe.prototype.DM=(1<<po)-1;Oe.prototype.DV=1<<po;var rx=52;Oe.prototype.FV=Math.pow(2,rx);Oe.prototype.F1=rx-po;Oe.prototype.F2=2*po-rx;var sX="0123456789abcdefghijklmnopqrstuvwxyz",Vw=new Array,Hh,fi;Hh=48;for(fi=0;fi<=9;++fi)Vw[Hh++]=fi;Hh=97;for(fi=10;fi<36;++fi)Vw[Hh++]=fi;Hh=65;for(fi=10;fi<36;++fi)Vw[Hh++]=fi;function vO(r){return sX.charAt(r)}o(vO,"int2char");function wO(r,e){var t=Vw[r.charCodeAt(e)];return t??-1}o(wO,"intAt");function iX(r){for(var e=this.t-1;e>=0;--e)r.data[e]=this.data[e];r.t=this.t,r.s=this.s}o(iX,"bnpCopyTo");function aX(r){this.t=1,this.s=r<0?-1:0,r>0?this.data[0]=r:r<-1?this.data[0]=r+this.DV:this.t=0}o(aX,"bnpFromInt");function Su(r){var e=lr();return e.fromInt(r),e}o(Su,"nbv");function oX(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var n=r.length,s=!1,i=0;--n>=0;){var a=t==8?r[n]&255:wO(r,n);if(a<0){r.charAt(n)=="-"&&(s=!0);continue}s=!1,i==0?this.data[this.t++]=a:i+t>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this.data[this.t++]=a>>this.DB-i):this.data[this.t-1]|=a<<i,i+=t,i>=this.DB&&(i-=this.DB)}t==8&&(r[0]&128)!=0&&(this.s=-1,i>0&&(this.data[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),s&&Oe.ZERO.subTo(this,this)}o(oX,"bnpFromString");function uX(){for(var r=this.s&this.DM;this.t>0&&this.data[this.t-1]==r;)--this.t}o(uX,"bnpClamp");function lX(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,n,s=!1,i="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(n=this.data[a]>>u)>0&&(s=!0,i=vO(n));a>=0;)u<e?(n=(this.data[a]&(1<<u)-1)<<e-u,n|=this.data[--a]>>(u+=this.DB-e)):(n=this.data[a]>>(u-=e)&t,u<=0&&(u+=this.DB,--a)),n>0&&(s=!0),s&&(i+=vO(n));return s?i:"0"}o(lX,"bnToString");function cX(){var r=lr();return Oe.ZERO.subTo(this,r),r}o(cX,"bnNegate");function fX(){return this.s<0?this.negate():this}o(fX,"bnAbs");function hX(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this.data[t]-r.data[t])!=0)return e;return 0}o(hX,"bnCompareTo");function Uw(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}o(Uw,"nbits");function pX(){return this.t<=0?0:this.DB*(this.t-1)+Uw(this.data[this.t-1]^this.s&this.DM)}o(pX,"bnBitLength");function dX(r,e){var t;for(t=this.t-1;t>=0;--t)e.data[t+r]=this.data[t];for(t=r-1;t>=0;--t)e.data[t]=0;e.t=this.t+r,e.s=this.s}o(dX,"bnpDLShiftTo");function mX(r,e){for(var t=r;t<this.t;++t)e.data[t-r]=this.data[t];e.t=Math.max(this.t-r,0),e.s=this.s}o(mX,"bnpDRShiftTo");function gX(r,e){var t=r%this.DB,n=this.DB-t,s=(1<<n)-1,i=Math.floor(r/this.DB),a=this.s<<t&this.DM,u;for(u=this.t-1;u>=0;--u)e.data[u+i+1]=this.data[u]>>n|a,a=(this.data[u]&s)<<t;for(u=i-1;u>=0;--u)e.data[u]=0;e.data[i]=a,e.t=this.t+i+1,e.s=this.s,e.clamp()}o(gX,"bnpLShiftTo");function yX(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var n=r%this.DB,s=this.DB-n,i=(1<<n)-1;e.data[0]=this.data[t]>>n;for(var a=t+1;a<this.t;++a)e.data[a-t-1]|=(this.data[a]&i)<<s,e.data[a-t]=this.data[a]>>n;n>0&&(e.data[this.t-t-1]|=(this.s&i)<<s),e.t=this.t-t,e.clamp()}o(yX,"bnpRShiftTo");function vX(r,e){for(var t=0,n=0,s=Math.min(r.t,this.t);t<s;)n+=this.data[t]-r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n-=r.s;t<this.t;)n+=this.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n-=r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n-=r.s}e.s=n<0?-1:0,n<-1?e.data[t++]=this.DV+n:n>0&&(e.data[t++]=n),e.t=t,e.clamp()}o(vX,"bnpSubTo");function wX(r,e){var t=this.abs(),n=r.abs(),s=t.t;for(e.t=s+n.t;--s>=0;)e.data[s]=0;for(s=0;s<n.t;++s)e.data[s+t.t]=t.am(0,n.data[s],e,s,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&Oe.ZERO.subTo(e,e)}o(wX,"bnpMultiplyTo");function SX(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r.data[t]=0;for(t=0;t<e.t-1;++t){var n=e.am(t,e.data[t],r,2*t,0,1);(r.data[t+e.t]+=e.am(t+1,2*e.data[t],r,2*t+1,n,e.t-t-1))>=e.DV&&(r.data[t+e.t]-=e.DV,r.data[t+e.t+1]=1)}r.t>0&&(r.data[r.t-1]+=e.am(t,e.data[t],r,2*t,0,1)),r.s=0,r.clamp()}o(SX,"bnpSquareTo");function EX(r,e,t){var n=r.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=lr());var i=lr(),a=this.s,u=r.s,l=this.DB-Uw(n.data[n.t-1]);l>0?(n.lShiftTo(l,i),s.lShiftTo(l,t)):(n.copyTo(i),s.copyTo(t));var f=i.t,h=i.data[f-1];if(h!=0){var m=h*(1<<this.F1)+(f>1?i.data[f-2]>>this.F2:0),g=this.FV/m,w=(1<<this.F1)/m,y=1<<this.F2,S=t.t,E=S-f,b=e??lr();for(i.dlShiftTo(E,b),t.compareTo(b)>=0&&(t.data[t.t++]=1,t.subTo(b,t)),Oe.ONE.dlShiftTo(f,b),b.subTo(i,i);i.t<f;)i.data[i.t++]=0;for(;--E>=0;){var T=t.data[--S]==h?this.DM:Math.floor(t.data[S]*g+(t.data[S-1]+y)*w);if((t.data[S]+=i.am(0,T,t,E,0,f))<T)for(i.dlShiftTo(E,b),t.subTo(b,t);t.data[S]<--T;)t.subTo(b,t)}e!=null&&(t.drShiftTo(f,e),a!=u&&Oe.ZERO.subTo(e,e)),t.t=f,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&Oe.ZERO.subTo(t,t)}}}o(EX,"bnpDivRemTo");function AX(r){var e=lr();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(Oe.ZERO)>0&&r.subTo(e,e),e}o(AX,"bnMod");function pc(r){this.m=r}o(pc,"Classic");function CX(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}o(CX,"cConvert");function bX(r){return r}o(bX,"cRevert");function xX(r){r.divRemTo(this.m,null,r)}o(xX,"cReduce");function NX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(NX,"cMulTo");function TX(r,e){r.squareTo(e),this.reduce(e)}o(TX,"cSqrTo");pc.prototype.convert=CX;pc.prototype.revert=bX;pc.prototype.reduce=xX;pc.prototype.mulTo=NX;pc.prototype.sqrTo=TX;function IX(){if(this.t<1)return 0;var r=this.data[0];if((r&1)==0)return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}o(IX,"bnpInvDigit");function dc(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}o(dc,"Montgomery");function BX(r){var e=lr();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(Oe.ZERO)>0&&this.m.subTo(e,e),e}o(BX,"montConvert");function DX(r){var e=lr();return r.copyTo(e),this.reduce(e),e}o(DX,"montRevert");function _X(r){for(;r.t<=this.mt2;)r.data[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r.data[e]&32767,n=t*this.mpl+((t*this.mph+(r.data[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r.data[t]+=this.m.am(0,n,r,e,0,this.m.t);r.data[t]>=r.DV;)r.data[t]-=r.DV,r.data[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}o(_X,"montReduce");function RX(r,e){r.squareTo(e),this.reduce(e)}o(RX,"montSqrTo");function PX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(PX,"montMulTo");dc.prototype.convert=BX;dc.prototype.revert=DX;dc.prototype.reduce=_X;dc.prototype.mulTo=PX;dc.prototype.sqrTo=RX;function OX(){return(this.t>0?this.data[0]&1:this.s)==0}o(OX,"bnpIsEven");function kX(r,e){if(r>4294967295||r<1)return Oe.ONE;var t=lr(),n=lr(),s=e.convert(this),i=Uw(r)-1;for(s.copyTo(t);--i>=0;)if(e.sqrTo(t,n),(r&1<<i)>0)e.mulTo(n,s,t);else{var a=t;t=n,n=a}return e.revert(t)}o(kX,"bnpExp");function LX(r,e){var t;return r<256||e.isEven()?t=new pc(e):t=new dc(e),this.exp(r,t)}o(LX,"bnModPowInt");Oe.prototype.copyTo=iX;Oe.prototype.fromInt=aX;Oe.prototype.fromString=oX;Oe.prototype.clamp=uX;Oe.prototype.dlShiftTo=dX;Oe.prototype.drShiftTo=mX;Oe.prototype.lShiftTo=gX;Oe.prototype.rShiftTo=yX;Oe.prototype.subTo=vX;Oe.prototype.multiplyTo=wX;Oe.prototype.squareTo=SX;Oe.prototype.divRemTo=EX;Oe.prototype.invDigit=IX;Oe.prototype.isEven=OX;Oe.prototype.exp=kX;Oe.prototype.toString=lX;Oe.prototype.negate=cX;Oe.prototype.abs=fX;Oe.prototype.compareTo=hX;Oe.prototype.bitLength=pX;Oe.prototype.mod=AX;Oe.prototype.modPowInt=LX;Oe.ZERO=Su(0);Oe.ONE=Su(1);function VX(){var r=lr();return this.copyTo(r),r}o(VX,"bnClone");function UX(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}o(UX,"bnIntValue");function MX(){return this.t==0?this.s:this.data[0]<<24>>24}o(MX,"bnByteValue");function jX(){return this.t==0?this.s:this.data[0]<<16>>16}o(jX,"bnShortValue");function FX(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}o(FX,"bnpChunkSize");function qX(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}o(qX,"bnSigNum");function HX(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),n=Su(t),s=lr(),i=lr(),a="";for(this.divRemTo(n,s,i);s.signum()>0;)a=(t+i.intValue()).toString(r).substr(1)+a,s.divRemTo(n,s,i);return i.intValue().toString(r)+a}o(HX,"bnpToRadix");function KX(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),n=Math.pow(e,t),s=!1,i=0,a=0,u=0;u<r.length;++u){var l=wO(r,u);if(l<0){r.charAt(u)=="-"&&this.signum()==0&&(s=!0);continue}a=e*a+l,++i>=t&&(this.dMultiply(n),this.dAddOffset(a,0),i=0,a=0)}i>0&&(this.dMultiply(Math.pow(e,i)),this.dAddOffset(a,0)),s&&Oe.ZERO.subTo(this,this)}o(KX,"bnpFromRadix");function $X(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(Oe.ONE.shiftLeft(r-1),nx,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Oe.ONE.shiftLeft(r-1),this);else{var n=new Array,s=r&7;n.length=(r>>3)+1,e.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}}o($X,"bnpFromNumber");function XX(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,n,s=0;if(r-- >0)for(t<this.DB&&(n=this.data[r]>>t)!=(this.s&this.DM)>>t&&(e[s++]=n|this.s<<this.DB-t);r>=0;)t<8?(n=(this.data[r]&(1<<t)-1)<<8-t,n|=this.data[--r]>>(t+=this.DB-8)):(n=this.data[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),(n&128)!=0&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(e[s++]=n);return e}o(XX,"bnToByteArray");function GX(r){return this.compareTo(r)==0}o(GX,"bnEquals");function WX(r){return this.compareTo(r)<0?this:r}o(WX,"bnMin");function JX(r){return this.compareTo(r)>0?this:r}o(JX,"bnMax");function zX(r,e,t){var n,s,i=Math.min(r.t,this.t);for(n=0;n<i;++n)t.data[n]=e(this.data[n],r.data[n]);if(r.t<this.t){for(s=r.s&this.DM,n=i;n<this.t;++n)t.data[n]=e(this.data[n],s);t.t=this.t}else{for(s=this.s&this.DM,n=i;n<r.t;++n)t.data[n]=e(s,r.data[n]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}o(zX,"bnpBitwiseTo");function YX(r,e){return r&e}o(YX,"op_and");function QX(r){var e=lr();return this.bitwiseTo(r,YX,e),e}o(QX,"bnAnd");function nx(r,e){return r|e}o(nx,"op_or");function ZX(r){var e=lr();return this.bitwiseTo(r,nx,e),e}o(ZX,"bnOr");function SO(r,e){return r^e}o(SO,"op_xor");function eG(r){var e=lr();return this.bitwiseTo(r,SO,e),e}o(eG,"bnXor");function EO(r,e){return r&~e}o(EO,"op_andnot");function tG(r){var e=lr();return this.bitwiseTo(r,EO,e),e}o(tG,"bnAndNot");function rG(){for(var r=lr(),e=0;e<this.t;++e)r.data[e]=this.DM&~this.data[e];return r.t=this.t,r.s=~this.s,r}o(rG,"bnNot");function nG(r){var e=lr();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}o(nG,"bnShiftLeft");function sG(r){var e=lr();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}o(sG,"bnShiftRight");function iG(r){if(r==0)return-1;var e=0;return(r&65535)==0&&(r>>=16,e+=16),(r&255)==0&&(r>>=8,e+=8),(r&15)==0&&(r>>=4,e+=4),(r&3)==0&&(r>>=2,e+=2),(r&1)==0&&++e,e}o(iG,"lbit");function aG(){for(var r=0;r<this.t;++r)if(this.data[r]!=0)return r*this.DB+iG(this.data[r]);return this.s<0?this.t*this.DB:-1}o(aG,"bnGetLowestSetBit");function oG(r){for(var e=0;r!=0;)r&=r-1,++e;return e}o(oG,"cbit");function uG(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=oG(this.data[t]^e);return r}o(uG,"bnBitCount");function lG(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<r%this.DB)!=0}o(lG,"bnTestBit");function cG(r,e){var t=Oe.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}o(cG,"bnpChangeBit");function fG(r){return this.changeBit(r,nx)}o(fG,"bnSetBit");function hG(r){return this.changeBit(r,EO)}o(hG,"bnClearBit");function pG(r){return this.changeBit(r,SO)}o(pG,"bnFlipBit");function dG(r,e){for(var t=0,n=0,s=Math.min(r.t,this.t);t<s;)n+=this.data[t]+r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n+=r.s;t<this.t;)n+=this.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n+=r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=r.s}e.s=n<0?-1:0,n>0?e.data[t++]=n:n<-1&&(e.data[t++]=this.DV+n),e.t=t,e.clamp()}o(dG,"bnpAddTo");function mG(r){var e=lr();return this.addTo(r,e),e}o(mG,"bnAdd");function gG(r){var e=lr();return this.subTo(r,e),e}o(gG,"bnSubtract");function yG(r){var e=lr();return this.multiplyTo(r,e),e}o(yG,"bnMultiply");function vG(r){var e=lr();return this.divRemTo(r,e,null),e}o(vG,"bnDivide");function wG(r){var e=lr();return this.divRemTo(r,null,e),e}o(wG,"bnRemainder");function SG(r){var e=lr(),t=lr();return this.divRemTo(r,e,t),new Array(e,t)}o(SG,"bnDivideAndRemainder");function EG(r){this.data[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}o(EG,"bnpDMultiply");function AG(r,e){if(r!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=r;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}o(AG,"bnpDAddOffset");function Em(){}o(Em,"NullExp");function AO(r){return r}o(AO,"nNop");function CG(r,e,t){r.multiplyTo(e,t)}o(CG,"nMulTo");function bG(r,e){r.squareTo(e)}o(bG,"nSqrTo");Em.prototype.convert=AO;Em.prototype.revert=AO;Em.prototype.mulTo=CG;Em.prototype.sqrTo=bG;function xG(r){return this.exp(r,new Em)}o(xG,"bnPow");function NG(r,e,t){var n=Math.min(this.t+r.t,e);for(t.s=0,t.t=n;n>0;)t.data[--n]=0;var s;for(s=t.t-this.t;n<s;++n)t.data[n+this.t]=this.am(0,r.data[n],t,n,0,this.t);for(s=Math.min(r.t,e);n<s;++n)this.am(0,r.data[n],t,n,0,e-n);t.clamp()}o(NG,"bnpMultiplyLowerTo");function TG(r,e,t){--e;var n=t.t=this.t+r.t-e;for(t.s=0;--n>=0;)t.data[n]=0;for(n=Math.max(e-this.t,0);n<r.t;++n)t.data[this.t+n-e]=this.am(e-n,r.data[n],t,0,0,this.t+n-e);t.clamp(),t.drShiftTo(1,t)}o(TG,"bnpMultiplyUpperTo");function Kh(r){this.r2=lr(),this.q3=lr(),Oe.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}o(Kh,"Barrett");function IG(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var e=lr();return r.copyTo(e),this.reduce(e),e}o(IG,"barrettConvert");function BG(r){return r}o(BG,"barrettRevert");function DG(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}o(DG,"barrettReduce");function _G(r,e){r.squareTo(e),this.reduce(e)}o(_G,"barrettSqrTo");function RG(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(RG,"barrettMulTo");Kh.prototype.convert=IG;Kh.prototype.revert=BG;Kh.prototype.reduce=DG;Kh.prototype.mulTo=RG;Kh.prototype.sqrTo=_G;function PG(r,e){var t=r.bitLength(),n,s=Su(1),i;if(t<=0)return s;t<18?n=1:t<48?n=3:t<144?n=4:t<768?n=5:n=6,t<8?i=new pc(e):e.isEven()?i=new Kh(e):i=new dc(e);var a=new Array,u=3,l=n-1,f=(1<<n)-1;if(a[1]=i.convert(this),n>1){var h=lr();for(i.sqrTo(a[1],h);u<=f;)a[u]=lr(),i.mulTo(h,a[u-2],a[u]),u+=2}var m=r.t-1,g,w=!0,y=lr(),S;for(t=Uw(r.data[m])-1;m>=0;){for(t>=l?g=r.data[m]>>t-l&f:(g=(r.data[m]&(1<<t+1)-1)<<l-t,m>0&&(g|=r.data[m-1]>>this.DB+t-l)),u=n;(g&1)==0;)g>>=1,--u;if((t-=u)<0&&(t+=this.DB,--m),w)a[g].copyTo(s),w=!1;else{for(;u>1;)i.sqrTo(s,y),i.sqrTo(y,s),u-=2;u>0?i.sqrTo(s,y):(S=s,s=y,y=S),i.mulTo(y,a[g],s)}for(;m>=0&&(r.data[m]&1<<t)==0;)i.sqrTo(s,y),S=s,s=y,y=S,--t<0&&(t=this.DB-1,--m)}return i.revert(s)}o(PG,"bnModPow");function OG(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var n=e;e=t,t=n}var s=e.getLowestSetBit(),i=t.getLowestSetBit();if(i<0)return e;for(s<i&&(i=s),i>0&&(e.rShiftTo(i,e),t.rShiftTo(i,t));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=t.getLowestSetBit())>0&&t.rShiftTo(s,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return i>0&&t.lShiftTo(i,t),t}o(OG,"bnGCD");function kG(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this.data[0]%r;else for(var n=this.t-1;n>=0;--n)t=(e*t+this.data[n])%r;return t}o(kG,"bnpModInt");function LG(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return Oe.ZERO;for(var t=r.clone(),n=this.clone(),s=Su(1),i=Su(0),a=Su(0),u=Su(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!s.isEven()||!i.isEven())&&(s.addTo(this,s),i.subTo(r,i)),s.rShiftTo(1,s)):i.isEven()||i.subTo(r,i),i.rShiftTo(1,i);for(;n.isEven();)n.rShiftTo(1,n),e?((!a.isEven()||!u.isEven())&&(a.addTo(this,a),u.subTo(r,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(r,u),u.rShiftTo(1,u);t.compareTo(n)>=0?(t.subTo(n,t),e&&s.subTo(a,s),i.subTo(u,i)):(n.subTo(t,n),e&&a.subTo(s,a),u.subTo(i,u))}if(n.compareTo(Oe.ONE)!=0)return Oe.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u}o(LG,"bnModInverse");var qi=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],VG=(1<<26)/qi[qi.length-1];function UG(r){var e,t=this.abs();if(t.t==1&&t.data[0]<=qi[qi.length-1]){for(e=0;e<qi.length;++e)if(t.data[0]==qi[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<qi.length;){for(var n=qi[e],s=e+1;s<qi.length&&n<VG;)n*=qi[s++];for(n=t.modInt(n);e<s;)if(n%qi[e++]==0)return!1}return t.millerRabin(r)}o(UG,"bnIsProbablePrime");function MG(r){var e=this.subtract(Oe.ONE),t=e.getLowestSetBit();if(t<=0)return!1;for(var n=e.shiftRight(t),s=jG(),i,a=0;a<r;++a){do i=new Oe(this.bitLength(),s);while(i.compareTo(Oe.ONE)<=0||i.compareTo(e)>=0);var u=i.modPow(n,this);if(u.compareTo(Oe.ONE)!=0&&u.compareTo(e)!=0){for(var l=1;l++<t&&u.compareTo(e)!=0;)if(u=u.modPowInt(2,this),u.compareTo(Oe.ONE)==0)return!1;if(u.compareTo(e)!=0)return!1}}return!0}o(MG,"bnpMillerRabin");function jG(){return{nextBytes:o(function(r){for(var e=0;e<r.length;++e)r[e]=Math.floor(Math.random()*256)},"nextBytes")}}o(jG,"bnGetPrng");Oe.prototype.chunkSize=FX;Oe.prototype.toRadix=HX;Oe.prototype.fromRadix=KX;Oe.prototype.fromNumber=$X;Oe.prototype.bitwiseTo=zX;Oe.prototype.changeBit=cG;Oe.prototype.addTo=dG;Oe.prototype.dMultiply=EG;Oe.prototype.dAddOffset=AG;Oe.prototype.multiplyLowerTo=NG;Oe.prototype.multiplyUpperTo=TG;Oe.prototype.modInt=kG;Oe.prototype.millerRabin=MG;Oe.prototype.clone=VX;Oe.prototype.intValue=UX;Oe.prototype.byteValue=MX;Oe.prototype.shortValue=jX;Oe.prototype.signum=qX;Oe.prototype.toByteArray=XX;Oe.prototype.equals=GX;Oe.prototype.min=WX;Oe.prototype.max=JX;Oe.prototype.and=QX;Oe.prototype.or=ZX;Oe.prototype.xor=eG;Oe.prototype.andNot=tG;Oe.prototype.not=rG;Oe.prototype.shiftLeft=nG;Oe.prototype.shiftRight=sG;Oe.prototype.getLowestSetBit=aG;Oe.prototype.bitCount=uG;Oe.prototype.testBit=lG;Oe.prototype.setBit=fG;Oe.prototype.clearBit=hG;Oe.prototype.flipBit=pG;Oe.prototype.add=mG;Oe.prototype.subtract=gG;Oe.prototype.multiply=yG;Oe.prototype.divide=vG;Oe.prototype.remainder=wG;Oe.prototype.divideAndRemainder=SG;Oe.prototype.modPow=PG;Oe.prototype.modInverse=LG;Oe.prototype.pow=xG;Oe.prototype.gcd=OG;Oe.prototype.isProbablePrime=UG});var $h=ye((Ece,TO)=>{"use strict";var wa=$t();da();ur();var xO=TO.exports=wa.sha1=wa.sha1||{};wa.md.sha1=wa.md.algorithms.sha1=xO;xO.create=function(){NO||FG();var r=null,e=wa.util.createBuffer(),t=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=wa.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=wa.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),bO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=wa.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(sx.substr(0,n.blockLength-a));for(var u,l,f=n.fullMessageLength[0]*8,h=0;h<n.fullMessageLength.length-1;++h)u=n.fullMessageLength[h+1]*8,l=u/4294967296>>>0,f+=l,s.putInt32(f>>>0),f=u>>>0;s.putInt32(f);var m={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4};bO(m,t,s);var g=wa.util.createBuffer();return g.putInt32(m.h0),g.putInt32(m.h1),g.putInt32(m.h2),g.putInt32(m.h3),g.putInt32(m.h4),g},n};var sx=null,NO=!1;function FG(){sx="\x80",sx+=wa.util.fillString("\0",64),NO=!0}o(FG,"_init");function bO(r,e,t){for(var n,s,i,a,u,l,f,h,m=t.length();m>=64;){for(s=r.h0,i=r.h1,a=r.h2,u=r.h3,l=r.h4,h=0;h<16;++h)n=t.getInt32(),e[h]=n,f=u^i&(a^u),n=(s<<5|s>>>27)+f+l+1518500249+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<20;++h)n=e[h-3]^e[h-8]^e[h-14]^e[h-16],n=n<<1|n>>>31,e[h]=n,f=u^i&(a^u),n=(s<<5|s>>>27)+f+l+1518500249+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<32;++h)n=e[h-3]^e[h-8]^e[h-14]^e[h-16],n=n<<1|n>>>31,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+1859775393+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<40;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+1859775393+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<60;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i&a|u&(i^a),n=(s<<5|s>>>27)+f+l+2400959708+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<80;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+3395469782+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+u|0,r.h4=r.h4+l|0,m-=64}}o(bO,"_update")});var ix=ye((Cce,BO)=>{"use strict";var Sa=$t();ur();ci();$h();var IO=BO.exports=Sa.pkcs1=Sa.pkcs1||{};IO.encode_rsa_oaep=function(r,e,t){var n,s,i,a;typeof t=="string"?(n=t,s=arguments[3]||void 0,i=arguments[4]||void 0):t&&(n=t.label||void 0,s=t.seed||void 0,i=t.md||void 0,t.mgf1&&t.mgf1.md&&(a=t.mgf1.md)),i?i.start():i=Sa.md.sha1.create(),a||(a=i);var u=Math.ceil(r.n.bitLength()/8),l=u-2*i.digestLength-2;if(e.length>l){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=l,f}n||(n=""),i.update(n,"raw");for(var h=i.digest(),m="",g=l-e.length,w=0;w<g;w++)m+="\0";var y=h.getBytes()+m+""+e;if(!s)s=Sa.random.getBytes(i.digestLength);else if(s.length!==i.digestLength){var f=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=s.length,f.digestLength=i.digestLength,f}var S=Mw(s,u-i.digestLength-1,a),E=Sa.util.xorBytes(y,S,y.length),b=Mw(E,i.digestLength,a),T=Sa.util.xorBytes(s,b,s.length);return"\0"+T+E};IO.decode_rsa_oaep=function(r,e,t){var n,s,i;typeof t=="string"?(n=t,s=arguments[3]||void 0):t&&(n=t.label||void 0,s=t.md||void 0,t.mgf1&&t.mgf1.md&&(i=t.mgf1.md));var a=Math.ceil(r.n.bitLength()/8);if(e.length!==a){var E=new Error("RSAES-OAEP encoded message length is invalid.");throw E.length=e.length,E.expectedLength=a,E}if(s===void 0?s=Sa.md.sha1.create():s.start(),i||(i=s),a<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),s.update(n,"raw");for(var u=s.digest().getBytes(),l=e.charAt(0),f=e.substring(1,s.digestLength+1),h=e.substring(1+s.digestLength),m=Mw(h,s.digestLength,i),g=Sa.util.xorBytes(f,m,f.length),w=Mw(g,a-s.digestLength-1,i),y=Sa.util.xorBytes(h,w,h.length),S=y.substring(0,s.digestLength),E=l!=="\0",b=0;b<s.digestLength;++b)E|=u.charAt(b)!==S.charAt(b);for(var T=1,A=s.digestLength,C=s.digestLength;C<y.length;C++){var x=y.charCodeAt(C),B=x&1^1,F=T?65534:0;E|=x&F,T=T&B,A+=T}if(E||y.charCodeAt(A)!==1)throw new Error("Invalid RSAES-OAEP padding.");return y.substring(A+1)};function Mw(r,e,t){t||(t=Sa.md.sha1.create());for(var n="",s=Math.ceil(e/t.digestLength),i=0;i<s;++i){var a=String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255);t.start(),t.update(r+a),n+=t.digest().getBytes()}return n.substring(0,e)}o(Mw,"rsa_mgf1")});var ox=ye((xce,ax)=>{"use strict";var Eu=$t();ur();Am();ci();(function(){if(Eu.prime){ax.exports=Eu.prime;return}var r=ax.exports=Eu.prime=Eu.prime||{},e=Eu.jsbn.BigInteger,t=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var s=o(function(m,g){return m|g},"op_or");r.generateProbablePrime=function(m,g,w){typeof g=="function"&&(w=g,g={}),g=g||{};var y=g.algorithm||"PRIMEINC";typeof y=="string"&&(y={name:y}),y.options=y.options||{};var S=g.prng||Eu.random,E={nextBytes:o(function(b){for(var T=S.getBytesSync(b.length),A=0;A<b.length;++A)b[A]=T.charCodeAt(A)},"nextBytes")};if(y.name==="PRIMEINC")return i(m,E,y.options,w);throw new Error("Invalid prime generation algorithm: "+y.name)};function i(m,g,w,y){return"workers"in w?l(m,g,w,y):a(m,g,w,y)}o(i,"primeincFindPrime");function a(m,g,w,y){var S=f(m,g),E=0,b=h(S.bitLength());"millerRabinTests"in w&&(b=w.millerRabinTests);var T=10;"maxBlockTime"in w&&(T=w.maxBlockTime),u(S,m,g,E,b,T,y)}o(a,"primeincFindPrimeWithoutWorkers");function u(m,g,w,y,S,E,b){var T=+new Date;do{if(m.bitLength()>g&&(m=f(g,w)),m.isProbablePrime(S))return b(null,m);m.dAddOffset(t[y++%8],0)}while(E<0||+new Date-T<E);Eu.util.setImmediate(function(){u(m,g,w,y,S,E,b)})}o(u,"_primeinc");function l(m,g,w,y){if(typeof Worker>"u")return a(m,g,w,y);var S=f(m,g),E=w.workers,b=w.workLoad||100,T=b*30/8,A=w.workerScript||"forge/prime.worker.js";if(E===-1)return Eu.util.estimateCores(function(x,B){x&&(B=2),E=B-1,C()});C();function C(){E=Math.max(1,E);for(var x=[],B=0;B<E;++B)x[B]=new Worker(A);for(var F=E,B=0;B<E;++B)x[B].addEventListener("message",H);var R=!1;function H(q){if(!R){--F;var K=q.data;if(K.found){for(var G=0;G<x.length;++G)x[G].terminate();return R=!0,y(null,new e(K.prime,16))}S.bitLength()>m&&(S=f(m,g));var he=S.toString(16);q.target.postMessage({hex:he,workLoad:b}),S.dAddOffset(T,0)}}o(H,"workerMessage")}o(C,"generate")}o(l,"primeincFindPrimeWithWorkers");function f(m,g){var w=new e(m,g),y=m-1;return w.testBit(y)||w.bitwiseTo(e.ONE.shiftLeft(y),s,w),w.dAddOffset(31-w.mod(n).byteValue(),0),w}o(f,"generateRandom");function h(m){return m<=100?27:m<=150?18:m<=200?15:m<=250?12:m<=300?9:m<=350?8:m<=400?7:m<=500?6:m<=600?5:m<=800?4:m<=1250?3:2}o(h,"getMillerRabinTests")})()});var Cm=ye((Tce,LO)=>{"use strict";var vt=$t();Fi();Am();wu();ix();ox();ci();ur();typeof ir>"u"&&(ir=vt.jsbn.BigInteger);var ir,ux=vt.util.isNodejs?gt("crypto"):null,pe=vt.asn1,hi=vt.util;vt.pki=vt.pki||{};LO.exports=vt.pki.rsa=vt.rsa=vt.rsa||{};var Vt=vt.pki,qG=[6,4,2,4,2,4,6,2],HG={name:"PrivateKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},KG={name:"RSAPrivateKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},$G={name:"RSAPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},XG=vt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},GG={name:"DigestInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pe.Class.UNIVERSAL,type:pe.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},WG=o(function(r){var e;if(r.algorithm in Vt.oids)e=Vt.oids[r.algorithm];else{var t=new Error("Unknown message digest algorithm.");throw t.algorithm=r.algorithm,t}var n=pe.oidToDer(e).getBytes(),s=pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[]),i=pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[]);i.value.push(pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,n)),i.value.push(pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,""));var a=pe.create(pe.Class.UNIVERSAL,pe.Type.OCTETSTRING,!1,r.digest().getBytes());return s.value.push(i),s.value.push(a),pe.toDer(s).getBytes()},"emsaPkcs1v15encode"),OO=o(function(r,e,t){if(t)return r.modPow(e.e,e.n);if(!e.p||!e.q)return r.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(ir.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(ir.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new ir(vt.util.bytesToHex(vt.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(ir.ONE));r=r.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var s=r.mod(e.p).modPow(e.dP,e.p),i=r.mod(e.q).modPow(e.dQ,e.q);s.compareTo(i)<0;)s=s.add(e.p);var a=s.subtract(i).multiply(e.qInv).mod(e.p).multiply(e.q).add(i);return a=a.multiply(n.modInverse(e.n)).mod(e.n),a},"_modPow");Vt.rsa.encrypt=function(r,e,t){var n=t,s,i=Math.ceil(e.n.bitLength()/8);t!==!1&&t!==!0?(n=t===2,s=kO(r,e,t)):(s=vt.util.createBuffer(),s.putBytes(r));for(var a=new ir(s.toHex(),16),u=OO(a,e,n),l=u.toString(16),f=vt.util.createBuffer(),h=i-Math.ceil(l.length/2);h>0;)f.putByte(0),--h;return f.putBytes(vt.util.hexToBytes(l)),f.getBytes()};Vt.rsa.decrypt=function(r,e,t,n){var s=Math.ceil(e.n.bitLength()/8);if(r.length!==s){var i=new Error("Encrypted message length is invalid.");throw i.length=r.length,i.expected=s,i}var a=new ir(vt.util.createBuffer(r).toHex(),16);if(a.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=OO(a,e,t),l=u.toString(16),f=vt.util.createBuffer(),h=s-Math.ceil(l.length/2);h>0;)f.putByte(0),--h;return f.putBytes(vt.util.hexToBytes(l)),n!==!1?jw(f.getBytes(),e,t):f.getBytes()};Vt.rsa.createKeyPairGenerationState=function(r,e,t){typeof r=="string"&&(r=parseInt(r,10)),r=r||2048,t=t||{};var n=t.prng||vt.random,s={nextBytes:o(function(u){for(var l=n.getBytesSync(u.length),f=0;f<u.length;++f)u[f]=l.charCodeAt(f)},"nextBytes")},i=t.algorithm||"PRIMEINC",a;if(i==="PRIMEINC")a={algorithm:i,state:0,bits:r,rng:s,eInt:e||65537,e:new ir(null),p:null,q:null,qBits:r>>1,pBits:r-(r>>1),pqState:0,num:null,keys:null},a.e.fromInt(a.eInt);else throw new Error("Invalid key generation algorithm: "+i);return a};Vt.rsa.stepKeyPairGenerationState=function(r,e){"algorithm"in r||(r.algorithm="PRIMEINC");var t=new ir(null);t.fromInt(30);for(var n=0,s=o(function(m,g){return m|g},"op_or"),i=+new Date,a,u=0;r.keys===null&&(e<=0||u<e);){if(r.state===0){var l=r.p===null?r.pBits:r.qBits,f=l-1;r.pqState===0?(r.num=new ir(l,r.rng),r.num.testBit(f)||r.num.bitwiseTo(ir.ONE.shiftLeft(f),s,r.num),r.num.dAddOffset(31-r.num.mod(t).byteValue(),0),n=0,++r.pqState):r.pqState===1?r.num.bitLength()>l?r.pqState=0:r.num.isProbablePrime(zG(r.num.bitLength()))?++r.pqState:r.num.dAddOffset(qG[n++%8],0):r.pqState===2?r.pqState=r.num.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)===0?3:0:r.pqState===3&&(r.pqState=0,r.p===null?r.p=r.num:r.q=r.num,r.p!==null&&r.q!==null&&++r.state,r.num=null)}else if(r.state===1)r.p.compareTo(r.q)<0&&(r.num=r.p,r.p=r.q,r.q=r.num),++r.state;else if(r.state===2)r.p1=r.p.subtract(ir.ONE),r.q1=r.q.subtract(ir.ONE),r.phi=r.p1.multiply(r.q1),++r.state;else if(r.state===3)r.phi.gcd(r.e).compareTo(ir.ONE)===0?++r.state:(r.p=null,r.q=null,r.state=0);else if(r.state===4)r.n=r.p.multiply(r.q),r.n.bitLength()===r.bits?++r.state:(r.q=null,r.state=0);else if(r.state===5){var h=r.e.modInverse(r.phi);r.keys={privateKey:Vt.rsa.setPrivateKey(r.n,r.e,h,r.p,r.q,h.mod(r.p1),h.mod(r.q1),r.q.modInverse(r.p)),publicKey:Vt.rsa.setPublicKey(r.n,r.e)}}a=+new Date,u+=a-i,i=a}return r.keys!==null};Vt.rsa.generateKeyPair=function(r,e,t,n){if(arguments.length===1?typeof r=="object"?(t=r,r=void 0):typeof r=="function"&&(n=r,r=void 0):arguments.length===2?typeof r=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(t=e,e=void 0):(t=r,n=e,r=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof t=="function"&&(n=t,t=void 0):(n=t,t=e,e=void 0)),t=t||{},r===void 0&&(r=t.bits||2048),e===void 0&&(e=t.e||65537),!vt.options.usePureJavaScript&&!t.prng&&r>=256&&r<=16384&&(e===65537||e===3)){if(n){if(DO("generateKeyPair"))return ux.generateKeyPair("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(u,l,f){if(u)return n(u);n(null,{privateKey:Vt.privateKeyFromPem(f),publicKey:Vt.publicKeyFromPem(l)})});if(_O("generateKey")&&_O("exportKey"))return hi.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:PO(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(u){return hi.globalScope.crypto.subtle.exportKey("pkcs8",u.privateKey)}).then(void 0,function(u){n(u)}).then(function(u){if(u){var l=Vt.privateKeyFromAsn1(pe.fromDer(vt.util.createBuffer(u)));n(null,{privateKey:l,publicKey:Vt.setRsaPublicKey(l.n,l.e)})}});if(RO("generateKey")&&RO("exportKey")){var s=hi.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:PO(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);s.oncomplete=function(u){var l=u.target.result,f=hi.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);f.oncomplete=function(h){var m=h.target.result,g=Vt.privateKeyFromAsn1(pe.fromDer(vt.util.createBuffer(m)));n(null,{privateKey:g,publicKey:Vt.setRsaPublicKey(g.n,g.e)})},f.onerror=function(h){n(h)}},s.onerror=function(u){n(u)};return}}else if(DO("generateKeyPairSync")){var i=ux.generateKeyPairSync("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Vt.privateKeyFromPem(i.privateKey),publicKey:Vt.publicKeyFromPem(i.publicKey)}}}var a=Vt.rsa.createKeyPairGenerationState(r,e,t);if(!n)return Vt.rsa.stepKeyPairGenerationState(a,0),a.keys;JG(a,t,n)};Vt.setRsaPublicKey=Vt.rsa.setPublicKey=function(r,e){var t={n:r,e};return t.encrypt=function(n,s,i){if(typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSAES-PKCS1-V1_5"),s==="RSAES-PKCS1-V1_5")s={encode:o(function(u,l,f){return kO(u,l,2).getBytes()},"encode")};else if(s==="RSA-OAEP"||s==="RSAES-OAEP")s={encode:o(function(u,l){return vt.pkcs1.encode_rsa_oaep(l,u,i)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(s)!==-1)s={encode:o(function(u){return u},"encode")};else if(typeof s=="string")throw new Error('Unsupported encryption scheme: "'+s+'".');var a=s.encode(n,t,!0);return Vt.rsa.encrypt(a,t,!0)},t.verify=function(n,s,i,a){typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSASSA-PKCS1-V1_5"),a===void 0&&(a={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),i==="RSASSA-PKCS1-V1_5"?i={verify:o(function(l,f){f=jw(f,t,!0);var h=pe.fromDer(f,{parseAllBytes:a._parseAllDigestBytes}),m={},g=[];if(!pe.validate(h,GG,m,g)){var w=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw w.errors=g,w}var y=pe.derToOid(m.algorithmIdentifier);if(!(y===vt.oids.md2||y===vt.oids.md5||y===vt.oids.sha1||y===vt.oids.sha224||y===vt.oids.sha256||y===vt.oids.sha384||y===vt.oids.sha512||y===vt.oids["sha512-224"]||y===vt.oids["sha512-256"])){var w=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw w.oid=y,w}if((y===vt.oids.md2||y===vt.oids.md5)&&!("parameters"in m))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===m.digest},"verify")}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:o(function(l,f){return f=jw(f,t,!0),l===f},"verify")});var u=Vt.rsa.decrypt(s,t,!0,!1);return i.verify(n,u,t.n.bitLength())},t};Vt.setRsaPrivateKey=Vt.rsa.setPrivateKey=function(r,e,t,n,s,i,a,u){var l={n:r,e,d:t,p:n,q:s,dP:i,dQ:a,qInv:u};return l.decrypt=function(f,h,m){typeof h=="string"?h=h.toUpperCase():h===void 0&&(h="RSAES-PKCS1-V1_5");var g=Vt.rsa.decrypt(f,l,!1,!1);if(h==="RSAES-PKCS1-V1_5")h={decode:jw};else if(h==="RSA-OAEP"||h==="RSAES-OAEP")h={decode:o(function(w,y){return vt.pkcs1.decode_rsa_oaep(y,w,m)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(h)!==-1)h={decode:o(function(w){return w},"decode")};else throw new Error('Unsupported encryption scheme: "'+h+'".');return h.decode(g,l,!1)},l.sign=function(f,h){var m=!1;typeof h=="string"&&(h=h.toUpperCase()),h===void 0||h==="RSASSA-PKCS1-V1_5"?(h={encode:WG},m=1):(h==="NONE"||h==="NULL"||h===null)&&(h={encode:o(function(){return f},"encode")},m=1);var g=h.encode(f,l.n.bitLength());return Vt.rsa.encrypt(g,l,m)},l};Vt.wrapRsaPrivateKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,pe.integerToDer(0).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,pe.oidToDer(Vt.oids.rsaEncryption).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,"")]),pe.create(pe.Class.UNIVERSAL,pe.Type.OCTETSTRING,!1,pe.toDer(r).getBytes())])};Vt.privateKeyFromAsn1=function(r){var e={},t=[];if(pe.validate(r,HG,e,t)&&(r=pe.fromDer(vt.util.createBuffer(e.privateKey))),e={},t=[],!pe.validate(r,KG,e,t)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=t,n}var s,i,a,u,l,f,h,m;return s=vt.util.createBuffer(e.privateKeyModulus).toHex(),i=vt.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=vt.util.createBuffer(e.privateKeyPrivateExponent).toHex(),u=vt.util.createBuffer(e.privateKeyPrime1).toHex(),l=vt.util.createBuffer(e.privateKeyPrime2).toHex(),f=vt.util.createBuffer(e.privateKeyExponent1).toHex(),h=vt.util.createBuffer(e.privateKeyExponent2).toHex(),m=vt.util.createBuffer(e.privateKeyCoefficient).toHex(),Vt.setRsaPrivateKey(new ir(s,16),new ir(i,16),new ir(a,16),new ir(u,16),new ir(l,16),new ir(f,16),new ir(h,16),new ir(m,16))};Vt.privateKeyToAsn1=Vt.privateKeyToRSAPrivateKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,pe.integerToDer(0).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.n)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.e)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.d)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.p)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.q)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.dP)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.dQ)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.qInv))])};Vt.publicKeyFromAsn1=function(r){var e={},t=[];if(pe.validate(r,XG,e,t)){var n=pe.derToOid(e.publicKeyOid);if(n!==Vt.oids.rsaEncryption){var s=new Error("Cannot read public key. Unknown OID.");throw s.oid=n,s}r=e.rsaPublicKey}if(t=[],!pe.validate(r,$G,e,t)){var s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw s.errors=t,s}var i=vt.util.createBuffer(e.publicKeyModulus).toHex(),a=vt.util.createBuffer(e.publicKeyExponent).toHex();return Vt.setRsaPublicKey(new ir(i,16),new ir(a,16))};Vt.publicKeyToAsn1=Vt.publicKeyToSubjectPublicKeyInfo=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,pe.oidToDer(Vt.oids.rsaEncryption).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,"")]),pe.create(pe.Class.UNIVERSAL,pe.Type.BITSTRING,!1,[Vt.publicKeyToRSAPublicKey(r)])])};Vt.publicKeyToRSAPublicKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.n)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Ea(r.e))])};function kO(r,e,t){var n=vt.util.createBuffer(),s=Math.ceil(e.n.bitLength()/8);if(r.length>s-11){var i=new Error("Message is too long for PKCS#1 v1.5 padding.");throw i.length=r.length,i.max=s-11,i}n.putByte(0),n.putByte(t);var a=s-3-r.length,u;if(t===0||t===1){u=t===0?0:255;for(var l=0;l<a;++l)n.putByte(u)}else for(;a>0;){for(var f=0,h=vt.random.getBytes(a),l=0;l<a;++l)u=h.charCodeAt(l),u===0?++f:n.putByte(u);a=f}return n.putByte(0),n.putBytes(r),n}o(kO,"_encodePkcs1_v1_5");function jw(r,e,t,n){var s=Math.ceil(e.n.bitLength()/8),i=vt.util.createBuffer(r),a=i.getByte(),u=i.getByte();if(a!==0||t&&u!==0&&u!==1||!t&&u!=2||t&&u===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var l=0;if(u===0){l=s-3-n;for(var f=0;f<l;++f)if(i.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(u===1)for(l=0;i.length()>1;){if(i.getByte()!==255){--i.read;break}++l}else if(u===2)for(l=0;i.length()>1;){if(i.getByte()===0){--i.read;break}++l}var h=i.getByte();if(h!==0||l!==s-3-i.length())throw new Error("Encryption block is invalid.");return i.getBytes()}o(jw,"_decodePkcs1_v1_5");function JG(r,e,t){typeof e=="function"&&(t=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),s();function s(){i(r.pBits,function(u,l){if(u)return t(u);if(r.p=l,r.q!==null)return a(u,r.q);i(r.qBits,a)})}o(s,"generate");function i(u,l){vt.prime.generateProbablePrime(u,n,l)}o(i,"getPrime");function a(u,l){if(u)return t(u);if(r.q=l,r.p.compareTo(r.q)<0){var f=r.p;r.p=r.q,r.q=f}if(r.p.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)!==0){r.p=null,s();return}if(r.q.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)!==0){r.q=null,i(r.qBits,a);return}if(r.p1=r.p.subtract(ir.ONE),r.q1=r.q.subtract(ir.ONE),r.phi=r.p1.multiply(r.q1),r.phi.gcd(r.e).compareTo(ir.ONE)!==0){r.p=r.q=null,s();return}if(r.n=r.p.multiply(r.q),r.n.bitLength()!==r.bits){r.q=null,i(r.qBits,a);return}var h=r.e.modInverse(r.phi);r.keys={privateKey:Vt.rsa.setPrivateKey(r.n,r.e,h,r.p,r.q,h.mod(r.p1),h.mod(r.q1),r.q.modInverse(r.p)),publicKey:Vt.rsa.setPublicKey(r.n,r.e)},t(null,r.keys)}o(a,"finish")}o(JG,"_generateKeyPair");function Ea(r){var e=r.toString(16);e[0]>="8"&&(e="00"+e);var t=vt.util.hexToBytes(e);return t.length>1&&(t.charCodeAt(0)===0&&(t.charCodeAt(1)&128)===0||t.charCodeAt(0)===255&&(t.charCodeAt(1)&128)===128)?t.substr(1):t}o(Ea,"_bnToBytes");function zG(r){return r<=100?27:r<=150?18:r<=200?15:r<=250?12:r<=300?9:r<=350?8:r<=400?7:r<=500?6:r<=600?5:r<=800?4:r<=1250?3:2}o(zG,"_getMillerRabinTests");function DO(r){return vt.util.isNodejs&&typeof ux[r]=="function"}o(DO,"_detectNodeCrypto");function _O(r){return typeof hi.globalScope<"u"&&typeof hi.globalScope.crypto=="object"&&typeof hi.globalScope.crypto.subtle=="object"&&typeof hi.globalScope.crypto.subtle[r]=="function"}o(_O,"_detectSubtleCrypto");function RO(r){return typeof hi.globalScope<"u"&&typeof hi.globalScope.msCrypto=="object"&&typeof hi.globalScope.msCrypto.subtle=="object"&&typeof hi.globalScope.msCrypto.subtle[r]=="function"}o(RO,"_detectSubtleMsCrypto");function PO(r){for(var e=vt.util.hexToBytes(r.toString(16)),t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}o(PO,"_intToUint8Array")});var lx=ye((Bce,FO)=>{"use strict";var st=$t();vu();Fi();Sm();da();wu();kw();hc();ci();ex();Cm();ur();typeof VO>"u"&&(VO=st.jsbn.BigInteger);var VO,Ee=st.asn1,Ft=st.pki=st.pki||{};FO.exports=Ft.pbe=st.pbe=st.pbe||{};var mc=Ft.oids,YG={name:"EncryptedPrivateKeyInfo",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},QG={name:"PBES2Algorithms",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},ZG={name:"pkcs-12PbeParams",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,capture:"iterations"}]};Ft.encryptPrivateKeyInfo=function(r,e,t){t=t||{},t.saltSize=t.saltSize||8,t.count=t.count||2048,t.algorithm=t.algorithm||"aes128",t.prfAlgorithm=t.prfAlgorithm||"sha1";var n=st.random.getBytesSync(t.saltSize),s=t.count,i=Ee.integerToDer(s),a,u,l;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){var f,h,m;switch(t.algorithm){case"aes128":a=16,f=16,h=mc["aes128-CBC"],m=st.aes.createEncryptionCipher;break;case"aes192":a=24,f=16,h=mc["aes192-CBC"],m=st.aes.createEncryptionCipher;break;case"aes256":a=32,f=16,h=mc["aes256-CBC"],m=st.aes.createEncryptionCipher;break;case"des":a=8,f=8,h=mc.desCBC,m=st.des.createEncryptionCipher;break;default:var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=t.algorithm,g}var w="hmacWith"+t.prfAlgorithm.toUpperCase(),y=jO(w),S=st.pkcs5.pbkdf2(e,n,s,a,y),E=st.random.getBytesSync(f),b=m(S);b.start(E),b.update(Ee.toDer(r)),b.finish(),l=b.output.getBytes();var T=eW(n,i,a,w);u=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(mc.pkcs5PBES2).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(mc.pkcs5PBKDF2).getBytes()),T]),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(h).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,E)])])])}else if(t.algorithm==="3des"){a=24;var A=new st.util.ByteBuffer(n),S=Ft.pbe.generatePkcs12Key(e,A,1,s,a),E=Ft.pbe.generatePkcs12Key(e,A,2,s,a),b=st.des.createEncryptionCipher(S);b.start(E),b.update(Ee.toDer(r)),b.finish(),l=b.output.getBytes(),u=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(mc["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,n),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,i.getBytes())])])}else{var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=t.algorithm,g}var C=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[u,Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,l)]);return C};Ft.decryptPrivateKeyInfo=function(r,e){var t=null,n={},s=[];if(!Ee.validate(r,YG,n,s)){var i=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}var a=Ee.derToOid(n.encryptionOid),u=Ft.pbe.getCipher(a,n.encryptionParams,e),l=st.util.createBuffer(n.encryptedData);return u.update(l),u.finish()&&(t=Ee.fromDer(u.output)),t};Ft.encryptedPrivateKeyToPem=function(r,e){var t={type:"ENCRYPTED PRIVATE KEY",body:Ee.toDer(r).getBytes()};return st.pem.encode(t,{maxline:e})};Ft.encryptedPrivateKeyFromPem=function(r){var e=st.pem.decode(r)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var t=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Ee.fromDer(e.body)};Ft.encryptRsaPrivateKey=function(r,e,t){if(t=t||{},!t.legacy){var n=Ft.wrapRsaPrivateKey(Ft.privateKeyToAsn1(r));return n=Ft.encryptPrivateKeyInfo(n,e,t),Ft.encryptedPrivateKeyToPem(n)}var s,i,a,u;switch(t.algorithm){case"aes128":s="AES-128-CBC",a=16,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",a=24,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",a=32,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",a=24,i=st.random.getBytesSync(8),u=st.des.createEncryptionCipher;break;case"des":s="DES-CBC",a=8,i=st.random.getBytesSync(8),u=st.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+t.algorithm+'".');throw l.algorithm=t.algorithm,l}var f=st.pbe.opensslDeriveBytes(e,i.substr(0,8),a),h=u(f);h.start(i),h.update(Ee.toDer(Ft.privateKeyToAsn1(r))),h.finish();var m={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:st.util.bytesToHex(i).toUpperCase()},body:h.output.getBytes()};return st.pem.encode(m)};Ft.decryptRsaPrivateKey=function(r,e){var t=null,n=st.pem.decode(r)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var s=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw s.headerType=s,s}if(n.procType&&n.procType.type==="ENCRYPTED"){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=st.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=st.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=st.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=st.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=st.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=o(function(m){return st.rc2.createDecryptionCipher(m,40)},"cipherFn");break;case"RC2-64-CBC":i=8,a=o(function(m){return st.rc2.createDecryptionCipher(m,64)},"cipherFn");break;case"RC2-128-CBC":i=16,a=o(function(m){return st.rc2.createDecryptionCipher(m,128)},"cipherFn");break;default:var s=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw s.algorithm=n.dekInfo.algorithm,s}var u=st.util.hexToBytes(n.dekInfo.parameters),l=st.pbe.opensslDeriveBytes(e,u.substr(0,8),i),f=a(l);if(f.start(u),f.update(st.util.createBuffer(n.body)),f.finish())t=f.output.getBytes();else return t}else t=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?t=Ft.decryptPrivateKeyInfo(Ee.fromDer(t),e):t=Ee.fromDer(t),t!==null&&(t=Ft.privateKeyFromAsn1(t)),t};Ft.pbe.generatePkcs12Key=function(r,e,t,n,s,i){var a,u;if(typeof i>"u"||i===null){if(!("sha1"in st.md))throw new Error('"sha1" hash algorithm unavailable.');i=st.md.sha1.create()}var l=i.digestLength,f=i.blockLength,h=new st.util.ByteBuffer,m=new st.util.ByteBuffer;if(r!=null){for(u=0;u<r.length;u++)m.putInt16(r.charCodeAt(u));m.putInt16(0)}var g=m.length(),w=e.length(),y=new st.util.ByteBuffer;y.fillWithByte(t,f);var S=f*Math.ceil(w/f),E=new st.util.ByteBuffer;for(u=0;u<S;u++)E.putByte(e.at(u%w));var b=f*Math.ceil(g/f),T=new st.util.ByteBuffer;for(u=0;u<b;u++)T.putByte(m.at(u%g));var A=E;A.putBuffer(T);for(var C=Math.ceil(s/l),x=1;x<=C;x++){var B=new st.util.ByteBuffer;B.putBytes(y.bytes()),B.putBytes(A.bytes());for(var F=0;F<n;F++)i.start(),i.update(B.getBytes()),B=i.digest();var R=new st.util.ByteBuffer;for(u=0;u<f;u++)R.putByte(B.at(u%l));var H=Math.ceil(w/f)+Math.ceil(g/f),q=new st.util.ByteBuffer;for(a=0;a<H;a++){var K=new st.util.ByteBuffer(A.getBytes(f)),G=511;for(u=R.length()-1;u>=0;u--)G=G>>8,G+=R.at(u)+K.at(u),K.setAt(u,G&255);q.putBuffer(K)}A=q,h.putBuffer(B)}return h.truncate(h.length()-s),h};Ft.pbe.getCipher=function(r,e,t){switch(r){case Ft.oids.pkcs5PBES2:return Ft.pbe.getCipherForPBES2(r,e,t);case Ft.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Ft.oids["pbewithSHAAnd40BitRC2-CBC"]:return Ft.pbe.getCipherForPKCS12PBE(r,e,t);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=r,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};Ft.pbe.getCipherForPBES2=function(r,e,t){var n={},s=[];if(!Ee.validate(e,QG,n,s)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}if(r=Ee.derToOid(n.kdfOid),r!==Ft.oids.pkcs5PBKDF2){var i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw i.oid=r,i.supportedOids=["pkcs5PBKDF2"],i}if(r=Ee.derToOid(n.encOid),r!==Ft.oids["aes128-CBC"]&&r!==Ft.oids["aes192-CBC"]&&r!==Ft.oids["aes256-CBC"]&&r!==Ft.oids["des-EDE3-CBC"]&&r!==Ft.oids.desCBC){var i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw i.oid=r,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i}var a=n.kdfSalt,u=st.util.createBuffer(n.kdfIterationCount);u=u.getInt(u.length()<<3);var l,f;switch(Ft.oids[r]){case"aes128-CBC":l=16,f=st.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=st.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=st.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=st.des.createDecryptionCipher;break;case"desCBC":l=8,f=st.des.createDecryptionCipher;break}var h=MO(n.prfOid),m=st.pkcs5.pbkdf2(t,a,u,l,h),g=n.encIv,w=f(m);return w.start(g),w};Ft.pbe.getCipherForPKCS12PBE=function(r,e,t){var n={},s=[];if(!Ee.validate(e,ZG,n,s)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}var a=st.util.createBuffer(n.salt),u=st.util.createBuffer(n.iterations);u=u.getInt(u.length()<<3);var l,f,h;switch(r){case Ft.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,f=8,h=st.des.startDecrypting;break;case Ft.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,f=8,h=o(function(S,E){var b=st.rc2.createDecryptionCipher(S,40);return b.start(E,null),b},"cipherFn");break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=r,i}var m=MO(n.prfOid),g=Ft.pbe.generatePkcs12Key(t,a,1,u,l,m);m.start();var w=Ft.pbe.generatePkcs12Key(t,a,2,u,f,m);return h(g,w)};Ft.pbe.opensslDeriveBytes=function(r,e,t,n){if(typeof n>"u"||n===null){if(!("md5"in st.md))throw new Error('"md5" hash algorithm unavailable.');n=st.md.md5.create()}e===null&&(e="");for(var s=[UO(n,r+e)],i=16,a=1;i<t;++a,i+=16)s.push(UO(n,s[a-1]+r+e));return s.join("").substr(0,t)};function UO(r,e){return r.start().update(e).digest().getBytes()}o(UO,"hash");function MO(r){var e;if(!r)e="hmacWithSHA1";else if(e=Ft.oids[Ee.derToOid(r)],!e){var t=new Error("Unsupported PRF OID.");throw t.oid=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}return jO(e)}o(MO,"prfOidToMessageDigest");function jO(r){var e=st.md;switch(r){case"hmacWithSHA224":e=st.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":r=r.substr(8).toLowerCase();break;default:var t=new Error("Unsupported PRF algorithm.");throw t.algorithm=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}if(!e||!(r in e))throw new Error("Unknown hash algorithm: "+r);return e[r].create()}o(jO,"prfAlgorithmToMessageDigest");function eW(r,e,t,n){var s=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,r),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&s.value.push(Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,st.util.hexToBytes(t.toString(16))),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(Ft.oids[n]).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.NULL,!1,"")])),s}o(eW,"createPbkdf2Params")});var cx=ye((_ce,KO)=>{"use strict";var Xh=$t();Fi();ur();var tt=Xh.asn1,Gh=KO.exports=Xh.pkcs7asn1=Xh.pkcs7asn1||{};Xh.pkcs7=Xh.pkcs7||{};Xh.pkcs7.asn1=Gh;var qO={name:"ContentInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Gh.contentInfoValidator=qO;var HO={name:"EncryptedContentInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Gh.envelopedDataValidator={name:"EnvelopedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(HO)};Gh.encryptedDataValidator={name:"EncryptedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"}].concat(HO)};var tW={name:"SignerInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:tt.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Gh.signedDataValidator={name:"SignedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},qO,{name:"SignedData.Certificates",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:tt.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,capture:"signerInfos",optional:!0,value:[tW]}]};Gh.recipientInfoValidator={name:"RecipientInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var fx=ye((Rce,$O)=>{"use strict";var gc=$t();ur();gc.mgf=gc.mgf||{};var rW=$O.exports=gc.mgf.mgf1=gc.mgf1=gc.mgf1||{};rW.create=function(r){var e={generate:o(function(t,n){for(var s=new gc.util.ByteBuffer,i=Math.ceil(n/r.digestLength),a=0;a<i;a++){var u=new gc.util.ByteBuffer;u.putInt32(a),r.start(),r.update(t+u.getBytes()),s.putBuffer(r.digest())}return s.truncate(s.length()-n),s.getBytes()},"generate")};return e}});var GO=ye((Oce,XO)=>{"use strict";var Fw=$t();fx();XO.exports=Fw.mgf=Fw.mgf||{};Fw.mgf.mgf1=Fw.mgf1});var qw=ye((kce,WO)=>{"use strict";var yc=$t();ci();ur();var nW=WO.exports=yc.pss=yc.pss||{};nW.create=function(r){arguments.length===3&&(r={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=r.md,t=r.mgf,n=e.digestLength,s=r.salt||null;typeof s=="string"&&(s=yc.util.createBuffer(s));var i;if("saltLength"in r)i=r.saltLength;else if(s!==null)i=s.length();else throw new Error("Salt length not specified or specific salt not given.");if(s!==null&&s.length()!==i)throw new Error("Given salt length does not match length of given salt.");var a=r.prng||yc.random,u={};return u.encode=function(l,f){var h,m=f-1,g=Math.ceil(m/8),w=l.digest().getBytes();if(g<n+i+2)throw new Error("Message is too long to encrypt.");var y;s===null?y=a.getBytesSync(i):y=s.bytes();var S=new yc.util.ByteBuffer;S.fillWithByte(0,8),S.putBytes(w),S.putBytes(y),e.start(),e.update(S.getBytes());var E=e.digest().getBytes(),b=new yc.util.ByteBuffer;b.fillWithByte(0,g-i-n-2),b.putByte(1),b.putBytes(y);var T=b.getBytes(),A=g-n-1,C=t.generate(E,A),x="";for(h=0;h<A;h++)x+=String.fromCharCode(T.charCodeAt(h)^C.charCodeAt(h));var B=65280>>8*g-m&255;return x=String.fromCharCode(x.charCodeAt(0)&~B)+x.substr(1),x+E+"\xBC"},u.verify=function(l,f,h){var m,g=h-1,w=Math.ceil(g/8);if(f=f.substr(-w),w<n+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(f.charCodeAt(w-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var y=w-n-1,S=f.substr(0,y),E=f.substr(y,n),b=65280>>8*w-g&255;if((S.charCodeAt(0)&b)!==0)throw new Error("Bits beyond keysize not zero as expected.");var T=t.generate(E,y),A="";for(m=0;m<y;m++)A+=String.fromCharCode(S.charCodeAt(m)^T.charCodeAt(m));A=String.fromCharCode(A.charCodeAt(0)&~b)+A.substr(1);var C=w-n-i-2;for(m=0;m<C;m++)if(A.charCodeAt(m)!==0)throw new Error("Leftmost octets not zero as expected");if(A.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var x=A.substr(-i),B=new yc.util.ByteBuffer;B.fillWithByte(0,8),B.putBytes(l),B.putBytes(x),e.start(),e.update(B.getBytes());var F=e.digest().getBytes();return E===F},u}});var $w=ye((Lce,ZO)=>{"use strict";var wt=$t();vu();Fi();Sm();da();GO();wu();hc();qw();Cm();ur();var k=wt.asn1,$e=ZO.exports=wt.pki=wt.pki||{},ar=$e.oids,Jr={};Jr.CN=ar.commonName;Jr.commonName="CN";Jr.C=ar.countryName;Jr.countryName="C";Jr.L=ar.localityName;Jr.localityName="L";Jr.ST=ar.stateOrProvinceName;Jr.stateOrProvinceName="ST";Jr.O=ar.organizationName;Jr.organizationName="O";Jr.OU=ar.organizationalUnitName;Jr.organizationalUnitName="OU";Jr.E=ar.emailAddress;Jr.emailAddress="E";var zO=wt.pki.rsa.publicKeyValidator,sW={name:"Certificate",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:k.Class.UNIVERSAL,type:k.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:k.Class.UNIVERSAL,type:k.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:k.Class.UNIVERSAL,type:k.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:k.Class.UNIVERSAL,type:k.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},zO,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:k.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:k.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:k.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},iW={name:"rsapss",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:k.Class.UNIVERSAL,type:k.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:k.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:k.Class.UNIVERSAL,type:k.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:k.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:k.Class.UNIVERSAL,type:k.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:k.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:k.Class.UNIVERSAL,type:k.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},aW={name:"CertificationRequestInfo",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},zO,{name:"CertificationRequestInfo.attributes",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:k.Class.UNIVERSAL,type:k.Type.SET,constructed:!0}]}]}]},oW={name:"CertificationRequest",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[aW,{name:"CertificationRequest.signatureAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};$e.RDNAttributesAsArray=function(r,e){for(var t=[],n,s,i,a=0;a<r.value.length;++a){n=r.value[a];for(var u=0;u<n.value.length;++u)i={},s=n.value[u],i.type=k.derToOid(s.value[0].value),i.value=s.value[1].value,i.valueTagClass=s.value[1].type,i.type in ar&&(i.name=ar[i.type],i.name in Jr&&(i.shortName=Jr[i.name])),e&&(e.update(i.type),e.update(i.value)),t.push(i)}return t};$e.CRIAttributesAsArray=function(r){for(var e=[],t=0;t<r.length;++t)for(var n=r[t],s=k.derToOid(n.value[0].value),i=n.value[1].value,a=0;a<i.length;++a){var u={};if(u.type=s,u.value=i[a].value,u.valueTagClass=i[a].type,u.type in ar&&(u.name=ar[u.type],u.name in Jr&&(u.shortName=Jr[u.name])),u.type===ar.extensionRequest){u.extensions=[];for(var l=0;l<u.value.length;++l)u.extensions.push($e.certificateExtensionFromAsn1(u.value[l]))}e.push(u)}return e};function Au(r,e){typeof e=="string"&&(e={shortName:e});for(var t=null,n,s=0;t===null&&s<r.attributes.length;++s)n=r.attributes[s],(e.type&&e.type===n.type||e.name&&e.name===n.name||e.shortName&&e.shortName===n.shortName)&&(t=n);return t}o(Au,"_getAttribute");var Hw=o(function(r,e,t){var n={};if(r!==ar["RSASSA-PSS"])return n;t&&(n={hash:{algorithmOid:ar.sha1},mgf:{algorithmOid:ar.mgf1,hash:{algorithmOid:ar.sha1}},saltLength:20});var s={},i=[];if(!k.validate(e,iW,s,i)){var a=new Error("Cannot read RSASSA-PSS parameter block.");throw a.errors=i,a}return s.hashOid!==void 0&&(n.hash=n.hash||{},n.hash.algorithmOid=k.derToOid(s.hashOid)),s.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=k.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=k.derToOid(s.maskGenHashOid)),s.saltLength!==void 0&&(n.saltLength=s.saltLength.charCodeAt(0)),n},"_readSignatureParameters"),Kw=o(function(r){switch(ar[r.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return wt.md.sha1.create();case"md5WithRSAEncryption":return wt.md.md5.create();case"sha256WithRSAEncryption":return wt.md.sha256.create();case"sha384WithRSAEncryption":return wt.md.sha384.create();case"sha512WithRSAEncryption":return wt.md.sha512.create();case"RSASSA-PSS":return wt.md.sha256.create();default:var e=new Error("Could not compute "+r.type+" digest. Unknown signature OID.");throw e.signatureOid=r.signatureOid,e}},"_createSignatureDigest"),YO=o(function(r){var e=r.certificate,t;switch(e.signatureOid){case ar.sha1WithRSAEncryption:case ar.sha1WithRSASignature:break;case ar["RSASSA-PSS"]:var n,s;if(n=ar[e.signatureParameters.mgf.hash.algorithmOid],n===void 0||wt.md[n]===void 0){var i=new Error("Unsupported MGF hash function.");throw i.oid=e.signatureParameters.mgf.hash.algorithmOid,i.name=n,i}if(s=ar[e.signatureParameters.mgf.algorithmOid],s===void 0||wt.mgf[s]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=e.signatureParameters.mgf.algorithmOid,i.name=s,i}if(s=wt.mgf[s].create(wt.md[n].create()),n=ar[e.signatureParameters.hash.algorithmOid],n===void 0||wt.md[n]===void 0){var i=new Error("Unsupported RSASSA-PSS hash function.");throw i.oid=e.signatureParameters.hash.algorithmOid,i.name=n,i}t=wt.pss.create(wt.md[n].create(),s,e.signatureParameters.saltLength);break}return e.publicKey.verify(r.md.digest().getBytes(),r.signature,t)},"_verifySignature");$e.certificateFromPem=function(r,e,t){var n=wt.pem.decode(r)[0];if(n.type!=="CERTIFICATE"&&n.type!=="X509 CERTIFICATE"&&n.type!=="TRUSTED CERTIFICATE"){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=n.type,s}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var i=k.fromDer(n.body,t);return $e.certificateFromAsn1(i,e)};$e.certificateToPem=function(r,e){var t={type:"CERTIFICATE",body:k.toDer($e.certificateToAsn1(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.publicKeyFromPem=function(r){var e=wt.pem.decode(r)[0];if(e.type!=="PUBLIC KEY"&&e.type!=="RSA PUBLIC KEY"){var t=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var n=k.fromDer(e.body);return $e.publicKeyFromAsn1(n)};$e.publicKeyToPem=function(r,e){var t={type:"PUBLIC KEY",body:k.toDer($e.publicKeyToAsn1(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.publicKeyToRSAPublicKeyPem=function(r,e){var t={type:"RSA PUBLIC KEY",body:k.toDer($e.publicKeyToRSAPublicKey(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||wt.md.sha1.create(),n=e.type||"RSAPublicKey",s;switch(n){case"RSAPublicKey":s=k.toDer($e.publicKeyToRSAPublicKey(r)).getBytes();break;case"SubjectPublicKeyInfo":s=k.toDer($e.publicKeyToAsn1(r)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+e.type+'".')}t.start(),t.update(s);var i=t.digest();if(e.encoding==="hex"){var a=i.toHex();return e.delimiter?a.match(/.{2}/g).join(e.delimiter):a}else{if(e.encoding==="binary")return i.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return i};$e.certificationRequestFromPem=function(r,e,t){var n=wt.pem.decode(r)[0];if(n.type!=="CERTIFICATE REQUEST"){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=n.type,s}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var i=k.fromDer(n.body,t);return $e.certificationRequestFromAsn1(i,e)};$e.certificationRequestToPem=function(r,e){var t={type:"CERTIFICATE REQUEST",body:k.toDer($e.certificationRequestToAsn1(r)).getBytes()};return wt.pem.encode(t,{maxline:e})};$e.createCertificate=function(){var r={};return r.version=2,r.serialNumber="00",r.signatureOid=null,r.signature=null,r.siginfo={},r.siginfo.algorithmOid=null,r.validity={},r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.issuer={},r.issuer.getField=function(e){return Au(r.issuer,e)},r.issuer.addField=function(e){pi([e]),r.issuer.attributes.push(e)},r.issuer.attributes=[],r.issuer.hash=null,r.subject={},r.subject.getField=function(e){return Au(r.subject,e)},r.subject.addField=function(e){pi([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.extensions=[],r.publicKey=null,r.md=null,r.setSubject=function(e,t){pi(e),r.subject.attributes=e,delete r.subject.uniqueId,t&&(r.subject.uniqueId=t),r.subject.hash=null},r.setIssuer=function(e,t){pi(e),r.issuer.attributes=e,delete r.issuer.uniqueId,t&&(r.issuer.uniqueId=t),r.issuer.hash=null},r.setExtensions=function(e){for(var t=0;t<e.length;++t)QO(e[t],{cert:r});r.extensions=e},r.getExtension=function(e){typeof e=="string"&&(e={name:e});for(var t=null,n,s=0;t===null&&s<r.extensions.length;++s)n=r.extensions[s],(e.id&&n.id===e.id||e.name&&n.name===e.name)&&(t=n);return t},r.sign=function(e,t){r.md=t||wt.md.sha1.create();var n=ar[r.md.algorithm+"WithRSAEncryption"];if(!n){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=r.md.algorithm,s}r.signatureOid=r.siginfo.algorithmOid=n,r.tbsCertificate=$e.getTBSCertificate(r);var i=k.toDer(r.tbsCertificate);r.md.update(i.getBytes()),r.signature=e.sign(r.md)},r.verify=function(e){var t=!1;if(!r.issued(e)){var n=e.issuer,s=r.subject,i=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw i.expectedIssuer=s.attributes,i.actualIssuer=n.attributes,i}var a=e.md;if(a===null){a=Kw({signatureOid:e.signatureOid,type:"certificate"});var u=e.tbsCertificate||$e.getTBSCertificate(e),l=k.toDer(u);a.update(l.getBytes())}return a!==null&&(t=YO({certificate:r,md:a,signature:e.signature})),t},r.isIssuer=function(e){var t=!1,n=r.issuer,s=e.subject;if(n.hash&&s.hash)t=n.hash===s.hash;else if(n.attributes.length===s.attributes.length){t=!0;for(var i,a,u=0;t&&u<n.attributes.length;++u)i=n.attributes[u],a=s.attributes[u],(i.type!==a.type||i.value!==a.value)&&(t=!1)}return t},r.issued=function(e){return e.isIssuer(r)},r.generateSubjectKeyIdentifier=function(){return $e.getPublicKeyFingerprint(r.publicKey,{type:"RSAPublicKey"})},r.verifySubjectKeyIdentifier=function(){for(var e=ar.subjectKeyIdentifier,t=0;t<r.extensions.length;++t){var n=r.extensions[t];if(n.id===e){var s=r.generateSubjectKeyIdentifier().getBytes();return wt.util.hexToBytes(n.subjectKeyIdentifier)===s}}return!1},r};$e.certificateFromAsn1=function(r,e){var t={},n=[];if(!k.validate(r,sW,t,n)){var s=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw s.errors=n,s}var i=k.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=$e.createCertificate();a.version=t.certVersion?t.certVersion.charCodeAt(0):0;var u=wt.util.createBuffer(t.certSerialNumber);a.serialNumber=u.toHex(),a.signatureOid=wt.asn1.derToOid(t.certSignatureOid),a.signatureParameters=Hw(a.signatureOid,t.certSignatureParams,!0),a.siginfo.algorithmOid=wt.asn1.derToOid(t.certinfoSignatureOid),a.siginfo.parameters=Hw(a.siginfo.algorithmOid,t.certinfoSignatureParams,!1),a.signature=t.certSignature;var l=[];if(t.certValidity1UTCTime!==void 0&&l.push(k.utcTimeToDate(t.certValidity1UTCTime)),t.certValidity2GeneralizedTime!==void 0&&l.push(k.generalizedTimeToDate(t.certValidity2GeneralizedTime)),t.certValidity3UTCTime!==void 0&&l.push(k.utcTimeToDate(t.certValidity3UTCTime)),t.certValidity4GeneralizedTime!==void 0&&l.push(k.generalizedTimeToDate(t.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(a.validity.notBefore=l[0],a.validity.notAfter=l[1],a.tbsCertificate=t.tbsCertificate,e){a.md=Kw({signatureOid:a.signatureOid,type:"certificate"});var f=k.toDer(a.tbsCertificate);a.md.update(f.getBytes())}var h=wt.md.sha1.create(),m=k.toDer(t.certIssuer);h.update(m.getBytes()),a.issuer.getField=function(y){return Au(a.issuer,y)},a.issuer.addField=function(y){pi([y]),a.issuer.attributes.push(y)},a.issuer.attributes=$e.RDNAttributesAsArray(t.certIssuer),t.certIssuerUniqueId&&(a.issuer.uniqueId=t.certIssuerUniqueId),a.issuer.hash=h.digest().toHex();var g=wt.md.sha1.create(),w=k.toDer(t.certSubject);return g.update(w.getBytes()),a.subject.getField=function(y){return Au(a.subject,y)},a.subject.addField=function(y){pi([y]),a.subject.attributes.push(y)},a.subject.attributes=$e.RDNAttributesAsArray(t.certSubject),t.certSubjectUniqueId&&(a.subject.uniqueId=t.certSubjectUniqueId),a.subject.hash=g.digest().toHex(),t.certExtensions?a.extensions=$e.certificateExtensionsFromAsn1(t.certExtensions):a.extensions=[],a.publicKey=$e.publicKeyFromAsn1(t.subjectPublicKeyInfo),a};$e.certificateExtensionsFromAsn1=function(r){for(var e=[],t=0;t<r.value.length;++t)for(var n=r.value[t],s=0;s<n.value.length;++s)e.push($e.certificateExtensionFromAsn1(n.value[s]));return e};$e.certificateExtensionFromAsn1=function(r){var e={};if(e.id=k.derToOid(r.value[0].value),e.critical=!1,r.value[1].type===k.Type.BOOLEAN?(e.critical=r.value[1].value.charCodeAt(0)!==0,e.value=r.value[2].value):e.value=r.value[1].value,e.id in ar){if(e.name=ar[e.id],e.name==="keyUsage"){var t=k.fromDer(e.value),n=0,s=0;t.value.length>1&&(n=t.value.charCodeAt(1),s=t.value.length>2?t.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(s&128)===128}else if(e.name==="basicConstraints"){var t=k.fromDer(e.value);t.value.length>0&&t.value[0].type===k.Type.BOOLEAN?e.cA=t.value[0].value.charCodeAt(0)!==0:e.cA=!1;var i=null;t.value.length>0&&t.value[0].type===k.Type.INTEGER?i=t.value[0].value:t.value.length>1&&(i=t.value[1].value),i!==null&&(e.pathLenConstraint=k.derToInteger(i))}else if(e.name==="extKeyUsage")for(var t=k.fromDer(e.value),a=0;a<t.value.length;++a){var u=k.derToOid(t.value[a].value);u in ar?e[ar[u]]=!0:e[u]=!0}else if(e.name==="nsCertType"){var t=k.fromDer(e.value),n=0;t.value.length>1&&(n=t.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var l,t=k.fromDer(e.value),f=0;f<t.value.length;++f){l=t.value[f];var h={type:l.type,value:l.value};switch(e.altNames.push(h),l.type){case 1:case 2:case 6:break;case 7:h.ip=wt.util.bytesToIP(l.value);break;case 8:h.oid=k.derToOid(l.value);break;default:}}}else if(e.name==="subjectKeyIdentifier"){var t=k.fromDer(e.value);e.subjectKeyIdentifier=wt.util.bytesToHex(t.value)}}return e};$e.certificationRequestFromAsn1=function(r,e){var t={},n=[];if(!k.validate(r,oW,t,n)){var s=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw s.errors=n,s}var i=k.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=$e.createCertificationRequest();if(a.version=t.csrVersion?t.csrVersion.charCodeAt(0):0,a.signatureOid=wt.asn1.derToOid(t.csrSignatureOid),a.signatureParameters=Hw(a.signatureOid,t.csrSignatureParams,!0),a.siginfo.algorithmOid=wt.asn1.derToOid(t.csrSignatureOid),a.siginfo.parameters=Hw(a.siginfo.algorithmOid,t.csrSignatureParams,!1),a.signature=t.csrSignature,a.certificationRequestInfo=t.certificationRequestInfo,e){a.md=Kw({signatureOid:a.signatureOid,type:"certification request"});var u=k.toDer(a.certificationRequestInfo);a.md.update(u.getBytes())}var l=wt.md.sha1.create();return a.subject.getField=function(f){return Au(a.subject,f)},a.subject.addField=function(f){pi([f]),a.subject.attributes.push(f)},a.subject.attributes=$e.RDNAttributesAsArray(t.certificationRequestInfoSubject,l),a.subject.hash=l.digest().toHex(),a.publicKey=$e.publicKeyFromAsn1(t.subjectPublicKeyInfo),a.getAttribute=function(f){return Au(a,f)},a.addAttribute=function(f){pi([f]),a.attributes.push(f)},a.attributes=$e.CRIAttributesAsArray(t.certificationRequestInfoAttributes||[]),a};$e.createCertificationRequest=function(){var r={};return r.version=0,r.signatureOid=null,r.signature=null,r.siginfo={},r.siginfo.algorithmOid=null,r.subject={},r.subject.getField=function(e){return Au(r.subject,e)},r.subject.addField=function(e){pi([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.publicKey=null,r.attributes=[],r.getAttribute=function(e){return Au(r,e)},r.addAttribute=function(e){pi([e]),r.attributes.push(e)},r.md=null,r.setSubject=function(e){pi(e),r.subject.attributes=e,r.subject.hash=null},r.setAttributes=function(e){pi(e),r.attributes=e},r.sign=function(e,t){r.md=t||wt.md.sha1.create();var n=ar[r.md.algorithm+"WithRSAEncryption"];if(!n){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=r.md.algorithm,s}r.signatureOid=r.siginfo.algorithmOid=n,r.certificationRequestInfo=$e.getCertificationRequestInfo(r);var i=k.toDer(r.certificationRequestInfo);r.md.update(i.getBytes()),r.signature=e.sign(r.md)},r.verify=function(){var e=!1,t=r.md;if(t===null){t=Kw({signatureOid:r.signatureOid,type:"certification request"});var n=r.certificationRequestInfo||$e.getCertificationRequestInfo(r),s=k.toDer(n);t.update(s.getBytes())}return t!==null&&(e=YO({certificate:r,md:t,signature:r.signature})),e},r};function Wh(r){for(var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),t,n,s=r.attributes,i=0;i<s.length;++i){t=s[i];var a=t.value,u=k.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass,u===k.Type.UTF8&&(a=wt.util.encodeUtf8(a))),n=k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(t.type).getBytes()),k.create(k.Class.UNIVERSAL,u,!1,a)])]),e.value.push(n)}return e}o(Wh,"_dnToAsn1");function pi(r){for(var e,t=0;t<r.length;++t){if(e=r[t],typeof e.name>"u"&&(e.type&&e.type in $e.oids?e.name=$e.oids[e.type]:e.shortName&&e.shortName in Jr&&(e.name=$e.oids[Jr[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in $e.oids)e.type=$e.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in Jr&&(e.shortName=Jr[e.name]),e.type===ar.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=k.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var s=0;s<e.extensions.length;++s)e.value.push($e.certificateExtensionToAsn1(QO(e.extensions[s])))}if(typeof e.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}o(pi,"_fillMissingFields");function QO(r,e){if(e=e||{},typeof r.name>"u"&&r.id&&r.id in $e.oids&&(r.name=$e.oids[r.id]),typeof r.id>"u")if(r.name&&r.name in $e.oids)r.id=$e.oids[r.name];else{var t=new Error("Extension ID not specified.");throw t.extension=r,t}if(typeof r.value<"u")return r;if(r.name==="keyUsage"){var n=0,s=0,i=0;r.digitalSignature&&(s|=128,n=7),r.nonRepudiation&&(s|=64,n=6),r.keyEncipherment&&(s|=32,n=5),r.dataEncipherment&&(s|=16,n=4),r.keyAgreement&&(s|=8,n=3),r.keyCertSign&&(s|=4,n=2),r.cRLSign&&(s|=2,n=1),r.encipherOnly&&(s|=1,n=0),r.decipherOnly&&(i|=128,n=7);var a=String.fromCharCode(n);i!==0?a+=String.fromCharCode(s)+String.fromCharCode(i):s!==0&&(a+=String.fromCharCode(s)),r.value=k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,a)}else if(r.name==="basicConstraints")r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),r.cA&&r.value.value.push(k.create(k.Class.UNIVERSAL,k.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in r&&r.value.value.push(k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.pathLenConstraint).getBytes()));else if(r.name==="extKeyUsage"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);var u=r.value.value;for(var l in r)r[l]===!0&&(l in ar?u.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(ar[l]).getBytes())):l.indexOf(".")!==-1&&u.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(l).getBytes())))}else if(r.name==="nsCertType"){var n=0,s=0;r.client&&(s|=128,n=7),r.server&&(s|=64,n=6),r.email&&(s|=32,n=5),r.objsign&&(s|=16,n=4),r.reserved&&(s|=8,n=3),r.sslCA&&(s|=4,n=2),r.emailCA&&(s|=2,n=1),r.objCA&&(s|=1,n=0);var a=String.fromCharCode(n);s!==0&&(a+=String.fromCharCode(s)),r.value=k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,a)}else if(r.name==="subjectAltName"||r.name==="issuerAltName"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);for(var f,h=0;h<r.altNames.length;++h){f=r.altNames[h];var a=f.value;if(f.type===7&&f.ip){if(a=wt.util.bytesFromIP(f.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else f.type===8&&(f.oid?a=k.oidToDer(k.oidToDer(f.oid)):a=k.oidToDer(a));r.value.value.push(k.create(k.Class.CONTEXT_SPECIFIC,f.type,!1,a))}}else if(r.name==="nsComment"&&e.cert){if(!/^[\x00-\x7F]*$/.test(r.comment)||r.comment.length<1||r.comment.length>128)throw new Error('Invalid "nsComment" content.');r.value=k.create(k.Class.UNIVERSAL,k.Type.IA5STRING,!1,r.comment)}else if(r.name==="subjectKeyIdentifier"&&e.cert){var m=e.cert.generateSubjectKeyIdentifier();r.subjectKeyIdentifier=m.toHex(),r.value=k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,m.getBytes())}else if(r.name==="authorityKeyIdentifier"&&e.cert){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);var u=r.value.value;if(r.keyIdentifier){var g=r.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():r.keyIdentifier;u.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!1,g))}if(r.authorityCertIssuer){var w=[k.create(k.Class.CONTEXT_SPECIFIC,4,!0,[Wh(r.authorityCertIssuer===!0?e.cert.issuer:r.authorityCertIssuer)])];u.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,w))}if(r.serialNumber){var y=wt.util.hexToBytes(r.serialNumber===!0?e.cert.serialNumber:r.serialNumber);u.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if(r.name==="cRLDistributionPoints"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);for(var u=r.value.value,S=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),E=k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[]),f,h=0;h<r.altNames.length;++h){f=r.altNames[h];var a=f.value;if(f.type===7&&f.ip){if(a=wt.util.bytesFromIP(f.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else f.type===8&&(f.oid?a=k.oidToDer(k.oidToDer(f.oid)):a=k.oidToDer(a));E.value.push(k.create(k.Class.CONTEXT_SPECIFIC,f.type,!1,a))}S.value.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[E])),u.push(S)}if(typeof r.value>"u"){var t=new Error("Extension value not specified.");throw t.extension=r,t}return r}o(QO,"_fillMissingExtensionFields");function hx(r,e){switch(r){case ar["RSASSA-PSS"]:var t=[];return e.hash.algorithmOid!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.hash.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.mgf.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.mgf.hash.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(e.saltLength).getBytes())])),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,t);default:return k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")}}o(hx,"_signatureParametersToAsn1");function uW(r){var e=k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[]);if(r.attributes.length===0)return e;for(var t=r.attributes,n=0;n<t.length;++n){var s=t[n],i=s.value,a=k.Type.UTF8;"valueTagClass"in s&&(a=s.valueTagClass),a===k.Type.UTF8&&(i=wt.util.encodeUtf8(i));var u=!1;"valueConstructed"in s&&(u=s.valueConstructed);var l=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(s.type).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,a,u,i)])]);e.value.push(l)}return e}o(uW,"_CRIAttributesToAsn1");var lW=new Date("1950-01-01T00:00:00Z"),cW=new Date("2050-01-01T00:00:00Z");function JO(r){return r>=lW&&r<cW?k.create(k.Class.UNIVERSAL,k.Type.UTCTIME,!1,k.dateToUtcTime(r)):k.create(k.Class.UNIVERSAL,k.Type.GENERALIZEDTIME,!1,k.dateToGeneralizedTime(r))}o(JO,"_dateToAsn1");$e.getTBSCertificate=function(r){var e=JO(r.validity.notBefore),t=JO(r.validity.notAfter),n=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.version).getBytes())]),k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,wt.util.hexToBytes(r.serialNumber)),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.siginfo.algorithmOid).getBytes()),hx(r.siginfo.algorithmOid,r.siginfo.parameters)]),Wh(r.issuer),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,t]),Wh(r.subject),$e.publicKeyToAsn1(r.publicKey)]);return r.issuer.uniqueId&&n.value.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,[k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.issuer.uniqueId)])),r.subject.uniqueId&&n.value.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!0,[k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.subject.uniqueId)])),r.extensions.length>0&&n.value.push($e.certificateExtensionsToAsn1(r.extensions)),n};$e.getCertificationRequestInfo=function(r){var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.version).getBytes()),Wh(r.subject),$e.publicKeyToAsn1(r.publicKey),uW(r)]);return e};$e.distinguishedNameToAsn1=function(r){return Wh(r)};$e.certificateToAsn1=function(r){var e=r.tbsCertificate||$e.getTBSCertificate(r);return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.signatureOid).getBytes()),hx(r.signatureOid,r.signatureParameters)]),k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.signature)])};$e.certificateExtensionsToAsn1=function(r){var e=k.create(k.Class.CONTEXT_SPECIFIC,3,!0,[]),t=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);e.value.push(t);for(var n=0;n<r.length;++n)t.value.push($e.certificateExtensionToAsn1(r[n]));return e};$e.certificateExtensionToAsn1=function(r){var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);e.value.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.id).getBytes())),r.critical&&e.value.push(k.create(k.Class.UNIVERSAL,k.Type.BOOLEAN,!1,"\xFF"));var t=r.value;return typeof r.value!="string"&&(t=k.toDer(t).getBytes()),e.value.push(k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,t)),e};$e.certificationRequestToAsn1=function(r){var e=r.certificationRequestInfo||$e.getCertificationRequestInfo(r);return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.signatureOid).getBytes()),hx(r.signatureOid,r.signatureParameters)]),k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.signature)])};$e.createCaStore=function(r){var e={certs:{}};e.getIssuer=function(a){var u=t(a.issuer);return u},e.addCertificate=function(a){if(typeof a=="string"&&(a=wt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))if(a.subject.hash in e.certs){var u=e.certs[a.subject.hash];wt.util.isArray(u)||(u=[u]),u.push(a),e.certs[a.subject.hash]=u}else e.certs[a.subject.hash]=a},e.hasCertificate=function(a){typeof a=="string"&&(a=wt.pki.certificateFromPem(a));var u=t(a.subject);if(!u)return!1;wt.util.isArray(u)||(u=[u]);for(var l=k.toDer($e.certificateToAsn1(a)).getBytes(),f=0;f<u.length;++f){var h=k.toDer($e.certificateToAsn1(u[f])).getBytes();if(l===h)return!0}return!1},e.listAllCertificates=function(){var a=[];for(var u in e.certs)if(e.certs.hasOwnProperty(u)){var l=e.certs[u];if(!wt.util.isArray(l))a.push(l);else for(var f=0;f<l.length;++f)a.push(l[f])}return a},e.removeCertificate=function(a){var u;if(typeof a=="string"&&(a=wt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))return null;var l=t(a.subject);if(!wt.util.isArray(l))return u=e.certs[a.subject.hash],delete e.certs[a.subject.hash],u;for(var f=k.toDer($e.certificateToAsn1(a)).getBytes(),h=0;h<l.length;++h){var m=k.toDer($e.certificateToAsn1(l[h])).getBytes();f===m&&(u=l[h],l.splice(h,1))}return l.length===0&&delete e.certs[a.subject.hash],u};function t(a){return n(a),e.certs[a.hash]||null}o(t,"getBySubject");function n(a){if(!a.hash){var u=wt.md.sha1.create();a.attributes=$e.RDNAttributesAsArray(Wh(a),u),a.hash=u.digest().toHex()}}if(o(n,"ensureSubjectHasHash"),r)for(var s=0;s<r.length;++s){var i=r[s];e.addCertificate(i)}return e};$e.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};$e.verifyCertificateChain=function(r,e,t){typeof t=="function"&&(t={verify:t}),t=t||{},e=e.slice(0);var n=e.slice(0),s=t.validityCheckDate;typeof s>"u"&&(s=new Date);var i=!0,a=null,u=0;do{var l=e.shift(),f=null,h=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:$e.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),a===null){if(f=e[0]||r.getIssuer(l),f===null&&l.isIssuer(l)&&(h=!0,f=l),f){var m=f;wt.util.isArray(m)||(m=[m]);for(var g=!1;!g&&m.length>0;){f=m.shift();try{g=f.verify(l)}catch{}}g||(a={message:"Certificate signature is invalid.",error:$e.certificateError.bad_certificate})}a===null&&(!f||h)&&!r.hasCertificate(l)&&(a={message:"Certificate is not trusted.",error:$e.certificateError.unknown_ca})}if(a===null&&f&&!l.isIssuer(f)&&(a={message:"Certificate issuer is invalid.",error:$e.certificateError.bad_certificate}),a===null)for(var w={keyUsage:!0,basicConstraints:!0},y=0;a===null&&y<l.extensions.length;++y){var S=l.extensions[y];S.critical&&!(S.name in w)&&(a={message:"Certificate has an unsupported critical extension.",error:$e.certificateError.unsupported_certificate})}if(a===null&&(!i||e.length===0&&(!f||h))){var E=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||E===null)&&(a={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:$e.certificateError.bad_certificate}),a===null&&E!==null&&!E.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:$e.certificateError.bad_certificate}),a===null&&b!==null&&"pathLenConstraint"in E){var T=u-1;T>E.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:$e.certificateError.bad_certificate})}}var A=a===null?!0:a.error,C=t.verify?t.verify(A,u,n):A;if(C===!0)a=null;else throw A===!0&&(a={message:"The application rejected the certificate.",error:$e.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!wt.util.isArray(C)?(C.message&&(a.message=C.message),C.error&&(a.error=C.error)):typeof C=="string"&&(a.error=C)),a;i=!1,++u}while(e.length>0);return!0}});var dx=ye((Uce,t3)=>{"use strict";var Br=$t();Fi();Fh();wu();cx();lx();ci();Cm();$h();ur();$w();var Y=Br.asn1,Yt=Br.pki,xm=t3.exports=Br.pkcs12=Br.pkcs12||{},e3={name:"ContentInfo",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},fW={name:"PFX",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Y.Class.UNIVERSAL,type:Y.Type.INTEGER,constructed:!1,capture:"version"},e3,{name:"PFX.macData",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:Y.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Y.Class.UNIVERSAL,type:Y.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},hW={name:"SafeBag",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},pW={name:"Attribute",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SET,constructed:!0,capture:"values"}]},dW={name:"CertBag",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Y.Class.UNIVERSAL,type:Y.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function bm(r,e,t,n){for(var s=[],i=0;i<r.length;i++)for(var a=0;a<r[i].safeBags.length;a++){var u=r[i].safeBags[a];if(!(n!==void 0&&u.type!==n)){if(e===null){s.push(u);continue}u.attributes[e]!==void 0&&u.attributes[e].indexOf(t)>=0&&s.push(u)}}return s}o(bm,"_getBagsByAttribute");xm.pkcs12FromAsn1=function(r,e,t){typeof e=="string"?(t=e,e=!0):e===void 0&&(e=!0);var n={},s=[];if(!Y.validate(r,fW,n,s)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var a={version:n.version.charCodeAt(0),safeContents:[],getBags:o(function(E){var b={},T;return"localKeyId"in E?T=E.localKeyId:"localKeyIdHex"in E&&(T=Br.util.hexToBytes(E.localKeyIdHex)),T===void 0&&!("friendlyName"in E)&&"bagType"in E&&(b[E.bagType]=bm(a.safeContents,null,null,E.bagType)),T!==void 0&&(b.localKeyId=bm(a.safeContents,"localKeyId",T,E.bagType)),"friendlyName"in E&&(b.friendlyName=bm(a.safeContents,"friendlyName",E.friendlyName,E.bagType)),b},"getBags"),getBagsByFriendlyName:o(function(E,b){return bm(a.safeContents,"friendlyName",E,b)},"getBagsByFriendlyName"),getBagsByLocalKeyId:o(function(E,b){return bm(a.safeContents,"localKeyId",E,b)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=n.version.charCodeAt(0),i}if(Y.derToOid(n.contentType)!==Yt.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=Y.derToOid(n.contentType),i}var u=n.content.value[0];if(u.tagClass!==Y.Class.UNIVERSAL||u.type!==Y.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(u=px(u),n.mac){var l=null,f=0,h=Y.derToOid(n.macAlgorithm);switch(h){case Yt.oids.sha1:l=Br.md.sha1.create(),f=20;break;case Yt.oids.sha256:l=Br.md.sha256.create(),f=32;break;case Yt.oids.sha384:l=Br.md.sha384.create(),f=48;break;case Yt.oids.sha512:l=Br.md.sha512.create(),f=64;break;case Yt.oids.md5:l=Br.md.md5.create(),f=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+h);var m=new Br.util.ByteBuffer(n.macSalt),g="macIterations"in n?parseInt(Br.util.bytesToHex(n.macIterations),16):1,w=xm.generateKey(t,m,3,g,f,l),y=Br.hmac.create();y.start(l,w),y.update(u.value);var S=y.getMac();if(S.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return mW(a,u.value,e,t),a};function px(r){if(r.composed||r.constructed){for(var e=Br.util.createBuffer(),t=0;t<r.value.length;++t)e.putBytes(r.value[t].value);r.composed=r.constructed=!1,r.value=e.getBytes()}return r}o(px,"_decodePkcs7Data");function mW(r,e,t,n){if(e=Y.fromDer(e,t),e.tagClass!==Y.Class.UNIVERSAL||e.type!==Y.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<e.value.length;s++){var i=e.value[s],a={},u=[];if(!Y.validate(i,e3,a,u)){var l=new Error("Cannot read ContentInfo.");throw l.errors=u,l}var f={encrypted:!1},h=null,m=a.content.value[0];switch(Y.derToOid(a.contentType)){case Yt.oids.data:if(m.tagClass!==Y.Class.UNIVERSAL||m.type!==Y.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");h=px(m).value;break;case Yt.oids.encryptedData:h=gW(m,n),f.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=Y.derToOid(a.contentType),l}f.safeBags=yW(h,t,n),r.safeContents.push(f)}}o(mW,"_decodeAuthenticatedSafe");function gW(r,e){var t={},n=[];if(!Y.validate(r,Br.pkcs7.asn1.encryptedDataValidator,t,n)){var s=new Error("Cannot read EncryptedContentInfo.");throw s.errors=n,s}var i=Y.derToOid(t.contentType);if(i!==Yt.oids.data){var s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw s.oid=i,s}i=Y.derToOid(t.encAlgorithm);var a=Yt.pbe.getCipher(i,t.encParameter,e),u=px(t.encryptedContentAsn1),l=Br.util.createBuffer(u.value);if(a.update(l),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}o(gW,"_decryptSafeContents");function yW(r,e,t){if(!e&&r.length===0)return[];if(r=Y.fromDer(r,e),r.tagClass!==Y.Class.UNIVERSAL||r.type!==Y.Type.SEQUENCE||r.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],s=0;s<r.value.length;s++){var i=r.value[s],a={},u=[];if(!Y.validate(i,hW,a,u)){var l=new Error("Cannot read SafeBag.");throw l.errors=u,l}var f={type:Y.derToOid(a.bagId),attributes:vW(a.bagAttributes)};n.push(f);var h,m,g=a.bagValue.value[0];switch(f.type){case Yt.oids.pkcs8ShroudedKeyBag:if(g=Yt.decryptPrivateKeyInfo(g,t),g===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Yt.oids.keyBag:try{f.key=Yt.privateKeyFromAsn1(g)}catch{f.key=null,f.asn1=g}continue;case Yt.oids.certBag:h=dW,m=o(function(){if(Y.derToOid(a.certId)!==Yt.oids.x509Certificate){var y=new Error("Unsupported certificate type, only X.509 supported.");throw y.oid=Y.derToOid(a.certId),y}var S=Y.fromDer(a.cert,e);try{f.cert=Yt.certificateFromAsn1(S,!0)}catch{f.cert=null,f.asn1=S}},"decoder");break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=f.type,l}if(h!==void 0&&!Y.validate(g,h,a,u)){var l=new Error("Cannot read PKCS#12 "+h.name);throw l.errors=u,l}m()}return n}o(yW,"_decodeSafeContents");function vW(r){var e={};if(r!==void 0)for(var t=0;t<r.length;++t){var n={},s=[];if(!Y.validate(r[t],pW,n,s)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=s,i}var a=Y.derToOid(n.oid);if(Yt.oids[a]!==void 0){e[Yt.oids[a]]=[];for(var u=0;u<n.values.length;++u)e[Yt.oids[a]].push(n.values[u].value)}}return e}o(vW,"_decodeBagAttributes");xm.toPkcs12Asn1=function(r,e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||n.encAlgorithm||"aes128","useMac"in n||(n.useMac=!0),"localKeyId"in n||(n.localKeyId=null),"generateLocalKeyId"in n||(n.generateLocalKeyId=!0);var s=n.localKeyId,i;if(s!==null)s=Br.util.hexToBytes(s);else if(n.generateLocalKeyId)if(e){var a=Br.util.isArray(e)?e[0]:e;typeof a=="string"&&(a=Yt.certificateFromPem(a));var u=Br.md.sha1.create();u.update(Y.toDer(Yt.certificateToAsn1(a)).getBytes()),s=u.digest().getBytes()}else s=Br.random.getBytes(20);var l=[];s!==null&&l.push(Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.localKeyId).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,s)])])),"friendlyName"in n&&l.push(Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.friendlyName).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.BMPSTRING,!1,n.friendlyName)])])),l.length>0&&(i=Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,l));var f=[],h=[];e!==null&&(Br.util.isArray(e)?h=e:h=[e]);for(var m=[],g=0;g<h.length;++g){e=h[g],typeof e=="string"&&(e=Yt.certificateFromPem(e));var w=g===0?i:void 0,y=Yt.certificateToAsn1(e),S=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.certBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.x509Certificate).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(y).getBytes())])])]),w]);m.push(S)}if(m.length>0){var E=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,m),b=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(E).getBytes())])]);f.push(b)}var T=null;if(r!==null){var A=Yt.wrapRsaPrivateKey(Yt.privateKeyToAsn1(r));t===null?T=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.keyBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[A]),i]):T=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.pkcs8ShroudedKeyBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Yt.encryptPrivateKeyInfo(A,t,n)]),i]);var C=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[T]),x=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(C).getBytes())])]);f.push(x)}var B=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,f),F;if(n.useMac){var u=Br.md.sha1.create(),R=new Br.util.ByteBuffer(Br.random.getBytes(n.saltSize)),H=n.count,r=xm.generateKey(t,R,3,H,20),q=Br.hmac.create();q.start(u,r),q.update(Y.toDer(B).getBytes());var K=q.getMac();F=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.sha1).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.NULL,!1,"")]),Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,K.getBytes())]),Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,R.getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.INTEGER,!1,Y.integerToDer(H).getBytes())])}return Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.INTEGER,!1,Y.integerToDer(3).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(B).getBytes())])]),F])};xm.generateKey=Br.pbe.generatePkcs12Key});var gx=ye((jce,r3)=>{"use strict";var Cu=$t();Fi();wu();lx();hc();kw();dx();qw();Cm();ur();$w();var mx=Cu.asn1,Jh=r3.exports=Cu.pki=Cu.pki||{};Jh.pemToDer=function(r){var e=Cu.pem.decode(r)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Cu.util.createBuffer(e.body)};Jh.privateKeyFromPem=function(r){var e=Cu.pem.decode(r)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var t=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=mx.fromDer(e.body);return Jh.privateKeyFromAsn1(n)};Jh.privateKeyToPem=function(r,e){var t={type:"RSA PRIVATE KEY",body:mx.toDer(Jh.privateKeyToAsn1(r)).getBytes()};return Cu.pem.encode(t,{maxline:e})};Jh.privateKeyInfoToPem=function(r,e){var t={type:"PRIVATE KEY",body:mx.toDer(r).getBytes()};return Cu.pem.encode(t,{maxline:e})}});var Ax=ye((Fce,c3)=>{"use strict";var ke=$t();Fi();Fh();_w();hc();gx();ci();$h();ur();var Jw=o(function(r,e,t,n){var s=ke.util.createBuffer(),i=r.length>>1,a=i+(r.length&1),u=r.substr(0,a),l=r.substr(i,a),f=ke.util.createBuffer(),h=ke.hmac.create();t=e+t;var m=Math.ceil(n/16),g=Math.ceil(n/20);h.start("MD5",u);var w=ke.util.createBuffer();f.putBytes(t);for(var y=0;y<m;++y)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+t),w.putBuffer(h.digest());h.start("SHA1",l);var S=ke.util.createBuffer();f.clear(),f.putBytes(t);for(var y=0;y<g;++y)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+t),S.putBuffer(h.digest());return s.putBytes(ke.util.xorBytes(w.getBytes(),S.getBytes(),n)),s},"prf_TLS1"),wW=o(function(r,e,t){var n=ke.hmac.create();n.start("SHA1",r);var s=ke.util.createBuffer();return s.putInt32(e[0]),s.putInt32(e[1]),s.putByte(t.type),s.putByte(t.version.major),s.putByte(t.version.minor),s.putInt16(t.length),s.putBytes(t.fragment.bytes()),n.update(s.getBytes()),n.digest().getBytes()},"hmac_sha1"),SW=o(function(r,e,t){var n=!1;try{var s=r.deflate(e.fragment.getBytes());e.fragment=ke.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"deflate"),EW=o(function(r,e,t){var n=!1;try{var s=r.inflate(e.fragment.getBytes());e.fragment=ke.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"inflate"),$s=o(function(r,e){var t=0;switch(e){case 1:t=r.getByte();break;case 2:t=r.getInt16();break;case 3:t=r.getInt24();break;case 4:t=r.getInt32();break}return ke.util.createBuffer(r.getBytes(t))},"readVector"),di=o(function(r,e,t){r.putInt(t.length(),e<<3),r.putBuffer(t)},"writeVector"),U={};U.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};U.SupportedVersions=[U.Versions.TLS_1_1,U.Versions.TLS_1_0];U.Version=U.SupportedVersions[0];U.MaxFragment=15360;U.ConnectionEnd={server:0,client:1};U.PRFAlgorithm={tls_prf_sha256:0};U.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};U.CipherType={stream:0,block:1,aead:2};U.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};U.CompressionMethod={none:0,deflate:1};U.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};U.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};U.Alert={};U.Alert.Level={warning:1,fatal:2};U.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};U.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};U.CipherSuites={};U.getCipherSuite=function(r){var e=null;for(var t in U.CipherSuites){var n=U.CipherSuites[t];if(n.id[0]===r.charCodeAt(0)&&n.id[1]===r.charCodeAt(1)){e=n;break}}return e};U.handleUnexpected=function(r,e){var t=!r.open&&r.entity===U.ConnectionEnd.client;t||r.error(r,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unexpected_message}})};U.handleHelloRequest=function(r,e,t){!r.handshaking&&r.handshakes>0&&(U.queue(r,U.createAlert(r,{level:U.Alert.Level.warning,description:U.Alert.Description.no_renegotiation})),U.flush(r)),r.process()};U.parseHelloMessage=function(r,e,t){var n=null,s=r.entity===U.ConnectionEnd.client;if(t<38)r.error(r,{message:s?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});else{var i=e.fragment,a=i.length();if(n={version:{major:i.getByte(),minor:i.getByte()},random:ke.util.createBuffer(i.getBytes(32)),session_id:$s(i,1),extensions:[]},s?(n.cipher_suite=i.getBytes(2),n.compression_method=i.getByte()):(n.cipher_suites=$s(i,2),n.compression_methods=$s(i,1)),a=t-(a-i.length()),a>0){for(var u=$s(i,2);u.length()>0;)n.extensions.push({type:[u.getByte(),u.getByte()],data:$s(u,2)});if(!s)for(var l=0;l<n.extensions.length;++l){var f=n.extensions[l];if(f.type[0]===0&&f.type[1]===0)for(var h=$s(f.data,2);h.length()>0;){var m=h.getByte();if(m!==0)break;r.session.extensions.server_name.serverNameList.push($s(h,2).getBytes())}}}if(r.session.version&&(n.version.major!==r.session.version.major||n.version.minor!==r.session.version.minor))return r.error(r,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}});if(s)r.session.cipherSuite=U.getCipherSuite(n.cipher_suite);else for(var g=ke.util.createBuffer(n.cipher_suites.bytes());g.length()>0&&(r.session.cipherSuite=U.getCipherSuite(g.getBytes(2)),r.session.cipherSuite===null););if(r.session.cipherSuite===null)return r.error(r,{message:"No cipher suites in common.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.handshake_failure},cipherSuite:ke.util.bytesToHex(n.cipher_suite)});s?r.session.compressionMethod=n.compression_method:r.session.compressionMethod=U.CompressionMethod.none}return n};U.createSecurityParameters=function(r,e){var t=r.entity===U.ConnectionEnd.client,n=e.random.bytes(),s=t?r.session.sp.client_random:n,i=t?n:U.createRandom().getBytes();r.session.sp={entity:r.entity,prf_algorithm:U.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:r.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:s,server_random:i}};U.handleServerHello=function(r,e,t){var n=U.parseHelloMessage(r,e,t);if(!r.fail){if(n.version.minor<=r.version.minor)r.version.minor=n.version.minor;else return r.error(r,{message:"Incompatible TLS version.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}});r.session.version=r.version;var s=n.session_id.bytes();s.length>0&&s===r.session.id?(r.expect=i3,r.session.resuming=!0,r.session.sp.server_random=n.random.bytes()):(r.expect=CW,r.session.resuming=!1,U.createSecurityParameters(r,n)),r.session.id=s,r.process()}};U.handleClientHello=function(r,e,t){var n=U.parseHelloMessage(r,e,t);if(!r.fail){var s=n.session_id.bytes(),i=null;if(r.sessionCache&&(i=r.sessionCache.getSession(s),i===null?s="":(i.version.major!==n.version.major||i.version.minor>n.version.minor)&&(i=null,s="")),s.length===0&&(s=ke.random.getBytes(32)),r.session.id=s,r.session.clientHelloVersion=n.version,r.session.sp={},i)r.version=r.session.version=i.version,r.session.sp=i.sp;else{for(var a,u=1;u<U.SupportedVersions.length&&(a=U.SupportedVersions[u],!(a.minor<=n.version.minor));++u);r.version={major:a.major,minor:a.minor},r.session.version=r.version}i!==null?(r.expect=Sx,r.session.resuming=!0,r.session.sp.client_random=n.random.bytes()):(r.expect=r.verifyClient!==!1?DW:wx,r.session.resuming=!1,U.createSecurityParameters(r,n)),r.open=!0,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerHello(r)})),r.session.resuming?(U.queue(r,U.createRecord(r,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),r.state.pending=U.createConnectionState(r),r.state.current.write=r.state.pending.write,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createFinished(r)}))):(U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificate(r)})),r.fail||(U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerKeyExchange(r)})),r.verifyClient!==!1&&U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificateRequest(r)})),U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerHelloDone(r)})))),U.flush(r),r.process()}};U.handleCertificate=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_list:$s(n,3)},i,a,u=[];try{for(;s.certificate_list.length()>0;)i=$s(s.certificate_list,3),a=ke.asn1.fromDer(i),i=ke.pki.certificateFromAsn1(a,!0),u.push(i)}catch(f){return r.error(r,{message:"Could not parse certificate list.",cause:f,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate}})}var l=r.entity===U.ConnectionEnd.client;(l||r.verifyClient===!0)&&u.length===0?r.error(r,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}}):u.length===0?r.expect=l?n3:wx:(l?r.session.serverCertificate=u[0]:r.session.clientCertificate=u[0],U.verifyCertificateChain(r,u)&&(r.expect=l?n3:wx)),r.process()};U.handleServerKeyExchange=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unsupported_certificate}});r.expect=bW,r.process()};U.handleClientKeyExchange=function(r,e,t){if(t<48)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unsupported_certificate}});var n=e.fragment,s={enc_pre_master_secret:$s(n,2).getBytes()},i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.serverCertificate),i=ke.pki.privateKeyFromPem(i)}catch(l){r.error(r,{message:"Could not get private key.",cause:l,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}})}if(i===null)return r.error(r,{message:"No private key set.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}});try{var a=r.session.sp;a.pre_master_secret=i.decrypt(s.enc_pre_master_secret);var u=r.session.clientHelloVersion;if(u.major!==a.pre_master_secret.charCodeAt(0)||u.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=ke.random.getBytes(48)}r.expect=Sx,r.session.clientCertificate!==null&&(r.expect=_W),r.process()};U.handleCertificateRequest=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_types:$s(n,1),certificate_authorities:$s(n,2)};r.session.certificateRequest=s,r.expect=xW,r.process()};U.handleCertificateVerify=function(r,e,t){if(t<2)return r.error(r,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i={signature:$s(n,2).getBytes()},a=ke.util.createBuffer();a.putBuffer(r.session.md5.digest()),a.putBuffer(r.session.sha1.digest()),a=a.getBytes();try{var u=r.session.clientCertificate;if(!u.publicKey.verify(a,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");r.session.md5.update(s),r.session.sha1.update(s)}catch{return r.error(r,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.handshake_failure}})}r.expect=Sx,r.process()};U.handleServerHelloDone=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.record_overflow}});if(r.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.insufficient_security}},s=0,i=r.verify(r,n.alert.description,s,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!ke.util.isArray(i)?(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert)):typeof i=="number"&&(n.alert.description=i)),r.error(r,n)}r.session.certificateRequest!==null&&(e=U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificate(r)}),U.queue(r,e)),e=U.createRecord(r,{type:U.ContentType.handshake,data:U.createClientKeyExchange(r)}),U.queue(r,e),r.expect=IW;var a=o(function(u,l){u.session.certificateRequest!==null&&u.session.clientCertificate!==null&&U.queue(u,U.createRecord(u,{type:U.ContentType.handshake,data:U.createCertificateVerify(u,l)})),U.queue(u,U.createRecord(u,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),u.state.pending=U.createConnectionState(u),u.state.current.write=u.state.pending.write,U.queue(u,U.createRecord(u,{type:U.ContentType.handshake,data:U.createFinished(u)})),u.expect=i3,U.flush(u),u.process()},"callback");if(r.session.certificateRequest===null||r.session.clientCertificate===null)return a(r,null);U.getClientSignature(r,a)};U.handleChangeCipherSpec=function(r,e){if(e.fragment.getByte()!==1)return r.error(r,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var t=r.entity===U.ConnectionEnd.client;(r.session.resuming&&t||!r.session.resuming&&!t)&&(r.state.pending=U.createConnectionState(r)),r.state.current.read=r.state.pending.read,(!r.session.resuming&&t||r.session.resuming&&!t)&&(r.state.pending=null),r.expect=t?NW:RW,r.process()};U.handleFinished=function(r,e,t){var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i=e.fragment.getBytes();n=ke.util.createBuffer(),n.putBuffer(r.session.md5.digest()),n.putBuffer(r.session.sha1.digest());var a=r.entity===U.ConnectionEnd.client,u=a?"server finished":"client finished",l=r.session.sp,f=12,h=Jw;if(n=h(l.master_secret,u,n.getBytes(),f),n.getBytes()!==i)return r.error(r,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.decrypt_error}});r.session.md5.update(s),r.session.sha1.update(s),(r.session.resuming&&a||!r.session.resuming&&!a)&&(U.queue(r,U.createRecord(r,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),r.state.current.write=r.state.pending.write,r.state.pending=null,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createFinished(r)}))),r.expect=a?TW:PW,r.handshaking=!1,++r.handshakes,r.peerCertificate=a?r.session.serverCertificate:r.session.clientCertificate,U.flush(r),r.isConnected=!0,r.connected(r),r.process()};U.handleAlert=function(r,e){var t=e.fragment,n={level:t.getByte(),description:t.getByte()},s;switch(n.description){case U.Alert.Description.close_notify:s="Connection closed.";break;case U.Alert.Description.unexpected_message:s="Unexpected message.";break;case U.Alert.Description.bad_record_mac:s="Bad record MAC.";break;case U.Alert.Description.decryption_failed:s="Decryption failed.";break;case U.Alert.Description.record_overflow:s="Record overflow.";break;case U.Alert.Description.decompression_failure:s="Decompression failed.";break;case U.Alert.Description.handshake_failure:s="Handshake failure.";break;case U.Alert.Description.bad_certificate:s="Bad certificate.";break;case U.Alert.Description.unsupported_certificate:s="Unsupported certificate.";break;case U.Alert.Description.certificate_revoked:s="Certificate revoked.";break;case U.Alert.Description.certificate_expired:s="Certificate expired.";break;case U.Alert.Description.certificate_unknown:s="Certificate unknown.";break;case U.Alert.Description.illegal_parameter:s="Illegal parameter.";break;case U.Alert.Description.unknown_ca:s="Unknown certificate authority.";break;case U.Alert.Description.access_denied:s="Access denied.";break;case U.Alert.Description.decode_error:s="Decode error.";break;case U.Alert.Description.decrypt_error:s="Decrypt error.";break;case U.Alert.Description.export_restriction:s="Export restriction.";break;case U.Alert.Description.protocol_version:s="Unsupported protocol version.";break;case U.Alert.Description.insufficient_security:s="Insufficient security.";break;case U.Alert.Description.internal_error:s="Internal error.";break;case U.Alert.Description.user_canceled:s="User canceled.";break;case U.Alert.Description.no_renegotiation:s="Renegotiation not supported.";break;default:s="Unknown error.";break}if(n.description===U.Alert.Description.close_notify)return r.close();r.error(r,{message:s,send:!1,origin:r.entity===U.ConnectionEnd.client?"server":"client",alert:n}),r.process()};U.handleHandshake=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt24();if(s>t.length())return r.fragmented=e,e.fragment=ke.util.createBuffer(),t.read-=4,r.process();r.fragmented=null,t.read-=4;var i=t.bytes(s+4);t.read+=4,n in Ww[r.entity][r.expect]?(r.entity===U.ConnectionEnd.server&&!r.open&&!r.fail&&(r.handshaking=!0,r.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:ke.md.md5.create(),sha1:ke.md.sha1.create()}),n!==U.HandshakeType.hello_request&&n!==U.HandshakeType.certificate_verify&&n!==U.HandshakeType.finished&&(r.session.md5.update(i),r.session.sha1.update(i)),Ww[r.entity][r.expect][n](r,e,s)):U.handleUnexpected(r,e)};U.handleApplicationData=function(r,e){r.data.putBuffer(e.fragment),r.dataReady(r),r.process()};U.handleHeartbeat=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt16(),i=t.getBytes(s);if(n===U.HeartbeatMessageType.heartbeat_request){if(r.handshaking||s>i.length)return r.process();U.queue(r,U.createRecord(r,{type:U.ContentType.heartbeat,data:U.createHeartbeat(U.HeartbeatMessageType.heartbeat_response,i)})),U.flush(r)}else if(n===U.HeartbeatMessageType.heartbeat_response){if(i!==r.expectedHeartbeatPayload)return r.process();r.heartbeatReceived&&r.heartbeatReceived(r,ke.util.createBuffer(i))}r.process()};var AW=0,CW=1,n3=2,bW=3,xW=4,i3=5,NW=6,TW=7,IW=8,BW=0,DW=1,wx=2,_W=3,Sx=4,RW=5,PW=6,V=U.handleUnexpected,a3=U.handleChangeCipherSpec,On=U.handleAlert,cs=U.handleHandshake,o3=U.handleApplicationData,kn=U.handleHeartbeat,Ex=[];Ex[U.ConnectionEnd.client]=[[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[a3,On,V,V,kn],[V,On,cs,V,kn],[V,On,cs,o3,kn],[V,On,cs,V,kn]];Ex[U.ConnectionEnd.server]=[[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[V,On,cs,V,kn],[a3,On,V,V,kn],[V,On,cs,V,kn],[V,On,cs,o3,kn],[V,On,cs,V,kn]];var bu=U.handleHelloRequest,OW=U.handleServerHello,u3=U.handleCertificate,s3=U.handleServerKeyExchange,yx=U.handleCertificateRequest,Xw=U.handleServerHelloDone,l3=U.handleFinished,Ww=[];Ww[U.ConnectionEnd.client]=[[V,V,OW,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,u3,s3,yx,Xw,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,s3,yx,Xw,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,yx,Xw,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,Xw,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,l3],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[bu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V]];var kW=U.handleClientHello,LW=U.handleClientKeyExchange,VW=U.handleCertificateVerify;Ww[U.ConnectionEnd.server]=[[V,kW,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,u3,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,LW,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,VW,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,l3],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V]];U.generateKeys=function(r,e){var t=Jw,n=e.client_random+e.server_random;r.session.resuming||(e.master_secret=t(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var s=2*e.mac_key_length+2*e.enc_key_length,i=r.version.major===U.Versions.TLS_1_0.major&&r.version.minor===U.Versions.TLS_1_0.minor;i&&(s+=2*e.fixed_iv_length);var a=t(e.master_secret,"key expansion",n,s),u={client_write_MAC_key:a.getBytes(e.mac_key_length),server_write_MAC_key:a.getBytes(e.mac_key_length),client_write_key:a.getBytes(e.enc_key_length),server_write_key:a.getBytes(e.enc_key_length)};return i&&(u.client_write_IV=a.getBytes(e.fixed_iv_length),u.server_write_IV=a.getBytes(e.fixed_iv_length)),u};U.createConnectionState=function(r){var e=r.entity===U.ConnectionEnd.client,t=o(function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:o(function(a){return!0},"cipherFunction"),compressionState:null,compressFunction:o(function(a){return!0},"compressFunction"),updateSequenceNumber:o(function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]},"updateSequenceNumber")};return i},"createMode"),n={read:t(),write:t()};if(n.read.update=function(i,a){return n.read.cipherFunction(a,n.read)?n.read.compressFunction(i,a,n.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_record_mac}}),!i.fail},n.write.update=function(i,a){return n.write.compressFunction(i,a,n.write)?n.write.cipherFunction(a,n.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}),!i.fail},r.session){var s=r.session.sp;switch(r.session.cipherSuite.initSecurityParameters(s),s.keys=U.generateKeys(r,s),n.read.macKey=e?s.keys.server_write_MAC_key:s.keys.client_write_MAC_key,n.write.macKey=e?s.keys.client_write_MAC_key:s.keys.server_write_MAC_key,r.session.cipherSuite.initConnectionState(n,r,s),s.compression_algorithm){case U.CompressionMethod.none:break;case U.CompressionMethod.deflate:n.read.compressFunction=EW,n.write.compressFunction=SW;break;default:throw new Error("Unsupported compression algorithm.")}}return n};U.createRandom=function(){var r=new Date,e=+r+r.getTimezoneOffset()*6e4,t=ke.util.createBuffer();return t.putInt32(e),t.putBytes(ke.random.getBytes(28)),t};U.createRecord=function(r,e){if(!e.data)return null;var t={type:e.type,version:{major:r.version.major,minor:r.version.minor},length:e.data.length(),fragment:e.data};return t};U.createAlert=function(r,e){var t=ke.util.createBuffer();return t.putByte(e.level),t.putByte(e.description),U.createRecord(r,{type:U.ContentType.alert,data:t})};U.createClientHello=function(r){r.session.clientHelloVersion={major:r.version.major,minor:r.version.minor};for(var e=ke.util.createBuffer(),t=0;t<r.cipherSuites.length;++t){var n=r.cipherSuites[t];e.putByte(n.id[0]),e.putByte(n.id[1])}var s=e.length(),i=ke.util.createBuffer();i.putByte(U.CompressionMethod.none);var a=i.length(),u=ke.util.createBuffer();if(r.virtualHost){var l=ke.util.createBuffer();l.putByte(0),l.putByte(0);var f=ke.util.createBuffer();f.putByte(0),di(f,2,ke.util.createBuffer(r.virtualHost));var h=ke.util.createBuffer();di(h,2,f),di(l,2,h),u.putBuffer(l)}var m=u.length();m>0&&(m+=2);var g=r.session.id,w=g.length+1+2+4+28+2+s+1+a+m,y=ke.util.createBuffer();return y.putByte(U.HandshakeType.client_hello),y.putInt24(w),y.putByte(r.version.major),y.putByte(r.version.minor),y.putBytes(r.session.sp.client_random),di(y,1,ke.util.createBuffer(g)),di(y,2,e),di(y,1,i),m>0&&di(y,2,u),y};U.createServerHello=function(r){var e=r.session.id,t=e.length+1+2+4+28+2+1,n=ke.util.createBuffer();return n.putByte(U.HandshakeType.server_hello),n.putInt24(t),n.putByte(r.version.major),n.putByte(r.version.minor),n.putBytes(r.session.sp.server_random),di(n,1,ke.util.createBuffer(e)),n.putByte(r.session.cipherSuite.id[0]),n.putByte(r.session.cipherSuite.id[1]),n.putByte(r.session.compressionMethod),n};U.createCertificate=function(r){var e=r.entity===U.ConnectionEnd.client,t=null;if(r.getCertificate){var n;e?n=r.session.certificateRequest:n=r.session.extensions.server_name.serverNameList,t=r.getCertificate(r,n)}var s=ke.util.createBuffer();if(t!==null)try{ke.util.isArray(t)||(t=[t]);for(var i=null,a=0;a<t.length;++a){var u=ke.pem.decode(t[a])[0];if(u.type!=="CERTIFICATE"&&u.type!=="X509 CERTIFICATE"&&u.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=u.type,l}if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var f=ke.util.createBuffer(u.body);i===null&&(i=ke.asn1.fromDer(f.bytes(),!1));var h=ke.util.createBuffer();di(h,3,f),s.putBuffer(h)}t=ke.pki.certificateFromAsn1(i),e?r.session.clientCertificate=t:r.session.serverCertificate=t}catch(w){return r.error(r,{message:"Could not send certificate list.",cause:w,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate}})}var m=3+s.length(),g=ke.util.createBuffer();return g.putByte(U.HandshakeType.certificate),g.putInt24(m),di(g,3,s),g};U.createClientKeyExchange=function(r){var e=ke.util.createBuffer();e.putByte(r.session.clientHelloVersion.major),e.putByte(r.session.clientHelloVersion.minor),e.putBytes(ke.random.getBytes(46));var t=r.session.sp;t.pre_master_secret=e.getBytes();var n=r.session.serverCertificate.publicKey;e=n.encrypt(t.pre_master_secret);var s=e.length+2,i=ke.util.createBuffer();return i.putByte(U.HandshakeType.client_key_exchange),i.putInt24(s),i.putInt16(e.length),i.putBytes(e),i};U.createServerKeyExchange=function(r){var e=0,t=ke.util.createBuffer();return e>0&&(t.putByte(U.HandshakeType.server_key_exchange),t.putInt24(e)),t};U.getClientSignature=function(r,e){var t=ke.util.createBuffer();t.putBuffer(r.session.md5.digest()),t.putBuffer(r.session.sha1.digest()),t=t.getBytes(),r.getSignature=r.getSignature||function(n,s,i){var a=null;if(n.getPrivateKey)try{a=n.getPrivateKey(n,n.session.clientCertificate),a=ke.pki.privateKeyFromPem(a)}catch(u){n.error(n,{message:"Could not get private key.",cause:u,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}})}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}):s=a.sign(s,null),i(n,s)},r.getSignature(r,t,e)};U.createCertificateVerify=function(r,e){var t=e.length+2,n=ke.util.createBuffer();return n.putByte(U.HandshakeType.certificate_verify),n.putInt24(t),n.putInt16(e.length),n.putBytes(e),n};U.createCertificateRequest=function(r){var e=ke.util.createBuffer();e.putByte(1);var t=ke.util.createBuffer();for(var n in r.caStore.certs){var s=r.caStore.certs[n],i=ke.pki.distinguishedNameToAsn1(s.subject),a=ke.asn1.toDer(i);t.putInt16(a.length()),t.putBuffer(a)}var u=1+e.length()+2+t.length(),l=ke.util.createBuffer();return l.putByte(U.HandshakeType.certificate_request),l.putInt24(u),di(l,1,e),di(l,2,t),l};U.createServerHelloDone=function(r){var e=ke.util.createBuffer();return e.putByte(U.HandshakeType.server_hello_done),e.putInt24(0),e};U.createChangeCipherSpec=function(){var r=ke.util.createBuffer();return r.putByte(1),r};U.createFinished=function(r){var e=ke.util.createBuffer();e.putBuffer(r.session.md5.digest()),e.putBuffer(r.session.sha1.digest());var t=r.entity===U.ConnectionEnd.client,n=r.session.sp,s=12,i=Jw,a=t?"client finished":"server finished";e=i(n.master_secret,a,e.getBytes(),s);var u=ke.util.createBuffer();return u.putByte(U.HandshakeType.finished),u.putInt24(e.length()),u.putBuffer(e),u};U.createHeartbeat=function(r,e,t){typeof t>"u"&&(t=e.length);var n=ke.util.createBuffer();n.putByte(r),n.putInt16(t),n.putBytes(e);var s=n.length(),i=Math.max(16,s-t-3);return n.putBytes(ke.random.getBytes(i)),n};U.queue=function(r,e){if(e&&!(e.fragment.length()===0&&(e.type===U.ContentType.handshake||e.type===U.ContentType.alert||e.type===U.ContentType.change_cipher_spec))){if(e.type===U.ContentType.handshake){var t=e.fragment.bytes();r.session.md5.update(t),r.session.sha1.update(t),t=null}var n;if(e.fragment.length()<=U.MaxFragment)n=[e];else{n=[];for(var s=e.fragment.bytes();s.length>U.MaxFragment;)n.push(U.createRecord(r,{type:e.type,data:ke.util.createBuffer(s.slice(0,U.MaxFragment))})),s=s.slice(U.MaxFragment);s.length>0&&n.push(U.createRecord(r,{type:e.type,data:ke.util.createBuffer(s)}))}for(var i=0;i<n.length&&!r.fail;++i){var a=n[i],u=r.state.current.write;u.update(r,a)&&r.records.push(a)}}};U.flush=function(r){for(var e=0;e<r.records.length;++e){var t=r.records[e];r.tlsData.putByte(t.type),r.tlsData.putByte(t.version.major),r.tlsData.putByte(t.version.minor),r.tlsData.putInt16(t.fragment.length()),r.tlsData.putBuffer(r.records[e].fragment)}return r.records=[],r.tlsDataReady(r)};var vx=o(function(r){switch(r){case!0:return!0;case ke.pki.certificateError.bad_certificate:return U.Alert.Description.bad_certificate;case ke.pki.certificateError.unsupported_certificate:return U.Alert.Description.unsupported_certificate;case ke.pki.certificateError.certificate_revoked:return U.Alert.Description.certificate_revoked;case ke.pki.certificateError.certificate_expired:return U.Alert.Description.certificate_expired;case ke.pki.certificateError.certificate_unknown:return U.Alert.Description.certificate_unknown;case ke.pki.certificateError.unknown_ca:return U.Alert.Description.unknown_ca;default:return U.Alert.Description.bad_certificate}},"_certErrorToAlertDesc"),UW=o(function(r){switch(r){case!0:return!0;case U.Alert.Description.bad_certificate:return ke.pki.certificateError.bad_certificate;case U.Alert.Description.unsupported_certificate:return ke.pki.certificateError.unsupported_certificate;case U.Alert.Description.certificate_revoked:return ke.pki.certificateError.certificate_revoked;case U.Alert.Description.certificate_expired:return ke.pki.certificateError.certificate_expired;case U.Alert.Description.certificate_unknown:return ke.pki.certificateError.certificate_unknown;case U.Alert.Description.unknown_ca:return ke.pki.certificateError.unknown_ca;default:return ke.pki.certificateError.bad_certificate}},"_alertDescToCertError");U.verifyCertificateChain=function(r,e){try{var t={};for(var n in r.verifyOptions)t[n]=r.verifyOptions[n];t.verify=function(i,a,u){var l=vx(i),f=r.verify(r,i,a,u);if(f!==!0){if(typeof f=="object"&&!ke.util.isArray(f)){var h=new Error("The application rejected the certificate.");throw h.send=!0,h.alert={level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate},f.message&&(h.message=f.message),f.alert&&(h.alert.description=f.alert),h}f!==i&&(f=UW(f))}return f},ke.pki.verifyCertificateChain(r.caStore,e,t)}catch(i){var s=i;(typeof s!="object"||ke.util.isArray(s))&&(s={send:!0,alert:{level:U.Alert.Level.fatal,description:vx(i)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:U.Alert.Level.fatal,description:vx(s.error)}),r.error(r,s)}return!r.fail};U.createSessionCache=function(r,e){var t=null;if(r&&r.getSession&&r.setSession&&r.order)t=r;else{t={},t.cache=r||{},t.capacity=Math.max(e||100,1),t.order=[];for(var n in r)t.order.length<=e?t.order.push(n):delete r[n];t.getSession=function(s){var i=null,a=null;if(s?a=ke.util.bytesToHex(s):t.order.length>0&&(a=t.order[0]),a!==null&&a in t.cache){i=t.cache[a],delete t.cache[a];for(var u in t.order)if(t.order[u]===a){t.order.splice(u,1);break}}return i},t.setSession=function(s,i){if(t.order.length===t.capacity){var a=t.order.shift();delete t.cache[a]}var a=ke.util.bytesToHex(s);t.order.push(a),t.cache[a]=i}}return t};U.createConnection=function(r){var e=null;r.caStore?ke.util.isArray(r.caStore)?e=ke.pki.createCaStore(r.caStore):e=r.caStore:e=ke.pki.createCaStore();var t=r.cipherSuites||null;if(t===null){t=[];for(var n in U.CipherSuites)t.push(U.CipherSuites[n])}var s=r.server?U.ConnectionEnd.server:U.ConnectionEnd.client,i=r.sessionCache?U.createSessionCache(r.sessionCache):null,a={version:{major:U.Version.major,minor:U.Version.minor},entity:s,sessionId:r.sessionId,caStore:e,sessionCache:i,cipherSuites:t,connected:r.connected,virtualHost:r.virtualHost||null,verifyClient:r.verifyClient||!1,verify:r.verify||function(h,m,g,w){return m},verifyOptions:r.verifyOptions||{},getCertificate:r.getCertificate||null,getPrivateKey:r.getPrivateKey||null,getSignature:r.getSignature||null,input:ke.util.createBuffer(),tlsData:ke.util.createBuffer(),data:ke.util.createBuffer(),tlsDataReady:r.tlsDataReady,dataReady:r.dataReady,heartbeatReceived:r.heartbeatReceived,closed:r.closed,error:o(function(h,m){m.origin=m.origin||(h.entity===U.ConnectionEnd.client?"client":"server"),m.send&&(U.queue(h,U.createAlert(h,m.alert)),U.flush(h));var g=m.fatal!==!1;g&&(h.fail=!0),r.error(h,m),g&&h.close(!1)},"error"),deflate:r.deflate||null,inflate:r.inflate||null};a.reset=function(h){a.version={major:U.Version.major,minor:U.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===U.ConnectionEnd.client?AW:BW,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(h||typeof h>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=U.createConnectionState(a)},a.reset();var u=o(function(h,m){var g=m.type-U.ContentType.change_cipher_spec,w=Ex[h.entity][h.expect];g in w?w[g](h,m):U.handleUnexpected(h,m)},"_update"),l=o(function(h){var m=0,g=h.input,w=g.length();if(w<5)m=5-w;else{h.record={type:g.getByte(),version:{major:g.getByte(),minor:g.getByte()},length:g.getInt16(),fragment:ke.util.createBuffer(),ready:!1};var y=h.record.version.major===h.version.major;y&&h.session&&h.session.version&&(y=h.record.version.minor===h.version.minor),y||h.error(h,{message:"Incompatible TLS version.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}})}return m},"_readRecordHeader"),f=o(function(h){var m=0,g=h.input,w=g.length();if(w<h.record.length)m=h.record.length-w;else{h.record.fragment.putBytes(g.getBytes(h.record.length)),g.compact();var y=h.state.current.read;y.update(h,h.record)&&(h.fragmented!==null&&(h.fragmented.type===h.record.type?(h.fragmented.fragment.putBuffer(h.record.fragment),h.record=h.fragmented):h.error(h,{message:"Invalid fragmented record.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unexpected_message}})),h.record.ready=!0)}return m},"_readRecord");return a.handshake=function(h){if(a.entity!==U.ConnectionEnd.client)a.error(a,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(a.handshaking)a.error(a,{message:"Handshake already in progress.",fatal:!1});else{a.fail&&!a.open&&a.handshakes===0&&(a.fail=!1),a.handshaking=!0,h=h||"";var m=null;h.length>0&&(a.sessionCache&&(m=a.sessionCache.getSession(h)),m===null&&(h="")),h.length===0&&a.sessionCache&&(m=a.sessionCache.getSession(),m!==null&&(h=m.id)),a.session={id:h,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ke.md.md5.create(),sha1:ke.md.sha1.create()},m&&(a.version=m.version,a.session.sp=m.sp),a.session.sp.client_random=U.createRandom().getBytes(),a.open=!0,U.queue(a,U.createRecord(a,{type:U.ContentType.handshake,data:U.createClientHello(a)})),U.flush(a)}},a.process=function(h){var m=0;return h&&a.input.putBytes(h),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(m=l(a)),!a.fail&&a.record!==null&&!a.record.ready&&(m=f(a)),!a.fail&&a.record!==null&&a.record.ready&&u(a,a.record)),m},a.prepare=function(h){return U.queue(a,U.createRecord(a,{type:U.ContentType.application_data,data:ke.util.createBuffer(h)})),U.flush(a)},a.prepareHeartbeatRequest=function(h,m){return h instanceof ke.util.ByteBuffer&&(h=h.bytes()),typeof m>"u"&&(m=h.length),a.expectedHeartbeatPayload=h,U.queue(a,U.createRecord(a,{type:U.ContentType.heartbeat,data:U.createHeartbeat(U.HeartbeatMessageType.heartbeat_request,h,m)})),U.flush(a)},a.close=function(h){if(!a.fail&&a.sessionCache&&a.session){var m={id:a.session.id,version:a.session.version,sp:a.session.sp};m.sp.keys=null,a.sessionCache.setSession(m.id,m)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,U.queue(a,U.createAlert(a,{level:U.Alert.Level.warning,description:U.Alert.Description.close_notify})),U.flush(a)),a.closed(a)),a.reset(h)},a};c3.exports=ke.tls=ke.tls||{};for(Gw in U)typeof U[Gw]!="function"&&(ke.tls[Gw]=U[Gw]);var Gw;ke.tls.prf_tls1=Jw;ke.tls.hmac_sha1=wW;ke.tls.createSessionCache=U.createSessionCache;ke.tls.createConnection=U.createConnection});var p3=ye((Hce,h3)=>{"use strict";var xu=$t();vu();Ax();var mi=h3.exports=xu.tls;mi.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:o(function(r){r.bulk_cipher_algorithm=mi.BulkCipherAlgorithm.aes,r.cipher_type=mi.CipherType.block,r.enc_key_length=16,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=mi.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:f3};mi.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:o(function(r){r.bulk_cipher_algorithm=mi.BulkCipherAlgorithm.aes,r.cipher_type=mi.CipherType.block,r.enc_key_length=32,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=mi.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:f3};function f3(r,e,t){var n=e.entity===xu.tls.ConnectionEnd.client;r.read.cipherState={init:!1,cipher:xu.cipher.createDecipher("AES-CBC",n?t.keys.server_write_key:t.keys.client_write_key),iv:n?t.keys.server_write_IV:t.keys.client_write_IV},r.write.cipherState={init:!1,cipher:xu.cipher.createCipher("AES-CBC",n?t.keys.client_write_key:t.keys.server_write_key),iv:n?t.keys.client_write_IV:t.keys.server_write_IV},r.read.cipherFunction=qW,r.write.cipherFunction=MW,r.read.macLength=r.write.macLength=t.mac_length,r.read.macFunction=r.write.macFunction=mi.hmac_sha1}o(f3,"initConnectionState");function MW(r,e){var t=!1,n=e.macFunction(e.macKey,e.sequenceNumber,r);r.fragment.putBytes(n),e.updateSequenceNumber();var s;r.version.minor===mi.Versions.TLS_1_0.minor?s=e.cipherState.init?null:e.cipherState.iv:s=xu.random.getBytesSync(16),e.cipherState.init=!0;var i=e.cipherState.cipher;return i.start({iv:s}),r.version.minor>=mi.Versions.TLS_1_1.minor&&i.output.putBytes(s),i.update(r.fragment),i.finish(jW)&&(r.fragment=i.output,r.length=r.fragment.length(),t=!0),t}o(MW,"encrypt_aes_cbc_sha1");function jW(r,e,t){if(!t){var n=r-e.length()%r;e.fillWithByte(n-1,n)}return!0}o(jW,"encrypt_aes_cbc_sha1_padding");function FW(r,e,t){var n=!0;if(t){for(var s=e.length(),i=e.last(),a=s-1-i;a<s-1;++a)n=n&&e.at(a)==i;n&&e.truncate(i+1)}return n}o(FW,"decrypt_aes_cbc_sha1_padding");function qW(r,e){var t=!1,n;r.version.minor===mi.Versions.TLS_1_0.minor?n=e.cipherState.init?null:e.cipherState.iv:n=r.fragment.getBytes(16),e.cipherState.init=!0;var s=e.cipherState.cipher;s.start({iv:n}),s.update(r.fragment),t=s.finish(FW);var i=e.macLength,a=xu.random.getBytesSync(i),u=s.output.length();u>=i?(r.fragment=s.output.getBytes(u-i),a=s.output.getBytes(i)):r.fragment=s.output.getBytes(),r.fragment=xu.util.createBuffer(r.fragment),r.length=r.fragment.length();var l=e.macFunction(e.macKey,e.sequenceNumber,r);return e.updateSequenceNumber(),t=HW(e.macKey,a,l)&&t,t}o(qW,"decrypt_aes_cbc_sha1");function HW(r,e,t){var n=xu.hmac.create();return n.start("SHA1",r),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(t),t=n.digest().getBytes(),e===t}o(HW,"compareMacs")});var xx=ye(($ce,y3)=>{"use strict";var Vr=$t();da();ur();var Nm=y3.exports=Vr.sha512=Vr.sha512||{};Vr.md.sha512=Vr.md.algorithms.sha512=Nm;var m3=Vr.sha384=Vr.sha512.sha384=Vr.sha512.sha384||{};m3.create=function(){return Nm.create("SHA-384")};Vr.md.sha384=Vr.md.algorithms.sha384=m3;Vr.sha512.sha256=Vr.sha512.sha256||{create:o(function(){return Nm.create("SHA-512/256")},"create")};Vr.md["sha512/256"]=Vr.md.algorithms["sha512/256"]=Vr.sha512.sha256;Vr.sha512.sha224=Vr.sha512.sha224||{create:o(function(){return Nm.create("SHA-512/224")},"create")};Vr.md["sha512/224"]=Vr.md.algorithms["sha512/224"]=Vr.sha512.sha224;Nm.create=function(r){if(g3||KW(),typeof r>"u"&&(r="SHA-512"),!(r in vc))throw new Error("Invalid SHA-512 algorithm: "+r);for(var e=vc[r],t=null,n=Vr.util.createBuffer(),s=new Array(80),i=0;i<80;++i)s[i]=new Array(2);var a=64;switch(r){case"SHA-384":a=48;break;case"SHA-512/256":a=32;break;case"SHA-512/224":a=28;break}var u={algorithm:r.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return u.start=function(){u.messageLength=0,u.fullMessageLength=u.messageLength128=[];for(var l=u.messageLengthSize/4,f=0;f<l;++f)u.fullMessageLength.push(0);n=Vr.util.createBuffer(),t=new Array(e.length);for(var f=0;f<e.length;++f)t[f]=e[f].slice(0);return u},u.start(),u.update=function(l,f){f==="utf8"&&(l=Vr.util.encodeUtf8(l));var h=l.length;u.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var m=u.fullMessageLength.length-1;m>=0;--m)u.fullMessageLength[m]+=h[1],h[1]=h[0]+(u.fullMessageLength[m]/4294967296>>>0),u.fullMessageLength[m]=u.fullMessageLength[m]>>>0,h[0]=h[1]/4294967296>>>0;return n.putBytes(l),d3(t,s,n),(n.read>2048||n.length()===0)&&n.compact(),u},u.digest=function(){var l=Vr.util.createBuffer();l.putBytes(n.bytes());var f=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize,h=f&u.blockLength-1;l.putBytes(Cx.substr(0,u.blockLength-h));for(var m,g,w=u.fullMessageLength[0]*8,y=0;y<u.fullMessageLength.length-1;++y)m=u.fullMessageLength[y+1]*8,g=m/4294967296>>>0,w+=g,l.putInt32(w>>>0),w=m>>>0;l.putInt32(w);for(var S=new Array(t.length),y=0;y<t.length;++y)S[y]=t[y].slice(0);d3(S,s,l);var E=Vr.util.createBuffer(),b;r==="SHA-512"?b=S.length:r==="SHA-384"?b=S.length-2:b=S.length-4;for(var y=0;y<b;++y)E.putInt32(S[y][0]),(y!==b-1||r!=="SHA-512/224")&&E.putInt32(S[y][1]);return E},u};var Cx=null,g3=!1,bx=null,vc=null;function KW(){Cx="\x80",Cx+=Vr.util.fillString("\0",128),bx=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],vc={},vc["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],vc["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],vc["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],vc["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],g3=!0}o(KW,"_init");function d3(r,e,t){for(var n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R,H,q,K,G,he,le,oe,Z,fe,Se,Ke,be,we,Me=t.length();Me>=128;){for(oe=0;oe<16;++oe)e[oe][0]=t.getInt32()>>>0,e[oe][1]=t.getInt32()>>>0;for(;oe<80;++oe)Se=e[oe-2],Z=Se[0],fe=Se[1],n=((Z>>>19|fe<<13)^(fe>>>29|Z<<3)^Z>>>6)>>>0,s=((Z<<13|fe>>>19)^(fe<<3|Z>>>29)^(Z<<26|fe>>>6))>>>0,be=e[oe-15],Z=be[0],fe=be[1],i=((Z>>>1|fe<<31)^(Z>>>8|fe<<24)^Z>>>7)>>>0,a=((Z<<31|fe>>>1)^(Z<<24|fe>>>8)^(Z<<25|fe>>>7))>>>0,Ke=e[oe-7],we=e[oe-16],fe=s+Ke[1]+a+we[1],e[oe][0]=n+Ke[0]+i+we[0]+(fe/4294967296>>>0)>>>0,e[oe][1]=fe>>>0;for(S=r[0][0],E=r[0][1],b=r[1][0],T=r[1][1],A=r[2][0],C=r[2][1],x=r[3][0],B=r[3][1],F=r[4][0],R=r[4][1],H=r[5][0],q=r[5][1],K=r[6][0],G=r[6][1],he=r[7][0],le=r[7][1],oe=0;oe<80;++oe)f=((F>>>14|R<<18)^(F>>>18|R<<14)^(R>>>9|F<<23))>>>0,h=((F<<18|R>>>14)^(F<<14|R>>>18)^(R<<23|F>>>9))>>>0,m=(K^F&(H^K))>>>0,g=(G^R&(q^G))>>>0,u=((S>>>28|E<<4)^(E>>>2|S<<30)^(E>>>7|S<<25))>>>0,l=((S<<4|E>>>28)^(E<<30|S>>>2)^(E<<25|S>>>7))>>>0,w=(S&b|A&(S^b))>>>0,y=(E&T|C&(E^T))>>>0,fe=le+h+g+bx[oe][1]+e[oe][1],n=he+f+m+bx[oe][0]+e[oe][0]+(fe/4294967296>>>0)>>>0,s=fe>>>0,fe=l+y,i=u+w+(fe/4294967296>>>0)>>>0,a=fe>>>0,he=K,le=G,K=H,G=q,H=F,q=R,fe=B+s,F=x+n+(fe/4294967296>>>0)>>>0,R=fe>>>0,x=A,B=C,A=b,C=T,b=S,T=E,fe=s+a,S=n+i+(fe/4294967296>>>0)>>>0,E=fe>>>0;fe=r[0][1]+E,r[0][0]=r[0][0]+S+(fe/4294967296>>>0)>>>0,r[0][1]=fe>>>0,fe=r[1][1]+T,r[1][0]=r[1][0]+b+(fe/4294967296>>>0)>>>0,r[1][1]=fe>>>0,fe=r[2][1]+C,r[2][0]=r[2][0]+A+(fe/4294967296>>>0)>>>0,r[2][1]=fe>>>0,fe=r[3][1]+B,r[3][0]=r[3][0]+x+(fe/4294967296>>>0)>>>0,r[3][1]=fe>>>0,fe=r[4][1]+R,r[4][0]=r[4][0]+F+(fe/4294967296>>>0)>>>0,r[4][1]=fe>>>0,fe=r[5][1]+q,r[5][0]=r[5][0]+H+(fe/4294967296>>>0)>>>0,r[5][1]=fe>>>0,fe=r[6][1]+G,r[6][0]=r[6][0]+K+(fe/4294967296>>>0)>>>0,r[6][1]=fe>>>0,fe=r[7][1]+le,r[7][0]=r[7][0]+he+(fe/4294967296>>>0)>>>0,r[7][1]=fe>>>0,Me-=128}}o(d3,"_update")});var v3=ye(Nx=>{"use strict";var $W=$t();Fi();var xn=$W.asn1;Nx.privateKeyValidator={name:"PrivateKeyInfo",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:xn.Class.UNIVERSAL,type:xn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:xn.Class.UNIVERSAL,type:xn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:xn.Class.UNIVERSAL,type:xn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Nx.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:xn.Class.UNIVERSAL,type:xn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:xn.Class.UNIVERSAL,type:xn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:xn.Class.UNIVERSAL,type:xn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var _3=ye((Wce,D3)=>{"use strict";var Ln=$t();Am();ci();xx();ur();var b3=v3(),XW=b3.publicKeyValidator,GW=b3.privateKeyValidator;typeof w3>"u"&&(w3=Ln.jsbn.BigInteger);var w3,Bx=Ln.util.ByteBuffer,As=typeof Buffer>"u"?Uint8Array:Buffer;Ln.pki=Ln.pki||{};D3.exports=Ln.pki.ed25519=Ln.ed25519=Ln.ed25519||{};var Qt=Ln.ed25519;Qt.constants={};Qt.constants.PUBLIC_KEY_BYTE_LENGTH=32;Qt.constants.PRIVATE_KEY_BYTE_LENGTH=64;Qt.constants.SEED_BYTE_LENGTH=32;Qt.constants.SIGN_BYTE_LENGTH=64;Qt.constants.HASH_BYTE_LENGTH=64;Qt.generateKeyPair=function(r){r=r||{};var e=r.seed;if(e===void 0)e=Ln.random.getBytesSync(Qt.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Qt.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Qt.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=mo({message:e,encoding:"binary"});for(var t=new As(Qt.constants.PUBLIC_KEY_BYTE_LENGTH),n=new As(Qt.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=e[s];return YW(t,n),{publicKey:t,privateKey:n}};Qt.privateKeyFromAsn1=function(r){var e={},t=[],n=Ln.asn1.validate(r,GW,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=Ln.asn1.derToOid(e.privateKeyOid),a=Ln.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var u=e.privateKey,l=mo({message:Ln.asn1.fromDer(u).value,encoding:"binary"});return{privateKeyBytes:l}};Qt.publicKeyFromAsn1=function(r){var e={},t=[],n=Ln.asn1.validate(r,XW,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=Ln.asn1.derToOid(e.publicKeyOid),a=Ln.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var u=e.ed25519PublicKey;if(u.length!==Qt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return mo({message:u,encoding:"binary"})};Qt.publicKeyFromPrivateKey=function(r){r=r||{};var e=mo({message:r.privateKey,encoding:"binary"});if(e.length!==Qt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Qt.constants.PRIVATE_KEY_BYTE_LENGTH);for(var t=new As(Qt.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<t.length;++n)t[n]=e[32+n];return t};Qt.sign=function(r){r=r||{};var e=mo(r),t=mo({message:r.privateKey,encoding:"binary"});if(t.length===Qt.constants.SEED_BYTE_LENGTH){var n=Qt.generateKeyPair({seed:t});t=n.privateKey}else if(t.length!==Qt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Qt.constants.SEED_BYTE_LENGTH+" or "+Qt.constants.PRIVATE_KEY_BYTE_LENGTH);var s=new As(Qt.constants.SIGN_BYTE_LENGTH+e.length);QW(s,e,e.length,t);for(var i=new As(Qt.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=s[a];return i};Qt.verify=function(r){r=r||{};var e=mo(r);if(r.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var t=mo({message:r.signature,encoding:"binary"});if(t.length!==Qt.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Qt.constants.SIGN_BYTE_LENGTH);var n=mo({message:r.publicKey,encoding:"binary"});if(n.length!==Qt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Qt.constants.PUBLIC_KEY_BYTE_LENGTH);var s=new As(Qt.constants.SIGN_BYTE_LENGTH+e.length),i=new As(Qt.constants.SIGN_BYTE_LENGTH+e.length),a;for(a=0;a<Qt.constants.SIGN_BYTE_LENGTH;++a)s[a]=t[a];for(a=0;a<e.length;++a)s[a+Qt.constants.SIGN_BYTE_LENGTH]=e[a];return ZW(i,s,s.length,n)>=0};function mo(r){var e=r.message;if(e instanceof Uint8Array||e instanceof As)return e;var t=r.encoding;if(e===void 0)if(r.md)e=r.md.digest().getBytes(),t="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!t)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,t);e=new Bx(e,t)}else if(!(e instanceof Bx))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new As(e.length()),s=0;s<n.length;++s)n[s]=e.at(s);return n}o(mo,"messageToNativeBuffer");var Dx=Nt(),zw=Nt([1]),WW=Nt([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),JW=Nt([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),S3=Nt([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E3=Nt([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Tx=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),zW=Nt([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Tm(r,e){var t=Ln.md.sha512.create(),n=new Bx(r);t.update(n.getBytes(e),"binary");var s=t.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(s,"binary");for(var i=new As(Qt.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)i[a]=s.charCodeAt(a);return i}o(Tm,"sha512");function YW(r,e){var t=[Nt(),Nt(),Nt(),Nt()],n,s=Tm(e,32);for(s[0]&=248,s[31]&=127,s[31]|=64,Ox(t,s),Px(r,t),n=0;n<32;++n)e[n+32]=r[n];return 0}o(YW,"crypto_sign_keypair");function QW(r,e,t,n){var s,i,a=new Float64Array(64),u=[Nt(),Nt(),Nt(),Nt()],l=Tm(n,32);l[0]&=248,l[31]&=127,l[31]|=64;var f=t+64;for(s=0;s<t;++s)r[64+s]=e[s];for(s=0;s<32;++s)r[32+s]=l[32+s];var h=Tm(r.subarray(32),t+32);for(_x(h),Ox(u,h),Px(r,u),s=32;s<64;++s)r[s]=n[s];var m=Tm(r,t+64);for(_x(m),s=32;s<64;++s)a[s]=0;for(s=0;s<32;++s)a[s]=h[s];for(s=0;s<32;++s)for(i=0;i<32;i++)a[s+i]+=m[s]*l[i];return x3(r.subarray(32),a),f}o(QW,"crypto_sign");function ZW(r,e,t,n){var s,i,a=new As(32),u=[Nt(),Nt(),Nt(),Nt()],l=[Nt(),Nt(),Nt(),Nt()];if(i=-1,t<64||eJ(l,n))return-1;for(s=0;s<t;++s)r[s]=e[s];for(s=0;s<32;++s)r[s+32]=n[s];var f=Tm(r,t);if(_x(f),I3(u,l,f),Ox(l,e.subarray(32)),Rx(u,l),Px(a,u),t-=64,N3(e,0,a,0)){for(s=0;s<t;++s)r[s]=0;return-1}for(s=0;s<t;++s)r[s]=e[s+64];return i=t,i}o(ZW,"crypto_sign_open");function x3(r,e){var t,n,s,i;for(n=63;n>=32;--n){for(t=0,s=n-32,i=n-12;s<i;++s)e[s]+=t-16*e[n]*Tx[s-(n-32)],t=e[s]+128>>8,e[s]-=t*256;e[s]+=t,e[n]=0}for(t=0,s=0;s<32;++s)e[s]+=t-(e[31]>>4)*Tx[s],t=e[s]>>8,e[s]&=255;for(s=0;s<32;++s)e[s]-=t*Tx[s];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(x3,"modL");function _x(r){for(var e=new Float64Array(64),t=0;t<64;++t)e[t]=r[t],r[t]=0;x3(r,e)}o(_x,"reduce");function Rx(r,e){var t=Nt(),n=Nt(),s=Nt(),i=Nt(),a=Nt(),u=Nt(),l=Nt(),f=Nt(),h=Nt();Yh(t,r[1],r[0]),Yh(h,e[1],e[0]),xr(t,t,h),zh(n,r[0],r[1]),zh(h,e[0],e[1]),xr(n,n,h),xr(s,r[3],e[3]),xr(s,s,JW),xr(i,r[2],e[2]),zh(i,i,i),Yh(a,n,t),Yh(u,i,s),zh(l,i,s),zh(f,n,t),xr(r[0],a,u),xr(r[1],f,l),xr(r[2],l,u),xr(r[3],a,f)}o(Rx,"add");function A3(r,e,t){for(var n=0;n<4;++n)B3(r[n],e[n],t)}o(A3,"cswap");function Px(r,e){var t=Nt(),n=Nt(),s=Nt();sJ(s,e[2]),xr(t,e[0],s),xr(n,e[1],s),Yw(r,n),r[31]^=T3(t)<<7}o(Px,"pack");function Yw(r,e){var t,n,s,i=Nt(),a=Nt();for(t=0;t<16;++t)a[t]=e[t];for(Ix(a),Ix(a),Ix(a),n=0;n<2;++n){for(i[0]=a[0]-65517,t=1;t<15;++t)i[t]=a[t]-65535-(i[t-1]>>16&1),i[t-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),s=i[15]>>16&1,i[14]&=65535,B3(a,i,1-s)}for(t=0;t<16;t++)r[2*t]=a[t]&255,r[2*t+1]=a[t]>>8}o(Yw,"pack25519");function eJ(r,e){var t=Nt(),n=Nt(),s=Nt(),i=Nt(),a=Nt(),u=Nt(),l=Nt();return Nu(r[2],zw),tJ(r[1],e),wc(s,r[1]),xr(i,s,WW),Yh(s,s,r[2]),zh(i,r[2],i),wc(a,i),wc(u,a),xr(l,u,a),xr(t,l,s),xr(t,t,i),rJ(t,t),xr(t,t,s),xr(t,t,i),xr(t,t,i),xr(r[0],t,i),wc(n,r[0]),xr(n,n,i),C3(n,s)&&xr(r[0],r[0],zW),wc(n,r[0]),xr(n,n,i),C3(n,s)?-1:(T3(r[0])===e[31]>>7&&Yh(r[0],Dx,r[0]),xr(r[3],r[0],r[1]),0)}o(eJ,"unpackneg");function tJ(r,e){var t;for(t=0;t<16;++t)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(tJ,"unpack25519");function rJ(r,e){var t=Nt(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=250;n>=0;--n)wc(t,t),n!==1&&xr(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}o(rJ,"pow2523");function C3(r,e){var t=new As(32),n=new As(32);return Yw(t,r),Yw(n,e),N3(t,0,n,0)}o(C3,"neq25519");function N3(r,e,t,n){return nJ(r,e,t,n,32)}o(N3,"crypto_verify_32");function nJ(r,e,t,n,s){var i,a=0;for(i=0;i<s;++i)a|=r[e+i]^t[n+i];return(1&a-1>>>8)-1}o(nJ,"vn");function T3(r){var e=new As(32);return Yw(e,r),e[0]&1}o(T3,"par25519");function I3(r,e,t){var n,s;for(Nu(r[0],Dx),Nu(r[1],zw),Nu(r[2],zw),Nu(r[3],Dx),s=255;s>=0;--s)n=t[s/8|0]>>(s&7)&1,A3(r,e,n),Rx(e,r),Rx(r,r),A3(r,e,n)}o(I3,"scalarmult");function Ox(r,e){var t=[Nt(),Nt(),Nt(),Nt()];Nu(t[0],S3),Nu(t[1],E3),Nu(t[2],zw),xr(t[3],S3,E3),I3(r,t,e)}o(Ox,"scalarbase");function Nu(r,e){var t;for(t=0;t<16;t++)r[t]=e[t]|0}o(Nu,"set25519");function sJ(r,e){var t=Nt(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=253;n>=0;--n)wc(t,t),n!==2&&n!==4&&xr(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}o(sJ,"inv25519");function Ix(r){var e,t,n=1;for(e=0;e<16;++e)t=r[e]+n+65535,n=Math.floor(t/65536),r[e]=t-n*65536;r[0]+=n-1+37*(n-1)}o(Ix,"car25519");function B3(r,e,t){for(var n,s=~(t-1),i=0;i<16;++i)n=s&(r[i]^e[i]),r[i]^=n,e[i]^=n}o(B3,"sel25519");function Nt(r){var e,t=new Float64Array(16);if(r)for(e=0;e<r.length;++e)t[e]=r[e];return t}o(Nt,"gf");function zh(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]+t[n]}o(zh,"A");function Yh(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]-t[n]}o(Yh,"Z");function wc(r,e){xr(r,e,e)}o(wc,"S");function xr(r,e,t){var n,s,i=0,a=0,u=0,l=0,f=0,h=0,m=0,g=0,w=0,y=0,S=0,E=0,b=0,T=0,A=0,C=0,x=0,B=0,F=0,R=0,H=0,q=0,K=0,G=0,he=0,le=0,oe=0,Z=0,fe=0,Se=0,Ke=0,be=t[0],we=t[1],Me=t[2],Je=t[3],Ye=t[4],lt=t[5],O=t[6],_=t[7],ne=t[8],J=t[9],Xe=t[10],Re=t[11],xe=t[12],ct=t[13],rr=t[14],je=t[15];n=e[0],i+=n*be,a+=n*we,u+=n*Me,l+=n*Je,f+=n*Ye,h+=n*lt,m+=n*O,g+=n*_,w+=n*ne,y+=n*J,S+=n*Xe,E+=n*Re,b+=n*xe,T+=n*ct,A+=n*rr,C+=n*je,n=e[1],a+=n*be,u+=n*we,l+=n*Me,f+=n*Je,h+=n*Ye,m+=n*lt,g+=n*O,w+=n*_,y+=n*ne,S+=n*J,E+=n*Xe,b+=n*Re,T+=n*xe,A+=n*ct,C+=n*rr,x+=n*je,n=e[2],u+=n*be,l+=n*we,f+=n*Me,h+=n*Je,m+=n*Ye,g+=n*lt,w+=n*O,y+=n*_,S+=n*ne,E+=n*J,b+=n*Xe,T+=n*Re,A+=n*xe,C+=n*ct,x+=n*rr,B+=n*je,n=e[3],l+=n*be,f+=n*we,h+=n*Me,m+=n*Je,g+=n*Ye,w+=n*lt,y+=n*O,S+=n*_,E+=n*ne,b+=n*J,T+=n*Xe,A+=n*Re,C+=n*xe,x+=n*ct,B+=n*rr,F+=n*je,n=e[4],f+=n*be,h+=n*we,m+=n*Me,g+=n*Je,w+=n*Ye,y+=n*lt,S+=n*O,E+=n*_,b+=n*ne,T+=n*J,A+=n*Xe,C+=n*Re,x+=n*xe,B+=n*ct,F+=n*rr,R+=n*je,n=e[5],h+=n*be,m+=n*we,g+=n*Me,w+=n*Je,y+=n*Ye,S+=n*lt,E+=n*O,b+=n*_,T+=n*ne,A+=n*J,C+=n*Xe,x+=n*Re,B+=n*xe,F+=n*ct,R+=n*rr,H+=n*je,n=e[6],m+=n*be,g+=n*we,w+=n*Me,y+=n*Je,S+=n*Ye,E+=n*lt,b+=n*O,T+=n*_,A+=n*ne,C+=n*J,x+=n*Xe,B+=n*Re,F+=n*xe,R+=n*ct,H+=n*rr,q+=n*je,n=e[7],g+=n*be,w+=n*we,y+=n*Me,S+=n*Je,E+=n*Ye,b+=n*lt,T+=n*O,A+=n*_,C+=n*ne,x+=n*J,B+=n*Xe,F+=n*Re,R+=n*xe,H+=n*ct,q+=n*rr,K+=n*je,n=e[8],w+=n*be,y+=n*we,S+=n*Me,E+=n*Je,b+=n*Ye,T+=n*lt,A+=n*O,C+=n*_,x+=n*ne,B+=n*J,F+=n*Xe,R+=n*Re,H+=n*xe,q+=n*ct,K+=n*rr,G+=n*je,n=e[9],y+=n*be,S+=n*we,E+=n*Me,b+=n*Je,T+=n*Ye,A+=n*lt,C+=n*O,x+=n*_,B+=n*ne,F+=n*J,R+=n*Xe,H+=n*Re,q+=n*xe,K+=n*ct,G+=n*rr,he+=n*je,n=e[10],S+=n*be,E+=n*we,b+=n*Me,T+=n*Je,A+=n*Ye,C+=n*lt,x+=n*O,B+=n*_,F+=n*ne,R+=n*J,H+=n*Xe,q+=n*Re,K+=n*xe,G+=n*ct,he+=n*rr,le+=n*je,n=e[11],E+=n*be,b+=n*we,T+=n*Me,A+=n*Je,C+=n*Ye,x+=n*lt,B+=n*O,F+=n*_,R+=n*ne,H+=n*J,q+=n*Xe,K+=n*Re,G+=n*xe,he+=n*ct,le+=n*rr,oe+=n*je,n=e[12],b+=n*be,T+=n*we,A+=n*Me,C+=n*Je,x+=n*Ye,B+=n*lt,F+=n*O,R+=n*_,H+=n*ne,q+=n*J,K+=n*Xe,G+=n*Re,he+=n*xe,le+=n*ct,oe+=n*rr,Z+=n*je,n=e[13],T+=n*be,A+=n*we,C+=n*Me,x+=n*Je,B+=n*Ye,F+=n*lt,R+=n*O,H+=n*_,q+=n*ne,K+=n*J,G+=n*Xe,he+=n*Re,le+=n*xe,oe+=n*ct,Z+=n*rr,fe+=n*je,n=e[14],A+=n*be,C+=n*we,x+=n*Me,B+=n*Je,F+=n*Ye,R+=n*lt,H+=n*O,q+=n*_,K+=n*ne,G+=n*J,he+=n*Xe,le+=n*Re,oe+=n*xe,Z+=n*ct,fe+=n*rr,Se+=n*je,n=e[15],C+=n*be,x+=n*we,B+=n*Me,F+=n*Je,R+=n*Ye,H+=n*lt,q+=n*O,K+=n*_,G+=n*ne,he+=n*J,le+=n*Xe,oe+=n*Re,Z+=n*xe,fe+=n*ct,Se+=n*rr,Ke+=n*je,i+=38*x,a+=38*B,u+=38*F,l+=38*R,f+=38*H,h+=38*q,m+=38*K,g+=38*G,w+=38*he,y+=38*le,S+=38*oe,E+=38*Z,b+=38*fe,T+=38*Se,A+=38*Ke,s=1,n=i+s+65535,s=Math.floor(n/65536),i=n-s*65536,n=a+s+65535,s=Math.floor(n/65536),a=n-s*65536,n=u+s+65535,s=Math.floor(n/65536),u=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=h+s+65535,s=Math.floor(n/65536),h=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=y+s+65535,s=Math.floor(n/65536),y=n-s*65536,n=S+s+65535,s=Math.floor(n/65536),S=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,n=b+s+65535,s=Math.floor(n/65536),b=n-s*65536,n=T+s+65535,s=Math.floor(n/65536),T=n-s*65536,n=A+s+65535,s=Math.floor(n/65536),A=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,i+=s-1+37*(s-1),s=1,n=i+s+65535,s=Math.floor(n/65536),i=n-s*65536,n=a+s+65535,s=Math.floor(n/65536),a=n-s*65536,n=u+s+65535,s=Math.floor(n/65536),u=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=h+s+65535,s=Math.floor(n/65536),h=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=y+s+65535,s=Math.floor(n/65536),y=n-s*65536,n=S+s+65535,s=Math.floor(n/65536),S=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,n=b+s+65535,s=Math.floor(n/65536),b=n-s*65536,n=T+s+65535,s=Math.floor(n/65536),T=n-s*65536,n=A+s+65535,s=Math.floor(n/65536),A=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,i+=s-1+37*(s-1),r[0]=i,r[1]=a,r[2]=u,r[3]=l,r[4]=f,r[5]=h,r[6]=m,r[7]=g,r[8]=w,r[9]=y,r[10]=S,r[11]=E,r[12]=b,r[13]=T,r[14]=A,r[15]=C}o(xr,"M")});var k3=ye((zce,O3)=>{"use strict";var Xs=$t();ur();ci();Am();O3.exports=Xs.kem=Xs.kem||{};var R3=Xs.jsbn.BigInteger;Xs.kem.rsa={};Xs.kem.rsa.create=function(r,e){e=e||{};var t=e.prng||Xs.random,n={};return n.encrypt=function(s,i){var a=Math.ceil(s.n.bitLength()/8),u;do u=new R3(Xs.util.bytesToHex(t.getBytesSync(a)),16).mod(s.n);while(u.compareTo(R3.ONE)<=0);u=Xs.util.hexToBytes(u.toString(16));var l=a-u.length;l>0&&(u=Xs.util.fillString("\0",l)+u);var f=s.encrypt(u,"NONE"),h=r.generate(u,i);return{encapsulation:f,key:h}},n.decrypt=function(s,i,a){var u=s.decrypt(i,"NONE");return r.generate(u,a)},n};Xs.kem.kdf1=function(r,e){P3(this,r,0,e||r.digestLength)};Xs.kem.kdf2=function(r,e){P3(this,r,1,e||r.digestLength)};function P3(r,e,t,n){r.generate=function(s,i){for(var a=new Xs.util.ByteBuffer,u=Math.ceil(i/n)+t,l=new Xs.util.ByteBuffer,f=t;f<u;++f){l.putInt32(f),e.start(),e.update(s+l.getBytes());var h=e.digest();a.putBytes(h.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}o(P3,"_createKDF")});var M3=ye((Qce,U3)=>{"use strict";var tr=$t();ur();U3.exports=tr.log=tr.log||{};tr.log.levels=["none","error","warning","info","debug","verbose","max"];var Qw={},Vx=[],Bm=null;tr.log.LEVEL_LOCKED=2;tr.log.NO_LEVEL_CHECK=4;tr.log.INTERPOLATE=8;for(Aa=0;Aa<tr.log.levels.length;++Aa)kx=tr.log.levels[Aa],Qw[kx]={index:Aa,name:kx.toUpperCase()};var kx,Aa;tr.log.logMessage=function(r){for(var e=Qw[r.level].index,t=0;t<Vx.length;++t){var n=Vx[t];if(n.flags&tr.log.NO_LEVEL_CHECK)n.f(r);else{var s=Qw[n.level].index;e<=s&&n.f(n,r)}}};tr.log.prepareStandard=function(r){"standard"in r||(r.standard=Qw[r.level].name+" ["+r.category+"] "+r.message)};tr.log.prepareFull=function(r){if(!("full"in r)){var e=[r.message];e=e.concat([]),r.full=tr.util.format.apply(this,e)}};tr.log.prepareStandardFull=function(r){"standardFull"in r||(tr.log.prepareStandard(r),r.standardFull=r.standard)};for(Lx=["error","warning","info","debug","verbose"],Aa=0;Aa<Lx.length;++Aa)(function(e){tr.log[e]=function(t,n){var s=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:n,arguments:s};tr.log.logMessage(i)}})(Lx[Aa]);var Lx,Aa;tr.log.makeLogger=function(r){var e={flags:0,f:r};return tr.log.setLevel(e,"none"),e};tr.log.setLevel=function(r,e){var t=!1;if(r&&!(r.flags&tr.log.LEVEL_LOCKED))for(var n=0;n<tr.log.levels.length;++n){var s=tr.log.levels[n];if(e==s){r.level=e,t=!0;break}}return t};tr.log.lock=function(r,e){typeof e>"u"||e?r.flags|=tr.log.LEVEL_LOCKED:r.flags&=~tr.log.LEVEL_LOCKED};tr.log.addLogger=function(r){Vx.push(r)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(L3={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Dm=o(function(r,e){tr.log.prepareStandard(e);var t=L3[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),t.apply(console,n)},"f"),Qh=tr.log.makeLogger(Dm)):(Dm=o(function(e,t){tr.log.prepareStandardFull(t),console.log(t.standardFull)},"f"),Qh=tr.log.makeLogger(Dm)),tr.log.setLevel(Qh,"debug"),tr.log.addLogger(Qh),Bm=Qh):console={log:o(function(){},"log")};var Qh,L3,Dm;Bm!==null&&typeof window<"u"&&window.location&&(Im=new URL(window.location.href).searchParams,Im.has("console.level")&&tr.log.setLevel(Bm,Im.get("console.level").slice(-1)[0]),Im.has("console.lock")&&(V3=Im.get("console.lock").slice(-1)[0],V3=="true"&&tr.log.lock(Bm)));var Im,V3;tr.log.consoleLogger=Bm});var F3=ye((efe,j3)=>{"use strict";j3.exports=da();_w();$h();zb();xx()});var K3=ye((tfe,H3)=>{"use strict";var We=$t();vu();Fi();Sm();wu();hc();cx();ci();ur();$w();var ee=We.asn1,fs=H3.exports=We.pkcs7=We.pkcs7||{};fs.messageFromPem=function(r){var e=We.pem.decode(r)[0];if(e.type!=="PKCS7"){var t=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=ee.fromDer(e.body);return fs.messageFromAsn1(n)};fs.messageToPem=function(r,e){var t={type:"PKCS7",body:ee.toDer(r.toAsn1()).getBytes()};return We.pem.encode(t,{maxline:e})};fs.messageFromAsn1=function(r){var e={},t=[];if(!ee.validate(r,fs.asn1.contentInfoValidator,e,t)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=t,n}var s=ee.derToOid(e.contentType),i;switch(s){case We.pki.oids.envelopedData:i=fs.createEnvelopedData();break;case We.pki.oids.encryptedData:i=fs.createEncryptedData();break;case We.pki.oids.signedData:i=fs.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return i.fromAsn1(e.content.value[0]),i};fs.createSignedData=function(){var r=null;return r={type:We.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:o(function(n){if(Mx(r,n,fs.asn1.signedDataValidator),r.certificates=[],r.crls=[],r.digestAlgorithmIdentifiers=[],r.contentInfo=null,r.signerInfos=[],r.rawCapture.certificates)for(var s=r.rawCapture.certificates.value,i=0;i<s.length;++i)r.certificates.push(We.pki.certificateFromAsn1(s[i]))},"fromAsn1"),toAsn1:o(function(){r.contentInfo||r.sign();for(var n=[],s=0;s<r.certificates.length;++s)n.push(We.pki.certificateToAsn1(r.certificates[s]));var i=[],a=ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return n.length>0&&a.value[0].value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,n)),i.length>0&&a.value[0].value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,r.signerInfos)),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),a])},"toAsn1"),addSigner:o(function(n){var s=n.issuer,i=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=We.pki.certificateFromPem(a)),s=a.issuer.attributes,i=a.serialNumber}var u=n.key;if(!u)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof u=="string"&&(u=We.pki.privateKeyFromPem(u));var l=n.digestAlgorithm||We.pki.oids.sha1;switch(l){case We.pki.oids.sha1:case We.pki.oids.sha256:case We.pki.oids.sha384:case We.pki.oids.sha512:case We.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var f=n.authenticatedAttributes||[];if(f.length>0){for(var h=!1,m=!1,g=0;g<f.length;++g){var w=f[g];if(!h&&w.type===We.pki.oids.contentType){if(h=!0,m)break;continue}if(!m&&w.type===We.pki.oids.messageDigest){if(m=!0,h)break;continue}}if(!h||!m)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}r.signers.push({key:u,version:1,issuer:s,serialNumber:i,digestAlgorithm:l,signatureAlgorithm:We.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:f,unauthenticatedAttributes:[]})},"addSigner"),sign:o(function(n){if(n=n||{},(typeof r.content!="object"||r.contentInfo===null)&&(r.contentInfo=ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(We.pki.oids.data).getBytes())]),"content"in r)){var s;r.content instanceof We.util.ByteBuffer?s=r.content.bytes():typeof r.content=="string"&&(s=We.util.encodeUtf8(r.content)),n.detached?r.detachedContent=ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,s):r.contentInfo.value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,s)]))}if(r.signers.length!==0){var i=e();t(i)}},"sign"),verify:o(function(){throw new Error("PKCS#7 signature verification not yet implemented.")},"verify"),addCertificate:o(function(n){typeof n=="string"&&(n=We.pki.certificateFromPem(n)),r.certificates.push(n)},"addCertificate"),addCertificateRevokationList:o(function(n){throw new Error("PKCS#7 CRL support not yet implemented.")},"addCertificateRevokationList")},r;function e(){for(var n={},s=0;s<r.signers.length;++s){var i=r.signers[s],a=i.digestAlgorithm;a in n||(n[a]=We.md[We.pki.oids[a]].create()),i.authenticatedAttributes.length===0?i.md=n[a]:i.md=We.md[We.pki.oids[a]].create()}r.digestAlgorithmIdentifiers=[];for(var a in n)r.digestAlgorithmIdentifiers.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(a).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")]));return n}o(e,"addDigestAlgorithmIds");function t(n){var s;if(r.detachedContent?s=r.detachedContent:(s=r.contentInfo.value[1],s=s.value[0]),!s)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=ee.derToOid(r.contentInfo.value[0].value),a=ee.toDer(s);a.getByte(),ee.getBerValueLength(a),a=a.getBytes();for(var u in n)n[u].start().update(a);for(var l=new Date,f=0;f<r.signers.length;++f){var h=r.signers[f];if(h.authenticatedAttributes.length===0){if(i!==We.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{h.authenticatedAttributesAsn1=ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var m=ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,[]),g=0;g<h.authenticatedAttributes.length;++g){var w=h.authenticatedAttributes[g];w.type===We.pki.oids.messageDigest?w.value=n[h.digestAlgorithm].digest():w.type===We.pki.oids.signingTime&&(w.value||(w.value=l)),m.value.push(Ux(w)),h.authenticatedAttributesAsn1.value.push(Ux(w))}a=ee.toDer(m).getBytes(),h.md.start().update(a)}h.signature=h.key.sign(h.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=cJ(r.signers)}o(t,"addSignerInfos")};fs.createEncryptedData=function(){var r=null;return r={type:We.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:We.pki.oids["aes256-CBC"]},fromAsn1:o(function(e){Mx(r,e,fs.asn1.encryptedDataValidator)},"fromAsn1"),decrypt:o(function(e){e!==void 0&&(r.encryptedContent.key=e),q3(r)},"decrypt")},r};fs.createEnvelopedData=function(){var r=null;return r={type:We.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:We.pki.oids["aes256-CBC"]},fromAsn1:o(function(e){var t=Mx(r,e,fs.asn1.envelopedDataValidator);r.recipients=oJ(t.recipientInfos.value)},"fromAsn1"),toAsn1:o(function(){return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,uJ(r.recipients)),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,fJ(r.encryptedContent))])])])},"toAsn1"),findRecipient:o(function(e){for(var t=e.issuer.attributes,n=0;n<r.recipients.length;++n){var s=r.recipients[n],i=s.issuer;if(s.serialNumber===e.serialNumber&&i.length===t.length){for(var a=!0,u=0;u<t.length;++u)if(i[u].type!==t[u].type||i[u].value!==t[u].value){a=!1;break}if(a)return s}}return null},"findRecipient"),decrypt:o(function(e,t){if(r.encryptedContent.key===void 0&&e!==void 0&&t!==void 0)switch(e.encryptedContent.algorithm){case We.pki.oids.rsaEncryption:case We.pki.oids.desCBC:var n=t.decrypt(e.encryptedContent.content);r.encryptedContent.key=We.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}q3(r)},"decrypt"),addRecipient:o(function(e){r.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:We.pki.oids.rsaEncryption,key:e.publicKey}})},"addRecipient"),encrypt:o(function(e,t){if(r.encryptedContent.content===void 0){t=t||r.encryptedContent.algorithm,e=e||r.encryptedContent.key;var n,s,i;switch(t){case We.pki.oids["aes128-CBC"]:n=16,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["aes192-CBC"]:n=24,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["aes256-CBC"]:n=32,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["des-EDE3-CBC"]:n=24,s=8,i=We.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+t)}if(e===void 0)e=We.util.createBuffer(We.random.getBytes(n));else if(e.length()!=n)throw new Error("Symmetric key has wrong length; got "+e.length()+" bytes, expected "+n+".");r.encryptedContent.algorithm=t,r.encryptedContent.key=e,r.encryptedContent.parameter=We.util.createBuffer(We.random.getBytes(s));var a=i(e);if(a.start(r.encryptedContent.parameter.copy()),a.update(r.content),!a.finish())throw new Error("Symmetric encryption failed.");r.encryptedContent.content=a.output}for(var u=0;u<r.recipients.length;++u){var l=r.recipients[u];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case We.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(r.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}},"encrypt")},r};function iJ(r){var e={},t=[];if(!ee.validate(r,fs.asn1.recipientInfoValidator,e,t)){var n=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw n.errors=t,n}return{version:e.version.charCodeAt(0),issuer:We.pki.RDNAttributesAsArray(e.issuer),serialNumber:We.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:ee.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}o(iJ,"_recipientFromAsn1");function aJ(r){return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[We.pki.distinguishedNameToAsn1({attributes:r.issuer}),ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,We.util.hexToBytes(r.serialNumber))]),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.encryptedContent.algorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")]),ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.encryptedContent.content)])}o(aJ,"_recipientToAsn1");function oJ(r){for(var e=[],t=0;t<r.length;++t)e.push(iJ(r[t]));return e}o(oJ,"_recipientsFromAsn1");function uJ(r){for(var e=[],t=0;t<r.length;++t)e.push(aJ(r[t]));return e}o(uJ,"_recipientsToAsn1");function lJ(r){var e=ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[We.pki.distinguishedNameToAsn1({attributes:r.issuer}),ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,We.util.hexToBytes(r.serialNumber))]),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.digestAlgorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")])]);if(r.authenticatedAttributesAsn1&&e.value.push(r.authenticatedAttributesAsn1),e.value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.signatureAlgorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")])),e.value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.signature)),r.unauthenticatedAttributes.length>0){for(var t=ee.create(ee.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<r.unauthenticatedAttributes.length;++n){var s=r.unauthenticatedAttributes[n];t.values.push(Ux(s))}e.value.push(t)}return e}o(lJ,"_signerToAsn1");function cJ(r){for(var e=[],t=0;t<r.length;++t)e.push(lJ(r[t]));return e}o(cJ,"_signersToAsn1");function Ux(r){var e;if(r.type===We.pki.oids.contentType)e=ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.value).getBytes());else if(r.type===We.pki.oids.messageDigest)e=ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.value.bytes());else if(r.type===We.pki.oids.signingTime){var t=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),s=r.value;if(typeof s=="string"){var i=Date.parse(s);isNaN(i)?s.length===13?s=ee.utcTimeToDate(s):s=ee.generalizedTimeToDate(s):s=new Date(i)}s>=t&&s<n?e=ee.create(ee.Class.UNIVERSAL,ee.Type.UTCTIME,!1,ee.dateToUtcTime(s)):e=ee.create(ee.Class.UNIVERSAL,ee.Type.GENERALIZEDTIME,!1,ee.dateToGeneralizedTime(s))}return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,[e])])}o(Ux,"_attributeToAsn1");function fJ(r){return[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(We.pki.oids.data).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.algorithm).getBytes()),r.parameter?ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.parameter.getBytes()):void 0]),ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.content.getBytes())])]}o(fJ,"_encryptedContentToAsn1");function Mx(r,e,t){var n={},s=[];if(!ee.validate(e,t,n,s)){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}var a=ee.derToOid(n.contentType);if(a!==We.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var u="";if(We.util.isArray(n.encryptedContent))for(var l=0;l<n.encryptedContent.length;++l){if(n.encryptedContent[l].type!==ee.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");u+=n.encryptedContent[l].value}else u=n.encryptedContent;r.encryptedContent={algorithm:ee.derToOid(n.encAlgorithm),parameter:We.util.createBuffer(n.encParameter.value),content:We.util.createBuffer(u)}}if(n.content){var u="";if(We.util.isArray(n.content))for(var l=0;l<n.content.length;++l){if(n.content[l].type!==ee.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");u+=n.content[l].value}else u=n.content;r.content=We.util.createBuffer(u)}return r.version=n.version.charCodeAt(0),r.rawCapture=n,n}o(Mx,"_fromAsn1");function q3(r){if(r.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(r.content===void 0){var e;switch(r.encryptedContent.algorithm){case We.pki.oids["aes128-CBC"]:case We.pki.oids["aes192-CBC"]:case We.pki.oids["aes256-CBC"]:e=We.aes.createDecryptionCipher(r.encryptedContent.key);break;case We.pki.oids.desCBC:case We.pki.oids["des-EDE3-CBC"]:e=We.des.createDecryptionCipher(r.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+r.encryptedContent.algorithm)}if(e.start(r.encryptedContent.parameter),e.update(r.encryptedContent.content),!e.finish())throw new Error("Symmetric decryption failed.");r.content=e.output}}o(q3,"_decryptContent")});var X3=ye((nfe,$3)=>{"use strict";var un=$t();vu();Fh();_w();$h();ur();var eS=$3.exports=un.ssh=un.ssh||{};eS.privateKeyToPutty=function(r,e,t){t=t||"",e=e||"";var n="ssh-rsa",s=e===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+n+`\r
15
+ `;i+="Encryption: "+s+`\r
16
+ `,i+="Comment: "+t+`\r
17
+ `;var a=un.util.createBuffer();Zh(a,n),Ca(a,r.e),Ca(a,r.n);var u=un.util.encode64(a.bytes(),64),l=Math.floor(u.length/66)+1;i+="Public-Lines: "+l+`\r
18
+ `,i+=u;var f=un.util.createBuffer();Ca(f,r.d),Ca(f,r.p),Ca(f,r.q),Ca(f,r.qInv);var h;if(!e)h=un.util.encode64(f.bytes(),64);else{var m=f.length()+16-1;m-=m%16;var g=Zw(f.bytes());g.truncate(g.length()-m+f.length()),f.putBuffer(g);var w=un.util.createBuffer();w.putBuffer(Zw("\0\0\0\0",e)),w.putBuffer(Zw("\0\0\0",e));var y=un.aes.createEncryptionCipher(w.truncate(8),"CBC");y.start(un.util.createBuffer().fillWithByte(0,16)),y.update(f.copy()),y.finish();var S=y.output;S.truncate(16),h=un.util.encode64(S.bytes(),64)}l=Math.floor(h.length/66)+1,i+=`\r
19
+ Private-Lines: `+l+`\r
20
+ `,i+=h;var E=Zw("putty-private-key-file-mac-key",e),b=un.util.createBuffer();Zh(b,n),Zh(b,s),Zh(b,t),b.putInt32(a.length()),b.putBuffer(a),b.putInt32(f.length()),b.putBuffer(f);var T=un.hmac.create();return T.start("sha1",E),T.update(b.bytes()),i+=`\r
21
+ Private-MAC: `+T.digest().toHex()+`\r
22
+ `,i};eS.publicKeyToOpenSSH=function(r,e){var t="ssh-rsa";e=e||"";var n=un.util.createBuffer();return Zh(n,t),Ca(n,r.e),Ca(n,r.n),t+" "+un.util.encode64(n.bytes())+" "+e};eS.privateKeyToOpenSSH=function(r,e){return e?un.pki.encryptRsaPrivateKey(r,e,{legacy:!0,algorithm:"aes128"}):un.pki.privateKeyToPem(r)};eS.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||un.md.md5.create(),n="ssh-rsa",s=un.util.createBuffer();Zh(s,n),Ca(s,r.e),Ca(s,r.n),t.start(),t.update(s.getBytes());var i=t.digest();if(e.encoding==="hex"){var a=i.toHex();return e.delimiter?a.match(/.{2}/g).join(e.delimiter):a}else{if(e.encoding==="binary")return i.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return i};function Ca(r,e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=un.util.hexToBytes(t);r.putInt32(n.length),r.putBytes(n)}o(Ca,"_addBigIntegerToBuffer");function Zh(r,e){r.putInt32(e.length),r.putString(e)}o(Zh,"_addStringToBuffer");function Zw(){for(var r=un.md.sha1.create(),e=arguments.length,t=0;t<e;++t)r.update(arguments[t]);return r.digest()}o(Zw,"_sha1")});var W3=ye((ife,G3)=>{"use strict";G3.exports=$t();vu();p3();Fi();bw();Sm();_3();Fh();k3();M3();F3();fx();kw();hc();ix();dx();K3();gx();ox();Yb();qw();ci();ex();X3();Ax();ur()});var Z3=ye((vfe,Q3)=>{"use strict";var{PassThrough:mJ}=gt("stream");Q3.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",s=!1;e?s=!(t||n):t=t||"utf8",n&&(t=null);let i=new mJ({objectMode:s});t&&i.setEncoding(t);let a=0,u=[];return i.on("data",l=>{u.push(l),s?a=u.length:a+=l.length}),i.getBufferedValue=()=>e?u:n?Buffer.concat(u,a):u.join(""),i.getBufferedLength=()=>a,i}});var t4=ye((Sfe,_m)=>{"use strict";var{constants:gJ}=gt("buffer"),yJ=gt("stream"),{promisify:vJ}=gt("util"),wJ=Z3(),SJ=vJ(yJ.pipeline),e4=class extends Error{static{o(this,"MaxBufferError")}constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function qx(r,e){if(!r)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n=wJ(e);return await new Promise((s,i)=>{let a=o(u=>{u&&n.getBufferedLength()<=gJ.MAX_LENGTH&&(u.bufferedData=n.getBufferedValue()),i(u)},"rejectPromise");(async()=>{try{await SJ(r,n),s()}catch(u){a(u)}})(),n.on("data",()=>{n.getBufferedLength()>t&&a(new e4)})}),n.getBufferedValue()}o(qx,"getStream");_m.exports=qx;_m.exports.buffer=(r,e)=>qx(r,{...e,encoding:"buffer"});_m.exports.array=(r,e)=>qx(r,{...e,array:!0});_m.exports.MaxBufferError=e4});var go=ye((tp,Rm)=>{"use strict";(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",i="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",f=1,h=2,m=4,g=1,w=2,y=1,S=2,E=4,b=8,T=16,A=32,C=64,x=128,B=256,F=512,R=30,H="...",q=800,K=16,G=1,he=2,le=3,oe=1/0,Z=9007199254740991,fe=17976931348623157e292,Se=NaN,Ke=4294967295,be=Ke-1,we=Ke>>>1,Me=[["ary",x],["bind",y],["bindKey",S],["curry",b],["curryRight",T],["flip",F],["partial",A],["partialRight",C],["rearg",B]],Je="[object Arguments]",Ye="[object Array]",lt="[object AsyncFunction]",O="[object Boolean]",_="[object Date]",ne="[object DOMException]",J="[object Error]",Xe="[object Function]",Re="[object GeneratorFunction]",xe="[object Map]",ct="[object Number]",rr="[object Null]",je="[object Object]",nr="[object Promise]",Ls="[object Proxy]",Ge="[object RegExp]",Ur="[object Set]",on="[object String]",$n="[object Symbol]",ms="[object Undefined]",ns="[object WeakMap]",pt="[object WeakSet]",Ze="[object ArrayBuffer]",Dn="[object DataView]",ss="[object Float32Array]",aa="[object Float64Array]",oa="[object Int8Array]",Rt="[object Int16Array]",yh="[object Int32Array]",vh="[object Uint8Array]",tc="[object Uint8ClampedArray]",z0="[object Uint16Array]",Vs="[object Uint32Array]",d=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,te=/&(?:amp|lt|gt|quot|#39);/g,ie=/[&<>"']/g,X=RegExp(te.source),nt=RegExp(ie.source),kt=/<%-([\s\S]+?)%>/g,Wt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_n=/^\w*$/,ti=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,or=/[\\^$.*+?()[\]{}|]/g,ua=RegExp(or.source),Y0=/^\s+/,Cv=/\s/,f2=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,h2=/\{\n\/\* \[wrapped with (.+)\] \*/,p2=/,? & /,d2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qe=/[()=,{}\[\]\/\s]/,Zt=/\\(\\)?/g,Xn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oi=/\w*$/,m2=/^[-+]0x[0-9a-f]+$/i,lM=/^0b[01]+$/i,cM=/^\[object .+?Constructor\]$/,fM=/^0o[0-7]+$/i,hM=/^(?:0|[1-9]\d*)$/,pM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bv=/($^)/,dM=/['\n\r\u2028\u2029\\]/g,xv="\\ud800-\\udfff",mM="\\u0300-\\u036f",gM="\\ufe20-\\ufe2f",yM="\\u20d0-\\u20ff",oD=mM+gM+yM,uD="\\u2700-\\u27bf",lD="a-z\\xdf-\\xf6\\xf8-\\xff",vM="\\xac\\xb1\\xd7\\xf7",wM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",SM="\\u2000-\\u206f",EM=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cD="A-Z\\xc0-\\xd6\\xd8-\\xde",fD="\\ufe0e\\ufe0f",hD=vM+wM+SM+EM,g2="['\u2019]",AM="["+xv+"]",pD="["+hD+"]",Nv="["+oD+"]",dD="\\d+",CM="["+uD+"]",mD="["+lD+"]",gD="[^"+xv+hD+dD+uD+lD+cD+"]",y2="\\ud83c[\\udffb-\\udfff]",bM="(?:"+Nv+"|"+y2+")",yD="[^"+xv+"]",v2="(?:\\ud83c[\\udde6-\\uddff]){2}",w2="[\\ud800-\\udbff][\\udc00-\\udfff]",wh="["+cD+"]",vD="\\u200d",wD="(?:"+mD+"|"+gD+")",xM="(?:"+wh+"|"+gD+")",SD="(?:"+g2+"(?:d|ll|m|re|s|t|ve))?",ED="(?:"+g2+"(?:D|LL|M|RE|S|T|VE))?",AD=bM+"?",CD="["+fD+"]?",NM="(?:"+vD+"(?:"+[yD,v2,w2].join("|")+")"+CD+AD+")*",TM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",IM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bD=CD+AD+NM,BM="(?:"+[CM,v2,w2].join("|")+")"+bD,DM="(?:"+[yD+Nv+"?",Nv,v2,w2,AM].join("|")+")",_M=RegExp(g2,"g"),RM=RegExp(Nv,"g"),S2=RegExp(y2+"(?="+y2+")|"+DM+bD,"g"),PM=RegExp([wh+"?"+mD+"+"+SD+"(?="+[pD,wh,"$"].join("|")+")",xM+"+"+ED+"(?="+[pD,wh+wD,"$"].join("|")+")",wh+"?"+wD+"+"+SD,wh+"+"+ED,IM,TM,dD,BM].join("|"),"g"),OM=RegExp("["+vD+xv+oD+fD+"]"),kM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,LM=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],VM=-1,kr={};kr[ss]=kr[aa]=kr[oa]=kr[Rt]=kr[yh]=kr[vh]=kr[tc]=kr[z0]=kr[Vs]=!0,kr[Je]=kr[Ye]=kr[Ze]=kr[O]=kr[Dn]=kr[_]=kr[J]=kr[Xe]=kr[xe]=kr[ct]=kr[je]=kr[Ge]=kr[Ur]=kr[on]=kr[ns]=!1;var Tr={};Tr[Je]=Tr[Ye]=Tr[Ze]=Tr[Dn]=Tr[O]=Tr[_]=Tr[ss]=Tr[aa]=Tr[oa]=Tr[Rt]=Tr[yh]=Tr[xe]=Tr[ct]=Tr[je]=Tr[Ge]=Tr[Ur]=Tr[on]=Tr[$n]=Tr[vh]=Tr[tc]=Tr[z0]=Tr[Vs]=!0,Tr[J]=Tr[Xe]=Tr[ns]=!1;var UM={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},MM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},jM={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},FM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qM=parseFloat,HM=parseInt,xD=typeof global=="object"&&global&&global.Object===Object&&global,KM=typeof self=="object"&&self&&self.Object===Object&&self,Sn=xD||KM||Function("return this")(),E2=typeof tp=="object"&&tp&&!tp.nodeType&&tp,rc=E2&&typeof Rm=="object"&&Rm&&!Rm.nodeType&&Rm,ND=rc&&rc.exports===E2,A2=ND&&xD.process,ri=(function(){try{var se=rc&&rc.require&&rc.require("util").types;return se||A2&&A2.binding&&A2.binding("util")}catch{}})(),TD=ri&&ri.isArrayBuffer,ID=ri&&ri.isDate,BD=ri&&ri.isMap,DD=ri&&ri.isRegExp,_D=ri&&ri.isSet,RD=ri&&ri.isTypedArray;function Us(se,Ce,ve){switch(ve.length){case 0:return se.call(Ce);case 1:return se.call(Ce,ve[0]);case 2:return se.call(Ce,ve[0],ve[1]);case 3:return se.call(Ce,ve[0],ve[1],ve[2])}return se.apply(Ce,ve)}o(Us,"apply");function $M(se,Ce,ve,ut){for(var Pt=-1,mr=se==null?0:se.length;++Pt<mr;){var dn=se[Pt];Ce(ut,dn,ve(dn),se)}return ut}o($M,"arrayAggregator");function ni(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut&&Ce(se[ve],ve,se)!==!1;);return se}o(ni,"arrayEach");function XM(se,Ce){for(var ve=se==null?0:se.length;ve--&&Ce(se[ve],ve,se)!==!1;);return se}o(XM,"arrayEachRight");function PD(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut;)if(!Ce(se[ve],ve,se))return!1;return!0}o(PD,"arrayEvery");function ru(se,Ce){for(var ve=-1,ut=se==null?0:se.length,Pt=0,mr=[];++ve<ut;){var dn=se[ve];Ce(dn,ve,se)&&(mr[Pt++]=dn)}return mr}o(ru,"arrayFilter");function Tv(se,Ce){var ve=se==null?0:se.length;return!!ve&&Sh(se,Ce,0)>-1}o(Tv,"arrayIncludes");function C2(se,Ce,ve){for(var ut=-1,Pt=se==null?0:se.length;++ut<Pt;)if(ve(Ce,se[ut]))return!0;return!1}o(C2,"arrayIncludesWith");function Mr(se,Ce){for(var ve=-1,ut=se==null?0:se.length,Pt=Array(ut);++ve<ut;)Pt[ve]=Ce(se[ve],ve,se);return Pt}o(Mr,"arrayMap");function nu(se,Ce){for(var ve=-1,ut=Ce.length,Pt=se.length;++ve<ut;)se[Pt+ve]=Ce[ve];return se}o(nu,"arrayPush");function b2(se,Ce,ve,ut){var Pt=-1,mr=se==null?0:se.length;for(ut&&mr&&(ve=se[++Pt]);++Pt<mr;)ve=Ce(ve,se[Pt],Pt,se);return ve}o(b2,"arrayReduce");function GM(se,Ce,ve,ut){var Pt=se==null?0:se.length;for(ut&&Pt&&(ve=se[--Pt]);Pt--;)ve=Ce(ve,se[Pt],Pt,se);return ve}o(GM,"arrayReduceRight");function x2(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut;)if(Ce(se[ve],ve,se))return!0;return!1}o(x2,"arraySome");var WM=N2("length");function JM(se){return se.split("")}o(JM,"asciiToArray");function zM(se){return se.match(d2)||[]}o(zM,"asciiWords");function OD(se,Ce,ve){var ut;return ve(se,function(Pt,mr,dn){if(Ce(Pt,mr,dn))return ut=mr,!1}),ut}o(OD,"baseFindKey");function Iv(se,Ce,ve,ut){for(var Pt=se.length,mr=ve+(ut?1:-1);ut?mr--:++mr<Pt;)if(Ce(se[mr],mr,se))return mr;return-1}o(Iv,"baseFindIndex");function Sh(se,Ce,ve){return Ce===Ce?uj(se,Ce,ve):Iv(se,kD,ve)}o(Sh,"baseIndexOf");function YM(se,Ce,ve,ut){for(var Pt=ve-1,mr=se.length;++Pt<mr;)if(ut(se[Pt],Ce))return Pt;return-1}o(YM,"baseIndexOfWith");function kD(se){return se!==se}o(kD,"baseIsNaN");function LD(se,Ce){var ve=se==null?0:se.length;return ve?I2(se,Ce)/ve:Se}o(LD,"baseMean");function N2(se){return function(Ce){return Ce==null?r:Ce[se]}}o(N2,"baseProperty");function T2(se){return function(Ce){return se==null?r:se[Ce]}}o(T2,"basePropertyOf");function VD(se,Ce,ve,ut,Pt){return Pt(se,function(mr,dn,Cr){ve=ut?(ut=!1,mr):Ce(ve,mr,dn,Cr)}),ve}o(VD,"baseReduce");function QM(se,Ce){var ve=se.length;for(se.sort(Ce);ve--;)se[ve]=se[ve].value;return se}o(QM,"baseSortBy");function I2(se,Ce){for(var ve,ut=-1,Pt=se.length;++ut<Pt;){var mr=Ce(se[ut]);mr!==r&&(ve=ve===r?mr:ve+mr)}return ve}o(I2,"baseSum");function B2(se,Ce){for(var ve=-1,ut=Array(se);++ve<se;)ut[ve]=Ce(ve);return ut}o(B2,"baseTimes");function ZM(se,Ce){return Mr(Ce,function(ve){return[ve,se[ve]]})}o(ZM,"baseToPairs");function UD(se){return se&&se.slice(0,qD(se)+1).replace(Y0,"")}o(UD,"baseTrim");function Ms(se){return function(Ce){return se(Ce)}}o(Ms,"baseUnary");function D2(se,Ce){return Mr(Ce,function(ve){return se[ve]})}o(D2,"baseValues");function Q0(se,Ce){return se.has(Ce)}o(Q0,"cacheHas");function MD(se,Ce){for(var ve=-1,ut=se.length;++ve<ut&&Sh(Ce,se[ve],0)>-1;);return ve}o(MD,"charsStartIndex");function jD(se,Ce){for(var ve=se.length;ve--&&Sh(Ce,se[ve],0)>-1;);return ve}o(jD,"charsEndIndex");function ej(se,Ce){for(var ve=se.length,ut=0;ve--;)se[ve]===Ce&&++ut;return ut}o(ej,"countHolders");var tj=T2(UM),rj=T2(MM);function nj(se){return"\\"+FM[se]}o(nj,"escapeStringChar");function sj(se,Ce){return se==null?r:se[Ce]}o(sj,"getValue");function Eh(se){return OM.test(se)}o(Eh,"hasUnicode");function ij(se){return kM.test(se)}o(ij,"hasUnicodeWord");function aj(se){for(var Ce,ve=[];!(Ce=se.next()).done;)ve.push(Ce.value);return ve}o(aj,"iteratorToArray");function _2(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut,Pt){ve[++Ce]=[Pt,ut]}),ve}o(_2,"mapToArray");function FD(se,Ce){return function(ve){return se(Ce(ve))}}o(FD,"overArg");function su(se,Ce){for(var ve=-1,ut=se.length,Pt=0,mr=[];++ve<ut;){var dn=se[ve];(dn===Ce||dn===l)&&(se[ve]=l,mr[Pt++]=ve)}return mr}o(su,"replaceHolders");function Bv(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut){ve[++Ce]=ut}),ve}o(Bv,"setToArray");function oj(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut){ve[++Ce]=[ut,ut]}),ve}o(oj,"setToPairs");function uj(se,Ce,ve){for(var ut=ve-1,Pt=se.length;++ut<Pt;)if(se[ut]===Ce)return ut;return-1}o(uj,"strictIndexOf");function lj(se,Ce,ve){for(var ut=ve+1;ut--;)if(se[ut]===Ce)return ut;return ut}o(lj,"strictLastIndexOf");function Ah(se){return Eh(se)?fj(se):WM(se)}o(Ah,"stringSize");function ki(se){return Eh(se)?hj(se):JM(se)}o(ki,"stringToArray");function qD(se){for(var Ce=se.length;Ce--&&Cv.test(se.charAt(Ce)););return Ce}o(qD,"trimmedEndIndex");var cj=T2(jM);function fj(se){for(var Ce=S2.lastIndex=0;S2.test(se);)++Ce;return Ce}o(fj,"unicodeSize");function hj(se){return se.match(S2)||[]}o(hj,"unicodeToArray");function pj(se){return se.match(PM)||[]}o(pj,"unicodeWords");var dj=o(function se(Ce){Ce=Ce==null?Sn:iu.defaults(Sn.Object(),Ce,iu.pick(Sn,LM));var ve=Ce.Array,ut=Ce.Date,Pt=Ce.Error,mr=Ce.Function,dn=Ce.Math,Cr=Ce.Object,R2=Ce.RegExp,mj=Ce.String,si=Ce.TypeError,Dv=ve.prototype,gj=mr.prototype,Ch=Cr.prototype,_v=Ce["__core-js_shared__"],Rv=gj.toString,wr=Ch.hasOwnProperty,yj=0,HD=(function(){var c=/[^.]+$/.exec(_v&&_v.keys&&_v.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),Pv=Ch.toString,vj=Rv.call(Cr),wj=Sn._,Sj=R2("^"+Rv.call(wr).replace(or,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ov=ND?Ce.Buffer:r,au=Ce.Symbol,kv=Ce.Uint8Array,KD=Ov?Ov.allocUnsafe:r,Lv=FD(Cr.getPrototypeOf,Cr),$D=Cr.create,XD=Ch.propertyIsEnumerable,Vv=Dv.splice,GD=au?au.isConcatSpreadable:r,Z0=au?au.iterator:r,nc=au?au.toStringTag:r,Uv=(function(){try{var c=uc(Cr,"defineProperty");return c({},"",{}),c}catch{}})(),Ej=Ce.clearTimeout!==Sn.clearTimeout&&Ce.clearTimeout,Aj=ut&&ut.now!==Sn.Date.now&&ut.now,Cj=Ce.setTimeout!==Sn.setTimeout&&Ce.setTimeout,Mv=dn.ceil,jv=dn.floor,P2=Cr.getOwnPropertySymbols,bj=Ov?Ov.isBuffer:r,WD=Ce.isFinite,xj=Dv.join,Nj=FD(Cr.keys,Cr),mn=dn.max,Gn=dn.min,Tj=ut.now,Ij=Ce.parseInt,JD=dn.random,Bj=Dv.reverse,O2=uc(Ce,"DataView"),em=uc(Ce,"Map"),k2=uc(Ce,"Promise"),bh=uc(Ce,"Set"),tm=uc(Ce,"WeakMap"),rm=uc(Cr,"create"),Fv=tm&&new tm,xh={},Dj=lc(O2),_j=lc(em),Rj=lc(k2),Pj=lc(bh),Oj=lc(tm),qv=au?au.prototype:r,nm=qv?qv.valueOf:r,zD=qv?qv.toString:r;function M(c){if(Wr(c)&&!Lt(c)&&!(c instanceof er)){if(c instanceof ii)return c;if(wr.call(c,"__wrapped__"))return Y_(c)}return new ii(c)}o(M,"lodash");var Nh=(function(){function c(){}return o(c,"object"),function(p){if(!qr(p))return{};if($D)return $D(p);c.prototype=p;var v=new c;return c.prototype=r,v}})();function Hv(){}o(Hv,"baseLodash");function ii(c,p){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=r}o(ii,"LodashWrapper"),M.templateSettings={escape:kt,evaluate:Wt,interpolate:et,variable:"",imports:{_:M}},M.prototype=Hv.prototype,M.prototype.constructor=M,ii.prototype=Nh(Hv.prototype),ii.prototype.constructor=ii;function er(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ke,this.__views__=[]}o(er,"LazyWrapper");function kj(){var c=new er(this.__wrapped__);return c.__actions__=gs(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=gs(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=gs(this.__views__),c}o(kj,"lazyClone");function Lj(){if(this.__filtered__){var c=new er(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}o(Lj,"lazyReverse");function Vj(){var c=this.__wrapped__.value(),p=this.__dir__,v=Lt(c),N=p<0,P=v?c.length:0,j=JF(0,P,this.__views__),z=j.start,Q=j.end,ue=Q-z,Ne=N?Q:z-1,De=this.__iteratees__,Le=De.length,ze=0,ht=Gn(ue,this.__takeCount__);if(!v||!N&&P==ue&&ht==ue)return S_(c,this.__actions__);var bt=[];e:for(;ue--&&ze<ht;){Ne+=p;for(var Kt=-1,xt=c[Ne];++Kt<Le;){var Jt=De[Kt],sr=Jt.iteratee,qs=Jt.type,os=sr(xt);if(qs==he)xt=os;else if(!os){if(qs==G)continue e;break e}}bt[ze++]=xt}return bt}o(Vj,"lazyValue"),er.prototype=Nh(Hv.prototype),er.prototype.constructor=er;function sc(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(sc,"Hash");function Uj(){this.__data__=rm?rm(null):{},this.size=0}o(Uj,"hashClear");function Mj(c){var p=this.has(c)&&delete this.__data__[c];return this.size-=p?1:0,p}o(Mj,"hashDelete");function jj(c){var p=this.__data__;if(rm){var v=p[c];return v===a?r:v}return wr.call(p,c)?p[c]:r}o(jj,"hashGet");function Fj(c){var p=this.__data__;return rm?p[c]!==r:wr.call(p,c)}o(Fj,"hashHas");function qj(c,p){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=rm&&p===r?a:p,this}o(qj,"hashSet"),sc.prototype.clear=Uj,sc.prototype.delete=Mj,sc.prototype.get=jj,sc.prototype.has=Fj,sc.prototype.set=qj;function eo(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(eo,"ListCache");function Hj(){this.__data__=[],this.size=0}o(Hj,"listCacheClear");function Kj(c){var p=this.__data__,v=Kv(p,c);if(v<0)return!1;var N=p.length-1;return v==N?p.pop():Vv.call(p,v,1),--this.size,!0}o(Kj,"listCacheDelete");function $j(c){var p=this.__data__,v=Kv(p,c);return v<0?r:p[v][1]}o($j,"listCacheGet");function Xj(c){return Kv(this.__data__,c)>-1}o(Xj,"listCacheHas");function Gj(c,p){var v=this.__data__,N=Kv(v,c);return N<0?(++this.size,v.push([c,p])):v[N][1]=p,this}o(Gj,"listCacheSet"),eo.prototype.clear=Hj,eo.prototype.delete=Kj,eo.prototype.get=$j,eo.prototype.has=Xj,eo.prototype.set=Gj;function to(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(to,"MapCache");function Wj(){this.size=0,this.__data__={hash:new sc,map:new(em||eo),string:new sc}}o(Wj,"mapCacheClear");function Jj(c){var p=rw(this,c).delete(c);return this.size-=p?1:0,p}o(Jj,"mapCacheDelete");function zj(c){return rw(this,c).get(c)}o(zj,"mapCacheGet");function Yj(c){return rw(this,c).has(c)}o(Yj,"mapCacheHas");function Qj(c,p){var v=rw(this,c),N=v.size;return v.set(c,p),this.size+=v.size==N?0:1,this}o(Qj,"mapCacheSet"),to.prototype.clear=Wj,to.prototype.delete=Jj,to.prototype.get=zj,to.prototype.has=Yj,to.prototype.set=Qj;function ic(c){var p=-1,v=c==null?0:c.length;for(this.__data__=new to;++p<v;)this.add(c[p])}o(ic,"SetCache");function Zj(c){return this.__data__.set(c,a),this}o(Zj,"setCacheAdd");function eF(c){return this.__data__.has(c)}o(eF,"setCacheHas"),ic.prototype.add=ic.prototype.push=Zj,ic.prototype.has=eF;function Li(c){var p=this.__data__=new eo(c);this.size=p.size}o(Li,"Stack");function tF(){this.__data__=new eo,this.size=0}o(tF,"stackClear");function rF(c){var p=this.__data__,v=p.delete(c);return this.size=p.size,v}o(rF,"stackDelete");function nF(c){return this.__data__.get(c)}o(nF,"stackGet");function sF(c){return this.__data__.has(c)}o(sF,"stackHas");function iF(c,p){var v=this.__data__;if(v instanceof eo){var N=v.__data__;if(!em||N.length<t-1)return N.push([c,p]),this.size=++v.size,this;v=this.__data__=new to(N)}return v.set(c,p),this.size=v.size,this}o(iF,"stackSet"),Li.prototype.clear=tF,Li.prototype.delete=rF,Li.prototype.get=nF,Li.prototype.has=sF,Li.prototype.set=iF;function YD(c,p){var v=Lt(c),N=!v&&cc(c),P=!v&&!N&&fu(c),j=!v&&!N&&!P&&Dh(c),z=v||N||P||j,Q=z?B2(c.length,mj):[],ue=Q.length;for(var Ne in c)(p||wr.call(c,Ne))&&!(z&&(Ne=="length"||P&&(Ne=="offset"||Ne=="parent")||j&&(Ne=="buffer"||Ne=="byteLength"||Ne=="byteOffset")||io(Ne,ue)))&&Q.push(Ne);return Q}o(YD,"arrayLikeKeys");function QD(c){var p=c.length;return p?c[X2(0,p-1)]:r}o(QD,"arraySample");function aF(c,p){return nw(gs(c),ac(p,0,c.length))}o(aF,"arraySampleSize");function oF(c){return nw(gs(c))}o(oF,"arrayShuffle");function L2(c,p,v){(v!==r&&!Vi(c[p],v)||v===r&&!(p in c))&&ro(c,p,v)}o(L2,"assignMergeValue");function sm(c,p,v){var N=c[p];(!(wr.call(c,p)&&Vi(N,v))||v===r&&!(p in c))&&ro(c,p,v)}o(sm,"assignValue");function Kv(c,p){for(var v=c.length;v--;)if(Vi(c[v][0],p))return v;return-1}o(Kv,"assocIndexOf");function uF(c,p,v,N){return ou(c,function(P,j,z){p(N,P,v(P),z)}),N}o(uF,"baseAggregator");function ZD(c,p){return c&&ca(p,En(p),c)}o(ZD,"baseAssign");function lF(c,p){return c&&ca(p,vs(p),c)}o(lF,"baseAssignIn");function ro(c,p,v){p=="__proto__"&&Uv?Uv(c,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[p]=v}o(ro,"baseAssignValue");function V2(c,p){for(var v=-1,N=p.length,P=ve(N),j=c==null;++v<N;)P[v]=j?r:yb(c,p[v]);return P}o(V2,"baseAt");function ac(c,p,v){return c===c&&(v!==r&&(c=c<=v?c:v),p!==r&&(c=c>=p?c:p)),c}o(ac,"baseClamp");function ai(c,p,v,N,P,j){var z,Q=p&f,ue=p&h,Ne=p&m;if(v&&(z=P?v(c,N,P,j):v(c)),z!==r)return z;if(!qr(c))return c;var De=Lt(c);if(De){if(z=YF(c),!Q)return gs(c,z)}else{var Le=Wn(c),ze=Le==Xe||Le==Re;if(fu(c))return C_(c,Q);if(Le==je||Le==Je||ze&&!P){if(z=ue||ze?{}:q_(c),!Q)return ue?jF(c,lF(z,c)):MF(c,ZD(z,c))}else{if(!Tr[Le])return P?c:{};z=QF(c,Le,Q)}}j||(j=new Li);var ht=j.get(c);if(ht)return ht;j.set(c,z),yR(c)?c.forEach(function(xt){z.add(ai(xt,p,v,xt,c,j))}):mR(c)&&c.forEach(function(xt,Jt){z.set(Jt,ai(xt,p,v,Jt,c,j))});var bt=Ne?ue?nb:rb:ue?vs:En,Kt=De?r:bt(c);return ni(Kt||c,function(xt,Jt){Kt&&(Jt=xt,xt=c[Jt]),sm(z,Jt,ai(xt,p,v,Jt,c,j))}),z}o(ai,"baseClone");function cF(c){var p=En(c);return function(v){return e_(v,c,p)}}o(cF,"baseConforms");function e_(c,p,v){var N=v.length;if(c==null)return!N;for(c=Cr(c);N--;){var P=v[N],j=p[P],z=c[P];if(z===r&&!(P in c)||!j(z))return!1}return!0}o(e_,"baseConformsTo");function t_(c,p,v){if(typeof c!="function")throw new si(s);return fm(function(){c.apply(r,v)},p)}o(t_,"baseDelay");function im(c,p,v,N){var P=-1,j=Tv,z=!0,Q=c.length,ue=[],Ne=p.length;if(!Q)return ue;v&&(p=Mr(p,Ms(v))),N?(j=C2,z=!1):p.length>=t&&(j=Q0,z=!1,p=new ic(p));e:for(;++P<Q;){var De=c[P],Le=v==null?De:v(De);if(De=N||De!==0?De:0,z&&Le===Le){for(var ze=Ne;ze--;)if(p[ze]===Le)continue e;ue.push(De)}else j(p,Le,N)||ue.push(De)}return ue}o(im,"baseDifference");var ou=I_(la),r_=I_(M2,!0);function fF(c,p){var v=!0;return ou(c,function(N,P,j){return v=!!p(N,P,j),v}),v}o(fF,"baseEvery");function $v(c,p,v){for(var N=-1,P=c.length;++N<P;){var j=c[N],z=p(j);if(z!=null&&(Q===r?z===z&&!Fs(z):v(z,Q)))var Q=z,ue=j}return ue}o($v,"baseExtremum");function hF(c,p,v,N){var P=c.length;for(v=jt(v),v<0&&(v=-v>P?0:P+v),N=N===r||N>P?P:jt(N),N<0&&(N+=P),N=v>N?0:wR(N);v<N;)c[v++]=p;return c}o(hF,"baseFill");function n_(c,p){var v=[];return ou(c,function(N,P,j){p(N,P,j)&&v.push(N)}),v}o(n_,"baseFilter");function Rn(c,p,v,N,P){var j=-1,z=c.length;for(v||(v=e9),P||(P=[]);++j<z;){var Q=c[j];p>0&&v(Q)?p>1?Rn(Q,p-1,v,N,P):nu(P,Q):N||(P[P.length]=Q)}return P}o(Rn,"baseFlatten");var U2=B_(),s_=B_(!0);function la(c,p){return c&&U2(c,p,En)}o(la,"baseForOwn");function M2(c,p){return c&&s_(c,p,En)}o(M2,"baseForOwnRight");function Xv(c,p){return ru(p,function(v){return ao(c[v])})}o(Xv,"baseFunctions");function oc(c,p){p=lu(p,c);for(var v=0,N=p.length;c!=null&&v<N;)c=c[fa(p[v++])];return v&&v==N?c:r}o(oc,"baseGet");function i_(c,p,v){var N=p(c);return Lt(c)?N:nu(N,v(c))}o(i_,"baseGetAllKeys");function is(c){return c==null?c===r?ms:rr:nc&&nc in Cr(c)?WF(c):o9(c)}o(is,"baseGetTag");function j2(c,p){return c>p}o(j2,"baseGt");function pF(c,p){return c!=null&&wr.call(c,p)}o(pF,"baseHas");function dF(c,p){return c!=null&&p in Cr(c)}o(dF,"baseHasIn");function mF(c,p,v){return c>=Gn(p,v)&&c<mn(p,v)}o(mF,"baseInRange");function F2(c,p,v){for(var N=v?C2:Tv,P=c[0].length,j=c.length,z=j,Q=ve(j),ue=1/0,Ne=[];z--;){var De=c[z];z&&p&&(De=Mr(De,Ms(p))),ue=Gn(De.length,ue),Q[z]=!v&&(p||P>=120&&De.length>=120)?new ic(z&&De):r}De=c[0];var Le=-1,ze=Q[0];e:for(;++Le<P&&Ne.length<ue;){var ht=De[Le],bt=p?p(ht):ht;if(ht=v||ht!==0?ht:0,!(ze?Q0(ze,bt):N(Ne,bt,v))){for(z=j;--z;){var Kt=Q[z];if(!(Kt?Q0(Kt,bt):N(c[z],bt,v)))continue e}ze&&ze.push(bt),Ne.push(ht)}}return Ne}o(F2,"baseIntersection");function gF(c,p,v,N){return la(c,function(P,j,z){p(N,v(P),j,z)}),N}o(gF,"baseInverter");function am(c,p,v){p=lu(p,c),c=X_(c,p);var N=c==null?c:c[fa(ui(p))];return N==null?r:Us(N,c,v)}o(am,"baseInvoke");function a_(c){return Wr(c)&&is(c)==Je}o(a_,"baseIsArguments");function yF(c){return Wr(c)&&is(c)==Ze}o(yF,"baseIsArrayBuffer");function vF(c){return Wr(c)&&is(c)==_}o(vF,"baseIsDate");function om(c,p,v,N,P){return c===p?!0:c==null||p==null||!Wr(c)&&!Wr(p)?c!==c&&p!==p:wF(c,p,v,N,om,P)}o(om,"baseIsEqual");function wF(c,p,v,N,P,j){var z=Lt(c),Q=Lt(p),ue=z?Ye:Wn(c),Ne=Q?Ye:Wn(p);ue=ue==Je?je:ue,Ne=Ne==Je?je:Ne;var De=ue==je,Le=Ne==je,ze=ue==Ne;if(ze&&fu(c)){if(!fu(p))return!1;z=!0,De=!1}if(ze&&!De)return j||(j=new Li),z||Dh(c)?M_(c,p,v,N,P,j):XF(c,p,ue,v,N,P,j);if(!(v&g)){var ht=De&&wr.call(c,"__wrapped__"),bt=Le&&wr.call(p,"__wrapped__");if(ht||bt){var Kt=ht?c.value():c,xt=bt?p.value():p;return j||(j=new Li),P(Kt,xt,v,N,j)}}return ze?(j||(j=new Li),GF(c,p,v,N,P,j)):!1}o(wF,"baseIsEqualDeep");function SF(c){return Wr(c)&&Wn(c)==xe}o(SF,"baseIsMap");function q2(c,p,v,N){var P=v.length,j=P,z=!N;if(c==null)return!j;for(c=Cr(c);P--;){var Q=v[P];if(z&&Q[2]?Q[1]!==c[Q[0]]:!(Q[0]in c))return!1}for(;++P<j;){Q=v[P];var ue=Q[0],Ne=c[ue],De=Q[1];if(z&&Q[2]){if(Ne===r&&!(ue in c))return!1}else{var Le=new Li;if(N)var ze=N(Ne,De,ue,c,p,Le);if(!(ze===r?om(De,Ne,g|w,N,Le):ze))return!1}}return!0}o(q2,"baseIsMatch");function o_(c){if(!qr(c)||r9(c))return!1;var p=ao(c)?Sj:cM;return p.test(lc(c))}o(o_,"baseIsNative");function EF(c){return Wr(c)&&is(c)==Ge}o(EF,"baseIsRegExp");function AF(c){return Wr(c)&&Wn(c)==Ur}o(AF,"baseIsSet");function CF(c){return Wr(c)&&lw(c.length)&&!!kr[is(c)]}o(CF,"baseIsTypedArray");function u_(c){return typeof c=="function"?c:c==null?ws:typeof c=="object"?Lt(c)?f_(c[0],c[1]):c_(c):DR(c)}o(u_,"baseIteratee");function H2(c){if(!cm(c))return Nj(c);var p=[];for(var v in Cr(c))wr.call(c,v)&&v!="constructor"&&p.push(v);return p}o(H2,"baseKeys");function bF(c){if(!qr(c))return a9(c);var p=cm(c),v=[];for(var N in c)N=="constructor"&&(p||!wr.call(c,N))||v.push(N);return v}o(bF,"baseKeysIn");function K2(c,p){return c<p}o(K2,"baseLt");function l_(c,p){var v=-1,N=ys(c)?ve(c.length):[];return ou(c,function(P,j,z){N[++v]=p(P,j,z)}),N}o(l_,"baseMap");function c_(c){var p=ib(c);return p.length==1&&p[0][2]?K_(p[0][0],p[0][1]):function(v){return v===c||q2(v,c,p)}}o(c_,"baseMatches");function f_(c,p){return ob(c)&&H_(p)?K_(fa(c),p):function(v){var N=yb(v,c);return N===r&&N===p?vb(v,c):om(p,N,g|w)}}o(f_,"baseMatchesProperty");function Gv(c,p,v,N,P){c!==p&&U2(p,function(j,z){if(P||(P=new Li),qr(j))xF(c,p,z,v,Gv,N,P);else{var Q=N?N(lb(c,z),j,z+"",c,p,P):r;Q===r&&(Q=j),L2(c,z,Q)}},vs)}o(Gv,"baseMerge");function xF(c,p,v,N,P,j,z){var Q=lb(c,v),ue=lb(p,v),Ne=z.get(ue);if(Ne){L2(c,v,Ne);return}var De=j?j(Q,ue,v+"",c,p,z):r,Le=De===r;if(Le){var ze=Lt(ue),ht=!ze&&fu(ue),bt=!ze&&!ht&&Dh(ue);De=ue,ze||ht||bt?Lt(Q)?De=Q:en(Q)?De=gs(Q):ht?(Le=!1,De=C_(ue,!0)):bt?(Le=!1,De=b_(ue,!0)):De=[]:hm(ue)||cc(ue)?(De=Q,cc(Q)?De=SR(Q):(!qr(Q)||ao(Q))&&(De=q_(ue))):Le=!1}Le&&(z.set(ue,De),P(De,ue,N,j,z),z.delete(ue)),L2(c,v,De)}o(xF,"baseMergeDeep");function h_(c,p){var v=c.length;if(v)return p+=p<0?v:0,io(p,v)?c[p]:r}o(h_,"baseNth");function p_(c,p,v){p.length?p=Mr(p,function(j){return Lt(j)?function(z){return oc(z,j.length===1?j[0]:j)}:j}):p=[ws];var N=-1;p=Mr(p,Ms(Et()));var P=l_(c,function(j,z,Q){var ue=Mr(p,function(Ne){return Ne(j)});return{criteria:ue,index:++N,value:j}});return QM(P,function(j,z){return UF(j,z,v)})}o(p_,"baseOrderBy");function NF(c,p){return d_(c,p,function(v,N){return vb(c,N)})}o(NF,"basePick");function d_(c,p,v){for(var N=-1,P=p.length,j={};++N<P;){var z=p[N],Q=oc(c,z);v(Q,z)&&um(j,lu(z,c),Q)}return j}o(d_,"basePickBy");function TF(c){return function(p){return oc(p,c)}}o(TF,"basePropertyDeep");function $2(c,p,v,N){var P=N?YM:Sh,j=-1,z=p.length,Q=c;for(c===p&&(p=gs(p)),v&&(Q=Mr(c,Ms(v)));++j<z;)for(var ue=0,Ne=p[j],De=v?v(Ne):Ne;(ue=P(Q,De,ue,N))>-1;)Q!==c&&Vv.call(Q,ue,1),Vv.call(c,ue,1);return c}o($2,"basePullAll");function m_(c,p){for(var v=c?p.length:0,N=v-1;v--;){var P=p[v];if(v==N||P!==j){var j=P;io(P)?Vv.call(c,P,1):J2(c,P)}}return c}o(m_,"basePullAt");function X2(c,p){return c+jv(JD()*(p-c+1))}o(X2,"baseRandom");function IF(c,p,v,N){for(var P=-1,j=mn(Mv((p-c)/(v||1)),0),z=ve(j);j--;)z[N?j:++P]=c,c+=v;return z}o(IF,"baseRange");function G2(c,p){var v="";if(!c||p<1||p>Z)return v;do p%2&&(v+=c),p=jv(p/2),p&&(c+=c);while(p);return v}o(G2,"baseRepeat");function Gt(c,p){return cb($_(c,p,ws),c+"")}o(Gt,"baseRest");function BF(c){return QD(_h(c))}o(BF,"baseSample");function DF(c,p){var v=_h(c);return nw(v,ac(p,0,v.length))}o(DF,"baseSampleSize");function um(c,p,v,N){if(!qr(c))return c;p=lu(p,c);for(var P=-1,j=p.length,z=j-1,Q=c;Q!=null&&++P<j;){var ue=fa(p[P]),Ne=v;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return c;if(P!=z){var De=Q[ue];Ne=N?N(De,ue,Q):r,Ne===r&&(Ne=qr(De)?De:io(p[P+1])?[]:{})}sm(Q,ue,Ne),Q=Q[ue]}return c}o(um,"baseSet");var g_=Fv?function(c,p){return Fv.set(c,p),c}:ws,_F=Uv?function(c,p){return Uv(c,"toString",{configurable:!0,enumerable:!1,value:Sb(p),writable:!0})}:ws;function RF(c){return nw(_h(c))}o(RF,"baseShuffle");function oi(c,p,v){var N=-1,P=c.length;p<0&&(p=-p>P?0:P+p),v=v>P?P:v,v<0&&(v+=P),P=p>v?0:v-p>>>0,p>>>=0;for(var j=ve(P);++N<P;)j[N]=c[N+p];return j}o(oi,"baseSlice");function PF(c,p){var v;return ou(c,function(N,P,j){return v=p(N,P,j),!v}),!!v}o(PF,"baseSome");function Wv(c,p,v){var N=0,P=c==null?N:c.length;if(typeof p=="number"&&p===p&&P<=we){for(;N<P;){var j=N+P>>>1,z=c[j];z!==null&&!Fs(z)&&(v?z<=p:z<p)?N=j+1:P=j}return P}return W2(c,p,ws,v)}o(Wv,"baseSortedIndex");function W2(c,p,v,N){var P=0,j=c==null?0:c.length;if(j===0)return 0;p=v(p);for(var z=p!==p,Q=p===null,ue=Fs(p),Ne=p===r;P<j;){var De=jv((P+j)/2),Le=v(c[De]),ze=Le!==r,ht=Le===null,bt=Le===Le,Kt=Fs(Le);if(z)var xt=N||bt;else Ne?xt=bt&&(N||ze):Q?xt=bt&&ze&&(N||!ht):ue?xt=bt&&ze&&!ht&&(N||!Kt):ht||Kt?xt=!1:xt=N?Le<=p:Le<p;xt?P=De+1:j=De}return Gn(j,be)}o(W2,"baseSortedIndexBy");function y_(c,p){for(var v=-1,N=c.length,P=0,j=[];++v<N;){var z=c[v],Q=p?p(z):z;if(!v||!Vi(Q,ue)){var ue=Q;j[P++]=z===0?0:z}}return j}o(y_,"baseSortedUniq");function v_(c){return typeof c=="number"?c:Fs(c)?Se:+c}o(v_,"baseToNumber");function js(c){if(typeof c=="string")return c;if(Lt(c))return Mr(c,js)+"";if(Fs(c))return zD?zD.call(c):"";var p=c+"";return p=="0"&&1/c==-oe?"-0":p}o(js,"baseToString");function uu(c,p,v){var N=-1,P=Tv,j=c.length,z=!0,Q=[],ue=Q;if(v)z=!1,P=C2;else if(j>=t){var Ne=p?null:KF(c);if(Ne)return Bv(Ne);z=!1,P=Q0,ue=new ic}else ue=p?[]:Q;e:for(;++N<j;){var De=c[N],Le=p?p(De):De;if(De=v||De!==0?De:0,z&&Le===Le){for(var ze=ue.length;ze--;)if(ue[ze]===Le)continue e;p&&ue.push(Le),Q.push(De)}else P(ue,Le,v)||(ue!==Q&&ue.push(Le),Q.push(De))}return Q}o(uu,"baseUniq");function J2(c,p){return p=lu(p,c),c=X_(c,p),c==null||delete c[fa(ui(p))]}o(J2,"baseUnset");function w_(c,p,v,N){return um(c,p,v(oc(c,p)),N)}o(w_,"baseUpdate");function Jv(c,p,v,N){for(var P=c.length,j=N?P:-1;(N?j--:++j<P)&&p(c[j],j,c););return v?oi(c,N?0:j,N?j+1:P):oi(c,N?j+1:0,N?P:j)}o(Jv,"baseWhile");function S_(c,p){var v=c;return v instanceof er&&(v=v.value()),b2(p,function(N,P){return P.func.apply(P.thisArg,nu([N],P.args))},v)}o(S_,"baseWrapperValue");function z2(c,p,v){var N=c.length;if(N<2)return N?uu(c[0]):[];for(var P=-1,j=ve(N);++P<N;)for(var z=c[P],Q=-1;++Q<N;)Q!=P&&(j[P]=im(j[P]||z,c[Q],p,v));return uu(Rn(j,1),p,v)}o(z2,"baseXor");function E_(c,p,v){for(var N=-1,P=c.length,j=p.length,z={};++N<P;){var Q=N<j?p[N]:r;v(z,c[N],Q)}return z}o(E_,"baseZipObject");function Y2(c){return en(c)?c:[]}o(Y2,"castArrayLikeObject");function Q2(c){return typeof c=="function"?c:ws}o(Q2,"castFunction");function lu(c,p){return Lt(c)?c:ob(c,p)?[c]:z_(gr(c))}o(lu,"castPath");var OF=Gt;function cu(c,p,v){var N=c.length;return v=v===r?N:v,!p&&v>=N?c:oi(c,p,v)}o(cu,"castSlice");var A_=Ej||function(c){return Sn.clearTimeout(c)};function C_(c,p){if(p)return c.slice();var v=c.length,N=KD?KD(v):new c.constructor(v);return c.copy(N),N}o(C_,"cloneBuffer");function Z2(c){var p=new c.constructor(c.byteLength);return new kv(p).set(new kv(c)),p}o(Z2,"cloneArrayBuffer");function kF(c,p){var v=p?Z2(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}o(kF,"cloneDataView");function LF(c){var p=new c.constructor(c.source,Oi.exec(c));return p.lastIndex=c.lastIndex,p}o(LF,"cloneRegExp");function VF(c){return nm?Cr(nm.call(c)):{}}o(VF,"cloneSymbol");function b_(c,p){var v=p?Z2(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}o(b_,"cloneTypedArray");function x_(c,p){if(c!==p){var v=c!==r,N=c===null,P=c===c,j=Fs(c),z=p!==r,Q=p===null,ue=p===p,Ne=Fs(p);if(!Q&&!Ne&&!j&&c>p||j&&z&&ue&&!Q&&!Ne||N&&z&&ue||!v&&ue||!P)return 1;if(!N&&!j&&!Ne&&c<p||Ne&&v&&P&&!N&&!j||Q&&v&&P||!z&&P||!ue)return-1}return 0}o(x_,"compareAscending");function UF(c,p,v){for(var N=-1,P=c.criteria,j=p.criteria,z=P.length,Q=v.length;++N<z;){var ue=x_(P[N],j[N]);if(ue){if(N>=Q)return ue;var Ne=v[N];return ue*(Ne=="desc"?-1:1)}}return c.index-p.index}o(UF,"compareMultiple");function N_(c,p,v,N){for(var P=-1,j=c.length,z=v.length,Q=-1,ue=p.length,Ne=mn(j-z,0),De=ve(ue+Ne),Le=!N;++Q<ue;)De[Q]=p[Q];for(;++P<z;)(Le||P<j)&&(De[v[P]]=c[P]);for(;Ne--;)De[Q++]=c[P++];return De}o(N_,"composeArgs");function T_(c,p,v,N){for(var P=-1,j=c.length,z=-1,Q=v.length,ue=-1,Ne=p.length,De=mn(j-Q,0),Le=ve(De+Ne),ze=!N;++P<De;)Le[P]=c[P];for(var ht=P;++ue<Ne;)Le[ht+ue]=p[ue];for(;++z<Q;)(ze||P<j)&&(Le[ht+v[z]]=c[P++]);return Le}o(T_,"composeArgsRight");function gs(c,p){var v=-1,N=c.length;for(p||(p=ve(N));++v<N;)p[v]=c[v];return p}o(gs,"copyArray");function ca(c,p,v,N){var P=!v;v||(v={});for(var j=-1,z=p.length;++j<z;){var Q=p[j],ue=N?N(v[Q],c[Q],Q,v,c):r;ue===r&&(ue=c[Q]),P?ro(v,Q,ue):sm(v,Q,ue)}return v}o(ca,"copyObject");function MF(c,p){return ca(c,ab(c),p)}o(MF,"copySymbols");function jF(c,p){return ca(c,j_(c),p)}o(jF,"copySymbolsIn");function zv(c,p){return function(v,N){var P=Lt(v)?$M:uF,j=p?p():{};return P(v,c,Et(N,2),j)}}o(zv,"createAggregator");function Th(c){return Gt(function(p,v){var N=-1,P=v.length,j=P>1?v[P-1]:r,z=P>2?v[2]:r;for(j=c.length>3&&typeof j=="function"?(P--,j):r,z&&as(v[0],v[1],z)&&(j=P<3?r:j,P=1),p=Cr(p);++N<P;){var Q=v[N];Q&&c(p,Q,N,j)}return p})}o(Th,"createAssigner");function I_(c,p){return function(v,N){if(v==null)return v;if(!ys(v))return c(v,N);for(var P=v.length,j=p?P:-1,z=Cr(v);(p?j--:++j<P)&&N(z[j],j,z)!==!1;);return v}}o(I_,"createBaseEach");function B_(c){return function(p,v,N){for(var P=-1,j=Cr(p),z=N(p),Q=z.length;Q--;){var ue=z[c?Q:++P];if(v(j[ue],ue,j)===!1)break}return p}}o(B_,"createBaseFor");function FF(c,p,v){var N=p&y,P=lm(c);function j(){var z=this&&this!==Sn&&this instanceof j?P:c;return z.apply(N?v:this,arguments)}return o(j,"wrapper"),j}o(FF,"createBind");function D_(c){return function(p){p=gr(p);var v=Eh(p)?ki(p):r,N=v?v[0]:p.charAt(0),P=v?cu(v,1).join(""):p.slice(1);return N[c]()+P}}o(D_,"createCaseFirst");function Ih(c){return function(p){return b2(IR(TR(p).replace(_M,"")),c,"")}}o(Ih,"createCompounder");function lm(c){return function(){var p=arguments;switch(p.length){case 0:return new c;case 1:return new c(p[0]);case 2:return new c(p[0],p[1]);case 3:return new c(p[0],p[1],p[2]);case 4:return new c(p[0],p[1],p[2],p[3]);case 5:return new c(p[0],p[1],p[2],p[3],p[4]);case 6:return new c(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new c(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=Nh(c.prototype),N=c.apply(v,p);return qr(N)?N:v}}o(lm,"createCtor");function qF(c,p,v){var N=lm(c);function P(){for(var j=arguments.length,z=ve(j),Q=j,ue=Bh(P);Q--;)z[Q]=arguments[Q];var Ne=j<3&&z[0]!==ue&&z[j-1]!==ue?[]:su(z,ue);if(j-=Ne.length,j<v)return k_(c,p,Yv,P.placeholder,r,z,Ne,r,r,v-j);var De=this&&this!==Sn&&this instanceof P?N:c;return Us(De,this,z)}return o(P,"wrapper"),P}o(qF,"createCurry");function __(c){return function(p,v,N){var P=Cr(p);if(!ys(p)){var j=Et(v,3);p=En(p),v=o(function(Q){return j(P[Q],Q,P)},"predicate")}var z=c(p,v,N);return z>-1?P[j?p[z]:z]:r}}o(__,"createFind");function R_(c){return so(function(p){var v=p.length,N=v,P=ii.prototype.thru;for(c&&p.reverse();N--;){var j=p[N];if(typeof j!="function")throw new si(s);if(P&&!z&&tw(j)=="wrapper")var z=new ii([],!0)}for(N=z?N:v;++N<v;){j=p[N];var Q=tw(j),ue=Q=="wrapper"?sb(j):r;ue&&ub(ue[0])&&ue[1]==(x|b|A|B)&&!ue[4].length&&ue[9]==1?z=z[tw(ue[0])].apply(z,ue[3]):z=j.length==1&&ub(j)?z[Q]():z.thru(j)}return function(){var Ne=arguments,De=Ne[0];if(z&&Ne.length==1&&Lt(De))return z.plant(De).value();for(var Le=0,ze=v?p[Le].apply(this,Ne):De;++Le<v;)ze=p[Le].call(this,ze);return ze}})}o(R_,"createFlow");function Yv(c,p,v,N,P,j,z,Q,ue,Ne){var De=p&x,Le=p&y,ze=p&S,ht=p&(b|T),bt=p&F,Kt=ze?r:lm(c);function xt(){for(var Jt=arguments.length,sr=ve(Jt),qs=Jt;qs--;)sr[qs]=arguments[qs];if(ht)var os=Bh(xt),Hs=ej(sr,os);if(N&&(sr=N_(sr,N,P,ht)),j&&(sr=T_(sr,j,z,ht)),Jt-=Hs,ht&&Jt<Ne){var tn=su(sr,os);return k_(c,p,Yv,xt.placeholder,v,sr,tn,Q,ue,Ne-Jt)}var Ui=Le?v:this,uo=ze?Ui[c]:c;return Jt=sr.length,Q?sr=u9(sr,Q):bt&&Jt>1&&sr.reverse(),De&&ue<Jt&&(sr.length=ue),this&&this!==Sn&&this instanceof xt&&(uo=Kt||lm(uo)),uo.apply(Ui,sr)}return o(xt,"wrapper"),xt}o(Yv,"createHybrid");function P_(c,p){return function(v,N){return gF(v,c,p(N),{})}}o(P_,"createInverter");function Qv(c,p){return function(v,N){var P;if(v===r&&N===r)return p;if(v!==r&&(P=v),N!==r){if(P===r)return N;typeof v=="string"||typeof N=="string"?(v=js(v),N=js(N)):(v=v_(v),N=v_(N)),P=c(v,N)}return P}}o(Qv,"createMathOperation");function eb(c){return so(function(p){return p=Mr(p,Ms(Et())),Gt(function(v){var N=this;return c(p,function(P){return Us(P,N,v)})})})}o(eb,"createOver");function Zv(c,p){p=p===r?" ":js(p);var v=p.length;if(v<2)return v?G2(p,c):p;var N=G2(p,Mv(c/Ah(p)));return Eh(p)?cu(ki(N),0,c).join(""):N.slice(0,c)}o(Zv,"createPadding");function HF(c,p,v,N){var P=p&y,j=lm(c);function z(){for(var Q=-1,ue=arguments.length,Ne=-1,De=N.length,Le=ve(De+ue),ze=this&&this!==Sn&&this instanceof z?j:c;++Ne<De;)Le[Ne]=N[Ne];for(;ue--;)Le[Ne++]=arguments[++Q];return Us(ze,P?v:this,Le)}return o(z,"wrapper"),z}o(HF,"createPartial");function O_(c){return function(p,v,N){return N&&typeof N!="number"&&as(p,v,N)&&(v=N=r),p=oo(p),v===r?(v=p,p=0):v=oo(v),N=N===r?p<v?1:-1:oo(N),IF(p,v,N,c)}}o(O_,"createRange");function ew(c){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=li(p),v=li(v)),c(p,v)}}o(ew,"createRelationalOperation");function k_(c,p,v,N,P,j,z,Q,ue,Ne){var De=p&b,Le=De?z:r,ze=De?r:z,ht=De?j:r,bt=De?r:j;p|=De?A:C,p&=~(De?C:A),p&E||(p&=~(y|S));var Kt=[c,p,P,ht,Le,bt,ze,Q,ue,Ne],xt=v.apply(r,Kt);return ub(c)&&G_(xt,Kt),xt.placeholder=N,W_(xt,c,p)}o(k_,"createRecurry");function tb(c){var p=dn[c];return function(v,N){if(v=li(v),N=N==null?0:Gn(jt(N),292),N&&WD(v)){var P=(gr(v)+"e").split("e"),j=p(P[0]+"e"+(+P[1]+N));return P=(gr(j)+"e").split("e"),+(P[0]+"e"+(+P[1]-N))}return p(v)}}o(tb,"createRound");var KF=bh&&1/Bv(new bh([,-0]))[1]==oe?function(c){return new bh(c)}:Cb;function L_(c){return function(p){var v=Wn(p);return v==xe?_2(p):v==Ur?oj(p):ZM(p,c(p))}}o(L_,"createToPairs");function no(c,p,v,N,P,j,z,Q){var ue=p&S;if(!ue&&typeof c!="function")throw new si(s);var Ne=N?N.length:0;if(Ne||(p&=~(A|C),N=P=r),z=z===r?z:mn(jt(z),0),Q=Q===r?Q:jt(Q),Ne-=P?P.length:0,p&C){var De=N,Le=P;N=P=r}var ze=ue?r:sb(c),ht=[c,p,v,N,P,De,Le,j,z,Q];if(ze&&i9(ht,ze),c=ht[0],p=ht[1],v=ht[2],N=ht[3],P=ht[4],Q=ht[9]=ht[9]===r?ue?0:c.length:mn(ht[9]-Ne,0),!Q&&p&(b|T)&&(p&=~(b|T)),!p||p==y)var bt=FF(c,p,v);else p==b||p==T?bt=qF(c,p,Q):(p==A||p==(y|A))&&!P.length?bt=HF(c,p,v,N):bt=Yv.apply(r,ht);var Kt=ze?g_:G_;return W_(Kt(bt,ht),c,p)}o(no,"createWrap");function V_(c,p,v,N){return c===r||Vi(c,Ch[v])&&!wr.call(N,v)?p:c}o(V_,"customDefaultsAssignIn");function U_(c,p,v,N,P,j){return qr(c)&&qr(p)&&(j.set(p,c),Gv(c,p,r,U_,j),j.delete(p)),c}o(U_,"customDefaultsMerge");function $F(c){return hm(c)?r:c}o($F,"customOmitClone");function M_(c,p,v,N,P,j){var z=v&g,Q=c.length,ue=p.length;if(Q!=ue&&!(z&&ue>Q))return!1;var Ne=j.get(c),De=j.get(p);if(Ne&&De)return Ne==p&&De==c;var Le=-1,ze=!0,ht=v&w?new ic:r;for(j.set(c,p),j.set(p,c);++Le<Q;){var bt=c[Le],Kt=p[Le];if(N)var xt=z?N(Kt,bt,Le,p,c,j):N(bt,Kt,Le,c,p,j);if(xt!==r){if(xt)continue;ze=!1;break}if(ht){if(!x2(p,function(Jt,sr){if(!Q0(ht,sr)&&(bt===Jt||P(bt,Jt,v,N,j)))return ht.push(sr)})){ze=!1;break}}else if(!(bt===Kt||P(bt,Kt,v,N,j))){ze=!1;break}}return j.delete(c),j.delete(p),ze}o(M_,"equalArrays");function XF(c,p,v,N,P,j,z){switch(v){case Dn:if(c.byteLength!=p.byteLength||c.byteOffset!=p.byteOffset)return!1;c=c.buffer,p=p.buffer;case Ze:return!(c.byteLength!=p.byteLength||!j(new kv(c),new kv(p)));case O:case _:case ct:return Vi(+c,+p);case J:return c.name==p.name&&c.message==p.message;case Ge:case on:return c==p+"";case xe:var Q=_2;case Ur:var ue=N&g;if(Q||(Q=Bv),c.size!=p.size&&!ue)return!1;var Ne=z.get(c);if(Ne)return Ne==p;N|=w,z.set(c,p);var De=M_(Q(c),Q(p),N,P,j,z);return z.delete(c),De;case $n:if(nm)return nm.call(c)==nm.call(p)}return!1}o(XF,"equalByTag");function GF(c,p,v,N,P,j){var z=v&g,Q=rb(c),ue=Q.length,Ne=rb(p),De=Ne.length;if(ue!=De&&!z)return!1;for(var Le=ue;Le--;){var ze=Q[Le];if(!(z?ze in p:wr.call(p,ze)))return!1}var ht=j.get(c),bt=j.get(p);if(ht&&bt)return ht==p&&bt==c;var Kt=!0;j.set(c,p),j.set(p,c);for(var xt=z;++Le<ue;){ze=Q[Le];var Jt=c[ze],sr=p[ze];if(N)var qs=z?N(sr,Jt,ze,p,c,j):N(Jt,sr,ze,c,p,j);if(!(qs===r?Jt===sr||P(Jt,sr,v,N,j):qs)){Kt=!1;break}xt||(xt=ze=="constructor")}if(Kt&&!xt){var os=c.constructor,Hs=p.constructor;os!=Hs&&"constructor"in c&&"constructor"in p&&!(typeof os=="function"&&os instanceof os&&typeof Hs=="function"&&Hs instanceof Hs)&&(Kt=!1)}return j.delete(c),j.delete(p),Kt}o(GF,"equalObjects");function so(c){return cb($_(c,r,eR),c+"")}o(so,"flatRest");function rb(c){return i_(c,En,ab)}o(rb,"getAllKeys");function nb(c){return i_(c,vs,j_)}o(nb,"getAllKeysIn");var sb=Fv?function(c){return Fv.get(c)}:Cb;function tw(c){for(var p=c.name+"",v=xh[p],N=wr.call(xh,p)?v.length:0;N--;){var P=v[N],j=P.func;if(j==null||j==c)return P.name}return p}o(tw,"getFuncName");function Bh(c){var p=wr.call(M,"placeholder")?M:c;return p.placeholder}o(Bh,"getHolder");function Et(){var c=M.iteratee||Eb;return c=c===Eb?u_:c,arguments.length?c(arguments[0],arguments[1]):c}o(Et,"getIteratee");function rw(c,p){var v=c.__data__;return t9(p)?v[typeof p=="string"?"string":"hash"]:v.map}o(rw,"getMapData");function ib(c){for(var p=En(c),v=p.length;v--;){var N=p[v],P=c[N];p[v]=[N,P,H_(P)]}return p}o(ib,"getMatchData");function uc(c,p){var v=sj(c,p);return o_(v)?v:r}o(uc,"getNative");function WF(c){var p=wr.call(c,nc),v=c[nc];try{c[nc]=r;var N=!0}catch{}var P=Pv.call(c);return N&&(p?c[nc]=v:delete c[nc]),P}o(WF,"getRawTag");var ab=P2?function(c){return c==null?[]:(c=Cr(c),ru(P2(c),function(p){return XD.call(c,p)}))}:bb,j_=P2?function(c){for(var p=[];c;)nu(p,ab(c)),c=Lv(c);return p}:bb,Wn=is;(O2&&Wn(new O2(new ArrayBuffer(1)))!=Dn||em&&Wn(new em)!=xe||k2&&Wn(k2.resolve())!=nr||bh&&Wn(new bh)!=Ur||tm&&Wn(new tm)!=ns)&&(Wn=o(function(c){var p=is(c),v=p==je?c.constructor:r,N=v?lc(v):"";if(N)switch(N){case Dj:return Dn;case _j:return xe;case Rj:return nr;case Pj:return Ur;case Oj:return ns}return p},"getTag"));function JF(c,p,v){for(var N=-1,P=v.length;++N<P;){var j=v[N],z=j.size;switch(j.type){case"drop":c+=z;break;case"dropRight":p-=z;break;case"take":p=Gn(p,c+z);break;case"takeRight":c=mn(c,p-z);break}}return{start:c,end:p}}o(JF,"getView");function zF(c){var p=c.match(h2);return p?p[1].split(p2):[]}o(zF,"getWrapDetails");function F_(c,p,v){p=lu(p,c);for(var N=-1,P=p.length,j=!1;++N<P;){var z=fa(p[N]);if(!(j=c!=null&&v(c,z)))break;c=c[z]}return j||++N!=P?j:(P=c==null?0:c.length,!!P&&lw(P)&&io(z,P)&&(Lt(c)||cc(c)))}o(F_,"hasPath");function YF(c){var p=c.length,v=new c.constructor(p);return p&&typeof c[0]=="string"&&wr.call(c,"index")&&(v.index=c.index,v.input=c.input),v}o(YF,"initCloneArray");function q_(c){return typeof c.constructor=="function"&&!cm(c)?Nh(Lv(c)):{}}o(q_,"initCloneObject");function QF(c,p,v){var N=c.constructor;switch(p){case Ze:return Z2(c);case O:case _:return new N(+c);case Dn:return kF(c,v);case ss:case aa:case oa:case Rt:case yh:case vh:case tc:case z0:case Vs:return b_(c,v);case xe:return new N;case ct:case on:return new N(c);case Ge:return LF(c);case Ur:return new N;case $n:return VF(c)}}o(QF,"initCloneByTag");function ZF(c,p){var v=p.length;if(!v)return c;var N=v-1;return p[N]=(v>1?"& ":"")+p[N],p=p.join(v>2?", ":" "),c.replace(f2,`{
23
+ /* [wrapped with `+p+`] */
24
+ `)}o(ZF,"insertWrapDetails");function e9(c){return Lt(c)||cc(c)||!!(GD&&c&&c[GD])}o(e9,"isFlattenable");function io(c,p){var v=typeof c;return p=p??Z,!!p&&(v=="number"||v!="symbol"&&hM.test(c))&&c>-1&&c%1==0&&c<p}o(io,"isIndex");function as(c,p,v){if(!qr(v))return!1;var N=typeof p;return(N=="number"?ys(v)&&io(p,v.length):N=="string"&&p in v)?Vi(v[p],c):!1}o(as,"isIterateeCall");function ob(c,p){if(Lt(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||Fs(c)?!0:_n.test(c)||!Dt.test(c)||p!=null&&c in Cr(p)}o(ob,"isKey");function t9(c){var p=typeof c;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?c!=="__proto__":c===null}o(t9,"isKeyable");function ub(c){var p=tw(c),v=M[p];if(typeof v!="function"||!(p in er.prototype))return!1;if(c===v)return!0;var N=sb(v);return!!N&&c===N[0]}o(ub,"isLaziable");function r9(c){return!!HD&&HD in c}o(r9,"isMasked");var n9=_v?ao:xb;function cm(c){var p=c&&c.constructor,v=typeof p=="function"&&p.prototype||Ch;return c===v}o(cm,"isPrototype");function H_(c){return c===c&&!qr(c)}o(H_,"isStrictComparable");function K_(c,p){return function(v){return v==null?!1:v[c]===p&&(p!==r||c in Cr(v))}}o(K_,"matchesStrictComparable");function s9(c){var p=ow(c,function(N){return v.size===u&&v.clear(),N}),v=p.cache;return p}o(s9,"memoizeCapped");function i9(c,p){var v=c[1],N=p[1],P=v|N,j=P<(y|S|x),z=N==x&&v==b||N==x&&v==B&&c[7].length<=p[8]||N==(x|B)&&p[7].length<=p[8]&&v==b;if(!(j||z))return c;N&y&&(c[2]=p[2],P|=v&y?0:E);var Q=p[3];if(Q){var ue=c[3];c[3]=ue?N_(ue,Q,p[4]):Q,c[4]=ue?su(c[3],l):p[4]}return Q=p[5],Q&&(ue=c[5],c[5]=ue?T_(ue,Q,p[6]):Q,c[6]=ue?su(c[5],l):p[6]),Q=p[7],Q&&(c[7]=Q),N&x&&(c[8]=c[8]==null?p[8]:Gn(c[8],p[8])),c[9]==null&&(c[9]=p[9]),c[0]=p[0],c[1]=P,c}o(i9,"mergeData");function a9(c){var p=[];if(c!=null)for(var v in Cr(c))p.push(v);return p}o(a9,"nativeKeysIn");function o9(c){return Pv.call(c)}o(o9,"objectToString");function $_(c,p,v){return p=mn(p===r?c.length-1:p,0),function(){for(var N=arguments,P=-1,j=mn(N.length-p,0),z=ve(j);++P<j;)z[P]=N[p+P];P=-1;for(var Q=ve(p+1);++P<p;)Q[P]=N[P];return Q[p]=v(z),Us(c,this,Q)}}o($_,"overRest");function X_(c,p){return p.length<2?c:oc(c,oi(p,0,-1))}o(X_,"parent");function u9(c,p){for(var v=c.length,N=Gn(p.length,v),P=gs(c);N--;){var j=p[N];c[N]=io(j,v)?P[j]:r}return c}o(u9,"reorder");function lb(c,p){if(!(p==="constructor"&&typeof c[p]=="function")&&p!="__proto__")return c[p]}o(lb,"safeGet");var G_=J_(g_),fm=Cj||function(c,p){return Sn.setTimeout(c,p)},cb=J_(_F);function W_(c,p,v){var N=p+"";return cb(c,ZF(N,l9(zF(N),v)))}o(W_,"setWrapToString");function J_(c){var p=0,v=0;return function(){var N=Tj(),P=K-(N-v);if(v=N,P>0){if(++p>=q)return arguments[0]}else p=0;return c.apply(r,arguments)}}o(J_,"shortOut");function nw(c,p){var v=-1,N=c.length,P=N-1;for(p=p===r?N:p;++v<p;){var j=X2(v,P),z=c[j];c[j]=c[v],c[v]=z}return c.length=p,c}o(nw,"shuffleSelf");var z_=s9(function(c){var p=[];return c.charCodeAt(0)===46&&p.push(""),c.replace(ti,function(v,N,P,j){p.push(P?j.replace(Zt,"$1"):N||v)}),p});function fa(c){if(typeof c=="string"||Fs(c))return c;var p=c+"";return p=="0"&&1/c==-oe?"-0":p}o(fa,"toKey");function lc(c){if(c!=null){try{return Rv.call(c)}catch{}try{return c+""}catch{}}return""}o(lc,"toSource");function l9(c,p){return ni(Me,function(v){var N="_."+v[0];p&v[1]&&!Tv(c,N)&&c.push(N)}),c.sort()}o(l9,"updateWrapDetails");function Y_(c){if(c instanceof er)return c.clone();var p=new ii(c.__wrapped__,c.__chain__);return p.__actions__=gs(c.__actions__),p.__index__=c.__index__,p.__values__=c.__values__,p}o(Y_,"wrapperClone");function c9(c,p,v){(v?as(c,p,v):p===r)?p=1:p=mn(jt(p),0);var N=c==null?0:c.length;if(!N||p<1)return[];for(var P=0,j=0,z=ve(Mv(N/p));P<N;)z[j++]=oi(c,P,P+=p);return z}o(c9,"chunk");function f9(c){for(var p=-1,v=c==null?0:c.length,N=0,P=[];++p<v;){var j=c[p];j&&(P[N++]=j)}return P}o(f9,"compact");function h9(){var c=arguments.length;if(!c)return[];for(var p=ve(c-1),v=arguments[0],N=c;N--;)p[N-1]=arguments[N];return nu(Lt(v)?gs(v):[v],Rn(p,1))}o(h9,"concat");var p9=Gt(function(c,p){return en(c)?im(c,Rn(p,1,en,!0)):[]}),d9=Gt(function(c,p){var v=ui(p);return en(v)&&(v=r),en(c)?im(c,Rn(p,1,en,!0),Et(v,2)):[]}),m9=Gt(function(c,p){var v=ui(p);return en(v)&&(v=r),en(c)?im(c,Rn(p,1,en,!0),r,v):[]});function g9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),oi(c,p<0?0:p,N)):[]}o(g9,"drop");function y9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),p=N-p,oi(c,0,p<0?0:p)):[]}o(y9,"dropRight");function v9(c,p){return c&&c.length?Jv(c,Et(p,3),!0,!0):[]}o(v9,"dropRightWhile");function w9(c,p){return c&&c.length?Jv(c,Et(p,3),!0):[]}o(w9,"dropWhile");function S9(c,p,v,N){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&as(c,p,v)&&(v=0,N=P),hF(c,p,v,N)):[]}o(S9,"fill");function Q_(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=v==null?0:jt(v);return P<0&&(P=mn(N+P,0)),Iv(c,Et(p,3),P)}o(Q_,"findIndex");function Z_(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=N-1;return v!==r&&(P=jt(v),P=v<0?mn(N+P,0):Gn(P,N-1)),Iv(c,Et(p,3),P,!0)}o(Z_,"findLastIndex");function eR(c){var p=c==null?0:c.length;return p?Rn(c,1):[]}o(eR,"flatten");function E9(c){var p=c==null?0:c.length;return p?Rn(c,oe):[]}o(E9,"flattenDeep");function A9(c,p){var v=c==null?0:c.length;return v?(p=p===r?1:jt(p),Rn(c,p)):[]}o(A9,"flattenDepth");function C9(c){for(var p=-1,v=c==null?0:c.length,N={};++p<v;){var P=c[p];N[P[0]]=P[1]}return N}o(C9,"fromPairs");function tR(c){return c&&c.length?c[0]:r}o(tR,"head");function b9(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=v==null?0:jt(v);return P<0&&(P=mn(N+P,0)),Sh(c,p,P)}o(b9,"indexOf");function x9(c){var p=c==null?0:c.length;return p?oi(c,0,-1):[]}o(x9,"initial");var N9=Gt(function(c){var p=Mr(c,Y2);return p.length&&p[0]===c[0]?F2(p):[]}),T9=Gt(function(c){var p=ui(c),v=Mr(c,Y2);return p===ui(v)?p=r:v.pop(),v.length&&v[0]===c[0]?F2(v,Et(p,2)):[]}),I9=Gt(function(c){var p=ui(c),v=Mr(c,Y2);return p=typeof p=="function"?p:r,p&&v.pop(),v.length&&v[0]===c[0]?F2(v,r,p):[]});function B9(c,p){return c==null?"":xj.call(c,p)}o(B9,"join");function ui(c){var p=c==null?0:c.length;return p?c[p-1]:r}o(ui,"last");function D9(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=N;return v!==r&&(P=jt(v),P=P<0?mn(N+P,0):Gn(P,N-1)),p===p?lj(c,p,P):Iv(c,kD,P,!0)}o(D9,"lastIndexOf");function _9(c,p){return c&&c.length?h_(c,jt(p)):r}o(_9,"nth");var R9=Gt(rR);function rR(c,p){return c&&c.length&&p&&p.length?$2(c,p):c}o(rR,"pullAll");function P9(c,p,v){return c&&c.length&&p&&p.length?$2(c,p,Et(v,2)):c}o(P9,"pullAllBy");function O9(c,p,v){return c&&c.length&&p&&p.length?$2(c,p,r,v):c}o(O9,"pullAllWith");var k9=so(function(c,p){var v=c==null?0:c.length,N=V2(c,p);return m_(c,Mr(p,function(P){return io(P,v)?+P:P}).sort(x_)),N});function L9(c,p){var v=[];if(!(c&&c.length))return v;var N=-1,P=[],j=c.length;for(p=Et(p,3);++N<j;){var z=c[N];p(z,N,c)&&(v.push(z),P.push(N))}return m_(c,P),v}o(L9,"remove");function fb(c){return c==null?c:Bj.call(c)}o(fb,"reverse");function V9(c,p,v){var N=c==null?0:c.length;return N?(v&&typeof v!="number"&&as(c,p,v)?(p=0,v=N):(p=p==null?0:jt(p),v=v===r?N:jt(v)),oi(c,p,v)):[]}o(V9,"slice");function U9(c,p){return Wv(c,p)}o(U9,"sortedIndex");function M9(c,p,v){return W2(c,p,Et(v,2))}o(M9,"sortedIndexBy");function j9(c,p){var v=c==null?0:c.length;if(v){var N=Wv(c,p);if(N<v&&Vi(c[N],p))return N}return-1}o(j9,"sortedIndexOf");function F9(c,p){return Wv(c,p,!0)}o(F9,"sortedLastIndex");function q9(c,p,v){return W2(c,p,Et(v,2),!0)}o(q9,"sortedLastIndexBy");function H9(c,p){var v=c==null?0:c.length;if(v){var N=Wv(c,p,!0)-1;if(Vi(c[N],p))return N}return-1}o(H9,"sortedLastIndexOf");function K9(c){return c&&c.length?y_(c):[]}o(K9,"sortedUniq");function $9(c,p){return c&&c.length?y_(c,Et(p,2)):[]}o($9,"sortedUniqBy");function X9(c){var p=c==null?0:c.length;return p?oi(c,1,p):[]}o(X9,"tail");function G9(c,p,v){return c&&c.length?(p=v||p===r?1:jt(p),oi(c,0,p<0?0:p)):[]}o(G9,"take");function W9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),p=N-p,oi(c,p<0?0:p,N)):[]}o(W9,"takeRight");function J9(c,p){return c&&c.length?Jv(c,Et(p,3),!1,!0):[]}o(J9,"takeRightWhile");function z9(c,p){return c&&c.length?Jv(c,Et(p,3)):[]}o(z9,"takeWhile");var Y9=Gt(function(c){return uu(Rn(c,1,en,!0))}),Q9=Gt(function(c){var p=ui(c);return en(p)&&(p=r),uu(Rn(c,1,en,!0),Et(p,2))}),Z9=Gt(function(c){var p=ui(c);return p=typeof p=="function"?p:r,uu(Rn(c,1,en,!0),r,p)});function eq(c){return c&&c.length?uu(c):[]}o(eq,"uniq");function tq(c,p){return c&&c.length?uu(c,Et(p,2)):[]}o(tq,"uniqBy");function rq(c,p){return p=typeof p=="function"?p:r,c&&c.length?uu(c,r,p):[]}o(rq,"uniqWith");function hb(c){if(!(c&&c.length))return[];var p=0;return c=ru(c,function(v){if(en(v))return p=mn(v.length,p),!0}),B2(p,function(v){return Mr(c,N2(v))})}o(hb,"unzip");function nR(c,p){if(!(c&&c.length))return[];var v=hb(c);return p==null?v:Mr(v,function(N){return Us(p,r,N)})}o(nR,"unzipWith");var nq=Gt(function(c,p){return en(c)?im(c,p):[]}),sq=Gt(function(c){return z2(ru(c,en))}),iq=Gt(function(c){var p=ui(c);return en(p)&&(p=r),z2(ru(c,en),Et(p,2))}),aq=Gt(function(c){var p=ui(c);return p=typeof p=="function"?p:r,z2(ru(c,en),r,p)}),oq=Gt(hb);function uq(c,p){return E_(c||[],p||[],sm)}o(uq,"zipObject");function lq(c,p){return E_(c||[],p||[],um)}o(lq,"zipObjectDeep");var cq=Gt(function(c){var p=c.length,v=p>1?c[p-1]:r;return v=typeof v=="function"?(c.pop(),v):r,nR(c,v)});function sR(c){var p=M(c);return p.__chain__=!0,p}o(sR,"chain");function fq(c,p){return p(c),c}o(fq,"tap");function sw(c,p){return p(c)}o(sw,"thru");var hq=so(function(c){var p=c.length,v=p?c[0]:0,N=this.__wrapped__,P=o(function(j){return V2(j,c)},"interceptor");return p>1||this.__actions__.length||!(N instanceof er)||!io(v)?this.thru(P):(N=N.slice(v,+v+(p?1:0)),N.__actions__.push({func:sw,args:[P],thisArg:r}),new ii(N,this.__chain__).thru(function(j){return p&&!j.length&&j.push(r),j}))});function pq(){return sR(this)}o(pq,"wrapperChain");function dq(){return new ii(this.value(),this.__chain__)}o(dq,"wrapperCommit");function mq(){this.__values__===r&&(this.__values__=vR(this.value()));var c=this.__index__>=this.__values__.length,p=c?r:this.__values__[this.__index__++];return{done:c,value:p}}o(mq,"wrapperNext");function gq(){return this}o(gq,"wrapperToIterator");function yq(c){for(var p,v=this;v instanceof Hv;){var N=Y_(v);N.__index__=0,N.__values__=r,p?P.__wrapped__=N:p=N;var P=N;v=v.__wrapped__}return P.__wrapped__=c,p}o(yq,"wrapperPlant");function vq(){var c=this.__wrapped__;if(c instanceof er){var p=c;return this.__actions__.length&&(p=new er(this)),p=p.reverse(),p.__actions__.push({func:sw,args:[fb],thisArg:r}),new ii(p,this.__chain__)}return this.thru(fb)}o(vq,"wrapperReverse");function wq(){return S_(this.__wrapped__,this.__actions__)}o(wq,"wrapperValue");var Sq=zv(function(c,p,v){wr.call(c,v)?++c[v]:ro(c,v,1)});function Eq(c,p,v){var N=Lt(c)?PD:fF;return v&&as(c,p,v)&&(p=r),N(c,Et(p,3))}o(Eq,"every");function Aq(c,p){var v=Lt(c)?ru:n_;return v(c,Et(p,3))}o(Aq,"filter");var Cq=__(Q_),bq=__(Z_);function xq(c,p){return Rn(iw(c,p),1)}o(xq,"flatMap");function Nq(c,p){return Rn(iw(c,p),oe)}o(Nq,"flatMapDeep");function Tq(c,p,v){return v=v===r?1:jt(v),Rn(iw(c,p),v)}o(Tq,"flatMapDepth");function iR(c,p){var v=Lt(c)?ni:ou;return v(c,Et(p,3))}o(iR,"forEach");function aR(c,p){var v=Lt(c)?XM:r_;return v(c,Et(p,3))}o(aR,"forEachRight");var Iq=zv(function(c,p,v){wr.call(c,v)?c[v].push(p):ro(c,v,[p])});function Bq(c,p,v,N){c=ys(c)?c:_h(c),v=v&&!N?jt(v):0;var P=c.length;return v<0&&(v=mn(P+v,0)),cw(c)?v<=P&&c.indexOf(p,v)>-1:!!P&&Sh(c,p,v)>-1}o(Bq,"includes");var Dq=Gt(function(c,p,v){var N=-1,P=typeof p=="function",j=ys(c)?ve(c.length):[];return ou(c,function(z){j[++N]=P?Us(p,z,v):am(z,p,v)}),j}),_q=zv(function(c,p,v){ro(c,v,p)});function iw(c,p){var v=Lt(c)?Mr:l_;return v(c,Et(p,3))}o(iw,"map");function Rq(c,p,v,N){return c==null?[]:(Lt(p)||(p=p==null?[]:[p]),v=N?r:v,Lt(v)||(v=v==null?[]:[v]),p_(c,p,v))}o(Rq,"orderBy");var Pq=zv(function(c,p,v){c[v?0:1].push(p)},function(){return[[],[]]});function Oq(c,p,v){var N=Lt(c)?b2:VD,P=arguments.length<3;return N(c,Et(p,4),v,P,ou)}o(Oq,"reduce");function kq(c,p,v){var N=Lt(c)?GM:VD,P=arguments.length<3;return N(c,Et(p,4),v,P,r_)}o(kq,"reduceRight");function Lq(c,p){var v=Lt(c)?ru:n_;return v(c,uw(Et(p,3)))}o(Lq,"reject");function Vq(c){var p=Lt(c)?QD:BF;return p(c)}o(Vq,"sample");function Uq(c,p,v){(v?as(c,p,v):p===r)?p=1:p=jt(p);var N=Lt(c)?aF:DF;return N(c,p)}o(Uq,"sampleSize");function Mq(c){var p=Lt(c)?oF:RF;return p(c)}o(Mq,"shuffle");function jq(c){if(c==null)return 0;if(ys(c))return cw(c)?Ah(c):c.length;var p=Wn(c);return p==xe||p==Ur?c.size:H2(c).length}o(jq,"size");function Fq(c,p,v){var N=Lt(c)?x2:PF;return v&&as(c,p,v)&&(p=r),N(c,Et(p,3))}o(Fq,"some");var qq=Gt(function(c,p){if(c==null)return[];var v=p.length;return v>1&&as(c,p[0],p[1])?p=[]:v>2&&as(p[0],p[1],p[2])&&(p=[p[0]]),p_(c,Rn(p,1),[])}),aw=Aj||function(){return Sn.Date.now()};function Hq(c,p){if(typeof p!="function")throw new si(s);return c=jt(c),function(){if(--c<1)return p.apply(this,arguments)}}o(Hq,"after");function oR(c,p,v){return p=v?r:p,p=c&&p==null?c.length:p,no(c,x,r,r,r,r,p)}o(oR,"ary");function uR(c,p){var v;if(typeof p!="function")throw new si(s);return c=jt(c),function(){return--c>0&&(v=p.apply(this,arguments)),c<=1&&(p=r),v}}o(uR,"before");var pb=Gt(function(c,p,v){var N=y;if(v.length){var P=su(v,Bh(pb));N|=A}return no(c,N,p,v,P)}),lR=Gt(function(c,p,v){var N=y|S;if(v.length){var P=su(v,Bh(lR));N|=A}return no(p,N,c,v,P)});function cR(c,p,v){p=v?r:p;var N=no(c,b,r,r,r,r,r,p);return N.placeholder=cR.placeholder,N}o(cR,"curry");function fR(c,p,v){p=v?r:p;var N=no(c,T,r,r,r,r,r,p);return N.placeholder=fR.placeholder,N}o(fR,"curryRight");function hR(c,p,v){var N,P,j,z,Q,ue,Ne=0,De=!1,Le=!1,ze=!0;if(typeof c!="function")throw new si(s);p=li(p)||0,qr(v)&&(De=!!v.leading,Le="maxWait"in v,j=Le?mn(li(v.maxWait)||0,p):j,ze="trailing"in v?!!v.trailing:ze);function ht(tn){var Ui=N,uo=P;return N=P=r,Ne=tn,z=c.apply(uo,Ui),z}o(ht,"invokeFunc");function bt(tn){return Ne=tn,Q=fm(Jt,p),De?ht(tn):z}o(bt,"leadingEdge");function Kt(tn){var Ui=tn-ue,uo=tn-Ne,_R=p-Ui;return Le?Gn(_R,j-uo):_R}o(Kt,"remainingWait");function xt(tn){var Ui=tn-ue,uo=tn-Ne;return ue===r||Ui>=p||Ui<0||Le&&uo>=j}o(xt,"shouldInvoke");function Jt(){var tn=aw();if(xt(tn))return sr(tn);Q=fm(Jt,Kt(tn))}o(Jt,"timerExpired");function sr(tn){return Q=r,ze&&N?ht(tn):(N=P=r,z)}o(sr,"trailingEdge");function qs(){Q!==r&&A_(Q),Ne=0,N=ue=P=Q=r}o(qs,"cancel");function os(){return Q===r?z:sr(aw())}o(os,"flush");function Hs(){var tn=aw(),Ui=xt(tn);if(N=arguments,P=this,ue=tn,Ui){if(Q===r)return bt(ue);if(Le)return A_(Q),Q=fm(Jt,p),ht(ue)}return Q===r&&(Q=fm(Jt,p)),z}return o(Hs,"debounced"),Hs.cancel=qs,Hs.flush=os,Hs}o(hR,"debounce");var Kq=Gt(function(c,p){return t_(c,1,p)}),$q=Gt(function(c,p,v){return t_(c,li(p)||0,v)});function Xq(c){return no(c,F)}o(Xq,"flip");function ow(c,p){if(typeof c!="function"||p!=null&&typeof p!="function")throw new si(s);var v=o(function(){var N=arguments,P=p?p.apply(this,N):N[0],j=v.cache;if(j.has(P))return j.get(P);var z=c.apply(this,N);return v.cache=j.set(P,z)||j,z},"memoized");return v.cache=new(ow.Cache||to),v}o(ow,"memoize"),ow.Cache=to;function uw(c){if(typeof c!="function")throw new si(s);return function(){var p=arguments;switch(p.length){case 0:return!c.call(this);case 1:return!c.call(this,p[0]);case 2:return!c.call(this,p[0],p[1]);case 3:return!c.call(this,p[0],p[1],p[2])}return!c.apply(this,p)}}o(uw,"negate");function Gq(c){return uR(2,c)}o(Gq,"once");var Wq=OF(function(c,p){p=p.length==1&&Lt(p[0])?Mr(p[0],Ms(Et())):Mr(Rn(p,1),Ms(Et()));var v=p.length;return Gt(function(N){for(var P=-1,j=Gn(N.length,v);++P<j;)N[P]=p[P].call(this,N[P]);return Us(c,this,N)})}),db=Gt(function(c,p){var v=su(p,Bh(db));return no(c,A,r,p,v)}),pR=Gt(function(c,p){var v=su(p,Bh(pR));return no(c,C,r,p,v)}),Jq=so(function(c,p){return no(c,B,r,r,r,p)});function zq(c,p){if(typeof c!="function")throw new si(s);return p=p===r?p:jt(p),Gt(c,p)}o(zq,"rest");function Yq(c,p){if(typeof c!="function")throw new si(s);return p=p==null?0:mn(jt(p),0),Gt(function(v){var N=v[p],P=cu(v,0,p);return N&&nu(P,N),Us(c,this,P)})}o(Yq,"spread");function Qq(c,p,v){var N=!0,P=!0;if(typeof c!="function")throw new si(s);return qr(v)&&(N="leading"in v?!!v.leading:N,P="trailing"in v?!!v.trailing:P),hR(c,p,{leading:N,maxWait:p,trailing:P})}o(Qq,"throttle");function Zq(c){return oR(c,1)}o(Zq,"unary");function e7(c,p){return db(Q2(p),c)}o(e7,"wrap");function t7(){if(!arguments.length)return[];var c=arguments[0];return Lt(c)?c:[c]}o(t7,"castArray");function r7(c){return ai(c,m)}o(r7,"clone");function n7(c,p){return p=typeof p=="function"?p:r,ai(c,m,p)}o(n7,"cloneWith");function s7(c){return ai(c,f|m)}o(s7,"cloneDeep");function i7(c,p){return p=typeof p=="function"?p:r,ai(c,f|m,p)}o(i7,"cloneDeepWith");function a7(c,p){return p==null||e_(c,p,En(p))}o(a7,"conformsTo");function Vi(c,p){return c===p||c!==c&&p!==p}o(Vi,"eq");var o7=ew(j2),u7=ew(function(c,p){return c>=p}),cc=a_((function(){return arguments})())?a_:function(c){return Wr(c)&&wr.call(c,"callee")&&!XD.call(c,"callee")},Lt=ve.isArray,l7=TD?Ms(TD):yF;function ys(c){return c!=null&&lw(c.length)&&!ao(c)}o(ys,"isArrayLike");function en(c){return Wr(c)&&ys(c)}o(en,"isArrayLikeObject");function c7(c){return c===!0||c===!1||Wr(c)&&is(c)==O}o(c7,"isBoolean");var fu=bj||xb,f7=ID?Ms(ID):vF;function h7(c){return Wr(c)&&c.nodeType===1&&!hm(c)}o(h7,"isElement");function p7(c){if(c==null)return!0;if(ys(c)&&(Lt(c)||typeof c=="string"||typeof c.splice=="function"||fu(c)||Dh(c)||cc(c)))return!c.length;var p=Wn(c);if(p==xe||p==Ur)return!c.size;if(cm(c))return!H2(c).length;for(var v in c)if(wr.call(c,v))return!1;return!0}o(p7,"isEmpty");function d7(c,p){return om(c,p)}o(d7,"isEqual");function m7(c,p,v){v=typeof v=="function"?v:r;var N=v?v(c,p):r;return N===r?om(c,p,r,v):!!N}o(m7,"isEqualWith");function mb(c){if(!Wr(c))return!1;var p=is(c);return p==J||p==ne||typeof c.message=="string"&&typeof c.name=="string"&&!hm(c)}o(mb,"isError");function g7(c){return typeof c=="number"&&WD(c)}o(g7,"isFinite");function ao(c){if(!qr(c))return!1;var p=is(c);return p==Xe||p==Re||p==lt||p==Ls}o(ao,"isFunction");function dR(c){return typeof c=="number"&&c==jt(c)}o(dR,"isInteger");function lw(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Z}o(lw,"isLength");function qr(c){var p=typeof c;return c!=null&&(p=="object"||p=="function")}o(qr,"isObject");function Wr(c){return c!=null&&typeof c=="object"}o(Wr,"isObjectLike");var mR=BD?Ms(BD):SF;function y7(c,p){return c===p||q2(c,p,ib(p))}o(y7,"isMatch");function v7(c,p,v){return v=typeof v=="function"?v:r,q2(c,p,ib(p),v)}o(v7,"isMatchWith");function w7(c){return gR(c)&&c!=+c}o(w7,"isNaN");function S7(c){if(n9(c))throw new Pt(n);return o_(c)}o(S7,"isNative");function E7(c){return c===null}o(E7,"isNull");function A7(c){return c==null}o(A7,"isNil");function gR(c){return typeof c=="number"||Wr(c)&&is(c)==ct}o(gR,"isNumber");function hm(c){if(!Wr(c)||is(c)!=je)return!1;var p=Lv(c);if(p===null)return!0;var v=wr.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&Rv.call(v)==vj}o(hm,"isPlainObject");var gb=DD?Ms(DD):EF;function C7(c){return dR(c)&&c>=-Z&&c<=Z}o(C7,"isSafeInteger");var yR=_D?Ms(_D):AF;function cw(c){return typeof c=="string"||!Lt(c)&&Wr(c)&&is(c)==on}o(cw,"isString");function Fs(c){return typeof c=="symbol"||Wr(c)&&is(c)==$n}o(Fs,"isSymbol");var Dh=RD?Ms(RD):CF;function b7(c){return c===r}o(b7,"isUndefined");function x7(c){return Wr(c)&&Wn(c)==ns}o(x7,"isWeakMap");function N7(c){return Wr(c)&&is(c)==pt}o(N7,"isWeakSet");var T7=ew(K2),I7=ew(function(c,p){return c<=p});function vR(c){if(!c)return[];if(ys(c))return cw(c)?ki(c):gs(c);if(Z0&&c[Z0])return aj(c[Z0]());var p=Wn(c),v=p==xe?_2:p==Ur?Bv:_h;return v(c)}o(vR,"toArray");function oo(c){if(!c)return c===0?c:0;if(c=li(c),c===oe||c===-oe){var p=c<0?-1:1;return p*fe}return c===c?c:0}o(oo,"toFinite");function jt(c){var p=oo(c),v=p%1;return p===p?v?p-v:p:0}o(jt,"toInteger");function wR(c){return c?ac(jt(c),0,Ke):0}o(wR,"toLength");function li(c){if(typeof c=="number")return c;if(Fs(c))return Se;if(qr(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=qr(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=UD(c);var v=lM.test(c);return v||fM.test(c)?HM(c.slice(2),v?2:8):m2.test(c)?Se:+c}o(li,"toNumber");function SR(c){return ca(c,vs(c))}o(SR,"toPlainObject");function B7(c){return c?ac(jt(c),-Z,Z):c===0?c:0}o(B7,"toSafeInteger");function gr(c){return c==null?"":js(c)}o(gr,"toString");var D7=Th(function(c,p){if(cm(p)||ys(p)){ca(p,En(p),c);return}for(var v in p)wr.call(p,v)&&sm(c,v,p[v])}),ER=Th(function(c,p){ca(p,vs(p),c)}),fw=Th(function(c,p,v,N){ca(p,vs(p),c,N)}),_7=Th(function(c,p,v,N){ca(p,En(p),c,N)}),R7=so(V2);function P7(c,p){var v=Nh(c);return p==null?v:ZD(v,p)}o(P7,"create");var O7=Gt(function(c,p){c=Cr(c);var v=-1,N=p.length,P=N>2?p[2]:r;for(P&&as(p[0],p[1],P)&&(N=1);++v<N;)for(var j=p[v],z=vs(j),Q=-1,ue=z.length;++Q<ue;){var Ne=z[Q],De=c[Ne];(De===r||Vi(De,Ch[Ne])&&!wr.call(c,Ne))&&(c[Ne]=j[Ne])}return c}),k7=Gt(function(c){return c.push(r,U_),Us(AR,r,c)});function L7(c,p){return OD(c,Et(p,3),la)}o(L7,"findKey");function V7(c,p){return OD(c,Et(p,3),M2)}o(V7,"findLastKey");function U7(c,p){return c==null?c:U2(c,Et(p,3),vs)}o(U7,"forIn");function M7(c,p){return c==null?c:s_(c,Et(p,3),vs)}o(M7,"forInRight");function j7(c,p){return c&&la(c,Et(p,3))}o(j7,"forOwn");function F7(c,p){return c&&M2(c,Et(p,3))}o(F7,"forOwnRight");function q7(c){return c==null?[]:Xv(c,En(c))}o(q7,"functions");function H7(c){return c==null?[]:Xv(c,vs(c))}o(H7,"functionsIn");function yb(c,p,v){var N=c==null?r:oc(c,p);return N===r?v:N}o(yb,"get");function K7(c,p){return c!=null&&F_(c,p,pF)}o(K7,"has");function vb(c,p){return c!=null&&F_(c,p,dF)}o(vb,"hasIn");var $7=P_(function(c,p,v){p!=null&&typeof p.toString!="function"&&(p=Pv.call(p)),c[p]=v},Sb(ws)),X7=P_(function(c,p,v){p!=null&&typeof p.toString!="function"&&(p=Pv.call(p)),wr.call(c,p)?c[p].push(v):c[p]=[v]},Et),G7=Gt(am);function En(c){return ys(c)?YD(c):H2(c)}o(En,"keys");function vs(c){return ys(c)?YD(c,!0):bF(c)}o(vs,"keysIn");function W7(c,p){var v={};return p=Et(p,3),la(c,function(N,P,j){ro(v,p(N,P,j),N)}),v}o(W7,"mapKeys");function J7(c,p){var v={};return p=Et(p,3),la(c,function(N,P,j){ro(v,P,p(N,P,j))}),v}o(J7,"mapValues");var z7=Th(function(c,p,v){Gv(c,p,v)}),AR=Th(function(c,p,v,N){Gv(c,p,v,N)}),Y7=so(function(c,p){var v={};if(c==null)return v;var N=!1;p=Mr(p,function(j){return j=lu(j,c),N||(N=j.length>1),j}),ca(c,nb(c),v),N&&(v=ai(v,f|h|m,$F));for(var P=p.length;P--;)J2(v,p[P]);return v});function Q7(c,p){return CR(c,uw(Et(p)))}o(Q7,"omitBy");var Z7=so(function(c,p){return c==null?{}:NF(c,p)});function CR(c,p){if(c==null)return{};var v=Mr(nb(c),function(N){return[N]});return p=Et(p),d_(c,v,function(N,P){return p(N,P[0])})}o(CR,"pickBy");function eH(c,p,v){p=lu(p,c);var N=-1,P=p.length;for(P||(P=1,c=r);++N<P;){var j=c==null?r:c[fa(p[N])];j===r&&(N=P,j=v),c=ao(j)?j.call(c):j}return c}o(eH,"result");function tH(c,p,v){return c==null?c:um(c,p,v)}o(tH,"set");function rH(c,p,v,N){return N=typeof N=="function"?N:r,c==null?c:um(c,p,v,N)}o(rH,"setWith");var bR=L_(En),xR=L_(vs);function nH(c,p,v){var N=Lt(c),P=N||fu(c)||Dh(c);if(p=Et(p,4),v==null){var j=c&&c.constructor;P?v=N?new j:[]:qr(c)?v=ao(j)?Nh(Lv(c)):{}:v={}}return(P?ni:la)(c,function(z,Q,ue){return p(v,z,Q,ue)}),v}o(nH,"transform");function sH(c,p){return c==null?!0:J2(c,p)}o(sH,"unset");function iH(c,p,v){return c==null?c:w_(c,p,Q2(v))}o(iH,"update");function aH(c,p,v,N){return N=typeof N=="function"?N:r,c==null?c:w_(c,p,Q2(v),N)}o(aH,"updateWith");function _h(c){return c==null?[]:D2(c,En(c))}o(_h,"values");function oH(c){return c==null?[]:D2(c,vs(c))}o(oH,"valuesIn");function uH(c,p,v){return v===r&&(v=p,p=r),v!==r&&(v=li(v),v=v===v?v:0),p!==r&&(p=li(p),p=p===p?p:0),ac(li(c),p,v)}o(uH,"clamp");function lH(c,p,v){return p=oo(p),v===r?(v=p,p=0):v=oo(v),c=li(c),mF(c,p,v)}o(lH,"inRange");function cH(c,p,v){if(v&&typeof v!="boolean"&&as(c,p,v)&&(p=v=r),v===r&&(typeof p=="boolean"?(v=p,p=r):typeof c=="boolean"&&(v=c,c=r)),c===r&&p===r?(c=0,p=1):(c=oo(c),p===r?(p=c,c=0):p=oo(p)),c>p){var N=c;c=p,p=N}if(v||c%1||p%1){var P=JD();return Gn(c+P*(p-c+qM("1e-"+((P+"").length-1))),p)}return X2(c,p)}o(cH,"random");var fH=Ih(function(c,p,v){return p=p.toLowerCase(),c+(v?NR(p):p)});function NR(c){return wb(gr(c).toLowerCase())}o(NR,"capitalize");function TR(c){return c=gr(c),c&&c.replace(pM,tj).replace(RM,"")}o(TR,"deburr");function hH(c,p,v){c=gr(c),p=js(p);var N=c.length;v=v===r?N:ac(jt(v),0,N);var P=v;return v-=p.length,v>=0&&c.slice(v,P)==p}o(hH,"endsWith");function pH(c){return c=gr(c),c&&nt.test(c)?c.replace(ie,rj):c}o(pH,"escape");function dH(c){return c=gr(c),c&&ua.test(c)?c.replace(or,"\\$&"):c}o(dH,"escapeRegExp");var mH=Ih(function(c,p,v){return c+(v?"-":"")+p.toLowerCase()}),gH=Ih(function(c,p,v){return c+(v?" ":"")+p.toLowerCase()}),yH=D_("toLowerCase");function vH(c,p,v){c=gr(c),p=jt(p);var N=p?Ah(c):0;if(!p||N>=p)return c;var P=(p-N)/2;return Zv(jv(P),v)+c+Zv(Mv(P),v)}o(vH,"pad");function wH(c,p,v){c=gr(c),p=jt(p);var N=p?Ah(c):0;return p&&N<p?c+Zv(p-N,v):c}o(wH,"padEnd");function SH(c,p,v){c=gr(c),p=jt(p);var N=p?Ah(c):0;return p&&N<p?Zv(p-N,v)+c:c}o(SH,"padStart");function EH(c,p,v){return v||p==null?p=0:p&&(p=+p),Ij(gr(c).replace(Y0,""),p||0)}o(EH,"parseInt1");function AH(c,p,v){return(v?as(c,p,v):p===r)?p=1:p=jt(p),G2(gr(c),p)}o(AH,"repeat");function CH(){var c=arguments,p=gr(c[0]);return c.length<3?p:p.replace(c[1],c[2])}o(CH,"replace");var bH=Ih(function(c,p,v){return c+(v?"_":"")+p.toLowerCase()});function xH(c,p,v){return v&&typeof v!="number"&&as(c,p,v)&&(p=v=r),v=v===r?Ke:v>>>0,v?(c=gr(c),c&&(typeof p=="string"||p!=null&&!gb(p))&&(p=js(p),!p&&Eh(c))?cu(ki(c),0,v):c.split(p,v)):[]}o(xH,"split");var NH=Ih(function(c,p,v){return c+(v?" ":"")+wb(p)});function TH(c,p,v){return c=gr(c),v=v==null?0:ac(jt(v),0,c.length),p=js(p),c.slice(v,v+p.length)==p}o(TH,"startsWith");function IH(c,p,v){var N=M.templateSettings;v&&as(c,p,v)&&(p=r),c=gr(c),p=fw({},p,N,V_);var P=fw({},p.imports,N.imports,V_),j=En(P),z=D2(P,j),Q,ue,Ne=0,De=p.interpolate||bv,Le="__p += '",ze=R2((p.escape||bv).source+"|"+De.source+"|"+(De===et?Xn:bv).source+"|"+(p.evaluate||bv).source+"|$","g"),ht="//# sourceURL="+(wr.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++VM+"]")+`
25
+ `;c.replace(ze,function(xt,Jt,sr,qs,os,Hs){return sr||(sr=qs),Le+=c.slice(Ne,Hs).replace(dM,nj),Jt&&(Q=!0,Le+=`' +
26
+ __e(`+Jt+`) +
27
+ '`),os&&(ue=!0,Le+=`';
28
+ `+os+`;
29
+ __p += '`),sr&&(Le+=`' +
30
+ ((__t = (`+sr+`)) == null ? '' : __t) +
31
+ '`),Ne=Hs+xt.length,xt}),Le+=`';
32
+ `;var bt=wr.call(p,"variable")&&p.variable;if(!bt)Le=`with (obj) {
33
+ `+Le+`
34
+ }
35
+ `;else if(qe.test(bt))throw new Pt(i);Le=(ue?Le.replace(d,""):Le).replace(I,"$1").replace($,"$1;"),Le="function("+(bt||"obj")+`) {
36
+ `+(bt?"":`obj || (obj = {});
37
+ `)+"var __t, __p = ''"+(Q?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
38
+ function print() { __p += __j.call(arguments, '') }
39
+ `:`;
40
+ `)+Le+`return __p
41
+ }`;var Kt=BR(function(){return mr(j,ht+"return "+Le).apply(r,z)});if(Kt.source=Le,mb(Kt))throw Kt;return Kt}o(IH,"template");function BH(c){return gr(c).toLowerCase()}o(BH,"toLower");function DH(c){return gr(c).toUpperCase()}o(DH,"toUpper");function _H(c,p,v){if(c=gr(c),c&&(v||p===r))return UD(c);if(!c||!(p=js(p)))return c;var N=ki(c),P=ki(p),j=MD(N,P),z=jD(N,P)+1;return cu(N,j,z).join("")}o(_H,"trim");function RH(c,p,v){if(c=gr(c),c&&(v||p===r))return c.slice(0,qD(c)+1);if(!c||!(p=js(p)))return c;var N=ki(c),P=jD(N,ki(p))+1;return cu(N,0,P).join("")}o(RH,"trimEnd");function PH(c,p,v){if(c=gr(c),c&&(v||p===r))return c.replace(Y0,"");if(!c||!(p=js(p)))return c;var N=ki(c),P=MD(N,ki(p));return cu(N,P).join("")}o(PH,"trimStart");function OH(c,p){var v=R,N=H;if(qr(p)){var P="separator"in p?p.separator:P;v="length"in p?jt(p.length):v,N="omission"in p?js(p.omission):N}c=gr(c);var j=c.length;if(Eh(c)){var z=ki(c);j=z.length}if(v>=j)return c;var Q=v-Ah(N);if(Q<1)return N;var ue=z?cu(z,0,Q).join(""):c.slice(0,Q);if(P===r)return ue+N;if(z&&(Q+=ue.length-Q),gb(P)){if(c.slice(Q).search(P)){var Ne,De=ue;for(P.global||(P=R2(P.source,gr(Oi.exec(P))+"g")),P.lastIndex=0;Ne=P.exec(De);)var Le=Ne.index;ue=ue.slice(0,Le===r?Q:Le)}}else if(c.indexOf(js(P),Q)!=Q){var ze=ue.lastIndexOf(P);ze>-1&&(ue=ue.slice(0,ze))}return ue+N}o(OH,"truncate");function kH(c){return c=gr(c),c&&X.test(c)?c.replace(te,cj):c}o(kH,"unescape");var LH=Ih(function(c,p,v){return c+(v?" ":"")+p.toUpperCase()}),wb=D_("toUpperCase");function IR(c,p,v){return c=gr(c),p=v?r:p,p===r?ij(c)?pj(c):zM(c):c.match(p)||[]}o(IR,"words");var BR=Gt(function(c,p){try{return Us(c,r,p)}catch(v){return mb(v)?v:new Pt(v)}}),VH=so(function(c,p){return ni(p,function(v){v=fa(v),ro(c,v,pb(c[v],c))}),c});function UH(c){var p=c==null?0:c.length,v=Et();return c=p?Mr(c,function(N){if(typeof N[1]!="function")throw new si(s);return[v(N[0]),N[1]]}):[],Gt(function(N){for(var P=-1;++P<p;){var j=c[P];if(Us(j[0],this,N))return Us(j[1],this,N)}})}o(UH,"cond");function MH(c){return cF(ai(c,f))}o(MH,"conforms");function Sb(c){return function(){return c}}o(Sb,"constant");function jH(c,p){return c==null||c!==c?p:c}o(jH,"defaultTo");var FH=R_(),qH=R_(!0);function ws(c){return c}o(ws,"identity");function Eb(c){return u_(typeof c=="function"?c:ai(c,f))}o(Eb,"iteratee");function HH(c){return c_(ai(c,f))}o(HH,"matches");function KH(c,p){return f_(c,ai(p,f))}o(KH,"matchesProperty");var $H=Gt(function(c,p){return function(v){return am(v,c,p)}}),XH=Gt(function(c,p){return function(v){return am(c,v,p)}});function Ab(c,p,v){var N=En(p),P=Xv(p,N);v==null&&!(qr(p)&&(P.length||!N.length))&&(v=p,p=c,c=this,P=Xv(p,En(p)));var j=!(qr(v)&&"chain"in v)||!!v.chain,z=ao(c);return ni(P,function(Q){var ue=p[Q];c[Q]=ue,z&&(c.prototype[Q]=function(){var Ne=this.__chain__;if(j||Ne){var De=c(this.__wrapped__),Le=De.__actions__=gs(this.__actions__);return Le.push({func:ue,args:arguments,thisArg:c}),De.__chain__=Ne,De}return ue.apply(c,nu([this.value()],arguments))})}),c}o(Ab,"mixin");function GH(){return Sn._===this&&(Sn._=wj),this}o(GH,"noConflict");function Cb(){}o(Cb,"noop");function WH(c){return c=jt(c),Gt(function(p){return h_(p,c)})}o(WH,"nthArg");var JH=eb(Mr),zH=eb(PD),YH=eb(x2);function DR(c){return ob(c)?N2(fa(c)):TF(c)}o(DR,"property");function QH(c){return function(p){return c==null?r:oc(c,p)}}o(QH,"propertyOf");var ZH=O_(),eK=O_(!0);function bb(){return[]}o(bb,"stubArray");function xb(){return!1}o(xb,"stubFalse");function tK(){return{}}o(tK,"stubObject");function rK(){return""}o(rK,"stubString");function nK(){return!0}o(nK,"stubTrue");function sK(c,p){if(c=jt(c),c<1||c>Z)return[];var v=Ke,N=Gn(c,Ke);p=Et(p),c-=Ke;for(var P=B2(N,p);++v<c;)p(v);return P}o(sK,"times");function iK(c){return Lt(c)?Mr(c,fa):Fs(c)?[c]:gs(z_(gr(c)))}o(iK,"toPath");function aK(c){var p=++yj;return gr(c)+p}o(aK,"uniqueId");var oK=Qv(function(c,p){return c+p},0),uK=tb("ceil"),lK=Qv(function(c,p){return c/p},1),cK=tb("floor");function fK(c){return c&&c.length?$v(c,ws,j2):r}o(fK,"max");function hK(c,p){return c&&c.length?$v(c,Et(p,2),j2):r}o(hK,"maxBy");function pK(c){return LD(c,ws)}o(pK,"mean");function dK(c,p){return LD(c,Et(p,2))}o(dK,"meanBy");function mK(c){return c&&c.length?$v(c,ws,K2):r}o(mK,"min");function gK(c,p){return c&&c.length?$v(c,Et(p,2),K2):r}o(gK,"minBy");var yK=Qv(function(c,p){return c*p},1),vK=tb("round"),wK=Qv(function(c,p){return c-p},0);function SK(c){return c&&c.length?I2(c,ws):0}o(SK,"sum");function EK(c,p){return c&&c.length?I2(c,Et(p,2)):0}return o(EK,"sumBy"),M.after=Hq,M.ary=oR,M.assign=D7,M.assignIn=ER,M.assignInWith=fw,M.assignWith=_7,M.at=R7,M.before=uR,M.bind=pb,M.bindAll=VH,M.bindKey=lR,M.castArray=t7,M.chain=sR,M.chunk=c9,M.compact=f9,M.concat=h9,M.cond=UH,M.conforms=MH,M.constant=Sb,M.countBy=Sq,M.create=P7,M.curry=cR,M.curryRight=fR,M.debounce=hR,M.defaults=O7,M.defaultsDeep=k7,M.defer=Kq,M.delay=$q,M.difference=p9,M.differenceBy=d9,M.differenceWith=m9,M.drop=g9,M.dropRight=y9,M.dropRightWhile=v9,M.dropWhile=w9,M.fill=S9,M.filter=Aq,M.flatMap=xq,M.flatMapDeep=Nq,M.flatMapDepth=Tq,M.flatten=eR,M.flattenDeep=E9,M.flattenDepth=A9,M.flip=Xq,M.flow=FH,M.flowRight=qH,M.fromPairs=C9,M.functions=q7,M.functionsIn=H7,M.groupBy=Iq,M.initial=x9,M.intersection=N9,M.intersectionBy=T9,M.intersectionWith=I9,M.invert=$7,M.invertBy=X7,M.invokeMap=Dq,M.iteratee=Eb,M.keyBy=_q,M.keys=En,M.keysIn=vs,M.map=iw,M.mapKeys=W7,M.mapValues=J7,M.matches=HH,M.matchesProperty=KH,M.memoize=ow,M.merge=z7,M.mergeWith=AR,M.method=$H,M.methodOf=XH,M.mixin=Ab,M.negate=uw,M.nthArg=WH,M.omit=Y7,M.omitBy=Q7,M.once=Gq,M.orderBy=Rq,M.over=JH,M.overArgs=Wq,M.overEvery=zH,M.overSome=YH,M.partial=db,M.partialRight=pR,M.partition=Pq,M.pick=Z7,M.pickBy=CR,M.property=DR,M.propertyOf=QH,M.pull=R9,M.pullAll=rR,M.pullAllBy=P9,M.pullAllWith=O9,M.pullAt=k9,M.range=ZH,M.rangeRight=eK,M.rearg=Jq,M.reject=Lq,M.remove=L9,M.rest=zq,M.reverse=fb,M.sampleSize=Uq,M.set=tH,M.setWith=rH,M.shuffle=Mq,M.slice=V9,M.sortBy=qq,M.sortedUniq=K9,M.sortedUniqBy=$9,M.split=xH,M.spread=Yq,M.tail=X9,M.take=G9,M.takeRight=W9,M.takeRightWhile=J9,M.takeWhile=z9,M.tap=fq,M.throttle=Qq,M.thru=sw,M.toArray=vR,M.toPairs=bR,M.toPairsIn=xR,M.toPath=iK,M.toPlainObject=SR,M.transform=nH,M.unary=Zq,M.union=Y9,M.unionBy=Q9,M.unionWith=Z9,M.uniq=eq,M.uniqBy=tq,M.uniqWith=rq,M.unset=sH,M.unzip=hb,M.unzipWith=nR,M.update=iH,M.updateWith=aH,M.values=_h,M.valuesIn=oH,M.without=nq,M.words=IR,M.wrap=e7,M.xor=sq,M.xorBy=iq,M.xorWith=aq,M.zip=oq,M.zipObject=uq,M.zipObjectDeep=lq,M.zipWith=cq,M.entries=bR,M.entriesIn=xR,M.extend=ER,M.extendWith=fw,Ab(M,M),M.add=oK,M.attempt=BR,M.camelCase=fH,M.capitalize=NR,M.ceil=uK,M.clamp=uH,M.clone=r7,M.cloneDeep=s7,M.cloneDeepWith=i7,M.cloneWith=n7,M.conformsTo=a7,M.deburr=TR,M.defaultTo=jH,M.divide=lK,M.endsWith=hH,M.eq=Vi,M.escape=pH,M.escapeRegExp=dH,M.every=Eq,M.find=Cq,M.findIndex=Q_,M.findKey=L7,M.findLast=bq,M.findLastIndex=Z_,M.findLastKey=V7,M.floor=cK,M.forEach=iR,M.forEachRight=aR,M.forIn=U7,M.forInRight=M7,M.forOwn=j7,M.forOwnRight=F7,M.get=yb,M.gt=o7,M.gte=u7,M.has=K7,M.hasIn=vb,M.head=tR,M.identity=ws,M.includes=Bq,M.indexOf=b9,M.inRange=lH,M.invoke=G7,M.isArguments=cc,M.isArray=Lt,M.isArrayBuffer=l7,M.isArrayLike=ys,M.isArrayLikeObject=en,M.isBoolean=c7,M.isBuffer=fu,M.isDate=f7,M.isElement=h7,M.isEmpty=p7,M.isEqual=d7,M.isEqualWith=m7,M.isError=mb,M.isFinite=g7,M.isFunction=ao,M.isInteger=dR,M.isLength=lw,M.isMap=mR,M.isMatch=y7,M.isMatchWith=v7,M.isNaN=w7,M.isNative=S7,M.isNil=A7,M.isNull=E7,M.isNumber=gR,M.isObject=qr,M.isObjectLike=Wr,M.isPlainObject=hm,M.isRegExp=gb,M.isSafeInteger=C7,M.isSet=yR,M.isString=cw,M.isSymbol=Fs,M.isTypedArray=Dh,M.isUndefined=b7,M.isWeakMap=x7,M.isWeakSet=N7,M.join=B9,M.kebabCase=mH,M.last=ui,M.lastIndexOf=D9,M.lowerCase=gH,M.lowerFirst=yH,M.lt=T7,M.lte=I7,M.max=fK,M.maxBy=hK,M.mean=pK,M.meanBy=dK,M.min=mK,M.minBy=gK,M.stubArray=bb,M.stubFalse=xb,M.stubObject=tK,M.stubString=rK,M.stubTrue=nK,M.multiply=yK,M.nth=_9,M.noConflict=GH,M.noop=Cb,M.now=aw,M.pad=vH,M.padEnd=wH,M.padStart=SH,M.parseInt=EH,M.random=cH,M.reduce=Oq,M.reduceRight=kq,M.repeat=AH,M.replace=CH,M.result=eH,M.round=vK,M.runInContext=se,M.sample=Vq,M.size=jq,M.snakeCase=bH,M.some=Fq,M.sortedIndex=U9,M.sortedIndexBy=M9,M.sortedIndexOf=j9,M.sortedLastIndex=F9,M.sortedLastIndexBy=q9,M.sortedLastIndexOf=H9,M.startCase=NH,M.startsWith=TH,M.subtract=wK,M.sum=SK,M.sumBy=EK,M.template=IH,M.times=sK,M.toFinite=oo,M.toInteger=jt,M.toLength=wR,M.toLower=BH,M.toNumber=li,M.toSafeInteger=B7,M.toString=gr,M.toUpper=DH,M.trim=_H,M.trimEnd=RH,M.trimStart=PH,M.truncate=OH,M.unescape=kH,M.uniqueId=aK,M.upperCase=LH,M.upperFirst=wb,M.each=iR,M.eachRight=aR,M.first=tR,Ab(M,(function(){var c={};return la(M,function(p,v){wr.call(M.prototype,v)||(c[v]=p)}),c})(),{chain:!1}),M.VERSION=e,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){M[c].placeholder=M}),ni(["drop","take"],function(c,p){er.prototype[c]=function(v){v=v===r?1:mn(jt(v),0);var N=this.__filtered__&&!p?new er(this):this.clone();return N.__filtered__?N.__takeCount__=Gn(v,N.__takeCount__):N.__views__.push({size:Gn(v,Ke),type:c+(N.__dir__<0?"Right":"")}),N},er.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),ni(["filter","map","takeWhile"],function(c,p){var v=p+1,N=v==G||v==le;er.prototype[c]=function(P){var j=this.clone();return j.__iteratees__.push({iteratee:Et(P,3),type:v}),j.__filtered__=j.__filtered__||N,j}}),ni(["head","last"],function(c,p){var v="take"+(p?"Right":"");er.prototype[c]=function(){return this[v](1).value()[0]}}),ni(["initial","tail"],function(c,p){var v="drop"+(p?"":"Right");er.prototype[c]=function(){return this.__filtered__?new er(this):this[v](1)}}),er.prototype.compact=function(){return this.filter(ws)},er.prototype.find=function(c){return this.filter(c).head()},er.prototype.findLast=function(c){return this.reverse().find(c)},er.prototype.invokeMap=Gt(function(c,p){return typeof c=="function"?new er(this):this.map(function(v){return am(v,c,p)})}),er.prototype.reject=function(c){return this.filter(uw(Et(c)))},er.prototype.slice=function(c,p){c=jt(c);var v=this;return v.__filtered__&&(c>0||p<0)?new er(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),p!==r&&(p=jt(p),v=p<0?v.dropRight(-p):v.take(p-c)),v)},er.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},er.prototype.toArray=function(){return this.take(Ke)},la(er.prototype,function(c,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),N=/^(?:head|last)$/.test(p),P=M[N?"take"+(p=="last"?"Right":""):p],j=N||/^find/.test(p);P&&(M.prototype[p]=function(){var z=this.__wrapped__,Q=N?[1]:arguments,ue=z instanceof er,Ne=Q[0],De=ue||Lt(z),Le=o(function(Jt){var sr=P.apply(M,nu([Jt],Q));return N&&ze?sr[0]:sr},"interceptor");De&&v&&typeof Ne=="function"&&Ne.length!=1&&(ue=De=!1);var ze=this.__chain__,ht=!!this.__actions__.length,bt=j&&!ze,Kt=ue&&!ht;if(!j&&De){z=Kt?z:new er(this);var xt=c.apply(z,Q);return xt.__actions__.push({func:sw,args:[Le],thisArg:r}),new ii(xt,ze)}return bt&&Kt?c.apply(this,Q):(xt=this.thru(Le),bt?N?xt.value()[0]:xt.value():xt)})}),ni(["pop","push","shift","sort","splice","unshift"],function(c){var p=Dv[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);M.prototype[c]=function(){var P=arguments;if(N&&!this.__chain__){var j=this.value();return p.apply(Lt(j)?j:[],P)}return this[v](function(z){return p.apply(Lt(z)?z:[],P)})}}),la(er.prototype,function(c,p){var v=M[p];if(v){var N=v.name+"";wr.call(xh,N)||(xh[N]=[]),xh[N].push({name:p,func:v})}}),xh[Yv(r,S).name]=[{name:"wrapper",func:r}],er.prototype.clone=kj,er.prototype.reverse=Lj,er.prototype.value=Vj,M.prototype.at=hq,M.prototype.chain=pq,M.prototype.commit=dq,M.prototype.next=mq,M.prototype.plant=yq,M.prototype.reverse=vq,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=wq,M.prototype.first=M.prototype.head,Z0&&(M.prototype[Z0]=gq),M},"runInContext"),iu=dj();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Sn._=iu,define(function(){return iu})):rc?((rc.exports=iu)._=iu,E2._=iu):Sn._=iu}).call(tp)});var fN=ye((Cfe,z4)=>{"use strict";var EJ=AK(),AJ=gt("crypto"),CJ=gt("url"),bJ=CK(),xJ=gt("http"),NJ=gt("https"),TJ=gt("util"),IJ=bK(),BJ=gt("zlib"),b4=gt("stream"),DJ=gt("events");function xa(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}o(xa,"_interopDefaultLegacy");var x4=xa(EJ),_J=xa(AJ),RJ=xa(CJ),PJ=xa(bJ),OJ=xa(xJ),kJ=xa(NJ),N4=xa(TJ),LJ=xa(IJ),Iu=xa(BJ),Tu=xa(b4);function T4(r,e){return o(function(){return r.apply(e,arguments)},"wrap")}o(T4,"bind");var{toString:VJ}=Object.prototype,{getPrototypeOf:sN}=Object,{iterator:fS,toStringTag:I4}=Symbol,hS=(r=>e=>{let t=VJ.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Hi=o(r=>(r=r.toLowerCase(),e=>hS(e)===r),"kindOfTest"),pS=o(r=>e=>typeof e===r,"typeOfTest"),{isArray:op}=Array,np=pS("undefined");function km(r){return r!==null&&!np(r)&&r.constructor!==null&&!np(r.constructor)&&Cs(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}o(km,"isBuffer");var B4=Hi("ArrayBuffer");function UJ(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&B4(r.buffer),e}o(UJ,"isArrayBufferView");var MJ=pS("string"),Cs=pS("function"),D4=pS("number"),Lm=o(r=>r!==null&&typeof r=="object","isObject"),jJ=o(r=>r===!0||r===!1,"isBoolean"),sS=o(r=>{if(hS(r)!=="object")return!1;let e=sN(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(I4 in r)&&!(fS in r)},"isPlainObject"),FJ=o(r=>{if(!Lm(r)||km(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},"isEmptyObject"),qJ=Hi("Date"),HJ=Hi("File"),KJ=Hi("Blob"),$J=Hi("FileList"),XJ=o(r=>Lm(r)&&Cs(r.pipe),"isStream"),GJ=o(r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Cs(r.append)&&((e=hS(r))==="formdata"||e==="object"&&Cs(r.toString)&&r.toString()==="[object FormData]"))},"isFormData"),WJ=Hi("URLSearchParams"),[JJ,zJ,YJ,QJ]=["ReadableStream","Request","Response","Headers"].map(Hi),ZJ=o(r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function Vm(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,s;if(typeof r!="object"&&(r=[r]),op(r))for(n=0,s=r.length;n<s;n++)e.call(null,r[n],n,r);else{if(km(r))return;let i=t?Object.getOwnPropertyNames(r):Object.keys(r),a=i.length,u;for(n=0;n<a;n++)u=i[n],e.call(null,r[u],u,r)}}o(Vm,"forEach");function _4(r,e){if(km(r))return null;e=e.toLowerCase();let t=Object.keys(r),n=t.length,s;for(;n-- >0;)if(s=t[n],e===s.toLowerCase())return s;return null}o(_4,"findKey");var Ec=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,R4=o(r=>!np(r)&&r!==Ec,"isContextDefined");function Wx(){let{caseless:r,skipUndefined:e}=R4(this)&&this||{},t={},n=o((s,i)=>{let a=r&&_4(t,i)||i;sS(t[a])&&sS(s)?t[a]=Wx(t[a],s):sS(s)?t[a]=Wx({},s):op(s)?t[a]=s.slice():(!e||!np(s))&&(t[a]=s)},"assignValue");for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Vm(arguments[s],n);return t}o(Wx,"merge");var ez=o((r,e,t,{allOwnKeys:n}={})=>(Vm(e,(s,i)=>{t&&Cs(s)?r[i]=T4(s,t):r[i]=s},{allOwnKeys:n}),r),"extend"),tz=o(r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),rz=o((r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},"inherits"),nz=o((r,e,t,n)=>{let s,i,a,u={};if(e=e||{},r==null)return e;do{for(s=Object.getOwnPropertyNames(r),i=s.length;i-- >0;)a=s[i],(!n||n(a,r,e))&&!u[a]&&(e[a]=r[a],u[a]=!0);r=t!==!1&&sN(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},"toFlatObject"),sz=o((r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},"endsWith"),iz=o(r=>{if(!r)return null;if(op(r))return r;let e=r.length;if(!D4(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},"toArray"),az=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&sN(Uint8Array)),oz=o((r,e)=>{let n=(r&&r[fS]).call(r),s;for(;(s=n.next())&&!s.done;){let i=s.value;e.call(r,i[0],i[1])}},"forEachEntry"),uz=o((r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},"matchAll"),lz=Hi("HTMLFormElement"),cz=o(r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,o(function(t,n,s){return n.toUpperCase()+s},"replacer")),"toCamelCase"),r4=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),fz=Hi("RegExp"),P4=o((r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};Vm(t,(s,i)=>{let a;(a=e(s,i,r))!==!1&&(n[i]=a||s)}),Object.defineProperties(r,n)},"reduceDescriptors"),hz=o(r=>{P4(r,(e,t)=>{if(Cs(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(Cs(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),pz=o((r,e)=>{let t={},n=o(s=>{s.forEach(i=>{t[i]=!0})},"define");return op(r)?n(r):n(String(r).split(e)),t},"toObjectSet"),dz=o(()=>{},"noop"),mz=o((r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,"toFiniteNumber");function gz(r){return!!(r&&Cs(r.append)&&r[I4]==="FormData"&&r[fS])}o(gz,"isSpecCompliantForm");var yz=o(r=>{let e=new Array(10),t=o((n,s)=>{if(Lm(n)){if(e.indexOf(n)>=0)return;if(km(n))return n;if(!("toJSON"in n)){e[s]=n;let i=op(n)?[]:{};return Vm(n,(a,u)=>{let l=t(a,s+1);!np(l)&&(i[u]=l)}),e[s]=void 0,i}}return n},"visit");return t(r,0)},"toJSONObject"),vz=Hi("AsyncFunction"),wz=o(r=>r&&(Lm(r)||Cs(r))&&Cs(r.then)&&Cs(r.catch),"isThenable"),O4=((r,e)=>r?setImmediate:e?((t,n)=>(Ec.addEventListener("message",({source:s,data:i})=>{s===Ec&&i===t&&n.length&&n.shift()()},!1),s=>{n.push(s),Ec.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Cs(Ec.postMessage)),Sz=typeof queueMicrotask<"u"?queueMicrotask.bind(Ec):typeof process<"u"&&process.nextTick||O4,Ez=o(r=>r!=null&&Cs(r[fS]),"isIterable"),ce={isArray:op,isArrayBuffer:B4,isBuffer:km,isFormData:GJ,isArrayBufferView:UJ,isString:MJ,isNumber:D4,isBoolean:jJ,isObject:Lm,isPlainObject:sS,isEmptyObject:FJ,isReadableStream:JJ,isRequest:zJ,isResponse:YJ,isHeaders:QJ,isUndefined:np,isDate:qJ,isFile:HJ,isBlob:KJ,isRegExp:fz,isFunction:Cs,isStream:XJ,isURLSearchParams:WJ,isTypedArray:az,isFileList:$J,forEach:Vm,merge:Wx,extend:ez,trim:ZJ,stripBOM:tz,inherits:rz,toFlatObject:nz,kindOf:hS,kindOfTest:Hi,endsWith:sz,toArray:iz,forEachEntry:oz,matchAll:uz,isHTMLForm:lz,hasOwnProperty:r4,hasOwnProp:r4,reduceDescriptors:P4,freezeMethods:hz,toObjectSet:pz,toCamelCase:cz,noop:dz,toFiniteNumber:mz,findKey:_4,global:Ec,isContextDefined:R4,isSpecCompliantForm:gz,toJSONObject:yz,isAsyncFn:vz,isThenable:wz,setImmediate:O4,asap:Sz,isIterable:Ez};function it(r,e,t,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}o(it,"AxiosError");ce.inherits(it,Error,{toJSON:o(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var k4=it.prototype,L4={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{L4[r]={value:r}});Object.defineProperties(it,L4);Object.defineProperty(k4,"isAxiosError",{value:!0});it.from=(r,e,t,n,s,i)=>{let a=Object.create(k4);ce.toFlatObject(r,a,o(function(h){return h!==Error.prototype},"filter"),f=>f!=="isAxiosError");let u=r&&r.message?r.message:"Error",l=e==null&&r?r.code:e;return it.call(a,u,l,t,n,s),r&&a.cause==null&&Object.defineProperty(a,"cause",{value:r,configurable:!0}),a.name=r&&r.name||"Error",i&&Object.assign(a,i),a};function Jx(r){return ce.isPlainObject(r)||ce.isArray(r)}o(Jx,"isVisitable");function V4(r){return ce.endsWith(r,"[]")?r.slice(0,-2):r}o(V4,"removeBrackets");function n4(r,e,t){return r?r.concat(e).map(o(function(s,i){return s=V4(s),!t&&i?"["+s+"]":s},"each")).join(t?".":""):e}o(n4,"renderKey");function Az(r){return ce.isArray(r)&&!r.some(Jx)}o(Az,"isFlatArray");var Cz=ce.toFlatObject(ce,{},null,o(function(e){return/^is[A-Z]/.test(e)},"filter"));function dS(r,e,t){if(!ce.isObject(r))throw new TypeError("target must be an object");e=e||new(x4.default||FormData),t=ce.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,o(function(S,E){return!ce.isUndefined(E[S])},"defined"));let n=t.metaTokens,s=t.visitor||h,i=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(e);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(ce.isDate(y))return y.toISOString();if(ce.isBoolean(y))return y.toString();if(!l&&ce.isBlob(y))throw new it("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(y)||ce.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}o(f,"convertValue");function h(y,S,E){let b=y;if(y&&!E&&typeof y=="object"){if(ce.endsWith(S,"{}"))S=n?S:S.slice(0,-2),y=JSON.stringify(y);else if(ce.isArray(y)&&Az(y)||(ce.isFileList(y)||ce.endsWith(S,"[]"))&&(b=ce.toArray(y)))return S=V4(S),b.forEach(o(function(A,C){!(ce.isUndefined(A)||A===null)&&e.append(a===!0?n4([S],C,i):a===null?S:S+"[]",f(A))},"each")),!1}return Jx(y)?!0:(e.append(n4(E,S,i),f(y)),!1)}o(h,"defaultVisitor");let m=[],g=Object.assign(Cz,{defaultVisitor:h,convertValue:f,isVisitable:Jx});function w(y,S){if(!ce.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+S.join("."));m.push(y),ce.forEach(y,o(function(b,T){(!(ce.isUndefined(b)||b===null)&&s.call(e,b,ce.isString(T)?T.trim():T,S,g))===!0&&w(b,S?S.concat(T):[T])},"each")),m.pop()}}if(o(w,"build"),!ce.isObject(r))throw new TypeError("data must be an object");return w(r),e}o(dS,"toFormData");function s4(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,o(function(n){return e[n]},"replacer"))}o(s4,"encode$1");function U4(r,e){this._pairs=[],r&&dS(r,this,e)}o(U4,"AxiosURLSearchParams");var M4=U4.prototype;M4.append=o(function(e,t){this._pairs.push([e,t])},"append");M4.toString=o(function(e){let t=e?function(n){return e.call(this,n,s4)}:s4;return this._pairs.map(o(function(s){return t(s[0])+"="+t(s[1])},"each"),"").join("&")},"toString");function bz(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}o(bz,"encode");function iN(r,e,t){if(!e)return r;let n=t&&t.encode||bz;ce.isFunction(t)&&(t={serialize:t});let s=t&&t.serialize,i;if(s?i=s(e,t):i=ce.isURLSearchParams(e)?e.toString():new U4(e,t).toString(n),i){let a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+i}return r}o(iN,"buildURL");var zx=class{static{o(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ce.forEach(this.handlers,o(function(n){n!==null&&e(n)},"forEachHandler"))}},i4=zx,aN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xz=RJ.default.URLSearchParams,Hx="abcdefghijklmnopqrstuvwxyz",a4="0123456789",j4={DIGIT:a4,ALPHA:Hx,ALPHA_DIGIT:Hx+Hx.toUpperCase()+a4},Nz=o((r=16,e=j4.ALPHA_DIGIT)=>{let t="",{length:n}=e,s=new Uint32Array(r);_J.default.randomFillSync(s);for(let i=0;i<r;i++)t+=e[s[i]%n];return t},"generateString"),Tz={isNode:!0,classes:{URLSearchParams:xz,FormData:x4.default,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:j4,generateString:Nz,protocols:["http","https","file","data"]},oN=typeof window<"u"&&typeof document<"u",Yx=typeof navigator=="object"&&navigator||void 0,Iz=oN&&(!Yx||["ReactNative","NativeScript","NS"].indexOf(Yx.product)<0),Bz=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dz=oN&&window.location.href||"http://localhost",_z=Object.freeze({__proto__:null,hasBrowserEnv:oN,hasStandardBrowserWebWorkerEnv:Bz,hasStandardBrowserEnv:Iz,navigator:Yx,origin:Dz}),zr={..._z,...Tz};function Rz(r,e){return dS(r,new zr.classes.URLSearchParams,{visitor:o(function(t,n,s,i){return zr.isNode&&ce.isBuffer(t)?(this.append(n,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},"visitor"),...e})}o(Rz,"toURLEncodedForm");function Pz(r){return ce.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}o(Pz,"parsePropPath");function Oz(r){let e={},t=Object.keys(r),n,s=t.length,i;for(n=0;n<s;n++)i=t[n],e[i]=r[i];return e}o(Oz,"arrayToObject");function F4(r){function e(t,n,s,i){let a=t[i++];if(a==="__proto__")return!0;let u=Number.isFinite(+a),l=i>=t.length;return a=!a&&ce.isArray(s)?s.length:a,l?(ce.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!u):((!s[a]||!ce.isObject(s[a]))&&(s[a]=[]),e(t,n,s[a],i)&&ce.isArray(s[a])&&(s[a]=Oz(s[a])),!u)}if(o(e,"buildPath"),ce.isFormData(r)&&ce.isFunction(r.entries)){let t={};return ce.forEachEntry(r,(n,s)=>{e(Pz(n),s,t,0)}),t}return null}o(F4,"formDataToJSON");function kz(r,e,t){if(ce.isString(r))try{return(e||JSON.parse)(r),ce.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}o(kz,"stringifySafely");var uN={transitional:aN,adapter:["xhr","http","fetch"],transformRequest:[o(function(e,t){let n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=ce.isObject(e);if(i&&ce.isHTMLForm(e)&&(e=new FormData(e)),ce.isFormData(e))return s?JSON.stringify(F4(e)):e;if(ce.isArrayBuffer(e)||ce.isBuffer(e)||ce.isStream(e)||ce.isFile(e)||ce.isBlob(e)||ce.isReadableStream(e))return e;if(ce.isArrayBufferView(e))return e.buffer;if(ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Rz(e,this.formSerializer).toString();if((u=ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return dS(u?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),kz(e)):e},"transformRequest")],transformResponse:[o(function(e){let t=this.transitional||uN.transitional,n=t&&t.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(e)||ce.isReadableStream(e))return e;if(e&&ce.isString(e)&&(n&&!this.responseType||s)){let a=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(u){if(a)throw u.name==="SyntaxError"?it.from(u,it.ERR_BAD_RESPONSE,this,null,this.response):u}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:zr.classes.FormData,Blob:zr.classes.Blob},validateStatus:o(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],r=>{uN.headers[r]={}});var lN=uN,Lz=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vz=o(r=>{let e={},t,n,s;return r&&r.split(`
42
+ `).forEach(o(function(a){s=a.indexOf(":"),t=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!t||e[t]&&Lz[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)},"parser")),e},"parseHeaders"),o4=Symbol("internals");function Pm(r){return r&&String(r).trim().toLowerCase()}o(Pm,"normalizeHeader");function iS(r){return r===!1||r==null?r:ce.isArray(r)?r.map(iS):String(r)}o(iS,"normalizeValue");function Uz(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}o(Uz,"parseTokens");var Mz=o(r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()),"isValidHeaderName");function Kx(r,e,t,n,s){if(ce.isFunction(n))return n.call(this,e,t);if(s&&(e=t),!!ce.isString(e)){if(ce.isString(n))return e.indexOf(n)!==-1;if(ce.isRegExp(n))return n.test(e)}}o(Kx,"matchHeaderValue");function jz(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}o(jz,"formatHeader");function Fz(r,e){let t=ce.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:o(function(s,i,a){return this[n].call(this,e,s,i,a)},"value"),configurable:!0})})}o(Fz,"buildAccessors");var sp=class{static{o(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,n){let s=this;function i(u,l,f){let h=Pm(l);if(!h)throw new Error("header name must be a non-empty string");let m=ce.findKey(s,h);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||l]=iS(u))}o(i,"setHeader");let a=o((u,l)=>ce.forEach(u,(f,h)=>i(f,h,l)),"setHeaders");if(ce.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(ce.isString(e)&&(e=e.trim())&&!Mz(e))a(Vz(e),t);else if(ce.isObject(e)&&ce.isIterable(e)){let u={},l,f;for(let h of e){if(!ce.isArray(h))throw TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(l=u[f])?ce.isArray(l)?[...l,h[1]]:[l,h[1]]:h[1]}a(u,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Pm(e),e){let n=ce.findKey(this,e);if(n){let s=this[n];if(!t)return s;if(t===!0)return Uz(s);if(ce.isFunction(t))return t.call(this,s,n);if(ce.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Pm(e),e){let n=ce.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Kx(this,this[n],n,t)))}return!1}delete(e,t){let n=this,s=!1;function i(a){if(a=Pm(a),a){let u=ce.findKey(n,a);u&&(!t||Kx(n,n[u],u,t))&&(delete n[u],s=!0)}}return o(i,"deleteHeader"),ce.isArray(e)?e.forEach(i):i(e),s}clear(e){let t=Object.keys(this),n=t.length,s=!1;for(;n--;){let i=t[n];(!e||Kx(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){let t=this,n={};return ce.forEach(this,(s,i)=>{let a=ce.findKey(n,i);if(a){t[a]=iS(s),delete t[i];return}let u=e?jz(i):String(i).trim();u!==i&&delete t[i],t[u]=iS(s),n[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return ce.forEach(this,(n,s)=>{n!=null&&n!==!1&&(t[s]=e&&ce.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
43
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(s=>n.set(s)),n}static accessor(e){let n=(this[o4]=this[o4]={accessors:{}}).accessors,s=this.prototype;function i(a){let u=Pm(a);n[u]||(Fz(s,a),n[u]=!0)}return o(i,"defineAccessor"),ce.isArray(e)?e.forEach(i):i(e),this}};sp.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(sp.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:o(()=>r,"get"),set(n){this[t]=n}}});ce.freezeMethods(sp);var bs=sp;function $x(r,e){let t=this||lN,n=e||t,s=bs.from(n.headers),i=n.data;return ce.forEach(r,o(function(u){i=u.call(t,i,s.normalize(),e?e.status:void 0)},"transform")),s.normalize(),i}o($x,"transformData");function q4(r){return!!(r&&r.__CANCEL__)}o(q4,"isCancel");function Bu(r,e,t){it.call(this,r??"canceled",it.ERR_CANCELED,e,t),this.name="CanceledError"}o(Bu,"CanceledError");ce.inherits(Bu,it,{__CANCEL__:!0});function rp(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new it("Request failed with status code "+t.status,[it.ERR_BAD_REQUEST,it.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}o(rp,"settle");function qz(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}o(qz,"isAbsoluteURL");function Hz(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}o(Hz,"combineURLs");function cN(r,e,t){let n=!qz(e);return r&&(n||t==!1)?Hz(r,e):e}o(cN,"buildFullPath");var uS="1.12.2";function H4(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}o(H4,"parseProtocol");var Kz=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function $z(r,e,t){let n=t&&t.Blob||zr.classes.Blob,s=H4(r);if(e===void 0&&n&&(e=!0),s==="data"){r=s.length?r.slice(s.length+1):r;let i=Kz.exec(r);if(!i)throw new it("Invalid URL",it.ERR_INVALID_URL);let a=i[1],u=i[2],l=i[3],f=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(e){if(!n)throw new it("Blob is not supported",it.ERR_NOT_SUPPORT);return new n([f],{type:a})}return f}throw new it("Unsupported protocol "+s,it.ERR_NOT_SUPPORT)}o($z,"fromDataURI");var Xx=Symbol("internals"),Qx=class extends Tu.default.Transform{static{o(this,"AxiosTransformStream")}constructor(e){e=ce.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,s)=>!ce.isUndefined(s[n])),super({readableHighWaterMark:e.chunkSize});let t=this[Xx]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){let t=this[Xx];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let s=this[Xx],i=s.maxRate,a=this.readableHighWaterMark,u=s.timeWindow,l=1e3/u,f=i/l,h=s.minChunkSize!==!1?Math.max(s.minChunkSize,f*.01):0,m=o((w,y)=>{let S=Buffer.byteLength(w);s.bytesSeen+=S,s.bytes+=S,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(w)?process.nextTick(y):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(y)}},"pushChunk"),g=o((w,y)=>{let S=Buffer.byteLength(w),E=null,b=a,T,A=0;if(i){let C=Date.now();(!s.ts||(A=C-s.ts)>=u)&&(s.ts=C,T=f-s.bytes,s.bytes=T<0?-T:0,A=0),T=f-s.bytes}if(i){if(T<=0)return setTimeout(()=>{y(null,w)},u-A);T<b&&(b=T)}b&&S>b&&S-b>h&&(E=w.subarray(b),w=w.subarray(0,b)),m(w,E?()=>{process.nextTick(y,null,E)}:y)},"transformChunk");g(e,o(function w(y,S){if(y)return n(y);S?g(S,w):n(null)},"transformNextChunk"))}},u4=Qx,{asyncIterator:l4}=Symbol,Xz=o(async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[l4]?yield*r[l4]():yield r},"readBlob"),K4=Xz,Gz=zr.ALPHABET.ALPHA_DIGIT+"-_",Om=typeof TextEncoder=="function"?new TextEncoder:new N4.default.TextEncoder,Ac=`\r
44
+ `,Wz=Om.encode(Ac),Jz=2,Zx=class{static{o(this,"FormDataPart")}constructor(e,t){let{escapeName:n}=this.constructor,s=ce.isString(t),i=`Content-Disposition: form-data; name="${n(e)}"${!s&&t.name?`; filename="${n(t.name)}"`:""}${Ac}`;s?t=Om.encode(String(t).replace(/\r?\n|\r\n?/g,Ac)):i+=`Content-Type: ${t.type||"application/octet-stream"}${Ac}`,this.headers=Om.encode(i+Ac),this.contentLength=s?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+Jz,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;ce.isTypedArray(e)?yield e:yield*K4(e),yield Wz}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},zz=o((r,e,t)=>{let{tag:n="form-data-boundary",size:s=25,boundary:i=n+"-"+zr.generateString(s,Gz)}=t||{};if(!ce.isFormData(r))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let a=Om.encode("--"+i+Ac),u=Om.encode("--"+i+"--"+Ac),l=u.byteLength,f=Array.from(r.entries()).map(([m,g])=>{let w=new Zx(m,g);return l+=w.size,w});l+=a.byteLength*f.length,l=ce.toFiniteNumber(l);let h={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(l)&&(h["Content-Length"]=l),e&&e(h),b4.Readable.from((async function*(){for(let m of f)yield a,yield*m.encode();yield u})())},"formDataToStream"),Yz=zz,eN=class extends Tu.default.Transform{static{o(this,"ZlibHeaderTransformStream")}__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let s=Buffer.alloc(2);s[0]=120,s[1]=156,this.push(s,t)}this.__transform(e,t,n)}},Qz=eN,Zz=o((r,e)=>ce.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(s=>{try{e?n(null,...e(s)):n(null,s)}catch(i){n(i)}},n)}:r,"callbackify"),eY=Zz;function tY(r,e){r=r||10;let t=new Array(r),n=new Array(r),s=0,i=0,a;return e=e!==void 0?e:1e3,o(function(l){let f=Date.now(),h=n[i];a||(a=f),t[s]=l,n[s]=f;let m=i,g=0;for(;m!==s;)g+=t[m++],m=m%r;if(s=(s+1)%r,s===i&&(i=(i+1)%r),f-a<e)return;let w=h&&f-h;return w?Math.round(g*1e3/w):void 0},"push")}o(tY,"speedometer");function rY(r,e){let t=0,n=1e3/e,s,i,a=o((f,h=Date.now())=>{t=h,s=null,i&&(clearTimeout(i),i=null),r(...f)},"invoke");return[o((...f)=>{let h=Date.now(),m=h-t;m>=n?a(f,h):(s=f,i||(i=setTimeout(()=>{i=null,a(s)},n-m)))},"throttled"),o(()=>s&&a(s),"flush")]}o(rY,"throttle");var ip=o((r,e,t=3)=>{let n=0,s=tY(50,250);return rY(i=>{let a=i.loaded,u=i.lengthComputable?i.total:void 0,l=a-n,f=s(l),h=a<=u;n=a;let m={loaded:a,total:u,progress:u?a/u:void 0,bytes:l,rate:f||void 0,estimated:f&&u&&h?(u-a)/f:void 0,event:i,lengthComputable:u!=null,[e?"download":"upload"]:!0};r(m)},t)},"progressEventReducer"),lS=o((r,e)=>{let t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},"progressEventDecorator"),cS=o(r=>(...e)=>ce.asap(()=>r(...e)),"asyncDecorator");function nY(r){if(!r||typeof r!="string"||!r.startsWith("data:"))return 0;let e=r.indexOf(",");if(e<0)return 0;let t=r.slice(5,e),n=r.slice(e+1);if(/;base64/i.test(t)){let i=n.length,a=n.length;for(let g=0;g<a;g++)if(n.charCodeAt(g)===37&&g+2<a){let w=n.charCodeAt(g+1),y=n.charCodeAt(g+2);(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102)&&(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102)&&(i-=2,g+=2)}let u=0,l=a-1,f=o(g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100),"tailIsPct3D");l>=0&&(n.charCodeAt(l)===61?(u++,l--):f(l)&&(u++,l-=3)),u===1&&l>=0&&(n.charCodeAt(l)===61||f(l))&&u++;let m=Math.floor(i/4)*3-(u||0);return m>0?m:0}return Buffer.byteLength(n,"utf8")}o(nY,"estimateDataURLDecodedBytes");var c4={flush:Iu.default.constants.Z_SYNC_FLUSH,finishFlush:Iu.default.constants.Z_SYNC_FLUSH},sY={flush:Iu.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Iu.default.constants.BROTLI_OPERATION_FLUSH},f4=ce.isFunction(Iu.default.createBrotliDecompress),{http:iY,https:aY}=LJ.default,oY=/https:?/,h4=zr.protocols.map(r=>r+":"),p4=o((r,[e,t])=>(r.on("end",t).on("error",t),e),"flushOnFinish");function uY(r,e){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,e)}o(uY,"dispatchBeforeRedirect");function $4(r,e,t){let n=e;if(!n&&n!==!1){let s=PJ.default.getProxyForUrl(t);s&&(n=new URL(s))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let i=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+i}r.headers.host=r.hostname+(r.port?":"+r.port:"");let s=n.hostname||n.host;r.hostname=s,r.host=s,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=o(function(i){$4(i,e,i.href)},"beforeRedirect")}o($4,"setProxy");var lY=typeof process<"u"&&ce.kindOf(process)==="process",cY=o(r=>new Promise((e,t)=>{let n,s,i=o((l,f)=>{s||(s=!0,n&&n(l,f))},"done"),a=o(l=>{i(l),e(l)},"_resolve"),u=o(l=>{i(l,!0),t(l)},"_reject");r(a,u,l=>n=l).catch(u)}),"wrapAsync"),fY=o(({address:r,family:e})=>{if(!ce.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},"resolveFamily"),d4=o((r,e)=>fY(ce.isObject(r)?r:{address:r,family:e}),"buildAddressEntry"),hY=lY&&o(function(e){return cY(o(async function(n,s,i){let{data:a,lookup:u,family:l}=e,{responseType:f,responseEncoding:h}=e,m=e.method.toUpperCase(),g,w=!1,y;if(u){let fe=eY(u,Se=>ce.isArray(Se)?Se:[Se]);u=o((Se,Ke,be)=>{fe(Se,Ke,(we,Me,Je)=>{if(we)return be(we);let Ye=ce.isArray(Me)?Me.map(lt=>d4(lt)):[d4(Me,Je)];Ke.all?be(we,Ye):be(we,Ye[0].address,Ye[0].family)})},"lookup")}let S=new DJ.EventEmitter,E=o(()=>{e.cancelToken&&e.cancelToken.unsubscribe(b),e.signal&&e.signal.removeEventListener("abort",b),S.removeAllListeners()},"onFinished");i((fe,Se)=>{g=!0,Se&&(w=!0,E())});function b(fe){S.emit("abort",!fe||fe.type?new Bu(null,e,y):fe)}o(b,"abort"),S.once("abort",s),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(b),e.signal&&(e.signal.aborted?b():e.signal.addEventListener("abort",b)));let T=cN(e.baseURL,e.url,e.allowAbsoluteUrls),A=new URL(T,zr.hasBrowserEnv?zr.origin:void 0),C=A.protocol||h4[0];if(C==="data:"){if(e.maxContentLength>-1){let Se=String(e.url||T||"");if(nY(Se)>e.maxContentLength)return s(new it("maxContentLength size of "+e.maxContentLength+" exceeded",it.ERR_BAD_RESPONSE,e))}let fe;if(m!=="GET")return rp(n,s,{status:405,statusText:"method not allowed",headers:{},config:e});try{fe=$z(e.url,f==="blob",{Blob:e.env&&e.env.Blob})}catch(Se){throw it.from(Se,it.ERR_BAD_REQUEST,e)}return f==="text"?(fe=fe.toString(h),(!h||h==="utf8")&&(fe=ce.stripBOM(fe))):f==="stream"&&(fe=Tu.default.Readable.from(fe)),rp(n,s,{data:fe,status:200,statusText:"OK",headers:new bs,config:e})}if(h4.indexOf(C)===-1)return s(new it("Unsupported protocol "+C,it.ERR_BAD_REQUEST,e));let x=bs.from(e.headers).normalize();x.set("User-Agent","axios/"+uS,!1);let{onUploadProgress:B,onDownloadProgress:F}=e,R=e.maxRate,H,q;if(ce.isSpecCompliantForm(a)){let fe=x.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Yz(a,Se=>{x.set(Se)},{tag:`axios-${uS}-boundary`,boundary:fe&&fe[1]||void 0})}else if(ce.isFormData(a)&&ce.isFunction(a.getHeaders)){if(x.set(a.getHeaders()),!x.hasContentLength())try{let fe=await N4.default.promisify(a.getLength).call(a);Number.isFinite(fe)&&fe>=0&&x.setContentLength(fe)}catch{}}else if(ce.isBlob(a)||ce.isFile(a))a.size&&x.setContentType(a.type||"application/octet-stream"),x.setContentLength(a.size||0),a=Tu.default.Readable.from(K4(a));else if(a&&!ce.isStream(a)){if(!Buffer.isBuffer(a))if(ce.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(ce.isString(a))a=Buffer.from(a,"utf-8");else return s(new it("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",it.ERR_BAD_REQUEST,e));if(x.setContentLength(a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return s(new it("Request body larger than maxBodyLength limit",it.ERR_BAD_REQUEST,e))}let K=ce.toFiniteNumber(x.getContentLength());ce.isArray(R)?(H=R[0],q=R[1]):H=q=R,a&&(B||H)&&(ce.isStream(a)||(a=Tu.default.Readable.from(a,{objectMode:!1})),a=Tu.default.pipeline([a,new u4({maxRate:ce.toFiniteNumber(H)})],ce.noop),B&&a.on("progress",p4(a,lS(K,ip(cS(B),!1,3)))));let G;if(e.auth){let fe=e.auth.username||"",Se=e.auth.password||"";G=fe+":"+Se}if(!G&&A.username){let fe=A.username,Se=A.password;G=fe+":"+Se}G&&x.delete("authorization");let he;try{he=iN(A.pathname+A.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(fe){let Se=new Error(fe.message);return Se.config=e,Se.url=e.url,Se.exists=!0,s(Se)}x.set("Accept-Encoding","gzip, compress, deflate"+(f4?", br":""),!1);let le={path:he,method:m,headers:x.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:G,protocol:C,family:l,beforeRedirect:uY,beforeRedirects:{}};!ce.isUndefined(u)&&(le.lookup=u),e.socketPath?le.socketPath=e.socketPath:(le.hostname=A.hostname.startsWith("[")?A.hostname.slice(1,-1):A.hostname,le.port=A.port,$4(le,e.proxy,C+"//"+A.hostname+(A.port?":"+A.port:"")+le.path));let oe,Z=oY.test(le.protocol);if(le.agent=Z?e.httpsAgent:e.httpAgent,e.transport?oe=e.transport:e.maxRedirects===0?oe=Z?kJ.default:OJ.default:(e.maxRedirects&&(le.maxRedirects=e.maxRedirects),e.beforeRedirect&&(le.beforeRedirects.config=e.beforeRedirect),oe=Z?aY:iY),e.maxBodyLength>-1?le.maxBodyLength=e.maxBodyLength:le.maxBodyLength=1/0,e.insecureHTTPParser&&(le.insecureHTTPParser=e.insecureHTTPParser),y=oe.request(le,o(function(Se){if(y.destroyed)return;let Ke=[Se],be=+Se.headers["content-length"];if(F||q){let lt=new u4({maxRate:ce.toFiniteNumber(q)});F&&lt.on("progress",p4(lt,lS(be,ip(cS(F),!0,3)))),Ke.push(lt)}let we=Se,Me=Se.req||y;if(e.decompress!==!1&&Se.headers["content-encoding"])switch((m==="HEAD"||Se.statusCode===204)&&delete Se.headers["content-encoding"],(Se.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ke.push(Iu.default.createUnzip(c4)),delete Se.headers["content-encoding"];break;case"deflate":Ke.push(new Qz),Ke.push(Iu.default.createUnzip(c4)),delete Se.headers["content-encoding"];break;case"br":f4&&(Ke.push(Iu.default.createBrotliDecompress(sY)),delete Se.headers["content-encoding"])}we=Ke.length>1?Tu.default.pipeline(Ke,ce.noop):Ke[0];let Je=Tu.default.finished(we,()=>{Je(),E()}),Ye={status:Se.statusCode,statusText:Se.statusMessage,headers:new bs(Se.headers),config:e,request:Me};if(f==="stream")Ye.data=we,rp(n,s,Ye);else{let lt=[],O=0;we.on("data",o(function(ne){lt.push(ne),O+=ne.length,e.maxContentLength>-1&&O>e.maxContentLength&&(w=!0,we.destroy(),s(new it("maxContentLength size of "+e.maxContentLength+" exceeded",it.ERR_BAD_RESPONSE,e,Me)))},"handleStreamData")),we.on("aborted",o(function(){if(w)return;let ne=new it("stream has been aborted",it.ERR_BAD_RESPONSE,e,Me);we.destroy(ne),s(ne)},"handlerStreamAborted")),we.on("error",o(function(ne){y.destroyed||s(it.from(ne,null,e,Me))},"handleStreamError")),we.on("end",o(function(){try{let ne=lt.length===1?lt[0]:Buffer.concat(lt);f!=="arraybuffer"&&(ne=ne.toString(h),(!h||h==="utf8")&&(ne=ce.stripBOM(ne))),Ye.data=ne}catch(ne){return s(it.from(ne,null,e,Ye.request,Ye))}rp(n,s,Ye)},"handleStreamEnd"))}S.once("abort",lt=>{we.destroyed||(we.emit("error",lt),we.destroy())})},"handleResponse")),S.once("abort",fe=>{s(fe),y.destroy(fe)}),y.on("error",o(function(Se){s(it.from(Se,null,e,y))},"handleRequestError")),y.on("socket",o(function(Se){Se.setKeepAlive(!0,1e3*60)},"handleRequestSocket")),e.timeout){let fe=parseInt(e.timeout,10);if(Number.isNaN(fe)){s(new it("error trying to parse `config.timeout` to int",it.ERR_BAD_OPTION_VALUE,e,y));return}y.setTimeout(fe,o(function(){if(g)return;let Ke=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",be=e.transitional||aN;e.timeoutErrorMessage&&(Ke=e.timeoutErrorMessage),s(new it(Ke,be.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,e,y)),b()},"handleRequestTimeout"))}if(ce.isStream(a)){let fe=!1,Se=!1;a.on("end",()=>{fe=!0}),a.once("error",Ke=>{Se=!0,y.destroy(Ke)}),a.on("close",()=>{!fe&&!Se&&b(new Bu("Request stream has been aborted",e,y))}),a.pipe(y)}else y.end(a)},"dispatchHttpRequest"))},"httpAdapter"),pY=zr.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,zr.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(zr.origin),zr.navigator&&/(msie|trident)/i.test(zr.navigator.userAgent)):()=>!0,dY=zr.hasStandardBrowserEnv?{write(r,e,t,n,s,i){let a=[r+"="+encodeURIComponent(e)];ce.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),ce.isString(n)&&a.push("path="+n),ce.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}},m4=o(r=>r instanceof bs?{...r}:r,"headersToObject");function Cc(r,e){e=e||{};let t={};function n(f,h,m,g){return ce.isPlainObject(f)&&ce.isPlainObject(h)?ce.merge.call({caseless:g},f,h):ce.isPlainObject(h)?ce.merge({},h):ce.isArray(h)?h.slice():h}o(n,"getMergedValue");function s(f,h,m,g){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return n(void 0,f,m,g)}else return n(f,h,m,g)}o(s,"mergeDeepProperties");function i(f,h){if(!ce.isUndefined(h))return n(void 0,h)}o(i,"valueFromConfig2");function a(f,h){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return n(void 0,f)}else return n(void 0,h)}o(a,"defaultToConfig2");function u(f,h,m){if(m in e)return n(f,h);if(m in r)return n(void 0,f)}o(u,"mergeDirectKeys");let l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:o((f,h,m)=>s(m4(f),m4(h),m,!0),"headers")};return ce.forEach(Object.keys({...r,...e}),o(function(h){let m=l[h]||s,g=m(r[h],e[h],h);ce.isUndefined(g)&&m!==u||(t[h]=g)},"computeConfigValue")),t}o(Cc,"mergeConfig");var X4=o(r=>{let e=Cc({},r),{data:t,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:u}=e;if(e.headers=a=bs.from(a),e.url=iN(cN(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ce.isFormData(t)){if(zr.hasStandardBrowserEnv||zr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(ce.isFunction(t.getHeaders)){let l=t.getHeaders(),f=["content-type","content-length"];Object.entries(l).forEach(([h,m])=>{f.includes(h.toLowerCase())&&a.set(h,m)})}}if(zr.hasStandardBrowserEnv&&(n&&ce.isFunction(n)&&(n=n(e)),n||n!==!1&&pY(e.url))){let l=s&&i&&dY.read(i);l&&a.set(s,l)}return e},"resolveConfig"),mY=typeof XMLHttpRequest<"u",gY=mY&&function(r){return new Promise(o(function(t,n){let s=X4(r),i=s.data,a=bs.from(s.headers).normalize(),{responseType:u,onUploadProgress:l,onDownloadProgress:f}=s,h,m,g,w,y;function S(){w&&w(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}o(S,"done");let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function b(){if(!E)return;let A=bs.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),x={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:A,config:r,request:E};rp(o(function(F){t(F),S()},"_resolve"),o(function(F){n(F),S()},"_reject"),x),E=null}o(b,"onloadend"),"onloadend"in E?E.onloadend=b:E.onreadystatechange=o(function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(b)},"handleLoad"),E.onabort=o(function(){E&&(n(new it("Request aborted",it.ECONNABORTED,r,E)),E=null)},"handleAbort"),E.onerror=o(function(C){let x=C&&C.message?C.message:"Network Error",B=new it(x,it.ERR_NETWORK,r,E);B.event=C||null,n(B),E=null},"handleError"),E.ontimeout=o(function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",x=s.transitional||aN;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),n(new it(C,x.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,r,E)),E=null},"handleTimeout"),i===void 0&&a.setContentType(null),"setRequestHeader"in E&&ce.forEach(a.toJSON(),o(function(C,x){E.setRequestHeader(x,C)},"setRequestHeader")),ce.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),f&&([g,y]=ip(f,!0),E.addEventListener("progress",g)),l&&E.upload&&([m,w]=ip(l),E.upload.addEventListener("progress",m),E.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(h=o(A=>{E&&(n(!A||A.type?new Bu(null,r,E):A),E.abort(),E=null)},"onCanceled"),s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));let T=H4(s.url);if(T&&zr.protocols.indexOf(T)===-1){n(new it("Unsupported protocol "+T+":",it.ERR_BAD_REQUEST,r));return}E.send(i||null)},"dispatchXhrRequest"))},yY=o((r,e)=>{let{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,s,i=o(function(f){if(!s){s=!0,u();let h=f instanceof Error?f:this.reason;n.abort(h instanceof it?h:new Bu(h instanceof Error?h.message:h))}},"onabort"),a=e&&setTimeout(()=>{a=null,i(new it(`timeout ${e} of ms exceeded`,it.ETIMEDOUT))},e),u=o(()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),r=null)},"unsubscribe");r.forEach(f=>f.addEventListener("abort",i));let{signal:l}=n;return l.unsubscribe=()=>ce.asap(u),l}},"composeSignals"),vY=yY,wY=o(function*(r,e){let t=r.byteLength;if(!e||t<e){yield r;return}let n=0,s;for(;n<t;)s=n+e,yield r.slice(n,s),n=s},"streamChunk"),SY=o(async function*(r,e){for await(let t of EY(r))yield*wY(t,e)},"readBytes"),EY=o(async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}let e=r.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},"readStream"),g4=o((r,e,t,n)=>{let s=SY(r,e),i=0,a,u=o(l=>{a||(a=!0,n&&n(l))},"_onFinish");return new ReadableStream({async pull(l){try{let{done:f,value:h}=await s.next();if(f){u(),l.close();return}let m=h.byteLength;if(t){let g=i+=m;t(g)}l.enqueue(new Uint8Array(h))}catch(f){throw u(f),f}},cancel(l){return u(l),s.return()}},{highWaterMark:2})},"trackStream"),y4=64*1024,{isFunction:nS}=ce,AY=(({Request:r,Response:e})=>({Request:r,Response:e}))(ce.global),{ReadableStream:v4,TextEncoder:w4}=ce.global,S4=o((r,...e)=>{try{return!!r(...e)}catch{return!1}},"test"),CY=o(r=>{r=ce.merge.call({skipUndefined:!0},AY,r);let{fetch:e,Request:t,Response:n}=r,s=e?nS(e):typeof fetch=="function",i=nS(t),a=nS(n);if(!s)return!1;let u=s&&nS(v4),l=s&&(typeof w4=="function"?(y=>S=>y.encode(S))(new w4):async y=>new Uint8Array(await new t(y).arrayBuffer())),f=i&&u&&S4(()=>{let y=!1,S=new t(zr.origin,{body:new v4,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!S}),h=a&&u&&S4(()=>ce.isReadableStream(new n("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(S,E)=>{let b=S&&S[y];if(b)return b.call(S);throw new it(`Response type '${y}' is not supported`,it.ERR_NOT_SUPPORT,E)})});let g=o(async y=>{if(y==null)return 0;if(ce.isBlob(y))return y.size;if(ce.isSpecCompliantForm(y))return(await new t(zr.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(y)||ce.isArrayBuffer(y))return y.byteLength;if(ce.isURLSearchParams(y)&&(y=y+""),ce.isString(y))return(await l(y)).byteLength},"getBodyLength"),w=o(async(y,S)=>{let E=ce.toFiniteNumber(y.getContentLength());return E??g(S)},"resolveBodyLength");return async y=>{let{url:S,method:E,data:b,signal:T,cancelToken:A,timeout:C,onDownloadProgress:x,onUploadProgress:B,responseType:F,headers:R,withCredentials:H="same-origin",fetchOptions:q}=X4(y),K=e||fetch;F=F?(F+"").toLowerCase():"text";let G=vY([T,A&&A.toAbortSignal()],C),he=null,le=G&&G.unsubscribe&&(()=>{G.unsubscribe()}),oe;try{if(B&&f&&E!=="get"&&E!=="head"&&(oe=await w(R,b))!==0){let we=new t(S,{method:"POST",body:b,duplex:"half"}),Me;if(ce.isFormData(b)&&(Me=we.headers.get("content-type"))&&R.setContentType(Me),we.body){let[Je,Ye]=lS(oe,ip(cS(B)));b=g4(we.body,y4,Je,Ye)}}ce.isString(H)||(H=H?"include":"omit");let Z=i&&"credentials"in t.prototype,fe={...q,signal:G,method:E.toUpperCase(),headers:R.normalize().toJSON(),body:b,duplex:"half",credentials:Z?H:void 0};he=i&&new t(S,fe);let Se=await(i?K(he,q):K(S,fe)),Ke=h&&(F==="stream"||F==="response");if(h&&(x||Ke&&le)){let we={};["status","statusText","headers"].forEach(lt=>{we[lt]=Se[lt]});let Me=ce.toFiniteNumber(Se.headers.get("content-length")),[Je,Ye]=x&&lS(Me,ip(cS(x),!0))||[];Se=new n(g4(Se.body,y4,Je,()=>{Ye&&Ye(),le&&le()}),we)}F=F||"text";let be=await m[ce.findKey(m,F)||"text"](Se,y);return!Ke&&le&&le(),await new Promise((we,Me)=>{rp(we,Me,{data:be,headers:bs.from(Se.headers),status:Se.status,statusText:Se.statusText,config:y,request:he})})}catch(Z){throw le&&le(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new it("Network Error",it.ERR_NETWORK,y,he),{cause:Z.cause||Z}):it.from(Z,Z&&Z.code,y,he)}}},"factory"),bY=new Map,G4=o(r=>{let e=r?r.env:{},{fetch:t,Request:n,Response:s}=e,i=[n,s,t],a=i.length,u=a,l,f,h=bY;for(;u--;)l=i[u],f=h.get(l),f===void 0&&h.set(l,f=u?new Map:CY(e)),h=f;return f},"getFetch");G4();var tN={http:hY,xhr:gY,fetch:{get:G4}};ce.forEach(tN,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var E4=o(r=>`- ${r}`,"renderReason"),xY=o(r=>ce.isFunction(r)||r===null||r===!1,"isResolvedHandle"),W4={getAdapter:o((r,e)=>{r=ce.isArray(r)?r:[r];let{length:t}=r,n,s,i={};for(let a=0;a<t;a++){n=r[a];let u;if(s=n,!xY(n)&&(s=tN[(u=String(n)).toLowerCase()],s===void 0))throw new it(`Unknown adapter '${u}'`);if(s&&(ce.isFunction(s)||(s=s.get(e))))break;i[u||"#"+a]=s}if(!s){let a=Object.entries(i).map(([l,f])=>`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build")),u=t?a.length>1?`since :
45
+ `+a.map(E4).join(`
46
+ `):" "+E4(a[0]):"as no adapter specified";throw new it("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},"getAdapter"),adapters:tN};function Gx(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Bu(null,r)}o(Gx,"throwIfCancellationRequested");function A4(r){return Gx(r),r.headers=bs.from(r.headers),r.data=$x.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),W4.getAdapter(r.adapter||lN.adapter,r)(r).then(o(function(n){return Gx(r),n.data=$x.call(r,r.transformResponse,n),n.headers=bs.from(n.headers),n},"onAdapterResolution"),o(function(n){return q4(n)||(Gx(r),n&&n.response&&(n.response.data=$x.call(r,r.transformResponse,n.response),n.response.headers=bs.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(A4,"dispatchRequest");var mS={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{mS[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var C4={};mS.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+uS+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new it(s(a," has been removed"+(t?" in "+t:"")),it.ERR_DEPRECATED);return t&&!C4[a]&&(C4[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");mS.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function NY(r,e,t){if(typeof r!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],l=u===void 0||a(u,i,r);if(l!==!0)throw new it("option "+i+" must be "+l,it.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new it("Unknown option "+i,it.ERR_BAD_OPTION)}}o(NY,"assertOptions");var aS={assertOptions:NY,validators:mS},ba=aS.validators,ap=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new i4,response:new i4}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
47
+ `+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Cc(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&aS.assertOptions(n,{silentJSONParsing:ba.transitional(ba.boolean),forcedJSONParsing:ba.transitional(ba.boolean),clarifyTimeoutError:ba.transitional(ba.boolean)},!1),s!=null&&(ce.isFunction(s)?t.paramsSerializer={serialize:s}:aS.assertOptions(s,{encode:ba.function,serialize:ba.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),aS.assertOptions(t,{baseUrl:ba.spelling("baseURL"),withXsrfToken:ba.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ce.merge(i.common,i[t.method]);i&&ce.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),t.headers=bs.concat(a,i);let u=[],l=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(l=l&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let f=[];this.interceptors.response.forEach(o(function(S){f.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!l){let y=[A4.bind(this),void 0];for(y.unshift(...u),y.push(...f),g=y.length,h=Promise.resolve(t);m<g;)h=h.then(y[m++],y[m++]);return h}g=u.length;let w=t;for(;m<g;){let y=u[m++],S=u[m++];try{w=y(w)}catch(E){S.call(this,E);break}}try{h=A4.call(this,w)}catch(y){return Promise.reject(y)}for(m=0,g=f.length;m<g;)h=h.then(f[m++],f[m++]);return h}getUri(e){e=Cc(this.defaults,e);let t=cN(e.baseURL,e.url,e.allowAbsoluteUrls);return iN(t,e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],o(function(e){ap.prototype[e]=function(t,n){return this.request(Cc(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ce.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(Cc(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),ap.prototype[e]=t(),ap.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var oS=ap,rN=class r{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new Bu(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new r(o(function(s){e=s},"executor")),cancel:e}}},TY=rN;function IY(r){return o(function(t){return r.apply(null,t)},"wrap")}o(IY,"spread");function BY(r){return ce.isObject(r)&&r.isAxiosError===!0}o(BY,"isAxiosError");var nN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nN).forEach(([r,e])=>{nN[e]=r});var DY=nN;function J4(r){let e=new oS(r),t=T4(oS.prototype.request,e);return ce.extend(t,oS.prototype,e,{allOwnKeys:!0}),ce.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return J4(Cc(r,s))},"create"),t}o(J4,"createInstance");var ln=J4(lN);ln.Axios=oS;ln.CanceledError=Bu;ln.CancelToken=TY;ln.isCancel=q4;ln.VERSION=uS;ln.toFormData=dS;ln.AxiosError=it;ln.Cancel=ln.CanceledError;ln.all=o(function(e){return Promise.all(e)},"all");ln.spread=IY;ln.isAxiosError=BY;ln.mergeConfig=Cc;ln.AxiosHeaders=bs;ln.formToJSON=r=>F4(ce.isHTMLForm(r)?new FormData(r):r);ln.getAdapter=W4.getAdapter;ln.HttpStatusCode=DY;ln.default=ln;z4.exports=ln});var Y4=ye((xfe,Dr)=>{"use strict";Dr.exports.NTLMFLAG_NEGOTIATE_UNICODE=1;Dr.exports.NTLMFLAG_NEGOTIATE_OEM=2;Dr.exports.NTLMFLAG_REQUEST_TARGET=4;Dr.exports.NTLMFLAG_NEGOTIATE_SIGN=16;Dr.exports.NTLMFLAG_NEGOTIATE_SEAL=32;Dr.exports.NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE=64;Dr.exports.NTLMFLAG_NEGOTIATE_LM_KEY=128;Dr.exports.NTLMFLAG_NEGOTIATE_NETWARE=256;Dr.exports.NTLMFLAG_NEGOTIATE_NTLM_KEY=512;Dr.exports.NTLMFLAG_NEGOTIATE_ANONYMOUS=2048;Dr.exports.NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED=4096;Dr.exports.NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED=8192;Dr.exports.NTLMFLAG_NEGOTIATE_LOCAL_CALL=16384;Dr.exports.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN=32768;Dr.exports.NTLMFLAG_TARGET_TYPE_DOMAIN=65536;Dr.exports.NTLMFLAG_TARGET_TYPE_SERVER=1<<17;Dr.exports.NTLMFLAG_TARGET_TYPE_SHARE=1<<18;Dr.exports.NTLMFLAG_NEGOTIATE_NTLM2_KEY=1<<19;Dr.exports.NTLMFLAG_REQUEST_INIT_RESPONSE=1<<20;Dr.exports.NTLMFLAG_REQUEST_ACCEPT_RESPONSE=1<<21;Dr.exports.NTLMFLAG_REQUEST_NONNT_SESSION_KEY=1<<22;Dr.exports.NTLMFLAG_NEGOTIATE_TARGET_INFO=1<<23;Dr.exports.NTLMFLAG_NEGOTIATE_128=1<<29;Dr.exports.NTLMFLAG_NEGOTIATE_KEY_EXCHANGE=1<<30;Dr.exports.NTLMFLAG_NEGOTIATE_56=1<<31});var hN=ye(gi=>{"use strict";gi.readUInt32BE=o(function(e,t){var n=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return n>>>0},"readUInt32BE");gi.writeUInt32BE=o(function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=t&255},"writeUInt32BE");gi.ip=o(function(e,t,n,s){for(var i=0,a=0,u=6;u>=0;u-=2){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>>l+u&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>>l+u&1}for(var u=6;u>=0;u-=2){for(var l=1;l<=25;l+=8)a<<=1,a|=t>>>l+u&1;for(var l=1;l<=25;l+=8)a<<=1,a|=e>>>l+u&1}n[s+0]=i>>>0,n[s+1]=a>>>0},"ip");gi.rip=o(function(e,t,n,s){for(var i=0,a=0,u=0;u<4;u++)for(var l=24;l>=0;l-=8)i<<=1,i|=t>>>l+u&1,i<<=1,i|=e>>>l+u&1;for(var u=4;u<8;u++)for(var l=24;l>=0;l-=8)a<<=1,a|=t>>>l+u&1,a<<=1,a|=e>>>l+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"rip");gi.pc1=o(function(e,t,n,s){for(var i=0,a=0,u=7;u>=5;u--){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+u&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>l+u&1}for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+u&1;for(var u=1;u<=3;u++){for(var l=0;l<=24;l+=8)a<<=1,a|=t>>l+u&1;for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+u&1}for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc1");gi.r28shl=o(function(e,t){return e<<t&268435455|e>>>28-t},"r28shl");var gS=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];gi.pc2=o(function(e,t,n,s){for(var i=0,a=0,u=gS.length>>>1,l=0;l<u;l++)i<<=1,i|=e>>>gS[l]&1;for(var l=u;l<gS.length;l++)a<<=1,a|=t>>>gS[l]&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc2");gi.expand=o(function(e,t,n){var s=0,i=0;s=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4)s<<=6,s|=e>>>a&63;for(var a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(e&31)<<1|e>>>31,t[n+0]=s>>>0,t[n+1]=i>>>0},"expand");var Q4=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];gi.substitute=o(function(e,t){for(var n=0,s=0;s<4;s++){var i=e>>>18-s*6&63,a=Q4[s*64+i];n<<=4,n|=a}for(var s=0;s<4;s++){var i=t>>>18-s*6&63,a=Q4[256+s*64+i];n<<=4,n|=a}return n>>>0},"substitute");var Z4=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];gi.permute=o(function(e){for(var t=0,n=0;n<Z4.length;n++)t<<=1,t|=e>>>Z4[n]&1;return t>>>0},"permute");gi.padSplit=o(function(e,t,n){for(var s=e.toString(2);s.length<t;)s="0"+s;for(var i=[],a=0;a<t;a+=n)i.push(s.slice(a,a+n));return i.join(" ")},"padSplit")});var Um=ye((Ife,tk)=>{"use strict";tk.exports=ek;function ek(r,e){if(!r)throw new Error(e||"Assertion failed")}o(ek,"assert");ek.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var yS=ye((Dfe,rk)=>{"use strict";var _Y=Um();function yi(r){this.options=r,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=r.padding!==!1}o(yi,"Cipher");rk.exports=yi;yi.prototype._init=o(function(){},"_init");yi.prototype.update=o(function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},"update");yi.prototype._buffer=o(function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),s=0;s<n;s++)this.buffer[this.bufferOff+s]=e[t+s];return this.bufferOff+=n,n},"_buffer");yi.prototype._flushBuffer=o(function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},"_flushBuffer");yi.prototype._updateEncrypt=o(function(e){var t=0,n=0,s=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(s*this.blockSize);this.bufferOff!==0&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(i,n)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},"_updateEncrypt");yi.prototype._updateDecrypt=o(function(e){for(var t=0,n=0,s=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(s*this.blockSize);s>0;s--)t+=this._buffer(e,t),n+=this._flushBuffer(i,n);return t+=this._buffer(e,t),i},"_updateDecrypt");yi.prototype.final=o(function(e){var t;e&&(t=this.update(e));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),t?t.concat(n):n},"final");yi.prototype._pad=o(function(e,t){if(t===0)return!1;for(;t<e.length;)e[t++]=0;return!0},"_pad");yi.prototype._finalEncrypt=o(function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},"_finalEncrypt");yi.prototype._unpad=o(function(e){return e},"_unpad");yi.prototype._finalDecrypt=o(function(){_Y.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)},"_finalDecrypt")});var nk=ye((Rfe,pN)=>{"use strict";typeof Object.create=="function"?pN.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):pN.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var vS=ye((Ofe,mN)=>{"use strict";try{if(dN=gt("util"),typeof dN.inherits!="function")throw"";mN.exports=dN.inherits}catch{mN.exports=nk()}var dN});var gN=ye((kfe,ak)=>{"use strict";var sk=Um(),RY=vS(),yn=hN(),ik=yS();function PY(){this.tmp=new Array(2),this.keys=null}o(PY,"DESState");function Na(r){ik.call(this,r);var e=new PY;this._desState=e,this.deriveKeys(e,r.key)}o(Na,"DES");RY(Na,ik);ak.exports=Na;Na.create=o(function(e){return new Na(e)},"create");var OY=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Na.prototype.deriveKeys=o(function(e,t){e.keys=new Array(32),sk.equal(t.length,this.blockSize,"Invalid key length");var n=yn.readUInt32BE(t,0),s=yn.readUInt32BE(t,4);yn.pc1(n,s,e.tmp,0),n=e.tmp[0],s=e.tmp[1];for(var i=0;i<e.keys.length;i+=2){var a=OY[i>>>1];n=yn.r28shl(n,a),s=yn.r28shl(s,a),yn.pc2(n,s,e.keys,i)}},"deriveKeys");Na.prototype._update=o(function(e,t,n,s){var i=this._desState,a=yn.readUInt32BE(e,t),u=yn.readUInt32BE(e,t+4);yn.ip(a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],this.type==="encrypt"?this._encrypt(i,a,u,i.tmp,0):this._decrypt(i,a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],yn.writeUInt32BE(n,a,s),yn.writeUInt32BE(n,u,s+4)},"_update");Na.prototype._pad=o(function(e,t){if(this.padding===!1)return!1;for(var n=e.length-t,s=t;s<e.length;s++)e[s]=n;return!0},"_pad");Na.prototype._unpad=o(function(e){if(this.padding===!1)return e;for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)sk.equal(e[n],t);return e.slice(0,e.length-t)},"_unpad");Na.prototype._encrypt=o(function(e,t,n,s,i){for(var a=t,u=n,l=0;l<e.keys.length;l+=2){var f=e.keys[l],h=e.keys[l+1];yn.expand(u,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=yn.substitute(f,h),g=yn.permute(m),w=u;u=(a^g)>>>0,a=w}yn.rip(u,a,s,i)},"_encrypt");Na.prototype._decrypt=o(function(e,t,n,s,i){for(var a=n,u=t,l=e.keys.length-2;l>=0;l-=2){var f=e.keys[l],h=e.keys[l+1];yn.expand(a,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=yn.substitute(f,h),g=yn.permute(m),w=a;a=(u^g)>>>0,u=w}yn.rip(a,u,s,i)},"_decrypt")});var uk=ye(ok=>{"use strict";var kY=Um(),LY=vS(),wS={};function VY(r){kY.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=r[e]}o(VY,"CBCState");function UY(r){function e(i){r.call(this,i),this._cbcInit()}o(e,"CBC"),LY(e,r);for(var t=Object.keys(wS),n=0;n<t.length;n++){var s=t[n];e.prototype[s]=wS[s]}return e.create=o(function(a){return new e(a)},"create"),e}o(UY,"instantiate");ok.instantiate=UY;wS._cbcInit=o(function(){var e=new VY(this.options.iv);this._cbcState=e},"_cbcInit");wS._update=o(function(e,t,n,s){var i=this._cbcState,a=this.constructor.super_.prototype,u=i.iv;if(this.type==="encrypt"){for(var l=0;l<this.blockSize;l++)u[l]^=e[t+l];a._update.call(this,u,0,n,s);for(var l=0;l<this.blockSize;l++)u[l]=n[s+l]}else{a._update.call(this,e,t,n,s);for(var l=0;l<this.blockSize;l++)n[s+l]^=u[l];for(var l=0;l<this.blockSize;l++)u[l]=e[t+l]}},"_update")});var fk=ye((Mfe,ck)=>{"use strict";var MY=Um(),jY=vS(),lk=yS(),Du=gN();function FY(r,e){MY.equal(e.length,24,"Invalid key length");var t=e.slice(0,8),n=e.slice(8,16),s=e.slice(16,24);r==="encrypt"?this.ciphers=[Du.create({type:"encrypt",key:t}),Du.create({type:"decrypt",key:n}),Du.create({type:"encrypt",key:s})]:this.ciphers=[Du.create({type:"decrypt",key:s}),Du.create({type:"encrypt",key:n}),Du.create({type:"decrypt",key:t})]}o(FY,"EDEState");function bc(r){lk.call(this,r);var e=new FY(this.type,this.options.key);this._edeState=e}o(bc,"EDE");jY(bc,lk);ck.exports=bc;bc.create=o(function(e){return new bc(e)},"create");bc.prototype._update=o(function(e,t,n,s){var i=this._edeState;i.ciphers[0]._update(e,t,n,s),i.ciphers[1]._update(n,s,n,s),i.ciphers[2]._update(n,s,n,s)},"_update");bc.prototype._pad=Du.prototype._pad;bc.prototype._unpad=Du.prototype._unpad});var hk=ye(up=>{"use strict";up.utils=hN();up.Cipher=yS();up.DES=gN();up.CBC=uk();up.EDE=fk()});var pk=ye((qfe,SS)=>{"use strict";(function(){"use strict";var r=typeof window=="object"?window:{},e=!r.JS_MD4_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;e&&(r=global);var t=!r.JS_MD4_NO_COMMON_JS&&typeof SS=="object"&&SS.exports,n=typeof define=="function"&&define.amd,s=!r.JS_MD4_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",i="0123456789abcdef".split(""),a=[128,32768,8388608,-2147483648],u=[0,8,16,24],l=["hex","array","digest","buffer","arrayBuffer"],f=[],h;if(s){var m=new ArrayBuffer(68);h=new Uint8Array(m),f=new Uint32Array(m)}var g=o(function(b){return function(T){return new S(!0).update(T)[b]()}},"createOutputMethod"),w=o(function(){var b=g("hex");e&&(b=y(b)),b.create=function(){return new S},b.update=function(C){return b.create().update(C)};for(var T=0;T<l.length;++T){var A=l[T];b[A]=g(A)}return b},"createMethod"),y=o(function(b){var T=gt("crypto"),A=gt("buffer").Buffer,C=o(function(x){if(typeof x=="string")return T.createHash("md4").update(x,"utf8").digest("hex");if(s&&x instanceof ArrayBuffer)x=new Uint8Array(x);else if(x.length===void 0)return b(x);return T.createHash("md4").update(new A(x)).digest("hex")},"nodeMethod");return C},"nodeWrap");function S(b){if(b)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=h;else if(s){var T=new ArrayBuffer(68);this.buffer8=new Uint8Array(T),this.blocks=new Uint32Array(T)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}o(S,"Md4"),S.prototype.update=function(b){if(!this.finalized){var T=typeof b!="string";T&&s&&b instanceof ArrayBuffer&&(b=new Uint8Array(b));for(var A,C=0,x,B=b.length||0,F=this.blocks,R=this.buffer8;C<B;){if(this.hashed&&(this.hashed=!1,F[0]=F[16],F[16]=F[1]=F[2]=F[3]=F[4]=F[5]=F[6]=F[7]=F[8]=F[9]=F[10]=F[11]=F[12]=F[13]=F[14]=F[15]=0),T)if(s)for(x=this.start;C<B&&x<64;++C)R[x++]=b[C];else for(x=this.start;C<B&&x<64;++C)F[x>>2]|=b[C]<<u[x++&3];else if(s)for(x=this.start;C<B&&x<64;++C)A=b.charCodeAt(C),A<128?R[x++]=A:A<2048?(R[x++]=192|A>>6,R[x++]=128|A&63):A<55296||A>=57344?(R[x++]=224|A>>12,R[x++]=128|A>>6&63,R[x++]=128|A&63):(A=65536+((A&1023)<<10|b.charCodeAt(++C)&1023),R[x++]=240|A>>18,R[x++]=128|A>>12&63,R[x++]=128|A>>6&63,R[x++]=128|A&63);else for(x=this.start;C<B&&x<64;++C)A=b.charCodeAt(C),A<128?F[x>>2]|=A<<u[x++&3]:A<2048?(F[x>>2]|=(192|A>>6)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]):A<55296||A>=57344?(F[x>>2]|=(224|A>>12)<<u[x++&3],F[x>>2]|=(128|A>>6&63)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]):(A=65536+((A&1023)<<10|b.charCodeAt(++C)&1023),F[x>>2]|=(240|A>>18)<<u[x++&3],F[x>>2]|=(128|A>>12&63)<<u[x++&3],F[x>>2]|=(128|A>>6&63)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]);this.lastByteIndex=x,this.bytes+=x-this.start,x>=64?(this.start=x-64,this.hash(),this.hashed=!0):this.start=x}return this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var b=this.blocks,T=this.lastByteIndex;b[T>>2]|=a[T&3],T>=56&&(this.hashed||this.hash(),b[0]=b[16],b[16]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=b[9]=b[10]=b[11]=b[12]=b[13]=b[14]=b[15]=0),b[14]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var b,T,A,C,x,B,F,R,H=this.blocks;this.first?(b=H[0]-1,b=b<<3|b>>>29,C=(b&4023233417|~b&2562383102)+H[1]+271733878,C=C<<7|C>>>25,A=(C&b|~C&4023233417)+H[2]-1732584194,A=A<<11|A>>>21,T=(A&C|~A&b)+H[3]-271733879,T=T<<19|T>>>13):(b=this.h0,T=this.h1,A=this.h2,C=this.h3,b+=(T&A|~T&C)+H[0],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[1],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[2],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[3],T=T<<19|T>>>13),b+=(T&A|~T&C)+H[4],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[5],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[6],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[7],T=T<<19|T>>>13,b+=(T&A|~T&C)+H[8],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[9],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[10],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[11],T=T<<19|T>>>13,b+=(T&A|~T&C)+H[12],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[13],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[14],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[15],T=T<<19|T>>>13,B=T&A,b+=(B|T&C|A&C)+H[0]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[4]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[8]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[12]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[1]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[5]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[9]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[13]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[2]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[6]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[10]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[14]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[3]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[7]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[11]+1518500249,A=A<<9|A>>>23,T+=(A&C|A&b|R)+H[15]+1518500249,T=T<<13|T>>>19,B=T^A,b+=(B^C)+H[0]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[8]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[4]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[12]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[2]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[10]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[6]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[14]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[1]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[9]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[5]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[13]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[3]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[11]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[7]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[15]+1859775393,T=T<<15|T>>>17,this.first?(this.h0=b+1732584193<<0,this.h1=T-271733879<<0,this.h2=A-1732584194<<0,this.h3=C+271733878<<0,this.first=!1):(this.h0=this.h0+b<<0,this.h1=this.h1+T<<0,this.h2=this.h2+A<<0,this.h3=this.h3+C<<0)},S.prototype.hex=function(){this.finalize();var b=this.h0,T=this.h1,A=this.h2,C=this.h3;return i[b>>4&15]+i[b&15]+i[b>>12&15]+i[b>>8&15]+i[b>>20&15]+i[b>>16&15]+i[b>>28&15]+i[b>>24&15]+i[T>>4&15]+i[T&15]+i[T>>12&15]+i[T>>8&15]+i[T>>20&15]+i[T>>16&15]+i[T>>28&15]+i[T>>24&15]+i[A>>4&15]+i[A&15]+i[A>>12&15]+i[A>>8&15]+i[A>>20&15]+i[A>>16&15]+i[A>>28&15]+i[A>>24&15]+i[C>>4&15]+i[C&15]+i[C>>12&15]+i[C>>8&15]+i[C>>20&15]+i[C>>16&15]+i[C>>28&15]+i[C>>24&15]},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var b=this.h0,T=this.h1,A=this.h2,C=this.h3;return[b&255,b>>8&255,b>>16&255,b>>24&255,T&255,T>>8&255,T>>16&255,T>>24&255,A&255,A>>8&255,A>>16&255,A>>24&255,C&255,C>>8&255,C>>16&255,C>>24&255]},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var b=new ArrayBuffer(16),T=new Uint32Array(b);return T[0]=this.h0,T[1]=this.h1,T[2]=this.h2,T[3]=this.h3,b},S.prototype.buffer=S.prototype.arrayBuffer;var E=w();t?SS.exports=E:(r.md4=E,n&&define(function(){return E}))})()});var gk=ye(($fe,mk)=>{"use strict";var yN=gt("crypto"),Kfe=hk(),qY=pk();function HY(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),_u(n.slice(0,7),r).copy(t),_u(n.slice(7,14),r).copy(t,8),_u(n.slice(14),r).copy(t,16),t}o(HY,"createLMResponse");function KY(r){var e=new Buffer.alloc(16),t=new Buffer.alloc(14),n=new Buffer.from("KGS!@#$%","ascii");return r.length>14?(e.fill(0),e):(t.fill(0),t.write(r.toUpperCase(),0,"ascii"),Buffer.concat([_u(t.slice(0,7),n),_u(t.slice(7),n)]))}o(KY,"createLMHash");function _u(r,e){var t=new Buffer.alloc(8);t[0]=r[0]&254,t[1]=r[0]<<7&255|r[1]>>1,t[2]=r[1]<<6&255|r[2]>>2,t[3]=r[2]<<5&255|r[3]>>3,t[4]=r[3]<<4&255|r[4]>>4,t[5]=r[4]<<3&255|r[5]>>5,t[6]=r[5]<<2&255|r[6]>>6,t[7]=r[6]<<1&255;for(var n=0;n<8;n++){for(var s=0,i=1;i<8;i++)s+=(t[n]>>i)%2;t[n]|=s%2===0?1:0}var a=a.DES.create({type:"encrypt",ley:t});return a.update(e)}o(_u,"calculateDES");function $Y(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),_u(n.slice(0,7),r).copy(t),_u(n.slice(7,14),r).copy(t,8),_u(n.slice(14),r).copy(t,16),t}o($Y,"createNTLMResponse");function XY(r){var e=qY.create();return e.update(new Buffer.from(r,"ucs2")),e.buffer()}o(XY,"createNTLMHash");function dk(r,e,t){var n=yN.createHmac("md5",r);return n.update(new Buffer.from(e.toUpperCase()+t,"ucs2")),n.digest()}o(dk,"createNTLMv2Hash");function GY(r,e,t,n,s){var i=new Buffer.alloc(24),a=dk(t,e,s),u=yN.createHmac("md5",a);r.challenge.copy(i,8),i.write(n||vN(16),16,"hex"),u.update(i.slice(8));var l=u.digest();return l.copy(i),i}o(GY,"createLMv2Response");function WY(r,e,t,n,s){var i=new Buffer.alloc(48+r.targetInfo.buffer.length),a=dk(t,e,s),u=yN.createHmac("md5",a);r.challenge.copy(i,8),i.writeUInt32BE(16842752,16),i.writeUInt32LE(0,20);var l=((Date.now()+116444736e5)*1e4).toString(16),f=+("0x"+l.substring(Math.max(0,l.length-8))),h=+("0x"+l.substring(0,Math.max(0,l.length-8)));i.writeUInt32LE(f,24,!1),i.writeUInt32LE(h,28,!1),i.write(n||vN(16),32,"hex"),i.writeUInt32LE(0,40),r.targetInfo.buffer.copy(i,44),i.writeUInt32LE(0,44+r.targetInfo.buffer.length),u.update(i.slice(8));var m=u.digest();return m.copy(i),i}o(WY,"createNTLMv2Response");function vN(r){for(var e="";e.length<r;)e+=Math.floor(Math.random()*16).toString(16);return e}o(vN,"createPseudoRandomValue");mk.exports={createLMHash:KY,createNTLMHash:XY,createLMResponse:HY,createNTLMResponse:$Y,createLMv2Response:GY,createNTLMv2Response:WY,createPseudoRandomValue:vN}});var wk=ye((Gfe,vk)=>{"use strict";var yk=gt("os"),Pu=Y4(),Ru=gk(),Ou="NTLMSSP\0";function JY(r,e){var t=32,n=0,s=new Buffer.alloc(1024);return r=r===void 0?yk.hostname():r,e=e===void 0?"":e,s.write(Ou,n,Ou.length,"ascii"),n+=Ou.length,s.writeUInt32LE(1,n),n+=4,s.writeUInt32LE(Pu.NTLMFLAG_NEGOTIATE_OEM|Pu.NTLMFLAG_REQUEST_TARGET|Pu.NTLMFLAG_NEGOTIATE_NTLM_KEY|Pu.NTLMFLAG_NEGOTIATE_NTLM2_KEY|Pu.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN,n),n+=4,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt32LE(e.length===0?0:t,n),n+=4,e.length>0&&(t+=s.write(e,t,"ascii")),s.writeUInt16LE(r.length,n),n+=2,s.writeUInt16LE(r.length,n),n+=2,s.writeUInt32LE(r.length===0?0:t,n),n+=4,r.length>0&&(t+=s.write(r,t,"ascii")),"NTLM "+s.toString("base64",0,t)}o(JY,"createType1Message");function zY(r){if(r===void 0)throw new Error("Invalid argument");if(Object.prototype.toString.call(r)!=="[object String]")if(r.hasOwnProperty("headers")&&r.headers.hasOwnProperty("www-authenticate"))r=r.headers["www-authenticate"];else throw new Error("Invalid argument");var e=/^NTLM ([^,\s]+)/.exec(r);e&&(r=e[1]);var t=new Buffer.from(r,"base64"),n={};if(t.toString("ascii",0,Ou.length)!==Ou)throw new Error("Invalid message signature: "+r);if(t.readUInt32LE(Ou.length)!==2)throw new Error("Invalid message type (no type 2)");return n.flags=t.readUInt32LE(20),n.encoding=n.flags&Pu.NTLMFLAG_NEGOTIATE_OEM?"ascii":"ucs2",n.version=n.flags&Pu.NTLMFLAG_NEGOTIATE_NTLM2_KEY?2:1,n.challenge=t.slice(24,32),n.targetName=(function(){var s=t.readUInt16LE(12),i=t.readUInt32LE(16);if(s===0)return"";if(i+s>t.length||i<32)throw new Error("Bad type 2 message");return t.toString(n.encoding,i,i+s)})(),n.flags&Pu.NTLMFLAG_NEGOTIATE_TARGET_INFO&&(n.targetInfo=(function(){var s={},i=t.readUInt16LE(40),a=t.readUInt32LE(44),u=new Buffer.alloc(i);if(t.copy(u,0,a,a+i),i===0)return s;if(a+i>t.length||a<32)throw new Error("Bad type 2 message");for(var l=a;l<a+i;){var f=t.readUInt16LE(l);l+=2;var h=t.readUInt16LE(l);if(l+=2,f===0)break;var m=void 0;switch(f){case 1:m="SERVER";break;case 2:m="DOMAIN";break;case 3:m="FQDN";break;case 4:m="DNS";break;case 5:m="PARENT_DNS";break;default:m="";break}m&&(s[m]=t.toString("ucs2",l,l+h)),l+=h}return{parsed:s,buffer:u}})()),n}o(zY,"decodeType2Message");function YY(r,e,t,n,s){var i=52,a=new Buffer.alloc(1024);if(n===void 0&&(n=yk.hostname()),s===void 0&&(s=r.targetName),a.write(Ou,0,Ou.length,"ascii"),a.writeUInt32LE(3,8),r.version===2){i=64;var u=Ru.createNTLMHash(t),l=Ru.createPseudoRandomValue(16),f=Ru.createLMv2Response(r,e,u,l,s),h=Ru.createNTLMv2Response(r,e,u,l,s);a.writeUInt16LE(f.length,12),a.writeUInt16LE(f.length,14),a.writeUInt32LE(i,16),f.copy(a,i),i+=f.length,a.writeUInt16LE(h.length,20),a.writeUInt16LE(h.length,22),a.writeUInt32LE(i,24),h.copy(a,i),i+=h.length}else{var m=Ru.createLMHash(t),u=Ru.createNTLMHash(t),g=Ru.createLMResponse(r.challenge,m),w=Ru.createNTLMResponse(r.challenge,u);a.writeUInt16LE(g.length,12),a.writeUInt16LE(g.length,14),a.writeUInt32LE(i,16),g.copy(a,i),i+=g.length,a.writeUInt16LE(w.length,20),a.writeUInt16LE(w.length,22),a.writeUInt32LE(i,24),w.copy(a,i),i+=w.length}return a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,28),a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,30),a.writeUInt32LE(i,32),i+=a.write(s,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,36),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,38),a.writeUInt32LE(i,40),i+=a.write(e,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,44),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,46),a.writeUInt32LE(i,48),i+=a.write(n,i,r.encoding),r.version===2&&(a.writeUInt16LE(0,52),a.writeUInt16LE(0,54),a.writeUInt32LE(0,56),a.writeUInt32LE(r.flags,60)),"NTLM "+a.toString("base64",0,i)}o(YY,"createType3Message");vk.exports={createType1Message:JY,decodeType2Message:zY,createType3Message:YY}});var Ck=ye((Jfe,Ak)=>{"use strict";var QY=gt("util"),ZY=gt("stream"),Sk=ZY.Writable,Ek=Ek||function(r){setTimeout(r,0)};Ak.exports=Mm;QY.inherits(Mm,Sk);function Mm(r){if(!(this instanceof Mm))return new Mm(r);r=r||{},Sk.call(this,r)}o(Mm,"DevNull");Mm.prototype._write=function(r,e,t){Ek(t)}});var xk=ye(Vn=>{"use strict";var eQ=Vn&&Vn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tQ=Vn&&Vn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ES=Vn&&Vn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&eQ(t,e,n[s]);return tQ(t,e),t}})(),rQ=Vn&&Vn.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return o(s,"adopt"),new(t||(t=Promise))(function(i,a){function u(h){try{f(n.next(h))}catch(m){a(m)}}o(u,"fulfilled");function l(h){try{f(n.throw(h))}catch(m){a(m)}}o(l,"rejected");function f(h){h.done?i(h.value):s(h.value).then(u,l)}o(f,"step"),f((n=n.apply(r,e||[])).next())})},nQ=Vn&&Vn.__generator||function(r,e){var t={label:0,sent:o(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,s,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(h){return l([f,h])}}function l(f){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(t=0)),t;)try{if(n=1,s&&(i=f[0]&2?s.return:f[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,f[1])).done)return i;switch(s=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,s=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(h){f=[6,h],s=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},sQ=Vn&&Vn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.AxiosError=void 0;Vn.NtlmClient=uQ;var bk=ES(fN());Object.defineProperty(Vn,"AxiosError",{enumerable:!0,get:o(function(){return bk.AxiosError},"get")});var wN=ES(wk()),iQ=ES(gt("https")),aQ=ES(gt("http")),oQ=sQ(Ck());function uQ(r,e){var t=this,n=e??{};n.httpAgent||(n.httpAgent=new aQ.Agent({keepAlive:!0})),n.httpsAgent||(n.httpsAgent=new iQ.Agent({keepAlive:!0}));var s=bk.default.create(n);return s.interceptors.response.use(function(i){return i},function(i){return rQ(t,void 0,void 0,function(){var a,u,l,f,h,m,g,w;return nQ(this,function(y){switch(y.label){case 0:return a=i.response,a&&a.status===401&&a.headers["www-authenticate"]&&a.headers["www-authenticate"].includes("NTLM")&&(!a.config.headers["X-retry"]||a.config.headers["X-retry"]!=="false")?(u=((g=a.headers["www-authenticate"].split(",").find(function(S){return S.match(/ *NTLM/)}))===null||g===void 0?void 0:g.trim())||"",a.config.headers||(a.config.headers={}),u.length<50?(l=wN.createType1Message(r.workstation,r.domain),a.config.headers.Authorization=l):(f=wN.decodeType2Message((u.match(/^NTLM\s+(.+?)(,|\s+|$)/)||[])[1]),h=wN.createType3Message(f,r.username,r.password,r.workstation,r.domain),a.config.headers["X-retry"]="false",a.config.headers.Authorization=h),a.config.responseType!=="stream"?[3,2]:(m=(w=i.response)===null||w===void 0?void 0:w.data,m&&!m.readableEnded?[4,new Promise(function(S){m.pipe((0,oQ.default)()),m.once("close",S)})]:[3,2])):[3,3];case 1:y.sent(),y.label=2;case 2:return[2,s(a.config)];case 3:throw i}})})}),s}o(uQ,"NtlmClient")});var jm=ye(ku=>{"use strict";ku.removeLeadingAndTrailingHTTPWhitespace=r=>r.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");ku.removeTrailingHTTPWhitespace=r=>r.replace(/[ \t\n\r]+$/u,"");ku.isHTTPWhitespaceChar=r=>r===" "||r===" "||r===`
48
+ `||r==="\r";ku.solelyContainsHTTPTokenCodePoints=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r);ku.soleyContainsHTTPQuotedStringTokenCodePoints=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r);ku.asciiLowercase=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase());ku.collectAnHTTPQuotedString=(r,e)=>{let t="";for(e++;;){for(;e<r.length&&r[e]!=='"'&&r[e]!=="\\";)t+=r[e],++e;if(e>=r.length)break;let n=r[e];if(++e,n==="\\"){if(e>=r.length){t+="\\";break}t+=r[e],++e}else break}return[t,e]}});var Tk=ye((the,Nk)=>{"use strict";var{asciiLowercase:AS,solelyContainsHTTPTokenCodePoints:lQ,soleyContainsHTTPQuotedStringTokenCodePoints:cQ}=jm();Nk.exports=class{static{o(this,"MIMETypeParameters")}constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=AS(String(e)),this._map.get(e)}has(e){return e=AS(String(e)),this._map.has(e)}set(e,t){if(e=AS(String(e)),t=String(t),!lQ(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!cQ(t))throw new Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=AS(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}});var Dk=ye((nhe,Bk)=>{"use strict";var{removeLeadingAndTrailingHTTPWhitespace:fQ,removeTrailingHTTPWhitespace:Ik,isHTTPWhitespaceChar:hQ,solelyContainsHTTPTokenCodePoints:SN,soleyContainsHTTPQuotedStringTokenCodePoints:pQ,asciiLowercase:EN,collectAnHTTPQuotedString:dQ}=jm();Bk.exports=r=>{r=fQ(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!SN(t)||e>=r.length)return null;++e;let n="";for(;e<r.length&&r[e]!==";";)n+=r[e],++e;if(n=Ik(n),n.length===0||!SN(n))return null;let s={type:EN(t),subtype:EN(n),parameters:new Map};for(;e<r.length;){for(++e;hQ(r[e]);)++e;let i="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)i+=r[e],++e;if(i=EN(i),e<r.length){if(r[e]===";")continue;++e}let a=null;if(r[e]==='"')for([a,e]=dQ(r,e);e<r.length&&r[e]!==";";)++e;else{for(a="";e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=Ik(a),a==="")continue}i.length>0&&SN(i)&&pQ(a)&&!s.parameters.has(i)&&s.parameters.set(i,a)}return s}});var Rk=ye((she,_k)=>{"use strict";var{solelyContainsHTTPTokenCodePoints:mQ}=jm();_k.exports=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,n]of r.parameters)e+=";",e+=t,e+="=",(!mQ(n)||n.length===0)&&(n=n.replace(/(["\\])/ug,"\\$1"),n=`"${n}"`),e+=n;return e}});var Lk=ye((ahe,kk)=>{"use strict";var gQ=Tk(),yQ=Dk(),vQ=Rk(),{asciiLowercase:Pk,solelyContainsHTTPTokenCodePoints:Ok}=jm();kk.exports=class{static{o(this,"MIMEType")}constructor(e){e=String(e);let t=yQ(e);if(t===null)throw new Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new gQ(t.parameters)}static parse(e){try{return new this(e)}catch{return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=Pk(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!Ok(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=Pk(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!Ok(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return vQ(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}}});var Lu=ye(cn=>{"use strict";var wQ=cn&&cn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),SQ=cn&&cn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),EQ=cn&&cn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&wQ(t,e,n[s]);return SQ(t,e),t}})();Object.defineProperty(cn,"__esModule",{value:!0});cn.wsdlCacheSingleton=cn.TNS_PREFIX=void 0;cn.passwordDigest=CQ;cn.findPrefix=bQ;cn.splitQName=xQ;cn.xmlEscape=NQ;cn.parseMTOMResp=TQ;var AQ=EQ(gt("crypto"));function CQ(r,e,t){let n=AQ.createHash("sha1"),s=Buffer.from(r||"","base64"),i=Buffer.from(e||"","utf8"),a=Buffer.from(t||"","utf8"),u=Buffer.concat([s,i,a]);return n.update(u),n.digest("base64")}o(CQ,"passwordDigest");cn.TNS_PREFIX="__tns__";function bQ(r,e){for(let t in r)if(t!==cn.TNS_PREFIX&&r[t]===e)return t}o(bQ,"findPrefix");function xQ(r){if(typeof r!="string")return{prefix:cn.TNS_PREFIX,name:r};let[e]=r.split("|",1),t=e.indexOf(":");return{prefix:e.substring(0,t)||cn.TNS_PREFIX,name:e.substring(t+1)}}o(xQ,"splitQName");function NQ(r){return typeof r=="string"?r.substr(0,9)==="<![CDATA["&&r.substr(-3)==="]]>"?r:r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):r}o(NQ,"xmlEscape");function TQ(r,e,t){return import("./src-NRIPS2N7.mjs").then(({MultipartParser:n})=>{let s={parts:[]},i="",a="",u,l=0,f=new n;return f.initWithBoundary(e),f.on("data",({name:h,buffer:m,start:g,end:w})=>{switch(h){case"partBegin":s.parts[l]={body:null,headers:{}},u=Buffer.from("");break;case"headerField":i=m.slice(g,w).toString();break;case"headerValue":a=m.slice(g,w).toString();break;case"headerEnd":s.parts[l].headers[i.toLowerCase()]=a;break;case"partData":u=Buffer.concat([u,m.slice(g,w)]);break;case"partEnd":s.parts[l].body=u,l++;break}}),f.write(r),t(null,s)}).catch(t)}o(TQ,"parseMTOMResp");var IQ=class{static{o(this,"DefaultWSDLCache")}constructor(){this.cache={}}has(e){return!!this.cache[e]}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}clear(){this.cache={}}};cn.wsdlCacheSingleton=new IQ});var Vk=ye((fhe,BQ)=>{BQ.exports={name:"soap",version:"1.6.0",description:"A minimal node SOAP client",engines:{node:">=14.17.0"},author:"Vinay Pulim <v@pulim.com>",dependencies:{axios:"^1.12.2","axios-ntlm":"^1.4.6",debug:"^4.4.3",formidable:"^3.5.4","get-stream":"^6.0.1",lodash:"^4.17.21",sax:"^1.4.1","strip-bom":"^3.0.0","whatwg-mimetype":"4.0.0","xml-crypto":"^6.1.2"},repository:{type:"git",url:"https://github.com/vpulim/node-soap.git"},main:"./lib/soap.js",types:"./lib/soap.d.ts",directories:{lib:"./lib",test:"./test"},scripts:{build:"tsc -p .",watch:"tsc -w -p .",lint:"eslint .",format:"prettier --write .","format:check":"prettier --check .",toc:"./node_modules/.bin/doctoc Readme.md --github --maxlevel 3",cover:"OPENSSL_ENABLE_SHA1_SIGNATURES=1 nyc --extension=.ts --reporter=lcov --reporter=html --reporter=text mocha --no-parallel --timeout 30000 --exit test/*-test.js test/security/*.js",coveralls:"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js -v",docs:"typedoc --out docs",test:"mocha --timeout 15000 --bail --exit test/*-test.js test/security/*.js"},keywords:["soap"],license:"MIT",devDependencies:{"@eslint/js":"^9.38.0","@types/debug":"^4.1.12","@types/formidable":"^3.4.6","@types/lodash":"^4.17.20","@types/node":"^14.0.0","@types/sax":"^1.2.7","@types/whatwg-mimetype":"^3.0.2","body-parser":"^2.2.0",colors:"^1.4.0",diff:"^8.0.2",doctoc:"^2.2.1",duplexer:"~0.1.2",eslint:"^9.38.0",express:"^5.1.0",finalhandler:"^2.1.0",glob:"^11.0.3",mocha:"^11.7.4",nyc:"^17.1.0",prettier:"^3.6.2","readable-stream":"^4.7.0",semver:"^7.7.3","serve-static":"^2.2.0",should:"^13.2.3",sinon:"^21.0.0","source-map-support":"^0.5.21",timekeeper:"^2.3.1",typedoc:"^0.28.14",typescript:"^5.9.3","typescript-eslint":"^8.46.1"}}});var CS=ye(vi=>{"use strict";var DQ=vi&&vi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),_Q=vi&&vi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),jk=vi&&vi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&DQ(t,e,n[s]);return _Q(t,e),t}})(),Fk=vi&&vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vi,"__esModule",{value:!0});vi.HttpClient=void 0;var RQ=jk(fN()),PQ=xk(),Uk=gt("crypto"),OQ=Fk(pw()),kQ=jk(gt("url")),LQ=Fk(Lk()),VQ=gt("zlib"),UQ=Lu(),Mk=(0,OQ.default)("node-soap"),MQ=Vk(),jQ=class{static{o(this,"HttpClient")}constructor(e){e=e||{},this.options=e,this._request=e.request||RQ.create()}buildRequest(e,t,n,s={}){let i=kQ.parse(e),a=t?"POST":"GET",u=i.hostname,l=parseInt(i.port,10),f={"User-Agent":"node-soap/"+MQ.version,Accept:"text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8","Accept-Encoding":"none","Accept-Charset":"utf-8",...s.forever&&{Connection:"keep-alive"},Host:u+(isNaN(l)?"":":"+l)},h=["headers"],{attachments:m,...g}=s,w=m||[];typeof t=="string"&&w.length===0&&!s.forceMTOM&&(f["Content-Length"]=Buffer.byteLength(t,"utf8"),f["Content-Type"]="application/x-www-form-urlencoded"),n=n||{};for(let S in n)f[S]=n[S];let y={url:i.href,method:a,headers:f,transformResponse:o(S=>S,"transformResponse")};if(s.ntlm||(y.validateStatus=null),s.forceMTOM||w.length>0){let S=(0,Uk.randomUUID)(),E=null;if(f["Content-Type"].indexOf("action")>-1)for(let C of f["Content-Type"].split("; "))C.indexOf("action")>-1&&(E=C);let b=(0,Uk.randomUUID)();f["Content-Type"]='multipart/related; type="application/xop+xml"; start="<'+S+'>"; start-info="text/xml"; boundary='+b,E&&(f["Content-Type"]=f["Content-Type"]+"; "+E);let T=[{"Content-Type":'application/xop+xml; charset=UTF-8; type="text/xml"',"Content-ID":"<"+S+">",body:t}];w.forEach(C=>{T.push({"Content-Type":C.mimetype,"Content-Transfer-Encoding":"binary","Content-ID":"<"+C.contentId+">","Content-Disposition":'attachment; filename="'+C.name+'"',body:C.body})}),y.data=[Buffer.from(`--${b}\r
49
+ `)];let A=0;T.forEach(C=>{Object.keys(C).forEach(x=>{x!=="body"&&y.data.push(Buffer.from(`${x}: ${C[x]}\r
50
+ `))}),y.data.push(Buffer.from(`\r
51
+ `),Buffer.from(C.body),Buffer.from(`\r
52
+ --${b}${A===T.length-1?"--":""}\r
53
+ `)),A++}),y.data=Buffer.concat(y.data)}else y.data=t;s.forceGzip&&(y.decompress=!0,y.data=(0,VQ.gzipSync)(y.data),y.headers["Accept-Encoding"]="gzip,deflate",y.headers["Content-Encoding"]="gzip");for(let S in g)if(h.indexOf(S)!==-1)for(let E in s[S])y[S][E]=s[S][E];else y[S]=s[S];return Mk("Http request: %j",y),y}handleResponse(e,t,n){if(Mk("Http response body: %j",n),typeof n=="string"){let s=/(?:<\?[^?]*\?>[\s]*)?<([^:]*):Envelope([\S\s]*)<\/\1:Envelope>/i,i=n.replace(/<!--[\s\S]*?-->/,"").match(s);i&&(n=i[0])}return n}request(e,t,n,s,i){let a=this.buildRequest(e,t,s,i),u;i!==void 0&&i.ntlm?u=(0,PQ.NtlmClient)({username:i.username,password:i.password,workstation:i.workstation||"",domain:i.domain||""})(a):(this.options.parseReponseAttachments&&(a.responseType="arraybuffer",a.responseEncoding="binary"),u=this._request(a));let l=this;return u.then(f=>{let h=o(m=>(f.data=this.handleResponse(u,f,m||f.data),n(null,f,f.data),f),"handleBody");if(l.options.parseReponseAttachments)if(f.headers["content-type"]&&f.headers["content-type"].toLowerCase().indexOf("multipart/related")>-1){let g,w=LQ.default.parse(f.headers["content-type"]);return w&&(g=w.parameters.get("boundary")),g?(0,UQ.parseMTOMResp)(f.data,g,(y,S)=>{if(y)return n(y);let E=S.parts.shift();return!E||!E.body?n(new Error("Cannot parse multipart response")):(f.mtomResponseAttachments=S,h(E.body.toString(l.options.encoding||"utf8")))}):n(new Error("Missing boundary from content-type"))}else return h(f.data.toString(l.options.encoding||"utf8"));else return h()},f=>n(f)),u}requestStream(e,t,n,s){let i=this.buildRequest(e,t,n,s);i.responseType="stream";let a=this._request(i).then(u=>(u.data=this.handleResponse(a,u,u.data),u));return a}};vi.HttpClient=jQ});var AN=ye(wi=>{"use strict";var FQ=wi&&wi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),qQ=wi&&wi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),$k=wi&&wi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&FQ(t,e,n[s]);return qQ(t,e),t}})(),Xk=wi&&wi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wi,"__esModule",{value:!0});wi.Client=void 0;var qk=$k(gt("assert")),HQ=gt("crypto"),KQ=Xk(pw()),$Q=gt("events"),XQ=Xk(t4()),Hk=$k(go()),GQ=CS(),WQ=Lu(),JQ=(0,KQ.default)("node-soap"),Kk=/[^a-z$_0-9]/i,zQ=class extends $Q.EventEmitter{static{o(this,"Client")}constructor(e,t,n){super(),n=n||{},this.wsdl=e,this._initializeOptions(n),this._initializeServices(t),this.httpClient=n.httpClient||new GQ.HttpClient(n)}addSoapHeader(e,t,n,s){return this.soapHeaders||(this.soapHeaders=[]),e=this._processSoapHeader(e,t,n,s),this.soapHeaders.push(e)-1}changeSoapHeader(e,t,n,s,i){this.soapHeaders||(this.soapHeaders=[]),t=this._processSoapHeader(t,n,s,i),this.soapHeaders[e]=t}getSoapHeaders(){return this.soapHeaders}clearSoapHeaders(){this.soapHeaders=null}addHttpHeader(e,t){this.httpHeaders||(this.httpHeaders={}),this.httpHeaders[e]=t}getHttpHeaders(){return this.httpHeaders}clearHttpHeaders(){this.httpHeaders=null}addBodyAttribute(e){if(this.bodyAttributes||(this.bodyAttributes=[]),typeof e=="object"){let t="";Object.getOwnPropertyNames(e).forEach(n=>{t+=" "+n+'="'+e[n]+'"'}),e=t}e.substr(0,1)!==" "&&(e=" "+e),this.bodyAttributes.push(e)}getBodyAttributes(){return this.bodyAttributes}clearBodyAttributes(){this.bodyAttributes=null}setEndpoint(e){this.endpoint=e,this._initializeServices(e)}describe(){return this.wsdl.describeServices()}setSecurity(e){this.security=e}setSOAPAction(e){this.SOAPAction=e}_initializeServices(e){let n=this.wsdl.definitions.services;for(let s in n)this[s]=this._defineService(n[s],e)}_initializeOptions(e){this.streamAllowed=e.stream,this.returnSaxStream=e.returnSaxStream,this.normalizeNames=e.normalizeNames,this.overridePromiseSuffix=e.overridePromiseSuffix||"Async",this.wsdl.options.attributesKey=e.attributesKey||"attributes",this.wsdl.options.envelopeKey=e.envelopeKey||"soap",this.wsdl.options.envelopeSoapUrl=e.envelopeSoapUrl||"http://schemas.xmlsoap.org/soap/envelope/",this.wsdl.options.preserveWhitespace=!!e.preserveWhitespace,this.wsdl.options.forceUseSchemaXmlns=!!e.forceUseSchemaXmlns;let t=e.ignoredNamespaces;t!==void 0&&typeof t=="object"&&"override"in t&&t.override===!0&&t.namespaces!==void 0&&(this.wsdl.options.ignoredNamespaces=t.namespaces),e.overrideElementKey!==void 0&&(this.wsdl.options.overrideElementKey=e.overrideElementKey),e.overrideRootElement!==void 0&&(this.wsdl.options.overrideRootElement=e.overrideRootElement),this.wsdl.options.forceSoap12Headers=!!e.forceSoap12Headers}_defineService(e,t){let n=e.ports,s={};for(let i in n)s[i]=this._definePort(n[i],t||n[i].location);return s}_definePort(e,t){let n=t,i=e.binding.methods,a={};for(let u in i){a[u]=this._defineMethod(i[u],n);let l=this.normalizeNames?u.replace(Kk,"_"):u;if(this[l]=a[u],!Kk.test(l)){let f=this.overridePromiseSuffix;this[l+f]=this._promisifyMethod(a[u])}}return a}_promisifyMethod(e){return(t,n,s)=>new Promise((i,a)=>{e(t,o((l,f,h,m,g,w)=>{l?a(l):i([f,h,m,g,w])},"callback"),n,s)})}_defineMethod(e,t){let n;return(s,i,a,u)=>{typeof s=="function"?(i=s,s={}):typeof a=="function"?(n=i,i=a,a=n):typeof u=="function"&&(n=i,i=u,u=a,a=n),this._invoke(e,s,t,(l,f,h,m,g,w)=>{i(l,f,h,m,g,w)},a,u)}}_processSoapHeader(e,t,n,s){switch(typeof e){case"object":return this.wsdl.objectToXML(e,t,n,s,!0);case"function":{let i=this;return(...a)=>{let u=e.apply(null,[...a]);return typeof u=="object"?i.wsdl.objectToXML(u,t,n,s,!0):u}}default:return e}}_invoke(e,t,n,s,i,a){let u=e.$name,l=e.input,f=e.output,h=e.style,m=this.wsdl.definitions,g=this.wsdl.options.envelopeKey,w=this.wsdl.options.envelopeSoapUrl,y=m.$targetNamespace,S="",E="",b=null,T,A=(0,WQ.findPrefix)(m.xmlns,y),C={"Content-Type":"text/xml; charset=utf-8"},x="xmlns:"+g+'="'+w+'"',B=o((G,he,le)=>{let oe;if(!f)return s(null,null,he,G.Header,b,le.mtomResponseAttachments);if(!G.html&&!G.Body){if(le.status>=400){let Z=new Error("Error http status codes");return Z.response=le,Z.body=he,this.emit("soapError",Z,H),s(Z,G,he,G.Header)}return s(null,G,he,G.Header)}if(typeof G.Body!="object"){let Z=new Error("Cannot parse response");return Z.response=le,Z.body=he,s(Z,G,he,void 0,b)}oe=G.Body[f.$name],oe||(oe=G.Body[f.$name.replace(/(?:Out(?:put)?|Response)$/,"")]),oe||["Response","Out","Output"].forEach(Z=>{if(Object.hasOwnProperty.call(G.Body,u+Z))return oe=G.Body[u+Z]}),s(null,oe,he,G.Header,b,le.mtomResponseAttachments)},"finish"),F=o((G,he)=>{let le;try{le=this.wsdl.xmlToObject(G)}catch(oe){if(!f||!f.$lookupTypes){JQ("Response element is not present. Unable to convert response xml to json.");let Z=Hk.isObject(G)?G:q(G);if(Z)return s(null,he,Z,void 0,b)}return oe.response=he,oe.body=G,this.emit("soapError",oe,H),s(oe,he,G,void 0,b,he.mtomResponseAttachments)}return B(le,G,he)},"parseSync");this.SOAPAction?T=this.SOAPAction:e.soapAction!==void 0&&e.soapAction!==null?T=e.soapAction:T=(y.lastIndexOf("/")!==y.length-1?y+"/":y)+u,this.wsdl.options.forceSoap12Headers?(C["Content-Type"]=`application/soap+xml; charset=utf-8; action="${T}"`,x="xmlns:"+g+'="http://www.w3.org/2003/05/soap-envelope"'):C.SOAPAction='"'+T+'"',i=i||{},this.security&&this.security.addHeaders&&this.security.addHeaders(C),this.security&&this.security.addOptions&&this.security.addOptions(i),h==="rpc"&&(l.parts||l.name==="element"||t===null)?(qk.ok(!h||h==="rpc","invalid message definition for document style binding"),E=this.wsdl.objectToRpcXML(u,t,A,y,l.name!=="element"),e.inputSoap==="encoded"&&(S='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):(qk.ok(!h||h==="document","invalid message definition for rpc style binding"),E=this.wsdl.objectToDocumentXML(l.$name,t,l.targetNSAlias,l.targetNamespace,l.$type||l.$lookupType));let R;this.soapHeaders&&(R=this.soapHeaders.map(G=>typeof G=="function"?G(e,n,T,t):G).join(" ")),b='<?xml version="1.0" encoding="utf-8"?><'+g+":Envelope "+x+' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '+S+this.wsdl.xmlnsInEnvelope+">"+(R||this.security?"<"+g+":Header"+(this.wsdl.xmlnsInHeader?" "+this.wsdl.xmlnsInHeader:"")+">"+(R||"")+(this.security&&!this.security.postProcess?this.security.toXML():"")+"</"+g+":Header>":"")+"<"+g+":Body"+(this.bodyAttributes?this.bodyAttributes.join(" "):"")+">"+E+"</"+g+":Body></"+g+":Envelope>",this.security&&this.security.postProcess&&(b=this.security.postProcess(b,g)),i&&i.postProcess&&(b=i.postProcess(b)),this.lastMessage=E,this.lastRequest=b,this.lastEndpoint=n;let H=i.exchangeId||(0,HQ.randomUUID)();if(this.emit("message",E,H),this.emit("request",b,H),this.httpHeaders===null)C={};else{for(let G in this.httpHeaders)C[G]=this.httpHeaders[G];for(let G in a)C[G]=a[G]}let q=o(G=>{try{return JSON.parse(G)}catch{return}},"tryJSONparse");if(this.streamAllowed&&typeof this.httpClient.requestStream=="function"){s=Hk.once(s);let G=Date.now(),he=o(le=>{this.lastResponse=null,this.lastResponseHeaders=null,this.lastElapsedTime=null,this.lastRequestHeaders=le.config&&le.config.headers,this.emit("response",null,null,H),this.returnSaxStream||!le.response||!le.response.data?s(le,void 0,void 0,void 0,b):(le.response.data.on("close",()=>{s(le,void 0,void 0,void 0,b)}),le.response.data.on("data",oe=>{le.response.data=oe.toString()}))},"onError");this.httpClient.requestStream(n,b,C,i,this).then(le=>{if(this.lastRequestHeaders=le.headers,le.data.on&&le.data.on("error",oe=>he(oe)),le.status!==200||!f||!f.$lookupTypes){(0,XQ.default)(le.data).then(oe=>(this.lastResponse=oe,this.lastElapsedTime=Date.now()-G,this.lastResponseHeaders=le&&le.headers,this.lastRequestHeaders=le.config&&le.config.headers||le.headers,this.emit("response",oe,le,H),F(oe,le)));return}if(this.returnSaxStream){let oe=this.wsdl.getSaxStream(le.data);return B({saxStream:oe},"<stream>",le.data)}else this.wsdl.xmlToObject(le.data,(oe,Z)=>(this.lastResponse=le,this.lastElapsedTime=Date.now()-G,this.lastResponseHeaders=le&&le.headers,this.lastRequestHeaders=le.config.headers,this.emit("response","<stream>",le.data,H),oe?(oe.response=le,oe.body="<stream>",this.emit("soapError",oe,H),s(oe,le,void 0,void 0,b)):B(Z,"<stream>",le)))},he);return}let K=Date.now();return this.httpClient.request(n,b,(G,he,le)=>{if(this.lastResponse=le,he&&(this.lastResponseHeaders=he.headers,this.lastElapsedTime=Date.now()-K,this.lastResponseAttachments=he.mtomResponseAttachments,this.lastRequestHeaders=he.config&&he.config.headers),this.emit("response",le,he,H),G){this.lastRequestHeaders=G.config&&G.config.headers;try{G.response&&G.response.data&&this.wsdl.xmlToObject(G.response.data)}catch(oe){G.root=oe.root||oe}s(G,void 0,void 0,void 0,b)}else return F(le,he)},C,i,this)}};wi.Client=zQ});var Wk=ye(Ta=>{"use strict";var YQ=Ta&&Ta.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),QQ=Ta&&Ta.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),ZQ=Ta&&Ta.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&YQ(t,e,n[s]);return QQ(t,e),t}})();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.BasicAuthSecurity=void 0;var Gk=ZQ(go()),eZ=class{static{o(this,"BasicAuthSecurity")}constructor(e,t,n){this._username=e,this._password=t,this.defaults={},Gk.merge(this.defaults,n)}addHeaders(e){e.Authorization="Basic "+Buffer.from(this._username+":"+this._password||"").toString("base64")}toXML(){return""}addOptions(e){Gk.merge(e,this.defaults)}};Ta.BasicAuthSecurity=eZ});var zk=ye(Ia=>{"use strict";var tZ=Ia&&Ia.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),rZ=Ia&&Ia.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),nZ=Ia&&Ia.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&tZ(t,e,n[s]);return rZ(t,e),t}})();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.BearerSecurity=void 0;var Jk=nZ(go()),sZ=class{static{o(this,"BearerSecurity")}constructor(e,t){this._token=e,this.defaults={},Jk.merge(this.defaults,t)}addHeaders(e){e.Authorization="Bearer "+this._token}toXML(){return""}addOptions(e){Jk.merge(e,this.defaults)}};Ia.BearerSecurity=sZ});var Zk=ye(Ba=>{"use strict";var iZ=Ba&&Ba.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),aZ=Ba&&Ba.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bN=Ba&&Ba.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&iZ(t,e,n[s]);return aZ(t,e),t}})();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.ClientSSLSecurity=void 0;var CN=bN(gt("fs")),Yk=bN(gt("https")),Qk=bN(go()),oZ=class{static{o(this,"ClientSSLSecurity")}constructor(e,t,n,s){if(e)if(Buffer.isBuffer(e))this.key=e;else if(typeof e=="string")this.key=CN.readFileSync(e);else throw new Error("key should be a buffer or a string!");if(t)if(Buffer.isBuffer(t))this.cert=t;else if(typeof t=="string")this.cert=CN.readFileSync(t);else throw new Error("cert should be a buffer or a string!");n&&(Buffer.isBuffer(n)||Array.isArray(n)?this.ca=n:typeof n=="string"?this.ca=CN.readFileSync(n):(s=n,this.ca=null)),this.defaults={},Qk.merge(this.defaults,s),this.agent=null}toXML(){return""}addOptions(e){let t=null;e.key=this.key,e.cert=this.cert,e.ca=this.ca,Qk.merge(e,this.defaults),e.forever?(this.agent||(e.keepAlive=!0,this.agent=new Yk.Agent(e)),t=this.agent):t=new Yk.Agent(e),e.httpsAgent=t}};Ba.ClientSSLSecurity=oZ});var tL=ye(Da=>{"use strict";var uZ=Da&&Da.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),lZ=Da&&Da.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),xN=Da&&Da.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&uZ(t,e,n[s]);return lZ(t,e),t}})();Object.defineProperty(Da,"__esModule",{value:!0});Da.ClientSSLSecurityPFX=void 0;var cZ=xN(gt("fs")),fZ=xN(gt("https")),eL=xN(go()),hZ=class{static{o(this,"ClientSSLSecurityPFX")}constructor(e,t,n){if(typeof t=="object"&&(n=t),e)if(Buffer.isBuffer(e))this.pfx=e;else if(typeof e=="string")this.pfx=cZ.readFileSync(e);else throw new Error("supplied pfx file should be a buffer or a file location");t&&typeof t=="string"&&(this.passphrase=t),this.defaults={},eL.merge(this.defaults,n)}toXML(){return""}addOptions(e){e.pfx=this.pfx,this.passphrase&&(e.passphrase=this.passphrase),eL.merge(e,this.defaults),e.httpsAgent=new fZ.Agent(e)}};Da.ClientSSLSecurityPFX=hZ});var rL=ye(_a=>{"use strict";var pZ=_a&&_a.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),dZ=_a&&_a.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),mZ=_a&&_a.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&pZ(t,e,n[s]);return dZ(t,e),t}})();Object.defineProperty(_a,"__esModule",{value:!0});_a.NTLMSecurity=void 0;var gZ=mZ(go()),yZ=class{static{o(this,"NTLMSecurity")}constructor(e,t,n,s){typeof e=="object"?(this.defaults=e,this.defaults.ntlm=!0):this.defaults={ntlm:!0,username:e,password:t,domain:n,workstation:s}}addHeaders(e){e.Connection="keep-alive"}toXML(){return""}addOptions(e){gZ.merge(e,this.defaults)}};_a.NTLMSecurity=yZ});var nL=ye(Ra=>{"use strict";var vZ=Ra&&Ra.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),wZ=Ra&&Ra.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),SZ=Ra&&Ra.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&vZ(t,e,n[s]);return wZ(t,e),t}})();Object.defineProperty(Ra,"__esModule",{value:!0});Ra.WSSecurity=void 0;var EZ=SZ(gt("crypto")),NN=Lu(),AZ=["PasswordDigest","PasswordText"],CZ=class{static{o(this,"WSSecurity")}constructor(e,t,n){n=n||{},this._username=e,this._password=t,this._envelopeKey="soap",typeof n=="string"?(this._passwordType=n||"PasswordText",n={}):this._passwordType=n.passwordType?n.passwordType:"PasswordText",AZ.indexOf(this._passwordType)===-1&&(this._passwordType="PasswordText"),this._hasTimeStamp=n.hasTimeStamp||typeof n.hasTimeStamp=="boolean"?!!n.hasTimeStamp:!0,n.hasNonce!=null&&(this._hasNonce=!!n.hasNonce),this._hasTokenCreated=n.hasTokenCreated||typeof n.hasTokenCreated=="boolean"?!!n.hasTokenCreated:!0,n.actor!=null&&(this._actor=n.actor),n.mustUnderstand!=null&&(this._mustUnderstand=!!n.mustUnderstand),n.envelopeKey&&(this._envelopeKey=n.envelopeKey)}toXML(){function e(u){function l(f){return f<10?"0"+f:f}return o(l,"pad"),u.getUTCFullYear()+"-"+l(u.getUTCMonth()+1)+"-"+l(u.getUTCDate())+"T"+l(u.getUTCHours())+":"+l(u.getUTCMinutes())+":"+l(u.getUTCSeconds())+"Z"}o(e,"getDate");let t=new Date,n=e(t),s="";if(this._hasTimeStamp){let u=e(new Date(t.getTime()+6e5));s='<wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+u+"</wsu:Expires></wsu:Timestamp>"}let i,a;if(this._hasNonce||this._passwordType!=="PasswordText"){let u=EZ.createHash("sha1");u.update(n+Math.random()),a=u.digest("base64")}return this._passwordType==="PasswordText"?(i='<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'+(0,NN.xmlEscape)(this._password)+"</wsse:Password>",a&&(i+='<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+a+"</wsse:Nonce>")):i='<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'+(0,NN.passwordDigest)(a,n,this._password)+'</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+a+"</wsse:Nonce>","<wsse:Security "+(this._actor?`${this._envelopeKey}:actor="${this._actor}" `:"")+(this._mustUnderstand?`${this._envelopeKey}:mustUnderstand="1" `:"")+'xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'+s+'<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-'+n+'"><wsse:Username>'+(0,NN.xmlEscape)(this._username)+"</wsse:Username>"+i+(this._hasTokenCreated?"<wsu:Created>"+n+"</wsu:Created>":"")+"</wsse:UsernameToken></wsse:Security>"}};Ra.WSSecurity=CZ});var bS=ye(TN=>{"use strict";var bZ=typeof TN>"u"?{}:TN;(function(r){"use strict";function e(d){var I=Array.prototype.slice,$=d.length,te=o(function(X,nt){return function(){return nt.apply(this,X.concat(I.call(arguments)))}},"partial"),ie=o(function(){var X=I.call(arguments);return X.length<$?te(X,ie):d.apply(this,I.apply(arguments,[0,$]))},"fn1");return ie}o(e,"curry");var t=o(function(d,I){for(var $=0;$<I.length;$+=1)d(I[$],$,I)},"forEach"),n=o(function(d,I,$){var te=I;return t(function(ie,X){te=d(te,ie,X)},$),te},"reduce"),s=o(function(d,I){var $=new Array(I.length);return t(function(te,ie){$[ie]=d(te)},I),$},"map"),i=o(function(d,I){var $=[];return t(function(te,ie){d(te,ie)&&$.push(te)},I),$},"filter"),a=o(function(d,I){for(var $=0;$<d.length;$+=1)if(d[$]===I)return!0;return!1},"includes");function u(d){return function(){return d}}o(u,"always");function l(d){return d.toString()}o(l,"toString");var f=o(function(d,I){return I.join(d)},"join"),h=o(function(d,I,$){return d+$+I},"wrap"),m=Array.prototype.concat,g=32767;function w(d){for(var I=[],$=0;$<d.length;$+=g){var te=d.slice($,$+g);I=m.apply(I,te)}return I}o(w,"flatten");function y(d,I){for(var $=Object(d),te=1;te<arguments.length;te++){var ie=arguments[te];if(ie!=null)for(var X in ie)Object.prototype.hasOwnProperty.call(ie,X)&&($[X]=ie[X])}return $}o(y,"assign");var S={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};E.prototype=new Object,E.prototype.constructor=E,E.superclass=Object.prototype;function E(){this.init()}o(E,"XPathParser"),E.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(d){return new F(d[0],d[2])},this.reduceActions[5]=function(d){return new R(d[0],d[2])},this.reduceActions[7]=function(d){return new H(d[0],d[2])},this.reduceActions[8]=function(d){return new q(d[0],d[2])},this.reduceActions[10]=function(d){return new K(d[0],d[2])},this.reduceActions[11]=function(d){return new G(d[0],d[2])},this.reduceActions[12]=function(d){return new he(d[0],d[2])},this.reduceActions[13]=function(d){return new le(d[0],d[2])},this.reduceActions[15]=function(d){return new oe(d[0],d[2])},this.reduceActions[16]=function(d){return new Z(d[0],d[2])},this.reduceActions[18]=function(d){return new fe(d[0],d[2])},this.reduceActions[19]=function(d){return new Se(d[0],d[2])},this.reduceActions[20]=function(d){return new Ke(d[0],d[2])},this.reduceActions[22]=function(d){return new x(d[1])},this.reduceActions[24]=function(d){return new be(d[0],d[2])},this.reduceActions[25]=function(d){return new we(void 0,void 0,d[0])},this.reduceActions[27]=function(d){return d[0].locationPath=d[2],d[0]},this.reduceActions[28]=function(d){return d[0].locationPath=d[2],d[0].locationPath.steps.unshift(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[0]},this.reduceActions[29]=function(d){return new we(d[0],[],void 0)},this.reduceActions[30]=function(d){return Ze.instance_of(d[0],we)?(d[0].filterPredicates==null&&(d[0].filterPredicates=[]),d[0].filterPredicates.push(d[1]),d[0]):new we(d[0],[d[1]],void 0)},this.reduceActions[32]=function(d){return d[1]},this.reduceActions[33]=function(d){return new Re(d[0])},this.reduceActions[34]=function(d){return new xe(d[0])},this.reduceActions[36]=function(d){return new J(d[0],[])},this.reduceActions[37]=function(d){return new J(d[0],d[2])},this.reduceActions[38]=function(d){return[d[0]]},this.reduceActions[39]=function(d){return d[2].unshift(d[0]),d[2]},this.reduceActions[43]=function(d){return new lt(!0,[])},this.reduceActions[44]=function(d){return d[1].absolute=!0,d[1]},this.reduceActions[46]=function(d){return new lt(!1,[d[0]])},this.reduceActions[47]=function(d){return d[0].steps.push(d[2]),d[0]},this.reduceActions[49]=function(d){return new O(d[0],d[1],[])},this.reduceActions[50]=function(d){return new O(O.CHILD,d[0],[])},this.reduceActions[51]=function(d){return new O(d[0],d[1],d[2])},this.reduceActions[52]=function(d){return new O(O.CHILD,d[0],d[1])},this.reduceActions[54]=function(d){return[d[0]]},this.reduceActions[55]=function(d){return d[1].unshift(d[0]),d[1]},this.reduceActions[56]=function(d){return d[0]=="ancestor"?O.ANCESTOR:d[0]=="ancestor-or-self"?O.ANCESTORORSELF:d[0]=="attribute"?O.ATTRIBUTE:d[0]=="child"?O.CHILD:d[0]=="descendant"?O.DESCENDANT:d[0]=="descendant-or-self"?O.DESCENDANTORSELF:d[0]=="following"?O.FOLLOWING:d[0]=="following-sibling"?O.FOLLOWINGSIBLING:d[0]=="namespace"?O.NAMESPACE:d[0]=="parent"?O.PARENT:d[0]=="preceding"?O.PRECEDING:d[0]=="preceding-sibling"?O.PRECEDINGSIBLING:d[0]=="self"?O.SELF:-1},this.reduceActions[57]=function(d){return O.ATTRIBUTE},this.reduceActions[59]=function(d){return d[0]=="comment"?_.commentTest:d[0]=="text"?_.textTest:d[0]=="processing-instruction"?_.anyPiTest:d[0]=="node"?_.nodeTest:new _(-1,void 0)},this.reduceActions[60]=function(d){return new _.PITest(d[2])},this.reduceActions[61]=function(d){return d[1]},this.reduceActions[63]=function(d){return d[1].absolute=!0,d[1].steps.unshift(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[1]},this.reduceActions[64]=function(d){return d[0].steps.push(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[0].steps.push(d[2]),d[0]},this.reduceActions[65]=function(d){return new O(O.SELF,_.nodeTest,[])},this.reduceActions[66]=function(d){return new O(O.PARENT,_.nodeTest,[])},this.reduceActions[67]=function(d){return new ne(d[1])},this.reduceActions[68]=function(d){return _.nameTestAny},this.reduceActions[69]=function(d){return new _.NameTestPrefixAny(d[0].split(":")[0])},this.reduceActions[70]=function(d){return new _.NameTestQName(d[0])}},E.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],E.actionTableNumber=[` 1 0 /.-,+*)(' & %$ # "!`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",` 1 0 /.-,+*)(' & %$ # "!`,`K1 KKKKKKKK . +*)('KKKKKK KK# K" `,` 1 0 /.-,+*)(' & %$ # "!`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",` 1 . +*)(' # " `,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",` 1 0 /.-,+*)(' & %$m # "!`,"_ f________ ______e __ _ ",` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 . +*)(' # " `,` 1 . +*)(' # " `,"> >>>>>>>>> >>>>>>> >> >> ",` 1 . +*)(' # " `,` 1 . +*)(' # " `,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," \x87 ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," \x88 "," F\x89 ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," \x8A ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE ",` 1 0 /.-,+*)(' & %$ # "!`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],E.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," \x7F=>?@ AB CDEFGH IJ ","\x80456789:;<=>?@ AB CDEFGH IJ\x81"," \x82 EFGH IJ "," \x83 EFGH IJ "," "," \x84 GH IJ "," \x85 GH IJ "," i \x86 "," i \x87 "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ AB\x8CqCDEFGH IJ "," "," "],E.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],E.DOUBLEDOT=2,E.DOUBLECOLON=3,E.DOUBLESLASH=4,E.NOTEQUAL=5,E.LESSTHANOREQUAL=6,E.GREATERTHANOREQUAL=7,E.AND=8,E.OR=9,E.MOD=10,E.DIV=11,E.MULTIPLYOPERATOR=12,E.FUNCTIONNAME=13,E.AXISNAME=14,E.LITERAL=15,E.NUMBER=16,E.ASTERISKNAMETEST=17,E.QNAME=18,E.NCNAMECOLONASTERISK=19,E.NODETYPE=20,E.PROCESSINGINSTRUCTIONWITHLITERAL=21,E.EQUALS=22,E.LESSTHAN=23,E.GREATERTHAN=24,E.PLUS=25,E.MINUS=26,E.BAR=27,E.SLASH=28,E.LEFTPARENTHESIS=29,E.RIGHTPARENTHESIS=30,E.COMMA=31,E.AT=32,E.LEFTBRACKET=33,E.RIGHTBRACKET=34,E.DOT=35,E.DOLLAR=36,E.prototype.tokenize=function(d){for(var I=[],$=[],te=d+"\0",ie=0,X=te.charAt(ie++);;){for(;X==" "||X==" "||X=="\r"||X==`
54
+ `;)X=te.charAt(ie++);if(X=="\0"||ie>=te.length)break;if(X=="("){I.push(E.LEFTPARENTHESIS),$.push(X),X=te.charAt(ie++);continue}if(X==")"){I.push(E.RIGHTPARENTHESIS),$.push(X),X=te.charAt(ie++);continue}if(X=="["){I.push(E.LEFTBRACKET),$.push(X),X=te.charAt(ie++);continue}if(X=="]"){I.push(E.RIGHTBRACKET),$.push(X),X=te.charAt(ie++);continue}if(X=="@"){I.push(E.AT),$.push(X),X=te.charAt(ie++);continue}if(X==","){I.push(E.COMMA),$.push(X),X=te.charAt(ie++);continue}if(X=="|"){I.push(E.BAR),$.push(X),X=te.charAt(ie++);continue}if(X=="+"){I.push(E.PLUS),$.push(X),X=te.charAt(ie++);continue}if(X=="-"){I.push(E.MINUS),$.push(X),X=te.charAt(ie++);continue}if(X=="="){I.push(E.EQUALS),$.push(X),X=te.charAt(ie++);continue}if(X=="$"){I.push(E.DOLLAR),$.push(X),X=te.charAt(ie++);continue}if(X=="."){if(X=te.charAt(ie++),X=="."){I.push(E.DOUBLEDOT),$.push(".."),X=te.charAt(ie++);continue}if(X>="0"&&X<="9"){var nt="."+X;for(X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);I.push(E.NUMBER),$.push(nt);continue}I.push(E.DOT),$.push(".");continue}if(X=="'"||X=='"'){for(var kt=X,Wt="";ie<te.length&&(X=te.charAt(ie))!==kt;)Wt+=X,ie+=1;if(X!==kt)throw Dn.fromMessage("Unterminated string literal: "+kt+Wt);ie+=1,I.push(E.LITERAL),$.push(Wt),X=te.charAt(ie++);continue}if(X>="0"&&X<="9"){var nt=X;for(X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);if(X=="."&&te.charAt(ie)>="0"&&te.charAt(ie)<="9")for(nt+=X,nt+=te.charAt(ie++),X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);I.push(E.NUMBER),$.push(nt);continue}if(X=="*"){if(I.length>0){var et=I[I.length-1];if(et!=E.AT&&et!=E.DOUBLECOLON&&et!=E.LEFTPARENTHESIS&&et!=E.LEFTBRACKET&&et!=E.AND&&et!=E.OR&&et!=E.MOD&&et!=E.DIV&&et!=E.MULTIPLYOPERATOR&&et!=E.SLASH&&et!=E.DOUBLESLASH&&et!=E.BAR&&et!=E.PLUS&&et!=E.MINUS&&et!=E.EQUALS&&et!=E.NOTEQUAL&&et!=E.LESSTHAN&&et!=E.LESSTHANOREQUAL&&et!=E.GREATERTHAN&&et!=E.GREATERTHANOREQUAL){I.push(E.MULTIPLYOPERATOR),$.push(X),X=te.charAt(ie++);continue}}I.push(E.ASTERISKNAMETEST),$.push(X),X=te.charAt(ie++);continue}if(X==":"&&te.charAt(ie)==":"){I.push(E.DOUBLECOLON),$.push("::"),ie++,X=te.charAt(ie++);continue}if(X=="/"){if(X=te.charAt(ie++),X=="/"){I.push(E.DOUBLESLASH),$.push("//"),X=te.charAt(ie++);continue}I.push(E.SLASH),$.push("/");continue}if(X=="!"&&te.charAt(ie)=="="){I.push(E.NOTEQUAL),$.push("!="),ie++,X=te.charAt(ie++);continue}if(X=="<"){if(te.charAt(ie)=="="){I.push(E.LESSTHANOREQUAL),$.push("<="),ie++,X=te.charAt(ie++);continue}I.push(E.LESSTHAN),$.push("<"),X=te.charAt(ie++);continue}if(X==">"){if(te.charAt(ie)=="="){I.push(E.GREATERTHANOREQUAL),$.push(">="),ie++,X=te.charAt(ie++);continue}I.push(E.GREATERTHAN),$.push(">"),X=te.charAt(ie++);continue}if(X=="_"||Ze.isLetter(X.charCodeAt(0))){var Dt=X;for(X=te.charAt(ie++);Ze.isNCNameChar(X.charCodeAt(0));)Dt+=X,X=te.charAt(ie++);if(I.length>0){var et=I[I.length-1];if(et!=E.AT&&et!=E.DOUBLECOLON&&et!=E.LEFTPARENTHESIS&&et!=E.LEFTBRACKET&&et!=E.AND&&et!=E.OR&&et!=E.MOD&&et!=E.DIV&&et!=E.MULTIPLYOPERATOR&&et!=E.SLASH&&et!=E.DOUBLESLASH&&et!=E.BAR&&et!=E.PLUS&&et!=E.MINUS&&et!=E.EQUALS&&et!=E.NOTEQUAL&&et!=E.LESSTHAN&&et!=E.LESSTHANOREQUAL&&et!=E.GREATERTHAN&&et!=E.GREATERTHANOREQUAL){if(Dt=="and"){I.push(E.AND),$.push(Dt);continue}if(Dt=="or"){I.push(E.OR),$.push(Dt);continue}if(Dt=="mod"){I.push(E.MOD),$.push(Dt);continue}if(Dt=="div"){I.push(E.DIV),$.push(Dt);continue}}}if(X==":"){if(te.charAt(ie)=="*"){I.push(E.NCNAMECOLONASTERISK),$.push(Dt+":*"),ie++,X=te.charAt(ie++);continue}if(te.charAt(ie)=="_"||Ze.isLetter(te.charCodeAt(ie))){for(Dt+=":",X=te.charAt(ie++);Ze.isNCNameChar(X.charCodeAt(0));)Dt+=X,X=te.charAt(ie++);if(X=="("){I.push(E.FUNCTIONNAME),$.push(Dt);continue}I.push(E.QNAME),$.push(Dt);continue}if(te.charAt(ie)==":"){I.push(E.AXISNAME),$.push(Dt);continue}}if(X=="("){if(Dt=="comment"||Dt=="text"||Dt=="node"){I.push(E.NODETYPE),$.push(Dt);continue}if(Dt=="processing-instruction"){te.charAt(ie)==")"?I.push(E.NODETYPE):I.push(E.PROCESSINGINSTRUCTIONWITHLITERAL),$.push(Dt);continue}I.push(E.FUNCTIONNAME),$.push(Dt);continue}I.push(E.QNAME),$.push(Dt);continue}throw new Error("Unexpected character "+X)}return I.push(1),$.push("[EOF]"),[I,$]},E.SHIFT="s",E.REDUCE="r",E.ACCEPT="a",E.prototype.parse=function(Wt){var I,$,te=this.tokenize(Wt);if(te!=null){I=te[0],$=te[1];var ie=0,X=[],nt=[],kt=[],Wt,et,Dt;for(X.push(0),nt.push(1),kt.push("_S"),et=I[ie],Dt=$[ie++];;)switch(Wt=X[X.length-1],E.actionTable[Wt].charAt(et-1)){case E.SHIFT:nt.push(-et),kt.push(Dt),X.push(E.actionTableNumber[Wt].charCodeAt(et-1)-32),et=I[ie],Dt=$[ie++];break;case E.REDUCE:for(var _n=E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][1],ti=[],or=0;or<_n;or++)nt.pop(),ti.unshift(kt.pop()),X.pop();var ua=X[X.length-1];nt.push(E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][0]),this.reduceActions[E.actionTableNumber[Wt].charCodeAt(et-1)-32]==null?kt.push(ti[0]):kt.push(this.reduceActions[E.actionTableNumber[Wt].charCodeAt(et-1)-32](ti)),X.push(E.gotoTable[ua].charCodeAt(E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][0]-2)-33);break;case E.ACCEPT:return new b(kt.pop());default:throw new Error("XPath parse error")}}},b.prototype=new Object,b.prototype.constructor=b,b.superclass=Object.prototype;function b(d){this.expression=d}o(b,"XPath"),b.prototype.toString=function(){return this.expression.toString()};function T(d,I,$){I in d||(d[I]=$)}o(T,"setIfUnset"),b.prototype.evaluate=function(d){return d.contextNode=d.expressionContextNode,d.contextSize=1,d.contextPosition=1,d.isHtml&&(T(d,"caseInsensitive",!0),T(d,"allowAnyNamespaceForNoPrefix",!0)),T(d,"caseInsensitive",!1),this.expression.evaluate(d)},b.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",b.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",A.prototype=new Object,A.prototype.constructor=A,A.superclass=Object.prototype;function A(){}o(A,"Expression"),A.prototype.init=function(){},A.prototype.toString=function(){return"<Expression>"},A.prototype.evaluate=function(d){throw new Error("Could not evaluate expression.")},C.prototype=new A,C.prototype.constructor=C,C.superclass=A.prototype;function C(d){arguments.length>0&&this.init(d)}o(C,"UnaryOperation"),C.prototype.init=function(d){this.rhs=d},x.prototype=new C,x.prototype.constructor=x,x.superclass=C.prototype;function x(d){arguments.length>0&&this.init(d)}o(x,"UnaryMinusOperation"),x.prototype.init=function(d){x.superclass.init.call(this,d)},x.prototype.evaluate=function(d){return this.rhs.evaluate(d).number().negate()},x.prototype.toString=function(){return"-"+this.rhs.toString()},B.prototype=new A,B.prototype.constructor=B,B.superclass=A.prototype;function B(d,I){arguments.length>0&&this.init(d,I)}o(B,"BinaryOperation"),B.prototype.init=function(d,I){this.lhs=d,this.rhs=I},F.prototype=new B,F.prototype.constructor=F,F.superclass=B.prototype;function F(d,I){arguments.length>0&&this.init(d,I)}o(F,"OrOperation"),F.prototype.init=function(d,I){F.superclass.init.call(this,d,I)},F.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},F.prototype.evaluate=function(d){var I=this.lhs.evaluate(d).bool();return I.booleanValue()?I:this.rhs.evaluate(d).bool()},R.prototype=new B,R.prototype.constructor=R,R.superclass=B.prototype;function R(d,I){arguments.length>0&&this.init(d,I)}o(R,"AndOperation"),R.prototype.init=function(d,I){R.superclass.init.call(this,d,I)},R.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},R.prototype.evaluate=function(d){var I=this.lhs.evaluate(d).bool();return I.booleanValue()?this.rhs.evaluate(d).bool():I},H.prototype=new B,H.prototype.constructor=H,H.superclass=B.prototype;function H(d,I){arguments.length>0&&this.init(d,I)}o(H,"EqualsOperation"),H.prototype.init=function(d,I){H.superclass.init.call(this,d,I)},H.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},H.prototype.evaluate=function(d){return this.lhs.evaluate(d).equals(this.rhs.evaluate(d))},q.prototype=new B,q.prototype.constructor=q,q.superclass=B.prototype;function q(d,I){arguments.length>0&&this.init(d,I)}o(q,"NotEqualOperation"),q.prototype.init=function(d,I){q.superclass.init.call(this,d,I)},q.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},q.prototype.evaluate=function(d){return this.lhs.evaluate(d).notequal(this.rhs.evaluate(d))},K.prototype=new B,K.prototype.constructor=K,K.superclass=B.prototype;function K(d,I){arguments.length>0&&this.init(d,I)}o(K,"LessThanOperation"),K.prototype.init=function(d,I){K.superclass.init.call(this,d,I)},K.prototype.evaluate=function(d){return this.lhs.evaluate(d).lessthan(this.rhs.evaluate(d))},K.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},G.prototype=new B,G.prototype.constructor=G,G.superclass=B.prototype;function G(d,I){arguments.length>0&&this.init(d,I)}o(G,"GreaterThanOperation"),G.prototype.init=function(d,I){G.superclass.init.call(this,d,I)},G.prototype.evaluate=function(d){return this.lhs.evaluate(d).greaterthan(this.rhs.evaluate(d))},G.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},he.prototype=new B,he.prototype.constructor=he,he.superclass=B.prototype;function he(d,I){arguments.length>0&&this.init(d,I)}o(he,"LessThanOrEqualOperation"),he.prototype.init=function(d,I){he.superclass.init.call(this,d,I)},he.prototype.evaluate=function(d){return this.lhs.evaluate(d).lessthanorequal(this.rhs.evaluate(d))},he.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},le.prototype=new B,le.prototype.constructor=le,le.superclass=B.prototype;function le(d,I){arguments.length>0&&this.init(d,I)}o(le,"GreaterThanOrEqualOperation"),le.prototype.init=function(d,I){le.superclass.init.call(this,d,I)},le.prototype.evaluate=function(d){return this.lhs.evaluate(d).greaterthanorequal(this.rhs.evaluate(d))},le.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},oe.prototype=new B,oe.prototype.constructor=oe,oe.superclass=B.prototype;function oe(d,I){arguments.length>0&&this.init(d,I)}o(oe,"PlusOperation"),oe.prototype.init=function(d,I){oe.superclass.init.call(this,d,I)},oe.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().plus(this.rhs.evaluate(d).number())},oe.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},Z.prototype=new B,Z.prototype.constructor=Z,Z.superclass=B.prototype;function Z(d,I){arguments.length>0&&this.init(d,I)}o(Z,"MinusOperation"),Z.prototype.init=function(d,I){Z.superclass.init.call(this,d,I)},Z.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().minus(this.rhs.evaluate(d).number())},Z.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},fe.prototype=new B,fe.prototype.constructor=fe,fe.superclass=B.prototype;function fe(d,I){arguments.length>0&&this.init(d,I)}o(fe,"MultiplyOperation"),fe.prototype.init=function(d,I){fe.superclass.init.call(this,d,I)},fe.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().multiply(this.rhs.evaluate(d).number())},fe.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},Se.prototype=new B,Se.prototype.constructor=Se,Se.superclass=B.prototype;function Se(d,I){arguments.length>0&&this.init(d,I)}o(Se,"DivOperation"),Se.prototype.init=function(d,I){Se.superclass.init.call(this,d,I)},Se.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().div(this.rhs.evaluate(d).number())},Se.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},Ke.prototype=new B,Ke.prototype.constructor=Ke,Ke.superclass=B.prototype;function Ke(d,I){arguments.length>0&&this.init(d,I)}o(Ke,"ModOperation"),Ke.prototype.init=function(d,I){Ke.superclass.init.call(this,d,I)},Ke.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().mod(this.rhs.evaluate(d).number())},Ke.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},be.prototype=new B,be.prototype.constructor=be,be.superclass=B.prototype;function be(d,I){arguments.length>0&&this.init(d,I)}o(be,"BarOperation"),be.prototype.init=function(d,I){be.superclass.init.call(this,d,I)},be.prototype.evaluate=function(d){return this.lhs.evaluate(d).nodeset().union(this.rhs.evaluate(d).nodeset())},be.prototype.toString=function(){return s(l,[this.lhs,this.rhs]).join(" | ")},we.prototype=new A,we.prototype.constructor=we,we.superclass=A.prototype;function we(d,I,$){arguments.length>0&&this.init(d,I,$)}o(we,"PathExpr"),we.prototype.init=function(d,I,$){we.superclass.init.call(this),this.filter=d,this.filterPredicates=I,this.locationPath=$};function Me(d){for(;d&&d.parentNode;)d=d.parentNode;return d}o(Me,"findRoot"),we.applyPredicates=function(d,I,$){if(d.length===0)return $;var te=I.extend({});return n(function(ie,X){return te.contextSize=ie.length,i(function(nt,kt){return te.contextNode=nt,te.contextPosition=kt+1,we.predicateMatches(X,te)},ie)},$,d)},we.getRoot=function(d,I){var $=I[0];if($.nodeType===S.DOCUMENT_NODE)return $;if(d.virtualRoot)return d.virtualRoot;var te=$.ownerDocument;if(te)return te;for(var ie=$;ie.parentNode!=null;)ie=ie.parentNode;return ie},we.applyStep=function(d,I,$){var te=this,ie=[];switch(I.contextNode=$,d.axis){case O.ANCESTOR:if(I.contextNode===I.virtualRoot)break;var X;for(I.contextNode.nodeType==S.ATTRIBUTE_NODE?X=we.getOwnerElement(I.contextNode):X=I.contextNode.parentNode;X!=null&&(d.nodeTest.matches(X,I)&&ie.push(X),X!==I.virtualRoot);)X=X.parentNode;break;case O.ANCESTORORSELF:for(var X=I.contextNode;X!=null&&(d.nodeTest.matches(X,I)&&ie.push(X),X!==I.virtualRoot);X=X.nodeType==S.ATTRIBUTE_NODE?we.getOwnerElement(X):X.parentNode);break;case O.ATTRIBUTE:var nt=I.contextNode.attributes;if(nt!=null)for(var kt=0;kt<nt.length;kt++){var X=nt.item(kt);d.nodeTest.matches(X,I)&&ie.push(X)}break;case O.CHILD:for(var X=I.contextNode.firstChild;X!=null;X=X.nextSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.DESCENDANT:for(var or=[I.contextNode.firstChild];or.length>0;)for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;break;case O.DESCENDANTORSELF:d.nodeTest.matches(I.contextNode,I)&&ie.push(I.contextNode);for(var or=[I.contextNode.firstChild];or.length>0;)for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;break;case O.FOLLOWING:if(I.contextNode===I.virtualRoot)break;var or=[];I.contextNode.firstChild!=null?or.unshift(I.contextNode.firstChild):or.unshift(I.contextNode.nextSibling);for(var X=I.contextNode.parentNode;X!=null&&X.nodeType!=S.DOCUMENT_NODE&&X!==I.virtualRoot;X=X.parentNode)or.unshift(X.nextSibling);do for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;while(or.length>0);break;case O.FOLLOWINGSIBLING:if(I.contextNode===I.virtualRoot)break;for(var X=I.contextNode.nextSibling;X!=null;X=X.nextSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.NAMESPACE:var Wt={};if(I.contextNode.nodeType==S.ELEMENT_NODE){Wt.xml=b.XML_NAMESPACE_URI,Wt.xmlns=b.XMLNS_NAMESPACE_URI;for(var X=I.contextNode;X!=null&&X.nodeType==S.ELEMENT_NODE;X=X.parentNode)for(var kt=0;kt<X.attributes.length;kt++){var et=X.attributes.item(kt),Dt=String(et.name);if(Dt=="xmlns")Wt[""]==null&&(Wt[""]=et.value);else if(Dt.length>6&&Dt.substring(0,6)=="xmlns:"){var _n=Dt.substring(6,Dt.length);Wt[_n]==null&&(Wt[_n]=et.value)}}for(var _n in Wt){var ti=new Ur(_n,Wt[_n],I.contextNode);d.nodeTest.matches(ti,I)&&ie.push(ti)}}break;case O.PARENT:X=null,I.contextNode!==I.virtualRoot&&(I.contextNode.nodeType==S.ATTRIBUTE_NODE?X=we.getOwnerElement(I.contextNode):X=I.contextNode.parentNode),X!=null&&d.nodeTest.matches(X,I)&&ie.push(X);break;case O.PRECEDING:var or;I.virtualRoot!=null?or=[I.virtualRoot]:or=[Me(I.contextNode)];e:for(;or.length>0;)for(var X=or.pop();X!=null;){if(X==I.contextNode)break e;d.nodeTest.matches(X,I)&&ie.unshift(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling}break;case O.PRECEDINGSIBLING:if(I.contextNode===I.virtualRoot)break;for(var X=I.contextNode.previousSibling;X!=null;X=X.previousSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.SELF:d.nodeTest.matches(I.contextNode,I)&&ie.push(I.contextNode);break;default:}return ie};function Je(d,I,$){return we.applyPredicates(d.predicates,I,we.applyStep(d,I,$))}o(Je,"applyStepWithPredicates");function Ye(d,I,$){return w(s(Je.bind(null,$,d),I))}o(Ye,"applyStepToNodes"),we.applySteps=function(d,I,$){return n(Ye.bind(null,I),$,d)},we.prototype.applyFilter=function(d,I){if(!this.filter)return{nodes:[d.contextNode]};var $=this.filter.evaluate(d);if(!Ze.instance_of($,Ge)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:$}}return{nodes:we.applyPredicates(this.filterPredicates||[],I,$.toUnsortedArray())}},we.applyLocationPath=function(d,I,$){if(!d)return $;var te=d.absolute?[we.getRoot(I,$)]:$;return we.applySteps(d.steps,I,te)},we.prototype.evaluate=function(d){var I=y(new on,d),$=this.applyFilter(d,I);if("nonNodes"in $)return $.nonNodes;var te=new Ge;return te.addArray(we.applyLocationPath(this.locationPath,I,$.nodes)),te},we.predicateMatches=function(d,I){var $=d.evaluate(I);return Ze.instance_of($,xe)?I.contextPosition===$.numberValue():$.booleanValue()},we.predicateString=function(d){return h("[","]",d.toString())},we.predicatesString=function(d){return f("",s(we.predicateString,d))},we.prototype.toString=function(){if(this.filter!=null){var d=l(this.filter);return Ze.instance_of(this.filter,Re)?h("'","'",d):this.filterPredicates!=null&&this.filterPredicates.length?h("(",")",d)+we.predicatesString(this.filterPredicates):this.locationPath!=null?d+(this.locationPath.absolute?"":"/")+l(this.locationPath):d}return l(this.locationPath)},we.getOwnerElement=function(d){if(d.ownerElement)return d.ownerElement;try{if(d.selectSingleNode)return d.selectSingleNode("..")}catch{}for(var I=d.nodeType==S.DOCUMENT_NODE?d:d.ownerDocument,$=I.getElementsByTagName("*"),te=0;te<$.length;te++)for(var ie=$.item(te),X=ie.attributes,nt=0;nt<X.length;nt++){var kt=X.item(nt);if(kt===d)return ie}return null},lt.prototype=new Object,lt.prototype.constructor=lt,lt.superclass=Object.prototype;function lt(d,I){arguments.length>0&&this.init(d,I)}o(lt,"LocationPath"),lt.prototype.init=function(d,I){this.absolute=d,this.steps=I},lt.prototype.toString=function(){return(this.absolute?"/":"")+s(l,this.steps).join("/")},O.prototype=new Object,O.prototype.constructor=O,O.superclass=Object.prototype;function O(d,I,$){arguments.length>0&&this.init(d,I,$)}o(O,"Step"),O.prototype.init=function(d,I,$){this.axis=d,this.nodeTest=I,this.predicates=$},O.prototype.toString=function(){return O.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+we.predicatesString(this.predicates)},O.ANCESTOR=0,O.ANCESTORORSELF=1,O.ATTRIBUTE=2,O.CHILD=3,O.DESCENDANT=4,O.DESCENDANTORSELF=5,O.FOLLOWING=6,O.FOLLOWINGSIBLING=7,O.NAMESPACE=8,O.PARENT=9,O.PRECEDING=10,O.PRECEDINGSIBLING=11,O.SELF=12,O.STEPNAMES=n(function(d,I){return d[I[0]]=I[1],d},{},[[O.ANCESTOR,"ancestor"],[O.ANCESTORORSELF,"ancestor-or-self"],[O.ATTRIBUTE,"attribute"],[O.CHILD,"child"],[O.DESCENDANT,"descendant"],[O.DESCENDANTORSELF,"descendant-or-self"],[O.FOLLOWING,"following"],[O.FOLLOWINGSIBLING,"following-sibling"],[O.NAMESPACE,"namespace"],[O.PARENT,"parent"],[O.PRECEDING,"preceding"],[O.PRECEDINGSIBLING,"preceding-sibling"],[O.SELF,"self"]]),_.prototype=new Object,_.prototype.constructor=_,_.superclass=Object.prototype;function _(d,I){arguments.length>0&&this.init(d,I)}o(_,"NodeTest"),_.prototype.init=function(d,I){this.type=d,this.value=I},_.prototype.toString=function(){return"<unknown nodetest type>"},_.prototype.matches=function(d,I){console.warn("unknown node test type")},_.NAMETESTANY=0,_.NAMETESTPREFIXANY=1,_.NAMETESTQNAME=2,_.COMMENT=3,_.TEXT=4,_.PI=5,_.NODE=6,_.isNodeType=function(d){return function(I){return a(d,I.nodeType)}},_.makeNodeTestType=function(d,I,$){var te=$||function(){};return te.prototype=new _(d),te.prototype.constructor=te,y(te.prototype,I),te},_.makeNodeTypeTest=function(d,I,$){return new(_.makeNodeTestType(d,{matches:_.isNodeType(I),toString:u($)}))},_.hasPrefix=function(d){return d.prefix||(d.nodeName||d.tagName).indexOf(":")!==-1},_.isElementOrAttribute=_.isNodeType([1,2]),_.nameSpaceMatches=function(d,I,$){var te=$.namespaceURI||"";if(!d)return!te||I.allowAnyNamespaceForNoPrefix&&!_.hasPrefix($);var ie=I.namespaceResolver.getNamespace(d,I.expressionContextNode);if(ie==null)throw new Error("Cannot resolve QName "+d);return ie===te},_.localNameMatches=function(d,I,$){var te=$.localName||$.nodeName;return I.caseInsensitive?d.toLowerCase()===te.toLowerCase():d===te},_.NameTestPrefixAny=_.makeNodeTestType(_.NAMETESTPREFIXANY,{matches:o(function(d,I){return _.isElementOrAttribute(d)&&_.nameSpaceMatches(this.prefix,I,d)},"matches"),toString:o(function(){return this.prefix+":*"},"toString")},o(function(I){this.prefix=I},"NameTestPrefixAny")),_.NameTestQName=_.makeNodeTestType(_.NAMETESTQNAME,{matches:o(function(d,I){return _.isNodeType([S.ELEMENT_NODE,S.ATTRIBUTE_NODE,Ur.XPATH_NAMESPACE_NODE])(d)&&_.nameSpaceMatches(this.prefix,I,d)&&_.localNameMatches(this.localName,I,d)},"matches"),toString:o(function(){return this.name},"toString")},o(function(I){var $=I.split(":");this.name=I,this.prefix=$.length>1?$[0]:null,this.localName=$[$.length>1?1:0]},"NameTestQName")),_.PITest=_.makeNodeTestType(_.PI,{matches:o(function(d,I){return _.isNodeType([S.PROCESSING_INSTRUCTION_NODE])(d)&&(d.target||d.nodeName)===this.name},"matches"),toString:o(function(){return h('processing-instruction("','")',this.name)},"toString")},function(d){this.name=d}),_.nameTestAny=_.makeNodeTypeTest(_.NAMETESTANY,[S.ELEMENT_NODE,S.ATTRIBUTE_NODE,Ur.XPATH_NAMESPACE_NODE],"*"),_.textTest=_.makeNodeTypeTest(_.TEXT,[S.TEXT_NODE,S.CDATA_SECTION_NODE],"text()"),_.commentTest=_.makeNodeTypeTest(_.COMMENT,[S.COMMENT_NODE],"comment()"),_.nodeTest=_.makeNodeTypeTest(_.NODE,[S.ELEMENT_NODE,S.ATTRIBUTE_NODE,S.TEXT_NODE,S.CDATA_SECTION_NODE,S.PROCESSING_INSTRUCTION_NODE,S.COMMENT_NODE,S.DOCUMENT_NODE],"node()"),_.anyPiTest=_.makeNodeTypeTest(_.PI,[S.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),ne.prototype=new A,ne.prototype.constructor=ne,ne.superclass=A.prototype;function ne(d){arguments.length>0&&this.init(d)}o(ne,"VariableReference"),ne.prototype.init=function(d){this.variable=d},ne.prototype.toString=function(){return"$"+this.variable},ne.prototype.evaluate=function(d){var I=Ze.resolveQName(this.variable,d.namespaceResolver,d.contextNode,!1);if(I[0]==null)throw new Error("Cannot resolve QName "+fn);var $=d.variableResolver.getVariable(I[1],I[0]);if(!$)throw Dn.fromMessage("Undeclared variable: "+this.toString());return $},J.prototype=new A,J.prototype.constructor=J,J.superclass=A.prototype;function J(d,I){arguments.length>0&&this.init(d,I)}o(J,"FunctionCall"),J.prototype.init=function(d,I){this.functionName=d,this.arguments=I},J.prototype.toString=function(){for(var d=this.functionName+"(",I=0;I<this.arguments.length;I++)I>0&&(d+=", "),d+=this.arguments[I].toString();return d+")"},J.prototype.evaluate=function(d){var I=ms.getFunctionFromContext(this.functionName,d);if(!I)throw new Error("Unknown function "+this.functionName);var $=[d].concat(this.arguments);return I.apply(d.functionResolver.thisArg,$)};var Xe=new Object;Xe.equals=function(d,I){return d.equals(I)},Xe.notequal=function(d,I){return d.notequal(I)},Xe.lessthan=function(d,I){return d.lessthan(I)},Xe.greaterthan=function(d,I){return d.greaterthan(I)},Xe.lessthanorequal=function(d,I){return d.lessthanorequal(I)},Xe.greaterthanorequal=function(d,I){return d.greaterthanorequal(I)},Re.prototype=new A,Re.prototype.constructor=Re,Re.superclass=A.prototype;function Re(d){arguments.length>0&&this.init(d)}o(Re,"XString"),Re.prototype.init=function(d){this.str=String(d)},Re.prototype.toString=function(){return this.str},Re.prototype.evaluate=function(d){return this},Re.prototype.string=function(){return this},Re.prototype.number=function(){return new xe(this.str)},Re.prototype.bool=function(){return new je(this.str)},Re.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},Re.prototype.stringValue=function(){return this.str},Re.prototype.numberValue=function(){return this.number().numberValue()},Re.prototype.booleanValue=function(){return this.bool().booleanValue()},Re.prototype.equals=function(d){return Ze.instance_of(d,je)?this.bool().equals(d):Ze.instance_of(d,xe)?this.number().equals(d):Ze.instance_of(d,Ge)?d.compareWithString(this,Xe.equals):new je(this.str==d.str)},Re.prototype.notequal=function(d){return Ze.instance_of(d,je)?this.bool().notequal(d):Ze.instance_of(d,xe)?this.number().notequal(d):Ze.instance_of(d,Ge)?d.compareWithString(this,Xe.notequal):new je(this.str!=d.str)},Re.prototype.lessthan=function(d){return this.number().lessthan(d)},Re.prototype.greaterthan=function(d){return this.number().greaterthan(d)},Re.prototype.lessthanorequal=function(d){return this.number().lessthanorequal(d)},Re.prototype.greaterthanorequal=function(d){return this.number().greaterthanorequal(d)},xe.prototype=new A,xe.prototype.constructor=xe,xe.superclass=A.prototype;function xe(d){arguments.length>0&&this.init(d)}o(xe,"XNumber"),xe.prototype.init=function(d){this.num=typeof d=="string"?this.parse(d):Number(d)},xe.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,xe.prototype.parse=function(d){return this.numberFormat.test(d)?parseFloat(d):Number.NaN};function ct(d){for(var I=d.split("e-"),$=I[0].replace(".",""),te=Number(I[1]),ie=0;ie<te-1;ie+=1)$="0"+$;return"0."+$}o(ct,"padSmallNumber");function rr(d){for(var I=d.split("e"),$=I[0].replace(".",""),te=Number(I[1]),ie=te+1-$.length,X=0;X<ie;X+=1)$+="0";return $}o(rr,"padLargeNumber"),xe.prototype.toString=function(){var d=this.num.toString();return d.indexOf("e-")!==-1?ct(d):d.indexOf("e")!==-1?rr(d):d},xe.prototype.evaluate=function(d){return this},xe.prototype.string=function(){return new Re(this.toString())},xe.prototype.number=function(){return this},xe.prototype.bool=function(){return new je(this.num)},xe.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},xe.prototype.stringValue=function(){return this.string().stringValue()},xe.prototype.numberValue=function(){return this.num},xe.prototype.booleanValue=function(){return this.bool().booleanValue()},xe.prototype.negate=function(){return new xe(-this.num)},xe.prototype.equals=function(d){return Ze.instance_of(d,je)?this.bool().equals(d):Ze.instance_of(d,Re)?this.equals(d.number()):Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.equals):new je(this.num==d.num)},xe.prototype.notequal=function(d){return Ze.instance_of(d,je)?this.bool().notequal(d):Ze.instance_of(d,Re)?this.notequal(d.number()):Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.notequal):new je(this.num!=d.num)},xe.prototype.lessthan=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.greaterthan):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.lessthan(d.number()):new je(this.num<d.num)},xe.prototype.greaterthan=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.lessthan):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.greaterthan(d.number()):new je(this.num>d.num)},xe.prototype.lessthanorequal=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.greaterthanorequal):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.lessthanorequal(d.number()):new je(this.num<=d.num)},xe.prototype.greaterthanorequal=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.lessthanorequal):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.greaterthanorequal(d.number()):new je(this.num>=d.num)},xe.prototype.plus=function(d){return new xe(this.num+d.num)},xe.prototype.minus=function(d){return new xe(this.num-d.num)},xe.prototype.multiply=function(d){return new xe(this.num*d.num)},xe.prototype.div=function(d){return new xe(this.num/d.num)},xe.prototype.mod=function(d){return new xe(this.num%d.num)},je.prototype=new A,je.prototype.constructor=je,je.superclass=A.prototype;function je(d){arguments.length>0&&this.init(d)}o(je,"XBoolean"),je.prototype.init=function(d){this.b=!!d},je.prototype.toString=function(){return this.b.toString()},je.prototype.evaluate=function(d){return this},je.prototype.string=function(){return new Re(this.b)},je.prototype.number=function(){return new xe(this.b)},je.prototype.bool=function(){return this},je.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},je.prototype.stringValue=function(){return this.string().stringValue()},je.prototype.numberValue=function(){return this.number().numberValue()},je.prototype.booleanValue=function(){return this.b},je.prototype.not=function(){return new je(!this.b)},je.prototype.equals=function(d){return Ze.instance_of(d,Re)||Ze.instance_of(d,xe)?this.equals(d.bool()):Ze.instance_of(d,Ge)?d.compareWithBoolean(this,Xe.equals):new je(this.b==d.b)},je.prototype.notequal=function(d){return Ze.instance_of(d,Re)||Ze.instance_of(d,xe)?this.notequal(d.bool()):Ze.instance_of(d,Ge)?d.compareWithBoolean(this,Xe.notequal):new je(this.b!=d.b)},je.prototype.lessthan=function(d){return this.number().lessthan(d)},je.prototype.greaterthan=function(d){return this.number().greaterthan(d)},je.prototype.lessthanorequal=function(d){return this.number().lessthanorequal(d)},je.prototype.greaterthanorequal=function(d){return this.number().greaterthanorequal(d)},je.true_=new je(!0),je.false_=new je(!1),nr.prototype=new Object,nr.prototype.constructor=nr,nr.superclass=Object.prototype;function nr(d){this.init(d)}o(nr,"AVLTree"),nr.prototype.init=function(d){this.left=null,this.right=null,this.node=d,this.depth=1},nr.prototype.balance=function(){var d=this.left==null?0:this.left.depth,I=this.right==null?0:this.right.depth;if(d>I+1){var $=this.left.left==null?0:this.left.left.depth,te=this.left.right==null?0:this.left.right.depth;$<te&&this.left.rotateRR(),this.rotateLL()}else if(d+1<I){var ie=this.right.right==null?0:this.right.right.depth,X=this.right.left==null?0:this.right.left.depth;X>ie&&this.right.rotateLL(),this.rotateRR()}},nr.prototype.rotateLL=function(){var d=this.node,I=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=I,this.right.node=d,this.right.updateInNewLocation(),this.updateInNewLocation()},nr.prototype.rotateRR=function(){var d=this.node,I=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=I,this.left.node=d,this.left.updateInNewLocation(),this.updateInNewLocation()},nr.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},nr.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function Ls(d,I){if(d===I)return 0;if(d.compareDocumentPosition){var $=d.compareDocumentPosition(I);return $&1||$&10?1:$&20?-1:0}for(var te=0,ie=0,X=d;X!=null;X=X.parentNode||X.ownerElement)te++;for(var nt=I;nt!=null;nt=nt.parentNode||nt.ownerElement)ie++;if(te>ie){for(;te>ie;)d=d.parentNode||d.ownerElement,te--;if(d===I)return 1}else if(ie>te){for(;ie>te;)I=I.parentNode||I.ownerElement,ie--;if(d===I)return-1}for(var kt=d.parentNode||d.ownerElement,Wt=I.parentNode||I.ownerElement;kt!==Wt;)d=kt,I=Wt,kt=d.parentNode||d.ownerElement,Wt=I.parentNode||I.ownerElement;var et=Ze.isAttribute(d),Dt=Ze.isAttribute(I);if(et&&!Dt)return-1;if(!et&&Dt)return 1;if(kt)for(var _n=et?kt.attributes:kt.childNodes,ti=_n.length,or=0;or<ti;or+=1){var ua=_n[or];if(ua===d)return-1;if(ua===I)return 1}throw new Error("Unexpected: could not determine node order")}o(Ls,"nodeOrder"),nr.prototype.add=function(d){if(d===this.node)return!1;var I=Ls(d,this.node),$=!1;return I==-1?this.left==null?(this.left=new nr(d),$=!0):($=this.left.add(d),$&&this.balance()):I==1&&(this.right==null?(this.right=new nr(d),$=!0):($=this.right.add(d),$&&this.balance())),$&&this.getDepthFromChildren(),$},Ge.prototype=new A,Ge.prototype.constructor=Ge,Ge.superclass=A.prototype;function Ge(){this.init()}o(Ge,"XNodeSet"),Ge.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},Ge.prototype.toString=function(){var d=this.first();return d==null?"":this.stringForNode(d)},Ge.prototype.evaluate=function(d){return this},Ge.prototype.string=function(){return new Re(this.toString())},Ge.prototype.stringValue=function(){return this.toString()},Ge.prototype.number=function(){return new xe(this.string())},Ge.prototype.numberValue=function(){return Number(this.string())},Ge.prototype.bool=function(){return new je(this.booleanValue())},Ge.prototype.booleanValue=function(){return!!this.size},Ge.prototype.nodeset=function(){return this},Ge.prototype.stringForNode=function(d){return d.nodeType==S.DOCUMENT_NODE||d.nodeType==S.ELEMENT_NODE||d.nodeType===S.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(d):d.nodeType===S.ATTRIBUTE_NODE?d.value||d.nodeValue:d.isNamespaceNode?d.namespace:d.nodeValue},Ge.prototype.stringForContainerNode=function(d){for(var I="",$=d.firstChild;$!=null;$=$.nextSibling){var te=$.nodeType;(te===1||te===3||te===4||te===9||te===11)&&(I+=this.stringForNode($))}return I},Ge.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new nr(this.nodes[0]);for(var d=1;d<this.nodes.length;d+=1)this.tree.add(this.nodes[d])}return this.tree},Ge.prototype.first=function(){var d=this.buildTree();if(d==null)return null;for(;d.left!=null;)d=d.left;return d.node},Ge.prototype.add=function(d){for(var I=0;I<this.nodes.length;I+=1)if(d===this.nodes[I])return;this.tree=null,this.nodes.push(d),this.size+=1},Ge.prototype.addArray=function(d){var I=this;t(function($){I.add($)},d)},Ge.prototype.toArray=function(){var d=[];return this.toArrayRec(this.buildTree(),d),d},Ge.prototype.toArrayRec=function(d,I){d!=null&&(this.toArrayRec(d.left,I),I.push(d.node),this.toArrayRec(d.right,I))},Ge.prototype.toUnsortedArray=function(){return this.nodes.slice()},Ge.prototype.compareWithString=function(d,I){for(var $=this.toUnsortedArray(),te=0;te<$.length;te++){var ie=$[te],X=new Re(this.stringForNode(ie)),nt=I(X,d);if(nt.booleanValue())return nt}return new je(!1)},Ge.prototype.compareWithNumber=function(d,I){for(var $=this.toUnsortedArray(),te=0;te<$.length;te++){var ie=$[te],X=new xe(this.stringForNode(ie)),nt=I(X,d);if(nt.booleanValue())return nt}return new je(!1)},Ge.prototype.compareWithBoolean=function(d,I){return I(this.bool(),d)},Ge.prototype.compareWithNodeSet=function(d,I){for(var $=this.toUnsortedArray(),te=o(function(kt,Wt){return I(Wt,kt)},"oInvert"),ie=0;ie<$.length;ie++){var X=new Re(this.stringForNode($[ie])),nt=d.compareWithString(X,te);if(nt.booleanValue())return nt}return new je(!1)},Ge.compareWith=e(function(d,I){return Ze.instance_of(I,Re)?this.compareWithString(I,d):Ze.instance_of(I,xe)?this.compareWithNumber(I,d):Ze.instance_of(I,je)?this.compareWithBoolean(I,d):this.compareWithNodeSet(I,d)}),Ge.prototype.equals=Ge.compareWith(Xe.equals),Ge.prototype.notequal=Ge.compareWith(Xe.notequal),Ge.prototype.lessthan=Ge.compareWith(Xe.lessthan),Ge.prototype.greaterthan=Ge.compareWith(Xe.greaterthan),Ge.prototype.lessthanorequal=Ge.compareWith(Xe.lessthanorequal),Ge.prototype.greaterthanorequal=Ge.compareWith(Xe.greaterthanorequal),Ge.prototype.union=function(d){var I=new Ge;return I.addArray(this.toUnsortedArray()),I.addArray(d.toUnsortedArray()),I},Ur.prototype=new Object,Ur.prototype.constructor=Ur,Ur.superclass=Object.prototype;function Ur(d,I,$){this.isXPathNamespace=!0,this.ownerDocument=$.ownerDocument,this.nodeName="#namespace",this.prefix=d,this.localName=d,this.namespaceURI=I,this.nodeValue=I,this.ownerElement=$,this.nodeType=Ur.XPATH_NAMESPACE_NODE}o(Ur,"XPathNamespace"),Ur.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},on.prototype=new Object,on.prototype.constructor=on,on.superclass=Object.prototype;function on(d,I,$){this.variableResolver=d??new $n,this.namespaceResolver=I??new ns,this.functionResolver=$??new ms}o(on,"XPathContext"),on.prototype.extend=function(d){return y(new on,this,d)},$n.prototype=new Object,$n.prototype.constructor=$n,$n.superclass=Object.prototype;function $n(){}o($n,"VariableResolver"),$n.prototype.getVariable=function(d,I){return null},ms.prototype=new Object,ms.prototype.constructor=ms,ms.superclass=Object.prototype;function ms(d){this.thisArg=d??pt,this.functions=new Object,this.addStandardFunctions()}o(ms,"FunctionResolver"),ms.prototype.addStandardFunctions=function(){this.functions["{}last"]=pt.last,this.functions["{}position"]=pt.position,this.functions["{}count"]=pt.count,this.functions["{}id"]=pt.id,this.functions["{}local-name"]=pt.localName,this.functions["{}namespace-uri"]=pt.namespaceURI,this.functions["{}name"]=pt.name,this.functions["{}string"]=pt.string,this.functions["{}concat"]=pt.concat,this.functions["{}starts-with"]=pt.startsWith,this.functions["{}contains"]=pt.contains,this.functions["{}substring-before"]=pt.substringBefore,this.functions["{}substring-after"]=pt.substringAfter,this.functions["{}substring"]=pt.substring,this.functions["{}string-length"]=pt.stringLength,this.functions["{}normalize-space"]=pt.normalizeSpace,this.functions["{}translate"]=pt.translate,this.functions["{}boolean"]=pt.boolean_,this.functions["{}not"]=pt.not,this.functions["{}true"]=pt.true_,this.functions["{}false"]=pt.false_,this.functions["{}lang"]=pt.lang,this.functions["{}number"]=pt.number,this.functions["{}sum"]=pt.sum,this.functions["{}floor"]=pt.floor,this.functions["{}ceiling"]=pt.ceiling,this.functions["{}round"]=pt.round},ms.prototype.addFunction=function(d,I,$){this.functions["{"+d+"}"+I]=$},ms.getFunctionFromContext=function(d,I){var $=Ze.resolveQName(d,I.namespaceResolver,I.contextNode,!1);if($[0]===null)throw new Error("Cannot resolve QName "+name);return I.functionResolver.getFunction($[1],$[0])},ms.prototype.getFunction=function(d,I){return this.functions["{"+I+"}"+d]},ns.prototype=new Object,ns.prototype.constructor=ns,ns.superclass=Object.prototype;function ns(){}o(ns,"NamespaceResolver"),ns.prototype.getNamespace=function(d,I){if(d=="xml")return b.XML_NAMESPACE_URI;if(d=="xmlns")return b.XMLNS_NAMESPACE_URI;for(I.nodeType==S.DOCUMENT_NODE?I=I.documentElement:I.nodeType==S.ATTRIBUTE_NODE?I=we.getOwnerElement(I):I.nodeType!=S.ELEMENT_NODE&&(I=I.parentNode);I!=null&&I.nodeType==S.ELEMENT_NODE;){for(var $=I.attributes,te=0;te<$.length;te++){var ie=$.item(te),X=ie.name||ie.nodeName;if(X==="xmlns"&&d===""||X==="xmlns:"+d)return String(ie.value||ie.nodeValue)}I=I.parentNode}return null};var pt=new Object;pt.last=function(d){if(arguments.length!=1)throw new Error("Function last expects ()");return new xe(d.contextSize)},pt.position=function(d){if(arguments.length!=1)throw new Error("Function position expects ()");return new xe(d.contextPosition)},pt.count=function(){var d=arguments[0],I;if(arguments.length!=2||!Ze.instance_of(I=arguments[1].evaluate(d),Ge))throw new Error("Function count expects (node-set)");return new xe(I.size)},pt.id=function(){var d=arguments[0],I;if(arguments.length!=2)throw new Error("Function id expects (object)");I=arguments[1].evaluate(d),Ze.instance_of(I,Ge)?I=I.toArray().join(" "):I=I.stringValue();for(var $=I.split(/[\x0d\x0a\x09\x20]+/),te=0,ie=new Ge,X=d.contextNode.nodeType==S.DOCUMENT_NODE?d.contextNode:d.contextNode.ownerDocument,nt=0;nt<$.length;nt++){var kt;X.getElementById?kt=X.getElementById($[nt]):kt=Ze.getElementById(X,$[nt]),kt!=null&&(ie.add(kt),te++)}return ie},pt.localName=function(d,I){var $;if(arguments.length==1)$=d.contextNode;else if(arguments.length==2)$=I.evaluate(d).first();else throw new Error("Function local-name expects (node-set?)");return $==null?new Re(""):new Re($.localName||$.baseName||$.target||$.nodeName||"")},pt.namespaceURI=function(){var d=arguments[0],I;if(arguments.length==1)I=d.contextNode;else if(arguments.length==2)I=arguments[1].evaluate(d).first();else throw new Error("Function namespace-uri expects (node-set?)");return I==null?new Re(""):new Re(I.namespaceURI)},pt.name=function(){var d=arguments[0],I;if(arguments.length==1)I=d.contextNode;else if(arguments.length==2)I=arguments[1].evaluate(d).first();else throw new Error("Function name expects (node-set?)");return I==null?new Re(""):I.nodeType==S.ELEMENT_NODE?new Re(I.nodeName):I.nodeType==S.ATTRIBUTE_NODE?new Re(I.name||I.nodeName):I.nodeType===S.PROCESSING_INSTRUCTION_NODE?new Re(I.target||I.nodeName):I.localName==null?new Re(""):new Re(I.localName)},pt.string=function(){var d=arguments[0];if(arguments.length==1)return new Re(Ge.prototype.stringForNode(d.contextNode));if(arguments.length==2)return arguments[1].evaluate(d).string();throw new Error("Function string expects (object?)")},pt.concat=function(d){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var I="",$=1;$<arguments.length;$++)I+=arguments[$].evaluate(d).stringValue();return new Re(I)},pt.startsWith=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new je(I.substring(0,$.length)==$)},pt.contains=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new je(I.indexOf($)!==-1)},pt.substringBefore=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new Re(I.substring(0,I.indexOf($)))},pt.substringAfter=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();if($.length==0)return new Re(I);var te=I.indexOf($);return te==-1?new Re(""):new Re(I.substring(te+$.length))},pt.substring=function(){var d=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var I=arguments[1].evaluate(d).stringValue(),$=Math.round(arguments[2].evaluate(d).numberValue())-1,te=arguments.length==4?$+Math.round(arguments[3].evaluate(d).numberValue()):void 0;return new Re(I.substring($,te))},pt.stringLength=function(){var d=arguments[0],I;if(arguments.length==1)I=Ge.prototype.stringForNode(d.contextNode);else if(arguments.length==2)I=arguments[1].evaluate(d).stringValue();else throw new Error("Function string-length expects (string?)");return new xe(I.length)},pt.normalizeSpace=function(){var d=arguments[0],I;if(arguments.length==1)I=Ge.prototype.stringForNode(d.contextNode);else if(arguments.length==2)I=arguments[1].evaluate(d).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var $=0,te=I.length-1;Ze.isSpace(I.charCodeAt(te));)te--;for(var ie="";$<=te&&Ze.isSpace(I.charCodeAt($));)$++;for(;$<=te;)if(Ze.isSpace(I.charCodeAt($)))for(ie+=" ";$<=te&&Ze.isSpace(I.charCodeAt($));)$++;else ie+=I.charAt($),$++;return new Re(ie)},pt.translate=function(d,I,$,te){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var ie=I.evaluate(d).stringValue(),X=$.evaluate(d).stringValue(),nt=te.evaluate(d).stringValue(),kt=n(function(et,Dt,_n){return Dt in et||(et[Dt]=_n>nt.length?"":nt[_n]),et},{},X),Wt=f("",s(function(et){return et in kt?kt[et]:et},ie));return new Re(Wt)},pt.boolean_=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(d).bool()},pt.not=function(d,I){if(arguments.length!=2)throw new Error("Function not expects (object)");return I.evaluate(d).bool().not()},pt.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return je.true_},pt.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return je.false_},pt.lang=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var I,$=d.contextNode;$!=null&&$.nodeType!=S.DOCUMENT_NODE;$=$.parentNode){var te=$.getAttributeNS(b.XML_NAMESPACE_URI,"lang");if(te!=null){I=String(te);break}}if(I==null)return je.false_;var ie=arguments[1].evaluate(d).stringValue();return new je(I.substring(0,ie.length)==ie&&(I.length==ie.length||I.charAt(ie.length)=="-"))},pt.number=function(){var d=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new xe(Ge.prototype.stringForNode(d.contextNode)):arguments[1].evaluate(d).number()},pt.sum=function(){var d=arguments[0],I;if(arguments.length!=2||!Ze.instance_of(I=arguments[1].evaluate(d),Ge))throw new Error("Function sum expects (node-set)");I=I.toUnsortedArray();for(var $=0,te=0;te<I.length;te++)$+=new xe(Ge.prototype.stringForNode(I[te])).numberValue();return new xe($)},pt.floor=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new xe(Math.floor(arguments[1].evaluate(d).numberValue()))},pt.ceiling=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new xe(Math.ceil(arguments[1].evaluate(d).numberValue()))},pt.round=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new xe(Math.round(arguments[1].evaluate(d).numberValue()))};var Ze=new Object;Ze.isAttribute=function(d){return d&&(d.nodeType===S.ATTRIBUTE_NODE||d.ownerElement)},Ze.splitQName=function(d){var I=d.indexOf(":");return I==-1?[null,d]:[d.substring(0,I),d.substring(I+1)]},Ze.resolveQName=function(d,I,$,te){var ie=Ze.splitQName(d);return ie[0]!=null?ie[0]=I.getNamespace(ie[0],$):te?(ie[0]=I.getNamespace("",$),ie[0]==null&&(ie[0]="")):ie[0]="",ie},Ze.isSpace=function(d){return d==9||d==13||d==10||d==32},Ze.isLetter=function(d){return d>=65&&d<=90||d>=97&&d<=122||d>=192&&d<=214||d>=216&&d<=246||d>=248&&d<=255||d>=256&&d<=305||d>=308&&d<=318||d>=321&&d<=328||d>=330&&d<=382||d>=384&&d<=451||d>=461&&d<=496||d>=500&&d<=501||d>=506&&d<=535||d>=592&&d<=680||d>=699&&d<=705||d==902||d>=904&&d<=906||d==908||d>=910&&d<=929||d>=931&&d<=974||d>=976&&d<=982||d==986||d==988||d==990||d==992||d>=994&&d<=1011||d>=1025&&d<=1036||d>=1038&&d<=1103||d>=1105&&d<=1116||d>=1118&&d<=1153||d>=1168&&d<=1220||d>=1223&&d<=1224||d>=1227&&d<=1228||d>=1232&&d<=1259||d>=1262&&d<=1269||d>=1272&&d<=1273||d>=1329&&d<=1366||d==1369||d>=1377&&d<=1414||d>=1488&&d<=1514||d>=1520&&d<=1522||d>=1569&&d<=1594||d>=1601&&d<=1610||d>=1649&&d<=1719||d>=1722&&d<=1726||d>=1728&&d<=1742||d>=1744&&d<=1747||d==1749||d>=1765&&d<=1766||d>=2309&&d<=2361||d==2365||d>=2392&&d<=2401||d>=2437&&d<=2444||d>=2447&&d<=2448||d>=2451&&d<=2472||d>=2474&&d<=2480||d==2482||d>=2486&&d<=2489||d>=2524&&d<=2525||d>=2527&&d<=2529||d>=2544&&d<=2545||d>=2565&&d<=2570||d>=2575&&d<=2576||d>=2579&&d<=2600||d>=2602&&d<=2608||d>=2610&&d<=2611||d>=2613&&d<=2614||d>=2616&&d<=2617||d>=2649&&d<=2652||d==2654||d>=2674&&d<=2676||d>=2693&&d<=2699||d==2701||d>=2703&&d<=2705||d>=2707&&d<=2728||d>=2730&&d<=2736||d>=2738&&d<=2739||d>=2741&&d<=2745||d==2749||d==2784||d>=2821&&d<=2828||d>=2831&&d<=2832||d>=2835&&d<=2856||d>=2858&&d<=2864||d>=2866&&d<=2867||d>=2870&&d<=2873||d==2877||d>=2908&&d<=2909||d>=2911&&d<=2913||d>=2949&&d<=2954||d>=2958&&d<=2960||d>=2962&&d<=2965||d>=2969&&d<=2970||d==2972||d>=2974&&d<=2975||d>=2979&&d<=2980||d>=2984&&d<=2986||d>=2990&&d<=2997||d>=2999&&d<=3001||d>=3077&&d<=3084||d>=3086&&d<=3088||d>=3090&&d<=3112||d>=3114&&d<=3123||d>=3125&&d<=3129||d>=3168&&d<=3169||d>=3205&&d<=3212||d>=3214&&d<=3216||d>=3218&&d<=3240||d>=3242&&d<=3251||d>=3253&&d<=3257||d==3294||d>=3296&&d<=3297||d>=3333&&d<=3340||d>=3342&&d<=3344||d>=3346&&d<=3368||d>=3370&&d<=3385||d>=3424&&d<=3425||d>=3585&&d<=3630||d==3632||d>=3634&&d<=3635||d>=3648&&d<=3653||d>=3713&&d<=3714||d==3716||d>=3719&&d<=3720||d==3722||d==3725||d>=3732&&d<=3735||d>=3737&&d<=3743||d>=3745&&d<=3747||d==3749||d==3751||d>=3754&&d<=3755||d>=3757&&d<=3758||d==3760||d>=3762&&d<=3763||d==3773||d>=3776&&d<=3780||d>=3904&&d<=3911||d>=3913&&d<=3945||d>=4256&&d<=4293||d>=4304&&d<=4342||d==4352||d>=4354&&d<=4355||d>=4357&&d<=4359||d==4361||d>=4363&&d<=4364||d>=4366&&d<=4370||d==4412||d==4414||d==4416||d==4428||d==4430||d==4432||d>=4436&&d<=4437||d==4441||d>=4447&&d<=4449||d==4451||d==4453||d==4455||d==4457||d>=4461&&d<=4462||d>=4466&&d<=4467||d==4469||d==4510||d==4520||d==4523||d>=4526&&d<=4527||d>=4535&&d<=4536||d==4538||d>=4540&&d<=4546||d==4587||d==4592||d==4601||d>=7680&&d<=7835||d>=7840&&d<=7929||d>=7936&&d<=7957||d>=7960&&d<=7965||d>=7968&&d<=8005||d>=8008&&d<=8013||d>=8016&&d<=8023||d==8025||d==8027||d==8029||d>=8031&&d<=8061||d>=8064&&d<=8116||d>=8118&&d<=8124||d==8126||d>=8130&&d<=8132||d>=8134&&d<=8140||d>=8144&&d<=8147||d>=8150&&d<=8155||d>=8160&&d<=8172||d>=8178&&d<=8180||d>=8182&&d<=8188||d==8486||d>=8490&&d<=8491||d==8494||d>=8576&&d<=8578||d>=12353&&d<=12436||d>=12449&&d<=12538||d>=12549&&d<=12588||d>=44032&&d<=55203||d>=19968&&d<=40869||d==12295||d>=12321&&d<=12329},Ze.isNCNameChar=function(d){return d>=48&&d<=57||d>=1632&&d<=1641||d>=1776&&d<=1785||d>=2406&&d<=2415||d>=2534&&d<=2543||d>=2662&&d<=2671||d>=2790&&d<=2799||d>=2918&&d<=2927||d>=3047&&d<=3055||d>=3174&&d<=3183||d>=3302&&d<=3311||d>=3430&&d<=3439||d>=3664&&d<=3673||d>=3792&&d<=3801||d>=3872&&d<=3881||d==46||d==45||d==95||Ze.isLetter(d)||d>=768&&d<=837||d>=864&&d<=865||d>=1155&&d<=1158||d>=1425&&d<=1441||d>=1443&&d<=1465||d>=1467&&d<=1469||d==1471||d>=1473&&d<=1474||d==1476||d>=1611&&d<=1618||d==1648||d>=1750&&d<=1756||d>=1757&&d<=1759||d>=1760&&d<=1764||d>=1767&&d<=1768||d>=1770&&d<=1773||d>=2305&&d<=2307||d==2364||d>=2366&&d<=2380||d==2381||d>=2385&&d<=2388||d>=2402&&d<=2403||d>=2433&&d<=2435||d==2492||d==2494||d==2495||d>=2496&&d<=2500||d>=2503&&d<=2504||d>=2507&&d<=2509||d==2519||d>=2530&&d<=2531||d==2562||d==2620||d==2622||d==2623||d>=2624&&d<=2626||d>=2631&&d<=2632||d>=2635&&d<=2637||d>=2672&&d<=2673||d>=2689&&d<=2691||d==2748||d>=2750&&d<=2757||d>=2759&&d<=2761||d>=2763&&d<=2765||d>=2817&&d<=2819||d==2876||d>=2878&&d<=2883||d>=2887&&d<=2888||d>=2891&&d<=2893||d>=2902&&d<=2903||d>=2946&&d<=2947||d>=3006&&d<=3010||d>=3014&&d<=3016||d>=3018&&d<=3021||d==3031||d>=3073&&d<=3075||d>=3134&&d<=3140||d>=3142&&d<=3144||d>=3146&&d<=3149||d>=3157&&d<=3158||d>=3202&&d<=3203||d>=3262&&d<=3268||d>=3270&&d<=3272||d>=3274&&d<=3277||d>=3285&&d<=3286||d>=3330&&d<=3331||d>=3390&&d<=3395||d>=3398&&d<=3400||d>=3402&&d<=3405||d==3415||d==3633||d>=3636&&d<=3642||d>=3655&&d<=3662||d==3761||d>=3764&&d<=3769||d>=3771&&d<=3772||d>=3784&&d<=3789||d>=3864&&d<=3865||d==3893||d==3895||d==3897||d==3902||d==3903||d>=3953&&d<=3972||d>=3974&&d<=3979||d>=3984&&d<=3989||d==3991||d>=3993&&d<=4013||d>=4017&&d<=4023||d==4025||d>=8400&&d<=8412||d==8417||d>=12330&&d<=12335||d==12441||d==12442||d==183||d==720||d==721||d==903||d==1600||d==3654||d==3782||d==12293||d>=12337&&d<=12341||d>=12445&&d<=12446||d>=12540&&d<=12542},Ze.coalesceText=function(d){for(var I=d.firstChild;I!=null;I=I.nextSibling)if(I.nodeType==S.TEXT_NODE||I.nodeType==S.CDATA_SECTION_NODE){var $=I.nodeValue,te=I;for(I=I.nextSibling;I!=null&&(I.nodeType==S.TEXT_NODE||I.nodeType==S.CDATA_SECTION_NODE);){$+=I.nodeValue;var ie=I;I=I.nextSibling,ie.parentNode.removeChild(ie)}if(te.nodeType==S.CDATA_SECTION_NODE){var X=te.parentNode;if(te.nextSibling==null)X.removeChild(te),X.appendChild(X.ownerDocument.createTextNode($));else{var nt=te.nextSibling;X.removeChild(te),X.insertBefore(X.ownerDocument.createTextNode($),nt)}}else te.nodeValue=$;if(I==null)break}else I.nodeType==S.ELEMENT_NODE&&Ze.coalesceText(I)},Ze.instance_of=function(d,I){for(;d!=null;){if(d.constructor===I)return!0;if(d===Object)return!1;d=d.constructor.superclass}return!1},Ze.getElementById=function(d,I){if(d.nodeType==S.ELEMENT_NODE&&(d.getAttribute("id")==I||d.getAttributeNS(null,"id")==I))return d;for(var $=d.firstChild;$!=null;$=$.nextSibling){var te=Ze.getElementById($,I);if(te!=null)return te}return null};var Dn=(function(){function d($,te){var ie=te?": "+te.toString():"";switch($){case I.INVALID_EXPRESSION_ERR:return"Invalid expression"+ie;case I.TYPE_ERR:return"Type error"+ie}return null}o(d,"getMessage");function I($,te,ie){var X=Error.call(this,d($,te)||ie);return X.code=$,X.exception=te,X}return o(I,"XPathException"),I.prototype=Object.create(Error.prototype),I.prototype.constructor=I,I.superclass=Error,I.prototype.toString=function(){return this.message},I.fromMessage=function($,te){return new I(null,te,$)},I.INVALID_EXPRESSION_ERR=51,I.TYPE_ERR=52,I})();ss.prototype={},ss.prototype.constructor=ss,ss.superclass=Object.prototype;function ss(d,I,$){this.xpath=$.parse(d),this.context=new on,this.context.namespaceResolver=new aa(I)}o(ss,"XPathExpression"),ss.getOwnerDocument=function(d){return d.nodeType===S.DOCUMENT_NODE?d:d.ownerDocument},ss.detectHtmlDom=function(d){if(!d)return!1;var I=ss.getOwnerDocument(d);try{return I.implementation.hasFeature("HTML","2.0")}catch{return!0}},ss.prototype.evaluate=function(d,I,$){this.context.expressionContextNode=d,this.context.caseInsensitive=ss.detectHtmlDom(d);var te=this.xpath.evaluate(this.context);return new Rt(te,I)},aa.prototype={},aa.prototype.constructor=aa,aa.superclass=Object.prototype;function aa(d){this.xpathNSResolver=d}o(aa,"XPathNSResolverWrapper"),aa.prototype.getNamespace=function(d,I){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(d)},oa.prototype={},oa.prototype.constructor=oa,oa.superclass=Object.prototype;function oa(d){this.node=d,this.namespaceResolver=new ns}o(oa,"NodeXPathNSResolver"),oa.prototype.lookupNamespaceURI=function(d){return this.namespaceResolver.getNamespace(d,this.node)},Rt.prototype={},Rt.prototype.constructor=Rt,Rt.superclass=Object.prototype;function Rt(d,I){switch(I==Rt.ANY_TYPE&&(d.constructor===Re?I=Rt.STRING_TYPE:d.constructor===xe?I=Rt.NUMBER_TYPE:d.constructor===je?I=Rt.BOOLEAN_TYPE:d.constructor===Ge&&(I=Rt.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=I,I){case Rt.NUMBER_TYPE:this.numberValue=d.numberValue();return;case Rt.STRING_TYPE:this.stringValue=d.stringValue();return;case Rt.BOOLEAN_TYPE:this.booleanValue=d.booleanValue();return;case Rt.ANY_UNORDERED_NODE_TYPE:case Rt.FIRST_ORDERED_NODE_TYPE:if(d.constructor===Ge){this.singleNodeValue=d.first();return}break;case Rt.UNORDERED_NODE_ITERATOR_TYPE:case Rt.ORDERED_NODE_ITERATOR_TYPE:if(d.constructor===Ge){this.invalidIteratorState=!1,this.nodes=d.toArray(),this.iteratorIndex=0;return}break;case Rt.UNORDERED_NODE_SNAPSHOT_TYPE:case Rt.ORDERED_NODE_SNAPSHOT_TYPE:if(d.constructor===Ge){this.nodes=d.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new Dn(Dn.TYPE_ERR)}o(Rt,"XPathResult"),Rt.prototype.iterateNext=function(){if(this.resultType!=Rt.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=Rt.ORDERED_NODE_ITERATOR_TYPE)throw new Dn(Dn.TYPE_ERR);return this.nodes[this.iteratorIndex++]},Rt.prototype.snapshotItem=function(d){if(this.resultType!=Rt.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=Rt.ORDERED_NODE_SNAPSHOT_TYPE)throw new Dn(Dn.TYPE_ERR);return this.nodes[d]},Rt.ANY_TYPE=0,Rt.NUMBER_TYPE=1,Rt.STRING_TYPE=2,Rt.BOOLEAN_TYPE=3,Rt.UNORDERED_NODE_ITERATOR_TYPE=4,Rt.ORDERED_NODE_ITERATOR_TYPE=5,Rt.UNORDERED_NODE_SNAPSHOT_TYPE=6,Rt.ORDERED_NODE_SNAPSHOT_TYPE=7,Rt.ANY_UNORDERED_NODE_TYPE=8,Rt.FIRST_ORDERED_NODE_TYPE=9;function yh(d,I){d.createExpression=function($,te){try{return new ss($,te,I)}catch(ie){throw new Dn(Dn.INVALID_EXPRESSION_ERR,ie)}},d.createNSResolver=function($){return new oa($)},d.evaluate=function($,te,ie,X,nt){if(X<0||X>9)throw{code:0,toString:o(function(){return"Request type not supported"},"toString")};return d.createExpression($,ie,I).evaluate(te,X,nt)}}o(yh,"installDOM3XPathSupport");try{var vh=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(vh=!1)}catch{}vh&&yh(document,new E)}catch{}yh(r,new E),(function(){var d=new E,I=new ns,$=new ms,te=new $n;function ie(qe){return{getNamespace:o(function(Zt,Xn){var Oi=qe(Zt,Xn);return Oi||I.getNamespace(Zt,Xn)},"getNamespace")}}o(ie,"makeNSResolverFromFunction");function X(qe){return ie(qe.getNamespace.bind(qe))}o(X,"makeNSResolverFromObject");function nt(qe){return ie(function(Zt){return qe[Zt]})}o(nt,"makeNSResolverFromMap");function kt(qe){return qe&&typeof qe.getNamespace=="function"?X(qe):typeof qe=="function"?ie(qe):typeof qe=="object"?nt(qe):I}o(kt,"makeNSResolver");function Wt(qe){if(qe===null||typeof qe>"u"||qe instanceof Re||qe instanceof je||qe instanceof xe||qe instanceof Ge)return qe;switch(typeof qe){case"string":return new Re(qe);case"boolean":return new je(qe);case"number":return new xe(qe)}var Zt=new Ge;return Zt.addArray([].concat(qe)),Zt}o(Wt,"convertValue");function et(qe){return function(Zt){var Xn=Array.prototype.slice.call(arguments,1).map(function(m2){return m2.evaluate(Zt)}),Oi=qe.apply(this,[].concat(Zt,Xn));return Wt(Oi)}}o(et,"makeEvaluator");function Dt(qe){return{getFunction:o(function(Zt,Xn){var Oi=qe(Zt,Xn);return Oi?et(Oi):$.getFunction(Zt,Xn)},"getFunction")}}o(Dt,"makeFunctionResolverFromFunction");function _n(qe){return Dt(qe.getFunction.bind(qe))}o(_n,"makeFunctionResolverFromObject");function ti(qe){return Dt(function(Zt){return qe[Zt]})}o(ti,"makeFunctionResolverFromMap");function or(qe){return qe&&typeof qe.getFunction=="function"?_n(qe):typeof qe=="function"?Dt(qe):typeof qe=="object"?ti(qe):$}o(or,"makeFunctionResolver");function ua(qe){return{getVariable:o(function(Zt,Xn){var Oi=qe(Zt,Xn);return Wt(Oi)},"getVariable")}}o(ua,"makeVariableResolverFromFunction");function Y0(qe){if(qe){if(typeof qe.getVariable=="function")return ua(qe.getVariable.bind(qe));if(typeof qe=="function")return ua(qe);if(typeof qe=="object")return ua(function(Zt){return qe[Zt]})}return te}o(Y0,"makeVariableResolver");function Cv(qe,Zt,Xn){qe in Xn&&(Zt[qe]=Xn[qe])}o(Cv,"copyIfPresent");function f2(qe){var Zt=new on;return qe?(Zt.namespaceResolver=kt(qe.namespaces),Zt.functionResolver=or(qe.functions),Zt.variableResolver=Y0(qe.variables),Zt.expressionContextNode=qe.node,Cv("allowAnyNamespaceForNoPrefix",Zt,qe),Cv("isHtml",Zt,qe)):Zt.namespaceResolver=I,Zt}o(f2,"makeContext");function h2(qe,Zt){var Xn=f2(Zt);return qe.evaluate(Xn)}o(h2,"evaluate");var p2={evaluate:o(function(qe){return h2(this.expression,qe)},"evaluate"),evaluateNumber:o(function(qe){return this.evaluate(qe).numberValue()},"evaluateNumber"),evaluateString:o(function(qe){return this.evaluate(qe).stringValue()},"evaluateString"),evaluateBoolean:o(function(qe){return this.evaluate(qe).booleanValue()},"evaluateBoolean"),evaluateNodeSet:o(function(qe){return this.evaluate(qe).nodeset()},"evaluateNodeSet"),select:o(function(qe){return this.evaluateNodeSet(qe).toArray()},"select"),select1:o(function(qe){return this.select(qe)[0]},"select1")};function d2(qe){var Zt=d.parse(qe);return Object.create(p2,{expression:{value:Zt}})}o(d2,"parse"),r.parse=d2})(),y(r,{XPath:b,XPathParser:E,XPathResult:Rt,Step:O,PathExpr:we,NodeTest:_,LocationPath:lt,OrOperation:F,AndOperation:R,BarOperation:be,EqualsOperation:H,NotEqualOperation:q,LessThanOperation:K,GreaterThanOperation:G,LessThanOrEqualOperation:he,GreaterThanOrEqualOperation:le,PlusOperation:oe,MinusOperation:Z,MultiplyOperation:fe,DivOperation:Se,ModOperation:Ke,UnaryMinusOperation:x,FunctionCall:J,VariableReference:ne,XPathContext:on,XNodeSet:Ge,XBoolean:je,XString:Re,XNumber:xe,NamespaceResolver:ns,FunctionResolver:ms,VariableResolver:$n,Utilities:Ze}),r.select=function(d,I,$){return r.selectWithResolver(d,I,null,$)},r.useNamespaces=function(d){var I={mappings:d||{},lookupNamespaceURI:o(function($){return this.mappings[$]},"lookupNamespaceURI")};return function($,te,ie){return r.selectWithResolver($,te,I,ie)}},r.selectWithResolver=function(d,I,$,te){var ie=new ss(d,$,new E),X=Rt.ANY_TYPE,nt=ie.evaluate(I,X,null);return nt.resultType==Rt.STRING_TYPE?nt=nt.stringValue:nt.resultType==Rt.NUMBER_TYPE?nt=nt.numberValue:nt.resultType==Rt.BOOLEAN_TYPE?nt=nt.booleanValue:(nt=nt.nodes,te&&(nt=nt[0])),nt},r.select1=function(d,I){return r.select(d,I,!0)};var tc=o(function(d){return d&&typeof d.nodeType=="number"&&Number.isInteger(d.nodeType)&&d.nodeType>=1&&d.nodeType<=11&&typeof d.nodeName=="string"},"isNodeLike"),z0=o(function(d){return Array.isArray(d)&&d.every(tc)},"isArrayOfNodes"),Vs=o(function(d){return function(I){return tc(I)&&I.nodeType===d}},"isNodeOfType");y(r,{isNodeLike:tc,isArrayOfNodes:z0,isElement:Vs(S.ELEMENT_NODE),isAttribute:Vs(S.ATTRIBUTE_NODE),isTextNode:Vs(S.TEXT_NODE),isCDATASection:Vs(S.CDATA_SECTION_NODE),isProcessingInstruction:Vs(S.PROCESSING_INSTRUCTION_NODE),isComment:Vs(S.COMMENT_NODE),isDocumentNode:Vs(S.DOCUMENT_NODE),isDocumentTypeNode:Vs(S.DOCUMENT_TYPE_NODE),isDocumentFragment:Vs(S.DOCUMENT_FRAGMENT_NODE)})})(bZ)});var lp=ye(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.assertIsDocumentFragmentNode=It.assertIsDocumentTypeNode=It.assertIsDocumentNode=It.assertIsCommentNode=It.assertIsProcessingInstructionNode=It.assertIsCDATASectionNode=It.assertIsTextNode=It.assertIsAttributeNode=It.assertIsElementNode=It.isDocumentFragmentNode=It.isDocumentTypeNode=It.isDocumentNode=It.isCommentNode=It.isProcessingInstructionNode=It.isCDATASectionNode=It.isTextNode=It.isAttributeNode=It.isElementNode=It.assertIsArrayOfNodes=It.isArrayOfNodes=It.assertIsNodeLike=It.isNodeLike=It.NodeTypes=void 0;var Yr;(function(r){r[r.ELEMENT_NODE=1]="ELEMENT_NODE",r[r.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",r[r.TEXT_NODE=3]="TEXT_NODE",r[r.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",r[r.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",r[r.COMMENT_NODE=8]="COMMENT_NODE",r[r.DOCUMENT_NODE=9]="DOCUMENT_NODE",r[r.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",r[r.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(Yr||(It.NodeTypes=Yr={}));function xS(r){return r&&typeof r=="object"&&Number.isInteger(r.nodeType)&&r.nodeType>=1&&r.nodeType<=11&&typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.removeChild=="function"}o(xS,"isNodeLike");It.isNodeLike=xS;function xZ(r){if(!xS(r))throw new Error(`Value is not a Node-like object. Received: ${r}`)}o(xZ,"assertIsNodeLike");It.assertIsNodeLike=xZ;function sL(r){return Array.isArray(r)&&r.every(xS)}o(sL,"isArrayOfNodes");It.isArrayOfNodes=sL;function NZ(r){if(!sL(r))throw new Error("Value is not an array of Nodes")}o(NZ,"assertIsArrayOfNodes");It.assertIsArrayOfNodes=NZ;function Pa(r,e){return xS(e)&&e.nodeType===r}o(Pa,"isNodeOfType");function yo(r,e){let t=Object.keys(Yr).find(n=>Yr[n]===r);if(!Pa(r,e))throw new Error(`Value is not of type ${t}`)}o(yo,"assertIsNodeOfType");var TZ=o(r=>Pa(Yr.ELEMENT_NODE,r),"isElementNode");It.isElementNode=TZ;var IZ=o(r=>Pa(Yr.ATTRIBUTE_NODE,r),"isAttributeNode");It.isAttributeNode=IZ;var BZ=o(r=>Pa(Yr.TEXT_NODE,r),"isTextNode");It.isTextNode=BZ;var DZ=o(r=>Pa(Yr.CDATA_SECTION_NODE,r),"isCDATASectionNode");It.isCDATASectionNode=DZ;var _Z=o(r=>Pa(Yr.PROCESSING_INSTRUCTION_NODE,r),"isProcessingInstructionNode");It.isProcessingInstructionNode=_Z;var RZ=o(r=>Pa(Yr.COMMENT_NODE,r),"isCommentNode");It.isCommentNode=RZ;var PZ=o(r=>Pa(Yr.DOCUMENT_NODE,r),"isDocumentNode");It.isDocumentNode=PZ;var OZ=o(r=>Pa(Yr.DOCUMENT_TYPE_NODE,r),"isDocumentTypeNode");It.isDocumentTypeNode=OZ;var kZ=o(r=>Pa(Yr.DOCUMENT_FRAGMENT_NODE,r),"isDocumentFragmentNode");It.isDocumentFragmentNode=kZ;var LZ=o(r=>{yo(Yr.ELEMENT_NODE,r)},"assertIsElementNode");It.assertIsElementNode=LZ;var VZ=o(r=>yo(Yr.ATTRIBUTE_NODE,r),"assertIsAttributeNode");It.assertIsAttributeNode=VZ;var UZ=o(r=>yo(Yr.TEXT_NODE,r),"assertIsTextNode");It.assertIsTextNode=UZ;var MZ=o(r=>yo(Yr.CDATA_SECTION_NODE,r),"assertIsCDATASectionNode");It.assertIsCDATASectionNode=MZ;var jZ=o(r=>yo(Yr.PROCESSING_INSTRUCTION_NODE,r),"assertIsProcessingInstructionNode");It.assertIsProcessingInstructionNode=jZ;var FZ=o(r=>yo(Yr.COMMENT_NODE,r),"assertIsCommentNode");It.assertIsCommentNode=FZ;var qZ=o(r=>yo(Yr.DOCUMENT_NODE,r),"assertIsDocumentNode");It.assertIsDocumentNode=qZ;var HZ=o(r=>yo(Yr.DOCUMENT_TYPE_NODE,r),"assertIsDocumentTypeNode");It.assertIsDocumentTypeNode=HZ;var KZ=o(r=>yo(Yr.DOCUMENT_FRAGMENT_NODE,r),"assertIsDocumentFragmentNode");It.assertIsDocumentFragmentNode=KZ});var Fm=ye(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.validateDigestValue=cr.findAncestorNs=cr.derToPem=cr.pemToDer=cr.normalizePem=cr.BASE64_REGEX=cr.EXTRACT_X509_CERTS=cr.PEM_FORMAT_REGEX=cr.encodeSpecialCharactersInText=cr.encodeSpecialCharactersInAttribute=cr.findChilds=cr.findChildren=cr.findAttr=cr.isArrayHasLength=void 0;var $Z=bS(),BN=lp();function iL(r){return Array.isArray(r)&&r.length>0}o(iL,"isArrayHasLength");cr.isArrayHasLength=iL;function XZ(r,e,t){return r.localName===e&&(r.namespaceURI===t||t==null)}o(XZ,"attrEqualsExplicitly");function GZ(r,e,t,n){return r.localName===e&&(!r.namespaceURI&&n?.namespaceURI===t||t==null)}o(GZ,"attrEqualsImplicitly");function WZ(r,e,t){for(let n=0;n<r.attributes.length;n++){let s=r.attributes[n];if(XZ(s,e,t)||GZ(s,e,t,r))return s}return null}o(WZ,"findAttr");cr.findAttr=WZ;function aL(r,e,t){let n=r.documentElement??r,s=[];for(let i=0;i<n.childNodes.length;i++){let a=n.childNodes[i];BN.isElementNode(a)&&a.localName===e&&(a.namespaceURI===t||t==null)&&s.push(a)}return s}o(aL,"findChildren");cr.findChildren=aL;function JZ(r,e,t){return aL(r,e,t)}o(JZ,"findChilds");cr.findChilds=JZ;var zZ={"&":"&amp;","<":"&lt;",'"':"&quot;","\r":"&#xD;","\n":"&#xA;"," ":"&#x9;"},YZ={"&":"&amp;","<":"&lt;",">":"&gt;","\r":"&#xD;"};function QZ(r){return r.replace(/([&<"\r\n\t])/g,function(e,t){return zZ[t]})}o(QZ,"encodeSpecialCharactersInAttribute");cr.encodeSpecialCharactersInAttribute=QZ;function ZZ(r){return r.replace(/([&<>\r])/g,function(e,t){return YZ[t]})}o(ZZ,"encodeSpecialCharactersInText");cr.encodeSpecialCharactersInText=ZZ;cr.PEM_FORMAT_REGEX=new RegExp("^-----BEGIN [A-Z ]{1,48}-----([^-]*)-----END [A-Z ]{1,48}-----$","s");cr.EXTRACT_X509_CERTS=new RegExp("-----BEGIN CERTIFICATE-----[^-]*-----END CERTIFICATE-----","g");cr.BASE64_REGEX=new RegExp("^(?:[A-Za-z0-9\\+\\/]{4}\\n{0,1})*(?:[A-Za-z0-9\\+\\/]{2}==|[A-Za-z0-9\\+\\/]{3}=)?$","s");function IN(r){return`${(r.trim().replace(/(\r\n|\r)/g,`
55
+ `).match(/.{1,64}/g)??[]).join(`
56
+ `)}
57
+ `}o(IN,"normalizePem");cr.normalizePem=IN;function eee(r){if(!cr.PEM_FORMAT_REGEX.test(r.trim()))throw new Error("Invalid PEM format.");return Buffer.from(r.replace(/(\r\n|\r)/g,"").replace(/-----BEGIN [A-Z\x20]{1,48}-----\n?/,"").replace(/-----END [A-Z\x20]{1,48}-----\n?/,""),"base64")}o(eee,"pemToDer");cr.pemToDer=eee;function tee(r,e){let t=Buffer.isBuffer(r)?r.toString("base64").trim():r.replace(/(\r\n|\r)/g,"").trim();if(cr.PEM_FORMAT_REGEX.test(t))return IN(t);if(cr.BASE64_REGEX.test(t.replace(/ /g,""))){if(e==null)throw new Error("PEM label is required when DER is given.");let n=`-----BEGIN ${e}-----
58
+ ${t.replace(/ /g,"")}
59
+ -----END ${e}-----`;return IN(n)}throw new Error("Unknown DER format.")}o(tee,"derToPem");cr.derToPem=tee;function oL(r,e=[]){if(!BN.isElementNode(r.parentNode))return e;let t=r.parentNode;if(!t)return e;if(t.attributes&&t.attributes.length>0)for(let n=0;n<t.attributes.length;n++){let s=t.attributes[n];s&&s.nodeName&&s.nodeName.search(/^xmlns:?/)!==-1&&e.push({prefix:s.nodeName.replace(/^xmlns:?/,""),namespaceURI:s.nodeValue||""})}return oL(t,e)}o(oL,"collectAncestorNamespaces");function ree(r){let e=r.attributes;for(let t=0;t<e.length;t++){let n=e[t].nodeName;if(n.search(/^xmlns:?/)!==-1)return n.replace(/^xmlns:?/,"")}return r.prefix||""}o(ree,"findNSPrefix");function nee(r){return r.every(e=>BN.isElementNode(e))}o(nee,"isElementSubset");function see(r,e,t){if(e==null)return[];let n=$Z.selectWithResolver(e,r,t);if(!iL(n))return[];if(!nee(n))throw new Error("Document subset must be list of elements");let s=oL(n[0]),i=[];for(let l=0;l<s.length;l++){let f=!0;for(let h in i)if(i[h].prefix===s[l].prefix){f=!1;break}f&&i.push(s[l])}let a=[],u=ree(n[0]);for(let l of i)l.prefix!==u&&a.push(l);return a}o(see,"findAncestorNs");cr.findAncestorNs=see;function iee(r,e){let t=Buffer.from(r,"base64"),n=Buffer.from(e,"base64");if(typeof t.equals=="function")return t.equals(n);if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(iee,"validateDigestValue");cr.validateDigestValue=iee});var _N=ye(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.C14nCanonicalizationWithComments=cp.C14nCanonicalization=void 0;var NS=Fm(),DN=lp(),uL=class{static{o(this,"C14nCanonicalization")}constructor(){this.includeComments=!1,this.includeComments=!1}attrCompare(e,t){if(!e.namespaceURI&&t.namespaceURI)return-1;if(!t.namespaceURI&&e.namespaceURI)return 1;let n=e.namespaceURI+e.localName,s=t.namespaceURI+t.localName;return n===s?0:n<s?-1:1}nsCompare(e,t){let n=e.prefix,s=t.prefix;return n===s?0:n.localeCompare(s)}renderAttrs(e){let t,n,s=[];if(DN.isCommentNode(e))return this.renderComment(e);if(e.attributes)for(t=0;t<e.attributes.length;++t)n=e.attributes[t],n.name.indexOf("xmlns")!==0&&s.push(n);return s.sort(this.attrCompare),s.map(a=>` ${a.name}="${NS.encodeSpecialCharactersInAttribute(a.value)}"`).join("")}renderNs(e,t,n,s,i){let a,u,l=[],f=n,h=[],m=e.namespaceURI||"";if(e.prefix?t.indexOf(e.prefix)===-1&&(h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push(e.prefix)):n!==m&&(f=e.namespaceURI||"",l.push(' xmlns="',f,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)u=e.attributes[a],u.prefix==="xmlns"&&t.indexOf(u.localName)===-1&&(h.push({prefix:u.localName,namespaceURI:u.value}),t.push(u.localName)),u.prefix&&t.indexOf(u.prefix)===-1&&u.prefix!=="xmlns"&&u.prefix!=="xml"&&(h.push({prefix:u.prefix,namespaceURI:u.namespaceURI}),t.push(u.prefix));if(NS.isArrayHasLength(i))for(let g of i){let w=!1;for(let y of h)y.prefix===g.prefix&&y.namespaceURI===g.namespaceURI&&(w=!0);w||h.push(g)}return h.sort(this.nsCompare),l.push(...h.map(g=>g.prefix?` xmlns:${g.prefix}="${g.namespaceURI}"`:` xmlns="${g.namespaceURI}"`)),{rendered:l.join(""),newDefaultNs:f}}processInner(e,t,n,s,i){if(DN.isCommentNode(e))return this.renderComment(e);if(e.data)return NS.encodeSpecialCharactersInText(e.data);if(DN.isElementNode(e)){let a,u,l=this.renderNs(e,t,n,s,i),f=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)u=t.slice(0),f.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,s,[]));return f.push("</",e.tagName,">"),f.join("")}throw new Error(`Unable to canonicalize node type: ${e.nodeType}`)}renderComment(e){if(!this.includeComments)return"";let t=e.ownerDocument===e.parentNode,n=!1,s=!1;if(t){let l=e,f=e;for(;l!==null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;f!==null;){if(f===e.ownerDocument.documentElement){s=!0;break}f=f.previousSibling}}let i=s?`
60
+ `:"",a=n?`
61
+ `:"",u=NS.encodeSpecialCharactersInText(e.data);return`${i}<!--${u}-->${a}`}process(e,t){t=t||{};let n=t.defaultNs||"",s=t.defaultNsForPrefix||{},i=t.ancestorNamespaces||[],a=[];for(let l=0;l<i.length;l++)a.push(i[l].prefix);return this.processInner(e,a,n,s,i)}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}};cp.C14nCanonicalization=uL;var aee=class extends uL{static{o(this,"C14nCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"}};cp.C14nCanonicalizationWithComments=aee});var ON=ye(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.ExclusiveCanonicalizationWithComments=fp.ExclusiveCanonicalization=void 0;var xc=Fm(),RN=lp();function PN(r,e,t){let n=!1;return r.forEach(function(s){s.prefix===e&&s.namespaceURI===t&&(n=!0)}),n}o(PN,"isPrefixInScope");var lL=class{static{o(this,"ExclusiveCanonicalization")}constructor(){this.includeComments=!1,this.includeComments=!1}attrCompare(e,t){if(!e.namespaceURI&&t.namespaceURI)return-1;if(!t.namespaceURI&&e.namespaceURI)return 1;let n=e.namespaceURI+e.localName,s=t.namespaceURI+t.localName;return n===s?0:n<s?-1:1}nsCompare(e,t){let n=e.prefix,s=t.prefix;return n===s?0:n.localeCompare(s)}renderAttrs(e){let t,n,s=[],i=[];if(RN.isCommentNode(e))return this.renderComment(e);if(e.attributes)for(t=0;t<e.attributes.length;++t)n=e.attributes[t],n.name.indexOf("xmlns")!==0&&i.push(n);i.sort(this.attrCompare);for(n of i)s.push(" ",n.name,'="',xc.encodeSpecialCharactersInAttribute(n.value),'"');return s.join("")}renderNs(e,t,n,s,i){let a,u,l=[],f=n,h=[],m=e.namespaceURI||"";if(e.prefix?PN(t,e.prefix,e.namespaceURI||s[e.prefix])||(h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]})):n!==m&&(f=e.namespaceURI,l.push(' xmlns="',f,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)u=e.attributes[a],u.prefix&&!PN(t,u.localName,u.value)&&i.indexOf(u.localName)>=0&&(h.push({prefix:u.localName,namespaceURI:u.value}),t.push({prefix:u.localName,namespaceURI:u.value})),u.prefix&&!PN(t,u.prefix,u.namespaceURI)&&u.prefix!=="xmlns"&&u.prefix!=="xml"&&(h.push({prefix:u.prefix,namespaceURI:u.namespaceURI}),t.push({prefix:u.prefix,namespaceURI:u.namespaceURI}));h.sort(this.nsCompare);for(let g of h)l.push(" xmlns:",g.prefix,'="',g.namespaceURI,'"');return{rendered:l.join(""),newDefaultNs:f}}processInner(e,t,n,s,i){if(RN.isCommentNode(e))return this.renderComment(e);if(e.data)return xc.encodeSpecialCharactersInText(e.data);if(RN.isElementNode(e)){let a,u,l=this.renderNs(e,t,n,s,i),f=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)u=t.slice(0),f.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,s,i));return f.push("</",e.tagName,">"),f.join("")}throw new Error(`Unable to exclusive canonicalize node type: ${e.nodeType}`)}renderComment(e){if(!this.includeComments)return"";let t=e.ownerDocument===e.parentNode,n=!1,s=!1;if(t){let l=e,f=e;for(;l!=null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;f!=null;){if(f===e.ownerDocument.documentElement){s=!0;break}f=f.previousSibling}}let i=s?`
62
+ `:"",a=n?`
63
+ `:"",u=xc.encodeSpecialCharactersInText(e.data);return`${i}<!--${u}-->${a}`}process(e,t){t=t||{};let n=t.inclusiveNamespacesPrefixList||[],s=t.defaultNs||"",i=t.defaultNsForPrefix||{},a=t.ancestorNamespaces||[];if(!xc.isArrayHasLength(n)){let l=xc.findChildren(e,"CanonicalizationMethod");if(l.length!==0){let f=xc.findChildren(l[0],"InclusiveNamespaces");f.length!==0&&(n=(f[0].getAttribute("PrefixList")||"").split(" "))}}return xc.isArrayHasLength(n)&&n.forEach(function(l){a&&a.forEach(function(f){l===f.prefix&&e.setAttributeNS("http://www.w3.org/2000/xmlns/",`xmlns:${l}`,f.namespaceURI)})}),this.processInner(e,[],s,i,n)}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#"}};fp.ExclusiveCanonicalization=lL;var oee=class extends lL{static{o(this,"ExclusiveCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}};fp.ExclusiveCanonicalizationWithComments=oee});var qm=ye(hp=>{"use strict";function uee(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(Object.prototype.hasOwnProperty.call(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}o(uee,"find");function kN(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}o(kN,"freeze");function lee(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}o(lee,"assign");var cL=kN({HTML:"text/html",isHTML:o(function(r){return r===cL.HTML},"isHTML"),XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),fL=kN({HTML:"http://www.w3.org/1999/xhtml",isHTML:o(function(r){return r===fL.HTML},"isHTML"),SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});hp.assign=lee;hp.find=uee;hp.freeze=kN;hp.MIME_TYPE=cL;hp.NAMESPACE=fL});var XN=ye(Vu=>{"use strict";var wL=qm(),Oa=wL.find,Hm=wL.NAMESPACE;function cee(r){return r!==""}o(cee,"notEmptyString");function fee(r){return r?r.split(/[\t\n\f\r ]+/).filter(cee):[]}o(fee,"splitOnASCIIWhitespace");function hee(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}o(hee,"orderedSetReducer");function hL(r){if(!r)return[];var e=fee(r);return Object.keys(e.reduce(hee,{}))}o(hL,"toOrderedSet");function pee(r){return function(e){return r&&r.indexOf(e)!==-1}}o(pee,"arrayIncludes");function Xm(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}o(Xm,"copy");function Ns(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};var n=s;o(s,"t"),s.prototype=e.prototype,s=new s,Xm(t,s),r.prototype=t=s}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}o(Ns,"_extends");var Ts={},Si=Ts.ELEMENT_NODE=1,dp=Ts.ATTRIBUTE_NODE=2,TS=Ts.TEXT_NODE=3,SL=Ts.CDATA_SECTION_NODE=4,EL=Ts.ENTITY_REFERENCE_NODE=5,dee=Ts.ENTITY_NODE=6,AL=Ts.PROCESSING_INSTRUCTION_NODE=7,CL=Ts.COMMENT_NODE=8,bL=Ts.DOCUMENT_NODE=9,xL=Ts.DOCUMENT_TYPE_NODE=10,wo=Ts.DOCUMENT_FRAGMENT_NODE=11,mee=Ts.NOTATION_NODE=12,zn={},Nn={},Qhe=zn.INDEX_SIZE_ERR=(Nn[1]="Index size error",1),Zhe=zn.DOMSTRING_SIZE_ERR=(Nn[2]="DOMString size error",2),xs=zn.HIERARCHY_REQUEST_ERR=(Nn[3]="Hierarchy request error",3),epe=zn.WRONG_DOCUMENT_ERR=(Nn[4]="Wrong document",4),tpe=zn.INVALID_CHARACTER_ERR=(Nn[5]="Invalid character",5),rpe=zn.NO_DATA_ALLOWED_ERR=(Nn[6]="No data allowed",6),npe=zn.NO_MODIFICATION_ALLOWED_ERR=(Nn[7]="No modification allowed",7),NL=zn.NOT_FOUND_ERR=(Nn[8]="Not found",8),spe=zn.NOT_SUPPORTED_ERR=(Nn[9]="Not supported",9),pL=zn.INUSE_ATTRIBUTE_ERR=(Nn[10]="Attribute in use",10),ipe=zn.INVALID_STATE_ERR=(Nn[11]="Invalid state",11),ape=zn.SYNTAX_ERR=(Nn[12]="Syntax error",12),ope=zn.INVALID_MODIFICATION_ERR=(Nn[13]="Invalid modification",13),upe=zn.NAMESPACE_ERR=(Nn[14]="Invalid namespace",14),lpe=zn.INVALID_ACCESS_ERR=(Nn[15]="Invalid access",15);function rn(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Nn[r]),this.message=Nn[r],Error.captureStackTrace&&Error.captureStackTrace(this,rn);return t.code=r,e&&(this.message=this.message+": "+e),t}o(rn,"DOMException");rn.prototype=Error.prototype;Xm(zn,rn);function vo(){}o(vo,"NodeList");vo.prototype={length:0,item:o(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:o(function(r,e){for(var t=[],n=0;n<this.length;n++)pp(this[n],t,r,e);return t.join("")},"toString"),filter:o(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:o(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};function mp(r,e){this._node=r,this._refresh=e,UN(this)}o(mp,"LiveNodeList");function UN(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(UL(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];Xm(t,r),r._inc=e}}o(UN,"_updateLiveList");mp.prototype.item=function(r){return UN(this),this[r]||null};Ns(mp,vo);function IS(){}o(IS,"NamedNodeMap");function TL(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}o(TL,"_findNodeIndex");function dL(r,e,t,n){if(n?e[TL(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&DL(s,r,n),gee(s,r,t))}}o(dL,"_addNamedNode");function mL(r,e,t){var n=TL(e,t);if(n>=0){for(var s=e.length-1;n<s;)e[n]=e[++n];if(e.length=s,r){var i=r.ownerDocument;i&&(DL(i,r,t),t.ownerElement=null)}}else throw new rn(NL,new Error(r.tagName+"@"+t))}o(mL,"_removeNamedNode");IS.prototype={length:0,item:vo.prototype.item,getNamedItem:o(function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},"getNamedItem"),setNamedItem:o(function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new rn(pL);var t=this.getNamedItem(r.nodeName);return dL(this._ownerElement,this,r,t),t},"setNamedItem"),setNamedItemNS:o(function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new rn(pL);return t=this.getNamedItemNS(r.namespaceURI,r.localName),dL(this._ownerElement,this,r,t),t},"setNamedItemNS"),removeNamedItem:o(function(r){var e=this.getNamedItem(r);return mL(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:o(function(r,e){var t=this.getNamedItemNS(r,e);return mL(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:o(function(r,e){for(var t=this.length;t--;){var n=this[t];if(n.localName==e&&n.namespaceURI==r)return n}return null},"getNamedItemNS")};function IL(){}o(IL,"DOMImplementation");IL.prototype={hasFeature:o(function(r,e){return!0},"hasFeature"),createDocument:o(function(r,e,t){var n=new Gm;if(n.implementation=this,n.childNodes=new vo,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(r,e);n.appendChild(s)}return n},"createDocument"),createDocumentType:o(function(r,e,t){var n=new _S;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n},"createDocumentType")};function Sr(){}o(Sr,"Node");Sr.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:o(function(r,e){return BS(this,r,e)},"insertBefore"),replaceChild:o(function(r,e){BS(this,r,e,RL),e&&this.removeChild(e)},"replaceChild"),removeChild:o(function(r){return _L(this,r)},"removeChild"),appendChild:o(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:o(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:o(function(r){return VN(this.ownerDocument||this,this,r)},"cloneNode"),normalize:o(function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==TS&&r.nodeType==TS?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e)}},"normalize"),isSupported:o(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),hasAttributes:o(function(){return this.attributes.length>0},"hasAttributes"),lookupPrefix:o(function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===r)return n}e=e.nodeType==dp?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:o(function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==dp?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:o(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace")};function BL(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}o(BL,"_xmlEncoder");Xm(Ts,Sr);Xm(Ts,Sr.prototype);function Km(r,e){if(e(r))return!0;if(r=r.firstChild)do if(Km(r,e))return!0;while(r=r.nextSibling)}o(Km,"_visitNode");function Gm(){this.ownerDocument=this}o(Gm,"Document");function gee(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Hm.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}o(gee,"_onAddAttribute");function DL(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===Hm.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}o(DL,"_onRemoveAttribute");function MN(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t)n[n.length++]=t;else{for(var s=e.firstChild,i=0;s;)n[i++]=s,s=s.nextSibling;n.length=i,delete n[n.length]}}}o(MN,"_onUpdateChild");function _L(r,e){var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,MN(r.ownerDocument,r),e}o(_L,"_removeChild");function yee(r){return r&&(r.nodeType===Sr.DOCUMENT_NODE||r.nodeType===Sr.DOCUMENT_FRAGMENT_NODE||r.nodeType===Sr.ELEMENT_NODE)}o(yee,"hasValidParentNodeType");function vee(r){return r&&(ka(r)||jN(r)||So(r)||r.nodeType===Sr.DOCUMENT_FRAGMENT_NODE||r.nodeType===Sr.COMMENT_NODE||r.nodeType===Sr.PROCESSING_INSTRUCTION_NODE)}o(vee,"hasInsertableNodeType");function So(r){return r&&r.nodeType===Sr.DOCUMENT_TYPE_NODE}o(So,"isDocTypeNode");function ka(r){return r&&r.nodeType===Sr.ELEMENT_NODE}o(ka,"isElementNode");function jN(r){return r&&r.nodeType===Sr.TEXT_NODE}o(jN,"isTextNode");function gL(r,e){var t=r.childNodes||[];if(Oa(t,ka)||So(e))return!1;var n=Oa(t,So);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}o(gL,"isElementInsertionPossible");function yL(r,e){var t=r.childNodes||[];function n(i){return ka(i)&&i!==e}if(o(n,"hasElementChildThatIsNotChild"),Oa(t,n))return!1;var s=Oa(t,So);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}o(yL,"isElementReplacementPossible");function wee(r,e,t){if(!yee(r))throw new rn(xs,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new rn(NL,"child not in parent");if(!vee(e)||So(e)&&r.nodeType!==Sr.DOCUMENT_NODE)throw new rn(xs,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}o(wee,"assertPreInsertionValidity1to5");function See(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Sr.DOCUMENT_FRAGMENT_NODE){var i=s.filter(ka);if(i.length>1||Oa(s,jN))throw new rn(xs,"More than one element or text in fragment");if(i.length===1&&!gL(r,t))throw new rn(xs,"Element in fragment can not be inserted before doctype")}if(ka(e)&&!gL(r,t))throw new rn(xs,"Only one element can be added and only after doctype");if(So(e)){if(Oa(n,So))throw new rn(xs,"Only one doctype is allowed");var a=Oa(n,ka);if(t&&n.indexOf(a)<n.indexOf(t))throw new rn(xs,"Doctype can only be inserted before an element");if(!t&&a)throw new rn(xs,"Doctype can not be appended since element is present")}}o(See,"assertPreInsertionValidityInDocument");function RL(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Sr.DOCUMENT_FRAGMENT_NODE){var i=s.filter(ka);if(i.length>1||Oa(s,jN))throw new rn(xs,"More than one element or text in fragment");if(i.length===1&&!yL(r,t))throw new rn(xs,"Element in fragment can not be inserted before doctype")}if(ka(e)&&!yL(r,t))throw new rn(xs,"Only one element can be added and only after doctype");if(So(e)){let l=function(f){return So(f)&&f!==t};var u=l;if(o(l,"hasDoctypeChildThatIsNotChild"),Oa(n,l))throw new rn(xs,"Only one doctype is allowed");var a=Oa(n,ka);if(t&&n.indexOf(a)<n.indexOf(t))throw new rn(xs,"Doctype can only be inserted before an element")}}o(RL,"assertPreReplacementValidityInDocument");function BS(r,e,t,n){wee(r,e,t),r.nodeType===Sr.DOCUMENT_NODE&&(n||See)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===wo){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var u=t?t.previousSibling:r.lastChild;i.previousSibling=u,a.nextSibling=t,u?u.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do{i.parentNode=r;var l=r.ownerDocument||r;$m(i,l)}while(i!==a&&(i=i.nextSibling));return MN(r.ownerDocument||r,r),e.nodeType==wo&&(e.firstChild=e.lastChild=null),e}o(BS,"_insertBefore");function $m(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Si&&r.attributes)for(var t=0;t<r.attributes.length;t++){var n=r.attributes.item(t);n&&(n.ownerDocument=e)}for(var s=r.firstChild;s;)$m(s,e),s=s.nextSibling}}o($m,"_updateOwnerDocument");function Eee(r,e){e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,MN(r.ownerDocument,r,e);var t=r.ownerDocument||r;return $m(e,t),e}o(Eee,"_appendSingleChild");Gm.prototype={nodeName:"#document",nodeType:bL,doctype:null,documentElement:null,_inc:1,insertBefore:o(function(r,e){if(r.nodeType==wo){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return BS(this,r,e),$m(r,this),this.documentElement===null&&r.nodeType===Si&&(this.documentElement=r),r},"insertBefore"),removeChild:o(function(r){return this.documentElement==r&&(this.documentElement=null),_L(this,r)},"removeChild"),replaceChild:o(function(r,e){BS(this,r,e,RL),$m(r,this),e&&this.removeChild(e),ka(r)&&(this.documentElement=r)},"replaceChild"),importNode:o(function(r,e){return VL(this,r,e)},"importNode"),getElementById:o(function(r){var e=null;return Km(this.documentElement,function(t){if(t.nodeType==Si&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),getElementsByClassName:o(function(r){var e=hL(r);return new mp(this,function(t){var n=[];return e.length>0&&Km(t.documentElement,function(s){if(s!==t&&s.nodeType===Si){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var u=hL(i);a=e.every(pee(u))}a&&n.push(s)}}}),n})},"getElementsByClassName"),createElement:o(function(r){var e=new Nc;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new vo;var t=e.attributes=new IS;return t._ownerElement=e,e},"createElement"),createDocumentFragment:o(function(){var r=new RS;return r.ownerDocument=this,r.childNodes=new vo,r},"createDocumentFragment"),createTextNode:o(function(r){var e=new FN;return e.ownerDocument=this,e.appendData(r),e},"createTextNode"),createComment:o(function(r){var e=new qN;return e.ownerDocument=this,e.appendData(r),e},"createComment"),createCDATASection:o(function(r){var e=new HN;return e.ownerDocument=this,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:o(function(r,e){var t=new $N;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:o(function(r){var e=new DS;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"createAttribute"),createEntityReference:o(function(r){var e=new KN;return e.ownerDocument=this,e.nodeName=r,e},"createEntityReference"),createElementNS:o(function(r,e){var t=new Nc,n=e.split(":"),s=t.attributes=new IS;return t.childNodes=new vo,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,s._ownerElement=t,t},"createElementNS"),createAttributeNS:o(function(r,e){var t=new DS,n=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,t},"createAttributeNS")};Ns(Gm,Sr);function Nc(){this._nsMap={}}o(Nc,"Element");Nc.prototype={nodeType:Si,hasAttribute:o(function(r){return this.getAttributeNode(r)!=null},"hasAttribute"),getAttribute:o(function(r){var e=this.getAttributeNode(r);return e&&e.value||""},"getAttribute"),getAttributeNode:o(function(r){return this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:o(function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},"setAttribute"),removeAttribute:o(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),appendChild:o(function(r){return r.nodeType===wo?this.insertBefore(r,null):Eee(this,r)},"appendChild"),setAttributeNode:o(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:o(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:o(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:o(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:o(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:o(function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},"getAttributeNS"),setAttributeNS:o(function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},"setAttributeNS"),getAttributeNodeNS:o(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByTagName:o(function(r){return new mp(this,function(e){var t=[];return Km(e,function(n){n!==e&&n.nodeType==Si&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},"getElementsByTagName"),getElementsByTagNameNS:o(function(r,e){return new mp(this,function(t){var n=[];return Km(t,function(s){s!==t&&s.nodeType===Si&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Gm.prototype.getElementsByTagName=Nc.prototype.getElementsByTagName;Gm.prototype.getElementsByTagNameNS=Nc.prototype.getElementsByTagNameNS;Ns(Nc,Sr);function DS(){}o(DS,"Attr");DS.prototype.nodeType=dp;Ns(DS,Sr);function Wm(){}o(Wm,"CharacterData");Wm.prototype={data:"",substringData:o(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:o(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:o(function(r,e){this.replaceData(r,0,e)},"insertData"),appendChild:o(function(r){throw new Error(Nn[xs])},"appendChild"),deleteData:o(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:o(function(r,e,t){var n=this.data.substring(0,r),s=this.data.substring(r+e);t=n+t+s,this.nodeValue=this.data=t,this.length=t.length},"replaceData")};Ns(Wm,Sr);function FN(){}o(FN,"Text");FN.prototype={nodeName:"#text",nodeType:TS,splitText:o(function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n},"splitText")};Ns(FN,Wm);function qN(){}o(qN,"Comment");qN.prototype={nodeName:"#comment",nodeType:CL};Ns(qN,Wm);function HN(){}o(HN,"CDATASection");HN.prototype={nodeName:"#cdata-section",nodeType:SL};Ns(HN,Wm);function _S(){}o(_S,"DocumentType");_S.prototype.nodeType=xL;Ns(_S,Sr);function PL(){}o(PL,"Notation");PL.prototype.nodeType=mee;Ns(PL,Sr);function OL(){}o(OL,"Entity");OL.prototype.nodeType=dee;Ns(OL,Sr);function KN(){}o(KN,"EntityReference");KN.prototype.nodeType=EL;Ns(KN,Sr);function RS(){}o(RS,"DocumentFragment");RS.prototype.nodeName="#document-fragment";RS.prototype.nodeType=wo;Ns(RS,Sr);function $N(){}o($N,"ProcessingInstruction");$N.prototype.nodeType=AL;Ns($N,Sr);function kL(){}o(kL,"XMLSerializer");kL.prototype.serializeToString=function(r,e,t){return LL.call(r,e,t)};Sr.prototype.toString=LL;function LL(r,e){var t=[],n=this.nodeType==9&&this.documentElement||this,s=n.prefix,i=n.namespaceURI;if(i&&s==null){var s=n.lookupPrefix(i);if(s==null)var a=[{namespace:i,prefix:null}]}return pp(this,t,r,e,a),t.join("")}o(LL,"nodeSerializeToString");function vL(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===Hm.XML||s===Hm.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}o(vL,"needNamespaceDefine");function LN(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,BL),'"')}o(LN,"addSerializedAttribute");function pp(r,e,t,n,s){if(s||(s=[]),n)if(r=n(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Si:var i=r.attributes,a=i.length,b=r.firstChild,u=r.tagName;t=Hm.isHTML(r.namespaceURI)||t;var l=u;if(!t&&!r.prefix&&r.namespaceURI){for(var f,h=0;h<i.length;h++)if(i.item(h).name==="xmlns"){f=i.item(h).value;break}if(!f)for(var m=s.length-1;m>=0;m--){var g=s[m];if(g.prefix===""&&g.namespace===r.namespaceURI){f=g.namespace;break}}if(f!==r.namespaceURI)for(var m=s.length-1;m>=0;m--){var g=s[m];if(g.namespace===r.namespaceURI){g.prefix&&(l=g.prefix+":"+u);break}}}e.push("<",l);for(var w=0;w<a;w++){var y=i.item(w);y.prefix=="xmlns"?s.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&s.push({prefix:"",namespace:y.value})}for(var w=0;w<a;w++){var y=i.item(w);if(vL(y,t,s)){var S=y.prefix||"",E=y.namespaceURI;LN(e,S?"xmlns:"+S:"xmlns",E),s.push({prefix:S,namespace:E})}pp(y,e,t,n,s)}if(u===l&&vL(r,t,s)){var S=r.prefix||"",E=r.namespaceURI;LN(e,S?"xmlns:"+S:"xmlns",E),s.push({prefix:S,namespace:E})}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),t&&/^script$/i.test(u))for(;b;)b.data?e.push(b.data):pp(b,e,t,n,s.slice()),b=b.nextSibling;else for(;b;)pp(b,e,t,n,s.slice()),b=b.nextSibling;e.push("</",l,">")}else e.push("/>");return;case bL:case wo:for(var b=r.firstChild;b;)pp(b,e,t,n,s.slice()),b=b.nextSibling;return;case dp:return LN(e,r.name,r.value);case TS:return e.push(r.data.replace(/[<&>]/g,BL));case SL:return e.push("<![CDATA[",r.data,"]]>");case CL:return e.push("<!--",r.data,"-->");case xL:var T=r.publicId,A=r.systemId;if(e.push("<!DOCTYPE ",r.name),T)e.push(" PUBLIC ",T),A&&A!="."&&e.push(" ",A),e.push(">");else if(A&&A!=".")e.push(" SYSTEM ",A,">");else{var C=r.internalSubset;C&&e.push(" [",C,"]"),e.push(">")}return;case AL:return e.push("<?",r.target," ",r.data,"?>");case EL:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}o(pp,"serializeToString");function VL(r,e,t){var n;switch(e.nodeType){case Si:n=e.cloneNode(!1),n.ownerDocument=r;case wo:break;case dp:t=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=r,n.parentNode=null,t)for(var s=e.firstChild;s;)n.appendChild(VL(r,s,t)),s=s.nextSibling;return n}o(VL,"importNode");function VN(r,e,t){var n=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var i=e[s];typeof i!="object"&&i!=n[s]&&(n[s]=i)}switch(e.childNodes&&(n.childNodes=new vo),n.ownerDocument=r,n.nodeType){case Si:var a=e.attributes,u=n.attributes=new IS,l=a.length;u._ownerElement=n;for(var f=0;f<l;f++)n.setAttributeNode(VN(r,a.item(f),!0));break;case dp:t=!0}if(t)for(var h=e.firstChild;h;)n.appendChild(VN(r,h,t)),h=h.nextSibling;return n}o(VN,"cloneNode");function UL(r,e,t){r[e]=t}o(UL,"__set__");try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Si:case wo:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Aee=r,o(r,"getTextContent"),Object.defineProperty(mp.prototype,"length",{get:o(function(){return UN(this),this.$$length},"get")}),Object.defineProperty(Sr.prototype,"textContent",{get:o(function(){return r(this)},"get"),set:o(function(e){switch(this.nodeType){case Si:case wo:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}},"set")}),UL=o(function(e,t,n){e["$$"+t]=n},"__set__")}}catch{}var Aee;Vu.DocumentType=_S;Vu.DOMException=rn;Vu.DOMImplementation=IL;Vu.Element=Nc;Vu.Node=Sr;Vu.NodeList=vo;Vu.XMLSerializer=kL});var jL=ye(Jm=>{"use strict";var ML=qm().freeze;Jm.XML_ENTITIES=ML({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Jm.HTML_ENTITIES=ML({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
64
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Jm.entityMap=Jm.HTML_ENTITIES});var WL=ye(WN=>{"use strict";var Zm=qm().NAMESPACE,GN=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,FL=new RegExp("[\\-\\.0-9"+GN.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),qL=new RegExp("^"+GN.source+FL.source+"*(?::"+GN.source+FL.source+"*)?$"),zm=0,Uu=1,gp=2,Ym=3,yp=4,vp=5,Qm=6,PS=7;function wp(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,wp)}o(wp,"ParseError");wp.prototype=new Error;wp.prototype.name=wp.name;function $L(){}o($L,"XMLReader");$L.prototype={parse:o(function(r,e,t){var n=this.domBuilder;n.startDocument(),XL(e,e={}),Cee(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};function Cee(r,e,t,n,s){function i(Z){if(Z>65535){Z-=65536;var fe=55296+(Z>>10),Se=56320+(Z&1023);return String.fromCharCode(fe,Se)}else return String.fromCharCode(Z)}o(i,"fixedFromCharCode");function a(Z){var fe=Z.slice(1,-1);return Object.hasOwnProperty.call(t,fe)?t[fe]:fe.charAt(0)==="#"?i(parseInt(fe.substr(1).replace("x","0x"))):(s.error("entity not found:"+Z),Z)}o(a,"entityReplacer");function u(Z){if(Z>S){var fe=r.substring(S,Z).replace(/&#?\w+;/g,a);g&&l(S),n.characters(fe,0,Z-S),S=Z}}o(u,"appendText");function l(Z,fe){for(;Z>=h&&(fe=m.exec(r));)f=fe.index,h=f+fe[0].length,g.lineNumber++;g.columnNumber=Z-f+1}o(l,"position");for(var f=0,h=0,m=/.*(?:\r\n?|\n)|.*$/g,g=n.locator,w=[{currentNSMap:e}],y={},S=0;;){try{var E=r.indexOf("<",S);if(E<0){if(!r.substr(S).match(/^\s*$/)){var b=n.doc,T=b.createTextNode(r.substr(S));b.appendChild(T),n.currentElement=T}return}switch(E>S&&u(E),r.charAt(E+1)){case"/":var K=r.indexOf(">",E+3),A=r.substring(E+2,K).replace(/[ \t\n\r]+$/g,""),C=w.pop();K<0?(A=r.substring(E+2).replace(/[\s<].*/,""),s.error("end tag name: "+A+" is not complete:"+C.tagName),K=E+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,""),s.error("end tag name: "+A+" maybe not complete"),K=E+1+A.length);var x=C.localNSMap,B=C.tagName==A,F=B||C.tagName&&C.tagName.toLowerCase()==A.toLowerCase();if(F){if(n.endElement(C.uri,C.localName,A),x)for(var R in x)Object.prototype.hasOwnProperty.call(x,R)&&n.endPrefixMapping(R);B||s.fatalError("end tag name: "+A+" is not match the current start tagName:"+C.tagName)}else w.push(C);K++;break;case"?":g&&l(E),K=Iee(r,E,n);break;case"!":g&&l(E),K=Tee(r,E,n,s);break;default:g&&l(E);var H=new GL,q=w[w.length-1].currentNSMap,K=bee(r,E,H,q,a,s),G=H.length;if(!H.closed&&Nee(r,K,H.tagName,y)&&(H.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),g&&G){for(var he=HL(g,{}),le=0;le<G;le++){var oe=H[le];l(oe.offset),oe.locator=HL(g,{})}n.locator=he,KL(H,n,q)&&w.push(H),n.locator=g}else KL(H,n,q)&&w.push(H);Zm.isHTML(H.uri)&&!H.closed?K=xee(r,K,H.tagName,a,n):K++}}catch(Z){if(Z instanceof wp)throw Z;s.error("element parse error: "+Z),K=-1}K>S?S=K:u(Math.max(E,S)+1)}}o(Cee,"parse");function HL(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}o(HL,"copyLocator");function bee(r,e,t,n,s,i){function a(w,y,S){t.attributeNames.hasOwnProperty(w)&&i.fatalError("Attribute "+w+" redefined"),t.addValue(w,y.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),S)}o(a,"addAttribute");for(var u,l,f=++e,h=zm;;){var m=r.charAt(f);switch(m){case"=":if(h===Uu)u=r.slice(e,f),h=Ym;else if(h===gp)h=Ym;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(h===Ym||h===Uu)if(h===Uu&&(i.warning('attribute value must after "="'),u=r.slice(e,f)),e=f+1,f=r.indexOf(m,e),f>0)l=r.slice(e,f),a(u,l,e-1),h=vp;else throw new Error("attribute value no end '"+m+"' match");else if(h==yp)l=r.slice(e,f),a(u,l,e),i.warning('attribute "'+u+'" missed start quot('+m+")!!"),e=f+1,h=vp;else throw new Error('attribute value must after "="');break;case"/":switch(h){case zm:t.setTagName(r.slice(e,f));case vp:case Qm:case PS:h=PS,t.closed=!0;case yp:case Uu:break;case gp:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),h==zm&&t.setTagName(r.slice(e,f)),f;case">":switch(h){case zm:t.setTagName(r.slice(e,f));case vp:case Qm:case PS:break;case yp:case Uu:l=r.slice(e,f),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case gp:h===gp&&(l=u),h==yp?(i.warning('attribute "'+l+'" missed quot(")!'),a(u,l,e)):((!Zm.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Ym:throw new Error("attribute value missed!!")}return f;case"\x80":m=" ";default:if(m<=" ")switch(h){case zm:t.setTagName(r.slice(e,f)),h=Qm;break;case Uu:u=r.slice(e,f),h=gp;break;case yp:var l=r.slice(e,f);i.warning('attribute "'+l+'" missed quot(")!!'),a(u,l,e);case vp:h=Qm;break}else switch(h){case gp:var g=t.tagName;(!Zm.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),a(u,u,e),e=f,h=Uu;break;case vp:i.warning('attribute space is required"'+u+'"!!');case Qm:h=Uu,e=f;break;case Ym:h=yp,e=f;break;case PS:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}o(bee,"parseElementStartPart");function KL(r,e,t){for(var n=r.tagName,s=null,m=r.length;m--;){var i=r[m],a=i.qName,u=i.value,g=a.indexOf(":");if(g>0)var l=i.prefix=a.slice(0,g),f=a.slice(g+1),h=l==="xmlns"&&f;else f=a,l=null,h=a==="xmlns"&&"";i.localName=f,h!==!1&&(s==null&&(s={},XL(t,t={})),t[h]=s[h]=u,i.uri=Zm.XMLNS,e.startPrefixMapping(h,u))}for(var m=r.length;m--;){i=r[m];var l=i.prefix;l&&(l==="xml"&&(i.uri=Zm.XML),l!=="xmlns"&&(i.uri=t[l||""]))}var g=n.indexOf(":");g>0?(l=r.prefix=n.slice(0,g),f=r.localName=n.slice(g+1)):(l=null,f=r.localName=n);var w=r.uri=t[l||""];if(e.startElement(w,f,n,r),r.closed){if(e.endElement(w,f,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}o(KL,"appendElement");function xee(r,e,t,n,s){if(/^(?:script|textarea)$/i.test(t)){var i=r.indexOf("</"+t+">",e),a=r.substring(e+1,i);if(/[&<]/.test(a))return/^script$/i.test(t)?(s.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),i)}return e+1}o(xee,"parseHtmlSpecialContent");function Nee(r,e,t,n){var s=n[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),n[t]=s),s<e}o(Nee,"fixSelfClosed");function XL(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}o(XL,"_copy");function Tee(r,e,t,n){var s=r.charAt(e+2);switch(s){case"-":if(r.charAt(e+3)==="-"){var i=r.indexOf("-->",e+4);return i>e?(t.comment(r,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var i=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,i-e-9),t.endCDATA(),i+3}var a=Bee(r,e),u=a.length;if(u>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],f=!1,h=!1;u>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],h=u>4&&a[4][0]):/^system$/i.test(a[2][0])&&(h=a[3][0]));var m=a[u-1];return t.startDTD(l,f,h),t.endDTD(),m.index+m[0].length}}return-1}o(Tee,"parseDCC");function Iee(r,e,t){var n=r.indexOf("?>",e);if(n){var s=r.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){var i=s[0].length;return t.processingInstruction(s[1],s[2]),n+2}else return-1}return-1}o(Iee,"parseInstruction");function GL(){this.attributeNames={}}o(GL,"ElementAttributes");GL.prototype={setTagName:o(function(r){if(!qL.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:o(function(r,e,t){if(!qL.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},"addValue"),length:0,getLocalName:o(function(r){return this[r].localName},"getLocalName"),getLocator:o(function(r){return this[r].locator},"getLocator"),getQName:o(function(r){return this[r].qName},"getQName"),getURI:o(function(r){return this[r].uri},"getURI"),getValue:o(function(r){return this[r].value},"getValue")};function Bee(r,e){var t,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(n.push(t),t[1])return n}o(Bee,"split");WN.XMLReader=$L;WN.ParseError=wp});var t8=ye(kS=>{"use strict";var Dee=qm(),_ee=XN(),JL=jL(),QL=WL(),Ree=_ee.DOMImplementation,zL=Dee.NAMESPACE,Pee=QL.ParseError,Oee=QL.XMLReader;function ZL(r){return r.replace(/\r[\n\u0085]/g,`
65
+ `).replace(/[\r\u0085\u2028]/g,`
66
+ `)}o(ZL,"normalizeLineEndings");function e8(r){this.options=r||{locator:{}}}o(e8,"DOMParser");e8.prototype.parseFromString=function(r,e){var t=this.options,n=new Oee,s=t.domBuilder||new eg,i=t.errorHandler,a=t.locator,u=t.xmlns||{},l=/\/x?html?$/.test(e),f=l?JL.HTML_ENTITIES:JL.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=kee(i,s,a),n.domBuilder=t.domBuilder||s,l&&(u[""]=zL.HTML),u.xml=u.xml||zL.XML;var h=t.normalizeLineEndings||ZL;return r&&typeof r=="string"?n.parse(h(r),u,f):n.errorHandler.error("invalid doc source"),s.doc};function kee(r,e,t){if(!r){if(e instanceof eg)return e;r=e}var n={},s=r instanceof Function;t=t||{};function i(a){var u=r[a];!u&&s&&(u=r.length==2?function(l){r(a,l)}:r),n[a]=u&&function(l){u("[xmldom "+a+"] "+l+JN(t))}||function(){}}return o(i,"build"),i("warning"),i("error"),i("fatalError"),n}o(kee,"buildErrorHandler");function eg(){this.cdata=!1}o(eg,"DOMHandler");function Sp(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}o(Sp,"position");eg.prototype={startDocument:o(function(){this.doc=new Ree().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},"startDocument"),startElement:o(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;OS(this,i),this.currentElement=i,this.locator&&Sp(this.locator,i);for(var u=0;u<a;u++){var r=n.getURI(u),l=n.getValue(u),t=n.getQName(u),f=s.createAttributeNS(r,t);this.locator&&Sp(n.getLocator(u),f),f.value=f.nodeValue=l,i.setAttributeNode(f)}},"startElement"),endElement:o(function(r,e,t){var n=this.currentElement,s=n.tagName;this.currentElement=n.parentNode},"endElement"),startPrefixMapping:o(function(r,e){},"startPrefixMapping"),endPrefixMapping:o(function(r){},"endPrefixMapping"),processingInstruction:o(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Sp(this.locator,t),OS(this,t)},"processingInstruction"),ignorableWhitespace:o(function(r,e,t){},"ignorableWhitespace"),characters:o(function(r,e,t){if(r=YL.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&Sp(this.locator,n)}},"characters"),skippedEntity:o(function(r){},"skippedEntity"),endDocument:o(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:o(function(r){(this.locator=r)&&(r.lineNumber=0)},"setDocumentLocator"),comment:o(function(r,e,t){r=YL.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&Sp(this.locator,n),OS(this,n)},"comment"),startCDATA:o(function(){this.cdata=!0},"startCDATA"),endCDATA:o(function(){this.cdata=!1},"endCDATA"),startDTD:o(function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(r,e,t);this.locator&&Sp(this.locator,s),OS(this,s),this.doc.doctype=s}},"startDTD"),warning:o(function(r){console.warn("[xmldom warning] "+r,JN(this.locator))},"warning"),error:o(function(r){console.error("[xmldom error] "+r,JN(this.locator))},"error"),fatalError:o(function(r){throw new Pee(r,this.locator)},"fatalError")};function JN(r){if(r)return`
67
+ @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}o(JN,"_locator");function YL(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}o(YL,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){eg.prototype[r]=function(){return null}});function OS(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}o(OS,"appendElement");kS.__DOMHandler=eg;kS.normalizeLineEndings=ZL;kS.DOMParser=e8});var zN=ye(LS=>{"use strict";var r8=XN();LS.DOMImplementation=r8.DOMImplementation;LS.XMLSerializer=r8.XMLSerializer;LS.DOMParser=t8().DOMParser});var n8=ye(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.EnvelopedSignature=void 0;var VS=bS(),YN=lp(),Lee=class{static{o(this,"EnvelopedSignature")}constructor(){this.includeComments=!1,this.includeComments=!1}process(e,t){if(t.signatureNode==null){let i=VS.select1("./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return YN.isNodeLike(i)&&i.parentNode&&i.parentNode.removeChild(i),e}let n=t.signatureNode,s=VS.select1(".//*[local-name(.)='SignatureValue']/text()",n);if(YN.isTextNode(s)){let i=s.data,a=VS.select(".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);for(let u of Array.isArray(a)?a:[]){let l=VS.select1(".//*[local-name(.)='SignatureValue']/text()",u);if(YN.isTextNode(l)){let f=l.data;i===f&&u.parentNode&&u.parentNode.removeChild(u)}}}return e}getAlgorithmName(){return"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}};US.EnvelopedSignature=Lee});var s8=ye(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.Sha512=Mu.Sha256=Mu.Sha1=void 0;var QN=gt("crypto"),Vee=class{static{o(this,"Sha1")}constructor(){this.getHash=function(e){let t=QN.createHash("sha1");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#sha1"}}};Mu.Sha1=Vee;var Uee=class{static{o(this,"Sha256")}constructor(){this.getHash=function(e){let t=QN.createHash("sha256");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha256"}}};Mu.Sha256=Uee;var Mee=class{static{o(this,"Sha512")}constructor(){this.getHash=function(e){let t=QN.createHash("sha512");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha512"}}};Mu.Sha512=Mee});var ZN=ye(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});MS.createOptionalCallbackFunction=void 0;function jee(r){return typeof r=="function"}o(jee,"isErrorFirstCallback");function Fee(r){return(...e)=>{let t=e[e.length-1];if(jee(t))try{let n=r(...e.slice(0,-1));t(null,n)}catch(n){t(n instanceof Error?n:new Error("Unknown error"))}else return r(...e)}}o(Fee,"createOptionalCallbackFunction");MS.createOptionalCallbackFunction=Fee});var i8=ye(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.HmacSha1=La.RsaSha512=La.RsaSha256=La.RsaSha1=void 0;var ju=gt("crypto"),Fu=ZN(),qee=class{static{o(this,"RsaSha1")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createSign("RSA-SHA1");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createVerify("RSA-SHA1");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#rsa-sha1"}};La.RsaSha1=qee;var Hee=class{static{o(this,"RsaSha256")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createSign("RSA-SHA256");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createVerify("RSA-SHA256");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"}};La.RsaSha256=Hee;var Kee=class{static{o(this,"RsaSha512")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createSign("RSA-SHA512");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createVerify("RSA-SHA512");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"}};La.RsaSha512=Kee;var $ee=class{static{o(this,"HmacSha1")}constructor(){this.getSignature=(0,Fu.createOptionalCallbackFunction)((e,t)=>{let n=ju.createHmac("SHA1",t);return n.update(e),n.digest("base64")}),this.verifySignature=(0,Fu.createOptionalCallbackFunction)((e,t,n)=>{let s=ju.createHmac("SHA1",t);return s.update(e),s.digest("base64")===n}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#hmac-sha1"}};La.HmacSha1=$ee});var u8=ye(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});FS.SignedXml=void 0;var Gs=lp(),Tc=zN(),Xee=gt("util"),Ei=bS(),a8=_N(),Gee=n8(),o8=ON(),eT=s8(),jS=i8(),pr=Fm(),tT=class Ep{static{o(this,"SignedXml")}constructor(e={}){this.signatureAlgorithm=void 0,this.canonicalizationAlgorithm=void 0,this.inclusiveNamespacesPrefixList=[],this.namespaceResolver={lookupNamespaceURI:o(function(){throw new Error("Not implemented")},"lookupNamespaceURI")},this.implicitTransforms=[],this.keyInfoAttributes={},this.getKeyInfoContent=Ep.getKeyInfoContent,this.getCertFromKeyInfo=Ep.getCertFromKeyInfo,this.id=0,this.signedXml="",this.signatureXml="",this.signatureNode=null,this.signatureValue="",this.originalXmlWithIds="",this.keyInfo=null,this.references=[],this.signedReferences=[],this.CanonicalizationAlgorithms={"http://www.w3.org/TR/2001/REC-xml-c14n-20010315":a8.C14nCanonicalization,"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":a8.C14nCanonicalizationWithComments,"http://www.w3.org/2001/10/xml-exc-c14n#":o8.ExclusiveCanonicalization,"http://www.w3.org/2001/10/xml-exc-c14n#WithComments":o8.ExclusiveCanonicalizationWithComments,"http://www.w3.org/2000/09/xmldsig#enveloped-signature":Gee.EnvelopedSignature},this.HashAlgorithms={"http://www.w3.org/2000/09/xmldsig#sha1":eT.Sha1,"http://www.w3.org/2001/04/xmlenc#sha256":eT.Sha256,"http://www.w3.org/2001/04/xmlenc#sha512":eT.Sha512},this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#rsa-sha1":jS.RsaSha1,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":jS.RsaSha256,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":jS.RsaSha512};let{idMode:t,idAttribute:n,privateKey:s,publicCert:i,signatureAlgorithm:a,canonicalizationAlgorithm:u,inclusiveNamespacesPrefixList:l,implicitTransforms:f,keyInfoAttributes:h,getKeyInfoContent:m,getCertFromKeyInfo:g}=e;this.idMode=t,this.idAttributes=["Id","ID","id"],n&&this.idAttributes.unshift(n),this.privateKey=s,this.publicCert=i,this.signatureAlgorithm=a??this.signatureAlgorithm,this.canonicalizationAlgorithm=u,typeof l=="string"?this.inclusiveNamespacesPrefixList=l.split(" "):pr.isArrayHasLength(l)&&(this.inclusiveNamespacesPrefixList=l),this.implicitTransforms=f??this.implicitTransforms,this.keyInfoAttributes=h??this.keyInfoAttributes,this.getKeyInfoContent=m??this.getKeyInfoContent,this.getCertFromKeyInfo=g??Ep.noop,this.CanonicalizationAlgorithms,this.HashAlgorithms,this.SignatureAlgorithms}enableHMAC(){this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#hmac-sha1":jS.HmacSha1},this.getKeyInfoContent=Ep.noop}static getKeyInfoContent({publicCert:e,prefix:t}){if(e==null)return null;t=t?`${t}:`:"";let n="";Buffer.isBuffer(e)&&(e=e.toString("latin1"));let s=[];return typeof e=="string"&&(s=e.match(pr.EXTRACT_X509_CERTS)||[]),s.length>0&&(n=s.map(i=>`<${t}X509Certificate>${pr.pemToDer(i).toString("base64")}</${t}X509Certificate>`).join("")),`<${t}X509Data>${n}</${t}X509Data>`}static getCertFromKeyInfo(e){if(e!=null){let t=Ei.select1(".//*[local-name(.)='X509Certificate']",e);if(Gs.isNodeLike(t))return pr.derToPem(t.textContent??"","CERTIFICATE")}return null}checkSignature(e,t){if(t!=null&&typeof t!="function")throw new Error("Last parameter must be a callback function");this.signedXml=e;let n=new Tc.DOMParser().parseFromString(e);this.references=[];let s=this.getCanonSignedInfoXml(n);if(!s){if(t){t(new Error("Canonical signed info cannot be empty"),!1);return}throw new Error("Canonical signed info cannot be empty")}let a=new Tc.DOMParser().parseFromString(s,"text/xml").documentElement;if(!a){if(t){t(new Error("Could not parse unverifiedSignedInfoCanon into a document"),!1);return}throw new Error("Could not parse unverifiedSignedInfoCanon into a document")}let u=pr.findChildren(a,"Reference");if(!pr.isArrayHasLength(u)){if(t){t(new Error("could not find any Reference elements"),!1);return}throw new Error("could not find any Reference elements")}for(let m of u)this.loadReference(m);if(!this.getReferences().every(m=>this.validateReference(m,n))){if(this.signedReferences=[],this.references.forEach(m=>{m.signedReference=void 0}),t){t(new Error("Could not validate all references"),!1);return}return!1}let l=this.findSignatureAlgorithm(this.signatureAlgorithm),f=this.getCertFromKeyInfo(this.keyInfo)||this.publicCert||this.privateKey;if(f==null)throw new Error("KeyInfo or publicCert or privateKey is required to validate signature");if(l.verifySignature(s,f,this.signatureValue)===!0)if(t)t(null,!0);else return!0;else if(this.signedReferences=[],this.references.forEach(m=>{m.signedReference=void 0}),t){t(new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`));return}else throw new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`)}getCanonSignedInfoXml(e){if(this.signatureNode==null)throw new Error("No signature found.");if(typeof this.canonicalizationAlgorithm!="string")throw new Error("Missing canonicalizationAlgorithm when trying to get signed info for XML");let t=pr.findChildren(this.signatureNode,"SignedInfo");if(t.length===0)throw new Error("could not find SignedInfo element in the message");if(t.length>1)throw new Error("could not get canonicalized signed info for a signature that contains multiple SignedInfo nodes");if((this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")&&(!e||typeof e!="object"))throw new Error("When canonicalization method is non-exclusive, whole xml dom must be provided as an argument");let s={ancestorNamespaces:pr.findAncestorNs(e,"//*[local-name()='SignedInfo']")};return this.getCanonXml([this.canonicalizationAlgorithm],t[0],s)}getCanonReferenceXml(e,t,n){Array.isArray(t.transforms)&&(t.ancestorNamespaces=pr.findAncestorNs(e,t.xpath,this.namespaceResolver));let s={inclusiveNamespacesPrefixList:t.inclusiveNamespacesPrefixList,ancestorNamespaces:t.ancestorNamespaces};return this.getCanonXml(t.transforms,n,s)}calculateSignatureValue(e,t){let n=this.getCanonSignedInfoXml(e),s=this.findSignatureAlgorithm(this.signatureAlgorithm);if(this.privateKey==null)throw new Error("Private key is required to compute signature");typeof t=="function"?s.getSignature(n,this.privateKey,t):this.signatureValue=s.getSignature(n,this.privateKey)}findSignatureAlgorithm(e){if(e==null)throw new Error("signatureAlgorithm is required");let t=this.SignatureAlgorithms[e];if(t)return new t;throw new Error(`signature algorithm '${e}' is not supported`)}findCanonicalizationAlgorithm(e){if(e!=null){let t=this.CanonicalizationAlgorithms[e];if(t)return new t}throw new Error(`canonicalization algorithm '${e}' is not supported`)}findHashAlgorithm(e){let t=this.HashAlgorithms[e];if(t)return new t;throw new Error(`hash algorithm '${e}' is not supported`)}validateElementAgainstReferences(e,t){let n;if(typeof e=="string"){let s=Ei.select1(e,t);Gs.assertIsElementNode(s),n=s}else n=e;for(let s of this.getReferences()){let i=s.uri?.[0]==="#"?s.uri.substring(1):s.uri;for(let f of this.idAttributes){let h=n.getAttribute(f);if(i===h){s.xpath=`//*[@*[local-name(.)='${f}']='${i}']`;break}}let a=this.getCanonReferenceXml(t,s,n),l=this.findHashAlgorithm(s.digestAlgorithm).getHash(a);if(pr.validateDigestValue(l,s.digestValue))return s}throw new Error("No references passed validation")}validateReference(e,t){let n=e.uri?.[0]==="#"?e.uri.substring(1):e.uri,s=null;if(n==="")s=Ei.select1("//*",t);else{if(n?.indexOf("'")!==-1)throw new Error("Cannot validate a uri with quotes inside it");{let l=0;for(let f of this.idAttributes){let h=`//*[@*[local-name(.)='${f}']='${n}']`,m=Ei.select(h,t);if(pr.isArrayHasLength(m)){if(l+=m.length,l>1)throw new Error("Cannot validate a document which contains multiple elements with the same value for the ID / Id / Id attributes, in order to prevent signature wrapping attack.");s=m[0],e.xpath=h}}}}if(e.getValidatedNode=(0,Xee.deprecate)(l=>{if(l=l||e.xpath,typeof l!="string"||e.validationError!=null)return null;let f=Ei.select1(l,t);return Gs.isNodeLike(f)?f:null},"`ref.getValidatedNode()` is deprecated and insecure. Use `ref.signedReference` or `this.getSignedReferences()` instead."),!Gs.isNodeLike(s)){let l=new Error(`invalid signature: the signature references an element with uri ${e.uri} but could not find such element in the xml`);return e.validationError=l,!1}let i=this.getCanonReferenceXml(t,e,s),u=this.findHashAlgorithm(e.digestAlgorithm).getHash(i);if(!pr.validateDigestValue(u,e.digestValue)){let l=new Error(`invalid signature: for uri ${e.uri} calculated digest is ${u} but the xml to validate supplies digest ${e.digestValue}`);return e.validationError=l,!1}return this.signedReferences.push(i),e.signedReference=i,!0}findSignatures(e){let t=Ei.select("//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return Gs.isArrayOfNodes(t)?t:[]}loadSignature(e){typeof e=="string"?this.signatureNode=e=new Tc.DOMParser().parseFromString(e):this.signatureNode=e,this.signatureXml=e.toString();let t=Ei.select1(".//*[local-name(.)='CanonicalizationMethod']/@Algorithm",e);if(!Gs.isNodeLike(t))throw new Error("could not find CanonicalizationMethod/@Algorithm element");Gs.isAttributeNode(t)&&(this.canonicalizationAlgorithm=t.value);let n=Ei.select1(".//*[local-name(.)='SignatureMethod']/@Algorithm",e);Gs.isAttributeNode(n)&&(this.signatureAlgorithm=n.value);let s=pr.findChildren(this.signatureNode,"SignedInfo");if(!pr.isArrayHasLength(s))throw new Error("no signed info node found");if(s.length>1)throw new Error("could not load signature that contains multiple SignedInfo nodes");let i=this.canonicalizationAlgorithm;(!i||i==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||i==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")&&(i="http://www.w3.org/2001/10/xml-exc-c14n#");let a=this.getCanonXml([i],s[0]),l=new Tc.DOMParser().parseFromString(a,"text/xml").documentElement;this.references=[];let f=pr.findChildren(l,"Reference");if(!pr.isArrayHasLength(f))throw new Error("could not find any Reference elements");for(let g of f)this.loadReference(g);let h=Ei.select1(".//*[local-name(.)='SignatureValue']/text()",e);Gs.isTextNode(h)&&(this.signatureValue=h.data.replace(/\r?\n/g,""));let m=Ei.select1(".//*[local-name(.)='KeyInfo']",e);Gs.isNodeLike(m)&&(this.keyInfo=m)}loadReference(e){let t=pr.findChildren(e,"DigestMethod");if(t.length===0)throw new Error(`could not find DigestMethod in reference ${e.toString()}`);let n=t[0],s=pr.findAttr(n,"Algorithm");if(!s)throw new Error(`could not find Algorithm attribute in node ${n.toString()}`);let i=s.value;if(t=pr.findChildren(e,"DigestValue"),t.length===0)throw new Error(`could not find DigestValue node in reference ${e.toString()}`);if(t.length>1)throw new Error(`could not load reference for a node that contains multiple DigestValue nodes: ${e.toString()}`);let a=t[0].textContent;if(!a)throw new Error(`could not find the value of DigestValue in ${e.toString()}`);let u=[],l=[];if(t=pr.findChildren(e,"Transforms"),t.length!==0){let h=t[0],m=pr.findChildren(h,"Transform");for(let w of m){let y=pr.findAttr(w,"Algorithm");y&&u.push(y.value)}let g=pr.findChildren(m[m.length-1],"InclusiveNamespaces");pr.isArrayHasLength(g)&&(l=g.flatMap(w=>(w.getAttribute("PrefixList")??"").split(" ")).filter(w=>w.length>0))}pr.isArrayHasLength(this.implicitTransforms)&&this.implicitTransforms.forEach(function(h){u.push(h)}),(u.length===0||u[u.length-1]==="http://www.w3.org/2000/09/xmldsig#enveloped-signature")&&u.push("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");let f=Gs.isElementNode(e)&&e.getAttribute("URI")||void 0;this.addReference({transforms:u,digestAlgorithm:i,uri:f,digestValue:a,inclusiveNamespacesPrefixList:l,isEmptyUri:!1})}addReference({xpath:e,transforms:t,digestAlgorithm:n,uri:s="",digestValue:i,inclusiveNamespacesPrefixList:a=[],isEmptyUri:u=!1}){if(n==null)throw new Error("digestAlgorithm is required");if(!pr.isArrayHasLength(t))throw new Error("transforms must contain at least one transform algorithm");this.references.push({xpath:e,transforms:t,digestAlgorithm:n,uri:s,digestValue:i,inclusiveNamespacesPrefixList:a,isEmptyUri:u,getValidatedNode:o(()=>{throw new Error("Reference has not been validated yet; Did you call `sig.checkSignature()`?")},"getValidatedNode")})}getReferences(){return this.references}getSignedReferences(){return[...this.signedReferences]}computeSignature(e,t,n){let s;typeof t=="function"&&n==null?(s=t,t={}):(s=n,t=t??{});let i=new Tc.DOMParser().parseFromString(e),a="xmlns",u=[],l,f=["append","prepend","before","after"],h=t.prefix,m=t.attrs||{},g=t.location||{},w=t.existingPrefixes||{};if(this.namespaceResolver={lookupNamespaceURI:o(function(B){return B?w[B]:null},"lookupNamespaceURI")},g.reference=g.reference||"/*",g.action=g.action||"append",f.indexOf(g.action)===-1){let B=new Error(`location.action option has an invalid action: ${g.action}, must be any of the following values: ${f.join(", ")}`);if(s){s(B);return}else throw B}h?(a+=`:${h}`,l=`${h}:`):l="",Object.keys(m).forEach(function(B){B!=="xmlns"&&B!==a&&u.push(`${B}="${m[B]}"`)}),u.push(`${a}="http://www.w3.org/2000/09/xmldsig#"`);let y=`<${l}Signature ${u.join(" ")}>`;y+=this.createSignedInfo(i,h),y+=this.getKeyInfo(h),y+=`</${l}Signature>`,this.originalXmlWithIds=i.toString();let S="";Object.keys(w).forEach(function(B){S+=`xmlns:${B}="${w[B]}" `});let E=`<Dummy ${S}>${y}</Dummy>`,T=new Tc.DOMParser().parseFromString(E).documentElement.firstChild,A=Ei.select1(g.reference,i);if(!Gs.isNodeLike(A)){let B=new Error(`the following xpath cannot be used because it was not found: ${g.reference}`);if(s){s(B);return}else throw B}if(g.action==="append")A.appendChild(T);else if(g.action==="prepend")A.insertBefore(T,A.firstChild);else if(g.action==="before"){if(A.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `before`");A.parentNode.insertBefore(T,A)}else if(g.action==="after"){if(A.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `after`");A.parentNode.insertBefore(T,A.nextSibling)}this.signatureNode=T;let C=pr.findChildren(this.signatureNode,"SignedInfo");if(C.length===0){let B=new Error("could not find SignedInfo element in the message");if(s){s(B);return}else throw B}let x=C[0];typeof s=="function"?this.calculateSignatureValue(i,(B,F)=>{B?s(B):(this.signatureValue=F||"",T.insertBefore(this.createSignature(h),x.nextSibling),this.signatureXml=T.toString(),this.signedXml=i.toString(),s(null,this))}):(this.calculateSignatureValue(i),T.insertBefore(this.createSignature(h),x.nextSibling),this.signatureXml=T.toString(),this.signedXml=i.toString())}getKeyInfo(e){let t=e?`${e}:`:"",n="";this.keyInfoAttributes&&Object.keys(this.keyInfoAttributes).forEach(i=>{n+=` ${i}="${this.keyInfoAttributes[i]}"`});let s=this.getKeyInfoContent({publicCert:this.publicCert,prefix:e});return n||s?`<${t}KeyInfo${n}>${s}</${t}KeyInfo>`:""}createReferences(e,t){let n="";t=t||"",t=t&&`${t}:`;for(let s of this.getReferences()){let i=Ei.selectWithResolver(s.xpath??"",e,this.namespaceResolver);if(!pr.isArrayHasLength(i))throw new Error(`the following xpath cannot be signed because it was not found: ${s.xpath}`);for(let a of i){if(s.isEmptyUri)n+=`<${t}Reference URI="">`;else{let f=this.ensureHasId(a);s.uri=f,n+=`<${t}Reference URI="#${f}">`}n+=`<${t}Transforms>`;for(let f of s.transforms||[]){let h=this.findCanonicalizationAlgorithm(f);n+=`<${t}Transform Algorithm="${h.getAlgorithmName()}"`,pr.isArrayHasLength(s.inclusiveNamespacesPrefixList)?(n+=">",n+=`<InclusiveNamespaces PrefixList="${s.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${h.getAlgorithmName()}"/>`,n+=`</${t}Transform>`):n+=" />"}let u=this.getCanonReferenceXml(e,s,a),l=this.findHashAlgorithm(s.digestAlgorithm);n+=`</${t}Transforms><${t}DigestMethod Algorithm="${l.getAlgorithmName()}" /><${t}DigestValue>${l.getHash(u)}</${t}DigestValue></${t}Reference>`}}return n}getCanonXml(e,t,n={}){n.defaultNsForPrefix=n.defaultNsForPrefix??Ep.defaultNsForPrefix,n.signatureNode=this.signatureNode;let i=t.cloneNode(!0);return e.forEach(a=>{Gs.isNodeLike(i)&&(i=this.findCanonicalizationAlgorithm(a).process(i,n))}),i.toString()}ensureHasId(e){let t;if(this.idMode==="wssecurity"?t=pr.findAttr(e,"Id","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"):this.idAttributes.some(s=>(t=pr.findAttr(e,s),!!t)),t)return t.value;let n=`_${this.id++}`;return this.idMode==="wssecurity"?(e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:wsu","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"),e.setAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu:Id",n)):e.setAttribute("Id",n),n}createSignedInfo(e,t){if(typeof this.canonicalizationAlgorithm!="string")throw new Error("Missing canonicalizationAlgorithm when trying to create signed info for XML");let n=this.findCanonicalizationAlgorithm(this.canonicalizationAlgorithm),s=this.findSignatureAlgorithm(this.signatureAlgorithm),i;i=t||"",i=i&&`${i}:`;let a=`<${i}SignedInfo>`;return a+=`<${i}CanonicalizationMethod Algorithm="${n.getAlgorithmName()}"`,pr.isArrayHasLength(this.inclusiveNamespacesPrefixList)?(a+=">",a+=`<InclusiveNamespaces PrefixList="${this.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${n.getAlgorithmName()}"/>`,a+=`</${i}CanonicalizationMethod>`):a+=" />",a+=`<${i}SignatureMethod Algorithm="${s.getAlgorithmName()}" />`,a+=this.createReferences(e,t),a+=`</${i}SignedInfo>`,a}createSignature(e){let t="xmlns";e?(t+=`:${e}`,e+=":"):e="";let n=`<${e}SignatureValue>${this.signatureValue}</${e}SignatureValue>`,s=`<${e}Signature ${t}="http://www.w3.org/2000/09/xmldsig#">${n}</${e}Signature>`;return new Tc.DOMParser().parseFromString(s).documentElement.firstChild}getSignatureXml(){return this.signatureXml}getOriginalXmlWithIds(){return this.originalXmlWithIds}getSignedXml(){return this.signedXml}};FS.SignedXml=tT;tT.defaultNsForPrefix={ds:"http://www.w3.org/2000/09/xmldsig#"};tT.noop=()=>null});var rT=ye(Tn=>{"use strict";var Wee=Tn&&Tn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),l8=Tn&&Tn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Wee(e,r,t)};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SignedXml=Tn.ExclusiveCanonicalizationWithComments=Tn.ExclusiveCanonicalization=Tn.C14nCanonicalizationWithComments=Tn.C14nCanonicalization=void 0;var c8=_N();Object.defineProperty(Tn,"C14nCanonicalization",{enumerable:!0,get:o(function(){return c8.C14nCanonicalization},"get")});Object.defineProperty(Tn,"C14nCanonicalizationWithComments",{enumerable:!0,get:o(function(){return c8.C14nCanonicalizationWithComments},"get")});var f8=ON();Object.defineProperty(Tn,"ExclusiveCanonicalization",{enumerable:!0,get:o(function(){return f8.ExclusiveCanonicalization},"get")});Object.defineProperty(Tn,"ExclusiveCanonicalizationWithComments",{enumerable:!0,get:o(function(){return f8.ExclusiveCanonicalizationWithComments},"get")});var Jee=u8();Object.defineProperty(Tn,"SignedXml",{enumerable:!0,get:o(function(){return Jee.SignedXml},"get")});l8(ZN(),Tn);l8(Fm(),Tn)});var d8=ye(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});HS.WSSecurityCert=void 0;var zee=gt("crypto"),Yee=rT();function Qee(r,e){return new Date(r.getTime()+e*6e4)}o(Qee,"addMinutes");function h8(r){return r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)).slice(-2)+"-"+("0"+r.getUTCDate()).slice(-2)+"T"+("0"+r.getUTCHours()).slice(-2)+":"+("0"+r.getUTCMinutes()).slice(-2)+":"+("0"+r.getUTCSeconds()).slice(-2)+"Z"}o(h8,"dateStringForSOAP");function Zee(){return h8(new Date)}o(Zee,"generateCreated");function ete(){return h8(Qee(new Date,10))}o(ete,"generateExpires");function qS(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}o(qS,"insertStr");function tte(){return(0,zee.randomUUID)().replace(/-/gm,"")}o(tte,"generateId");function rte(r,e){for(let t of r)t.xpath===p8&&(t.xpath=e)}o(rte,"resolvePlaceholderInReferences");var qu="http://docs.oasis-open.org/wss/2004/01",p8="[[bodyXpath]]",nte=class{static{o(this,"WSSecurityCert")}constructor(e,t,n,s={}){if(this.signerOptions={},this.additionalReferences=[],this.excludeReferencesFromSigning=[],this.publicP12PEM=t.toString().replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/(\r\n|\n|\r)/gm,""),this.signer=new Yee.SignedXml({idMode:s?.signerOptions?.idMode,signatureAlgorithm:s?.signatureAlgorithm}),this.signer.digestAlgorithm=s.digestAlgorithm??"http://www.w3.org/2001/04/xmlenc#sha256",s.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=s.signatureAlgorithm,this.signer.addReference({xpath:p8,transforms:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})),s.signatureAlgorithm||(this.signer.signatureAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"),this.signer.canonicalizationAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#",s.additionalReferences&&s.additionalReferences.length>0&&(this.additionalReferences=s.additionalReferences),s.excludeReferencesFromSigning&&s.excludeReferencesFromSigning.length>0&&(this.excludeReferencesFromSigning=s.excludeReferencesFromSigning),s.signerOptions){let{signerOptions:i}=s;this.signerOptions=i,this.signerOptions.existingPrefixes||(this.signerOptions.existingPrefixes={}),this.signerOptions.existingPrefixes&&!this.signerOptions.existingPrefixes.wsse&&(this.signerOptions.existingPrefixes.wsse=`${qu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${qu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e,passphrase:n},this.x509Id=`x509-${tte()}`,this.hasTimeStamp=typeof s.hasTimeStamp>"u"?!0:!!s.hasTimeStamp,this.signatureTransformations=Array.isArray(s.signatureTransformations)?s.signatureTransformations:["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"],this.signer.getKeyInfoContent=()=>`<wsse:SecurityTokenReference><wsse:Reference URI="#${this.x509Id}" ValueType="${qu}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=Zee(),this.expires=ete();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${qu}/oasis-200401-wss-wssecurity-utility-1.0.xsd"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s=`<wsse:BinarySecurityToken EncodingType="${qu}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${qu}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+n,i,a=`xmlns:wsse="${qu}/oasis-200401-wss-wssecurity-secext-1.0.xsd"`,u=`xmlns:wsu="${qu}/oasis-200401-wss-wssecurity-utility-1.0.xsd"`,l=e.indexOf("</wsse:Security>");if(l>-1){let y=/<wsse:Security( [^>]*)?>/,S=e.match(y),E="";S[0].includes(` ${t}:mustUnderstand="`)||(E+=`${t}:mustUnderstand="1" `),S[0].includes(a.substring(0,a.indexOf("=")))||(E+=`${a} `),S[0].includes(u.substring(0,a.indexOf("=")))||(E+=`${u} `);let b="<wsse:Security ",T=e.indexOf(b);e=qS(s,e,l),i=qS(E,e,T+b.length)}else{let y=`<wsse:Security ${a} ${u} ${t}:mustUnderstand="1">`+s+"</wsse:Security>";i=qS(y,e,e.indexOf(`</${t}:Header>`))}let f=this.signatureTransformations,h=`//*[name(.)='${t}:Body']`;rte(this.signer.references,h),!this.excludeReferencesFromSigning.some(y=>y==="Body")&&!(this.signer.references.filter(y=>y.xpath===h).length>0)&&this.signer.addReference({xpath:h,transforms:f,digestAlgorithm:this.signer.digestAlgorithm});for(let y of this.additionalReferences){let S=`//*[name(.)='${y}']`;!this.excludeReferencesFromSigning.some(E=>E===y)&&!(this.signer.references.filter(E=>E.xpath===S).length>0)&&this.signer.addReference({xpath:S,transforms:f,digestAlgorithm:this.signer.digestAlgorithm})}let m="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";!this.excludeReferencesFromSigning.some(y=>y==="Timestamp")&&this.hasTimeStamp&&!(this.signer.references.filter(y=>y.xpath===m).length>0)&&this.signer.addReference({xpath:m,transforms:f,digestAlgorithm:this.signer.digestAlgorithm}),this.signer.computeSignature(i,this.signerOptions);let g=this.signer.getOriginalXmlWithIds(),w=this.signer.getSignatureXml();return qS(w,g,g.indexOf("</wsse:Security>"))}};HS.WSSecurityCert=nte});var v8=ye(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});KS.WSSecurityCertWithToken=void 0;var ste=gt("crypto"),ite=rT();function ate(r,e){return new Date(r.getTime()+e*6e4)}o(ate,"addMinutes");function g8(r){return r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)).slice(-2)+"-"+("0"+r.getUTCDate()).slice(-2)+"T"+("0"+r.getUTCHours()).slice(-2)+":"+("0"+r.getUTCMinutes()).slice(-2)+":"+("0"+r.getUTCSeconds()).slice(-2)+"Z"}o(g8,"dateStringForSOAP");function ote(){return g8(new Date)}o(ote,"generateCreated");function ute(){return g8(ate(new Date,10))}o(ute,"generateExpires");function m8(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}o(m8,"insertStr");function lte(){return(0,ste.randomUUID)().replace(/-/gm,"")}o(lte,"generateId");function cte(r,e){for(let t of r)t.xpath===y8&&(t.xpath=e)}o(cte,"resolvePlaceholderInReferences");var Hu="http://docs.oasis-open.org/wss/2004/01",y8="[[bodyXpath]]",fte=class{static{o(this,"WSSecurityCertWithToken")}constructor(e){this.signerOptions={},this.additionalReferences=[],this.publicP12PEM=e.publicKey.toString().replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/(\r\n|\n|\r)/gm,""),this.username=e.username,this.password=e.password,this.signer=new ite.SignedXml;let t=e.options||{};if(t.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=t.signatureAlgorithm,this.signer.addReference({xpath:y8,transforms:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})),t.signatureAlgorithm||(this.signer.signatureAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"),this.signer.canonicalizationAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#",t.additionalReferences&&t.additionalReferences.length>0&&(this.additionalReferences=t.additionalReferences),t.signerOptions){let{signerOptions:n}=e.options;this.signerOptions=n,this.signerOptions.existingPrefixes||(this.signerOptions.existingPrefixes={}),this.signerOptions.existingPrefixes&&!this.signerOptions.existingPrefixes.wsse&&(this.signerOptions.existingPrefixes.wsse=`${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e.privateKey,passphrase:e.keyPassword},this.x509Id=`x509-${lte()}`,this.hasTimeStamp=typeof t.hasTimeStamp>"u"?!0:!!t.hasTimeStamp,this.signatureTransformations=Array.isArray(t.signatureTransformations)?t.signatureTransformations:["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"],this.signer.keyInfoProvider={},this.signer.getKeyInfo=()=>`<wsse:SecurityTokenReference><wsse:Reference URI="#${this.x509Id}" ValueType="${Hu}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=ote(),this.expires=ute();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${Hu}/oasis-200401-wss-wssecurity-utility-1.0.xsd" Id="_1"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s="";this.username&&(s=`<wsse:UsernameToken wsu:Id="SecurityToken-${this.created}" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>${this.username}</wsse:Username> <wsse:Password>${this.password}</wsse:Password> </wsse:UsernameToken>`);let i=`<wsse:Security xmlns:wsse="${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="${Hu}/oasis-200401-wss-wssecurity-utility-1.0.xsd" ${t}:mustUnderstand="1"><wsse:BinarySecurityToken EncodingType="${Hu}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${Hu}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+s+n+"</wsse:Security>",a=m8(i,e,e.indexOf(`</${t}:Header>`)),u=this.signatureTransformations,l=`//*[name(.)='${t}:Body']`;cte(this.signer.references,l),this.signer.references.filter(h=>h.xpath===l).length>0||this.signer.addReference({xpath:l,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"});for(let h of this.additionalReferences){let m=`//*[name(.)='${h}']`;this.signer.references.filter(g=>g.xpath===m).length>0||this.signer.addReference({xpath:m,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})}let f="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";return this.hasTimeStamp&&!(this.signer.references.filter(h=>h.xpath===f).length>0)&&this.signer.addReference({xpath:f,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"}),this.signer.computeSignature(a,this.signerOptions),m8(this.signer.getSignatureXml(),a,a.indexOf("</wsse:Security>"))}};KS.WSSecurityCertWithToken=fte});var w8=ye($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});$S.WSSecurityPlusCert=void 0;var hte=class{static{o(this,"WSSecurityPlusCert")}constructor(e,t){this.wsSecurity=e,this.wsSecurityCert=t}postProcess(e,t){let n=this.wsSecurity.toXML(),s=e.indexOf(`</${t}:Header>`);return e=[e.slice(0,s),n,e.slice(s)].join(""),this.wsSecurityCert.postProcess(e,t)}};$S.WSSecurityPlusCert=hte});var nT=ye(hs=>{"use strict";var pte=hs&&hs.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Eo=hs&&hs.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&pte(e,r,t)};Object.defineProperty(hs,"__esModule",{value:!0});Eo(Wk(),hs);Eo(zk(),hs);Eo(Zk(),hs);Eo(tL(),hs);Eo(rL(),hs);Eo(nL(),hs);Eo(d8(),hs);Eo(v8(),hs);Eo(w8(),hs)});var sT=ye(Ai=>{"use strict";var dte=Ai&&Ai.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mte=Ai&&Ai.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),gte=Ai&&Ai.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&dte(t,e,n[s]);return mte(t,e),t}})(),yte=Ai&&Ai.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Server=void 0;var vte=gt("events"),XS=gte(gt("url")),wte=yte(gt("zlib"));function Ste(r){return typeof r.route=="function"&&typeof r.use=="function"}o(Ste,"isExpress");function S8(r){return!!r&&typeof r.then=="function"}o(S8,"isPromiseLike");function E8(r){function e(t){return t<10?"0"+t:t}return o(e,"pad"),r.getUTCFullYear()+"-"+e(r.getUTCMonth()+1)+"-"+e(r.getUTCDate())+"T"+e(r.getUTCHours())+":"+e(r.getUTCMinutes())+":"+e(r.getUTCSeconds())+"Z"}o(E8,"getDateString");var Ete=class extends vte.EventEmitter{static{o(this,"Server")}constructor(e,t,n,s,i){super(),i=i||{path:t,services:n},this.path=t,this.services=n,this.wsdl=s,this.suppressStack=i&&i.suppressStack,this.returnFault=i&&i.returnFault,this.onewayOptions=i&&i.oneWay||{},this.enableChunkedEncoding=i.enableChunkedEncoding===void 0?!0:!!i.enableChunkedEncoding,this.callback=i.callback?i.callback:()=>{},typeof t=="string"&&t[t.length-1]!=="/"?t+="/":t instanceof RegExp&&t.source[t.source.length-1]!=="/"&&(t=new RegExp(t.source+"(?:\\/|)")),s.onReady(a=>{if(Ste(e))e.route(t).all((u,l)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(u,l)){l.end();return}this._requestListener(u,l)}),this.callback(a,this);else{let u=e.listeners("request").slice();e.removeAllListeners("request"),e.addListener("request",(l,f)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(l,f)){f.end();return}let h=XS.parse(l.url).pathname;if(h[h.length-1]!=="/"&&(h+="/"),t===h||t instanceof RegExp&&h.match(t))this._requestListener(l,f);else for(let m=0,g=u.length;m<g;m++)u[m].call(this,l,f)}),this.callback(a,this)}}),this._initializeOptions(i)}addSoapHeader(e,t,n,s){return this.soapHeaders||(this.soapHeaders=[]),e=this._processSoapHeader(e,t,n,s),this.soapHeaders.push(e)-1}changeSoapHeader(e,t,n,s,i){this.soapHeaders||(this.soapHeaders=[]),t=this._processSoapHeader(t,n,s,i),this.soapHeaders[e]=t}getSoapHeaders(){return this.soapHeaders}clearSoapHeaders(){this.soapHeaders=null}_processSoapHeader(e,t,n,s){switch(typeof e){case"object":return this.wsdl.objectToXML(e,t,n,s,!0);case"function":{let i=this;return(...a)=>{let u=e.apply(null,[...a]);return typeof u=="object"?i.wsdl.objectToXML(u,t,n,s,!0):u}}default:return e}}_initializeOptions(e){this.wsdl.options.attributesKey=e.attributesKey||"attributes",this.onewayOptions.statusCode=this.onewayOptions.responseCode||200,this.onewayOptions.emptyBody=!!this.onewayOptions.emptyBody}_processRequestXml(e,t,n){let s;try{typeof this.log=="function"&&this.log("received",n,e),this._process(n,e,t,(i,a)=>{this._sendHttpResponse(t,a,i),typeof this.log=="function"&&this.log("replied",i,e)})}catch(i){if(i.Fault!==void 0)return this._sendError(i.Fault,(a,u)=>{this._sendHttpResponse(t,u||500,a),typeof this.log=="function"&&this.log("error",i,e)},new Date().toISOString());s=i.stack?this.suppressStack===!0?i.message:i.stack:i,this._sendHttpResponse(t,500,s),typeof this.log=="function"&&this.log("error",i,e)}}_requestListener(e,t){let s=XS.parse(e.url).search;if(typeof this.log=="function"&&this.log("info","Handling "+e.method+" on "+e.url,e),e.method==="GET")s&&s.toLowerCase().startsWith("?wsdl")&&(typeof this.log=="function"&&this.log("info","Wants the WSDL",e),t.setHeader("Content-Type","application/xml"),t.write(this.wsdl.toXML())),t.end();else if(e.method==="POST"){if(typeof e.headers["content-type"]<"u"?t.setHeader("Content-Type",e.headers["content-type"]):t.setHeader("Content-Type","application/xml"),e.body&&e.body.length>0)return this._processRequestXml(e,t,e.body.toString());let i=[],a,u=e;e.headers["content-encoding"]==="gzip"&&(a=wte.default.createGunzip(),e.pipe(a),u=a),u.on("data",l=>{i.push(l)}),u.on("end",()=>{let l=Buffer.concat(i).toString();this._processRequestXml(e,t,l)})}else t.end()}_getSoapAction(e){if(typeof e.headers.soapaction>"u")return;let t=e.headers.soapaction;return t.indexOf('"')===0?t.slice(1,-1):t}_process(e,t,n,s){let i=XS.parse(t.url).pathname.replace(/\/$/,""),a=this.wsdl.xmlToObject(e),u=a.Body,l=a.Header,f,h,m,g,w=a.Header&&a.Header.Security&&a.Header.Security.Timestamp,y=this.authenticate||o(function(){return!0},"defaultAuthenticate"),S=o((b,T)=>{let A={result:b};this.emit("response",A,h),s(A.result,T)},"callback"),E=o(()=>{if(typeof this.log=="function"&&this.log("info","Attempting to bind to "+i,t),!u)throw new Error("Failed to parse the SOAP Message body");if(f=(()=>{let b=this.wsdl.definitions.services,T,A;for(A in b){m=A;let x=b[m].ports;for(A in x){g=A;let B=x[g],F=XS.parse(B.location).pathname.replace(/\/$/,"");if(typeof this.log=="function"&&this.log("info","Trying "+g+" from path "+F,t),F===i)return B.binding;T||(T=B)}}return T?T.binding:void 0})(),!f)throw new Error("Failed to bind to WSDL");try{let b=this._getSoapAction(t),T=Object.keys(u)[0]==="attributes"?Object.keys(u)[1]:Object.keys(u)[0],A=f.topElements[T];b?h=this._getMethodNameBySoapAction(f,b):h=A?A.methodName:T;let C=f.methods[h].style||f.style;this.emit("request",a,h),l&&this.emit("headers",l,h),C==="rpc"?this._executeMethod({serviceName:m,portName:g,methodName:h,outputName:T+"Response",args:u[T],headers:l,style:"rpc"},t,n,S):this._executeMethod({serviceName:m,portName:g,methodName:h,outputName:A.outputName,args:u[T],headers:l,style:"document"},t,n,S,w)}catch(b){if(b.Fault!==void 0)return this._sendError(b.Fault,S,w);throw b}},"process");if(typeof y=="function"){let b=!1,T=o(C=>{if(!b){if(b=!0,C instanceof Error)return this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:C.toString()},statusCode:500},S,w);if(typeof C=="boolean")if(C===!0)try{E()}catch(x){return x.Fault!==void 0?this._sendError(x.Fault,S,w):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:x.toString()},statusCode:500},S,w)}else return this._sendError({Code:{Value:"SOAP-ENV:Client",Subcode:{Value:"AuthenticationFailure"}},Reason:{Text:"Invalid username or password"},statusCode:401},S,w)}},"processAuthResult"),A=y(a.Header&&a.Header.Security,T,t,a);S8(A)&&A.then(C=>{T(C)},C=>{T(C)}),typeof A=="boolean"&&T(A)}else throw new Error("Invalid authenticate function (not a function)")}_getMethodNameBySoapAction(e,t){for(let n in e.methods)if(e.methods[n].soapAction===t)return n}_executeMethod(e,t,n,s,i){e=e||{};let a,u,l,f=e.serviceName,h=e.portName,m=this.wsdl.definitions.services[f].ports[h].binding,g=e.methodName,w=e.outputName,y=e.args,S=e.style;this.soapHeaders&&(l=this.soapHeaders.map(C=>typeof C=="function"?C(g,y,e.headers,t,n,this):C).join(`
68
+ `));try{a=this.services[f][h][g]}catch{return s(this._envelope("",l,i))}let E=!1,b=o((C,x)=>{if(!E){if(E=!0,C)return C.Fault!==void 0?this._sendError(C.Fault,s,i):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:C.toString()},statusCode:500},s,i);if(S==="rpc")u=this.wsdl.objectToRpcXML(w,x,"",this.wsdl.definitions.$targetNamespace);else if(S==="document"){let B=m.methods[g].output;u=this.wsdl.objectToDocumentXML(w,x,B.targetNSAlias,B.targetNamespace)}else{let B=m.methods[g].output,F=B.$targetNamespace,R=w;F&&(R=`${F}:${R}`),u=this.wsdl.objectToDocumentXML(R,x,B.targetNSAlias,B.targetNamespace)}s(this._envelope(u,l,i))}},"handleResult");m.methods[g].output||(E=!0,u="",this.onewayOptions.emptyBody&&(u=this._envelope("",l,i)),s(u,this.onewayOptions.responseCode));let T=o((C,x)=>{C&&C.Fault!==void 0||x===void 0&&(x=C,C=null),b(C,x)},"methodCallback"),A=a.apply(this,[y,T,e.headers,t,n]);typeof A<"u"&&(S8(A)?A.then(C=>{b(null,C)},C=>{b(C)}):b(null,A))}_envelope(e,t,n){let a='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="'+(this.wsdl.options.forceSoap12Headers?"http://www.w3.org/2003/05/soap-envelope":"http://schemas.xmlsoap.org/soap/envelope/")+'" '+this.wsdl.xmlnsInEnvelope+">";if(t=t||"",n){let u=new Date,l=E8(u),f=E8(new Date(u.getTime()+1e3*600));t+='<o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <u:Timestamp u:Id="_0"> <u:Created>'+l+"</u:Created> <u:Expires>"+f+`</u:Expires> </u:Timestamp> </o:Security>
69
+ `}return t!==""&&(a+="<soap:Header>"+t+"</soap:Header>"),a+=e?"<soap:Body>"+e+"</soap:Body>":"<soap:Body/>",a+="</soap:Envelope>",a}_sendError(e,t,n){let s,i;return e.statusCode&&(i=e.statusCode,e.statusCode=void 0),"faultcode"in e?s=this.wsdl.objectToDocumentXML("soap:Fault",e,void 0):s=this.wsdl.objectToDocumentXML("Fault",e,"soap"),t(this._envelope(s,"",n),i)}_sendHttpResponse(e,t,n){t&&(e.statusCode=t),this.enableChunkedEncoding?(e.write(n),e.end()):e.end(n)}};Ai.Server=Ete});var iT=ye(GS=>{"use strict";(function(r){r.parser=function(O,_){return new t(O,_)},r.SAXParser=t,r.SAXStream=f,r.createStream=l,r.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function t(O,_){if(!(this instanceof t))return new t(O,_);var ne=this;s(ne),ne.q=ne.c="",ne.bufferCheckPosition=r.MAX_BUFFER_LENGTH,ne.opt=_||{},ne.opt.lowercase=ne.opt.lowercase||ne.opt.lowercasetags,ne.looseCase=ne.opt.lowercase?"toLowerCase":"toUpperCase",ne.tags=[],ne.closed=ne.closedRoot=ne.sawRoot=!1,ne.tag=ne.error=null,ne.strict=!!O,ne.noscript=!!(O||ne.opt.noscript),ne.state=R.BEGIN,ne.strictEntities=ne.opt.strictEntities,ne.ENTITIES=ne.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),ne.attribList=[],ne.opt.xmlns&&(ne.ns=Object.create(y)),ne.opt.unquotedAttributeValues===void 0&&(ne.opt.unquotedAttributeValues=!O),ne.trackPosition=ne.opt.position!==!1,ne.trackPosition&&(ne.position=ne.line=ne.column=0),q(ne,"onready")}o(t,"SAXParser"),Object.create||(Object.create=function(O){function _(){}o(_,"F"),_.prototype=O;var ne=new _;return ne}),Object.keys||(Object.keys=function(O){var _=[];for(var ne in O)O.hasOwnProperty(ne)&&_.push(ne);return _});function n(O){for(var _=Math.max(r.MAX_BUFFER_LENGTH,10),ne=0,J=0,Xe=e.length;J<Xe;J++){var Re=O[e[J]].length;if(Re>_)switch(e[J]){case"textNode":G(O);break;case"cdata":K(O,"oncdata",O.cdata),O.cdata="";break;case"script":K(O,"onscript",O.script),O.script="";break;default:le(O,"Max buffer length exceeded: "+e[J])}ne=Math.max(ne,Re)}var xe=r.MAX_BUFFER_LENGTH-ne;O.bufferCheckPosition=xe+O.position}o(n,"checkBufferLength");function s(O){for(var _=0,ne=e.length;_<ne;_++)O[e[_]]=""}o(s,"clearBuffers");function i(O){G(O),O.cdata!==""&&(K(O,"oncdata",O.cdata),O.cdata=""),O.script!==""&&(K(O,"onscript",O.script),O.script="")}o(i,"flushBuffers"),t.prototype={end:o(function(){oe(this)},"end"),write:lt,resume:o(function(){return this.error=null,this},"resume"),close:o(function(){return this.write(null)},"close"),flush:o(function(){i(this)},"flush")};var a;try{a=gt("stream").Stream}catch{a=o(function(){},"Stream")}a||(a=o(function(){},"Stream"));var u=r.EVENTS.filter(function(O){return O!=="error"&&O!=="end"});function l(O,_){return new f(O,_)}o(l,"createStream");function f(O,_){if(!(this instanceof f))return new f(O,_);a.apply(this),this._parser=new t(O,_),this.writable=!0,this.readable=!0;var ne=this;this._parser.onend=function(){ne.emit("end")},this._parser.onerror=function(J){ne.emit("error",J),ne._parser.error=null},this._decoder=null,u.forEach(function(J){Object.defineProperty(ne,"on"+J,{get:o(function(){return ne._parser["on"+J]},"get"),set:o(function(Xe){if(!Xe)return ne.removeAllListeners(J),ne._parser["on"+J]=Xe,Xe;ne.on(J,Xe)},"set"),enumerable:!0,configurable:!1})})}o(f,"SAXStream"),f.prototype=Object.create(a.prototype,{constructor:{value:f}}),f.prototype.write=function(O){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(O)){if(!this._decoder){var _=gt("string_decoder").StringDecoder;this._decoder=new _("utf8")}O=this._decoder.write(O)}return this._parser.write(O.toString()),this.emit("data",O),!0},f.prototype.end=function(O){return O&&O.length&&this.write(O),this._parser.end(),!0},f.prototype.on=function(O,_){var ne=this;return!ne._parser["on"+O]&&u.indexOf(O)!==-1&&(ne._parser["on"+O]=function(){var J=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);J.splice(0,0,O),ne.emit.apply(ne,J)}),a.prototype.on.call(ne,O,_)};var h="[CDATA[",m="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",y={xml:g,xmlns:w},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,b=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function A(O){return O===" "||O===`
70
+ `||O==="\r"||O===" "}o(A,"isWhitespace");function C(O){return O==='"'||O==="'"}o(C,"isQuote");function x(O){return O===">"||A(O)}o(x,"isAttribEnd");function B(O,_){return O.test(_)}o(B,"isMatch");function F(O,_){return!B(O,_)}o(F,"notMatch");var R=0;r.STATE={BEGIN:R++,BEGIN_WHITESPACE:R++,TEXT:R++,TEXT_ENTITY:R++,OPEN_WAKA:R++,SGML_DECL:R++,SGML_DECL_QUOTED:R++,DOCTYPE:R++,DOCTYPE_QUOTED:R++,DOCTYPE_DTD:R++,DOCTYPE_DTD_QUOTED:R++,COMMENT_STARTING:R++,COMMENT:R++,COMMENT_ENDING:R++,COMMENT_ENDED:R++,CDATA:R++,CDATA_ENDING:R++,CDATA_ENDING_2:R++,PROC_INST:R++,PROC_INST_BODY:R++,PROC_INST_ENDING:R++,OPEN_TAG:R++,OPEN_TAG_SLASH:R++,ATTRIB:R++,ATTRIB_NAME:R++,ATTRIB_NAME_SAW_WHITE:R++,ATTRIB_VALUE:R++,ATTRIB_VALUE_QUOTED:R++,ATTRIB_VALUE_CLOSED:R++,ATTRIB_VALUE_UNQUOTED:R++,ATTRIB_VALUE_ENTITY_Q:R++,ATTRIB_VALUE_ENTITY_U:R++,CLOSE_TAG:R++,CLOSE_TAG_SAW_WHITE:R++,SCRIPT:R++,SCRIPT_ENDING:R++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(O){var _=r.ENTITIES[O],ne=typeof _=="number"?String.fromCharCode(_):_;r.ENTITIES[O]=ne});for(var H in r.STATE)r.STATE[r.STATE[H]]=H;R=r.STATE;function q(O,_,ne){O[_]&&O[_](ne)}o(q,"emit");function K(O,_,ne){O.textNode&&G(O),q(O,_,ne)}o(K,"emitNode");function G(O){O.textNode=he(O.opt,O.textNode),O.textNode&&q(O,"ontext",O.textNode),O.textNode=""}o(G,"closeText");function he(O,_){return O.trim&&(_=_.trim()),O.normalize&&(_=_.replace(/\s+/g," ")),_}o(he,"textopts");function le(O,_){return G(O),O.trackPosition&&(_+=`
71
+ Line: `+O.line+`
72
+ Column: `+O.column+`
73
+ Char: `+O.c),_=new Error(_),O.error=_,q(O,"onerror",_),O}o(le,"error");function oe(O){return O.sawRoot&&!O.closedRoot&&Z(O,"Unclosed root tag"),O.state!==R.BEGIN&&O.state!==R.BEGIN_WHITESPACE&&O.state!==R.TEXT&&le(O,"Unexpected end"),G(O),O.c="",O.closed=!0,q(O,"onend"),t.call(O,O.strict,O.opt),O}o(oe,"end");function Z(O,_){if(typeof O!="object"||!(O instanceof t))throw new Error("bad call to strictFail");O.strict&&le(O,_)}o(Z,"strictFail");function fe(O){O.strict||(O.tagName=O.tagName[O.looseCase]());var _=O.tags[O.tags.length-1]||O,ne=O.tag={name:O.tagName,attributes:{}};O.opt.xmlns&&(ne.ns=_.ns),O.attribList.length=0,K(O,"onopentagstart",ne)}o(fe,"newTag");function Se(O,_){var ne=O.indexOf(":"),J=ne<0?["",O]:O.split(":"),Xe=J[0],Re=J[1];return _&&O==="xmlns"&&(Xe="xmlns",Re=""),{prefix:Xe,local:Re}}o(Se,"qname");function Ke(O){if(O.strict||(O.attribName=O.attribName[O.looseCase]()),O.attribList.indexOf(O.attribName)!==-1||O.tag.attributes.hasOwnProperty(O.attribName)){O.attribName=O.attribValue="";return}if(O.opt.xmlns){var _=Se(O.attribName,!0),ne=_.prefix,J=_.local;if(ne==="xmlns")if(J==="xml"&&O.attribValue!==g)Z(O,"xml: prefix must be bound to "+g+`
74
+ Actual: `+O.attribValue);else if(J==="xmlns"&&O.attribValue!==w)Z(O,"xmlns: prefix must be bound to "+w+`
75
+ Actual: `+O.attribValue);else{var Xe=O.tag,Re=O.tags[O.tags.length-1]||O;Xe.ns===Re.ns&&(Xe.ns=Object.create(Re.ns)),Xe.ns[J]=O.attribValue}O.attribList.push([O.attribName,O.attribValue])}else O.tag.attributes[O.attribName]=O.attribValue,K(O,"onattribute",{name:O.attribName,value:O.attribValue});O.attribName=O.attribValue=""}o(Ke,"attrib");function be(O,_){if(O.opt.xmlns){var ne=O.tag,J=Se(O.tagName);ne.prefix=J.prefix,ne.local=J.local,ne.uri=ne.ns[J.prefix]||"",ne.prefix&&!ne.uri&&(Z(O,"Unbound namespace prefix: "+JSON.stringify(O.tagName)),ne.uri=J.prefix);var Xe=O.tags[O.tags.length-1]||O;ne.ns&&Xe.ns!==ne.ns&&Object.keys(ne.ns).forEach(function($n){K(O,"onopennamespace",{prefix:$n,uri:ne.ns[$n]})});for(var Re=0,xe=O.attribList.length;Re<xe;Re++){var ct=O.attribList[Re],rr=ct[0],je=ct[1],nr=Se(rr,!0),Ls=nr.prefix,Ge=nr.local,Ur=Ls===""?"":ne.ns[Ls]||"",on={name:rr,value:je,prefix:Ls,local:Ge,uri:Ur};Ls&&Ls!=="xmlns"&&!Ur&&(Z(O,"Unbound namespace prefix: "+JSON.stringify(Ls)),on.uri=Ls),O.tag.attributes[rr]=on,K(O,"onattribute",on)}O.attribList.length=0}O.tag.isSelfClosing=!!_,O.sawRoot=!0,O.tags.push(O.tag),K(O,"onopentag",O.tag),_||(!O.noscript&&O.tagName.toLowerCase()==="script"?O.state=R.SCRIPT:O.state=R.TEXT,O.tag=null,O.tagName=""),O.attribName=O.attribValue="",O.attribList.length=0}o(be,"openTag");function we(O){if(!O.tagName){Z(O,"Weird empty close tag."),O.textNode+="</>",O.state=R.TEXT;return}if(O.script){if(O.tagName!=="script"){O.script+="</"+O.tagName+">",O.tagName="",O.state=R.SCRIPT;return}K(O,"onscript",O.script),O.script=""}var _=O.tags.length,ne=O.tagName;O.strict||(ne=ne[O.looseCase]());for(var J=ne;_--;){var Xe=O.tags[_];if(Xe.name!==J)Z(O,"Unexpected close tag");else break}if(_<0){Z(O,"Unmatched closing tag: "+O.tagName),O.textNode+="</"+O.tagName+">",O.state=R.TEXT;return}O.tagName=ne;for(var Re=O.tags.length;Re-- >_;){var xe=O.tag=O.tags.pop();O.tagName=O.tag.name,K(O,"onclosetag",O.tagName);var ct={};for(var rr in xe.ns)ct[rr]=xe.ns[rr];var je=O.tags[O.tags.length-1]||O;O.opt.xmlns&&xe.ns!==je.ns&&Object.keys(xe.ns).forEach(function(nr){var Ls=xe.ns[nr];K(O,"onclosenamespace",{prefix:nr,uri:Ls})})}_===0&&(O.closedRoot=!0),O.tagName=O.attribValue=O.attribName="",O.attribList.length=0,O.state=R.TEXT}o(we,"closeTag");function Me(O){var _=O.entity,ne=_.toLowerCase(),J,Xe="";return O.ENTITIES[_]?O.ENTITIES[_]:O.ENTITIES[ne]?O.ENTITIES[ne]:(_=ne,_.charAt(0)==="#"&&(_.charAt(1)==="x"?(_=_.slice(2),J=parseInt(_,16),Xe=J.toString(16)):(_=_.slice(1),J=parseInt(_,10),Xe=J.toString(10))),_=_.replace(/^0+/,""),isNaN(J)||Xe.toLowerCase()!==_?(Z(O,"Invalid character entity"),"&"+O.entity+";"):String.fromCodePoint(J))}o(Me,"parseEntity");function Je(O,_){_==="<"?(O.state=R.OPEN_WAKA,O.startTagPosition=O.position):A(_)||(Z(O,"Non-whitespace before first tag."),O.textNode=_,O.state=R.TEXT)}o(Je,"beginWhiteSpace");function Ye(O,_){var ne="";return _<O.length&&(ne=O.charAt(_)),ne}o(Ye,"charAt");function lt(O){var _=this;if(this.error)throw this.error;if(_.closed)return le(_,"Cannot write after close. Assign an onready handler.");if(O===null)return oe(_);typeof O=="object"&&(O=O.toString());for(var ne=0,J="";J=Ye(O,ne++),_.c=J,!!J;)switch(_.trackPosition&&(_.position++,J===`
76
+ `?(_.line++,_.column=0):_.column++),_.state){case R.BEGIN:if(_.state=R.BEGIN_WHITESPACE,J==="\uFEFF")continue;Je(_,J);continue;case R.BEGIN_WHITESPACE:Je(_,J);continue;case R.TEXT:if(_.sawRoot&&!_.closedRoot){for(var Xe=ne-1;J&&J!=="<"&&J!=="&";)J=Ye(O,ne++),J&&_.trackPosition&&(_.position++,J===`
77
+ `?(_.line++,_.column=0):_.column++);_.textNode+=O.substring(Xe,ne-1)}J==="<"&&!(_.sawRoot&&_.closedRoot&&!_.strict)?(_.state=R.OPEN_WAKA,_.startTagPosition=_.position):(!A(J)&&(!_.sawRoot||_.closedRoot)&&Z(_,"Text data outside of root node."),J==="&"?_.state=R.TEXT_ENTITY:_.textNode+=J);continue;case R.SCRIPT:J==="<"?_.state=R.SCRIPT_ENDING:_.script+=J;continue;case R.SCRIPT_ENDING:J==="/"?_.state=R.CLOSE_TAG:(_.script+="<"+J,_.state=R.SCRIPT);continue;case R.OPEN_WAKA:if(J==="!")_.state=R.SGML_DECL,_.sgmlDecl="";else if(!A(J))if(B(S,J))_.state=R.OPEN_TAG,_.tagName=J;else if(J==="/")_.state=R.CLOSE_TAG,_.tagName="";else if(J==="?")_.state=R.PROC_INST,_.procInstName=_.procInstBody="";else{if(Z(_,"Unencoded <"),_.startTagPosition+1<_.position){var Re=_.position-_.startTagPosition;J=new Array(Re).join(" ")+J}_.textNode+="<"+J,_.state=R.TEXT}continue;case R.SGML_DECL:if(_.sgmlDecl+J==="--"){_.state=R.COMMENT,_.comment="",_.sgmlDecl="";continue}_.doctype&&_.doctype!==!0&&_.sgmlDecl?(_.state=R.DOCTYPE_DTD,_.doctype+="<!"+_.sgmlDecl+J,_.sgmlDecl=""):(_.sgmlDecl+J).toUpperCase()===h?(K(_,"onopencdata"),_.state=R.CDATA,_.sgmlDecl="",_.cdata=""):(_.sgmlDecl+J).toUpperCase()===m?(_.state=R.DOCTYPE,(_.doctype||_.sawRoot)&&Z(_,"Inappropriately located doctype declaration"),_.doctype="",_.sgmlDecl=""):J===">"?(K(_,"onsgmldeclaration",_.sgmlDecl),_.sgmlDecl="",_.state=R.TEXT):(C(J)&&(_.state=R.SGML_DECL_QUOTED),_.sgmlDecl+=J);continue;case R.SGML_DECL_QUOTED:J===_.q&&(_.state=R.SGML_DECL,_.q=""),_.sgmlDecl+=J;continue;case R.DOCTYPE:J===">"?(_.state=R.TEXT,K(_,"ondoctype",_.doctype),_.doctype=!0):(_.doctype+=J,J==="["?_.state=R.DOCTYPE_DTD:C(J)&&(_.state=R.DOCTYPE_QUOTED,_.q=J));continue;case R.DOCTYPE_QUOTED:_.doctype+=J,J===_.q&&(_.q="",_.state=R.DOCTYPE);continue;case R.DOCTYPE_DTD:J==="]"?(_.doctype+=J,_.state=R.DOCTYPE):J==="<"?(_.state=R.OPEN_WAKA,_.startTagPosition=_.position):C(J)?(_.doctype+=J,_.state=R.DOCTYPE_DTD_QUOTED,_.q=J):_.doctype+=J;continue;case R.DOCTYPE_DTD_QUOTED:_.doctype+=J,J===_.q&&(_.state=R.DOCTYPE_DTD,_.q="");continue;case R.COMMENT:J==="-"?_.state=R.COMMENT_ENDING:_.comment+=J;continue;case R.COMMENT_ENDING:J==="-"?(_.state=R.COMMENT_ENDED,_.comment=he(_.opt,_.comment),_.comment&&K(_,"oncomment",_.comment),_.comment=""):(_.comment+="-"+J,_.state=R.COMMENT);continue;case R.COMMENT_ENDED:J!==">"?(Z(_,"Malformed comment"),_.comment+="--"+J,_.state=R.COMMENT):_.doctype&&_.doctype!==!0?_.state=R.DOCTYPE_DTD:_.state=R.TEXT;continue;case R.CDATA:J==="]"?_.state=R.CDATA_ENDING:_.cdata+=J;continue;case R.CDATA_ENDING:J==="]"?_.state=R.CDATA_ENDING_2:(_.cdata+="]"+J,_.state=R.CDATA);continue;case R.CDATA_ENDING_2:J===">"?(_.cdata&&K(_,"oncdata",_.cdata),K(_,"onclosecdata"),_.cdata="",_.state=R.TEXT):J==="]"?_.cdata+="]":(_.cdata+="]]"+J,_.state=R.CDATA);continue;case R.PROC_INST:J==="?"?_.state=R.PROC_INST_ENDING:A(J)?_.state=R.PROC_INST_BODY:_.procInstName+=J;continue;case R.PROC_INST_BODY:if(!_.procInstBody&&A(J))continue;J==="?"?_.state=R.PROC_INST_ENDING:_.procInstBody+=J;continue;case R.PROC_INST_ENDING:J===">"?(K(_,"onprocessinginstruction",{name:_.procInstName,body:_.procInstBody}),_.procInstName=_.procInstBody="",_.state=R.TEXT):(_.procInstBody+="?"+J,_.state=R.PROC_INST_BODY);continue;case R.OPEN_TAG:B(E,J)?_.tagName+=J:(fe(_),J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:(A(J)||Z(_,"Invalid character in tag name"),_.state=R.ATTRIB));continue;case R.OPEN_TAG_SLASH:J===">"?(be(_,!0),we(_)):(Z(_,"Forward-slash in opening tag not followed by >"),_.state=R.ATTRIB);continue;case R.ATTRIB:if(A(J))continue;J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:B(S,J)?(_.attribName=J,_.attribValue="",_.state=R.ATTRIB_NAME):Z(_,"Invalid attribute name");continue;case R.ATTRIB_NAME:J==="="?_.state=R.ATTRIB_VALUE:J===">"?(Z(_,"Attribute without value"),_.attribValue=_.attribName,Ke(_),be(_)):A(J)?_.state=R.ATTRIB_NAME_SAW_WHITE:B(E,J)?_.attribName+=J:Z(_,"Invalid attribute name");continue;case R.ATTRIB_NAME_SAW_WHITE:if(J==="=")_.state=R.ATTRIB_VALUE;else{if(A(J))continue;Z(_,"Attribute without value"),_.tag.attributes[_.attribName]="",_.attribValue="",K(_,"onattribute",{name:_.attribName,value:""}),_.attribName="",J===">"?be(_):B(S,J)?(_.attribName=J,_.state=R.ATTRIB_NAME):(Z(_,"Invalid attribute name"),_.state=R.ATTRIB)}continue;case R.ATTRIB_VALUE:if(A(J))continue;C(J)?(_.q=J,_.state=R.ATTRIB_VALUE_QUOTED):(_.opt.unquotedAttributeValues||le(_,"Unquoted attribute value"),_.state=R.ATTRIB_VALUE_UNQUOTED,_.attribValue=J);continue;case R.ATTRIB_VALUE_QUOTED:if(J!==_.q){J==="&"?_.state=R.ATTRIB_VALUE_ENTITY_Q:_.attribValue+=J;continue}Ke(_),_.q="",_.state=R.ATTRIB_VALUE_CLOSED;continue;case R.ATTRIB_VALUE_CLOSED:A(J)?_.state=R.ATTRIB:J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:B(S,J)?(Z(_,"No whitespace between attributes"),_.attribName=J,_.attribValue="",_.state=R.ATTRIB_NAME):Z(_,"Invalid attribute name");continue;case R.ATTRIB_VALUE_UNQUOTED:if(!x(J)){J==="&"?_.state=R.ATTRIB_VALUE_ENTITY_U:_.attribValue+=J;continue}Ke(_),J===">"?be(_):_.state=R.ATTRIB;continue;case R.CLOSE_TAG:if(_.tagName)J===">"?we(_):B(E,J)?_.tagName+=J:_.script?(_.script+="</"+_.tagName,_.tagName="",_.state=R.SCRIPT):(A(J)||Z(_,"Invalid tagname in closing tag"),_.state=R.CLOSE_TAG_SAW_WHITE);else{if(A(J))continue;F(S,J)?_.script?(_.script+="</"+J,_.state=R.SCRIPT):Z(_,"Invalid tagname in closing tag."):_.tagName=J}continue;case R.CLOSE_TAG_SAW_WHITE:if(A(J))continue;J===">"?we(_):Z(_,"Invalid characters in closing tag");continue;case R.TEXT_ENTITY:case R.ATTRIB_VALUE_ENTITY_Q:case R.ATTRIB_VALUE_ENTITY_U:var xe,ct;switch(_.state){case R.TEXT_ENTITY:xe=R.TEXT,ct="textNode";break;case R.ATTRIB_VALUE_ENTITY_Q:xe=R.ATTRIB_VALUE_QUOTED,ct="attribValue";break;case R.ATTRIB_VALUE_ENTITY_U:xe=R.ATTRIB_VALUE_UNQUOTED,ct="attribValue";break}if(J===";"){var rr=Me(_);_.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(rr)?(_.entity="",_.state=xe,_.write(rr)):(_[ct]+=rr,_.entity="",_.state=xe)}else B(_.entity.length?T:b,J)?_.entity+=J:(Z(_,"Invalid character in entity name"),_[ct]+="&"+_.entity+J,_.entity="",_.state=xe);continue;default:throw new Error(_,"Unknown state: "+_.state)}return _.position>=_.bufferCheckPosition&&n(_),_}o(lt,"write");String.fromCodePoint||(function(){var O=String.fromCharCode,_=Math.floor,ne=o(function(){var J=16384,Xe=[],Re,xe,ct=-1,rr=arguments.length;if(!rr)return"";for(var je="";++ct<rr;){var nr=Number(arguments[ct]);if(!isFinite(nr)||nr<0||nr>1114111||_(nr)!==nr)throw RangeError("Invalid code point: "+nr);nr<=65535?Xe.push(nr):(nr-=65536,Re=(nr>>10)+55296,xe=nr%1024+56320,Xe.push(Re,xe)),(ct+1===rr||Xe.length>J)&&(je+=O.apply(null,Xe),Xe.length=0)}return je},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:ne,configurable:!0,writable:!0}):String.fromCodePoint=ne})()})(typeof GS>"u"?GS.sax={}:GS)});var C8=ye((ede,A8)=>{"use strict";A8.exports=r=>{if(typeof r!="string")throw new TypeError("Expected a string, got "+typeof r);return r.charCodeAt(0)===65279?r.slice(1):r}});var b8=ye(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});WS.NamespaceContext=void 0;var Ate=class{static{o(this,"NamespaceScope")}constructor(e){this.parent=e,this.namespaces={}}getNamespaceURI(e,t){switch(e){case"xml":return"http://www.w3.org/XML/1998/namespace";case"xmlns":return"http://www.w3.org/2000/xmlns/";default:{let n=this.namespaces[e];return n!=null?n.uri:!t&&this.parent?this.parent.getNamespaceURI(e):null}}}getNamespaceMapping(e){switch(e){case"xml":return{uri:"http://www.w3.org/XML/1998/namespace",prefix:"xml",declared:!0};case"xmlns":return{uri:"http://www.w3.org/2000/xmlns/",prefix:"xmlns",declared:!0};default:{let t=this.namespaces[e];return t??(this.parent?this.parent.getNamespaceMapping(e):null)}}}getPrefix(e,t){switch(e){case"http://www.w3.org/XML/1998/namespace":return"xml";case"http://www.w3.org/2000/xmlns/":return"xmlns";default:for(let n in this.namespaces)if(this.namespaces[n].uri===e)return n;return!t&&this.parent?this.parent.getPrefix(e):null}}},Cte=class{static{o(this,"NamespaceContext")}constructor(){this.scopes=[],this.pushContext(),this.prefixCount=0}addNamespace(e,t,n){return this.getNamespaceURI(e,n)===t?!1:this.currentScope?(this.currentScope.namespaces[e]={uri:t,prefix:e,declared:!1},!0):!1}pushContext(){let e=new Ate(this.currentScope);return this.scopes.push(e),this.currentScope=e,e}popContext(){let e=this.scopes.pop();return e?this.currentScope=e.parent:this.currentScope=null,e}getNamespaceURI(e,t){return this.currentScope&&this.currentScope.getNamespaceURI(e,t)}getPrefix(e,t){return this.currentScope&&this.currentScope.getPrefix(e,t)}registerNamespace(e){let t=this.getPrefix(e);if(t)return t;for(;t="ns"+ ++this.prefixCount,!!this.getNamespaceURI(t););return this.addNamespace(t,e,!0),t}declareNamespace(e,t){if(this.currentScope){let n=this.currentScope.getNamespaceMapping(e);return n&&n.uri===t&&n.declared?!1:(this.currentScope.namespaces[e]={uri:t,prefix:e,declared:!0},!0)}return!1}};WS.NamespaceContext=Cte});var k8=ye(at=>{"use strict";var bte=at&&at.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),xte=at&&at.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Nte=at&&at.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&bte(t,e,n[s]);return xte(t,e),t}})(),Tte=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.ImportElement=at.IncludeElement=at.BodyElement=at.DefinitionsElement=at.ServiceElement=at.PortElement=at.BindingElement=at.PortTypeElement=at.OperationElement=at.TypesElement=at.SchemaElement=at.DocumentationElement=at.MessageElement=at.AllElement=at.AttributeElement=at.SequenceElement=at.SimpleContentElement=at.ComplexContentElement=at.ComplexTypeElement=at.EnumerationElement=at.ChoiceElement=at.ExtensionElement=at.RestrictionElement=at.SimpleTypeElement=at.OutputElement=at.InputElement=at.AnyElement=at.ElementElement=at.UnexpectedElement=at.Element=void 0;var aT=gt("assert"),Ite=Tte(pw()),Ki=Nte(go()),Yn=Lu(),Bte=(0,Ite.default)("node-soap"),JS={string:1,boolean:1,decimal:1,float:1,double:1,anyType:1,byte:1,int:1,long:1,short:1,negativeInteger:1,nonNegativeInteger:1,positiveInteger:1,nonPositiveInteger:1,unsignedByte:1,unsignedInt:1,unsignedLong:1,unsignedShort:1,duration:0,dateTime:0,time:0,date:0,gYearMonth:0,gYear:0,gMonthDay:0,gDay:0,gMonth:0,hexBinary:0,base64Binary:0,anyURI:0,QName:0,NOTATION:0},dr=class{static{o(this,"Element")}constructor(e,t,n,s){this.allowedChildren={},this.children=[];let i=(0,Yn.splitQName)(e);this.nsName=e,this.prefix=i.prefix,this.name=i.name,this.children=[],this.xmlns={},this.schemaXmlns={},this._initializeOptions(n);for(let a in t){let u=/^xmlns:?(.*)$/.exec(a);u?this.xmlns[u[1]?u[1]:Yn.TNS_PREFIX]=t[a]:a==="value"?this[this.valueKey]=t[a]:this["$"+a]=t[a]}for(let a in s){let u=/^xmlns:?(.*)$/.exec(a);u&&u[1]&&(this.schemaXmlns[u[1]]=s[a])}this.$targetNamespace!==void 0&&(this.xmlns[Yn.TNS_PREFIX]=this.$targetNamespace),this.init()}deleteFixedAttrs(){this.children&&this.children.length===0&&delete this.children,this.xmlns&&Object.keys(this.xmlns).length===0&&delete this.xmlns,delete this.nsName,delete this.prefix,delete this.name}startElement(e,t,n,s,i){if(!this.allowedChildren)return;let a=this.allowedChildren[(0,Yn.splitQName)(t).name];if(a==null&&!this.strict&&(a=x8),a){let u=new a(t,n,s,i);u.init();let l=e[0];l instanceof gT&&(u.definitionsXmlns=l.xmlns),e.push(u)}else this.unexpected(t)}endElement(e,t){if(this.nsName===t){if(e.length<2)return;let n=e[e.length-2];this!==e[0]&&(Ki.defaultsDeep(e[0].xmlns,this.xmlns),n.children.push(this),n.addChild(this)),e.pop()}}addChild(e){}unexpected(e){throw new Error("Found unexpected element ("+e+") inside "+this.nsName)}description(e,t){return this.$name||this.name}init(){}_initializeOptions(e){e?(this.valueKey=e.valueKey||"$value",this.xmlKey=e.xmlKey||"$xml",this.ignoredNamespaces=e.ignoredNamespaces||[],this.strict=e.strict||!1,this.forceUseSchemaXmlns=e.forceUseSchemaXmlns||!1):(this.valueKey="$value",this.xmlKey="$xml",this.ignoredNamespaces=[],this.strict=!1,this.forceUseSchemaXmlns=!1)}};at.Element=dr;var x8=class N8 extends dr{static{o(this,"UnexpectedElement")}startElement(e,t,n,s,i){let a=new N8(t,n,s,i);a.init(),e.push(a)}};at.UnexpectedElement=x8;var oT=class extends dr{static{o(this,"ElementElement")}constructor(){super(...arguments),this.allowedChildren=nn(["annotation","complexType","simpleType"])}description(e,t){let n={},s=this.$name,i=1,a=1;this.$maxOccurs==="unbounded"?a=1/0:this.$maxOccurs&&(a=parseInt(this.$maxOccurs,10)),this.$minOccurs&&(i=parseInt(this.$minOccurs,10));let u=a>1;u&&s&&(s+="[]"),t&&t[Yn.TNS_PREFIX]&&(this.$targetNamespace=t[Yn.TNS_PREFIX]);let l=this.$type||this.$ref;if(l){l=(0,Yn.splitQName)(l);let f=l.name,h=!!Ku(l.prefix,this.definitionsXmlns,e.xmlns)||!!Ku(this.targetNSAlias,this.definitionsXmlns,e.xmlns)||this.forceUseSchemaXmlns,m=Ku(l.prefix,t,this.xmlns,h?this.schemaXmlns:void 0,this.definitionsXmlns,e.xmlns),g=e.schemas[m],w=g&&(this.$type?g.complexTypes[f]||g.types[f]:g.elements[f]),y=this.$type?e.descriptions.types:e.descriptions.elements;if(m&&e.schemas[m]&&(t=e.schemas[m].xmlns),w&&!(f in JS))if(f in y)if(this.$ref)if(u){let S=f+"[]";y[S]=y[f],n[S]=y[S]}else n=y[f];else n[s]=y[f];else{let S={};y[f]=S,u&&"maxOccurs"in w&&(w.maxOccurs=this.$maxOccurs),this.$minOccurs&&"minOccurs"in w&&(w.minOccurs=this.$minOccurs);let E=w.description(e,t);if(typeof E=="string")S=E;else{Object.keys(E).forEach(T=>{S[T]=E[T]});let b=E[$i.Symbol];b&&(S[$i.Symbol]=b)}this.$ref?n=S:n[s]=S,typeof S=="object"&&(S.targetNSAlias=l.prefix,S.targetNamespace=m),y[f]=S}else n[s]=this.$type}else{let f=this.children;n[s]={};for(let h of f)(h instanceof eE||h instanceof YS)&&(n[s]=h.description(e,t))}return n}};at.ElementElement=oT;var zS=class extends dr{static{o(this,"AnyElement")}};at.AnyElement=zS;var T8=class extends dr{static{o(this,"InputElement")}constructor(){super(...arguments),this.allowedChildren=nn(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof tE&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};at.InputElement=T8;var I8=class extends dr{static{o(this,"OutputElement")}constructor(){super(...arguments),this.allowedChildren=nn(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof tE&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};at.OutputElement=I8;var YS=class extends dr{static{o(this,"SimpleTypeElement")}constructor(){super(...arguments),this.allowedChildren=nn(["restriction"])}description(e){for(let t of this.children)if(t instanceof QS)return[this.$name,t.description()].filter(Boolean).join("|");return{}}};at.SimpleTypeElement=YS;var QS=class extends dr{static{o(this,"RestrictionElement")}constructor(){super(...arguments),this.allowedChildren=nn(["all","choice","enumeration","sequence","attribute"])}description(e,t){let n=this.children,s,i=!1,a={};for(let l of n){if(l instanceof $i){a[l.$name]=l.description(e);continue}!i&&(l instanceof ng||l instanceof rg)&&(i=!0,s=l.description(e,t))}if(Object.keys(a).length>0&&(s=s??{},s[$i.Symbol]=a),s&&this.$base){let l=(0,Yn.splitQName)(this.$base),f=l.name,h=Ku(l.prefix,t,this.definitionsXmlns,e.xmlns),m=e.schemas[h],g=m&&(m.complexTypes[f]||m.types[f]||m.elements[f]);if(s.getBase=()=>g.description(e,m.xmlns),g){let w=g.description(e,m.xmlns);w[$i.Symbol]&&Ki.defaults(a,w[$i.Symbol]),s=Ki.defaults(s,w)}return s}let u=this.children.map(l=>l.description()).join(",");return[this.$base,u].filter(Boolean).join("|")}};at.RestrictionElement=QS;var ZS=class extends dr{static{o(this,"ExtensionElement")}constructor(){super(...arguments),this.allowedChildren=nn(["all","choice","sequence"])}description(e,t){let n={};for(let s of this.children)(s instanceof ng||s instanceof rg)&&(n=s.description(e,t));if(this.$base){let s=(0,Yn.splitQName)(this.$base),i=s.name,a=Ku(s.prefix,t,this.definitionsXmlns,e.xmlns),u=e.schemas[a];if(i in JS)return this.$base;{let l=u&&(u.complexTypes[i]||u.types[i]||u.elements[i]);if(l){let f=l.description(e,u.xmlns);n=typeof f=="string"?f:Ki.defaults(f,n)}}}return n}};at.ExtensionElement=ZS;var rg=class extends dr{static{o(this,"ChoiceElement")}constructor(){super(...arguments),this.allowedChildren=nn(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.ChoiceElement=rg;var B8=class extends dr{static{o(this,"EnumerationElement")}description(){return this[this.valueKey]}};at.EnumerationElement=B8;var eE=class extends dr{static{o(this,"ComplexTypeElement")}constructor(){super(...arguments),this.allowedChildren=nn(["all","annotation","choice","complexContent","sequence","simpleContent","attribute"])}description(e,t){let n={},s=!1,i={},a=this.children||[];for(let u of a){if(u instanceof $i){i[u.$name]=u.description(e);continue}!s&&(u instanceof rg||u instanceof ng||u instanceof cT||u instanceof lT||u instanceof uT)&&(s=!0,n=u.description(e,t))}return Object.keys(i).length>0&&(n[$i.Symbol]=i),n}};at.ComplexTypeElement=eE;var uT=class extends dr{static{o(this,"ComplexContentElement")}constructor(){super(...arguments),this.allowedChildren=nn(["extension","restriction"])}description(e,t){for(let n of this.children)if(n instanceof ZS||n instanceof QS)return n.description(e,t);return{}}};at.ComplexContentElement=uT;var lT=class extends dr{static{o(this,"SimpleContentElement")}constructor(){super(...arguments),this.allowedChildren=nn(["extension"])}description(e,t){for(let n of this.children)if(n instanceof ZS)return n.description(e,t);return{}}};at.SimpleContentElement=lT;var ng=class extends dr{static{o(this,"SequenceElement")}constructor(){super(...arguments),this.allowedChildren=nn(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){if(s instanceof zS)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.SequenceElement=ng;var $i=class extends dr{static{o(this,"AttributeElement")}description(e){return{type:this.$type,required:this.$use==="required"}}};at.AttributeElement=$i;$i.Symbol=Symbol("$attributes");var cT=class extends dr{static{o(this,"AllElement")}constructor(){super(...arguments),this.allowedChildren=nn(["choice","element"])}description(e,t){let n={};for(let s of this.children){if(s instanceof zS)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.AllElement=cT;var fT=class extends dr{static{o(this,"MessageElement")}constructor(){super(...arguments),this.allowedChildren=nn(["part","documentation"]),this.element=null,this.parts=null}postProcess(e){let t=null,n=this.children||[];for(let s of n)if(s.name==="part"){t=s;break}if(t){if(t.$element){let s=[];delete this.parts;let i=(0,Yn.splitQName)(t.$element),a=Ku(i.prefix,this.definitionsXmlns,e.xmlns),u=e.schemas[a];if(this.element=u.elements[i.name],!this.element){Bte(i.name+" is not present in wsdl and cannot be processed correctly.");return}this.element.targetNSAlias=i.prefix,this.element.targetNamespace=a,this.element.$lookupType=t.$element;let l=this.element.children;if(l.length>0)for(let f of l)s.push(this._getNestedLookupTypeString(f));if(s.length>0){s=s.join("_").split("_").filter(o(function(m){return m!=="^"},"removeEmptyLookupTypes"));let f=e.schemas[this.element.targetNamespace].xmlns;for(let h=0;h<s.length;h++)s[h]=this._createLookupTypeObject(s[h],f)}if(this.element.$lookupTypes=s,this.element.$type){let f=(0,Yn.splitQName)(this.element.$type),h=Ku(f.prefix,u.xmlns,this.definitionsXmlns,e.xmlns);if(h&&!(f.name in JS)){u=e.schemas[h];let m=u.complexTypes[f.name]||u.types[f.name]||u.elements[f.name];m&&(this.parts=m.description(e,u.xmlns))}}else{let f=this.element.description(e,u.xmlns);this.parts=f[i.name]}this.children.splice(0,1)}else{this.parts={},delete this.element;for(let s=0;s<this.children.length;s++){let i=this.children[s];if(i.name==="documentation")continue;(0,aT.ok)(i.name==="part","Expected part element");let a=(0,Yn.splitQName)(i.$type),u=Ku(a.prefix,this.definitionsXmlns,e.xmlns),l=a.name;typeof e.schemas[u]<"u"?this.parts[i.$name]=e.schemas[u].types[l]||e.schemas[u].complexTypes[l]:this.parts[i.$name]=i.$type,typeof this.parts[i.$name]=="object"&&(this.parts[i.$name].prefix=a.prefix,this.parts[i.$name].xmlns=u),this.children.splice(s--,1)}}this.deleteFixedAttrs()}}description(e){if(this.element)return this.element&&this.element.description(e);let t={};return t[this.$name]=this.parts,t}_createLookupTypeObject(e,t){let n=(0,Yn.splitQName)(e),s=n.prefix,i=n.name.split("#"),a=i[0],u=i[1];return{$namespace:t[s],$type:s+":"+a,$name:u}}_getNestedLookupTypeString(e){let t="^",n=this.ignoredNamespaces.concat("xs");return Object.hasOwnProperty.call(e,"$type")&&typeof e.$type=="string"&&n.indexOf(e.$type.split(":")[0])===-1&&(t+="_"+e.$type+"#"+e.$name),e.children.length>0&&e.children.forEach(s=>{let i=this._getNestedLookupTypeString(s).replace(/\^_/,"");i&&typeof i=="string"&&(t+="_"+i)}),t}};at.MessageElement=fT;var D8=class extends dr{static{o(this,"DocumentationElement")}};at.DocumentationElement=D8;var tg=class _8 extends dr{static{o(this,"SchemaElement")}constructor(){super(...arguments),this.allowedChildren=nn(["complexType","element","import","include","simpleType"]),this.complexTypes={},this.types={},this.elements={},this.includes=[]}merge(e){return(0,aT.ok)(e instanceof _8),Ki.merge(this.complexTypes,e.complexTypes),Ki.merge(this.types,e.types),Ki.merge(this.elements,e.elements),Ki.merge(this.xmlns,e.xmlns),Ki.merge(this,Ki.pickBy(e,(t,n)=>n.startsWith("$")&&!Object.hasOwnProperty.call(this,n))),this}addChild(e){if(!(e.$name in JS)){if(e instanceof yT||e instanceof vT){let t=e.$schemaLocation||e.$location;t&&this.includes.push({namespace:e.$namespace||e.$targetNamespace||this.$targetNamespace,location:t})}else e instanceof eE?this.complexTypes[e.$name]=e:e instanceof oT?this.elements[e.$name]=e:e instanceof YS&&(this.types[e.$name]=e);this.children.pop()}}};at.SchemaElement=tg;var hT=class extends dr{static{o(this,"TypesElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","schema"]),this.schemas={}}addChild(e){(0,aT.ok)(e instanceof tg);let t=e.includes.find(i=>Object.hasOwnProperty.call(i,"namespace")),n=typeof t<"u"&&Object.hasOwnProperty.call(t,"namespace")&&e instanceof tg?t.namespace:void 0,s=e.$targetNamespace||e.includes[0]?.namespace||n;Object.hasOwnProperty.call(this.schemas,s)?s===e.$targetNamespace?this.schemas[s]=e:console.error('Target-Namespace "'+s+'" already in use by another Schema!'):this.schemas[s]=e}};at.TypesElement=hT;var R8=class P8 extends dr{static{o(this,"OperationElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","fault","input","operation","output"]),this.input=null,this.output=null,this.inputSoap=null,this.outputSoap=null,this.style="",this.soapAction=""}addChild(e){e instanceof P8&&(this.soapAction=e.$soapAction||"",this.style=e.$style||"",this.children.pop())}postProcess(e,t){let n=this.children;for(let s=0;s<n.length;s++){let i=n[s];if(i.name!=="input"&&i.name!=="output")continue;if(t==="binding"){this[i.name]=i,n.splice(s--,1);continue}let a=(0,Yn.splitQName)(i.$message).name,u=e.messages[a];u&&(u.postProcess(e),u.element?(e.messages[u.element.$name]=u,this[i.name]=u.element):this[i.name]=u,n.splice(s--,1))}this.deleteFixedAttrs()}description(e){let t=this.input?this.input.description(e):null,n=this.output?this.output.description(e):null;return{input:t&&t[Object.keys(t)[0]],output:n&&n[Object.keys(n)[0]]}}};at.OperationElement=R8;var pT=class extends dr{static{o(this,"PortTypeElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","operation"]),this.methods={}}postProcess(e){let t=this.children;if(!(typeof t>"u")){for(let n=0;n<t.length;n++){let s=t[n];s.name==="operation"&&(s.postProcess(e,"portType"),this.methods[s.$name]=s,t.splice(n--,1))}delete this.$name,this.deleteFixedAttrs()}}description(e){let t={};for(let n in this.methods){let s=this.methods[n];t[n]=s.description(e)}return t}};at.PortTypeElement=pT;var dT=class extends dr{static{o(this,"BindingElement")}constructor(){super(...arguments),this.allowedChildren=nn(["binding","documentation","operation","SecuritySpec"]),this.transport="",this.style="",this.methods={}}addChild(e){e.name==="binding"&&(this.transport=e.$transport,this.style=e.$style,this.children.pop())}postProcess(e){let t=(0,Yn.splitQName)(this.$type).name,n=e.portTypes[t],s=this.style,i=this.children;if(n){n.postProcess(e),this.methods=n.methods;for(let a=0;a<i.length;a++){let u=i[a];if(u.name!=="operation")continue;u.postProcess(e,"binding"),i.splice(a--,1),u.style||(u.style=s);let l=this.methods[u.$name];l&&(l.style=u.style,l.soapAction=u.soapAction,l.inputSoap=u.input||null,l.outputSoap=u.output||null,l.inputSoap&&l.inputSoap.deleteFixedAttrs(),l.outputSoap&&l.outputSoap.deleteFixedAttrs())}}delete this.$name,delete this.$type,this.deleteFixedAttrs()}description(e){let t={};for(let n in this.methods){let s=this.methods[n];t[n]=s.description(e)}return t}};at.BindingElement=dT;var O8=class extends dr{static{o(this,"PortElement")}constructor(){super(...arguments),this.allowedChildren=nn(["address","documentation"]),this.location=null}addChild(e){e.name==="address"&&typeof e.$location<"u"&&(this.location=e.$location)}};at.PortElement=O8;var mT=class extends dr{static{o(this,"ServiceElement")}constructor(){super(...arguments),this.allowedChildren=nn(["documentation","port"]),this.ports={}}postProcess(e){let t=this.children,n=e.bindings;if(t&&t.length>0)for(let s=0;s<t.length;s++){let i=t[s];if(i.name!=="port")continue;let a=(0,Yn.splitQName)(i.$binding).name,u=n[a];u&&(u.postProcess(e),this.ports[i.$name]={location:i.location,binding:u},t.splice(s--,1))}delete this.$name,this.deleteFixedAttrs()}description(e){let t={};for(let n in this.ports){let s=this.ports[n];t[n]=s.binding.description(e)}return t}};at.ServiceElement=mT;var gT=class extends dr{static{o(this,"DefinitionsElement")}constructor(){super(...arguments),this.allowedChildren=nn(["binding","documentation","import","message","portType","service","types"]),this.messages={},this.portTypes={},this.bindings={},this.services={},this.schemas={},this.descriptions={types:{},elements:{}}}init(){this.name!=="definitions"&&this.unexpected(this.nsName)}addChild(e){if(e instanceof hT)Ki.merge(this.schemas,e.schemas);else if(e instanceof fT)this.messages[e.$name]=e;else if(e.name==="import"){let t=new tg(e.$namespace,{});t.init(),this.schemas[e.$namespace]=t,this.schemas[e.$namespace].addChild(e)}else e instanceof pT?this.portTypes[e.$name]=e:e instanceof dT?(e.transport==="http://schemas.xmlsoap.org/soap/http"||e.transport==="http://www.w3.org/2003/05/soap/bindings/HTTP/")&&(this.bindings[e.$name]=e):e instanceof mT&&(this.services[e.$name]=e);this.children.pop()}};at.DefinitionsElement=gT;var tE=class extends dr{static{o(this,"BodyElement")}};at.BodyElement=tE;var yT=class extends dr{static{o(this,"IncludeElement")}};at.IncludeElement=yT;var vT=class extends dr{static{o(this,"ImportElement")}};at.ImportElement=vT;var Dte={all:cT,any:zS,binding:dT,body:tE,choice:rg,complexContent:uT,complexType:eE,definitions:gT,documentation:D8,element:oT,enumeration:B8,extension:ZS,fault:dr,import:vT,include:yT,input:T8,message:fT,operation:R8,output:I8,port:O8,portType:pT,restriction:QS,schema:tg,sequence:ng,service:mT,simpleContent:lT,simpleType:YS,types:hT,attribute:$i};function nn(r){let e={};for(let t of r)e[t.replace(/^_/,"")]=Dte[t]||dr;return e}o(nn,"buildAllowedChildren");function Ku(r,...e){for(let t of e)if(t?.[r])return t[r]}o(Ku,"findNs")});var ET=ye(Is=>{"use strict";var _te=Is&&Is.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Rte=Is&&Is.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ap=Is&&Is.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&_te(t,e,n[s]);return Rte(t,e),t}})(),M8=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});Is.WSDL=void 0;Is.trim=ST;Is.open_wsdl=j8;var Pte=gt("assert"),Ote=M8(pw()),kte=Ap(gt("fs")),L8=Ap(go()),sg=Ap(gt("path")),rE=Ap(iT()),Lte=M8(C8()),Vte=Ap(gt("url")),Ute=CS(),Mte=b8(),Nr=Lu(),Ic=Ap(k8()),V8=(0,Ote.default)("node-soap"),U8="http://www.w3.org/2001/XMLSchema-instance",jte="http://schemas.xmlsoap.org/soap/envelope/";function ST(r){return r.trim()}o(ST,"trim");function nE(r){return r&&r.charAt(r.length-1)!==":"?r+":":r}o(nE,"appendColon");function wT(r){return r&&r.charAt(r.length-1)===":"?r.substring(0,r.length-1):r}o(wT,"noColonNameSpace");var sE=class{static{o(this,"WSDL")}constructor(e,t,n){this.ignoredNamespaces=["tns","targetNamespace","typedNamespace"],this.ignoreBaseNameSpaces=!1,this.valueKey="$value",this.xmlKey="$xml";let s;if(this.uri=t,this.callback=()=>{},this._includesWsdl=[],this.WSDL_CACHE={},n&&n.WSDL_CACHE&&(this.WSDL_CACHE=n.WSDL_CACHE),this._initializeOptions(n),typeof e=="string")e=(0,Lte.default)(e),s=this._fromXML;else if(typeof e=="object")s=this._fromServices;else throw new Error("WSDL constructor takes either an XML string or service definition");process.nextTick(()=>{try{s.call(this,e)}catch(i){return this.callback(i)}this.processIncludes(i=>{let a;if(i)return this.callback(i);try{this.definitions.deleteFixedAttrs();let u=this.services=this.definitions.services;if(u)for(a in u)u[a].postProcess(this.definitions);let l=this.definitions.complexTypes;if(l)for(a in l)l[a].deleteFixedAttrs();let f=this.definitions.bindings;for(let h in f){let m=f[h];typeof m.style>"u"&&(m.style="document");let g=m.methods,w=m.topElements={};for(let y in g)if((g[y].style||m.style)==="document"&&g[y].input){let S=g[y].input.$name,E="";g[y].output&&(E=g[y].output.$name),w[S]={methodName:y,outputName:E}}}this.xmlnsInEnvelope=this._xmlnsMap(),this.callback(i,this)}catch(u){this.callback(u)}})})}onReady(e){e&&(this.callback=e)}processIncludes(e){let t=this.definitions.schemas,n=[];for(let s in t){let i=t[s];n=n.concat(i.includes||[])}this._processNextInclude(n,e)}describeServices(){let e={};for(let t in this.services){let n=this.services[t];e[t]=n.description(this.definitions)}return e}toXML(){return this.xml||""}getSaxStream(e){let t=rE.createStream(!0,null);return e.pipe(t),t}xmlToObject(e,t){let n=typeof t=="function"?{}:rE.parser(!0,null),s=null,i={},u=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],l=new Map,f="soap",h={},m={};if(n.onopentag=w=>{let y=w.name,S=w.attributes,E=(0,Nr.splitQName)(y).name,b,T=u[u.length-1],A=T.schema,C={},x=!1,B=!1,F={},R=E;if(S.href){let K=S.href.substr(1);m[K]||(m[K]={hrefs:[],obj:null}),m[K].hrefs.push({par:T.object,key:E,obj:F})}S.id&&(m[S.id]||(m[S.id]={hrefs:[],obj:null}));for(b in S){let K=S[b];if(/^xmlns:|^xmlns$/.test(b)){let G=(0,Nr.splitQName)(b).name;h[G]=K,K===U8&&l.set(G,K),K===jte&&(f=G);continue}x=!0,C[b]=K}for(b in C){let K=(0,Nr.splitQName)(b);if(K.name==="nil"&&h[K.prefix]===U8&&C[b]&&(C[b].toLowerCase()==="true"||C[b]==="1")){B=!0;break}}if(x&&(F[this.options.attributesKey]=C),!s&&h[f]&&T.name==="Body"&&E!=="Fault"){let K=this.definitions.messages[E];if(!K)try{let G=!1;/Response$/.test(E)?E=E.replace(/Response$/,""):/Request$/.test(E)?(G=!0,E=E.replace(/Request$/,"")):/Solicit$/.test(E)&&(G=!0,E=E.replace(/Solicit$/,""));let he=this.definitions.portTypes,le=Object.keys(he),oe=he[le[0]];G?E=oe.methods[E].input.$name:E=oe.methods[E].output.$name,K=this.definitions.messages[E],this.definitions.messages[R]=this.definitions.messages[E]}catch(G){this.options.returnFault&&n.onerror(G)}A=K.description(this.definitions),s=R}let H,q;for(let K of l.keys())if(`${K}:type`in C){q=C[`${K}:type`];break}if(q){let K=(0,Nr.splitQName)(q),G;K.prefix===Nr.TNS_PREFIX?G=h[K.prefix]||h.xmlns:G=h[K.prefix];let he=this.findSchemaObject(G,K.name);he&&(H=he.description(this.definitions))}A&&A[E+"[]"]&&(E=E+"[]"),u.push({name:R,object:F,schema:H||A&&A[E],id:S.id,nil:B})},n.onclosetag=w=>{let y=u.pop(),S=y.object,E=u[u.length-1],b=E.object,T=E.schema,A=(0,Nr.splitQName)(w).name;if(typeof y.schema=="string"&&(y.schema==="string"||y.schema.split(":")[1]==="string")&&typeof S=="object"&&Object.keys(S).length===0&&(S=y.object=this.options.preserveWhitespace&&y.text||""),y.nil===!0)if(this.options.handleNilAsNull)S=null;else return;L8.isPlainObject(S)&&!Object.keys(S).length&&(S=null),T&&T[A+"[]"]?(b[A]||(b[A]=[]),b[A].push(S)):A in b?(Array.isArray(b[A])||(b[A]=[b[A]]),b[A].push(S)):b[A]=S,y.id&&(m[y.id].obj=S)},n.oncdata=w=>{let y=w;if(w=ST(w),!!w.length)if(/<\?xml[\s\S]+\?>/.test(w)){let S=u[u.length-1],E=this.xmlToObject(w);S.object[this.options.attributesKey]?S.object[this.options.valueKey]=E:S.object=E}else n.ontext(y)},n.onerror=w=>{throw n.resume(),{Fault:{faultcode:500,faultstring:"Invalid XML",detail:new Error(w).message,statusCode:500}}},n.ontext=w=>{let y=u[u.length-1],S=w;if(w=ST(w),!w.length){this.options.preserveWhitespace&&(y.text=(y.text||"")+S);return}let E=(0,Nr.splitQName)(y.schema).name,b;this.options&&this.options.customDeserializer&&this.options.customDeserializer[E]?b=this.options.customDeserializer[E](w,y):E==="int"||E==="integer"||E==="short"||E==="long"?b=parseInt(w,10):E==="double"||E==="float"||E==="decimal"?b=Number(w):E==="bool"||E==="boolean"?b=w.toLowerCase()==="true"||w==="1":E==="dateTime"||E==="date"?b=new Date(w):(this.options.preserveWhitespace&&(w=S),typeof y.object!="string"?b=w:b=y.object+w),y.object[this.options.attributesKey]?y.object[this.options.valueKey]=b:y.object=b},typeof t=="function"){let w=rE.createStream(!0,null);w.on("opentag",n.onopentag),w.on("closetag",n.onclosetag),w.on("cdata",n.oncdata),w.on("text",n.ontext),e.pipe(w).on("error",y=>{t(y)}).on("end",()=>{let y;try{y=g()}catch(S){return t(S)}t(null,y)});return}return n.write(e).close(),g();function g(){for(let w in m){let y=m[w];for(let S of y.hrefs)Object.assign(S.obj,y.obj)}if(i.Envelope){let w=i.Envelope.Body;if(w&&w.Fault){let y=w.Fault,S=y.faultcode&&y.faultcode.$value,E=y.faultstring&&y.faultstring.$value,b=y.detail&&y.detail.$value;S=S||y.faultcode,E=E||y.faultstring,b=b||y.detail,S=S||y.Code&&`${y.Code.Value}: ${y.Code.Subcode&&y.Code.Subcode.Value}`,E=E||y.Reason&&y.Reason.Text.$value,E=E||y.Reason&&y.Reason.Text,b=b||y.Detail;let T=new Error(S+": "+E+(b?": "+JSON.stringify(b):""));throw T.root=i,T}return i.Envelope}return i}o(g,"finish")}findSchemaObject(e,t){if(!e||!t)return null;let n=null;if(this.definitions.schemas){let s=this.definitions.schemas[e];s&&(t.indexOf(":")!==-1&&(t=t.substring(t.indexOf(":")+1,t.length)),n=s.complexTypes[t]||s.types[t]||s.elements[t])}return n}objectToDocumentXML(e,t,n,s,i){if(t&&t._xml)return t._xml;let a={};a[e]=t;let u=i?this.findSchemaObject(s,i):null;return this.objectToXML(a,null,n,s,!0,null,u)}objectToRpcXML(e,t,n,s,i){let a=[],u=this.definitions,l="_xmlns";n=n||(0,Nr.findPrefix)(u.xmlns,s),s=s||u.xmlns[n],n=n===Nr.TNS_PREFIX?"":n+":",a.push(["<",n,e,">"].join(""));for(let f in t)if(Object.prototype.hasOwnProperty.call(t,f)&&f!==l){let h=t[f];if(f===this.options.xmlKey)a.push(this.objectToXML({[f]:h},null,n,s));else{let m=(i?"":n)+f,g=[];if(typeof h=="object"&&Object.prototype.hasOwnProperty.call(h,this.options.attributesKey)){let w=h[this.options.attributesKey];for(let y in w)g.push(" "+y+'="'+w[y]+'"')}a.push(["<",m].concat(g).concat(">").join("")),a.push(typeof h=="object"?this.objectToXML(h,f,n,s):(0,Nr.xmlEscape)(h)),a.push(["</",m,">"].join(""))}}return a.push(["</",n,e,">"].join("")),a.join("")}isIgnoredNameSpace(e){return this.options.ignoredNamespaces.indexOf(e)>-1}filterOutIgnoredNameSpace(e){let t=wT(e);return this.isIgnoredNameSpace(t)?"":t}objectToXML(e,t,n,s,i,a,u,l){let f=this.definitions.schemas[s];if(this.options.overrideElementKey&&Object.keys(this.options.overrideElementKey).length>0)for(let A in this.options.overrideElementKey){let C=this.options.overrideElementKey[A];e&&e[A]&&(Object.defineProperty(e,C,Object.getOwnPropertyDescriptor(e,A)),delete e[A])}let h=n?n.parent:void 0;typeof h<"u"&&(n=n.current),h=wT(h),this.isIgnoredNameSpace(h)&&(h="");let m=!f,g=f&&f.$elementFormDefault==="qualified",w=[],y=(n||g)&&n!==Nr.TNS_PREFIX,S="";s&&i&&(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes?this.options.overrideRootElement.xmlnsAttributes.forEach(A=>{S+=" "+A.name+'="'+A.value+'"'}):(y&&!this.isIgnoredNameSpace(n)&&(S+=" xmlns:"+n+'="'+s+'"'),(g||m)&&(S+=' xmlns="'+s+'"'))),l?l.pushContext():(l=new Mte.NamespaceContext,l.declareNamespace(n,s)),a&&!(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes)&&(S=a);let E="";this.options.overrideRootElement&&i?E=this.options.overrideRootElement.namespace:y&&(g||i||m)&&!this.isIgnoredNameSpace(n)&&(E=n);let b,T;if(Array.isArray(e)){let A="",C=!1,x=/^([^:]+):([^:]+)$/.exec(t);for(x?(A=x[1],t=x[2]):t[0]===":"&&(C=!0,t=t.substr(1)),b=0,T=e.length;b<T;b++){let B=e[b],F=this.processAttributes(B,l),R=A||h||E,H=this.objectToXML(B,t,n,s,!1,null,u,l),q=["<",t,F,S];C||(q=["<",nE(R),t,F,S]),H===""&&this.options.useEmptyTag?(q.push(" />"),w.push(q.join(""))):(q.push(">"),(this.options.namespaceArrayElements||b===0)&&w.push(q.join("")),w.push(H),(this.options.namespaceArrayElements||b===T-1)&&(C?w.push(["</",t,">"].join("")):w.push(["</",nE(R),t,">"].join(""))))}}else if(typeof e=="object"){let A="";for(t in e){if(e.hasOwnProperty||(e=Object.assign({},e)),!Object.prototype.hasOwnProperty.call(e,t)||t===this.options.attributesKey)continue;if(t===this.options.xmlKey)return l.popContext(),e[t];if(t===this.options.valueKey)return l.popContext(),(0,Nr.xmlEscape)(e[t]);let C=e[t];if(typeof C>"u")continue;let x=this.processAttributes(C,l),B="",F="",R=!1,H=/^([^:]+):([^:]+)$/.exec(t);if(H?(F=H[1]+":",t=H[2]):t[0]===":"&&(R=!0,t=t.substr(1)),i)B=this.objectToXML(C,t,n,s,!1,null,u,l);else if(this.definitions.schemas)if(f){let K=this.findChildSchemaObject(u,t);if(K&&(K.$type&&K.$type.indexOf("xsd:")===-1||K.$ref||K.$name)){let G="",he="",le,oe="",Z=K.$ref||K.$name;if(Z){Z=(0,Nr.splitQName)(Z),he=Z.name,Z.prefix===Nr.TNS_PREFIX?(le=K.$targetNamespace,G=l.registerNamespace(le),this.isIgnoredNameSpace(G)&&(G=n)):(G=Z.prefix,this.isIgnoredNameSpace(G)&&(G=n),le=f.xmlns[G]||this.definitions.xmlns[G]);let Se=!1;K.$name&&K.targetNamespace===void 0&&(K.$form==="unqualified"?Se=!0:K.$form==="qualified"?Se=!1:Se=f.$elementFormDefault!=="qualified"),Se&&(G=""),le&&G&&l.declareNamespace(G,le)&&(oe=" xmlns:"+G+'="'+le+'"',S.includes(G)||(A=oe,S+=oe))}let fe;if(K.$type){let Se=(0,Nr.splitQName)(K.$type),Ke=K.$baseNameSpace||Se.prefix,be=f.xmlns[Ke]||this.definitions.xmlns[Ke];le=be,be!=="http://www.w3.org/2001/XMLSchema"&&Ke!==Nr.TNS_PREFIX&&l.addNamespace(Ke,be),fe=this.findSchemaType(Se.name,be)||K}else fe=this.findSchemaObject(le,he)||K;K.$baseNameSpace&&this.options.ignoreBaseNameSpaces&&(G=n,le=s),this.options.ignoreBaseNameSpaces&&(G="",le=""),E=G,Array.isArray(C)?(G={current:G,parent:E},oe=oe&&oe.length?oe:A):oe=null,B=this.objectToXML(C,t,G,le,!1,oe,fe,l)}else e[this.options.attributesKey]&&e[this.options.attributesKey].xsi_type?(F=e[this.options.attributesKey].xsi_type.prefix,l.addNamespace(e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns),B=this.objectToXML(C,t,e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns,!1,null,null,l)):(Array.isArray(C)&&(R?t=":"+t:t=F+t),B=this.objectToXML(C,t,n,s,!1,null,null,l))}else B=this.objectToXML(C,t,n,s,!1,null,null,l);E=wT(E),y&&!g&&i&&!this.options.overrideRootElement?E=n:this.isIgnoredNameSpace(E)&&(E="");let q=!B&&this.options.useEmptyTag;Array.isArray(C)||w.push(["<",R?"":nE(F||E),t,x,S,C===null?' xsi:nil="true"':"",q?" />":">"].join("")),q||(w.push(B),Array.isArray(C)||w.push(["</",R?"":nE(F||E),t,">"].join("")))}}else e!==void 0&&w.push(this.options.escapeXML?(0,Nr.xmlEscape)(e):e);return l.popContext(),w.join("")}processAttributes(e,t){let n="";e==null&&(e=[]);let s=e[this.options.attributesKey]||{};if(s&&s.xsi_type){let i=s.xsi_type,a=i.prefix||i.namespace;i.xmlns&&(a?t.declareNamespace(a,i.xmlns):a=t.registerNamespace(i.xmlns),i.prefix=a)}return Object.keys(s).forEach(i=>{let a=s[i];if(i==="xsi_type"){let u=a.type;a.prefix&&(u=`${a.prefix}:${u}`),n+=` xsi:type="${u}"`,a.xmlns&&(n+=` xmlns:${a.prefix}="${a.xmlns}"`)}else n+=` ${i}="${(0,Nr.xmlEscape)(a)}"`}),n}findSchemaType(e,t){if(!this.definitions.schemas||!e||!t)return null;let n=this.definitions.schemas[t];return!n||!n.complexTypes?null:n.complexTypes[e]}findChildSchemaObject(e,t,n){if(!e||!t||(n||(n=[]),n.indexOf(e)>=0))return null;n=n.concat([e]);let s=null,i=0,a;if(Array.isArray(e.$lookupTypes)&&e.$lookupTypes.length){let f=e.$lookupTypes;for(i=0;i<f.length;i++){let h=f[i];if(h.$name===t){s=h;break}}}let u=e;if(u.$name===t&&u.name==="element"||u.$ref&&(a=(0,Nr.splitQName)(u.$ref),a.name===t))return u;let l;if(u.$type&&n.length===1){let f=(0,Nr.splitQName)(u.$type);f.prefix===Nr.TNS_PREFIX?l=e.$targetNamespace:l=this.definitions.xmlns[f.prefix];let h=this.findSchemaType(f.name,l);if(h)return this.findChildSchemaObject(h,t,n)}if(u.$base&&(!Array.isArray(u.children)||!u.children.length)){let f=(0,Nr.splitQName)(u.$base);l=e.$targetNamespace,f.prefix!==Nr.TNS_PREFIX&&(l=this.definitions.xmlns[f.prefix]);let h=this.findSchemaType(f.name,l);if(h)return this.findChildSchemaObject(h,t,n)}if(Array.isArray(u.children)&&u.children.length>0)for(let f of u.children){if(s=this.findChildSchemaObject(f,t,n),s)break;if(f.$base){let h=(0,Nr.splitQName)(f.$base),m=h.prefix===Nr.TNS_PREFIX?"":h.prefix;l=f.xmlns[h.prefix]||f.schemaXmlns[h.prefix];let g=this.findSchemaType(h.name,l);if(g&&(s=this.findChildSchemaObject(g,t,n),s)){s.$baseNameSpace=m;break}}}return!s&&u.$name===t?u:s}_initializeOptions(e){this._originalIgnoredNamespaces=(e||{}).ignoredNamespaces,this.options={};let t=e?e.ignoredNamespaces:null;t&&(Array.isArray(t.namespaces)||typeof t.namespaces=="string")?t.override?this.options.ignoredNamespaces=t.namespaces:this.options.ignoredNamespaces=this.ignoredNamespaces.concat(t.namespaces):this.options.ignoredNamespaces=this.ignoredNamespaces,this.options.valueKey=e.valueKey||this.valueKey,this.options.xmlKey=e.xmlKey||this.xmlKey,e.escapeXML!==void 0?this.options.escapeXML=e.escapeXML:this.options.escapeXML=!0,e.returnFault!==void 0?this.options.returnFault=e.returnFault:this.options.returnFault=!1,this.options.handleNilAsNull=!!e.handleNilAsNull,e.namespaceArrayElements!==void 0?this.options.namespaceArrayElements=e.namespaceArrayElements:this.options.namespaceArrayElements=!0,this.options.wsdl_headers=e.wsdl_headers,this.options.wsdl_options=e.wsdl_options,e.httpClient&&(this.options.httpClient=e.httpClient),e.request&&(this.options.request=e.request);let n=e?e.ignoreBaseNameSpaces:null;n!==null&&typeof n<"u"?this.options.ignoreBaseNameSpaces=n:this.options.ignoreBaseNameSpaces=this.ignoreBaseNameSpaces,this.options.forceSoap12Headers=e.forceSoap12Headers,this.options.customDeserializer=e.customDeserializer,this.options.forceUseSchemaXmlns=e.forceUseSchemaXmlns,e.overrideElementKey!==void 0&&(this.options.overrideElementKey=e.overrideElementKey),e.overrideRootElement!==void 0&&(this.options.overrideRootElement=e.overrideRootElement),this.options.useEmptyTag=!!e.useEmptyTag}_processNextInclude(e,t){let n=e.shift();if(!n)return t();let s;!/^https?:/i.test(this.uri)&&!/^https?:/i.test(n.location)?(this.options.wsdl_options!==void 0&&Object.prototype.hasOwnProperty.call(this.options.wsdl_options,"fixedPath")?this.options.wsdl_options.fixedPath:!1)?s=sg.resolve(sg.dirname(this.uri),sg.parse(n.location).base):s=sg.resolve(sg.dirname(this.uri),n.location):s=Vte.resolve(this.uri||"",n.location);let i=Object.assign({},this.options);if(i.ignoredNamespaces=this._originalIgnoredNamespaces||this.options.ignoredNamespaces,i.WSDL_CACHE=this.WSDL_CACHE,this.options.wsdl_options!==void 0&&typeof this.options.wsdl_options.overrideImportLocation=="function")try{s=this.options.wsdl_options.overrideImportLocation(s,this.uri,n.location,i)}catch(a){return t(a)}Fte(s,i,(a,u)=>{if(a)return t(a);if(this._includesWsdl.push(u),u.definitions instanceof Ic.DefinitionsElement)L8.mergeWith(this.definitions,u.definitions,(l,f)=>l instanceof Ic.SchemaElement?l.merge(f):void 0);else return t(new Error("wsdl.defintions is not an instance of elements.DefinitionsElement"));this._processNextInclude(e,l=>{t(l)})})}_parse(e){let t=rE.parser(!0,null),n=[],s=null,i=null,a=null,u=null,l=this.options;return t.onopentag=f=>{let h=f.name,m=f.attributes,g=n[n.length-1],w=(0,Nr.splitQName)(h).name;if(w==="schema"&&(u=m),g)try{g.startElement(n,h,m,l,u)}catch(y){if(this.options.strict)throw y;n.push(new Ic.Element(h,m,l,u))}else if(w==="definitions")s=new Ic.DefinitionsElement(h,m,l),n.push(s);else if(w==="schema")s=new Ic.DefinitionsElement("definitions",{},{}),i=new Ic.TypesElement("types",{},{}),a=new Ic.SchemaElement(h,m,l),i.addChild(a),s.addChild(i),n.push(a);else throw w==="html"?new Error("Root element of WSDL was <html>. This is likely an authentication issue."):new Error("Unexpected root element of WSDL or include")},t.onclosetag=f=>{let h=n[n.length-1];(0,Pte.ok)(h,"Unmatched close tag: "+f),h.endElement(n,f)},t.write(e).close(),s}_fromXML(e){this.definitions=this._parse(e),this.definitions.descriptions={types:{},elements:{}},this.xml=e}_fromServices(e){}_xmlnsMap(){let e=this.definitions.xmlns,t="";for(let n in e){if(n===""||n===Nr.TNS_PREFIX)continue;let s=e[n];switch(s){case"http://xml.apache.org/xml-soap":case"http://schemas.xmlsoap.org/wsdl/":case"http://schemas.xmlsoap.org/wsdl/soap/":case"http://schemas.xmlsoap.org/wsdl/soap12/":case"http://schemas.xmlsoap.org/soap/encoding/":case"http://www.w3.org/2001/XMLSchema":continue}~s.indexOf("http://schemas.xmlsoap.org/")||~s.indexOf("http://www.w3.org/")||~s.indexOf("http://xml.apache.org/")||(t+=" xmlns:"+n+'="'+s+'"')}return t}};Is.WSDL=sE;function Fte(r,e,t){let n,s;typeof e=="function"?(n={},s=e):(n=e,s=t);let i=n.WSDL_CACHE[r];return i?s.call(i,null,i):j8(r,n,s)}o(Fte,"open_wsdl_recursive");function j8(r,e,t){let n,s;typeof e=="function"?(n={},s=e):typeof t=="function"&&(n=e,s=t);let i=n.WSDL_CACHE||{},a=n.wsdl_headers,u=n.wsdl_options,l;return/^<\?xml[^>]*?>/i.test(r)?(l=new sE(r,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):/^https?:/i.test(r)?(V8("Reading url: %s",r),(n.httpClient||new Ute.HttpClient(n)).request(r,null,(h,m,g)=>{h?s(h):m&&m.status===200?(l=new sE(g,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):s(new Error("Invalid WSDL URL: "+r+`
78
+
79
+ \r Code: `+m.status+`
80
+
81
+ \r Response Body: `+m.data))},a,u)):(V8("Reading file: %s",r),kte.readFile(r,"utf8",(f,h)=>{f?s(f):(l=new sE(h,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s))})),l}o(j8,"open_wsdl")});var q8=ye(F8=>{"use strict";Object.defineProperty(F8,"__esModule",{value:!0})});var X8=ye(Ot=>{"use strict";var H8=Ot&&Ot.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),qte=Ot&&Ot.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Hte=Ot&&Ot.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&H8(t,e,n[s]);return qte(t,e),t}})(),Kte=Ot&&Ot.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&H8(e,r,t)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WSDL=Ot.passwordDigest=Ot.Server=Ot.WSSecurityCertWithToken=Ot.WSSecurityPlusCert=Ot.WSSecurityCert=Ot.WSSecurity=Ot.NTLMSecurity=Ot.ClientSSLSecurityPFX=Ot.ClientSSLSecurity=Ot.BearerSecurity=Ot.BasicAuthSecurity=Ot.HttpClient=Ot.Client=Ot.security=void 0;Ot.createClient=$8;Ot.createClientAsync=rre;Ot.listen=nre;var $te=AN(),Xte=Hte(nT()),Gte=sT(),Wte=Lu(),K8=ET();Ot.security=Xte;var Jte=AN();Object.defineProperty(Ot,"Client",{enumerable:!0,get:o(function(){return Jte.Client},"get")});var zte=CS();Object.defineProperty(Ot,"HttpClient",{enumerable:!0,get:o(function(){return zte.HttpClient},"get")});var Ao=nT();Object.defineProperty(Ot,"BasicAuthSecurity",{enumerable:!0,get:o(function(){return Ao.BasicAuthSecurity},"get")});Object.defineProperty(Ot,"BearerSecurity",{enumerable:!0,get:o(function(){return Ao.BearerSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurity",{enumerable:!0,get:o(function(){return Ao.ClientSSLSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurityPFX",{enumerable:!0,get:o(function(){return Ao.ClientSSLSecurityPFX},"get")});Object.defineProperty(Ot,"NTLMSecurity",{enumerable:!0,get:o(function(){return Ao.NTLMSecurity},"get")});Object.defineProperty(Ot,"WSSecurity",{enumerable:!0,get:o(function(){return Ao.WSSecurity},"get")});Object.defineProperty(Ot,"WSSecurityCert",{enumerable:!0,get:o(function(){return Ao.WSSecurityCert},"get")});Object.defineProperty(Ot,"WSSecurityPlusCert",{enumerable:!0,get:o(function(){return Ao.WSSecurityPlusCert},"get")});Object.defineProperty(Ot,"WSSecurityCertWithToken",{enumerable:!0,get:o(function(){return Ao.WSSecurityCertWithToken},"get")});var Yte=sT();Object.defineProperty(Ot,"Server",{enumerable:!0,get:o(function(){return Yte.Server},"get")});var Qte=Lu();Object.defineProperty(Ot,"passwordDigest",{enumerable:!0,get:o(function(){return Qte.passwordDigest},"get")});Kte(q8(),Ot);var Zte=ET();Object.defineProperty(Ot,"WSDL",{enumerable:!0,get:o(function(){return Zte.WSDL},"get")});function ere(r,e,t,n){e.has(r)?process.nextTick(()=>{n(null,e.get(r))}):t((s,i)=>{if(s)return n(s);e.set(r,i),n(null,i)})}o(ere,"getFromCache");function tre(r,e,t){typeof e=="function"&&(t=e,e={});let n=o(s=>{(0,K8.open_wsdl)(r,e,s)},"openWsdl");if(e.disableCache===!0)n(t);else{let s;e.wsdlCache?s=e.wsdlCache:s=Wte.wsdlCacheSingleton,ere(r,s,n,t)}}o(tre,"_requestWSDL");function $8(r,e,t,n){let s=n,i,a;typeof e=="function"?(i=e,s=t,a={}):typeof t=="function"&&(a=e,i=t,s=n),s=a.endpoint||s,tre(r,a,(u,l)=>{i(u,l&&new $te.Client(l,s,a))})}o($8,"createClient");function rre(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,s)=>{$8(r,e,(i,a)=>{i&&s(i),n(a)},t)})}o(rre,"createClientAsync");function nre(r,e,t,n,s){let i,a,u="";typeof e=="object"&&!(e instanceof RegExp)?(i=e,a=i.path,t=i.services,n=i.xml,u=i.uri):(a=e,i={path:e,services:t,callback:s});let l=new K8.WSDL(n||t,u,i);return new Gte.Server(r,a,t,l,i)}o(nre,"listen")});var iE=ye(AT=>{"use strict";(function(){AT.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
82
+ `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(AT)});var Va=ye((Y8,$u)=>{"use strict";(function(){var r,e,t,n,s,i,a,u=[].slice,l={}.hasOwnProperty;r=o(function(){var f,h,m,g,w,y;if(y=arguments[0],w=2<=arguments.length?u.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(f=0,m=w.length;f<m;f++)if(g=w[f],g!=null)for(h in g)l.call(g,h)&&(y[h]=g[h]);return y},"assign"),s=o(function(f){return!!f&&Object.prototype.toString.call(f)==="[object Function]"},"isFunction"),i=o(function(f){var h;return!!f&&((h=typeof f)=="function"||h==="object")},"isObject"),t=o(function(f){return s(Array.isArray)?Array.isArray(f):Object.prototype.toString.call(f)==="[object Array]"},"isArray"),n=o(function(f){var h;if(t(f))return!f.length;for(h in f)if(l.call(f,h))return!1;return!0},"isEmpty"),a=o(function(f){var h,m;return i(f)&&(m=Object.getPrototypeOf(f))&&(h=m.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),e=o(function(f){return s(f.valueOf)?f.valueOf():f},"getValue"),$u.exports.assign=r,$u.exports.isFunction=s,$u.exports.isObject=i,$u.exports.isArray=t,$u.exports.isEmpty=n,$u.exports.isPlainObject=a,$u.exports.getValue=e}).call(Y8)});var CT=ye((Q8,Z8)=>{"use strict";(function(){var r;Z8.exports=r=(function(){function e(){}return o(e,"XMLDOMImplementation"),e.prototype.hasFeature=function(t,n){return!0},e.prototype.createDocumentType=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(Q8)});var r5=ye((e5,t5)=>{"use strict";(function(){var r;t5.exports=r=(function(){function e(){}return o(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(e5)});var i5=ye((n5,s5)=>{"use strict";(function(){var r;s5.exports=r=(function(){function e(t){this.arr=t||[]}return o(e,"XMLDOMStringList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.arr.length},"get")}),e.prototype.item=function(t){return this.arr[t]||null},e.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},e})()}).call(n5)});var u5=ye((a5,o5)=>{"use strict";(function(){var r,e,t;e=r5(),t=i5(),o5.exports=r=(function(){function n(){var s;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=s=Object.create(this.defaultParams)}return o(n,"XMLDOMConfiguration"),Object.defineProperty(n.prototype,"parameterNames",{get:o(function(){return new t(Object.keys(this.defaultParams))},"get")}),n.prototype.getParameter=function(s){return this.params.hasOwnProperty(s)?this.params[s]:null},n.prototype.canSetParameter=function(s,i){return!0},n.prototype.setParameter=function(s,i){return i!=null?this.params[s]=i:delete this.params[s]},n})()}).call(a5)});var sn=ye((l5,c5)=>{"use strict";(function(){c5.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(l5)});var bT=ye((f5,h5)=>{"use strict";(function(){var r,e,t;r=sn(),t=Ws(),h5.exports=e=(function(){function n(s,i,a){if(this.parent=s,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),i==null)throw new Error("Missing attribute name. "+this.debugInfo(i));this.name=this.stringify.name(i),this.value=this.stringify.attValue(a),this.type=r.Attribute,this.isId=!1,this.schemaTypeInfo=null}return o(n,"XMLAttribute"),Object.defineProperty(n.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(n.prototype,"ownerElement",{get:o(function(){return this.parent},"get")}),Object.defineProperty(n.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(s){return this.value=s||""},"set")}),Object.defineProperty(n.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(n.prototype,"specified",{get:o(function(){return!0},"get")}),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(s){return this.options.writer.attribute(this,this.options.writer.filterOptions(s))},n.prototype.debugInfo=function(s){return s=s||this.name,s==null?"parent: <"+this.parent.name+">":"attribute: {"+s+"}, parent: <"+this.parent.name+">"},n.prototype.isEqualNode=function(s){return!(s.namespaceURI!==this.namespaceURI||s.prefix!==this.prefix||s.localName!==this.localName||s.value!==this.value)},n})()}).call(f5)});var aE=ye((p5,d5)=>{"use strict";(function(){var r;d5.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNamedNodeMap"),Object.defineProperty(e.prototype,"length",{get:o(function(){return Object.keys(this.nodes).length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(t){return this.nodes[t]},e.prototype.setNamedItem=function(t){var n;return n=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,n||null},e.prototype.removeNamedItem=function(t){var n;return n=this.nodes[t],delete this.nodes[t],n||null},e.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},e.prototype.getNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(p5)});var oE=ye((m5,g5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f=o(function(m,g){for(var w in g)h.call(g,w)&&(m[w]=g[w]);function y(){this.constructor=m}return o(y,"ctor"),y.prototype=g.prototype,m.prototype=new y,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;l=Va(),u=l.isObject,a=l.isFunction,i=l.getValue,s=Ws(),r=sn(),e=bT(),n=aE(),g5.exports=t=(function(m){f(g,m);function g(w,y,S){var E,b,T,A;if(g.__super__.constructor.call(this,w),y==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(y),this.type=r.Element,this.attribs={},this.schemaTypeInfo=null,S!=null&&this.attribute(S),w.type===r.Document&&(this.isRoot=!0,this.documentObject=w,w.rootObject=this,w.children)){for(A=w.children,b=0,T=A.length;b<T;b++)if(E=A[b],E.type===r.DocType){E.name=this.name;break}}}return o(g,"XMLElement"),Object.defineProperty(g.prototype,"tagName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"id",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"className",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"classList",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"attributes",{get:o(function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap},"get")}),g.prototype.clone=function(){var w,y,S,E;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attribs={},E=this.attribs;for(y in E)h.call(E,y)&&(w=E[y],S.attribs[y]=w.clone());return S.children=[],this.children.forEach(function(b){var T;return T=b.clone(),T.parent=S,S.children.push(T)}),S},g.prototype.attribute=function(w,y){var S,E;if(w!=null&&(w=i(w)),u(w))for(S in w)h.call(w,S)&&(E=w[S],this.attribute(S,E));else a(y)&&(y=y.apply()),this.options.keepNullAttributes&&y==null?this.attribs[w]=new e(this,w,""):y!=null&&(this.attribs[w]=new e(this,w,y));return this},g.prototype.removeAttribute=function(w){var y,S,E;if(w==null)throw new Error("Missing attribute name. "+this.debugInfo());if(w=i(w),Array.isArray(w))for(S=0,E=w.length;S<E;S++)y=w[S],delete this.attribs[y];else delete this.attribs[w];return this},g.prototype.toString=function(w){return this.options.writer.element(this,this.options.writer.filterOptions(w))},g.prototype.att=function(w,y){return this.attribute(w,y)},g.prototype.a=function(w,y){return this.attribute(w,y)},g.prototype.getAttribute=function(w){return this.attribs.hasOwnProperty(w)?this.attribs[w].value:null},g.prototype.setAttribute=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(w){return this.attribs.hasOwnProperty(w)?this.attribs[w]:null},g.prototype.setAttributeNode=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(w,y,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(w){return this.attribs.hasOwnProperty(w)},g.prototype.hasAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(w,y){return this.attribs.hasOwnProperty(w)?this.attribs[w].isId:y},g.prototype.setIdAttributeNS=function(w,y,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(w){var y,S,E;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(w)||w.namespaceURI!==this.namespaceURI||w.prefix!==this.prefix||w.localName!==this.localName||w.attribs.length!==this.attribs.length)return!1;for(y=S=0,E=this.attribs.length-1;0<=E?S<=E:S>=E;y=0<=E?++S:--S)if(!this.attribs[y].isEqualNode(w.attribs[y]))return!1;return!0},g})(s)}).call(m5)});var ig=ye((y5,v5)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=Ws(),v5.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a),this.value=""}return o(i,"XMLCharacterData"),Object.defineProperty(i.prototype,"data",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),Object.defineProperty(i.prototype,"length",{get:o(function(){return this.value.length},"get")}),Object.defineProperty(i.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.insertData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(a,u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(a){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.data!==this.data)},i})(e)}).call(y5)});var uE=ye((w5,S5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),t=ig(),S5.exports=e=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=r.CData,this.value=this.stringify.cdata(l)}return o(a,"XMLCData"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.cdata(this,this.options.writer.filterOptions(u))},a})(t)}).call(w5)});var lE=ye((E5,A5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=ig(),A5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=r.Comment,this.value=this.stringify.comment(l)}return o(a,"XMLComment"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.comment(this,this.options.writer.filterOptions(u))},a})(e)}).call(E5)});var cE=ye((C5,b5)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Va().isObject,t=Ws(),r=sn(),b5.exports=e=(function(a){s(u,a);function u(l,f,h,m){var g;u.__super__.constructor.call(this,l),n(f)&&(g=f,f=g.version,h=g.encoding,m=g.standalone),f||(f="1.0"),this.type=r.Declaration,this.version=this.stringify.xmlVersion(f),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return o(u,"XMLDeclaration"),u.prototype.toString=function(l){return this.options.writer.declaration(this,this.options.writer.filterOptions(l))},u})(t)}).call(C5)});var fE=ye((x5,N5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),N5.exports=e=(function(i){n(a,i);function a(u,l,f,h,m,g){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(f==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(l));if(!h)throw new Error("Missing DTD attribute type. "+this.debugInfo(l));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(l));if(m.indexOf("#")!==0&&(m="#"+m),!m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(l));if(g&&!m.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(l));this.elementName=this.stringify.name(l),this.type=r.AttributeDeclaration,this.attributeName=this.stringify.name(f),this.attributeType=this.stringify.dtdAttType(h),g&&(this.defaultValue=this.stringify.dtdAttDefault(g)),this.defaultValueType=m}return o(a,"XMLDTDAttList"),a.prototype.toString=function(u){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(u))},a})(t)}).call(x5)});var hE=ye((T5,I5)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Va().isObject,t=Ws(),r=sn(),I5.exports=e=(function(a){s(u,a);function u(l,f,h,m){if(u.__super__.constructor.call(this,l),h==null)throw new Error("Missing DTD entity name. "+this.debugInfo(h));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(h));if(this.pe=!!f,this.name=this.stringify.name(h),this.type=r.EntityDeclaration,!n(m))this.value=this.stringify.dtdEntityValue(m),this.internal=!0;else{if(!m.pubID&&!m.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(h));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(h));if(this.internal=!1,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.sysID)),m.nData!=null&&(this.nData=this.stringify.dtdNData(m.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(h))}}return o(u,"XMLDTDEntity"),Object.defineProperty(u.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(u.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(u.prototype,"notationName",{get:o(function(){return this.nData||null},"get")}),Object.defineProperty(u.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlVersion",{get:o(function(){return null},"get")}),u.prototype.toString=function(l){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(l))},u})(t)}).call(T5)});var pE=ye((B5,D5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),D5.exports=e=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());f||(f="(#PCDATA)"),Array.isArray(f)&&(f="("+f.join(",")+")"),this.name=this.stringify.name(l),this.type=r.ElementDeclaration,this.value=this.stringify.dtdElementValue(f)}return o(a,"XMLDTDElement"),a.prototype.toString=function(u){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(u))},a})(t)}).call(B5)});var dE=ye((_5,R5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),R5.exports=e=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD notation name. "+this.debugInfo(l));if(!f.pubID&&!f.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(l));this.name=this.stringify.name(l),this.type=r.NotationDeclaration,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID))}return o(a,"XMLDTDNotation"),Object.defineProperty(a.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(a.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),a.prototype.toString=function(u){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(u))},a})(t)}).call(_5)});var mE=ye((P5,O5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f=o(function(m,g){for(var w in g)h.call(g,w)&&(m[w]=g[w]);function y(){this.constructor=m}return o(y,"ctor"),y.prototype=g.prototype,m.prototype=new y,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;l=Va().isObject,u=Ws(),r=sn(),e=fE(),n=hE(),t=pE(),s=dE(),a=aE(),O5.exports=i=(function(m){f(g,m);function g(w,y,S){var E,b,T,A,C,x;if(g.__super__.constructor.call(this,w),this.type=r.DocType,w.children){for(A=w.children,b=0,T=A.length;b<T;b++)if(E=A[b],E.type===r.Element){this.name=E.name;break}}this.documentObject=w,l(y)&&(C=y,y=C.pubID,S=C.sysID),S==null&&(x=[y,S],S=x[0],y=x[1]),y!=null&&(this.pubID=this.stringify.dtdPubID(y)),S!=null&&(this.sysID=this.stringify.dtdSysID(S))}return o(g,"XMLDocType"),Object.defineProperty(g.prototype,"entities",{get:o(function(){var w,y,S,E,b;for(E={},b=this.children,y=0,S=b.length;y<S;y++)w=b[y],w.type===r.EntityDeclaration&&!w.pe&&(E[w.name]=w);return new a(E)},"get")}),Object.defineProperty(g.prototype,"notations",{get:o(function(){var w,y,S,E,b;for(E={},b=this.children,y=0,S=b.length;y<S;y++)w=b[y],w.type===r.NotationDeclaration&&(E[w.name]=w);return new a(E)},"get")}),Object.defineProperty(g.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(g.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(g.prototype,"internalSubset",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),g.prototype.element=function(w,y){var S;return S=new t(this,w,y),this.children.push(S),this},g.prototype.attList=function(w,y,S,E,b){var T;return T=new e(this,w,y,S,E,b),this.children.push(T),this},g.prototype.entity=function(w,y){var S;return S=new n(this,!1,w,y),this.children.push(S),this},g.prototype.pEntity=function(w,y){var S;return S=new n(this,!0,w,y),this.children.push(S),this},g.prototype.notation=function(w,y){var S;return S=new s(this,w,y),this.children.push(S),this},g.prototype.toString=function(w){return this.options.writer.docType(this,this.options.writer.filterOptions(w))},g.prototype.ele=function(w,y){return this.element(w,y)},g.prototype.att=function(w,y,S,E,b){return this.attList(w,y,S,E,b)},g.prototype.ent=function(w,y){return this.entity(w,y)},g.prototype.pent=function(w,y){return this.pEntity(w,y)},g.prototype.not=function(w,y){return this.notation(w,y)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(w){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(w)||w.name!==this.name||w.publicId!==this.publicId||w.systemId!==this.systemId)},g})(u)}).call(P5)});var gE=ye((k5,L5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=Ws(),L5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=r.Raw,this.value=this.stringify.raw(l)}return o(a,"XMLRaw"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.raw(this,this.options.writer.filterOptions(u))},a})(e)}).call(k5)});var yE=ye((V5,U5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=ig(),U5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=r.Text,this.value=this.stringify.text(l)}return o(a,"XMLText"),Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(a.prototype,"wholeText",{get:o(function(){var u,l,f;for(f="",l=this.previousSibling;l;)f=l.data+f,l=l.previousSibling;for(f+=this.data,u=this.nextSibling;u;)f=f+u.data,u=u.nextSibling;return f},"get")}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.text(this,this.options.writer.filterOptions(u))},a.prototype.splitText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a})(e)}).call(V5)});var vE=ye((M5,j5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=sn(),e=ig(),j5.exports=t=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=r.ProcessingInstruction,this.target=this.stringify.insTarget(l),this.name=this.target,f&&(this.value=this.stringify.insValue(f))}return o(a,"XMLProcessingInstruction"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(u))},a.prototype.isEqualNode=function(u){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.target!==this.target)},a})(e)}).call(M5)});var xT=ye((F5,q5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Ws(),r=sn(),q5.exports=e=(function(i){n(a,i);function a(u){a.__super__.constructor.call(this,u),this.type=r.Dummy}return o(a,"XMLDummy"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return""},a})(t)}).call(F5)});var $5=ye((H5,K5)=>{"use strict";(function(){var r;K5.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNodeList"),Object.defineProperty(e.prototype,"length",{get:o(function(){return this.nodes.length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(t){return this.nodes[t]||null},e})()}).call(H5)});var W5=ye((X5,G5)=>{"use strict";(function(){G5.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(X5)});var Ws=ye((J5,z5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A={}.hasOwnProperty;T=Va(),b=T.isObject,E=T.isFunction,S=T.isEmpty,y=T.getValue,u=null,t=null,n=null,s=null,i=null,g=null,w=null,m=null,a=null,e=null,h=null,l=null,r=null,z5.exports=f=(function(){function C(x){this.parent=x,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=oE(),t=uE(),n=lE(),s=cE(),i=mE(),g=gE(),w=yE(),m=vE(),a=xT(),e=sn(),h=$5(),l=aE(),r=W5())}return o(C,"XMLNode"),Object.defineProperty(C.prototype,"nodeName",{get:o(function(){return this.name},"get")}),Object.defineProperty(C.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(C.prototype,"nodeValue",{get:o(function(){return this.value},"get")}),Object.defineProperty(C.prototype,"parentNode",{get:o(function(){return this.parent},"get")}),Object.defineProperty(C.prototype,"childNodes",{get:o(function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new h(this.children)),this.childNodeList},"get")}),Object.defineProperty(C.prototype,"firstChild",{get:o(function(){return this.children[0]||null},"get")}),Object.defineProperty(C.prototype,"lastChild",{get:o(function(){return this.children[this.children.length-1]||null},"get")}),Object.defineProperty(C.prototype,"previousSibling",{get:o(function(){var x;return x=this.parent.children.indexOf(this),this.parent.children[x-1]||null},"get")}),Object.defineProperty(C.prototype,"nextSibling",{get:o(function(){var x;return x=this.parent.children.indexOf(this),this.parent.children[x+1]||null},"get")}),Object.defineProperty(C.prototype,"ownerDocument",{get:o(function(){return this.document()||null},"get")}),Object.defineProperty(C.prototype,"textContent",{get:o(function(){var x,B,F,R,H;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(H="",R=this.children,B=0,F=R.length;B<F;B++)x=R[B],x.textContent&&(H+=x.textContent);return H}else return null},"get"),set:o(function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},"set")}),C.prototype.setParent=function(x){var B,F,R,H,q;for(this.parent=x,x&&(this.options=x.options,this.stringify=x.stringify),H=this.children,q=[],F=0,R=H.length;F<R;F++)B=H[F],q.push(B.setParent(this));return q},C.prototype.element=function(x,B,F){var R,H,q,K,G,he,le,oe,Z,fe,Se;if(he=null,B===null&&F==null&&(Z=[{},null],B=Z[0],F=Z[1]),B==null&&(B={}),B=y(B),b(B)||(fe=[B,F],F=fe[0],B=fe[1]),x!=null&&(x=y(x)),Array.isArray(x))for(q=0,le=x.length;q<le;q++)H=x[q],he=this.element(H);else if(E(x))he=this.element(x.apply());else if(b(x)){for(G in x)if(A.call(x,G))if(Se=x[G],E(Se)&&(Se=Se.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&G.indexOf(this.stringify.convertAttKey)===0)he=this.attribute(G.substr(this.stringify.convertAttKey.length),Se);else if(!this.options.separateArrayItems&&Array.isArray(Se)&&S(Se))he=this.dummy();else if(b(Se)&&S(Se))he=this.element(G);else if(!this.options.keepNullNodes&&Se==null)he=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(Se))for(K=0,oe=Se.length;K<oe;K++)H=Se[K],R={},R[G]=H,he=this.element(R);else b(Se)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&G.indexOf(this.stringify.convertTextKey)===0?he=this.element(Se):(he=this.element(G),he.element(Se)):he=this.element(G,Se)}else!this.options.keepNullNodes&&F===null?he=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&x.indexOf(this.stringify.convertTextKey)===0?he=this.text(F):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&x.indexOf(this.stringify.convertCDataKey)===0?he=this.cdata(F):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&x.indexOf(this.stringify.convertCommentKey)===0?he=this.comment(F):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&x.indexOf(this.stringify.convertRawKey)===0?he=this.raw(F):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&x.indexOf(this.stringify.convertPIKey)===0?he=this.instruction(x.substr(this.stringify.convertPIKey.length),F):he=this.node(x,B,F);if(he==null)throw new Error("Could not create any elements with: "+x+". "+this.debugInfo());return he},C.prototype.insertBefore=function(x,B,F){var R,H,q,K,G;if(x?.type)return q=x,K=B,q.setParent(this),K?(H=children.indexOf(K),G=children.splice(H),children.push(q),Array.prototype.push.apply(children,G)):children.push(q),q;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(x));return H=this.parent.children.indexOf(this),G=this.parent.children.splice(H),R=this.parent.element(x,B,F),Array.prototype.push.apply(this.parent.children,G),R},C.prototype.insertAfter=function(x,B,F){var R,H,q;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(x));return H=this.parent.children.indexOf(this),q=this.parent.children.splice(H+1),R=this.parent.element(x,B,F),Array.prototype.push.apply(this.parent.children,q),R},C.prototype.remove=function(){var x,B;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return x=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[x,x-x+1].concat(B=[])),this.parent},C.prototype.node=function(x,B,F){var R,H;return x!=null&&(x=y(x)),B||(B={}),B=y(B),b(B)||(H=[B,F],F=H[0],B=H[1]),R=new u(this,x,B),F!=null&&R.text(F),this.children.push(R),R},C.prototype.text=function(x){var B;return b(x)&&this.element(x),B=new w(this,x),this.children.push(B),this},C.prototype.cdata=function(x){var B;return B=new t(this,x),this.children.push(B),this},C.prototype.comment=function(x){var B;return B=new n(this,x),this.children.push(B),this},C.prototype.commentBefore=function(x){var B,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F),B=this.parent.comment(x),Array.prototype.push.apply(this.parent.children,R),this},C.prototype.commentAfter=function(x){var B,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F+1),B=this.parent.comment(x),Array.prototype.push.apply(this.parent.children,R),this},C.prototype.raw=function(x){var B;return B=new g(this,x),this.children.push(B),this},C.prototype.dummy=function(){var x;return x=new a(this),x},C.prototype.instruction=function(x,B){var F,R,H,q,K;if(x!=null&&(x=y(x)),B!=null&&(B=y(B)),Array.isArray(x))for(q=0,K=x.length;q<K;q++)F=x[q],this.instruction(F);else if(b(x))for(F in x)A.call(x,F)&&(R=x[F],this.instruction(F,R));else E(B)&&(B=B.apply()),H=new m(this,x,B),this.children.push(H);return this},C.prototype.instructionBefore=function(x,B){var F,R,H;return R=this.parent.children.indexOf(this),H=this.parent.children.splice(R),F=this.parent.instruction(x,B),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.instructionAfter=function(x,B){var F,R,H;return R=this.parent.children.indexOf(this),H=this.parent.children.splice(R+1),F=this.parent.instruction(x,B),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.declaration=function(x,B,F){var R,H;return R=this.document(),H=new s(R,x,B,F),R.children.length===0?R.children.unshift(H):R.children[0].type===e.Declaration?R.children[0]=H:R.children.unshift(H),R.root()||R},C.prototype.dtd=function(x,B){var F,R,H,q,K,G,he,le,oe,Z;for(R=this.document(),H=new i(R,x,B),oe=R.children,q=K=0,he=oe.length;K<he;q=++K)if(F=oe[q],F.type===e.DocType)return R.children[q]=H,H;for(Z=R.children,q=G=0,le=Z.length;G<le;q=++G)if(F=Z[q],F.isRoot)return R.children.splice(q,0,H),H;return R.children.push(H),H},C.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},C.prototype.root=function(){var x;for(x=this;x;){if(x.type===e.Document)return x.rootObject;if(x.isRoot)return x;x=x.parent}},C.prototype.document=function(){var x;for(x=this;x;){if(x.type===e.Document)return x;x=x.parent}},C.prototype.end=function(x){return this.document().end(x)},C.prototype.prev=function(){var x;if(x=this.parent.children.indexOf(this),x<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[x-1]},C.prototype.next=function(){var x;if(x=this.parent.children.indexOf(this),x===-1||x===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[x+1]},C.prototype.importDocument=function(x){var B;return B=x.root().clone(),B.parent=this,B.isRoot=!1,this.children.push(B),this},C.prototype.debugInfo=function(x){var B,F;return x=x||this.name,x==null&&!((B=this.parent)!=null&&B.name)?"":x==null?"parent: <"+this.parent.name+">":(F=this.parent)!=null&&F.name?"node: <"+x+">, parent: <"+this.parent.name+">":"node: <"+x+">"},C.prototype.ele=function(x,B,F){return this.element(x,B,F)},C.prototype.nod=function(x,B,F){return this.node(x,B,F)},C.prototype.txt=function(x){return this.text(x)},C.prototype.dat=function(x){return this.cdata(x)},C.prototype.com=function(x){return this.comment(x)},C.prototype.ins=function(x,B){return this.instruction(x,B)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(x,B,F){return this.declaration(x,B,F)},C.prototype.e=function(x,B,F){return this.element(x,B,F)},C.prototype.n=function(x,B,F){return this.node(x,B,F)},C.prototype.t=function(x){return this.text(x)},C.prototype.d=function(x){return this.cdata(x)},C.prototype.c=function(x){return this.comment(x)},C.prototype.r=function(x){return this.raw(x)},C.prototype.i=function(x,B){return this.instruction(x,B)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(x){return this.importDocument(x)},C.prototype.replaceChild=function(x,B){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(x,B){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(x){var B,F;return B=this,B===x?0:this.document()!==x.document()?(F=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?F|=r.Preceding:F|=r.Following,F):B.isAncestor(x)?r.Contains|r.Preceding:B.isDescendant(x)?r.Contains|r.Following:B.isPreceding(x)?r.Preceding:r.Following},C.prototype.isSameNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(x){var B,F,R;if(x.nodeType!==this.nodeType||x.children.length!==this.children.length)return!1;for(B=F=0,R=this.children.length-1;0<=R?F<=R:F>=R;B=0<=R?++F:--F)if(!this.children[B].isEqualNode(x.children[B]))return!1;return!0},C.prototype.getFeature=function(x,B){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(x,B,F){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(x){return x?x===this||this.isDescendant(x):!1},C.prototype.isDescendant=function(x){var B,F,R,H,q;for(q=this.children,R=0,H=q.length;R<H;R++)if(B=q[R],x===B||(F=B.isDescendant(x),F))return!0;return!1},C.prototype.isAncestor=function(x){return x.isDescendant(this)},C.prototype.isPreceding=function(x){var B,F;return B=this.treePosition(x),F=this.treePosition(this),B===-1||F===-1?!1:B<F},C.prototype.isFollowing=function(x){var B,F;return B=this.treePosition(x),F=this.treePosition(this),B===-1||F===-1?!1:B>F},C.prototype.treePosition=function(x){var B,F;return F=0,B=!1,this.foreachTreeNode(this.document(),function(R){if(F++,!B&&R===x)return B=!0}),B?F:-1},C.prototype.foreachTreeNode=function(x,B){var F,R,H,q,K;for(x||(x=this.document()),q=x.children,R=0,H=q.length;R<H;R++){if(F=q[R],K=B(F))return K;if(K=this.foreachTreeNode(F,B),K)return K}},C})()}).call(J5)});var NT=ye((Y5,Q5)=>{"use strict";(function(){var r,e=o(function(n,s){return function(){return n.apply(s,arguments)}},"bind"),t={}.hasOwnProperty;Q5.exports=r=(function(){function n(s){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var i,a,u;s||(s={}),this.options=s,this.options.version||(this.options.version="1.0"),a=s.stringify||{};for(i in a)t.call(a,i)&&(u=a[i],this[i]=u)}return o(n,"XMLStringifier"),n.prototype.name=function(s){return this.options.noValidation?s:this.assertLegalName(""+s||"")},n.prototype.text=function(s){return this.options.noValidation?s:this.assertLegalChar(this.textEscape(""+s||""))},n.prototype.cdata=function(s){return this.options.noValidation?s:(s=""+s||"",s=s.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(s))},n.prototype.comment=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+s);return this.assertLegalChar(s)},n.prototype.raw=function(s){return this.options.noValidation?s:""+s||""},n.prototype.attValue=function(s){return this.options.noValidation?s:this.assertLegalChar(this.attEscape(s=""+s||""))},n.prototype.insTarget=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.insValue=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/\?>/))throw new Error("Invalid processing instruction value: "+s);return this.assertLegalChar(s)},n.prototype.xmlVersion=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+s);return s},n.prototype.xmlEncoding=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+s);return this.assertLegalChar(s)},n.prototype.xmlStandalone=function(s){return this.options.noValidation?s:s?"yes":"no"},n.prototype.dtdPubID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdSysID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdElementValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttType=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttDefault=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdEntityValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdNData=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(s){var i,a;if(this.options.noValidation)return s;if(i="",this.options.version==="1.0"){if(i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i))throw new Error("Invalid character in string: "+s+" at index "+a.index)}else if(this.options.version==="1.1"&&(i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i)))throw new Error("Invalid character in string: "+s+" at index "+a.index);return s},n.prototype.assertLegalName=function(s){var i;if(this.options.noValidation)return s;if(this.assertLegalChar(s),i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!s.match(i))throw new Error("Invalid character in name");return s},n.prototype.textEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},n.prototype.attEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},n})()}).call(Y5)});var ag=ye((Z5,eV)=>{"use strict";(function(){eV.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(Z5)});var TT=ye((tV,rV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b={}.hasOwnProperty;E=Va().assign,r=sn(),l=cE(),f=mE(),t=uE(),n=lE(),m=oE(),w=gE(),y=yE(),g=vE(),h=xT(),s=fE(),i=pE(),a=hE(),u=dE(),e=ag(),rV.exports=S=(function(){function T(A){var C,x,B;A||(A={}),this.options=A,x=A.writer||{};for(C in x)b.call(x,C)&&(B=x[C],this["_"+C]=this[C],this[C]=B)}return o(T,"XMLWriterBase"),T.prototype.filterOptions=function(A){var C,x,B,F,R,H,q,K;return A||(A={}),A=E({},this.options,A),C={writer:this},C.pretty=A.pretty||!1,C.allowEmpty=A.allowEmpty||!1,C.indent=(x=A.indent)!=null?x:" ",C.newline=(B=A.newline)!=null?B:`
83
+ `,C.offset=(F=A.offset)!=null?F:0,C.dontPrettyTextNodes=(R=(H=A.dontPrettyTextNodes)!=null?H:A.dontprettytextnodes)!=null?R:0,C.spaceBeforeSlash=(q=(K=A.spaceBeforeSlash)!=null?K:A.spacebeforeslash)!=null?q:"",C.spaceBeforeSlash===!0&&(C.spaceBeforeSlash=" "),C.suppressPrettyCount=0,C.user={},C.state=e.None,C},T.prototype.indent=function(A,C,x){var B;return!C.pretty||C.suppressPrettyCount?"":C.pretty&&(B=(x||0)+C.offset+1,B>0)?new Array(B).join(C.indent):""},T.prototype.endline=function(A,C,x){return!C.pretty||C.suppressPrettyCount?"":C.newline},T.prototype.attribute=function(A,C,x){var B;return this.openAttribute(A,C,x),B=" "+A.name+'="'+A.value+'"',this.closeAttribute(A,C,x),B},T.prototype.cdata=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<![CDATA[",C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+="]]>"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.comment=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!-- ",C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=" -->"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.declaration=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<?xml",C.state=e.InsideTag,B+=' version="'+A.version+'"',A.encoding!=null&&(B+=' encoding="'+A.encoding+'"'),A.standalone!=null&&(B+=' standalone="'+A.standalone+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+"?>",B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.docType=function(A,C,x){var B,F,R,H,q;if(x||(x=0),this.openNode(A,C,x),C.state=e.OpenTag,H=this.indent(A,C,x),H+="<!DOCTYPE "+A.root().name,A.pubID&&A.sysID?H+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.sysID&&(H+=' SYSTEM "'+A.sysID+'"'),A.children.length>0){for(H+=" [",H+=this.endline(A,C,x),C.state=e.InsideTag,q=A.children,F=0,R=q.length;F<R;F++)B=q[F],H+=this.writeChildNode(B,C,x+1);C.state=e.CloseTag,H+="]"}return C.state=e.CloseTag,H+=C.spaceBeforeSlash+">",H+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),H},T.prototype.element=function(A,C,x){var B,F,R,H,q,K,G,he,le,oe,Z,fe,Se,Ke;x||(x=0),oe=!1,Z="",this.openNode(A,C,x),C.state=e.OpenTag,Z+=this.indent(A,C,x)+"<"+A.name,fe=A.attribs;for(le in fe)b.call(fe,le)&&(B=fe[le],Z+=this.attribute(B,C,x));if(R=A.children.length,H=R===0?null:A.children[0],R===0||A.children.every(function(be){return(be.type===r.Text||be.type===r.Raw)&&be.value===""}))C.allowEmpty?(Z+=">",C.state=e.CloseTag,Z+="</"+A.name+">"+this.endline(A,C,x)):(C.state=e.CloseTag,Z+=C.spaceBeforeSlash+"/>"+this.endline(A,C,x));else if(C.pretty&&R===1&&(H.type===r.Text||H.type===r.Raw)&&H.value!=null)Z+=">",C.state=e.InsideTag,C.suppressPrettyCount++,oe=!0,Z+=this.writeChildNode(H,C,x+1),C.suppressPrettyCount--,oe=!1,C.state=e.CloseTag,Z+="</"+A.name+">"+this.endline(A,C,x);else{if(C.dontPrettyTextNodes){for(Se=A.children,q=0,G=Se.length;q<G;q++)if(F=Se[q],(F.type===r.Text||F.type===r.Raw)&&F.value!=null){C.suppressPrettyCount++,oe=!0;break}}for(Z+=">"+this.endline(A,C,x),C.state=e.InsideTag,Ke=A.children,K=0,he=Ke.length;K<he;K++)F=Ke[K],Z+=this.writeChildNode(F,C,x+1);C.state=e.CloseTag,Z+=this.indent(A,C,x)+"</"+A.name+">",oe&&C.suppressPrettyCount--,Z+=this.endline(A,C,x),C.state=e.None}return this.closeNode(A,C,x),Z},T.prototype.writeChildNode=function(A,C,x){switch(A.type){case r.CData:return this.cdata(A,C,x);case r.Comment:return this.comment(A,C,x);case r.Element:return this.element(A,C,x);case r.Raw:return this.raw(A,C,x);case r.Text:return this.text(A,C,x);case r.ProcessingInstruction:return this.processingInstruction(A,C,x);case r.Dummy:return"";case r.Declaration:return this.declaration(A,C,x);case r.DocType:return this.docType(A,C,x);case r.AttributeDeclaration:return this.dtdAttList(A,C,x);case r.ElementDeclaration:return this.dtdElement(A,C,x);case r.EntityDeclaration:return this.dtdEntity(A,C,x);case r.NotationDeclaration:return this.dtdNotation(A,C,x);default:throw new Error("Unknown XML node type: "+A.constructor.name)}},T.prototype.processingInstruction=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<?",C.state=e.InsideTag,B+=A.target,A.value&&(B+=" "+A.value),C.state=e.CloseTag,B+=C.spaceBeforeSlash+"?>",B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.raw=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x),C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.text=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x),C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdAttList=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ATTLIST",C.state=e.InsideTag,B+=" "+A.elementName+" "+A.attributeName+" "+A.attributeType,A.defaultValueType!=="#DEFAULT"&&(B+=" "+A.defaultValueType),A.defaultValue&&(B+=' "'+A.defaultValue+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdElement=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ELEMENT",C.state=e.InsideTag,B+=" "+A.name+" "+A.value,C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdEntity=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ENTITY",C.state=e.InsideTag,A.pe&&(B+=" %"),B+=" "+A.name,A.value?B+=' "'+A.value+'"':(A.pubID&&A.sysID?B+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.sysID&&(B+=' SYSTEM "'+A.sysID+'"'),A.nData&&(B+=" NDATA "+A.nData)),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdNotation=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!NOTATION",C.state=e.InsideTag,B+=" "+A.name,A.pubID&&A.sysID?B+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.pubID?B+=' PUBLIC "'+A.pubID+'"':A.sysID&&(B+=' SYSTEM "'+A.sysID+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.openNode=function(A,C,x){},T.prototype.closeNode=function(A,C,x){},T.prototype.openAttribute=function(A,C,x){},T.prototype.closeAttribute=function(A,C,x){},T})()}).call(tV)});var wE=ye((nV,sV)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=TT(),sV.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a)}return o(i,"XMLStringWriter"),i.prototype.document=function(a,u){var l,f,h,m,g;for(u=this.filterOptions(u),m="",g=a.children,f=0,h=g.length;f<h;f++)l=g[f],m+=this.writeChildNode(l,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},i})(e)}).call(nV)});var IT=ye((iV,aV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l=o(function(h,m){for(var g in m)f.call(m,g)&&(h[g]=m[g]);function w(){this.constructor=h}return o(w,"ctor"),w.prototype=m.prototype,h.prototype=new w,h.__super__=m.prototype,h},"extend"),f={}.hasOwnProperty;u=Va().isPlainObject,t=CT(),e=u5(),s=Ws(),r=sn(),a=NT(),i=wE(),aV.exports=n=(function(h){l(m,h);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new i),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,w,y,S;for(S=this.children,w=0,y=S.length;w<y;w++)if(g=S[w],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var w;return w={},g?u(g)&&(w=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(w))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(s)}).call(iV)});var lV=ye((oV,uV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R={}.hasOwnProperty;F=Va(),x=F.isObject,C=F.isFunction,B=F.isPlainObject,A=F.getValue,r=sn(),m=IT(),w=oE(),n=uE(),s=lE(),S=gE(),T=yE(),y=vE(),f=cE(),h=mE(),i=fE(),u=hE(),a=pE(),l=dE(),t=bT(),b=NT(),E=wE(),e=ag(),uV.exports=g=(function(){function H(q,K,G){var he;this.name="?xml",this.type=r.Document,q||(q={}),he={},q.writer?B(q.writer)&&(he=q.writer,q.writer=new E):q.writer=new E,this.options=q,this.writer=q.writer,this.writerOptions=this.writer.filterOptions(he),this.stringify=new b(q),this.onDataCallback=K||function(){},this.onEndCallback=G||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(H,"XMLDocumentCB"),H.prototype.createChildNode=function(q){var K,G,he,le,oe,Z,fe,Se;switch(q.type){case r.CData:this.cdata(q.value);break;case r.Comment:this.comment(q.value);break;case r.Element:he={},fe=q.attribs;for(G in fe)R.call(fe,G)&&(K=fe[G],he[G]=K.value);this.node(q.name,he);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(q.value);break;case r.Text:this.text(q.value);break;case r.ProcessingInstruction:this.instruction(q.target,q.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+q.constructor.name)}for(Se=q.children,oe=0,Z=Se.length;oe<Z;oe++)le=Se[oe],this.createChildNode(le),le.type===r.Element&&this.up();return this},H.prototype.dummy=function(){return this},H.prototype.node=function(q,K,G){var he;if(q==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(q));return this.openCurrent(),q=A(q),K==null&&(K={}),K=A(K),x(K)||(he=[K,G],G=he[0],K=he[1]),this.currentNode=new w(this,q,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,G!=null&&this.text(G),this},H.prototype.element=function(q,K,G){var he,le,oe,Z,fe,Se;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(q)||x(q)||C(q))for(Z=this.options.noValidation,this.options.noValidation=!0,Se=new m(this.options).element("TEMP_ROOT"),Se.element(q),this.options.noValidation=Z,fe=Se.children,le=0,oe=fe.length;le<oe;le++)he=fe[le],this.createChildNode(he),he.type===r.Element&&this.up();else this.node(q,K,G);return this},H.prototype.attribute=function(q,K){var G,he;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(q));if(q!=null&&(q=A(q)),x(q))for(G in q)R.call(q,G)&&(he=q[G],this.attribute(G,he));else C(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[q]=new t(this,q,""):K!=null&&(this.currentNode.attribs[q]=new t(this,q,K));return this},H.prototype.text=function(q){var K;return this.openCurrent(),K=new T(this,q),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.cdata=function(q){var K;return this.openCurrent(),K=new n(this,q),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.comment=function(q){var K;return this.openCurrent(),K=new s(this,q),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.raw=function(q){var K;return this.openCurrent(),K=new S(this,q),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.instruction=function(q,K){var G,he,le,oe,Z;if(this.openCurrent(),q!=null&&(q=A(q)),K!=null&&(K=A(K)),Array.isArray(q))for(G=0,oe=q.length;G<oe;G++)he=q[G],this.instruction(he);else if(x(q))for(he in q)R.call(q,he)&&(le=q[he],this.instruction(he,le));else C(K)&&(K=K.apply()),Z=new y(this,q,K),this.onData(this.writer.processingInstruction(Z,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},H.prototype.declaration=function(q,K,G){var he;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return he=new f(this,q,K,G),this.onData(this.writer.declaration(he,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.doctype=function(q,K,G){if(this.openCurrent(),q==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new h(this,K,G),this.currentNode.rootNodeName=q,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},H.prototype.dtdElement=function(q,K){var G;return this.openCurrent(),G=new a(this,q,K),this.onData(this.writer.dtdElement(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.attList=function(q,K,G,he,le){var oe;return this.openCurrent(),oe=new i(this,q,K,G,he,le),this.onData(this.writer.dtdAttList(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.entity=function(q,K){var G;return this.openCurrent(),G=new u(this,!1,q,K),this.onData(this.writer.dtdEntity(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.pEntity=function(q,K){var G;return this.openCurrent(),G=new u(this,!0,q,K),this.onData(this.writer.dtdEntity(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.notation=function(q,K){var G;return this.openCurrent(),G=new l(this,q,K),this.onData(this.writer.dtdNotation(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},H.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},H.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},H.prototype.openNode=function(q){var K,G,he,le;if(!q.isOpen){if(!this.root&&this.currentLevel===0&&q.type===r.Element&&(this.root=q),G="",q.type===r.Element){this.writerOptions.state=e.OpenTag,G=this.writer.indent(q,this.writerOptions,this.currentLevel)+"<"+q.name,le=q.attribs;for(he in le)R.call(le,he)&&(K=le[he],G+=this.writer.attribute(K,this.writerOptions,this.currentLevel));G+=(q.children?">":"/>")+this.writer.endline(q,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,G=this.writer.indent(q,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+q.rootNodeName,q.pubID&&q.sysID?G+=' PUBLIC "'+q.pubID+'" "'+q.sysID+'"':q.sysID&&(G+=' SYSTEM "'+q.sysID+'"'),q.children?(G+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,G+=">"),G+=this.writer.endline(q,this.writerOptions,this.currentLevel);return this.onData(G,this.currentLevel),q.isOpen=!0}},H.prototype.closeNode=function(q){var K;if(!q.isClosed)return K="",this.writerOptions.state=e.CloseTag,q.type===r.Element?K=this.writer.indent(q,this.writerOptions,this.currentLevel)+"</"+q.name+">"+this.writer.endline(q,this.writerOptions,this.currentLevel):K=this.writer.indent(q,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(q,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),q.isClosed=!0},H.prototype.onData=function(q,K){return this.documentStarted=!0,this.onDataCallback(q,K+1)},H.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},H.prototype.debugInfo=function(q){return q==null?"":"node: <"+q+">"},H.prototype.ele=function(){return this.element.apply(this,arguments)},H.prototype.nod=function(q,K,G){return this.node(q,K,G)},H.prototype.txt=function(q){return this.text(q)},H.prototype.dat=function(q){return this.cdata(q)},H.prototype.com=function(q){return this.comment(q)},H.prototype.ins=function(q,K){return this.instruction(q,K)},H.prototype.dec=function(q,K,G){return this.declaration(q,K,G)},H.prototype.dtd=function(q,K,G){return this.doctype(q,K,G)},H.prototype.e=function(q,K,G){return this.element(q,K,G)},H.prototype.n=function(q,K,G){return this.node(q,K,G)},H.prototype.t=function(q){return this.text(q)},H.prototype.d=function(q){return this.cdata(q)},H.prototype.c=function(q){return this.comment(q)},H.prototype.r=function(q){return this.raw(q)},H.prototype.i=function(q,K){return this.instruction(q,K)},H.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.ent=function(q,K){return this.entity(q,K)},H.prototype.pent=function(q,K){return this.pEntity(q,K)},H.prototype.not=function(q,K){return this.notation(q,K)},H})()}).call(oV)});var hV=ye((cV,fV)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;r=sn(),n=TT(),e=ag(),fV.exports=t=(function(a){s(u,a);function u(l,f){this.stream=l,u.__super__.constructor.call(this,f)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(l,f,h){return l.isLastRootNode&&f.state===e.CloseTag?"":u.__super__.endline.call(this,l,f,h)},u.prototype.document=function(l,f){var h,m,g,w,y,S,E,b,T;for(E=l.children,m=g=0,y=E.length;g<y;m=++g)h=E[m],h.isLastRootNode=m===l.children.length-1;for(f=this.filterOptions(f),b=l.children,T=[],w=0,S=b.length;w<S;w++)h=b[w],T.push(this.writeChildNode(h,f,0));return T},u.prototype.attribute=function(l,f,h){return this.stream.write(u.__super__.attribute.call(this,l,f,h))},u.prototype.cdata=function(l,f,h){return this.stream.write(u.__super__.cdata.call(this,l,f,h))},u.prototype.comment=function(l,f,h){return this.stream.write(u.__super__.comment.call(this,l,f,h))},u.prototype.declaration=function(l,f,h){return this.stream.write(u.__super__.declaration.call(this,l,f,h))},u.prototype.docType=function(l,f,h){var m,g,w,y;if(h||(h=0),this.openNode(l,f,h),f.state=e.OpenTag,this.stream.write(this.indent(l,f,h)),this.stream.write("<!DOCTYPE "+l.root().name),l.pubID&&l.sysID?this.stream.write(' PUBLIC "'+l.pubID+'" "'+l.sysID+'"'):l.sysID&&this.stream.write(' SYSTEM "'+l.sysID+'"'),l.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(l,f,h)),f.state=e.InsideTag,y=l.children,g=0,w=y.length;g<w;g++)m=y[g],this.writeChildNode(m,f,h+1);f.state=e.CloseTag,this.stream.write("]")}return f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+">"),this.stream.write(this.endline(l,f,h)),f.state=e.None,this.closeNode(l,f,h)},u.prototype.element=function(l,f,h){var m,g,w,y,S,E,b,T,A,C;h||(h=0),this.openNode(l,f,h),f.state=e.OpenTag,this.stream.write(this.indent(l,f,h)+"<"+l.name),A=l.attribs;for(b in A)i.call(A,b)&&(m=A[b],this.attribute(m,f,h));if(w=l.children.length,y=w===0?null:l.children[0],w===0||l.children.every(function(x){return(x.type===r.Text||x.type===r.Raw)&&x.value===""}))f.allowEmpty?(this.stream.write(">"),f.state=e.CloseTag,this.stream.write("</"+l.name+">")):(f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>"));else if(f.pretty&&w===1&&(y.type===r.Text||y.type===r.Raw)&&y.value!=null)this.stream.write(">"),f.state=e.InsideTag,f.suppressPrettyCount++,T=!0,this.writeChildNode(y,f,h+1),f.suppressPrettyCount--,T=!1,f.state=e.CloseTag,this.stream.write("</"+l.name+">");else{for(this.stream.write(">"+this.endline(l,f,h)),f.state=e.InsideTag,C=l.children,S=0,E=C.length;S<E;S++)g=C[S],this.writeChildNode(g,f,h+1);f.state=e.CloseTag,this.stream.write(this.indent(l,f,h)+"</"+l.name+">")}return this.stream.write(this.endline(l,f,h)),f.state=e.None,this.closeNode(l,f,h)},u.prototype.processingInstruction=function(l,f,h){return this.stream.write(u.__super__.processingInstruction.call(this,l,f,h))},u.prototype.raw=function(l,f,h){return this.stream.write(u.__super__.raw.call(this,l,f,h))},u.prototype.text=function(l,f,h){return this.stream.write(u.__super__.text.call(this,l,f,h))},u.prototype.dtdAttList=function(l,f,h){return this.stream.write(u.__super__.dtdAttList.call(this,l,f,h))},u.prototype.dtdElement=function(l,f,h){return this.stream.write(u.__super__.dtdElement.call(this,l,f,h))},u.prototype.dtdEntity=function(l,f,h){return this.stream.write(u.__super__.dtdEntity.call(this,l,f,h))},u.prototype.dtdNotation=function(l,f,h){return this.stream.write(u.__super__.dtdNotation.call(this,l,f,h))},u})(n)}).call(cV)});var dV=ye((pV,Xu)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f;f=Va(),u=f.assign,l=f.isFunction,t=CT(),n=IT(),s=lV(),a=wE(),i=hV(),r=sn(),e=ag(),Xu.exports.create=function(h,m,g,w){var y,S;if(h==null)throw new Error("Root element needs a name.");return w=u({},m,g,w),y=new n(w),S=y.element(h),w.headless||(y.declaration(w),(w.pubID!=null||w.sysID!=null)&&y.dtd(w)),S},Xu.exports.begin=function(h,m,g){var w;return l(h)&&(w=[h,m],m=w[0],g=w[1],h={}),m?new s(h,m,g):new n(h)},Xu.exports.stringWriter=function(h){return new a(h)},Xu.exports.streamWriter=function(h,m){return new i(h,m)},Xu.exports.implementation=new t,Xu.exports.nodeType=r,Xu.exports.writerState=e}).call(pV)});var mV=ye(BT=>{"use strict";(function(){"use strict";var r,e,t,n,s,i={}.hasOwnProperty;r=dV(),e=iE().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),s=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),BT.Builder=(function(){function a(u){var l,f,h;this.options={},f=e["0.2"];for(l in f)i.call(f,l)&&(h=f[l],this.options[l]=h);for(l in u)i.call(u,l)&&(h=u[l],this.options[l]=h)}return o(a,"Builder"),a.prototype.buildObject=function(u){var l,f,h,m,g;return l=this.options.attrkey,f=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,h=(function(w){return function(y,S){var E,b,T,A,C,x;if(typeof S!="object")w.options.cdata&&n(S)?y.raw(s(S)):y.txt(S);else if(Array.isArray(S)){for(A in S)if(i.call(S,A)){b=S[A];for(C in b)T=b[C],y=h(y.ele(C),T).up()}}else for(C in S)if(i.call(S,C))if(b=S[C],C===l){if(typeof b=="object")for(E in b)x=b[E],y=y.att(E,x)}else if(C===f)w.options.cdata&&n(b)?y=y.raw(s(b)):y=y.txt(b);else if(Array.isArray(b))for(A in b)i.call(b,A)&&(T=b[A],typeof T=="string"?w.options.cdata&&n(T)?y=y.ele(C).raw(s(T)).up():y=y.ele(C,T).up():y=h(y.ele(C),T).up());else typeof b=="object"?y=h(y.ele(C),b).up():typeof b=="string"&&w.options.cdata&&n(b)?y=y.ele(C).raw(s(b)).up():(b==null&&(b=""),y=y.ele(C,b.toString()).up());return y}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),h(m,u).end(this.options.renderOpts)},a})()}).call(BT)});var gV=ye(DT=>{"use strict";(function(){"use strict";DT.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(DT)});var _T=ye(Bc=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),Bc.normalize=function(e){return e.toLowerCase()},Bc.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Bc.stripPrefix=function(e){return e.replace(r,"")},Bc.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},Bc.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(Bc)});var yV=ye(Co=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,u,l,f=o(function(g,w){return function(){return g.apply(w,arguments)}},"bind"),h=o(function(g,w){for(var y in w)m.call(w,y)&&(g[y]=w[y]);function S(){this.constructor=g}return o(S,"ctor"),S.prototype=w.prototype,g.prototype=new S,g.__super__=w.prototype,g},"extend"),m={}.hasOwnProperty;u=iT(),n=gt("events"),r=gV(),a=_T(),l=gt("timers").setImmediate,e=iE().defaults,s=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),i=o(function(g,w,y){var S,E,b;for(S=0,E=g.length;S<E;S++)b=g[S],w=b(w,y);return w},"processItem"),t=o(function(g,w,y){var S;return S=Object.create(null),S.value=y,S.writable=!0,S.enumerable=!0,S.configurable=!0,Object.defineProperty(g,w,S)},"defineProperty"),Co.Parser=(function(g){h(w,g);function w(y){this.parseStringPromise=f(this.parseStringPromise,this),this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this);var S,E,b;if(!(this instanceof Co.Parser))return new Co.Parser(y);this.options={},E=e["0.2"];for(S in E)m.call(E,S)&&(b=E[S],this.options[S]=b);for(S in y)m.call(y,S)&&(b=y[S],this.options[S]=b);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return o(w,"Parser"),w.prototype.processAsync=function(){var y,S;try{return this.remaining.length<=this.options.chunkSize?(y=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(y),this.saxParser.close()):(y=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(y),l(this.processAsync))}catch(E){if(S=E,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(S)}},w.prototype.assignOrPush=function(y,S,E){return S in y?(y[S]instanceof Array||t(y,S,[y[S]]),y[S].push(E)):this.options.explicitArray?t(y,S,[E]):t(y,S,E)},w.prototype.reset=function(){var y,S,E,b;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(T){return function(A){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",A)}})(this),this.saxParser.onend=(function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,b=[],y=this.options.attrkey,S=this.options.charkey,this.saxParser.onopentag=(function(T){return function(A){var C,x,B,F,R;if(B={},B[S]="",!T.options.ignoreAttrs){R=A.attributes;for(C in R)m.call(R,C)&&(!(y in B)&&!T.options.mergeAttrs&&(B[y]={}),x=T.options.attrValueProcessors?i(T.options.attrValueProcessors,A.attributes[C],C):A.attributes[C],F=T.options.attrNameProcessors?i(T.options.attrNameProcessors,C):C,T.options.mergeAttrs?T.assignOrPush(B,F,x):t(B[y],F,x))}return B["#name"]=T.options.tagNameProcessors?i(T.options.tagNameProcessors,A.name):A.name,T.options.xmlns&&(B[T.options.xmlnskey]={uri:A.uri,local:A.local}),b.push(B)}})(this),this.saxParser.onclosetag=(function(T){return function(){var A,C,x,B,F,R,H,q,K,G;if(R=b.pop(),F=R["#name"],(!T.options.explicitChildren||!T.options.preserveChildrenOrder)&&delete R["#name"],R.cdata===!0&&(A=R.cdata,delete R.cdata),K=b[b.length-1],R[S].match(/^\s*$/)&&!A?(C=R[S],delete R[S]):(T.options.trim&&(R[S]=R[S].trim()),T.options.normalize&&(R[S]=R[S].replace(/\s{2,}/g," ").trim()),R[S]=T.options.valueProcessors?i(T.options.valueProcessors,R[S],F):R[S],Object.keys(R).length===1&&S in R&&!T.EXPLICIT_CHARKEY&&(R=R[S])),s(R)&&(typeof T.options.emptyTag=="function"?R=T.options.emptyTag():R=T.options.emptyTag!==""?T.options.emptyTag:C),T.options.validator!=null&&(G="/"+(function(){var he,le,oe;for(oe=[],he=0,le=b.length;he<le;he++)B=b[he],oe.push(B["#name"]);return oe})().concat(F).join("/"),(function(){var he;try{return R=T.options.validator(G,K&&K[F],R)}catch(le){return he=le,T.emit("error",he)}})()),T.options.explicitChildren&&!T.options.mergeAttrs&&typeof R=="object"){if(!T.options.preserveChildrenOrder)B={},T.options.attrkey in R&&(B[T.options.attrkey]=R[T.options.attrkey],delete R[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in R&&(B[T.options.charkey]=R[T.options.charkey],delete R[T.options.charkey]),Object.getOwnPropertyNames(R).length>0&&(B[T.options.childkey]=R),R=B;else if(K){K[T.options.childkey]=K[T.options.childkey]||[],H={};for(x in R)m.call(R,x)&&t(H,x,R[x]);K[T.options.childkey].push(H),delete R["#name"],Object.keys(R).length===1&&S in R&&!T.EXPLICIT_CHARKEY&&(R=R[S])}}return b.length>0?T.assignOrPush(K,F,R):(T.options.explicitRoot&&(q=R,R={},t(R,F,q)),T.resultObject=R,T.saxParser.ended=!0,T.emit("end",T.resultObject))}})(this),E=(function(T){return function(A){var C,x;if(x=b[b.length-1],x)return x[S]+=A,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||A.replace(/\\n/g,"").trim()!=="")&&(x[T.options.childkey]=x[T.options.childkey]||[],C={"#name":"__text__"},C[S]=A,T.options.normalize&&(C[S]=C[S].replace(/\s{2,}/g," ").trim()),x[T.options.childkey].push(C)),x}})(this),this.saxParser.ontext=E,this.saxParser.oncdata=(function(T){return function(A){var C;if(C=E(A),C)return C.cdata=!0}})(this)},w.prototype.parseString=function(y,S){var E;S!=null&&typeof S=="function"&&(this.on("end",function(b){return this.reset(),S(null,b)}),this.on("error",function(b){return this.reset(),S(b)}));try{return y=y.toString(),y.trim()===""?(this.emit("end",null),!0):(y=r.stripBOM(y),this.options.async?(this.remaining=y,l(this.processAsync),this.saxParser):this.saxParser.write(y).close())}catch(b){if(E=b,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw E}else return this.emit("error",E),this.saxParser.errThrown=!0}},w.prototype.parseStringPromise=function(y){return new Promise((function(S){return function(E,b){return S.parseString(y,function(T,A){return T?b(T):E(A)})}})(this))},w})(n),Co.parseString=function(g,w,y){var S,E,b;return y!=null?(typeof y=="function"&&(S=y),typeof w=="object"&&(E=w)):(typeof w=="function"&&(S=w),E={}),b=new Co.Parser(E),b.parseString(g,S)},Co.parseStringPromise=function(g,w){var y,S;return typeof w=="object"&&(y=w),S=new Co.Parser(y),S.parseStringPromise(g)}}).call(Co)});var vV=ye(bo=>{"use strict";(function(){"use strict";var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;e=iE(),r=mV(),t=yV(),n=_T(),bo.defaults=e.defaults,bo.processors=n,bo.ValidationError=(function(a){s(u,a);function u(l){this.message=l}return o(u,"ValidationError"),u})(Error),bo.Builder=r.Builder,bo.Parser=t.Parser,bo.parseString=t.parseString,bo.parseStringPromise=t.parseStringPromise}).call(bo)});var Nb="http://www.w3.org/2000/09/xmldsig#",RR="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",Tb=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),Rh=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),Ib=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var xK={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},cae=Object.keys(xK);var hae={Production:"1",Homolog:"2"};var Ks=class extends Error{static{o(this,"NFeTsError")}};var PR=class extends Ks{static{o(this,"ValidationError")}};var pm={includeComments:!1,exclusive:!0};import{NFeTsError as NK}from"@nfets/core/domain/errors/nfets-error";var Bb=o(r=>{throw new NK("Didn't expect to get here")},"unreachable");var Ph=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Rh.SHA1,s=pm){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:Nb},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:RR}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:Nb},...e},{rootName:"SignedInfo"}),this.canonical);return await this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case Rh.SHA256:return Ib.SHA256;case Rh.SHA1:return Ib.SHA1;default:return Bb(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Rh.SHA256:return Tb.RSA_SHA256;case Rh.SHA1:return Tb.RSA_SHA1;default:return Bb(this.algorithm)}}};var Db=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},dw=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},lo=o(r=>new Db(r),"left"),Oh=o(r=>r===void 0?new dw(void 0):new dw(r),"right");var OR=class extends Ph{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n;if(!e[s])return lo(new Ks(`Node ${String(s)} not found`));let l=await this.toolkit.build(this.ns(e,String(s)),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),f=this.signedInfo(l,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=e;return m.Signature=this.assemble(f,h.value,u),Oh(m)}ns(e,t){let n=e.$.xmlns,{$:{xmlns:s,...i},...a}=e[t];return{$:{xmlns:n,...i},...a}}};var kR=class extends Ph{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n,l=this.toolkit.getNode(e,s);if(!l)return lo(new Ks(`Node ${s} not found`));let f=this.signedInfo(l,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=await this.toolkit.build(this.assemble(f,h.value,u),{rootName:"Signature"});return Oh(this.toolkit.appendNode(e,m))}};import"reflect-metadata";import{validateSync as IK}from"class-validator";import"reflect-metadata";var dm="__SkipValidation__",eoe=o(()=>(r,e)=>{Reflect.defineMetadata(dm,!0,r,e.toString())},"SkipValidation"),toe=o(()=>r=>{Reflect.defineMetadata(dm,!0,r)},"SkipAllValidations");import{plainToInstance as TK}from"class-transformer";var LR=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t&&typeof t=="object"&&LR(t)},"clearUndefinedValues"),VR=o((r,e)=>{let t=TK(e,r);return LR(t),t},"plainToInstance");var UR="__ValidateErrors__",MR=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(MR(n.children,e?`${e}.${n.property}`:n.property));let s=Object.values(n.constraints??{}).map(i=>e?`${e}.${i}`:i).join(", ");return s?t.concat(s):t},[]),"mapConstraintsToErrors"),foe=o(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata(dm,this.constructor);if(Reflect.getMetadata(dm,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[l,...f]=i,h=VR(l,r),m=IK(h,{whitelist:!0});if(m.length){let g=Reflect.getMetadata(UR,this)??[];Reflect.defineMetadata(UR,g.concat(MR(m,s?.name)),this)}return s?.apply(this,[h,...f])}},"Validates");import"reflect-metadata";import{Decimal as BK}from"@nfets/core/infrastructure";import{registerDecorator as DK}from"class-validator";var jR=o(r=>(e,t)=>{DK({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof BK?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as FR}from"class-validator";var kh=Symbol("choice"),Eoe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(kh,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(kh,i,e);for(let u of t)FR({name:"choice",target:e,propertyName:u,options:s,validator:{validate(l,f){let h=f.object,m=f.property,g=Reflect.getMetadata(kh,e);if(!g)return!0;let w=g.find(S=>S.properties.includes(m));if(!w||l==null)return!0;for(let S of w.properties){if(S===m)continue;let E=h[S];if(!(E==null))return!1}for(let S of g)if(S!==w)for(let E of S.properties){let b=h[E];if(!(b==null))return!1}return!0},defaultMessage(l){let f=Reflect.getMetadata(kh,e);if(!f)return`${l.property} validation error`;let h=f.find(g=>g.properties.includes(l.property));if(!h)return`${l.property} validation error`;let m=l.object;for(let g of h.properties)if(m[g]&&g!==l.property)return`${l.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`;for(let g of f)if(g!==h)for(let w of g.properties){let y=m[w];if(y!=null)return`${l.property} cannot be set because ${w} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let u of t)FR({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(l,f){let h=f.object,m=Reflect.getMetadata(kh,e);if(!m)return!0;let g=m.find(w=>w.properties.includes(f.property));if(!g?.required)return!0;for(let w of g.properties){let y=h[w];if(y!=null)return!0}return f.property!==g.properties[0]},defaultMessage(l){let f=Reflect.getMetadata(kh,e);if(!f)return"At least one property from a choice group must be provided";let h=f.find(m=>m.properties.includes(l.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Decimal as _K}from"@nfets/core/infrastructure";import{Transform as RK}from"class-transformer";var Ioe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{jR(e)(t,n),RK(({value:s})=>_K.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as kK}from"class-transformer";import{IsDateString as LK}from"class-validator";import _b from"dayjs";import PK from"dayjs/plugin/utc";import OK from"dayjs/plugin/timezone";_b.extend(PK);_b.extend(OK);var qR=_b;var Uoe=o((r={})=>(e,t)=>{kK(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?qR(s).utc().format(r.format):void 0})(e,t),LK()(e,t)},"TransformDateString");var HR=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],l=n.reduce((y,S,E)=>y+S*a[E],0)%11,f=l===0||l===1?0:11-l,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,f].reduce((y,S,E)=>y+S*h[E],0)%11,w=g===0||g===1?0:11-g;return s===f&&i===w}};var KR=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var $R=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var XR=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],l=i;for(let m=0;m<8;m++)l+=parseInt(t[m],10)*u[m];let h=11-l%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var GR=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(S=>parseInt(S,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let S=0;S<i.length;S++)a+=n[S]*i[S];let u=a%s,l=s-u;(s===11&&u<=1||s===10&&u===0)&&(l=0);let h=(t.slice(0,t.length-2)+l.toString()).split("").map(S=>parseInt(S,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let S=0;S<m.length;S++)g+=h[S]*m[S];let w=g%s,y=s-w;return(s===11&&w<=1||s===10&&w===0)&&(y=0),y===n[t.length-2]&&l===n[t.length-1]}};var WR=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var JR=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let l=n.concat([u]),f=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)f+=l[m]*i[g];let h=11-f%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var zR=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var YR=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let l=0;l<8;l++)i+=parseInt(t[l],10)*s[l];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var QR=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var ZR=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let w=0;w<12;w++){let y=w%2===0?1:2,S=(parseInt(s[w])*y).toString();i+=S.split("").reduce((E,b)=>E+parseInt(b),0)}let u=Math.ceil(i/10)*10-i,l=n+u.toString(),f=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let w=0;w<12;w++)h+=parseInt(l[w])*f[w];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var eP=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var tP=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var rP=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var nP=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var sP=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let w=0;w<7;w++)i+=n[w]*s[w];let a=i%11,u=a===0||a===1?0:11-a,l=[...n,u],f=[9,8,7,6,5,4,3,2],h=0;for(let w=0;w<8;w++)h+=l[w]*f[w];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var iP=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var aP=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let l=[...n,u],f=0;for(let m=0;m<9;m++)f+=l[m]*i[m];let h=11-f%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var oP=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var uP=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let f=0;f<n.length;f++)i+=s[f]*n[f];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var lP=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let l=0;l<s.length;l++)i+=n[l]*s[l];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var cP=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var fP=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var hP=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var pP=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var dP=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let h=0;h<11;h++)l+=n[h]*u[h];let f=l%11%10;return a===n[8]&&f===n[11]}};var mP=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let f=0;f<i.length;f++)a+=s[f]*i[f];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var gP=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
84
+ `).reduce((i,a)=>{let[u,l]=a.split("=").map(f=>f.trim());return!u||!l?i:i.set(u,l)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[0].subarray(-4),l=u.subarray(-2);u[0]===48?l=u:u[1]===48&&(l=u.subarray(-3));let f=Buffer.concat([l,n,i[1]]),h=this.length(f),m=n.length,g=f.subarray(2+m,2+m+h),w=g.length-l.length-2;if(w<=0||w>g.length)return;let S=g.subarray(-w).toString("utf8");return S.substring(Buffer.from(S).findIndex((E,b)=>S.charCodeAt(b)>=32&&S.charCodeAt(b)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var Lh=9e15,mu=1e9,Rb="0123456789abcdef",yw="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",vw="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pb={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Lh,maxE:Lh,crypto:!1},SP,co,Bt=!0,Sw="[DecimalError] ",du=Sw+"Invalid argument: ",EP=Sw+"Precision limit exceeded",AP=Sw+"crypto unavailable",CP="[object Decimal]",Jn=Math.floor,gn=Math.pow,VK=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,UK=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,MK=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,bP=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Mi=1e7,At=7,jK=9007199254740991,FK=yw.length-1,Ob=vw.length-1,Pe={toStringTag:CP};Pe.absoluteValue=Pe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),mt(r)};Pe.ceil=function(){return mt(new this.constructor(this),this.e+1,2)};Pe.clampedTo=Pe.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(du+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Pe.comparedTo=Pe.cmp=function(r){var e,t,n,s,i=this,a=i.d,u=(r=new i.constructor(r)).d,l=i.s,f=r.s;if(!a||!u)return!l||!f?NaN:l!==f?l:a===u?0:!a^l<0?1:-1;if(!a[0]||!u[0])return a[0]?l:u[0]?-f:0;if(l!==f)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=u.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};Pe.cosine=Pe.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+At,n.rounding=1,t=qK(n,BP(n,t)),n.precision=r,n.rounding=e,mt(co==2||co==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Pe.cubeRoot=Pe.cbrt=function(){var r,e,t,n,s,i,a,u,l,f,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(Bt=!1,i=h.s*gn(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=Pn(h.d),r=h.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=gn(t,1/3),r=Jn((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new m(t),n.s=h.s):n=new m(i.toString()),a=(r=m.precision)+3;;)if(u=n,l=u.times(u).times(u),f=l.plus(h),n=br(f.plus(h).times(u),f.plus(l),a+2,1),Pn(u.d).slice(0,a)===(t=Pn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(mt(u,r+1,0),u.times(u).times(u).eq(h))){n=u;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(mt(n,r+1,1),e=!n.times(n).times(n).eq(h));break}return Bt=!0,mt(n,r,m.rounding,e)};Pe.decimalPlaces=Pe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-Jn(this.e/At))*At,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Pe.dividedBy=Pe.div=function(r){return br(this,new this.constructor(r))};Pe.dividedToIntegerBy=Pe.divToInt=function(r){var e=this,t=e.constructor;return mt(br(e,new t(r),0,1,1),t.precision,t.rounding)};Pe.equals=Pe.eq=function(r){return this.cmp(r)===0};Pe.floor=function(){return mt(new this.constructor(this),this.e+1,3)};Pe.greaterThan=Pe.gt=function(r){return this.cmp(r)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(r){var e=this.cmp(r);return e==1||e===0};Pe.hyperbolicCosine=Pe.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/Aw(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=Vh(a,1,i.times(e),new a(1),!0);for(var l,f=r,h=new a(8);f--;)l=i.times(i),i=u.minus(l.times(h.minus(l.times(h))));return mt(i,a.precision=t,a.rounding=n,!0)};Pe.hyperbolicSine=Pe.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=Vh(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/Aw(5,r)),s=Vh(i,2,s,s,!0);for(var a,u=new i(5),l=new i(16),f=new i(20);r--;)a=s.times(s),s=s.times(u.plus(a.times(l.times(a).plus(f))))}return i.precision=e,i.rounding=t,mt(s,e,t,!0)};Pe.hyperbolicTangent=Pe.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,br(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Pe.inverseCosine=Pe.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?ha(e,n,s):new e(0):new e(NaN):r.isZero()?ha(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};Pe.inverseHyperbolicCosine=Pe.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Bt=!1,t=t.times(t).minus(1).sqrt().plus(t),Bt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Pe.inverseHyperbolicSine=Pe.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Bt=!1,t=t.times(t).plus(1).sqrt().plus(t),Bt=!0,n.precision=r,n.rounding=e,t.ln())};Pe.inverseHyperbolicTangent=Pe.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?mt(new i(s),r,e,!0):(i.precision=t=n-s.e,s=br(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};Pe.inverseSine=Pe.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=ha(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};Pe.inverseTangent=Pe.atan=function(){var r,e,t,n,s,i,a,u,l,f=this,h=f.constructor,m=h.precision,g=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&m+4<=Ob)return a=ha(h,m+4,g).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(m+4<=Ob)return a=ha(h,m+4,g).times(.5),a.s=f.s,a}for(h.precision=u=m+10,h.rounding=1,t=Math.min(28,u/At+2|0),r=t;r;--r)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(Bt=!1,e=Math.ceil(u/At),n=1,l=f.times(f),a=new h(f),s=f;r!==-1;)if(s=s.times(l),i=a.minus(s.div(n+=2)),s=s.times(l),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),Bt=!0,mt(a,h.precision=m,h.rounding=g,!0)};Pe.isFinite=function(){return!!this.d};Pe.isInteger=Pe.isInt=function(){return!!this.d&&Jn(this.e/At)>this.d.length-2};Pe.isNaN=function(){return!this.s};Pe.isNegative=Pe.isNeg=function(){return this.s<0};Pe.isPositive=Pe.isPos=function(){return this.s>0};Pe.isZero=function(){return!!this.d&&this.d[0]===0};Pe.lessThan=Pe.lt=function(r){return this.cmp(r)<0};Pe.lessThanOrEqualTo=Pe.lte=function(r){return this.cmp(r)<1};Pe.logarithm=Pe.log=function(r){var e,t,n,s,i,a,u,l,f=this,h=f.constructor,m=h.precision,g=h.rounding,w=5;if(r==null)r=new h(10),e=!0;else{if(r=new h(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new h(NaN);e=r.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new h(t&&!t[0]?-1/0:f.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(Bt=!1,u=m+w,a=pu(f,u),n=e?ww(h,u+10):pu(r,u),l=br(a,n,u,1),mm(l.d,s=m,g))do if(u+=10,a=pu(f,u),n=e?ww(h,u+10):pu(r,u),l=br(a,n,u,1),!i){+Pn(l.d).slice(s+1,s+15)+1==1e14&&(l=mt(l,m+1,0));break}while(mm(l.d,s+=10,g));return Bt=!0,mt(l,m,g)};Pe.minus=Pe.sub=function(r){var e,t,n,s,i,a,u,l,f,h,m,g,w=this,y=w.constructor;if(r=new y(r),!w.d||!r.d)return!w.s||!r.s?r=new y(NaN):w.d?r.s=-r.s:r=new y(r.d||w.s!==r.s?w:NaN),r;if(w.s!=r.s)return r.s=-r.s,w.plus(r);if(f=w.d,g=r.d,u=y.precision,l=y.rounding,!f[0]||!g[0]){if(g[0])r.s=-r.s;else if(f[0])r=new y(w);else return new y(l===3?-0:0);return Bt?mt(r,u,l):r}if(t=Jn(r.e/At),h=Jn(w.e/At),f=f.slice(),i=h-t,i){for(m=i<0,m?(e=f,i=-i,a=g.length):(e=g,t=h,a=f.length),n=Math.max(Math.ceil(u/At),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=f.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(f[n]!=g[n]){m=f[n]<g[n];break}i=0}for(m&&(e=f,f=g,g=e,r.s=-r.s),a=f.length,n=g.length-a;n>0;--n)f[a++]=0;for(n=g.length;n>i;){if(f[--n]<g[n]){for(s=n;s&&f[--s]===0;)f[s]=Mi-1;--f[s],f[n]+=Mi}f[n]-=g[n]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(r.d=f,r.e=Ew(f,t),Bt?mt(r,u,l):r):new y(l===3?-0:0)};Pe.modulo=Pe.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?mt(new n(t),n.precision,n.rounding):(Bt=!1,n.modulo==9?(e=br(t,r.abs(),0,3,1),e.s*=r.s):e=br(t,r,0,n.modulo,1),e=e.times(r),Bt=!0,t.minus(e))};Pe.naturalExponential=Pe.exp=function(){return kb(this)};Pe.naturalLogarithm=Pe.ln=function(){return pu(this)};Pe.negated=Pe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,mt(r)};Pe.plus=Pe.add=function(r){var e,t,n,s,i,a,u,l,f,h,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(f=m.d,h=r.d,u=g.precision,l=g.rounding,!f[0]||!h[0])return h[0]||(r=new g(m)),Bt?mt(r,u,l):r;if(i=Jn(m.e/At),n=Jn(r.e/At),f=f.slice(),s=i-n,s){for(s<0?(t=f,s=-s,a=h.length):(t=h,n=i,a=f.length),i=Math.ceil(u/At),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=f.length,s=h.length,a-s<0&&(s=a,t=h,h=f,f=t),e=0;s;)e=(f[--s]=f[s]+h[s]+e)/Mi|0,f[s]%=Mi;for(e&&(f.unshift(e),++n),a=f.length;f[--a]==0;)f.pop();return r.d=f,r.e=Ew(f,n),Bt?mt(r,u,l):r};Pe.precision=Pe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(du+r);return t.d?(e=xP(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Pe.round=function(){var r=this,e=r.constructor;return mt(new e(r),r.e+1,e.rounding)};Pe.sine=Pe.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+At,n.rounding=1,t=KK(n,BP(n,t)),n.precision=r,n.rounding=e,mt(co>2?t.neg():t,r,e,!0)):new n(NaN)};Pe.squareRoot=Pe.sqrt=function(){var r,e,t,n,s,i,a=this,u=a.d,l=a.e,f=a.s,h=a.constructor;if(f!==1||!u||!u[0])return new h(!f||f<0&&(!u||u[0])?NaN:u?a:1/0);for(Bt=!1,f=Math.sqrt(+a),f==0||f==1/0?(e=Pn(u),(e.length+l)%2==0&&(e+="0"),f=Math.sqrt(e),l=Jn((l+1)/2)-(l<0||l%2),f==1/0?e="5e"+l:(e=f.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new h(e)):n=new h(f.toString()),t=(l=h.precision)+3;;)if(i=n,n=i.plus(br(a,i,t+2,1)).times(.5),Pn(i.d).slice(0,t)===(e=Pn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(mt(i,l+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(mt(n,l+1,1),r=!n.times(n).eq(a));break}return Bt=!0,mt(n,l,h.rounding,r)};Pe.tangent=Pe.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=br(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,mt(co==2||co==4?t.neg():t,r,e,!0)):new n(NaN)};Pe.times=Pe.mul=function(r){var e,t,n,s,i,a,u,l,f,h=this,m=h.constructor,g=h.d,w=(r=new m(r)).d;if(r.s*=h.s,!g||!g[0]||!w||!w[0])return new m(!r.s||g&&!g[0]&&!w||w&&!w[0]&&!g?NaN:!g||!w?r.s/0:r.s*0);for(t=Jn(h.e/At)+Jn(r.e/At),l=g.length,f=w.length,l<f&&(i=g,g=w,w=i,a=l,l=f,f=a),i=[],a=l+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(e=0,s=l+n;s>n;)u=i[s]+w[n]*g[s-n-1]+e,i[s--]=u%Mi|0,e=u/Mi|0;i[s]=(i[s]+e)%Mi|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=Ew(i,t),Bt?mt(r,m.precision,m.rounding):r};Pe.toBinary=function(r,e){return Lb(this,2,r,e)};Pe.toDecimalPlaces=Pe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Ss(r,0,mu),e===void 0?e=n.rounding:Ss(e,0,8),mt(t,r+t.e+1,e))};Pe.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=pa(n,!0):(Ss(r,0,mu),e===void 0?e=s.rounding:Ss(e,0,8),n=mt(new s(n),r+1,e),t=pa(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=pa(s):(Ss(r,0,mu),e===void 0?e=i.rounding:Ss(e,0,8),n=mt(new i(s),r+s.e+1,e),t=pa(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Pe.toFraction=function(r){var e,t,n,s,i,a,u,l,f,h,m,g,w=this,y=w.d,S=w.constructor;if(!y)return new S(w);if(f=t=new S(1),n=l=new S(0),e=new S(n),i=e.e=xP(y)-w.e-1,a=i%At,e.d[0]=gn(10,a<0?At+a:a),r==null)r=i>0?e:f;else{if(u=new S(r),!u.isInt()||u.lt(f))throw Error(du+u);r=u.gt(e)?i>0?e:f:u}for(Bt=!1,u=new S(Pn(y)),h=S.precision,S.precision=i=y.length*At*2;m=br(u,e,0,1,1),s=t.plus(m.times(n)),s.cmp(r)!=1;)t=n,n=s,s=f,f=l.plus(m.times(s)),l=s,s=e,e=u.minus(m.times(s)),u=s;return s=br(r.minus(t),n,0,1,1),l=l.plus(s.times(f)),t=t.plus(s.times(n)),l.s=f.s=w.s,g=br(f,n,i,1).minus(w).abs().cmp(br(l,t,i,1).minus(w).abs())<1?[f,n]:[l,t],S.precision=h,Bt=!0,g};Pe.toHexadecimal=Pe.toHex=function(r,e){return Lb(this,16,r,e)};Pe.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:Ss(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(Bt=!1,t=br(t,r,0,e,1).times(r),Bt=!0,mt(t)):(r.s=t.s,t=r),t};Pe.toNumber=function(){return+this};Pe.toOctal=function(r,e){return Lb(this,8,r,e)};Pe.toPower=Pe.pow=function(r){var e,t,n,s,i,a,u=this,l=u.constructor,f=+(r=new l(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new l(gn(+u,f));if(u=new l(u),u.eq(1))return u;if(n=l.precision,i=l.rounding,r.eq(1))return mt(u,n,i);if(e=Jn(r.e/At),e>=r.d.length-1&&(t=f<0?-f:f)<=jK)return s=NP(l,u,t,n),r.s<0?new l(1).div(s):mt(s,n,i);if(a=u.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=gn(+u,f),e=t==0||!isFinite(t)?Jn(f*(Math.log("0."+Pn(u.d))/Math.LN10+u.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(Bt=!1,l.rounding=u.s=1,t=Math.min(12,(e+"").length),s=kb(r.times(pu(u,n+t)),n),s.d&&(s=mt(s,n+5,1),mm(s.d,n,i)&&(e=n+10,s=mt(kb(r.times(pu(u,e+t)),e),e+5,1),+Pn(s.d).slice(n+1,n+15)+1==1e14&&(s=mt(s,n+1,0)))),s.s=a,Bt=!0,l.rounding=i,mt(s,n,i))};Pe.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=pa(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(Ss(r,1,mu),e===void 0?e=s.rounding:Ss(e,0,8),n=mt(new s(n),r,e),t=pa(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toSignificantDigits=Pe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Ss(r,1,mu),e===void 0?e=n.rounding:Ss(e,0,8)),mt(new n(t),r,e)};Pe.toString=function(){var r=this,e=r.constructor,t=pa(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Pe.truncated=Pe.trunc=function(){return mt(new this.constructor(this),this.e+1,1)};Pe.valueOf=Pe.toJSON=function(){var r=this,e=r.constructor,t=pa(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function Pn(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=At-n.length,t&&(i+=hu(t)),i+=n;a=r[e],n=a+"",t=At-n.length,t&&(i+=hu(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}o(Pn,"digitsToString");function Ss(r,e,t){if(r!==~~r||r<e||r>t)throw Error(du+r)}o(Ss,"checkInt32");function mm(r,e,t,n){var s,i,a,u;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=At,s=0):(s=Math.ceil((e+1)/At),e%=At),i=gn(10,At-e),u=r[s]%i|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(r[s+1]/i/100|0)==gn(10,e-2)-1||(u==i/2||u==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==i||!n&&t>3&&u+1==i/2)&&(r[s+1]/i/1e3|0)==gn(10,e-3)-1,a}o(mm,"checkRoundingDigits");function mw(r,e,t){for(var n,s=[0],i,a=0,u=r.length;a<u;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=Rb.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}o(mw,"convertBase");function qK(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/Aw(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=Vh(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}o(qK,"cosine");var br=(function(){function r(n,s,i){var a,u=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+u,n[l]=a%i|0,u=a/i|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,s,i,a){var u,l;if(i!=a)l=i>a?1:-1;else for(u=l=0;u<i;u++)if(n[u]!=s[u]){l=n[u]>s[u]?1:-1;break}return l}o(e,"compare");function t(n,s,i,a){for(var u=0;i--;)n[i]-=u,u=n[i]<s[i]?1:0,n[i]=u*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,s,i,a,u,l){var f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R,H,q,K,G,he=n.constructor,le=n.s==s.s?1:-1,oe=n.d,Z=s.d;if(!oe||!oe[0]||!Z||!Z[0])return new he(!n.s||!s.s||(oe?Z&&oe[0]==Z[0]:!Z)?NaN:oe&&oe[0]==0||!Z?le*0:le/0);for(l?(w=1,h=n.e-s.e):(l=Mi,w=At,h=Jn(n.e/w)-Jn(s.e/w)),K=Z.length,H=oe.length,b=new he(le),T=b.d=[],m=0;Z[m]==(oe[m]||0);m++);if(Z[m]>(oe[m]||0)&&h--,i==null?(B=i=he.precision,a=he.rounding):u?B=i+(n.e-s.e)+1:B=i,B<0)T.push(1),y=!0;else{if(B=B/w+2|0,m=0,K==1){for(g=0,Z=Z[0],B++;(m<H||g)&&B--;m++)F=g*l+(oe[m]||0),T[m]=F/Z|0,g=F%Z|0;y=g||m<H}else{for(g=l/(Z[0]+1)|0,g>1&&(Z=r(Z,g,l),oe=r(oe,g,l),K=Z.length,H=oe.length),R=K,A=oe.slice(0,K),C=A.length;C<K;)A[C++]=0;G=Z.slice(),G.unshift(0),q=Z[0],Z[1]>=l/2&&++q;do g=0,f=e(Z,A,K,C),f<0?(x=A[0],K!=C&&(x=x*l+(A[1]||0)),g=x/q|0,g>1?(g>=l&&(g=l-1),S=r(Z,g,l),E=S.length,C=A.length,f=e(S,A,E,C),f==1&&(g--,t(S,K<E?G:Z,E,l))):(g==0&&(f=g=1),S=Z.slice()),E=S.length,E<C&&S.unshift(0),t(A,S,C,l),f==-1&&(C=A.length,f=e(Z,A,K,C),f<1&&(g++,t(A,K<C?G:Z,C,l))),C=A.length):f===0&&(g++,A=[0]),T[m++]=g,f&&A[0]?A[C++]=oe[R]||0:(A=[oe[R]],C=1);while((R++<H||A[0]!==void 0)&&B--);y=A[0]!==void 0}T[0]||T.shift()}if(w==1)b.e=h,SP=y;else{for(m=1,g=T[0];g>=10;g/=10)m++;b.e=m+h*w-1,mt(b,u?i+b.e+1:i,a,y)}return b}})();function mt(r,e,t,n){var s,i,a,u,l,f,h,m,g,w=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(s=1,u=m[0];u>=10;u/=10)s++;if(i=e-s,i<0)i+=At,a=e,h=m[g=0],l=h/gn(10,s-a-1)%10|0;else if(g=Math.ceil((i+1)/At),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);h=l=0,s=1,i%=At,a=i-At+1}else break e;else{for(h=u=m[g],s=1;u>=10;u/=10)s++;i%=At,a=i-At+s,l=a<0?0:h/gn(10,s-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?h:h%gn(10,s-a-1)),f=t<4?(l||n)&&(t==0||t==(r.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(i>0?a>0?h/gn(10,s-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,f?(e-=r.e+1,m[0]=gn(10,(At-e%At)%At),r.e=-e||0):m[0]=r.e=0,r;if(i==0?(m.length=g,u=1,g--):(m.length=g+1,u=gn(10,At-i),m[g]=a>0?(h/gn(10,s-a)%gn(10,a)|0)*u:0),f)for(;;)if(g==0){for(i=1,a=m[0];a>=10;a/=10)i++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(r.e++,m[0]==Mi&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=Mi)break;m[g--]=0,u=1}for(i=m.length;m[--i]===0;)m.pop()}return Bt&&(r.e>w.maxE?(r.d=null,r.e=NaN):r.e<w.minE&&(r.e=0,r.d=[0])),r}o(mt,"finalise");function pa(r,e,t){if(!r.isFinite())return IP(r);var n,s=r.e,i=Pn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+hu(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+hu(-s-1)+i,t&&(n=t-a)>0&&(i+=hu(n))):s>=a?(i+=hu(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+hu(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=hu(n))),i}o(pa,"finiteToString");function Ew(r,e){var t=r[0];for(e*=At;t>=10;t/=10)e++;return e}o(Ew,"getBase10Exponent");function ww(r,e,t){if(e>FK)throw Bt=!0,t&&(r.precision=t),Error(EP);return mt(new r(yw),e,1,!0)}o(ww,"getLn10");function ha(r,e,t){if(e>Ob)throw Error(EP);return mt(new r(vw),e,t,!0)}o(ha,"getPi");function xP(r){var e=r.length-1,t=e*At+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(xP,"getPrecision");function hu(r){for(var e="";r--;)e+="0";return e}o(hu,"getZeroString");function NP(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/At+4);for(Bt=!1;;){if(t%2&&(i=i.times(e),vP(i.d,a)&&(s=!0)),t=Jn(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),vP(e.d,a)}return Bt=!0,i}o(NP,"intPow");function yP(r){return r.d[r.d.length-1]&1}o(yP,"isOdd");function TP(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}o(TP,"maxOrMin");function kb(r,e){var t,n,s,i,a,u,l,f=0,h=0,m=0,g=r.constructor,w=g.rounding,y=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Bt=!1,l=y):l=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(gn(2,m))/Math.LN10*2+5|0,l+=n,t=i=a=new g(1),g.precision=l;;){if(i=mt(i.times(r),l,1),t=t.times(++h),u=a.plus(br(i,t,l,1)),Pn(u.d).slice(0,l)===Pn(a.d).slice(0,l)){for(s=m;s--;)a=mt(a.times(a),l,1);if(e==null)if(f<3&&mm(a.d,l-n,w,f))g.precision=l+=10,t=i=u=new g(1),h=0,f++;else return mt(a,g.precision=y,w,Bt=!0);else return g.precision=y,a}a=u}}o(kb,"naturalExponential");function pu(r,e){var t,n,s,i,a,u,l,f,h,m,g,w=1,y=10,S=r,E=S.d,b=S.constructor,T=b.rounding,A=b.precision;if(S.s<0||!E||!E[0]||!S.e&&E[0]==1&&E.length==1)return new b(E&&!E[0]?-1/0:S.s!=1?NaN:E?0:S);if(e==null?(Bt=!1,h=A):h=e,b.precision=h+=y,t=Pn(E),n=t.charAt(0),Math.abs(i=S.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)S=S.times(r),t=Pn(S.d),n=t.charAt(0),w++;i=S.e,n>1?(S=new b("0."+t),i++):S=new b(n+"."+t.slice(1))}else return f=ww(b,h+2,A).times(i+""),S=pu(new b(n+"."+t.slice(1)),h-y).plus(f),b.precision=A,e==null?mt(S,A,T,Bt=!0):S;for(m=S,l=a=S=br(S.minus(1),S.plus(1),h,1),g=mt(S.times(S),h,1),s=3;;){if(a=mt(a.times(g),h,1),f=l.plus(br(a,new b(s),h,1)),Pn(f.d).slice(0,h)===Pn(l.d).slice(0,h))if(l=l.times(2),i!==0&&(l=l.plus(ww(b,h+2,A).times(i+""))),l=br(l,new b(w),h,1),e==null)if(mm(l.d,h-y,T,u))b.precision=h+=y,f=a=S=br(m.minus(1),m.plus(1),h,1),g=mt(S.times(S),h,1),s=u=1;else return mt(l,b.precision=A,T,Bt=!0);else return b.precision=A,l;l=f,s+=2}}o(pu,"naturalLogarithm");function IP(r){return String(r.s*r.s/0)}o(IP,"nonFiniteToString");function gw(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%At,t<0&&(n+=At),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=At;n<s;)r.d.push(+e.slice(n,n+=At));e=e.slice(n),n=At-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),Bt&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}o(gw,"parseDecimal");function HK(r,e){var t,n,s,i,a,u,l,f,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),bP.test(e))return gw(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(UK.test(e))t=16,e=e.toLowerCase();else if(VK.test(e))t=2;else if(MK.test(e))t=8;else throw Error(du+e);for(i=e.search(/p/i),i>0?(l=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),u=e.length,i=u-i,s=NP(n,new n(t),i,i*2)),f=mw(e,t,Mi),h=f.length-1,i=h;f[i]===0;--i)f.pop();return i<0?new n(r.s*0):(r.e=Ew(f,h),r.d=f,Bt=!1,a&&(r=br(r,s,u*4)),l&&(r=r.times(Math.abs(l)<54?gn(2,l):Uh.pow(2,l))),Bt=!0,r)}o(HK,"parseOther");function KK(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Vh(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Aw(5,t)),e=Vh(r,2,e,e);for(var s,i=new r(5),a=new r(16),u=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(u))));return e}o(KK,"sine");function Vh(r,e,t,n,s){var i,a,u,l,f=1,h=r.precision,m=Math.ceil(h/At);for(Bt=!1,l=t.times(t),u=new r(n);;){if(a=br(u.times(l),new r(e++*e++),h,1),u=s?n.plus(a):n.minus(a),n=br(a.times(l),new r(e++*e++),h,1),a=u.plus(n),a.d[m]!==void 0){for(i=m;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=n,n=a,a=i,f++}return Bt=!0,a.d.length=m+1,a}o(Vh,"taylorSeries");function Aw(r,e){for(var t=r;--e;)t*=r;return t}o(Aw,"tinyPow");function BP(r,e){var t,n=e.s<0,s=ha(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return co=n?4:1,e;if(t=e.divToInt(s),t.isZero())co=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return co=yP(t)?n?2:3:n?4:1,e;co=yP(t)?n?1:4:n?3:2}return e.minus(s).abs()}o(BP,"toLessThanHalfPi");function Lb(r,e,t,n){var s,i,a,u,l,f,h,m,g,w=r.constructor,y=t!==void 0;if(y?(Ss(t,1,mu),n===void 0?n=w.rounding:Ss(n,0,8)):(t=w.precision,n=w.rounding),!r.isFinite())h=IP(r);else{for(h=pa(r),a=h.indexOf("."),y?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(h=h.replace(".",""),g=new w(1),g.e=h.length-a,g.d=mw(pa(g),10,s),g.e=g.d.length),m=mw(h,10,s),i=l=m.length;m[--l]==0;)m.pop();if(!m[0])h=y?"0p+0":"0";else{if(a<0?i--:(r=new w(r),r.d=m,r.e=i,r=br(r,g,t,n,0,s),m=r.d,i=r.e,f=SP),a=m[t],u=s/2,f=f||m[t+1]!==void 0,f=n<4?(a!==void 0||f)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||f||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,f)for(;++m[--t]>s-1;)m[t]=0,t||(++i,m.unshift(1));for(l=m.length;!m[l-1];--l);for(a=0,h="";a<l;a++)h+=Rb.charAt(m[a]);if(y){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)h+="0";for(m=mw(h,s,e),l=m.length;!m[l-1];--l);for(a=1,h="1.";a<l;a++)h+=Rb.charAt(m[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>l)for(i-=l;i--;)h+="0";else i<l&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return r.s<0?"-"+h:h}o(Lb,"toStringBinary");function vP(r,e){if(r.length>e)return r.length=e,!0}o(vP,"truncate");function $K(r){return new this(r).abs()}o($K,"abs");function XK(r){return new this(r).acos()}o(XK,"acos");function GK(r){return new this(r).acosh()}o(GK,"acosh");function WK(r,e){return new this(r).plus(e)}o(WK,"add");function JK(r){return new this(r).asin()}o(JK,"asin");function zK(r){return new this(r).asinh()}o(zK,"asinh");function YK(r){return new this(r).atan()}o(YK,"atan");function QK(r){return new this(r).atanh()}o(QK,"atanh");function ZK(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=ha(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?ha(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=ha(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(br(r,e,i,1)),e=ha(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(br(r,e,i,1)),t}o(ZK,"atan2");function e$(r){return new this(r).cbrt()}o(e$,"cbrt");function t$(r){return mt(r=new this(r),r.e+1,2)}o(t$,"ceil");function r$(r,e,t){return new this(r).clamp(e,t)}o(r$,"clamp");function n$(r){if(!r||typeof r!="object")throw Error(Sw+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,mu,"rounding",0,8,"toExpNeg",-Lh,0,"toExpPos",0,Lh,"maxE",0,Lh,"minE",-Lh,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=Pb[t]),(n=r[t])!==void 0)if(Jn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(du+t+": "+n);if(t="crypto",s&&(this[t]=Pb[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(AP);else this[t]=!1;else throw Error(du+t+": "+n);return this}o(n$,"config");function s$(r){return new this(r).cos()}o(s$,"cos");function i$(r){return new this(r).cosh()}o(i$,"cosh");function DP(r){var e,t,n;function s(i){var a,u,l,f=this;if(!(f instanceof s))return new s(i);if(f.constructor=s,wP(i)){f.s=i.s,Bt?!i.d||i.e>s.maxE?(f.e=NaN,f.d=null):i.e<s.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;Bt?a>s.maxE?(f.e=NaN,f.d=null):a<s.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[i]):(f.e=a,f.d=[i]);return}if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return gw(f,i.toString())}if(l==="string")return(u=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(u===43&&(i=i.slice(1)),f.s=1),bP.test(i)?gw(f,i):HK(f,i);if(l==="bigint")return i<0?(i=-i,f.s=-1):f.s=1,gw(f,i.toString());throw Error(du+i)}if(o(s,"Decimal"),s.prototype=Pe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=n$,s.clone=DP,s.isDecimal=wP,s.abs=$K,s.acos=XK,s.acosh=GK,s.add=WK,s.asin=JK,s.asinh=zK,s.atan=YK,s.atanh=QK,s.atan2=ZK,s.cbrt=e$,s.ceil=t$,s.clamp=r$,s.cos=s$,s.cosh=i$,s.div=a$,s.exp=o$,s.floor=u$,s.hypot=l$,s.ln=c$,s.log=f$,s.log10=p$,s.log2=h$,s.max=d$,s.min=m$,s.mod=g$,s.mul=y$,s.pow=v$,s.random=w$,s.round=S$,s.sign=E$,s.sin=A$,s.sinh=C$,s.sqrt=b$,s.sub=x$,s.sum=N$,s.tan=T$,s.tanh=I$,s.trunc=B$,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}o(DP,"clone");function a$(r,e){return new this(r).div(e)}o(a$,"div");function o$(r){return new this(r).exp()}o(o$,"exp");function u$(r){return mt(r=new this(r),r.e+1,3)}o(u$,"floor");function l$(){var r,e,t=new this(0);for(Bt=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return Bt=!0,new this(1/0);t=e}return Bt=!0,t.sqrt()}o(l$,"hypot");function wP(r){return r instanceof Uh||r&&r.toStringTag===CP||!1}o(wP,"isDecimalInstance");function c$(r){return new this(r).ln()}o(c$,"ln");function f$(r,e){return new this(r).log(e)}o(f$,"log");function h$(r){return new this(r).log(2)}o(h$,"log2");function p$(r){return new this(r).log(10)}o(p$,"log10");function d$(){return TP(this,arguments,-1)}o(d$,"max");function m$(){return TP(this,arguments,1)}o(m$,"min");function g$(r,e){return new this(r).mod(e)}o(g$,"mod");function y$(r,e){return new this(r).mul(e)}o(y$,"mul");function v$(r,e){return new this(r).pow(e)}o(v$,"pow");function w$(r){var e,t,n,s,i=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Ss(r,1,mu),n=Math.ceil(r/At),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:u[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(u.push(s%1e7),i+=4);i=n/4}else throw Error(AP);else for(;i<n;)u[i++]=Math.random()*1e7|0;for(n=u[--i],r%=At,n&&r&&(s=gn(10,At-r),u[i]=(n/s|0)*s);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=At)u.shift();for(n=1,s=u[0];s>=10;s/=10)n++;n<At&&(t-=At-n)}return a.e=t,a.d=u,a}o(w$,"random");function S$(r){return mt(r=new this(r),r.e+1,this.rounding)}o(S$,"round");function E$(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(E$,"sign");function A$(r){return new this(r).sin()}o(A$,"sin");function C$(r){return new this(r).sinh()}o(C$,"sinh");function b$(r){return new this(r).sqrt()}o(b$,"sqrt");function x$(r,e){return new this(r).sub(e)}o(x$,"sub");function N$(){var r=0,e=arguments,t=new this(e[r]);for(Bt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Bt=!0,mt(t,this.precision,this.rounding)}o(N$,"sum");function T$(r){return new this(r).tan()}o(T$,"tan");function I$(r){return new this(r).tanh()}o(I$,"tanh");function B$(r){return mt(r=new this(r),r.e+1,1)}o(B$,"trunc");Pe[Symbol.for("nodejs.util.inspect.custom")]=Pe.toString;Pe[Symbol.toStringTag]="Decimal";var Uh=Pe.constructor=DP(Pb);yw=new Uh(yw);vw=new Uh(vw);var _P=class r extends Uh{static{o(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};var RP=class{static{o(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var Sc=hw(W3(),1);import J3 from"fs";import hJ from"path";import ep from"crypto";import{NFeTsError as tS}from"@nfets/core/domain/errors/nfets-error";import{left as jx,right as rS}from"@nfets/core/shared/either";import{leftFromError as Fx}from"@nfets/core/shared/left-from-error";import{NullCacheAdapter as pJ}from"@nfets/core/infrastructure/repositories/null-cache-adapter";import{SignatureAlgorithm as dJ}from"@nfets/core/domain/entities/signer/algo";var z3=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new pJ){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let s=Sc.default.asn1.fromDer(n.value.toString("binary")),i=Sc.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a,pkcs8ShroudedKeyBag:u}=Sc.default.pki.oids,l=i.getBags({bagType:a}),f=i.getBags({bagType:u}),h=l[a];if(!h?.length)return jx(new tS("Cannot read certificate"));let[{cert:m},...g]=h;if(!m)return jx(new tS("Issuer Certificate not found"));let w=f[u]?.[0].key;if(!w)return jx(new tS("Certificate Private Key not found"));let y=g.reduce((A,{cert:C})=>(C&&A.push(new ep.X509Certificate(Sc.default.pki.certificateToPem(C))),A),[]),S=Sc.default.pki.privateKeyToPem(w),E=Sc.default.pki.certificateToPem(m),b=ep.createPrivateKey(S),T=new ep.X509Certificate(E);return rS({ca:y,password:t,privateKey:b,certificate:T})}catch(t){return Fx(t)}}async sign(e,t,n=dJ.SHA1){try{let i=ep.sign(n,Buffer.from(e),{key:t,padding:ep.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(rS(i))}catch(s){return Promise.resolve(Fx(s))}}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new tS("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return rS(i);if(hJ.isAbsolute(t)||J3.existsSync(t))return this.hitBufferOnCache(s,J3.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return Fx(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return ep.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),rS(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var Y3=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var J8=hw(X8(),1);import sre from"path";import{constants as ire}from"crypto";import{Agent as G8}from"https";import{right as are}from"@nfets/core/shared/either";import{leftFromError as ore}from"@nfets/core/shared/left-from-error";var W8=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:ire.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new G8({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return new G8({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,J8.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=sre.dirname(e.xsd),u=e.xsd,l=await this.toolkit.validate(i,a,u);if(l.isLeft())return l;let[f]=await n[`${e.method}Async`]({_xml:s},{httpsAgent:t});return are(f)}catch(t){return ore(t)}}};import ure from"path";var lre=gt(ure.join(process.env.NFETS_ADDONS_DIR??"","xml_validator.node")),z8=lre;var uae=hw(vV(),1);import iae from"fs";import aae from"path";import oae from"crypto";var wV="application/xml";var Ut;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ut||(Ut={}));function cre(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(cre,"SelectNodesEx");function fre(r,e){let t=Cp("xpath").select;return t(e,r)}o(fre,"SelectNodesNode");var SV=typeof self<"u"?cre:fre;function Ci(r){r=r.replace(/\r\n/g,`
85
+ `).replace(/\r/g,`
86
+ `);let e;return typeof DOMParser<"u"?e=DOMParser:e=Cp("DOMParser"),new e().parseFromString(r,wV)}o(Ci,"Parse");function Ua(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Cp("XMLSerializer"),new e().serializeToString(r)}o(Ua,"Stringify");function SE(r,e){let t=SV(r,e);return t&&t.length>0?t[0]:null}o(SE,"SelectSingleNode");function EV(r,e){return r&&r.nodeType===e}o(EV,"isNodeType");function Js(r){return EV(r,Ut.Element)}o(Js,"isElement");function Dc(r){return EV(r,Ut.Document)}o(Dc,"isDocument");var AV=new Map;function CV(r){for(let e in r)AV.set(e,r[e])}o(CV,"setNodeDependencies");function Cp(r){let e=AV.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Cp,"getNodeDependency");var og="element",ug="attribute",EE="content";var hre=1e9;function RT(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o(RT,"assign");function Mt(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=RT({},t.items)),t.target=e}}o(Mt,"XmlElement");function Xt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=RT({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||hre,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:og},xV(e,s,r)}}o(Xt,"XmlChildElement");function _r(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=RT({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=ug,xV(e,s,r)}}o(_r,"XmlAttribute");function xV(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(xV,"defineProperty");var Gu=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function pre(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(pre,"printf");function dre(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(dre,"padNum");var Fe=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=pre(an[e],...t);this.message=`${this.prefix}${dre(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Te;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(Te||(Te={}));var an={};an[Te.NONE]="No description";an[Te.NULL_REFERENCE]="Null reference";an[Te.NULL_PARAM]="'%1' has empty '%2' object";an[Te.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";an[Te.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";an[Te.METHOD_NOT_IMPLEMENTED]="Method is not implemented";an[Te.METHOD_NOT_SUPPORTED]="Method is not supported";an[Te.PARAM_REQUIRED]="Required parameter is missing '%1'";an[Te.CONVERTER_UNSUPPORTED]="Converter is not supported";an[Te.ELEMENT_MALFORMED]="Malformed element '%1'";an[Te.ELEMENT_MISSING]="Element '%1' is missing in '%2'";an[Te.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";an[Te.CONTENT_MISSING]="Content is missing in '%1'";an[Te.CRYPTOGRAPHIC]="Cryptographic error: %1";an[Te.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";an[Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";an[Te.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";an[Te.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";an[Te.XML_EXCEPTION]="XML exception: %1";an[Te.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var vr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new Fe(Te.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new Fe(Te.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var bi={get:o(r=>{if(r)return vr.ToBase64(r)},"get"),set:o(r=>vr.FromBase64(r),"set")},lg={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var mre="xml_root",Bs=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new Fe(Te.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Dc(e)&&(n=e.getElementById(t)),n==null&&(n=SE(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=SE(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=SE(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=mre,t=null,n=null){if(n&&!t)throw new Fe(Te.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Ci(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Dc(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];Js(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=Dc(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(Js(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(Js(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let l=t[u],f=i.items[u];switch(f.type){case EE:{let h=f,m=h.converter?h.converter.get(l):l;if(h.required&&m==null)throw new Fe(Te.CONTENT_MISSING,a);(h.defaultValue!==l||h.required)&&(s.textContent=m);break}case ug:{let h=f,m=h.converter?h.converter.get(l):l;if(h.required&&m==null)throw new Fe(Te.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==l||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case og:{let h=f,m=null;if(h.parser){if(h.required&&!l||h.minOccurs&&!l.Count){let g=l?.localName||h.localName;throw new Fe(Te.ELEMENT_MISSING,g,a)}l&&(m=l.GetXml(l.element===void 0&&(h.required||l.Count)))}else{let g=h.converter?h.converter.get(l):l;if(h.required&&g===void 0)throw new Fe(Te.ELEMENT_MISSING,h.localName,a);if(l!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let w of g){let y=w instanceof r?w.GetXml(!0):w;y!==null&&m&&m.appendChild(y)}else if(g instanceof r){let w=g.GetXml(!0);w&&m&&m.appendChild(w)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let E=m.childNodes.item(S);Js(E)&&g.push(E)}let w=h.minOccurs||0,y=h.maxOccurs||1/0;if(g.length<w||g.length>y)throw new Fe(Te.COLLECTION_LIMIT,l.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new Fe(Te.COLLECTION_LIMIT,l.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Ci(e).documentElement:t=e,!t)throw new Fe(Te.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new Fe(Te.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case EE:{let l=u;if(l.required&&!t.textContent)throw new Fe(Te.CONTENT_MISSING,i);if(!t.textContent)n[a]=l.defaultValue;else{let f=l.converter?l.converter.set(t.textContent):t.textContent;n[a]=f}break}case ug:{let l=u,f,h;if(!l.localName)throw new Fe(Te.PARAM_REQUIRED,"localName");if(l.namespaceURI?(f=t.hasAttributeNS.bind(t,l.namespaceURI,l.localName),h=t.getAttributeNS.bind(t,l.namespaceURI,l.localName)):(f=t.hasAttribute.bind(t,l.localName),h=t.getAttribute.bind(t,l.localName)),l.required&&!f())throw new Fe(Te.ATTRIBUTE_MISSING,l.localName,i);if(!f())n[a]=l.defaultValue;else{let m=h(),g=l.converter&&m?l.converter.set(m):m;n[a]=g}break}case og:{let l=u;if(l.noRoot){if(!l.parser)throw new Fe(Te.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser'`);let h=new l.parser;if(!(h instanceof bp))throw new Fe(Te.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=l.minOccurs||0,g=l.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new Fe(Te.COLLECTION_LIMIT,l.parser.localName,i);n[a]=h;continue}let f=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!Js(m))continue;let g=m;if(g.localName===l.localName&&g.namespaceURI==l.namespaceURI){f=g;break}}if(l.required&&!f)throw new Fe(Te.ELEMENT_MISSING,l.parser?l.parser.localName:l.localName,i);if(l.parser){if(f){let h=new l.parser;h.localName=l.localName,h.namespaceURI=l.namespaceURI,n[a]=h,h.LoadXml(f)}}else if(!f)n[a]=l.defaultValue;else{let h=f.textContent||"",m=l.converter?l.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Ua(e):""}GetElement(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new Fe(Te.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var bp=class extends Bs{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new Gu(this.GetIterator().map(e))}Filter(e){return new Gu(this.GetIterator().filter(e))}Sort(e){return new Gu(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new Fe(Te.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(Js(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var xp=class extends Gu{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var gre="[object ArrayBuffer]",dt=class kT{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===gre}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=kT.toUint8Array(e),s=kT.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},OT="string",yre=/^[0-9a-f\s]+$/i,vre=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,wre=/^[a-zA-Z0-9-_]+$/,NV=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=dt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},Ma=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=dt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Ct=class Np{static{o(this,"Convert")}static isHex(e){return typeof e===OT&&yre.test(e)}static isBase64(e){return typeof e===OT&&vre.test(e)}static isBase64Url(e){return typeof e===OT&&wre.test(e)}static ToString(e,t="utf8"){let n=dt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Ma.toString(n,!0);case"utf16":case"utf16be":return Ma.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Ma.fromString(e,!0);case"utf16":case"utf16be":return Ma.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=dt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Np.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Np.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=Np.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return NV.fromString(e);case"utf16":case"utf16be":return Ma.fromString(e);case"utf16le":case"usc2":return Ma.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=Np.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return NV.toString(e);case"utf16":case"utf16be":return Ma.toString(e);case"utf16le":case"usc2":return Ma.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=dt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=dt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Np.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return Ma.toString(e,t)}static FromUtf16String(e,t=!1){return Ma.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Ct.DEFAULT_UTF8_ENCODING="utf8";function D(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(D,"getParametersValue");function AE(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(AE,"bufferToHexCodes");function xo(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(xo,"utilFromBase");function Xi(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let l;if(n<0)l=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);l=new ArrayBuffer(n),i=n}let f=new Uint8Array(l);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);f[i-h-1]=Math.floor(s/m),s-=f[i-h-1]*m}return l}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Xi,"utilToBase");function _c(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(_c,"utilConcatBuf");function CE(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(CE,"utilConcatView");function LT(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,l=r[0]===0&&(r[1]&128)===0;(u||l)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=xo(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,xo(i,8)-n}o(LT,"utilDecodeTC");function IV(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Xi(a,8,n),l=new Uint8Array(u);return l[0]|=128,u}let s=Xi(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let l=0;l<a.byteLength;l++)i[l+1]=u[l];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(IV,"utilEncodeTC");function Wu(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Wu,"isEqualBuffer");function Ds(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(Ds,"padNumber");var BV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",DV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function bE(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",l=e?DV:BV;if(n){let f=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){f=h;break}r=r.slice(f)}for(;s<r.length;){let f=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=f>>2,w=(f&3)<<4|h>>4,y=(h&15)<<2|m>>6,S=m&63;i===1?y=S=64:a===1&&(S=64),t?y===64?u+=`${l.charAt(g)}${l.charAt(w)}`:S===64?u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}`:u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}${l.charAt(S)}`:u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}${l.charAt(S)}`}return u}o(bE,"toBase64");function Tp(r,e=!1,t=!1){let n=e?DV:BV;function s(l){for(let f=0;f<64;f++)if(n.charAt(f)===l)return f;return 64}o(s,"indexOf");function i(l){return l===64?0:l}o(i,"test");let a=0,u="";for(;a<r.length;){let l=s(r.charAt(a++)),f=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(l)<<2|i(f)>>4,w=(i(f)&15)<<4|i(h)>>2,y=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(w)),m!==64&&(u+=String.fromCharCode(y))}if(t){let l=u.length,f=-1;for(let h=l-1;h>=0;h--)if(u.charCodeAt(h)!==0){f=h;break}f!==-1?u=u.slice(0,f+1):u=""}return u}o(Tp,"fromBase64");function cg(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(cg,"arrayBufferToString");function Rc(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Rc,"stringToArrayBuffer");var Sre=Math.log(2);function _V(r){let e=Math.log(r)/Sre,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(_V,"nearestPowerOf2");function _e(r,e){for(let t of e)delete r[t]}o(_e,"clearProps");function xE(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(xE,"assertBigInt");function jT(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(jT,"concat");function No(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(No,"checkBufferParams");var FT=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return jT(this.items)}},fg=[new Uint8Array([1])],PV="0123456789",VT="name",OV="valueHexView",Ere="isHexOnly",Are="idBlock",Cre="tagClass",bre="tagNumber",xre="isConstructed",Nre="fromBER",Tre="toBER",Ire="local",_s="",Gi=new ArrayBuffer(0),NE=new Uint8Array(0),pg="EndOfContent",LV="OCTET STRING",VV="BIT STRING";function To(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?dt.toUint8Array(i.valueHex):NE}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!No(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Gi)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Ct.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(To,"HexBlock");var Pc=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=_s,warnings:n=[],valueBeforeDecode:s=NE}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=dt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Ct.ToHex(this.valueBeforeDecodeView)}}};Pc.NAME="baseBlock";var Rs=class extends Pc{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Rs.NAME="valueBlock";var UV=class extends To(Pc){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?dt.toUint8Array(e.valueHex):NE,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Gi}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=Xi(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let l=0;l<a-1;l++)u[l+1]=i[l]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let l=1,f=this.valueHexView=new Uint8Array(255),h=255;for(;i[l]&128;){if(f[l-1]=i[l]&127,l++,l>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(l===h){h+=255;let g=new Uint8Array(h);for(let w=0;w<f.length;w++)g[w]=f[w];f=this.valueHexView=new Uint8Array(h)}}this.blockLength=l+1,f[l-1]=i[l]&127;let m=new Uint8Array(l);for(let g=0;g<l;g++)m[g]=f[g];f=this.valueHexView=new Uint8Array(l),f.set(m),this.blockLength<=9?this.tagNumber=xo(f,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};UV.NAME="identificationBlock";var MV=class extends Pc{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,l=s.subarray(u,u+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=xo(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=Xi(this.length,8);if(s.byteLength>127)return this.error="Too big length",Gi;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};MV.NAME="lengthBlock";var ot={},ps=class extends Pc{static{o(this,"BaseBlock")}constructor({name:e=_s,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new UV(s),this.lenBlock=new MV(s),this.valueBlock=i?new i(s):new Rs(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new FT;t||jV(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?Gi:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Ct.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Ct.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Wu(t,n)}};ps.NAME="BaseBlock";function jV(r){var e;if(r instanceof ot.Constructed)for(let t of r.valueBlock.value)jV(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(jV,"prepareIndefiniteForm");var FV=class extends ps{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=_s,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};FV.NAME="BaseStringBlock";var qV=class extends To(Rs){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};qV.NAME="PrimitiveValueBlock";var HV,yt=class extends ps{static{o(this,"Primitive")}constructor(e={}){super(e,qV),this.idBlock.isConstructed=!1}};HV=yt;ot.Primitive=HV;yt.NAME="PRIMITIVE";function Bre(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(Bre,"localChangeType");function dg(r,e=0,t=r.length){let n=e,s=new ps({},Rs),i=new Pc;if(!No(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let l=ps;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};l=ot.EndOfContent;break;case 1:l=ot.Boolean;break;case 2:l=ot.Integer;break;case 3:l=ot.BitString;break;case 4:l=ot.OctetString;break;case 5:l=ot.Null;break;case 6:l=ot.ObjectIdentifier;break;case 10:l=ot.Enumerated;break;case 12:l=ot.Utf8String;break;case 13:l=ot.RelativeObjectIdentifier;break;case 14:l=ot.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:l=ot.Sequence;break;case 17:l=ot.Set;break;case 18:l=ot.NumericString;break;case 19:l=ot.PrintableString;break;case 20:l=ot.TeletexString;break;case 21:l=ot.VideotexString;break;case 22:l=ot.IA5String;break;case 23:l=ot.UTCTime;break;case 24:l=ot.GeneralizedTime;break;case 25:l=ot.GraphicString;break;case 26:l=ot.VisibleString;break;case 27:l=ot.GeneralString;break;case 28:l=ot.UniversalString;break;case 29:l=ot.CharacterString;break;case 30:l=ot.BmpString;break;case 31:l=ot.DATE;break;case 32:l=ot.TimeOfDay;break;case 33:l=ot.DateTime;break;case 34:l=ot.Duration;break;default:{let f=s.idBlock.isConstructed?new ot.Constructed:new ot.Primitive;f.idBlock=s.idBlock,f.lenBlock=s.lenBlock,f.warnings=s.warnings,s=f}}break;case 2:case 3:case 4:default:l=s.idBlock.isConstructed?ot.Constructed:ot.Primitive}return s=Bre(s,l),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(dg,"localFromBER");function Hr(r){if(!r.byteLength){let e=new ps({},Rs);return e.error="Input buffer has zero length",{offset:-1,result:e}}return dg(dt.toUint8Array(r).slice(),0,r.byteLength)}o(Hr,"fromBER");function Dre(r,e){return r?1:e}o(Dre,"checkLen");var Ju=class extends Rs{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;Dre(this.isIndefiniteForm,n)>0;){let a=dg(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===pg)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===pg?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new FT;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Gi:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Ju.NAME="ConstructedValueBlock";var KV,ae=class extends ps{static{o(this,"Constructed")}constructor(e={}){super(e,Ju),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
87
+ `).map(s=>` ${s}`).join(`
88
+ `));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
89
+ ${e.join(`
90
+ `)}`:`${t} :`}};KV=ae;ot.Constructed=KV;ae.NAME="CONSTRUCTED";var $V=class extends Rs{static{o(this,"LocalEndOfContentValueBlock")}fromBER(e,t,n){return t}toBER(e){return Gi}};$V.override="EndOfContentValueBlock";var XV,GV=class extends ps{static{o(this,"EndOfContent")}constructor(e={}){super(e,$V),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};XV=GV;ot.EndOfContent=XV;GV.NAME=pg;var WV,Kr=class extends ps{static{o(this,"Null")}constructor(e={}){super(e,Rs),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let s=new Uint8Array(n);s[0]=5,s[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};WV=Kr;ot.Null=WV;Kr.NAME="NULL";var JV=class extends To(Rs){static{o(this,"LocalBooleanValueBlock")}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=dt.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,n){let s=dt.toUint8Array(e);return No(this,s,t,n)?(this.valueHexView=s.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,LT.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};JV.NAME="BooleanValueBlock";var zV,Wi=class extends ps{static{o(this,"Boolean")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,JV),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};zV=Wi;ot.Boolean=zV;Wi.NAME="BOOLEAN";var YV=class extends To(Ju){static{o(this,"LocalOctetStringValueBlock")}constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=Ju.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let i=0;i<this.value.length;i++){let a=this.value[i].constructor.NAME;if(a===pg){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==LV)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,t,n),this.blockLength=n;return s}toBER(e,t){return this.isConstructed?Ju.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};YV.NAME="OctetStringValueBlock";var qT,Ve=class extends ps{static{o(this,"OctetString")}constructor({idBlock:e={},lenBlock:t={},...n}={}){var s,i;(s=n.isConstructed)!==null&&s!==void 0||(n.isConstructed=!!(!((i=n.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},YV),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let i=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(i.byteLength){let a=dg(i,0,i.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return ae.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=Ct.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof qT&&e.push(t.valueBlock.valueHexView);return dt.concat(e)}};qT=Ve;ot.OctetString=qT;Ve.NAME=LV;var QV=class extends To(Ju){static{o(this,"LocalBitStringValueBlock")}constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let s=-1;if(this.isConstructed){if(s=Ju.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let u of this.value){let l=u.constructor.NAME;if(l===pg){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==VV)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let f=u.valueBlock;if(this.unusedBits>0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return s}let i=dt.toUint8Array(e);if(!No(this,i,t,n))return-1;let a=i.subarray(t,t+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let u=a.subarray(1);try{if(u.byteLength){let l=dg(u,0,u.byteLength);l.offset!==-1&&l.offset===n-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+n}toBER(e,t){if(this.isConstructed)return Ju.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Gi;let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};QV.NAME="BitStringValueBlock";var ZV,qt=class extends ps{static{o(this,"BitString")}constructor({idBlock:e={},lenBlock:t={},...n}={}){var s,i;(s=n.isConstructed)!==null&&s!==void 0||(n.isConstructed=!!(!((i=n.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},QV),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return ae.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let a of t)e.push(a.toString(2).padStart(8,"0"));let n=e.join(""),s=this.constructor.NAME,i=n.substring(0,n.length-this.valueBlock.unusedBits);return`${s} : ${i}`}}};ZV=qt;ot.BitString=ZV;qt.NAME=VV;var eU;function _re(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,u=s.slice(0),l=u.length-1,f=0,h=l<a?a:l,m=0;for(let g=h;g>=0;g--,m++){switch(!0){case m<u.length:f=i[a-m]+u[l-m]+t[0];break;default:f=i[a-m]+t[0]}switch(t[0]=f/10,!0){case m>=i.length:i=CE(new Uint8Array([f%10]),i);break;default:i[a-m]=f%10}}return t[0]>0&&(i=CE(t,i)),i}o(_re,"viewAdd");function kV(r){if(r>=fg.length)for(let e=fg.length;e<=r;e++){let t=new Uint8Array([0]),n=fg[e-1].slice(0);for(let s=n.length-1;s>=0;s--){let i=new Uint8Array([(n[s]<<1)+t[0]]);t[0]=i[0]/10,n[s]=i[0]%10}t[0]>0&&(n=CE(t,n)),fg.push(n)}return fg[r]}o(kV,"power2");function Rre(r,e){let t=0,n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,u=s.slice(0),l=u.length-1,f,h=0;for(let m=l;m>=0;m--,h++)switch(f=i[a-h]-u[l-h]-t,!0){case f<0:t=1,i[a-h]=f+10;break;default:t=0,i[a-h]=f}if(t>0)for(let m=a-l+1;m>=0;m--,h++)if(f=i[a-h]-t,f<0)t=1,i[a-h]=f+10;else{t=0,i[a-h]=f;break}return i.slice()}o(Rre,"viewSub");var HT=class extends To(Rs){static{o(this,"LocalIntegerValueBlock")}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=LT.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(IV(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,s=0){let i=this.fromBER(e,t,n);if(i===-1)return i;let a=this.valueHexView;return a[0]===0&&(a[1]&128)!==0?this.valueHexView=a.subarray(1):s!==0&&a.length<s&&(s-a.length>1&&(s=a.length+1),this.valueHexView=a.subarray(s-a.length)),i}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let s=super.fromBER(e,t,n);return s===-1||this.setValueHex(),s}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,s,i=this.valueHexView,a="",u=!1;for(let l=i.byteLength-1;l>=0;l--){s=i[l];for(let f=0;f<8;f++){if((s&1)===1)switch(n){case e:t=Rre(kV(n),t),a="-";break;default:t=_re(t,kV(n))}n++,s>>=1}}for(let l=0;l<t.length;l++)t[l]&&(u=!0),u&&(a+=PV.charAt(t[l]));return u===!1&&(a+=PV.charAt(0)),a}};eU=HT;HT.NAME="IntegerValueBlock";Object.defineProperty(eU.prototype,"valueHex",{set:o(function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},"set"),get:o(function(){return this.valueHexView.slice().buffer},"get")});var hg,me=class extends ps{static{o(this,"Integer")}constructor(e={}){super(e,HT),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return xE(),BigInt(this.valueBlock.toString())}static fromBigInt(e){xE();let t=BigInt(e),n=new FT,s=t.toString(16).replace(/^-/,""),i=new Uint8Array(Ct.FromHex(s));if(t<0){let u=new Uint8Array(i.length+(i[0]&128?1:0));u[0]|=128;let f=BigInt(`0x${Ct.ToHex(u)}`)+t,h=dt.toUint8Array(Ct.FromHex(f.toString(16)));h[0]|=128,n.write(h)}else i[0]&128&&n.write(new Uint8Array([0])),n.write(i);return new hg({valueHex:n.final()})}convertToDER(){let e=new hg({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new hg({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};hg=me;ot.Integer=hg;me.NAME="INTEGER";var tU,zu=class extends me{static{o(this,"Enumerated")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};tU=zu;ot.Enumerated=tU;zu.NAME="ENUMERATED";var UT=class extends To(Rs){static{o(this,"LocalSidValueBlock")}constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let u=0;u<n&&(this.valueHexView[u]=i[u]&127,this.blockLength++,(i[u]&128)!==0);u++);let a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,(i[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=xo(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){xE();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let s=0;s<n.length;s++)n[s]=parseInt(t.slice(s*7,s*7+7),2)+(s+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let s=this.valueHexView,i=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)i[a]=s[a]|128;return i[this.blockLength-1]=s[this.blockLength-1],i.buffer}let t=Xi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Gi;let n=new Uint8Array(t.byteLength);if(!e){let s=new Uint8Array(t),i=t.byteLength-1;for(let a=0;a<i;a++)n[a]=s[a]|128;n[i]=s[i]}return n}toString(){let e="";if(this.isHexOnly)e=Ct.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};UT.NAME="sidBlock";var rU=class extends Rs{static{o(this,"LocalObjectIdentifierValueBlock")}constructor({value:e=_s,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new UT;if(s=i.fromBER(e,s,n),s===-1)return this.blockLength=0,this.error=i.error,s;this.value.length===0&&(i.isFirstSid=!0),this.blockLength+=i.blockLength,n-=i.blockLength,this.value.push(i)}return s}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Gi;t.push(s)}return jT(t)}fromString(e){this.value=[];let t=0,n=0,s="",i=!1;do if(n=e.indexOf(".",t),n===-1?s=e.substring(t):s=e.substring(t,n),t=n+1,i){let a=this.value[0],u=0;switch(a.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}let l=parseInt(s,10);if(isNaN(l))return;a.valueDec=l+u,i=!1}else{let a=new UT;if(s>Number.MAX_SAFE_INTEGER){xE();let u=BigInt(s);a.valueBigInt=u}else if(a.valueDec=parseInt(s,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,i=!0),this.value.push(a)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let s=this.value[n].toString();n!==0&&(e=`${e}.`),t?(s=`{${s}}`,this.value[n].isFirstSid?e=`2.{${s} - 80}`:e+=s):e+=s}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};rU.NAME="ObjectIdentifierValueBlock";var nU,rt=class extends ps{static{o(this,"ObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,rU),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};nU=rt;ot.ObjectIdentifier=nU;rt.NAME="OBJECT IDENTIFIER";var MT=class extends To(Pc){static{o(this,"LocalRelativeSidValueBlock")}constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let s=dt.toUint8Array(e);if(!No(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let u=0;u<n&&(this.valueHexView[u]=i[u]&127,this.blockLength++,(i[u]&128)!==0);u++);let a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,(i[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=xo(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let s=this.valueHexView,i=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)i[a]=s[a]|128;return i[this.blockLength-1]=s[this.blockLength-1],i.buffer}let t=Xi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Gi;let n=new Uint8Array(t.byteLength);if(!e){let s=new Uint8Array(t),i=t.byteLength-1;for(let a=0;a<i;a++)n[a]=s[a]|128;n[i]=s[i]}return n.buffer}toString(){let e="";return this.isHexOnly?e=Ct.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};MT.NAME="relativeSidBlock";var sU=class extends Rs{static{o(this,"LocalRelativeObjectIdentifierValueBlock")}constructor({value:e=_s,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new MT;if(s=i.fromBER(e,s,n),s===-1)return this.blockLength=0,this.error=i.error,s;this.blockLength+=i.blockLength,n-=i.blockLength,this.value.push(i)}return s}toBER(e,t){let n=[];for(let s=0;s<this.value.length;s++){let i=this.value[s].toBER(e);if(i.byteLength===0)return this.error=this.value[s].error,Gi;n.push(i)}return jT(n)}fromString(e){this.value=[];let t=0,n=0,s="";do{n=e.indexOf(".",t),n===-1?s=e.substring(t):s=e.substring(t,n),t=n+1;let i=new MT;if(i.valueDec=parseInt(s,10),isNaN(i.valueDec))return!0;this.value.push(i)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let s=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(s=`{${s}}`),e+=s}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};sU.NAME="RelativeObjectIdentifierValueBlock";var iU,aU=class extends ps{static{o(this,"RelativeObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,sU),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};iU=aU;ot.RelativeObjectIdentifier=iU;aU.NAME="RelativeObjectIdentifier";var oU,W=class extends ae{static{o(this,"Sequence")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};oU=W;ot.Sequence=oU;W.NAME="SEQUENCE";var uU,$r=class extends ae{static{o(this,"Set")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};uU=$r;ot.Set=uU;$r.NAME="SET";var lU=class extends To(Rs){static{o(this,"LocalStringValueBlock")}constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=_s}toJSON(){return{...super.toJSON(),value:this.value}}};lU.NAME="StringValueBlock";var cU=class extends lU{static{o(this,"LocalSimpleStringValueBlock")}};cU.NAME="SimpleStringValueBlock";var zs=class extends FV{static{o(this,"LocalSimpleStringBlock")}constructor({...e}={}){super(e,cU)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,dt.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);this.valueBlock.value=e}};zs.NAME="SIMPLE STRING";var fU=class extends zs{static{o(this,"LocalUtf8StringValueBlock")}fromBuffer(e){this.valueBlock.valueHexView=dt.toUint8Array(e);try{this.valueBlock.value=Ct.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=Ct.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(Ct.FromUtf8String(e)),this.valueBlock.value=e}};fU.NAME="Utf8StringValueBlock";var hU,xi=class extends fU{static{o(this,"Utf8String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};hU=xi;ot.Utf8String=hU;xi.NAME="UTF8String";var pU=class extends zs{static{o(this,"LocalBmpStringValueBlock")}fromBuffer(e){this.valueBlock.value=Ct.ToUtf16String(e),this.valueBlock.valueHexView=dt.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(Ct.FromUtf16String(e))}};pU.NAME="BmpStringValueBlock";var dU,Ip=class extends pU{static{o(this,"BmpString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};dU=Ip;ot.BmpString=dU;Ip.NAME="BMPString";var mU=class extends zs{static{o(this,"LocalUniversalStringValueBlock")}fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let s=0;s<n.length;s+=4)n[s]=n[s+3],n[s+1]=n[s+2],n[s+2]=0,n[s+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let s=0;s<t;s++){let i=Xi(e.charCodeAt(s),8),a=new Uint8Array(i);if(a.length>4)continue;let u=4-a.length;for(let l=a.length-1;l>=0;l--)n[s*4+l+u]=a[l]}this.valueBlock.value=e}};mU.NAME="UniversalStringValueBlock";var gU,Bp=class extends mU{static{o(this,"UniversalString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};gU=Bp;ot.UniversalString=gU;Bp.NAME="UniversalString";var yU,Oc=class extends zs{static{o(this,"NumericString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};yU=Oc;ot.NumericString=yU;Oc.NAME="NumericString";var vU,Ni=class extends zs{static{o(this,"PrintableString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};vU=Ni;ot.PrintableString=vU;Ni.NAME="PrintableString";var wU,Dp=class extends zs{static{o(this,"TeletexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};wU=Dp;ot.TeletexString=wU;Dp.NAME="TeletexString";var SU,TE=class extends zs{static{o(this,"VideotexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};SU=TE;ot.VideotexString=SU;TE.NAME="VideotexString";var EU,mg=class extends zs{static{o(this,"IA5String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};EU=mg;ot.IA5String=EU;mg.NAME="IA5String";var AU,IE=class extends zs{static{o(this,"GraphicString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};AU=IE;ot.GraphicString=AU;IE.NAME="GraphicString";var CU,gg=class extends zs{static{o(this,"VisibleString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};CU=gg;ot.VisibleString=CU;gg.NAME="VisibleString";var bU,BE=class extends zs{static{o(this,"GeneralString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};bU=BE;ot.GeneralString=bU;BE.NAME="GeneralString";var xU,DE=class extends zs{static{o(this,"CharacterString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};xU=DE;ot.CharacterString=xU;DE.NAME="CharacterString";var NU,kc=class extends gg{static{o(this,"UTCTime")}constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let s=0;s<e.length;s++)this.valueBlock.valueHexView[s]=e.charCodeAt(s)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,dt.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let s=parseInt(n[1],10);s>=50?this.year=1900+s:this.year=2e3+s,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=Ds(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ds(this.month,2),t[2]=Ds(this.day,2),t[3]=Ds(this.hour,2),t[4]=Ds(this.minute,2),t[5]=Ds(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};NU=kc;ot.UTCTime=NU;kc.NAME="UTCTime";var TU,Rr=class extends kc{static{o(this,"GeneralizedTime")}constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,n="",s="",i=0,a,u=0,l=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let m=new Number(e[e.length-1]);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let m=1,g=n.indexOf("+"),w="";if(g===-1&&(g=n.indexOf("-"),m=-1),g!==-1){if(w=n.substring(g+1),n=n.substring(0,g),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let y=parseInt(w.substring(0,2),10);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");if(u=m*y,w.length===4){if(y=parseInt(w.substring(2,4),10),isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");l=m*y}}}let f=n.indexOf(".");if(f===-1&&(f=n.indexOf(",")),f!==-1){let m=new Number(`0${n.substring(f)}`);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");i=m.valueOf(),s=n.substring(0,f)}else s=n;switch(!0){case s.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case s.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=60*i;this.minute=Math.floor(m),m=60*(m-this.minute),this.second=Math.floor(m),m=1e3*(m-this.second),this.millisecond=Math.floor(m)}break;case s.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=60*i;this.second=Math.floor(m),m=1e3*(m-this.second),this.millisecond=Math.floor(m)}break;case s.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=1e3*i;this.millisecond=Math.floor(m)}break;default:throw new Error("Wrong input string for conversion")}let h=a.exec(s);if(h===null)throw new Error("Wrong input string for conversion");for(let m=1;m<h.length;m++)switch(m){case 1:this.year=parseInt(h[m],10);break;case 2:this.month=parseInt(h[m],10);break;case 3:this.day=parseInt(h[m],10);break;case 4:this.hour=parseInt(h[m],10)+u;break;case 5:this.minute=parseInt(h[m],10)+l;break;case 6:this.second=parseInt(h[m],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let m=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=m.getUTCFullYear(),this.month=m.getUTCMonth(),this.day=m.getUTCDay(),this.hour=m.getUTCHours(),this.minute=m.getUTCMinutes(),this.second=m.getUTCSeconds(),this.millisecond=m.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(Ds(this.year,4)),t.push(Ds(this.month,2)),t.push(Ds(this.day,2)),t.push(Ds(this.hour,2)),t.push(Ds(this.minute,2)),t.push(Ds(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Ds(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};TU=Rr;ot.GeneralizedTime=TU;Rr.NAME="GeneralizedTime";var IU,BU=class extends xi{static{o(this,"DATE")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};IU=BU;ot.DATE=IU;BU.NAME="DATE";var DU,_U=class extends xi{static{o(this,"TimeOfDay")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};DU=_U;ot.TimeOfDay=DU;_U.NAME="TimeOfDay";var RU,PU=class extends xi{static{o(this,"DateTime")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};RU=PU;ot.DateTime=RU;PU.NAME="DateTime";var OU,kU=class extends xi{static{o(this,"Duration")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};OU=kU;ot.Duration=OU;kU.NAME="Duration";var LU,VU=class extends xi{static{o(this,"TIME")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};LU=VU;ot.TIME=LU;VU.NAME="TIME";var St=class{static{o(this,"Any")}constructor({name:e=_s,optional:t=!1}={}){this.name=e,this.optional=t}},Pr=class extends St{static{o(this,"Choice")}constructor({value:e=[],...t}={}){super(t),this.value=e}},Tt=class extends St{static{o(this,"Repeated")}constructor({value:e=new St,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}},yg=class{static{o(this,"RawData")}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=dt.toUint8Array(e)}constructor({data:e=NE}={}){this.dataView=dt.toUint8Array(e)}fromBER(e,t,n){let s=t+n;return this.dataView=dt.toUint8Array(e).subarray(t,s),s}toBER(e){return this.dataView.slice().buffer}};function Ie(r,e,t){if(t instanceof Pr){for(let i of t.value)if(Ie(r,e,i).verified)return{verified:!0,result:r};{let i={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(VT)&&(i.name=t.name),i}}if(t instanceof St)return t.hasOwnProperty(VT)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Are in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Nre in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Tre in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(Cre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(bre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(xre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(Ere in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(OV in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(i.length!==a.length)return{verified:!1,result:r};for(let u=0;u<i.length;u++)if(i[u]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(r[t.name]=e)),t instanceof ot.Constructed){let i=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Tt&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let l=!0;for(let f=0;f<t.valueBlock.value.length;f++)l=l&&(t.valueBlock.value[f].optional||!1);return l?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let l=0;l<u;l++)if(l-i>=e.valueBlock.value.length){if(t.valueBlock.value[l].optional===!1){let f={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(delete r[t.name],f.name=t.name)),f}}else if(t.valueBlock.value[0]instanceof Tt){if(a=Ie(r,e.valueBlock.value[l],t.valueBlock.value[0].value),a.verified===!1)if(t.valueBlock.value[0].optional)i++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&delete r[t.name]),a;if(VT in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let f={};Ire in t.valueBlock.value[0]&&t.valueBlock.value[0].local?f=e:f=r,typeof f[t.valueBlock.value[0].name]>"u"&&(f[t.valueBlock.value[0].name]=[]),f[t.valueBlock.value[0].name].push(e.valueBlock.value[l])}}else if(a=Ie(r,e.valueBlock.value[l-i],t.valueBlock.value[l]),a.verified===!1)if(t.valueBlock.value[l].optional)i++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&delete r[t.name]),a;if(a.verified===!1){let l={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(delete r[t.name],l.name=t.name)),l}return{verified:!0,result:r}}if(t.primitiveSchema&&OV in e.valueBlock){let i=dg(e.valueBlock.valueHexView);if(i.offset===-1){let a={verified:!1,result:i.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,_s),t.name&&(delete r[t.name],a.name=t.name)),a}return Ie(r,i.result,t.primitiveSchema)}return{verified:!0,result:r}}o(Ie,"compareSchema");var Un=class r{static{o(this,"ByteStream")}constructor(e={}){if("view"in e)this.fromUint8Array(e.view);else if("buffer"in e)this.fromArrayBuffer(e.buffer);else if("string"in e)this.fromString(e.string);else if("hexstring"in e)this.fromHexString(e.hexstring);else if("length"in e&&e.length>0){if(this.length=e.length,e.stub)for(let t=0;t<this._view.length;t++)this._view[t]=e.stub}else this.length=0}set buffer(e){this._buffer=e,this._view=new Uint8Array(this._buffer)}get buffer(){return this._buffer}set view(e){this._buffer=new ArrayBuffer(e.length),this._view=new Uint8Array(this._buffer),this._view.set(e)}get view(){return this._view}get length(){return this.view.byteLength}set length(e){this._buffer=new ArrayBuffer(e),this._view=new Uint8Array(this._buffer)}clear(){this._buffer=new ArrayBuffer(0),this._view=new Uint8Array(this._buffer)}fromArrayBuffer(e){this._buffer=e,this._view=new Uint8Array(this._buffer)}fromUint8Array(e){this.fromArrayBuffer(new Uint8Array(e).buffer)}fromString(e){let t=e.length;this.length=t;for(let n=0;n<t;n++)this.view[n]=e.charCodeAt(n)}toString(e=0,t=this.view.length-e){let n="";(e>=this.view.length||e<0)&&(e=0),(t>=this.view.length||t<0)&&(t=this.view.length-e);for(let s=e;s<e+t;s++)n+=String.fromCharCode(this.view[s]);return n}fromHexString(e){let t=e.length;this.buffer=new ArrayBuffer(t>>1),this.view=new Uint8Array(this.buffer);let n=new Map;n.set("0",0),n.set("1",1),n.set("2",2),n.set("3",3),n.set("4",4),n.set("5",5),n.set("6",6),n.set("7",7),n.set("8",8),n.set("9",9),n.set("A",10),n.set("a",10),n.set("B",11),n.set("b",11),n.set("C",12),n.set("c",12),n.set("D",13),n.set("d",13),n.set("E",14),n.set("e",14),n.set("F",15),n.set("f",15);let s=0,i=0;for(let a=0;a<t;a++)a%2?(i|=n.get(e.charAt(a)),this.view[s]=i,s++):i=n.get(e.charAt(a))<<4}toHexString(e=0,t=this.view.length-e){let n="";(e>=this.view.length||e<0)&&(e=0),(t>=this.view.length||t<0)&&(t=this.view.length-e);for(let s=e;s<e+t;s++){let i=this.view[s].toString(16).toUpperCase();n=n+(i.length==1?"0":"")+i}return n}copy(e=0,t=this.length-e){if(!e&&!this.length)return new r;if(e<0||e>this.length-1)throw new Error(`Wrong start position: ${e}`);return new r({buffer:this._buffer.slice(e,e+t)})}slice(e=0,t=this.length){if(!e&&!this.length)return new r;if(e<0||e>this.length-1)throw new Error(`Wrong start position: ${e}`);return new r({buffer:this._buffer.slice(e,t)})}realloc(e){let t=new ArrayBuffer(e),n=new Uint8Array(t);e>this._view.length?n.set(this._view):n.set(new Uint8Array(this._buffer,0,e)),this._buffer=t,this._view=new Uint8Array(this._buffer)}append(e){let t=this.length,n=e.length,s=e._view.subarray();this.realloc(t+n),this._view.set(s,t)}insert(e,t=0,n=this.length-t){return t>this.length-1?!1:(n>this.length-t&&(n=this.length-t),n>e.length&&(n=e.length),n==e.length?this._view.set(e._view,t):this._view.set(e._view.subarray(0,n),t),!0)}isEqual(e){if(this.length!=e.length)return!1;for(let t=0;t<e.length;t++)if(this.view[t]!=e.view[t])return!1;return!0}isEqualView(e){if(e.length!=this.view.length)return!1;for(let t=0;t<e.length;t++)if(this.view[t]!=e[t])return!1;return!0}findPattern(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=e.length;if(l>a)return-1;let f=[];for(let h=0;h<l;h++)f.push(e.view[h]);for(let h=0;h<=a-l;h++){let m=!0,g=u?i-l-h:i+h;for(let w=0;w<l;w++)if(this.view[w+g]!=f[w]){m=!1;break}if(m)return u?i-l-h:i+l+h}return-1}findFirstIn(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l={id:-1,position:u?0:i+a,length:0};for(let f=0;f<e.length;f++){let h=this.findPattern(e[f],i,a,u);if(h!=-1){let m=!1,g=e[f].length;u?h-g>=l.position-l.length&&(m=!0):h-g<=l.position-l.length&&(m=!0),m&&(l.position=h,l.id=f,l.length=g)}}return l}findAllIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={id:-1,position:s};do{let l=u.position;if(u=this.findFirstIn(e,u.position,i),u.id==-1)break;i-=u.position-l,a.push({id:u.id,position:u.position})}while(!0);return a}findAllPatternIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u=e.length;if(u>i)return-1;let l=Array.from(e.view);for(let f=0;f<=i-u;f++){let h=!0,m=s+f;for(let g=0;g<u;g++)if(this.view[g+m]!=l[g]){h=!1;break}h&&(a.push(s+u+f),f+=u-1)}return a}findFirstNotIn(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l={left:{id:-1,position:i},right:{id:-1,position:0},value:new r},f=a;for(;f>0;){if(l.right=this.findFirstIn(e,u?i-a+f:i+a-f,f,u),l.right.id==-1){a=f,u?i-=a:i=l.left.position,l.value=new r({buffer:this._buffer.slice(i,i+a)});break}if(l.right.position!=(u?l.left.position-e[l.right.id].length:l.left.position+e[l.right.id].length)){u?(i=l.right.position+e[l.right.id].length,a=l.left.position-l.right.position-e[l.right.id].length):(i=l.left.position,a=l.right.position-l.left.position-e[l.right.id].length),l.value=new r({buffer:this._buffer.slice(i,i+a)});break}l.left=l.right,f-=e[l.right.id].length}if(u){let h=l.right;l.right=l.left,l.left=h}return l}findAllNotIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={left:{id:-1,position:s},right:{id:-1,position:s},value:new r};do{let l=u.right.position;u=this.findFirstNotIn(e,u.right.position,i),i-=u.right.position-l,a.push({left:{id:u.left.id,position:u.left.position},right:{id:u.right.id,position:u.right.position},value:u.value})}while(u.right.id!=-1);return a}findFirstSequence(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=this.skipNotPatterns(e,i,a,u);if(l==-1)return{position:-1,value:new r};let f=this.skipPatterns(e,l,a-(u?i-l:l-i),u);u?(i=f,a=l-f):(i=l,a=f-l);let h=new r({buffer:this._buffer.slice(i,i+a)});return{position:f,value:h}}findAllSequences(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={position:s,value:new r};do{let l=u.position;u=this.findFirstSequence(e,u.position,i),u.position!=-1&&(i-=u.position-l,a.push({position:u.position,value:u.value}))}while(u.position!=-1);return a}findPairedPatterns(e,t,n,s){let i=[];if(e.isEqual(t))return i;let{start:a,length:u}=this.prepareFindParameters(n,s),l=0,f=this.findAllPatternIn(e,a,u);if(!Array.isArray(f)||f.length==0)return i;let h=this.findAllPatternIn(t,a,u);if(!Array.isArray(h)||h.length==0)return i;for(;l<f.length&&h.length!=0;){if(f[0]==h[0]){i.push({left:f[0],right:h[0]}),f.splice(0,1),h.splice(0,1);continue}if(f[l]>h[0])break;for(;f[l]<h[0]&&(l++,!(l>=f.length)););i.push({left:f[l-1],right:h[0]}),f.splice(l-1,1),h.splice(0,1),l=0}return i.sort((m,g)=>m.left-g.left),i}findPairedArrays(e,t,n,s){let{start:i,length:a}=this.prepareFindParameters(n,s),u=[],l=0,f=this.findAllIn(e,i,a);if(f.length==0)return u;let h=this.findAllIn(t,i,a);if(h.length==0)return u;for(;l<f.length&&h.length!=0;){if(f[0].position==h[0].position){u.push({left:f[0],right:h[0]}),f.splice(0,1),h.splice(0,1);continue}if(f[l].position>h[0].position)break;for(;f[l].position<h[0].position&&(l++,!(l>=f.length)););u.push({left:f[l-1],right:h[0]}),f.splice(l-1,1),h.splice(0,1),l=0}return u.sort((m,g)=>m.left.position-g.left.position),u}replacePattern(e,t,n,s,i=null){let a=[],u,l={status:-1,searchPatternPositions:[],replacePatternPositions:[]},{start:f,length:h}=this.prepareFindParameters(n,s);if(i==null){if(a=this.findAllIn([e],f,h),a.length==0)return l}else a=i;l.searchPatternPositions.push(...Array.from(a,y=>y.position));let m=e.length-t.length,g=new ArrayBuffer(this.view.length-a.length*m),w=new Uint8Array(g);for(w.set(new Uint8Array(this.buffer,0,f)),u=0;u<a.length;u++){let y=u==0?f:a[u-1].position;w.set(new Uint8Array(this.buffer,y,a[u].position-e.length-y),y-u*m),w.set(t.view,a[u].position-e.length-u*m),l.replacePatternPositions.push(a[u].position-e.length-u*m)}return u--,w.set(new Uint8Array(this.buffer,a[u].position,this.length-a[u].position),a[u].position-e.length+t.length-u*m),this.buffer=g,this.view=new Uint8Array(this.buffer),l.status=1,l}skipPatterns(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=i;for(let f=0;f<e.length;f++){let h=e[f].length,m=u?l-h:l,g=!0;for(let w=0;w<h;w++)if(this.view[w+m]!=e[f].view[w]){g=!1;break}if(g){if(f=-1,u){if(l-=h,l<=0)return l}else if(l+=h,l>=i+a)return l}}return l}skipNotPatterns(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=-1;for(let f=0;f<a;f++){for(let h=0;h<e.length;h++){let m=e[h].length,g=u?i-f-m:i+f,w=!0;for(let y=0;y<m;y++)if(this.view[y+g]!=e[h].view[y]){w=!1;break}if(w){l=u?i-f:i+f;break}}if(l!=-1)break}return l}prepareFindParameters(e=null,t=null,n=!1){return e===null&&(e=n?this.length:0),e>this.length&&(e=this.length),n?(t===null&&(t=e),t>e&&(t=e)):(t===null&&(t=this.length-e),t>this.length-e&&(t=this.length-e)),{start:e,length:t,backward:n}}};var Pre=16777216,Io=class r{static{o(this,"SeqStream")}constructor(e={}){this._stream=new Un,this._length=0,this._start=0,this.backward=!1,this.appendBlock=0,this.prevLength=0,this.prevStart=0,"view"in e?this.stream=new Un({view:e.view}):"buffer"in e?this.stream=new Un({buffer:e.buffer}):"string"in e?this.stream=new Un({string:e.string}):"hexstring"in e?this.stream=new Un({hexstring:e.hexstring}):"stream"in e?this.stream=e.stream.slice():this.stream=new Un,"backward"in e&&e.backward&&(this.backward=e.backward,this._start=this.stream.length),"length"in e&&e.length>0&&(this._length=e.length),"start"in e&&e.start&&e.start>0&&(this._start=e.start),"appendBlock"in e&&e.appendBlock&&e.appendBlock>0&&(this.appendBlock=e.appendBlock)}set stream(e){this._stream=e,this.prevLength=this._length,this._length=e.length,this.prevStart=this._start,this._start=0}get stream(){return this._stream}set length(e){this.prevLength=this._length,this._length=e}get length(){return this.appendBlock?this.start:this._length}set start(e){e>this.stream.length||(this.prevStart=this._start,this.prevLength=this._length,this._length-=this.backward?this._start-e:e-this._start,this._start=e)}get start(){return this._start}get buffer(){return this._stream.buffer.slice(0,this._length)}resetPosition(){this._start=this.prevStart,this._length=this.prevLength}findPattern(e,t=null){(t==null||t>this.length)&&(t=this.length);let n=this.stream.findPattern(e,this.start,this.length,this.backward);if(n==-1)return n;if(this.backward){if(n<this.start-e.length-t)return-1}else if(n>this.start+e.length+t)return-1;return this.start=n,n}findFirstIn(e,t=null){(t==null||t>this.length)&&(t=this.length);let n=this.stream.findFirstIn(e,this.start,this.length,this.backward);if(n.id==-1)return n;if(this.backward){if(n.position<this.start-e[n.id].length-t)return{id:-1,position:this.backward?0:this.start+this.length}}else if(n.position>this.start+e[n.id].length+t)return{id:-1,position:this.backward?0:this.start+this.length};return this.start=n.position,n}findAllIn(e){let t=this.backward?this.start-this.length:this.start;return this.stream.findAllIn(e,t,this.length)}findFirstNotIn(e,t=null){(t==null||t>this._length)&&(t=this._length);let n=this._stream.findFirstNotIn(e,this._start,this._length,this.backward);if(n.left.id==-1&&n.right.id==-1)return n;if(this.backward){if(n.right.id!=-1&&n.right.position<this._start-e[n.right.id].length-t)return{left:{id:-1,position:this._start},right:{id:-1,position:0},value:new Un}}else if(n.left.id!=-1&&n.left.position>this._start+e[n.left.id].length+t)return{left:{id:-1,position:this._start},right:{id:-1,position:0},value:new Un};return this.backward?n.left.id==-1?this.start=0:this.start=n.left.position:n.right.id==-1?this.start=this._start+this._length:this.start=n.right.position,n}findAllNotIn(e){let t=this.backward?this._start-this._length:this._start;return this._stream.findAllNotIn(e,t,this._length)}findFirstSequence(e,t=null,n=null){(t==null||t>this._length)&&(t=this._length),(n==null||n>t)&&(n=t);let s=this._stream.findFirstSequence(e,this._start,t,this.backward);if(s.value.length==0)return s;if(this.backward){if(s.position<this._start-s.value.length-n)return{position:-1,value:new Un}}else if(s.position>this._start+s.value.length+n)return{position:-1,value:new Un};return this.start=s.position,s}findAllSequences(e){let t=this.backward?this.start-this.length:this.start;return this.stream.findAllSequences(e,t,this.length)}findPairedPatterns(e,t,n=null){(n==null||n>this.length)&&(n=this.length);let s=this.backward?this.start-this.length:this.start,i=this.stream.findPairedPatterns(e,t,s,this.length);if(i.length){if(this.backward){if(i[0].right<this.start-t.length-n)return[]}else if(i[0].left>this.start+e.length+n)return[]}return i}findPairedArrays(e,t,n=null){(n==null||n>this.length)&&(n=this.length);let s=this.backward?this.start-this.length:this.start,i=this.stream.findPairedArrays(e,t,s,this.length);if(i.length){if(this.backward){if(i[0].right.position<this.start-t[i[0].right.id].length-n)return[]}else if(i[0].left.position>this.start+e[i[0].left.id].length+n)return[]}return i}replacePattern(e,t){let n=this.backward?this.start-this.length:this.start;return this.stream.replacePattern(e,t,n,this.length)}skipPatterns(e){let t=this.stream.skipPatterns(e,this.start,this.length,this.backward);return this.start=t,t}skipNotPatterns(e){let t=this.stream.skipNotPatterns(e,this.start,this.length,this.backward);return t==-1?-1:(this.start=t,t)}append(e){this.beforeAppend(e.length),this._stream.view.set(e.view,this._start),this._length+=e.length*2,this.start=this._start+e.length,this.prevLength-=e.length*2}appendView(e){this.beforeAppend(e.length),this._stream.view.set(e,this._start),this._length+=e.length*2,this.start=this._start+e.length,this.prevLength-=e.length*2}appendChar(e){this.beforeAppend(1),this._stream.view[this._start]=e,this._length+=2,this.start=this._start+1,this.prevLength-=2}appendUint16(e){this.beforeAppend(2);let t=new Uint16Array([e]),n=new Uint8Array(t.buffer);this.stream.view[this._start]=n[1],this._stream.view[this._start+1]=n[0],this._length+=4,this.start=this._start+2,this.prevLength-=4}appendUint24(e){this.beforeAppend(3);let t=new Uint32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[2],this._stream.view[this._start+1]=n[1],this._stream.view[this._start+2]=n[0],this._length+=6,this.start=this._start+3,this.prevLength-=6}appendUint32(e){this.beforeAppend(4);let t=new Uint32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[3],this._stream.view[this._start+1]=n[2],this._stream.view[this._start+2]=n[1],this._stream.view[this._start+3]=n[0],this._length+=8,this.start=this._start+4,this.prevLength-=8}appendInt16(e){this.beforeAppend(2);let t=new Int16Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[1],this._stream.view[this._start+1]=n[0],this._length+=4,this.start=this._start+2,this.prevLength-=4}appendInt32(e){this.beforeAppend(4);let t=new Int32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[3],this._stream.view[this._start+1]=n[2],this._stream.view[this._start+2]=n[1],this._stream.view[this._start+3]=n[0],this._length+=8,this.start=this._start+4,this.prevLength-=8}getBlock(e,t=!0){if(this._length<=0)return new Uint8Array(0);this._length<e&&(e=this._length);let n;if(this.backward){let s=this._stream.view.subarray(this._length-e,this._length);n=new Uint8Array(e);for(let i=0;i<e;i++)n[e-1-i]=s[i]}else n=this._stream.view.subarray(this._start,this._start+e);return t&&(this.start+=this.backward?-1*e:e),n}getUint16(e=!0){let t=this.getBlock(2,e);return t.length<2?0:t[0]<<8|t[1]}getInt16(e=!0){let t=this.getUint16(e),n=32768;return t&n?-(n-(t^n)):t}getUint24(e=!0){let t=this.getBlock(4,e);return t.length<3?0:t[0]<<16|t[1]<<8|t[2]}getUint32(e=!0){let t=this.getBlock(4,e);return t.length<4?0:t[0]*Pre+(t[1]<<16)+(t[2]<<8)+t[3]}getInt32(e=!0){let t=this.getUint32(e),n=2147483648;return t&n?-(n-(t^n)):t}beforeAppend(e){this._start+e>this._stream.length&&(e>this.appendBlock&&(this.appendBlock=e+r.APPEND_BLOCK),this._stream.realloc(this._stream.length+this.appendBlock))}};Io.APPEND_BLOCK=1e3;function kre(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}o(kre,"isBytes");function KT(r,...e){if(!kre(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}o(KT,"bytes");function $T(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}o($T,"exists");function MU(r,e){KT(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}o(MU,"output");var RE=o(r=>new DataView(r.buffer,r.byteOffset,r.byteLength),"createView"),Ji=o((r,e)=>r<<32-e|r>>>e,"rotr"),PE=o((r,e)=>r<<e|r>>>32-e>>>0,"rotl"),s1e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Lre(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}o(Lre,"utf8ToBytes");function XT(r){return typeof r=="string"&&(r=Lre(r)),KT(r),r}o(XT,"toBytes");var _E=class{static{o(this,"Hash")}clone(){return this._cloneInto()}},i1e={}.toString;function Lc(r){let e=o(n=>r().update(XT(n)).digest(),"hashC"),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}o(Lc,"wrapConstructor");function Vre(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),a=Number(t>>s&i),u=Number(t&i),l=n?4:0,f=n?0:4;r.setUint32(e+l,a,n),r.setUint32(e+f,u,n)}o(Vre,"setBigUint64");var OE=o((r,e,t)=>r&e^~r&t,"Chi"),kE=o((r,e,t)=>r&e^r&t^e&t,"Maj"),Yu=class extends _E{static{o(this,"HashMD")}constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=RE(this.buffer)}update(e){$T(this);let{view:t,buffer:n,blockLen:s}=this;e=XT(e);let i=e.length;for(let a=0;a<i;){let u=Math.min(s-this.pos,i-a);if(u===s){let l=RE(e);for(;s<=i-a;a+=s)this.process(l,a);continue}n.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$T(this),MU(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let m=a;m<s;m++)t[m]=0;Vre(n,s-8,BigInt(this.length*8),i),this.process(n,0);let u=RE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=l/4,h=this.get();if(f>h.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<f;m++)u.setUint32(4*m,h[m],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:a,pos:u}=this;return e.length=s,e.pos=u,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};var vg=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Qu=new Uint32Array(80),Ure=class extends Yu{static{o(this,"SHA1")}constructor(){super(64,20,8,!1),this.A=vg[0]|0,this.B=vg[1]|0,this.C=vg[2]|0,this.D=vg[3]|0,this.E=vg[4]|0}get(){let{A:e,B:t,C:n,D:s,E:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0}process(e,t){for(let l=0;l<16;l++,t+=4)Qu[l]=e.getUint32(t,!1);for(let l=16;l<80;l++)Qu[l]=PE(Qu[l-3]^Qu[l-8]^Qu[l-14]^Qu[l-16],1);let{A:n,B:s,C:i,D:a,E:u}=this;for(let l=0;l<80;l++){let f,h;l<20?(f=OE(s,i,a),h=1518500249):l<40?(f=s^i^a,h=1859775393):l<60?(f=kE(s,i,a),h=2400959708):(f=s^i^a,h=3395469782);let m=PE(n,5)+f+u+h+Qu[l]|0;u=a,a=i,i=PE(s,30),s=n,n=m}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,this.set(n,s,i,a,u)}roundClean(){Qu.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}},jU=Lc(()=>new Ure);var Mre=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zu=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),el=new Uint32Array(64),jre=class extends Yu{static{o(this,"SHA256")}constructor(){super(64,32,8,!1),this.A=Zu[0]|0,this.B=Zu[1]|0,this.C=Zu[2]|0,this.D=Zu[3]|0,this.E=Zu[4]|0,this.F=Zu[5]|0,this.G=Zu[6]|0,this.H=Zu[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:u,H:l}=this;return[e,t,n,s,i,a,u,l]}set(e,t,n,s,i,a,u,l){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=u|0,this.H=l|0}process(e,t){for(let m=0;m<16;m++,t+=4)el[m]=e.getUint32(t,!1);for(let m=16;m<64;m++){let g=el[m-15],w=el[m-2],y=Ji(g,7)^Ji(g,18)^g>>>3,S=Ji(w,17)^Ji(w,19)^w>>>10;el[m]=S+el[m-7]+y+el[m-16]|0}let{A:n,B:s,C:i,D:a,E:u,F:l,G:f,H:h}=this;for(let m=0;m<64;m++){let g=Ji(u,6)^Ji(u,11)^Ji(u,25),w=h+g+OE(u,l,f)+Mre[m]+el[m]|0,S=(Ji(n,2)^Ji(n,13)^Ji(n,22))+kE(n,s,i)|0;h=f,f=l,l=u,u=a+w|0,a=i,i=s,s=n,n=w+S|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(n,s,i,a,u,l,f,h)}roundClean(){el.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var GT=Lc(()=>new jre);var LE=BigInt(4294967295),WT=BigInt(32);function FU(r,e=!1){return e?{h:Number(r&LE),l:Number(r>>WT&LE)}:{h:Number(r>>WT&LE)|0,l:Number(r&LE)|0}}o(FU,"fromBig");function Fre(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:a}=FU(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}o(Fre,"split");var qre=o((r,e)=>BigInt(r>>>0)<<WT|BigInt(e>>>0),"toBig"),Hre=o((r,e,t)=>r>>>t,"shrSH"),Kre=o((r,e,t)=>r<<32-t|e>>>t,"shrSL"),$re=o((r,e,t)=>r>>>t|e<<32-t,"rotrSH"),Xre=o((r,e,t)=>r<<32-t|e>>>t,"rotrSL"),Gre=o((r,e,t)=>r<<64-t|e>>>t-32,"rotrBH"),Wre=o((r,e,t)=>r>>>t-32|e<<64-t,"rotrBL"),Jre=o((r,e)=>e,"rotr32H"),zre=o((r,e)=>r,"rotr32L"),Yre=o((r,e,t)=>r<<t|e>>>32-t,"rotlSH"),Qre=o((r,e,t)=>e<<t|r>>>32-t,"rotlSL"),Zre=o((r,e,t)=>e<<t-32|r>>>64-t,"rotlBH"),ene=o((r,e,t)=>r<<t-32|e>>>64-t,"rotlBL");function tne(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}o(tne,"add");var rne=o((r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),"add3L"),nne=o((r,e,t,n)=>e+t+n+(r/2**32|0)|0,"add3H"),sne=o((r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),"add4L"),ine=o((r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0,"add4H"),ane=o((r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0),"add5L"),one=o((r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0,"add5H");var une={fromBig:FU,split:Fre,toBig:qre,shrSH:Hre,shrSL:Kre,rotrSH:$re,rotrSL:Xre,rotrBH:Gre,rotrBL:Wre,rotr32H:Jre,rotr32L:zre,rotlSH:Yre,rotlSL:Qre,rotlBH:Zre,rotlBL:ene,add:tne,add3L:rne,add3H:nne,add4L:sne,add4H:ine,add5H:one,add5L:ane},Ht=une;var[lne,cne]=Ht.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),tl=new Uint32Array(80),rl=new Uint32Array(80),VE=class extends Yu{static{o(this,"SHA512")}constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:a,Dh:u,Dl:l,Eh:f,El:h,Fh:m,Fl:g,Gh:w,Gl:y,Hh:S,Hl:E}=this;return[e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E]}set(e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=f|0,this.El=h|0,this.Fh=m|0,this.Fl=g|0,this.Gh=w|0,this.Gl=y|0,this.Hh=S|0,this.Hl=E|0}process(e,t){for(let A=0;A<16;A++,t+=4)tl[A]=e.getUint32(t),rl[A]=e.getUint32(t+=4);for(let A=16;A<80;A++){let C=tl[A-15]|0,x=rl[A-15]|0,B=Ht.rotrSH(C,x,1)^Ht.rotrSH(C,x,8)^Ht.shrSH(C,x,7),F=Ht.rotrSL(C,x,1)^Ht.rotrSL(C,x,8)^Ht.shrSL(C,x,7),R=tl[A-2]|0,H=rl[A-2]|0,q=Ht.rotrSH(R,H,19)^Ht.rotrBH(R,H,61)^Ht.shrSH(R,H,6),K=Ht.rotrSL(R,H,19)^Ht.rotrBL(R,H,61)^Ht.shrSL(R,H,6),G=Ht.add4L(F,K,rl[A-7],rl[A-16]),he=Ht.add4H(G,B,q,tl[A-7],tl[A-16]);tl[A]=he|0,rl[A]=G|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:u,Cl:l,Dh:f,Dl:h,Eh:m,El:g,Fh:w,Fl:y,Gh:S,Gl:E,Hh:b,Hl:T}=this;for(let A=0;A<80;A++){let C=Ht.rotrSH(m,g,14)^Ht.rotrSH(m,g,18)^Ht.rotrBH(m,g,41),x=Ht.rotrSL(m,g,14)^Ht.rotrSL(m,g,18)^Ht.rotrBL(m,g,41),B=m&w^~m&S,F=g&y^~g&E,R=Ht.add5L(T,x,F,cne[A],rl[A]),H=Ht.add5H(R,b,C,B,lne[A],tl[A]),q=R|0,K=Ht.rotrSH(n,s,28)^Ht.rotrBH(n,s,34)^Ht.rotrBH(n,s,39),G=Ht.rotrSL(n,s,28)^Ht.rotrBL(n,s,34)^Ht.rotrBL(n,s,39),he=n&i^n&u^i&u,le=s&a^s&l^a&l;b=S|0,T=E|0,S=w|0,E=y|0,w=m|0,y=g|0,{h:m,l:g}=Ht.add(f|0,h|0,H|0,q|0),f=u|0,h=l|0,u=i|0,l=a|0,i=n|0,a=s|0;let oe=Ht.add3L(q,G,le);n=Ht.add3H(oe,H,K,he),s=oe|0}({h:n,l:s}=Ht.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=Ht.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:u,l}=Ht.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:f,l:h}=Ht.add(this.Dh|0,this.Dl|0,f|0,h|0),{h:m,l:g}=Ht.add(this.Eh|0,this.El|0,m|0,g|0),{h:w,l:y}=Ht.add(this.Fh|0,this.Fl|0,w|0,y|0),{h:S,l:E}=Ht.add(this.Gh|0,this.Gl|0,S|0,E|0),{h:b,l:T}=Ht.add(this.Hh|0,this.Hl|0,b|0,T|0),this.set(n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T)}roundClean(){tl.fill(0),rl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var fne=class extends VE{static{o(this,"SHA384")}constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},JT=Lc(()=>new VE);var zT=Lc(()=>new fne);var Qr=new ArrayBuffer(0),L="",Er=class NI extends TypeError{static{o(this,"ArgumentError")}constructor(){super(...arguments),this.name=NI.NAME}static isType(e,t){if(typeof t=="string"){if(t==="Array"&&Array.isArray(e))return!0;if(t==="ArrayBuffer"&&e instanceof ArrayBuffer)return!0;if(t==="ArrayBufferView"&&ArrayBuffer.isView(e))return!0;if(typeof e===t)return!0}else if(e instanceof t)return!0;return!1}static assert(e,t,...n){for(let i of n)if(this.isType(e,i))return;let s=n.map(i=>i instanceof Function&&"name"in i?i.name:`${i}`);throw new NI(`Parameter '${t}' is not of type ${s.length>1?`(${s.join(" or ")})`:s[0]}`)}};Er.NAME="ArgumentError";var fr=class cA extends TypeError{static{o(this,"ParameterError")}static assert(...e){let t=null,n,s;typeof e[0]=="string"?(t=e[0],n=e[1],s=e.slice(2)):(n=e[0],s=e.slice(1)),Er.assert(n,"parameters","object");for(let i of s){let a=n[i];if(a==null)throw new cA(i,t)}}static assertEmpty(e,t,n){if(e==null)throw new cA(t,n)}constructor(e,t=null,n){super(),this.name=cA.NAME,this.field=e,t&&(this.target=t),n?this.message=n:this.message=`Absent mandatory parameter '${e}' ${t?` in '${t}'`:L}`}};fr.NAME="ParameterError";var Ae=class h6 extends Error{static{o(this,"AsnError")}static assertSchema(e,t){if(!e.verified)throw new Error(`Object's schema was not verified against input data for ${t}`)}static assert(e,t){if(e.offset===-1)throw new h6(`Error during parsing of ASN.1 data. Data is not correct for '${t}'.`)}constructor(e){super(e),this.name="AsnError"}},Be=class{static{o(this,"PkiObject")}static blockName(){return this.CLASS_NAME}static fromBER(e){let t=Hr(e);Ae.assert(t,this.name);try{return new this({schema:t.result})}catch{throw new Ae(`Cannot create '${this.CLASS_NAME}' from ASN.1 object`)}}static defaultValues(e){throw new Error(`Invalid member name for ${this.CLASS_NAME} class: ${e}`)}static schema(e={}){throw new Error(`Method '${this.CLASS_NAME}.schema' should be overridden`)}get className(){return this.constructor.CLASS_NAME}toString(e="hex"){let t;try{t=this.toSchema()}catch{t=this.toSchema(!0)}return Ct.ToString(t.toBER(),e)}};Be.CLASS_NAME="PkiObject";function Jl(r){let e=!1,t=L,n=r.trim();for(let s=0;s<n.length;s++)n.charCodeAt(s)===32?e===!1&&(e=!0):(e&&(t+=" ",e=!1),t+=n[s]);return t.toLowerCase()}o(Jl,"stringPrep");var wg="type",YT="value",TI=class Rg extends Be{static{o(this,"AttributeTypeAndValue")}constructor(e={}){super(),this.type=D(e,wg,Rg.defaultValues(wg)),this.value=D(e,YT,Rg.defaultValues(YT)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wg:return L;case YT:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.type||L}),new St({name:t.value||L})]})}fromSchema(e){_e(e,[wg,"typeValue"]);let t=Ie(e,e,Rg.schema({names:{type:wg,value:"typeValue"}}));Ae.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.value=t.result.typeValue}toSchema(){return new W({value:[new rt({value:this.type}),this.value]})}toJSON(){let e={type:this.type};return Object.keys(this.value).length!==0?e.value=this.value.toJSON():e.value=this.value,e}isEqual(e){let t=[xi.blockName(),Ip.blockName(),Bp.blockName(),Oc.blockName(),Ni.blockName(),Dp.blockName(),TE.blockName(),mg.blockName(),IE.blockName(),gg.blockName(),BE.blockName(),DE.blockName()];if(e instanceof ArrayBuffer)return dt.isEqual(this.value.valueBeforeDecodeView,e);if(e.constructor.blockName()===Rg.blockName()){if(this.type!==e.type)return!1;let n=[!1,!1],s=this.value.constructor.blockName();for(let a of t)s===a&&(n[0]=!0),e.value.constructor.blockName()===a&&(n[1]=!0);if(n[0]!==n[1])return!1;if(n[0]&&n[1]){let a=Jl(this.value.valueBlock.value),u=Jl(e.value.valueBlock.value);if(a.localeCompare(u)!==0)return!1}else if(!dt.isEqual(this.value.valueBeforeDecodeView,e.value.valueBeforeDecodeView))return!1;return!0}return!1}};TI.CLASS_NAME="AttributeTypeAndValue";var Vc="typesAndValues",UE="valueBeforeDecode",qU="RDN",Or=class Pg extends Be{static{o(this,"RelativeDistinguishedNames")}constructor(e={}){super(),this.typesAndValues=D(e,Vc,Pg.defaultValues(Vc)),this.valueBeforeDecode=D(e,UE,Pg.defaultValues(UE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vc:return[];case UE:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Vc:return t.length===0;case UE:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.repeatedSequence||L,value:new $r({value:[new Tt({name:t.repeatedSet||L,value:TI.schema(t.typeAndValue||{})})]})})]})}fromSchema(e){_e(e,[qU,Vc]);let t=Ie(e,e,Pg.schema({names:{blockName:qU,repeatedSet:Vc}}));Ae.assertSchema(t,this.className),Vc in t.result&&(this.typesAndValues=Array.from(t.result.typesAndValues,n=>new TI({schema:n}))),this.valueBeforeDecode=t.result.RDN.valueBeforeDecodeView.slice().buffer}toSchema(){if(this.valueBeforeDecode.byteLength===0)return new W({value:[new $r({value:Array.from(this.typesAndValues,t=>t.toSchema())})]});let e=Hr(this.valueBeforeDecode);if(Ae.assert(e,"RelativeDistinguishedNames"),!(e.result instanceof W))throw new Error("ASN.1 result should be SEQUENCE");return e.result}toJSON(){return{typesAndValues:Array.from(this.typesAndValues,e=>e.toJSON())}}isEqual(e){if(e instanceof Pg){if(this.typesAndValues.length!==e.typesAndValues.length)return!1;for(let[t,n]of this.typesAndValues.entries())if(n.isEqual(e.typesAndValues[t])===!1)return!1;return!0}return e instanceof ArrayBuffer?Wu(this.valueBeforeDecode,e):!1}};Or.CLASS_NAME="RelativeDistinguishedNames";var Og="type",kg="value";function hne(r={},e=!1){let t=D(r,"names",{});return new W({optional:e,value:[new ae({optional:!0,idBlock:{tagClass:2,tagNumber:1},name:t.country_name||L,value:[new Pr({value:[new Oc,new Ni]})]}),new ae({optional:!0,idBlock:{tagClass:2,tagNumber:2},name:t.administration_domain_name||L,value:[new Pr({value:[new Oc,new Ni]})]}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:0},name:t.network_address||L,isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:1},name:t.terminal_identifier||L,isHexOnly:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:2},name:t.private_domain_name||L,value:[new Pr({value:[new Oc,new Ni]})]}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:3},name:t.organization_name||L,isHexOnly:!0}),new yt({optional:!0,name:t.numeric_user_identifier||L,idBlock:{tagClass:3,tagNumber:4},isHexOnly:!0}),new ae({optional:!0,name:t.personal_name||L,idBlock:{tagClass:3,tagNumber:5},value:[new yt({idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:1},isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:2},isHexOnly:!0}),new yt({optional:!0,idBlock:{tagClass:3,tagNumber:3},isHexOnly:!0})]}),new ae({optional:!0,name:t.organizational_unit_names||L,idBlock:{tagClass:3,tagNumber:6},value:[new Tt({value:new Ni})]})]})}o(hne,"builtInStandardAttributes");function pne(r=!1){return new W({optional:r,value:[new Ni,new Ni]})}o(pne,"builtInDomainDefinedAttributes");function dne(r=!1){return new $r({optional:r,value:[new yt({optional:!0,idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new St]})]})}o(dne,"extensionAttributes");var Ar=class Up extends Be{static{o(this,"GeneralName")}constructor(e={}){super(),this.type=D(e,Og,Up.defaultValues(Og)),this.value=D(e,kg,Up.defaultValues(kg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Og:return 9;case kg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Og:return t===Up.defaultValues(e);case kg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[new ae({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||L,value:[new rt,new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St]})]}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:1}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:2}}),new ae({idBlock:{tagClass:3,tagNumber:3},name:t.blockName||L,value:[hne(t.builtInStandardAttributes||{},!1),pne(!0),dne(!0)]}),new ae({idBlock:{tagClass:3,tagNumber:4},name:t.blockName||L,value:[Or.schema(t.directoryName||{})]}),new ae({idBlock:{tagClass:3,tagNumber:5},name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({value:[new Dp,new Ni,new Bp,new xi,new Ip]})]}),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new Pr({value:[new Dp,new Ni,new Bp,new xi,new Ip]})]})]}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:6}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:7}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:8}})]})}fromSchema(e){_e(e,["blockName","otherName","rfc822Name","dNSName","x400Address","directoryName","ediPartyName","uniformResourceIdentifier","iPAddress","registeredID"]);let t=Ie(e,e,Up.schema({names:{blockName:"blockName",otherName:"otherName",rfc822Name:"rfc822Name",dNSName:"dNSName",x400Address:"x400Address",directoryName:{names:{blockName:"directoryName"}},ediPartyName:"ediPartyName",uniformResourceIdentifier:"uniformResourceIdentifier",iPAddress:"iPAddress",registeredID:"registeredID"}}));switch(Ae.assertSchema(t,this.className),this.type=t.result.blockName.idBlock.tagNumber,this.type){case 0:this.value=t.result.blockName;break;case 1:case 2:case 6:{let n=t.result.blockName;n.idBlock.tagClass=1,n.idBlock.tagNumber=22;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"GeneralName value"),this.value=i.result.valueBlock.value}break;case 3:this.value=t.result.blockName;break;case 4:this.value=new Or({schema:t.result.directoryName});break;case 5:this.value=t.result.ediPartyName;break;case 7:this.value=new Ve({valueHex:t.result.blockName.valueBlock.valueHex});break;case 8:{let n=t.result.blockName;n.idBlock.tagClass=1,n.idBlock.tagNumber=6;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"GeneralName registeredID"),this.value=i.result.valueBlock.toString()}break}}toSchema(){switch(this.type){case 0:case 3:case 5:return new ae({idBlock:{tagClass:3,tagNumber:this.type},value:[this.value]});case 1:case 2:case 6:{let e=new mg({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 4:return new ae({idBlock:{tagClass:3,tagNumber:4},value:[this.value.toSchema()]});case 7:{let e=this.value;return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 8:{let e=new rt({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}default:return Up.schema()}}toJSON(){let e={type:this.type,value:L};if(typeof this.value=="string")e.value=this.value;else try{e.value=this.value.toJSON()}catch{}return e}};Ar.CLASS_NAME="GeneralName";var Lg="accessMethod",Vg="accessLocation",mne=[Lg,Vg],II=class fA extends Be{static{o(this,"AccessDescription")}constructor(e={}){super(),this.accessMethod=D(e,Lg,fA.defaultValues(Lg)),this.accessLocation=D(e,Vg,fA.defaultValues(Vg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Lg:return L;case Vg:return new Ar;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.accessMethod||L}),Ar.schema(t.accessLocation||{})]})}fromSchema(e){_e(e,mne);let t=Ie(e,e,fA.schema({names:{accessMethod:Lg,accessLocation:{names:{blockName:Vg}}}}));Ae.assertSchema(t,this.className),this.accessMethod=t.result.accessMethod.valueBlock.toString(),this.accessLocation=new Ar({schema:t.result.accessLocation})}toSchema(){return new W({value:[new rt({value:this.accessMethod}),this.accessLocation.toSchema()]})}toJSON(){return{accessMethod:this.accessMethod,accessLocation:this.accessLocation.toJSON()}}};II.CLASS_NAME="AccessDescription";var sl="seconds",il="millis",al="micros",Fc=class Mp extends Be{static{o(this,"Accuracy")}constructor(e={}){super(),sl in e&&(this.seconds=D(e,sl,Mp.defaultValues(sl))),il in e&&(this.millis=D(e,il,Mp.defaultValues(il))),al in e&&(this.micros=D(e,al,Mp.defaultValues(al))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sl:case il:case al:return 0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case sl:case il:case al:return t===Mp.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:!0,value:[new me({optional:!0,name:t.seconds||L}),new yt({name:t.millis||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new yt({name:t.micros||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,[sl,il,al]);let t=Ie(e,e,Mp.schema({names:{seconds:sl,millis:il,micros:al}}));if(Ae.assertSchema(t,this.className),"seconds"in t.result&&(this.seconds=t.result.seconds.valueBlock.valueDec),"millis"in t.result){let n=new me({valueHex:t.result.millis.valueBlock.valueHex});this.millis=n.valueBlock.valueDec}if("micros"in t.result){let n=new me({valueHex:t.result.micros.valueBlock.valueHex});this.micros=n.valueBlock.valueDec}}toSchema(){let e=[];if(this.seconds!==void 0&&e.push(new me({value:this.seconds})),this.millis!==void 0){let t=new me({value:this.millis});e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:t.valueBlock.valueHexView}))}if(this.micros!==void 0){let t=new me({value:this.micros});e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:t.valueBlock.valueHexView}))}return new W({value:e})}toJSON(){let e={};return this.seconds!==void 0&&(e.seconds=this.seconds),this.millis!==void 0&&(e.millis=this.millis),this.micros!==void 0&&(e.micros=this.micros),e}};Fc.CLASS_NAME="Accuracy";var ME="algorithmId",Sg="algorithmParams",p6="algorithm",BI="params",gne=[p6,BI],ge=class Ug extends Be{static{o(this,"AlgorithmIdentifier")}constructor(e={}){super(),this.algorithmId=D(e,ME,Ug.defaultValues(ME)),Sg in e&&(this.algorithmParams=D(e,Sg,Ug.defaultValues(Sg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ME:return L;case Sg:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ME:return t===L;case Sg:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:t.optional||!1,value:[new rt({name:t.algorithmIdentifier||L}),new St({name:t.algorithmParams||L,optional:!0})]})}fromSchema(e){_e(e,gne);let t=Ie(e,e,Ug.schema({names:{algorithmIdentifier:p6,algorithmParams:BI}}));Ae.assertSchema(t,this.className),this.algorithmId=t.result.algorithm.valueBlock.toString(),BI in t.result&&(this.algorithmParams=t.result.params)}toSchema(){let e=[];return e.push(new rt({value:this.algorithmId})),this.algorithmParams&&!(this.algorithmParams instanceof St)&&e.push(this.algorithmParams),new W({value:e})}toJSON(){let e={algorithmId:this.algorithmId};return this.algorithmParams&&!(this.algorithmParams instanceof St)&&(e.algorithmParams=this.algorithmParams.toJSON()),e}isEqual(e){return!(e instanceof Ug)||this.algorithmId!==e.algorithmId?!1:this.algorithmParams?e.algorithmParams?JSON.stringify(this.algorithmParams)===JSON.stringify(e.algorithmParams):!1:!e.algorithmParams}};ge.CLASS_NAME="AlgorithmIdentifier";var jp="altNames",yne=[jp],DI=class _I extends Be{static{o(this,"AltName")}constructor(e={}){super(),this.altNames=D(e,jp,_I.defaultValues(jp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jp:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.altNames||L,value:Ar.schema()})]})}fromSchema(e){_e(e,yne);let t=Ie(e,e,_I.schema({names:{altNames:jp}}));Ae.assertSchema(t,this.className),jp in t.result&&(this.altNames=Array.from(t.result.altNames,n=>new Ar({schema:n})))}toSchema(){return new W({value:Array.from(this.altNames,e=>e.toSchema())})}toJSON(){return{altNames:Array.from(this.altNames,e=>e.toJSON())}}};DI.CLASS_NAME="AltName";var Fp="type",qp="values",vne=[Fp,qp],Zr=class hA extends Be{static{o(this,"Attribute")}constructor(e={}){super(),this.type=D(e,Fp,hA.defaultValues(Fp)),this.values=D(e,qp,hA.defaultValues(qp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Fp:return L;case qp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Fp:return t===L;case qp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.type||L}),new $r({name:t.setName||L,value:[new Tt({name:t.values||L,value:new St})]})]})}fromSchema(e){_e(e,vne);let t=Ie(e,e,hA.schema({names:{type:Fp,values:qp}}));Ae.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.values=t.result.values}toSchema(){return new W({value:[new rt({value:this.type}),new $r({value:this.values})]})}toJSON(){return{type:this.type,values:Array.from(this.values,e=>e.toJSON())}}};Zr.CLASS_NAME="Attribute";var Mg="notBeforeTime",jg="notAfterTime",wne=[Mg,jg],nh=class pA extends Be{static{o(this,"AttCertValidityPeriod")}constructor(e={}){super(),this.notBeforeTime=D(e,Mg,pA.defaultValues(Mg)),this.notAfterTime=D(e,jg,pA.defaultValues(jg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Mg:case jg:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Rr({name:t.notBeforeTime||L}),new Rr({name:t.notAfterTime||L})]})}fromSchema(e){_e(e,wne);let t=Ie(e,e,pA.schema({names:{notBeforeTime:Mg,notAfterTime:jg}}));Ae.assertSchema(t,this.className),this.notBeforeTime=t.result.notBeforeTime.toDate(),this.notAfterTime=t.result.notAfterTime.toDate()}toSchema(){return new W({value:[new Rr({valueDate:this.notBeforeTime}),new Rr({valueDate:this.notAfterTime})]})}toJSON(){return{notBeforeTime:this.notBeforeTime,notAfterTime:this.notAfterTime}}};nh.CLASS_NAME="AttCertValidityPeriod";var Eg="names",HU="generalNames",Mn=class RI extends Be{static{o(this,"GeneralNames")}constructor(e={}){super(),this.names=D(e,Eg,RI.defaultValues(Eg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case"names":return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,Eg,{});return new W({optional:t,name:n.blockName||L,value:[new Tt({name:n.generalNames||L,value:Ar.schema()})]})}fromSchema(e){_e(e,[Eg,HU]);let t=Ie(e,e,RI.schema({names:{blockName:Eg,generalNames:HU}}));Ae.assertSchema(t,this.className),this.names=Array.from(t.result.generalNames,n=>new Ar({schema:n}))}toSchema(){return new W({value:Array.from(this.names,e=>e.toSchema())})}toJSON(){return{names:Array.from(this.names,e=>e.toJSON())}}};Mn.CLASS_NAME="GeneralNames";var Sne="2.5.29.9",Ene="2.5.29.14",Ane="2.5.29.15",Cne="2.5.29.16",d6="2.5.29.17",m6="2.5.29.18",PB="2.5.29.19",bne="2.5.29.20",xne="2.5.29.27",Nne="2.5.29.21",Tne="2.5.29.24",g6="2.5.29.28",y6="2.5.29.29",v6="2.5.29.30",w6="2.5.29.31",OB="2.5.29.46",S6="2.5.29.32",Ti="2.5.29.32.0",Ine="1.3.6.1.4.1.311.21.10",E6="2.5.29.33",kB="2.5.29.35",A6="2.5.29.36",Bne="2.5.29.37",Dne="2.5.29.54",LB="1.3.6.1.5.5.7.1.1",_ne="1.3.6.1.5.5.7.1.11",Rne="1.3.6.1.4.1.11129.2.4.2";var Pne="1.3.6.1.4.1.311.21.7",One="1.3.6.1.4.1.311.21.1",kne="1.3.6.1.5.5.7.1.3",VB="1.2.840.113549.1.7.1",C6="1.2.840.113549.1.7.2",b6="1.2.840.113549.1.7.3",x6="1.2.840.113549.1.7.6",Lne="1.2.840.113549.1.9.16.1.4",KU="1.2.840.113549.1.9.22.1",Vne="1.2.840.113549.1.9.22.2",$U="1.2.840.113549.1.9.22.3",XU="1.2.840.113549.1.9.23.1",Une="1.3.6.1.5.5.7",UB=`${Une}.48`,dA=`${UB}.1.1`,j1e=`${UB}.2`,F1e=`${UB}.1`;var qc="keyIdentifier",Hc="authorityCertIssuer",Kc="authorityCertSerialNumber",Mne=[qc,Hc,Kc],MB=class Fg extends Be{static{o(this,"AuthorityKeyIdentifier")}constructor(e={}){super(),qc in e&&(this.keyIdentifier=D(e,qc,Fg.defaultValues(qc))),Hc in e&&(this.authorityCertIssuer=D(e,Hc,Fg.defaultValues(Hc))),Kc in e&&(this.authorityCertSerialNumber=D(e,Kc,Fg.defaultValues(Kc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qc:return new Ve;case Hc:return[];case Kc:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new yt({name:t.keyIdentifier||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.authorityCertIssuer||L,value:Ar.schema()})]}),new yt({name:t.authorityCertSerialNumber||L,optional:!0,idBlock:{tagClass:3,tagNumber:2}})]})}fromSchema(e){_e(e,Mne);let t=Ie(e,e,Fg.schema({names:{keyIdentifier:qc,authorityCertIssuer:Hc,authorityCertSerialNumber:Kc}}));Ae.assertSchema(t,this.className),qc in t.result&&(this.keyIdentifier=new Ve({valueHex:t.result.keyIdentifier.valueBlock.valueHex})),Hc in t.result&&(this.authorityCertIssuer=Array.from(t.result.authorityCertIssuer,n=>new Ar({schema:n}))),Kc in t.result&&(this.authorityCertSerialNumber=new me({valueHex:t.result.authorityCertSerialNumber.valueBlock.valueHex}))}toSchema(){let e=[];return this.keyIdentifier&&e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.keyIdentifier.valueBlock.valueHexView})),this.authorityCertIssuer&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.authorityCertIssuer,t=>t.toSchema())})),this.authorityCertSerialNumber&&e.push(new yt({idBlock:{tagClass:3,tagNumber:2},valueHex:this.authorityCertSerialNumber.valueBlock.valueHexView})),new W({value:e})}toJSON(){let e={};return this.keyIdentifier&&(e.keyIdentifier=this.keyIdentifier.toJSON()),this.authorityCertIssuer&&(e.authorityCertIssuer=Array.from(this.authorityCertIssuer,t=>t.toJSON())),this.authorityCertSerialNumber&&(e.authorityCertSerialNumber=this.authorityCertSerialNumber.toJSON()),e}};MB.CLASS_NAME="AuthorityKeyIdentifier";var Uc="pathLenConstraint",Mc="cA",jB=class mA extends Be{static{o(this,"BasicConstraints")}constructor(e={}){super(),this.cA=D(e,Mc,!1),Uc in e&&(this.pathLenConstraint=D(e,Uc,0)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Mc:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Wi({optional:!0,name:t.cA||L}),new me({optional:!0,name:t.pathLenConstraint||L})]})}fromSchema(e){_e(e,[Mc,Uc]);let t=Ie(e,e,mA.schema({names:{cA:Mc,pathLenConstraint:Uc}}));Ae.assertSchema(t,this.className),Mc in t.result&&(this.cA=t.result.cA.valueBlock.value),Uc in t.result&&(t.result.pathLenConstraint.valueBlock.isHexOnly?this.pathLenConstraint=t.result.pathLenConstraint:this.pathLenConstraint=t.result.pathLenConstraint.valueBlock.valueDec)}toSchema(){let e=[];return this.cA!==mA.defaultValues(Mc)&&e.push(new Wi({value:this.cA})),Uc in this&&(this.pathLenConstraint instanceof me?e.push(this.pathLenConstraint):e.push(new me({value:this.pathLenConstraint}))),new W({value:e})}toJSON(){let e={};return this.cA!==mA.defaultValues(Mc)&&(e.cA=this.cA),Uc in this&&(this.pathLenConstraint instanceof me?e.pathLenConstraint=this.pathLenConstraint.toJSON():e.pathLenConstraint=this.pathLenConstraint),e}};jB.CLASS_NAME="BasicConstraints";var QT="certificateIndex",ZT="keyIndex",N6=class PI extends Be{static{o(this,"CAVersion")}constructor(e={}){super(),this.certificateIndex=D(e,QT,PI.defaultValues(QT)),this.keyIndex=D(e,ZT,PI.defaultValues(ZT)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case QT:case ZT:return 0;default:return super.defaultValues(e)}}static schema(){return new me}fromSchema(e){if(e.constructor.blockName()!==me.blockName())throw new Error("Object's schema was not verified against input data for CAVersion");let t=e.valueBlock.valueHex.slice(0),n=new Uint8Array(t);switch(!0){case t.byteLength<4:{let m=new ArrayBuffer(4);new Uint8Array(m).set(n,4-t.byteLength),t=m.slice(0)}break;case t.byteLength>4:{let m=new ArrayBuffer(4);new Uint8Array(m).set(n.slice(0,4)),t=m.slice(0)}break}let s=t.slice(0,2),i=new Uint8Array(s),a=i[0];i[0]=i[1],i[1]=a;let u=new Uint16Array(s);this.keyIndex=u[0];let l=t.slice(2),f=new Uint8Array(l);a=f[0],f[0]=f[1],f[1]=a;let h=new Uint16Array(l);this.certificateIndex=h[0]}toSchema(){let e=new ArrayBuffer(2),t=new Uint16Array(e);t[0]=this.certificateIndex;let n=new Uint8Array(e),s=n[0];n[0]=n[1],n[1]=s;let i=new ArrayBuffer(2),a=new Uint16Array(i);a[0]=this.keyIndex;let u=new Uint8Array(i);return s=u[0],u[0]=u[1],u[1]=s,new me({valueHex:_c(i,e)})}toJSON(){return{certificateIndex:this.certificateIndex,keyIndex:this.keyIndex}}};N6.CLASS_NAME="CAVersion";var qg="policyQualifierId",Hg="qualifier",jne=[qg,Hg],OI=class gA extends Be{static{o(this,"PolicyQualifierInfo")}constructor(e={}){super(),this.policyQualifierId=D(e,qg,gA.defaultValues(qg)),this.qualifier=D(e,Hg,gA.defaultValues(Hg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qg:return L;case Hg:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.policyQualifierId||L}),new St({name:t.qualifier||L})]})}fromSchema(e){_e(e,jne);let t=Ie(e,e,gA.schema({names:{policyQualifierId:qg,qualifier:Hg}}));Ae.assertSchema(t,this.className),this.policyQualifierId=t.result.policyQualifierId.valueBlock.toString(),this.qualifier=t.result.qualifier}toSchema(){return new W({value:[new rt({value:this.policyQualifierId}),this.qualifier]})}toJSON(){return{policyQualifierId:this.policyQualifierId,qualifier:this.qualifier.toJSON()}}};OI.CLASS_NAME="PolicyQualifierInfo";var Kg="policyIdentifier",$c="policyQualifiers",Fne=[Kg,$c],kI=class yA extends Be{static{o(this,"PolicyInformation")}constructor(e={}){super(),this.policyIdentifier=D(e,Kg,yA.defaultValues(Kg)),$c in e&&(this.policyQualifiers=D(e,$c,yA.defaultValues($c))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Kg:return L;case $c:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.policyIdentifier||L}),new W({optional:!0,value:[new Tt({name:t.policyQualifiers||L,value:OI.schema()})]})]})}fromSchema(e){_e(e,Fne);let t=Ie(e,e,yA.schema({names:{policyIdentifier:Kg,policyQualifiers:$c}}));Ae.assertSchema(t,this.className),this.policyIdentifier=t.result.policyIdentifier.valueBlock.toString(),$c in t.result&&(this.policyQualifiers=Array.from(t.result.policyQualifiers,n=>new OI({schema:n})))}toSchema(){let e=[];return e.push(new rt({value:this.policyIdentifier})),this.policyQualifiers&&e.push(new W({value:Array.from(this.policyQualifiers,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={policyIdentifier:this.policyIdentifier};return this.policyQualifiers&&(e.policyQualifiers=Array.from(this.policyQualifiers,t=>t.toJSON())),e}};kI.CLASS_NAME="PolicyInformation";var $g="certificatePolicies",qne=[$g],LI=class VI extends Be{static{o(this,"CertificatePolicies")}constructor(e={}){super(),this.certificatePolicies=D(e,$g,VI.defaultValues($g)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $g:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.certificatePolicies||L,value:kI.schema()})]})}fromSchema(e){_e(e,qne);let t=Ie(e,e,VI.schema({names:{certificatePolicies:$g}}));Ae.assertSchema(t,this.className),this.certificatePolicies=Array.from(t.result.certificatePolicies,n=>new kI({schema:n}))}toSchema(){return new W({value:Array.from(this.certificatePolicies,e=>e.toSchema())})}toJSON(){return{certificatePolicies:Array.from(this.certificatePolicies,e=>e.toJSON())}}};LI.CLASS_NAME="CertificatePolicies";var Xg="templateID",Do="templateMajorVersion",_o="templateMinorVersion",Hne=[Xg,Do,_o],Kne=class Gg extends Be{static{o(this,"CertificateTemplate")}constructor(e={}){super(),this.templateID=D(e,Xg,Gg.defaultValues(Xg)),Do in e&&(this.templateMajorVersion=D(e,Do,Gg.defaultValues(Do))),_o in e&&(this.templateMinorVersion=D(e,_o,Gg.defaultValues(_o))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xg:return L;case Do:case _o:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.templateID||L}),new me({name:t.templateMajorVersion||L,optional:!0}),new me({name:t.templateMinorVersion||L,optional:!0})]})}fromSchema(e){_e(e,Hne);let t=Ie(e,e,Gg.schema({names:{templateID:Xg,templateMajorVersion:Do,templateMinorVersion:_o}}));Ae.assertSchema(t,this.className),this.templateID=t.result.templateID.valueBlock.toString(),Do in t.result&&(this.templateMajorVersion=t.result.templateMajorVersion.valueBlock.valueDec),_o in t.result&&(this.templateMinorVersion=t.result.templateMinorVersion.valueBlock.valueDec)}toSchema(){let e=[];return e.push(new rt({value:this.templateID})),Do in this&&e.push(new me({value:this.templateMajorVersion})),_o in this&&e.push(new me({value:this.templateMinorVersion})),new W({value:e})}toJSON(){let e={templateID:this.templateID};return Do in this&&(e.templateMajorVersion=this.templateMajorVersion),_o in this&&(e.templateMinorVersion=this.templateMinorVersion),e}},Xc="distributionPoint",T6="distributionPointNames",Gc="reasons",Wc="cRLIssuer",I6="cRLIssuerNames",$ne=[Xc,T6,Gc,Wc,I6],UI=class Wg extends Be{static{o(this,"DistributionPoint")}constructor(e={}){super(),Xc in e&&(this.distributionPoint=D(e,Xc,Wg.defaultValues(Xc))),Gc in e&&(this.reasons=D(e,Gc,Wg.defaultValues(Gc))),Wc in e&&(this.cRLIssuer=D(e,Wc,Wg.defaultValues(Wc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xc:return[];case Gc:return new qt;case Wc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({value:[new ae({name:t.distributionPoint||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.distributionPointNames||L,value:Ar.schema()})]}),new ae({name:t.distributionPoint||L,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Or.schema().valueBlock.value})]})]}),new yt({name:t.reasons||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new ae({name:t.cRLIssuer||L,optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[new Tt({name:t.cRLIssuerNames||L,value:Ar.schema()})]})]})}fromSchema(e){_e(e,$ne);let t=Ie(e,e,Wg.schema({names:{distributionPoint:Xc,distributionPointNames:T6,reasons:Gc,cRLIssuer:Wc,cRLIssuerNames:I6}}));Ae.assertSchema(t,this.className),Xc in t.result&&(t.result.distributionPoint.idBlock.tagNumber===0&&(this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new Ar({schema:n}))),t.result.distributionPoint.idBlock.tagNumber===1&&(this.distributionPoint=new Or({schema:new W({value:t.result.distributionPoint.valueBlock.value})}))),Gc in t.result&&(this.reasons=new qt({valueHex:t.result.reasons.valueBlock.valueHex})),Wc in t.result&&(this.cRLIssuer=Array.from(t.result.cRLIssuerNames,n=>new Ar({schema:n})))}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):t=new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.distributionPoint.toSchema()]}),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}return this.reasons&&e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:this.reasons.valueBlock.valueHexView})),this.cRLIssuer&&e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:Array.from(this.cRLIssuer,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={};return this.distributionPoint&&(this.distributionPoint instanceof Array?e.distributionPoint=Array.from(this.distributionPoint,t=>t.toJSON()):e.distributionPoint=this.distributionPoint.toJSON()),this.reasons&&(e.reasons=this.reasons.toJSON()),this.cRLIssuer&&(e.cRLIssuer=Array.from(this.cRLIssuer,t=>t.toJSON())),e}};UI.CLASS_NAME="DistributionPoint";var Jg="distributionPoints",Xne=[Jg],MI=class jI extends Be{static{o(this,"CRLDistributionPoints")}constructor(e={}){super(),this.distributionPoints=D(e,Jg,jI.defaultValues(Jg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.distributionPoints||L,value:UI.schema()})]})}fromSchema(e){_e(e,Xne);let t=Ie(e,e,jI.schema({names:{distributionPoints:Jg}}));Ae.assertSchema(t,this.className),this.distributionPoints=Array.from(t.result.distributionPoints,n=>new UI({schema:n}))}toSchema(){return new W({value:Array.from(this.distributionPoints,e=>e.toSchema())})}toJSON(){return{distributionPoints:Array.from(this.distributionPoints,e=>e.toJSON())}}};MI.CLASS_NAME="CRLDistributionPoints";var zg="keyPurposes",Gne=[zg],B6=class FI extends Be{static{o(this,"ExtKeyUsage")}constructor(e={}){super(),this.keyPurposes=D(e,zg,FI.defaultValues(zg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case zg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.keyPurposes||L,value:new rt})]})}fromSchema(e){_e(e,Gne);let t=Ie(e,e,FI.schema({names:{keyPurposes:zg}}));Ae.assertSchema(t,this.className),this.keyPurposes=Array.from(t.result.keyPurposes,n=>n.valueBlock.toString())}toSchema(){return new W({value:Array.from(this.keyPurposes,e=>new rt({value:e}))})}toJSON(){return{keyPurposes:Array.from(this.keyPurposes)}}};B6.CLASS_NAME="ExtKeyUsage";var Ag="accessDescriptions",qI=class HI extends Be{static{o(this,"InfoAccess")}constructor(e={}){super(),this.accessDescriptions=D(e,Ag,HI.defaultValues(Ag)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ag:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.accessDescriptions||L,value:II.schema()})]})}fromSchema(e){_e(e,[Ag]);let t=Ie(e,e,HI.schema({names:{accessDescriptions:Ag}}));Ae.assertSchema(t,this.className),this.accessDescriptions=Array.from(t.result.accessDescriptions,n=>new II({schema:n}))}toSchema(){return new W({value:Array.from(this.accessDescriptions,e=>e.toSchema())})}toJSON(){return{accessDescriptions:Array.from(this.accessDescriptions,e=>e.toJSON())}}};qI.CLASS_NAME="InfoAccess";var Jc="distributionPoint",D6="distributionPointNames",ol="onlyContainsUserCerts",ul="onlyContainsCACerts",ll="onlySomeReasons",cl="indirectCRL",fl="onlyContainsAttributeCerts",Wne=[Jc,D6,ol,ul,ll,cl,fl],_6=class Zn extends Be{static{o(this,"IssuingDistributionPoint")}constructor(e={}){super(),Jc in e&&(this.distributionPoint=D(e,Jc,Zn.defaultValues(Jc))),this.onlyContainsUserCerts=D(e,ol,Zn.defaultValues(ol)),this.onlyContainsCACerts=D(e,ul,Zn.defaultValues(ul)),ll in e&&(this.onlySomeReasons=D(e,ll,Zn.defaultValues(ll))),this.indirectCRL=D(e,cl,Zn.defaultValues(cl)),this.onlyContainsAttributeCerts=D(e,fl,Zn.defaultValues(fl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jc:return[];case ol:return!1;case ul:return!1;case ll:return 0;case cl:return!1;case fl:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({value:[new ae({name:t.distributionPoint||L,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.distributionPointNames||L,value:Ar.schema()})]}),new ae({name:t.distributionPoint||L,idBlock:{tagClass:3,tagNumber:1},value:Or.schema().valueBlock.value})]})]}),new yt({name:t.onlyContainsUserCerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new yt({name:t.onlyContainsCACerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new yt({name:t.onlySomeReasons||L,optional:!0,idBlock:{tagClass:3,tagNumber:3}}),new yt({name:t.indirectCRL||L,optional:!0,idBlock:{tagClass:3,tagNumber:4}}),new yt({name:t.onlyContainsAttributeCerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:5}})]})}fromSchema(e){_e(e,Wne);let t=Ie(e,e,Zn.schema({names:{distributionPoint:Jc,distributionPointNames:D6,onlyContainsUserCerts:ol,onlyContainsCACerts:ul,onlySomeReasons:ll,indirectCRL:cl,onlyContainsAttributeCerts:fl}}));if(Ae.assertSchema(t,this.className),Jc in t.result)switch(!0){case t.result.distributionPoint.idBlock.tagNumber===0:this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new Ar({schema:n}));break;case t.result.distributionPoint.idBlock.tagNumber===1:this.distributionPoint=new Or({schema:new W({value:t.result.distributionPoint.valueBlock.value})});break;default:throw new Error("Unknown tagNumber for distributionPoint: {$asn1.result.distributionPoint.idBlock.tagNumber}")}if(ol in t.result){let n=new Uint8Array(t.result.onlyContainsUserCerts.valueBlock.valueHex);this.onlyContainsUserCerts=n[0]!==0}if(ul in t.result){let n=new Uint8Array(t.result.onlyContainsCACerts.valueBlock.valueHex);this.onlyContainsCACerts=n[0]!==0}if(ll in t.result){let n=new Uint8Array(t.result.onlySomeReasons.valueBlock.valueHex);this.onlySomeReasons=n[0]}if(cl in t.result){let n=new Uint8Array(t.result.indirectCRL.valueBlock.valueHex);this.indirectCRL=n[0]!==0}if(fl in t.result){let n=new Uint8Array(t.result.onlyContainsAttributeCerts.valueBlock.valueHex);this.onlyContainsAttributeCerts=n[0]!==0}}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):(t=this.distributionPoint.toSchema(),t.idBlock.tagClass=3,t.idBlock.tagNumber=1),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(this.onlyContainsUserCerts!==Zn.defaultValues(ol)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsCACerts!==Zn.defaultValues(ul)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:2},valueHex:new Uint8Array([255]).buffer})),this.onlySomeReasons!==void 0){let t=new ArrayBuffer(1),n=new Uint8Array(t);n[0]=this.onlySomeReasons,e.push(new yt({idBlock:{tagClass:3,tagNumber:3},valueHex:t}))}return this.indirectCRL!==Zn.defaultValues(cl)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:4},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsAttributeCerts!==Zn.defaultValues(fl)&&e.push(new yt({idBlock:{tagClass:3,tagNumber:5},valueHex:new Uint8Array([255]).buffer})),new W({value:e})}toJSON(){let e={};return this.distributionPoint&&(this.distributionPoint instanceof Array?e.distributionPoint=Array.from(this.distributionPoint,t=>t.toJSON()):e.distributionPoint=this.distributionPoint.toJSON()),this.onlyContainsUserCerts!==Zn.defaultValues(ol)&&(e.onlyContainsUserCerts=this.onlyContainsUserCerts),this.onlyContainsCACerts!==Zn.defaultValues(ul)&&(e.onlyContainsCACerts=this.onlyContainsCACerts),ll in this&&(e.onlySomeReasons=this.onlySomeReasons),this.indirectCRL!==Zn.defaultValues(cl)&&(e.indirectCRL=this.indirectCRL),this.onlyContainsAttributeCerts!==Zn.defaultValues(fl)&&(e.onlyContainsAttributeCerts=this.onlyContainsAttributeCerts),e}};_6.CLASS_NAME="IssuingDistributionPoint";var Yg="base",Hp="minimum",hl="maximum",Jne=[Yg,Hp,hl],Qg=class Zg extends Be{static{o(this,"GeneralSubtree")}constructor(e={}){super(),this.base=D(e,Yg,Zg.defaultValues(Yg)),this.minimum=D(e,Hp,Zg.defaultValues(Hp)),hl in e&&(this.maximum=D(e,hl,Zg.defaultValues(hl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yg:return new Ar;case Hp:return 0;case hl:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ar.schema(t.base||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.minimum||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new me({name:t.maximum||L})]})]})}fromSchema(e){_e(e,Jne);let t=Ie(e,e,Zg.schema({names:{base:{names:{blockName:Yg}},minimum:Hp,maximum:hl}}));Ae.assertSchema(t,this.className),this.base=new Ar({schema:t.result.base}),Hp in t.result&&(t.result.minimum.valueBlock.isHexOnly?this.minimum=t.result.minimum:this.minimum=t.result.minimum.valueBlock.valueDec),hl in t.result&&(t.result.maximum.valueBlock.isHexOnly?this.maximum=t.result.maximum:this.maximum=t.result.maximum.valueBlock.valueDec)}toSchema(){let e=[];if(e.push(this.base.toSchema()),this.minimum!==0){let t=0;this.minimum instanceof me?t=this.minimum:t=new me({value:this.minimum}),e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(hl in this){let t=0;this.maximum instanceof me?t=this.maximum:t=new me({value:this.maximum}),e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[t]}))}return new W({value:e})}toJSON(){let e={base:this.base.toJSON()};return this.minimum!==0&&(typeof this.minimum=="number"?e.minimum=this.minimum:e.minimum=this.minimum.toJSON()),this.maximum!==void 0&&(typeof this.maximum=="number"?e.maximum=this.maximum:e.maximum=this.maximum.toJSON()),e}};Qg.CLASS_NAME="GeneralSubtree";var zc="permittedSubtrees",Yc="excludedSubtrees",zne=[zc,Yc],R6=class vA extends Be{static{o(this,"NameConstraints")}constructor(e={}){super(),zc in e&&(this.permittedSubtrees=D(e,zc,vA.defaultValues(zc))),Yc in e&&(this.excludedSubtrees=D(e,Yc,vA.defaultValues(Yc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case zc:case Yc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.permittedSubtrees||L,value:Qg.schema()})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.excludedSubtrees||L,value:Qg.schema()})]})]})}fromSchema(e){_e(e,zne);let t=Ie(e,e,vA.schema({names:{permittedSubtrees:zc,excludedSubtrees:Yc}}));Ae.assertSchema(t,this.className),zc in t.result&&(this.permittedSubtrees=Array.from(t.result.permittedSubtrees,n=>new Qg({schema:n}))),Yc in t.result&&(this.excludedSubtrees=Array.from(t.result.excludedSubtrees,n=>new Qg({schema:n})))}toSchema(){let e=[];return this.permittedSubtrees&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.permittedSubtrees,t=>t.toSchema())})),this.excludedSubtrees&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.excludedSubtrees,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={};return this.permittedSubtrees&&(e.permittedSubtrees=Array.from(this.permittedSubtrees,t=>t.toJSON())),this.excludedSubtrees&&(e.excludedSubtrees=Array.from(this.excludedSubtrees,t=>t.toJSON())),e}};R6.CLASS_NAME="NameConstraints";var Ro="requireExplicitPolicy",Po="inhibitPolicyMapping",Yne=[Ro,Po],P6=class wA extends Be{static{o(this,"PolicyConstraints")}constructor(e={}){super(),Ro in e&&(this.requireExplicitPolicy=D(e,Ro,wA.defaultValues(Ro))),Po in e&&(this.inhibitPolicyMapping=D(e,Po,wA.defaultValues(Po))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ro:return 0;case Po:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new yt({name:t.requireExplicitPolicy||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new yt({name:t.inhibitPolicyMapping||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,Yne);let t=Ie(e,e,wA.schema({names:{requireExplicitPolicy:Ro,inhibitPolicyMapping:Po}}));if(Ae.assertSchema(t,this.className),Ro in t.result){let n=t.result.requireExplicitPolicy;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"Integer"),this.requireExplicitPolicy=i.result.valueBlock.valueDec}if(Po in t.result){let n=t.result.inhibitPolicyMapping;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Hr(s);Ae.assert(i,"Integer"),this.inhibitPolicyMapping=i.result.valueBlock.valueDec}}toSchema(){let e=[];if(Ro in this){let t=new me({value:this.requireExplicitPolicy});t.idBlock.tagClass=3,t.idBlock.tagNumber=0,e.push(t)}if(Po in this){let t=new me({value:this.inhibitPolicyMapping});t.idBlock.tagClass=3,t.idBlock.tagNumber=1,e.push(t)}return new W({value:e})}toJSON(){let e={};return Ro in this&&(e.requireExplicitPolicy=this.requireExplicitPolicy),Po in this&&(e.inhibitPolicyMapping=this.inhibitPolicyMapping),e}};P6.CLASS_NAME="PolicyConstraints";var e1="issuerDomainPolicy",t1="subjectDomainPolicy",Qne=[e1,t1],KI=class SA extends Be{static{o(this,"PolicyMapping")}constructor(e={}){super(),this.issuerDomainPolicy=D(e,e1,SA.defaultValues(e1)),this.subjectDomainPolicy=D(e,t1,SA.defaultValues(t1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case e1:return L;case t1:return L;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.issuerDomainPolicy||L}),new rt({name:t.subjectDomainPolicy||L})]})}fromSchema(e){_e(e,Qne);let t=Ie(e,e,SA.schema({names:{issuerDomainPolicy:e1,subjectDomainPolicy:t1}}));Ae.assertSchema(t,this.className),this.issuerDomainPolicy=t.result.issuerDomainPolicy.valueBlock.toString(),this.subjectDomainPolicy=t.result.subjectDomainPolicy.valueBlock.toString()}toSchema(){return new W({value:[new rt({value:this.issuerDomainPolicy}),new rt({value:this.subjectDomainPolicy})]})}toJSON(){return{issuerDomainPolicy:this.issuerDomainPolicy,subjectDomainPolicy:this.subjectDomainPolicy}}};KI.CLASS_NAME="PolicyMapping";var r1="mappings",Zne=[r1],O6=class $I extends Be{static{o(this,"PolicyMappings")}constructor(e={}){super(),this.mappings=D(e,r1,$I.defaultValues(r1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case r1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.mappings||L,value:KI.schema()})]})}fromSchema(e){_e(e,Zne);let t=Ie(e,e,$I.schema({names:{mappings:r1}}));Ae.assertSchema(t,this.className),this.mappings=Array.from(t.result.mappings,n=>new KI({schema:n}))}toSchema(){return new W({value:Array.from(this.mappings,e=>e.toSchema())})}toJSON(){return{mappings:Array.from(this.mappings,e=>e.toJSON())}}};O6.CLASS_NAME="PolicyMappings";var pl="notBefore",dl="notAfter",ese=[pl,dl],k6=class EA extends Be{static{o(this,"PrivateKeyUsagePeriod")}constructor(e={}){super(),pl in e&&(this.notBefore=D(e,pl,EA.defaultValues(pl))),dl in e&&(this.notAfter=D(e,dl,EA.defaultValues(dl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pl:return new Date;case dl:return new Date;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new yt({name:t.notBefore||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new yt({name:t.notAfter||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,ese);let t=Ie(e,e,EA.schema({names:{notBefore:pl,notAfter:dl}}));if(Ae.assertSchema(t,this.className),pl in t.result){let n=new Rr;n.fromBuffer(t.result.notBefore.valueBlock.valueHex),this.notBefore=n.toDate()}if(dl in t.result){let n=new Rr({valueHex:t.result.notAfter.valueBlock.valueHex});n.fromBuffer(t.result.notAfter.valueBlock.valueHex),this.notAfter=n.toDate()}}toSchema(){let e=[];return pl in this&&e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:new Rr({valueDate:this.notBefore}).valueBlock.valueHexView})),dl in this&&e.push(new yt({idBlock:{tagClass:3,tagNumber:1},valueHex:new Rr({valueDate:this.notAfter}).valueBlock.valueHexView})),new W({value:e})}toJSON(){let e={};return this.notBefore&&(e.notBefore=this.notBefore),this.notAfter&&(e.notAfter=this.notAfter),e}};k6.CLASS_NAME="PrivateKeyUsagePeriod";var Kp="id",Oo="type",$p="values",tse=[Kp,Oo],rse=[$p],XI=class AA extends Be{static{o(this,"QCStatement")}constructor(e={}){super(),this.id=D(e,Kp,AA.defaultValues(Kp)),Oo in e&&(this.type=D(e,Oo,AA.defaultValues(Oo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Kp:return L;case Oo:return new Kr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Kp:return t===L;case Oo:return t instanceof Kr;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||L}),new St({name:t.type||L,optional:!0})]})}fromSchema(e){_e(e,tse);let t=Ie(e,e,AA.schema({names:{id:Kp,type:Oo}}));Ae.assertSchema(t,this.className),this.id=t.result.id.valueBlock.toString(),Oo in t.result&&(this.type=t.result.type)}toSchema(){let e=[new rt({value:this.id})];return Oo in this&&e.push(this.type),new W({value:e})}toJSON(){let e={id:this.id};return this.type&&(e.type=this.type.toJSON()),e}};XI.CLASS_NAME="QCStatement";var L6=class GI extends Be{static{o(this,"QCStatements")}constructor(e={}){super(),this.values=D(e,$p,GI.defaultValues($p)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $p:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case $p:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.values||L,value:XI.schema(t.value||{})})]})}fromSchema(e){_e(e,rse);let t=Ie(e,e,GI.schema({names:{values:$p}}));Ae.assertSchema(t,this.className),this.values=Array.from(t.result.values,n=>new XI({schema:n}))}toSchema(){return new W({value:Array.from(this.values,e=>e.toSchema())})}toJSON(){return{values:Array.from(this.values,e=>e.toJSON())}}};L6.CLASS_NAME="QCStatements";var Qc,Yl=class{static{o(this,"ECNamedCurves")}static register(e,t,n){this.namedCurves[e.toLowerCase()]=this.namedCurves[t]={name:e,id:t,size:n}}static find(e){return this.namedCurves[e.toLowerCase()]||null}};Qc=Yl;Yl.namedCurves={};Qc.register("P-256","1.2.840.10045.3.1.7",32),Qc.register("P-384","1.3.132.0.34",48),Qc.register("P-521","1.3.132.0.35",66),Qc.register("brainpoolP256r1","1.3.36.3.3.2.8.1.1.7",32),Qc.register("brainpoolP384r1","1.3.36.3.3.2.8.1.1.11",48),Qc.register("brainpoolP512r1","1.3.36.3.3.2.8.1.1.13",64);var jE="x",FE="y",qE="namedCurve",Wo=class Xp extends Be{static{o(this,"ECPublicKey")}constructor(e={}){super(),this.x=D(e,jE,Xp.defaultValues(jE)),this.y=D(e,FE,Xp.defaultValues(FE)),this.namedCurve=D(e,qE,Xp.defaultValues(qE)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jE:case FE:return Qr;case qE:return L;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case jE:case FE:return t instanceof ArrayBuffer&&Wu(t,Xp.defaultValues(e));case qE:return typeof t=="string"&&t===Xp.defaultValues(e);default:return super.defaultValues(e)}}static schema(){return new yg}fromSchema(e){let t=dt.toUint8Array(e);if(t[0]!==4)throw new Error("Object's schema was not verified against input data for ECPublicKey");let n=Yl.find(this.namedCurve);if(!n)throw new Error(`Incorrect curve OID: ${this.namedCurve}`);let s=n.size;if(t.byteLength!==s*2+1)throw new Error("Object's schema was not verified against input data for ECPublicKey");this.namedCurve=n.name,this.x=t.slice(1,s+1).buffer,this.y=t.slice(1+s,s*2+1).buffer}toSchema(){return new yg({data:_c(new Uint8Array([4]).buffer,this.x,this.y)})}toJSON(){let e=Yl.find(this.namedCurve);return{crv:e?e.name:this.namedCurve,x:bE(cg(this.x),!0,!0,!1),y:bE(cg(this.y),!0,!0,!1)}}fromJSON(e){fr.assert("json",e,"crv","x","y");let t=0,n=Yl.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=Rc(Tp(e.x,!0));if(s.byteLength<t){this.x=new ArrayBuffer(t);let a=new Uint8Array(this.x),u=new Uint8Array(s);a.set(u,1)}else this.x=s.slice(0,t);let i=Rc(Tp(e.y,!0));if(i.byteLength<t){this.y=new ArrayBuffer(t);let a=new Uint8Array(this.y),u=new Uint8Array(i);a.set(u,1)}else this.y=i.slice(0,t)}};Wo.CLASS_NAME="ECPublicKey";var n1="modulus",s1="publicExponent",nse=[n1,s1],WI=class CA extends Be{static{o(this,"RSAPublicKey")}constructor(e={}){super(),this.modulus=D(e,n1,CA.defaultValues(n1)),this.publicExponent=D(e,s1,CA.defaultValues(s1)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case n1:return new me;case s1:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.modulus||L}),new me({name:t.publicExponent||L})]})}fromSchema(e){_e(e,nse);let t=Ie(e,e,CA.schema({names:{modulus:n1,publicExponent:s1}}));Ae.assertSchema(t,this.className),this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent}toSchema(){return new W({value:[this.modulus.convertToDER(),this.publicExponent]})}toJSON(){return{n:Ct.ToBase64Url(this.modulus.valueBlock.valueHexView),e:Ct.ToBase64Url(this.publicExponent.valueBlock.valueHexView)}}fromJSON(e){fr.assert("json",e,"n","e");let t=Rc(Tp(e.n,!0));this.modulus=new me({valueHex:t.slice(0,Math.pow(2,_V(t.byteLength)))}),this.publicExponent=new me({valueHex:Rc(Tp(e.e,!0)).slice(0,3)})}};WI.CLASS_NAME="RSAPublicKey";var i1="algorithm",a1="subjectPublicKey",sse=[i1,a1],na=class bA extends Be{static{o(this,"PublicKeyInfo")}get parsedKey(){if(this._parsedKey===void 0){switch(this.algorithm.algorithmId){case"1.2.840.10045.2.1":if("algorithmParams"in this.algorithm&&this.algorithm.algorithmParams.constructor.blockName()===rt.blockName())try{this._parsedKey=new Wo({namedCurve:this.algorithm.algorithmParams.valueBlock.toString(),schema:this.subjectPublicKey.valueBlock.valueHexView})}catch{}break;case"1.2.840.113549.1.1.1":{let e=Hr(this.subjectPublicKey.valueBlock.valueHexView);if(e.offset!==-1)try{this._parsedKey=new WI({schema:e.result})}catch{}}break}this._parsedKey||(this._parsedKey=null)}return this._parsedKey||void 0}set parsedKey(e){this._parsedKey=e}constructor(e={}){super(),this.algorithm=D(e,i1,bA.defaultValues(i1)),this.subjectPublicKey=D(e,a1,bA.defaultValues(a1));let t=D(e,"parsedKey",null);t&&(this.parsedKey=t),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case i1:return new ge;case a1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.algorithm||{}),new qt({name:t.subjectPublicKey||L})]})}fromSchema(e){_e(e,sse);let t=Ie(e,e,bA.schema({names:{algorithm:{names:{blockName:i1}},subjectPublicKey:a1}}));Ae.assertSchema(t,this.className),this.algorithm=new ge({schema:t.result.algorithm}),this.subjectPublicKey=t.result.subjectPublicKey}toSchema(){return new W({value:[this.algorithm.toSchema(),this.subjectPublicKey]})}toJSON(){if(!this.parsedKey)return{algorithm:this.algorithm.toJSON(),subjectPublicKey:this.subjectPublicKey.toJSON()};let e={};switch(this.algorithm.algorithmId){case"1.2.840.10045.2.1":e.kty="EC";break;case"1.2.840.113549.1.1.1":e.kty="RSA";break}let t=this.parsedKey.toJSON();return Object.assign(e,t),e}fromJSON(e){if("kty"in e){switch(e.kty.toUpperCase()){case"EC":this.parsedKey=new Wo({json:e}),this.algorithm=new ge({algorithmId:"1.2.840.10045.2.1",algorithmParams:new rt({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new WI({json:e}),this.algorithm=new ge({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new Kr});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.subjectPublicKey=new qt({valueHex:this.parsedKey.toSchema().toBER(!1)})}}async importKey(e,t=_t(!0)){try{if(!e)throw new Error("Need to provide publicKey input parameter");let n=await t.exportKey("spki",e),s=Hr(n);try{this.fromSchema(s.result)}catch{throw new Error("Error during initializing object from schema")}}catch(n){let s=n instanceof Error?n.message:`${n}`;throw new Error(`Error during exporting public key: ${s}`)}}};na.CLASS_NAME="PublicKeyInfo";var Gp="version",Wp="privateKey",zi="namedCurve",ml="publicKey",ise=[Gp,Wp,zi,ml],JI=class ko extends Be{static{o(this,"ECPrivateKey")}constructor(e={}){super(),this.version=D(e,Gp,ko.defaultValues(Gp)),this.privateKey=D(e,Wp,ko.defaultValues(Wp)),zi in e&&(this.namedCurve=D(e,zi,ko.defaultValues(zi))),ml in e&&(this.publicKey=D(e,ml,ko.defaultValues(ml))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gp:return 1;case Wp:return new Ve;case zi:return L;case ml:return new Wo;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Gp:return t===ko.defaultValues(e);case Wp:return t.isEqual(ko.defaultValues(e));case zi:return t===L;case ml:return Wo.compareWithDefault(zi,t.namedCurve)&&Wo.compareWithDefault("x",t.x)&&Wo.compareWithDefault("y",t.y);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new Ve({name:t.privateKey||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new rt({name:t.namedCurve||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new qt({name:t.publicKey||L})]})]})}fromSchema(e){_e(e,ise);let t=Ie(e,e,ko.schema({names:{version:Gp,privateKey:Wp,namedCurve:zi,publicKey:ml}}));if(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKey=t.result.privateKey,zi in t.result&&(this.namedCurve=t.result.namedCurve.valueBlock.toString()),ml in t.result){let n={schema:t.result.publicKey.valueBlock.valueHex};zi in this&&(n.namedCurve=this.namedCurve),this.publicKey=new Wo(n)}}toSchema(){let e=[new me({value:this.version}),this.privateKey];return this.namedCurve&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new rt({value:this.namedCurve})]})),this.publicKey&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new qt({valueHex:this.publicKey.toSchema().toBER(!1)})]})),new W({value:e})}toJSON(){if(!this.namedCurve||ko.compareWithDefault(zi,this.namedCurve))throw new Error('Not enough information for making JSON: absent "namedCurve" value');let e=Yl.find(this.namedCurve),t={crv:e?e.name:this.namedCurve,d:Ct.ToBase64Url(this.privateKey.valueBlock.valueHexView)};if(this.publicKey){let n=this.publicKey.toJSON();t.x=n.x,t.y=n.y}return t}fromJSON(e){fr.assert("json",e,"crv","d");let t=0,n=Yl.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=Ct.FromBase64Url(e.d);if(s.byteLength<t){let i=new ArrayBuffer(t),a=new Uint8Array(i),u=new Uint8Array(s);a.set(u,1),this.privateKey=new Ve({valueHex:i})}else this.privateKey=new Ve({valueHex:s.slice(0,t)});e.x&&e.y&&(this.publicKey=new Wo({json:e}))}};JI.CLASS_NAME="ECPrivateKey";var o1="prime",u1="exponent",l1="coefficient",ase=[o1,u1,l1],xA=class c1 extends Be{static{o(this,"OtherPrimeInfo")}constructor(e={}){super(),this.prime=D(e,o1,c1.defaultValues(o1)),this.exponent=D(e,u1,c1.defaultValues(u1)),this.coefficient=D(e,l1,c1.defaultValues(l1)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case o1:return new me;case u1:return new me;case l1:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.prime||L}),new me({name:t.exponent||L}),new me({name:t.coefficient||L})]})}fromSchema(e){_e(e,ase);let t=Ie(e,e,c1.schema({names:{prime:o1,exponent:u1,coefficient:l1}}));Ae.assertSchema(t,this.className),this.prime=t.result.prime.convertFromDER(),this.exponent=t.result.exponent.convertFromDER(),this.coefficient=t.result.coefficient.convertFromDER()}toSchema(){return new W({value:[this.prime.convertToDER(),this.exponent.convertToDER(),this.coefficient.convertToDER()]})}toJSON(){return{r:Ct.ToBase64Url(this.prime.valueBlock.valueHexView),d:Ct.ToBase64Url(this.exponent.valueBlock.valueHexView),t:Ct.ToBase64Url(this.coefficient.valueBlock.valueHexView)}}fromJSON(e){fr.assert("json",e,"r","d","r"),this.prime=new me({valueHex:Ct.FromBase64Url(e.r)}),this.exponent=new me({valueHex:Ct.FromBase64Url(e.d)}),this.coefficient=new me({valueHex:Ct.FromBase64Url(e.t)})}};xA.CLASS_NAME="OtherPrimeInfo";var f1="version",h1="modulus",p1="publicExponent",d1="privateExponent",m1="prime1",g1="prime2",y1="exponent1",v1="exponent2",w1="coefficient",Zc="otherPrimeInfos",ose=[f1,h1,p1,d1,m1,g1,y1,v1,w1,Zc],zI=class Ii extends Be{static{o(this,"RSAPrivateKey")}constructor(e={}){super(),this.version=D(e,f1,Ii.defaultValues(f1)),this.modulus=D(e,h1,Ii.defaultValues(h1)),this.publicExponent=D(e,p1,Ii.defaultValues(p1)),this.privateExponent=D(e,d1,Ii.defaultValues(d1)),this.prime1=D(e,m1,Ii.defaultValues(m1)),this.prime2=D(e,g1,Ii.defaultValues(g1)),this.exponent1=D(e,y1,Ii.defaultValues(y1)),this.exponent2=D(e,v1,Ii.defaultValues(v1)),this.coefficient=D(e,w1,Ii.defaultValues(w1)),Zc in e&&(this.otherPrimeInfos=D(e,Zc,Ii.defaultValues(Zc))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case f1:return 0;case h1:return new me;case p1:return new me;case d1:return new me;case m1:return new me;case g1:return new me;case y1:return new me;case v1:return new me;case w1:return new me;case Zc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new me({name:t.modulus||L}),new me({name:t.publicExponent||L}),new me({name:t.privateExponent||L}),new me({name:t.prime1||L}),new me({name:t.prime2||L}),new me({name:t.exponent1||L}),new me({name:t.exponent2||L}),new me({name:t.coefficient||L}),new W({optional:!0,value:[new Tt({name:t.otherPrimeInfosName||L,value:xA.schema(t.otherPrimeInfo||{})})]})]})}fromSchema(e){_e(e,ose);let t=Ie(e,e,Ii.schema({names:{version:f1,modulus:h1,publicExponent:p1,privateExponent:d1,prime1:m1,prime2:g1,exponent1:y1,exponent2:v1,coefficient:w1,otherPrimeInfo:{names:{blockName:Zc}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent,this.privateExponent=t.result.privateExponent.convertFromDER(256),this.prime1=t.result.prime1.convertFromDER(128),this.prime2=t.result.prime2.convertFromDER(128),this.exponent1=t.result.exponent1.convertFromDER(128),this.exponent2=t.result.exponent2.convertFromDER(128),this.coefficient=t.result.coefficient.convertFromDER(128),Zc in t.result&&(this.otherPrimeInfos=Array.from(t.result.otherPrimeInfos,n=>new xA({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.modulus.convertToDER()),e.push(this.publicExponent),e.push(this.privateExponent.convertToDER()),e.push(this.prime1.convertToDER()),e.push(this.prime2.convertToDER()),e.push(this.exponent1.convertToDER()),e.push(this.exponent2.convertToDER()),e.push(this.coefficient.convertToDER()),this.otherPrimeInfos&&e.push(new W({value:Array.from(this.otherPrimeInfos,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={n:Ct.ToBase64Url(this.modulus.valueBlock.valueHexView),e:Ct.ToBase64Url(this.publicExponent.valueBlock.valueHexView),d:Ct.ToBase64Url(this.privateExponent.valueBlock.valueHexView),p:Ct.ToBase64Url(this.prime1.valueBlock.valueHexView),q:Ct.ToBase64Url(this.prime2.valueBlock.valueHexView),dp:Ct.ToBase64Url(this.exponent1.valueBlock.valueHexView),dq:Ct.ToBase64Url(this.exponent2.valueBlock.valueHexView),qi:Ct.ToBase64Url(this.coefficient.valueBlock.valueHexView)};return this.otherPrimeInfos&&(e.oth=Array.from(this.otherPrimeInfos,t=>t.toJSON())),e}fromJSON(e){fr.assert("json",e,"n","e","d","p","q","dp","dq","qi"),this.modulus=new me({valueHex:Ct.FromBase64Url(e.n)}),this.publicExponent=new me({valueHex:Ct.FromBase64Url(e.e)}),this.privateExponent=new me({valueHex:Ct.FromBase64Url(e.d)}),this.prime1=new me({valueHex:Ct.FromBase64Url(e.p)}),this.prime2=new me({valueHex:Ct.FromBase64Url(e.q)}),this.exponent1=new me({valueHex:Ct.FromBase64Url(e.dp)}),this.exponent2=new me({valueHex:Ct.FromBase64Url(e.dq)}),this.coefficient=new me({valueHex:Ct.FromBase64Url(e.qi)}),e.oth&&(this.otherPrimeInfos=Array.from(e.oth,t=>new xA({json:t})))}};zI.CLASS_NAME="RSAPrivateKey";var S1="version",E1="privateKeyAlgorithm",A1="privateKey",ef="attributes",HE="parsedKey",use=[S1,E1,A1,ef],lv=class tf extends Be{static{o(this,"PrivateKeyInfo")}constructor(e={}){super(),this.version=D(e,S1,tf.defaultValues(S1)),this.privateKeyAlgorithm=D(e,E1,tf.defaultValues(E1)),this.privateKey=D(e,A1,tf.defaultValues(A1)),ef in e&&(this.attributes=D(e,ef,tf.defaultValues(ef))),HE in e&&(this.parsedKey=D(e,HE,tf.defaultValues(HE))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case S1:return 0;case E1:return new ge;case A1:return new Ve;case ef:return[];case HE:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),ge.schema(t.privateKeyAlgorithm||{}),new Ve({name:t.privateKey||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.attributes||L,value:Zr.schema()})]})]})}fromSchema(e){_e(e,use);let t=Ie(e,e,tf.schema({names:{version:S1,privateKeyAlgorithm:{names:{blockName:E1}},privateKey:A1,attributes:ef}}));switch(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKeyAlgorithm=new ge({schema:t.result.privateKeyAlgorithm}),this.privateKey=t.result.privateKey,ef in t.result&&(this.attributes=Array.from(t.result.attributes,n=>new Zr({schema:n}))),this.privateKeyAlgorithm.algorithmId){case"1.2.840.113549.1.1.1":{let n=Hr(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new zI({schema:n.result}))}break;case"1.2.840.10045.2.1":if("algorithmParams"in this.privateKeyAlgorithm&&this.privateKeyAlgorithm.algorithmParams instanceof rt){let n=Hr(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new JI({namedCurve:this.privateKeyAlgorithm.algorithmParams.valueBlock.toString(),schema:n.result}))}break}}toSchema(){let e=[new me({value:this.version}),this.privateKeyAlgorithm.toSchema(),this.privateKey];return this.attributes&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes,t=>t.toSchema())})),new W({value:e})}toJSON(){if(!this.parsedKey){let n={version:this.version,privateKeyAlgorithm:this.privateKeyAlgorithm.toJSON(),privateKey:this.privateKey.toJSON()};return this.attributes&&(n.attributes=Array.from(this.attributes,s=>s.toJSON())),n}let e={};switch(this.privateKeyAlgorithm.algorithmId){case"1.2.840.10045.2.1":e.kty="EC";break;case"1.2.840.113549.1.1.1":e.kty="RSA";break}let t=this.parsedKey.toJSON();return Object.assign(e,t),e}fromJSON(e){if("kty"in e){switch(e.kty.toUpperCase()){case"EC":this.parsedKey=new JI({json:e}),this.privateKeyAlgorithm=new ge({algorithmId:"1.2.840.10045.2.1",algorithmParams:new rt({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new zI({json:e}),this.privateKeyAlgorithm=new ge({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new Kr});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.privateKey=new Ve({valueHex:this.parsedKey.toSchema().toBER(!1)})}}};lv.CLASS_NAME="PrivateKeyInfo";var Jp="contentType",zp="contentEncryptionAlgorithm",rf="encryptedContent",lse=[Jp,zp,rf],GU=1024,es=class C1 extends Be{static{o(this,"EncryptedContentInfo")}constructor(e={}){if(super(),this.contentType=D(e,Jp,C1.defaultValues(Jp)),this.contentEncryptionAlgorithm=D(e,zp,C1.defaultValues(zp)),rf in e&&e.encryptedContent&&(this.encryptedContent=e.encryptedContent,this.encryptedContent.idBlock.tagClass===1&&this.encryptedContent.idBlock.tagNumber===4&&this.encryptedContent.idBlock.isConstructed===!1&&!e.disableSplit)){let t=new Ve({idBlock:{isConstructed:!0},isConstructed:!0}),n=0,s=this.encryptedContent.valueBlock.valueHexView.slice().buffer,i=s.byteLength;for(;i>0;){let a=new Uint8Array(s,n,n+GU>s.byteLength?s.byteLength-n:GU),u=new ArrayBuffer(a.length),l=new Uint8Array(u);for(let f=0;f<l.length;f++)l[f]=a[f];t.valueBlock.value.push(new Ve({valueHex:u})),i-=a.length,n+=a.length}this.encryptedContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jp:return L;case zp:return new ge;case rf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Jp:return t===L;case zp:return t.algorithmId===L&&!("algorithmParams"in t);case rf:return t.isEqual(C1.defaultValues(rf));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.contentType||L}),ge.schema(t.contentEncryptionAlgorithm||{}),new Pr({value:[new ae({name:t.encryptedContent||L,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({value:new Ve})]}),new yt({name:t.encryptedContent||L,idBlock:{tagClass:3,tagNumber:0}})]})]})}fromSchema(e){_e(e,lse);let t=Ie(e,e,C1.schema({names:{contentType:Jp,contentEncryptionAlgorithm:{names:{blockName:zp}},encryptedContent:rf}}));Ae.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.contentEncryptionAlgorithm=new ge({schema:t.result.contentEncryptionAlgorithm}),rf in t.result&&(this.encryptedContent=t.result.encryptedContent,this.encryptedContent.idBlock.tagClass=1,this.encryptedContent.idBlock.tagNumber=4)}toSchema(){let e={isIndefiniteForm:!1},t=[];if(t.push(new rt({value:this.contentType})),t.push(this.contentEncryptionAlgorithm.toSchema()),this.encryptedContent){e.isIndefiniteForm=this.encryptedContent.idBlock.isConstructed;let n=this.encryptedContent;n.idBlock.tagClass=3,n.idBlock.tagNumber=0,n.lenBlock.isIndefiniteForm=this.encryptedContent.idBlock.isConstructed,t.push(n)}return new W({lenBlock:e,value:t})}toJSON(){let e={contentType:this.contentType,contentEncryptionAlgorithm:this.contentEncryptionAlgorithm.toJSON()};return this.encryptedContent&&(e.encryptedContent=this.encryptedContent.toJSON()),e}getEncryptedContent(){if(!this.encryptedContent)throw new Error("Parameter 'encryptedContent' is undefined");return Ve.prototype.getValue.call(this.encryptedContent)}};es.CLASS_NAME="EncryptedContentInfo";var gl="hashAlgorithm",yl="maskGenAlgorithm",vl="saltLength",wl="trailerField",cse=[gl,yl,vl,wl],NA=class Ps extends Be{static{o(this,"RSASSAPSSParams")}constructor(e={}){super(),this.hashAlgorithm=D(e,gl,Ps.defaultValues(gl)),this.maskGenAlgorithm=D(e,yl,Ps.defaultValues(yl)),this.saltLength=D(e,vl,Ps.defaultValues(vl)),this.trailerField=D(e,wl,Ps.defaultValues(wl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case gl:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr});case yl:return new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr}).toSchema()});case vl:return 20;case wl:return 1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ge.schema(t.hashAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ge.schema(t.maskGenAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[new me({name:t.saltLength||L})]}),new ae({idBlock:{tagClass:3,tagNumber:3},optional:!0,value:[new me({name:t.trailerField||L})]})]})}fromSchema(e){_e(e,cse);let t=Ie(e,e,Ps.schema({names:{hashAlgorithm:{names:{blockName:gl}},maskGenAlgorithm:{names:{blockName:yl}},saltLength:vl,trailerField:wl}}));Ae.assertSchema(t,this.className),gl in t.result&&(this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm})),yl in t.result&&(this.maskGenAlgorithm=new ge({schema:t.result.maskGenAlgorithm})),vl in t.result&&(this.saltLength=t.result.saltLength.valueBlock.valueDec),wl in t.result&&(this.trailerField=t.result.trailerField.valueBlock.valueDec)}toSchema(){let e=[];return this.hashAlgorithm.isEqual(Ps.defaultValues(gl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(Ps.defaultValues(yl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.saltLength!==Ps.defaultValues(vl)&&e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[new me({value:this.saltLength})]})),this.trailerField!==Ps.defaultValues(wl)&&e.push(new ae({idBlock:{tagClass:3,tagNumber:3},value:[new me({value:this.trailerField})]})),new W({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(Ps.defaultValues(gl))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(Ps.defaultValues(yl))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.saltLength!==Ps.defaultValues(vl)&&(e.saltLength=this.saltLength),this.trailerField!==Ps.defaultValues(wl)&&(e.trailerField=this.trailerField),e}};NA.CLASS_NAME="RSASSAPSSParams";var Yp="salt",b1="iterationCount",Yi="keyLength",Lo="prf",fse=[Yp,b1,Yi,Lo],y0=class ja extends Be{static{o(this,"PBKDF2Params")}constructor(e={}){super(),this.salt=D(e,Yp,ja.defaultValues(Yp)),this.iterationCount=D(e,b1,ja.defaultValues(b1)),Yi in e&&(this.keyLength=D(e,Yi,ja.defaultValues(Yi))),Lo in e&&(this.prf=D(e,Lo,ja.defaultValues(Lo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yp:return{};case b1:return-1;case Yi:return 0;case Lo:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr});default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Pr({value:[new Ve({name:t.saltPrimitive||L}),ge.schema(t.saltConstructed||{})]}),new me({name:t.iterationCount||L}),new me({name:t.keyLength||L,optional:!0}),ge.schema(t.prf||{names:{optional:!0}})]})}fromSchema(e){_e(e,fse);let t=Ie(e,e,ja.schema({names:{saltPrimitive:Yp,saltConstructed:{names:{blockName:Yp}},iterationCount:b1,keyLength:Yi,prf:{names:{blockName:Lo,optional:!0}}}}));Ae.assertSchema(t,this.className),this.salt=t.result.salt,this.iterationCount=t.result.iterationCount.valueBlock.valueDec,Yi in t.result&&(this.keyLength=t.result.keyLength.valueBlock.valueDec),Lo in t.result&&(this.prf=new ge({schema:t.result.prf}))}toSchema(){let e=[];return e.push(this.salt),e.push(new me({value:this.iterationCount})),Yi in this&&ja.defaultValues(Yi)!==this.keyLength&&e.push(new me({value:this.keyLength})),this.prf&&ja.defaultValues(Lo).isEqual(this.prf)===!1&&e.push(this.prf.toSchema()),new W({value:e})}toJSON(){let e={salt:this.salt.toJSON(),iterationCount:this.iterationCount};return Yi in this&&ja.defaultValues(Yi)!==this.keyLength&&(e.keyLength=this.keyLength),this.prf&&ja.defaultValues(Lo).isEqual(this.prf)===!1&&(e.prf=this.prf.toJSON()),e}};y0.CLASS_NAME="PBKDF2Params";var x1="keyDerivationFunc",N1="encryptionScheme",hse=[x1,N1],YI=class TA extends Be{static{o(this,"PBES2Params")}constructor(e={}){super(),this.keyDerivationFunc=D(e,x1,TA.defaultValues(x1)),this.encryptionScheme=D(e,N1,TA.defaultValues(N1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case x1:return new ge;case N1:return new ge;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.keyDerivationFunc||{}),ge.schema(t.encryptionScheme||{})]})}fromSchema(e){_e(e,hse);let t=Ie(e,e,TA.schema({names:{keyDerivationFunc:{names:{blockName:x1}},encryptionScheme:{names:{blockName:N1}}}}));Ae.assertSchema(t,this.className),this.keyDerivationFunc=new ge({schema:t.result.keyDerivationFunc}),this.encryptionScheme=new ge({schema:t.result.encryptionScheme})}toSchema(){return new W({value:[this.keyDerivationFunc.toSchema(),this.encryptionScheme.toSchema()]})}toJSON(){return{keyDerivationFunc:this.keyDerivationFunc.toJSON(),encryptionScheme:this.encryptionScheme.toJSON()}}};YI.CLASS_NAME="PBES2Params";var pse=class{static{o(this,"AbstractCryptoEngine")}constructor(e){this.crypto=e.crypto,this.subtle="webkitSubtle"in e.crypto?e.crypto.webkitSubtle:e.crypto.subtle,this.name=D(e,"name",L)}async encrypt(...e){return this.subtle.encrypt(...e)}async decrypt(...e){return this.subtle.decrypt(...e)}sign(...e){return this.subtle.sign(...e)}async verify(...e){return this.subtle.verify(...e)}async digest(...e){return this.subtle.digest(...e)}async generateKey(...e){return this.subtle.generateKey(...e)}async deriveKey(...e){return this.subtle.deriveKey(...e)}async deriveBits(...e){return this.subtle.deriveBits(...e)}async wrapKey(...e){return this.subtle.wrapKey(...e)}async unwrapKey(...e){return this.subtle.unwrapKey(...e)}exportKey(...e){return this.subtle.exportKey(...e)}importKey(...e){return this.subtle.importKey(...e)}getRandomValues(e){if(e===null)throw new Error('Argument "array" must not be null');return this.crypto.getRandomValues(e)}};async function WU(r,e,t,n,s){let i,a,u;switch(r.toUpperCase()){case"SHA-1":i=20,a=64,u=jU;break;case"SHA-256":i=32,a=64,u=GT;break;case"SHA-384":i=48,a=128,u=zT;break;case"SHA-512":i=64,a=128,u=JT;break;default:throw new Error("Unsupported hashing algorithm")}let l=new Uint8Array(t),f=new TextDecoder().decode(t);new TextEncoder().encode(f).some((C,x)=>C!==l[x])&&(f=String.fromCharCode(...l));let m=new Uint8Array(f.length*2+2),g=new DataView(m.buffer);for(let C=0;C<f.length;C++)g.setUint16(C*2,f.charCodeAt(C),!1);g.setUint16(f.length*2,0,!1);let w=new Uint8Array(a).fill(3),y=new Uint8Array(n),S=new Uint8Array(a*Math.ceil(y.length/a)).map((C,x)=>y[x%y.length]),E=new Uint8Array(a*Math.ceil(m.length/a)).map((C,x)=>m[x%m.length]),b=new Uint8Array(S.length+E.length);b.set(S),b.set(E,S.length);let T=Math.ceil((e>>3)/i),A=[];for(let C=0;C<T;C++){let x=new Uint8Array(w.length+b.length);x.set(w),x.set(b,w.length);for(let H=0;H<s;H++)x=u(x);let B=new Uint8Array(a).map((H,q)=>x[q%x.length]),F=Math.ceil(y.length/a)+Math.ceil(m.length/a),R=[];for(let H=0;H<F;H++){let q=Array.from(b.slice(H*a,(H+1)*a)),K=511;for(let G=B.length-1;G>=0;G--)K>>=8,K+=B[G]+(q[G]||0),q[G]=K&255;R.push(...q)}b=new Uint8Array(R),A.push(...x)}return new Uint8Array(A.slice(0,e>>3)).buffer}o(WU,"makePKCS12B2Key");function V6(r){let e=typeof r=="string"?{name:r}:r;return"hash"in e?{...e,hash:V6(e.hash)}:e}o(V6,"prepareAlgorithm");var w0=class extends pse{static{o(this,"CryptoEngine")}async importKey(e,t,n,s,i){var a,u,l,f,h,m;let g={},w=V6(n);switch(e.toLowerCase()){case"raw":return this.subtle.importKey("raw",t,n,s,i);case"spki":{let y=Hr(dt.toArrayBuffer(t));Ae.assert(y,"keyData");let S=new na;try{S.fromSchema(y.result)}catch{throw new Er("Incorrect keyData")}switch(w.name.toUpperCase()){case"RSA-PSS":{if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="PS1";break;case"SHA-256":g.alg="PS256";break;case"SHA-384":g.alg="PS384";break;case"SHA-512":g.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}case"RSASSA-PKCS1-V1_5":{if(i=["verify"],g.kty="RSA",g.ext=s,g.key_ops=i,S.algorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect public key algorithm: ${S.algorithm.algorithmId}`);if(!g.alg){if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="RS1";break;case"SHA-256":g.alg="RS256";break;case"SHA-384":g.alg="RS384";break;case"SHA-512":g.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}let E=S.toJSON();Object.assign(g,E)}break;case"ECDSA":i=["verify"];case"ECDH":{if(g={kty:"EC",ext:s,key_ops:i},S.algorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect public key algorithm: ${S.algorithm.algorithmId}`);let E=S.toJSON();Object.assign(g,E)}break;case"RSA-OAEP":{if(g.kty="RSA",g.ext=s,g.key_ops=i,this.name.toLowerCase()==="safari")g.alg="RSA-OAEP";else{if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="RSA-OAEP";break;case"SHA-256":g.alg="RSA-OAEP-256";break;case"SHA-384":g.alg="RSA-OAEP-384";break;case"SHA-512":g.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}let E=S.toJSON();Object.assign(g,E)}break;case"RSAES-PKCS1-V1_5":{g.kty="RSA",g.ext=s,g.key_ops=i,g.alg="PS1";let E=S.toJSON();Object.assign(g,E)}break;default:throw new Error(`Incorrect algorithm name: ${w.name.toUpperCase()}`)}}break;case"pkcs8":{let y=new lv,S=Hr(dt.toArrayBuffer(t));Ae.assert(S,"keyData");try{y.fromSchema(S.result)}catch{throw new Error("Incorrect keyData")}if(!y.parsedKey)throw new Error("Incorrect keyData");switch(w.name.toUpperCase()){case"RSA-PSS":switch((a=w.hash)===null||a===void 0?void 0:a.name.toUpperCase()){case"SHA-1":g.alg="PS1";break;case"SHA-256":g.alg="PS256";break;case"SHA-384":g.alg="PS384";break;case"SHA-512":g.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${(u=w.hash)===null||u===void 0?void 0:u.name.toUpperCase()}`)}case"RSASSA-PKCS1-V1_5":{if(i=["sign"],g.kty="RSA",g.ext=s,g.key_ops=i,y.privateKeyAlgorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect private key algorithm: ${y.privateKeyAlgorithm.algorithmId}`);if(!("alg"in g))switch((l=w.hash)===null||l===void 0?void 0:l.name.toUpperCase()){case"SHA-1":g.alg="RS1";break;case"SHA-256":g.alg="RS256";break;case"SHA-384":g.alg="RS384";break;case"SHA-512":g.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${(f=w.hash)===null||f===void 0?void 0:f.name.toUpperCase()}`)}let E=y.toJSON();Object.assign(g,E)}break;case"ECDSA":i=["sign"];case"ECDH":{if(g={kty:"EC",ext:s,key_ops:i},y.privateKeyAlgorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect algorithm: ${y.privateKeyAlgorithm.algorithmId}`);let E=y.toJSON();Object.assign(g,E)}break;case"RSA-OAEP":{if(g.kty="RSA",g.ext=s,g.key_ops=i,this.name.toLowerCase()==="safari")g.alg="RSA-OAEP";else switch((h=w.hash)===null||h===void 0?void 0:h.name.toUpperCase()){case"SHA-1":g.alg="RSA-OAEP";break;case"SHA-256":g.alg="RSA-OAEP-256";break;case"SHA-384":g.alg="RSA-OAEP-384";break;case"SHA-512":g.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${(m=w.hash)===null||m===void 0?void 0:m.name.toUpperCase()}`)}let E=y.toJSON();Object.assign(g,E)}break;case"RSAES-PKCS1-V1_5":{i=["decrypt"],g.kty="RSA",g.ext=s,g.key_ops=i,g.alg="PS1";let E=y.toJSON();Object.assign(g,E)}break;default:throw new Error(`Incorrect algorithm name: ${w.name.toUpperCase()}`)}}break;case"jwk":g=t;break;default:throw new Error(`Incorrect format: ${e}`)}if(this.name.toLowerCase()==="safari")try{return this.subtle.importKey("jwk",Rc(JSON.stringify(g)),n,s,i)}catch{return this.subtle.importKey("jwk",g,n,s,i)}return this.subtle.importKey("jwk",g,n,s,i)}async exportKey(e,t){let n=await this.subtle.exportKey("jwk",t);switch(this.name.toLowerCase()==="safari"&&n instanceof ArrayBuffer&&(n=JSON.parse(cg(n))),e.toLowerCase()){case"raw":return this.subtle.exportKey("raw",t);case"spki":{let s=new na;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"pkcs8":{let s=new lv;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"jwk":return n;default:throw new Error(`Incorrect format: ${e}`)}}async convert(e,t,n,s,i,a){if(e.toLowerCase()===t.toLowerCase())return n;let u=await this.importKey(e,n,s,i,a);return this.exportKey(t,u)}getAlgorithmByOID(e,t=!1,n){switch(e){case"1.2.840.113549.1.1.1":return{name:"RSAES-PKCS1-v1_5"};case"1.2.840.113549.1.1.5":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case"1.2.840.113549.1.1.11":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"1.2.840.113549.1.1.12":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case"1.2.840.113549.1.1.13":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case"1.2.840.113549.1.1.10":return{name:"RSA-PSS"};case"1.2.840.113549.1.1.7":return{name:"RSA-OAEP"};case"1.2.840.10045.2.1":case"1.2.840.10045.4.1":return{name:"ECDSA",hash:{name:"SHA-1"}};case"1.2.840.10045.4.3.2":return{name:"ECDSA",hash:{name:"SHA-256"}};case"1.2.840.10045.4.3.3":return{name:"ECDSA",hash:{name:"SHA-384"}};case"1.2.840.10045.4.3.4":return{name:"ECDSA",hash:{name:"SHA-512"}};case"1.3.133.16.840.63.0.2":return{name:"ECDH",kdf:"SHA-1"};case"1.3.132.1.11.1":return{name:"ECDH",kdf:"SHA-256"};case"1.3.132.1.11.2":return{name:"ECDH",kdf:"SHA-384"};case"1.3.132.1.11.3":return{name:"ECDH",kdf:"SHA-512"};case"2.16.840.1.101.3.4.1.2":return{name:"AES-CBC",length:128};case"2.16.840.1.101.3.4.1.22":return{name:"AES-CBC",length:192};case"2.16.840.1.101.3.4.1.42":return{name:"AES-CBC",length:256};case"2.16.840.1.101.3.4.1.6":return{name:"AES-GCM",length:128};case"2.16.840.1.101.3.4.1.26":return{name:"AES-GCM",length:192};case"2.16.840.1.101.3.4.1.46":return{name:"AES-GCM",length:256};case"2.16.840.1.101.3.4.1.4":return{name:"AES-CFB",length:128};case"2.16.840.1.101.3.4.1.24":return{name:"AES-CFB",length:192};case"2.16.840.1.101.3.4.1.44":return{name:"AES-CFB",length:256};case"2.16.840.1.101.3.4.1.5":return{name:"AES-KW",length:128};case"2.16.840.1.101.3.4.1.25":return{name:"AES-KW",length:192};case"2.16.840.1.101.3.4.1.45":return{name:"AES-KW",length:256};case"1.2.840.113549.2.7":return{name:"HMAC",hash:{name:"SHA-1"}};case"1.2.840.113549.2.9":return{name:"HMAC",hash:{name:"SHA-256"}};case"1.2.840.113549.2.10":return{name:"HMAC",hash:{name:"SHA-384"}};case"1.2.840.113549.2.11":return{name:"HMAC",hash:{name:"SHA-512"}};case"1.2.840.113549.1.9.16.3.5":return{name:"DH"};case"1.3.14.3.2.26":return{name:"SHA-1"};case"2.16.840.1.101.3.4.2.1":return{name:"SHA-256"};case"2.16.840.1.101.3.4.2.2":return{name:"SHA-384"};case"2.16.840.1.101.3.4.2.3":return{name:"SHA-512"};case"1.2.840.113549.1.5.12":return{name:"PBKDF2"};case"1.2.840.10045.3.1.7":return{name:"P-256"};case"1.3.132.0.34":return{name:"P-384"};case"1.3.132.0.35":return{name:"P-521"}}if(t)throw new Error(`Unsupported algorithm identifier ${n?`for ${n} `:L}: ${e}`);return{}}getOIDByAlgorithm(e,t=!1,n){let s=L;switch(e.name.toUpperCase()){case"RSAES-PKCS1-V1_5":s="1.2.840.113549.1.1.1";break;case"RSASSA-PKCS1-V1_5":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.113549.1.1.5";break;case"SHA-256":s="1.2.840.113549.1.1.11";break;case"SHA-384":s="1.2.840.113549.1.1.12";break;case"SHA-512":s="1.2.840.113549.1.1.13";break}break;case"RSA-PSS":s="1.2.840.113549.1.1.10";break;case"RSA-OAEP":s="1.2.840.113549.1.1.7";break;case"ECDSA":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.10045.4.1";break;case"SHA-256":s="1.2.840.10045.4.3.2";break;case"SHA-384":s="1.2.840.10045.4.3.3";break;case"SHA-512":s="1.2.840.10045.4.3.4";break}break;case"ECDH":switch(e.kdf.toUpperCase()){case"SHA-1":s="1.3.133.16.840.63.0.2";break;case"SHA-256":s="1.3.132.1.11.1";break;case"SHA-384":s="1.3.132.1.11.2";break;case"SHA-512":s="1.3.132.1.11.3";break}break;case"AES-CTR":break;case"AES-CBC":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.2";break;case 192:s="2.16.840.1.101.3.4.1.22";break;case 256:s="2.16.840.1.101.3.4.1.42";break}break;case"AES-CMAC":break;case"AES-GCM":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.6";break;case 192:s="2.16.840.1.101.3.4.1.26";break;case 256:s="2.16.840.1.101.3.4.1.46";break}break;case"AES-CFB":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.4";break;case 192:s="2.16.840.1.101.3.4.1.24";break;case 256:s="2.16.840.1.101.3.4.1.44";break}break;case"AES-KW":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.5";break;case 192:s="2.16.840.1.101.3.4.1.25";break;case 256:s="2.16.840.1.101.3.4.1.45";break}break;case"HMAC":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.113549.2.7";break;case"SHA-256":s="1.2.840.113549.2.9";break;case"SHA-384":s="1.2.840.113549.2.10";break;case"SHA-512":s="1.2.840.113549.2.11";break}break;case"DH":s="1.2.840.113549.1.9.16.3.5";break;case"SHA-1":s="1.3.14.3.2.26";break;case"SHA-256":s="2.16.840.1.101.3.4.2.1";break;case"SHA-384":s="2.16.840.1.101.3.4.2.2";break;case"SHA-512":s="2.16.840.1.101.3.4.2.3";break;case"CONCAT":break;case"HKDF":break;case"PBKDF2":s="1.2.840.113549.1.5.12";break;case"P-256":s="1.2.840.10045.3.1.7";break;case"P-384":s="1.3.132.0.34";break;case"P-521":s="1.3.132.0.35";break}if(!s&&t)throw new Error(`Unsupported algorithm ${n?`for ${n} `:L}: ${e.name}`);return s}getAlgorithmParameters(e,t){let n={algorithm:{},usages:[]};switch(e.toUpperCase()){case"RSAES-PKCS1-V1_5":case"RSASSA-PKCS1-V1_5":switch(t.toLowerCase()){case"generatekey":n={algorithm:{name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},usages:["sign","verify"]};break;case"verify":case"sign":case"importkey":n={algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]};break;case"exportkey":default:return{algorithm:{name:"RSASSA-PKCS1-v1_5"},usages:[]}}break;case"RSA-PSS":switch(t.toLowerCase()){case"sign":case"verify":n={algorithm:{name:"RSA-PSS",hash:{name:"SHA-1"},saltLength:20},usages:["sign","verify"]};break;case"generatekey":n={algorithm:{name:"RSA-PSS",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-1"}},usages:["sign","verify"]};break;case"importkey":n={algorithm:{name:"RSA-PSS",hash:{name:"SHA-1"}},usages:["verify"]};break;case"exportkey":default:return{algorithm:{name:"RSA-PSS"},usages:[]}}break;case"RSA-OAEP":switch(t.toLowerCase()){case"encrypt":case"decrypt":n={algorithm:{name:"RSA-OAEP"},usages:["encrypt","decrypt"]};break;case"generatekey":n={algorithm:{name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"importkey":n={algorithm:{name:"RSA-OAEP",hash:{name:"SHA-256"}},usages:["encrypt"]};break;case"exportkey":default:return{algorithm:{name:"RSA-OAEP"},usages:[]}}break;case"ECDSA":switch(t.toLowerCase()){case"generatekey":n={algorithm:{name:"ECDSA",namedCurve:"P-256"},usages:["sign","verify"]};break;case"importkey":n={algorithm:{name:"ECDSA",namedCurve:"P-256"},usages:["verify"]};break;case"verify":case"sign":n={algorithm:{name:"ECDSA",hash:{name:"SHA-256"}},usages:["sign"]};break;default:return{algorithm:{name:"ECDSA"},usages:[]}}break;case"ECDH":switch(t.toLowerCase()){case"exportkey":case"importkey":case"generatekey":n={algorithm:{name:"ECDH",namedCurve:"P-256"},usages:["deriveKey","deriveBits"]};break;case"derivekey":case"derivebits":n={algorithm:{name:"ECDH",namedCurve:"P-256",public:[]},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"ECDH"},usages:[]}}break;case"AES-CTR":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-CTR",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-CTR",counter:new Uint8Array(16),length:10},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-CTR"},usages:[]}}break;case"AES-CBC":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-CBC",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-CBC",iv:this.getRandomValues(new Uint8Array(16))},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-CBC"},usages:[]}}break;case"AES-GCM":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-GCM",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-GCM",iv:this.getRandomValues(new Uint8Array(16))},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-GCM"},usages:[]}}break;case"AES-KW":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":case"wrapkey":case"unwrapkey":n={algorithm:{name:"AES-KW",length:256},usages:["wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-KW"},usages:[]}}break;case"HMAC":switch(t.toLowerCase()){case"sign":case"verify":n={algorithm:{name:"HMAC"},usages:["sign","verify"]};break;case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"HMAC",length:32,hash:{name:"SHA-256"}},usages:["sign","verify"]};break;default:return{algorithm:{name:"HMAC"},usages:[]}}break;case"HKDF":switch(t.toLowerCase()){case"derivekey":n={algorithm:{name:"HKDF",hash:"SHA-256",salt:new Uint8Array([]),info:new Uint8Array([])},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"HKDF"},usages:[]}}break;case"PBKDF2":switch(t.toLowerCase()){case"derivekey":n={algorithm:{name:"PBKDF2",hash:{name:"SHA-256"},salt:new Uint8Array([]),iterations:1e4},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"PBKDF2"},usages:[]}}break}return n}getHashAlgorithm(e){let t=L;switch(e.algorithmId){case"1.2.840.10045.4.1":case"1.2.840.113549.1.1.5":t="SHA-1";break;case"1.2.840.10045.4.3.2":case"1.2.840.113549.1.1.11":t="SHA-256";break;case"1.2.840.10045.4.3.3":case"1.2.840.113549.1.1.12":t="SHA-384";break;case"1.2.840.10045.4.3.4":case"1.2.840.113549.1.1.13":t="SHA-512";break;case"1.2.840.113549.1.1.10":try{let n=new NA({schema:e.algorithmParams});if(n.hashAlgorithm){let s=this.getAlgorithmByOID(n.hashAlgorithm.algorithmId);if("name"in s)t=s.name;else return L}else t="SHA-1"}catch{}break}return t}async encryptEncryptedContentInfo(e){fr.assert(e,"password","contentEncryptionAlgorithm","hmacHashAlgorithm","iterationCount","contentToEncrypt","contentToEncrypt","contentType");let t=this.getOIDByAlgorithm(e.contentEncryptionAlgorithm,!0,"contentEncryptionAlgorithm"),n=this.getOIDByAlgorithm({name:"PBKDF2"},!0,"PBKDF2"),s=this.getOIDByAlgorithm({name:"HMAC",hash:{name:e.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),i=new ArrayBuffer(16),a=new Uint8Array(i);this.getRandomValues(a);let u=new ArrayBuffer(64),l=new Uint8Array(u);this.getRandomValues(l);let f=new Uint8Array(e.contentToEncrypt),h=new y0({salt:new Ve({valueHex:u}),iterationCount:e.iterationCount,prf:new ge({algorithmId:s,algorithmParams:new Kr})}),m=new Uint8Array(e.password),g=await this.importKey("raw",m,"PBKDF2",!1,["deriveKey"]),w=await this.deriveKey({name:"PBKDF2",hash:{name:e.hmacHashAlgorithm},salt:l,iterations:e.iterationCount},g,e.contentEncryptionAlgorithm,!1,["encrypt"]),y=await this.encrypt({name:e.contentEncryptionAlgorithm.name,iv:a},w,f),S=new YI({keyDerivationFunc:new ge({algorithmId:n,algorithmParams:h.toSchema()}),encryptionScheme:new ge({algorithmId:t,algorithmParams:new Ve({valueHex:i})})});return new es({contentType:e.contentType,contentEncryptionAlgorithm:new ge({algorithmId:"1.2.840.113549.1.5.13",algorithmParams:S.toSchema()}),encryptedContent:new Ve({valueHex:y})})}async decryptEncryptedContentInfo(e){if(fr.assert(e,"password","encryptedContentInfo"),e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId!=="1.2.840.113549.1.5.13")throw new Error(`Unknown "contentEncryptionAlgorithm": ${e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId}`);let t;try{t=new YI({schema:e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbes2Parameters"')}let n;try{n=new y0({schema:t.keyDerivationFunc.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbkdf2Params"')}let s=this.getAlgorithmByOID(t.encryptionScheme.algorithmId,!0),i=t.encryptionScheme.algorithmParams.valueBlock.valueHex,a=new Uint8Array(i),u=n.salt.valueBlock.valueHex,l=new Uint8Array(u),f=n.iterationCount,h="SHA-1";n.prf&&(h=this.getAlgorithmByOID(n.prf.algorithmId,!0).hash.name);let m=await this.importKey("raw",e.password,"PBKDF2",!1,["deriveKey"]),g=await this.deriveKey({name:"PBKDF2",hash:{name:h},salt:l,iterations:f},m,s,!1,["decrypt"]),w=e.encryptedContentInfo.getEncryptedContent();return this.decrypt({name:s.name,iv:a},g,w)}async stampDataWithPassword(e){if(!(e instanceof Object))throw new Error('Parameters must have type "Object"');fr.assert(e,"password","hashAlgorithm","iterationCount","salt","contentToStamp");let t;switch(e.hashAlgorithm.toLowerCase()){case"sha-1":t=160;break;case"sha-256":t=256;break;case"sha-384":t=384;break;case"sha-512":t=512;break;default:throw new Error(`Incorrect "parameters.hashAlgorithm" parameter: ${e.hashAlgorithm}`)}let n={name:"HMAC",length:t,hash:{name:e.hashAlgorithm}},s=await WU(e.hashAlgorithm,t,e.password,e.salt,e.iterationCount),i=await this.importKey("raw",new Uint8Array(s),n,!1,["sign"]);return this.sign(n,i,new Uint8Array(e.contentToStamp))}async verifyDataStampedWithPassword(e){fr.assert(e,"password","hashAlgorithm","salt","iterationCount","contentToVerify","signatureToVerify");let t=0;switch(e.hashAlgorithm.toLowerCase()){case"sha-1":t=160;break;case"sha-256":t=256;break;case"sha-384":t=384;break;case"sha-512":t=512;break;default:throw new Error(`Incorrect "parameters.hashAlgorithm" parameter: ${e.hashAlgorithm}`)}let n={name:"HMAC",length:t,hash:{name:e.hashAlgorithm}},s=await WU(e.hashAlgorithm,t,e.password,e.salt,e.iterationCount),i=await this.importKey("raw",new Uint8Array(s),n,!1,["verify"]);return this.verify(n,i,new Uint8Array(e.signatureToVerify),new Uint8Array(e.contentToVerify))}async getSignatureParameters(e,t="SHA-1"){this.getOIDByAlgorithm({name:t},!0,"hashAlgorithm");let n=new ge,s=this.getAlgorithmParameters(e.algorithm.name,"sign");if(!Object.keys(s.algorithm).length)throw new Error("Parameter 'algorithm' is empty");let i=s.algorithm;switch("hash"in e.algorithm&&e.algorithm.hash&&e.algorithm.hash.name?i.hash.name=e.algorithm.hash.name:i.hash.name=t,e.algorithm.name.toUpperCase()){case"RSASSA-PKCS1-V1_5":case"ECDSA":n.algorithmId=this.getOIDByAlgorithm(i,!0);break;case"RSA-PSS":{switch(i.hash.name.toUpperCase()){case"SHA-256":i.saltLength=32;break;case"SHA-384":i.saltLength=48;break;case"SHA-512":i.saltLength=64;break}let a={};if(i.hash.name.toUpperCase()!=="SHA-1"){let l=this.getOIDByAlgorithm({name:i.hash.name},!0,"hashAlgorithm");a.hashAlgorithm=new ge({algorithmId:l,algorithmParams:new Kr}),a.maskGenAlgorithm=new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:a.hashAlgorithm.toSchema()})}i.saltLength!==20&&(a.saltLength=i.saltLength);let u=new NA(a);n.algorithmId="1.2.840.113549.1.1.10",n.algorithmParams=u.toSchema()}break;default:throw new Error(`Unsupported signature algorithm: ${e.algorithm.name}`)}return{signatureAlgorithm:n,parameters:s}}async signWithPrivateKey(e,t,n){let s=await this.sign(n.algorithm,t,e);return n.algorithm.name==="ECDSA"?mse(s):s}fillPublicKeyParameters(e,t){let n={},s=this.getHashAlgorithm(t);if(s===L)throw new Error(`Unsupported signature algorithm: ${t.algorithmId}`);let i;t.algorithmId==="1.2.840.113549.1.1.10"?i=t.algorithmId:i=e.algorithm.algorithmId;let a=this.getAlgorithmByOID(i,!0);if(n.algorithm=this.getAlgorithmParameters(a.name,"importKey"),"hash"in n.algorithm.algorithm&&(n.algorithm.algorithm.hash.name=s),a.name==="ECDSA"){let u=e.algorithm;if(!u.algorithmParams)throw new Error("Algorithm parameters for ECDSA public key are missed");let l=u.algorithmParams;if("idBlock"in u.algorithmParams&&!(l.idBlock.tagClass===1&&l.idBlock.tagNumber===6))throw new Error("Incorrect type for ECDSA public key parameters");let f=this.getAlgorithmByOID(l.valueBlock.toString(),!0);n.algorithm.algorithm.namedCurve=f.name}return n}async getPublicKey(e,t,n){n||(n=this.fillPublicKeyParameters(e,t));let s=e.toSchema().toBER(!1);return this.importKey("spki",s,n.algorithm.algorithm,!0,n.algorithm.usages)}async verifyWithPublicKey(e,t,n,s,i){let a;if(i){let f={},h;s.algorithmId==="1.2.840.113549.1.1.10"?h=s.algorithmId:h=n.algorithm.algorithmId;let m=this.getAlgorithmByOID(h,!0);if(f.algorithm=this.getAlgorithmParameters(m.name,"importKey"),"hash"in f.algorithm.algorithm&&(f.algorithm.algorithm.hash.name=i),m.name==="ECDSA"){let g=!1;if("algorithmParams"in n.algorithm&&"idBlock"in n.algorithm.algorithmParams&&n.algorithm.algorithmParams.idBlock.tagClass===1&&n.algorithm.algorithmParams.idBlock.tagNumber===6&&(g=!0),g===!1)throw new Error("Incorrect type for ECDSA public key parameters");let w=this.getAlgorithmByOID(n.algorithm.algorithmParams.valueBlock.toString(),!0);f.algorithm.algorithm.namedCurve=w.name}a=await this.getPublicKey(n,null,f)}else{if(i=this.getHashAlgorithm(s),!i)throw new Error(`Unsupported signature algorithm: ${s.algorithmId}`);a=await this.getPublicKey(n,s)}let u=this.getAlgorithmParameters(a.algorithm.name,"verify");"hash"in u.algorithm&&(u.algorithm.hash.name=i);let l=t.valueBlock.valueHexView;if(a.algorithm.name==="ECDSA"){let f=Yl.find(a.algorithm.namedCurve);if(!f)throw new Error("Unsupported named curve in use");let h=Hr(l);Ae.assert(h,"Signature value"),l=gse(h.result,f.size)}if(a.algorithm.name==="RSA-PSS"){let f=new NA({schema:s.algorithmParams});"saltLength"in f?u.algorithm.saltLength=f.saltLength:u.algorithm.saltLength=20;let h="SHA-1";"hashAlgorithm"in f&&(h=this.getAlgorithmByOID(f.hashAlgorithm.algorithmId,!0).name),u.algorithm.hash.name=h}return this.verify(u.algorithm,a,l,e)}},U6={name:"none",crypto:null};function JU(r){return!!(r&&typeof r=="object"&&"crypto"in r)}o(JU,"isCryptoEngine");function bC(r,...e){let t=null;if(e.length<2)e.length?t=e[0]:t=typeof self<"u"&&self.crypto?new w0({name:"browser",crypto:self.crypto}):null;else{let n=e[0],s=e[1];JU(s)?t=s:JU(n)?t=n:"subtle"in n&&"getRandomValues"in n&&(t=new w0({crypto:n}))}if(typeof process<"u"&&"pid"in process&&typeof global<"u"&&typeof window>"u"){if(typeof global[process.pid]>"u")global[process.pid]={};else if(typeof global[process.pid]!="object")throw new Error(`Name global.${process.pid} already exists and it is not an object`);if(typeof global[process.pid].pkijs>"u")global[process.pid].pkijs={};else if(typeof global[process.pid].pkijs!="object")throw new Error(`Name global.${process.pid}.pkijs already exists and it is not an object`);global[process.pid].pkijs.engine={name:r,crypto:t}}else U6={name:r,crypto:t}}o(bC,"setEngine");function dse(){if(typeof process<"u"&&"pid"in process&&typeof global<"u"&&typeof window>"u"){let r;try{r=global[process.pid].pkijs.engine}catch{throw new Error("Please call 'setEngine' before call to 'getEngine'")}return r}return U6}o(dse,"getEngine");function _t(r=!1){let e=dse();if(!e.crypto&&r)throw new Error("Unable to create WebCrypto object");return e.crypto}o(_t,"getCrypto");function mse(r){if(r.byteLength%2!==0)return Qr;let e=r.byteLength/2,t=new ArrayBuffer(e);new Uint8Array(t).set(new Uint8Array(r,0,e));let s=new me({valueHex:t}),i=new ArrayBuffer(e);new Uint8Array(i).set(new Uint8Array(r,e,e));let u=new me({valueHex:i});return new W({value:[s.convertToDER(),u.convertToDER()]}).toBER(!1)}o(mse,"createCMSECDSASignature");function gse(r,e){if(!(r instanceof W&&r.valueBlock.value.length===2&&r.valueBlock.value[0]instanceof me&&r.valueBlock.value[1]instanceof me))return Qr;let t=r.valueBlock.value[0].convertFromDER().valueBlock.valueHexView,n=r.valueBlock.value[1].convertFromDER().valueBlock.valueHexView,s=new Uint8Array(e*2);return s.set(t,e-t.byteLength),s.set(n,2*e-n.byteLength),s.buffer}o(gse,"createECDSASignatureFromCMS");async function yse(r,e,t,n,s){switch(r.toUpperCase()){case"SHA-1":case"SHA-256":case"SHA-384":case"SHA-512":break;default:throw new Er(`Unknown hash function: ${r}`)}if(Er.assert(e,"zBuffer","ArrayBuffer"),e.byteLength===0)throw new Er("'zBuffer' has zero length, error");if(Er.assert(n,"SharedInfo","ArrayBuffer"),t>255)throw new Er("Please set 'Counter' argument to value less or equal to 255");let i=new ArrayBuffer(4),a=new Uint8Array(i);a[0]=0,a[1]=0,a[2]=0,a[3]=t;let u=Qr;u=_c(u,e),u=_c(u,i),u=_c(u,n);let l=await s.digest({name:r},u);return{counter:t,result:l}}o(yse,"kdfWithCounter");async function zU(r,e,t,n,s=_t(!0)){let i=0,a=1;switch(r.toUpperCase()){case"SHA-1":i=160;break;case"SHA-256":i=256;break;case"SHA-384":i=384;break;case"SHA-512":i=512;break;default:throw new Er(`Unknown hash function: ${r}`)}if(Er.assert(e,"Zbuffer","ArrayBuffer"),e.byteLength===0)throw new Er("'Zbuffer' has zero length, error");Er.assert(n,"SharedInfo","ArrayBuffer");let u=t/i;Math.floor(u)>0&&(a=Math.floor(u),u-a>0&&a++);let l=[];for(let g=1;g<=a;g++)l.push(await yse(r,e,g,n,s));let f=Qr,h=1,m=!0;for(;m;){m=!1;for(let g of l)if(g.counter===h){f=_c(f,g.result),m=!0;break}h++}if(t>>=3,f.byteLength>t){let g=new ArrayBuffer(t),w=new Uint8Array(g),y=new Uint8Array(f);for(let S=0;S<t;S++)w[S]=y[S];return g}return f}o(zU,"kdf");var eI="version",tI="logID",rI="extensions",nI="timestamp",sI="hashAlgorithm",iI="signatureAlgorithm",aI="signature",YU="none",QU="md5",ZU="sha1",e6="sha224",t6="sha256",r6="sha384",n6="sha512",s6="anonymous",i6="rsa",a6="dsa",o6="ecdsa",M6=class Sl extends Be{static{o(this,"SignedCertificateTimestamp")}constructor(e={}){super(),this.version=D(e,eI,Sl.defaultValues(eI)),this.logID=D(e,tI,Sl.defaultValues(tI)),this.timestamp=D(e,nI,Sl.defaultValues(nI)),this.extensions=D(e,rI,Sl.defaultValues(rI)),this.hashAlgorithm=D(e,sI,Sl.defaultValues(sI)),this.signatureAlgorithm=D(e,iI,Sl.defaultValues(iI)),this.signature=D(e,aI,Sl.defaultValues(aI)),"stream"in e&&e.stream&&this.fromStream(e.stream),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case eI:return 0;case tI:case rI:return Qr;case nI:return new Date(0);case sI:case iI:return L;case aI:return Qr;default:return super.defaultValues(e)}}fromSchema(e){if(!(e instanceof yg))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestamp");let t=new Io({stream:new Un({buffer:e.data})});this.fromStream(t)}fromStream(e){let t=e.getUint16();if(this.version=e.getBlock(1)[0],this.version===0){this.logID=new Uint8Array(e.getBlock(32)).buffer.slice(0),this.timestamp=new Date(xo(new Uint8Array(e.getBlock(8)),8));let n=e.getUint16();switch(this.extensions=new Uint8Array(e.getBlock(n)).buffer.slice(0),e.getBlock(1)[0]){case 0:this.hashAlgorithm=YU;break;case 1:this.hashAlgorithm=QU;break;case 2:this.hashAlgorithm=ZU;break;case 3:this.hashAlgorithm=e6;break;case 4:this.hashAlgorithm=t6;break;case 5:this.hashAlgorithm=r6;break;case 6:this.hashAlgorithm=n6;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}switch(e.getBlock(1)[0]){case 0:this.signatureAlgorithm=s6;break;case 1:this.signatureAlgorithm=i6;break;case 2:this.signatureAlgorithm=a6;break;case 3:this.signatureAlgorithm=o6;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}let s=e.getUint16();if(this.signature=new Uint8Array(e.getBlock(s)).buffer.slice(0),t!==47+n+s)throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}}toSchema(){let e=this.toStream();return new yg({data:e.stream.buffer})}toStream(){let e=new Io;e.appendUint16(47+this.extensions.byteLength+this.signature.byteLength),e.appendChar(this.version),e.appendView(new Uint8Array(this.logID));let t=new ArrayBuffer(8),n=new Uint8Array(t),s=Xi(this.timestamp.valueOf(),8);n.set(new Uint8Array(s),8-s.byteLength),e.appendView(n),e.appendUint16(this.extensions.byteLength),this.extensions.byteLength&&e.appendView(new Uint8Array(this.extensions));let i;switch(this.hashAlgorithm.toLowerCase()){case YU:i=0;break;case QU:i=1;break;case ZU:i=2;break;case e6:i=3;break;case t6:i=4;break;case r6:i=5;break;case n6:i=6;break;default:throw new Error(`Incorrect data for hashAlgorithm: ${this.hashAlgorithm}`)}e.appendChar(i);let a;switch(this.signatureAlgorithm.toLowerCase()){case s6:a=0;break;case i6:a=1;break;case a6:a=2;break;case o6:a=3;break;default:throw new Error(`Incorrect data for signatureAlgorithm: ${this.signatureAlgorithm}`)}return e.appendChar(a),e.appendUint16(this.signature.byteLength),e.appendView(new Uint8Array(this.signature)),e}toJSON(){return{version:this.version,logID:AE(this.logID),timestamp:this.timestamp,extensions:AE(this.extensions),hashAlgorithm:this.hashAlgorithm,signatureAlgorithm:this.signatureAlgorithm,signature:AE(this.signature)}}async verify(e,t,n=0,s=_t(!0)){let i=bE(cg(this.logID)),a=null,u=new Io;for(let w of e)if(w.log_id===i){a=w.key;break}if(!a)throw new Error(`Public key not found for CT with logId: ${i}`);let l=Rc(Tp(a)),f=na.fromBER(l);u.appendChar(0),u.appendChar(0);let h=new ArrayBuffer(8),m=new Uint8Array(h),g=Xi(this.timestamp.valueOf(),8);return m.set(new Uint8Array(g),8-g.byteLength),u.appendView(m),u.appendUint16(n),n===0&&u.appendUint24(t.byteLength),u.appendView(new Uint8Array(t)),u.appendUint16(this.extensions.byteLength),this.extensions.byteLength!==0&&u.appendView(new Uint8Array(this.extensions)),s.verifyWithPublicKey(u.buffer.slice(0,u.length),new Ve({valueHex:this.signature}),f,{algorithmId:L},"SHA-256")}};M6.CLASS_NAME="SignedCertificateTimestamp";var KE="timestamps",j6=class F6 extends Be{static{o(this,"SignedCertificateTimestampList")}constructor(e={}){super(),this.timestamps=D(e,KE,F6.defaultValues(KE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case KE:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case KE:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){var t;let n=D(e,"names",{});return(t=n.optional)!==null&&t!==void 0||(n.optional=!1),new Ve({name:n.blockName||"SignedCertificateTimestampList",optional:n.optional})}fromSchema(e){if(!(e instanceof Ve))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");let t=new Io({stream:new Un({buffer:e.valueBlock.valueHex})});if(t.getUint16()!==t.length)throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");for(;t.length;)this.timestamps.push(new M6({stream:t}))}toSchema(){let e=new Io,t=0,n=[];for(let s of this.timestamps){let i=s.toStream();n.push(i),t+=i.stream.buffer.byteLength}e.appendUint16(t);for(let s of n)e.appendView(s.stream.view);return new Ve({valueHex:e.stream.buffer.slice(0)})}toJSON(){return{timestamps:Array.from(this.timestamps,e=>e.toJSON())}}};j6.CLASS_NAME="SignedCertificateTimestampList";var T1="attributes",vse=[T1],q6=class QI extends Be{static{o(this,"SubjectDirectoryAttributes")}constructor(e={}){super(),this.attributes=D(e,T1,QI.defaultValues(T1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case T1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.attributes||L,value:Zr.schema()})]})}fromSchema(e){_e(e,vse);let t=Ie(e,e,QI.schema({names:{attributes:T1}}));Ae.assertSchema(t,this.className),this.attributes=Array.from(t.result.attributes,n=>new Zr({schema:n}))}toSchema(){return new W({value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){return{attributes:Array.from(this.attributes,e=>e.toJSON())}}};q6.CLASS_NAME="SubjectDirectoryAttributes";var wse=class Xr{static{o(this,"ExtensionValueFactory")}static getItems(){return this.types||(this.types={},Xr.register(d6,"SubjectAltName",DI),Xr.register(m6,"IssuerAltName",DI),Xr.register(kB,"AuthorityKeyIdentifier",MB),Xr.register(PB,"BasicConstraints",jB),Xr.register(One,"MicrosoftCaVersion",N6),Xr.register(S6,"CertificatePolicies",LI),Xr.register(Ine,"CertificatePoliciesMicrosoft",LI),Xr.register(Pne,"MicrosoftCertTemplateV2",Kne),Xr.register(w6,"CRLDistributionPoints",MI),Xr.register(OB,"FreshestCRL",MI),Xr.register(Bne,"ExtKeyUsage",B6),Xr.register(y6,"CertificateIssuer",Mn),Xr.register(LB,"AuthorityInfoAccess",qI),Xr.register(_ne,"SubjectInfoAccess",qI),Xr.register(g6,"IssuingDistributionPoint",_6),Xr.register(v6,"NameConstraints",R6),Xr.register(A6,"PolicyConstraints",P6),Xr.register(E6,"PolicyMappings",O6),Xr.register(Cne,"PrivateKeyUsagePeriod",k6),Xr.register(kne,"QCStatements",L6),Xr.register(Rne,"SignedCertificateTimestampList",j6),Xr.register(Sne,"SubjectDirectoryAttributes",q6)),this.types}static fromBER(e,t){let n=Hr(t);if(n.offset===-1)return null;let s=this.find(e);if(s)try{return new s.type({schema:n.result})}catch{let i=new s.type;return i.parsingError=`Incorrectly formatted value of extension ${s.name} (${e})`,i}return n.result}static find(e){return this.getItems()[e]||null}static register(e,t,n){this.getItems()[e]={name:t,type:n}}},I1="extnID",El="critical",B1="extnValue",$E="parsedValue",Sse=[I1,El,B1],_i=class Al extends Be{static{o(this,"Extension")}get parsedValue(){if(this._parsedValue===void 0){let e=wse.fromBER(this.extnID,this.extnValue.valueBlock.valueHexView);this._parsedValue=e}return this._parsedValue||void 0}set parsedValue(e){this._parsedValue=e}constructor(e={}){super(),this.extnID=D(e,I1,Al.defaultValues(I1)),this.critical=D(e,El,Al.defaultValues(El)),B1 in e?this.extnValue=new Ve({valueHex:e.extnValue}):this.extnValue=Al.defaultValues(B1),$E in e&&(this.parsedValue=D(e,$E,Al.defaultValues($E))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case I1:return L;case El:return!1;case B1:return new Ve;case $E:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.extnID||L}),new Wi({name:t.critical||L,optional:!0}),new Ve({name:t.extnValue||L})]})}fromSchema(e){_e(e,Sse);let t=Ie(e,e,Al.schema({names:{extnID:I1,critical:El,extnValue:B1}}));Ae.assertSchema(t,this.className),this.extnID=t.result.extnID.valueBlock.toString(),El in t.result&&(this.critical=t.result.critical.valueBlock.value),this.extnValue=t.result.extnValue}toSchema(){let e=[];return e.push(new rt({value:this.extnID})),this.critical!==Al.defaultValues(El)&&e.push(new Wi({value:this.critical})),e.push(this.extnValue),new W({value:e})}toJSON(){let e={extnID:this.extnID,extnValue:this.extnValue.toJSON()};return this.critical!==Al.defaultValues(El)&&(e.critical=this.critical),this.parsedValue&&this.parsedValue.toJSON&&(e.parsedValue=this.parsedValue.toJSON()),e}};_i.CLASS_NAME="Extension";var D1="extensions",Ese=[D1],wn=class ZI extends Be{static{o(this,"Extensions")}constructor(e={}){super(),this.extensions=D(e,D1,ZI.defaultValues(D1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case D1:return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,"names",{});return new W({optional:t,name:n.blockName||L,value:[new Tt({name:n.extensions||L,value:_i.schema(n.extension||{})})]})}fromSchema(e){_e(e,Ese);let t=Ie(e,e,ZI.schema({names:{extensions:D1}}));Ae.assertSchema(t,this.className),this.extensions=Array.from(t.result.extensions,n=>new _i({schema:n}))}toSchema(){return new W({value:Array.from(this.extensions,e=>e.toSchema())})}toJSON(){return{extensions:this.extensions.map(e=>e.toJSON())}}};wn.CLASS_NAME="Extensions";var _1="issuer",R1="serialNumber",nf="issuerUID",Ase=[_1,R1,nf],Xa=class P1 extends Be{static{o(this,"IssuerSerial")}constructor(e={}){super(),this.issuer=D(e,_1,P1.defaultValues(_1)),this.serialNumber=D(e,R1,P1.defaultValues(R1)),nf in e&&(this.issuerUID=D(e,nf,P1.defaultValues(nf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case _1:return new Mn;case R1:return new me;case nf:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Mn.schema(t.issuer||{}),new me({name:t.serialNumber||L}),new qt({optional:!0,name:t.issuerUID||L})]})}fromSchema(e){_e(e,Ase);let t=Ie(e,e,P1.schema({names:{issuer:{names:{blockName:_1}},serialNumber:R1,issuerUID:nf}}));Ae.assertSchema(t,this.className),this.issuer=new Mn({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber,nf in t.result&&(this.issuerUID=t.result.issuerUID)}toSchema(){let e=new W({value:[this.issuer.toSchema(),this.serialNumber]});return this.issuerUID&&e.valueBlock.value.push(this.issuerUID),e}toJSON(){let e={issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()};return this.issuerUID&&(e.issuerUID=this.issuerUID.toJSON()),e}};Xa.CLASS_NAME="IssuerSerial";var O1="version",sf="baseCertificateID",af="subjectName",k1="issuer",L1="signature",V1="serialNumber",U1="attrCertValidityPeriod",M1="attributes",of="issuerUniqueID",uf="extensions",Cse=[O1,sf,af,k1,L1,V1,U1,M1,of,uf],IA=class Bi extends Be{static{o(this,"AttributeCertificateInfoV1")}constructor(e={}){super(),this.version=D(e,O1,Bi.defaultValues(O1)),sf in e&&(this.baseCertificateID=D(e,sf,Bi.defaultValues(sf))),af in e&&(this.subjectName=D(e,af,Bi.defaultValues(af))),this.issuer=D(e,k1,Bi.defaultValues(k1)),this.signature=D(e,L1,Bi.defaultValues(L1)),this.serialNumber=D(e,V1,Bi.defaultValues(V1)),this.attrCertValidityPeriod=D(e,U1,Bi.defaultValues(U1)),this.attributes=D(e,M1,Bi.defaultValues(M1)),of in e&&(this.issuerUniqueID=D(e,of,Bi.defaultValues(of))),uf in e&&(this.extensions=D(e,uf,Bi.defaultValues(uf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case O1:return 0;case sf:return new Xa;case af:return new Mn;case k1:return new Mn;case L1:return new ge;case V1:return new me;case U1:return new nh;case M1:return[];case of:return new qt;case uf:return new wn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new Pr({value:[new ae({name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Xa.schema().valueBlock.value}),new ae({name:t.subjectName||L,idBlock:{tagClass:3,tagNumber:1},value:Mn.schema().valueBlock.value})]}),Mn.schema({names:{blockName:t.issuer||L}}),ge.schema(t.signature||{}),new me({name:t.serialNumber||L}),nh.schema(t.attrCertValidityPeriod||{}),new W({name:t.attributes||L,value:[new Tt({value:Zr.schema()})]}),new qt({optional:!0,name:t.issuerUniqueID||L}),wn.schema(t.extensions||{},!0)]})}fromSchema(e){_e(e,Cse);let t=Ie(e,e,Bi.schema({names:{version:O1,baseCertificateID:sf,subjectName:af,issuer:k1,signature:{names:{blockName:L1}},serialNumber:V1,attrCertValidityPeriod:{names:{blockName:U1}},attributes:M1,issuerUniqueID:of,extensions:{names:{blockName:uf}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,sf in t.result&&(this.baseCertificateID=new Xa({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),af in t.result&&(this.subjectName=new Mn({schema:new W({value:t.result.subjectName.valueBlock.value})})),this.issuer=t.result.issuer,this.signature=new ge({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new nh({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new Zr({schema:n})),of in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),uf in t.result&&(this.extensions=new wn({schema:t.result.extensions}))}toSchema(){let e=new W({value:[new me({value:this.version})]});return this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.subjectName&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.subjectName.toSchema().valueBlock.value})),e.valueBlock.value.push(this.issuer.toSchema()),e.valueBlock.value.push(this.signature.toSchema()),e.valueBlock.value.push(this.serialNumber),e.valueBlock.value.push(this.attrCertValidityPeriod.toSchema()),e.valueBlock.value.push(new W({value:Array.from(this.attributes,t=>t.toSchema())})),this.issuerUniqueID&&e.valueBlock.value.push(this.issuerUniqueID),this.extensions&&e.valueBlock.value.push(this.extensions.toSchema()),e}toJSON(){let e={version:this.version};return this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.subjectName&&(e.subjectName=this.subjectName.toJSON()),e.issuer=this.issuer.toJSON(),e.signature=this.signature.toJSON(),e.serialNumber=this.serialNumber.toJSON(),e.attrCertValidityPeriod=this.attrCertValidityPeriod.toJSON(),e.attributes=Array.from(this.attributes,t=>t.toJSON()),this.issuerUniqueID&&(e.issuerUniqueID=this.issuerUniqueID.toJSON()),this.extensions&&(e.extensions=this.extensions.toJSON()),e}};IA.CLASS_NAME="AttributeCertificateInfoV1";var j1="acinfo",F1="signatureAlgorithm",q1="signatureValue",bse=[j1,q1,F1],xC=class H1 extends Be{static{o(this,"AttributeCertificateV1")}constructor(e={}){super(),this.acinfo=D(e,j1,H1.defaultValues(j1)),this.signatureAlgorithm=D(e,F1,H1.defaultValues(F1)),this.signatureValue=D(e,q1,H1.defaultValues(q1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case j1:return new IA;case F1:return new ge;case q1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[IA.schema(t.acinfo||{}),ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signatureValue||L})]})}fromSchema(e){_e(e,bse);let t=Ie(e,e,H1.schema({names:{acinfo:{names:{blockName:j1}},signatureAlgorithm:{names:{blockName:F1}},signatureValue:q1}}));Ae.assertSchema(t,this.className),this.acinfo=new IA({schema:t.result.acinfo}),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new W({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};xC.CLASS_NAME="AttributeCertificateV1";var K1="digestedObjectType",lf="otherObjectTypeID",$1="digestAlgorithm",X1="objectDigest",xse=[K1,lf,$1,X1],sh=class Qp extends Be{static{o(this,"ObjectDigestInfo")}constructor(e={}){super(),this.digestedObjectType=D(e,K1,Qp.defaultValues(K1)),lf in e&&(this.otherObjectTypeID=D(e,lf,Qp.defaultValues(lf))),this.digestAlgorithm=D(e,$1,Qp.defaultValues($1)),this.objectDigest=D(e,X1,Qp.defaultValues(X1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case K1:return new zu;case lf:return new rt;case $1:return new ge;case X1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new zu({name:t.digestedObjectType||L}),new rt({optional:!0,name:t.otherObjectTypeID||L}),ge.schema(t.digestAlgorithm||{}),new qt({name:t.objectDigest||L})]})}fromSchema(e){_e(e,xse);let t=Ie(e,e,Qp.schema({names:{digestedObjectType:K1,otherObjectTypeID:lf,digestAlgorithm:{names:{blockName:$1}},objectDigest:X1}}));Ae.assertSchema(t,this.className),this.digestedObjectType=t.result.digestedObjectType,lf in t.result&&(this.otherObjectTypeID=t.result.otherObjectTypeID),this.digestAlgorithm=new ge({schema:t.result.digestAlgorithm}),this.objectDigest=t.result.objectDigest}toSchema(){let e=new W({value:[this.digestedObjectType]});return this.otherObjectTypeID&&e.valueBlock.value.push(this.otherObjectTypeID),e.valueBlock.value.push(this.digestAlgorithm.toSchema()),e.valueBlock.value.push(this.objectDigest),e}toJSON(){let e={digestedObjectType:this.digestedObjectType.toJSON(),digestAlgorithm:this.digestAlgorithm.toJSON(),objectDigest:this.objectDigest.toJSON()};return this.otherObjectTypeID&&(e.otherObjectTypeID=this.otherObjectTypeID.toJSON()),e}};sh.CLASS_NAME="ObjectDigestInfo";var cf="issuerName",ff="baseCertificateID",hf="objectDigestInfo",Nse=[cf,ff,hf],eB=class G1 extends Be{static{o(this,"V2Form")}constructor(e={}){super(),cf in e&&(this.issuerName=D(e,cf,G1.defaultValues(cf))),ff in e&&(this.baseCertificateID=D(e,ff,G1.defaultValues(ff))),hf in e&&(this.objectDigestInfo=D(e,hf,G1.defaultValues(hf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cf:return new Mn;case ff:return new Xa;case hf:return new sh;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Mn.schema({names:{blockName:t.issuerName}},!0),new ae({optional:!0,name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Xa.schema().valueBlock.value}),new ae({optional:!0,name:t.objectDigestInfo||L,idBlock:{tagClass:3,tagNumber:1},value:sh.schema().valueBlock.value})]})}fromSchema(e){_e(e,Nse);let t=Ie(e,e,G1.schema({names:{issuerName:cf,baseCertificateID:ff,objectDigestInfo:hf}}));Ae.assertSchema(t,this.className),cf in t.result&&(this.issuerName=new Mn({schema:t.result.issuerName})),ff in t.result&&(this.baseCertificateID=new Xa({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),hf in t.result&&(this.objectDigestInfo=new sh({schema:new W({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new W;return this.issuerName&&e.valueBlock.value.push(this.issuerName.toSchema()),this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.objectDigestInfo.toSchema().valueBlock.value})),e}toJSON(){let e={};return this.issuerName&&(e.issuerName=this.issuerName.toJSON()),this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.objectDigestInfo&&(e.objectDigestInfo=this.objectDigestInfo.toJSON()),e}};eB.CLASS_NAME="V2Form";var pf="baseCertificateID",df="entityName",mf="objectDigestInfo",Tse=[pf,df,mf],BA=class W1 extends Be{static{o(this,"Holder")}constructor(e={}){super(),pf in e&&(this.baseCertificateID=D(e,pf,W1.defaultValues(pf))),df in e&&(this.entityName=D(e,df,W1.defaultValues(df))),mf in e&&(this.objectDigestInfo=D(e,mf,W1.defaultValues(mf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pf:return new Xa;case df:return new Mn;case mf:return new sh;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Xa.schema().valueBlock.value}),new ae({optional:!0,name:t.entityName||L,idBlock:{tagClass:3,tagNumber:1},value:Mn.schema().valueBlock.value}),new ae({optional:!0,name:t.objectDigestInfo||L,idBlock:{tagClass:3,tagNumber:2},value:sh.schema().valueBlock.value})]})}fromSchema(e){_e(e,Tse);let t=Ie(e,e,W1.schema({names:{baseCertificateID:pf,entityName:df,objectDigestInfo:mf}}));Ae.assertSchema(t,this.className),pf in t.result&&(this.baseCertificateID=new Xa({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),df in t.result&&(this.entityName=new Mn({schema:new W({value:t.result.entityName.valueBlock.value})})),mf in t.result&&(this.objectDigestInfo=new sh({schema:new W({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new W;return this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.entityName&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.entityName.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:this.objectDigestInfo.toSchema().valueBlock.value})),e}toJSON(){let e={};return this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.entityName&&(e.entityName=this.entityName.toJSON()),this.objectDigestInfo&&(e.objectDigestInfo=this.objectDigestInfo.toJSON()),e}};BA.CLASS_NAME="Holder";var J1="version",z1="holder",Y1="issuer",Q1="signature",Z1="serialNumber",ey="attrCertValidityPeriod",ty="attributes",gf="issuerUniqueID",yf="extensions",Ise=[J1,z1,Y1,Q1,Z1,ey,ty,gf,yf],DA=class Qi extends Be{static{o(this,"AttributeCertificateInfoV2")}constructor(e={}){super(),this.version=D(e,J1,Qi.defaultValues(J1)),this.holder=D(e,z1,Qi.defaultValues(z1)),this.issuer=D(e,Y1,Qi.defaultValues(Y1)),this.signature=D(e,Q1,Qi.defaultValues(Q1)),this.serialNumber=D(e,Z1,Qi.defaultValues(Z1)),this.attrCertValidityPeriod=D(e,ey,Qi.defaultValues(ey)),this.attributes=D(e,ty,Qi.defaultValues(ty)),gf in e&&(this.issuerUniqueID=D(e,gf,Qi.defaultValues(gf))),yf in e&&(this.extensions=D(e,yf,Qi.defaultValues(yf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case J1:return 1;case z1:return new BA;case Y1:return{};case Q1:return new ge;case Z1:return new me;case ey:return new nh;case ty:return[];case gf:return new qt;case yf:return new wn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),BA.schema(t.holder||{}),new Pr({value:[Mn.schema({names:{blockName:t.issuer||L}}),new ae({name:t.issuer||L,idBlock:{tagClass:3,tagNumber:0},value:eB.schema().valueBlock.value})]}),ge.schema(t.signature||{}),new me({name:t.serialNumber||L}),nh.schema(t.attrCertValidityPeriod||{}),new W({name:t.attributes||L,value:[new Tt({value:Zr.schema()})]}),new qt({optional:!0,name:t.issuerUniqueID||L}),wn.schema(t.extensions||{},!0)]})}fromSchema(e){_e(e,Ise);let t=Ie(e,e,Qi.schema({names:{version:J1,holder:{names:{blockName:z1}},issuer:Y1,signature:{names:{blockName:Q1}},serialNumber:Z1,attrCertValidityPeriod:{names:{blockName:ey}},attributes:ty,issuerUniqueID:gf,extensions:{names:{blockName:yf}}}}));switch(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.holder=new BA({schema:t.result.holder}),t.result.issuer.idBlock.tagClass){case 3:this.issuer=new eB({schema:new W({value:t.result.issuer.valueBlock.value})});break;case 1:default:throw new Error("Incorrect value for 'issuer' in AttributeCertificateInfoV2")}this.signature=new ge({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new nh({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new Zr({schema:n})),gf in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),yf in t.result&&(this.extensions=new wn({schema:t.result.extensions}))}toSchema(){let e=new W({value:[new me({value:this.version}),this.holder.toSchema(),new ae({idBlock:{tagClass:3,tagNumber:0},value:this.issuer.toSchema().valueBlock.value}),this.signature.toSchema(),this.serialNumber,this.attrCertValidityPeriod.toSchema(),new W({value:Array.from(this.attributes,t=>t.toSchema())})]});return this.issuerUniqueID&&e.valueBlock.value.push(this.issuerUniqueID),this.extensions&&e.valueBlock.value.push(this.extensions.toSchema()),e}toJSON(){let e={version:this.version,holder:this.holder.toJSON(),issuer:this.issuer.toJSON(),signature:this.signature.toJSON(),serialNumber:this.serialNumber.toJSON(),attrCertValidityPeriod:this.attrCertValidityPeriod.toJSON(),attributes:Array.from(this.attributes,t=>t.toJSON())};return this.issuerUniqueID&&(e.issuerUniqueID=this.issuerUniqueID.toJSON()),this.extensions&&(e.extensions=this.extensions.toJSON()),e}};DA.CLASS_NAME="AttributeCertificateInfoV2";var ry="acinfo",ny="signatureAlgorithm",sy="signatureValue",Bse=[ry,ny,sy],zl=class iy extends Be{static{o(this,"AttributeCertificateV2")}constructor(e={}){super(),this.acinfo=D(e,ry,iy.defaultValues(ry)),this.signatureAlgorithm=D(e,ny,iy.defaultValues(ny)),this.signatureValue=D(e,sy,iy.defaultValues(sy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ry:return new DA;case ny:return new ge;case sy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[DA.schema(t.acinfo||{}),ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signatureValue||L})]})}fromSchema(e){_e(e,Bse);let t=Ie(e,e,iy.schema({names:{acinfo:{names:{blockName:ry}},signatureAlgorithm:{names:{blockName:ny}},signatureValue:sy}}));Ae.assertSchema(t,this.className),this.acinfo=new DA({schema:t.result.acinfo}),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new W({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};zl.CLASS_NAME="AttributeCertificateV2";var vf="contentType",Zp="content",Dse=[vf,Zp],Gr=class _A extends Be{static{o(this,"ContentInfo")}constructor(e={}){super(),this.contentType=D(e,vf,_A.defaultValues(vf)),this.content=D(e,Zp,_A.defaultValues(Zp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case vf:return L;case Zp:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case vf:return typeof t=="string"&&t===this.defaultValues(vf);case Zp:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return"optional"in t||(t.optional=!1),new W({name:t.blockName||"ContentInfo",optional:t.optional,value:[new rt({name:t.contentType||vf}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.content||Zp})]})]})}fromSchema(e){_e(e,Dse);let t=Ie(e,e,_A.schema());Ae.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.content=t.result.content}toSchema(){return new W({value:[new rt({value:this.contentType}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.content]})]})}toJSON(){let e={contentType:this.contentType};return this.content instanceof St||(e.content=this.content.toJSON()),e}};Gr.CLASS_NAME="ContentInfo";Gr.DATA=VB;Gr.SIGNED_DATA=C6;Gr.ENVELOPED_DATA=b6;Gr.ENCRYPTED_DATA=x6;var oI="type",uI="value",tB="utcTimeName",rB="generalTimeName",_se=[tB,rB],u6;(function(r){r[r.UTCTime=0]="UTCTime",r[r.GeneralizedTime=1]="GeneralizedTime",r[r.empty=2]="empty"})(u6||(u6={}));var jn=class RA extends Be{static{o(this,"Time")}constructor(e={}){super(),this.type=D(e,oI,RA.defaultValues(oI)),this.value=D(e,uI,RA.defaultValues(uI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case oI:return 0;case uI:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,"names",{});return new Pr({optional:t,value:[new kc({name:n.utcTimeName||L}),new Rr({name:n.generalTimeName||L})]})}fromSchema(e){_e(e,_se);let t=Ie(e,e,RA.schema({names:{utcTimeName:tB,generalTimeName:rB}}));Ae.assertSchema(t,this.className),tB in t.result&&(this.type=0,this.value=t.result.utcTimeName.toDate()),rB in t.result&&(this.type=1,this.value=t.result.generalTimeName.toDate())}toSchema(){return this.type===0?new kc({valueDate:this.value}):this.type===1?new Rr({valueDate:this.value}):{}}toJSON(){return{type:this.type,value:this.value}}};jn.CLASS_NAME="Time";var lI="tbs",Cl="version",PA="serialNumber",OA="signature",kA="issuer",LA="notBefore",VA="notAfter",UA="subject",MA="subjectPublicKeyInfo",ay="issuerUniqueID",oy="subjectUniqueID",uy="extensions",ly="signatureAlgorithm",cy="signatureValue",Qs="tbsCertificate",NC=`${Qs}.${Cl}`,FB=`${Qs}.${PA}`,qB=`${Qs}.${OA}`,HB=`${Qs}.${kA}`,TC=`${Qs}.${LA}`,IC=`${Qs}.${VA}`,KB=`${Qs}.${UA}`,$B=`${Qs}.${MA}`,BC=`${Qs}.${ay}`,DC=`${Qs}.${oy}`,rv=`${Qs}.${uy}`,Rse=[Qs,NC,FB,qB,HB,TC,IC,KB,$B,BC,DC,rv,ly,cy];function Pse(r={}){let e=D(r,"names",{});return new W({name:e.blockName||Qs,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:e.tbsCertificateVersion||NC})]}),new me({name:e.tbsCertificateSerialNumber||FB}),ge.schema(e.signature||{names:{blockName:qB}}),Or.schema(e.issuer||{names:{blockName:HB}}),new W({name:e.tbsCertificateValidity||"tbsCertificate.validity",value:[jn.schema(e.notBefore||{names:{utcTimeName:TC,generalTimeName:TC}}),jn.schema(e.notAfter||{names:{utcTimeName:IC,generalTimeName:IC}})]}),Or.schema(e.subject||{names:{blockName:KB}}),na.schema(e.subjectPublicKeyInfo||{names:{blockName:$B}}),new yt({name:e.tbsCertificateIssuerUniqueID||BC,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new yt({name:e.tbsCertificateSubjectUniqueID||DC,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[wn.schema(e.extensions||{names:{blockName:rv}})]})]})}o(Pse,"tbsCertificate");var ts=class vn extends Be{static{o(this,"Certificate")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,lI,vn.defaultValues(lI))),this.version=D(e,Cl,vn.defaultValues(Cl)),this.serialNumber=D(e,PA,vn.defaultValues(PA)),this.signature=D(e,OA,vn.defaultValues(OA)),this.issuer=D(e,kA,vn.defaultValues(kA)),this.notBefore=D(e,LA,vn.defaultValues(LA)),this.notAfter=D(e,VA,vn.defaultValues(VA)),this.subject=D(e,UA,vn.defaultValues(UA)),this.subjectPublicKeyInfo=D(e,MA,vn.defaultValues(MA)),ay in e&&(this.issuerUniqueID=D(e,ay,vn.defaultValues(ay))),oy in e&&(this.subjectUniqueID=D(e,oy,vn.defaultValues(oy))),uy in e&&(this.extensions=D(e,uy,vn.defaultValues(uy))),this.signatureAlgorithm=D(e,ly,vn.defaultValues(ly)),this.signatureValue=D(e,cy,vn.defaultValues(cy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case lI:return Qr;case Cl:return 0;case PA:return new me;case OA:return new ge;case kA:return new Or;case LA:return new jn;case VA:return new jn;case UA:return new Or;case MA:return new na;case ay:return Qr;case oy:return Qr;case uy:return[];case ly:return new ge;case cy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Pse(t.tbsCertificate),ge.schema(t.signatureAlgorithm||{names:{blockName:ly}}),new qt({name:t.signatureValue||cy})]})}fromSchema(e){_e(e,Rse);let t=Ie(e,e,vn.schema({names:{tbsCertificate:{names:{extensions:{names:{extensions:rv}}}}}}));Ae.assertSchema(t,this.className),this.tbsView=t.result.tbsCertificate.valueBeforeDecodeView,NC in t.result&&(this.version=t.result[NC].valueBlock.valueDec),this.serialNumber=t.result[FB],this.signature=new ge({schema:t.result[qB]}),this.issuer=new Or({schema:t.result[HB]}),this.notBefore=new jn({schema:t.result[TC]}),this.notAfter=new jn({schema:t.result[IC]}),this.subject=new Or({schema:t.result[KB]}),this.subjectPublicKeyInfo=new na({schema:t.result[$B]}),BC in t.result&&(this.issuerUniqueID=t.result[BC].valueBlock.valueHex),DC in t.result&&(this.subjectUniqueID=t.result[DC].valueBlock.valueHex),rv in t.result&&(this.extensions=Array.from(t.result[rv],n=>new _i({schema:n}))),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return Cl in this&&this.version!==vn.defaultValues(Cl)&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),e.push(this.serialNumber),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(new W({value:[this.notBefore.toSchema(),this.notAfter.toSchema()]})),e.push(this.subject.toSchema()),e.push(this.subjectPublicKeyInfo.toSchema()),this.issuerUniqueID&&e.push(new yt({optional:!0,idBlock:{tagClass:3,tagNumber:1},valueHex:this.issuerUniqueID})),this.subjectUniqueID&&e.push(new yt({optional:!0,idBlock:{tagClass:3,tagNumber:2},valueHex:this.subjectUniqueID})),this.extensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[new W({value:Array.from(this.extensions,t=>t.toSchema())})]})),new W({value:e})}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return vn.schema().value[0];let n=Hr(this.tbsView);Ae.assert(n,"TBS Certificate"),t=n.result}else t=this.encodeTBS();return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,serialNumber:this.serialNumber.toJSON(),signature:this.signature.toJSON(),issuer:this.issuer.toJSON(),notBefore:this.notBefore.toJSON(),notAfter:this.notAfter.toJSON(),subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return Cl in this&&this.version!==vn.defaultValues(Cl)&&(e.version=this.version),this.issuerUniqueID&&(e.issuerUniqueID=Ct.ToHex(this.issuerUniqueID)),this.subjectUniqueID&&(e.subjectUniqueID=Ct.ToHex(this.subjectUniqueID)),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async getPublicKey(e,t=_t(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}async getKeyHash(e="SHA-1",t=_t(!0)){return t.digest({name:e},this.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView)}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters;this.signature=s.signatureAlgorithm,this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new qt({valueHex:a})}async verify(e,t=_t(!0)){let n;if(e?n=e.subjectPublicKeyInfo:this.issuer.isEqual(this.subject)&&(n=this.subjectPublicKeyInfo),!(n instanceof na))throw new Error("Please provide issuer certificate as a parameter");return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};ts.CLASS_NAME="Certificate";function H6(r,e=null){if(e&&r.issuer.isEqual(e.issuer)&&r.serialNumber.isEqual(e.serialNumber))return null;let t=!1;if(r.extensions){for(let n of r.extensions)if(n.extnID===PB&&n.parsedValue instanceof jB&&n.parsedValue.cA){t=!0;break}}return t?r:null}o(H6,"checkCA");var ed="certId",td="certValue",_p="parsedValue",Ose=[ed,td],K6=class fy extends Be{static{o(this,"CertBag")}constructor(e={}){super(),this.certId=D(e,ed,fy.defaultValues(ed)),this.certValue=D(e,td,fy.defaultValues(td)),_p in e&&(this.parsedValue=D(e,_p,fy.defaultValues(_p))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ed:return L;case td:return new St;case _p:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ed:return t===L;case td:return t instanceof St;case _p:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,Ose);let t=Ie(e,e,fy.schema({names:{id:ed,value:td}}));Ae.assertSchema(t,this.className),this.certId=t.result.certId.valueBlock.toString(),this.certValue=t.result.certValue;let n=this.certValue.valueBlock.valueHexView;switch(this.certId){case KU:try{this.parsedValue=ts.fromBER(n)}catch{zl.fromBER(n)}break;case $U:this.parsedValue=zl.fromBER(n);break;case Vne:default:throw new Error(`Incorrect CERT_ID value in CertBag: ${this.certId}`)}}toSchema(){return _p in this&&("acinfo"in this.parsedValue?this.certId=$U:this.certId=KU,this.certValue=new Ve({valueHex:this.parsedValue.toSchema().toBER(!1)})),new W({value:[new rt({value:this.certId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:["toSchema"in this.certValue?this.certValue.toSchema():this.certValue]})]})}toJSON(){return{certId:this.certId,certValue:this.certValue.toJSON()}}};K6.CLASS_NAME="CertBag";var hy="userCertificate",rd="revocationDate",wf="crlEntryExtensions",kse=[hy,rd,wf],$6=class py extends Be{static{o(this,"RevokedCertificate")}constructor(e={}){super(),this.userCertificate=D(e,hy,py.defaultValues(hy)),this.revocationDate=D(e,rd,py.defaultValues(rd)),wf in e&&(this.crlEntryExtensions=D(e,wf,py.defaultValues(wf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case hy:return new me;case rd:return new jn;case wf:return new wn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.userCertificate||hy}),jn.schema({names:{utcTimeName:t.revocationDate||rd,generalTimeName:t.revocationDate||rd}}),wn.schema({names:{blockName:t.crlEntryExtensions||wf}},!0)]})}fromSchema(e){_e(e,kse);let t=Ie(e,e,py.schema());Ae.assertSchema(t,this.className),this.userCertificate=t.result.userCertificate,this.revocationDate=new jn({schema:t.result.revocationDate}),wf in t.result&&(this.crlEntryExtensions=new wn({schema:t.result.crlEntryExtensions}))}toSchema(){let e=[this.userCertificate,this.revocationDate.toSchema()];return this.crlEntryExtensions&&e.push(this.crlEntryExtensions.toSchema()),new W({value:e})}toJSON(){let e={userCertificate:this.userCertificate.toJSON(),revocationDate:this.revocationDate.toJSON()};return this.crlEntryExtensions&&(e.crlEntryExtensions=this.crlEntryExtensions.toJSON()),e}};$6.CLASS_NAME="RevokedCertificate";var cI="tbs",Cg="version",fI="signature",hI="issuer",pI="thisUpdate",XE="nextUpdate",GE="revokedCertificates",WE="crlExtensions",dy="signatureAlgorithm",my="signatureValue",Jo="tbsCertList",_C=`${Jo}.version`,XB=`${Jo}.signature`,GB=`${Jo}.issuer`,RC=`${Jo}.thisUpdate`,cv=`${Jo}.nextUpdate`,PC=`${Jo}.revokedCertificates`,OC=`${Jo}.extensions`,Lse=[Jo,_C,XB,GB,RC,cv,PC,OC,dy,my];function Vse(r={}){let e=D(r,"names",{});return new W({name:e.blockName||Jo,value:[new me({optional:!0,name:e.tbsCertListVersion||_C,value:2}),ge.schema(e.signature||{names:{blockName:XB}}),Or.schema(e.issuer||{names:{blockName:GB}}),jn.schema(e.tbsCertListThisUpdate||{names:{utcTimeName:RC,generalTimeName:RC}}),jn.schema(e.tbsCertListNextUpdate||{names:{utcTimeName:cv,generalTimeName:cv}},!0),new W({optional:!0,value:[new Tt({name:e.tbsCertListRevokedCertificates||PC,value:new W({value:[new me,jn.schema(),wn.schema({},!0)]})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[wn.schema(e.crlExtensions||{names:{blockName:OC}})]})]})}o(Vse,"tbsCertList");var Use=[kB,m6,bne,xne,g6,OB,LB,Nne,Tne,y6],fv=class ds extends Be{static{o(this,"CertificateRevocationList")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,cI,ds.defaultValues(cI))),this.version=D(e,Cg,ds.defaultValues(Cg)),this.signature=D(e,fI,ds.defaultValues(fI)),this.issuer=D(e,hI,ds.defaultValues(hI)),this.thisUpdate=D(e,pI,ds.defaultValues(pI)),XE in e&&(this.nextUpdate=D(e,XE,ds.defaultValues(XE))),GE in e&&(this.revokedCertificates=D(e,GE,ds.defaultValues(GE))),WE in e&&(this.crlExtensions=D(e,WE,ds.defaultValues(WE))),this.signatureAlgorithm=D(e,dy,ds.defaultValues(dy)),this.signatureValue=D(e,my,ds.defaultValues(my)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cI:return Qr;case Cg:return 0;case fI:return new ge;case hI:return new Or;case pI:return new jn;case XE:return new jn;case GE:return[];case WE:return new wn;case dy:return new ge;case my:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"CertificateList",value:[Vse(e),ge.schema(t.signatureAlgorithm||{names:{blockName:dy}}),new qt({name:t.signatureValue||my})]})}fromSchema(e){_e(e,Lse);let t=Ie(e,e,ds.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.tbsCertList.valueBeforeDecodeView,_C in t.result&&(this.version=t.result[_C].valueBlock.valueDec),this.signature=new ge({schema:t.result[XB]}),this.issuer=new Or({schema:t.result[GB]}),this.thisUpdate=new jn({schema:t.result[RC]}),cv in t.result&&(this.nextUpdate=new jn({schema:t.result[cv]})),PC in t.result&&(this.revokedCertificates=Array.from(t.result[PC],n=>new $6({schema:n}))),OC in t.result&&(this.crlExtensions=new wn({schema:t.result[OC]})),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return this.version!==ds.defaultValues(Cg)&&e.push(new me({value:this.version})),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(this.thisUpdate.toSchema()),this.nextUpdate&&e.push(this.nextUpdate.toSchema()),this.revokedCertificates&&e.push(new W({value:Array.from(this.revokedCertificates,t=>t.toSchema())})),this.crlExtensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.crlExtensions.toSchema()]})),new W({value:e})}toSchema(e=!1){let t;if(e)t=this.encodeTBS();else{if(!this.tbsView.byteLength)return ds.schema();let n=Hr(this.tbsView);Ae.assert(n,"TBS Certificate Revocation List"),t=n.result}return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,signature:this.signature.toJSON(),issuer:this.issuer.toJSON(),thisUpdate:this.thisUpdate.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return this.version!==ds.defaultValues(Cg)&&(e.version=this.version),this.nextUpdate&&(e.nextUpdate=this.nextUpdate.toJSON()),this.revokedCertificates&&(e.revokedCertificates=Array.from(this.revokedCertificates,t=>t.toJSON())),this.crlExtensions&&(e.crlExtensions=this.crlExtensions.toJSON()),e}isCertificateRevoked(e){if(!this.issuer.isEqual(e.issuer)||!this.revokedCertificates)return!1;for(let t of this.revokedCertificates)if(t.userCertificate.isEqual(e.serialNumber))return!0;return!1}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),{parameters:i}=s;this.signature=s.signatureAlgorithm,this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new qt({valueHex:a})}async verify(e={},t=_t(!0)){let n;if(e.issuerCertificate&&(n=e.issuerCertificate.subjectPublicKeyInfo,!this.issuer.isEqual(e.issuerCertificate.subject)))return!1;if(e.publicKeyInfo&&(n=e.publicKeyInfo),!n)throw new Error("Issuer's certificate must be provided as an input parameter");if(this.crlExtensions){for(let s of this.crlExtensions.extensions)if(s.critical&&!Use.includes(s.extnID))return!1}return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};fv.CLASS_NAME="CertificateRevocationList";var nd="crlId",sd="crlValue",bg="parsedValue",Mse=[nd,sd],X6=class gy extends Be{static{o(this,"CRLBag")}constructor(e={}){super(),this.crlId=D(e,nd,gy.defaultValues(nd)),this.crlValue=D(e,sd,gy.defaultValues(sd)),bg in e&&(this.parsedValue=D(e,bg,gy.defaultValues(bg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case nd:return L;case sd:return new St;case bg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case nd:return t===L;case sd:return t instanceof St;case bg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,Mse);let t=Ie(e,e,gy.schema({names:{id:nd,value:sd}}));switch(Ae.assertSchema(t,this.className),this.crlId=t.result.crlId.valueBlock.toString(),this.crlValue=t.result.crlValue,this.crlId){case XU:this.parsedValue=fv.fromBER(this.certValue.valueBlock.valueHex);break;default:throw new Error(`Incorrect CRL_ID value in CRLBag: ${this.crlId}`)}}toSchema(){return this.parsedValue&&(this.crlId=XU,this.crlValue=new Ve({valueHex:this.parsedValue.toSchema().toBER(!1)})),new W({value:[new rt({value:this.crlId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.crlValue.toSchema()]})]})}toJSON(){return{crlId:this.crlId,crlValue:this.crlValue.toJSON()}}};X6.CLASS_NAME="CRLBag";var id="version",ad="encryptedContentInfo",bl="unprotectedAttrs",jse=[id,ad,bl],hv=class yy extends Be{static{o(this,"EncryptedData")}constructor(e={}){super(),this.version=D(e,id,yy.defaultValues(id)),this.encryptedContentInfo=D(e,ad,yy.defaultValues(ad)),bl in e&&(this.unprotectedAttrs=D(e,bl,yy.defaultValues(bl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case id:return 0;case ad:return new es;case bl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case id:return t===0;case ad:return es.compareWithDefault("contentType",t.contentType)&&es.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&es.compareWithDefault("encryptedContent",t.encryptedContent);case bl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),es.schema(t.encryptedContentInfo||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.unprotectedAttrs||L,value:Zr.schema()})]})]})}fromSchema(e){_e(e,jse);let t=Ie(e,e,yy.schema({names:{version:id,encryptedContentInfo:{names:{blockName:ad}},unprotectedAttrs:bl}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.encryptedContentInfo=new es({schema:t.result.encryptedContentInfo}),bl in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new Zr({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,encryptedContentInfo:this.encryptedContentInfo.toJSON()};return this.unprotectedAttrs&&(e.unprotectedAttrs=Array.from(this.unprotectedAttrs,t=>t.toJSON())),e}async encrypt(e,t=_t(!0)){Er.assert(e,"parameters","object");let n={...e,contentType:"1.2.840.113549.1.7.1"};this.encryptedContentInfo=await t.encryptEncryptedContentInfo(n)}async decrypt(e,t=_t(!0)){Er.assert(e,"parameters","object");let n={...e,encryptedContentInfo:this.encryptedContentInfo};return t.decryptEncryptedContentInfo(n)}};hv.CLASS_NAME="EncryptedData";var Sf="encryptionAlgorithm",xl="encryptedData",xg="parsedValue",Fse=[Sf,xl],G6=class od extends Be{static{o(this,"PKCS8ShroudedKeyBag")}constructor(e={}){super(),this.encryptionAlgorithm=D(e,Sf,od.defaultValues(Sf)),this.encryptedData=D(e,xl,od.defaultValues(xl)),xg in e&&(this.parsedValue=D(e,xg,od.defaultValues(xg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sf:return new ge;case xl:return new Ve;case xg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Sf:return ge.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case xl:return t.isEqual(od.defaultValues(e));case xg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.encryptionAlgorithm||{names:{blockName:Sf}}),new Pr({value:[new Ve({name:t.encryptedData||xl}),new Ve({idBlock:{isConstructed:!0},name:t.encryptedData||xl})]})]})}fromSchema(e){_e(e,Fse);let t=Ie(e,e,od.schema({names:{encryptionAlgorithm:{names:{blockName:Sf}},encryptedData:xl}}));Ae.assertSchema(t,this.className),this.encryptionAlgorithm=new ge({schema:t.result.encryptionAlgorithm}),this.encryptedData=t.result.encryptedData}toSchema(){return new W({value:[this.encryptionAlgorithm.toSchema(),this.encryptedData]})}toJSON(){return{encryptionAlgorithm:this.encryptionAlgorithm.toJSON(),encryptedData:this.encryptedData.toJSON()}}async parseInternalValues(e,t=_t(!0)){let s=await new hv({encryptedContentInfo:new es({contentEncryptionAlgorithm:this.encryptionAlgorithm,encryptedContent:this.encryptedData})}).decrypt(e,t);this.parsedValue=lv.fromBER(s)}async makeInternalValues(e,t=_t(!0)){if(!this.parsedValue)throw new Error('Please initialize "parsedValue" first');let n=new hv,s={...e,contentToEncrypt:this.parsedValue.toSchema().toBER(!1)};if(await n.encrypt(s,t),!n.encryptedContentInfo.encryptedContent)throw new Error("The filed `encryptedContent` in EncryptedContentInfo is empty");this.encryptionAlgorithm=n.encryptedContentInfo.contentEncryptionAlgorithm,this.encryptedData=n.encryptedContentInfo.encryptedContent}};G6.CLASS_NAME="PKCS8ShroudedKeyBag";var ud="secretTypeId",ld="secretValue",qse=[ud,ld],W6=class jA extends Be{static{o(this,"SecretBag")}constructor(e={}){super(),this.secretTypeId=D(e,ud,jA.defaultValues(ud)),this.secretValue=D(e,ld,jA.defaultValues(ld)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ud:return L;case ld:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ud:return t===L;case ld:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,qse);let t=Ie(e,e,jA.schema({names:{id:ud,value:ld}}));Ae.assertSchema(t,this.className),this.secretTypeId=t.result.secretTypeId.valueBlock.toString(),this.secretValue=t.result.secretValue}toSchema(){return new W({value:[new rt({value:this.secretTypeId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.secretValue.toSchema()]})]})}toJSON(){return{secretTypeId:this.secretTypeId,secretValue:this.secretValue.toJSON()}}};W6.CLASS_NAME="SecretBag";var Hse=class Ef{static{o(this,"SafeBagValueFactory")}static getItems(){return this.items||(this.items={},Ef.register("1.2.840.113549.1.12.10.1.1",lv),Ef.register("1.2.840.113549.1.12.10.1.2",G6),Ef.register("1.2.840.113549.1.12.10.1.3",K6),Ef.register("1.2.840.113549.1.12.10.1.4",X6),Ef.register("1.2.840.113549.1.12.10.1.5",W6),Ef.register("1.2.840.113549.1.12.10.1.6",g0)),this.items}static register(e,t){this.getItems()[e]=t}static find(e){return this.getItems()[e]||null}},Af="bagId",Cf="bagValue",Vo="bagAttributes",Kse=[Af,Cf,Vo],nB=class vy extends Be{static{o(this,"SafeBag")}constructor(e={}){super(),this.bagId=D(e,Af,vy.defaultValues(Af)),this.bagValue=D(e,Cf,vy.defaultValues(Cf)),Vo in e&&(this.bagAttributes=D(e,Vo,vy.defaultValues(Vo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Af:return L;case Cf:return new St;case Vo:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Af:return t===L;case Cf:return t instanceof St;case Vo:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.bagId||Af}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.bagValue||Cf})]}),new $r({optional:!0,value:[new Tt({name:t.bagAttributes||Vo,value:Zr.schema()})]})]})}fromSchema(e){_e(e,Kse);let t=Ie(e,e,vy.schema({names:{bagId:Af,bagValue:Cf,bagAttributes:Vo}}));Ae.assertSchema(t,this.className),this.bagId=t.result.bagId.valueBlock.toString();let n=Hse.find(this.bagId);if(!n)throw new Error(`Invalid BAG_ID for SafeBag: ${this.bagId}`);this.bagValue=new n({schema:t.result.bagValue}),Vo in t.result&&(this.bagAttributes=Array.from(t.result.bagAttributes,s=>new Zr({schema:s})))}toSchema(){let e=[new rt({value:this.bagId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.bagValue.toSchema()]})];return this.bagAttributes&&e.push(new $r({value:Array.from(this.bagAttributes,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={bagId:this.bagId,bagValue:this.bagValue.toJSON()};return this.bagAttributes&&(e.bagAttributes=Array.from(this.bagAttributes,t=>t.toJSON())),e}};nB.CLASS_NAME="SafeBag";var Rp="safeBags",g0=class sB extends Be{static{o(this,"SafeContents")}constructor(e={}){super(),this.safeBags=D(e,Rp,sB.defaultValues(Rp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Rp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.safeBags||L,value:nB.schema()})]})}fromSchema(e){_e(e,[Rp]);let t=Ie(e,e,sB.schema({names:{safeBags:Rp}}));Ae.assertSchema(t,this.className),this.safeBags=Array.from(t.result.safeBags,n=>new nB({schema:n}))}toSchema(){return new W({value:Array.from(this.safeBags,e=>e.toSchema())})}toJSON(){return{safeBags:Array.from(this.safeBags,e=>e.toJSON())}}};g0.CLASS_NAME="SafeContents";var wy="otherCertFormat",Sy="otherCert",$se=[wy,Sy],FA=class qA extends Be{static{o(this,"OtherCertificateFormat")}constructor(e={}){super(),this.otherCertFormat=D(e,wy,qA.defaultValues(wy)),this.otherCert=D(e,Sy,qA.defaultValues(Sy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wy:return L;case Sy:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.otherCertFormat||wy}),new St({name:t.otherCert||Sy})]})}fromSchema(e){_e(e,$se);let t=Ie(e,e,qA.schema());Ae.assertSchema(t,this.className),this.otherCertFormat=t.result.otherCertFormat.valueBlock.toString(),this.otherCert=t.result.otherCert}toSchema(){return new W({value:[new rt({value:this.otherCertFormat}),this.otherCert]})}toJSON(){let e={otherCertFormat:this.otherCertFormat};return this.otherCert instanceof St||(e.otherCert=this.otherCert.toJSON()),e}},Ey="certificates",Xse=[Ey],ih=class iB extends Be{static{o(this,"CertificateSet")}constructor(e={}){super(),this.certificates=D(e,Ey,iB.defaultValues(Ey)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ey:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new $r({name:t.blockName||L,value:[new Tt({name:t.certificates||Ey,value:new Pr({value:[ts.schema(),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St]}),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W]}),new ae({idBlock:{tagClass:3,tagNumber:2},value:zl.schema().valueBlock.value}),new ae({idBlock:{tagClass:3,tagNumber:3},value:FA.schema().valueBlock.value})]})})]})}fromSchema(e){_e(e,Xse);let t=Ie(e,e,iB.schema());Ae.assertSchema(t,this.className),this.certificates=Array.from(t.result.certificates||[],n=>{let s=n.idBlock.tagNumber;if(n.idBlock.tagClass===1)return new ts({schema:n});let i=new W({value:n.valueBlock.value});switch(s){case 1:return i.valueBlock.value[0].valueBlock.value[0].valueBlock.valueDec===1?new zl({schema:i}):new xC({schema:i});case 2:return new zl({schema:i});case 3:return new FA({schema:i})}return n})}toSchema(){return new $r({value:Array.from(this.certificates,e=>{switch(!0){case e instanceof ts:return e.toSchema();case e instanceof xC:return new ae({idBlock:{tagClass:3,tagNumber:1},value:e.toSchema().valueBlock.value});case e instanceof zl:return new ae({idBlock:{tagClass:3,tagNumber:2},value:e.toSchema().valueBlock.value});case e instanceof FA:return new ae({idBlock:{tagClass:3,tagNumber:3},value:e.toSchema().valueBlock.value})}return e.toSchema()})})}toJSON(){return{certificates:Array.from(this.certificates,e=>e.toJSON())}}};ih.CLASS_NAME="CertificateSet";var Ay="otherRevInfoFormat",Cy="otherRevInfo",Gse=[Ay,Cy],nv=class HA extends Be{static{o(this,"OtherRevocationInfoFormat")}constructor(e={}){super(),this.otherRevInfoFormat=D(e,Ay,HA.defaultValues(Ay)),this.otherRevInfo=D(e,Cy,HA.defaultValues(Cy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ay:return L;case Cy:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.otherRevInfoFormat||Ay}),new St({name:t.otherRevInfo||Cy})]})}fromSchema(e){_e(e,Gse);let t=Ie(e,e,HA.schema());Ae.assertSchema(t,this.className),this.otherRevInfoFormat=t.result.otherRevInfoFormat.valueBlock.toString(),this.otherRevInfo=t.result.otherRevInfo}toSchema(){return new W({value:[new rt({value:this.otherRevInfoFormat}),this.otherRevInfo]})}toJSON(){let e={otherRevInfoFormat:this.otherRevInfoFormat};return this.otherRevInfo instanceof St||(e.otherRevInfo=this.otherRevInfo.toJSON()),e}};nv.CLASS_NAME="OtherRevocationInfoFormat";var by="crls",dI="otherRevocationInfos",Wse=[by],sv=class KA extends Be{static{o(this,"RevocationInfoChoices")}constructor(e={}){super(),this.crls=D(e,by,KA.defaultValues(by)),this.otherRevocationInfos=D(e,dI,KA.defaultValues(dI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case by:return[];case dI:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new $r({name:t.blockName||L,value:[new Tt({name:t.crls||L,value:new Pr({value:[fv.schema(),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new rt,new St]})]})})]})}fromSchema(e){_e(e,Wse);let t=Ie(e,e,KA.schema({names:{crls:by}}));if(Ae.assertSchema(t,this.className),t.result.crls)for(let n of t.result.crls)n.idBlock.tagClass===1?this.crls.push(new fv({schema:n})):this.otherRevocationInfos.push(new nv({schema:n}))}toSchema(){let e=[];return e.push(...Array.from(this.crls,t=>t.toSchema())),e.push(...Array.from(this.otherRevocationInfos,t=>{let n=t.toSchema();return n.idBlock.tagClass=3,n.idBlock.tagNumber=1,n})),new $r({value:e})}toJSON(){return{crls:Array.from(this.crls,e=>e.toJSON()),otherRevocationInfos:Array.from(this.otherRevocationInfos,e=>e.toJSON())}}};sv.CLASS_NAME="RevocationInfoChoices";var xy="certs",bf="crls",Jse=[xy,bf],$A=class aB extends Be{static{o(this,"OriginatorInfo")}constructor(e={}){super(),this.crls=D(e,bf,aB.defaultValues(bf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xy:return new ih;case bf:return new sv;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case xy:return t.certificates.length===0;case bf:return t.crls.length===0&&t.otherRevocationInfos.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({name:t.certs||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ih.schema().valueBlock.value}),new ae({name:t.crls||L,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:sv.schema().valueBlock.value})]})}fromSchema(e){_e(e,Jse);let t=Ie(e,e,aB.schema({names:{certs:xy,crls:bf}}));Ae.assertSchema(t,this.className),xy in t.result&&(this.certs=new ih({schema:new $r({value:t.result.certs.valueBlock.value})})),bf in t.result&&(this.crls=new sv({schema:new $r({value:t.result.crls.valueBlock.value})}))}toSchema(){let e=[];return this.certs&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.certs.toSchema().valueBlock.value})),this.crls&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.crls.toSchema().valueBlock.value})),new W({value:e})}toJSON(){let e={};return this.certs&&(e.certs=this.certs.toJSON()),this.crls&&(e.crls=this.crls.toJSON()),e}};$A.CLASS_NAME="OriginatorInfo";var Ny="issuer",Ty="serialNumber",zse=[Ny,Ty],Fn=class XA extends Be{static{o(this,"IssuerAndSerialNumber")}constructor(e={}){super(),this.issuer=D(e,Ny,XA.defaultValues(Ny)),this.serialNumber=D(e,Ty,XA.defaultValues(Ty)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ny:return new Or;case Ty:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Or.schema(t.issuer||{}),new me({name:t.serialNumber||L})]})}fromSchema(e){_e(e,zse);let t=Ie(e,e,XA.schema({names:{issuer:{names:{blockName:Ny}},serialNumber:Ty}}));Ae.assertSchema(t,this.className),this.issuer=new Or({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber}toSchema(){return new W({value:[this.issuer.toSchema(),this.serialNumber]})}toJSON(){return{issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()}}};Fn.CLASS_NAME="IssuerAndSerialNumber";var JE="variant",Ng="value",Yse=["blockName"],J6=class GA extends Be{static{o(this,"RecipientIdentifier")}constructor(e={}){super(),this.variant=D(e,JE,GA.defaultValues(JE)),Ng in e&&(this.value=D(e,Ng,GA.defaultValues(Ng))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case JE:return-1;case Ng:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case JE:return t===-1;case Ng:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[Fn.schema({names:{blockName:t.blockName||L}}),new yt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:0}})]})}fromSchema(e){_e(e,Yse);let t=Ie(e,e,GA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new Fn({schema:t.result.blockName})):(this.variant=2,this.value=new Ve({valueHex:t.result.blockName.valueBlock.valueHex}))}toSchema(){switch(this.variant){case 1:if(!(this.value instanceof Fn))throw new Error("Incorrect type of RecipientIdentifier.value. It should be IssuerAndSerialNumber.");return this.value.toSchema();case 2:if(!(this.value instanceof Ve))throw new Error("Incorrect type of RecipientIdentifier.value. It should be ASN.1 OctetString.");return new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.value.valueBlock.valueHexView});default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&this.value&&(e.value=this.value.toJSON()),e}};J6.CLASS_NAME="RecipientIdentifier";var xf="version",cd="rid",fd="keyEncryptionAlgorithm",hd="encryptedKey",zE="recipientCertificate",Qse=[xf,cd,fd,hd],kC=class Uo extends Be{static{o(this,"KeyTransRecipientInfo")}constructor(e={}){super(),this.version=D(e,xf,Uo.defaultValues(xf)),this.rid=D(e,cd,Uo.defaultValues(cd)),this.keyEncryptionAlgorithm=D(e,fd,Uo.defaultValues(fd)),this.encryptedKey=D(e,hd,Uo.defaultValues(hd)),this.recipientCertificate=D(e,zE,Uo.defaultValues(zE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xf:return-1;case cd:return{};case fd:return new ge;case hd:return new Ve;case zE:return new ts;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case xf:return t===Uo.defaultValues(xf);case cd:return Object.keys(t).length===0;case fd:case hd:return t.isEqual(Uo.defaultValues(e));case zE:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),J6.schema(t.rid||{}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,Qse);let t=Ie(e,e,Uo.schema({names:{version:xf,rid:{names:{blockName:cd}},keyEncryptionAlgorithm:{names:{blockName:fd}},encryptedKey:hd}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,t.result.rid.idBlock.tagClass===3?this.rid=new Ve({valueHex:t.result.rid.valueBlock.valueHex}):this.rid=new Fn({schema:t.result.rid}),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return this.rid instanceof Fn?(this.version=0,e.push(new me({value:this.version})),e.push(this.rid.toSchema())):(this.version=2,e.push(new me({value:this.version})),e.push(new yt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.rid.valueBlock.valueHexView}))),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new W({value:e})}toJSON(){return{version:this.version,rid:this.rid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};kC.CLASS_NAME="KeyTransRecipientInfo";var pd="algorithm",dd="publicKey",Zse=[pd,dd],LC=class Iy extends Be{static{o(this,"OriginatorPublicKey")}constructor(e={}){super(),this.algorithm=D(e,pd,Iy.defaultValues(pd)),this.publicKey=D(e,dd,Iy.defaultValues(dd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pd:return new ge;case dd:return new qt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case pd:case dd:return t.isEqual(Iy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.algorithm||{}),new qt({name:t.publicKey||L})]})}fromSchema(e){_e(e,Zse);let t=Ie(e,e,Iy.schema({names:{algorithm:{names:{blockName:pd}},publicKey:dd}}));Ae.assertSchema(t,this.className),this.algorithm=new ge({schema:t.result.algorithm}),this.publicKey=t.result.publicKey}toSchema(){return new W({value:[this.algorithm.toSchema(),this.publicKey]})}toJSON(){return{algorithm:this.algorithm.toJSON(),publicKey:this.publicKey.toJSON()}}};LC.CLASS_NAME="OriginatorPublicKey";var YE="variant",Tg="value",eie=["blockName"],iv=class WA extends Be{static{o(this,"OriginatorIdentifierOrKey")}constructor(e={}){super(),this.variant=D(e,YE,WA.defaultValues(YE)),Tg in e&&(this.value=D(e,Tg,WA.defaultValues(Tg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case YE:return-1;case Tg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case YE:return t===-1;case Tg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[Fn.schema({names:{blockName:t.blockName||L}}),new yt({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||L}),new ae({idBlock:{tagClass:3,tagNumber:1},name:t.blockName||L,value:LC.schema().valueBlock.value})]})}fromSchema(e){_e(e,eie);let t=Ie(e,e,WA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new Fn({schema:t.result.blockName})):t.result.blockName.idBlock.tagNumber===0?(t.result.blockName.idBlock.tagClass=1,t.result.blockName.idBlock.tagNumber=4,this.variant=2,this.value=t.result.blockName):(this.variant=3,this.value=new LC({schema:new W({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return this.value.idBlock.tagClass=3,this.value.idBlock.tagNumber=0,this.value;case 3:{let e=this.value.toSchema();return e.idBlock.tagClass=3,e.idBlock.tagNumber=1,e}default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2||this.variant===3)&&(e.value=this.value.toJSON()),e}};iv.CLASS_NAME="OriginatorIdentifierOrKey";var md="keyAttrId",Fa="keyAttr",tie=[md,Fa],ah=class JA extends Be{static{o(this,"OtherKeyAttribute")}constructor(e={}){super(),this.keyAttrId=D(e,md,JA.defaultValues(md)),Fa in e&&(this.keyAttr=D(e,Fa,JA.defaultValues(Fa))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case md:return L;case Fa:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case md:return typeof t=="string"&&t===L;case Fa:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({optional:t.optional||!0,name:t.blockName||L,value:[new rt({name:t.keyAttrId||L}),new St({optional:!0,name:t.keyAttr||L})]})}fromSchema(e){_e(e,tie);let t=Ie(e,e,JA.schema({names:{keyAttrId:md,keyAttr:Fa}}));Ae.assertSchema(t,this.className),this.keyAttrId=t.result.keyAttrId.valueBlock.toString(),Fa in t.result&&(this.keyAttr=t.result.keyAttr)}toSchema(){let e=[];return e.push(new rt({value:this.keyAttrId})),Fa in this&&e.push(this.keyAttr),new W({value:e})}toJSON(){let e={keyAttrId:this.keyAttrId};return Fa in this&&(e.keyAttr=this.keyAttr.toJSON()),e}};ah.CLASS_NAME="OtherKeyAttribute";var Nf="subjectKeyIdentifier",Nl="date",Tl="other",rie=[Nf,Nl,Tl],VC=class gd extends Be{static{o(this,"RecipientKeyIdentifier")}constructor(e={}){super(),this.subjectKeyIdentifier=D(e,Nf,gd.defaultValues(Nf)),Nl in e&&(this.date=D(e,Nl,gd.defaultValues(Nl))),Tl in e&&(this.other=D(e,Tl,gd.defaultValues(Tl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Nf:return new Ve;case Nl:return new Rr;case Tl:return new ah;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Nf:return t.isEqual(gd.defaultValues(Nf));case Nl:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case Tl:return t.keyAttrId===L&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ve({name:t.subjectKeyIdentifier||L}),new Rr({optional:!0,name:t.date||L}),ah.schema(t.other||{})]})}fromSchema(e){_e(e,rie);let t=Ie(e,e,gd.schema({names:{subjectKeyIdentifier:Nf,date:Nl,other:{names:{blockName:Tl}}}}));Ae.assertSchema(t,this.className),this.subjectKeyIdentifier=t.result.subjectKeyIdentifier,Nl in t.result&&(this.date=t.result.date),Tl in t.result&&(this.other=new ah({schema:t.result.other}))}toSchema(){let e=[];return e.push(this.subjectKeyIdentifier),this.date&&e.push(this.date),this.other&&e.push(this.other.toSchema()),new W({value:e})}toJSON(){let e={subjectKeyIdentifier:this.subjectKeyIdentifier.toJSON()};return this.date&&(e.date=this.date.toJSON()),this.other&&(e.other=this.other.toJSON()),e}};VC.CLASS_NAME="RecipientKeyIdentifier";var QE="variant",ZE="value",nie=["blockName"],v0=class zA extends Be{static{o(this,"KeyAgreeRecipientIdentifier")}constructor(e={}){super(),this.variant=D(e,QE,zA.defaultValues(QE)),this.value=D(e,ZE,zA.defaultValues(ZE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case QE:return-1;case ZE:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case QE:return t===-1;case ZE:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[Fn.schema(t.issuerAndSerialNumber||{names:{blockName:t.blockName||L}}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:0},value:VC.schema(t.rKeyId||{names:{blockName:t.blockName||L}}).valueBlock.value})]})}fromSchema(e){_e(e,nie);let t=Ie(e,e,zA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new Fn({schema:t.result.blockName})):(this.variant=2,this.value=new VC({schema:new W({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return new ae({idBlock:{tagClass:3,tagNumber:0},value:this.value.toSchema().valueBlock.value});default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&(e.value=this.value.toJSON()),e}};v0.CLASS_NAME="KeyAgreeRecipientIdentifier";var yd="rid",Tf="encryptedKey",sie=[yd,Tf],UC=class By extends Be{static{o(this,"RecipientEncryptedKey")}constructor(e={}){super(),this.rid=D(e,yd,By.defaultValues(yd)),this.encryptedKey=D(e,Tf,By.defaultValues(Tf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case yd:return new v0;case Tf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case yd:return t.variant===-1&&!("value"in t);case Tf:return t.isEqual(By.defaultValues(Tf));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[v0.schema(t.rid||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,sie);let t=Ie(e,e,By.schema({names:{rid:{names:{blockName:yd}},encryptedKey:Tf}}));Ae.assertSchema(t,this.className),this.rid=new v0({schema:t.result.rid}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new W({value:[this.rid.toSchema(),this.encryptedKey]})}toJSON(){return{rid:this.rid.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};UC.CLASS_NAME="RecipientEncryptedKey";var eA="encryptedKeys",z6="RecipientEncryptedKeys",iie=[z6],av=class oB extends Be{static{o(this,"RecipientEncryptedKeys")}constructor(e={}){super(),this.encryptedKeys=D(e,eA,oB.defaultValues(eA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case eA:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case eA:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.RecipientEncryptedKeys||L,value:UC.schema()})]})}fromSchema(e){_e(e,iie);let t=Ie(e,e,oB.schema({names:{RecipientEncryptedKeys:z6}}));Ae.assertSchema(t,this.className),this.encryptedKeys=Array.from(t.result.RecipientEncryptedKeys,n=>new UC({schema:n}))}toSchema(){return new W({value:Array.from(this.encryptedKeys,e=>e.toSchema())})}toJSON(){return{encryptedKeys:Array.from(this.encryptedKeys,e=>e.toJSON())}}};av.CLASS_NAME="RecipientEncryptedKeys";var vd="version",wd="originator",Mo="ukm",Sd="keyEncryptionAlgorithm",Ed="recipientEncryptedKeys",tA="recipientCertificate",rA="recipientPublicKey",aie=[vd,wd,Mo,Sd,Ed],MC=class qa extends Be{static{o(this,"KeyAgreeRecipientInfo")}constructor(e={}){super(),this.version=D(e,vd,qa.defaultValues(vd)),this.originator=D(e,wd,qa.defaultValues(wd)),Mo in e&&(this.ukm=D(e,Mo,qa.defaultValues(Mo))),this.keyEncryptionAlgorithm=D(e,Sd,qa.defaultValues(Sd)),this.recipientEncryptedKeys=D(e,Ed,qa.defaultValues(Ed)),this.recipientCertificate=D(e,tA,qa.defaultValues(tA)),this.recipientPublicKey=D(e,rA,qa.defaultValues(rA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case vd:return 0;case wd:return new iv;case Mo:return new Ve;case Sd:return new ge;case Ed:return new av;case tA:return new ts;case rA:return null;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case vd:return t===0;case wd:return t.variant===-1&&!("value"in t);case Mo:return t.isEqual(qa.defaultValues(Mo));case Sd:return t.algorithmId===L&&!("algorithmParams"in t);case Ed:return t.encryptedKeys.length===0;case tA:return!1;case rA:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[iv.schema(t.originator||{})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Ve({name:t.ukm||L})]}),ge.schema(t.keyEncryptionAlgorithm||{}),av.schema(t.recipientEncryptedKeys||{})]})}fromSchema(e){_e(e,aie);let t=Ie(e,e,qa.schema({names:{version:vd,originator:{names:{blockName:wd}},ukm:Mo,keyEncryptionAlgorithm:{names:{blockName:Sd}},recipientEncryptedKeys:{names:{blockName:Ed}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.originator=new iv({schema:t.result.originator}),Mo in t.result&&(this.ukm=t.result.ukm),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.recipientEncryptedKeys=new av({schema:t.result.recipientEncryptedKeys})}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.originator.toSchema()]})),this.ukm&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[this.ukm]})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.recipientEncryptedKeys.toSchema()),new W({value:e})}toJSON(){let e={version:this.version,originator:this.originator.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),recipientEncryptedKeys:this.recipientEncryptedKeys.toJSON()};return this.ukm&&(e.ukm=this.ukm.toJSON()),e}};MC.CLASS_NAME="KeyAgreeRecipientInfo";var If="keyIdentifier",Il="date",Bl="other",oie=[If,Il,Bl],ov=class Ad extends Be{static{o(this,"KEKIdentifier")}constructor(e={}){super(),this.keyIdentifier=D(e,If,Ad.defaultValues(If)),Il in e&&(this.date=D(e,Il,Ad.defaultValues(Il))),Bl in e&&(this.other=D(e,Bl,Ad.defaultValues(Bl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case If:return new Ve;case Il:return new Rr;case Bl:return new ah;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case If:return t.isEqual(Ad.defaultValues(If));case Il:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case Bl:return t.compareWithDefault("keyAttrId",t.keyAttrId)&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ve({name:t.keyIdentifier||L}),new Rr({optional:!0,name:t.date||L}),ah.schema(t.other||{})]})}fromSchema(e){_e(e,oie);let t=Ie(e,e,Ad.schema({names:{keyIdentifier:If,date:Il,other:{names:{blockName:Bl}}}}));Ae.assertSchema(t,this.className),this.keyIdentifier=t.result.keyIdentifier,Il in t.result&&(this.date=t.result.date),Bl in t.result&&(this.other=new ah({schema:t.result.other}))}toSchema(){let e=[];return e.push(this.keyIdentifier),this.date&&e.push(this.date),this.other&&e.push(this.other.toSchema()),new W({value:e})}toJSON(){let e={keyIdentifier:this.keyIdentifier.toJSON()};return this.date&&(e.date=this.date),this.other&&(e.other=this.other.toJSON()),e}};ov.CLASS_NAME="KEKIdentifier";var Cd="version",bd="kekid",xd="keyEncryptionAlgorithm",Bf="encryptedKey",nA="preDefinedKEK",uie=[Cd,bd,xd,Bf],jC=class jo extends Be{static{o(this,"KEKRecipientInfo")}constructor(e={}){super(),this.version=D(e,Cd,jo.defaultValues(Cd)),this.kekid=D(e,bd,jo.defaultValues(bd)),this.keyEncryptionAlgorithm=D(e,xd,jo.defaultValues(xd)),this.encryptedKey=D(e,Bf,jo.defaultValues(Bf)),this.preDefinedKEK=D(e,nA,jo.defaultValues(nA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Cd:return 0;case bd:return new ov;case xd:return new ge;case Bf:return new Ve;case nA:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"KEKRecipientInfo":return t===jo.defaultValues(Cd);case bd:return t.compareWithDefault("keyIdentifier",t.keyIdentifier)&&!("date"in t)&&!("other"in t);case xd:return t.algorithmId===L&&!("algorithmParams"in t);case Bf:return t.isEqual(jo.defaultValues(Bf));case nA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),ov.schema(t.kekid||{}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,uie);let t=Ie(e,e,jo.schema({names:{version:Cd,kekid:{names:{blockName:bd}},keyEncryptionAlgorithm:{names:{blockName:xd}},encryptedKey:Bf}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.kekid=new ov({schema:t.result.kekid}),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new W({value:[new me({value:this.version}),this.kekid.toSchema(),this.keyEncryptionAlgorithm.toSchema(),this.encryptedKey]})}toJSON(){return{version:this.version,kekid:this.kekid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};jC.CLASS_NAME="KEKRecipientInfo";var Nd="version",Dl="keyDerivationAlgorithm",Td="keyEncryptionAlgorithm",Df="encryptedKey",sA="password",lie=[Nd,Dl,Td,Df],FC=class _l extends Be{static{o(this,"PasswordRecipientinfo")}constructor(e={}){super(),this.version=D(e,Nd,_l.defaultValues(Nd)),Dl in e&&(this.keyDerivationAlgorithm=D(e,Dl,_l.defaultValues(Dl))),this.keyEncryptionAlgorithm=D(e,Td,_l.defaultValues(Td)),this.encryptedKey=D(e,Df,_l.defaultValues(Df)),this.password=D(e,sA,_l.defaultValues(sA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Nd:return-1;case Dl:return new ge;case Td:return new ge;case Df:return new Ve;case sA:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Nd:return t===-1;case Dl:case Td:return t.algorithmId===L&&!("algorithmParams"in t);case Df:return t.isEqual(_l.defaultValues(Df));case sA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({name:t.keyDerivationAlgorithm||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ge.schema().valueBlock.value}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,lie);let t=Ie(e,e,_l.schema({names:{version:Nd,keyDerivationAlgorithm:Dl,keyEncryptionAlgorithm:{names:{blockName:Td}},encryptedKey:Df}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,Dl in t.result&&(this.keyDerivationAlgorithm=new ge({schema:new W({value:t.result.keyDerivationAlgorithm.valueBlock.value})})),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return e.push(new me({value:this.version})),this.keyDerivationAlgorithm&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.keyDerivationAlgorithm.toSchema().valueBlock.value})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new W({value:e})}toJSON(){let e={version:this.version,keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()};return this.keyDerivationAlgorithm&&(e.keyDerivationAlgorithm=this.keyDerivationAlgorithm.toJSON()),e}};FC.CLASS_NAME="PasswordRecipientInfo";var Id="oriType",_f="oriValue",cie=[Id,_f],uB=class Dy extends Be{static{o(this,"OtherRecipientInfo")}constructor(e={}){super(),this.oriType=D(e,Id,Dy.defaultValues(Id)),this.oriValue=D(e,_f,Dy.defaultValues(_f)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Id:return L;case _f:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Id:return t===L;case _f:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.oriType||L}),new St({name:t.oriValue||L})]})}fromSchema(e){_e(e,cie);let t=Ie(e,e,Dy.schema({names:{oriType:Id,oriValue:_f}}));Ae.assertSchema(t,this.className),this.oriType=t.result.oriType.valueBlock.toString(),this.oriValue=t.result.oriValue}toSchema(){return new W({value:[new rt({value:this.oriType}),this.oriValue]})}toJSON(){let e={oriType:this.oriType};return Dy.compareWithDefault(_f,this.oriValue)||(e.oriValue=this.oriValue.toJSON()),e}};uB.CLASS_NAME="OtherRecipientInfo";var iA="variant",Ig="value",fie=["blockName"],Rf=class _y extends Be{static{o(this,"RecipientInfo")}constructor(e={}){super(),this.variant=D(e,iA,_y.defaultValues(iA)),Ig in e&&(this.value=D(e,Ig,_y.defaultValues(Ig))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case iA:return-1;case Ig:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case iA:return t===_y.defaultValues(e);case Ig:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Pr({value:[kC.schema({names:{blockName:t.blockName||L}}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:1},value:MC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:2},value:jC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:3},value:FC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:4},value:uB.schema().valueBlock.value})]})}fromSchema(e){_e(e,fie);let t=Ie(e,e,_y.schema({names:{blockName:"blockName"}}));if(Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1)this.variant=1,this.value=new kC({schema:t.result.blockName});else{let n=new W({value:t.result.blockName.valueBlock.value});switch(t.result.blockName.idBlock.tagNumber){case 1:this.variant=2,this.value=new MC({schema:n});break;case 2:this.variant=3,this.value=new jC({schema:n});break;case 3:this.variant=4,this.value=new FC({schema:n});break;case 4:this.variant=5,this.value=new uB({schema:n});break;default:throw new Error("Incorrect structure of RecipientInfo block")}}}toSchema(){fr.assertEmpty(this.value,"value","RecipientInfo");let e=this.value.toSchema();switch(this.variant){case 1:return e;case 2:case 3:case 4:return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.variant-1,e;default:return new St}}toJSON(){let e={variant:this.variant};return this.value&&this.variant>=1&&this.variant<=4&&(e.value=this.value.toJSON()),e}};Rf.CLASS_NAME="RecipientInfo";var Rl="hashAlgorithm",Pl="maskGenAlgorithm",Ol="pSourceAlgorithm",hie=[Rl,Pl,Ol],YA=class Zi extends Be{static{o(this,"RSAESOAEPParams")}constructor(e={}){super(),this.hashAlgorithm=D(e,Rl,Zi.defaultValues(Rl)),this.maskGenAlgorithm=D(e,Pl,Zi.defaultValues(Pl)),this.pSourceAlgorithm=D(e,Ol,Zi.defaultValues(Ol)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rl:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr});case Pl:return new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new Kr}).toSchema()});case Ol:return new ge({algorithmId:"1.2.840.113549.1.1.9",algorithmParams:new Ve({valueHex:new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer})});default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ge.schema(t.hashAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ge.schema(t.maskGenAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[ge.schema(t.pSourceAlgorithm||{})]})]})}fromSchema(e){_e(e,hie);let t=Ie(e,e,Zi.schema({names:{hashAlgorithm:{names:{blockName:Rl}},maskGenAlgorithm:{names:{blockName:Pl}},pSourceAlgorithm:{names:{blockName:Ol}}}}));Ae.assertSchema(t,this.className),Rl in t.result&&(this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm})),Pl in t.result&&(this.maskGenAlgorithm=new ge({schema:t.result.maskGenAlgorithm})),Ol in t.result&&(this.pSourceAlgorithm=new ge({schema:t.result.pSourceAlgorithm}))}toSchema(){let e=[];return this.hashAlgorithm.isEqual(Zi.defaultValues(Rl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(Zi.defaultValues(Pl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.pSourceAlgorithm.isEqual(Zi.defaultValues(Ol))||e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.pSourceAlgorithm.toSchema()]})),new W({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(Zi.defaultValues(Rl))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(Zi.defaultValues(Pl))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.pSourceAlgorithm.isEqual(Zi.defaultValues(Ol))||(e.pSourceAlgorithm=this.pSourceAlgorithm.toJSON()),e}};YA.CLASS_NAME="RSAESOAEPParams";var Bd="keyInfo",kl="entityUInfo",Dd="suppPubInfo",pie=[Bd,kl,Dd],lB=class _d extends Be{static{o(this,"ECCCMSSharedInfo")}constructor(e={}){super(),this.keyInfo=D(e,Bd,_d.defaultValues(Bd)),kl in e&&(this.entityUInfo=D(e,kl,_d.defaultValues(kl))),this.suppPubInfo=D(e,Dd,_d.defaultValues(Dd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Bd:return new ge;case kl:return new Ve;case Dd:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Bd:case kl:case Dd:return t.isEqual(_d.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.keyInfo||{}),new ae({name:t.entityUInfo||L,idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[new Ve]}),new ae({name:t.suppPubInfo||L,idBlock:{tagClass:3,tagNumber:2},value:[new Ve]})]})}fromSchema(e){_e(e,pie);let t=Ie(e,e,_d.schema({names:{keyInfo:{names:{blockName:Bd}},entityUInfo:kl,suppPubInfo:Dd}}));Ae.assertSchema(t,this.className),this.keyInfo=new ge({schema:t.result.keyInfo}),kl in t.result&&(this.entityUInfo=t.result.entityUInfo.valueBlock.value[0]),this.suppPubInfo=t.result.suppPubInfo.valueBlock.value[0]}toSchema(){let e=[];return e.push(this.keyInfo.toSchema()),this.entityUInfo&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.entityUInfo]})),e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.suppPubInfo]})),new W({value:e})}toJSON(){let e={keyInfo:this.keyInfo.toJSON(),suppPubInfo:this.suppPubInfo.toJSON()};return this.entityUInfo&&(e.entityUInfo=this.entityUInfo.toJSON()),e}};lB.CLASS_NAME="ECCCMSSharedInfo";var Rd="version",Ll="originatorInfo",Pd="recipientInfos",Od="encryptedContentInfo",Vl="unprotectedAttrs",die=[Rd,Ll,Pd,Od,Vl],l6={kdfAlgorithm:"SHA-512",kekEncryptionLength:256},mie={"P-256":256,"P-384":384,"P-521":528},cB=class Ul extends Be{static{o(this,"EnvelopedData")}constructor(e={}){super(),this.version=D(e,Rd,Ul.defaultValues(Rd)),Ll in e&&(this.originatorInfo=D(e,Ll,Ul.defaultValues(Ll))),this.recipientInfos=D(e,Pd,Ul.defaultValues(Pd)),this.encryptedContentInfo=D(e,Od,Ul.defaultValues(Od)),Vl in e&&(this.unprotectedAttrs=D(e,Vl,Ul.defaultValues(Vl))),this.policy={disableSplit:!!e.disableSplit},e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rd:return 0;case Ll:return new $A;case Pd:return[];case Od:return new es;case Vl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Rd:return t===Ul.defaultValues(e);case Ll:return t.certs.certificates.length===0&&t.crls.crls.length===0;case Pd:case Vl:return t.length===0;case Od:return es.compareWithDefault("contentType",t.contentType)&&es.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&es.compareWithDefault("encryptedContent",t.encryptedContent);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({name:t.originatorInfo||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:$A.schema().valueBlock.value}),new $r({value:[new Tt({name:t.recipientInfos||L,value:Rf.schema()})]}),es.schema(t.encryptedContentInfo||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.unprotectedAttrs||L,value:Zr.schema()})]})]})}fromSchema(e){_e(e,die);let t=Ie(e,e,Ul.schema({names:{version:Rd,originatorInfo:Ll,recipientInfos:Pd,encryptedContentInfo:{names:{blockName:Od}},unprotectedAttrs:Vl}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,Ll in t.result&&(this.originatorInfo=new $A({schema:new W({value:t.result.originatorInfo.valueBlock.value})})),this.recipientInfos=Array.from(t.result.recipientInfos,n=>new Rf({schema:n})),this.encryptedContentInfo=new es({schema:t.result.encryptedContentInfo}),Vl in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new Zr({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),this.originatorInfo&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:this.originatorInfo.toSchema().valueBlock.value})),e.push(new $r({value:Array.from(this.recipientInfos,t=>t.toSchema())})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,recipientInfos:Array.from(this.recipientInfos,t=>t.toJSON()),encryptedContentInfo:this.encryptedContentInfo.toJSON()};return this.originatorInfo&&(e.originatorInfo=this.originatorInfo.toJSON()),this.unprotectedAttrs&&(e.unprotectedAttrs=Array.from(this.unprotectedAttrs,t=>t.toJSON())),e}addRecipientByCertificate(e,t,n,s=_t(!0)){let i=Object.assign({useOAEP:!0,oaepHashAlgorithm:"SHA-512"},l6,t||{});if(e.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.113549")!==-1)n=1;else if(e.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.10045")!==-1)n=2;else throw new Error(`Unknown type of certificate's public key: ${e.subjectPublicKeyInfo.algorithm.algorithmId}`);switch(n){case 1:{let a,u;if(i.useOAEP===!0){a=s.getOIDByAlgorithm({name:"RSA-OAEP"},!0,"keyEncryptionAlgorithm");let f=s.getOIDByAlgorithm({name:i.oaepHashAlgorithm},!0,"RSAES-OAEP-params"),h=new ge({algorithmId:f,algorithmParams:new Kr});u=new YA({hashAlgorithm:h,maskGenAlgorithm:new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:h.toSchema()})}).toSchema()}else{if(a=s.getOIDByAlgorithm({name:"RSAES-PKCS1-v1_5"}),a===L)throw new Error("Can not find OID for RSAES-PKCS1-v1_5");u=new Kr}let l=new kC({version:0,rid:new Fn({issuer:e.issuer,serialNumber:e.serialNumber}),keyEncryptionAlgorithm:new ge({algorithmId:a,algorithmParams:u}),recipientCertificate:e});this.recipientInfos.push(new Rf({variant:1,value:l}))}break;case 2:{let a=new v0({variant:1,value:new Fn({issuer:e.issuer,serialNumber:e.serialNumber})});this._addKeyAgreeRecipientInfo(a,i,{recipientCertificate:e},s)}break;default:throw new Error(`Unknown "variant" value: ${n}`)}return!0}addRecipientByPreDefinedData(e,t={},n,s=_t(!0)){if(Er.assert(e,"preDefinedData","ArrayBuffer"),!e.byteLength)throw new Error("Pre-defined data could have zero length");if(!t.keyIdentifier){let i=new ArrayBuffer(16),a=new Uint8Array(i);s.getRandomValues(a),t.keyIdentifier=i}switch(t.hmacHashAlgorithm||(t.hmacHashAlgorithm="SHA-512"),t.iterationCount===void 0&&(t.iterationCount=2048),t.keyEncryptionAlgorithm||(t.keyEncryptionAlgorithm={name:"AES-KW",length:256}),t.keyEncryptionAlgorithmParams||(t.keyEncryptionAlgorithmParams=new Kr),n){case 1:{let i=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),a=new jC({version:4,kekid:new ov({keyIdentifier:new Ve({valueHex:t.keyIdentifier})}),keyEncryptionAlgorithm:new ge({algorithmId:i,algorithmParams:t.keyEncryptionAlgorithmParams}),preDefinedKEK:e});this.recipientInfos.push(new Rf({variant:3,value:a}))}break;case 2:{let i=s.getOIDByAlgorithm({name:"PBKDF2"},!0,"keyDerivationAlgorithm"),a=new ArrayBuffer(64),u=new Uint8Array(a);s.getRandomValues(u);let l=s.getOIDByAlgorithm({name:"HMAC",hash:{name:t.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),f=new y0({salt:new Ve({valueHex:a}),iterationCount:t.iterationCount,prf:new ge({algorithmId:l,algorithmParams:new Kr})}),h=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),m=new FC({version:0,keyDerivationAlgorithm:new ge({algorithmId:i,algorithmParams:f.toSchema()}),keyEncryptionAlgorithm:new ge({algorithmId:h,algorithmParams:t.keyEncryptionAlgorithmParams}),password:e});this.recipientInfos.push(new Rf({variant:4,value:m}))}break;default:throw new Error(`Unknown value for "variant": ${n}`)}}addRecipientByKeyIdentifier(e,t,n,s=_t(!0)){let i=Object.assign({},l6,n||{}),a=new v0({variant:2,value:new VC({subjectKeyIdentifier:new Ve({valueHex:t})})});this._addKeyAgreeRecipientInfo(a,i,{recipientPublicKey:e},s)}_addKeyAgreeRecipientInfo(e,t,n,s=_t(!0)){let i=new UC({rid:e}),a=s.getOIDByAlgorithm({name:"AES-KW",length:t.kekEncryptionLength},!0,"keyEncryptionAlgorithm"),u=new ge({algorithmId:a}),l=s.getOIDByAlgorithm({name:"ECDH",kdf:t.kdfAlgorithm},!0,"KeyAgreeRecipientInfo"),f=new ArrayBuffer(64),h=new Uint8Array(f);s.getRandomValues(h);let m={version:3,ukm:new Ve({valueHex:f}),keyEncryptionAlgorithm:new ge({algorithmId:l,algorithmParams:u.toSchema()}),recipientEncryptedKeys:new av({encryptedKeys:[i]})},g=new MC(Object.assign(m,n));this.recipientInfos.push(new Rf({variant:2,value:g}))}async encrypt(e,t,n=_t(!0)){let s=new ArrayBuffer(16),i=new Uint8Array(s);n.getRandomValues(i);let a=new Uint8Array(t),u=n.getOIDByAlgorithm(e,!0,"contentEncryptionAlgorithm"),l=await n.generateKey(e,!0,["encrypt"]),f=await n.encrypt({name:e.name,iv:i},l,a),h=await n.exportKey("raw",l);this.version=2,this.encryptedContentInfo=new es({disableSplit:this.policy.disableSplit,contentType:"1.2.840.113549.1.7.1",contentEncryptionAlgorithm:new ge({algorithmId:u,algorithmParams:new Ve({valueHex:s})}),encryptedContent:new Ve({valueHex:f})});let m=o(async E=>{let b=this.recipientInfos[E].value,T,A;if(b.recipientPublicKey)T=b.recipientPublicKey.algorithm.namedCurve,A=b.recipientPublicKey;else if(b.recipientCertificate){let be=b.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(be.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${E}`);switch(be.valueBlock.toString()){case"1.2.840.10045.3.1.7":T="P-256";break;case"1.3.132.0.34":T="P-384";break;case"1.3.132.0.35":T="P-521";break;default:throw new Error(`Incorrect curve OID for index ${E}`)}A=await b.recipientCertificate.getPublicKey({algorithm:{algorithm:{name:"ECDH",namedCurve:T},usages:[]}},n)}else throw new Error("Unsupported RecipientInfo");let C=mie[T],x=await n.generateKey({name:"ECDH",namedCurve:T},!0,["deriveBits"]),B=await n.exportKey("spki",x.publicKey),F=await n.deriveBits({name:"ECDH",public:A},x.privateKey,C),R=new ge({schema:b.keyEncryptionAlgorithm.algorithmParams}),H=n.getAlgorithmByOID(R.algorithmId,!0,"aesKWAlgorithm"),q=H.length,K=new ArrayBuffer(4),G=new Uint8Array(K);for(let be=3;be>=0;be--)G[be]=q,q>>=8;let le=new lB({keyInfo:new ge({algorithmId:R.algorithmId}),entityUInfo:b.ukm,suppPubInfo:new Ve({valueHex:K})}).toSchema().toBER(!1),oe=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm"),Z=await zU(oe.kdf,F,H.length,le,n),fe=await n.importKey("raw",Z,{name:"AES-KW"},!0,["wrapKey"]),Se=await n.wrapKey("raw",l,fe,{name:"AES-KW"}),Ke=new iv;return Ke.variant=3,Ke.value=LC.fromBER(B),b.originator=Ke,b.recipientEncryptedKeys.encryptedKeys[0].encryptedKey=new Ve({valueHex:Se}),{ecdhPrivateKey:x.privateKey}},"SubKeyAgreeRecipientInfo"),g=o(async E=>{let b=this.recipientInfos[E].value,T=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(T.name==="RSA-OAEP"){let A=b.keyEncryptionAlgorithm.algorithmParams,C=new YA({schema:A});if(T.hash=n.getAlgorithmByOID(C.hashAlgorithm.algorithmId),!("name"in T.hash))throw new Error(`Incorrect OID for hash algorithm: ${C.hashAlgorithm.algorithmId}`)}try{let A=await b.recipientCertificate.getPublicKey({algorithm:{algorithm:T,usages:["encrypt","wrapKey"]}},n),C=await n.encrypt(A.algorithm,A,h);b.encryptedKey=new Ve({valueHex:C})}catch{}},"SubKeyTransRecipientInfo"),w=o(async E=>{let b=this.recipientInfos[E].value,T=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),A=await n.importKey("raw",new Uint8Array(b.preDefinedKEK),T,!0,["wrapKey"]),C=await n.wrapKey("raw",l,A,T);b.encryptedKey=new Ve({valueHex:C})},"SubKEKRecipientInfo"),y=o(async E=>{let b=this.recipientInfos[E].value,T;if(!b.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!b.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{T=new y0({schema:b.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let A=new Uint8Array(b.password),C=await n.importKey("raw",A,"PBKDF2",!1,["deriveKey"]),x=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),B="SHA-1";T.prf&&(B=n.getAlgorithmByOID(T.prf.algorithmId,!0,"prfAlgorithm").hash.name);let F=new Uint8Array(T.salt.valueBlock.valueHex),R=T.iterationCount,H=await n.deriveKey({name:"PBKDF2",hash:{name:B},salt:F,iterations:R},C,x,!0,["wrapKey"]),q=await n.wrapKey("raw",l,H,x);b.encryptedKey=new Ve({valueHex:q})},"SubPasswordRecipientinfo"),S=[];for(let E=0;E<this.recipientInfos.length;E++)switch(this.recipientInfos[E].variant){case 1:S.push(await g(E));break;case 2:S.push(await m(E));break;case 3:S.push(await w(E));break;case 4:S.push(await y(E));break;default:throw new Error(`Unknown recipient type in array with index ${E}`)}return S}async decrypt(e,t,n=_t(!0)){let s=t||{};if(e+1>this.recipientInfos.length)throw new Error(`Maximum value for "index" is: ${this.recipientInfos.length-1}`);let i=o(async S=>{let E=this.recipientInfos[S].value,b,T,A,C=E.originator;if(s.recipientCertificate){let oe=s.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(oe.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${S}`);b=oe.valueBlock.toString()}else if(C.value.algorithm.algorithmParams){let oe=C.value.algorithm.algorithmParams;if(oe.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect originator for index ${S}`);b=oe.valueBlock.toString()}else throw new Error('Parameter "recipientCertificate" is mandatory for "KeyAgreeRecipientInfo" if algorithm params are missing from originator');if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyAgreeRecipientInfo"');switch(b){case"1.2.840.10045.3.1.7":T="P-256",A=256;break;case"1.3.132.0.34":T="P-384",A=384;break;case"1.3.132.0.35":T="P-521",A=528;break;default:throw new Error(`Incorrect curve OID for index ${S}`)}let x,B=n;dt.isBufferSource(s.recipientPrivateKey)?x=await n.importKey("pkcs8",s.recipientPrivateKey,{name:"ECDH",namedCurve:T},!0,["deriveBits"]):(x=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(B=s.crypto.subtle)),"algorithmParams"in C.value.algorithm||(C.value.algorithm.algorithmParams=new rt({value:b}));let F=C.value.toSchema().toBER(!1),R=await n.importKey("spki",F,{name:"ECDH",namedCurve:T},!0,[]),H=await B.deriveBits({name:"ECDH",public:R},x,A);async function q(oe){oe=oe||!1;let Z=new ge({schema:E.keyEncryptionAlgorithm.algorithmParams}),fe=n.getAlgorithmByOID(Z.algorithmId,!0,"kwAlgorithm"),Se=fe.length,Ke=new ArrayBuffer(4),be=new Uint8Array(Ke);for(let lt=3;lt>=0;lt--)be[lt]=Se,Se>>=8;let we={algorithmId:Z.algorithmId};oe&&(we.algorithmParams=new Kr);let Je=new lB({keyInfo:new ge(we),entityUInfo:E.ukm,suppPubInfo:new Ve({valueHex:Ke})}).toSchema().toBER(!1),Ye=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm");if(!Ye.name)throw new Error(`Incorrect OID for key encryption algorithm: ${E.keyEncryptionAlgorithm.algorithmId}`);return zU(Ye.kdf,H,fe.length,Je,n)}o(q,"applyKDF");let K=await q(),G=o(async oe=>n.importKey("raw",oe,{name:"AES-KW"},!0,["unwrapKey"]),"importAesKwKey"),he=await G(K),le=o(async oe=>{let Z=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,fe=n.getAlgorithmByOID(Z,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",E.recipientEncryptedKeys.encryptedKeys[0].encryptedKey.valueBlock.valueHexView,oe,{name:"AES-KW"},fe,!0,["decrypt"])},"unwrapSessionKey");try{return await le(he)}catch{let oe=await q(!0),Z=await G(oe);return le(Z)}},"SubKeyAgreeRecipientInfo"),a=o(async S=>{let E=this.recipientInfos[S].value;if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyTransRecipientInfo"');let b=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(b.name==="RSA-OAEP"){let F=E.keyEncryptionAlgorithm.algorithmParams,R=new YA({schema:F});if(b.hash=n.getAlgorithmByOID(R.hashAlgorithm.algorithmId),!("name"in b.hash))throw new Error(`Incorrect OID for hash algorithm: ${R.hashAlgorithm.algorithmId}`)}let T,A=n;dt.isBufferSource(s.recipientPrivateKey)?T=await n.importKey("pkcs8",s.recipientPrivateKey,b,!0,["decrypt"]):(T=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(A=s.crypto.subtle));let C=await A.decrypt(T.algorithm,T,E.encryptedKey.valueBlock.valueHexView),x=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,B=n.getAlgorithmByOID(x,!0,"contentEncryptionAlgorithm");if(!("name"in B))throw new Error(`Incorrect "contentEncryptionAlgorithm": ${x}`);return n.importKey("raw",C,B,!0,["decrypt"])},"SubKeyTransRecipientInfo"),u=o(async S=>{let E=this.recipientInfos[S].value;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');let b=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),T=await n.importKey("raw",s.preDefinedData,b,!0,["unwrapKey"]),A=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,C=n.getAlgorithmByOID(A,!0,"contentEncryptionAlgorithm");if(!C.name)throw new Error(`Incorrect "contentEncryptionAlgorithm": ${A}`);return n.unwrapKey("raw",E.encryptedKey.valueBlock.valueHexView,T,b,C,!0,["decrypt"])},"SubKEKRecipientInfo"),l=o(async S=>{let E=this.recipientInfos[S].value,b;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');if(!E.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!E.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{b=new y0({schema:E.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let T=await n.importKey("raw",s.preDefinedData,"PBKDF2",!1,["deriveKey"]),A=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm"),C=b.prf?n.getAlgorithmByOID(b.prf.algorithmId,!0,"prfAlgorithm").hash.name:"SHA-1",x=new Uint8Array(b.salt.valueBlock.valueHex),B=b.iterationCount,F=await n.deriveKey({name:"PBKDF2",hash:{name:C},salt:x,iterations:B},T,A,!0,["unwrapKey"]),R=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,H=n.getAlgorithmByOID(R,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",E.encryptedKey.valueBlock.valueHexView,F,A,H,!0,["decrypt"])},"SubPasswordRecipientinfo"),f;switch(this.recipientInfos[e].variant){case 1:f=await a(e);break;case 2:f=await i(e);break;case 3:f=await u(e);break;case 4:f=await l(e);break;default:throw new Error(`Unknown recipient type in array with index ${e}`)}let h=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,m=n.getAlgorithmByOID(h,!0,"contentEncryptionAlgorithm"),g=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams.valueBlock.valueHex,w=new Uint8Array(g);if(!this.encryptedContentInfo.encryptedContent)throw new Error("Required property `encryptedContent` is empty");let y=this.encryptedContentInfo.getEncryptedContent();return n.decrypt({name:m.name,iv:w},f,y)}};cB.CLASS_NAME="EnvelopedData";var Pp="safeContents",Bg="parsedValue",c6="contentInfos",fB=class QA extends Be{static{o(this,"AuthenticatedSafe")}constructor(e={}){super(),this.safeContents=D(e,Pp,QA.defaultValues(Pp)),Bg in e&&(this.parsedValue=D(e,Bg,QA.defaultValues(Bg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pp:return[];case Bg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Pp:return t.length===0;case Bg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.contentInfos||L,value:Gr.schema()})]})}fromSchema(e){_e(e,[c6]);let t=Ie(e,e,QA.schema({names:{contentInfos:c6}}));Ae.assertSchema(t,this.className),this.safeContents=Array.from(t.result.contentInfos,n=>new Gr({schema:n}))}toSchema(){return new W({value:Array.from(this.safeContents,e=>e.toSchema())})}toJSON(){return{safeContents:Array.from(this.safeContents,e=>e.toJSON())}}async parseInternalValues(e,t=_t(!0)){if(fr.assert(e,Pp),Er.assert(e.safeContents,Pp,"Array"),e.safeContents.length!==this.safeContents.length)throw new Er('Length of "parameters.safeContents" must be equal to "this.safeContents.length"');this.parsedValue={safeContents:[]};for(let[n,s]of this.safeContents.entries()){let i=e.safeContents[n],a=`parameters.safeContents[${n}]`;switch(s.contentType){case VB:{Er.assert(s.content,"this.safeContents[j].content",Ve);let u=s.content.getValue();this.parsedValue.safeContents.push({privacyMode:0,value:g0.fromBER(u)})}break;case b6:{let u=new cB({schema:s.content});fr.assert(a,i,"recipientCertificate","recipientKey");let l=i,f=l.recipientCertificate,h=l.recipientKey,m=await u.decrypt(0,{recipientCertificate:f,recipientPrivateKey:h},t);this.parsedValue.safeContents.push({privacyMode:2,value:g0.fromBER(m)})}break;case x6:{let u=new hv({schema:s.content});fr.assert(a,i,"password");let l=i.password,f=await u.decrypt({password:l},t);this.parsedValue.safeContents.push({privacyMode:1,value:g0.fromBER(f)})}break;default:throw new Error(`Unknown "contentType" for AuthenticatedSafe: " ${s.contentType}`)}}}async makeInternalValues(e,t=_t(!0)){if(!this.parsedValue)throw new Error('Please run "parseValues" first or add "parsedValue" manually');if(Er.assert(this.parsedValue,"this.parsedValue","object"),Er.assert(this.parsedValue.safeContents,"this.parsedValue.safeContents","Array"),Er.assert(e,"parameters","object"),fr.assert(e,"safeContents"),Er.assert(e.safeContents,"parameters.safeContents","Array"),e.safeContents.length!==this.parsedValue.safeContents.length)throw new Er('Length of "parameters.safeContents" must be equal to "this.parsedValue.safeContents"');this.safeContents=[];for(let[n,s]of this.parsedValue.safeContents.entries())switch(fr.assert("content",s,"privacyMode","value"),Er.assert(s.value,"content.value",g0),s.privacyMode){case 0:{let i=s.value.toSchema().toBER(!1);this.safeContents.push(new Gr({contentType:"1.2.840.113549.1.7.1",content:new Ve({valueHex:i})}))}break;case 1:{let i=new hv,a=e.safeContents[n];a.contentToEncrypt=s.value.toSchema().toBER(!1),await i.encrypt(a,t),this.safeContents.push(new Gr({contentType:"1.2.840.113549.1.7.6",content:i.toSchema()}))}break;case 2:{let i=new cB,a=s.value.toSchema().toBER(!1),u=e.safeContents[n];switch(fr.assert(`parameters.safeContents[${n}]`,u,"encryptingCertificate","encryptionAlgorithm"),!0){case u.encryptionAlgorithm.name.toLowerCase()==="aes-cbc":case u.encryptionAlgorithm.name.toLowerCase()==="aes-gcm":break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm" in "parameters.safeContents[i]": ${u.encryptionAlgorithm}`)}switch(!0){case u.encryptionAlgorithm.length===128:case u.encryptionAlgorithm.length===192:case u.encryptionAlgorithm.length===256:break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm.length" in "parameters.safeContents[i]": ${u.encryptionAlgorithm.length}`)}let l=u.encryptionAlgorithm;i.addRecipientByCertificate(u.encryptingCertificate,{},void 0,t),await i.encrypt(l,a,t),this.safeContents.push(new Gr({contentType:"1.2.840.113549.1.7.3",content:i.toSchema()}))}break;default:throw new Error(`Incorrect value for "content.privacyMode": ${s.privacyMode}`)}return this}};fB.CLASS_NAME="AuthenticatedSafe";var Pf="hashAlgorithm",kd="issuerNameHash",Ld="issuerKeyHash",Of="serialNumber",gie=[Pf,kd,Ld,Of],Ys=class Ml extends Be{static{o(this,"CertID")}static async create(e,t,n=_t(!0)){let s=new Ml;return await s.createForCertificate(e,t,n),s}constructor(e={}){super(),this.hashAlgorithm=D(e,Pf,Ml.defaultValues(Pf)),this.issuerNameHash=D(e,kd,Ml.defaultValues(kd)),this.issuerKeyHash=D(e,Ld,Ml.defaultValues(Ld)),this.serialNumber=D(e,Of,Ml.defaultValues(Of)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pf:return new ge;case kd:case Ld:return new Ve;case Of:return new me;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Pf:return t.algorithmId===L&&!("algorithmParams"in t);case kd:case Ld:case Of:return t.isEqual(Ml.defaultValues(Of));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.hashAlgorithmObject||{names:{blockName:t.hashAlgorithm||L}}),new Ve({name:t.issuerNameHash||L}),new Ve({name:t.issuerKeyHash||L}),new me({name:t.serialNumber||L})]})}fromSchema(e){_e(e,gie);let t=Ie(e,e,Ml.schema({names:{hashAlgorithm:Pf,issuerNameHash:kd,issuerKeyHash:Ld,serialNumber:Of}}));Ae.assertSchema(t,this.className),this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm}),this.issuerNameHash=t.result.issuerNameHash,this.issuerKeyHash=t.result.issuerKeyHash,this.serialNumber=t.result.serialNumber}toSchema(){return new W({value:[this.hashAlgorithm.toSchema(),this.issuerNameHash,this.issuerKeyHash,this.serialNumber]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),issuerNameHash:this.issuerNameHash.toJSON(),issuerKeyHash:this.issuerKeyHash.toJSON(),serialNumber:this.serialNumber.toJSON()}}isEqual(e){return!(this.hashAlgorithm.algorithmId!==e.hashAlgorithm.algorithmId||!dt.isEqual(this.issuerNameHash.valueBlock.valueHexView,e.issuerNameHash.valueBlock.valueHexView)||!dt.isEqual(this.issuerKeyHash.valueBlock.valueHexView,e.issuerKeyHash.valueBlock.valueHexView)||!this.serialNumber.isEqual(e.serialNumber))}async createForCertificate(e,t,n=_t(!0)){fr.assert(t,Pf,"issuerCertificate");let s=n.getOIDByAlgorithm({name:t.hashAlgorithm},!0,"hashAlgorithm");this.hashAlgorithm=new ge({algorithmId:s,algorithmParams:new Kr});let i=t.issuerCertificate;this.serialNumber=e.serialNumber;let a=await n.digest({name:t.hashAlgorithm},i.subject.toSchema().toBER(!1));this.issuerNameHash=new Ve({valueHex:a});let u=i.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView,l=await n.digest({name:t.hashAlgorithm},u);this.issuerKeyHash=new Ve({valueHex:l})}};Ys.CLASS_NAME="CertID";var Vd="certID",Ud="certStatus",Md="thisUpdate",jl="nextUpdate",kf="singleExtensions",yie=[Vd,Ud,Md,jl,kf],hB=class Fl extends Be{static{o(this,"SingleResponse")}constructor(e={}){super(),this.certID=D(e,Vd,Fl.defaultValues(Vd)),this.certStatus=D(e,Ud,Fl.defaultValues(Ud)),this.thisUpdate=D(e,Md,Fl.defaultValues(Md)),jl in e&&(this.nextUpdate=D(e,jl,Fl.defaultValues(jl))),kf in e&&(this.singleExtensions=D(e,kf,Fl.defaultValues(kf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vd:return new Ys;case Ud:return{};case Md:case jl:return new Date(0,0,0);case kf:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Vd:return Ys.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&Ys.compareWithDefault("issuerNameHash",t.issuerNameHash)&&Ys.compareWithDefault("issuerKeyHash",t.issuerKeyHash)&&Ys.compareWithDefault("serialNumber",t.serialNumber);case Ud:return Object.keys(t).length===0;case Md:case jl:return t===Fl.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ys.schema(t.certID||{}),new Pr({value:[new yt({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:0}}),new ae({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:1},value:[new Rr,new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new zu]})]}),new yt({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:2},lenBlock:{length:1}})]}),new Rr({name:t.thisUpdate||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Rr({name:t.nextUpdate||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[wn.schema(t.singleExtensions||{})]})]})}fromSchema(e){_e(e,yie);let t=Ie(e,e,Fl.schema({names:{certID:{names:{blockName:Vd}},certStatus:Ud,thisUpdate:Md,nextUpdate:jl,singleExtensions:{names:{blockName:kf}}}}));Ae.assertSchema(t,this.className),this.certID=new Ys({schema:t.result.certID}),this.certStatus=t.result.certStatus,this.thisUpdate=t.result.thisUpdate.toDate(),jl in t.result&&(this.nextUpdate=t.result.nextUpdate.toDate()),kf in t.result&&(this.singleExtensions=Array.from(t.result.singleExtensions.valueBlock.value,n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(this.certID.toSchema()),e.push(this.certStatus),e.push(new Rr({valueDate:this.thisUpdate})),this.nextUpdate&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new Rr({valueDate:this.nextUpdate})]})),this.singleExtensions&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W({value:Array.from(this.singleExtensions,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={certID:this.certID.toJSON(),certStatus:this.certStatus.toJSON(),thisUpdate:this.thisUpdate};return this.nextUpdate&&(e.nextUpdate=this.nextUpdate),this.singleExtensions&&(e.singleExtensions=Array.from(this.singleExtensions,t=>t.toJSON())),e}};hB.CLASS_NAME="SingleResponse";var aA="tbs",Lf="version",Ry="responderID",Py="producedAt",Oy="responses",jd="responseExtensions",oh="ResponseData",ZA=`${oh}.${Lf}`,Fd=`${oh}.${Ry}`,pB=`${oh}.${Py}`,dB=`${oh}.${Oy}`,eC=`${oh}.${jd}`,vie=[oh,ZA,Fd,pB,dB,eC],Fo=class Ha extends Be{static{o(this,"ResponseData")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,aA,Ha.defaultValues(aA))),Lf in e&&(this.version=D(e,Lf,Ha.defaultValues(Lf))),this.responderID=D(e,Ry,Ha.defaultValues(Ry)),this.producedAt=D(e,Py,Ha.defaultValues(Py)),this.responses=D(e,Oy,Ha.defaultValues(Oy)),jd in e&&(this.responseExtensions=D(e,jd,Ha.defaultValues(jd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Lf:return 0;case aA:return Qr;case Ry:return{};case Py:return new Date(0,0,0);case Oy:case jd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case aA:return t.byteLength===0;case Ry:return Object.keys(t).length===0;case Py:return t===Ha.defaultValues(e);case Oy:case jd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||oh,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.version||ZA})]}),new Pr({value:[new ae({name:t.responderID||Fd,idBlock:{tagClass:3,tagNumber:1},value:[Or.schema(t.ResponseDataByName||{names:{blockName:"ResponseData.byName"}})]}),new ae({name:t.responderID||Fd,idBlock:{tagClass:3,tagNumber:2},value:[new Ve({name:t.ResponseDataByKey||"ResponseData.byKey"})]})]}),new Rr({name:t.producedAt||pB}),new W({value:[new Tt({name:dB,value:hB.schema(t.response||{})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[wn.schema(t.extensions||{names:{blockName:eC}})]})]})}fromSchema(e){_e(e,vie);let t=Ie(e,e,Ha.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.ResponseData.valueBeforeDecodeView,ZA in t.result&&(this.version=t.result[ZA].valueBlock.valueDec),t.result[Fd].idBlock.tagNumber===1?this.responderID=new Or({schema:t.result[Fd].valueBlock.value[0]}):this.responderID=t.result[Fd].valueBlock.value[0],this.producedAt=t.result[pB].toDate(),this.responses=Array.from(t.result[dB],n=>new hB({schema:n})),eC in t.result&&(this.responseExtensions=Array.from(t.result[eC].valueBlock.value,n=>new _i({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return Ha.schema();let n=Hr(this.tbsView);Ae.assert(n,"TBS Response Data"),t=n.result}else{let n=[];Lf in this&&n.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),this.responderID instanceof Or?n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.responderID.toSchema()]})):n.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.responderID]})),n.push(new Rr({valueDate:this.producedAt})),n.push(new W({value:Array.from(this.responses,s=>s.toSchema())})),this.responseExtensions&&n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W({value:Array.from(this.responseExtensions,s=>s.toSchema())})]})),t=new W({value:n})}return t}toJSON(){let e={};return Lf in this&&(e.version=this.version),this.responderID&&(e.responderID=this.responderID),this.producedAt&&(e.producedAt=this.producedAt),this.responses&&(e.responses=Array.from(this.responses,t=>t.toJSON())),this.responseExtensions&&(e.responseExtensions=Array.from(this.responseExtensions,t=>t.toJSON())),e}};Fo.CLASS_NAME="ResponseData";var mI="trustedCerts",gI="certs",yI="crls",vI="ocsps",wI="checkDate",SI="findOrigin",EI="findIssuer",Qf;(function(r){r[r.unknown=-1]="unknown",r[r.success=0]="success",r[r.noRevocation=11]="noRevocation",r[r.noPath=60]="noPath",r[r.noValidPath=97]="noValidPath"})(Qf||(Qf={}));var qd=class Y6 extends Error{static{o(this,"ChainValidationError")}constructor(e,t){super(t),this.name=Y6.NAME,this.code=e,this.message=t}};qd.NAME="ChainValidationError";function wie(r,e){for(let t=0;t<e.length;t++)if(dt.isEqual(r.tbsView,e[t].tbsView))return!0;return!1}o(wie,"isTrusted");var Q6=class Z6{static{o(this,"CertificateChainValidationEngine")}constructor(e={}){this.trustedCerts=D(e,mI,this.defaultValues(mI)),this.certs=D(e,gI,this.defaultValues(gI)),this.crls=D(e,yI,this.defaultValues(yI)),this.ocsps=D(e,vI,this.defaultValues(vI)),this.checkDate=D(e,wI,this.defaultValues(wI)),this.findOrigin=D(e,SI,this.defaultValues(SI)),this.findIssuer=D(e,EI,this.defaultValues(EI))}static defaultFindOrigin(e,t){e.tbsView.byteLength===0&&(e.tbsView=new Uint8Array(e.encodeTBS().toBER()));for(let n of t.certs)if(n.tbsView.byteLength===0&&(n.tbsView=new Uint8Array(n.encodeTBS().toBER())),dt.isEqual(e.tbsView,n.tbsView))return"Intermediate Certificates";for(let n of t.trustedCerts)if(n.tbsView.byteLength===0&&(n.tbsView=new Uint8Array(n.encodeTBS().toBER())),dt.isEqual(e.tbsView,n.tbsView))return"Trusted Certificates";return"Unknown"}async defaultFindIssuer(e,t,n=_t(!0)){let s=[],i=null,a=null,u=null;if(e.subject.isEqual(e.issuer))try{if(await e.verify(void 0,n))return[e]}catch{}if(e.extensions){for(let f of e.extensions)if(f.extnID===kB&&f.parsedValue instanceof MB){f.parsedValue.keyIdentifier?i=f.parsedValue.keyIdentifier:(f.parsedValue.authorityCertIssuer&&(a=f.parsedValue.authorityCertIssuer),f.parsedValue.authorityCertSerialNumber&&(u=f.parsedValue.authorityCertSerialNumber));break}}function l(f){if(i!==null&&f.extensions){let m=!1;for(let g of f.extensions)if(g.extnID===Ene&&g.parsedValue){m=!0,dt.isEqual(g.parsedValue.valueBlock.valueHex,i.valueBlock.valueHexView)&&s.push(f);break}if(m)return}let h=!1;u!==null&&(h=f.serialNumber.isEqual(u)),a!==null?f.subject.isEqual(a)&&h&&s.push(f):e.issuer.isEqual(f.subject)&&s.push(f)}o(l,"checkCertificate");for(let f of t.trustedCerts)l(f);for(let f of t.certs)l(f);for(let f=s.length-1;f>=0;f--)try{await e.verify(s[f],n)===!1&&s.splice(f,1)}catch{s.splice(f,1)}return s}defaultValues(e){switch(e){case mI:return[];case gI:return[];case yI:return[];case vI:return[];case wI:return new Date;case SI:return Z6.defaultFindOrigin;case EI:return this.defaultFindIssuer;default:throw new Error(`Invalid member name for CertificateChainValidationEngine class: ${e}`)}}async sort(e=!1,t=_t(!0)){let n=[],s=o(async(y,S)=>{let E=[];function b(A){let C=!0;for(let x=0;x<A.length;x++){for(let B=0;B<A.length;B++)if(B!==x&&A[x]===A[B]){C=!1;break}if(!C)break}return C}if(o(b,"checkUnique"),wie(y,this.trustedCerts))return[[y]];let T=await this.findIssuer(y,this,S);if(T.length===0)throw new Error("No valid certificate paths found");for(let A=0;A<T.length;A++){if(dt.isEqual(T[A].tbsView,y.tbsView)){E.push([T[A]]);continue}let C=await s(T[A],S);for(let x=0;x<C.length;x++){let B=C[x].slice();B.splice(0,0,T[A]),b(B)?E.push(B):E.push(C[x])}}return E},"buildPath"),i=o(async y=>{let S=[],E=[],b=[];if(S.push(...n.filter(T=>y.issuer.isEqual(T.subject))),S.length===0)return{status:1,statusMessage:"No certificate's issuers"};if(E.push(...this.crls.filter(T=>T.issuer.isEqual(y.issuer))),E.length===0)return{status:2,statusMessage:"No CRLs for specific certificate issuer"};for(let T=0;T<E.length;T++){let A=E[T];if(!(A.nextUpdate&&A.nextUpdate.value<this.checkDate))for(let C=0;C<S.length;C++)try{if(await E[T].verify({issuerCertificate:S[C]},t)){b.push({crl:E[T],certificate:S[C]});break}}catch{}}return b.length?{status:0,statusMessage:L,result:b}:{status:3,statusMessage:"No valid CRLs found"}},"findCRL"),a=o(async(y,S)=>{let E=t.getAlgorithmByOID(y.signatureAlgorithm.algorithmId);if(!E.name||!E.hash)return 1;for(let b=0;b<this.ocsps.length;b++){let A=await this.ocsps[b].getCertificateStatus(y,S,t);if(A.isForCertificate)return A.status===0?0:1}return 2},"findOCSP");async function u(y,S=!1){let E=!1,b=!1,T=!1,A=!1;if(y.extensions){for(let C=0;C<y.extensions.length;C++){let x=y.extensions[C];if(x.critical&&!x.parsedValue)return{result:!1,resultCode:6,resultMessage:`Unable to parse critical certificate extension: ${x.extnID}`};if(x.extnID===Ane){T=!0;let B=new Uint8Array(x.parsedValue.valueBlock.valueHex);(B[0]&4)===4&&(b=!0),(B[0]&2)===2&&(A=!0)}x.extnID===PB&&"cA"in x.parsedValue&&x.parsedValue.cA===!0&&(E=!0)}if(b===!0&&E===!1)return{result:!1,resultCode:3,resultMessage:'Unable to build certificate chain - using "keyCertSign" flag set without BasicConstraints'};if(T===!0&&E===!0&&b===!1)return{result:!1,resultCode:4,resultMessage:'Unable to build certificate chain - "keyCertSign" flag was not set'};if(E===!0&&T===!0&&S&&A===!1)return{result:!1,resultCode:5,resultMessage:'Unable to build certificate chain - intermediate certificate must have "cRLSign" key usage flag'}}return E===!1?{result:!1,resultCode:7,resultMessage:"Unable to build certificate chain - more than one possible end-user certificate"}:{result:!0,resultCode:0,resultMessage:L}}o(u,"checkForCA");let l=o(async(y,S)=>{for(let E=0;E<y.length;E++)if(y[E].notBefore.value>S||y[E].notAfter.value<S)return{result:!1,resultCode:8,resultMessage:"The certificate is either not yet valid or expired"};if(y.length<2)return{result:!1,resultCode:9,resultMessage:"Too short certificate path"};for(let E=y.length-2;E>=0;E--)if(y[E].issuer.isEqual(y[E].subject)===!1&&y[E].issuer.isEqual(y[E+1].subject)===!1)return{result:!1,resultCode:10,resultMessage:"Incorrect name chaining"};if(this.crls.length!==0||this.ocsps.length!==0)for(let E=0;E<y.length-1;E++){let b=2,T={status:0,statusMessage:L};if(this.ocsps.length!==0)switch(b=await a(y[E],y[E+1]),b){case 0:continue;case 1:return{result:!1,resultCode:12,resultMessage:"One of certificates was revoked via OCSP response"}}if(this.crls.length!==0){if(T=await i(y[E]),T.status===0&&T.result)for(let A=0;A<T.result.length;A++){if(T.result[A].crl.isCertificateRevoked(y[E]))return{result:!1,resultCode:12,resultMessage:"One of certificates had been revoked"};if((await u(T.result[A].certificate,!0)).result===!1)return{result:!1,resultCode:13,resultMessage:"CRL issuer certificate is not a CA certificate or does not have crlSign flag"}}else if(e===!1)throw new qd(Qf.noRevocation,`No revocation values found for one of certificates: ${T.statusMessage}`)}else if(b===2)return{result:!1,resultCode:11,resultMessage:"No revocation values found for one of certificates"};if(b===2&&T.status===2&&e){let A=y[E+1],C=!1;if(A.extensions)for(let x of A.extensions)switch(x.extnID){case w6:case OB:case LB:C=!0;break}if(C)throw new qd(Qf.noRevocation,`No revocation values found for one of certificates: ${T.statusMessage}`)}}for(let[E,b]of y.entries()){if(!E)continue;if(!(await u(b)).result)return{result:!1,resultCode:14,resultMessage:"One of intermediate certificates is not a CA certificate"}}return{result:!0}},"basicCheck");n.push(...this.trustedCerts),n.push(...this.certs);for(let y=0;y<n.length;y++)for(let S=0;S<n.length;S++)if(y!==S&&dt.isEqual(n[y].tbsView,n[S].tbsView)){n.splice(S,1),y=0;break}let f=n[n.length-1],h,m=[f];if(h=await s(f,t),h.length===0)throw new qd(Qf.noPath,"Unable to find certificate path");for(let y=h.length-1;y>=0;y--){let S=!1;for(let E=0;E<h[y].length;E++){let b=h[y][E];for(let T=0;T<this.trustedCerts.length;T++)if(dt.isEqual(b.tbsView,this.trustedCerts[T].tbsView)){S=!0;break}if(S)break}S||h.splice(y,1)}if(h.length===0)throw new qd(Qf.noValidPath,"No valid certificate paths found");let g=h[0].length,w=0;for(let y=0;y<h.length;y++)h[y].length<g&&(g=h[y].length,w=y);for(let y=0;y<h[w].length;y++)m.push(h[w][y]);if(h=await l(m,this.checkDate),h.result===!1)throw h;return m}async verify(e={},t=_t(!0)){function n(l,f){let h=Jl(l),m=Jl(f),g=h.split("."),w=m.split("."),y=g.length,S=w.length;if(y===0||S===0||y<S)return!1;for(let E=0;E<y;E++)if(g[E].length===0)return!1;for(let E=0;E<S;E++)if(w[E].length===0){if(E===0){if(S===1)return!1;continue}return!1}for(let E=0;E<S;E++)if(w[S-1-E].length!==0&&g[y-1-E].localeCompare(w[S-1-E])!==0)return!1;return!0}o(n,"compareDNSName");function s(l,f){let h=Jl(l),m=Jl(f),g=h.split("@"),w=m.split("@");if(g.length===0||w.length===0||g.length<w.length)return!1;if(w.length===1){if(n(g[1],w[0])){let S=g[1].split("."),E=w[0].split(".");return E[0].length===0?!0:S.length===E.length}return!1}return h.localeCompare(m)===0}o(s,"compareRFC822Name");function i(l,f){let h=Jl(l),m=Jl(f),g=h.split("/");if(m.split("/").length>1)return!1;if(g.length>1){for(let S=0;S<g.length;S++)if(g[S].length>0&&g[S].charAt(g[S].length-1)!==":"){h=g[S].split(":")[0];break}}if(n(h,m)){let S=h.split("."),E=m.split(".");return E[0].length===0?!0:S.length===E.length}return!1}o(i,"compareUniformResourceIdentifier");function a(l,f){let h=l.valueBlock.valueHexView,m=f.valueBlock.valueHexView;if(h.length===4&&m.length===8){for(let g=0;g<4;g++)if((h[g]^m[g])&m[g+4])return!1;return!0}if(h.length===16&&m.length===32){for(let g=0;g<16;g++)if((h[g]^m[g])&m[g+16])return!1;return!0}return!1}o(a,"compareIPAddress");function u(l,f){if(l.typesAndValues.length===0||f.typesAndValues.length===0)return!0;if(l.typesAndValues.length<f.typesAndValues.length)return!1;let h=!0,m=0;for(let g=0;g<f.typesAndValues.length;g++){let w=!1;for(let y=m;y<l.typesAndValues.length;y++)if(w=l.typesAndValues[y].isEqual(f.typesAndValues[g]),l.typesAndValues[y].type===f.typesAndValues[g].type&&(h=h&&w),w===!0)if(m===0||m===y){m=y+1;break}else return!1;if(w===!1)return!1}return m===0?!1:h}o(u,"compareDirectoryName");try{if(this.certs.length===0)throw new Error("Empty certificate array");let l=e.passedWhenNotRevValues||!1,f=e.initialPolicySet||[Ti],h=e.initialExplicitPolicy||!1,m=e.initialPolicyMappingInhibit||!1,g=e.initialInhibitPolicy||!1,w=e.initialPermittedSubtreesSet||[],y=e.initialExcludedSubtreesSet||[],S=e.initialRequiredNameForms||[],E=h,b=m,T=g,A=[!1,!1,!1],C=0,x=0,B=0,F=w,R=y,H=S,q=1;this.certs=await this.sort(l,t);let K=[];K.push(Ti);let G=[],he=new Array(this.certs.length-1);for(let be=0;be<this.certs.length-1;be++)he[be]=!0;G.push(he);let le=new Array(this.certs.length-1),oe=new Array(this.certs.length-1),Z=E?this.certs.length-1:-1;for(let be=this.certs.length-2;be>=0;be--,q++){let we=this.certs[be];if(we.extensions){for(let Me=0;Me<we.extensions.length;Me++){let Je=we.extensions[Me];if(Je.extnID===S6){oe[be]=Je.parsedValue;for(let Ye=0;Ye<K.length;Ye++)if(K[Ye]===Ti){delete G[Ye][be];break}for(let Ye=0;Ye<Je.parsedValue.certificatePolicies.length;Ye++){let lt=-1,O=Je.parsedValue.certificatePolicies[Ye].policyIdentifier;for(let _=0;_<K.length;_++)if(O===K[_]){lt=_;break}if(lt===-1){K.push(O);let _=new Array(this.certs.length-1);_[be]=!0,G.push(_)}else G[lt][be]=!0}}if(Je.extnID===E6){if(b)return{result:!1,resultCode:98,resultMessage:"Policy mapping prohibited"};le[be]=Je.parsedValue}Je.extnID===A6&&E===!1&&(Je.parsedValue.requireExplicitPolicy===0?(E=!0,Z=be):A[0]===!1?(A[0]=!0,C=Je.parsedValue.requireExplicitPolicy):C=C>Je.parsedValue.requireExplicitPolicy?Je.parsedValue.requireExplicitPolicy:C,Je.parsedValue.inhibitPolicyMapping===0?b=!0:A[1]===!1?(A[1]=!0,x=Je.parsedValue.inhibitPolicyMapping+1):x=x>Je.parsedValue.inhibitPolicyMapping+1?Je.parsedValue.inhibitPolicyMapping+1:x),Je.extnID===Dne&&T===!1&&(Je.parsedValue.valueBlock.valueDec===0?T=!0:A[2]===!1?(A[2]=!0,B=Je.parsedValue.valueBlock.valueDec):B=B>Je.parsedValue.valueBlock.valueDec?Je.parsedValue.valueBlock.valueDec:B)}if(T===!0){let Me=-1;for(let Je=0;Je<K.length;Je++)if(K[Je]===Ti){Me=Je;break}Me!==-1&&delete G[0][be]}E===!1&&A[0]===!0&&(C--,C===0&&(E=!0,Z=be,A[0]=!1)),b===!1&&A[1]===!0&&(x--,x===0&&(b=!0,A[1]=!1)),T===!1&&A[2]===!0&&(B--,B===0&&(T=!0,A[2]=!1))}}for(let be=0;be<this.certs.length-1;be++)if(be<this.certs.length-2&&typeof le[be+1]<"u")for(let we=0;we<le[be+1].mappings.length;we++){if(le[be+1].mappings[we].issuerDomainPolicy===Ti||le[be+1].mappings[we].subjectDomainPolicy===Ti)return{result:!1,resultCode:99,resultMessage:'The "anyPolicy" should not be a part of policy mapping scheme'};let Me=-1,Je=-1;for(let Ye=0;Ye<K.length;Ye++)K[Ye]===le[be+1].mappings[we].issuerDomainPolicy&&(Me=Ye),K[Ye]===le[be+1].mappings[we].subjectDomainPolicy&&(Je=Ye);typeof G[Me][be]<"u"&&delete G[Me][be];for(let Ye=0;Ye<oe[be].certificatePolicies.length;Ye++)if(le[be+1].mappings[we].subjectDomainPolicy===oe[be].certificatePolicies[Ye].policyIdentifier&&Me!==-1&&Je!==-1)for(let lt=0;lt<=be;lt++)typeof G[Je][lt]<"u"&&(G[Me][lt]=!0,delete G[Je][lt])}for(let be=0;be<K.length;be++)if(K[be]===Ti)for(let we=0;we<Z;we++)delete G[be][we];let fe=[];for(let be=0;be<G.length;be++){let we=!0;for(let Me=0;Me<this.certs.length-1;Me++){let Je=!1;if(Me<Z&&K[be]===Ti&&K.length>1){we=!1;break}if(typeof G[be][Me]>"u"){if(Me>=Z){for(let Ye=0;Ye<K.length;Ye++)if(K[Ye]===Ti){G[Ye][Me]===!0&&(Je=!0);break}}if(!Je){we=!1;break}}}we===!0&&fe.push(K[be])}let Se=[];if(f.length===1&&f[0]===Ti&&E===!1)Se=f;else if(fe.length===1&&fe[0]===Ti)Se=f;else for(let be=0;be<fe.length;be++)for(let we=0;we<f.length;we++)if(f[we]===fe[be]||f[we]===Ti){Se.push(fe[be]);break}let Ke={result:Se.length>0,resultCode:0,resultMessage:Se.length>0?L:'Zero "userConstrPolicies" array, no intersections with "authConstrPolicies"',authConstrPolicies:fe,userConstrPolicies:Se,explicitPolicyIndicator:E,policyMappings:le,certificatePath:this.certs};if(Se.length===0||Ke.result===!1)return Ke;q=1;for(let be=this.certs.length-2;be>=0;be--,q++){let we=this.certs[be],Me=[],Je=[],Ye=[];if(we.extensions)for(let ne=0;ne<we.extensions.length;ne++){let J=we.extensions[ne];J.extnID===v6&&("permittedSubtrees"in J.parsedValue&&(Je=Je.concat(J.parsedValue.permittedSubtrees)),"excludedSubtrees"in J.parsedValue&&(Ye=Ye.concat(J.parsedValue.excludedSubtrees))),J.extnID===d6&&(Me=Me.concat(J.parsedValue.altNames))}let lt=H.length<=0;for(let ne=0;ne<H.length;ne++)switch(H[ne].base.type){case 4:{if(H[ne].base.value.typesAndValues.length!==we.subject.typesAndValues.length)continue;lt=!0;for(let J=0;J<we.subject.typesAndValues.length;J++)if(we.subject.typesAndValues[J].type!==H[ne].base.value.typesAndValues[J].type){lt=!1;break}if(lt===!0)break}break;default:}if(lt===!1)throw Ke.result=!1,Ke.resultCode=21,Ke.resultMessage="No necessary name form found",Ke;let O=[[],[],[],[],[]];for(let ne=0;ne<F.length;ne++)switch(F[ne].base.type){case 1:O[0].push(F[ne]);break;case 2:O[1].push(F[ne]);break;case 4:O[2].push(F[ne]);break;case 6:O[3].push(F[ne]);break;case 7:O[4].push(F[ne]);break;default:}for(let ne=0;ne<5;ne++){let J=!1,Xe=!1,Re=O[ne];for(let xe=0;xe<Re.length;xe++){switch(ne){case 0:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===1&&(Xe=!0,J=J||s(Me[ct].value,Re[xe].base.value));else for(let ct=0;ct<we.subject.typesAndValues.length;ct++)(we.subject.typesAndValues[ct].type==="1.2.840.113549.1.9.1"||we.subject.typesAndValues[ct].type==="0.9.2342.19200300.100.1.3")&&(Xe=!0,J=J||s(we.subject.typesAndValues[ct].value.valueBlock.value,Re[xe].base.value));break;case 1:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===2&&(Xe=!0,J=J||n(Me[ct].value,Re[xe].base.value));break;case 2:Xe=!0,J=u(we.subject,Re[xe].base.value);break;case 3:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===6&&(Xe=!0,J=J||i(Me[ct].value,Re[xe].base.value));break;case 4:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===7&&(Xe=!0,J=J||a(Me[ct].value,Re[xe].base.value));break;default:}if(J)break}if(J===!1&&Re.length>0&&Xe)throw Ke.result=!1,Ke.resultCode=41,Ke.resultMessage='Failed to meet "permitted sub-trees" name constraint',Ke}let _=!1;for(let ne=0;ne<R.length;ne++){switch(R[ne].base.type){case 1:if(Me.length>=0)for(let J=0;J<Me.length;J++)Me[J].type===1&&(_=_||s(Me[J].value,R[ne].base.value));else for(let J=0;J<we.subject.typesAndValues.length;J++)(we.subject.typesAndValues[J].type==="1.2.840.113549.1.9.1"||we.subject.typesAndValues[J].type==="0.9.2342.19200300.100.1.3")&&(_=_||s(we.subject.typesAndValues[J].value.valueBlock.value,R[ne].base.value));break;case 2:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===2&&(_=_||n(Me[J].value,R[ne].base.value));break;case 4:_=_||u(we.subject,R[ne].base.value);break;case 6:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===6&&(_=_||i(Me[J].value,R[ne].base.value));break;case 7:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===7&&(_=_||a(Me[J].value,R[ne].base.value));break;default:}if(_)break}if(_===!0)throw Ke.result=!1,Ke.resultCode=42,Ke.resultMessage='Failed to meet "excluded sub-trees" name constraint',Ke;F=F.concat(Je),R=R.concat(Ye)}return Ke}catch(l){return l instanceof Error?l instanceof qd?{result:!1,resultCode:l.code,resultMessage:l.message,error:l}:{result:!1,resultCode:Qf.unknown,resultMessage:l.message,error:l}:l&&typeof l=="object"&&"resultMessage"in l?l:{result:!1,resultCode:-1,resultMessage:`${l}`}}}},tC="tbsResponseData",ky="signatureAlgorithm",Ly="signature",Hd="certs",pv="BasicOCSPResponse",mB=`${pv}.${tC}`,gB=`${pv}.${ky}`,yB=`${pv}.${Ly}`,rC=`${pv}.${Hd}`,Sie=[mB,gB,yB,rC],uv=class Vf extends Be{static{o(this,"BasicOCSPResponse")}constructor(e={}){super(),this.tbsResponseData=D(e,tC,Vf.defaultValues(tC)),this.signatureAlgorithm=D(e,ky,Vf.defaultValues(ky)),this.signature=D(e,Ly,Vf.defaultValues(Ly)),Hd in e&&(this.certs=D(e,Hd,Vf.defaultValues(Hd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case tC:return new Fo;case ky:return new ge;case Ly:return new qt;case Hd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"type":{let n=Fo.compareWithDefault("tbs",t.tbs)&&Fo.compareWithDefault("responderID",t.responderID)&&Fo.compareWithDefault("producedAt",t.producedAt)&&Fo.compareWithDefault("responses",t.responses);return"responseExtensions"in t&&(n=n&&Fo.compareWithDefault("responseExtensions",t.responseExtensions)),n}case ky:return t.algorithmId===L&&!("algorithmParams"in t);case Ly:return t.isEqual(Vf.defaultValues(e));case Hd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||pv,value:[Fo.schema(t.tbsResponseData||{names:{blockName:mB}}),ge.schema(t.signatureAlgorithm||{names:{blockName:gB}}),new qt({name:t.signature||yB}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:[new Tt({name:rC,value:ts.schema(t.certs||{})})]})]})]})}fromSchema(e){_e(e,Sie);let t=Ie(e,e,Vf.schema());Ae.assertSchema(t,this.className),this.tbsResponseData=new Fo({schema:t.result[mB]}),this.signatureAlgorithm=new ge({schema:t.result[gB]}),this.signature=t.result[yB],rC in t.result&&(this.certs=Array.from(t.result[rC],n=>new ts({schema:n})))}toSchema(){let e=[];return e.push(this.tbsResponseData.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.certs,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={tbsResponseData:this.tbsResponseData.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.certs&&(e.certs=Array.from(this.certs,t=>t.toJSON())),e}async getCertificateStatus(e,t,n=_t(!0)){let s={isForCertificate:!1,status:2},i={},a=[];for(let u of this.tbsResponseData.responses){let l=n.getAlgorithmByOID(u.certID.hashAlgorithm.algorithmId,!0,"CertID.hashAlgorithm");if(!i[l.name]){i[l.name]=1;let f=new Ys;a.push(f),await f.createForCertificate(e,{hashAlgorithm:l.name,issuerCertificate:t},n)}}for(let u of this.tbsResponseData.responses)for(let l of a)if(u.certID.isEqual(l)){s.isForCertificate=!0;try{switch(u.certStatus.idBlock.isConstructed){case!0:u.certStatus.idBlock.tagNumber===1&&(s.status=1);break;case!1:switch(u.certStatus.idBlock.tagNumber){case 0:s.status=0;break;case 2:s.status=2;break;default:}break;default:}}catch{}return s}return s}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters.algorithm;if(!("name"in i))throw new Error("Empty algorithm");this.signatureAlgorithm=s.signatureAlgorithm,this.tbsResponseData.tbsView=new Uint8Array(this.tbsResponseData.toSchema(!0).toBER());let a=await n.signWithPrivateKey(this.tbsResponseData.tbsView,e,{algorithm:i});this.signature=new qt({valueHex:a})}async verify(e={},t=_t(!0)){let n=null,s=-1,i=e.trustedCerts||[];if(!this.certs)throw new Error("No certificates attached to the BasicOCSPResponse");switch(!0){case this.tbsResponseData.responderID instanceof Or:for(let[f,h]of this.certs.entries())if(h.subject.isEqual(this.tbsResponseData.responderID)){s=f;break}break;case this.tbsResponseData.responderID instanceof Ve:for(let[f,h]of this.certs.entries()){let m=await t.digest({name:"sha-1"},h.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Wu(m,this.tbsResponseData.responderID.valueBlock.valueHex)){s=f;break}}break;default:throw new Error("Wrong value for responderID")}if(s===-1)throw new Error("Correct certificate was not found in OCSP response");n=this.certs[s];let a=[n];for(let f of this.certs){let h=await H6(f,n);h&&a.push(h)}if(!(await new Q6({certs:a,trustedCerts:i}).verify({},t)).result)throw new Error("Validation of signer's certificate failed");return t.verifyWithPublicKey(this.tbsResponseData.tbsView,this.signature,this.certs[s].subjectPublicKeyInfo,this.signatureAlgorithm)}};uv.CLASS_NAME="BasicOCSPResponse";var AI="tbs",CI="version",bI="subject",xI="subjectPublicKeyInfo",Op="attributes",Vy="signatureAlgorithm",Uy="signatureValue",E0="CertificationRequestInfo",WB=`${E0}.version`,JB=`${E0}.subject`,zB=`${E0}.subjectPublicKeyInfo`,qC=`${E0}.attributes`,Eie=[E0,WB,JB,zB,qC,Vy,Uy];function Aie(r={}){let e=D(r,"names",{});return new W({name:e.CertificationRequestInfo||E0,value:[new me({name:e.CertificationRequestInfoVersion||WB}),Or.schema(e.subject||{names:{blockName:JB}}),na.schema({names:{blockName:zB}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({optional:!0,name:e.CertificationRequestInfoAttributes||qC,value:Zr.schema(e.attributes||{})})]})]})}o(Aie,"CertificationRequestInfo");var Cie=class Ka extends Be{static{o(this,"CertificationRequest")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,AI,Ka.defaultValues(AI))),this.version=D(e,CI,Ka.defaultValues(CI)),this.subject=D(e,bI,Ka.defaultValues(bI)),this.subjectPublicKeyInfo=D(e,xI,Ka.defaultValues(xI)),Op in e&&(this.attributes=D(e,Op,Ka.defaultValues(Op))),this.signatureAlgorithm=D(e,Vy,Ka.defaultValues(Vy)),this.signatureValue=D(e,Uy,Ka.defaultValues(Uy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case AI:return Qr;case CI:return 0;case bI:return new Or;case xI:return new na;case Op:return[];case Vy:return new ge;case Uy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({value:[Aie(t.certificationRequestInfo||{}),new W({name:t.signatureAlgorithm||Vy,value:[new rt,new St({optional:!0})]}),new qt({name:t.signatureValue||Uy})]})}fromSchema(e){_e(e,Eie);let t=Ie(e,e,Ka.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.CertificationRequestInfo.valueBeforeDecodeView,this.version=t.result[WB].valueBlock.valueDec,this.subject=new Or({schema:t.result[JB]}),this.subjectPublicKeyInfo=new na({schema:t.result[zB]}),qC in t.result&&(this.attributes=Array.from(t.result[qC],n=>new Zr({schema:n}))),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[new me({value:this.version}),this.subject.toSchema(),this.subjectPublicKeyInfo.toSchema()];return Op in this&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes||[],t=>t.toSchema())})),new W({value:e})}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return Ka.schema();let n=Hr(this.tbsView);Ae.assert(n,"PKCS#10 Certificate Request"),t=n.result}else t=this.encodeTBS();return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return Op in this&&(e.attributes=Array.from(this.attributes||[],t=>t.toJSON())),e}async sign(e,t="SHA-1",n=_t(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters;this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new qt({valueHex:a})}async verify(e=_t(!0)){return e.verifyWithPublicKey(this.tbsView,this.signatureValue,this.subjectPublicKeyInfo,this.signatureAlgorithm)}async getPublicKey(e,t=_t(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}};Cie.CLASS_NAME="CertificationRequest";var Uf="digestAlgorithm",Mf="digest",bie=[Uf,Mf],Zf=class My extends Be{static{o(this,"DigestInfo")}constructor(e={}){super(),this.digestAlgorithm=D(e,Uf,My.defaultValues(Uf)),this.digest=D(e,Mf,My.defaultValues(Mf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Uf:return new ge;case Mf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Uf:return ge.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case Mf:return t.isEqual(My.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.digestAlgorithm||{names:{blockName:Uf}}),new Ve({name:t.digest||Mf})]})}fromSchema(e){_e(e,bie);let t=Ie(e,e,My.schema({names:{digestAlgorithm:{names:{blockName:Uf}},digest:Mf}}));Ae.assertSchema(t,this.className),this.digestAlgorithm=new ge({schema:t.result.digestAlgorithm}),this.digest=t.result.digest}toSchema(){return new W({value:[this.digestAlgorithm.toSchema(),this.digest]})}toJSON(){return{digestAlgorithm:this.digestAlgorithm.toJSON(),digest:this.digest.toJSON()}}};Zf.CLASS_NAME="DigestInfo";var Kd="eContentType",ea="eContent",xie=[Kd,ea],eh=class jf extends Be{static{o(this,"EncapsulatedContentInfo")}constructor(e={}){if(super(),this.eContentType=D(e,Kd,jf.defaultValues(Kd)),ea in e&&(this.eContent=D(e,ea,jf.defaultValues(ea)),this.eContent.idBlock.tagClass===1&&this.eContent.idBlock.tagNumber===4&&this.eContent.idBlock.isConstructed===!1)){let t=new Ve({idBlock:{isConstructed:!0},isConstructed:!0}),n=0,s=this.eContent.valueBlock.valueHexView.slice().buffer,i=s.byteLength;for(;i>0;){let a=new Uint8Array(s,n,n+65536>s.byteLength?s.byteLength-n:65536),u=new ArrayBuffer(a.length),l=new Uint8Array(u);for(let f=0;f<l.length;f++)l[f]=a[f];t.valueBlock.value.push(new Ve({valueHex:u})),i-=a.length,n+=a.length}this.eContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Kd:return L;case ea:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Kd:return t===L;case ea:return t.idBlock.tagClass===1&&t.idBlock.tagNumber===4?t.isEqual(jf.defaultValues(ea)):!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.eContentType||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.eContent||L})]})]})}fromSchema(e){_e(e,xie);let t=Ie(e,e,jf.schema({names:{eContentType:Kd,eContent:ea}}));Ae.assertSchema(t,this.className),this.eContentType=t.result.eContentType.valueBlock.toString(),ea in t.result&&(this.eContent=t.result.eContent)}toSchema(){let e=[];return e.push(new rt({value:this.eContentType})),this.eContent&&jf.compareWithDefault(ea,this.eContent)===!1&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.eContent]})),new W({value:e})}toJSON(){let e={eContentType:this.eContentType};return this.eContent&&jf.compareWithDefault(ea,this.eContent)===!1&&(e.eContent=this.eContent.toJSON()),e}};eh.CLASS_NAME="EncapsulatedContentInfo";var Ff="mac",qf="macSalt",qo="iterations",Nie=[Ff,qf,qo],ql=class Hf extends Be{static{o(this,"MacData")}constructor(e={}){super(),this.mac=D(e,Ff,Hf.defaultValues(Ff)),this.macSalt=D(e,qf,Hf.defaultValues(qf)),qo in e&&(this.iterations=D(e,qo,Hf.defaultValues(qo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ff:return new Zf;case qf:return new Ve;case qo:return 1;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ff:return Zf.compareWithDefault("digestAlgorithm",t.digestAlgorithm)&&Zf.compareWithDefault("digest",t.digest);case qf:return t.isEqual(Hf.defaultValues(e));case qo:return t===Hf.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:t.optional||!0,value:[Zf.schema(t.mac||{names:{blockName:Ff}}),new Ve({name:t.macSalt||qf}),new me({optional:!0,name:t.iterations||qo})]})}fromSchema(e){_e(e,Nie);let t=Ie(e,e,Hf.schema({names:{mac:{names:{blockName:Ff}},macSalt:qf,iterations:qo}}));Ae.assertSchema(t,this.className),this.mac=new Zf({schema:t.result.mac}),this.macSalt=t.result.macSalt,qo in t.result&&(this.iterations=t.result.iterations.valueBlock.valueDec)}toSchema(){let e=[this.mac.toSchema(),this.macSalt];return this.iterations!==void 0&&e.push(new me({value:this.iterations})),new W({value:e})}toJSON(){let e={mac:this.mac.toJSON(),macSalt:this.macSalt.toJSON()};return this.iterations!==void 0&&(e.iterations=this.iterations),e}};ql.CLASS_NAME="MacData";var th="hashAlgorithm",rh="hashedMessage",Tie=[th,rh],ra=class $d extends Be{static{o(this,"MessageImprint")}static async create(e,t,n=_t(!0)){let s=n.getOIDByAlgorithm({name:e},!0,"hashAlgorithm"),i=await n.digest(e,t);return new $d({hashAlgorithm:new ge({algorithmId:s,algorithmParams:new Kr}),hashedMessage:new Ve({valueHex:i})})}constructor(e={}){super(),this.hashAlgorithm=D(e,th,$d.defaultValues(th)),this.hashedMessage=D(e,rh,$d.defaultValues(rh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case th:return new ge;case rh:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case th:return t.algorithmId===L&&!("algorithmParams"in t);case rh:return t.isEqual($d.defaultValues(e))===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.hashAlgorithm||{}),new Ve({name:t.hashedMessage||L})]})}fromSchema(e){_e(e,Tie);let t=Ie(e,e,$d.schema({names:{hashAlgorithm:{names:{blockName:th}},hashedMessage:rh}}));Ae.assertSchema(t,this.className),this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm}),this.hashedMessage=t.result.hashedMessage}toSchema(){return new W({value:[this.hashAlgorithm.toSchema(),this.hashedMessage]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),hashedMessage:this.hashedMessage.toJSON()}}};ra.CLASS_NAME="MessageImprint";var Xd="reqCert",Hl="singleRequestExtensions",Iie=[Xd,Hl],HC=class jy extends Be{static{o(this,"Request")}constructor(e={}){super(),this.reqCert=D(e,Xd,jy.defaultValues(Xd)),Hl in e&&(this.singleRequestExtensions=D(e,Hl,jy.defaultValues(Hl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xd:return new Ys;case Hl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Xd:return t.isEqual(jy.defaultValues(e));case Hl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ys.schema(t.reqCert||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[wn.schema(t.extensions||{names:{blockName:t.singleRequestExtensions||L}})]})]})}fromSchema(e){_e(e,Iie);let t=Ie(e,e,jy.schema({names:{reqCert:{names:{blockName:Xd}},extensions:{names:{blockName:Hl}}}}));Ae.assertSchema(t,this.className),this.reqCert=new Ys({schema:t.result.reqCert}),Hl in t.result&&(this.singleRequestExtensions=Array.from(t.result.singleRequestExtensions.valueBlock.value,n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(this.reqCert.toSchema()),this.singleRequestExtensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.singleRequestExtensions,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={reqCert:this.reqCert.toJSON()};return this.singleRequestExtensions&&(e.singleRequestExtensions=Array.from(this.singleRequestExtensions,t=>t.toJSON())),e}};HC.CLASS_NAME="Request";var oA="tbs",Gd="version",Wd="requestorName",uA="requestList",Jd="requestExtensions",A0="TBSRequest",nC=`${A0}.${Gd}`,sC=`${A0}.${Wd}`,vB=`${A0}.requests`,iC=`${A0}.${Jd}`,Bie=[A0,nC,sC,vB,iC],Ho=class Ko extends Be{static{o(this,"TBSRequest")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,oA,Ko.defaultValues(oA))),Gd in e&&(this.version=D(e,Gd,Ko.defaultValues(Gd))),Wd in e&&(this.requestorName=D(e,Wd,Ko.defaultValues(Wd))),this.requestList=D(e,uA,Ko.defaultValues(uA)),Jd in e&&(this.requestExtensions=D(e,Jd,Ko.defaultValues(Jd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case oA:return Qr;case Gd:return 0;case Wd:return new Ar;case uA:case Jd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case oA:return t.byteLength===0;case Gd:return t===Ko.defaultValues(e);case Wd:return t.type===Ar.defaultValues("type")&&Object.keys(t.value).length===0;case uA:case Jd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||A0,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.TBSRequestVersion||nC})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Ar.schema(t.requestorName||{names:{blockName:sC}})]}),new W({name:t.requestList||"TBSRequest.requestList",value:[new Tt({name:t.requests||vB,value:HC.schema(t.requestNames||{})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[wn.schema(t.extensions||{names:{blockName:t.requestExtensions||iC}})]})]})}fromSchema(e){_e(e,Bie);let t=Ie(e,e,Ko.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.TBSRequest.valueBeforeDecodeView,nC in t.result&&(this.version=t.result[nC].valueBlock.valueDec),sC in t.result&&(this.requestorName=new Ar({schema:t.result[sC]})),this.requestList=Array.from(t.result[vB],n=>new HC({schema:n})),iC in t.result&&(this.requestExtensions=Array.from(t.result[iC].valueBlock.value,n=>new _i({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return Ko.schema();let n=Hr(this.tbsView);if(Ae.assert(n,"TBS Request"),!(n.result instanceof W))throw new Error("ASN.1 result should be SEQUENCE");t=n.result}else{let n=[];this.version!==void 0&&n.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),this.requestorName&&n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.requestorName.toSchema()]})),n.push(new W({value:Array.from(this.requestList,s=>s.toSchema())})),this.requestExtensions&&n.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[new W({value:Array.from(this.requestExtensions,s=>s.toSchema())})]})),t=new W({value:n})}return t}toJSON(){let e={};return this.version!=null&&(e.version=this.version),this.requestorName&&(e.requestorName=this.requestorName.toJSON()),e.requestList=Array.from(this.requestList,t=>t.toJSON()),this.requestExtensions&&(e.requestExtensions=Array.from(this.requestExtensions,t=>t.toJSON())),e}};Ho.CLASS_NAME="TBSRequest";var kp="signatureAlgorithm",Lp="signature",nl="certs",Kf=class zd extends Be{static{o(this,"Signature")}constructor(e={}){super(),this.signatureAlgorithm=D(e,kp,zd.defaultValues(kp)),this.signature=D(e,Lp,zd.defaultValues(Lp)),nl in e&&(this.certs=D(e,nl,zd.defaultValues(nl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kp:return new ge;case Lp:return new qt;case nl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case kp:return t.algorithmId===L&&!("algorithmParams"in t);case Lp:return t.isEqual(zd.defaultValues(e));case nl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signature||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:[new Tt({name:t.certs||L,value:ts.schema({})})]})]})]})}fromSchema(e){_e(e,[kp,Lp,nl]);let t=Ie(e,e,zd.schema({names:{signatureAlgorithm:{names:{blockName:kp}},signature:Lp,certs:nl}}));Ae.assertSchema(t,this.className),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signature=t.result.signature,nl in t.result&&(this.certs=Array.from(t.result.certs,n=>new ts({schema:n})))}toSchema(){let e=[];return e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.certs,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.certs&&(e.certs=Array.from(this.certs,t=>t.toJSON())),e}};Kf.CLASS_NAME="Signature";var Yd="tbsRequest",Kl="optionalSignature",Die=[Yd,Kl],_ie=class aC extends Be{static{o(this,"OCSPRequest")}constructor(e={}){super(),this.tbsRequest=D(e,Yd,aC.defaultValues(Yd)),Kl in e&&(this.optionalSignature=D(e,Kl,aC.defaultValues(Kl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yd:return new Ho;case Kl:return new Kf;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Yd:return Ho.compareWithDefault("tbs",t.tbs)&&Ho.compareWithDefault("version",t.version)&&Ho.compareWithDefault("requestorName",t.requestorName)&&Ho.compareWithDefault("requestList",t.requestList)&&Ho.compareWithDefault("requestExtensions",t.requestExtensions);case Kl:return Kf.compareWithDefault("signatureAlgorithm",t.signatureAlgorithm)&&Kf.compareWithDefault("signature",t.signature)&&Kf.compareWithDefault("certs",t.certs);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"OCSPRequest",value:[Ho.schema(t.tbsRequest||{names:{blockName:Yd}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Kf.schema(t.optionalSignature||{names:{blockName:Kl}})]})]})}fromSchema(e){_e(e,Die);let t=Ie(e,e,aC.schema());Ae.assertSchema(t,this.className),this.tbsRequest=new Ho({schema:t.result.tbsRequest}),Kl in t.result&&(this.optionalSignature=new Kf({schema:t.result.optionalSignature}))}toSchema(e=!1){let t=[];return t.push(this.tbsRequest.toSchema(e)),this.optionalSignature&&t.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.optionalSignature.toSchema()]})),new W({value:t})}toJSON(){let e={tbsRequest:this.tbsRequest.toJSON()};return this.optionalSignature&&(e.optionalSignature=this.optionalSignature.toJSON()),e}async createForCertificate(e,t,n=_t(!0)){let s=new Ys;await s.createForCertificate(e,t,n),this.tbsRequest.requestList.push(new HC({reqCert:s}))}async sign(e,t="SHA-1",n=_t(!0)){if(fr.assertEmpty(e,"privateKey","OCSPRequest.sign method"),!this.optionalSignature)throw new Error('Need to create "optionalSignature" field before signing');let s=await n.getSignatureParameters(e,t),i=s.parameters;this.optionalSignature.signatureAlgorithm=s.signatureAlgorithm;let a=this.tbsRequest.toSchema(!0).toBER(!1),u=await n.signWithPrivateKey(a,e,i);this.optionalSignature.signature=new qt({valueHex:u})}verify(){}};_ie.CLASS_NAME="OCSPRequest";var Qd="responseType",Zd="response",Rie=[Qd,Zd],e0=class Fy extends Be{static{o(this,"ResponseBytes")}constructor(e={}){super(),this.responseType=D(e,Qd,Fy.defaultValues(Qd)),this.response=D(e,Zd,Fy.defaultValues(Zd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Qd:return L;case Zd:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Qd:return t===L;case Zd:return t.isEqual(Fy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.responseType||L}),new Ve({name:t.response||L})]})}fromSchema(e){_e(e,Rie);let t=Ie(e,e,Fy.schema({names:{responseType:Qd,response:Zd}}));Ae.assertSchema(t,this.className),this.responseType=t.result.responseType.valueBlock.toString(),this.response=t.result.response}toSchema(){return new W({value:[new rt({value:this.responseType}),this.response]})}toJSON(){return{responseType:this.responseType,response:this.response.toJSON()}}};e0.CLASS_NAME="ResponseBytes";var Vp="responseStatus",Bo="responseBytes",Pie=class qy extends Be{static{o(this,"OCSPResponse")}constructor(e={}){super(),this.responseStatus=D(e,Vp,qy.defaultValues(Vp)),Bo in e&&(this.responseBytes=D(e,Bo,qy.defaultValues(Bo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vp:return new zu;case Bo:return new e0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Vp:return t.isEqual(qy.defaultValues(e));case Bo:return e0.compareWithDefault("responseType",t.responseType)&&e0.compareWithDefault("response",t.response);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"OCSPResponse",value:[new zu({name:t.responseStatus||Vp}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[e0.schema(t.responseBytes||{names:{blockName:Bo}})]})]})}fromSchema(e){_e(e,[Vp,Bo]);let t=Ie(e,e,qy.schema());Ae.assertSchema(t,this.className),this.responseStatus=t.result.responseStatus,Bo in t.result&&(this.responseBytes=new e0({schema:t.result.responseBytes}))}toSchema(){let e=[];return e.push(this.responseStatus),this.responseBytes&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.responseBytes.toSchema()]})),new W({value:e})}toJSON(){let e={responseStatus:this.responseStatus.toJSON()};return this.responseBytes&&(e.responseBytes=this.responseBytes.toJSON()),e}async getCertificateStatus(e,t,n=_t(!0)){let s,i={isForCertificate:!1,status:2};if(!this.responseBytes||this.responseBytes.responseType!==dA)return i;try{let a=Hr(this.responseBytes.response.valueBlock.valueHexView);Ae.assert(a,"Basic OCSP response"),s=new uv({schema:a.result})}catch{return i}return s.getCertificateStatus(e,t,n)}async sign(e,t,n=_t(!0)){var s;if(this.responseBytes&&this.responseBytes.responseType===dA)return uv.fromBER(this.responseBytes.response.valueBlock.valueHexView).sign(e,t,n);throw new Error(`Unknown ResponseBytes type: ${((s=this.responseBytes)===null||s===void 0?void 0:s.responseType)||"Unknown"}`)}async verify(e=null,t=_t(!0)){var n;if(!(Bo in this))throw new Error("Empty ResponseBytes field");if(this.responseBytes&&this.responseBytes.responseType===dA){let s=uv.fromBER(this.responseBytes.response.valueBlock.valueHexView);return e!==null&&(s.certs||(s.certs=[]),s.certs.push(e)),s.verify({},t)}throw new Error(`Unknown ResponseBytes type: ${((n=this.responseBytes)===null||n===void 0?void 0:n.responseType)||"Unknown"}`)}};Pie.CLASS_NAME="OCSPResponse";var jc="type",$o="attributes",lA="encodedValue",Oie=[$o],ks=class $a extends Be{static{o(this,"SignedAndUnsignedAttributes")}constructor(e={}){super(),this.type=D(e,jc,$a.defaultValues(jc)),this.attributes=D(e,$o,$a.defaultValues($o)),this.encodedValue=D(e,lA,$a.defaultValues(lA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jc:return-1;case $o:return[];case lA:return Qr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case jc:return t===$a.defaultValues(jc);case $o:return t.length===0;case lA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new ae({name:t.blockName||L,optional:!0,idBlock:{tagClass:3,tagNumber:t.tagNumber||0},value:[new Tt({name:t.attributes||L,value:Zr.schema()})]})}fromSchema(e){_e(e,Oie);let t=Ie(e,e,$a.schema({names:{tagNumber:this.type,attributes:$o}}));Ae.assertSchema(t,this.className),this.type=t.result.idBlock.tagNumber,this.encodedValue=dt.toArrayBuffer(t.result.valueBeforeDecodeView);let n=new Uint8Array(this.encodedValue);if(n[0]=49,!($o in t.result)){if(this.type===0)throw new Error("Wrong structure of SignedUnsignedAttributes");return}this.attributes=Array.from(t.result.attributes,s=>new Zr({schema:s}))}toSchema(){if($a.compareWithDefault(jc,this.type)||$a.compareWithDefault($o,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return new ae({optional:!0,idBlock:{tagClass:3,tagNumber:this.type},value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){if($a.compareWithDefault(jc,this.type)||$a.compareWithDefault($o,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return{type:this.type,attributes:Array.from(this.attributes,e=>e.toJSON())}}};ks.CLASS_NAME="SignedAndUnsignedAttributes";var t0="version",$f="sid",r0="digestAlgorithm",$l="signedAttrs",n0="signatureAlgorithm",Hy="signature",Xl="unsignedAttrs",Ql="SignerInfo",wB=`${Ql}.${t0}`,Ky=`${Ql}.${$f}`,SB=`${Ql}.${r0}`,oC=`${Ql}.${$l}`,EB=`${Ql}.${n0}`,AB=`${Ql}.${Hy}`,uC=`${Ql}.${Xl}`,kie=[wB,Ky,SB,oC,EB,AB,uC],KC=class In extends Be{static{o(this,"SignerInfo")}constructor(e={}){super(),this.version=D(e,t0,In.defaultValues(t0)),this.sid=D(e,$f,In.defaultValues($f)),this.digestAlgorithm=D(e,r0,In.defaultValues(r0)),$l in e&&(this.signedAttrs=D(e,$l,In.defaultValues($l))),this.signatureAlgorithm=D(e,n0,In.defaultValues(n0)),this.signature=D(e,Hy,In.defaultValues(Hy)),Xl in e&&(this.unsignedAttrs=D(e,Xl,In.defaultValues(Xl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case t0:return 0;case $f:return new St;case r0:return new ge;case $l:return new ks({type:0});case n0:return new ge;case Hy:return new Ve;case Xl:return new ks({type:1});default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case t0:return In.defaultValues(t0)===t;case $f:return t instanceof St;case r0:return t instanceof ge?t.isEqual(In.defaultValues(r0)):!1;case $l:return ks.compareWithDefault("type",t.type)&&ks.compareWithDefault("attributes",t.attributes)&&ks.compareWithDefault("encodedValue",t.encodedValue);case n0:return t instanceof ge?t.isEqual(In.defaultValues(n0)):!1;case Hy:case Xl:return ks.compareWithDefault("type",t.type)&&ks.compareWithDefault("attributes",t.attributes)&&ks.compareWithDefault("encodedValue",t.encodedValue);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:Ql,value:[new me({name:t.version||wB}),new Pr({value:[Fn.schema(t.sidSchema||{names:{blockName:Ky}}),new Pr({value:[new ae({optional:!0,name:t.sid||Ky,idBlock:{tagClass:3,tagNumber:0},value:[new Ve]}),new yt({optional:!0,name:t.sid||Ky,idBlock:{tagClass:3,tagNumber:0}})]})]}),ge.schema(t.digestAlgorithm||{names:{blockName:SB}}),ks.schema(t.signedAttrs||{names:{blockName:oC,tagNumber:0}}),ge.schema(t.signatureAlgorithm||{names:{blockName:EB}}),new Ve({name:t.signature||AB}),ks.schema(t.unsignedAttrs||{names:{blockName:uC,tagNumber:1}})]})}fromSchema(e){_e(e,kie);let t=Ie(e,e,In.schema());Ae.assertSchema(t,this.className),this.version=t.result[wB].valueBlock.valueDec;let n=t.result[Ky];n.idBlock.tagClass===1?this.sid=new Fn({schema:n}):this.sid=n,this.digestAlgorithm=new ge({schema:t.result[SB]}),oC in t.result&&(this.signedAttrs=new ks({type:0,schema:t.result[oC]})),this.signatureAlgorithm=new ge({schema:t.result[EB]}),this.signature=t.result[AB],uC in t.result&&(this.unsignedAttrs=new ks({type:1,schema:t.result[uC]}))}toSchema(){if(In.compareWithDefault($f,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e=[];return e.push(new me({value:this.version})),this.sid instanceof Fn?e.push(this.sid.toSchema()):e.push(this.sid),e.push(this.digestAlgorithm.toSchema()),this.signedAttrs&&In.compareWithDefault($l,this.signedAttrs)===!1&&e.push(this.signedAttrs.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.unsignedAttrs&&In.compareWithDefault(Xl,this.unsignedAttrs)===!1&&e.push(this.unsignedAttrs.toSchema()),new W({value:e})}toJSON(){if(In.compareWithDefault($f,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e={version:this.version,digestAlgorithm:this.digestAlgorithm.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.sid instanceof St||(e.sid=this.sid.toJSON()),this.signedAttrs&&In.compareWithDefault($l,this.signedAttrs)===!1&&(e.signedAttrs=this.signedAttrs.toJSON()),this.unsignedAttrs&&In.compareWithDefault(Xl,this.unsignedAttrs)===!1&&(e.unsignedAttrs=this.unsignedAttrs.toJSON()),e}};KC.CLASS_NAME="SignerInfo";var $y="version",Xy="policy",Gy="messageImprint",Wy="serialNumber",Jy="genTime",Xf="ordering",Gf="nonce",s0="accuracy",i0="tsa",a0="extensions",sa="TSTInfo",CB=`${sa}.${$y}`,bB=`${sa}.${Xy}`,xB=`${sa}.${Gy}`,NB=`${sa}.${Wy}`,TB=`${sa}.${Jy}`,lC=`${sa}.${s0}`,cC=`${sa}.${Xf}`,fC=`${sa}.${Gf}`,hC=`${sa}.${i0}`,pC=`${sa}.${a0}`,Lie=[CB,bB,xB,NB,TB,lC,cC,fC,hC,pC],eM=class Os extends Be{static{o(this,"TSTInfo")}constructor(e={}){super(),this.version=D(e,$y,Os.defaultValues($y)),this.policy=D(e,Xy,Os.defaultValues(Xy)),this.messageImprint=D(e,Gy,Os.defaultValues(Gy)),this.serialNumber=D(e,Wy,Os.defaultValues(Wy)),this.genTime=D(e,Jy,Os.defaultValues(Jy)),s0 in e&&(this.accuracy=D(e,s0,Os.defaultValues(s0))),Xf in e&&(this.ordering=D(e,Xf,Os.defaultValues(Xf))),Gf in e&&(this.nonce=D(e,Gf,Os.defaultValues(Gf))),i0 in e&&(this.tsa=D(e,i0,Os.defaultValues(i0))),a0 in e&&(this.extensions=D(e,a0,Os.defaultValues(a0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $y:return 0;case Xy:return L;case Gy:return new ra;case Wy:return new me;case Jy:return new Date(0,0,0);case s0:return new Fc;case Xf:return!1;case Gf:return new me;case i0:return new Ar;case a0:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case $y:case Xy:case Jy:case Xf:return t===Os.defaultValues(Xf);case Gy:return ra.compareWithDefault(th,t.hashAlgorithm)&&ra.compareWithDefault(rh,t.hashedMessage);case Wy:case Gf:return t.isEqual(Os.defaultValues(Gf));case s0:return Fc.compareWithDefault(sl,t.seconds)&&Fc.compareWithDefault(il,t.millis)&&Fc.compareWithDefault(al,t.micros);case i0:return Ar.compareWithDefault(Og,t.type)&&Ar.compareWithDefault(kg,t.value);case a0:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||sa,value:[new me({name:t.version||CB}),new rt({name:t.policy||bB}),ra.schema(t.messageImprint||{names:{blockName:xB}}),new me({name:t.serialNumber||NB}),new Rr({name:t.genTime||TB}),Fc.schema(t.accuracy||{names:{blockName:lC}}),new Wi({name:t.ordering||cC,optional:!0}),new me({name:t.nonce||fC,optional:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Ar.schema(t.tsa||{names:{blockName:hC}})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.extensions||pC,value:_i.schema(t.extension||{})})]})]})}fromSchema(e){_e(e,Lie);let t=Ie(e,e,Os.schema());Ae.assertSchema(t,this.className),this.version=t.result[CB].valueBlock.valueDec,this.policy=t.result[bB].valueBlock.toString(),this.messageImprint=new ra({schema:t.result[xB]}),this.serialNumber=t.result[NB],this.genTime=t.result[TB].toDate(),lC in t.result&&(this.accuracy=new Fc({schema:t.result[lC]})),cC in t.result&&(this.ordering=t.result[cC].valueBlock.value),fC in t.result&&(this.nonce=t.result[fC]),hC in t.result&&(this.tsa=new Ar({schema:t.result[hC]})),pC in t.result&&(this.extensions=Array.from(t.result[pC],n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(new rt({value:this.policy})),e.push(this.messageImprint.toSchema()),e.push(this.serialNumber),e.push(new Rr({valueDate:this.genTime})),this.accuracy&&e.push(this.accuracy.toSchema()),this.ordering!==void 0&&e.push(new Wi({value:this.ordering})),this.nonce&&e.push(this.nonce),this.tsa&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.tsa.toSchema()]})),this.extensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.extensions,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,policy:this.policy,messageImprint:this.messageImprint.toJSON(),serialNumber:this.serialNumber.toJSON(),genTime:this.genTime};return this.accuracy&&(e.accuracy=this.accuracy.toJSON()),this.ordering!==void 0&&(e.ordering=this.ordering),this.nonce&&(e.nonce=this.nonce.toJSON()),this.tsa&&(e.tsa=this.tsa.toJSON()),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async verify(e,t=_t(!0)){if(!e.data)throw new Error('"data" is a mandatory attribute for TST_INFO verification');let n=e.data;if(e.notBefore&&this.genTime<e.notBefore)throw new Error("Generation time for TSTInfo object is less than notBefore value");if(e.notAfter&&this.genTime>e.notAfter)throw new Error("Generation time for TSTInfo object is more than notAfter value");let s=t.getAlgorithmByOID(this.messageImprint.hashAlgorithm.algorithmId,!0,"MessageImprint.hashAlgorithm"),i=await t.digest(s.name,new Uint8Array(n));return dt.isEqual(i,this.messageImprint.hashedMessage.valueBlock.valueHexView)}};eM.CLASS_NAME="TSTInfo";var o0="version",zy="digestAlgorithms",Yy="encapContentInfo",u0="certificates",l0="crls",Qy="signerInfos",Dg="ocsps",uh="SignedData",IB=`${uh}.${o0}`,dC=`${uh}.${zy}`,BB=`${uh}.${Yy}`,mC=`${uh}.${u0}`,gC=`${uh}.${l0}`,yC=`${uh}.${Qy}`,Vie=[IB,dC,BB,mC,gC,yC],Qn=class extends Error{static{o(this,"SignedDataVerifyError")}constructor({message:e,code:t=0,date:n=new Date,signatureVerified:s=null,signerCertificate:i=null,signerCertificateVerified:a=null,timestampSerial:u=null,certificatePath:l=[]}){super(e),this.name="SignedDataVerifyError",this.date=n,this.code=t,this.timestampSerial=u,this.signatureVerified=s,this.signerCertificate=i,this.signerCertificateVerified=a,this.certificatePath=l}},S0=class ta extends Be{static{o(this,"SignedData")}constructor(e={}){super(),this.version=D(e,o0,ta.defaultValues(o0)),this.digestAlgorithms=D(e,zy,ta.defaultValues(zy)),this.encapContentInfo=D(e,Yy,ta.defaultValues(Yy)),u0 in e&&(this.certificates=D(e,u0,ta.defaultValues(u0))),l0 in e&&(this.crls=D(e,l0,ta.defaultValues(l0))),Dg in e&&(this.ocsps=D(e,Dg,ta.defaultValues(Dg))),this.signerInfos=D(e,Qy,ta.defaultValues(Qy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case o0:return 0;case zy:return[];case Yy:return new eh;case u0:return[];case l0:return[];case Dg:return[];case Qy:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case o0:return t===ta.defaultValues(o0);case Yy:return eh.compareWithDefault("eContentType",t.eContentType)&&eh.compareWithDefault("eContent",t.eContent);case zy:case u0:case l0:case Dg:case Qy:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return t.optional===void 0&&(t.optional=!1),new W({name:t.blockName||uh,optional:t.optional,value:[new me({name:t.version||IB}),new $r({value:[new Tt({name:t.digestAlgorithms||dC,value:ge.schema()})]}),eh.schema(t.encapContentInfo||{names:{blockName:BB}}),new ae({name:t.certificates||mC,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ih.schema().valueBlock.value}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:sv.schema(t.crls||{names:{crls:gC}}).valueBlock.value}),new $r({value:[new Tt({name:t.signerInfos||yC,value:KC.schema()})]})]})}fromSchema(e){_e(e,Vie);let t=Ie(e,e,ta.schema());if(Ae.assertSchema(t,this.className),this.version=t.result[IB].valueBlock.valueDec,dC in t.result&&(this.digestAlgorithms=Array.from(t.result[dC],n=>new ge({schema:n}))),this.encapContentInfo=new eh({schema:t.result[BB]}),mC in t.result){let n=new ih({schema:new $r({value:t.result[mC].valueBlock.value})});this.certificates=n.certificates.slice(0)}gC in t.result&&(this.crls=Array.from(t.result[gC],n=>n.idBlock.tagClass===1?new fv({schema:n}):(n.idBlock.tagClass=1,n.idBlock.tagNumber=16,new nv({schema:n})))),yC in t.result&&(this.signerInfos=Array.from(t.result[yC],n=>new KC({schema:n})))}toSchema(e=!1){let t=[];if(this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof FA)||this.crls&&this.crls.length&&this.crls.some(n=>n instanceof nv)?this.version=5:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof zl)?this.version=4:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof xC)||this.signerInfos.some(n=>n.version===3)||this.encapContentInfo.eContentType!==ta.ID_DATA?this.version=3:this.version=1,t.push(new me({value:this.version})),t.push(new $r({value:Array.from(this.digestAlgorithms,n=>n.toSchema())})),t.push(this.encapContentInfo.toSchema()),this.certificates){let s=new ih({certificates:this.certificates}).toSchema();t.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:s.valueBlock.value}))}return this.crls&&t.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.crls,n=>{if(n instanceof nv){let s=n.toSchema();return s.idBlock.tagClass=3,s.idBlock.tagNumber=1,s}return n.toSchema(e)})})),t.push(new $r({value:Array.from(this.signerInfos,n=>n.toSchema())})),new W({value:t})}toJSON(){let e={version:this.version,digestAlgorithms:Array.from(this.digestAlgorithms,t=>t.toJSON()),encapContentInfo:this.encapContentInfo.toJSON(),signerInfos:Array.from(this.signerInfos,t=>t.toJSON())};return this.certificates&&(e.certificates=Array.from(this.certificates,t=>t.toJSON())),this.crls&&(e.crls=Array.from(this.crls,t=>t.toJSON())),e}async verify({signer:e=-1,data:t=Qr,trustedCerts:n=[],checkDate:s=new Date,checkChain:i=!1,passedWhenNotRevValues:a=!1,extendedMode:u=!1,findOrigin:l=null,findIssuer:f=null}={},h=_t(!0)){let m=null,g=null;try{let w=Qr,y=L,S=[],E=this.signerInfos[e];if(!E)throw new Qn({date:s,code:1,message:"Unable to get signer by supplied index"});if(!this.certificates)throw new Qn({date:s,code:2,message:"No certificates attached to this signed data"});if(E.sid instanceof Fn){for(let C of this.certificates)if(C instanceof ts&&C.issuer.isEqual(E.sid.issuer)&&C.serialNumber.isEqual(E.sid.serialNumber)){m=C;break}}else{let C=E.sid,x=C.idBlock.isConstructed?C.valueBlock.value[0].valueBlock.valueHex:C.valueBlock.valueHex;for(let B of this.certificates){if(!(B instanceof ts))continue;let F=await h.digest({name:"sha-1"},B.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Wu(F,x)){m=B;break}}}if(!m)throw new Qn({date:s,code:3,message:"Unable to find signer certificate"});if(this.encapContentInfo.eContentType===Lne){if(!this.encapContentInfo.eContent)throw new Qn({date:s,code:15,message:"Error during verification: TSTInfo eContent is empty",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0});let C;try{C=eM.fromBER(this.encapContentInfo.eContent.valueBlock.valueHexView)}catch{throw new Qn({date:s,code:15,message:"Error during verification: TSTInfo wrong ASN.1 schema ",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}if(s=C.genTime,g=C.serialNumber.valueBlock.valueHexView.slice().buffer,t.byteLength===0)throw new Qn({date:s,code:4,message:"Missed detached data input array"});if(!await C.verify({data:t},h))throw new Qn({date:s,code:15,message:"Error during verification: TSTInfo verification is failed",signatureVerified:!1,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}if(i){let C=this.certificates.filter(R=>R instanceof ts&&!!H6(R,m)),x={checkDate:s,certs:C,trustedCerts:n};f&&(x.findIssuer=f),l&&(x.findOrigin=l);let B=new Q6(x);if(B.certs.push(m),this.crls)for(let R of this.crls)"thisUpdate"in R?B.crls.push(R):R.otherRevInfoFormat===dA&&B.ocsps.push(new uv({schema:R.otherRevInfo}));this.ocsps&&B.ocsps.push(...this.ocsps);let F=await B.verify({passedWhenNotRevValues:a},h).catch(R=>{throw new Qn({date:s,code:5,message:`Validation of signer's certificate failed with error: ${R instanceof Object?R.resultMessage:R}`,signerCertificate:m,signerCertificateVerified:!1})});if(F.certificatePath&&(S=F.certificatePath),!F.result)throw new Qn({date:s,code:5,message:`Validation of signer's certificate failed: ${F.resultMessage}`,signerCertificate:m,signerCertificateVerified:!1})}let b=h.getAlgorithmByOID(E.digestAlgorithm.algorithmId);if(!("name"in b))throw new Qn({date:s,code:7,message:`Unsupported signature algorithm: ${E.digestAlgorithm.algorithmId}`,signerCertificate:m,signerCertificateVerified:!0});y=b.name;let T=this.encapContentInfo.eContent;if(T)T.idBlock.tagClass===1&&T.idBlock.tagNumber===4?t=T.getValue():t=T.valueBlock.valueBeforeDecodeView.slice().buffer;else if(t.byteLength===0)throw new Qn({date:s,code:8,message:"Missed detached data input array",signerCertificate:m,signerCertificateVerified:!0});if(E.signedAttrs){let C=!1,x=!1;for(let B of E.signedAttrs.attributes)if(B.type==="1.2.840.113549.1.9.3"&&(C=!0),B.type==="1.2.840.113549.1.9.4"&&(x=!0,w=B.values[0].valueBlock.valueHex),C&&x)break;if(C===!1)throw new Qn({date:s,code:9,message:'Attribute "content-type" is a mandatory attribute for "signed attributes"',signerCertificate:m,signerCertificateVerified:!0});if(x===!1)throw new Qn({date:s,code:10,message:'Attribute "message-digest" is a mandatory attribute for "signed attributes"',signatureVerified:null,signerCertificate:m,signerCertificateVerified:!0})}if(E.signedAttrs){let C=await h.digest(y,new Uint8Array(t));if(!Wu(C,w))throw new Qn({date:s,code:15,message:"Error during verification: Message digest doesn't match",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0});t=E.signedAttrs.encodedValue}let A=E.signatureAlgorithm.algorithmId==="1.2.840.113549.1.1.1"?await h.verifyWithPublicKey(t,E.signature,m.subjectPublicKeyInfo,E.signatureAlgorithm,y):await h.verifyWithPublicKey(t,E.signature,m.subjectPublicKeyInfo,E.signatureAlgorithm);return u?{date:s,code:14,message:L,signatureVerified:A,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0,certificatePath:S}:A}catch(w){throw w instanceof Qn?w:new Qn({date:s,code:15,message:`Error during verification: ${w instanceof Error?w.message:w}`,signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}}async sign(e,t,n="SHA-1",s=Qr,i=_t(!0)){var a;if(!e)throw new Error("Need to provide a private key for signing");let u=this.signerInfos[t];if(!u)throw new RangeError("SignerInfo index is out of range");!(!((a=u.signedAttrs)===null||a===void 0)&&a.attributes.length)&&"hash"in e.algorithm&&"hash"in e.algorithm&&e.algorithm.hash&&(n=e.algorithm.hash.name);let l=i.getOIDByAlgorithm({name:n},!0,"hashAlgorithm");this.digestAlgorithms.filter(g=>g.algorithmId===l).length===0&&this.digestAlgorithms.push(new ge({algorithmId:l,algorithmParams:new Kr})),u.digestAlgorithm=new ge({algorithmId:l,algorithmParams:new Kr});let f=await i.getSignatureParameters(e,n),h=f.parameters;if(u.signatureAlgorithm=f.signatureAlgorithm,u.signedAttrs)if(u.signedAttrs.encodedValue.byteLength!==0)s=u.signedAttrs.encodedValue;else{s=u.signedAttrs.toSchema().toBER();let g=dt.toUint8Array(s);g[0]=49}else{let g=this.encapContentInfo.eContent;if(g)g.idBlock.tagClass===1&&g.idBlock.tagNumber===4?s=g.getValue():s=g.valueBlock.valueBeforeDecodeView.slice().buffer;else if(s.byteLength===0)throw new Error("Missed detached data input array")}let m=await i.signWithPrivateKey(s,e,h);u.signature=new Ve({valueHex:m})}};S0.CLASS_NAME="SignedData";S0.ID_DATA=VB;var Wf="version",Jf="authSafe",Xo="macData",_g="parsedValue",Uie=[Wf,Jf,Xo],Mie=class zf extends Be{static{o(this,"PFX")}constructor(e={}){super(),this.version=D(e,Wf,zf.defaultValues(Wf)),this.authSafe=D(e,Jf,zf.defaultValues(Jf)),Xo in e&&(this.macData=D(e,Xo,zf.defaultValues(Xo))),_g in e&&(this.parsedValue=D(e,_g,zf.defaultValues(_g))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wf:return 3;case Jf:return new Gr;case Xo:return new ql;case _g:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Wf:return t===zf.defaultValues(e);case Jf:return Gr.compareWithDefault("contentType",t.contentType)&&Gr.compareWithDefault("content",t.content);case Xo:return ql.compareWithDefault("mac",t.mac)&&ql.compareWithDefault("macSalt",t.macSalt)&&ql.compareWithDefault("iterations",t.iterations);case _g:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||Wf}),Gr.schema(t.authSafe||{names:{blockName:Jf}}),ql.schema(t.macData||{names:{blockName:Xo,optional:!0}})]})}fromSchema(e){_e(e,Uie);let t=Ie(e,e,zf.schema({names:{version:Wf,authSafe:{names:{blockName:Jf}},macData:{names:{blockName:Xo}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.authSafe=new Gr({schema:t.result.authSafe}),Xo in t.result&&(this.macData=new ql({schema:t.result.macData}))}toSchema(){let e=[new me({value:this.version}),this.authSafe.toSchema()];return this.macData&&e.push(this.macData.toSchema()),new W({value:e})}toJSON(){let e={version:this.version,authSafe:this.authSafe.toJSON()};return this.macData&&(e.macData=this.macData.toJSON()),e}async makeInternalValues(e={},t=_t(!0)){if(Er.assert(e,"parameters","object"),!this.parsedValue)throw new Error('Please call "parseValues" function first in order to make "parsedValue" data');switch(fr.assertEmpty(this.parsedValue.integrityMode,"integrityMode","parsedValue"),fr.assertEmpty(this.parsedValue.authenticatedSafe,"authenticatedSafe","parsedValue"),this.parsedValue.integrityMode){case 0:{if(!("iterations"in e))throw new fr("iterations");fr.assertEmpty(e.pbkdf2HashAlgorithm,"pbkdf2HashAlgorithm"),fr.assertEmpty(e.hmacHashAlgorithm,"hmacHashAlgorithm"),fr.assertEmpty(e.password,"password");let n=new ArrayBuffer(64),s=new Uint8Array(n);t.getRandomValues(s);let i=this.parsedValue.authenticatedSafe.toSchema().toBER(!1);this.authSafe=new Gr({contentType:Gr.DATA,content:new Ve({valueHex:i})});let a=await t.stampDataWithPassword({password:e.password,hashAlgorithm:e.hmacHashAlgorithm,salt:n,iterationCount:e.iterations,contentToStamp:i});this.macData=new ql({mac:new Zf({digestAlgorithm:new ge({algorithmId:t.getOIDByAlgorithm({name:e.hmacHashAlgorithm},!0,"hmacHashAlgorithm")}),digest:new Ve({valueHex:a})}),macSalt:new Ve({valueHex:n}),iterations:e.iterations})}break;case 1:{if(!("signingCertificate"in e))throw new fr("signingCertificate");fr.assertEmpty(e.privateKey,"privateKey"),fr.assertEmpty(e.hashAlgorithm,"hashAlgorithm");let n=this.parsedValue.authenticatedSafe.toSchema().toBER(!1),s=new S0({version:1,encapContentInfo:new eh({eContentType:"1.2.840.113549.1.7.1",eContent:new Ve({valueHex:n})}),certificates:[e.signingCertificate]}),i=await t.digest({name:e.hashAlgorithm},new Uint8Array(n)),a=[];a.push(new Zr({type:"1.2.840.113549.1.9.3",values:[new rt({value:"1.2.840.113549.1.7.1"})]})),a.push(new Zr({type:"1.2.840.113549.1.9.5",values:[new kc({valueDate:new Date})]})),a.push(new Zr({type:"1.2.840.113549.1.9.4",values:[new Ve({valueHex:i})]})),s.signerInfos.push(new KC({version:1,sid:new Fn({issuer:e.signingCertificate.issuer,serialNumber:e.signingCertificate.serialNumber}),signedAttrs:new ks({type:0,attributes:a})})),await s.sign(e.privateKey,0,e.hashAlgorithm,void 0,t),this.authSafe=new Gr({contentType:"1.2.840.113549.1.7.2",content:s.toSchema(!0)})}break;default:throw new Error(`Parameter "integrityMode" has unknown value: ${this.parsedValue.integrityMode}`)}}async parseInternalValues(e,t=_t(!0)){switch(Er.assert(e,"parameters","object"),e.checkIntegrity===void 0&&(e.checkIntegrity=!0),this.parsedValue={},this.authSafe.contentType){case Gr.DATA:{fr.assertEmpty(e.password,"password"),this.parsedValue.integrityMode=0,Er.assert(this.authSafe.content,"authSafe.content",Ve);let n=this.authSafe.content.getValue();if(this.parsedValue.authenticatedSafe=fB.fromBER(n),e.checkIntegrity){if(!this.macData)throw new Error('Absent "macData" value, can not check PKCS#12 data integrity');let s=t.getAlgorithmByOID(this.macData.mac.digestAlgorithm.algorithmId,!0,"digestAlgorithm");if(!await t.verifyDataStampedWithPassword({password:e.password,hashAlgorithm:s.name,salt:dt.toArrayBuffer(this.macData.macSalt.valueBlock.valueHexView),iterationCount:this.macData.iterations||1,contentToVerify:n,signatureToVerify:dt.toArrayBuffer(this.macData.mac.digest.valueBlock.valueHexView)}))throw new Error("Integrity for the PKCS#12 data is broken!")}}break;case Gr.SIGNED_DATA:{this.parsedValue.integrityMode=1;let n=new S0({schema:this.authSafe.content}),s=n.encapContentInfo.eContent;fr.assert(s,"eContent","cmsSigned.encapContentInfo"),Er.assert(s,"eContent",Ve);let i=s.getValue();if(this.parsedValue.authenticatedSafe=fB.fromBER(i),!await n.verify({signer:0,checkChain:!1},t))throw new Error("Integrity for the PKCS#12 data is broken!")}break;default:throw new Error(`Incorrect value for "this.authSafe.contentType": ${this.authSafe.contentType}`)}}};Mie.CLASS_NAME="PFX";var c0="status",Gl="statusStrings",Wl="failInfo",jie=[c0,Gl,Wl],f6;(function(r){r[r.granted=0]="granted",r[r.grantedWithMods=1]="grantedWithMods",r[r.rejection=2]="rejection",r[r.waiting=3]="waiting",r[r.revocationWarning=4]="revocationWarning",r[r.revocationNotification=5]="revocationNotification"})(f6||(f6={}));var Zy=class Yf extends Be{static{o(this,"PKIStatusInfo")}constructor(e={}){super(),this.status=D(e,c0,Yf.defaultValues(c0)),Gl in e&&(this.statusStrings=D(e,Gl,Yf.defaultValues(Gl))),Wl in e&&(this.failInfo=D(e,Wl,Yf.defaultValues(Wl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case c0:return 2;case Gl:return[];case Wl:return new qt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case c0:return t===Yf.defaultValues(e);case Gl:return t.length===0;case Wl:return t.isEqual(Yf.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.status||L}),new W({optional:!0,value:[new Tt({name:t.statusStrings||L,value:new xi})]}),new qt({name:t.failInfo||L,optional:!0})]})}fromSchema(e){_e(e,jie);let t=Ie(e,e,Yf.schema({names:{status:c0,statusStrings:Gl,failInfo:Wl}}));Ae.assertSchema(t,this.className);let n=t.result.status;if(n.valueBlock.isHexOnly===!0||n.valueBlock.valueDec<0||n.valueBlock.valueDec>5)throw new Error('PKIStatusInfo "status" has invalid value');this.status=n.valueBlock.valueDec,Gl in t.result&&(this.statusStrings=t.result.statusStrings),Wl in t.result&&(this.failInfo=t.result.failInfo)}toSchema(){let e=[];return e.push(new me({value:this.status})),this.statusStrings&&e.push(new W({optional:!0,value:this.statusStrings})),this.failInfo&&e.push(this.failInfo),new W({value:e})}toJSON(){let e={status:this.status};return this.statusStrings&&(e.statusStrings=Array.from(this.statusStrings,t=>t.toJSON())),this.failInfo&&(e.failInfo=this.failInfo.toJSON()),e}};Zy.CLASS_NAME="PKIStatusInfo";var ev="version",tv="messageImprint",f0="reqPolicy",h0="nonce",Go="certReq",p0="extensions",lh="TimeStampReq",DB=`${lh}.${ev}`,_B=`${lh}.${tv}`,vC=`${lh}.${f0}`,wC=`${lh}.${h0}`,SC=`${lh}.${Go}`,EC=`${lh}.${p0}`,Fie=[DB,_B,vC,wC,SC,EC],qie=class Di extends Be{static{o(this,"TimeStampReq")}constructor(e={}){super(),this.version=D(e,ev,Di.defaultValues(ev)),this.messageImprint=D(e,tv,Di.defaultValues(tv)),f0 in e&&(this.reqPolicy=D(e,f0,Di.defaultValues(f0))),h0 in e&&(this.nonce=D(e,h0,Di.defaultValues(h0))),Go in e&&(this.certReq=D(e,Go,Di.defaultValues(Go))),p0 in e&&(this.extensions=D(e,p0,Di.defaultValues(p0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ev:return 0;case tv:return new ra;case f0:return L;case h0:return new me;case Go:return!1;case p0:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ev:case f0:case Go:return t===Di.defaultValues(e);case tv:return ra.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&ra.compareWithDefault("hashedMessage",t.hashedMessage);case h0:return t.isEqual(Di.defaultValues(e));case p0:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||lh,value:[new me({name:t.version||DB}),ra.schema(t.messageImprint||{names:{blockName:_B}}),new rt({name:t.reqPolicy||vC,optional:!0}),new me({name:t.nonce||wC,optional:!0}),new Wi({name:t.certReq||SC,optional:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.extensions||EC,value:_i.schema()})]})]})}fromSchema(e){_e(e,Fie);let t=Ie(e,e,Di.schema());Ae.assertSchema(t,this.className),this.version=t.result[DB].valueBlock.valueDec,this.messageImprint=new ra({schema:t.result[_B]}),vC in t.result&&(this.reqPolicy=t.result[vC].valueBlock.toString()),wC in t.result&&(this.nonce=t.result[wC]),SC in t.result&&(this.certReq=t.result[SC].valueBlock.value),EC in t.result&&(this.extensions=Array.from(t.result[EC],n=>new _i({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.messageImprint.toSchema()),this.reqPolicy&&e.push(new rt({value:this.reqPolicy})),this.nonce&&e.push(this.nonce),Go in this&&Di.compareWithDefault(Go,this.certReq)===!1&&e.push(new Wi({value:this.certReq})),this.extensions&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.extensions,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={version:this.version,messageImprint:this.messageImprint.toJSON()};return this.reqPolicy!==void 0&&(e.reqPolicy=this.reqPolicy),this.nonce!==void 0&&(e.nonce=this.nonce.toJSON()),this.certReq!==void 0&&Di.compareWithDefault(Go,this.certReq)===!1&&(e.certReq=this.certReq),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}};qie.CLASS_NAME="TimeStampReq";var d0="status",m0="timeStampToken",YB="TimeStampResp",RB=`${YB}.${d0}`,AC=`${YB}.${m0}`,Hie=[RB,AC],Kie=class CC extends Be{static{o(this,"TimeStampResp")}constructor(e={}){super(),this.status=D(e,d0,CC.defaultValues(d0)),m0 in e&&(this.timeStampToken=D(e,m0,CC.defaultValues(m0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case d0:return new Zy;case m0:return new Gr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case d0:return Zy.compareWithDefault(d0,t.status)&&!("statusStrings"in t)&&!("failInfo"in t);case m0:return t.contentType===L&&t.content instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||YB,value:[Zy.schema(t.status||{names:{blockName:RB}}),Gr.schema(t.timeStampToken||{names:{blockName:AC,optional:!0}})]})}fromSchema(e){_e(e,Hie);let t=Ie(e,e,CC.schema());Ae.assertSchema(t,this.className),this.status=new Zy({schema:t.result[RB]}),AC in t.result&&(this.timeStampToken=new Gr({schema:t.result[AC]}))}toSchema(){let e=[];return e.push(this.status.toSchema()),this.timeStampToken&&e.push(this.timeStampToken.toSchema()),new W({value:e})}toJSON(){let e={status:this.status.toJSON()};return this.timeStampToken&&(e.timeStampToken=this.timeStampToken.toJSON()),e}async sign(e,t,n=_t(!0)){return this.assertContentType(),new S0({schema:this.timeStampToken.content}).sign(e,0,t,void 0,n)}async verify(e={signer:0,trustedCerts:[],data:Qr},t=_t(!0)){return this.assertContentType(),new S0({schema:this.timeStampToken.content}).verify(e,t)}assertContentType(){if(!this.timeStampToken)throw new Error("timeStampToken is absent in TSP response");if(this.timeStampToken.contentType!==C6)throw new Error(`Wrong format of timeStampToken: ${this.timeStampToken.contentType}`)}};Kie.CLASS_NAME="TimeStampResp";function $ie(){if(typeof globalThis<"u"&&"crypto"in globalThis){let r="webcrypto";"webkitSubtle"in globalThis.crypto&&(r="safari"),bC(r,new w0({name:r,crypto:globalThis.crypto}))}else if(typeof crypto<"u"&&"webcrypto"in crypto){let r="NodeJS ^15",e=crypto.webcrypto;bC(r,new w0({name:r,crypto:e}))}}o($ie,"initCryptoEngine");$ie();var QB=null,hn=class{static{o(this,"Application")}static setEngine(e,t){QB=Object.assign(t,{name:e}),bC(e,new w0({name:e,crypto:t}))}static get crypto(){if(!QB)throw new Fe(Te.CRYPTOGRAPHIC_NO_MODULE);return QB}static isNodePlugin(){return typeof self>"u"&&typeof window>"u"}};function Xie(){hn.isNodePlugin()||hn.setEngine("W3 WebCrypto module",self.crypto)}o(Xie,"init");Xie();var $C=class{static{o(this,"XmlAlgorithm")}getAlgorithmName(){return this.namespaceURI}},ch=class extends $C{static{o(this,"HashAlgorithm")}async Digest(e){let t;if(typeof e=="string")t=vr.FromString(e,"utf8");else if(ArrayBuffer.isView(e))t=new Uint8Array(e.buffer);else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else{let s=Ua(e);t=vr.FromString(s,"utf8")}let n=await hn.crypto.subtle.digest(this.algorithm,t);return new Uint8Array(n)}},pn=class extends $C{static{o(this,"SignatureAlgorithm")}async Sign(e,t,n){let s=vr.FromString(e,"utf8");return hn.crypto.subtle.sign(n,t,s)}async Verify(e,t,n){let s=this.algorithm,i=vr.FromString(e,"utf8");return hn.crypto.subtle.verify(s,t,n,i)}};var Bn="SHA-1",qn="SHA-256",Hn="SHA-384",Kn="SHA-512",C0="http://www.w3.org/2000/09/xmldsig#sha1",b0="http://www.w3.org/2001/04/xmlenc#sha256",x0="http://www.w3.org/2001/04/xmldsig-more#sha384",N0="http://www.w3.org/2001/04/xmlenc#sha512",XC=class extends ch{static{o(this,"Sha1")}constructor(){super(...arguments),this.algorithm={name:Bn},this.namespaceURI=C0}},dv=class extends ch{static{o(this,"Sha256")}constructor(){super(...arguments),this.algorithm={name:qn},this.namespaceURI=b0}},GC=class extends ch{static{o(this,"Sha384")}constructor(){super(...arguments),this.algorithm={name:Hn},this.namespaceURI=x0}},WC=class extends ch{static{o(this,"Sha512")}constructor(){super(...arguments),this.algorithm={name:Kn},this.namespaceURI=N0}};var zo="ECDSA",JC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1",zC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256",YC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384",QC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";function ZC(r){if(r.name.toUpperCase()===zo.toUpperCase())switch(r.hash.name.toUpperCase()){case Bn:return new T0;case qn:return new I0;case Hn:return new B0;case Kn:return new D0}return null}o(ZC,"fromAlgorithm");var T0=class extends pn{static{o(this,"EcdsaSha1")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:Bn}},this.namespaceURI=JC}static fromAlgorithm(e){return ZC(e)}},I0=class extends pn{static{o(this,"EcdsaSha256")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:qn}},this.namespaceURI=zC}static fromAlgorithm(e){return ZC(e)}},B0=class extends pn{static{o(this,"EcdsaSha384")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:Hn}},this.namespaceURI=YC}static fromAlgorithm(e){return ZC(e)}},D0=class extends pn{static{o(this,"EcdsaSha512")}constructor(){super(...arguments),this.algorithm={name:zo,hash:{name:Kn}},this.namespaceURI=QC}static fromAlgorithm(e){return ZC(e)}};var _0="HMAC",ZB="http://www.w3.org/2000/09/xmldsig#hmac-sha1",eD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",tD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha384",rD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha512";function e2(r){if(r.name.toUpperCase()===_0.toUpperCase())switch(r.hash.name.toUpperCase()){case Bn:return new mv;case qn:return new gv;case Hn:return new yv;case Kn:return new vv}return null}o(e2,"fromAlgorithm");var mv=class extends pn{static{o(this,"HmacSha1")}constructor(){super(...arguments),this.algorithm={name:_0,hash:{name:Bn}},this.namespaceURI=ZB}static fromAlgorithm(e){return e2(e)}},gv=class extends pn{static{o(this,"HmacSha256")}constructor(){super(...arguments),this.algorithm={name:_0,hash:{name:qn}},this.namespaceURI=eD}static fromAlgorithm(e){return e2(e)}},yv=class extends pn{static{o(this,"HmacSha384")}constructor(){super(...arguments),this.algorithm={name:_0,hash:{name:Hn}},this.namespaceURI=tD}static fromAlgorithm(e){return e2(e)}},vv=class extends pn{static{o(this,"HmacSha512")}constructor(){super(...arguments),this.algorithm={name:_0,hash:{name:Kn}},this.namespaceURI=rD}static fromAlgorithm(e){return e2(e)}};var Yo="RSASSA-PKCS1-v1_5",t2="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",n2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha384",s2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";function i2(r){if(r.name.toUpperCase()===Yo.toUpperCase())switch(r.hash.name.toUpperCase()){case Bn:return new R0;case qn:return new P0;case Hn:return new O0;case Kn:return new k0}return null}o(i2,"fromAlgorithm");var R0=class extends pn{static{o(this,"RsaPkcs1Sha1")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Bn}},this.namespaceURI=t2}static fromAlgorithm(e){return i2(e)}},P0=class extends pn{static{o(this,"RsaPkcs1Sha256")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:qn}},this.namespaceURI=r2}static fromAlgorithm(e){return i2(e)}},O0=class extends pn{static{o(this,"RsaPkcs1Sha384")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Hn}},this.namespaceURI=n2}static fromAlgorithm(e){return i2(e)}},k0=class extends pn{static{o(this,"RsaPkcs1Sha512")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Kn}},this.namespaceURI=s2}static fromAlgorithm(e){return i2(e)}};function He(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var u=r.length-1;u>=0;u--)(a=r[u])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i}o(He,"__decorate");function ft(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}o(ft,"__metadata");var de={DefaultCanonMethod:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315",DefaultDigestMethod:"http://www.w3.org/2001/04/xmlenc#sha256",DefaultPrefix:"ds",ElementNames:{CanonicalizationMethod:"CanonicalizationMethod",DigestMethod:"DigestMethod",DigestValue:"DigestValue",DSAKeyValue:"DSAKeyValue",DomainParameters:"DomainParameters",EncryptedKey:"EncryptedKey",HMACOutputLength:"HMACOutputLength",RSAPSSParams:"RSAPSSParams",MaskGenerationFunction:"MaskGenerationFunction",SaltLength:"SaltLength",KeyInfo:"KeyInfo",KeyName:"KeyName",KeyValue:"KeyValue",Modulus:"Modulus",Exponent:"Exponent",Manifest:"Manifest",Object:"Object",Reference:"Reference",RetrievalMethod:"RetrievalMethod",RSAKeyValue:"RSAKeyValue",ECDSAKeyValue:"ECDSAKeyValue",NamedCurve:"NamedCurve",PublicKey:"PublicKey",Signature:"Signature",SignatureMethod:"SignatureMethod",SignatureValue:"SignatureValue",SignedInfo:"SignedInfo",Transform:"Transform",Transforms:"Transforms",X509Data:"X509Data",PGPData:"PGPData",SPKIData:"SPKIData",SPKIexp:"SPKIexp",MgmtData:"MgmtData",X509IssuerSerial:"X509IssuerSerial",X509IssuerName:"X509IssuerName",X509SerialNumber:"X509SerialNumber",X509SKI:"X509SKI",X509SubjectName:"X509SubjectName",X509Certificate:"X509Certificate",X509CRL:"X509CRL",XPath:"XPath",X:"X",Y:"Y"},AttributeNames:{Algorithm:"Algorithm",Encoding:"Encoding",Id:"Id",MimeType:"MimeType",Type:"Type",URI:"URI"},AlgorithmNamespaces:{XmlDsigBase64Transform:"http://www.w3.org/2000/09/xmldsig#base64",XmlDsigC14NTransform:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315",XmlDsigC14NWithCommentsTransform:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",XmlDsigEnvelopedSignatureTransform:"http://www.w3.org/2000/09/xmldsig#enveloped-signature",XmlDsigXPathTransform:"http://www.w3.org/TR/1999/REC-xpath-19991116",XmlDsigXsltTransform:"http://www.w3.org/TR/1999/REC-xslt-19991116",XmlDsigExcC14NTransform:"http://www.w3.org/2001/10/xml-exc-c14n#",XmlDsigExcC14NWithCommentsTransform:"http://www.w3.org/2001/10/xml-exc-c14n#WithComments",XmlDecryptionTransform:"http://www.w3.org/2002/07/decrypt#XML",XmlLicenseTransform:"urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform"},Uri:{Manifest:"http://www.w3.org/2000/09/xmldsig#Manifest"},NamespaceURI:"http://www.w3.org/2000/09/xmldsig#",NamespaceURIMore:"http://www.w3.org/2007/05/xmldsig-more#",NamespaceURIPss:"http://www.example.org/xmldsig-pss/#"};var Fr=class extends Bs{static{o(this,"XmlSignatureObject")}};Fr=He([Mt({localName:"xmldsig",namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix})],Fr);var Ri=class extends bp{static{o(this,"XmlSignatureCollection")}};Ri=He([Mt({localName:"xmldsig_collection",namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix})],Ri);var Pi=class extends Fr{static{o(this,"DigestMethod")}constructor(e){super(),e&&(this.Algorithm=e)}};He([_r({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:de.DefaultDigestMethod}),ft("design:type",String)],Pi.prototype,"Algorithm",void 0);Pi=He([Mt({localName:de.ElementNames.DigestMethod}),ft("design:paramtypes",[String])],Pi);var Zs=class extends Fr{static{o(this,"KeyInfoClause")}static canImportCryptoKey(e){return!1}};var Gie={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},L0=class extends Zs{static{o(this,"RsaKeyValue")}constructor(){super(...arguments),this.key=null,this.jwk=null,this.keyUsage=[]}static canImportCryptoKey(e){let t=e.algorithm.name.toUpperCase();return t===Yo.toUpperCase()||t===fh.toUpperCase()}async importKey(e){let t=e.algorithm.name?e.algorithm.name.toUpperCase():"";if(t!==Yo.toUpperCase()&&t!==fh.toUpperCase())throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);this.key=e;let n=await hn.crypto.subtle.exportKey("jwk",e);return this.jwk=n,this.Modulus=vr.FromBase64Url(n.n||""),this.Exponent=vr.FromBase64Url(n.e||""),this.keyUsage=e.usages,this}async exportKey(e=Gie){if(this.key)return this.key;if(!this.Modulus)throw new Fe(Te.CRYPTOGRAPHIC,"RsaKeyValue has no Modulus");let t=vr.ToBase64Url(this.Modulus);if(!this.Exponent)throw new Fe(Te.CRYPTOGRAPHIC,"RsaKeyValue has no Exponent");let n=vr.ToBase64Url(this.Exponent),s;switch(e.name.toUpperCase()){case Yo.toUpperCase():s="R";break;case fh.toUpperCase():s="P";break;default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}switch(e.hash.name.toUpperCase()){case Bn:s+="S1";break;case qn:s+="S256";break;case Hn:s+="S384";break;case Kn:s+="S512";break}let i={kty:"RSA",alg:s,n:t,e:n,ext:!0};return hn.crypto.subtle.importKey("jwk",i,e,!0,this.keyUsage)}LoadXml(e){super.LoadXml(e),this.keyUsage=["verify"]}};He([Xt({localName:de.ElementNames.Modulus,prefix:de.DefaultPrefix,namespaceURI:de.NamespaceURI,required:!0,converter:bi}),ft("design:type",Object)],L0.prototype,"Modulus",void 0);He([Xt({localName:de.ElementNames.Exponent,prefix:de.DefaultPrefix,namespaceURI:de.NamespaceURI,required:!0,converter:bi}),ft("design:type",Object)],L0.prototype,"Exponent",void 0);L0=He([Mt({localName:de.ElementNames.RSAKeyValue})],L0);var nD="http://www.w3.org/2007/05/xmldsig-more#",sD="pss",V0=class extends Bs{static{o(this,"MaskGenerationFunction")}};He([Xt({parser:Pi}),ft("design:type",Pi)],V0.prototype,"DigestMethod",void 0);He([_r({localName:de.AttributeNames.Algorithm,defaultValue:"http://www.w3.org/2007/05/xmldsig-more#MGF1"}),ft("design:type",String)],V0.prototype,"Algorithm",void 0);V0=He([Mt({localName:de.ElementNames.MaskGenerationFunction,prefix:sD,namespaceURI:nD})],V0);var ia=class extends Bs{static{o(this,"PssAlgorithmParams")}};He([Xt({parser:Pi}),ft("design:type",Pi)],ia.prototype,"DigestMethod",void 0);He([Xt({parser:V0}),ft("design:type",V0)],ia.prototype,"MGF",void 0);He([Xt({converter:lg,prefix:sD,namespaceURI:nD}),ft("design:type",Number)],ia.prototype,"SaltLength",void 0);He([Xt({converter:lg}),ft("design:type",Number)],ia.prototype,"TrailerField",void 0);ia=He([Mt({localName:de.ElementNames.RSAPSSParams,prefix:sD,namespaceURI:nD})],ia);var fh="RSA-PSS",iD="http://www.w3.org/2007/05/xmldsig-more#rsa-pss",a2=class r extends pn{static{o(this,"RsaPssWithParams")}constructor(){super(...arguments),this.algorithm={name:fh,hash:{name:Bn}},this.namespaceURI=iD}static fromAlgorithm(e){let t=null;if(e.name.toUpperCase()===fh.toUpperCase()){switch(e.hash.name.toUpperCase()){case Bn:t=new r;break;case qn:t=new r;break;case Hn:t=new r;break;case Kn:t=new r;break}if(t)return t.algorithm.hash.name=e.hash.name,e.saltLength&&(t.algorithm.saltLength=e.saltLength),t}return null}fromMethod(e){if(!e.Any.Some(t=>{if(t instanceof ia){switch(t.DigestMethod.Algorithm.toLowerCase()){case C0:this.algorithm.hash.name=Bn;break;case b0:this.algorithm.hash.name=qn;break;case x0:this.algorithm.hash.name=Hn;break;case N0:this.algorithm.hash.name=Kn;break;default:throw new Fe(Te.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${t.DigestMethod.Algorithm}`)}return t.SaltLength&&(this.algorithm.saltLength=t.SaltLength),!0}return!1}))throw new Fe(Te.CRYPTOGRAPHIC,"RSA-PSS parameters not found in SignatureMethod")}toMethod(e){let t=new ia;switch(this.algorithm.hash.name.toUpperCase()){case Bn:t.DigestMethod.Algorithm=C0;break;case qn:t.DigestMethod.Algorithm=b0;break;case Hn:t.DigestMethod.Algorithm=x0;break;case Kn:t.DigestMethod.Algorithm=N0;break;default:throw new Fe(Te.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${this.algorithm.hash.name}`)}this.algorithm.saltLength&&(t.SaltLength=this.algorithm.saltLength),e.Any.Add(t)}};var ei;(function(r){r[r.BeforeDocElement=0]="BeforeDocElement",r[r.InsideDocElement=1]="InsideDocElement",r[r.AfterDocElement=2]="AfterDocElement"})(ei||(ei={}));var Ga=class{static{o(this,"XmlCanonicalizer")}constructor(e,t,n=new xp){this.propagatedNamespaces=new xp,this.result=[],this.visibleNamespaces=new xp,this.inclusiveNamespacesPrefixList=[],this.state=ei.BeforeDocElement,this.withComments=e,this.exclusive=t,this.propagatedNamespaces=n}get InclusiveNamespacesPrefixList(){return this.inclusiveNamespacesPrefixList.join(" ")}set InclusiveNamespacesPrefixList(e){this.inclusiveNamespacesPrefixList=e.split(" ")}Canonicalize(e){if(!e)throw new Fe(Te.CRYPTOGRAPHIC,"Parameter 1 is not Node");return this.WriteNode(e),this.result.join("")}WriteNode(e){switch(e.nodeType){case Ut.Document:case Ut.DocumentFragment:this.WriteDocumentNode(e);break;case Ut.Element:this.WriteElementNode(e);break;case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Text:Dc(e.parentNode)||this.WriteTextNode(e);break;case Ut.Whitespace:this.state===ei.InsideDocElement&&this.WriteTextNode(e);break;case Ut.Comment:this.WriteCommentNode(e);break;case Ut.ProcessingInstruction:this.WriteProcessingInstructionNode(e);break;case Ut.EntityReference:for(let t=0;t<e.childNodes.length;t++)this.WriteNode(e.childNodes[t]);break;case Ut.Attribute:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.EndElement:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.EndEntity:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.DocumentType:case Ut.Entity:case Ut.Notation:case Ut.XmlDeclaration:break}}WriteDocumentNode(e){this.state=ei.BeforeDocElement;for(let t=e.firstChild;t!=null;t=t.nextSibling)this.WriteNode(t)}WriteCommentNode(e){this.withComments&&(this.state===ei.AfterDocElement?this.result.push(`
91
+ <!--`):this.result.push("<!--"),this.result.push(this.NormalizeString(e.nodeValue,Ut.Comment)),this.state===ei.BeforeDocElement?this.result.push(`-->
92
+ `):this.result.push("-->"))}WriteTextNode(e){this.result.push(this.NormalizeString(e.nodeValue,e.nodeType))}WriteProcessingInstructionNode(e){let t=e.nodeName||e.tagName;t!=="xml"&&(this.state===ei.AfterDocElement?this.result.push(`
93
+ <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,Ut.ProcessingInstruction))),this.state===ei.BeforeDocElement?this.result.push(`?>
94
+ `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===ei.BeforeDocElement&&(this.state=ei.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===ei.BeforeDocElement&&(this.state=ei.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!aD(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let h={prefix:a.prefix,namespace:a.namespaceURI};t.push(h),this.visibleNamespaces.Add(h),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let h={prefix:a.prefix,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}let u=null,l;(l=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=l[1]);let f=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let h=tM(e,u);if(h>1)f=!1;else if(h===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&f){let h={prefix:u,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(Jie);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];aD(s)||t.push(s)}t.sort(zie),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,Ut.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===Ut.Attribute?n.push("&quot;"):i===" "&&t===Ut.Attribute?n.push("&#x9;"):i===`
95
+ `&&t===Ut.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case Ut.Text:case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function Jie(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(Jie,"XmlDsigC14NTransformNamespacesComparer");function zie(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(zie,"XmlDsigC14NTransformAttributesComparer");function tM(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!aD(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===Ut.Element){let a=tM(s,e,t);if(s.nodeType===Ut.Element&&a)return++t+a}return t}o(tM,"IsNamespaceUsed");function aD(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===Ut.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(aD,"IsNamespaceNode");var o2=class extends Ri{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element||n.nodeName===de.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case de.ElementNames.RSAPSSParams:s=ia;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};o2=He([Mt({localName:"Other"})],o2);var Wa=class extends Fr{static{o(this,"SignatureMethod")}};He([_r({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:""}),ft("design:type",String)],Wa.prototype,"Algorithm",void 0);He([Xt({localName:de.ElementNames.HMACOutputLength,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,converter:lg}),ft("design:type",Number)],Wa.prototype,"HMACOutputLength",void 0);He([Xt({parser:o2,noRoot:!0,minOccurs:0}),ft("design:type",o2)],Wa.prototype,"Any",void 0);Wa=He([Mt({localName:de.ElementNames.SignatureMethod})],Wa);var U0=class extends Fr{static{o(this,"CanonicalizationMethod")}};He([_r({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:de.DefaultCanonMethod}),ft("design:type",String)],U0.prototype,"Algorithm",void 0);U0=He([Mt({localName:de.ElementNames.CanonicalizationMethod})],U0);var M0=class extends Fr{static{o(this,"DataObject")}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],M0.prototype,"Id",void 0);He([_r({localName:de.AttributeNames.MimeType,defaultValue:""}),ft("design:type",String)],M0.prototype,"MimeType",void 0);He([_r({localName:de.AttributeNames.Encoding,defaultValue:""}),ft("design:type",String)],M0.prototype,"Encoding",void 0);M0=He([Mt({localName:de.ElementNames.Object})],M0);var wv=class extends Ri{static{o(this,"DataObjects")}};wv=He([Mt({localName:"xmldsig_objects",parser:M0})],wv);var rs=class extends Fr{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new Fe(Te.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};He([_r({localName:de.AttributeNames.Algorithm,defaultValue:""}),ft("design:type",String)],rs.prototype,"Algorithm",void 0);He([Xt({localName:de.ElementNames.XPath,defaultValue:""}),ft("design:type",String)],rs.prototype,"XPath",void 0);rs=He([Mt({localName:de.ElementNames.Transform})],rs);var Qo=class extends rs{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=de.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return vr.FromString(this.innerXml.textContent||"","base64")}};var Ja=class extends rs{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Ga(!1,!1)}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},za=class extends Ja{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Ga(!0,!1)}};var Zo=class extends rs{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)Js(e)&&e.localName===de.ElementNames.Signature&&e.namespaceURI===de.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var Ya=class extends rs{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Ga(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Qa=class extends Ya{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Ga(!0,!0)}};function rM(r){return r.parentNode?rM(r.parentNode):r}o(rM,"lookupParentNode");var j0=class extends rs{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=de.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");this.Filter(rM(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:Cp("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?Cp("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(f=>i.lookupNamespaceURI(f),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};He([Xt({localName:de.ElementNames.XPath,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],j0.prototype,"XPath",void 0);var F0=class extends Ri{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return hh(t,Zo);case de.AlgorithmNamespaces.XmlDsigC14NTransform:return hh(t,Ja);case de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return hh(t,za);case de.AlgorithmNamespaces.XmlDsigExcC14NTransform:return hh(t,Ya);case de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return hh(t,Qa);case de.AlgorithmNamespaces.XmlDsigBase64Transform:return hh(t,Qo);case de.AlgorithmNamespaces.XmlDsigXPathTransform:return hh(t,j0);default:try{let n=Sv.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new Fe(Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};F0=He([Mt({localName:de.ElementNames.Transforms,parser:rs})],F0);function hh(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(hh,"ChangeTransform");var Za=class extends Fr{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new Pi,e&&(this.Uri=e)}};He([_r({defaultValue:""}),ft("design:type",String)],Za.prototype,"Id",void 0);He([_r({localName:de.AttributeNames.URI}),ft("design:type",String)],Za.prototype,"Uri",void 0);He([_r({localName:de.AttributeNames.Type,defaultValue:""}),ft("design:type",String)],Za.prototype,"Type",void 0);He([Xt({parser:F0}),ft("design:type",F0)],Za.prototype,"Transforms",void 0);He([Xt({required:!0,parser:Pi}),ft("design:type",Pi)],Za.prototype,"DigestMethod",void 0);He([Xt({required:!0,localName:de.ElementNames.DigestValue,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,converter:bi}),ft("design:type",Uint8Array)],Za.prototype,"DigestValue",void 0);Za=He([Mt({localName:de.ElementNames.Reference}),ft("design:paramtypes",[String])],Za);var q0=class extends Ri{static{o(this,"References")}};q0=He([Mt({localName:"References",parser:Za})],q0);var eu=class extends Fr{static{o(this,"SignedInfo")}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],eu.prototype,"Id",void 0);He([Xt({parser:U0,required:!0}),ft("design:type",U0)],eu.prototype,"CanonicalizationMethod",void 0);He([Xt({parser:Wa,required:!0}),ft("design:type",Wa)],eu.prototype,"SignatureMethod",void 0);He([Xt({parser:q0,minOccurs:1,noRoot:!0}),ft("design:type",q0)],eu.prototype,"References",void 0);eu=He([Mt({localName:de.ElementNames.SignedInfo})],eu);var X0="http://www.w3.org/2001/04/xmldsig-more#",G0="ecdsa",ph=class extends Bs{static{o(this,"EcdsaPublicKey")}};He([Xt({localName:de.ElementNames.X,namespaceURI:X0,prefix:G0,required:!0,converter:bi}),ft("design:type",Uint8Array)],ph.prototype,"X",void 0);He([Xt({localName:de.ElementNames.Y,namespaceURI:X0,prefix:G0,required:!0,converter:bi}),ft("design:type",Uint8Array)],ph.prototype,"Y",void 0);ph=He([Mt({localName:de.ElementNames.PublicKey,namespaceURI:X0,prefix:G0})],ph);var H0=class extends Bs{static{o(this,"NamedCurve")}};He([_r({localName:de.AttributeNames.URI,required:!0}),ft("design:type",String)],H0.prototype,"Uri",void 0);H0=He([Mt({localName:de.ElementNames.NamedCurve,namespaceURI:X0,prefix:G0})],H0);var K0=class extends Bs{static{o(this,"DomainParameters")}};He([Xt({parser:H0}),ft("design:type",H0)],K0.prototype,"NamedCurve",void 0);K0=He([Mt({localName:de.ElementNames.DomainParameters,namespaceURI:X0,prefix:G0})],K0);var $0=class extends Zs{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=de.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===zo.toUpperCase()}get NamedCurve(){return sM(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await hn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new ph,this.PublicKey.X=vr.FromString(t.x||"","base64url"),this.PublicKey.Y=vr.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new K0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new H0),this.DomainParameters.NamedCurve.Uri=sM(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=vr.ToBase64Url(this.PublicKey.X),n=vr.ToBase64Url(this.PublicKey.Y),s=Yie(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await hn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};He([Xt({parser:K0}),ft("design:type",K0)],$0.prototype,"DomainParameters",void 0);He([Xt({parser:ph,required:!0}),ft("design:type",ph)],$0.prototype,"PublicKey",void 0);$0=He([Mt({localName:de.ElementNames.ECDSAKeyValue,namespaceURI:X0,prefix:G0})],$0);function sM(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(sM,"GetNamedCurveOid");function Yie(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(Yie,"GetNamedCurveFromOid");var Qie=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},Zl=new Qie;Zl.set(de.ElementNames.RSAKeyValue,L0);Zl.set(de.ElementNames.ECDSAKeyValue,$0);var u2=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=Zl.get(e);if(!t)throw new Fe(Te.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var Ev=class extends Zs{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of Zl)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new Fe(Te.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new Fe(Te.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(Js(n))try{let s=n.localName,i=u2.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new Fe(Te.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};Ev=He([Mt({localName:de.ElementNames.KeyValue}),ft("design:paramtypes",[Zs])],Ev);var Zie={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},W0=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return hn.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===zo){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=Zie[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Hr(this.raw.buffer);this.simpl=new ts({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var l2=class extends Fr{static{o(this,"X509IssuerSerial")}};He([Xt({localName:de.ElementNames.X509IssuerName,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],l2.prototype,"X509IssuerName",void 0);He([Xt({localName:de.ElementNames.X509SerialNumber,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],l2.prototype,"X509SerialNumber",void 0);l2=He([Mt({localName:de.ElementNames.X509IssuerSerial})],l2);var dh;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(dh||(dh={}));var J0=class extends Zs{static{o(this,"KeyInfoX509Data")}constructor(e,t=dh.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new W0(e));else if(e instanceof W0)switch(t){case dh.None:case dh.EndCertOnly:this.AddCertificate(e);break;case dh.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case dh.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new Fe(Te.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new Fe(Te.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new Fe(Te.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=vr.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509IssuerSerial),a=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SKI);i.textContent=vr.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509Certificate);i.textContent=vr.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509CRL);s.textContent=vr.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(de.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Fr.GetChild(s,de.ElementNames.X509IssuerName,de.NamespaceURI,!0),a=Fr.GetChild(s,de.ElementNames.X509SerialNumber,de.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(de.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=vr.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(de.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(de.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=vr.FromBase64(s.textContent);this.AddCertificate(new W0(i))}});let n=this.GetChild(de.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=vr.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};J0=He([Mt({localName:de.ElementNames.X509Data}),ft("design:paramtypes",[Object,Object])],J0);var Av=class extends Zs{static{o(this,"SPKIData")}async importKey(e){let t=await hn.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await hn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};He([Xt({localName:de.ElementNames.SPKIexp,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0,converter:bi}),ft("design:type",Object)],Av.prototype,"SPKIexp",void 0);Av=He([Mt({localName:de.ElementNames.SPKIData})],Av);var mh=class extends Ri{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element)continue;let s=null;switch(n.localName){case de.ElementNames.KeyValue:s=Ev;break;case de.ElementNames.X509Data:s=J0;break;case de.ElementNames.SPKIData:s=Av;break;case de.ElementNames.KeyName:case de.ElementNames.RetrievalMethod:case de.ElementNames.PGPData:case de.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],mh.prototype,"Id",void 0);mh=He([Mt({localName:de.ElementNames.KeyInfo})],mh);var ec=class extends Fr{static{o(this,"Signature")}};He([_r({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],ec.prototype,"Id",void 0);He([Xt({parser:eu,required:!0}),ft("design:type",eu)],ec.prototype,"SignedInfo",void 0);He([Xt({localName:de.ElementNames.SignatureValue,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0,converter:bi,defaultValue:null}),ft("design:type",Object)],ec.prototype,"SignatureValue",void 0);He([Xt({parser:mh}),ft("design:type",mh)],ec.prototype,"KeyInfo",void 0);He([Xt({parser:wv,noRoot:!0}),ft("design:type",wv)],ec.prototype,"ObjectList",void 0);ec=He([Mt({localName:de.ElementNames.Signature})],ec);var tae=class extends Map{static{o(this,"AlgorithmRegistry")}},hr=new tae;hr.set(t2,{type:"signature",algorithm:R0});hr.set(r2,{type:"signature",algorithm:P0});hr.set(n2,{type:"signature",algorithm:O0});hr.set(s2,{type:"signature",algorithm:k0});hr.set(t2,{type:"signature",algorithm:R0});hr.set(r2,{type:"signature",algorithm:P0});hr.set(n2,{type:"signature",algorithm:O0});hr.set(s2,{type:"signature",algorithm:k0});hr.set(iD,{type:"signature",algorithm:a2});hr.set(JC,{type:"signature",algorithm:T0});hr.set(zC,{type:"signature",algorithm:I0});hr.set(YC,{type:"signature",algorithm:B0});hr.set(QC,{type:"signature",algorithm:D0});hr.set(JC.toUpperCase(),{type:"signature",algorithm:T0});hr.set(zC.toUpperCase(),{type:"signature",algorithm:I0});hr.set(YC.toUpperCase(),{type:"signature",algorithm:B0});hr.set(QC.toUpperCase(),{type:"signature",algorithm:D0});hr.set(ZB,{type:"signature",algorithm:mv});hr.set(eD,{type:"signature",algorithm:gv});hr.set(tD,{type:"signature",algorithm:yv});hr.set(rD,{type:"signature",algorithm:vv});hr.set(C0,{type:"hash",algorithm:XC});hr.set(b0,{type:"hash",algorithm:dv});hr.set(x0,{type:"hash",algorithm:GC});hr.set(N0,{type:"hash",algorithm:WC});var gh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of hr)if(n==="hash"&&t===e)return new s;throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of hr)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of hr)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of hr)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}};var rae=class extends Map{static{o(this,"TransformRegistry")}},tu=new rae;tu.set(de.AlgorithmNamespaces.XmlDsigBase64Transform,Qo);tu.set(de.AlgorithmNamespaces.XmlDsigC14NTransform,Ja);tu.set(de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,za);tu.set(de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Zo);tu.set(de.AlgorithmNamespaces.XmlDsigExcC14NTransform,Ya);tu.set(de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Qa);var Sv=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"name");let t=tu.get(e);if(t)return new t;let n;switch(e){case de.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Qo;break;case de.AlgorithmNamespaces.XmlDsigC14NTransform:n=new Ja;break;case de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new za;break;case de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Zo;break;case de.AlgorithmNamespaces.XmlDsigXPathTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case de.AlgorithmNamespaces.XmlDsigXsltTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case de.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new Ya;break;case de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Qa;break;case de.AlgorithmNamespaces.XmlDecryptionTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return gh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return gh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return gh.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),gh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Wa;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){hr.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){hr.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){Zl.set(e,t)}static RegisterTransform(e,t){tu.set(e,t)}};var c2=hw(zN(),1);var iM={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var aM={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var sae=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),oM=o(r=>typeof r=="string"?lo(new Ks(r)):r instanceof Error?lo(new Ks(r.message,{cause:r.cause})):sae(r)?lo(new Ks(r.message)):lo(new Ks("unexpected error")),"leftFromError");var uM=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=uae){this.xml2js=e,CV({XMLSerializer:c2.default.XMLSerializer,DOMParser:c2.default.DOMParser,DOMImplementation:c2.default.DOMImplementation})}async validate(e,t,n){try{return await z8.validate(e,t,iae.readFileSync(aae.resolve(t,n),"utf8")),Oh()}catch(s){return oM(s)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...aM,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...iM,...t}).buildObject(e))}digest(e,t,n=pm){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=pm){let n=Ci(this.clear(e));return new Ga(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let s=Ci(e).documentElement.getElementsByTagName(t).item(0);return s?this.clear(Ua(s)):null}getFirstNode(e){let n=Ci(e).documentElement.firstChild;return n?this.clear(Ua(n)):null}getAttribute(e,t){return Ci(e).documentElement.getAttribute(t)}appendNode(e,t){let n=Ci(e),{documentElement:s}=Ci(t);return n.documentElement.appendChild(s),this.clear(Ua(n))}hash(e,t){return oae.createHash(t).update(e,"utf8").digest().toString("base64")}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
96
+ `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};export{Nb as a,RR as b,Tb as c,Rh as d,Ib as e,xK as f,cae as g,hae as h,Ks as i,PR as j,Bb as k,Ph as l,Db as m,dw as n,lo as o,Oh as p,OR as q,kR as r,dm as s,eoe as t,toe as u,VR as v,UR as w,MR as x,foe as y,jR as z,Eoe as A,Ioe as B,Uoe as C,HR as D,KR as E,$R as F,XR as G,GR as H,WR as I,JR as J,zR as K,YR as L,QR as M,ZR as N,eP as O,tP as P,rP as Q,nP as R,sP as S,iP as T,aP as U,oP as V,uP as W,lP as X,cP as Y,fP as Z,hP as _,pP as $,dP as aa,mP as ba,gP as ca,_P as da,RP as ea,z3 as fa,Y3 as ga,W8 as ha,oM as ia,uM as ja};
97
+ /*! Bundled license information:
98
+
99
+ lodash/lodash.js:
100
+ (**
101
+ * @license
102
+ * Lodash <https://lodash.com/>
103
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
104
+ * Released under MIT license <https://lodash.com/license>
105
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
106
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
107
+ *)
108
+
109
+ axios/dist/node/axios.cjs:
110
+ (*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors *)
111
+
112
+ js-md4/src/md4.js:
113
+ (**
114
+ * [js-md4]{@link https://github.com/emn178/js-md4}
115
+ *
116
+ * @namespace md4
117
+ * @version 0.3.2
118
+ * @author Yi-Cyuan Chen [emn178@gmail.com]
119
+ * @copyright Yi-Cyuan Chen 2015-2027
120
+ * @license MIT
121
+ *)
122
+
123
+ sax/lib/sax.js:
124
+ (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
125
+
126
+ decimal.js/decimal.mjs:
127
+ (*!
128
+ * decimal.js v10.6.0
129
+ * An arbitrary-precision Decimal type for JavaScript.
130
+ * https://github.com/MikeMcl/decimal.js
131
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
132
+ * MIT Licence
133
+ *)
134
+
135
+ pvtsutils/build/index.es.js:
136
+ (*!
137
+ * MIT License
138
+ *
139
+ * Copyright (c) 2017-2024 Peculiar Ventures, LLC
140
+ *
141
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
142
+ * of this software and associated documentation files (the "Software"), to deal
143
+ * in the Software without restriction, including without limitation the rights
144
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
+ * copies of the Software, and to permit persons to whom the Software is
146
+ * furnished to do so, subject to the following conditions:
147
+ *
148
+ * The above copyright notice and this permission notice shall be included in all
149
+ * copies or substantial portions of the Software.
150
+ *
151
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
157
+ * SOFTWARE.
158
+ *
159
+ *)
160
+
161
+ pvutils/build/utils.es.js:
162
+ (*!
163
+ Copyright (c) Peculiar Ventures, LLC
164
+ *)
165
+
166
+ asn1js/build/index.es.js:
167
+ (*!
168
+ * Copyright (c) 2014, GMO GlobalSign
169
+ * Copyright (c) 2015-2022, Peculiar Ventures
170
+ * All rights reserved.
171
+ *
172
+ * Author 2014-2019, Yury Strozhevsky
173
+ *
174
+ * Redistribution and use in source and binary forms, with or without modification,
175
+ * are permitted provided that the following conditions are met:
176
+ *
177
+ * * Redistributions of source code must retain the above copyright notice, this
178
+ * list of conditions and the following disclaimer.
179
+ *
180
+ * * Redistributions in binary form must reproduce the above copyright notice, this
181
+ * list of conditions and the following disclaimer in the documentation and/or
182
+ * other materials provided with the distribution.
183
+ *
184
+ * * Neither the name of the copyright holder nor the names of its
185
+ * contributors may be used to endorse or promote products derived from
186
+ * this software without specific prior written permission.
187
+ *
188
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
189
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
190
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
191
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
192
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
193
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
194
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
195
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
196
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
197
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
198
+ *
199
+ *)
200
+
201
+ @noble/hashes/esm/utils.js:
202
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
203
+
204
+ pkijs/build/index.es.js:
205
+ (*!
206
+ * Copyright (c) 2014, GlobalSign
207
+ * Copyright (c) 2015-2019, Peculiar Ventures
208
+ * All rights reserved.
209
+ *
210
+ * Author 2014-2019, Yury Strozhevsky
211
+ *
212
+ * Redistribution and use in source and binary forms, with or without modification,
213
+ * are permitted provided that the following conditions are met:
214
+ *
215
+ * * Redistributions of source code must retain the above copyright notice, this
216
+ * list of conditions and the following disclaimer.
217
+ *
218
+ * * Redistributions in binary form must reproduce the above copyright notice, this
219
+ * list of conditions and the following disclaimer in the documentation and/or
220
+ * other materials provided with the distribution.
221
+ *
222
+ * * Neither the name of the {organization} nor the names of its
223
+ * contributors may be used to endorse or promote products derived from
224
+ * this software without specific prior written permission.
225
+ *
226
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
227
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
228
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
229
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
230
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
231
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
232
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
233
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
234
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
235
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
236
+ *
237
+ *)
238
+ */