forked from wechatpay-apiv3/wechatpay-postman-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wechatpay-apiv3.postman_collection.json
657 lines (657 loc) · 503 KB
/
wechatpay-apiv3.postman_collection.json
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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
{
"info": {
"_postman_id": "85f478d8-2596-420a-9f21-53376fc6ad0a",
"name": "微信支付 APIv3",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "3391715"
},
"item": [
{
"name": "微信支付平台证书",
"item": [
{
"name": "获取微信支付平台证书列表",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://api.mch.weixin.qq.com/v3/certificates",
"protocol": "https",
"host": [
"api",
"mch",
"weixin",
"qq",
"com"
],
"path": [
"v3",
"certificates"
]
}
},
"response": [
{
"name": "获取微信支付平台证书列表",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{auth}}",
"description": "客户端提供的身份认证信息",
"type": "text"
}
],
"url": {
"raw": "https://api.mch.weixin.qq.com/v3/certificates",
"protocol": "https",
"host": [
"api",
"mch",
"weixin",
"qq",
"com"
],
"path": [
"v3",
"certificates"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "nginx"
},
{
"key": "Date",
"value": "Tue, 20 Sep 2022 08:25:00 GMT"
},
{
"key": "Content-Type",
"value": "application/json; charset=utf-8"
},
{
"key": "Content-Length",
"value": "2204"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Keep-Alive",
"value": "timeout=8"
},
{
"key": "Cache-Control",
"value": "no-cache, must-revalidate"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Request-ID",
"value": "08DCF1A59906106818C2C18C5820FC0228D115-0"
},
{
"key": "Content-Language",
"value": "zh-CN"
},
{
"key": "Wechatpay-Nonce",
"value": "ff63d3301a87be3ce5f076abcb0f3ce5"
},
{
"key": "Wechatpay-Signature",
"value": "VxvMRyTc3vjhxBsDaRNnWYWOEpSxnb61VhHgtCKW1QdalV7Fu/bzYsyFyOQ7TCAlB1wGR8J+7tE6lFKEQMxzXpeUTcRHWMUwPZvYESSjBDxIyEiziD36nkE7SRo5n69LG04GnVSx5DDoXnqcJrkJnhWR/ttQmr1wvQBw82qepy2+0grago1P1hAWGOdMRUbT8iKCov5l/q6Y+zGDYpJGRg7OfDeVOfLyMaOR9z0U+D4hogEr3nGQ2n85Yk4NA+libPYyb/R7eeDMWZ8et1RgbAkfO9ouRqNVm8U2lR8XdNgKCkTGsOSiKKMxuPWGtQnZynoEvnQWZn+2Eygdffl8Dw=="
},
{
"key": "Wechatpay-Timestamp",
"value": "1663662300"
},
{
"key": "Wechatpay-Serial",
"value": "19FBBF2A24A3F3C97F5925FA855A850D6E4624AF"
},
{
"key": "Wechatpay-Signature-Type",
"value": "WECHATPAY2-SHA256-RSA2048"
}
],
"cookie": [],
"body": "{\n \"data\": [\n {\n \"effective_time\": \"2018-10-09T21:48:14+08:00\",\n \"encrypt_certificate\": {\n \"algorithm\": \"AEAD_AES_256_GCM\",\n \"associated_data\": \"certificate\",\n \"ciphertext\": \"pUP7ASDyy89HcVwh+CZn2ySmgX5HVjmYmkKrCx9I+Lz5lkj9QY1TXDpylpRmN+bNRk0rhmVMK3Z2G51WFQCj6SbSQABwCyTwB3yRJnXXQdIGLtrFmZhMml9ZwTaeECWbrTsZfWzicN4jDxrhA/YZJepXC36yEyDRPScECFD8GztvDhysowkG2WXDk921mFkE9kDrHdIL85EBBqNlD2WpTVMNG5Pzg65Y3Z3FeDFr0ExHwjaR9gPwdl6D1GT+xuhiQyMtr3w/9urbDH9hyyZ/vjm4NUf9SSSvxv0nf58endYtNtPgd6vnQe9RaRxZheVCAxF5b+FhDyQYDkVQjlgsXd2mlgUkG8OQubwxPja3mgvu8J7BdOcuHIHoKOabTfeR+jy3yyn3ZbAaYIk/TyTY2irFeAFtoewZw0qbKOELMeADKYwHC1uCOxeSikxwYe+OOQzehZpz7jzNcKZW+378xgVNvOWX6N7Fn4GpqE8zcyCJJglB+2Rpw70znGyYX8N/0iTrbtebL2opA6ptpk41OuAKrJ7/zZEQmZ4Z8RioIWToYQVdEJM0Wb5N1fwIQqJqvVKWEE3IrmAHF46rkOTjmYs9sDcg7p8h8/HWpu4nfWD0ApK/tMg2mRI8Frn7/cOYrhZymP7Yy9mcj9kKU7T7+HcDa6LmVfX36YVHb+3aU4teTrworKbJ+OlZu7AQ+0bruhXV8gw73SRqtcTWOwic8CBRaH16LpfGvC7b0SxRFI9qrkjb/ce6HVDyujL7p/9YIedwjmzTa4rovwbeSPUG5Px2JB1PF8OKWSd3IVPI6UXIRzLmhNNsAep7UaQinBngl+rxzlDIhqm3+Ild6oWAS+W57syzp/x6gVQpq0fwAaQhaeyLJlbVF7r75q4Xe+2Of+ck05pMZI4boOQdbyoL4+FQMiRygpEN1FEmLfLEamUBfSiBCyKxX89fnpPrhP/1Wl2LrdUSJRV3YbC27SzBDmnnlbTW1ltLgaBpwyv1RoFQ4XnocNse6704ul8j771DaWtbhj1p6aiwO5TAmi0xKSxzEBMtvMdGinNTqOOSuSS8cf62lpjdSD4LzkoefnefsqZwvWcTsBjD7i72+9L8XZ2vdPY7p2C18U7dk03hGgQ8ReaYmmqGqiT0QVPmJ84SCMYaHX1J0gH/5OU8tKGXicKCGWibvZtIPWWghVzjZp8W+aRicyIJoUgFMoMe3uROXYnKOaw8iEM1nBaCIVnmm27GR0k6JUjhoyDgnQvFv6mPDxQa3KLrWxwbTbSKuadlF84NNGgZ30qfhkNZoBurrVLILIHz5MaCjpgFW55EfMTJ/RmX3yxOrgREtVzh4XGkhu01UFweY36N702BF1m/fSe4pU5ZtxiMJdKO1gAATMwsJBYrczDWh+N5ZqIdd1+1iypjrv2VaeJ0YNIQ6SJmWx1qVzIlKbauUXWcy0qTAeiqiQi/lzrrkt/IyRK9qpQFShzqXhr53bw0VjY6HSrCKScMHn10uAGrDrXfDw/Z7yB9fBiKrHHaFZk+0+w26ebtRQk5sJ+3W1EqT1wg5yz5JgvktwP9Rc0K0yxvmYUxXPUXycYjMBjVjTQgoHKouP9nCegw00lD65xuNxRGbgo9njrLIbsvP+ceu0U/XfRFi8d49ZvtyTEA7zd3gZamyGMGKLjnV83L8RjBuKL0LisQEZMq+DVVH0u6I/ZX+MIScJfjt0M5tMWWxzVkMwrb9n4IiOv9U8TyaMKL7M2RqKOB5pFANg9+m5UJcC+aAugyMtAHfGhJUxTJ+XC2t/5o2glTKAgcCO/dtgmk6rijdEVJy4VwsaJ/j1Ndo3tNdYI4okrqbZOJMpactZtz8SNDzD/d861Om2Ae+WH+8nyDjNcsz4PUNeKuNVVtiOAOFE79LHD9T2ncDZuxAeaiEP4lJN1Od4pU\",\n \"nonce\": \"cef99389cb29\"\n },\n \"expire_time\": \"2023-10-08T21:48:14+08:00\",\n \"serial_no\": \"19FBBF2A24A3F3C97F5925FA855A850D6E4624AF\"\n }\n ]\n}"
}
]
}
]
},
{
"name": "JSAPI支付",
"item": [
{
"name": "JSAPI下单",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"mchid\": \"190000****\",\n\t\"out_trade_no\": \"20220907-test-***\",\n\t\"appid\": \"wxa9d9651ae82ec4b9\",\n\t\"description\": \"Image形象店-深圳腾大-QQ公仔\",\n\t\"notify_url\": \"https://www.weixin.qq.com/wxpay/pay.php\",\n\t\"amount\": {\n\t\t\"total\": 1,\n\t\t\"currency\": \"CNY\"\n\t},\n\t\"payer\": {\n\t\t\"openid\": \"oLTPCuN5a-nBD4rAL_fa0o8p****\"\n\t}\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi",
"protocol": "https",
"host": [
"api",
"mch",
"weixin",
"qq",
"com"
],
"path": [
"v3",
"pay",
"transactions",
"jsapi"
]
}
},
"response": [
{
"name": "200_OK",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "{{auth}}",
"description": "客户端的身份认证信息",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"mchid\": \"190000****\",\n\t\"out_trade_no\": \"20220907-test-***\",\n\t\"appid\": \"wxa9d9651ae82ec4b9\",\n\t\"description\": \"Image形象店-深圳腾大-QQ公仔\",\n\t\"notify_url\": \"https://www.weixin.qq.com/wxpay/pay.php\",\n\t\"amount\": {\n\t\t\"total\": 1,\n\t\t\"currency\": \"CNY\"\n\t},\n\t\"payer\": {\n\t\t\"openid\": \"oLTPCuN5a-nBD4rAL_fa0o8p****\"\n\t}\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi",
"protocol": "https",
"host": [
"api",
"mch",
"weixin",
"qq",
"com"
],
"path": [
"v3",
"pay",
"transactions",
"jsapi"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Server",
"value": "nginx"
},
{
"key": "Date",
"value": "Wed, 07 Sep 2022 11:00:40 GMT"
},
{
"key": "Content-Type",
"value": "application/json; charset=utf-8"
},
{
"key": "Content-Length",
"value": "52"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Keep-Alive",
"value": "timeout=8"
},
{
"key": "Cache-Control",
"value": "no-cache, must-revalidate"
},
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "Request-ID",
"value": "08D7F3E19806109F071889D2EAA306200028F98101-0"
},
{
"key": "Request-ID",
"value": "08D7F3E19806109F071889D2EAA306200028F98101-0"
},
{
"key": "Content-Language",
"value": "zh-CN"
},
{
"key": "Wechatpay-Nonce",
"value": "c7f41cadbae3a6027d88e46daaa005ae"
},
{
"key": "Wechatpay-Signature",
"value": "T8xSLB9POrdp4mdiqT2egIREwGPBZ41JeraJcT5eLMODPDyKzPeFWBH/5sAvFhhiwEq5L10F9qtodLVdx12N/P/VPKTqxYyTKmUgq/yOPngbLFsZPpcMXyPkNbWLNRpMaRhwGjuJ91fzylFh/6vX11i2bV0p3C9iG8Luh2viCYg0lWCUeC2pWXdY/U2fjGj95448nkzjIENwGGoZ2kgiUWbaKeXV1p/D6Agog4ma0etJCOnOfzWjZ5CLVUa7TmaEsGerE2Bs0xLe9osNYC6D2jrSqRPsXlnjFUgBrHJjvnFxtrQmnucsU3YzYO7ah4NV1j/+ZdoShTS7KPzk0nzWVg=="
},
{
"key": "Wechatpay-Timestamp",
"value": "1662548440"
},
{
"key": "Wechatpay-Serial",
"value": "19FBBF2A24A3F3C97F5925FA855A850D6E4624AF"
},
{
"key": "Wechatpay-Signature-Type",
"value": "WECHATPAY2-SHA256-RSA2048"
}
],
"cookie": [],
"body": "{\n \"prepay_id\": \"wx071900406588238ff38ea3608d8b360904\"\n}"
}
]
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const forge_code = pm.collectionVariables.get(\"forge_code\");",
"(new Function(forge_code))();",
"",
"const { asn1 } = forge;",
"",
"/**",
" * 从PEM证书中获取国密PrivateKey对象.",
" *",
" * @param pem 国密商户API私钥.",
" *",
" * @return 国密PrivateKey对象.",
" */",
"function privateKeyFromPem(pem) {",
" const msg = forge.pem.decode(pem)[0];",
"",
" if (msg.type !== \"PRIVATE KEY\") {",
" throw new Error(\"格式非法的商户API私钥.错误的PEM类型\");",
" }",
"",
" if (msg?.procType === \"ENCRYPTED\") {",
" throw new Error(\"格式非法的商户API私钥.不支持加密的PEM\");",
" }",
"",
" const privateKeyValidator = {",
" // PrivateKeyInfo",
" name: \"PrivateKeyInfo\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.SEQUENCE,",
" constructed: true,",
" value: [",
" {",
" // Version (INTEGER)",
" name: \"PrivateKeyInfo.version\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.INTEGER,",
" constructed: false,",
" capture: \"privateKeyVersion\",",
" },",
" {",
" // privateKeyAlgorithm",
" name: \"PrivateKeyInfo.privateKeyAlgorithm\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.SEQUENCE,",
" constructed: true,",
" value: [",
" {",
" name: \"AlgorithmIdentifier.algorithm\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OID,",
" constructed: false,",
" capture: \"algorithm\",",
" },",
" {",
" name: \"AlgorithmIdentifier.namedCurveOID\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OID,",
" constructed: false,",
" capture: \"namedCurveOid\",",
" },",
" ],",
" },",
" {",
" // privateKeyInfo",
" name: \"PrivateKeyInfo.PrivateKey\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OCTETSTRING,",
" constructed: false,",
" capture: \"ecPrivateKey\",",
" },",
" ],",
" };",
" const ecPrivateKeyValidator = {",
" name: \"ecPrivateKeyInfo\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.SEQUENCE,",
" constructed: true,",
" value: [",
" {",
" // Version",
" name: \"Version\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.INTEGER,",
" constructed: false,",
" capture: \"version\",",
" },",
" {",
" // PrivateKey",
" name: \"PrivateKey\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OCTETSTRING,",
" constructed: false,",
" capture: \"privateKey\",",
" },",
" {",
" // NamedCurveOID, optional, tag:0",
" name: \"NamedCurveOID\",",
" tagClass: asn1.Class.CONTEXT_SPECIFIC,",
" type: 0,",
" optional: true,",
" constructed: true,",
" value: [",
" {",
" name: \"ObjectIdentifier\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OID,",
" constructed: false,",
" capture: \"namedCurveOid\",",
" },",
" ],",
" },",
" {",
" // PublicKey, optional, tag:1",
" name: \"PublicKey\",",
" tagClass: asn1.Class.CONTEXT_SPECIFIC,",
" type: 1,",
" optional: true,",
" constructed: true,",
" value: [",
" {",
" name: \"PublicKey\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.BITSTRING,",
" constructed: false,",
" captureBitStringValue: \"publicKey\",",
" },",
" ],",
" },",
" ],",
" };",
"",
" let obj = asn1.fromDer(msg.body);",
" // get PrivateKeyInfo",
" let privateKeyInfo = {};",
" let errors = [];",
" if (asn1.validate(obj, privateKeyValidator, privateKeyInfo, errors)) {",
" obj = asn1.fromDer(forge.util.createBuffer(privateKeyInfo.ecPrivateKey));",
" } else {",
" let error = new Error(\"读取商户API私钥失败. ASN.1结构中没有包含私钥\");",
" error.errors = errors;",
" throw error;",
" }",
" privateKeyInfo.privateKeyVersion = forge.util.bytesToHex(",
" privateKeyInfo.privateKeyVersion",
" );",
" privateKeyInfo.algorithm = asn1.derToOid(privateKeyInfo.algorithm);",
" privateKeyInfo.namedCurveOid = asn1.derToOid(privateKeyInfo.namedCurveOid);",
"",
" // get ECDSA PrivateKey",
" let ecPrivateKeyInfo = {};",
" errors = [];",
" if (!asn1.validate(obj, ecPrivateKeyValidator, ecPrivateKeyInfo, errors)) {",
" let error = new Error(\"读取商户API私钥失败. ASN.1结构中没有包含ECDSA私钥\");",
" error.errors = errors;",
" throw error;",
" }",
"",
" ecPrivateKeyInfo.version = forge.util.bytesToHex(ecPrivateKeyInfo.version);",
" ecPrivateKeyInfo.privateKey = forge.util.bytesToHex(",
" ecPrivateKeyInfo.privateKey",
" );",
" if (\"publicKey\" in ecPrivateKeyInfo) {",
" ecPrivateKeyInfo.publicKey = forge.util.bytesToHex(",
" ecPrivateKeyInfo.publicKey",
" );",
" }",
" if (\"namedCurveOid\" in ecPrivateKeyInfo) {",
" ecPrivateKeyInfo.namedCurveOid = asn1.derToOid(",
" ecPrivateKeyInfo.namedCurveOid",
" );",
" }",
" privateKeyInfo.ecPrivateKey = ecPrivateKeyInfo;",
"",
" return privateKeyInfo;",
"}",
"",
"/**",
" * 从PEM证书中获取国密PublicKey对象.",
" *",
" * @param pem 国密商户API公钥.",
" *",
" * @return 国密PublicKey对象.",
" */",
"function publicKeyFromPem(pem) {",
" let msg = forge.pem.decode(pem)[0];",
"",
" if (msg.type !== \"PUBLIC KEY\") {",
" throw new Error(\"格式非法的商户API公钥.错误的PEM类型\");",
" }",
"",
" let obj = asn1.fromDer(msg.body);",
"",
" const publicKeyValidator = {",
" // pkixPublicKey",
" name: \"PublicKeyInfo\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.SEQUENCE,",
" constructed: true,",
" value: [",
" {",
" name: \"AlgorithmIdentifier\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.SEQUENCE,",
" constructed: true,",
" value: [",
" {",
" name: \"AlgorithmIdentifier.algorithm\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OID,",
" constructed: false,",
" capture: \"algorithm\",",
" },",
" {",
" name: \"NamedCurveOID\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.OID,",
" constructed: false,",
" capture: \"namedCurveOid\",",
" },",
" ],",
" },",
" {",
" // BitString",
" name: \"PublicKey\",",
" tagClass: asn1.Class.UNIVERSAL,",
" type: asn1.Type.BITSTRING,",
" constructed: false,",
" captureBitStringValue: \"publicKey\",",
" },",
" ],",
" };",
"",
" // get PublicKeyInfo",
" let publicKeyInfo = {};",
" let errors = [];",
" if (!asn1.validate(obj, publicKeyValidator, publicKeyInfo, errors)) {",
" let error = new Error(\"读取商户API公钥失败. ASN.1结构中没有包含公钥\");",
" error.errors = errors;",
" throw error;",
" }",
" publicKeyInfo.algorithm = asn1.derToOid(publicKeyInfo.algorithm);",
" publicKeyInfo.namedCurveOid = asn1.derToOid(publicKeyInfo.namedCurveOid);",
" publicKeyInfo.publicKey = forge.util.bytesToHex(publicKeyInfo.publicKey);",
"",
" return publicKeyInfo;",
"}",
"",
"const nonceStr = pm.variables.replaceIn(\"{{$guid}}\"),",
" timeStamp = pm.variables.replaceIn(\"{{$timestamp}}\");",
"",
"// 变量替换,把请求中所有的Variables赋值",
"const sdk = require(\"postman-collection\"),",
" newRequest = new sdk.Request(pm.request.toJSON()),",
" resolvedRequest = newRequest.toObjectResolved(",
" null,",
" [pm.variables.toObject()],",
" { ignoreOwnVariables: true }",
" ),",
" url = new sdk.Url(resolvedRequest.url),",
" canonicalUrl = url.getPathWithQuery();",
"",
"const method = request.method;",
"",
"let body = \"\";",
"if (method === \"POST\" || method === \"PUT\" || method === \"PATCH\") {",
" // 使用变量替换后的body",
" body = resolvedRequest.body.raw;",
" if (canonicalUrl.endsWith(\"upload\")) {",
" const result = JSON.parse(JSON.stringify(resolvedRequest.body.formdata));",
" for (const [key, value] of result) {",
" if (key === \"meta\") {",
" body = value;",
" }",
" }",
" }",
"}",
"",
"// 计算签名源串",
"const message =",
" method +",
" \"\\n\" +",
" canonicalUrl +",
" \"\\n\" +",
" timeStamp +",
" \"\\n\" +",
" nonceStr +",
" \"\\n\" +",
" body +",
" \"\\n\";",
"",
"let auth;",
"const enableShangMi = pm.environment.get(\"shangmi\");",
"if (enableShangMi == \"true\") {",
" console.log(\"using ShangMi for signature\");",
"",
" const sm2js_code = pm.collectionVariables.get(\"sm2js_code\");",
" (new Function(sm2_code))();",
"",
" const mchid = pm.environment.get(\"merchantId\");",
" const serialNumber = pm.environment.get(\"merchantSerialNo\");",
" // 二进制的私钥和公钥",
" const privateKeyPem = pm.environment.get(\"merchantPrivateKey\");",
" const publicKeyPem = pm.environment.get(\"merchantPublicKey\");",
"",
" const privateKeyInfo = privateKeyFromPem(privateKeyPem);",
" const publicKey =",
" \"publicKey\" in privateKeyInfo.ecPrivateKey",
" ? privateKeyInfo.ecPrivateKey.publicKey",
" : publicKeyFromPem(publicKeyPem).publicKey;",
"",
" const signHex = new SM2Lib.SM2().sign(",
" publicKey,",
" privateKeyInfo.ecPrivateKey.privateKey,",
" SM2Lib.utils.stringToByteArrayInUtf8(message),",
" SM2Lib.utils.stringToByteArrayInUtf8(\"1234567812345678\")",
" );",
"",
" const signature = forge.util.encode64(forge.util.hexToBytes(signHex));",
" auth = `WECHATPAY2-SM2-WITH-SM3 mchid=\"${mchid}\",serial_no=\"${serialNumber}\",nonce_str=\"${nonceStr}\",timestamp=\"${timeStamp}\",signature=\"${signature}\"`;",
"} else {",
" console.log(\"using RSA for signature\");",
"",
" const mchid = pm.environment.get(\"merchantId\");",
" const serialNo = pm.environment.get(\"merchantSerialNo\");",
" // pem私钥字符串",
" const privateKeyStr = pm.environment.get(\"merchantPrivateKey\");",
" // 从pem中加载私钥",
" const privateKey = forge.pki.privateKeyFromPem(privateKeyStr);",
"",
" const sha256 = forge.md.sha256.create();",
" sha256.update(forge.util.encodeUtf8(message));",
"",
" const signature = forge.util.encode64(privateKey.sign(sha256));",
" auth = `WECHATPAY2-SHA256-RSA2048 mchid=\"${mchid}\",serial_no=\"${serialNo}\",nonce_str=\"${nonceStr}\",timestamp=\"${timeStamp}\",signature=\"${signature}\"`;",
"}",
"",
"pm.request.headers.add({",
" key: \"Authorization\",",
" value: auth,",
"});",
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "sm2js_code",
"value": "/*! For license information please see SM2.js.LICENSE.txt */\n!function(t,r){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=r():\"function\"==typeof define&&define.amd?define([],r):\"object\"==typeof exports?exports.SM2Lib=r():t.SM2Lib=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&r&&\"string\"!=typeof t)for(var i in t)e.d(n,i,function(r){return t[r]}.bind(null,i));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,\"a\",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p=\"\",e(e.s=295)}([function(t,r){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,r,e){var n=e(29),i=e(123);t.exports=function(t){if(\"Function\"===n(t))return i(t)}},function(t,r,e){(function(r){var e=function(t){return t&&t.Math==Math&&t};t.exports=e(\"object\"==typeof globalThis&&globalThis)||e(\"object\"==typeof window&&window)||e(\"object\"==typeof self&&self)||e(\"object\"==typeof r&&r)||function(){return this}()||Function(\"return this\")()}).call(this,e(148))},function(t,r,e){\"use strict\";var n,i,o,s=e(133),u=e(9),a=e(2),h=e(4),f=e(8),c=e(12),l=e(22),p=e(35),d=e(23),v=e(16),y=e(11).f,g=e(34),m=e(55),w=e(36),b=e(5),M=e(59),x=e(26),T=x.enforce,A=x.get,E=a.Int8Array,_=E&&E.prototype,S=a.Uint8ClampedArray,B=S&&S.prototype,O=E&&m(E),R=_&&m(_),k=Object.prototype,F=a.TypeError,j=b(\"toStringTag\"),D=M(\"TYPED_ARRAY_TAG\"),I=\"TypedArrayConstructor\",P=s&&!!w&&\"Opera\"!==l(a.opera),C=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},N=function(t){var r=m(t);if(f(r)){var e=A(r);return e&&c(e,I)?e.TypedArrayConstructor:N(r)}},q=function(t){if(!f(t))return!1;var r=l(t);return c(L,r)||c(U,r)};for(n in L)(o=(i=a[n])&&i.prototype)?T(o).TypedArrayConstructor=i:P=!1;for(n in U)(o=(i=a[n])&&i.prototype)&&(T(o).TypedArrayConstructor=i);if((!P||!h(O)||O===Function.prototype)&&(O=function(){throw F(\"Incorrect invocation\")},P))for(n in L)a[n]&&w(a[n],O);if((!P||!R||R===k)&&(R=O.prototype,P))for(n in L)a[n]&&w(a[n].prototype,R);if(P&&m(B)!==R&&w(B,R),u&&!c(R,j))for(n in C=!0,y(R,j,{get:function(){return f(this)?this[D]:void 0}}),L)a[n]&&d(a[n],D,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:P,TYPED_ARRAY_TAG:C&&D,aTypedArray:function(t){if(q(t))return t;throw F(\"Target is not a typed array\")},aTypedArrayConstructor:function(t){if(h(t)&&(!w||g(O,t)))return t;throw F(p(t)+\" is not a typed array constructor\")},exportTypedArrayMethod:function(t,r,e,n){if(u){if(e)for(var i in L){var o=a[i];if(o&&c(o.prototype,t))try{delete o.prototype[t]}catch(e){try{o.prototype[t]=r}catch(t){}}}R[t]&&!e||v(R,t,e?r:P&&_[t]||r,n)}},exportTypedArrayStaticMethod:function(t,r,e){var n,i;if(u){if(w){if(e)for(n in L)if((i=a[n])&&c(i,t))try{delete i[t]}catch(t){}if(O[t]&&!e)return;try{return v(O,t,e?r:P&&O[t]||r)}catch(t){}}for(n in L)!(i=a[n])||i[t]&&!e||v(i,t,r)}},getTypedArrayConstructor:N,isView:function(t){if(!f(t))return!1;var r=l(t);return\"DataView\"===r||c(L,r)||c(U,r)},isTypedArray:q,TypedArray:O,TypedArrayPrototype:R}},function(t,r,e){var n=e(125),i=n.all;t.exports=n.IS_HTMLDDA?function(t){return\"function\"==typeof t||t===i}:function(t){return\"function\"==typeof t}},function(t,r,e){var n=e(2),i=e(81),o=e(12),s=e(59),u=e(124),a=e(126),h=i(\"wks\"),f=n.Symbol,c=f&&f.for,l=a?f:f&&f.withoutSetter||s;t.exports=function(t){if(!o(h,t)||!u&&\"string\"!=typeof h[t]){var r=\"Symbol.\"+t;u&&o(f,t)?h[t]=f[t]:h[t]=a&&c?c(r):l(r)}return h[t]}},function(t,r,e){var n=e(2),i=e(49).f,o=e(23),s=e(16),u=e(73),a=e(183),h=e(118);t.exports=function(t,r){var e,f,c,l,p,d=t.target,v=t.global,y=t.stat;if(e=v?n:y?n[d]||u(d,{}):(n[d]||{}).prototype)for(f in r){if(l=r[f],c=t.dontCallGetSet?(p=i(e,f))&&p.value:e[f],!h(v?f:d+(y?\".\":\"#\")+f,t.forced)&&void 0!==c){if(typeof l==typeof c)continue;a(l,c)}(t.sham||c&&c.sham)&&o(l,\"sham\",!0),s(e,f,l,t)}}},function(t,r,e){var n=e(53),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},function(t,r,e){var n=e(4),i=e(125),o=i.all;t.exports=i.IS_HTMLDDA?function(t){return\"object\"==typeof t?null!==t:n(t)||t===o}:function(t){return\"object\"==typeof t?null!==t:n(t)}},function(t,r,e){var n=e(0);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,r,e){var n=e(8),i=String,o=TypeError;t.exports=function(t){if(n(t))return t;throw o(i(t)+\" is not an object\")}},function(t,r,e){var n=e(9),i=e(128),o=e(127),s=e(10),u=e(54),a=TypeError,h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,c=\"enumerable\",l=\"configurable\",p=\"writable\";r.f=n?o?function(t,r,e){if(s(t),r=u(r),s(e),\"function\"==typeof t&&\"prototype\"===r&&\"value\"in e&&p in e&&!e.writable){var n=f(t,r);n&&n.writable&&(t[r]=e.value,e={configurable:l in e?e.configurable:n.configurable,enumerable:c in e?e.enumerable:n.enumerable,writable:!1})}return h(t,r,e)}:h:function(t,r,e){if(s(t),r=u(r),s(e),i)try{return h(t,r,e)}catch(t){}if(\"get\"in e||\"set\"in e)throw a(\"Accessors not supported\");return\"value\"in e&&(t[r]=e.value),t}},function(t,r,e){var n=e(1),i=e(14),o=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return o(i(t),r)}},function(t,r,e){var n=e(20);t.exports=function(t){return n(t.length)}},function(t,r,e){var n=e(32),i=Object;t.exports=function(t){return i(n(t))}},function(t,r,e){var n=e(48),i=e(1),o=e(52),s=e(14),u=e(13),a=e(93),h=i([].push),f=function(t){var r=1==t,e=2==t,i=3==t,f=4==t,c=6==t,l=7==t,p=5==t||c;return function(d,v,y,g){for(var m,w,b=s(d),M=o(b),x=n(v,y),T=u(M),A=0,E=g||a,_=r?E(d,T):e||l?E(d,0):void 0;T>A;A++)if((p||A in M)&&(w=x(m=M[A],A,b),t))if(r)_[A]=w;else if(w)switch(t){case 3:return!0;case 5:return m;case 6:return A;case 2:h(_,m)}else switch(t){case 4:return!1;case 7:h(_,m)}return c?-1:i||f?f:_}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},function(t,r,e){var n=e(4),i=e(11),o=e(182),s=e(73);t.exports=function(t,r,e,u){u||(u={});var a=u.enumerable,h=void 0!==u.name?u.name:r;if(n(e)&&o(e,h,u),u.global)a?t[r]=e:s(r,e);else{try{u.unsafe?t[r]&&(a=!0):delete t[r]}catch(t){}a?t[r]=e:i.f(t,r,{value:e,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(t,r,e){var n=e(78),i=e(16),o=e(190);n||i(Object.prototype,\"toString\",o,{unsafe:!0})},function(t,r,e){var n=e(52),i=e(32);t.exports=function(t){return n(i(t))}},function(t,r,e){var n=e(21),i=Math.max,o=Math.min;t.exports=function(t,r){var e=n(t);return e<0?i(e+r,0):o(e,r)}},function(t,r,e){var n=e(21),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},function(t,r,e){var n=e(179);t.exports=function(t){var r=+t;return r!=r||0===r?0:n(r)}},function(t,r,e){var n=e(78),i=e(4),o=e(29),s=e(5)(\"toStringTag\"),u=Object,a=\"Arguments\"==o(function(){return arguments}());t.exports=n?o:function(t){var r,e,n;return void 0===t?\"Undefined\":null===t?\"Null\":\"string\"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=u(t),s))?e:a?o(r):\"Object\"==(n=o(r))&&i(r.callee)?\"Arguments\":n}},function(t,r,e){var n=e(9),i=e(11),o=e(43);t.exports=n?function(t,r,e){return i.f(t,r,o(1,e))}:function(t,r,e){return t[r]=e,t}},function(t,r,e){var n=e(22),i=String;t.exports=function(t){if(\"Symbol\"===n(t))throw TypeError(\"Cannot convert a Symbol value to a string\");return i(t)}},function(t,r,e){var n=e(4),i=e(35),o=TypeError;t.exports=function(t){if(n(t))return t;throw o(i(t)+\" is not a function\")}},function(t,r,e){var n,i,o,s=e(180),u=e(2),a=e(8),h=e(23),f=e(12),c=e(72),l=e(76),p=e(60),d=\"Object already initialized\",v=u.TypeError,y=u.WeakMap;if(s||c.state){var g=c.state||(c.state=new y);g.get=g.get,g.has=g.has,g.set=g.set,n=function(t,r){if(g.has(t))throw v(d);return r.facade=t,g.set(t,r),r},i=function(t){return g.get(t)||{}},o=function(t){return g.has(t)}}else{var m=l(\"state\");p[m]=!0,n=function(t,r){if(f(t,m))throw v(d);return r.facade=t,h(t,m,r),r},i=function(t){return f(t,m)?t[m]:{}},o=function(t){return f(t,m)}}t.exports={set:n,get:i,has:o,enforce:function(t){return o(t)?i(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!a(r)||(e=i(r)).type!==t)throw v(\"Incompatible receiver, \"+t+\" required\");return e}}}},function(t,r,e){\"use strict\";var n=e(6),i=e(68),o=e(77),s=e(8),u=e(19),a=e(13),h=e(18),f=e(67),c=e(5),l=e(63),p=e(62),d=l(\"slice\"),v=c(\"species\"),y=Array,g=Math.max;n({target:\"Array\",proto:!0,forced:!d},{slice:function(t,r){var e,n,c,l=h(this),d=a(l),m=u(t,d),w=u(void 0===r?d:r,d);if(i(l)&&(e=l.constructor,(o(e)&&(e===y||i(e.prototype))||s(e)&&null===(e=e[v]))&&(e=void 0),e===y||void 0===e))return p(l,m,w);for(n=new(void 0===e?y:e)(g(w-m,0)),c=0;m<w;m++,c++)m in l&&f(n,c,l[m]);return n.length=c,n}})},function(t,r,e){var n=e(2),i=e(4),o=function(t){return i(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?o(n[t]):n[t]&&n[t][r]}},function(t,r,e){var n=e(123),i=n({}.toString),o=n(\"\".slice);t.exports=function(t){return o(i(t),8,-1)}},function(t,r){t.exports=function(t){return null==t}},function(t,r){t.exports=!1},function(t,r,e){var n=e(30),i=TypeError;t.exports=function(t){if(n(t))throw i(\"Can't call method on \"+t);return t}},function(t,r,e){var n=e(28);t.exports=n(\"navigator\",\"userAgent\")||\"\"},function(t,r,e){var n=e(1);t.exports=n({}.isPrototypeOf)},function(t,r){var e=String;t.exports=function(t){try{return e(t)}catch(t){return\"Object\"}}},function(t,r,e){var n=e(1),i=e(10),o=e(188);t.exports=Object.setPrototypeOf||(\"__proto__\"in{}?function(){var t,r=!1,e={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,\"__proto__\").set))(e,[]),r=e instanceof Array}catch(t){}return function(e,n){return i(e),o(n),r?t(e,n):e.__proto__=n,e}}():void 0)},function(t,r){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r,e){var n,i=e(10),o=e(177),s=e(75),u=e(60),a=e(150),h=e(69),f=e(76),c=f(\"IE_PROTO\"),l=function(){},p=function(t){return\"<script>\"+t+\"</\"+\"script>\"},d=function(t){t.write(p(\"\")),t.close();var r=t.parentWindow.Object;return t=null,r},v=function(){try{n=new ActiveXObject(\"htmlfile\")}catch(t){}var t,r;v=\"undefined\"!=typeof document?document.domain&&n?d(n):((r=h(\"iframe\")).style.display=\"none\",a.appendChild(r),r.src=String(\"javascript:\"),(t=r.contentWindow.document).open(),t.write(p(\"document.F=Object\")),t.close(),t.F):d(n);for(var e=s.length;e--;)delete v.prototype[s[e]];return v()};u[c]=!0,t.exports=Object.create||function(t,r){var e;return null!==t?(l.prototype=i(t),e=new l,l.prototype=null,e[c]=t):e=v(),void 0===r?e:o.f(e,r)}},function(t,r,e){\"use strict\";var n=e(6),i=e(1),o=e(52),s=e(18),u=e(61),a=i([].join),h=o!=Object,f=u(\"join\",\",\");n({target:\"Array\",proto:!0,forced:h||!f},{join:function(t){return a(s(this),void 0===t?\",\":t)}})},function(t,r,e){\"use strict\";var n=e(18),i=e(158),o=e(42),s=e(26),u=e(11).f,a=e(117),h=e(119),f=e(31),c=e(9),l=\"Array Iterator\",p=s.set,d=s.getterFor(l);t.exports=a(Array,\"Array\",(function(t,r){p(this,{type:l,target:n(t),index:0,kind:r})}),(function(){var t=d(this),r=t.target,e=t.kind,n=t.index++;return!r||n>=r.length?(t.target=void 0,h(void 0,!0)):h(\"keys\"==e?n:\"values\"==e?r[n]:[n,r[n]],!1)}),\"values\");var v=o.Arguments=o.Array;if(i(\"keys\"),i(\"values\"),i(\"entries\"),!f&&c&&\"values\"!==v.name)try{u(v,\"name\",{value:\"values\"})}catch(t){}},function(t,r,e){var n,i,o=e(2),s=e(33),u=o.process,a=o.Deno,h=u&&u.versions||a&&a.version,f=h&&h.v8;f&&(i=(n=f.split(\".\"))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&s&&(!(n=s.match(/Edge\\/(\\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\\/(\\d+)/))&&(i=+n[1]),t.exports=i},function(t,r){t.exports={}},function(t,r){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},function(t,r,e){var n=e(53),i=Function.prototype,o=i.apply,s=i.call;t.exports=\"object\"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},function(t,r,e){var n=e(9),i=e(12),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,u=i(o,\"name\"),a=u&&\"something\"===function(){}.name,h=u&&(!n||n&&s(o,\"name\").configurable);t.exports={EXISTS:u,PROPER:a,CONFIGURABLE:h}},function(t,r,e){\"use strict\";var n=e(45).PROPER,i=e(16),o=e(10),s=e(24),u=e(0),a=e(205),h=\"toString\",f=RegExp.prototype.toString,c=u((function(){return\"/a/b\"!=f.call({source:\"a\",flags:\"b\"})})),l=n&&f.name!=h;(c||l)&&i(RegExp.prototype,h,(function(){var t=o(this);return\"/\"+s(t.source)+\"/\"+s(a(t))}),{unsafe:!0})},function(t,r,e){var n=e(25),i=e(30);t.exports=function(t,r){var e=t[r];return i(e)?void 0:n(e)}},function(t,r,e){var n=e(1),i=e(25),o=e(53),s=n(n.bind);t.exports=function(t,r){return i(t),void 0===r?t:o?s(t,r):function(){return t.apply(r,arguments)}}},function(t,r,e){var n=e(9),i=e(7),o=e(181),s=e(43),u=e(18),a=e(54),h=e(12),f=e(128),c=Object.getOwnPropertyDescriptor;r.f=n?c:function(t,r){if(t=u(t),r=a(r),f)try{return c(t,r)}catch(t){}if(h(t,r))return s(!i(o.f,t,r),t[r])}},function(t,r,e){var n=e(130),i=e(75).concat(\"length\",\"prototype\");r.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},function(t,r,e){var n=e(11).f,i=e(12),o=e(5)(\"toStringTag\");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!i(t,o)&&n(t,o,{configurable:!0,value:r})}},function(t,r,e){var n=e(1),i=e(0),o=e(29),s=Object,u=n(\"\".split);t.exports=i((function(){return!s(\"z\").propertyIsEnumerable(0)}))?function(t){return\"String\"==o(t)?u(t,\"\"):s(t)}:s},function(t,r,e){var n=e(0);t.exports=!n((function(){var t=function(){}.bind();return\"function\"!=typeof t||t.hasOwnProperty(\"prototype\")}))},function(t,r,e){var n=e(129),i=e(74);t.exports=function(t){var r=n(t,\"string\");return i(r)?r:r+\"\"}},function(t,r,e){var n=e(12),i=e(4),o=e(14),s=e(76),u=e(187),a=s(\"IE_PROTO\"),h=Object,f=h.prototype;t.exports=u?h.getPrototypeOf:function(t){var r=o(t);if(n(r,a))return r[a];var e=r.constructor;return i(e)&&r instanceof e?e.prototype:r instanceof h?f:null}},function(t,r,e){var n=e(3),i=e(71),o=n.aTypedArrayConstructor,s=n.getTypedArrayConstructor;t.exports=function(t){return o(i(t,s(t)))}},function(t,r,e){var n=e(34),i=TypeError;t.exports=function(t,r){if(n(r,t))return t;throw i(\"Incorrect invocation\")}},function(t,r){\"function\"==typeof Object.create?t.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,r){if(r){t.super_=r;var e=function(){};e.prototype=r.prototype,t.prototype=new e,t.prototype.constructor=t}}},function(t,r,e){var n=e(1),i=0,o=Math.random(),s=n(1..toString);t.exports=function(t){return\"Symbol(\"+(void 0===t?\"\":t)+\")_\"+s(++i+o,36)}},function(t,r){t.exports={}},function(t,r,e){\"use strict\";var n=e(0);t.exports=function(t,r){var e=[][t];return!!e&&n((function(){e.call(null,r||function(){return 1},1)}))}},function(t,r,e){var n=e(1);t.exports=n([].slice)},function(t,r,e){var n=e(0),i=e(5),o=e(41),s=i(\"species\");t.exports=function(t){return o>=51||!n((function(){var r=[];return(r.constructor={})[s]=function(){return{foo:1}},1!==r[t](Boolean).foo}))}},function(t,r){t.exports=function(t,r){if(!(t instanceof r))throw new TypeError(\"Cannot call a class as a function\")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r){function e(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,\"prototype\",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r,e){var n=e(18),i=e(19),o=e(13),s=function(t){return function(r,e,s){var u,a=n(r),h=o(a),f=i(s,h);if(t&&e!=e){for(;h>f;)if((u=a[f++])!=u)return!0}else for(;h>f;f++)if((t||f in a)&&a[f]===e)return t||f||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},function(t,r,e){\"use strict\";var n=e(54),i=e(11),o=e(43);t.exports=function(t,r,e){var s=n(r);s in t?i.f(t,s,o(0,e)):t[s]=e}},function(t,r,e){var n=e(29);t.exports=Array.isArray||function(t){return\"Array\"==n(t)}},function(t,r,e){var n=e(2),i=e(8),o=n.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},function(t,r,e){var n=e(19),i=e(13),o=e(67),s=Array,u=Math.max;t.exports=function(t,r,e){for(var a=i(t),h=n(r,a),f=n(void 0===e?a:e,a),c=s(u(f-h,0)),l=0;h<f;h++,l++)o(c,l,t[h]);return c.length=l,c}},function(t,r,e){var n=e(10),i=e(135),o=e(30),s=e(5)(\"species\");t.exports=function(t,r){var e,u=n(t).constructor;return void 0===u||o(e=n(u)[s])?r:i(e)}},function(t,r,e){var n=e(2),i=e(73),o=\"__core-js_shared__\",s=n[o]||i(o,{});t.exports=s},function(t,r,e){var n=e(2),i=Object.defineProperty;t.exports=function(t,r){try{i(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},function(t,r,e){var n=e(28),i=e(4),o=e(34),s=e(126),u=Object;t.exports=s?function(t){return\"symbol\"==typeof t}:function(t){var r=n(\"Symbol\");return i(r)&&o(r.prototype,u(t))}},function(t,r){t.exports=[\"constructor\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\",\"toString\",\"valueOf\"]},function(t,r,e){var n=e(81),i=e(59),o=n(\"keys\");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,r,e){var n=e(1),i=e(0),o=e(4),s=e(22),u=e(28),a=e(82),h=function(){},f=[],c=u(\"Reflect\",\"construct\"),l=/^\\s*(?:class|function)\\b/,p=n(l.exec),d=!l.exec(h),v=function(t){if(!o(t))return!1;try{return c(h,f,t),!0}catch(t){return!1}},y=function(t){if(!o(t))return!1;switch(s(t)){case\"AsyncFunction\":case\"GeneratorFunction\":case\"AsyncGeneratorFunction\":return!1}try{return d||!!p(l,a(t))}catch(t){return!0}};y.sham=!0,t.exports=!c||i((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?y:v},function(t,r,e){var n={};n[e(5)(\"toStringTag\")]=\"z\",t.exports=\"[object z]\"===String(n)},function(t,r,e){\"use strict\";e(40),e(91),e(17),e(136),e(94),e(95),e(96),e(97),e(98),e(99),e(100),e(101),e(102),e(103),e(104),e(105),e(106),e(107),e(108),e(109),e(110),e(111),e(112),e(113),e(114),e(115),e(116),e(162),e(46),e(39);var n=e(157);t.exports={stringToByteArrayInUtf8:function(t){return function(t){return\"undefined\"!=typeof window&&window.TextEncoder?new window.TextEncoder(\"utf-8\").encode(t):(new(0,e(140).TextEncoder)).encode(t)}(t)},utf8ByteArrayToString:function(t){var r;if(-1!==t)return Array.isArray(t)&&(t=new Uint8Array(t)),r=t,\"undefined\"!=typeof window&&window.TextDecoder?new window.TextDecoder(\"utf-8\").decode(r):(new(0,e(140).TextDecoder)).decode(r)},byteArrayToBase64:function(t){return n.fromByteArray(t)},base64ToByteArray:function(t){return n.toByteArray(t)},byteArrayToHex:function(t){for(var r=0;r<t.length;r++)t[r]=(t[r]>>>0)%256;for(var e=[],n=0,i=0;i<2*t.length;i+=2)e[i>>>3]|=parseInt(t[n],10)<<24-i%8*4,n++;for(var o=[],s=0;s<t.length;s++){var u=e[s>>>2]>>>24-s%4*8&255;o.push((u>>>4).toString(16)),o.push((15&u).toString(16))}return o.join(\"\")},hexToByteArray:function(t){if(\"string\"!=typeof t)throw new TypeError(\"Expected input to be a string\");if(t.length%2!=0)throw new RangeError(\"Expected string to be an even number of characters\");for(var r=new Uint8Array(t.length/2),e=0;e<t.length;e+=2)r[e/2]=parseInt(t.substring(e,e+2),16);return r},byteArrayToByteArray:function(t){return t}}},function(t,r,e){\"use strict\";var n=e(6),i=e(0),o=e(68),s=e(8),u=e(14),a=e(13),h=e(175),f=e(67),c=e(93),l=e(63),p=e(5),d=e(41),v=p(\"isConcatSpreadable\"),y=d>=51||!i((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),g=l(\"concat\"),m=function(t){if(!s(t))return!1;var r=t[v];return void 0!==r?!!r:o(t)};n({target:\"Array\",proto:!0,arity:1,forced:!y||!g},{concat:function(t){var r,e,n,i,o,s=u(this),l=c(s,0),p=0;for(r=-1,n=arguments.length;r<n;r++)if(m(o=-1===r?s:arguments[r]))for(i=a(o),h(p+i),e=0;e<i;e++,p++)e in o&&f(l,p,o[e]);else h(p+1),f(l,p++,o);return l.length=p,l}})},function(t,r,e){var n=e(31),i=e(72);(t.exports=function(t,r){return i[t]||(i[t]=void 0!==r?r:{})})(\"versions\",[]).push({version:\"3.25.5\",mode:n?\"pure\":\"global\",copyright:\"© 2014-2022 Denis Pushkarev (zloirock.ru)\",license:\"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE\",source:\"https://github.com/zloirock/core-js\"})},function(t,r,e){var n=e(1),i=e(4),o=e(72),s=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},function(t,r,e){var n=e(22),i=e(47),o=e(30),s=e(42),u=e(5)(\"iterator\");t.exports=function(t){if(!o(t))return i(t,u)||i(t,\"@@iterator\")||s[n(t)]}},function(t,r,e){var n=e(25),i=e(14),o=e(52),s=e(13),u=TypeError,a=function(t){return function(r,e,a,h){n(e);var f=i(r),c=o(f),l=s(f),p=t?l-1:0,d=t?-1:1;if(a<2)for(;;){if(p in c){h=c[p],p+=d;break}if(p+=d,t?p<0:l<=p)throw u(\"Reduce of empty array with no initial value\")}for(;t?p>=0:l>p;p+=d)p in c&&(h=e(h,c[p],p,f));return h}};t.exports={left:a(!1),right:a(!0)}},function(t,r,e){var n=e(29),i=e(2);t.exports=\"process\"==n(i.process)},function(t,r,e){\"use strict\";var n=e(6),i=e(146);n({target:\"RegExp\",proto:!0,forced:/./.exec!==i},{exec:i})},function(t,r,e){var n=e(2);t.exports=n.Promise},function(t,r,e){var n=e(2),i=e(87),o=e(4),s=e(118),u=e(82),a=e(5),h=e(268),f=e(221),c=e(31),l=e(41),p=i&&i.prototype,d=a(\"species\"),v=!1,y=o(n.PromiseRejectionEvent),g=s(\"Promise\",(function(){var t=u(i),r=t!==String(i);if(!r&&66===l)return!0;if(c&&(!p.catch||!p.finally))return!0;if(!l||l<51||!/native code/.test(t)){var e=new i((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((e.constructor={})[d]=n,!(v=e.then((function(){}))instanceof n))return!0}return!r&&(h||f)&&!y}));t.exports={CONSTRUCTOR:g,REJECTION_EVENT:y,SUBCLASSING:v}},function(t,r,e){\"use strict\";var n=e(25),i=TypeError,o=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw i(\"Bad Promise constructor\");r=t,e=n})),this.resolve=n(r),this.reject=n(e)};t.exports.f=function(t){return new o(t)}},function(t,r,e){\"use strict\";var n=e(37);e(145),e(27),e(144),e(39),e(17),e(147);var i=n(e(223)),o=e(58),s=e(173).Reporter,u=e(170).Buffer;function a(t,r){s.call(this,r),u.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error(\"Input not Buffer\")}function h(t,r){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return h.isEncoderBuffer(t)||(t=new h(t,r)),this.length+=t.length,t}),this);else if(\"number\"==typeof t){if(!(0<=t&&t<=255))return r.error(\"non-byte EncoderBuffer value\");this.value=t,this.length=1}else if(\"string\"==typeof t)this.value=t,this.length=u.byteLength(t);else{if(!u.isBuffer(t))return r.error(\"Unsupported type: \"+(0,i.default)(t));this.value=t,this.length=t.length}}o(a,s),r.DecoderBuffer=a,a.isDecoderBuffer=function(t){return t instanceof a||\"object\"===(0,i.default)(t)&&u.isBuffer(t.base)&&\"DecoderBuffer\"===t.constructor.name&&\"number\"==typeof t.offset&&\"number\"==typeof t.length&&\"function\"==typeof t.save&&\"function\"==typeof t.restore&&\"function\"==typeof t.isEmpty&&\"function\"==typeof t.readUInt8&&\"function\"==typeof t.skip&&\"function\"==typeof t.raw},a.prototype.save=function(){return{offset:this.offset,reporter:s.prototype.save.call(this)}},a.prototype.restore=function(t){var r=new a(this.base);return r.offset=t.offset,r.length=this.offset,this.offset=t.offset,s.prototype.restore.call(this,t.reporter),r},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||\"DecoderBuffer overrun\")},a.prototype.skip=function(t,r){if(!(this.offset+t<=this.length))return this.error(r||\"DecoderBuffer overrun\");var e=new a(this.base);return e._reporterState=this._reporterState,e.offset=this.offset,e.length=this.offset+t,this.offset+=t,e},a.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},r.EncoderBuffer=h,h.isEncoderBuffer=function(t){return t instanceof h||\"object\"===(0,i.default)(t)&&\"EncoderBuffer\"===t.constructor.name&&\"number\"==typeof t.length&&\"function\"==typeof t.join},h.prototype.join=function(t,r){return t||(t=u.alloc(this.length)),r||(r=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(e){e.join(t,r),r+=e.length})):(\"number\"==typeof this.value?t[r]=this.value:\"string\"==typeof this.value?t.write(this.value,r):u.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t}},function(t,r,e){\"use strict\";var n=e(6),i=e(1),o=e(0),s=e(132),u=e(10),a=e(19),h=e(20),f=e(71),c=s.ArrayBuffer,l=s.DataView,p=l.prototype,d=i(c.prototype.slice),v=i(p.getUint8),y=i(p.setUint8);n({target:\"ArrayBuffer\",proto:!0,unsafe:!0,forced:o((function(){return!new c(2).slice(1,void 0).byteLength}))},{slice:function(t,r){if(d&&void 0===r)return d(u(this),t);for(var e=u(this).byteLength,n=a(t,e),i=a(void 0===r?e:r,e),o=new(f(this,c))(h(i-n)),s=new l(this),p=new l(o),g=0;n<i;)y(p,g++,v(s,n++));return o}})},function(t,r,e){\"use strict\";var n=e(14),i=e(19),o=e(13);t.exports=function(t){for(var r=n(this),e=o(r),s=arguments.length,u=i(s>1?arguments[1]:void 0,e),a=s>2?arguments[2]:void 0,h=void 0===a?e:i(a,e);h>u;)r[u++]=t;return r}},function(t,r,e){var n=e(194);t.exports=function(t,r){return new(n(t))(0===r?0:r)}},function(t,r,e){\"use strict\";var n=e(1),i=e(3),o=n(e(195)),s=i.aTypedArray;(0,i.exportTypedArrayMethod)(\"copyWithin\",(function(t,r){return o(s(this),t,r,arguments.length>2?arguments[2]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).every,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"every\",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(92),o=e(138),s=e(22),u=e(7),a=e(1),h=e(0),f=n.aTypedArray,c=n.exportTypedArrayMethod,l=a(\"\".slice);c(\"fill\",(function(t){var r=arguments.length;f(this);var e=\"Big\"===l(s(this),0,3)?o(t):+t;return u(i,this,e,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)}),h((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).filter,o=e(196),s=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"filter\",(function(t){var r=i(s(this),t,arguments.length>1?arguments[1]:void 0);return o(this,r)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).find,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"find\",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"findIndex\",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).forEach,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"forEach\",(function(t){i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(66).includes,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"includes\",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(66).indexOf,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"indexOf\",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(2),i=e(0),o=e(1),s=e(3),u=e(40),a=e(5)(\"iterator\"),h=n.Uint8Array,f=o(u.values),c=o(u.keys),l=o(u.entries),p=s.aTypedArray,d=s.exportTypedArrayMethod,v=h&&h.prototype,y=!i((function(){v[a].call([1])})),g=!!v&&v.values&&v[a]===v.values&&\"values\"===v.values.name,m=function(){return f(p(this))};d(\"entries\",(function(){return l(p(this))}),y),d(\"keys\",(function(){return c(p(this))}),y),d(\"values\",m,y||!g,{name:\"values\"}),d(a,m,y||!g,{name:\"values\"})},function(t,r,e){\"use strict\";var n=e(3),i=e(1),o=n.aTypedArray,s=n.exportTypedArrayMethod,u=i([].join);s(\"join\",(function(t){return u(o(this),t)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(44),o=e(198),s=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"lastIndexOf\",(function(t){var r=arguments.length;return i(o,s(this),r>1?[t,arguments[1]]:[t])}))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).map,o=e(56),s=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"map\",(function(t){return i(s(this),t,arguments.length>1?arguments[1]:void 0,(function(t,r){return new(o(t))(r)}))}))},function(t,r,e){\"use strict\";var n=e(3),i=e(84).left,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"reduce\",(function(t){var r=arguments.length;return i(o(this),t,r,r>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=e(84).right,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"reduceRight\",(function(t){var r=arguments.length;return i(o(this),t,r,r>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(3),i=n.aTypedArray,o=n.exportTypedArrayMethod,s=Math.floor;o(\"reverse\",(function(){for(var t,r=this,e=i(r).length,n=s(e/2),o=0;o<n;)t=r[o],r[o++]=r[--e],r[e]=t;return r}))},function(t,r,e){\"use strict\";var n=e(2),i=e(7),o=e(3),s=e(13),u=e(137),a=e(14),h=e(0),f=n.RangeError,c=n.Int8Array,l=c&&c.prototype,p=l&&l.set,d=o.aTypedArray,v=o.exportTypedArrayMethod,y=!h((function(){var t=new Uint8ClampedArray(2);return i(p,t,{length:1,0:3},1),3!==t[1]})),g=y&&o.NATIVE_ARRAY_BUFFER_VIEWS&&h((function(){var t=new c(2);return t.set(1),t.set(\"2\",1),0!==t[0]||2!==t[1]}));v(\"set\",(function(t){d(this);var r=u(arguments.length>1?arguments[1]:void 0,1),e=a(t);if(y)return i(p,this,e,r);var n=this.length,o=s(e),h=0;if(o+r>n)throw f(\"Wrong length\");for(;h<o;)this[r+h]=e[h++]}),!y||g)},function(t,r,e){\"use strict\";var n=e(3),i=e(56),o=e(0),s=e(62),u=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"slice\",(function(t,r){for(var e=s(u(this),t,r),n=i(this),o=0,a=e.length,h=new n(a);a>o;)h[o]=e[o++];return h}),o((function(){new Int8Array(1).slice()})))},function(t,r,e){\"use strict\";var n=e(3),i=e(15).some,o=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"some\",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,r,e){\"use strict\";var n=e(2),i=e(1),o=e(0),s=e(25),u=e(199),a=e(3),h=e(200),f=e(201),c=e(41),l=e(202),p=a.aTypedArray,d=a.exportTypedArrayMethod,v=n.Uint16Array,y=v&&i(v.prototype.sort),g=!(!y||o((function(){y(new v(2),null)}))&&o((function(){y(new v(2),{})}))),m=!!y&&!o((function(){if(c)return c<74;if(h)return h<67;if(f)return!0;if(l)return l<602;var t,r,e=new v(516),n=Array(516);for(t=0;t<516;t++)r=t%4,e[t]=515-t,n[t]=t-2*r+3;for(y(e,(function(t,r){return(t/4|0)-(r/4|0)})),t=0;t<516;t++)if(e[t]!==n[t])return!0}));d(\"sort\",(function(t){return void 0!==t&&s(t),m?y(this,t):u(p(this),function(t){return function(r,e){return void 0!==t?+t(r,e)||0:e!=e?-1:r!=r?1:0===r&&0===e?1/r>0&&1/e<0?1:-1:r>e}}(t))}),!m||g)},function(t,r,e){\"use strict\";var n=e(3),i=e(20),o=e(19),s=e(56),u=n.aTypedArray;(0,n.exportTypedArrayMethod)(\"subarray\",(function(t,r){var e=u(this),n=e.length,a=o(t,n);return new(s(e))(e.buffer,e.byteOffset+a*e.BYTES_PER_ELEMENT,i((void 0===r?n:o(r,n))-a))}))},function(t,r,e){\"use strict\";var n=e(2),i=e(44),o=e(3),s=e(0),u=e(62),a=n.Int8Array,h=o.aTypedArray,f=o.exportTypedArrayMethod,c=[].toLocaleString,l=!!a&&s((function(){c.call(new a(1))}));f(\"toLocaleString\",(function(){return i(c,l?u(h(this)):h(this),u(arguments))}),s((function(){return[1,2].toLocaleString()!=new a([1,2]).toLocaleString()}))||!s((function(){a.prototype.toLocaleString.call([1,2])})))},function(t,r,e){\"use strict\";var n=e(3).exportTypedArrayMethod,i=e(0),o=e(2),s=e(1),u=o.Uint8Array,a=u&&u.prototype||{},h=[].toString,f=s([].join);i((function(){h.call({})}))&&(h=function(){return f(this)});var c=a.toString!=h;n(\"toString\",h,c)},function(t,r,e){\"use strict\";var n=e(6),i=e(7),o=e(31),s=e(45),u=e(4),a=e(186),h=e(55),f=e(36),c=e(51),l=e(23),p=e(16),d=e(5),v=e(42),y=e(131),g=s.PROPER,m=s.CONFIGURABLE,w=y.IteratorPrototype,b=y.BUGGY_SAFARI_ITERATORS,M=d(\"iterator\"),x=\"keys\",T=\"values\",A=\"entries\",E=function(){return this};t.exports=function(t,r,e,s,d,y,_){a(e,r,s);var S,B,O,R=function(t){if(t===d&&I)return I;if(!b&&t in j)return j[t];switch(t){case x:case T:case A:return function(){return new e(this,t)}}return function(){return new e(this)}},k=r+\" Iterator\",F=!1,j=t.prototype,D=j[M]||j[\"@@iterator\"]||d&&j[d],I=!b&&D||R(d),P=\"Array\"==r&&j.entries||D;if(P&&(S=h(P.call(new t)))!==Object.prototype&&S.next&&(o||h(S)===w||(f?f(S,w):u(S[M])||p(S,M,E)),c(S,k,!0,!0),o&&(v[k]=E)),g&&d==T&&D&&D.name!==T&&(!o&&m?l(j,\"name\",T):(F=!0,I=function(){return i(D,this)})),d)if(B={values:R(T),keys:y?I:R(x),entries:R(A)},_)for(O in B)(b||F||!(O in j))&&p(j,O,B[O]);else n({target:r,proto:!0,forced:b||F},B);return o&&!_||j[M]===I||p(j,M,I,{name:d}),v[r]=I,B}},function(t,r,e){var n=e(0),i=e(4),o=/#|\\.prototype\\./,s=function(t,r){var e=a[u(t)];return e==f||e!=h&&(i(r)?n(r):!!r)},u=s.normalize=function(t){return String(t).replace(o,\".\").toLowerCase()},a=s.data={},h=s.NATIVE=\"N\",f=s.POLYFILL=\"P\";t.exports=s},function(t,r){t.exports=function(t,r){return{value:t,done:r}}},function(t,r,e){var n=e(5)(\"iterator\"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!i)return!1;var e=!1;try{var o={};o[n]=function(){return{next:function(){return{done:e=!0}}}},t(o)}catch(t){}return e}},function(t,r,e){\"use strict\";var n=e(28),i=e(11),o=e(5),s=e(9),u=o(\"species\");t.exports=function(t){var r=n(t),e=i.f;s&&r&&!r[u]&&e(r,u,{configurable:!0,get:function(){return this}})}},function(t,r,e){var n=e(1),i=e(21),o=e(24),s=e(32),u=n(\"\".charAt),a=n(\"\".charCodeAt),h=n(\"\".slice),f=function(t){return function(r,e){var n,f,c=o(s(r)),l=i(e),p=c.length;return l<0||l>=p?t?\"\":void 0:(n=a(c,l))<55296||n>56319||l+1===p||(f=a(c,l+1))<56320||f>57343?t?u(c,l):n:t?h(c,l,l+2):f-56320+(n-55296<<10)+65536}};t.exports={codeAt:f(!1),charAt:f(!0)}},function(t,r,e){var n=e(53),i=Function.prototype,o=i.call,s=n&&i.bind.bind(o,o);t.exports=function(t){return n?s(t):function(){return o.apply(t,arguments)}}},function(t,r,e){var n=e(41),i=e(0);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(t,r){var e=\"object\"==typeof document&&document.all,n=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:n}},function(t,r,e){var n=e(124);t.exports=n&&!Symbol.sham&&\"symbol\"==typeof Symbol.iterator},function(t,r,e){var n=e(9),i=e(0);t.exports=n&&i((function(){return 42!=Object.defineProperty((function(){}),\"prototype\",{value:42,writable:!1}).prototype}))},function(t,r,e){var n=e(9),i=e(0),o=e(69);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o(\"div\"),\"a\",{get:function(){return 7}}).a}))},function(t,r,e){var n=e(7),i=e(8),o=e(74),s=e(47),u=e(178),a=e(5),h=TypeError,f=a(\"toPrimitive\");t.exports=function(t,r){if(!i(t)||o(t))return t;var e,a=s(t,f);if(a){if(void 0===r&&(r=\"default\"),e=n(a,t,r),!i(e)||o(e))return e;throw h(\"Can't convert object to primitive value\")}return void 0===r&&(r=\"number\"),u(t,r)}},function(t,r,e){var n=e(1),i=e(12),o=e(18),s=e(66).indexOf,u=e(60),a=n([].push);t.exports=function(t,r){var e,n=o(t),h=0,f=[];for(e in n)!i(u,e)&&i(n,e)&&a(f,e);for(;r.length>h;)i(n,e=r[h++])&&(~s(f,e)||a(f,e));return f}},function(t,r,e){\"use strict\";var n,i,o,s=e(0),u=e(4),a=e(8),h=e(38),f=e(55),c=e(16),l=e(5),p=e(31),d=l(\"iterator\"),v=!1;[].keys&&(\"next\"in(o=[].keys())?(i=f(f(o)))!==Object.prototype&&(n=i):v=!0),!a(n)||s((function(){var t={};return n[d].call(t)!==t}))?n={}:p&&(n=h(n)),u(n[d])||c(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},function(t,r,e){\"use strict\";var n=e(2),i=e(1),o=e(9),s=e(133),u=e(45),a=e(23),h=e(151),f=e(0),c=e(57),l=e(21),p=e(20),d=e(134),v=e(189),y=e(55),g=e(36),m=e(50).f,w=e(11).f,b=e(92),M=e(70),x=e(51),T=e(26),A=u.PROPER,E=u.CONFIGURABLE,_=T.get,S=T.set,B=\"ArrayBuffer\",O=\"DataView\",R=\"Wrong index\",k=n.ArrayBuffer,F=k,j=F&&F.prototype,D=n.DataView,I=D&&D.prototype,P=Object.prototype,C=n.Array,L=n.RangeError,U=i(b),N=i([].reverse),q=v.pack,Y=v.unpack,z=function(t){return[255&t]},V=function(t){return[255&t,t>>8&255]},Z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},G=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},K=function(t){return q(t,23,4)},W=function(t){return q(t,52,8)},X=function(t,r){w(t.prototype,r,{get:function(){return _(this)[r]}})},H=function(t,r,e,n){var i=d(e),o=_(t);if(i+r>o.byteLength)throw L(R);var s=_(o.buffer).bytes,u=i+o.byteOffset,a=M(s,u,u+r);return n?a:N(a)},$=function(t,r,e,n,i,o){var s=d(e),u=_(t);if(s+r>u.byteLength)throw L(R);for(var a=_(u.buffer).bytes,h=s+u.byteOffset,f=n(+i),c=0;c<r;c++)a[h+c]=f[o?c:r-c-1]};if(s){var J=A&&k.name!==B;if(f((function(){k(1)}))&&f((function(){new k(-1)}))&&!f((function(){return new k,new k(1.5),new k(NaN),1!=k.length||J&&!E})))J&&E&&a(k,\"name\",B);else{(F=function(t){return c(this,j),new k(d(t))}).prototype=j;for(var Q,tt=m(k),rt=0;tt.length>rt;)(Q=tt[rt++])in F||a(F,Q,k[Q]);j.constructor=F}g&&y(I)!==P&&g(I,P);var et=new D(new F(2)),nt=i(I.setInt8);et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||h(I,{setInt8:function(t,r){nt(this,t,r<<24>>24)},setUint8:function(t,r){nt(this,t,r<<24>>24)}},{unsafe:!0})}else j=(F=function(t){c(this,j);var r=d(t);S(this,{bytes:U(C(r),0),byteLength:r}),o||(this.byteLength=r)}).prototype,I=(D=function(t,r,e){c(this,I),c(t,j);var n=_(t).byteLength,i=l(r);if(i<0||i>n)throw L(\"Wrong offset\");if(i+(e=void 0===e?n-i:p(e))>n)throw L(\"Wrong length\");S(this,{buffer:t,byteLength:e,byteOffset:i}),o||(this.buffer=t,this.byteLength=e,this.byteOffset=i)}).prototype,o&&(X(F,\"byteLength\"),X(D,\"buffer\"),X(D,\"byteLength\"),X(D,\"byteOffset\")),h(I,{getInt8:function(t){return H(this,1,t)[0]<<24>>24},getUint8:function(t){return H(this,1,t)[0]},getInt16:function(t){var r=H(this,2,t,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function(t){var r=H(this,2,t,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function(t){return G(H(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return G(H(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return Y(H(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return Y(H(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,r){$(this,1,t,z,r)},setUint8:function(t,r){$(this,1,t,z,r)},setInt16:function(t,r){$(this,2,t,V,r,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,r){$(this,2,t,V,r,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,r){$(this,4,t,Z,r,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,r){$(this,4,t,Z,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,r){$(this,4,t,K,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,r){$(this,8,t,W,r,arguments.length>2?arguments[2]:void 0)}});x(F,B),x(D,O),t.exports={ArrayBuffer:F,DataView:D}},function(t,r){t.exports=\"undefined\"!=typeof ArrayBuffer&&\"undefined\"!=typeof DataView},function(t,r,e){var n=e(21),i=e(20),o=RangeError;t.exports=function(t){if(void 0===t)return 0;var r=n(t),e=i(r);if(r!==e)throw o(\"Wrong length or index\");return e}},function(t,r,e){var n=e(77),i=e(35),o=TypeError;t.exports=function(t){if(n(t))return t;throw o(i(t)+\" is not a constructor\")}},function(t,r,e){e(159)(\"Uint8\",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},function(t,r,e){var n=e(192),i=RangeError;t.exports=function(t,r){var e=n(t);if(e%r)throw i(\"Wrong offset\");return e}},function(t,r,e){var n=e(129),i=TypeError;t.exports=function(t){var r=n(t,\"number\");if(\"number\"==typeof r)throw i(\"Can't convert number to bigint\");return BigInt(r)}},function(t,r){t.exports=\"\\t\\n\\v\\f\\r \\u2028\\u2029\\ufeff\"},function(t,r,e){\"use strict\";function n(){}function i(){}e(206),e(207),n.prototype.encode=function(t){for(var r=[],e=t.length,n=0;n<e;){var i=t.codePointAt(n),o=0,s=0;for(i<=127?(o=0,s=0):i<=2047?(o=6,s=192):i<=65535?(o=12,s=224):i<=2097151&&(o=18,s=240),r.push(s|i>>o),o-=6;o>=0;)r.push(128|i>>o&63),o-=6;n+=i>=65536?2:1}return r},i.prototype.decode=function(t){for(var r=\"\",e=0;e<t.length;){var n=t[e],i=0,o=0;if(n<=127?(i=0,o=255&n):n<=223?(i=1,o=31&n):n<=239?(i=2,o=15&n):n<=244&&(i=3,o=7&n),t.length-e-i>0)for(var s=0;s<i;)o=o<<6|63&(n=t[e+s+1]),s+=1;else o=65533,i=t.length-e;r+=String.fromCodePoint(o),e+=i+1}return r},t.exports={TextDecoder:i,TextEncoder:n}},function(t,r,e){\"use strict\";e(17),e(46),e(240),e(40),e(91),e(136),e(94),e(95),e(96),e(97),e(98),e(99),e(100),e(101),e(102),e(103),e(104),e(105),e(106),e(107),e(108),e(109),e(110),e(111),e(112),e(113),e(114),e(115),e(116),function(){var r;function e(t,r,e){null!=t&&(\"number\"==typeof t?this.fromNumber(t,r,e):null==r&&\"string\"!=typeof t?this.fromString(t,256):this.fromString(t,r))}function n(){return new e(null)}var i=\"undefined\"!=typeof navigator;i&&\"Microsoft Internet Explorer\"==navigator.appName?(e.prototype.am=function(t,r,e,n,i,o){for(var s=32767&r,u=r>>15;--o>=0;){var a=32767&this[t],h=this[t++]>>15,f=u*a+h*s;i=((a=s*a+((32767&f)<<15)+e[n]+(1073741823&i))>>>30)+(f>>>15)+u*h+(i>>>30),e[n++]=1073741823&a}return i},r=30):i&&\"Netscape\"!=navigator.appName?(e.prototype.am=function(t,r,e,n,i,o){for(;--o>=0;){var s=r*this[t++]+e[n]+i;i=Math.floor(s/67108864),e[n++]=67108863&s}return i},r=26):(e.prototype.am=function(t,r,e,n,i,o){for(var s=16383&r,u=r>>14;--o>=0;){var a=16383&this[t],h=this[t++]>>14,f=u*a+h*s;i=((a=s*a+((16383&f)<<14)+e[n]+i)>>28)+(f>>14)+u*h,e[n++]=268435455&a}return i},r=28),e.prototype.DB=r,e.prototype.DM=(1<<r)-1,e.prototype.DV=1<<r;e.prototype.FV=Math.pow(2,52),e.prototype.F1=52-r,e.prototype.F2=2*r-52;var o,s,u=new Array;for(o=\"0\".charCodeAt(0),s=0;s<=9;++s)u[o++]=s;for(o=\"a\".charCodeAt(0),s=10;s<36;++s)u[o++]=s;for(o=\"A\".charCodeAt(0),s=10;s<36;++s)u[o++]=s;function a(t){return\"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(t)}function h(t,r){var e=u[t.charCodeAt(r)];return null==e?-1:e}function f(t){var r=n();return r.fromInt(t),r}function c(t){var r,e=1;return 0!=(r=t>>>16)&&(t=r,e+=16),0!=(r=t>>8)&&(t=r,e+=8),0!=(r=t>>4)&&(t=r,e+=4),0!=(r=t>>2)&&(t=r,e+=2),0!=(r=t>>1)&&(t=r,e+=1),e}function l(t){this.m=t}function p(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function d(t,r){return t&r}function v(t,r){return t|r}function y(t,r){return t^r}function g(t,r){return t&~r}function m(t){if(0==t)return-1;var r=0;return 0==(65535&t)&&(t>>=16,r+=16),0==(255&t)&&(t>>=8,r+=8),0==(15&t)&&(t>>=4,r+=4),0==(3&t)&&(t>>=2,r+=2),0==(1&t)&&++r,r}function w(t){for(var r=0;0!=t;)t&=t-1,++r;return r}function b(){}function M(t){return t}function x(t){this.r2=n(),this.q3=n(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,r,e){t.multiplyTo(r,e),this.reduce(e)},l.prototype.sqrTo=function(t,r){t.squareTo(r),this.reduce(r)},p.prototype.convert=function(t){var r=n();return t.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),t.s<0&&r.compareTo(e.ZERO)>0&&this.m.subTo(r,r),r},p.prototype.revert=function(t){var r=n();return t.copyTo(r),this.reduce(r),r},p.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var r=0;r<this.m.t;++r){var e=32767&t[r],n=e*this.mpl+((e*this.mph+(t[r]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[e=r+this.m.t]+=this.m.am(0,n,t,r,0,this.m.t);t[e]>=t.DV;)t[e]-=t.DV,t[++e]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},p.prototype.mulTo=function(t,r,e){t.multiplyTo(r,e),this.reduce(e)},p.prototype.sqrTo=function(t,r){t.squareTo(r),this.reduce(r)},e.prototype.copyTo=function(t){for(var r=this.t-1;r>=0;--r)t[r]=this[r];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var u=8==n?255&t[i]:h(t,i);u<0?\"-\"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=u:s+n>this.DB?(this[this.t-1]|=(u&(1<<this.DB-s)-1)<<s,this[this.t++]=u>>this.DB-s):this[this.t-1]|=u<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,r){var e;for(e=this.t-1;e>=0;--e)r[e+t]=this[e];for(e=t-1;e>=0;--e)r[e]=0;r.t=this.t+t,r.s=this.s},e.prototype.drShiftTo=function(t,r){for(var e=t;e<this.t;++e)r[e-t]=this[e];r.t=Math.max(this.t-t,0),r.s=this.s},e.prototype.lShiftTo=function(t,r){var e,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(t/this.DB),u=this.s<<n&this.DM;for(e=this.t-1;e>=0;--e)r[e+s+1]=this[e]>>i|u,u=(this[e]&o)<<n;for(e=s-1;e>=0;--e)r[e]=0;r[s]=u,r.t=this.t+s+1,r.s=this.s,r.clamp()},e.prototype.rShiftTo=function(t,r){r.s=this.s;var e=Math.floor(t/this.DB);if(e>=this.t)r.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;r[0]=this[e]>>n;for(var s=e+1;s<this.t;++s)r[s-e-1]|=(this[s]&o)<<i,r[s-e]=this[s]>>n;n>0&&(r[this.t-e-1]|=(this.s&o)<<i),r.t=this.t-e,r.clamp()}},e.prototype.subTo=function(t,r){for(var e=0,n=0,i=Math.min(t.t,this.t);e<i;)n+=this[e]-t[e],r[e++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;e<this.t;)n+=this[e],r[e++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;e<t.t;)n-=t[e],r[e++]=n&this.DM,n>>=this.DB;n-=t.s}r.s=n<0?-1:0,n<-1?r[e++]=this.DV+n:n>0&&(r[e++]=n),r.t=e,r.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),i=t.abs(),o=n.t;for(r.t=o+i.t;--o>=0;)r[o]=0;for(o=0;o<i.t;++o)r[o+n.t]=n.am(0,i[o],r,o,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(t){for(var r=this.abs(),e=t.t=2*r.t;--e>=0;)t[e]=0;for(e=0;e<r.t-1;++e){var n=r.am(e,r[e],t,2*e,0,1);(t[e+r.t]+=r.am(e+1,2*r[e],t,2*e+1,n,r.t-e-1))>=r.DV&&(t[e+r.t]-=r.DV,t[e+r.t+1]=1)}t.t>0&&(t[t.t-1]+=r.am(e,r[e],t,2*e,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,r,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=r&&r.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=n());var u=n(),a=this.s,h=t.s,f=this.DB-c(o[o.t-1]);f>0?(o.lShiftTo(f,u),s.lShiftTo(f,i)):(o.copyTo(u),s.copyTo(i));var l=u.t,p=u[l-1];if(0!=p){var d=p*(1<<this.F1)+(l>1?u[l-2]>>this.F2:0),v=this.FV/d,y=(1<<this.F1)/d,g=1<<this.F2,m=i.t,w=m-l,b=null==r?n():r;for(u.dlShiftTo(w,b),i.compareTo(b)>=0&&(i[i.t++]=1,i.subTo(b,i)),e.ONE.dlShiftTo(l,b),b.subTo(u,u);u.t<l;)u[u.t++]=0;for(;--w>=0;){var M=i[--m]==p?this.DM:Math.floor(i[m]*v+(i[m-1]+g)*y);if((i[m]+=u.am(0,M,i,w,0,l))<M)for(u.dlShiftTo(w,b),i.subTo(b,i);i[m]<--M;)i.subTo(b,i)}null!=r&&(i.drShiftTo(l,r),a!=h&&e.ZERO.subTo(r,r)),i.t=l,i.clamp(),f>0&&i.rShiftTo(f,i),a<0&&e.ZERO.subTo(i,i)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var r=3&t;return(r=(r=(r=(r=r*(2-(15&t)*r)&15)*(2-(255&t)*r)&255)*(2-((65535&t)*r&65535))&65535)*(2-t*r%this.DV)%this.DV)>0?this.DV-r:-r},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var i=n(),o=n(),s=r.convert(this),u=c(t)-1;for(s.copyTo(i);--u>=0;)if(r.sqrTo(i,o),(t&1<<u)>0)r.mulTo(o,s,i);else{var a=i;i=o,o=a}return r.revert(i)},e.prototype.toString=function(t){if(this.s<0)return\"-\"+this.negate().toString(t);var r;if(16==t)r=4;else if(8==t)r=3;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return this.toRadix(t);r=2}var e,n=(1<<r)-1,i=!1,o=\"\",s=this.t,u=this.DB-s*this.DB%r;if(s-- >0)for(u<this.DB&&(e=this[s]>>u)>0&&(i=!0,o=a(e));s>=0;)u<r?(e=(this[s]&(1<<u)-1)<<r-u,e|=this[--s]>>(u+=this.DB-r)):(e=this[s]>>(u-=r)&n,u<=0&&(u+=this.DB,--s)),e>0&&(i=!0),i&&(o+=a(e));return i?o:\"0\"},e.prototype.negate=function(){var t=n();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var r=this.s-t.s;if(0!=r)return r;var e=this.t;if(0!=(r=e-t.t))return this.s<0?-r:r;for(;--e>=0;)if(0!=(r=this[e]-t[e]))return r;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+c(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=n();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r},e.prototype.modPowInt=function(t,r){var e;return e=t<256||r.isEven()?new l(r):new p(r),this.exp(t,e)},e.ZERO=f(0),e.ONE=f(1),b.prototype.convert=M,b.prototype.revert=M,b.prototype.mulTo=function(t,r,e){t.multiplyTo(r,e)},b.prototype.sqrTo=function(t,r){t.squareTo(r)},x.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var r=n();return t.copyTo(r),this.reduce(r),r},x.prototype.revert=function(t){return t},x.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},x.prototype.mulTo=function(t,r,e){t.multiplyTo(r,e),this.reduce(e)},x.prototype.sqrTo=function(t,r){t.squareTo(r),this.reduce(r)};var T,A,E,_=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],S=(1<<26)/_[_.length-1];function B(){var t;t=(new Date).getTime(),A[E++]^=255&t,A[E++]^=t>>8&255,A[E++]^=t>>16&255,A[E++]^=t>>24&255,E>=I&&(E-=I)}if(e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return\"0\";var r=this.chunkSize(t),e=Math.pow(t,r),i=f(e),o=n(),s=n(),u=\"\";for(this.divRemTo(i,o,s);o.signum()>0;)u=(e+s.intValue()).toString(t).substr(1)+u,o.divRemTo(i,o,s);return s.intValue().toString(t)+u},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),o=!1,s=0,u=0,a=0;a<t.length;++a){var f=h(t,a);f<0?\"-\"==t.charAt(a)&&0==this.signum()&&(o=!0):(u=r*u+f,++s>=n&&(this.dMultiply(i),this.dAddOffset(u,0),s=0,u=0))}s>0&&(this.dMultiply(Math.pow(r,s)),this.dAddOffset(u,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if(\"number\"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),r.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(t,r,e){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)e[n]=r(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)e[n]=r(this[n],i);e.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)e[n]=r(i,t[n]);e.t=t.t}e.s=r(this.s,t.s),e.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(t,r){for(var e=0,n=0,i=Math.min(t.t,this.t);e<i;)n+=this[e]+t[e],r[e++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;e<this.t;)n+=this[e],r[e++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;e<t.t;)n+=t[e],r[e++]=n&this.DM,n>>=this.DB;n+=t.s}r.s=n<0?-1:0,n>0?r[e++]=n:n<-1&&(r[e++]=this.DV+n),r.t=e,r.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,r){if(0!=t){for(;this.t<=r;)this[this.t++]=0;for(this[r]+=t;this[r]>=this.DV;)this[r]-=this.DV,++r>=this.t&&(this[this.t++]=0),++this[r]}},e.prototype.multiplyLowerTo=function(t,r,e){var n,i=Math.min(this.t+t.t,r);for(e.s=0,e.t=i;i>0;)e[--i]=0;for(n=e.t-this.t;i<n;++i)e[i+this.t]=this.am(0,t[i],e,i,0,this.t);for(n=Math.min(t.t,r);i<n;++i)this.am(0,t[i],e,i,0,r-i);e.clamp()},e.prototype.multiplyUpperTo=function(t,r,e){--r;var n=e.t=this.t+t.t-r;for(e.s=0;--n>=0;)e[n]=0;for(n=Math.max(r-this.t,0);n<t.t;++n)e[this.t+n-r]=this.am(r-n,t[n],e,0,0,this.t+n-r);e.clamp(),e.drShiftTo(1,e)},e.prototype.modInt=function(t){if(t<=0)return 0;var r=this.DV%t,e=this.s<0?t-1:0;if(this.t>0)if(0==r)e=this[0]%t;else for(var n=this.t-1;n>=0;--n)e=(r*e+this[n])%t;return e},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),i=r.getLowestSetBit();if(i<=0)return!1;var o=r.shiftRight(i);(t=t+1>>1)>_.length&&(t=_.length);for(var s=n(),u=0;u<t;++u){s.fromInt(_[Math.floor(Math.random()*_.length)]);var a=s.modPow(o,this);if(0!=a.compareTo(e.ONE)&&0!=a.compareTo(r)){for(var h=1;h++<i&&0!=a.compareTo(r);)if(0==(a=a.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=a.compareTo(r))return!1}}return!0},e.prototype.clone=function(){var t=n();return this.copyTo(t),t},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,r=new Array;r[0]=this.s;var e,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(e=this[t]>>n)!=(this.s&this.DM)>>n&&(r[i++]=e|this.s<<this.DB-n);t>=0;)n<8?(e=(this[t]&(1<<n)-1)<<8-n,e|=this[--t]>>(n+=this.DB-8)):(e=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&e)&&(e|=-256),0==i&&(128&this.s)!=(128&e)&&++i,(i>0||e!=this.s)&&(r[i++]=e);return r},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var r=n();return this.bitwiseTo(t,d,r),r},e.prototype.or=function(t){var r=n();return this.bitwiseTo(t,v,r),r},e.prototype.xor=function(t){var r=n();return this.bitwiseTo(t,y,r),r},e.prototype.andNot=function(t){var r=n();return this.bitwiseTo(t,g,r),r},e.prototype.not=function(){for(var t=n(),r=0;r<this.t;++r)t[r]=this.DM&~this[r];return t.t=this.t,t.s=~this.s,t},e.prototype.shiftLeft=function(t){var r=n();return t<0?this.rShiftTo(-t,r):this.lShiftTo(t,r),r},e.prototype.shiftRight=function(t){var r=n();return t<0?this.lShiftTo(-t,r):this.rShiftTo(t,r),r},e.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+m(this[t]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var t=0,r=this.s&this.DM,e=0;e<this.t;++e)t+=w(this[e]^r);return t},e.prototype.testBit=function(t){var r=Math.floor(t/this.DB);return r>=this.t?0!=this.s:0!=(this[r]&1<<t%this.DB)},e.prototype.setBit=function(t){return this.changeBit(t,v)},e.prototype.clearBit=function(t){return this.changeBit(t,g)},e.prototype.flipBit=function(t){return this.changeBit(t,y)},e.prototype.add=function(t){var r=n();return this.addTo(t,r),r},e.prototype.subtract=function(t){var r=n();return this.subTo(t,r),r},e.prototype.multiply=function(t){var r=n();return this.multiplyTo(t,r),r},e.prototype.divide=function(t){var r=n();return this.divRemTo(t,r,null),r},e.prototype.remainder=function(t){var r=n();return this.divRemTo(t,null,r),r},e.prototype.divideAndRemainder=function(t){var r=n(),e=n();return this.divRemTo(t,r,e),new Array(r,e)},e.prototype.modPow=function(t,r){var e,i,o=t.bitLength(),s=f(1);if(o<=0)return s;e=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new l(r):r.isEven()?new x(r):new p(r);var u=new Array,a=3,h=e-1,d=(1<<e)-1;if(u[1]=i.convert(this),e>1){var v=n();for(i.sqrTo(u[1],v);a<=d;)u[a]=n(),i.mulTo(v,u[a-2],u[a]),a+=2}var y,g,m=t.t-1,w=!0,b=n();for(o=c(t[m])-1;m>=0;){for(o>=h?y=t[m]>>o-h&d:(y=(t[m]&(1<<o+1)-1)<<h-o,m>0&&(y|=t[m-1]>>this.DB+o-h)),a=e;0==(1&y);)y>>=1,--a;if((o-=a)<0&&(o+=this.DB,--m),w)u[y].copyTo(s),w=!1;else{for(;a>1;)i.sqrTo(s,b),i.sqrTo(b,s),a-=2;a>0?i.sqrTo(s,b):(g=s,s=b,b=g),i.mulTo(b,u[y],s)}for(;m>=0&&0==(t[m]&1<<o);)i.sqrTo(s,b),g=s,s=b,b=g,--o<0&&(o=this.DB-1,--m)}return i.revert(s)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),i=this.clone(),o=f(1),s=f(0),u=f(0),a=f(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),r?(u.isEven()&&a.isEven()||(u.addTo(this,u),a.subTo(t,a)),u.rShiftTo(1,u)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);n.compareTo(i)>=0?(n.subTo(i,n),r&&o.subTo(u,o),s.subTo(a,s)):(i.subTo(n,i),r&&u.subTo(o,u),a.subTo(s,a))}return 0!=i.compareTo(e.ONE)?e.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},e.prototype.pow=function(t){return this.exp(t,new b)},e.prototype.gcd=function(t){var r=this.s<0?this.negate():this.clone(),e=t.s<0?t.negate():t.clone();if(r.compareTo(e)<0){var n=r;r=e,e=n}var i=r.getLowestSetBit(),o=e.getLowestSetBit();if(o<0)return r;for(i<o&&(o=i),o>0&&(r.rShiftTo(o,r),e.rShiftTo(o,e));r.signum()>0;)(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),r.compareTo(e)>=0?(r.subTo(e,r),r.rShiftTo(1,r)):(e.subTo(r,e),e.rShiftTo(1,e));return o>0&&e.lShiftTo(o,e),e},e.prototype.isProbablePrime=function(t){var r,e=this.abs();if(1==e.t&&e[0]<=_[_.length-1]){for(r=0;r<_.length;++r)if(e[0]==_[r])return!0;return!1}if(e.isEven())return!1;for(r=1;r<_.length;){for(var n=_[r],i=r+1;i<_.length&&n<S;)n*=_[i++];for(n=e.modInt(n);r<i;)if(n%_[r++]==0)return!1}return e.millerRabin(t)},e.prototype.square=function(){var t=n();return this.squareTo(t),t},e.prototype.Barrett=x,null==A){var O;if(A=new Array,E=0,\"undefined\"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var R=new Uint8Array(32);for(window.crypto.getRandomValues(R),O=0;O<32;++O)A[E++]=R[O]}else if(\"Netscape\"==navigator.appName&&navigator.appVersion<\"5\"){var k=window.crypto.random(32);for(O=0;O<k.length;++O)A[E++]=255&k.charCodeAt(O)}for(;E<I;)O=Math.floor(65536*Math.random()),A[E++]=O>>>8,A[E++]=255&O;E=0,B()}function F(){if(null==T){for(B(),(T=new D).init(A),E=0;E<A.length;++E)A[E]=0;E=0}return T.next()}function j(){}function D(){this.i=0,this.j=0,this.S=new Array}j.prototype.nextBytes=function(t){var r;for(r=0;r<t.length;++r)t[r]=F()},D.prototype.init=function(t){var r,e,n;for(r=0;r<256;++r)this.S[r]=r;for(e=0,r=0;r<256;++r)e=e+this.S[r]+t[r%t.length]&255,n=this.S[r],this.S[r]=this.S[e],this.S[e]=n;this.i=0,this.j=0},D.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var I=256;t.exports={default:e,BigInteger:e,SecureRandom:j}}.call(void 0)},function(t,r,e){\"use strict\";var n=e(37),i=n(e(65)),o=n(e(64)),s=e(141).BigInteger,u=(0,i.default)((function t(){(0,o.default)(this,t),this.p=new s(\"FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF\",16),this.a=new s(\"FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC\",16),this.b=new s(\"28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93\",16),this.Gx=new s(\"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7\",16),this.Gy=new s(\"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0\",16),this.n=new s(\"FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123\",16),this.h=new s(\"1\",16)}));t.exports=u},function(t,r,e){var n=e(48),i=e(7),o=e(10),s=e(35),u=e(153),a=e(13),h=e(34),f=e(152),c=e(83),l=e(250),p=TypeError,d=function(t,r){this.stopped=t,this.result=r},v=d.prototype;t.exports=function(t,r,e){var y,g,m,w,b,M,x,T=e&&e.that,A=!(!e||!e.AS_ENTRIES),E=!(!e||!e.IS_RECORD),_=!(!e||!e.IS_ITERATOR),S=!(!e||!e.INTERRUPTED),B=n(r,T),O=function(t){return y&&l(y,\"normal\",t),new d(!0,t)},R=function(t){return A?(o(t),S?B(t[0],t[1],O):B(t[0],t[1])):S?B(t,O):B(t)};if(E)y=t.iterator;else if(_)y=t;else{if(!(g=c(t)))throw p(s(t)+\" is not iterable\");if(u(g)){for(m=0,w=a(t);w>m;m++)if((b=R(t[m]))&&h(v,b))return b;return new d(!1)}y=f(t,g)}for(M=E?t.next:y.next;!(x=i(M,y)).done;){try{b=R(x.value)}catch(t){l(y,\"throw\",t)}if(\"object\"==typeof b&&b&&h(v,b))return b}return new d(!1)}},function(t,r,e){\"use strict\";var n=e(6),i=e(15).map;n({target:\"Array\",proto:!0,forced:!e(63)(\"map\")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,r,e){var n=e(9),i=e(45).EXISTS,o=e(1),s=e(11).f,u=Function.prototype,a=o(u.toString),h=/function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/,f=o(h.exec);n&&!i&&s(u,\"name\",{configurable:!0,get:function(){try{return f(h,a(this))[1]}catch(t){return\"\"}}})},function(t,r,e){\"use strict\";var n,i,o=e(7),s=e(1),u=e(24),a=e(156),h=e(217),f=e(81),c=e(38),l=e(26).get,p=e(256),d=e(257),v=f(\"native-string-replace\",String.prototype.replace),y=RegExp.prototype.exec,g=y,m=s(\"\".charAt),w=s(\"\".indexOf),b=s(\"\".replace),M=s(\"\".slice),x=(i=/b*/g,o(y,n=/a/,\"a\"),o(y,i,\"a\"),0!==n.lastIndex||0!==i.lastIndex),T=h.BROKEN_CARET,A=void 0!==/()??/.exec(\"\")[1];(x||A||T||p||d)&&(g=function(t){var r,e,n,i,s,h,f,p=this,d=l(p),E=u(t),_=d.raw;if(_)return _.lastIndex=p.lastIndex,r=o(g,_,E),p.lastIndex=_.lastIndex,r;var S=d.groups,B=T&&p.sticky,O=o(a,p),R=p.source,k=0,F=E;if(B&&(O=b(O,\"y\",\"\"),-1===w(O,\"g\")&&(O+=\"g\"),F=M(E,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&\"\\n\"!==m(E,p.lastIndex-1))&&(R=\"(?: \"+R+\")\",F=\" \"+F,k++),e=new RegExp(\"^(?:\"+R+\")\",O)),A&&(e=new RegExp(\"^\"+R+\"$(?!\\\\s)\",O)),x&&(n=p.lastIndex),i=o(y,B?e:p,F),B?i?(i.input=M(i.input,k),i[0]=M(i[0],k),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:x&&i&&(p.lastIndex=p.global?i.index+i[0].length:n),A&&i&&i.length>1&&o(v,i[0],e,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i&&S)for(i.groups=h=c(null),s=0;s<S.length;s++)h[(f=S[s])[0]]=i[f[1]];return i}),t.exports=g},function(t,r,e){var n=e(2),i=e(212),o=e(213),s=e(276),u=e(23),a=function(t){if(t&&t.forEach!==s)try{u(t,\"forEach\",s)}catch(r){t.forEach=s}};for(var h in i)i[h]&&a(n[h]&&n[h].prototype);a(o)},function(t,r){var e;e=function(){return this}();try{e=e||new Function(\"return this\")()}catch(t){\"object\"==typeof window&&(e=window)}t.exports=e},function(t,r,e){var n=e(130),i=e(75);t.exports=Object.keys||function(t){return n(t,i)}},function(t,r,e){var n=e(28);t.exports=n(\"document\",\"documentElement\")},function(t,r,e){var n=e(16);t.exports=function(t,r,e){for(var i in r)n(t,i,r[i],e);return t}},function(t,r,e){var n=e(7),i=e(25),o=e(10),s=e(35),u=e(83),a=TypeError;t.exports=function(t,r){var e=arguments.length<2?u(t):r;if(i(e))return o(n(e,t));throw a(s(t)+\" is not iterable\")}},function(t,r,e){var n=e(5),i=e(42),o=n(\"iterator\"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[o]===t)}},function(t,r,e){var n=e(4),i=e(8),o=e(36);t.exports=function(t,r,e){var s,u;return o&&n(s=r.constructor)&&s!==e&&i(u=s.prototype)&&u!==e.prototype&&o(t,u),t}},function(t,r,e){\"use strict\";var n=e(35),i=TypeError;t.exports=function(t,r){if(!delete t[r])throw i(\"Cannot delete property \"+n(r)+\" of \"+n(t))}},function(t,r,e){\"use strict\";var n=e(10);t.exports=function(){var t=n(this),r=\"\";return t.hasIndices&&(r+=\"d\"),t.global&&(r+=\"g\"),t.ignoreCase&&(r+=\"i\"),t.multiline&&(r+=\"m\"),t.dotAll&&(r+=\"s\"),t.unicode&&(r+=\"u\"),t.unicodeSets&&(r+=\"v\"),t.sticky&&(r+=\"y\"),r}},function(t,r,e){\"use strict\";r.byteLength=function(t){var r=h(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=h(t),s=n[0],u=n[1],a=new o(function(t,r,e){return 3*(r+e)/4-e}(0,s,u)),f=0,c=u>0?s-4:s;for(e=0;e<c;e+=4)r=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)],a[f++]=r>>16&255,a[f++]=r>>8&255,a[f++]=255&r;2===u&&(r=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,a[f++]=255&r);1===u&&(r=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,a[f++]=r>>8&255,a[f++]=255&r);return a},r.fromByteArray=function(t){for(var r,e=t.length,i=e%3,o=[],s=16383,u=0,a=e-i;u<a;u+=s)o.push(f(t,u,u+s>a?a:u+s));1===i?(r=t[e-1],o.push(n[r>>2]+n[r<<4&63]+\"==\")):2===i&&(r=(t[e-2]<<8)+t[e-1],o.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+\"=\"));return o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,s=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",u=0,a=s.length;u<a;++u)n[u]=s[u],i[s.charCodeAt(u)]=u;function h(t){var r=t.length;if(r%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var e=t.indexOf(\"=\");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function f(t,r,e){for(var i,o,s=[],u=r;u<e;u+=3)i=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join(\"\")}i[\"-\".charCodeAt(0)]=62,i[\"_\".charCodeAt(0)]=63},function(t,r,e){var n=e(5),i=e(38),o=e(11).f,s=n(\"unscopables\"),u=Array.prototype;null==u[s]&&o(u,s,{configurable:!0,value:i(null)}),t.exports=function(t){u[s][t]=!0}},function(t,r,e){\"use strict\";var n=e(6),i=e(2),o=e(7),s=e(9),u=e(160),a=e(3),h=e(132),f=e(57),c=e(43),l=e(23),p=e(191),d=e(20),v=e(134),y=e(137),g=e(54),m=e(12),w=e(22),b=e(8),M=e(74),x=e(38),T=e(34),A=e(36),E=e(50).f,_=e(161),S=e(15).forEach,B=e(121),O=e(11),R=e(49),k=e(26),F=e(154),j=k.get,D=k.set,I=k.enforce,P=O.f,C=R.f,L=Math.round,U=i.RangeError,N=h.ArrayBuffer,q=N.prototype,Y=h.DataView,z=a.NATIVE_ARRAY_BUFFER_VIEWS,V=a.TYPED_ARRAY_TAG,Z=a.TypedArray,G=a.TypedArrayPrototype,K=a.aTypedArrayConstructor,W=a.isTypedArray,X=\"BYTES_PER_ELEMENT\",H=\"Wrong length\",$=function(t,r){K(t);for(var e=0,n=r.length,i=new t(n);n>e;)i[e]=r[e++];return i},J=function(t,r){P(t,r,{get:function(){return j(this)[r]}})},Q=function(t){var r;return T(q,t)||\"ArrayBuffer\"==(r=w(t))||\"SharedArrayBuffer\"==r},tt=function(t,r){return W(t)&&!M(r)&&r in t&&p(+r)&&r>=0},rt=function(t,r){return r=g(r),tt(t,r)?c(2,t[r]):C(t,r)},et=function(t,r,e){return r=g(r),!(tt(t,r)&&b(e)&&m(e,\"value\"))||m(e,\"get\")||m(e,\"set\")||e.configurable||m(e,\"writable\")&&!e.writable||m(e,\"enumerable\")&&!e.enumerable?P(t,r,e):(t[r]=e.value,t)};s?(z||(R.f=rt,O.f=et,J(G,\"buffer\"),J(G,\"byteOffset\"),J(G,\"byteLength\"),J(G,\"length\")),n({target:\"Object\",stat:!0,forced:!z},{getOwnPropertyDescriptor:rt,defineProperty:et}),t.exports=function(t,r,e){var s=t.match(/\\d+$/)[0]/8,a=t+(e?\"Clamped\":\"\")+\"Array\",h=\"get\"+t,c=\"set\"+t,p=i[a],g=p,m=g&&g.prototype,w={},M=function(t,r){P(t,r,{get:function(){return function(t,r){var e=j(t);return e.view[h](r*s+e.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,n){var i=j(t);e&&(n=(n=L(n))<0?0:n>255?255:255&n),i.view[c](r*s+i.byteOffset,n,!0)}(this,r,t)},enumerable:!0})};z?u&&(g=r((function(t,r,e,n){return f(t,m),F(b(r)?Q(r)?void 0!==n?new p(r,y(e,s),n):void 0!==e?new p(r,y(e,s)):new p(r):W(r)?$(g,r):o(_,g,r):new p(v(r)),t,g)})),A&&A(g,Z),S(E(p),(function(t){t in g||l(g,t,p[t])})),g.prototype=m):(g=r((function(t,r,e,n){f(t,m);var i,u,a,h=0,c=0;if(b(r)){if(!Q(r))return W(r)?$(g,r):o(_,g,r);i=r,c=y(e,s);var l=r.byteLength;if(void 0===n){if(l%s)throw U(H);if((u=l-c)<0)throw U(H)}else if((u=d(n)*s)+c>l)throw U(H);a=u/s}else a=v(r),i=new N(u=a*s);for(D(t,{buffer:i,byteOffset:c,byteLength:u,length:a,view:new Y(i)});h<a;)M(t,h++)})),A&&A(g,Z),m=g.prototype=x(G)),m.constructor!==g&&l(m,\"constructor\",g),I(m).TypedArrayConstructor=g,V&&l(m,V,a);var T=g!=p;w[a]=g,n({global:!0,constructor:!0,forced:T,sham:!z},w),X in g||l(g,X,s),X in m||l(m,X,s),B(a)}):t.exports=function(){}},function(t,r,e){var n=e(2),i=e(0),o=e(120),s=e(3).NATIVE_ARRAY_BUFFER_VIEWS,u=n.ArrayBuffer,a=n.Int8Array;t.exports=!s||!i((function(){a(1)}))||!i((function(){new a(-1)}))||!o((function(t){new a,new a(null),new a(1.5),new a(t)}),!0)||i((function(){return 1!==new a(new u(2),1,void 0).length}))},function(t,r,e){var n=e(48),i=e(7),o=e(135),s=e(14),u=e(13),a=e(152),h=e(83),f=e(153),c=e(193),l=e(3).aTypedArrayConstructor,p=e(138);t.exports=function(t){var r,e,d,v,y,g,m,w,b=o(this),M=s(t),x=arguments.length,T=x>1?arguments[1]:void 0,A=void 0!==T,E=h(M);if(E&&!f(E))for(w=(m=a(M,E)).next,M=[];!(g=i(w,m)).done;)M.push(g.value);for(A&&x>2&&(T=n(T,arguments[2])),e=u(M),d=new(l(b))(e),v=c(d),r=0;e>r;r++)y=A?T(M[r],r):M[r],d[r]=v?p(y):+y;return d}},function(t,r,e){var n=e(6),i=e(203);n({global:!0,forced:parseInt!=i},{parseInt:i})},function(t,r,e){var n=e(226),i=e(227),o=e(228),s=e(229);t.exports=function(t){return n(t)||i(t)||o(t)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r){t.exports=function(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r,e){\"use strict\";var n=e(37);e(27);var i=n(e(64)),o=n(e(65)),s=e(79),u=[2043430169,4086860338,3878753381,3462539467,2630111639,965255983,1930511966,3861023932,3427080569,2559193843,823420391,1646840782,3293681564,2292395833,289824371,579648742,2643098247,991229199,1982458398,3964916796,3634866297,2974765299,1654563303,3309126606,2323285917,351604539,703209078,1406418156,2812836312,1330705329,2661410658,1027854021,2055708042,4111416084,3927864873,3560762451,2826557607,1358147919,2716295838,1137624381,2275248762,255530229,511060458,1022120916,2044241832,4088483664,3882000033,3469032771,2643098247,991229199,1982458398,3964916796,3634866297,2974765299,1654563303,3309126606,2323285917,351604539,703209078,1406418156,2812836312,1330705329,2661410658,1027854021],a=64,h=new Array(68);function f(t,r){return t<<r|t>>>32-r}function c(t){return t^f(t,15)^f(t,23)}function l(t,r,e,n,i,o,s,a,c){var l=f(r,12),p=f(l+o+u[t],7);return l^=p,t<=15?(i=i+(r^e^n)+l+(h[t]^h[t+4]),c=c+function(t,r,e){return t^r^e}(o,s,a)+p+h[t]):(i=i+function(t,r,e){return t&r|t&e|r&e}(r,e,n)+l+(h[t]^h[t+4]),c=c+function(t,r,e){return t&r|~t&e}(o,s,a)+p+h[t]),e=f(e,9),s=f(s,19),c=function(t){return t^f(t,9)^f(t,17)}(c),[e,i,s,c]}var p=function(){function t(){(0,i.default)(this,t),this.digest=new Array(8),this.nblocks=0,this.block=new Array(64),this.num=0}return(0,o.default)(t,[{key:\"init\",value:function(){this.digest[0]=1937774191,this.digest[1]=1226093241,this.digest[2]=388252375,this.digest[3]=3666478592,this.digest[4]=2842636476,this.digest[5]=372324522,this.digest[6]=3817729613,this.digest[7]=2969243214;for(var t=0;t<64;t++)this.block[t]=0;this.nblocks=0,this.num=0}},{key:\"SM3Compress\",value:function(t){for(var r=0,e=new Array(4),n=this.digest[0],i=this.digest[1],o=this.digest[2],s=this.digest[3],u=this.digest[4],a=this.digest[5],p=this.digest[6],d=this.digest[7],v=new Array(16),y=0;y+3<64;y+=4)v[y/4]=(t[y]<<24)+(t[y+1]<<16)+(t[y+2]<<8)+t[y+3];for(r=0;r<4;r++)h[r]=v[r];for(r=0;r<=8;r+=4)h[r+4]=v[r+4],i=(e=l(r,n,i,o,s,u,a,p,d))[0],s=e[1],a=e[2],d=e[3],h[r+5]=v[r+5],n=(e=l(r+1,s,n,i,o,d,u,a,p))[0],o=e[1],u=e[2],p=e[3],h[r+6]=v[r+6],s=(e=l(r+2,o,s,n,i,p,d,u,a))[0],i=e[1],d=e[2],a=e[3],h[r+7]=v[r+7],o=(e=l(r+3,i,o,s,n,a,p,d,u))[0],n=e[1],p=e[2],u=e[3];for(r=12;r<=60;r+=4)h[r+4]=c(h[r-12]^h[r-5]^f(h[r+1],15))^f(h[r-9],7)^h[r-2],i=(e=l(r,n,i,o,s,u,a,p,d))[0],s=e[1],a=e[2],d=e[3],h[r+5]=c(h[r-11]^h[r-4]^f(h[r+2],15))^f(h[r-8],7)^h[r-1],n=(e=l(r+1,s,n,i,o,d,u,a,p))[0],o=e[1],u=e[2],p=e[3],h[r+6]=c(h[r-10]^h[r-3]^f(h[r+3],15))^f(h[r-7],7)^h[r],s=(e=l(r+2,o,s,n,i,p,d,u,a))[0],i=e[1],d=e[2],a=e[3],h[r+7]=c(h[r-9]^h[r-2]^f(h[r+4],15))^f(h[r-6],7)^h[r+1],o=(e=l(r+3,i,o,s,n,a,p,d,u))[0],n=e[1],p=e[2],u=e[3];this.digest[0]^=n,this.digest[1]^=i,this.digest[2]^=o,this.digest[3]^=s,this.digest[4]^=u,this.digest[5]^=a,this.digest[6]^=p,this.digest[7]^=d;for(var g=0;g<8;g++)this.digest[g]=this.digest[g]>>>0}},{key:\"update\",value:function(t){for(var r=t.length,e=0;e<r;e++)t[e]=(t[e]>>>0)%256;if(this.num){var n=a-this.num;if(r<n){for(var i=0;i<r;i++)this.block[this.num+i]=t[i];return void(this.num+=r)}for(var o=0;o<n;o++)this.block[this.num+o]=t[o];this.SM3Compress(this.block),this.nblocks++,t=t.slice(n),r-=n}for(var s=0;r>=a;){var u=a*s,h=t.slice(u,u+a);this.SM3Compress(h),this.nblocks++,s++,r-=a}this.num=r;var f=s*a;if(r)for(var c=0;c<r;c++)this.block[c]=t[f+c]}},{key:\"final\",value:function(){if(this.block[this.num]=128,this.num+9<=a)for(var t=0;t<a-this.num-9;t++)this.block[this.num+1+t]=0;else{for(var r=0;r<a-this.num-1;r++)this.block[this.num+1+r]=0;this.SM3Compress(this.block);for(var e=0;e<56;e++)this.block[e]=0}var n=this.nblocks>>>23,i=(this.nblocks<<9)+(this.num<<3);this.block[56]=(n>>>24)%256,this.block[57]=(n>>>16)%256,this.block[58]=(n>>>8)%256,this.block[59]=(n>>>0)%256,this.block[60]=(i>>>24)%256,this.block[61]=(i>>>16)%256,this.block[62]=(i>>>8)%256,this.block[63]=(i>>>0)%256;var o=new Array(32);this.SM3Compress(this.block);for(var s=0;s<8;s++)o[4*s]=(this.digest[s]>>>24)%256,o[4*s+1]=(this.digest[s]>>>16)%256,o[4*s+2]=(this.digest[s]>>>8)%256,o[4*s+3]=(this.digest[s]>>>0)%256;return o}},{key:\"hashForBinaryArray\",value:function(t){this.init(),this.update(t);var r=this.final();return s.byteArrayToHex(r)}},{key:\"hashForUTF8String\",value:function(t){var r=s.stringToByteArrayInUtf8(t);return this.hashForBinaryArray(r)}}]),t}();t.exports=p},function(t,r,e){\"use strict\";e(86);var n=e(1),i=e(16),o=e(146),s=e(0),u=e(5),a=e(23),h=u(\"species\"),f=RegExp.prototype;t.exports=function(t,r,e,c){var l=u(t),p=!s((function(){var r={};return r[l]=function(){return 7},7!=\"\"[t](r)})),d=p&&!s((function(){var r=!1,e=/a/;return\"split\"===t&&((e={}).constructor={},e.constructor[h]=function(){return e},e.flags=\"\",e[l]=/./[l]),e.exec=function(){return r=!0,null},e[l](\"\"),!r}));if(!p||!d||e){var v=n(/./[l]),y=r(l,\"\"[t],(function(t,r,e,i,s){var u=n(t),a=r.exec;return a===o||a===f.exec?p&&!s?{done:!0,value:v(r,e,i)}:{done:!0,value:u(e,r,i)}:{done:!1}}));i(String.prototype,t,y[0]),i(f,l,y[1])}c&&a(f[l],\"sham\",!0)}},function(t,r,e){\"use strict\";var n=e(122).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},function(t,r,e){var n=e(7),i=e(10),o=e(4),s=e(29),u=e(146),a=TypeError;t.exports=function(t,r){var e=t.exec;if(o(e)){var h=n(e,t,r);return null!==h&&i(h),h}if(\"RegExp\"===s(t))return n(u,t,r);throw a(\"RegExp#exec called on incompatible receiver\")}},function(t,r){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,r,e){\"use strict\";(function(r){var n,i=e(176),o=i.Buffer,s={};for(n in i)i.hasOwnProperty(n)&&\"SlowBuffer\"!==n&&\"Buffer\"!==n&&(s[n]=i[n]);var u=s.Buffer={};for(n in o)o.hasOwnProperty(n)&&\"allocUnsafe\"!==n&&\"allocUnsafeSlow\"!==n&&(u[n]=o[n]);if(s.Buffer.prototype=o.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(t,r,e){if(\"number\"==typeof t)throw new TypeError('The \"value\" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t);return o(t,r,e)}),u.alloc||(u.alloc=function(t,r,e){if(\"number\"!=typeof t)throw new TypeError('The \"size\" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"');var n=o(t);return r&&0!==r.length?\"string\"==typeof e?n.fill(r,e):n.fill(r):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=r.binding(\"buffer\").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s}).call(this,e(275))},function(t,r,e){\"use strict\";var n=e(37)(e(223));e(80),e(17),e(147),e(277),e(144),e(172),e(27),e(86);var i=e(173).Reporter,o=e(90).EncoderBuffer,s=e(90).DecoderBuffer,u=e(278),a=[\"seq\",\"seqof\",\"set\",\"setof\",\"objid\",\"bool\",\"gentime\",\"utctime\",\"null_\",\"enum\",\"int\",\"objDesc\",\"bitstr\",\"bmpstr\",\"charstr\",\"genstr\",\"graphstr\",\"ia5str\",\"iso646str\",\"numstr\",\"octstr\",\"printstr\",\"t61str\",\"unistr\",\"utf8str\",\"videostr\"],h=[\"key\",\"obj\",\"use\",\"optional\",\"explicit\",\"implicit\",\"def\",\"choice\",\"any\",\"contains\"].concat(a);function f(t,r,e){var n={};this._baseState=n,n.name=e,n.enc=t,n.parent=r||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=f;var c=[\"enc\",\"parent\",\"children\",\"tag\",\"args\",\"reverseArgs\",\"choice\",\"optional\",\"any\",\"obj\",\"use\",\"alteredUse\",\"key\",\"default\",\"explicit\",\"implicit\",\"contains\"];f.prototype.clone=function(){var t=this._baseState,r={};c.forEach((function(e){r[e]=t[e]}));var e=new this.constructor(r.parent);return e._baseState=r,e},f.prototype._wrap=function(){var t=this._baseState;h.forEach((function(r){this[r]=function(){var e=new this.constructor(this);return t.children.push(e),e[r].apply(e,arguments)}}),this)},f.prototype._init=function(t){var r=this._baseState;u(null===r.parent),t.call(this),r.children=r.children.filter((function(t){return t._baseState.parent===this}),this),u.equal(r.children.length,1,\"Root node can have only one child\")},f.prototype._useArgs=function(t){var r=this._baseState,e=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==e.length&&(u(null===r.children),r.children=e,e.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(u(null===r.args),r.args=t,r.reverseArgs=t.map((function(t){if(\"object\"!==(0,n.default)(t)||t.constructor!==Object)return t;var r={};return Object.keys(t).forEach((function(e){e==(0|e)&&(e|=0);var n=t[e];r[n]=e})),r})))},[\"_peekTag\",\"_decodeTag\",\"_use\",\"_decodeStr\",\"_decodeObjid\",\"_decodeTime\",\"_decodeNull\",\"_decodeInt\",\"_decodeBool\",\"_decodeList\",\"_encodeComposite\",\"_encodeStr\",\"_encodeObjid\",\"_encodeTime\",\"_encodeNull\",\"_encodeInt\",\"_encodeBool\"].forEach((function(t){f.prototype[t]=function(){var r=this._baseState;throw new Error(t+\" not implemented for encoding: \"+r.enc)}})),a.forEach((function(t){f.prototype[t]=function(){var r=this._baseState,e=Array.prototype.slice.call(arguments);return u(null===r.tag),r.tag=t,this._useArgs(e),this}})),f.prototype.use=function(t){u(t);var r=this._baseState;return u(null===r.use),r.use=t,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(t){var r=this._baseState;return u(null===r.default),r.default=t,r.optional=!0,this},f.prototype.explicit=function(t){var r=this._baseState;return u(null===r.explicit&&null===r.implicit),r.explicit=t,this},f.prototype.implicit=function(t){var r=this._baseState;return u(null===r.explicit&&null===r.implicit),r.implicit=t,this},f.prototype.obj=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return t.obj=!0,0!==r.length&&this._useArgs(r),this},f.prototype.key=function(t){var r=this._baseState;return u(null===r.key),r.key=t,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(t){var r=this._baseState;return u(null===r.choice),r.choice=t,this._useArgs(Object.keys(t).map((function(r){return t[r]}))),this},f.prototype.contains=function(t){var r=this._baseState;return u(null===r.use),r.contains=t,this},f.prototype._decode=function(t,r){var e=this._baseState;if(null===e.parent)return t.wrapResult(e.children[0]._decode(t,r));var n,i=e.default,o=!0,u=null;if(null!==e.key&&(u=t.enterKey(e.key)),e.optional){var a=null;if(null!==e.explicit?a=e.explicit:null!==e.implicit?a=e.implicit:null!==e.tag&&(a=e.tag),null!==a||e.any){if(o=this._peekTag(t,a,e.any),t.isError(o))return o}else{var h=t.save();try{null===e.choice?this._decodeGeneric(e.tag,t,r):this._decodeChoice(t,r),o=!0}catch(t){o=!1}t.restore(h)}}if(e.obj&&o&&(n=t.enterObject()),o){if(null!==e.explicit){var f=this._decodeTag(t,e.explicit);if(t.isError(f))return f;t=f}var c=t.offset;if(null===e.use&&null===e.choice){var l;e.any&&(l=t.save());var p=this._decodeTag(t,null!==e.implicit?e.implicit:e.tag,e.any);if(t.isError(p))return p;e.any?i=t.raw(l):t=p}if(r&&r.track&&null!==e.tag&&r.track(t.path(),c,t.length,\"tagged\"),r&&r.track&&null!==e.tag&&r.track(t.path(),t.offset,t.length,\"content\"),e.any||(i=null===e.choice?this._decodeGeneric(e.tag,t,r):this._decodeChoice(t,r)),t.isError(i))return i;if(e.any||null!==e.choice||null===e.children||e.children.forEach((function(e){e._decode(t,r)})),e.contains&&(\"octstr\"===e.tag||\"bitstr\"===e.tag)){var d=new s(i);i=this._getUse(e.contains,t._reporterState.obj)._decode(d,r)}}return e.obj&&o&&(i=t.leaveObject(n)),null===e.key||null===i&&!0!==o?null!==u&&t.exitKey(u):t.leaveKey(u,e.key,i),i},f.prototype._decodeGeneric=function(t,r,e){var n=this._baseState;return\"seq\"===t||\"set\"===t?null:\"seqof\"===t||\"setof\"===t?this._decodeList(r,t,n.args[0],e):/str$/.test(t)?this._decodeStr(r,t,e):\"objid\"===t&&n.args?this._decodeObjid(r,n.args[0],n.args[1],e):\"objid\"===t?this._decodeObjid(r,null,null,e):\"gentime\"===t||\"utctime\"===t?this._decodeTime(r,t,e):\"null_\"===t?this._decodeNull(r,e):\"bool\"===t?this._decodeBool(r,e):\"objDesc\"===t?this._decodeStr(r,t,e):\"int\"===t||\"enum\"===t?this._decodeInt(r,n.args&&n.args[0],e):null!==n.use?this._getUse(n.use,r._reporterState.obj)._decode(r,e):r.error(\"unknown tag: \"+t)},f.prototype._getUse=function(t,r){var e=this._baseState;return e.useDecoder=this._use(t,r),u(null===e.useDecoder._baseState.parent),e.useDecoder=e.useDecoder._baseState.children[0],e.implicit!==e.useDecoder._baseState.implicit&&(e.useDecoder=e.useDecoder.clone(),e.useDecoder._baseState.implicit=e.implicit),e.useDecoder},f.prototype._decodeChoice=function(t,r){var e=this._baseState,n=null,i=!1;return Object.keys(e.choice).some((function(o){var s=t.save(),u=e.choice[o];try{var a=u._decode(t,r);if(t.isError(a))return!1;n={type:o,value:a},i=!0}catch(r){return t.restore(s),!1}return!0}),this),i?n:t.error(\"Choice not matched\")},f.prototype._createEncoderBuffer=function(t){return new o(t,this.reporter)},f.prototype._encode=function(t,r,e){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,r,e);if(void 0!==i&&!this._skipDefault(i,r,e))return i}},f.prototype._encodeValue=function(t,r,e){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(t,r||new i);var s=null;if(this.reporter=r,o.optional&&void 0===t){if(null===o.default)return;t=o.default}var u=null,a=!1;if(o.any)s=this._createEncoderBuffer(t);else if(o.choice)s=this._encodeChoice(t,r);else if(o.contains)u=this._getUse(o.contains,e)._encode(t,r),a=!0;else if(o.children)u=o.children.map((function(e){if(\"null_\"===e._baseState.tag)return e._encode(null,r,t);if(null===e._baseState.key)return r.error(\"Child should have a key\");var i=r.enterKey(e._baseState.key);if(\"object\"!==(0,n.default)(t))return r.error(\"Child expected, but input is not object\");var o=e._encode(t[e._baseState.key],r,t);return r.leaveKey(i),o}),this).filter((function(t){return t})),u=this._createEncoderBuffer(u);else if(\"seqof\"===o.tag||\"setof\"===o.tag){if(!o.args||1!==o.args.length)return r.error(\"Too many args for : \"+o.tag);if(!Array.isArray(t))return r.error(\"seqof/setof, but data is not Array\");var h=this.clone();h._baseState.implicit=null,u=this._createEncoderBuffer(t.map((function(e){var n=this._baseState;return this._getUse(n.args[0],t)._encode(e,r)}),h))}else null!==o.use?s=this._getUse(o.use,e)._encode(t,r):(u=this._encodePrimitive(o.tag,t),a=!0);if(!o.any&&null===o.choice){var f=null!==o.implicit?o.implicit:o.tag,c=null===o.implicit?\"universal\":\"context\";null===f?null===o.use&&r.error(\"Tag could be omitted only for .use()\"):null===o.use&&(s=this._encodeComposite(f,a,c,u))}return null!==o.explicit&&(s=this._encodeComposite(o.explicit,!1,\"context\",s)),s},f.prototype._encodeChoice=function(t,r){var e=this._baseState,n=e.choice[t.type];return n||u(!1,t.type+\" not found in \"+JSON.stringify(Object.keys(e.choice))),n._encode(t.value,r)},f.prototype._encodePrimitive=function(t,r){var e=this._baseState;if(/str$/.test(t))return this._encodeStr(r,t);if(\"objid\"===t&&e.args)return this._encodeObjid(r,e.reverseArgs[0],e.args[1]);if(\"objid\"===t)return this._encodeObjid(r,null,null);if(\"gentime\"===t||\"utctime\"===t)return this._encodeTime(r,t);if(\"null_\"===t)return this._encodeNull();if(\"int\"===t||\"enum\"===t)return this._encodeInt(r,e.args&&e.reverseArgs[0]);if(\"bool\"===t)return this._encodeBool(r);if(\"objDesc\"===t)return this._encodeStr(r,t);throw new Error(\"Unsupported tag: \"+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},function(t,r,e){var n=e(6),i=e(14),o=e(149);n({target:\"Object\",stat:!0,forced:e(0)((function(){o(1)}))},{keys:function(t){return o(i(t))}})},function(t,r,e){\"use strict\";e(27),e(39),e(144);var n=e(58);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,r){this.path=t,this.rethrow(r)}r.Reporter=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var r=this._reporterState;r.obj=t.obj,r.path=r.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var r=this._reporterState;r.path=r.path.slice(0,t-1)},i.prototype.leaveKey=function(t,r,e){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[r]=e)},i.prototype.path=function(){return this._reporterState.path.join(\"/\")},i.prototype.enterObject=function(){var t=this._reporterState,r=t.obj;return t.obj={},r},i.prototype.leaveObject=function(t){var r=this._reporterState,e=r.obj;return r.obj=t,e},i.prototype.error=function(t){var r,e=this._reporterState,n=t instanceof o;if(r=n?t:new o(e.path.map((function(t){return\"[\"+JSON.stringify(t)+\"]\"})).join(\"\"),t.message||t,t.stack),!e.options.partial)throw r;return n||e.errors.push(r),r},i.prototype.wrapResult=function(t){var r=this._reporterState;return r.options.partial?{result:this.isError(t)?null:t,errors:r.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+\" at: \"+(this.path||\"(shallow)\"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(t,r,e){\"use strict\";function n(t){var r={};return Object.keys(t).forEach((function(e){(0|e)==e&&(e|=0);var n=t[e];r[n]=e})),r}e(17),e(147),e(172),r.tagClass={0:\"universal\",1:\"application\",2:\"context\",3:\"private\"},r.tagClassByName=n(r.tagClass),r.tag={0:\"end\",1:\"bool\",2:\"int\",3:\"bitstr\",4:\"octstr\",5:\"null_\",6:\"objid\",7:\"objDesc\",8:\"external\",9:\"real\",10:\"enum\",11:\"embed\",12:\"utf8str\",13:\"relativeOid\",16:\"seq\",17:\"set\",18:\"numstr\",19:\"printstr\",20:\"t61str\",21:\"videostr\",22:\"ia5str\",23:\"utctime\",24:\"gentime\",25:\"graphstr\",26:\"iso646str\",27:\"genstr\",28:\"unistr\",29:\"charstr\",30:\"bmpstr\"},r.tagByName=n(r.tag)},function(t,r){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e(\"Maximum allowed index exceeded\");return t}},function(t,r,e){\"use strict\";(function(t){var n=e(157),i=e(235),o=e(236);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(s()<r)throw new RangeError(\"Invalid typed array length\");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=a.prototype:(null===t&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,r,e);if(\"number\"==typeof t){if(\"string\"==typeof r)throw new Error(\"If encoding is specified then the first argument must be a string\");return c(this,t)}return h(this,t,r,e)}function h(t,r,e,n){if(\"number\"==typeof r)throw new TypeError('\"value\" argument must not be a number');return\"undefined\"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError(\"'offset' is out of bounds\");if(r.byteLength<e+(n||0))throw new RangeError(\"'length' is out of bounds\");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);a.TYPED_ARRAY_SUPPORT?(t=r).__proto__=a.prototype:t=l(t,r);return t}(t,r,e,n):\"string\"==typeof r?function(t,r,e){\"string\"==typeof e&&\"\"!==e||(e=\"utf8\");if(!a.isEncoding(e))throw new TypeError('\"encoding\" must be a valid string encoding');var n=0|d(r,e),i=(t=u(t,n)).write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(a.isBuffer(r)){var e=0|p(r.length);return 0===(t=u(t,e)).length||r.copy(t,0,0,e),t}if(r){if(\"undefined\"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||\"length\"in r)return\"number\"!=typeof r.length||(n=r.length)!=n?u(t,0):l(t,r);if(\"Buffer\"===r.type&&o(r.data))return l(t,r.data)}var n;throw new TypeError(\"First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\")}(t,r)}function f(t){if(\"number\"!=typeof t)throw new TypeError('\"size\" argument must be a number');if(t<0)throw new RangeError('\"size\" argument must not be negative')}function c(t,r){if(f(r),t=u(t,r<0?0:0|p(r)),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r){var e=r.length<0?0:0|p(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=s())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s().toString(16)+\" bytes\");return 0|t}function d(t,r){if(a.isBuffer(t))return t.length;if(\"undefined\"!=typeof ArrayBuffer&&\"function\"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case\"ascii\":case\"latin1\":case\"binary\":return e;case\"utf8\":case\"utf-8\":case void 0:return q(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*e;case\"hex\":return e>>>1;case\"base64\":return Y(t).length;default:if(n)return q(t).length;r=(\"\"+r).toLowerCase(),n=!0}}function v(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return\"\";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return\"\";if((e>>>=0)<=(r>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return R(this,r,e);case\"utf8\":case\"utf-8\":return _(this,r,e);case\"ascii\":return B(this,r,e);case\"latin1\":case\"binary\":return O(this,r,e);case\"base64\":return E(this,r,e);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return k(this,r,e);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function y(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,i){if(0===t.length)return-1;if(\"string\"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if(\"string\"==typeof r&&(r=a.from(r,n)),a.isBuffer(r))return 0===r.length?-1:m(t,r,e,n,i);if(\"number\"==typeof r)return r&=255,a.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):m(t,[r],e,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function m(t,r,e,n,i){var o,s=1,u=t.length,a=r.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||r.length<2)return-1;s=2,u/=2,a/=2,e/=2}function h(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(i){var f=-1;for(o=e;o<u;o++)if(h(t,o)===h(r,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===a)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(e+a>u&&(e=u-a),o=e;o>=0;o--){for(var c=!0,l=0;l<a;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function w(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(r.substr(2*s,2),16);if(isNaN(u))return s;t[e+s]=u}return s}function b(t,r,e,n){return z(q(r,t.length-e),t,e,n)}function M(t,r,e,n){return z(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function x(t,r,e,n){return M(t,r,e,n)}function T(t,r,e,n){return z(Y(r),t,e,n)}function A(t,r,e,n){return z(function(t,r){for(var e,n,i,o=[],s=0;s<t.length&&!((r-=2)<0);++s)n=(e=t.charCodeAt(s))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function E(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function _(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,s,u,a,h=t[i],f=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&h)<<6|63&o)>127&&(f=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(a=(15&h)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(a=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(f=a)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(t){var r=t.length;if(r<=S)return String.fromCharCode.apply(String,t);var e=\"\",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=S));return e}(n)}r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&\"function\"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=s(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,r,e){return h(null,t,r,e)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,\"undefined\"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,r,e){return function(t,r,e,n){return f(r),r<=0?u(t,r):void 0!==e?\"string\"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}(null,t,r,e)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,r){if(!a.isBuffer(t)||!a.isBuffer(r))throw new TypeError(\"Arguments must be Buffers\");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},a.concat=function(t,r){if(!o(t))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=a.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var s=t[e];if(!a.isBuffer(s))throw new TypeError('\"list\" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(var r=0;r<t;r+=2)y(this,r,r+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(var r=0;r<t;r+=4)y(this,r,r+3),y(this,r+1,r+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(var r=0;r<t;r+=8)y(this,r,r+7),y(this,r+1,r+6),y(this,r+2,r+5),y(this,r+3,r+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?\"\":0===arguments.length?_(this,0,t):v.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t=\"\",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString(\"hex\",0,e).match(/.{2}/g).join(\" \"),this.length>e&&(t+=\" ... \")),\"<Buffer \"+t+\">\"},a.prototype.compare=function(t,r,e,n,i){if(!a.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(e>>>=0)-(r>>>=0),u=Math.min(o,s),h=this.slice(n,i),f=t.slice(r,e),c=0;c<u;++c)if(h[c]!==f[c]){o=h[c],s=f[c];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},a.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},a.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},a.prototype.write=function(t,r,e,n){if(void 0===r)n=\"utf8\",e=this.length,r=0;else if(void 0===e&&\"string\"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");r|=0,isFinite(e)?(e|=0,void 0===n&&(n=\"utf8\")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return w(this,t,r,e);case\"utf8\":case\"utf-8\":return b(this,t,r,e);case\"ascii\":return M(this,t,r,e);case\"latin1\":case\"binary\":return x(this,t,r,e);case\"base64\":return T(this,t,r,e);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return A(this,t,r,e);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function B(t,r,e){var n=\"\";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,r,e){var n=\"\";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function R(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i=\"\",o=r;o<e;++o)i+=N(t[o]);return i}function k(t,r,e){for(var n=t.slice(r,e),i=\"\",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function F(t,r,e){if(t%1!=0||t<0)throw new RangeError(\"offset is not uint\");if(t+r>e)throw new RangeError(\"Trying to access beyond buffer length\")}function j(t,r,e,n,i,o){if(!a.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('\"value\" argument is out of bounds');if(e+n>t.length)throw new RangeError(\"Index out of range\")}function D(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function I(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function P(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError(\"Index out of range\");if(e<0)throw new RangeError(\"Index out of range\")}function C(t,r,e,n,o){return o||P(t,0,e,4),i.write(t,r,e,n,23,4),e+4}function L(t,r,e,n,o){return o||P(t,0,e,8),i.write(t,r,e,n,52,8),e+8}a.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),a.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=a.prototype;else{var i=r-t;e=new a(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},a.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},a.prototype.readUInt8=function(t,r){return r||F(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,r){return r||F(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,r){return r||F(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,r){return r||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,r){return r||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},a.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},a.prototype.readInt8=function(t,r){return r||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,r){r||F(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},a.prototype.readInt16BE=function(t,r){r||F(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},a.prototype.readInt32LE=function(t,r){return r||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,r){return r||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,r){return r||F(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,r){return r||F(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,r){return r||F(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,r){return r||F(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},a.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},a.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},a.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},a.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},a.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):I(this,t,r,!0),r+4},a.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):I(this,t,r,!1),r+4},a.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=0,s=1,u=0;for(this[r]=255&t;++o<e&&(s*=256);)t<0&&0===u&&0!==this[r+o-1]&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+e},a.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(this,t,r,e,i-1,-i)}var o=e-1,s=1,u=0;for(this[r+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+e},a.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},a.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},a.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},a.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):I(this,t,r,!0),r+4},a.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):I(this,t,r,!1),r+4},a.prototype.writeFloatLE=function(t,r,e){return C(this,t,r,!0,e)},a.prototype.writeFloatBE=function(t,r,e){return C(this,t,r,!1,e)},a.prototype.writeDoubleLE=function(t,r,e){return L(this,t,r,!0,e)},a.prototype.writeDoubleBE=function(t,r,e){return L(this,t,r,!1,e)},a.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError(\"targetStart out of bounds\");if(e<0||e>=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},a.prototype.fill=function(t,r,e,n){if(\"string\"==typeof t){if(\"string\"==typeof r?(n=r,r=0,e=this.length):\"string\"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!a.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n)}else\"number\"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError(\"Out of range index\");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),\"number\"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var s=a.isBuffer(t)?t:q(new a(t,n).toString()),u=s.length;for(o=0;o<e-r;++o)this[o+r]=s[o%u]}return this};var U=/[^+\\/0-9A-Za-z-_]/g;function N(t){return t<16?\"0\"+t.toString(16):t.toString(16)}function q(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((e=t.charCodeAt(s))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error(\"Invalid code point\");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Y(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,\"\")}(t).replace(U,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function z(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}}).call(this,e(148))},function(t,r,e){var n=e(9),i=e(127),o=e(11),s=e(10),u=e(18),a=e(149);r.f=n&&!i?Object.defineProperties:function(t,r){s(t);for(var e,n=u(r),i=a(r),h=i.length,f=0;h>f;)o.f(t,e=i[f++],n[e]);return t}},function(t,r,e){var n=e(7),i=e(4),o=e(8),s=TypeError;t.exports=function(t,r){var e,u;if(\"string\"===r&&i(e=t.toString)&&!o(u=n(e,t)))return u;if(i(e=t.valueOf)&&!o(u=n(e,t)))return u;if(\"string\"!==r&&i(e=t.toString)&&!o(u=n(e,t)))return u;throw s(\"Can't convert object to primitive value\")}},function(t,r){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},function(t,r,e){var n=e(2),i=e(4),o=n.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},function(t,r,e){\"use strict\";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);r.f=o?function(t){var r=i(this,t);return!!r&&r.enumerable}:n},function(t,r,e){var n=e(0),i=e(4),o=e(12),s=e(9),u=e(45).CONFIGURABLE,a=e(82),h=e(26),f=h.enforce,c=h.get,l=Object.defineProperty,p=s&&!n((function(){return 8!==l((function(){}),\"length\",{value:8}).length})),d=String(String).split(\"String\"),v=t.exports=function(t,r,e){\"Symbol(\"===String(r).slice(0,7)&&(r=\"[\"+String(r).replace(/^Symbol\\(([^)]*)\\)/,\"$1\")+\"]\"),e&&e.getter&&(r=\"get \"+r),e&&e.setter&&(r=\"set \"+r),(!o(t,\"name\")||u&&t.name!==r)&&(s?l(t,\"name\",{value:r,configurable:!0}):t.name=r),p&&e&&o(e,\"arity\")&&t.length!==e.arity&&l(t,\"length\",{value:e.arity});try{e&&o(e,\"constructor\")&&e.constructor?s&&l(t,\"prototype\",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=f(t);return o(n,\"source\")||(n.source=d.join(\"string\"==typeof r?r:\"\")),t};Function.prototype.toString=v((function(){return i(this)&&c(this).source||a(this)}),\"toString\")},function(t,r,e){var n=e(12),i=e(184),o=e(49),s=e(11);t.exports=function(t,r,e){for(var u=i(r),a=s.f,h=o.f,f=0;f<u.length;f++){var c=u[f];n(t,c)||e&&n(e,c)||a(t,c,h(r,c))}}},function(t,r,e){var n=e(28),i=e(1),o=e(50),s=e(185),u=e(10),a=i([].concat);t.exports=n(\"Reflect\",\"ownKeys\")||function(t){var r=o.f(u(t)),e=s.f;return e?a(r,e(t)):r}},function(t,r){r.f=Object.getOwnPropertySymbols},function(t,r,e){\"use strict\";var n=e(131).IteratorPrototype,i=e(38),o=e(43),s=e(51),u=e(42),a=function(){return this};t.exports=function(t,r,e,h){var f=r+\" Iterator\";return t.prototype=i(n,{next:o(+!h,e)}),s(t,f,!1,!0),u[f]=a,t}},function(t,r,e){var n=e(0);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,r,e){var n=e(4),i=String,o=TypeError;t.exports=function(t){if(\"object\"==typeof t||n(t))return t;throw o(\"Can't set \"+i(t)+\" as a prototype\")}},function(t,r){var e=Array,n=Math.abs,i=Math.pow,o=Math.floor,s=Math.log,u=Math.LN2;t.exports={pack:function(t,r,a){var h,f,c,l=e(a),p=8*a-r-1,d=(1<<p)-1,v=d>>1,y=23===r?i(2,-24)-i(2,-77):0,g=t<0||0===t&&1/t<0?1:0,m=0;for((t=n(t))!=t||t===1/0?(f=t!=t?1:0,h=d):(h=o(s(t)/u),t*(c=i(2,-h))<1&&(h--,c*=2),(t+=h+v>=1?y/c:y*i(2,1-v))*c>=2&&(h++,c/=2),h+v>=d?(f=0,h=d):h+v>=1?(f=(t*c-1)*i(2,r),h+=v):(f=t*i(2,v-1)*i(2,r),h=0));r>=8;)l[m++]=255&f,f/=256,r-=8;for(h=h<<r|f,p+=r;p>0;)l[m++]=255&h,h/=256,p-=8;return l[--m]|=128*g,l},unpack:function(t,r){var e,n=t.length,o=8*n-r-1,s=(1<<o)-1,u=s>>1,a=o-7,h=n-1,f=t[h--],c=127&f;for(f>>=7;a>0;)c=256*c+t[h--],a-=8;for(e=c&(1<<-a)-1,c>>=-a,a+=r;a>0;)e=256*e+t[h--],a-=8;if(0===c)c=1-u;else{if(c===s)return e?NaN:f?-1/0:1/0;e+=i(2,r),c-=u}return(f?-1:1)*e*i(2,c-r)}}},function(t,r,e){\"use strict\";var n=e(78),i=e(22);t.exports=n?{}.toString:function(){return\"[object \"+i(this)+\"]\"}},function(t,r,e){var n=e(8),i=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&i(t)===t}},function(t,r,e){var n=e(21),i=RangeError;t.exports=function(t){var r=n(t);if(r<0)throw i(\"The argument can't be less than 0\");return r}},function(t,r,e){var n=e(22),i=e(1)(\"\".slice);t.exports=function(t){return\"Big\"===i(n(t),0,3)}},function(t,r,e){var n=e(68),i=e(77),o=e(8),s=e(5)(\"species\"),u=Array;t.exports=function(t){var r;return n(t)&&(r=t.constructor,(i(r)&&(r===u||n(r.prototype))||o(r)&&null===(r=r[s]))&&(r=void 0)),void 0===r?u:r}},function(t,r,e){\"use strict\";var n=e(14),i=e(19),o=e(13),s=e(155),u=Math.min;t.exports=[].copyWithin||function(t,r){var e=n(this),a=o(e),h=i(t,a),f=i(r,a),c=arguments.length>2?arguments[2]:void 0,l=u((void 0===c?a:i(c,a))-f,a-h),p=1;for(f<h&&h<f+l&&(p=-1,f+=l-1,h+=l-1);l-- >0;)f in e?e[h]=e[f]:s(e,h),h+=p,f+=p;return e}},function(t,r,e){var n=e(197),i=e(56);t.exports=function(t,r){return n(i(t),r)}},function(t,r,e){var n=e(13);t.exports=function(t,r){for(var e=0,i=n(r),o=new t(i);i>e;)o[e]=r[e++];return o}},function(t,r,e){\"use strict\";var n=e(44),i=e(18),o=e(21),s=e(13),u=e(61),a=Math.min,h=[].lastIndexOf,f=!!h&&1/[1].lastIndexOf(1,-0)<0,c=u(\"lastIndexOf\"),l=f||!c;t.exports=l?function(t){if(f)return n(h,this,arguments)||0;var r=i(this),e=s(r),u=e-1;for(arguments.length>1&&(u=a(u,o(arguments[1]))),u<0&&(u=e+u);u>=0;u--)if(u in r&&r[u]===t)return u||0;return-1}:h},function(t,r,e){var n=e(70),i=Math.floor,o=function(t,r){var e=t.length,a=i(e/2);return e<8?s(t,r):u(t,o(n(t,0,a),r),o(n(t,a),r),r)},s=function(t,r){for(var e,n,i=t.length,o=1;o<i;){for(n=o,e=t[o];n&&r(t[n-1],e)>0;)t[n]=t[--n];n!==o++&&(t[n]=e)}return t},u=function(t,r,e,n){for(var i=r.length,o=e.length,s=0,u=0;s<i||u<o;)t[s+u]=s<i&&u<o?n(r[s],e[u])<=0?r[s++]:e[u++]:s<i?r[s++]:e[u++];return t};t.exports=o},function(t,r,e){var n=e(33).match(/firefox\\/(\\d+)/i);t.exports=!!n&&+n[1]},function(t,r,e){var n=e(33);t.exports=/MSIE|Trident/.test(n)},function(t,r,e){var n=e(33).match(/AppleWebKit\\/(\\d+)\\./);t.exports=!!n&&+n[1]},function(t,r,e){var n=e(2),i=e(0),o=e(1),s=e(24),u=e(204).trim,a=e(139),h=n.parseInt,f=n.Symbol,c=f&&f.iterator,l=/^[+-]?0x/i,p=o(l.exec),d=8!==h(a+\"08\")||22!==h(a+\"0x16\")||c&&!i((function(){h(Object(c))}));t.exports=d?function(t,r){var e=u(s(t));return h(e,r>>>0||(p(l,e)?16:10))}:h},function(t,r,e){var n=e(1),i=e(32),o=e(24),s=e(139),u=n(\"\".replace),a=\"[\"+s+\"]\",h=RegExp(\"^\"+a+a+\"*\"),f=RegExp(a+a+\"*$\"),c=function(t){return function(r){var e=o(i(r));return 1&t&&(e=u(e,h,\"\")),2&t&&(e=u(e,f,\"\")),e}};t.exports={start:c(1),end:c(2),trim:c(3)}},function(t,r,e){var n=e(7),i=e(12),o=e(34),s=e(156),u=RegExp.prototype;t.exports=function(t){var r=t.flags;return void 0!==r||\"flags\"in u||i(t,\"flags\")||!o(u,t)?r:n(s,t)}},function(t,r,e){\"use strict\";var n=e(6),i=e(122).codeAt;n({target:\"String\",proto:!0},{codePointAt:function(t){return i(this,t)}})},function(t,r,e){var n=e(6),i=e(1),o=e(19),s=RangeError,u=String.fromCharCode,a=String.fromCodePoint,h=i([].join);n({target:\"String\",stat:!0,arity:1,forced:!!a&&1!=a.length},{fromCodePoint:function(t){for(var r,e=[],n=arguments.length,i=0;n>i;){if(r=+arguments[i++],o(r,1114111)!==r)throw s(r+\" is not a valid code point\");e[i]=r<65536?u(r):u(55296+((r-=65536)>>10),r%1024+56320)}return h(e,\"\")}})},function(t,r,e){var n=e(8),i=e(29),o=e(5)(\"match\");t.exports=function(t){var r;return n(t)&&(void 0!==(r=t[o])?!!r:\"RegExp\"==i(t))}},function(t,r,e){\"use strict\";var n=e(37),i=n(e(64)),o=n(e(65)),s=e(141).BigInteger,u=e(142),a=function(){function t(r,e,n){(0,i.default)(this,t),\"string\"==typeof r&&\"string\"==typeof e?(this.X=new s(r,16),this.Y=new s(e,16)):(this.X=r,this.Y=e),this.Z=null==n?s.ONE:n,this.zinv=null,this.curve=new u}return(0,o.default)(t,[{key:\"getX\",value:function(){return null===this.zinv&&(this.zinv=this.Z.modInverse(this.curve.p)),this.X.multiply(this.zinv).mod(this.curve.p)}},{key:\"getY\",value:function(){return null===this.zinv&&(this.zinv=this.Z.modInverse(this.curve.p)),this.Y.multiply(this.zinv).mod(this.curve.p)}},{key:\"isInfinity\",value:function(){return null===this.X&&null===this.Y||this.Z.equals(s.ZERO)&&!this.Y.equals(s.ZERO)}}]),t}();t.exports=a},function(t,r,e){\"use strict\";var n=e(37);e(27),e(39);var i=n(e(163));t.exports={normalize:function(t){var r=(0,i.default)(t);if(r.length>32)r=r.slice(r.length-32,r.length);else if(r.length<32)for(var e=0;e<32-r.length;e++)r.unshift(0);return r},leftPad:function(t,r){return t.length>=r?t:new Array(r-t.length+1).join(\"0\")+t}}},function(t,r,e){var n=e(6),i=e(1),o=e(60),s=e(8),u=e(12),a=e(11).f,h=e(50),f=e(246),c=e(247),l=e(59),p=e(249),d=!1,v=l(\"meta\"),y=0,g=function(t){a(t,v,{value:{objectID:\"O\"+y++,weakData:{}}})},m=t.exports={enable:function(){m.enable=function(){},d=!0;var t=h.f,r=i([].splice),e={};e[v]=1,t(e).length&&(h.f=function(e){for(var n=t(e),i=0,o=n.length;i<o;i++)if(n[i]===v){r(n,i,1);break}return n},n({target:\"Object\",stat:!0,forced:!0},{getOwnPropertyNames:f.f}))},fastKey:function(t,r){if(!s(t))return\"symbol\"==typeof t?t:(\"string\"==typeof t?\"S\":\"P\")+t;if(!u(t,v)){if(!c(t))return\"F\";if(!r)return\"E\";g(t)}return t[v].objectID},getWeakData:function(t,r){if(!u(t,v)){if(!c(t))return!0;if(!r)return!1;g(t)}return t[v].weakData},onFreeze:function(t){return p&&d&&c(t)&&!u(t,v)&&g(t),t}};o[v]=!0},function(t,r){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,r,e){var n=e(69)(\"span\").classList,i=n&&n.constructor&&n.constructor.prototype;t.exports=i===Object.prototype?void 0:i},function(t,r,e){(function(t){!function(t,r){\"use strict\";function n(t,r){if(!t)throw new Error(r||\"Assertion failed\")}function i(t,r){t.super_=r;var e=function(){};e.prototype=r.prototype,t.prototype=new e,t.prototype.constructor=t}function o(t,r,e){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(\"le\"!==r&&\"be\"!==r||(e=r,r=10),this._init(t||0,r||10,e||\"be\"))}var s;\"object\"==typeof t?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s=\"undefined\"!=typeof window&&void 0!==window.Buffer?window.Buffer:e(254).Buffer}catch(t){}function u(t,r){var e=t.charCodeAt(r);return e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:e-48&15}function a(t,r,e){var n=u(t,e);return e-1>=r&&(n|=u(t,e-1)<<4),n}function h(t,r,e,n){for(var i=0,o=Math.min(t.length,e),s=r;s<o;s++){var u=t.charCodeAt(s)-48;i*=n,i+=u>=49?u-49+10:u>=17?u-17+10:u}return i}o.isBN=function(t){return t instanceof o||null!==t&&\"object\"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,r){return t.cmp(r)>0?t:r},o.min=function(t,r){return t.cmp(r)<0?t:r},o.prototype._init=function(t,r,e){if(\"number\"==typeof t)return this._initNumber(t,r,e);if(\"object\"==typeof t)return this._initArray(t,r,e);\"hex\"===r&&(r=16),n(r===(0|r)&&r>=2&&r<=36);var i=0;\"-\"===(t=t.toString().replace(/\\s+/g,\"\"))[0]&&(i++,this.negative=1),i<t.length&&(16===r?this._parseHex(t,i,e):(this._parseBase(t,r,i),\"le\"===e&&this._initArray(this.toArray(),r,e)))},o.prototype._initNumber=function(t,r,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),\"le\"===e&&this._initArray(this.toArray(),r,e)},o.prototype._initArray=function(t,r,e){if(n(\"number\"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,u=0;if(\"be\"===e)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<u&67108863,this.words[o+1]=s>>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if(\"le\"===e)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<u&67108863,this.words[o+1]=s>>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,r,e){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if(\"be\"===e)for(n=t.length-1;n>=r;n-=2)i=a(t,r,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-r)%2==0?r+1:r;n<t.length;n+=2)i=a(t,r,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,r,e){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=r)n++;n--,i=i/r|0;for(var o=t.length-e,s=o%n,u=Math.min(o,o-s)+e,a=0,f=e;f<u;f+=n)a=h(t,f,f+n,r),this.imuln(i),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==s){var c=1;for(a=h(t,f,t.length,r),f=0;f<s;f++)c*=r;this.imuln(c),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?\"<BN-R: \":\"<BN: \")+this.toString(16)+\">\"};var f=[\"\",\"0\",\"00\",\"000\",\"0000\",\"00000\",\"000000\",\"0000000\",\"00000000\",\"000000000\",\"0000000000\",\"00000000000\",\"000000000000\",\"0000000000000\",\"00000000000000\",\"000000000000000\",\"0000000000000000\",\"00000000000000000\",\"000000000000000000\",\"0000000000000000000\",\"00000000000000000000\",\"000000000000000000000\",\"0000000000000000000000\",\"00000000000000000000000\",\"000000000000000000000000\",\"0000000000000000000000000\"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,r,e){e.negative=r.negative^t.negative;var n=t.length+r.length|0;e.length=n,n=n-1|0;var i=0|t.words[0],o=0|r.words[0],s=i*o,u=67108863&s,a=s/67108864|0;e.words[0]=u;for(var h=1;h<n;h++){for(var f=a>>>26,c=67108863&a,l=Math.min(h,r.length-1),p=Math.max(0,h-t.length+1);p<=l;p++){var d=h-p|0;f+=(s=(i=0|t.words[d])*(o=0|r.words[p])+c)/67108864|0,c=67108863&s}e.words[h]=0|c,a=0|f}return 0!==a?e.words[h]=0|a:e.length--,e.strip()}o.prototype.toString=function(t,r){var e;if(r=0|r||1,16===(t=t||10)||\"hex\"===t){e=\"\";for(var i=0,o=0,s=0;s<this.length;s++){var u=this.words[s],a=(16777215&(u<<i|o)).toString(16);e=0!==(o=u>>>24-i&16777215)||s!==this.length-1?f[6-a.length]+a+e:a+e,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(e=o.toString(16)+e);e.length%r!=0;)e=\"0\"+e;return 0!==this.negative&&(e=\"-\"+e),e}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],p=l[t];e=\"\";var d=this.clone();for(d.negative=0;!d.isZero();){var v=d.modn(p).toString(t);e=(d=d.idivn(p)).isZero()?v+e:f[h-v.length]+v+e}for(this.isZero()&&(e=\"0\"+e);e.length%r!=0;)e=\"0\"+e;return 0!==this.negative&&(e=\"-\"+e),e}n(!1,\"Base should be between 2 and 36\")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,\"Number can only safely store up to 53 bits\"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,r){return n(void 0!==s),this.toArrayLike(s,t,r)},o.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},o.prototype.toArrayLike=function(t,r,e){var i=this.byteLength(),o=e||Math.max(1,i);n(i<=o,\"byte array longer than desired length\"),n(o>0,\"Requested array length <= 0\"),this.strip();var s,u,a=\"le\"===r,h=new t(o),f=this.clone();if(a){for(u=0;!f.isZero();u++)s=f.andln(255),f.iushrn(8),h[u]=s;for(;u<o;u++)h[u]=0}else{for(u=0;u<o-i;u++)h[u]=0;for(u=0;!f.isZero();u++)s=f.andln(255),f.iushrn(8),h[o-u-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var r=t,e=0;return r>=4096&&(e+=13,r>>>=13),r>=64&&(e+=7,r>>>=7),r>=8&&(e+=4,r>>>=4),r>=2&&(e+=2,r>>>=2),e+r},o.prototype._zeroBits=function(t){if(0===t)return 26;var r=t,e=0;return 0==(8191&r)&&(e+=13,r>>>=13),0==(127&r)&&(e+=7,r>>>=7),0==(15&r)&&(e+=4,r>>>=4),0==(3&r)&&(e+=2,r>>>=2),0==(1&r)&&e++,e},o.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return 26*(this.length-1)+r},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var e=this._zeroBits(this.words[r]);if(t+=e,26!==e)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var r;r=this.length>t.length?t:this;for(var e=0;e<r.length;e++)this.words[e]=this.words[e]&t.words[e];return this.length=r.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var r,e;this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0;n<e.length;n++)this.words[n]=r.words[n]^e.words[n];if(this!==r)for(;n<r.length;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n(\"number\"==typeof t&&t>=0);var r=0|Math.ceil(t/26),e=t%26;this._expand(r),e>0&&r--;for(var i=0;i<r;i++)this.words[i]=67108863&~this.words[i];return e>0&&(this.words[i]=~this.words[i]&67108863>>26-e),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,r){n(\"number\"==typeof t&&t>=0);var e=t/26|0,i=t%26;return this._expand(e+1),this.words[e]=r?this.words[e]|1<<i:this.words[e]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var r,e,n;if(0!==this.negative&&0===t.negative)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();this.length>t.length?(e=this,n=t):(e=t,n=this);for(var i=0,o=0;o<n.length;o++)r=(0|e.words[o])+(0|n.words[o])+i,this.words[o]=67108863&r,i=r>>>26;for(;0!==i&&o<e.length;o++)r=(0|e.words[o])+i,this.words[o]=67108863&r,i=r>>>26;if(this.length=e.length,0!==i)this.words[this.length]=i,this.length++;else if(e!==this)for(;o<e.length;o++)this.words[o]=e.words[o];return this},o.prototype.add=function(t){var r;return 0!==t.negative&&0===this.negative?(t.negative=0,r=this.sub(t),t.negative^=1,r):0===t.negative&&0!==this.negative?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var e,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,n=t):(e=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(r=(0|e.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&r;for(;0!==o&&s<e.length;s++)o=(r=(0|e.words[s])+o)>>26,this.words[s]=67108863&r;if(0===o&&s<e.length&&e!==this)for(;s<e.length;s++)this.words[s]=e.words[s];return this.length=Math.max(this.length,s),e!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,r,e){var n,i,o,s=t.words,u=r.words,a=e.words,h=0,f=0|s[0],c=8191&f,l=f>>>13,p=0|s[1],d=8191&p,v=p>>>13,y=0|s[2],g=8191&y,m=y>>>13,w=0|s[3],b=8191&w,M=w>>>13,x=0|s[4],T=8191&x,A=x>>>13,E=0|s[5],_=8191&E,S=E>>>13,B=0|s[6],O=8191&B,R=B>>>13,k=0|s[7],F=8191&k,j=k>>>13,D=0|s[8],I=8191&D,P=D>>>13,C=0|s[9],L=8191&C,U=C>>>13,N=0|u[0],q=8191&N,Y=N>>>13,z=0|u[1],V=8191&z,Z=z>>>13,G=0|u[2],K=8191&G,W=G>>>13,X=0|u[3],H=8191&X,$=X>>>13,J=0|u[4],Q=8191&J,tt=J>>>13,rt=0|u[5],et=8191&rt,nt=rt>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,ft=0|u[8],ct=8191&ft,lt=ft>>>13,pt=0|u[9],dt=8191&pt,vt=pt>>>13;e.negative=t.negative^r.negative,e.length=19;var yt=(h+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,Y))+Math.imul(l,q)|0))<<13)|0;h=((o=Math.imul(l,Y))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(d,q),i=(i=Math.imul(d,Y))+Math.imul(v,q)|0,o=Math.imul(v,Y);var gt=(h+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,Z)|0)+Math.imul(l,V)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,q),i=(i=Math.imul(g,Y))+Math.imul(m,q)|0,o=Math.imul(m,Y),n=n+Math.imul(d,V)|0,i=(i=i+Math.imul(d,Z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Z)|0;var mt=(h+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,K)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,Y))+Math.imul(M,q)|0,o=Math.imul(M,Y),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(d,K)|0,i=(i=i+Math.imul(d,W)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,W)|0;var wt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(l,H)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,Y))+Math.imul(A,q)|0,o=Math.imul(A,Y),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,$)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,$)|0;var bt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,Y))+Math.imul(S,q)|0,o=Math.imul(S,Y),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,$)|0,n=n+Math.imul(d,Q)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var Mt=(h+(n=n+Math.imul(c,et)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,et)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,Y))+Math.imul(R,q)|0,o=Math.imul(R,Y),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(d,et)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(v,et)|0,o=o+Math.imul(v,nt)|0;var xt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,Y))+Math.imul(j,q)|0,o=Math.imul(j,Y),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(g,et)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(m,et)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(d,ot)|0,i=(i=i+Math.imul(d,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(l,at)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,Y))+Math.imul(P,q)|0,o=Math.imul(P,Y),n=n+Math.imul(F,V)|0,i=(i=i+Math.imul(F,Z)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Z)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(b,et)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(M,et)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,Y))+Math.imul(U,q)|0,o=Math.imul(U,Y),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(F,K)|0,i=(i=i+Math.imul(F,W)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,et)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(A,et)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0,n=n+Math.imul(d,ct)|0,i=(i=i+Math.imul(d,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(n=n+Math.imul(c,dt)|0)|0)+((8191&(i=(i=i+Math.imul(c,vt)|0)+Math.imul(l,dt)|0))<<13)|0;h=((o=o+Math.imul(l,vt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,Z))+Math.imul(U,V)|0,o=Math.imul(U,Z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(F,H)|0,i=(i=i+Math.imul(F,$)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,$)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(_,et)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(S,et)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(M,at)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var _t=(h+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,vt)|0)+Math.imul(v,dt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,W))+Math.imul(U,K)|0,o=Math.imul(U,W),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(F,Q)|0,i=(i=i+Math.imul(F,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(O,et)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(R,et)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(b,ct)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var St=(h+(n=n+Math.imul(g,dt)|0)|0)+((8191&(i=(i=i+Math.imul(g,vt)|0)+Math.imul(m,dt)|0))<<13)|0;h=((o=o+Math.imul(m,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,H),i=(i=Math.imul(L,$))+Math.imul(U,H)|0,o=Math.imul(U,$),n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(F,et)|0,i=(i=i+Math.imul(F,nt)|0)+Math.imul(j,et)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,lt)|0;var Bt=(h+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,vt)|0)+Math.imul(M,dt)|0))<<13)|0;h=((o=o+Math.imul(M,vt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),n=n+Math.imul(I,et)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,et)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(F,ot)|0,i=(i=i+Math.imul(F,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,lt)|0;var Ot=(h+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(A,dt)|0))<<13)|0;h=((o=o+Math.imul(A,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,et),i=(i=Math.imul(L,nt))+Math.imul(U,et)|0,o=Math.imul(U,nt),n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(F,at)|0,i=(i=i+Math.imul(F,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Rt=(h+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(S,dt)|0))<<13)|0;h=((o=o+Math.imul(S,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,at)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(F,ct)|0,i=(i=i+Math.imul(F,lt)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,lt)|0;var kt=(h+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,vt)|0)+Math.imul(R,dt)|0))<<13)|0;h=((o=o+Math.imul(R,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,at),i=(i=Math.imul(L,ht))+Math.imul(U,at)|0,o=Math.imul(U,ht),n=n+Math.imul(I,ct)|0,i=(i=i+Math.imul(I,lt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,lt)|0;var Ft=(h+(n=n+Math.imul(F,dt)|0)|0)+((8191&(i=(i=i+Math.imul(F,vt)|0)+Math.imul(j,dt)|0))<<13)|0;h=((o=o+Math.imul(j,vt)|0)+(i>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,n=Math.imul(L,ct),i=(i=Math.imul(L,lt))+Math.imul(U,ct)|0,o=Math.imul(U,lt);var jt=(h+(n=n+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,vt)|0)+Math.imul(P,dt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Dt=(h+(n=Math.imul(L,dt))|0)+((8191&(i=(i=Math.imul(L,vt))+Math.imul(U,dt)|0))<<13)|0;return h=((o=Math.imul(U,vt))+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,a[0]=yt,a[1]=gt,a[2]=mt,a[3]=wt,a[4]=bt,a[5]=Mt,a[6]=xt,a[7]=Tt,a[8]=At,a[9]=Et,a[10]=_t,a[11]=St,a[12]=Bt,a[13]=Ot,a[14]=Rt,a[15]=kt,a[16]=Ft,a[17]=jt,a[18]=Dt,0!==h&&(a[19]=h,e.length++),e};function v(t,r,e){return(new y).mulp(t,r,e)}function y(t,r){this.x=t,this.y=r}Math.imul||(d=p),o.prototype.mulTo=function(t,r){var e,n=this.length+t.length;return e=10===this.length&&10===t.length?d(this,t,r):n<63?p(this,t,r):n<1024?function(t,r,e){e.negative=r.negative^t.negative,e.length=t.length+r.length;for(var n=0,i=0,o=0;o<e.length-1;o++){var s=i;i=0;for(var u=67108863&n,a=Math.min(o,r.length-1),h=Math.max(0,o-t.length+1);h<=a;h++){var f=o-h,c=(0|t.words[f])*(0|r.words[h]),l=67108863&c;u=67108863&(l=l+u|0),i+=(s=(s=s+(c/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}e.words[o]=u,n=s,s=i}return 0!==n?e.words[o]=n:e.length--,e.strip()}(this,t,r):v(this,t,r),e},y.prototype.makeRBT=function(t){for(var r=new Array(t),e=o.prototype._countBits(t)-1,n=0;n<t;n++)r[n]=this.revBin(n,e,t);return r},y.prototype.revBin=function(t,r,e){if(0===t||t===e-1)return t;for(var n=0,i=0;i<r;i++)n|=(1&t)<<r-i-1,t>>=1;return n},y.prototype.permute=function(t,r,e,n,i,o){for(var s=0;s<o;s++)n[s]=r[t[s]],i[s]=e[t[s]]},y.prototype.transform=function(t,r,e,n,i,o){this.permute(o,t,r,e,n,i);for(var s=1;s<i;s<<=1)for(var u=s<<1,a=Math.cos(2*Math.PI/u),h=Math.sin(2*Math.PI/u),f=0;f<i;f+=u)for(var c=a,l=h,p=0;p<s;p++){var d=e[f+p],v=n[f+p],y=e[f+p+s],g=n[f+p+s],m=c*y-l*g;g=c*g+l*y,y=m,e[f+p]=d+y,n[f+p]=v+g,e[f+p+s]=d-y,n[f+p+s]=v-g,p!==u&&(m=a*c-h*l,l=a*l+h*c,c=m)}},y.prototype.guessLen13b=function(t,r){var e=1|Math.max(r,t),n=1&e,i=0;for(e=e/2|0;e;e>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,r,e){if(!(e<=1))for(var n=0;n<e/2;n++){var i=t[n];t[n]=t[e-n-1],t[e-n-1]=i,i=r[n],r[n]=-r[e-n-1],r[e-n-1]=-i}},y.prototype.normalize13b=function(t,r){for(var e=0,n=0;n<r/2;n++){var i=8192*Math.round(t[2*n+1]/r)+Math.round(t[2*n]/r)+e;t[n]=67108863&i,e=i<67108864?0:i/67108864|0}return t},y.prototype.convert13b=function(t,r,e,i){for(var o=0,s=0;s<r;s++)o+=0|t[s],e[2*s]=8191&o,o>>>=13,e[2*s+1]=8191&o,o>>>=13;for(s=2*r;s<i;++s)e[s]=0;n(0===o),n(0==(-8192&o))},y.prototype.stub=function(t){for(var r=new Array(t),e=0;e<t;e++)r[e]=0;return r},y.prototype.mulp=function(t,r,e){var n=2*this.guessLen13b(t.length,r.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),u=new Array(n),a=new Array(n),h=new Array(n),f=new Array(n),c=new Array(n),l=e.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(r.words,r.length,h,n),this.transform(s,o,u,a,n,i),this.transform(h,o,f,c,n,i);for(var p=0;p<n;p++){var d=u[p]*f[p]-a[p]*c[p];a[p]=u[p]*c[p]+a[p]*f[p],u[p]=d}return this.conjugate(u,a,n),this.transform(u,a,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),e.negative=t.negative^r.negative,e.length=t.length+r.length,e.strip()},o.prototype.mul=function(t){var r=new o(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},o.prototype.mulf=function(t){var r=new o(null);return r.words=new Array(this.length+t.length),v(this,t,r)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n(\"number\"==typeof t),n(t<67108864);for(var r=0,e=0;e<this.length;e++){var i=(0|this.words[e])*t,o=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=o>>>26,this.words[e]=67108863&o}return 0!==r&&(this.words[e]=r,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var r=function(t){for(var r=new Array(t.bitLength()),e=0;e<r.length;e++){var n=e/26|0,i=e%26;r[e]=(t.words[n]&1<<i)>>>i}return r}(t);if(0===r.length)return new o(1);for(var e=this,n=0;n<r.length&&0===r[n];n++,e=e.sqr());if(++n<r.length)for(var i=e.sqr();n<r.length;n++,i=i.sqr())0!==r[n]&&(e=e.mul(i));return e},o.prototype.iushln=function(t){n(\"number\"==typeof t&&t>=0);var r,e=t%26,i=(t-e)/26,o=67108863>>>26-e<<26-e;if(0!==e){var s=0;for(r=0;r<this.length;r++){var u=this.words[r]&o,a=(0|this.words[r])-u<<e;this.words[r]=a|s,s=u>>>26-e}s&&(this.words[r]=s,this.length++)}if(0!==i){for(r=this.length-1;r>=0;r--)this.words[r+i]=this.words[r];for(r=0;r<i;r++)this.words[r]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,r,e){var i;n(\"number\"==typeof t&&t>=0),i=r?(r-r%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<<o,a=e;if(i-=s,i=Math.max(0,i),a){for(var h=0;h<s;h++)a.words[h]=this.words[h];a.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=i);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&u}return a&&0!==f&&(a.words[a.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,r,e){return n(0===this.negative),this.iushrn(t,r,e)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n(\"number\"==typeof t&&t>=0);var r=t%26,e=(t-r)/26,i=1<<r;return!(this.length<=e)&&!!(this.words[e]&i)},o.prototype.imaskn=function(t){n(\"number\"==typeof t&&t>=0);var r=t%26,e=(t-r)/26;if(n(0===this.negative,\"imaskn works only with positive numbers\"),this.length<=e)return this;if(0!==r&&e++,this.length=Math.min(e,this.length),0!==r){var i=67108863^67108863>>>r<<r;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n(\"number\"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function(t){if(n(\"number\"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,r,e){var i,o,s=t.length+e;this._expand(s);var u=0;for(i=0;i<t.length;i++){o=(0|this.words[i+e])+u;var a=(0|t.words[i])*r;u=((o-=67108863&a)>>26)-(a/67108864|0),this.words[i+e]=67108863&o}for(;i<this.length-e;i++)u=(o=(0|this.words[i+e])+u)>>26,this.words[i+e]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i<this.length;i++)u=(o=-(0|this.words[i])+u)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,r){var e=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(e=26-this._countBits(s))&&(i=i.ushln(e),n.iushln(e),s=0|i.words[i.length-1]);var u,a=n.length-i.length;if(\"mod\"!==r){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h<u.length;h++)u.words[h]=0}var f=n.clone()._ishlnsubmul(i,1,a);0===f.negative&&(n=f,u&&(u.words[a]=1));for(var c=a-1;c>=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=l)}return u&&u.strip(),n.strip(),\"div\"!==r&&0!==e&&n.iushrn(e),{div:u||null,mod:n}},o.prototype.divmod=function(t,r,e){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,r),\"mod\"!==r&&(i=u.div.neg()),\"div\"!==r&&(s=u.mod.neg(),e&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),r),\"mod\"!==r&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),r),\"div\"!==r&&(s=u.mod.neg(),e&&0!==s.negative&&s.isub(t)),{div:u.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?\"div\"===r?{div:this.divn(t.words[0]),mod:null}:\"mod\"===r?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,r);var i,s,u},o.prototype.div=function(t){return this.divmod(t,\"div\",!1).div},o.prototype.mod=function(t){return this.divmod(t,\"mod\",!1).mod},o.prototype.umod=function(t){return this.divmod(t,\"mod\",!0).mod},o.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var e=0!==r.div.negative?r.mod.isub(t):r.mod,n=t.ushrn(1),i=t.andln(1),o=e.cmp(n);return o<0||1===i&&0===o?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var r=(1<<26)%t,e=0,i=this.length-1;i>=0;i--)e=(r*e+(0|this.words[i]))%t;return e},o.prototype.idivn=function(t){n(t<=67108863);for(var r=0,e=this.length-1;e>=0;e--){var i=(0|this.words[e])+67108864*r;this.words[e]=i/t|0,r=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var r=this,e=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;r.isEven()&&e.isEven();)r.iushrn(1),e.iushrn(1),++h;for(var f=e.clone(),c=r.clone();!r.isZero();){for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(f),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var d=0,v=1;0==(e.words[0]&v)&&d<26;++d,v<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(f),a.isub(c)),u.iushrn(1),a.iushrn(1);r.cmp(e)>=0?(r.isub(e),i.isub(u),s.isub(a)):(e.isub(r),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:e.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var r=this,e=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var i,s=new o(1),u=new o(0),a=e.clone();r.cmpn(1)>0&&e.cmpn(1)>0;){for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);r.cmp(e)>=0?(r.isub(e),s.isub(u)):(e.isub(r),u.isub(s))}return(i=0===r.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),e=t.clone();r.negative=0,e.negative=0;for(var n=0;r.isEven()&&e.isEven();n++)r.iushrn(1),e.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;e.isEven();)e.iushrn(1);var i=r.cmp(e);if(i<0){var o=r;r=e,e=o}else if(0===i||0===e.cmpn(1))break;r.isub(e)}return e.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n(\"number\"==typeof t);var r=t%26,e=(t-r)/26,i=1<<r;if(this.length<=e)return this._expand(e+1),this.words[e]|=i,this;for(var o=i,s=e;0!==o&&s<this.length;s++){var u=0|this.words[s];o=(u+=o)>>>26,u&=67108863,this.words[s]=u}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var r,e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;if(this.strip(),this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,\"Number is too big\");var i=0|this.words[0];r=i===t?0:i<t?-1:1}return 0!==this.negative?0|-r:r},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var r=this.ucmp(t);return 0!==this.negative?0|-r:r},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,e=this.length-1;e>=0;e--){var n=0|this.words[e],i=0|t.words[e];if(n!==i){n<i?r=-1:n>i&&(r=1);break}}return r},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return n(!this.red,\"Already a number in reduction context\"),n(0===this.negative,\"red works only with positives\"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,\"Already a number in reduction context\"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,\"redAdd works only with red numbers\"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,\"redSub works only with red numbers\"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,\"redISub works only with red numbers\"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,\"redShl works only with red numbers\"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function m(t,r){this.name=t,this.p=new o(r,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){m.call(this,\"k256\",\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\")}function b(){m.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function M(){m.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function x(){m.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function T(t){if(\"string\"==typeof t){var r=o._prime(t);this.m=r.p,this.prime=r}else n(t.gtn(1),\"modulus must be greater than 1\"),this.m=t,this.prime=null}function A(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var r,e=t;do{this.split(e,this.tmp),r=(e=(e=this.imulK(e)).iadd(this.tmp)).bitLength()}while(r>this.n);var n=r<this.n?-1:e.ucmp(this.p);return 0===n?(e.words[0]=0,e.length=1):n>0?e.isub(this.p):void 0!==e.strip?e.strip():e._strip(),e},m.prototype.split=function(t,r){t.iushrn(this.n,0,r)},m.prototype.imulK=function(t){return t.imul(this.k)},i(w,m),w.prototype.split=function(t,r){for(var e=4194303,n=Math.min(t.length,9),i=0;i<n;i++)r.words[i]=t.words[i];if(r.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(r.words[r.length++]=o&e,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&e)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,e=0;e<t.length;e++){var n=0|t.words[e];r+=977*n,t.words[e]=67108863&r,r=64*n+(r/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(b,m),i(M,m),i(x,m),x.prototype.imulK=function(t){for(var r=0,e=0;e<t.length;e++){var n=19*(0|t.words[e])+r,i=67108863&n;n>>>=26,t.words[e]=i,r=n}return 0!==r&&(t.words[t.length++]=r),t},o._prime=function(t){if(g[t])return g[t];var r;if(\"k256\"===t)r=new w;else if(\"p224\"===t)r=new b;else if(\"p192\"===t)r=new M;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);r=new x}return g[t]=r,r},T.prototype._verify1=function(t){n(0===t.negative,\"red works only with positives\"),n(t.red,\"red works only with red numbers\")},T.prototype._verify2=function(t,r){n(0==(t.negative|r.negative),\"red works only with positives\"),n(t.red&&t.red===r.red,\"red works only with red numbers\")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,r){this._verify2(t,r);var e=t.add(r);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},T.prototype.iadd=function(t,r){this._verify2(t,r);var e=t.iadd(r);return e.cmp(this.m)>=0&&e.isub(this.m),e},T.prototype.sub=function(t,r){this._verify2(t,r);var e=t.sub(r);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},T.prototype.isub=function(t,r){this._verify2(t,r);var e=t.isub(r);return e.cmpn(0)<0&&e.iadd(this.m),e},T.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},T.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},T.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(n(r%2==1),3===r){var e=this.m.add(new o(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(a);)f.redIAdd(a);for(var c=this.pow(f,i),l=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=s;0!==p.cmp(u);){for(var v=p,y=0;0!==v.cmp(u);y++)v=v.redSqr();n(y<d);var g=this.pow(c,new o(1).iushln(d-y-1));l=l.redMul(g),c=g.redSqr(),p=p.redMul(c),d=y}return l},T.prototype.invm=function(t){var r=t._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},T.prototype.pow=function(t,r){if(r.isZero())return new o(1).toRed(this);if(0===r.cmpn(1))return t.clone();var e=new Array(16);e[0]=new o(1).toRed(this),e[1]=t;for(var n=2;n<e.length;n++)e[n]=this.mul(e[n-1],t);var i=e[0],s=0,u=0,a=r.bitLength()%26;for(0===a&&(a=26),n=r.length-1;n>=0;n--){for(var h=r.words[n],f=a-1;f>=0;f--){var c=h>>f&1;i!==e[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===f)&&(i=this.mul(i,e[s]),u=0,s=0)):u=0}a=26}return i},T.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},T.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},o.mont=function(t){return new A(t)},i(A,T),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},A.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var e=t.imul(r),n=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new o(0)._forceRed(this);var e=t.mul(r),n=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=e.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,e(253)(t))},function(t,r,e){\"use strict\";var n=r;n.der=e(216),n.pem=e(279)},function(t,r,e){\"use strict\";e(145),e(39),e(86),e(218),e(27),e(258),e(17),e(260);var n=e(58),i=e(170).Buffer,o=e(171),s=e(174);function u(t){this.enc=\"der\",this.name=t.name,this.entity=t,this.tree=new a,this.tree._init(t.body)}function a(t){o.call(this,\"der\",t)}function h(t){return t<10?\"0\"+t:t}t.exports=u,u.prototype.encode=function(t,r){return this.tree._encode(t,r).join()},n(a,o),a.prototype._encodeComposite=function(t,r,e,n){var o=function(t,r,e,n){var i;\"seqof\"===t?t=\"seq\":\"setof\"===t&&(t=\"set\");if(s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if(\"number\"!=typeof t||(0|t)!==t)return n.error(\"Unknown tag: \"+t);i=t}if(i>=31)return n.error(\"Multi-octet tag encoding unsupported\");r||(i|=32);return i|=s.tagClassByName[e||\"universal\"]<<6}(t,r,e,this.reporter);if(n.length<128){var u=i.alloc(2);return u[0]=o,u[1]=n.length,this._createEncoderBuffer([u,n])}for(var a=1,h=n.length;h>=256;h>>=8)a++;var f=i.alloc(2+a);f[0]=o,f[1]=128|a;for(var c=1+a,l=n.length;l>0;c--,l>>=8)f[c]=255&l;return this._createEncoderBuffer([f,n])},a.prototype._encodeStr=function(t,r){if(\"bitstr\"===r)return this._createEncoderBuffer([0|t.unused,t.data]);if(\"bmpstr\"===r){for(var e=i.alloc(2*t.length),n=0;n<t.length;n++)e.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(e)}return\"numstr\"===r?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error(\"Encoding of string type: numstr supports only digits and space\"):\"printstr\"===r?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error(\"Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark\"):/str$/.test(r)||\"objDesc\"===r?this._createEncoderBuffer(t):this.reporter.error(\"Encoding of string type: \"+r+\" unsupported\")},a.prototype._encodeObjid=function(t,r,e){if(\"string\"==typeof t){if(!r)return this.reporter.error(\"string objid given, but no values map found\");if(!r.hasOwnProperty(t))return this.reporter.error(\"objid not found in values map\");t=r[t].split(/[\\s.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(var o=0;o<t.length;o++)t[o]|=0}if(!Array.isArray(t))return this.reporter.error(\"objid() should be either array or string, got: \"+JSON.stringify(t));if(!e){if(t[1]>=40)return this.reporter.error(\"Second objid identifier OOB\");t.splice(0,2,40*t[0]+t[1])}for(var s=0,u=0;u<t.length;u++){var a=t[u];for(s++;a>=128;a>>=7)s++}for(var h=i.alloc(s),f=h.length-1,c=t.length-1;c>=0;c--){var l=t[c];for(h[f--]=127&l;(l>>=7)>0;)h[f--]=128|127&l}return this._createEncoderBuffer(h)},a.prototype._encodeTime=function(t,r){var e,n=new Date(t);return\"gentime\"===r?e=[h(n.getUTCFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),\"Z\"].join(\"\"):\"utctime\"===r?e=[h(n.getUTCFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),\"Z\"].join(\"\"):this.reporter.error(\"Encoding \"+r+\" time is not supported yet\"),this._encodeStr(e,\"octstr\")},a.prototype._encodeNull=function(){return this._createEncoderBuffer(\"\")},a.prototype._encodeInt=function(t,r){if(\"string\"==typeof t){if(!r)return this.reporter.error(\"String int or enum given, but no values map\");if(!r.hasOwnProperty(t))return this.reporter.error(\"Values map doesn't contain: \"+JSON.stringify(t));t=r[t]}if(\"number\"!=typeof t&&!i.isBuffer(t)){var e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=i.alloc(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var s=1,u=t;u>=256;u>>=8)s++;for(var a=new Array(s),h=a.length-1;h>=0;h--)a[h]=255&t,t>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(i.from(a))},a.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},a.prototype._use=function(t,r){return\"function\"==typeof t&&(t=t(r)),t._getEncoder(\"der\").tree},a.prototype._skipDefault=function(t,r,e){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,r,e).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},function(t,r,e){var n=e(0),i=e(2).RegExp,o=n((function(){var t=i(\"a\",\"y\");return t.lastIndex=2,null!=t.exec(\"abcd\")})),s=o||n((function(){return!i(\"a\",\"y\").sticky})),u=o||n((function(){var t=i(\"^r\",\"gy\");return t.lastIndex=2,null!=t.exec(\"str\")}));t.exports={BROKEN_CARET:u,MISSED_STICKY:s,UNSUPPORTED_Y:o}},function(t,r,e){\"use strict\";var n=e(44),i=e(7),o=e(1),s=e(166),u=e(10),a=e(30),h=e(208),f=e(32),c=e(71),l=e(167),p=e(20),d=e(24),v=e(47),y=e(70),g=e(168),m=e(146),w=e(217),b=e(0),M=w.UNSUPPORTED_Y,x=4294967295,T=Math.min,A=[].push,E=o(/./.exec),_=o(A),S=o(\"\".slice),B=!b((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e=\"ab\".split(t);return 2!==e.length||\"a\"!==e[0]||\"b\"!==e[1]}));s(\"split\",(function(t,r,e){var o;return o=\"c\"==\"abbc\".split(/(b)*/)[1]||4!=\"test\".split(/(?:)/,-1).length||2!=\"ab\".split(/(?:ab)*/).length||4!=\".\".split(/(.?)(.?)/).length||\".\".split(/()()/).length>1||\"\".split(/.?/).length?function(t,e){var o=d(f(this)),s=void 0===e?x:e>>>0;if(0===s)return[];if(void 0===t)return[o];if(!h(t))return i(r,o,t,s);for(var u,a,c,l=[],p=(t.ignoreCase?\"i\":\"\")+(t.multiline?\"m\":\"\")+(t.unicode?\"u\":\"\")+(t.sticky?\"y\":\"\"),v=0,g=new RegExp(t.source,p+\"g\");(u=i(m,g,o))&&!((a=g.lastIndex)>v&&(_(l,S(o,v,u.index)),u.length>1&&u.index<o.length&&n(A,l,y(u,1)),c=u[0].length,v=a,l.length>=s));)g.lastIndex===u.index&&g.lastIndex++;return v===o.length?!c&&E(g,\"\")||_(l,\"\"):_(l,S(o,v)),l.length>s?y(l,0,s):l}:\"0\".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:i(r,this,t,e)}:r,[function(r,e){var n=f(this),s=a(r)?void 0:v(r,t);return s?i(s,r,n,e):i(o,d(n),r,e)},function(t,n){var i=u(this),s=d(t),a=e(o,i,s,n,o!==r);if(a.done)return a.value;var h=c(i,RegExp),f=i.unicode,v=(i.ignoreCase?\"i\":\"\")+(i.multiline?\"m\":\"\")+(i.unicode?\"u\":\"\")+(M?\"g\":\"y\"),y=new h(M?\"^(?:\"+i.source+\")\":i,v),m=void 0===n?x:n>>>0;if(0===m)return[];if(0===s.length)return null===g(y,s)?[s]:[];for(var w=0,b=0,A=[];b<s.length;){y.lastIndex=M?0:b;var E,B=g(y,M?S(s,b):s);if(null===B||(E=T(p(y.lastIndex+(M?b:0)),s.length))===w)b=l(s,b,f);else{if(_(A,S(s,w,b)),A.length===m)return A;for(var O=1;O<=B.length-1;O++)if(_(A,B[O]),A.length===m)return A;b=w=E}}return _(A,S(s,w)),A}]}),!B,M)},function(t,r,e){var n,i,o,s,u=e(2),a=e(44),h=e(48),f=e(4),c=e(12),l=e(0),p=e(150),d=e(62),v=e(69),y=e(262),g=e(220),m=e(85),w=u.setImmediate,b=u.clearImmediate,M=u.process,x=u.Dispatch,T=u.Function,A=u.MessageChannel,E=u.String,_=0,S={},B=\"onreadystatechange\";try{n=u.location}catch(t){}var O=function(t){if(c(S,t)){var r=S[t];delete S[t],r()}},R=function(t){return function(){O(t)}},k=function(t){O(t.data)},F=function(t){u.postMessage(E(t),n.protocol+\"//\"+n.host)};w&&b||(w=function(t){y(arguments.length,1);var r=f(t)?t:T(t),e=d(arguments,1);return S[++_]=function(){a(r,void 0,e)},i(_),_},b=function(t){delete S[t]},m?i=function(t){M.nextTick(R(t))}:x&&x.now?i=function(t){x.now(R(t))}:A&&!g?(s=(o=new A).port2,o.port1.onmessage=k,i=h(s.postMessage,s)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&\"file:\"!==n.protocol&&!l(F)?(i=F,u.addEventListener(\"message\",k,!1)):i=B in v(\"script\")?function(t){p.appendChild(v(\"script\")).onreadystatechange=function(){p.removeChild(this),O(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:w,clear:b}},function(t,r,e){var n=e(33);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},function(t,r){t.exports=\"object\"==typeof Deno&&Deno&&\"object\"==typeof Deno.version},function(t,r,e){var n=e(87),i=e(120),o=e(88).CONSTRUCTOR;t.exports=o||!i((function(t){n.all(t).then(void 0,(function(){}))}))},function(t,r){function e(r){return t.exports=e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r,e){\"use strict\";var n=r;n.der=e(225),n.pem=e(280)},function(t,r,e){\"use strict\";e(145),e(17),e(46),e(86),e(80),e(27),e(39);var n=e(58),i=e(214),o=e(90).DecoderBuffer,s=e(171),u=e(174);function a(t){this.enc=\"der\",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){s.call(this,\"der\",t)}function f(t,r){var e=t.readUInt8(r);if(t.isError(e))return e;var n=u.tagClass[e>>6],i=0==(32&e);if(31==(31&e)){var o=e;for(e=0;128==(128&o);){if(o=t.readUInt8(r),t.isError(o))return o;e<<=7,e|=127&o}}else e&=31;return{cls:n,primitive:i,tag:e,tagStr:u.tag[e]}}function c(t,r,e){var n=t.readUInt8(e);if(t.isError(n))return n;if(!r&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error(\"length octect is too long\");n=0;for(var o=0;o<i;o++){n<<=8;var s=t.readUInt8(e);if(t.isError(s))return s;n|=s}return n}t.exports=a,a.prototype.decode=function(t,r){return o.isDecoderBuffer(t)||(t=new o(t,r)),this.tree._decode(t,r)},n(h,s),h.prototype._peekTag=function(t,r,e){if(t.isEmpty())return!1;var n=t.save(),i=f(t,'Failed to peek tag: \"'+r+'\"');return t.isError(i)?i:(t.restore(n),i.tag===r||i.tagStr===r||i.tagStr+\"of\"===r||e)},h.prototype._decodeTag=function(t,r,e){var n=f(t,'Failed to decode tag of \"'+r+'\"');if(t.isError(n))return n;var i=c(t,n.primitive,'Failed to get length of \"'+r+'\"');if(t.isError(i))return i;if(!e&&n.tag!==r&&n.tagStr!==r&&n.tagStr+\"of\"!==r)return t.error('Failed to match tag: \"'+r+'\"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: \"'+r+'\"');var o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: \"'+this.tag+'\"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: \"'+r+'\"'))},h.prototype._skipUntilEnd=function(t,r){for(;;){var e=f(t,r);if(t.isError(e))return e;var n=c(t,e.primitive,r);if(t.isError(n))return n;var i=void 0;if(i=e.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,r),t.isError(i))return i;if(\"end\"===e.tagStr)break}},h.prototype._decodeList=function(t,r,e,n){for(var i=[];!t.isEmpty();){var o=this._peekTag(t,\"end\");if(t.isError(o))return o;var s=e.decode(t,\"der\",n);if(t.isError(s)&&o)break;i.push(s)}return i},h.prototype._decodeStr=function(t,r){if(\"bitstr\"===r){var e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if(\"bmpstr\"===r){var n=t.raw();if(n.length%2==1)return t.error(\"Decoding of string type: bmpstr length mismatch\");for(var i=\"\",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if(\"numstr\"===r){var s=t.raw().toString(\"ascii\");return this._isNumstr(s)?s:t.error(\"Decoding of string type: numstr unsupported characters\")}if(\"octstr\"===r)return t.raw();if(\"objDesc\"===r)return t.raw();if(\"printstr\"===r){var u=t.raw().toString(\"ascii\");return this._isPrintstr(u)?u:t.error(\"Decoding of string type: printstr unsupported characters\")}return/str$/.test(r)?t.raw().toString():t.error(\"Decoding of string type: \"+r+\" unsupported\")},h.prototype._decodeObjid=function(t,r,e){for(var n,i=[],o=0,s=0;!t.isEmpty();)o<<=7,o|=127&(s=t.readUInt8()),0==(128&s)&&(i.push(o),o=0);128&s&&i.push(o);var u=i[0]/40|0,a=i[0]%40;if(n=e?i:[u,a].concat(i.slice(1)),r){var h=r[n.join(\" \")];void 0===h&&(h=r[n.join(\".\")]),void 0!==h&&(n=h)}return n},h.prototype._decodeTime=function(t,r){var e,n,i,o,s,u,a=t.raw().toString();if(\"gentime\"===r)e=0|a.slice(0,4),n=0|a.slice(4,6),i=0|a.slice(6,8),o=0|a.slice(8,10),s=0|a.slice(10,12),u=0|a.slice(12,14);else{if(\"utctime\"!==r)return t.error(\"Decoding \"+r+\" time is not supported yet\");e=0|a.slice(0,2),n=0|a.slice(2,4),i=0|a.slice(4,6),o=0|a.slice(6,8),s=0|a.slice(8,10),u=0|a.slice(10,12),e=e<70?2e3+e:1900+e}return Date.UTC(e,n-1,i,o,s,u,0)},h.prototype._decodeNull=function(){return null},h.prototype._decodeBool=function(t){var r=t.readUInt8();return t.isError(r)?r:0!==r},h.prototype._decodeInt=function(t,r){var e=t.raw(),n=new i(e);return r&&(n=r[n.toString(10)]||n),n},h.prototype._use=function(t,r){return\"function\"==typeof t&&(t=t(r)),t._getDecoder(\"der\").tree}},function(t,r,e){var n=e(164);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r){t.exports=function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r,e){var n=e(164);t.exports=function(t,r){if(t){if(\"string\"==typeof t)return n(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===e&&t.constructor&&(e=t.constructor.name),\"Map\"===e||\"Set\"===e?Array.from(t):\"Arguments\"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,r):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r){t.exports=function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,r,e){var n=e(2),i=e(212),o=e(213),s=e(40),u=e(23),a=e(5),h=a(\"iterator\"),f=a(\"toStringTag\"),c=s.values,l=function(t,r){if(t){if(t[h]!==c)try{u(t,h,c)}catch(r){t[h]=c}if(t[f]||u(t,f,r),i[r])for(var e in s)if(t[e]!==s[e])try{u(t,e,s[e])}catch(r){t[e]=s[e]}}};for(var p in i)l(n[p]&&n[p].prototype,p);l(o,\"DOMTokenList\")},function(t,r,e){\"use strict\";var n=r;n.bignum=e(214),n.define=e(255).define,n.base=e(284),n.constants=e(285),n.decoders=e(224),n.encoders=e(215)},function(t,r,e){\"use strict\";(function(r){var n=e(37);e(80),e(27),e(17),e(46),e(237);var i=n(e(163)),o=n(e(64)),s=n(e(65)),u=e(141),a=u.BigInteger,h=u.SecureRandom,f=e(142),c=e(209),l=e(241),p=e(165),d=e(242),v=e(79),y=e(231),g=y.bignum,m=e(210),w=new h,b=y.define(\"ASN1_SM2EncryptFormat\",(function(){this.seq().obj(this.key(\"X\").int(),this.key(\"Y\").int(),this.key(\"Hash\").octstr(),this.key(\"Cipher\").octstr())})),M=y.define(\"ASN1_SM2SignFormat\",(function(){this.seq().obj(this.key(\"R\").int(),this.key(\"S\").int())})),x=y.define(\"ASN1_SM2PublicKeyObjID\",(function(){this.seq().obj(this.key(\"algorithm\").objid(),this.key(\"subAlgorithm\").objid())})),T=y.define(\"ASN1_SM2PublicKey\",(function(){this.seq().obj(this.key(\"algorithm\").use(x),this.key(\"key\").bitstr())})),A=function(){function t(){(0,o.default)(this,t),this.curve=new f,this.ecmath=new d,this.sm3=new p}return(0,s.default)(t,[{key:\"encodePublicKeyToDer\",value:function(t){var e=T.encode({algorithm:{algorithm:\"1.2.840.10045.2.1\".split(\".\"),subAlgorithm:\"1.2.156.10197.1.301\".split(\".\")},key:{data:r.from(t,\"hex\")}},\"der\");return v.byteArrayToHex(e)}},{key:\"decodePublicKeyFromDer\",value:function(t){var e=T.decode(r.from(t,\"hex\"),\"der\");return v.byteArrayToHex(e.key.data)}},{key:\"encrypt\",value:function(t,r){if(r&&0===r.length)throw new Error(\"plaintext cannot be an empty string.\");for(var e=new a(this.curve.n.bitLength(),w).mod(this.curve.n.subtract(a.ONE)).add(a.ONE),n=this.ecmath.ECPointMultiplyG(e),i=m.normalize(n.getX().toByteArray()),o=m.normalize(n.getY().toByteArray()),s=new c(t.substr(2,64),t.substr(66,64)),u=this.ecmath.ECPointMultiply(s,e),h=m.normalize(u.getX().toByteArray()),f=m.normalize(u.getY().toByteArray()),p=h.concat(f),d=l.kdf(p,r.length),y=!0,M=0;M<d.length;M++)if(0!=d[M]){y=!1;break}if(y)return this.encrypt(t,r);for(var x=new Array(r.length),T=0;T<r.length;T++)x[T]=r[T]^d[T];var A=h.concat(Array.prototype.slice.call(r)).concat(f);this.sm3.init(),this.sm3.update(A);var E=this.sm3.final(),_=b.encode({X:new g(v.byteArrayToHex(i),16),Y:new g(v.byteArrayToHex(o),16),Hash:E,Cipher:x},\"der\");return v.byteArrayToHex(_)}},{key:\"decrypt\",value:function(t,e){for(var n=r.from(v.hexToByteArray(e)),i=b.decode(n,\"der\"),o=new c(i.X.toString(16),i.Y.toString(16)),s=new a(t,16),u=this.ecmath.ECPointMultiply(o,s),h=m.normalize(u.getX().toByteArray()),f=m.normalize(u.getY().toByteArray()),p=h.concat(f),d=l.kdf(p,i.Cipher.length),y=!0,g=0;g<d.length;g++)if(0!=d[g]){y=!1;break}if(y)return-1;for(var w=new Array(i.Cipher.length),M=0;M<i.Cipher.length;M++)w[M]=i.Cipher[M]^d[M];var x=h.concat(w).concat(f);return this.sm3.init(),this.sm3.update(x),r.from(this.sm3.final()).equals(i.Hash)?w:-1}},{key:\"sign\",value:function(t,r,e,n){t.startsWith(\"0x\")&&(t=t.slice(2)),r.startsWith(\"0x\")&&(r=r.slice(2));var i=new c(t.substr(2,64),t.substr(66,64)),o=l.SM2MessageDigest(e,n,i),s=new a(this.curve.n.bitLength(),w).mod(this.curve.n.subtract(a.ONE)).add(a.ONE),u=this.ecmath.ECPointMultiplyG(s),h=new a(v.byteArrayToHex(o),16).add(u.getX()).mod(this.curve.n);if(h.equals(this.ecmath.zero))return this.sign(t,r,e,n);if(h.add(s).equals(this.curve.n))return this.sign(t,r,e,n);var f=new a(r,16),p=f.add(this.ecmath.one).modInverse(this.curve.n),d=h.multiply(f),y=p.multiply(s.add(d.negate())).mod(this.curve.n);if(y.equals(this.ecmath.zero))return this.sign(t,r,e,n);var m=M.encode({R:new g(h.toString(16),16),S:new g(y.toString(16),16)},\"der\");return v.byteArrayToHex(m)}},{key:\"verify\",value:function(t,e,n,i){t.startsWith(\"0x\")&&(t=t.slice(2));var o=r.from(v.hexToByteArray(i)),s=M.decode(o,\"der\"),u=new a(s.R.toString(16),16),h=new a(s.S.toString(16),16);if(!(u.compareTo(this.ecmath.zero)>0&&u.compareTo(this.curve.n)<0))return!1;if(!(h.compareTo(this.ecmath.zero)>0&&h.compareTo(this.curve.n)<0))return!1;var f=u.add(h).mod(this.curve.n);if(f.equals(this.ecmath.zero))return!1;var p=this.ecmath.ECPointMultiplyG(h),d=new c(t.substr(2,64),t.substr(66,64)),y=this.ecmath.ECPointMultiply(d,f),g=this.ecmath.ECPointAdd(p,y),m=l.SM2MessageDigest(e,n,d);return!!new a(v.byteArrayToHex(m),16).add(g.getX()).mod(this.curve.n).equals(u)}},{key:\"genKeyPair\",value:function(){var t=new a(this.curve.n.bitLength(),w).mod(this.curve.n.subtract(a.ONE)).add(a.ONE),r=this.ecmath.ECPointMultiplyG(t),e=m.normalize(r.getX().toByteArray()),n=m.normalize(r.getY().toByteArray()),o=v.byteArrayToHex([4].concat((0,i.default)(e),(0,i.default)(n)));return{privateKey:m.leftPad(t.toString(16),64),publicKey:o}}},{key:\"getPublicKeyFromPrivateKey\",value:function(t){var r=this.ecmath.ECPointMultiplyG(new a(t,16)),e=m.normalize(r.getX().toByteArray()),n=m.normalize(r.getY().toByteArray());return v.byteArrayToHex([4].concat((0,i.default)(e),(0,i.default)(n)))}},{key:\"kdf\",value:function(t,r){return l.kdf(t,r)}}]),t}();t.exports=A}).call(this,e(176).Buffer)},,,function(t,r){r.read=function(t,r,e,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,h=a>>1,f=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+t[r+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[r+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=h}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,r,e,n,i,o){var s,u,a,h=8*o-i-1,f=(1<<h)-1,c=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,v=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,s=f):(s=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-s))<1&&(s--,a*=2),(r+=s+c>=1?l/a:l*Math.pow(2,1-c))*a>=2&&(s++,a/=2),s+c>=f?(u=0,s=f):s+c>=1?(u=(r*a-1)*Math.pow(2,i),s+=c):(u=r*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[e+p]=255&u,p+=d,u/=256,i-=8);for(s=s<<i|u,h+=i;h>0;t[e+p]=255&s,p+=d,s/=256,h-=8);t[e+p-d]|=128*v}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return\"[object Array]\"==e.call(t)}},function(t,r,e){\"use strict\";var n,i=e(6),o=e(1),s=e(49).f,u=e(20),a=e(24),h=e(238),f=e(32),c=e(239),l=e(31),p=o(\"\".startsWith),d=o(\"\".slice),v=Math.min,y=c(\"startsWith\");i({target:\"String\",proto:!0,forced:!!(l||y||(n=s(String.prototype,\"startsWith\"),!n||n.writable))&&!y},{startsWith:function(t){var r=a(f(this));h(t);var e=u(v(arguments.length>1?arguments[1]:void 0,r.length)),n=a(t);return p?p(r,n,e):d(r,e,e+n.length)===n}})},function(t,r,e){var n=e(208),i=TypeError;t.exports=function(t){if(n(t))throw i(\"The method doesn't accept regular expressions\");return t}},function(t,r,e){var n=e(5)(\"match\");t.exports=function(t){var r=/./;try{\"/./\"[t](r)}catch(e){try{return r[n]=!1,\"/./\"[t](r)}catch(t){}}return!1}},function(t,r,e){\"use strict\";var n=e(6),i=e(84).left,o=e(61),s=e(41),u=e(85);n({target:\"Array\",proto:!0,forced:!o(\"reduce\")||!u&&s>79&&s<83},{reduce:function(t){var r=arguments.length;return i(this,t,r,r>1?arguments[1]:void 0)}})},function(t,r,e){\"use strict\";var n=e(165),i=new(e(142)),o=new n,s=e(210);function u(t,r){var e=new Array(2+t.length+192),n=8*t.length;e[0]=n>>8&255,e[1]=255&n;for(var u=0;u<t.length;u++)e[2+u]=t[u];for(var a=2+t.length,h=s.normalize(i.a.toByteArray()),f=0;f<h.length;f++)e[a+f]=(h[f]>>>0)%256;a+=h.length;for(var c=s.normalize(i.b.toByteArray()),l=0;l<c.length;l++)e[a+l]=(c[l]>>>0)%256;a+=c.length;for(var p=s.normalize(i.Gx.toByteArray()),d=0;d<p.length;d++)e[a+d]=(p[d]>>>0)%256;a+=p.length;for(var v=s.normalize(i.Gy.toByteArray()),y=0;y<v.length;y++)e[a+y]=(v[y]>>>0)%256;a+=v.length;for(var g=s.normalize(r.getX().toByteArray()),m=0;m<g.length;m++)e[a+m]=(g[m]>>>0)%256;a+=g.length;for(var w=s.normalize(r.getY().toByteArray()),b=0;b<w.length;b++)e[a+b]=(w[b]>>>0)%256;return a+=w.length,o.init(),o.update(e),o.final()}t.exports={SM2MessageDigest:function(t,r,e){var n=u(r,e);return o.init(),o.update(n),o.update(t),o.final()},SM2GetZ:u,kdf:function(t,r){if(r>137438953440)return-1;if(t.length>1024)return-1;var e,n=1,i=r,s=[],u=0;for(t.push((n>>>24)%256),t.push((n>>>16)%256),t.push((n>>>8)%256),t.push((n>>>0)%256);i>0;){if(o.init(),o.update(t),e=o.final(),i<=32)for(var a=0;a<i;a++)s[u+a]=e[a];else for(var h=r>=32?32:r,f=0;f<h;f++)s[u+f]=e[f];i-=32,u+=32,n++,t[t.length-4]=(n>>>24)%256,t[t.length-3]=(n>>>16)%256,t[t.length-2]=(n>>>8)%256,t[t.length-1]=(n>>>0)%256}return s}}},function(t,r,e){\"use strict\";var n=e(37);e(40),e(243),e(17),e(252),e(230),e(144),e(46);var i=n(e(64)),o=n(e(65)),s=e(141).BigInteger,u=e(142),a=e(209),h=function(){function t(){(0,i.default)(this,t),this.curve=new u,this.G=new a(\"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7\",\"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0\"),this.zero=new s(\"0\"),this.one=new s(\"1\"),this.two=new s(\"2\"),this.three=new s(\"3\"),this.infinity=new a(null,null),this.preCompute()}return(0,o.default)(t,[{key:\"preCompute\",value:function(){for(var t=new Map,r=1;r<256;r++)t.set(\"\".concat(r),this.preComputeMultiplyG(new s(\"\".concat(r))));this.map=t}},{key:\"preComputeMultiplyG\",value:function(t){if(t.equals(this.one))return this.G;for(var r=this.G,e=t.bitLength()-2;e>=0;e--){r=this.ECPointDoubling(r),1==t.testBit(e)&&(r=this.ECPointAdd(r,this.G))}return r}},{key:\"ECPointAdd\",value:function(t,r){var e=this.curve.p;if(t.isInfinity())return r;if(r.isInfinity())return t;var n=t.X,i=t.Y,o=t.Z,s=r.X,u=r.Y,h=r.Z,f=n.multiply(h).mod(e),c=s.multiply(o).mod(e),l=f.subtract(c),p=i.multiply(h).mod(e),d=u.multiply(o).mod(e),v=p.subtract(d);if(this.zero.equals(l))return this.zero.equals(v)?this.ECPointDoubling(t):this.infinity;var y=f.add(c),g=o.multiply(h).mod(e),m=l.square().mod(e),w=l.multiply(m).mod(e),b=g.multiply(v.square()).subtract(y.multiply(m)).mod(e),M=l.multiply(b).mod(e),x=v.multiply(m.multiply(f).subtract(b)).subtract(p.multiply(w)).mod(e),T=w.multiply(g).mod(e);return new a(M,x,T)}},{key:\"ECPointDoubling\",value:function(t){if(t.isInfinity())return t;if(!t.Y.signum())return this.infinity;var r=t.X,e=t.Y,n=t.Z,i=this.curve.p,o=this.curve.a,s=r.square().multiply(this.three).add(o.multiply(n.square())).mod(i),u=e.shiftLeft(1).multiply(n).mod(i),h=e.square().mod(i),f=h.multiply(r).multiply(n).mod(i),c=u.square().mod(i),l=s.square().subtract(f.shiftLeft(3)).mod(i),p=u.multiply(l).mod(i),d=s.multiply(f.shiftLeft(2).subtract(l)).subtract(c.shiftLeft(1).multiply(h)).mod(i),v=u.multiply(c).mod(i);return new a(p,d,v)}},{key:\"ECPointMultiply\",value:function(t,r){if(r.equals(this.one))return t;for(var e=t,n=r.bitLength()-2;n>=0;n--){e=this.ECPointDoubling(e),1==r.testBit(n)&&(e=this.ECPointAdd(e,t))}return e}},{key:\"ECPointMultiplyG\",value:function(t){if(t.equals(this.one))return this.G;for(var r=t.bitLength(),e=r%8==0?8:r%8,n=this.map.get(t.shiftRight(r-e).toString()),i=t.bitLength()-e-1;i>0;i-=8){n=this.ECPointDoubling(n),n=this.ECPointDoubling(n),n=this.ECPointDoubling(n),n=this.ECPointDoubling(n),n=this.ECPointDoubling(n),n=this.ECPointDoubling(n),n=this.ECPointDoubling(n),n=this.ECPointDoubling(n);for(var o=0,s=0;s<8;s++)o*=2,t.testBit(i-s)&&(o+=1);0!==o&&(n=this.ECPointAdd(n,this.map.get(\"\".concat(o))))}return n}},{key:\"ECPointIsOnCurve\",value:function(t){var r=t.Y.multiply(t.Y).mod(this.curve.p),e=t.X.multiply(t.X).multiply(t.X).add(t.X.multiply(this.curve.a)).add(this.curve.b).mod(this.curve.p);return r.equals(e)}}]),t}();t.exports=h},function(t,r,e){e(244)},function(t,r,e){\"use strict\";e(245)(\"Map\",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),e(251))},function(t,r,e){\"use strict\";var n=e(6),i=e(2),o=e(1),s=e(118),u=e(16),a=e(211),h=e(143),f=e(57),c=e(4),l=e(30),p=e(8),d=e(0),v=e(120),y=e(51),g=e(154);t.exports=function(t,r,e){var m=-1!==t.indexOf(\"Map\"),w=-1!==t.indexOf(\"Weak\"),b=m?\"set\":\"add\",M=i[t],x=M&&M.prototype,T=M,A={},E=function(t){var r=o(x[t]);u(x,t,\"add\"==t?function(t){return r(this,0===t?0:t),this}:\"delete\"==t?function(t){return!(w&&!p(t))&&r(this,0===t?0:t)}:\"get\"==t?function(t){return w&&!p(t)?void 0:r(this,0===t?0:t)}:\"has\"==t?function(t){return!(w&&!p(t))&&r(this,0===t?0:t)}:function(t,e){return r(this,0===t?0:t,e),this})};if(s(t,!c(M)||!(w||x.forEach&&!d((function(){(new M).entries().next()})))))T=e.getConstructor(r,t,m,b),a.enable();else if(s(t,!0)){var _=new T,S=_[b](w?{}:-0,1)!=_,B=d((function(){_.has(1)})),O=v((function(t){new M(t)})),R=!w&&d((function(){for(var t=new M,r=5;r--;)t[b](r,r);return!t.has(-0)}));O||((T=r((function(t,r){f(t,x);var e=g(new M,t,T);return l(r)||h(r,e[b],{that:e,AS_ENTRIES:m}),e}))).prototype=x,x.constructor=T),(B||R)&&(E(\"delete\"),E(\"has\"),m&&E(\"get\")),(R||S)&&E(b),w&&x.clear&&delete x.clear}return A[t]=T,n({global:!0,constructor:!0,forced:T!=M},A),y(T,t),w||e.setStrong(T,t,m),T}},function(t,r,e){var n=e(29),i=e(18),o=e(50).f,s=e(70),u=\"object\"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&\"Window\"==n(t)?function(t){try{return o(t)}catch(t){return s(u)}}(t):o(i(t))}},function(t,r,e){var n=e(0),i=e(8),o=e(29),s=e(248),u=Object.isExtensible,a=n((function(){u(1)}));t.exports=a||s?function(t){return!!i(t)&&((!s||\"ArrayBuffer\"!=o(t))&&(!u||u(t)))}:u},function(t,r,e){var n=e(0);t.exports=n((function(){if(\"function\"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,\"a\",{value:8})}}))},function(t,r,e){var n=e(0);t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(t,r,e){var n=e(7),i=e(10),o=e(47);t.exports=function(t,r,e){var s,u;i(t);try{if(!(s=o(t,\"return\"))){if(\"throw\"===r)throw e;return e}s=n(s,t)}catch(t){u=!0,s=t}if(\"throw\"===r)throw e;if(u)throw s;return i(s),e}},function(t,r,e){\"use strict\";var n=e(11).f,i=e(38),o=e(151),s=e(48),u=e(57),a=e(30),h=e(143),f=e(117),c=e(119),l=e(121),p=e(9),d=e(211).fastKey,v=e(26),y=v.set,g=v.getterFor;t.exports={getConstructor:function(t,r,e,f){var c=t((function(t,n){u(t,l),y(t,{type:r,index:i(null),first:void 0,last:void 0,size:0}),p||(t.size=0),a(n)||h(n,t[f],{that:t,AS_ENTRIES:e})})),l=c.prototype,v=g(r),m=function(t,r,e){var n,i,o=v(t),s=w(t,r);return s?s.value=e:(o.last=s={index:i=d(r,!0),key:r,value:e,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),p?o.size++:t.size++,\"F\"!==i&&(o.index[i]=s)),t},w=function(t,r){var e,n=v(t),i=d(r);if(\"F\"!==i)return n.index[i];for(e=n.first;e;e=e.next)if(e.key==r)return e};return o(l,{clear:function(){for(var t=v(this),r=t.index,e=t.first;e;)e.removed=!0,e.previous&&(e.previous=e.previous.next=void 0),delete r[e.index],e=e.next;t.first=t.last=void 0,p?t.size=0:this.size=0},delete:function(t){var r=this,e=v(r),n=w(r,t);if(n){var i=n.next,o=n.previous;delete e.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),e.first==n&&(e.first=i),e.last==n&&(e.last=o),p?e.size--:r.size--}return!!n},forEach:function(t){for(var r,e=v(this),n=s(t,arguments.length>1?arguments[1]:void 0);r=r?r.next:e.first;)for(n(r.value,r.key,this);r&&r.removed;)r=r.previous},has:function(t){return!!w(this,t)}}),o(l,e?{get:function(t){var r=w(this,t);return r&&r.value},set:function(t,r){return m(this,0===t?0:t,r)}}:{add:function(t){return m(this,t=0===t?0:t,t)}}),p&&n(l,\"size\",{get:function(){return v(this).size}}),c},setStrong:function(t,r,e){var n=r+\" Iterator\",i=g(r),o=g(n);f(t,r,(function(t,r){y(this,{type:n,target:t,state:i(t),kind:r,last:void 0})}),(function(){for(var t=o(this),r=t.kind,e=t.last;e&&e.removed;)e=e.previous;return t.target&&(t.last=e=e?e.next:t.state.first)?c(\"keys\"==r?e.key:\"values\"==r?e.value:[e.key,e.value],!1):(t.target=void 0,c(void 0,!0))}),e?\"entries\":\"values\",!e,!0),l(r)}}},function(t,r,e){\"use strict\";var n=e(122).charAt,i=e(24),o=e(26),s=e(117),u=e(119),a=\"String Iterator\",h=o.set,f=o.getterFor(a);s(String,\"String\",(function(t){h(this,{type:a,string:i(t),index:0})}),(function(){var t,r=f(this),e=r.string,i=r.index;return i>=e.length?u(void 0,!0):(t=n(e,i),r.index+=t.length,u(t,!1))}))},function(t,r){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,\"loaded\",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,\"id\",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,r){},function(t,r,e){\"use strict\";e(145);var n=e(215),i=e(224),o=e(58);function s(t,r){this.name=t,this.body=r,this.decoders={},this.encoders={}}r.define=function(t,r){return new s(t,r)},s.prototype._createNamed=function(t){var r=this.name;function e(t){this._initNamed(t,r)}return o(e,t),e.prototype._initNamed=function(r,e){t.call(this,r,e)},new e(this)},s.prototype._getDecoder=function(t){return t=t||\"der\",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,r,e){return this._getDecoder(r).decode(t,e)},s.prototype._getEncoder=function(t){return t=t||\"der\",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,r,e){return this._getEncoder(r).encode(t,e)}},function(t,r,e){var n=e(0),i=e(2).RegExp;t.exports=n((function(){var t=i(\".\",\"s\");return!(t.dotAll&&t.exec(\"\\n\")&&\"s\"===t.flags)}))},function(t,r,e){var n=e(0),i=e(2).RegExp;t.exports=n((function(){var t=i(\"(?<a>b)\",\"g\");return\"b\"!==t.exec(\"b\").groups.a||\"bc\"!==\"b\".replace(t,\"$<a>c\")}))},function(t,r,e){\"use strict\";var n=e(6),i=e(14),o=e(19),s=e(21),u=e(13),a=e(259),h=e(175),f=e(93),c=e(67),l=e(155),p=e(63)(\"splice\"),d=Math.max,v=Math.min;n({target:\"Array\",proto:!0,forced:!p},{splice:function(t,r){var e,n,p,y,g,m,w=i(this),b=u(w),M=o(t,b),x=arguments.length;for(0===x?e=n=0:1===x?(e=0,n=b-M):(e=x-2,n=v(d(s(r),0),b-M)),h(b+e-n),p=f(w,n),y=0;y<n;y++)(g=M+y)in w&&c(p,y,w[g]);if(p.length=n,e<n){for(y=M;y<b-n;y++)m=y+e,(g=y+n)in w?w[m]=w[g]:l(w,m);for(y=b;y>b-n+e;y--)l(w,y-1)}else if(e>n)for(y=b-n;y>M;y--)m=y+e-1,(g=y+n-1)in w?w[m]=w[g]:l(w,m);for(y=0;y<e;y++)w[y+M]=arguments[y+2];return a(w,b-n+e),p}})},function(t,r,e){\"use strict\";var n=e(9),i=e(68),o=TypeError,s=Object.getOwnPropertyDescriptor,u=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],\"length\",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=u?function(t,r){if(i(t)&&!s(t,\"length\").writable)throw o(\"Cannot set read only .length\");return t.length=r}:function(t,r){return t.length=r}},function(t,r,e){e(261),e(269),e(270),e(271),e(272),e(273)},function(t,r,e){\"use strict\";var n,i,o,s=e(6),u=e(31),a=e(85),h=e(2),f=e(7),c=e(16),l=e(36),p=e(51),d=e(121),v=e(25),y=e(4),g=e(8),m=e(57),w=e(71),b=e(219).set,M=e(263),x=e(266),T=e(169),A=e(267),E=e(26),_=e(87),S=e(88),B=e(89),O=\"Promise\",R=S.CONSTRUCTOR,k=S.REJECTION_EVENT,F=S.SUBCLASSING,j=E.getterFor(O),D=E.set,I=_&&_.prototype,P=_,C=I,L=h.TypeError,U=h.document,N=h.process,q=B.f,Y=q,z=!!(U&&U.createEvent&&h.dispatchEvent),V=\"unhandledrejection\",Z=function(t){var r;return!(!g(t)||!y(r=t.then))&&r},G=function(t,r){var e,n,i,o=r.value,s=1==r.state,u=s?t.ok:t.fail,a=t.resolve,h=t.reject,c=t.domain;try{u?(s||(2===r.rejection&&$(r),r.rejection=1),!0===u?e=o:(c&&c.enter(),e=u(o),c&&(c.exit(),i=!0)),e===t.promise?h(L(\"Promise-chain cycle\")):(n=Z(e))?f(n,e,a,h):a(e)):h(o)}catch(t){c&&!i&&c.exit(),h(t)}},K=function(t,r){t.notified||(t.notified=!0,M((function(){for(var e,n=t.reactions;e=n.get();)G(e,t);t.notified=!1,r&&!t.rejection&&X(t)})))},W=function(t,r,e){var n,i;z?((n=U.createEvent(\"Event\")).promise=r,n.reason=e,n.initEvent(t,!1,!0),h.dispatchEvent(n)):n={promise:r,reason:e},!k&&(i=h[\"on\"+t])?i(n):t===V&&x(\"Unhandled promise rejection\",e)},X=function(t){f(b,h,(function(){var r,e=t.facade,n=t.value;if(H(t)&&(r=T((function(){a?N.emit(\"unhandledRejection\",n,e):W(V,e,n)})),t.rejection=a||H(t)?2:1,r.error))throw r.value}))},H=function(t){return 1!==t.rejection&&!t.parent},$=function(t){f(b,h,(function(){var r=t.facade;a?N.emit(\"rejectionHandled\",r):W(\"rejectionhandled\",r,t.value)}))},J=function(t,r,e){return function(n){t(r,n,e)}},Q=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,K(t,!0))},tt=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw L(\"Promise can't be resolved itself\");var n=Z(r);n?M((function(){var e={done:!1};try{f(n,r,J(tt,e,t),J(Q,e,t))}catch(r){Q(e,r,t)}})):(t.value=r,t.state=1,K(t,!1))}catch(r){Q({done:!1},r,t)}}};if(R&&(C=(P=function(t){m(this,C),v(t),f(n,this);var r=j(this);try{t(J(tt,r),J(Q,r))}catch(t){Q(r,t)}}).prototype,(n=function(t){D(this,{type:O,done:!1,notified:!1,parent:!1,reactions:new A,rejection:!1,state:0,value:void 0})}).prototype=c(C,\"then\",(function(t,r){var e=j(this),n=q(w(this,P));return e.parent=!0,n.ok=!y(t)||t,n.fail=y(r)&&r,n.domain=a?N.domain:void 0,0==e.state?e.reactions.add(n):M((function(){G(n,e)})),n.promise})),i=function(){var t=new n,r=j(t);this.promise=t,this.resolve=J(tt,r),this.reject=J(Q,r)},B.f=q=function(t){return t===P||undefined===t?new i(t):Y(t)},!u&&y(_)&&I!==Object.prototype)){o=I.then,F||c(I,\"then\",(function(t,r){var e=this;return new P((function(t,r){f(o,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete I.constructor}catch(t){}l&&l(I,C)}s({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:P}),p(P,O,!1,!0),d(O)},function(t,r){var e=TypeError;t.exports=function(t,r){if(t<r)throw e(\"Not enough arguments\");return t}},function(t,r,e){var n,i,o,s,u,a,h,f,c=e(2),l=e(48),p=e(49).f,d=e(219).set,v=e(220),y=e(264),g=e(265),m=e(85),w=c.MutationObserver||c.WebKitMutationObserver,b=c.document,M=c.process,x=c.Promise,T=p(c,\"queueMicrotask\"),A=T&&T.value;A||(n=function(){var t,r;for(m&&(t=M.domain)&&t.exit();i;){r=i.fn,i=i.next;try{r()}catch(t){throw i?s():o=void 0,t}}o=void 0,t&&t.enter()},v||m||g||!w||!b?!y&&x&&x.resolve?((h=x.resolve(void 0)).constructor=x,f=l(h.then,h),s=function(){f(n)}):m?s=function(){M.nextTick(n)}:(d=l(d,c),s=function(){d(n)}):(u=!0,a=b.createTextNode(\"\"),new w(n).observe(a,{characterData:!0}),s=function(){a.data=u=!u})),t.exports=A||function(t){var r={fn:t,next:void 0};o&&(o.next=r),i||(i=r,s()),o=r}},function(t,r,e){var n=e(33),i=e(2);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==i.Pebble},function(t,r,e){var n=e(33);t.exports=/web0s(?!.*chrome)/i.test(n)},function(t,r,e){var n=e(2);t.exports=function(t,r){var e=n.console;e&&e.error&&(1==arguments.length?e.error(t):e.error(t,r))}},function(t,r){var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},function(t,r,e){var n=e(221),i=e(85);t.exports=!n&&!i&&\"object\"==typeof window&&\"object\"==typeof document},function(t,r,e){\"use strict\";var n=e(6),i=e(7),o=e(25),s=e(89),u=e(169),a=e(143);n({target:\"Promise\",stat:!0,forced:e(222)},{all:function(t){var r=this,e=s.f(r),n=e.resolve,h=e.reject,f=u((function(){var e=o(r.resolve),s=[],u=0,f=1;a(t,(function(t){var o=u++,a=!1;f++,i(e,r,t).then((function(t){a||(a=!0,s[o]=t,--f||n(s))}),h)})),--f||n(s)}));return f.error&&h(f.value),e.promise}})},function(t,r,e){\"use strict\";var n=e(6),i=e(31),o=e(88).CONSTRUCTOR,s=e(87),u=e(28),a=e(4),h=e(16),f=s&&s.prototype;if(n({target:\"Promise\",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&a(s)){var c=u(\"Promise\").prototype.catch;f.catch!==c&&h(f,\"catch\",c,{unsafe:!0})}},function(t,r,e){\"use strict\";var n=e(6),i=e(7),o=e(25),s=e(89),u=e(169),a=e(143);n({target:\"Promise\",stat:!0,forced:e(222)},{race:function(t){var r=this,e=s.f(r),n=e.reject,h=u((function(){var s=o(r.resolve);a(t,(function(t){i(s,r,t).then(e.resolve,n)}))}));return h.error&&n(h.value),e.promise}})},function(t,r,e){\"use strict\";var n=e(6),i=e(7),o=e(89);n({target:\"Promise\",stat:!0,forced:e(88).CONSTRUCTOR},{reject:function(t){var r=o.f(this);return i(r.reject,void 0,t),r.promise}})},function(t,r,e){\"use strict\";var n=e(6),i=e(28),o=e(31),s=e(87),u=e(88).CONSTRUCTOR,a=e(274),h=i(\"Promise\"),f=o&&!u;n({target:\"Promise\",stat:!0,forced:o||u},{resolve:function(t){return a(f&&this===h?s:this,t)}})},function(t,r,e){var n=e(10),i=e(8),o=e(89);t.exports=function(t,r){if(n(t),i(r)&&r.constructor===t)return r;var e=o.f(t);return(0,e.resolve)(r),e.promise}},function(t,r){var e,n,i=t.exports={};function o(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function u(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e=\"function\"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n=\"function\"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var a,h=[],f=!1,c=-1;function l(){f&&a&&(f=!1,a.length?h=a.concat(h):c=-1,h.length&&p())}function p(){if(!f){var t=u(l);f=!0;for(var r=h.length;r;){for(a=h,h=[];++c<r;)a&&a[c].run();c=-1,r=h.length}a=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(r){try{return n.call(null,t)}catch(r){return n.call(this,t)}}}(t)}}function d(t,r){this.fun=t,this.array=r}function v(){}i.nextTick=function(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];h.push(new d(t,r)),1!==h.length||f||u(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title=\"browser\",i.browser=!0,i.env={},i.argv=[],i.version=\"\",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error(\"process.binding is not supported\")},i.cwd=function(){return\"/\"},i.chdir=function(t){throw new Error(\"process.chdir is not supported\")},i.umask=function(){return 0}},function(t,r,e){\"use strict\";var n=e(15).forEach,i=e(61)(\"forEach\");t.exports=i?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},function(t,r,e){\"use strict\";var n=e(6),i=e(15).filter;n({target:\"Array\",proto:!0,forced:!e(63)(\"filter\")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,r){function e(t,r){if(!t)throw new Error(r||\"Assertion failed\")}t.exports=e,e.equal=function(t,r,e){if(t!=r)throw new Error(e||\"Assertion failed: \"+t+\" != \"+r)}},function(t,r,e){\"use strict\";e(17),e(46),e(27),e(39);var n=e(58),i=e(216);function o(t){i.call(this,t),this.enc=\"pem\"}n(o,i),t.exports=o,o.prototype.encode=function(t,r){for(var e=i.prototype.encode.call(this,t).toString(\"base64\"),n=[\"-----BEGIN \"+r.label+\"-----\"],o=0;o<e.length;o+=64)n.push(e.slice(o,o+64));return n.push(\"-----END \"+r.label+\"-----\"),n.join(\"\\n\")}},function(t,r,e){\"use strict\";e(86),e(218),e(17),e(46),e(281),e(39),e(27),e(282);var n=e(58),i=e(170).Buffer,o=e(225);function s(t){o.call(this,t),this.enc=\"pem\"}n(s,o),t.exports=s,s.prototype.decode=function(t,r){for(var e=t.toString().split(/[\\r\\n]+/g),n=r.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,u=-1,a=-1,h=0;h<e.length;h++){var f=e[h].match(s);if(null!==f&&f[2]===n){if(-1!==u){if(\"END\"!==f[1])break;a=h;break}if(\"BEGIN\"!==f[1])break;u=h}}if(-1===u||-1===a)throw new Error(\"PEM section not found for: \"+n);var c=e.slice(u+1,a).join(\"\");c.replace(/[^a-z0-9+/=]+/gi,\"\");var l=i.from(c,\"base64\");return o.prototype.decode.call(this,l,r)}},function(t,r,e){\"use strict\";var n=e(7),i=e(166),o=e(10),s=e(30),u=e(20),a=e(24),h=e(32),f=e(47),c=e(167),l=e(168);i(\"match\",(function(t,r,e){return[function(r){var e=h(this),i=s(r)?void 0:f(r,t);return i?n(i,r,e):new RegExp(r)[t](a(e))},function(t){var n=o(this),i=a(t),s=e(r,n,i);if(s.done)return s.value;if(!n.global)return l(n,i);var h=n.unicode;n.lastIndex=0;for(var f,p=[],d=0;null!==(f=l(n,i));){var v=a(f[0]);p[d]=v,\"\"===v&&(n.lastIndex=c(i,u(n.lastIndex),h)),d++}return 0===d?null:p}]}))},function(t,r,e){\"use strict\";var n=e(44),i=e(7),o=e(1),s=e(166),u=e(0),a=e(10),h=e(4),f=e(30),c=e(21),l=e(20),p=e(24),d=e(32),v=e(167),y=e(47),g=e(283),m=e(168),w=e(5)(\"replace\"),b=Math.max,M=Math.min,x=o([].concat),T=o([].push),A=o(\"\".indexOf),E=o(\"\".slice),_=\"$0\"===\"a\".replace(/./,\"$0\"),S=!!/./[w]&&\"\"===/./[w](\"a\",\"$0\");s(\"replace\",(function(t,r,e){var o=S?\"$\":\"$0\";return[function(t,e){var n=d(this),o=f(t)?void 0:y(t,w);return o?i(o,t,n,e):i(r,p(n),t,e)},function(t,i){var s=a(this),u=p(t);if(\"string\"==typeof i&&-1===A(i,o)&&-1===A(i,\"$<\")){var f=e(r,s,u,i);if(f.done)return f.value}var d=h(i);d||(i=p(i));var y=s.global;if(y){var w=s.unicode;s.lastIndex=0}for(var _=[];;){var S=m(s,u);if(null===S)break;if(T(_,S),!y)break;\"\"===p(S[0])&&(s.lastIndex=v(u,l(s.lastIndex),w))}for(var B,O=\"\",R=0,k=0;k<_.length;k++){for(var F=p((S=_[k])[0]),j=b(M(c(S.index),u.length),0),D=[],I=1;I<S.length;I++)T(D,void 0===(B=S[I])?B:String(B));var P=S.groups;if(d){var C=x([F],D,j,u);void 0!==P&&T(C,P);var L=p(n(i,void 0,C))}else L=g(F,u,j,D,P,i);j>=R&&(O+=E(u,R,j)+L,R=j+F.length)}return O+E(u,R)}]}),!!u((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:\"7\"},t},\"7\"!==\"\".replace(t,\"$<a>\")}))||!_||S)},function(t,r,e){var n=e(1),i=e(14),o=Math.floor,s=n(\"\".charAt),u=n(\"\".replace),a=n(\"\".slice),h=/\\$([$&'`]|\\d{1,2}|<[^>]*>)/g,f=/\\$([$&'`]|\\d{1,2})/g;t.exports=function(t,r,e,n,c,l){var p=e+t.length,d=n.length,v=f;return void 0!==c&&(c=i(c),v=h),u(l,v,(function(i,u){var h;switch(s(u,0)){case\"$\":return\"$\";case\"&\":return t;case\"`\":return a(r,0,e);case\"'\":return a(r,p);case\"<\":h=c[a(u,1,-1)];break;default:var f=+u;if(0===f)return i;if(f>d){var l=o(f/10);return 0===l?i:l<=d?void 0===n[l-1]?s(u,1):n[l-1]+s(u,1):i}h=n[f-1]}return void 0===h?\"\":h}))}},function(t,r,e){\"use strict\";var n=r;n.Reporter=e(173).Reporter,n.DecoderBuffer=e(90).DecoderBuffer,n.EncoderBuffer=e(90).EncoderBuffer,n.Node=e(171)},function(t,r,e){\"use strict\";e(17),e(147),e(172);var n=r;n._reverse=function(t){var r={};return Object.keys(t).forEach((function(e){(0|e)==e&&(e|=0);var n=t[e];r[n]=e})),r},n.der=e(174)},,,,,,,,,,function(t,r,e){\"use strict\";var n=e(232),i=e(79);t.exports={SM2:n,utils:i}}])}));",
"type": "string"
},
{
"key": "forge_code",
"value": "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.forge=t():e.forge=t()}(this,(function(){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=32)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){(function(t){var a=r(0),n=r(35),i=e.exports=a.util=a.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error(\"Only 8, 16, 24, or 32 bits supported: \"+e)}function o(e){if(this.data=\"\",this.read=0,\"string\"==typeof e)this.data=e;else if(i.isArrayBuffer(e)||i.isArrayBufferView(e))if(\"undefined\"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString(\"binary\");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof o||\"object\"==typeof e&&\"string\"==typeof e.data&&\"number\"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if(\"undefined\"!=typeof process&&process.nextTick&&!process.browser)return i.nextTick=process.nextTick,void(\"function\"==typeof setImmediate?i.setImmediate=setImmediate:i.setImmediate=i.nextTick);if(\"function\"==typeof setImmediate)return i.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(i.nextTick=function(e){return setImmediate(e)});if(i.setImmediate=function(e){setTimeout(e,0)},\"undefined\"!=typeof window&&\"function\"==typeof window.postMessage){var e=\"forge.setImmediate\",t=[];i.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,\"*\")},window.addEventListener(\"message\",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var a=t.slice();t.length=0,a.forEach((function(e){e()}))}}),!0)}if(\"undefined\"!=typeof MutationObserver){var r=Date.now(),a=!0,n=document.createElement(\"div\");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(n,{attributes:!0});var s=i.setImmediate;i.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&n.setAttribute(\"a\",a=!a))}}i.nextTick=i.setImmediate}(),i.isNodejs=\"undefined\"!=typeof process&&process.versions&&process.versions.node,i.globalScope=function(){return i.isNodejs?t:\"undefined\"==typeof self?this:self}(),i.isArray=Array.isArray||function(e){return\"[object Array]\"===Object.prototype.toString.call(e)},i.isArrayBuffer=function(e){return\"undefined\"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},i.ByteBuffer=o,i.ByteStringBuffer=o;i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r=\"\";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},i.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},i.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},i.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},i.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},i.ByteStringBuffer.prototype.getInt32=function(){var e=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,e},i.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},i.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},i.ByteStringBuffer.prototype.getInt32Le=function(){var e=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,e},i.ByteStringBuffer.prototype.getInt=function(e){s(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t=\"\":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data=\"\",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e=\"\",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+=\"0\"),e+=r.toString(16)}return e},i.ByteStringBuffer.prototype.toString=function(){return i.decodeUtf8(this.bytes())},i.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=i.isArrayBuffer(e),a=i.isArrayBufferView(e);if(r||a)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write=\"writeOffset\"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),\"writeOffset\"in t&&(this.write=t.writeOffset)},i.DataBuffer.prototype.length=function(){return this.write-this.read},i.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},i.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),a=new Uint8Array(this.length()+t);return a.set(r),this.data=new DataView(a.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},i.DataBuffer.prototype.putBytes=function(e,t){if(i.isArrayBufferView(e)){var r=(a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-a.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(a),this.write+=r,this}if(i.isArrayBuffer(e)){var a=new Uint8Array(e);return this.accommodate(a.byteLength),new Uint8Array(this.data.buffer).set(a,this.write),this.write+=a.byteLength,this}if(e instanceof i.DataBuffer||\"object\"==typeof e&&\"number\"==typeof e.read&&\"number\"==typeof e.write&&i.isArrayBufferView(e.data)){a=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(a.byteLength),new Uint8Array(e.data.byteLength,this.write).set(a),this.write+=a.byteLength,this}if(e instanceof i.ByteStringBuffer&&(e=e.data,t=\"binary\"),t=t||\"binary\",\"string\"==typeof e){var n;if(\"hex\"===t)return this.accommodate(Math.ceil(e.length/2)),n=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.hex.decode(e,n,this.write),this;if(\"base64\"===t)return this.accommodate(3*Math.ceil(e.length/4)),n=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.base64.decode(e,n,this.write),this;if(\"utf8\"===t&&(e=i.encodeUtf8(e),t=\"binary\"),\"binary\"===t||\"raw\"===t)return this.accommodate(e.length),n=new Uint8Array(this.data.buffer,this.write),this.write+=i.binary.raw.decode(n),this;if(\"utf16\"===t)return this.accommodate(2*e.length),n=new Uint16Array(this.data.buffer,this.write),this.write+=i.text.utf16.encode(n),this;throw new Error(\"Invalid encoding: \"+t)}throw Error(\"Invalid parameter: \"+e)},i.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},i.DataBuffer.prototype.putString=function(e){return this.putBytes(e,\"utf16\")},i.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},i.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},i.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},i.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},i.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},i.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},i.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},i.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},i.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},i.DataBuffer.prototype.getInt=function(e){s(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t=\"\":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e=\"\",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+=\"0\"),e+=r.toString(16)}return e},i.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(\"binary\"===(e=e||\"utf8\")||\"raw\"===e)return i.binary.raw.encode(t);if(\"hex\"===e)return i.binary.hex.encode(t);if(\"base64\"===e)return i.binary.base64.encode(t);if(\"utf8\"===e)return i.text.utf8.decode(t);if(\"utf16\"===e)return i.text.utf16.decode(t);throw new Error(\"Invalid encoding: \"+e)},i.createBuffer=function(e,t){return t=t||\"raw\",void 0!==e&&\"utf8\"===t&&(e=i.encodeUtf8(e)),new i.ByteBuffer(e)},i.fillString=function(e,t){for(var r=\"\";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},i.xorBytes=function(e,t,r){for(var a=\"\",n=\"\",i=\"\",s=0,o=0;r>0;--r,++s)n=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(a+=i,i=\"\",o=0),i+=String.fromCharCode(n),++o;return a+=i},i.hexToBytes=function(e){var t=\"\",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},i.bytesToHex=function(e){return i.createBuffer(e).toHex()},i.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",u=[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],l=\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";i.encode64=function(e,t){for(var r,a,n,i=\"\",s=\"\",o=0;o<e.length;)r=e.charCodeAt(o++),a=e.charCodeAt(o++),n=e.charCodeAt(o++),i+=c.charAt(r>>2),i+=c.charAt((3&r)<<4|a>>4),isNaN(a)?i+=\"==\":(i+=c.charAt((15&a)<<2|n>>6),i+=isNaN(n)?\"=\":c.charAt(63&n)),t&&i.length>t&&(s+=i.substr(0,t)+\"\\r\\n\",i=i.substr(t));return s+=i},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");for(var t,r,a,n,i=\"\",s=0;s<e.length;)t=u[e.charCodeAt(s++)-43],r=u[e.charCodeAt(s++)-43],a=u[e.charCodeAt(s++)-43],n=u[e.charCodeAt(s++)-43],i+=String.fromCharCode(t<<2|r>>4),64!==a&&(i+=String.fromCharCode((15&r)<<4|a>>2),64!==n&&(i+=String.fromCharCode((3&a)<<6|n)));return i},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:n.encode,decode:n.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length));for(var n=r=r||0,i=0;i<e.length;++i)a[n++]=e.charCodeAt(i);return t?n-r:a},i.binary.hex.encode=i.bytesToHex,i.binary.hex.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(Math.ceil(e.length/2)));var n=0,i=r=r||0;for(1&e.length&&(n=1,a[i++]=parseInt(e[0],16));n<e.length;n+=2)a[i++]=parseInt(e.substr(n,2),16);return t?i-r:a},i.binary.base64.encode=function(e,t){for(var r,a,n,i=\"\",s=\"\",o=0;o<e.byteLength;)r=e[o++],a=e[o++],n=e[o++],i+=c.charAt(r>>2),i+=c.charAt((3&r)<<4|a>>4),isNaN(a)?i+=\"==\":(i+=c.charAt((15&a)<<2|n>>6),i+=isNaN(n)?\"=\":c.charAt(63&n)),t&&i.length>t&&(s+=i.substr(0,t)+\"\\r\\n\",i=i.substr(t));return s+=i},i.binary.base64.decode=function(e,t,r){var a,n,i,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");for(var c=0,l=r=r||0;c<e.length;)a=u[e.charCodeAt(c++)-43],n=u[e.charCodeAt(c++)-43],i=u[e.charCodeAt(c++)-43],s=u[e.charCodeAt(c++)-43],o[l++]=a<<2|n>>4,64!==i&&(o[l++]=(15&n)<<4|i>>2,64!==s&&(o[l++]=(3&i)<<6|s));return t?l-r:o.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,l,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,l,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,r){e=i.encodeUtf8(e);var a=t;a||(a=new Uint8Array(e.length));for(var n=r=r||0,s=0;s<e.length;++s)a[n++]=e.charCodeAt(s);return t?n-r:a},i.text.utf8.decode=function(e){return i.decodeUtf8(String.fromCharCode.apply(null,e))},i.text.utf16.encode=function(e,t,r){var a=t;a||(a=new Uint8Array(2*e.length));for(var n=new Uint16Array(a.buffer),i=r=r||0,s=r,o=0;o<e.length;++o)n[s++]=e.charCodeAt(o),i+=2;return t?i-r:a},i.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},i.deflate=function(e,t,r){if(t=i.decode64(e.deflate(i.encode64(t)).rval),r){var a=2;32&t.charCodeAt(1)&&(a=6),t=t.substring(a,t.length-4)}return t},i.inflate=function(e,t,r){var a=e.inflate(i.encode64(t)).rval;return null===a?null:i.decode64(a)};var p=function(e,t,r){if(!e)throw new Error(\"WebStorage not available.\");var a;if(null===r?a=e.removeItem(t):(r=i.encode64(JSON.stringify(r)),a=e.setItem(t,r)),void 0!==a&&!0!==a.rval){var n=new Error(a.error.message);throw n.id=a.error.id,n.name=a.error.name,n}},f=function(e,t){if(!e)throw new Error(\"WebStorage not available.\");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var a=new Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(i.decode64(r))),r},h=function(e,t,r,a){var n=f(e,t);null===n&&(n={}),n[r]=a,p(e,t,n)},d=function(e,t,r){var a=f(e,t);return null!==a&&(a=r in a?a[r]:null),a},y=function(e,t,r){var a=f(e,t);if(null!==a&&r in a){delete a[r];var n=!0;for(var i in a){n=!1;break}n&&(a=null),p(e,t,a)}},g=function(e,t){p(e,t,null)},v=function(e,t,r){var a,n=null;void 0===r&&(r=[\"web\",\"flash\"]);var i=!1,s=null;for(var o in r){a=r[o];try{if(\"flash\"===a||\"both\"===a){if(null===t[0])throw new Error(\"Flash local storage not available.\");n=e.apply(this,t),i=\"flash\"===a}\"web\"!==a&&\"both\"!==a||(t[0]=localStorage,n=e.apply(this,t),i=!0)}catch(e){s=e}if(i)break}if(!i)throw s;return n};i.setItem=function(e,t,r,a,n){v(h,arguments,n)},i.getItem=function(e,t,r,a){return v(d,arguments,a)},i.removeItem=function(e,t,r,a){v(y,arguments,a)},i.clearItems=function(e,t,r){v(g,arguments,r)},i.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},i.format=function(e){for(var t,r,a=/%./g,n=0,i=[],s=0;t=a.exec(e);){(r=e.substring(s,a.lastIndex-2)).length>0&&i.push(r),s=a.lastIndex;var o=t[0][1];switch(o){case\"s\":case\"o\":n<arguments.length?i.push(arguments[1+n++]):i.push(\"<?>\");break;case\"%\":i.push(\"%\");break;default:i.push(\"<%\"+o+\"?>\")}}return i.push(e.substring(s)),i.join(\"\")},i.formatNumber=function(e,t,r,a){var n=e,i=isNaN(t=Math.abs(t))?2:t,s=void 0===r?\",\":r,o=void 0===a?\".\":a,c=n<0?\"-\":\"\",u=parseInt(n=Math.abs(+n||0).toFixed(i),10)+\"\",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:\"\")+u.substr(l).replace(/(\\d{3})(?=\\d)/g,\"$1\"+o)+(i?s+Math.abs(n-u).toFixed(i).slice(2):\"\")},i.formatSize=function(e){return e=e>=1073741824?i.formatNumber(e/1073741824,2,\".\",\"\")+\" GiB\":e>=1048576?i.formatNumber(e/1048576,2,\".\",\"\")+\" MiB\":e>=1024?i.formatNumber(e/1024,0)+\" KiB\":i.formatNumber(e,0)+\" bytes\"},i.bytesFromIP=function(e){return-1!==e.indexOf(\".\")?i.bytesFromIPv4(e):-1!==e.indexOf(\":\")?i.bytesFromIPv6(e):null},i.bytesFromIPv4=function(e){if(4!==(e=e.split(\".\")).length)return null;for(var t=i.createBuffer(),r=0;r<e.length;++r){var a=parseInt(e[r],10);if(isNaN(a))return null;t.putByte(a)}return t.getBytes()},i.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(\":\").filter((function(e){return 0===e.length&&++t,!0}))).length+t),a=i.createBuffer(),n=0;n<8;++n)if(e[n]&&0!==e[n].length){var s=i.hexToBytes(e[n]);s.length<2&&a.putByte(0),a.putBytes(s)}else a.fillWithByte(0,r),r=0;return a.getBytes()},i.bytesToIP=function(e){return 4===e.length?i.bytesToIPv4(e):16===e.length?i.bytesToIPv6(e):null},i.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(\".\")},i.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],a=0,n=0;n<e.length;n+=2){for(var s=i.bytesToHex(e[n]+e[n+1]);\"0\"===s[0]&&\"0\"!==s;)s=s.substr(1);if(\"0\"===s){var o=r[r.length-1],c=t.length;o&&c===o.end+1?(o.end=c,o.end-o.start>r[a].end-r[a].start&&(a=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[a];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,\"\"),0===u.start&&t.unshift(\"\"),7===u.end&&t.push(\"\"))}return t.join(\":\")},i.estimateCores=function(e,t){if(\"function\"==typeof e&&(t=e,e={}),e=e||{},\"cores\"in i&&!e.update)return t(null,i.cores);if(\"undefined\"!=typeof navigator&&\"hardwareConcurrency\"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if(\"undefined\"==typeof Worker)return i.cores=1,t(null,i.cores);if(\"undefined\"==typeof Blob)return i.cores=2,t(null,i.cores);var r=URL.createObjectURL(new Blob([\"(\",function(){self.addEventListener(\"message\",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),\")()\"],{type:\"application/javascript\"}));!function e(a,n,s){if(0===n){var o=Math.floor(a.reduce((function(e,t){return e+t}),0)/a.length);return i.cores=Math.max(1,o),URL.revokeObjectURL(r),t(null,i.cores)}!function(e,t){for(var a=[],n=[],i=0;i<e;++i){var s=new Worker(r);s.addEventListener(\"message\",(function(r){if(n.push(r.data),n.length===e){for(var i=0;i<e;++i)a[i].terminate();t(null,n)}})),a.push(s)}for(i=0;i<e;++i)a[i].postMessage(i)}(s,(function(t,r){a.push(function(e,t){for(var r=[],a=0;a<e;++a)for(var n=t[a],i=r[a]=[],s=0;s<e;++s)if(a!==s){var o=t[s];(n.st>o.st&&n.st<o.et||o.st>n.st&&o.st<n.et)&&i.push(s)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(s,r)),e(a,n-1,s)}))}([],5,16)}}).call(this,r(34))},function(e,t,r){var a=r(0);r(5),r(23),r(24),r(1),a.random&&a.random.getBytes?e.exports=a.random:function(t){var r={},n=new Array(4),i=a.util.createBuffer();function s(){var e=a.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=a.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),a.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=a.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return a.aes._updateBlock(e,t,n,!1),i.putInt32(n[0]),i.putInt32(n[1]),i.putInt32(n[2]),i.putInt32(n[3]),i.getBytes()},r.increment=function(e){return++e[3],e},r.md=a.md.sha256;var o=s(),c=null,u=a.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(c=function(e){return l.getRandomValues(e)}),a.options.usePureJavaScript||!a.util.isNodejs&&!c){if(\"undefined\"==typeof window||window.document,o.collectInt(+new Date,32),\"undefined\"!=typeof navigator){var p=\"\";for(var f in navigator)try{\"string\"==typeof navigator[f]&&(p+=navigator[f])}catch(e){}o.collect(p),p=null}t&&(t().mousemove((function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)})),t().keypress((function(e){o.collectInt(e.charCode,8)})))}if(a.random)for(var f in o)a.random[f]=o[f];else a.random=o;a.random.createInstance=s,e.exports=a.random}(\"undefined\"!=typeof jQuery?jQuery:null)},function(e,t,r){var a=r(0);r(1),r(6);var n=e.exports=a.asn1=a.asn1||{};function i(e,t,r){if(r>t){var a=new Error(\"Too few bytes to parse DER.\");throw a.available=e.length(),a.remaining=t,a.requested=r,a}}n.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},n.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},n.create=function(e,t,r,i,s){if(a.util.isArray(i)){for(var o=[],c=0;c<i.length;++c)void 0!==i[c]&&o.push(i[c]);i=o}var u={tagClass:e,type:t,constructed:r,composed:r||a.util.isArray(i),value:i};return s&&\"bitStringContents\"in s&&(u.bitStringContents=s.bitStringContents,u.original=n.copy(u)),u},n.copy=function(e,t){var r;if(a.util.isArray(e)){r=[];for(var i=0;i<e.length;++i)r.push(n.copy(e[i],t));return r}return\"string\"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:n.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},n.equals=function(e,t,r){if(a.util.isArray(e)){if(!a.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var i=0;i<e.length;++i)if(!n.equals(e[i],t[i]))return!1;return!0}if(typeof e!=typeof t)return!1;if(\"string\"==typeof e)return e===t;var s=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&n.equals(e.value,t.value);return r&&r.includeBitStringContents&&(s=s&&e.bitStringContents===t.bitStringContents),s},n.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};n.fromDer=function(e,t){void 0===t&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),\"boolean\"==typeof t&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),\"strict\"in t||(t.strict=!0),\"parseAllBytes\"in t||(t.parseAllBytes=!0),\"decodeBitStrings\"in t||(t.decodeBitStrings=!0),\"string\"==typeof e&&(e=a.util.createBuffer(e));var r=e.length(),s=function e(t,r,a,s){var o;i(t,r,2);var c=t.getByte();r--;var u=192&c,l=31&c;o=t.length();var p,f,h=function(e,t){var r=e.getByte();if(t--,128!==r){var a;if(128&r){var n=127&r;i(e,t,n),a=e.getInt(n<<3)}else a=r;if(a<0)throw new Error(\"Negative length: \"+a);return a}}(t,r);if(r-=o-t.length(),void 0!==h&&h>r){if(s.strict){var d=new Error(\"Too few bytes to read ASN.1 value.\");throw d.available=t.length(),d.remaining=r,d.requested=h,d}h=r}var y=32==(32&c);if(y)if(p=[],void 0===h)for(;;){if(i(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}o=t.length(),p.push(e(t,r,a+1,s)),r-=o-t.length()}else for(;h>0;)o=t.length(),p.push(e(t,h,a+1,s)),r-=o-t.length(),h-=o-t.length();void 0===p&&u===n.Class.UNIVERSAL&&l===n.Type.BITSTRING&&(f=t.bytes(h));if(void 0===p&&s.decodeBitStrings&&u===n.Class.UNIVERSAL&&l===n.Type.BITSTRING&&h>1){var g=t.read,v=r,m=0;if(l===n.Type.BITSTRING&&(i(t,r,1),m=t.getByte(),r--),0===m)try{o=t.length();var C=e(t,r,a+1,{strict:!0,decodeBitStrings:!0}),E=o-t.length();r-=E,l==n.Type.BITSTRING&&E++;var S=C.tagClass;E!==h||S!==n.Class.UNIVERSAL&&S!==n.Class.CONTEXT_SPECIFIC||(p=[C])}catch(e){}void 0===p&&(t.read=g,r=v)}if(void 0===p){if(void 0===h){if(s.strict)throw new Error(\"Non-constructed ASN.1 object of indefinite length.\");h=r}if(l===n.Type.BMPSTRING)for(p=\"\";h>0;h-=2)i(t,r,2),p+=String.fromCharCode(t.getInt16()),r-=2;else p=t.getBytes(h),r-=h}var T=void 0===f?null:{bitStringContents:f};return n.create(u,l,y,p,T)}(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var o=new Error(\"Unparsed DER bytes remain after ASN.1 parsing.\");throw o.byteCount=r,o.remaining=e.length(),o}return s},n.toDer=function(e){var t=a.util.createBuffer(),r=e.tagClass|e.type,i=a.util.createBuffer(),s=!1;if(\"bitStringContents\"in e&&(s=!0,e.original&&(s=n.equals(e,e.original))),s)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:i.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&i.putBuffer(n.toDer(e.value[o]))}else if(e.type===n.Type.BMPSTRING)for(o=0;o<e.value.length;++o)i.putInt16(e.value.charCodeAt(o));else e.type===n.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(t.putByte(r),i.length()<=127)t.putByte(127&i.length());else{var c=i.length(),u=\"\";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(i),t},n.oidToDer=function(e){var t,r,n,i,s=e.split(\".\"),o=a.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c<s.length;++c){t=!0,r=[],n=parseInt(s[c],10);do{i=127&n,n>>>=7,t||(i|=128),r.push(i),t=!1}while(n>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},n.derToOid=function(e){var t;\"string\"==typeof e&&(e=a.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+\".\"+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+=\".\"+(n+r),n=0);return t},n.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var a=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;\"+\"!==c&&\"-\"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,a,n),t.setUTCHours(i,s,o,0),u&&(\"+\"===(c=e.charAt(u))||\"-\"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,\"+\"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},n.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),a=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;\"Z\"===e.charAt(e.length-1)&&(l=!0);var p=e.length-5,f=e.charAt(p);\"+\"!==f&&\"-\"!==f||(u=60*parseInt(e.substr(p+1,2),10)+parseInt(e.substr(p+4,2),10),u*=6e4,\"+\"===f&&(u*=-1),l=!0);return\".\"===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,a,n),t.setUTCHours(i,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,a,n),t.setHours(i,s,o,c)),t},n.dateToUtcTime=function(e){if(\"string\"==typeof e)return e;var t=\"\",r=[];r.push((\"\"+e.getUTCFullYear()).substr(2)),r.push(\"\"+(e.getUTCMonth()+1)),r.push(\"\"+e.getUTCDate()),r.push(\"\"+e.getUTCHours()),r.push(\"\"+e.getUTCMinutes()),r.push(\"\"+e.getUTCSeconds());for(var a=0;a<r.length;++a)r[a].length<2&&(t+=\"0\"),t+=r[a];return t+=\"Z\"},n.dateToGeneralizedTime=function(e){if(\"string\"==typeof e)return e;var t=\"\",r=[];r.push(\"\"+e.getUTCFullYear()),r.push(\"\"+(e.getUTCMonth()+1)),r.push(\"\"+e.getUTCDate()),r.push(\"\"+e.getUTCHours()),r.push(\"\"+e.getUTCMinutes()),r.push(\"\"+e.getUTCSeconds());for(var a=0;a<r.length;++a)r[a].length<2&&(t+=\"0\"),t+=r[a];return t+=\"Z\"},n.integerToDer=function(e){var t=a.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error(\"Integer too large; max is 32-bits.\");throw r.integer=e,r},n.derToInteger=function(e){\"string\"==typeof e&&(e=a.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error(\"Integer too large; max is 32-bits.\");return e.getSignedInt(t)},n.validate=function(e,t,r,i){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)i&&(e.tagClass!==t.tagClass&&i.push(\"[\"+t.name+'] Expected tag class \"'+t.tagClass+'\", got \"'+e.tagClass+'\"'),e.type!==t.type&&i.push(\"[\"+t.name+'] Expected type \"'+t.type+'\", got \"'+e.type+'\"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&a.util.isArray(t.value))for(var o=0,c=0;s&&c<t.value.length;++c)s=t.value[c].optional||!1,e.value[o]&&((s=n.validate(e.value[o],t.value[c],r,i))?++o:t.value[c].optional&&(s=!0)),!s&&i&&i.push(\"[\"+t.name+'] Tag class \"'+t.tagClass+'\", type \"'+t.type+'\" expected value length \"'+t.value.length+'\", got \"'+e.value.length+'\"');if(s&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&\"bitStringContents\"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&\"bitStringContents\"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]=\"\";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error(\"captureBitStringValue only supported for zero unused bits\");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else i&&i.push(\"[\"+t.name+'] Expected constructed \"'+t.constructed+'\", got \"'+e.constructed+'\"');return s};var s=/[^\\\\u0000-\\\\u00ff]/;n.prettyPrint=function(e,t,r){var i=\"\";r=r||2,(t=t||0)>0&&(i+=\"\\n\");for(var o=\"\",c=0;c<t*r;++c)o+=\" \";switch(i+=o+\"Tag: \",e.tagClass){case n.Class.UNIVERSAL:i+=\"Universal:\";break;case n.Class.APPLICATION:i+=\"Application:\";break;case n.Class.CONTEXT_SPECIFIC:i+=\"Context-Specific:\";break;case n.Class.PRIVATE:i+=\"Private:\"}if(e.tagClass===n.Class.UNIVERSAL)switch(i+=e.type,e.type){case n.Type.NONE:i+=\" (None)\";break;case n.Type.BOOLEAN:i+=\" (Boolean)\";break;case n.Type.INTEGER:i+=\" (Integer)\";break;case n.Type.BITSTRING:i+=\" (Bit string)\";break;case n.Type.OCTETSTRING:i+=\" (Octet string)\";break;case n.Type.NULL:i+=\" (Null)\";break;case n.Type.OID:i+=\" (Object Identifier)\";break;case n.Type.ODESC:i+=\" (Object Descriptor)\";break;case n.Type.EXTERNAL:i+=\" (External or Instance of)\";break;case n.Type.REAL:i+=\" (Real)\";break;case n.Type.ENUMERATED:i+=\" (Enumerated)\";break;case n.Type.EMBEDDED:i+=\" (Embedded PDV)\";break;case n.Type.UTF8:i+=\" (UTF8)\";break;case n.Type.ROID:i+=\" (Relative Object Identifier)\";break;case n.Type.SEQUENCE:i+=\" (Sequence)\";break;case n.Type.SET:i+=\" (Set)\";break;case n.Type.PRINTABLESTRING:i+=\" (Printable String)\";break;case n.Type.IA5String:i+=\" (IA5String (ASCII))\";break;case n.Type.UTCTIME:i+=\" (UTC time)\";break;case n.Type.GENERALIZEDTIME:i+=\" (Generalized time)\";break;case n.Type.BMPSTRING:i+=\" (BMP String)\"}else i+=e.type;if(i+=\"\\n\",i+=o+\"Constructed: \"+e.constructed+\"\\n\",e.composed){var u=0,l=\"\";for(c=0;c<e.value.length;++c)void 0!==e.value[c]&&(u+=1,l+=n.prettyPrint(e.value[c],t+1,r),c+1<e.value.length&&(l+=\",\"));i+=o+\"Sub values: \"+u+l}else{if(i+=o+\"Value: \",e.type===n.Type.OID){var p=n.derToOid(e.value);i+=p,a.pki&&a.pki.oids&&p in a.pki.oids&&(i+=\" (\"+a.pki.oids[p]+\") \")}if(e.type===n.Type.INTEGER)try{i+=n.derToInteger(e.value)}catch(t){i+=\"0x\"+a.util.bytesToHex(e.value)}else if(e.type===n.Type.BITSTRING){if(e.value.length>1?i+=\"0x\"+a.util.bytesToHex(e.value.slice(1)):i+=\"(none)\",e.value.length>0){var f=e.value.charCodeAt(0);1==f?i+=\" (1 unused bit shown)\":f>1&&(i+=\" (\"+f+\" unused bits shown)\")}}else if(e.type===n.Type.OCTETSTRING)s.test(e.value)||(i+=\"(\"+e.value+\") \"),i+=\"0x\"+a.util.bytesToHex(e.value);else if(e.type===n.Type.UTF8)try{i+=a.util.decodeUtf8(e.value)}catch(t){if(\"URI malformed\"!==t.message)throw t;i+=\"0x\"+a.util.bytesToHex(e.value)+\" (malformed UTF8)\"}else e.type===n.Type.PRINTABLESTRING||e.type===n.Type.IA5String?i+=e.value:s.test(e.value)?i+=\"0x\"+a.util.bytesToHex(e.value):0===e.value.length?i+=\"[null]\":i+=e.value}return i}},function(e,t,r){var a=r(0);e.exports=a.md=a.md||{},a.md.algorithms=a.md.algorithms||{}},function(e,t,r){var a=r(0);function n(e,t){a.cipher.registerAlgorithm(e,(function(){return new a.aes.Algorithm(e,t)}))}r(13),r(19),r(1),e.exports=a.aes=a.aes||{},a.aes.startEncrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!1,mode:a});return n.start(t),n},a.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.aes.startDecrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!0,mode:a});return n.start(t),n},a.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.aes.Algorithm=function(e,t){l||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},a.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if(\"string\"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(a.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=a.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=a.util.createBuffer(r);if(!a.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i){i>>>=2;for(n=0;n<i;++n)r.push(t.getInt32())}}if(!a.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error(\"Invalid key parameter.\");var s=this.mode.name,o=-1!==[\"CFB\",\"OFB\",\"CTR\",\"GCM\"].indexOf(s);this._w=f(r,e.decrypt&&!o),this._init=!0}},a.aes._expandKey=function(e,t){return l||p(),f(e,t)},a.aes._updateBlock=h,n(\"AES-ECB\",a.cipher.modes.ecb),n(\"AES-CBC\",a.cipher.modes.cbc),n(\"AES-CFB\",a.cipher.modes.cfb),n(\"AES-OFB\",a.cipher.modes.ofb),n(\"AES-CTR\",a.cipher.modes.ctr),n(\"AES-GCM\",a.cipher.modes.gcm);var i,s,o,c,u,l=!1;function p(){l=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;i=new Array(256),s=new Array(256),c=new Array(4),u=new Array(4);for(t=0;t<4;++t)c[t]=new Array(256),u[t]=new Array(256);var r,a,n,p,f,h,d,y=0,g=0;for(t=0;t<256;++t){p=(p=g^g<<1^g<<2^g<<3^g<<4)>>8^255&p^99,i[y]=p,s[p]=y,h=(f=e[p])<<24^p<<16^p<<8^p^f,d=((r=e[y])^(a=e[r])^(n=e[a]))<<24^(y^n)<<16^(y^a^n)<<8^y^r^n;for(var v=0;v<4;++v)c[v][y]=h,u[v][p]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^n]]],g^=e[e[g]])}}function f(e,t){for(var r,a=e.slice(0),n=1,s=a.length,c=4*(s+6+1),l=s;l<c;++l)r=a[l-1],l%s==0?(r=i[r>>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^o[n]<<24,n++):s>6&&l%s==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),a[l]=a[l-s]^r;if(t){for(var p,f=u[0],h=u[1],d=u[2],y=u[3],g=a.slice(0),v=(l=0,(c=a.length)-4);l<c;l+=4,v-=4)if(0===l||l===c-4)g[l]=a[v],g[l+1]=a[v+3],g[l+2]=a[v+2],g[l+3]=a[v+1];else for(var m=0;m<4;++m)p=a[v+m],g[l+(3&-m)]=f[i[p>>>24]]^h[i[p>>>16&255]]^d[i[p>>>8&255]]^y[i[255&p]];a=g}return a}function h(e,t,r,a){var n,o,l,p,f,h,d,y,g,v,m,C,E=e.length/4-1;a?(n=u[0],o=u[1],l=u[2],p=u[3],f=s):(n=c[0],o=c[1],l=c[2],p=c[3],f=i),h=t[0]^e[0],d=t[a?3:1]^e[1],y=t[2]^e[2],g=t[a?1:3]^e[3];for(var S=3,T=1;T<E;++T)v=n[h>>>24]^o[d>>>16&255]^l[y>>>8&255]^p[255&g]^e[++S],m=n[d>>>24]^o[y>>>16&255]^l[g>>>8&255]^p[255&h]^e[++S],C=n[y>>>24]^o[g>>>16&255]^l[h>>>8&255]^p[255&d]^e[++S],g=n[g>>>24]^o[h>>>16&255]^l[d>>>8&255]^p[255&y]^e[++S],h=v,d=m,y=C;r[0]=f[h>>>24]<<24^f[d>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^e[++S],r[a?3:1]=f[d>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&h]^e[++S],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[h>>>8&255]<<8^f[255&d]^e[++S],r[a?1:3]=f[g>>>24]<<24^f[h>>>16&255]<<16^f[d>>>8&255]<<8^f[255&y]^e[++S]}function d(e){var t,r=\"AES-\"+((e=e||{}).mode||\"CBC\").toUpperCase(),n=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof a.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}},function(e,t,r){var a=r(0);a.pki=a.pki||{};var n=e.exports=a.pki.oids=a.oids=a.oids||{};function i(e,t){n[e]=t,n[t]=e}function s(e,t){n[e]=t}i(\"1.2.840.113549.1.1.1\",\"rsaEncryption\"),i(\"1.2.840.113549.1.1.4\",\"md5WithRSAEncryption\"),i(\"1.2.840.113549.1.1.5\",\"sha1WithRSAEncryption\"),i(\"1.2.840.113549.1.1.7\",\"RSAES-OAEP\"),i(\"1.2.840.113549.1.1.8\",\"mgf1\"),i(\"1.2.840.113549.1.1.9\",\"pSpecified\"),i(\"1.2.840.113549.1.1.10\",\"RSASSA-PSS\"),i(\"1.2.840.113549.1.1.11\",\"sha256WithRSAEncryption\"),i(\"1.2.840.113549.1.1.12\",\"sha384WithRSAEncryption\"),i(\"1.2.840.113549.1.1.13\",\"sha512WithRSAEncryption\"),i(\"1.3.101.112\",\"EdDSA25519\"),i(\"1.2.840.10040.4.3\",\"dsa-with-sha1\"),i(\"1.3.14.3.2.7\",\"desCBC\"),i(\"1.3.14.3.2.26\",\"sha1\"),i(\"1.3.14.3.2.29\",\"sha1WithRSASignature\"),i(\"2.16.840.1.101.3.4.2.1\",\"sha256\"),i(\"2.16.840.1.101.3.4.2.2\",\"sha384\"),i(\"2.16.840.1.101.3.4.2.3\",\"sha512\"),i(\"2.16.840.1.101.3.4.2.4\",\"sha224\"),i(\"2.16.840.1.101.3.4.2.5\",\"sha512-224\"),i(\"2.16.840.1.101.3.4.2.6\",\"sha512-256\"),i(\"1.2.840.113549.2.2\",\"md2\"),i(\"1.2.840.113549.2.5\",\"md5\"),i(\"1.2.840.113549.1.7.1\",\"data\"),i(\"1.2.840.113549.1.7.2\",\"signedData\"),i(\"1.2.840.113549.1.7.3\",\"envelopedData\"),i(\"1.2.840.113549.1.7.4\",\"signedAndEnvelopedData\"),i(\"1.2.840.113549.1.7.5\",\"digestedData\"),i(\"1.2.840.113549.1.7.6\",\"encryptedData\"),i(\"1.2.840.113549.1.9.1\",\"emailAddress\"),i(\"1.2.840.113549.1.9.2\",\"unstructuredName\"),i(\"1.2.840.113549.1.9.3\",\"contentType\"),i(\"1.2.840.113549.1.9.4\",\"messageDigest\"),i(\"1.2.840.113549.1.9.5\",\"signingTime\"),i(\"1.2.840.113549.1.9.6\",\"counterSignature\"),i(\"1.2.840.113549.1.9.7\",\"challengePassword\"),i(\"1.2.840.113549.1.9.8\",\"unstructuredAddress\"),i(\"1.2.840.113549.1.9.14\",\"extensionRequest\"),i(\"1.2.840.113549.1.9.20\",\"friendlyName\"),i(\"1.2.840.113549.1.9.21\",\"localKeyId\"),i(\"1.2.840.113549.1.9.22.1\",\"x509Certificate\"),i(\"1.2.840.113549.1.12.10.1.1\",\"keyBag\"),i(\"1.2.840.113549.1.12.10.1.2\",\"pkcs8ShroudedKeyBag\"),i(\"1.2.840.113549.1.12.10.1.3\",\"certBag\"),i(\"1.2.840.113549.1.12.10.1.4\",\"crlBag\"),i(\"1.2.840.113549.1.12.10.1.5\",\"secretBag\"),i(\"1.2.840.113549.1.12.10.1.6\",\"safeContentsBag\"),i(\"1.2.840.113549.1.5.13\",\"pkcs5PBES2\"),i(\"1.2.840.113549.1.5.12\",\"pkcs5PBKDF2\"),i(\"1.2.840.113549.1.12.1.1\",\"pbeWithSHAAnd128BitRC4\"),i(\"1.2.840.113549.1.12.1.2\",\"pbeWithSHAAnd40BitRC4\"),i(\"1.2.840.113549.1.12.1.3\",\"pbeWithSHAAnd3-KeyTripleDES-CBC\"),i(\"1.2.840.113549.1.12.1.4\",\"pbeWithSHAAnd2-KeyTripleDES-CBC\"),i(\"1.2.840.113549.1.12.1.5\",\"pbeWithSHAAnd128BitRC2-CBC\"),i(\"1.2.840.113549.1.12.1.6\",\"pbewithSHAAnd40BitRC2-CBC\"),i(\"1.2.840.113549.2.7\",\"hmacWithSHA1\"),i(\"1.2.840.113549.2.8\",\"hmacWithSHA224\"),i(\"1.2.840.113549.2.9\",\"hmacWithSHA256\"),i(\"1.2.840.113549.2.10\",\"hmacWithSHA384\"),i(\"1.2.840.113549.2.11\",\"hmacWithSHA512\"),i(\"1.2.840.113549.3.7\",\"des-EDE3-CBC\"),i(\"2.16.840.1.101.3.4.1.2\",\"aes128-CBC\"),i(\"2.16.840.1.101.3.4.1.22\",\"aes192-CBC\"),i(\"2.16.840.1.101.3.4.1.42\",\"aes256-CBC\"),i(\"2.5.4.3\",\"commonName\"),i(\"2.5.4.4\",\"surname\"),i(\"2.5.4.5\",\"serialNumber\"),i(\"2.5.4.6\",\"countryName\"),i(\"2.5.4.7\",\"localityName\"),i(\"2.5.4.8\",\"stateOrProvinceName\"),i(\"2.5.4.9\",\"streetAddress\"),i(\"2.5.4.10\",\"organizationName\"),i(\"2.5.4.11\",\"organizationalUnitName\"),i(\"2.5.4.12\",\"title\"),i(\"2.5.4.13\",\"description\"),i(\"2.5.4.15\",\"businessCategory\"),i(\"2.5.4.17\",\"postalCode\"),i(\"2.5.4.42\",\"givenName\"),i(\"1.3.6.1.4.1.311.60.2.1.2\",\"jurisdictionOfIncorporationStateOrProvinceName\"),i(\"1.3.6.1.4.1.311.60.2.1.3\",\"jurisdictionOfIncorporationCountryName\"),i(\"2.16.840.1.113730.1.1\",\"nsCertType\"),i(\"2.16.840.1.113730.1.13\",\"nsComment\"),s(\"2.5.29.1\",\"authorityKeyIdentifier\"),s(\"2.5.29.2\",\"keyAttributes\"),s(\"2.5.29.3\",\"certificatePolicies\"),s(\"2.5.29.4\",\"keyUsageRestriction\"),s(\"2.5.29.5\",\"policyMapping\"),s(\"2.5.29.6\",\"subtreesConstraint\"),s(\"2.5.29.7\",\"subjectAltName\"),s(\"2.5.29.8\",\"issuerAltName\"),s(\"2.5.29.9\",\"subjectDirectoryAttributes\"),s(\"2.5.29.10\",\"basicConstraints\"),s(\"2.5.29.11\",\"nameConstraints\"),s(\"2.5.29.12\",\"policyConstraints\"),s(\"2.5.29.13\",\"basicConstraints\"),i(\"2.5.29.14\",\"subjectKeyIdentifier\"),i(\"2.5.29.15\",\"keyUsage\"),s(\"2.5.29.16\",\"privateKeyUsagePeriod\"),i(\"2.5.29.17\",\"subjectAltName\"),i(\"2.5.29.18\",\"issuerAltName\"),i(\"2.5.29.19\",\"basicConstraints\"),s(\"2.5.29.20\",\"cRLNumber\"),s(\"2.5.29.21\",\"cRLReason\"),s(\"2.5.29.22\",\"expirationDate\"),s(\"2.5.29.23\",\"instructionCode\"),s(\"2.5.29.24\",\"invalidityDate\"),s(\"2.5.29.25\",\"cRLDistributionPoints\"),s(\"2.5.29.26\",\"issuingDistributionPoint\"),s(\"2.5.29.27\",\"deltaCRLIndicator\"),s(\"2.5.29.28\",\"issuingDistributionPoint\"),s(\"2.5.29.29\",\"certificateIssuer\"),s(\"2.5.29.30\",\"nameConstraints\"),i(\"2.5.29.31\",\"cRLDistributionPoints\"),i(\"2.5.29.32\",\"certificatePolicies\"),s(\"2.5.29.33\",\"policyMappings\"),s(\"2.5.29.34\",\"policyConstraints\"),i(\"2.5.29.35\",\"authorityKeyIdentifier\"),s(\"2.5.29.36\",\"policyConstraints\"),i(\"2.5.29.37\",\"extKeyUsage\"),s(\"2.5.29.46\",\"freshestCRL\"),s(\"2.5.29.54\",\"inhibitAnyPolicy\"),i(\"1.3.6.1.4.1.11129.2.4.2\",\"timestampList\"),i(\"1.3.6.1.5.5.7.1.1\",\"authorityInfoAccess\"),i(\"1.3.6.1.5.5.7.3.1\",\"serverAuth\"),i(\"1.3.6.1.5.5.7.3.2\",\"clientAuth\"),i(\"1.3.6.1.5.5.7.3.3\",\"codeSigning\"),i(\"1.3.6.1.5.5.7.3.4\",\"emailProtection\"),i(\"1.3.6.1.5.5.7.3.8\",\"timeStamping\")},function(e,t,r){var a=r(0);r(1);var n=e.exports=a.pem=a.pem||{};function i(e){for(var t=e.name+\": \",r=[],a=function(e,t){return\" \"+t},n=0;n<e.values.length;++n)r.push(e.values[n].replace(/^(\\S+\\r\\n)/,a));t+=r.join(\",\")+\"\\r\\n\";var i=0,s=-1;for(n=0;n<t.length;++n,++i)if(i>65&&-1!==s){var o=t[s];\",\"===o?(++s,t=t.substr(0,s)+\"\\r\\n \"+t.substr(s)):t=t.substr(0,s)+\"\\r\\n\"+o+t.substr(s+1),i=n-s-1,s=-1,++n}else\" \"!==t[n]&&\"\\t\"!==t[n]&&\",\"!==t[n]||(s=n);return t}function s(e){return e.replace(/^\\s+/,\"\")}n.encode=function(e,t){t=t||{};var r,n=\"-----BEGIN \"+e.type+\"-----\\r\\n\";if(e.procType&&(n+=i(r={name:\"Proc-Type\",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(n+=i(r={name:\"Content-Domain\",values:[e.contentDomain]})),e.dekInfo&&(r={name:\"DEK-Info\",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),n+=i(r)),e.headers)for(var s=0;s<e.headers.length;++s)n+=i(e.headers[s]);return e.procType&&(n+=\"\\r\\n\"),n+=a.util.encode64(e.body,t.maxline||64)+\"\\r\\n\",n+=\"-----END \"+e.type+\"-----\\r\\n\"},n.decode=function(e){for(var t,r=[],n=/\\s*-----BEGIN ([A-Z0-9- ]+)-----\\r?\\n?([\\x21-\\x7e\\s]+?(?:\\r?\\n\\r?\\n))?([:A-Za-z0-9+\\/=\\s]+?)-----END \\1-----/g,i=/([\\x21-\\x7e]+):\\s*([\\x21-\\x7e\\s^:]+)/,o=/\\r?\\n/;t=n.exec(e);){var c=t[1];\"NEW CERTIFICATE REQUEST\"===c&&(c=\"CERTIFICATE REQUEST\");var u={type:c,procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(t[3])};if(r.push(u),t[2]){for(var l=t[2].split(o),p=0;t&&p<l.length;){for(var f=l[p].replace(/\\s+$/,\"\"),h=p+1;h<l.length;++h){var d=l[h];if(!/\\s/.test(d[0]))break;f+=d,p=h}if(t=f.match(i)){for(var y={name:t[1],values:[]},g=t[2].split(\",\"),v=0;v<g.length;++v)y.values.push(s(g[v]));if(u.procType)if(u.contentDomain||\"Content-Domain\"!==y.name)if(u.dekInfo||\"DEK-Info\"!==y.name)u.headers.push(y);else{if(0===y.values.length)throw new Error('Invalid PEM formatted message. The \"DEK-Info\" header must have at least one subfield.');u.dekInfo={algorithm:g[0],parameters:g[1]||null}}else u.contentDomain=g[0]||\"\";else{if(\"Proc-Type\"!==y.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be \"Proc-Type\".');if(2!==y.values.length)throw new Error('Invalid PEM formatted message. The \"Proc-Type\" header must have two subfields.');u.procType={version:g[0],type:g[1]}}}++p}if(\"ENCRYPTED\"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The \"DEK-Info\" header must be present if \"Proc-Type\" is \"ENCRYPTED\".')}}if(0===r.length)throw new Error(\"Invalid PEM formatted message.\");return r}},function(e,t,r){var a=r(0);r(4),r(1),(e.exports=a.hmac=a.hmac||{}).create=function(){var e=null,t=null,r=null,n=null,i={start:function(i,s){if(null!==i)if(\"string\"==typeof i){if(!((i=i.toLowerCase())in a.md.algorithms))throw new Error('Unknown hash algorithm \"'+i+'\"');t=a.md.algorithms[i].create()}else t=i;if(null===s)s=e;else{if(\"string\"==typeof s)s=a.util.createBuffer(s);else if(a.util.isArray(s)){var o=s;s=a.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var u=s.length();u>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=a.util.createBuffer(),n=a.util.createBuffer(),u=s.length();for(c=0;c<u;++c){o=s.at(c);r.putByte(54^o),n.putByte(92^o)}if(u<t.blockLength)for(o=t.blockLength-u,c=0;c<o;++c)r.putByte(54),n.putByte(92);e=s,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(n),t.update(e),t.digest()}};return i.digest=i.getMac,i}},function(e,t,r){var a=r(0);r(4),r(1);var n=e.exports=a.sha1=a.sha1||{};a.md.sha1=a.md.algorithms.sha1=n,n.create=function(){s||(i=String.fromCharCode(128),i+=a.util.fillString(String.fromCharCode(0),64),s=!0);var e=null,t=a.util.createBuffer(),r=new Array(80),n={algorithm:\"sha1\",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,i=0;i<r;++i)n.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n}};return n.start(),n.update=function(i,s){\"utf8\"===s&&(i=a.util.encodeUtf8(i));var c=i.length;n.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=c[1],c[1]=c[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(i),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var c,u=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-u));for(var l=8*n.fullMessageLength[0],p=0;p<n.fullMessageLength.length-1;++p)l+=(c=8*n.fullMessageLength[p+1])/4294967296>>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(f,r,s);var h=a.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var i=null,s=!1;function o(e,t,r){for(var a,n,i,s,o,c,u,l=r.length();l>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)a=r.getInt32(),t[u]=a,a=(n<<5|n>>>27)+(o^i&(s^o))+c+1518500249+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<20;++u)a=(a=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|a>>>31,t[u]=a,a=(n<<5|n>>>27)+(o^i&(s^o))+c+1518500249+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<32;++u)a=(a=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|a>>>31,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+1859775393+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<40;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+1859775393+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<60;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i&s|o&(i^s))+c+2400959708+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<80;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+3395469782+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,l-=64}}},function(e,t,r){var a=r(0);function n(e,t){a.cipher.registerAlgorithm(e,(function(){return new a.des.Algorithm(e,t)}))}r(13),r(19),r(1),e.exports=a.des=a.des||{},a.des.startEncrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!1,mode:a||(null===t?\"ECB\":\"CBC\")});return n.start(t),n},a.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.des.startDecrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!0,mode:a||(null===t?\"ECB\":\"CBC\")});return n.start(t),n},a.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},a.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=a.util.createBuffer(e.key);if(0===this.name.indexOf(\"3DES\")&&24!==t.length())throw new Error(\"Invalid Triple-DES key size: \"+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[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],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],p=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[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],g=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<g;E++){var S=e.getInt32(),T=e.getInt32();S^=(t=252645135&(S>>>4^T))<<4,S^=t=65535&((T^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(T^=t<<-16)))<<2,S^=t=65535&((T^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(T^=t<<-16)))<<1,S^=t=16711935&((T^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(T^=t<<8)))<<1)<<8|(T^=t)>>>20&240,S=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=t;for(var I=0;I<m.length;++I){m[I]?(S=S<<2|S>>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27);var A=r[(S&=-15)>>>28]|a[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],B=u[(T&=-15)>>>28]|l[T>>>24&15]|p[T>>>20&15]|f[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=65535&(B>>>16^A),v[C++]=A^t,v[C++]=B^t<<16}}return v}(t),this._init=!0}},n(\"DES-ECB\",a.cipher.modes.ecb),n(\"DES-CBC\",a.cipher.modes.cbc),n(\"DES-CFB\",a.cipher.modes.cfb),n(\"DES-OFB\",a.cipher.modes.ofb),n(\"DES-CTR\",a.cipher.modes.ctr),n(\"3DES-ECB\",a.cipher.modes.ecb),n(\"3DES-CBC\",a.cipher.modes.cbc),n(\"3DES-CFB\",a.cipher.modes.cfb),n(\"3DES-OFB\",a.cipher.modes.ofb),n(\"3DES-CTR\",a.cipher.modes.ctr);var i=[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],s=[-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],o=[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],c=[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],u=[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],l=[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],p=[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],f=[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 h(e,t,r,a){var n,h,d=32===e.length?3:9;n=3===d?a?[30,-2,-2]:[0,32,2]:a?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(h=252645135&(y>>>4^g))<<4,y^=(h=65535&(y>>>16^(g^=h)))<<16,y^=h=858993459&((g^=h)>>>2^y),y^=h=16711935&((g^=h<<2)>>>8^y),y=(y^=(h=1431655765&(y>>>1^(g^=h<<8)))<<1)<<1|y>>>31,g=(g^=h)<<1|g>>>31;for(var v=0;v<d;v+=3){for(var m=n[v+1],C=n[v+2],E=n[v];E!=m;E+=C){var S=g^e[E],T=(g>>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|f[63&S]|i[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|p[63&T])}h=y,y=g,g=h}g=g>>>1|g<<31,g^=h=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(h=16711935&(g>>>8^(y^=h<<1)))<<8,g^=(h=858993459&(g>>>2^(y^=h)))<<2,g^=h=65535&((y^=h)>>>16^g),g^=h=252645135&((y^=h<<16)>>>4^g),y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r=\"DES-\"+((e=e||{}).mode||\"CBC\").toUpperCase(),n=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof a.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}},function(e,t,r){var a=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===n)var n=a.jsbn.BigInteger;var i=a.util.isNodejs?r(16):null,s=a.asn1,o=a.util;a.pki=a.pki||{},e.exports=a.pki.rsa=a.rsa=a.rsa||{};var c=a.pki,u=[6,4,2,4,2,4,6,2],l={name:\"PrivateKeyInfo\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"PrivateKeyInfo.version\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyVersion\"},{name:\"PrivateKeyInfo.privateKeyAlgorithm\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"AlgorithmIdentifier.algorithm\",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:\"privateKeyOid\"}]},{name:\"PrivateKeyInfo\",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:\"privateKey\"}]},p={name:\"RSAPrivateKey\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"RSAPrivateKey.version\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyVersion\"},{name:\"RSAPrivateKey.modulus\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyModulus\"},{name:\"RSAPrivateKey.publicExponent\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyPublicExponent\"},{name:\"RSAPrivateKey.privateExponent\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyPrivateExponent\"},{name:\"RSAPrivateKey.prime1\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyPrime1\"},{name:\"RSAPrivateKey.prime2\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyPrime2\"},{name:\"RSAPrivateKey.exponent1\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyExponent1\"},{name:\"RSAPrivateKey.exponent2\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyExponent2\"},{name:\"RSAPrivateKey.coefficient\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"privateKeyCoefficient\"}]},f={name:\"RSAPublicKey\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"RSAPublicKey.modulus\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"publicKeyModulus\"},{name:\"RSAPublicKey.exponent\",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:\"publicKeyExponent\"}]},h=a.pki.rsa.publicKeyValidator={name:\"SubjectPublicKeyInfo\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:\"subjectPublicKeyInfo\",value:[{name:\"SubjectPublicKeyInfo.AlgorithmIdentifier\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"AlgorithmIdentifier.algorithm\",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:\"publicKeyOid\"}]},{name:\"SubjectPublicKeyInfo.subjectPublicKey\",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:\"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:\"rsaPublicKey\"}]}]},d={name:\"DigestInfo\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"DigestInfo.DigestAlgorithm\",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:\"DigestInfo.DigestAlgorithm.algorithmIdentifier\",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:\"algorithmIdentifier\"},{name:\"DigestInfo.DigestAlgorithm.parameters\",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:\"parameters\",optional:!0,constructed:!1}]},{name:\"DigestInfo.digest\",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:\"digest\"}]},y=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error(\"Unknown message digest algorithm.\");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var a=s.oidToDer(t).getBytes(),n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);i.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,a)),i.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,\"\"));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(i),n.value.push(o),s.toDer(n).getBytes()},g=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var i;t.dP||(t.dP=t.d.mod(t.p.subtract(n.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(n.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{i=new n(a.util.bytesToHex(a.random.getBytes(t.n.bitLength()/8)),16)}while(i.compareTo(t.n)>=0||!i.gcd(t.n).equals(n.ONE));for(var s=(e=e.multiply(i.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c=c.multiply(i.modInverse(t.n)).mod(t.n)};function v(e,t,r){var n=a.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error(\"Message is too long for PKCS#1 v1.5 padding.\");throw s.length=e.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o,c=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u<c;++u)n.putByte(o)}else for(;c>0;){var l=0,p=a.random.getBytes(c);for(u=0;u<c;++u)0===(o=p.charCodeAt(u))?++l:n.putByte(o);c=l}return n.putByte(0),n.putBytes(e),n}function m(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),s=a.util.createBuffer(e),o=s.getByte(),c=s.getByte();if(0!==o||r&&0!==c&&1!==c||!r&&2!=c||r&&0===c&&void 0===n)throw new Error(\"Encryption block is invalid.\");var u=0;if(0===c){u=i-3-n;for(var l=0;l<u;++l)if(0!==s.getByte())throw new Error(\"Encryption block is invalid.\")}else if(1===c)for(u=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==i-3-s.length())throw new Error(\"Encryption block is invalid.\");return s.getBytes()}function C(e,t,r){\"function\"==typeof t&&(r=t,t={});var i={algorithm:{name:(t=t||{}).algorithm||\"PRIMEINC\",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,a){return t?r(t):(e.p=a,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){a.prime.generateProbablePrime(e,i,t)}function u(t,a){if(t)return r(t);if(e.q=a,e.p.compareTo(e.q)<0){var i=e.p;e.p=e.q,e.q=i}if(0!==e.p.subtract(n.ONE).gcd(e.e).compareTo(n.ONE))return e.p=null,void s();if(0!==e.q.subtract(n.ONE).gcd(e.e).compareTo(n.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(n.ONE),e.q1=e.q.subtract(n.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(n.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}\"prng\"in t&&(i.prng=t.prng),s()}function E(e){var t=e.toString(16);t[0]>=\"8\"&&(t=\"00\"+t);var r=a.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function S(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function T(e){return a.util.isNodejs&&\"function\"==typeof i[e]}function I(e){return void 0!==o.globalScope&&\"object\"==typeof o.globalScope.crypto&&\"object\"==typeof o.globalScope.crypto.subtle&&\"function\"==typeof o.globalScope.crypto.subtle[e]}function A(e){return void 0!==o.globalScope&&\"object\"==typeof o.globalScope.msCrypto&&\"object\"==typeof o.globalScope.msCrypto.subtle&&\"function\"==typeof o.globalScope.msCrypto.subtle[e]}function B(e){for(var t=a.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}c.rsa.encrypt=function(e,t,r){var i,s=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,i=v(e,t,r)):(i=a.util.createBuffer()).putBytes(e);for(var c=new n(i.toHex(),16),u=g(c,t,s).toString(16),l=a.util.createBuffer(),p=o-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(a.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error(\"Encrypted message length is invalid.\");throw o.length=e.length,o.expected=s,o}var c=new n(a.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error(\"Encrypted message is invalid.\");for(var u=g(c,t,r).toString(16),l=a.util.createBuffer(),p=s-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(a.util.hexToBytes(u)),!1!==i?m(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){\"string\"==typeof e&&(e=parseInt(e,10)),e=e||2048;var i,s=(r=r||{}).prng||a.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},c=r.algorithm||\"PRIMEINC\";if(\"PRIMEINC\"!==c)throw new Error(\"Invalid key generation algorithm: \"+c);return(i={algorithm:c,state:0,bits:e,rng:o,eInt:t||65537,e:new n(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},c.rsa.stepKeyPairGenerationState=function(e,t){\"algorithm\"in e||(e.algorithm=\"PRIMEINC\");var r=new n(null);r.fromInt(30);for(var a,i=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var p=null===e.p?e.pBits:e.qBits,f=p-1;0===e.pqState?(e.num=new n(p,e.rng),e.num.testBit(f)||e.num.bitwiseTo(n.ONE.shiftLeft(f),s,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>p?e.pqState=0:e.num.isProbablePrime(S(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(n.ONE).gcd(e.e).compareTo(n.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(n.ONE),e.q1=e.q.subtract(n.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(n.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(a=+new Date)-o,o=a}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?\"object\"==typeof e?(r=e,e=void 0):\"function\"==typeof e&&(n=e,e=void 0):2===arguments.length?\"number\"==typeof e?\"function\"==typeof t?(n=t,t=void 0):\"number\"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&(\"number\"==typeof t?\"function\"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!a.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(T(\"generateKeyPair\"))return i.generateKeyPair(\"rsa\",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:\"spki\",format:\"pem\"},privateKeyEncoding:{type:\"pkcs8\",format:\"pem\"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(I(\"generateKey\")&&I(\"exportKey\"))return o.globalScope.crypto.subtle.generateKey({name:\"RSASSA-PKCS1-v1_5\",modulusLength:e,publicExponent:B(t),hash:{name:\"SHA-256\"}},!0,[\"sign\",\"verify\"]).then((function(e){return o.globalScope.crypto.subtle.exportKey(\"pkcs8\",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(e)));n(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(A(\"generateKey\")&&A(\"exportKey\")){var u=o.globalScope.msCrypto.subtle.generateKey({name:\"RSASSA-PKCS1-v1_5\",modulusLength:e,publicExponent:B(t),hash:{name:\"SHA-256\"}},!0,[\"sign\",\"verify\"]);return u.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey(\"pkcs8\",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(t)));n(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(u.onerror=function(e){n(e)})}}else if(T(\"generateKeyPairSync\")){var l=i.generateKeyPairSync(\"rsa\",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:\"spki\",format:\"pem\"},privateKeyEncoding:{type:\"pkcs8\",format:\"pem\"}});return{privateKey:c.privateKeyFromPem(l.privateKey),publicKey:c.publicKeyFromPem(l.publicKey)}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!n)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;C(p,r,n)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){if(\"string\"==typeof t?t=t.toUpperCase():void 0===t&&(t=\"RSAES-PKCS1-V1_5\"),\"RSAES-PKCS1-V1_5\"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if(\"RSA-OAEP\"===t||\"RSAES-OAEP\"===t)t={encode:function(e,t){return a.pkcs1.encode_rsa_oaep(t,e,n)}};else if(-1!==[\"RAW\",\"NONE\",\"NULL\",null].indexOf(t))t={encode:function(e){return e}};else if(\"string\"==typeof t)throw new Error('Unsupported encryption scheme: \"'+t+'\".');var i=t.encode(e,r,!0);return c.rsa.encrypt(i,r,!0)},verify:function(e,t,n,i){\"string\"==typeof n?n=n.toUpperCase():void 0===n&&(n=\"RSASSA-PKCS1-V1_5\"),void 0===i&&(i={_parseAllDigestBytes:!0}),\"_parseAllDigestBytes\"in i||(i._parseAllDigestBytes=!0),\"RSASSA-PKCS1-V1_5\"===n?n={verify:function(e,t){t=m(t,r,!0);var n=s.fromDer(t,{parseAllBytes:i._parseAllDigestBytes}),o={},c=[];if(!s.validate(n,d,o,c))throw(u=new Error(\"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.\")).errors=c,u;var u,l=s.derToOid(o.algorithmIdentifier);if(l!==a.oids.md2&&l!==a.oids.md5&&l!==a.oids.sha1&&l!==a.oids.sha224&&l!==a.oids.sha256&&l!==a.oids.sha384&&l!==a.oids.sha512&&l!==a.oids[\"sha512-224\"]&&l!==a.oids[\"sha512-256\"])throw(u=new Error(\"Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.\")).oid=l,u;if((l===a.oids.md2||l===a.oids.md5)&&!(\"parameters\"in o))throw new Error(\"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.\");return e===o.digest}}:\"NONE\"!==n&&\"NULL\"!==n&&null!==n||(n={verify:function(e,t){return e===(t=m(t,r,!0))}});var o=c.rsa.decrypt(t,r,!0,!1);return n.verify(e,o,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,n,i,s,o,u){var l={n:e,e:t,d:r,p:n,q:i,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){\"string\"==typeof t?t=t.toUpperCase():void 0===t&&(t=\"RSAES-PKCS1-V1_5\");var n=c.rsa.decrypt(e,l,!1,!1);if(\"RSAES-PKCS1-V1_5\"===t)t={decode:m};else if(\"RSA-OAEP\"===t||\"RSAES-OAEP\"===t)t={decode:function(e,t){return a.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===[\"RAW\",\"NONE\",\"NULL\",null].indexOf(t))throw new Error('Unsupported encryption scheme: \"'+t+'\".');t={decode:function(e){return e}}}return t.decode(n,l,!1)},sign:function(e,t){var r=!1;\"string\"==typeof t&&(t=t.toUpperCase()),void 0===t||\"RSASSA-PKCS1-V1_5\"===t?(t={encode:y},r=1):\"NONE\"!==t&&\"NULL\"!==t&&null!==t||(t={encode:function(){return e}},r=1);var a=t.encode(e,l.n.bitLength());return c.rsa.encrypt(a,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,\"\")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,i,o,u,f,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(a.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,p,y,g)){var v=new Error(\"Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.\");throw v.errors=g,v}return t=a.util.createBuffer(y.privateKeyModulus).toHex(),r=a.util.createBuffer(y.privateKeyPublicExponent).toHex(),i=a.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=a.util.createBuffer(y.privateKeyPrime1).toHex(),u=a.util.createBuffer(y.privateKeyPrime2).toHex(),f=a.util.createBuffer(y.privateKeyExponent1).toHex(),h=a.util.createBuffer(y.privateKeyExponent2).toHex(),d=a.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new n(t,16),new n(r,16),new n(i,16),new n(o,16),new n(u,16),new n(f,16),new n(h,16),new n(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var i,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(i=new Error(\"Cannot read public key. Unknown OID.\")).oid=o,i;e=t.rsaPublicKey}if(r=[],!s.validate(e,f,t,r))throw(i=new Error(\"Cannot read public key. ASN.1 object does not contain an RSAPublicKey.\")).errors=r,i;var u=a.util.createBuffer(t.publicKeyModulus).toHex(),l=a.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new n(u,16),new n(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,\"\")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,E(e.e))])}},function(e,t,r){var a,n=r(0);e.exports=n.jsbn=n.jsbn||{};function i(e,t,r){this.data=[],null!=e&&(\"number\"==typeof e?this.fromNumber(e,t,r):null==t&&\"string\"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new i(null)}function o(e,t,r,a,n,i){for(var s=16383&t,o=t>>14;--i>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;n=((c=s*c+((16383&l)<<14)+r.data[a]+n)>>28)+(l>>14)+o*u,r.data[a++]=268435455&c}return n}n.jsbn.BigInteger=i,\"undefined\"==typeof navigator?(i.prototype.am=o,a=28):\"Microsoft Internet Explorer\"==navigator.appName?(i.prototype.am=function(e,t,r,a,n,i){for(var s=32767&t,o=t>>15;--i>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;n=((c=s*c+((32767&l)<<15)+r.data[a]+(1073741823&n))>>>30)+(l>>>15)+o*u+(n>>>30),r.data[a++]=1073741823&c}return n},a=30):\"Netscape\"!=navigator.appName?(i.prototype.am=function(e,t,r,a,n,i){for(;--i>=0;){var s=t*this.data[e++]+r.data[a]+n;n=Math.floor(s/67108864),r.data[a++]=67108863&s}return n},a=26):(i.prototype.am=o,a=28),i.prototype.DB=a,i.prototype.DM=(1<<a)-1,i.prototype.DV=1<<a;i.prototype.FV=Math.pow(2,52),i.prototype.F1=52-a,i.prototype.F2=2*a-52;var c,u,l=new Array;for(c=\"0\".charCodeAt(0),u=0;u<=9;++u)l[c++]=u;for(c=\"a\".charCodeAt(0),u=10;u<36;++u)l[c++]=u;for(c=\"A\".charCodeAt(0),u=10;u<36;++u)l[c++]=u;function p(e){return\"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(e)}function f(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=s();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function v(e,t){return e&t}function m(e,t){return e|t}function C(e,t){return e^t}function E(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function T(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function I(){}function A(e){return e}function B(e){this.r2=s(),this.q3=s(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],a=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,a,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var a=e.length,n=!1,s=0;--a>=0;){var o=8==r?255&e[a]:f(e,a);o<0?\"-\"==e.charAt(a)&&(n=!0):(n=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this.data[this.t++]=o>>this.DB-s):this.data[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&i.ZERO.subTo(this,this)},i.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},i.prototype.lShiftTo=function(e,t){var r,a=e%this.DB,n=this.DB-a,i=(1<<n)-1,s=Math.floor(e/this.DB),o=this.s<<a&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>n|o,o=(this.data[r]&i)<<a;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var a=e%this.DB,n=this.DB-a,i=(1<<a)-1;t.data[0]=this.data[r]>>a;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&i)<<n,t.data[s-r]=this.data[s]>>a;a>0&&(t.data[this.t-r-1]|=(this.s&i)<<n),t.t=this.t-r,t.clamp()}},i.prototype.subTo=function(e,t){for(var r=0,a=0,n=Math.min(e.t,this.t);r<n;)a+=this.data[r]-e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a-=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a-=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a-=e.s}t.s=a<0?-1:0,a<-1?t.data[r++]=this.DV+a:a>0&&(t.data[r++]=a),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),n=r.t;for(t.t=n+a.t;--n>=0;)t.data[n]=0;for(n=0;n<a.t;++n)t.data[n+r.t]=r.am(0,a.data[n],t,n,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&i.ZERO.subTo(t,t)},i.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var a=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,a,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var a=e.abs();if(!(a.t<=0)){var n=this.abs();if(n.t<a.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var o=s(),c=this.s,u=e.s,l=this.DB-d(a.data[a.t-1]);l>0?(a.lShiftTo(l,o),n.lShiftTo(l,r)):(a.copyTo(o),n.copyTo(r));var p=o.t,f=o.data[p-1];if(0!=f){var h=f*(1<<this.F1)+(p>1?o.data[p-2]>>this.F2:0),y=this.FV/h,g=(1<<this.F1)/h,v=1<<this.F2,m=r.t,C=m-p,E=null==t?s():t;for(o.dlShiftTo(C,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),i.ONE.dlShiftTo(p,E),E.subTo(o,o);o.t<p;)o.data[o.t++]=0;for(;--C>=0;){var S=r.data[--m]==f?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+v)*g);if((r.data[m]+=o.am(0,S,r,C,0,p))<S)for(o.dlShiftTo(C,E),r.subTo(E,r);r.data[m]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(p,t),c!=u&&i.ZERO.subTo(t,t)),r.t=p,r.clamp(),l>0&&r.rShiftTo(l,r),c<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=s(),a=s(),n=t.convert(this),o=d(e)-1;for(n.copyTo(r);--o>=0;)if(t.sqrTo(r,a),(e&1<<o)>0)t.mulTo(a,n,r);else{var c=r;r=a,a=c}return t.revert(r)},i.prototype.toString=function(e){if(this.s<0)return\"-\"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,a=(1<<t)-1,n=!1,i=\"\",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(n=!0,i=p(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(n=!0),n&&(i+=p(r));return n?i:\"0\"},i.prototype.negate=function(){var e=s();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},i.ZERO=h(0),i.ONE=h(1),I.prototype.convert=A,I.prototype.revert=A,I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},I.prototype.sqrTo=function(e,t){e.squareTo(t)},B.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},B.prototype.revert=function(e){return e},B.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},B.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},B.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var b=[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],N=(1<<26)/b[b.length-1];i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return\"0\";var t=this.chunkSize(e),r=Math.pow(e,t),a=h(r),n=s(),i=s(),o=\"\";for(this.divRemTo(a,n,i);n.signum()>0;)o=(r+i.intValue()).toString(e).substr(1)+o,n.divRemTo(a,n,i);return i.intValue().toString(e)+o},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),n=!1,s=0,o=0,c=0;c<e.length;++c){var u=f(e,c);u<0?\"-\"==e.charAt(c)&&0==this.signum()&&(n=!0):(o=t*o+u,++s>=r&&(this.dMultiply(a),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),n&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if(\"number\"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var a=new Array,n=7&e;a.length=1+(e>>3),t.nextBytes(a),n>0?a[0]&=(1<<n)-1:a[0]=0,this.fromString(a,256)}},i.prototype.bitwiseTo=function(e,t,r){var a,n,i=Math.min(e.t,this.t);for(a=0;a<i;++a)r.data[a]=t(this.data[a],e.data[a]);if(e.t<this.t){for(n=e.s&this.DM,a=i;a<this.t;++a)r.data[a]=t(this.data[a],n);r.t=this.t}else{for(n=this.s&this.DM,a=i;a<e.t;++a)r.data[a]=t(n,e.data[a]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},i.prototype.changeBit=function(e,t){var r=i.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},i.prototype.addTo=function(e,t){for(var r=0,a=0,n=Math.min(e.t,this.t);r<n;)a+=this.data[r]+e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a+=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a+=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=e.s}t.s=a<0?-1:0,a>0?t.data[r++]=a:a<-1&&(t.data[r++]=this.DV+a),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var a,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;for(a=r.t-this.t;n<a;++n)r.data[n+this.t]=this.am(0,e.data[n],r,n,0,this.t);for(a=Math.min(e.t,t);n<a;++n)this.am(0,e.data[n],r,n,0,t-n);r.clamp()},i.prototype.multiplyUpperTo=function(e,t,r){--t;var a=r.t=this.t+e.t-t;for(r.s=0;--a>=0;)r.data[a]=0;for(a=Math.max(t-this.t,0);a<e.t;++a)r.data[this.t+a-t]=this.am(t-a,e.data[a],r,0,0,this.t+a-t);r.clamp(),r.drShiftTo(1,r)},i.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var a=this.t-1;a>=0;--a)r=(t*r+this.data[a])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var a,n=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{a=new i(this.bitLength(),s)}while(a.compareTo(i.ONE)<=0||a.compareTo(t)>=0);var c=a.modPow(n,this);if(0!=c.compareTo(i.ONE)&&0!=c.compareTo(t)){for(var u=1;u++<r&&0!=c.compareTo(t);)if(0==(c=c.modPowInt(2,this)).compareTo(i.ONE))return!1;if(0!=c.compareTo(t))return!1}}return!0},i.prototype.clone=function(){var e=s();return this.copyTo(e),e},i.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},i.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,a=this.DB-e*this.DB%8,n=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<<this.DB-a);e>=0;)a<8?(r=(this.data[e]&(1<<a)-1)<<8-a,r|=this.data[--e]>>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},i.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},i.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,C,t),t},i.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,E,t),t},i.prototype.not=function(){for(var e=s(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},i.prototype.shiftLeft=function(e){var t=s();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},i.prototype.shiftRight=function(e){var t=s();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},i.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},i.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=T(this.data[r]^t);return e},i.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},i.prototype.setBit=function(e){return this.changeBit(e,m)},i.prototype.clearBit=function(e){return this.changeBit(e,E)},i.prototype.flipBit=function(e){return this.changeBit(e,C)},i.prototype.add=function(e){var t=s();return this.addTo(e,t),t},i.prototype.subtract=function(e){var t=s();return this.subTo(e,t),t},i.prototype.multiply=function(e){var t=s();return this.multiplyTo(e,t),t},i.prototype.divide=function(e){var t=s();return this.divRemTo(e,t,null),t},i.prototype.remainder=function(e){var t=s();return this.divRemTo(e,null,t),t},i.prototype.divideAndRemainder=function(e){var t=s(),r=s();return this.divRemTo(e,t,r),new Array(t,r)},i.prototype.modPow=function(e,t){var r,a,n=e.bitLength(),i=h(1);if(n<=0)return i;r=n<18?1:n<48?3:n<144?4:n<768?5:6,a=n<8?new y(t):t.isEven()?new B(t):new g(t);var o=new Array,c=3,u=r-1,l=(1<<r)-1;if(o[1]=a.convert(this),r>1){var p=s();for(a.sqrTo(o[1],p);c<=l;)o[c]=s(),a.mulTo(p,o[c-2],o[c]),c+=2}var f,v,m=e.t-1,C=!0,E=s();for(n=d(e.data[m])-1;m>=0;){for(n>=u?f=e.data[m]>>n-u&l:(f=(e.data[m]&(1<<n+1)-1)<<u-n,m>0&&(f|=e.data[m-1]>>this.DB+n-u)),c=r;0==(1&f);)f>>=1,--c;if((n-=c)<0&&(n+=this.DB,--m),C)o[f].copyTo(i),C=!1;else{for(;c>1;)a.sqrTo(i,E),a.sqrTo(E,i),c-=2;c>0?a.sqrTo(i,E):(v=i,i=E,E=v),a.mulTo(E,o[f],i)}for(;m>=0&&0==(e.data[m]&1<<n);)a.sqrTo(i,E),v=i,i=E,E=v,--n<0&&(n=this.DB-1,--m)}return a.revert(i)},i.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return i.ZERO;for(var r=e.clone(),a=this.clone(),n=h(1),s=h(0),o=h(0),c=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(n.isEven()&&s.isEven()||(n.addTo(this,n),s.subTo(e,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;a.isEven();)a.rShiftTo(1,a),t?(o.isEven()&&c.isEven()||(o.addTo(this,o),c.subTo(e,c)),o.rShiftTo(1,o)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(a)>=0?(r.subTo(a,r),t&&n.subTo(o,n),s.subTo(c,s)):(a.subTo(r,a),t&&o.subTo(n,o),c.subTo(s,c))}return 0!=a.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new I)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var a=t;t=r,r=a}var n=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(n<i&&(i=n),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=b[b.length-1]){for(t=0;t<b.length;++t)if(r.data[0]==b[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<b.length;){for(var a=b[t],n=t+1;n<b.length&&a<N;)a*=b[n++];for(a=r.modInt(a);t<n;)if(a%b[t++]==0)return!1}return r.millerRabin(e)}},function(e,t,r){var a=r(0);r(1),e.exports=a.cipher=a.cipher||{},a.cipher.algorithms=a.cipher.algorithms||{},a.cipher.createCipher=function(e,t){var r=e;if(\"string\"==typeof r&&(r=a.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error(\"Unsupported algorithm: \"+e);return new a.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},a.cipher.createDecipher=function(e,t){var r=e;if(\"string\"==typeof r&&(r=a.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error(\"Unsupported algorithm: \"+e);return new a.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},a.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),a.cipher.algorithms[e]=t},a.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in a.cipher.algorithms?a.cipher.algorithms[e]:null};var n=a.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};n.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=a.util.createBuffer(),this.output=e.output||a.util.createBuffer(),this.mode.start(t)},n.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},n.prototype.finish=function(e){!e||\"ECB\"!==this.mode.name&&\"CBC\"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},function(e,t,r){var a=r(0);r(4),r(1);var n=e.exports=a.md5=a.md5||{};a.md.md5=a.md.algorithms.md5=n,n.create=function(){u||function(){i=String.fromCharCode(128),i+=a.util.fillString(String.fromCharCode(0),64),s=[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],o=[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],c=new Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=a.util.createBuffer(),r=new Array(16),n={algorithm:\"md5\",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,i=0;i<r;++i)n.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n}};return n.start(),n.update=function(i,s){\"utf8\"===s&&(i=a.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var c=n.fullMessageLength.length-1;c>=0;--c)n.fullMessageLength[c]+=o[1],o[1]=o[0]+(n.fullMessageLength[c]/4294967296>>>0),n.fullMessageLength[c]=n.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-o));for(var c,u=0,p=n.fullMessageLength.length-1;p>=0;--p)u=(c=8*n.fullMessageLength[p]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(f,r,s);var h=a.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var i=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var a,n,i,u,l,p,f,h=r.length();h>=64;){for(n=e.h0,i=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),a=n+(l^i&(u^l))+c[f]+t[f],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<32;++f)a=n+(u^l&(i^u))+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<48;++f)a=n+(i^u^l)+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<64;++f)a=n+(u^(i|~l))+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,h-=64}}},function(e,t,r){var a=r(0);r(8),r(4),r(1);var n,i=a.pkcs5=a.pkcs5||{};a.util.isNodejs&&!a.options.usePureJavaScript&&(n=r(16)),e.exports=a.pbkdf2=i.pbkdf2=function(e,t,r,i,s,o){if(\"function\"==typeof s&&(o=s,s=null),a.util.isNodejs&&!a.options.usePureJavaScript&&n.pbkdf2&&(null===s||\"object\"!=typeof s)&&(n.pbkdf2Sync.length>4||!s||\"sha1\"===s))return\"string\"!=typeof s&&(s=\"sha1\"),e=Buffer.from(e,\"binary\"),t=Buffer.from(t,\"binary\"),o?4===n.pbkdf2Sync.length?n.pbkdf2(e,t,r,i,(function(e,t){if(e)return o(e);o(null,t.toString(\"binary\"))})):n.pbkdf2(e,t,r,i,s,(function(e,t){if(e)return o(e);o(null,t.toString(\"binary\"))})):4===n.pbkdf2Sync.length?n.pbkdf2Sync(e,t,r,i).toString(\"binary\"):n.pbkdf2Sync(e,t,r,i,s).toString(\"binary\");if(null==s&&(s=\"sha1\"),\"string\"==typeof s){if(!(s in a.md.algorithms))throw new Error(\"Unknown hash algorithm: \"+s);s=a.md[s].create()}var c=s.digestLength;if(i>4294967295*c){var u=new Error(\"Derived key is too long.\");if(o)return o(u);throw u}var l=Math.ceil(i/c),p=i-(l-1)*c,f=a.hmac.create();f.start(s,e);var h,d,y,g=\"\";if(!o){for(var v=1;v<=l;++v){f.start(null,null),f.update(t),f.update(a.util.int32ToBytes(v)),h=y=f.digest().getBytes();for(var m=2;m<=r;++m)f.start(null,null),f.update(y),d=f.digest().getBytes(),h=a.util.xorBytes(h,d,c),y=d;g+=v<l?h:h.substr(0,p)}return g}v=1;function C(){if(v>l)return o(null,g);f.start(null,null),f.update(t),f.update(a.util.int32ToBytes(v)),h=y=f.digest().getBytes(),m=2,E()}function E(){if(m<=r)return f.start(null,null),f.update(y),d=f.digest().getBytes(),h=a.util.xorBytes(h,d,c),y=d,++m,a.util.setImmediate(E);g+=v<l?h:h.substr(0,p),++v,C()}C()}},function(e,t){},function(e,t,r){var a=r(0);r(5),r(3),r(10),r(4),r(37),r(6),r(7),r(18),r(11),r(1);var n=a.asn1,i=e.exports=a.pki=a.pki||{},s=i.oids,o={};o.CN=s.commonName,o.commonName=\"CN\",o.C=s.countryName,o.countryName=\"C\",o.L=s.localityName,o.localityName=\"L\",o.ST=s.stateOrProvinceName,o.stateOrProvinceName=\"ST\",o.O=s.organizationName,o.organizationName=\"O\",o.OU=s.organizationalUnitName,o.organizationalUnitName=\"OU\",o.E=s.emailAddress,o.emailAddress=\"E\";var c=a.pki.rsa.publicKeyValidator,u={name:\"Certificate\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"Certificate.TBSCertificate\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"tbsCertificate\",value:[{name:\"Certificate.TBSCertificate.version\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:\"Certificate.TBSCertificate.version.integer\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"certVersion\"}]},{name:\"Certificate.TBSCertificate.serialNumber\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"certSerialNumber\"},{name:\"Certificate.TBSCertificate.signature\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"Certificate.TBSCertificate.signature.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"certinfoSignatureOid\"},{name:\"Certificate.TBSCertificate.signature.parameters\",tagClass:n.Class.UNIVERSAL,optional:!0,captureAsn1:\"certinfoSignatureParams\"}]},{name:\"Certificate.TBSCertificate.issuer\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"certIssuer\"},{name:\"Certificate.TBSCertificate.validity\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"Certificate.TBSCertificate.validity.notBefore (utc)\",tagClass:n.Class.UNIVERSAL,type:n.Type.UTCTIME,constructed:!1,optional:!0,capture:\"certValidity1UTCTime\"},{name:\"Certificate.TBSCertificate.validity.notBefore (generalized)\",tagClass:n.Class.UNIVERSAL,type:n.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:\"certValidity2GeneralizedTime\"},{name:\"Certificate.TBSCertificate.validity.notAfter (utc)\",tagClass:n.Class.UNIVERSAL,type:n.Type.UTCTIME,constructed:!1,optional:!0,capture:\"certValidity3UTCTime\"},{name:\"Certificate.TBSCertificate.validity.notAfter (generalized)\",tagClass:n.Class.UNIVERSAL,type:n.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:\"certValidity4GeneralizedTime\"}]},{name:\"Certificate.TBSCertificate.subject\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"certSubject\"},c,{name:\"Certificate.TBSCertificate.issuerUniqueID\",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:\"Certificate.TBSCertificate.issuerUniqueID.id\",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:\"certIssuerUniqueId\"}]},{name:\"Certificate.TBSCertificate.subjectUniqueID\",tagClass:n.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:\"Certificate.TBSCertificate.subjectUniqueID.id\",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:\"certSubjectUniqueId\"}]},{name:\"Certificate.TBSCertificate.extensions\",tagClass:n.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:\"certExtensions\",optional:!0}]},{name:\"Certificate.signatureAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"Certificate.signatureAlgorithm.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"certSignatureOid\"},{name:\"Certificate.TBSCertificate.signature.parameters\",tagClass:n.Class.UNIVERSAL,optional:!0,captureAsn1:\"certSignatureParams\"}]},{name:\"Certificate.signatureValue\",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:\"certSignature\"}]},l={name:\"rsapss\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"rsapss.hashAlgorithm\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:\"rsapss.hashAlgorithm.AlgorithmIdentifier\",tagClass:n.Class.UNIVERSAL,type:n.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:\"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"hashOid\"}]}]},{name:\"rsapss.maskGenAlgorithm\",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:\"rsapss.maskGenAlgorithm.AlgorithmIdentifier\",tagClass:n.Class.UNIVERSAL,type:n.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:\"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"maskGenOid\"},{name:\"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"maskGenHashOid\"}]}]}]},{name:\"rsapss.saltLength\",tagClass:n.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:\"rsapss.saltLength.saltLength\",tagClass:n.Class.UNIVERSAL,type:n.Class.INTEGER,constructed:!1,capture:\"saltLength\"}]},{name:\"rsapss.trailerField\",tagClass:n.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:\"rsapss.trailer.trailer\",tagClass:n.Class.UNIVERSAL,type:n.Class.INTEGER,constructed:!1,capture:\"trailer\"}]}]},p={name:\"CertificationRequestInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"certificationRequestInfo\",value:[{name:\"CertificationRequestInfo.integer\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"certificationRequestInfoVersion\"},{name:\"CertificationRequestInfo.subject\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"certificationRequestInfoSubject\"},c,{name:\"CertificationRequestInfo.attributes\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:\"certificationRequestInfoAttributes\",value:[{name:\"CertificationRequestInfo.attributes\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"CertificationRequestInfo.attributes.type\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1},{name:\"CertificationRequestInfo.attributes.value\",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0}]}]}]},f={name:\"CertificationRequest\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"csr\",value:[p,{name:\"CertificationRequest.signatureAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"CertificationRequest.signatureAlgorithm.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"csrSignatureOid\"},{name:\"CertificationRequest.signatureAlgorithm.parameters\",tagClass:n.Class.UNIVERSAL,optional:!0,captureAsn1:\"csrSignatureParams\"}]},{name:\"CertificationRequest.signature\",tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,captureBitStringValue:\"csrSignature\"}]};function h(e,t){\"string\"==typeof t&&(t={shortName:t});for(var r,a=null,n=0;null===a&&n<e.attributes.length;++n)r=e.attributes[n],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(a=r);return a}i.RDNAttributesAsArray=function(e,t){for(var r,a,i,c=[],u=0;u<e.value.length;++u){r=e.value[u];for(var l=0;l<r.value.length;++l)i={},a=r.value[l],i.type=n.derToOid(a.value[0].value),i.value=a.value[1].value,i.valueTagClass=a.value[1].type,i.type in s&&(i.name=s[i.type],i.name in o&&(i.shortName=o[i.name])),t&&(t.update(i.type),t.update(i.value)),c.push(i)}return c},i.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var a=e[r],c=n.derToOid(a.value[0].value),u=a.value[1].value,l=0;l<u.length;++l){var p={};if(p.type=c,p.value=u[l].value,p.valueTagClass=u[l].type,p.type in s&&(p.name=s[p.type],p.name in o&&(p.shortName=o[p.name])),p.type===s.extensionRequest){p.extensions=[];for(var f=0;f<p.value.length;++f)p.extensions.push(i.certificateExtensionFromAsn1(p.value[f]))}t.push(p)}return t};var d=function(e,t,r){var a={};if(e!==s[\"RSASSA-PSS\"])return a;r&&(a={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var i={},o=[];if(!n.validate(t,l,i,o)){var c=new Error(\"Cannot read RSASSA-PSS parameter block.\");throw c.errors=o,c}return void 0!==i.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=n.derToOid(i.hashOid)),void 0!==i.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=n.derToOid(i.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=n.derToOid(i.maskGenHashOid)),void 0!==i.saltLength&&(a.saltLength=i.saltLength.charCodeAt(0)),a},y=function(e){switch(s[e.signatureOid]){case\"sha1WithRSAEncryption\":case\"sha1WithRSASignature\":return a.md.sha1.create();case\"md5WithRSAEncryption\":return a.md.md5.create();case\"sha256WithRSAEncryption\":return a.md.sha256.create();case\"sha384WithRSAEncryption\":return a.md.sha384.create();case\"sha512WithRSAEncryption\":return a.md.sha512.create();case\"RSASSA-PSS\":return a.md.sha256.create();default:var t=new Error(\"Could not compute \"+e.type+\" digest. Unknown signature OID.\");throw t.signatureOid=e.signatureOid,t}},g=function(e){var t,r=e.certificate;switch(r.signatureOid){case s.sha1WithRSAEncryption:case s.sha1WithRSASignature:break;case s[\"RSASSA-PSS\"]:var n,i,o;if(void 0===(n=s[r.signatureParameters.mgf.hash.algorithmOid])||void 0===a.md[n])throw(o=new Error(\"Unsupported MGF hash function.\")).oid=r.signatureParameters.mgf.hash.algorithmOid,o.name=n,o;if(void 0===(i=s[r.signatureParameters.mgf.algorithmOid])||void 0===a.mgf[i])throw(o=new Error(\"Unsupported MGF function.\")).oid=r.signatureParameters.mgf.algorithmOid,o.name=i,o;if(i=a.mgf[i].create(a.md[n].create()),void 0===(n=s[r.signatureParameters.hash.algorithmOid])||void 0===a.md[n])throw(o=new Error(\"Unsupported RSASSA-PSS hash function.\")).oid=r.signatureParameters.hash.algorithmOid,o.name=n,o;t=a.pss.create(a.md[n].create(),i,r.signatureParameters.saltLength)}return r.publicKey.verify(e.md.digest().getBytes(),e.signature,t)};function v(e){for(var t,r,i=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),s=e.attributes,o=0;o<s.length;++o){var c=(t=s[o]).value,u=n.Type.PRINTABLESTRING;\"valueTagClass\"in t&&(u=t.valueTagClass)===n.Type.UTF8&&(c=a.util.encodeUtf8(c)),r=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.type).getBytes()),n.create(n.Class.UNIVERSAL,u,!1,c)])]),i.value.push(r)}return i}function m(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in i.oids?t.name=i.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=i.oids[o[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in i.oids))throw(c=new Error(\"Attribute type not specified.\")).attribute=t,c;t.type=i.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===s.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=n.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var a=0;a<t.extensions.length;++a)t.value.push(i.certificateExtensionToAsn1(C(t.extensions[a])))}var c;if(void 0===t.value)throw(c=new Error(\"Attribute value not specified.\")).attribute=t,c}}function C(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in i.oids&&(e.name=i.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in i.oids))throw(S=new Error(\"Extension ID not specified.\")).extension=e,S;e.id=i.oids[e.name]}if(void 0!==e.value)return e;if(\"keyUsage\"===e.name){var r=0,o=0,c=0;e.digitalSignature&&(o|=128,r=7),e.nonRepudiation&&(o|=64,r=6),e.keyEncipherment&&(o|=32,r=5),e.dataEncipherment&&(o|=16,r=4),e.keyAgreement&&(o|=8,r=3),e.keyCertSign&&(o|=4,r=2),e.cRLSign&&(o|=2,r=1),e.encipherOnly&&(o|=1,r=0),e.decipherOnly&&(c|=128,r=7);var u=String.fromCharCode(r);0!==c?u+=String.fromCharCode(o)+String.fromCharCode(c):0!==o&&(u+=String.fromCharCode(o)),e.value=n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,u)}else if(\"basicConstraints\"===e.name)e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(n.create(n.Class.UNIVERSAL,n.Type.BOOLEAN,!1,String.fromCharCode(255))),\"pathLenConstraint\"in e&&e.value.value.push(n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.pathLenConstraint).getBytes()));else if(\"extKeyUsage\"===e.name){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var p in e)!0===e[p]&&(p in s?l.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s[p]).getBytes())):-1!==p.indexOf(\".\")&&l.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(p).getBytes())))}else if(\"nsCertType\"===e.name){r=0,o=0;e.client&&(o|=128,r=7),e.server&&(o|=64,r=6),e.email&&(o|=32,r=5),e.objsign&&(o|=16,r=4),e.reserved&&(o|=8,r=3),e.sslCA&&(o|=4,r=2),e.emailCA&&(o|=2,r=1),e.objCA&&(o|=1,r=0);u=String.fromCharCode(r);0!==o&&(u+=String.fromCharCode(o)),e.value=n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,u)}else if(\"subjectAltName\"===e.name||\"issuerAltName\"===e.name){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);for(var f=0;f<e.altNames.length;++f){u=(m=e.altNames[f]).value;if(7===m.type&&m.ip){if(null===(u=a.util.bytesFromIP(m.ip)))throw(S=new Error('Extension \"ip\" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(u=m.oid?n.oidToDer(n.oidToDer(m.oid)):n.oidToDer(u));e.value.value.push(n.create(n.Class.CONTEXT_SPECIFIC,m.type,!1,u))}}else if(\"nsComment\"===e.name&&t.cert){if(!/^[\\x00-\\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid \"nsComment\" content.');e.value=n.create(n.Class.UNIVERSAL,n.Type.IA5STRING,!1,e.comment)}else if(\"subjectKeyIdentifier\"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,h.getBytes())}else if(\"authorityKeyIdentifier\"===e.name&&t.cert){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var y=[n.create(n.Class.CONTEXT_SPECIFIC,4,!0,[v(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var g=a.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if(\"cRLDistributionPoints\"===e.name){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);l=e.value.value;var m,C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),E=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f<e.altNames.length;++f){u=(m=e.altNames[f]).value;if(7===m.type&&m.ip){if(null===(u=a.util.bytesFromIP(m.ip)))throw(S=new Error('Extension \"ip\" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(u=m.oid?n.oidToDer(n.oidToDer(m.oid)):n.oidToDer(u));E.value.push(n.create(n.Class.CONTEXT_SPECIFIC,m.type,!1,u))}C.value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[E])),l.push(C)}var S;if(void 0===e.value)throw(S=new Error(\"Extension value not specified.\")).extension=e,S;return e}function E(e,t){switch(e){case s[\"RSASSA-PSS\"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.hash.algorithmOid).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")])])),void 0!==t.mgf.algorithmOid&&r.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.mgf.algorithmOid).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.mgf.hash.algorithmOid).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")])])])),void 0!==t.saltLength&&r.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.saltLength).getBytes())])),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,r);default:return n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")}}function S(e){var t=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,i=0;i<r.length;++i){var s=r[i],o=s.value,c=n.Type.UTF8;\"valueTagClass\"in s&&(c=s.valueTagClass),c===n.Type.UTF8&&(o=a.util.encodeUtf8(o));var u=!1;\"valueConstructed\"in s&&(u=s.valueConstructed);var l=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s.type).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,c,u,o)])]);t.value.push(l)}return t}i.certificateFromPem=function(e,t,r){var s=a.pem.decode(e)[0];if(\"CERTIFICATE\"!==s.type&&\"X509 CERTIFICATE\"!==s.type&&\"TRUSTED CERTIFICATE\"!==s.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not \"CERTIFICATE\", \"X509 CERTIFICATE\", or \"TRUSTED CERTIFICATE\".');throw o.headerType=s.type,o}if(s.procType&&\"ENCRYPTED\"===s.procType.type)throw new Error(\"Could not convert certificate from PEM; PEM is encrypted.\");var c=n.fromDer(s.body,r);return i.certificateFromAsn1(c,t)},i.certificateToPem=function(e,t){var r={type:\"CERTIFICATE\",body:n.toDer(i.certificateToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},i.publicKeyFromPem=function(e){var t=a.pem.decode(e)[0];if(\"PUBLIC KEY\"!==t.type&&\"RSA PUBLIC KEY\"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not \"PUBLIC KEY\" or \"RSA PUBLIC KEY\".');throw r.headerType=t.type,r}if(t.procType&&\"ENCRYPTED\"===t.procType.type)throw new Error(\"Could not convert public key from PEM; PEM is encrypted.\");var s=n.fromDer(t.body);return i.publicKeyFromAsn1(s)},i.publicKeyToPem=function(e,t){var r={type:\"PUBLIC KEY\",body:n.toDer(i.publicKeyToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},i.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:\"RSA PUBLIC KEY\",body:n.toDer(i.publicKeyToRSAPublicKey(e)).getBytes()};return a.pem.encode(r,{maxline:t})},i.getPublicKeyFingerprint=function(e,t){var r,s=(t=t||{}).md||a.md.sha1.create();switch(t.type||\"RSAPublicKey\"){case\"RSAPublicKey\":r=n.toDer(i.publicKeyToRSAPublicKey(e)).getBytes();break;case\"SubjectPublicKeyInfo\":r=n.toDer(i.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type \"'+t.type+'\".')}s.start(),s.update(r);var o=s.digest();if(\"hex\"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if(\"binary\"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding \"'+t.encoding+'\".');return o},i.certificationRequestFromPem=function(e,t,r){var s=a.pem.decode(e)[0];if(\"CERTIFICATE REQUEST\"!==s.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not \"CERTIFICATE REQUEST\".');throw o.headerType=s.type,o}if(s.procType&&\"ENCRYPTED\"===s.procType.type)throw new Error(\"Could not convert certification request from PEM; PEM is encrypted.\");var c=n.fromDer(s.body,r);return i.certificationRequestFromAsn1(c,t)},i.certificationRequestToPem=function(e,t){var r={type:\"CERTIFICATE REQUEST\",body:n.toDer(i.certificationRequestToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},i.createCertificate=function(){var e={version:2,serialNumber:\"00\",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return h(e.issuer,t)},e.issuer.addField=function(t){m([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){m([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){m(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){m(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)C(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){\"string\"==typeof t&&(t={name:t});for(var r,a=null,n=0;null===a&&n<e.extensions.length;++n)r=e.extensions[n],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(a=r);return a},e.sign=function(t,r){e.md=r||a.md.sha1.create();var o=s[e.md.algorithm+\"WithRSAEncryption\"];if(!o){var c=new Error(\"Could not compute certificate digest. Unknown message digest algorithm OID.\");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=i.getTBSCertificate(e);var u=n.toDer(e.tbsCertificate);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var a=t.issuer,s=e.subject,o=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 o.expectedIssuer=s.attributes,o.actualIssuer=a.attributes,o}var c=t.md;if(null===c){c=y({signatureOid:t.signatureOid,type:\"certificate\"});var u=t.tbsCertificate||i.getTBSCertificate(t),l=n.toDer(u);c.update(l.getBytes())}return null!==c&&(r=g({certificate:e,md:c,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,a=e.issuer,n=t.subject;if(a.hash&&n.hash)r=a.hash===n.hash;else if(a.attributes.length===n.attributes.length){var i,s;r=!0;for(var o=0;r&&o<a.attributes.length;++o)i=a.attributes[o],s=n.attributes[o],i.type===s.type&&i.value===s.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return i.getPublicKeyFingerprint(e.publicKey,{type:\"RSAPublicKey\"})},e.verifySubjectKeyIdentifier=function(){for(var t=s.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var n=e.extensions[r];if(n.id===t){var i=e.generateSubjectKeyIdentifier().getBytes();return a.util.hexToBytes(n.subjectKeyIdentifier)===i}}return!1},e},i.certificateFromAsn1=function(e,t){var r={},s=[];if(!n.validate(e,u,r,s)){var o=new Error(\"Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.\");throw o.errors=s,o}if(n.derToOid(r.publicKeyOid)!==i.oids.rsaEncryption)throw new Error(\"Cannot read public key. OID is not RSA.\");var c=i.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=a.util.createBuffer(r.certSerialNumber);c.serialNumber=l.toHex(),c.signatureOid=a.asn1.derToOid(r.certSignatureOid),c.signatureParameters=d(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=a.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var p=[];if(void 0!==r.certValidity1UTCTime&&p.push(n.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&p.push(n.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&p.push(n.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&p.push(n.generalizedTimeToDate(r.certValidity4GeneralizedTime)),p.length>2)throw new Error(\"Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.\");if(p.length<2)throw new Error(\"Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.\");if(c.validity.notBefore=p[0],c.validity.notAfter=p[1],c.tbsCertificate=r.tbsCertificate,t){c.md=y({signatureOid:c.signatureOid,type:\"certificate\"});var f=n.toDer(c.tbsCertificate);c.md.update(f.getBytes())}var g=a.md.sha1.create(),v=n.toDer(r.certIssuer);g.update(v.getBytes()),c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){m([e]),c.issuer.attributes.push(e)},c.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=g.digest().toHex();var C=a.md.sha1.create(),E=n.toDer(r.certSubject);return C.update(E.getBytes()),c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=C.digest().toHex(),r.certExtensions?c.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},i.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var a=e.value[r],n=0;n<a.value.length;++n)t.push(i.certificateExtensionFromAsn1(a.value[n]));return t},i.certificateExtensionFromAsn1=function(e){var t={};if(t.id=n.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===n.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in s)if(t.name=s[t.id],\"keyUsage\"===t.name){var r=0,i=0;(c=n.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1),i=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&i)}else if(\"basicConstraints\"===t.name){(c=n.fromDer(t.value)).value.length>0&&c.value[0].type===n.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===n.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=n.derToInteger(o))}else if(\"extKeyUsage\"===t.name)for(var c=n.fromDer(t.value),u=0;u<c.value.length;++u){var l=n.derToOid(c.value[u].value);l in s?t[s[l]]=!0:t[l]=!0}else if(\"nsCertType\"===t.name){r=0;(c=n.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if(\"subjectAltName\"===t.name||\"issuerAltName\"===t.name){var p;t.altNames=[];c=n.fromDer(t.value);for(var f=0;f<c.value.length;++f){var h={type:(p=c.value[f]).type,value:p.value};switch(t.altNames.push(h),p.type){case 1:case 2:case 6:break;case 7:h.ip=a.util.bytesToIP(p.value);break;case 8:h.oid=n.derToOid(p.value)}}}else if(\"subjectKeyIdentifier\"===t.name){c=n.fromDer(t.value);t.subjectKeyIdentifier=a.util.bytesToHex(c.value)}return t},i.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!n.validate(e,f,r,s)){var o=new Error(\"Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.\");throw o.errors=s,o}if(n.derToOid(r.publicKeyOid)!==i.oids.rsaEncryption)throw new Error(\"Cannot read public key. OID is not RSA.\");var c=i.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=a.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=d(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=a.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){c.md=y({signatureOid:c.signatureOid,type:\"certification request\"});var u=n.toDer(c.certificationRequestInfo);c.md.update(u.getBytes())}var l=a.md.sha1.create();return c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){m([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(r.certificationRequestInfoSubject,l),c.subject.hash=l.digest().toHex(),c.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return h(c,e)},c.addAttribute=function(e){m([e]),c.attributes.push(e)},c.attributes=i.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},i.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){m([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return h(e,t)},e.addAttribute=function(t){m([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){m(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){m(t),e.attributes=t},e.sign=function(t,r){e.md=r||a.md.sha1.create();var o=s[e.md.algorithm+\"WithRSAEncryption\"];if(!o){var c=new Error(\"Could not compute certification request digest. Unknown message digest algorithm OID.\");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=i.getCertificationRequestInfo(e);var u=n.toDer(e.certificationRequestInfo);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){r=y({signatureOid:e.signatureOid,type:\"certification request\"});var a=e.certificationRequestInfo||i.getCertificationRequestInfo(e),s=n.toDer(a);r.update(s.getBytes())}return null!==r&&(t=g({certificate:e,md:r,signature:e.signature})),t},e};var T=new Date(\"1950-01-01T00:00:00Z\"),I=new Date(\"2050-01-01T00:00:00Z\");function A(e){return e>=T&&e<I?n.create(n.Class.UNIVERSAL,n.Type.UTCTIME,!1,n.dateToUtcTime(e)):n.create(n.Class.UNIVERSAL,n.Type.GENERALIZEDTIME,!1,n.dateToGeneralizedTime(e))}i.getTBSCertificate=function(e){var t=A(e.validity.notBefore),r=A(e.validity.notAfter),s=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes())]),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,a.util.hexToBytes(e.serialNumber)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.siginfo.algorithmOid).getBytes()),E(e.siginfo.algorithmOid,e.siginfo.parameters)]),v(e.issuer),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[t,r]),v(e.subject),i.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&s.value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&s.value.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!0,[n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&s.value.push(i.certificateExtensionsToAsn1(e.extensions)),s},i.getCertificationRequestInfo=function(e){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),v(e.subject),i.publicKeyToAsn1(e.publicKey),S(e)])},i.distinguishedNameToAsn1=function(e){return v(e)},i.certificateToAsn1=function(e){var t=e.tbsCertificate||i.getTBSCertificate(e);return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[t,n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},i.certificateExtensionsToAsn1=function(e){var t=n.create(n.Class.CONTEXT_SPECIFIC,3,!0,[]),r=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);t.value.push(r);for(var a=0;a<e.length;++a)r.value.push(i.certificateExtensionToAsn1(e[a]));return t},i.certificateExtensionToAsn1=function(e){var t=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);t.value.push(n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.id).getBytes())),e.critical&&t.value.push(n.create(n.Class.UNIVERSAL,n.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return\"string\"!=typeof e.value&&(r=n.toDer(r).getBytes()),t.value.push(n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,r)),t},i.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||i.getCertificationRequestInfo(e);return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[t,n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},i.createCaStore=function(e){var t={certs:{}};function r(e){return s(e),t.certs[e.hash]||null}function s(e){if(!e.hash){var t=a.md.sha1.create();e.attributes=i.RDNAttributesAsArray(v(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if(\"string\"==typeof e&&(e=a.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];a.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){\"string\"==typeof e&&(e=a.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;a.util.isArray(t)||(t=[t]);for(var s=n.toDer(i.certificateToAsn1(e)).getBytes(),o=0;o<t.length;++o){if(s===n.toDer(i.certificateToAsn1(t[o])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var n=t.certs[r];if(a.util.isArray(n))for(var i=0;i<n.length;++i)e.push(n[i]);else e.push(n)}return e},t.removeCertificate=function(e){var o;if(\"string\"==typeof e&&(e=a.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))return null;var c=r(e.subject);if(!a.util.isArray(c))return o=t.certs[e.subject.hash],delete t.certs[e.subject.hash],o;for(var u=n.toDer(i.certificateToAsn1(e)).getBytes(),l=0;l<c.length;++l){u===n.toDer(i.certificateToAsn1(c[l])).getBytes()&&(o=c[l],c.splice(l,1))}return 0===c.length&&delete t.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var c=e[o];t.addCertificate(c)}return t},i.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\"},i.verifyCertificateChain=function(e,t,r){\"function\"==typeof r&&(r={verify:r}),r=r||{};var n=(t=t.slice(0)).slice(0),s=r.validityCheckDate;void 0===s&&(s=new Date);var o=!0,c=null,u=0;do{var l=t.shift(),p=null,f=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(c={message:\"Certificate is not valid yet or has expired.\",error:i.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(p=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(f=!0,p=l),p){var h=p;a.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){p=h.shift();try{d=p.verify(l)}catch(e){}}d||(c={message:\"Certificate signature is invalid.\",error:i.certificateError.bad_certificate})}null!==c||p&&!f||e.hasCertificate(l)||(c={message:\"Certificate is not trusted.\",error:i.certificateError.unknown_ca})}if(null===c&&p&&!l.isIssuer(p)&&(c={message:\"Certificate issuer is invalid.\",error:i.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&g<l.extensions.length;++g){var v=l.extensions[g];v.critical&&!(v.name in y)&&(c={message:\"Certificate has an unsupported critical extension.\",error:i.certificateError.unsupported_certificate})}if(null===c&&(!o||0===t.length&&(!p||f))){var m=l.getExtension(\"basicConstraints\"),C=l.getExtension(\"keyUsage\");if(null!==C&&(C.keyCertSign&&null!==m||(c={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:i.certificateError.bad_certificate})),null!==c||null===m||m.cA||(c={message:\"Certificate basicConstraints indicates the certificate is not a CA.\",error:i.certificateError.bad_certificate}),null===c&&null!==C&&\"pathLenConstraint\"in m)u-1>m.pathLenConstraint&&(c={message:\"Certificate basicConstraints pathLenConstraint violated.\",error:i.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,n):E;if(!0!==S)throw!0===E&&(c={message:\"The application rejected the certificate.\",error:i.certificateError.bad_certificate}),(S||0===S)&&(\"object\"!=typeof S||a.util.isArray(S)?\"string\"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},function(e,t,r){var a=r(0);r(2),r(1),(e.exports=a.pss=a.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,i=r.digestLength,s=e.salt||null;if(\"string\"==typeof s&&(s=a.util.createBuffer(s)),\"saltLength\"in e)t=e.saltLength;else{if(null===s)throw new Error(\"Salt length not specified or specific salt not given.\");t=s.length()}if(null!==s&&s.length()!==t)throw new Error(\"Given salt length does not match length of given salt.\");var o=e.prng||a.random,c={encode:function(e,c){var u,l,p=c-1,f=Math.ceil(p/8),h=e.digest().getBytes();if(f<i+t+2)throw new Error(\"Message is too long to encrypt.\");l=null===s?o.getBytesSync(t):s.bytes();var d=new a.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(h),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),g=new a.util.ByteBuffer;g.fillWithByte(0,f-t-i-2),g.putByte(1),g.putBytes(l);var v=g.getBytes(),m=f-i-1,C=n.generate(y,m),E=\"\";for(u=0;u<m;u++)E+=String.fromCharCode(v.charCodeAt(u)^C.charCodeAt(u));var S=65280>>8*f-p&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l<i+t+2)throw new Error(\"Inconsistent parameters to PSS signature verification.\");if(188!==s.charCodeAt(l-1))throw new Error(\"Encoded message does not end in 0xBC.\");var p=l-i-1,f=s.substr(0,p),h=s.substr(p,i),d=65280>>8*l-u&255;if(0!=(f.charCodeAt(0)&d))throw new Error(\"Bits beyond keysize not zero as expected.\");var y=n.generate(h,p),g=\"\";for(c=0;c<p;c++)g+=String.fromCharCode(f.charCodeAt(c)^y.charCodeAt(c));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var v=l-i-t-2;for(c=0;c<v;c++)if(0!==g.charCodeAt(c))throw new Error(\"Leftmost octets not zero as expected\");if(1!==g.charCodeAt(v))throw new Error(\"Inconsistent PSS signature, 0x01 marker not found\");var m=g.substr(-t),C=new a.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(m),r.start(),r.update(C.getBytes()),h===r.digest().getBytes()}};return c}},function(e,t,r){var a=r(0);r(1),a.cipher=a.cipher||{};var n=e.exports=a.cipher.modes=a.cipher.modes||{};function i(e,t){if(\"string\"==typeof e&&(e=a.util.createBuffer(e)),a.util.isArray(e)&&e.length>4){var r=e;e=a.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error(\"Invalid IV length; got \"+e.length()+\" bytes and expected \"+t+\" bytes.\");if(!a.util.isArray(e)){var i=[],s=t/4;for(n=0;n<s;++n)i.push(e.getInt32());e=i}return e}function s(e){e[e.length-1]=e[e.length-1]+1&4294967295}function o(e){return[e/4294967296|0,4294967295&e]}n.ecb=function(e){e=e||{},this.name=\"ECB\",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},n.ecb.prototype.start=function(e){},n.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},n.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},n.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},n.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},n.cbc=function(e){e=e||{},this.name=\"CBC\",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},n.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error(\"Invalid IV parameter.\");this._iv=this._prev.slice(0)}else{if(!(\"iv\"in e))throw new Error(\"Invalid IV parameter.\");this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},n.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=this._prev[a]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]);this._prev=this._outBlock},n.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(a=0;a<this._ints;++a)t.putInt32(this._prev[a]^this._outBlock[a]);this._prev=this._inBlock.slice(0)},n.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},n.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},n.cfb=function(e){e=e||{},this.name=\"CFB\",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.cfb.prototype.start=function(e){if(!(\"iv\"in e))throw new Error(\"Invalid IV parameter.\");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.cfb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32()^this._outBlock[n],t.putInt32(this._inBlock[n]);else{var i=(this.blockSize-a)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);if(i>0)e.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.cfb.prototype.decrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32(),t.putInt32(this._inBlock[n]^this._outBlock[n]);else{var i=(this.blockSize-a)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialBlock[n]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.ofb=function(e){e=e||{},this.name=\"OFB\",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.ofb.prototype.start=function(e){if(!(\"iv\"in e))throw new Error(\"Invalid IV parameter.\");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ofb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];else{var i=(this.blockSize-a)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0)e.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.ofb.prototype.decrypt=n.ofb.prototype.encrypt,n.ctr=function(e){e=e||{},this.name=\"CTR\",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.ctr.prototype.start=function(e){if(!(\"iv\"in e))throw new Error(\"Invalid IV parameter.\");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ctr.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n<this._ints;++n)t.putInt32(e.getInt32()^this._outBlock[n]);else{var i=(this.blockSize-a)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},n.ctr.prototype.decrypt=n.ctr.prototype.encrypt,n.gcm=function(e){e=e||{},this.name=\"GCM\",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=3774873600},n.gcm.prototype.start=function(e){if(!(\"iv\"in e))throw new Error(\"Invalid IV parameter.\");var t,r=a.util.createBuffer(e.iv);if(this._cipherLength=0,t=\"additionalData\"in e?a.util.createBuffer(e.additionalData):a.util.createBuffer(),this._tagLength=\"tagLength\"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=a.util.createBuffer(e.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=r.length();if(12===n)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*n)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=a.util.createBuffer(t),this._aDataLength=o(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),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()])},n.gcm.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^=e.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-a)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialOutput.putInt32(e.getInt32()^this._outBlock[n]);if(i<=0||r){if(r){var o=a%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(n=0;n<this._ints;++n)this._outBlock[n]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},n.gcm.prototype.decrypt=function(e,t,r){var a=e.length();if(a<this.blockSize&&!(r&&a>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]^this._hashBlock[n]);a<this.blockSize?this._cipherLength+=a%this.blockSize:this._cipherLength+=this.blockSize},n.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=a.util.createBuffer();var n=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^i[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},n.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],a=t.slice(0),n=0;n<128;++n){e[n/32|0]&1<<31-n%32&&(r[0]^=a[0],r[1]^=a[1],r[2]^=a[2],r[3]^=a[3]),this.pow(a,a)}return r},n.gcm.prototype.pow=function(e,t){for(var r=1&e[3],a=3;a>0;--a)t[a]=e[a]>>>1|(1&e[a-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},n.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var a=e[r/8|0]>>>4*(7-r%8)&15,n=this._m[r][a];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}return t},n.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},n.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,a=4*r,n=16*r,i=new Array(n),s=0;s<n;++s){var o=[0,0,0,0],c=(a-1-s%a)*t;o[s/a|0]=1<<t-1<<c,i[s]=this.generateSubHashTable(this.multiply(o,e),t)}return i},n.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,a=r>>>1,n=new Array(r);n[a]=e.slice(0);for(var i=a>>>1;i>0;)this.pow(n[2*i],n[i]=[]),i>>=1;for(i=2;i<a;){for(var s=1;s<i;++s){var o=n[i],c=n[s];n[i+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}i*=2}for(n[0]=[0,0,0,0],i=a+1;i<r;++i){var u=n[i^a];n[i]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return n}},function(e,t,r){var a=r(0);r(3),r(8),r(14),r(7),r(21),r(2),r(9),r(1);var n=function(e,t,r,n){var i=a.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=a.util.createBuffer(),p=a.hmac.create();r=t+r;var f=Math.ceil(n/16),h=Math.ceil(n/20);p.start(\"MD5\",c);var d=a.util.createBuffer();l.putBytes(r);for(var y=0;y<f;++y)p.start(null,null),p.update(l.getBytes()),l.putBuffer(p.digest()),p.start(null,null),p.update(l.bytes()+r),d.putBuffer(p.digest());p.start(\"SHA1\",u);var g=a.util.createBuffer();l.clear(),l.putBytes(r);for(y=0;y<h;++y)p.start(null,null),p.update(l.getBytes()),l.putBuffer(p.digest()),p.start(null,null),p.update(l.bytes()+r),g.putBuffer(p.digest());return i.putBytes(a.util.xorBytes(d.getBytes(),g.getBytes(),n)),i},i=function(e,t,r){var n=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=a.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},s=function(e,t,r){var n=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=a.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},o=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return a.util.createBuffer(e.getBytes(r))},c=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},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(e){var t=null;for(var r in u.CipherSuites){var a=u.CipherSuites[r];if(a.id[0]===e.charCodeAt(0)&&a.id[1]===e.charCodeAt(1)){t=a;break}}return t},u.handleUnexpected=function(e,t){!e.open&&e.entity===u.ConnectionEnd.client||e.error(e,{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(e,t,r){!e.handshaking&&e.handshakes>0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:i?\"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 s=t.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:a.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},i?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=o(s,2),n.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!i)for(var p=0;p<n.extensions.length;++p){var f=n.extensions[p];if(0===f.type[0]&&0===f.type[1])for(var h=o(f.data,2);h.length()>0;){if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:\"TLS version change is disallowed during renegotiation.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=u.getCipherSuite(n.cipher_suite);else for(var d=a.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:\"No cipher suites in common.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=i?n.compression_method:u.CompressionMethod.none}return n},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,a=t.random.bytes(),n=r?e.session.sp.client_random:a,i=r?a:u.createRandom().getBytes();e.session.sp={entity:e.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:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:n,server_random:i}},u.handleServerHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(a.version.minor<=e.version.minor))return e.error(e,{message:\"Incompatible TLS version.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=a.version.minor,e.session.version=e.version;var n=a.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=a.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,a)),e.session.id=n,e.process()}},u.handleClientHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(i))?i=\"\":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,i=\"\")),0===i.length&&(i=a.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c<u.SupportedVersions.length&&!((o=u.SupportedVersions[c]).minor<=n.version.minor);++c);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==s?(e.expect=S,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?m:C,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.open=!0,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHello(e)})),e.session.resuming?(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))):(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)})),e.fail||(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerKeyExchange(e)})),!1!==e.verifyClient&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateRequest(e)})),u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHelloDone(e)})))),u.flush(e),e.process()}},u.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:\"Invalid Certificate message. Message too short.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n,i,s=t.fragment,c={certificate_list:o(s,3)},l=[];try{for(;c.certificate_list.length()>0;)n=o(c.certificate_list,3),i=a.asn1.fromDer(n),n=a.pki.certificateFromAsn1(i,!0),l.push(n)}catch(t){return e.error(e,{message:\"Could not parse certificate list.\",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var f=e.entity===u.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=f?p:C:(f?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=f?p:C)):e.error(e,{message:f?\"No server certificate provided.\":\"No client certificate provided.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:\"Invalid key parameters. Only RSA is supported.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=f,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:\"Invalid key parameters. Only RSA is supported.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:o(n,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=a.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:\"Could not get private key.\",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:\"No private key set.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error(\"TLS version rollback attack detected.\")}catch(e){c.pre_master_secret=a.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:\"Invalid CertificateRequest. Message too short.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment,n={certificate_types:o(a,1),certificate_authorities:o(a,2)};e.session.certificateRequest=n,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:\"Invalid CertificateVerify. Message too short.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var s={signature:o(n,2).getBytes()},c=a.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,\"NONE\"))throw new Error(\"CertificateVerify signature does not match.\");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:\"Bad signature in CertificateVerify.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:\"Invalid ServerHelloDone message. Invalid length.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:\"No server certificate provided. Not enough security.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},i=e.verify(e,n.alert.description,0,[]);if(!0!==i)return(i||0===i)&&(\"object\"!=typeof i||a.util.isArray(i)?\"number\"==typeof i&&(n.alert.description=i):(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:\"Invalid ChangeCipherSpec message received.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var o=t.fragment.getBytes();(i=a.util.createBuffer()).putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?\"server finished\":\"client finished\",p=e.session.sp;if((i=n(p.master_secret,l,i.getBytes(),12)).getBytes()!==o)return e.error(e,{message:\"Invalid verify_data in Finished message.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:I,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,a=t.fragment,n={level:a.getByte(),description:a.getByte()};switch(n.description){case u.Alert.Description.close_notify:r=\"Connection closed.\";break;case u.Alert.Description.unexpected_message:r=\"Unexpected message.\";break;case u.Alert.Description.bad_record_mac:r=\"Bad record MAC.\";break;case u.Alert.Description.decryption_failed:r=\"Decryption failed.\";break;case u.Alert.Description.record_overflow:r=\"Record overflow.\";break;case u.Alert.Description.decompression_failure:r=\"Decompression failed.\";break;case u.Alert.Description.handshake_failure:r=\"Handshake failure.\";break;case u.Alert.Description.bad_certificate:r=\"Bad certificate.\";break;case u.Alert.Description.unsupported_certificate:r=\"Unsupported certificate.\";break;case u.Alert.Description.certificate_revoked:r=\"Certificate revoked.\";break;case u.Alert.Description.certificate_expired:r=\"Certificate expired.\";break;case u.Alert.Description.certificate_unknown:r=\"Certificate unknown.\";break;case u.Alert.Description.illegal_parameter:r=\"Illegal parameter.\";break;case u.Alert.Description.unknown_ca:r=\"Unknown certificate authority.\";break;case u.Alert.Description.access_denied:r=\"Access denied.\";break;case u.Alert.Description.decode_error:r=\"Decode error.\";break;case u.Alert.Description.decrypt_error:r=\"Decrypt error.\";break;case u.Alert.Description.export_restriction:r=\"Export restriction.\";break;case u.Alert.Description.protocol_version:r=\"Unsupported protocol version.\";break;case u.Alert.Description.insufficient_security:r=\"Insufficient security.\";break;case u.Alert.Description.internal_error:r=\"Internal error.\";break;case u.Alert.Description.user_canceled:r=\"User canceled.\";break;case u.Alert.Description.no_renegotiation:r=\"Renegotiation not supported.\";break;default:r=\"Unknown error.\"}if(n.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?\"server\":\"client\",alert:n}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=a.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(i+4);r.read+=4,n in K[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),n!==u.HandshakeType.hello_request&&n!==u.HandshakeType.certificate_verify&&n!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),K[e.entity][e.expect][n](e,t,i)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),s=r.getBytes(i);if(n===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(n===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,a.util.createBuffer(s))}e.process()};var l=1,p=2,f=3,h=4,d=5,y=6,g=7,v=8,m=1,C=2,E=3,S=4,T=5,I=6,A=u.handleUnexpected,B=u.handleChangeCipherSpec,b=u.handleAlert,N=u.handleHandshake,R=u.handleApplicationData,w=u.handleHeartbeat,_=[];_[u.ConnectionEnd.client]=[[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[B,b,A,A,w],[A,b,N,A,w],[A,b,N,R,w],[A,b,N,A,w]],_[u.ConnectionEnd.server]=[[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[A,b,N,A,w],[B,b,A,A,w],[A,b,N,A,w],[A,b,N,R,w],[A,b,N,A,w]];var L=u.handleHelloRequest,k=u.handleServerHello,U=u.handleCertificate,D=u.handleServerKeyExchange,P=u.handleCertificateRequest,V=u.handleServerHelloDone,O=u.handleFinished,K=[];K[u.ConnectionEnd.client]=[[A,A,k,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,U,D,P,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,D,P,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,P,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,V,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,O],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]];var x=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;K[u.ConnectionEnd.server]=[[A,x,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,U,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,M,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,F,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,O],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]],u.generateKeys=function(e,t){var r=n,a=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,\"master secret\",a,48).bytes(),t.pre_master_secret=null),a=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,\"key expansion\",a,i),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},a={read:r(),write:r()};if(a.read.update=function(e,t){return a.read.cipherFunction(t,a.read)?a.read.compressFunction(e,t,a.read)||e.error(e,{message:\"Could not decompress record.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:\"Could not decrypt record or bad MAC.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},a.write.update=function(e,t){return a.write.compressFunction(e,t,a.write)?a.write.cipherFunction(t,a.write)||e.error(e,{message:\"Could not encrypt record.\",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:\"Could not compress record.\",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=u.generateKeys(e,n),a.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,a.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(a,e,n),n.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:a.read.compressFunction=s,a.write.compressFunction=i;break;default:throw new Error(\"Unsupported compression algorithm.\")}}return a},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=a.util.createBuffer();return r.putInt32(t),r.putBytes(a.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=a.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=a.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var n=e.cipherSuites[r];t.putByte(n.id[0]),t.putByte(n.id[1])}var i=t.length(),s=a.util.createBuffer();s.putByte(u.CompressionMethod.none);var o=s.length(),l=a.util.createBuffer();if(e.virtualHost){var p=a.util.createBuffer();p.putByte(0),p.putByte(0);var f=a.util.createBuffer();f.putByte(0),c(f,2,a.util.createBuffer(e.virtualHost));var h=a.util.createBuffer();c(h,2,f),c(p,2,h),l.putBuffer(p)}var d=l.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+i+1+o+d,v=a.util.createBuffer();return v.putByte(u.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),c(v,1,a.util.createBuffer(y)),c(v,2,t),c(v,1,s),d>0&&c(v,2,l),v},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=a.util.createBuffer();return n.putByte(u.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),c(n,1,a.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var i=a.util.createBuffer();if(null!==n)try{a.util.isArray(n)||(n=[n]);for(var s=null,o=0;o<n.length;++o){var l=a.pem.decode(n[o])[0];if(\"CERTIFICATE\"!==l.type&&\"X509 CERTIFICATE\"!==l.type&&\"TRUSTED CERTIFICATE\"!==l.type){var p=new Error('Could not convert certificate from PEM; PEM header type is not \"CERTIFICATE\", \"X509 CERTIFICATE\", or \"TRUSTED CERTIFICATE\".');throw p.headerType=l.type,p}if(l.procType&&\"ENCRYPTED\"===l.procType.type)throw new Error(\"Could not convert certificate from PEM; PEM is encrypted.\");var f=a.util.createBuffer(l.body);null===s&&(s=a.asn1.fromDer(f.bytes(),!1));var h=a.util.createBuffer();c(h,3,f),i.putBuffer(h)}n=a.pki.certificateFromAsn1(s),r?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(t){return e.error(e,{message:\"Could not send certificate list.\",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var d=3+i.length(),y=a.util.createBuffer();return y.putByte(u.HandshakeType.certificate),y.putInt24(d),c(y,3,i),y},u.createClientKeyExchange=function(e){var t=a.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(a.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var n=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,i=a.util.createBuffer();return i.putByte(u.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},u.createServerKeyExchange=function(e){var t=a.util.createBuffer();return t},u.getClientSignature=function(e,t){var r=a.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.clientCertificate),n=a.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:\"Could not get private key.\",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}null===n?e.error(e,{message:\"No private key set.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):t=n.sign(t,null),r(e,t)},e.getSignature(e,r,t)},u.createCertificateVerify=function(e,t){var r=t.length+2,n=a.util.createBuffer();return n.putByte(u.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(t.length),n.putBytes(t),n},u.createCertificateRequest=function(e){var t=a.util.createBuffer();t.putByte(1);var r=a.util.createBuffer();for(var n in e.caStore.certs){var i=e.caStore.certs[n],s=a.pki.distinguishedNameToAsn1(i.subject),o=a.asn1.toDer(s);r.putInt16(o.length()),r.putBuffer(o)}var l=1+t.length()+2+r.length(),p=a.util.createBuffer();return p.putByte(u.HandshakeType.certificate_request),p.putInt24(l),c(p,1,t),c(p,2,r),p},u.createServerHelloDone=function(e){var t=a.util.createBuffer();return t.putByte(u.HandshakeType.server_hello_done),t.putInt24(0),t},u.createChangeCipherSpec=function(){var e=a.util.createBuffer();return e.putByte(1),e},u.createFinished=function(e){var t=a.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===u.ConnectionEnd.client,i=e.session.sp,s=r?\"client finished\":\"server finished\";t=n(i.master_secret,s,t.getBytes(),12);var o=a.util.createBuffer();return o.putByte(u.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},u.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var n=a.util.createBuffer();n.putByte(e),n.putInt16(r),n.putBytes(t);var i=n.length(),s=Math.max(16,i-r-3);return n.putBytes(a.random.getBytes(s)),n},u.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==u.ContentType.handshake&&t.type!==u.ContentType.alert&&t.type!==u.ContentType.change_cipher_spec)){if(t.type===u.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var n;if(t.fragment.length()<=u.MaxFragment)n=[t];else{n=[];for(var i=t.fragment.bytes();i.length>u.MaxFragment;)n.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(i.slice(0,u.MaxFragment))})),i=i.slice(u.MaxFragment);i.length>0&&n.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(i)}))}for(var s=0;s<n.length&&!e.fail;++s){var o=n[s];e.state.current.write.update(e,o)&&e.records.push(o)}}},u.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var j=function(e){switch(e){case!0:return!0;case a.pki.certificateError.bad_certificate:return u.Alert.Description.bad_certificate;case a.pki.certificateError.unsupported_certificate:return u.Alert.Description.unsupported_certificate;case a.pki.certificateError.certificate_revoked:return u.Alert.Description.certificate_revoked;case a.pki.certificateError.certificate_expired:return u.Alert.Description.certificate_expired;case a.pki.certificateError.certificate_unknown:return u.Alert.Description.certificate_unknown;case a.pki.certificateError.unknown_ca:return u.Alert.Description.unknown_ca;default:return u.Alert.Description.bad_certificate}};for(var G in u.verifyCertificateChain=function(e,t){try{var r={};for(var n in e.verifyOptions)r[n]=e.verifyOptions[n];r.verify=function(t,r,n){j(t);var i=e.verify(e,t,r,n);if(!0!==i){if(\"object\"==typeof i&&!a.util.isArray(i)){var s=new Error(\"The application rejected the certificate.\");throw s.send=!0,s.alert={level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate},i.message&&(s.message=i.message),i.alert&&(s.alert.description=i.alert),s}i!==t&&(i=function(e){switch(e){case!0:return!0;case u.Alert.Description.bad_certificate:return a.pki.certificateError.bad_certificate;case u.Alert.Description.unsupported_certificate:return a.pki.certificateError.unsupported_certificate;case u.Alert.Description.certificate_revoked:return a.pki.certificateError.certificate_revoked;case u.Alert.Description.certificate_expired:return a.pki.certificateError.certificate_expired;case u.Alert.Description.certificate_unknown:return a.pki.certificateError.certificate_unknown;case u.Alert.Description.unknown_ca:return a.pki.certificateError.unknown_ca;default:return a.pki.certificateError.bad_certificate}}(i))}return i},a.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var i=t;(\"object\"!=typeof i||a.util.isArray(i))&&(i={send:!0,alert:{level:u.Alert.Level.fatal,description:j(t)}}),\"send\"in i||(i.send=!0),\"alert\"in i||(i.alert={level:u.Alert.Level.fatal,description:j(i.error)}),e.error(e,i)}return!e.fail},u.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var n in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(n):delete e[n];r.getSession=function(e){var t=null,n=null;if(e?n=a.util.bytesToHex(e):r.order.length>0&&(n=r.order[0]),null!==n&&n in r.cache)for(var i in t=r.cache[n],delete r.cache[n],r.order)if(r.order[i]===n){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=a.util.bytesToHex(e);r.order.push(n),r.cache[n]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?a.util.isArray(e.caStore)?a.pki.createCaStore(e.caStore):e.caStore:a.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],u.CipherSuites)r.push(u.CipherSuites[n]);var i=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,a){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?\"client\":\"server\"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var a=!1!==r.fatal;a&&(t.fail=!0),e.error(t,r),a&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:\"Cannot initiate handshake as a server.\",fatal:!1});else if(o.handshaking)o.error(o,{message:\"Handshake already in progress.\",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||\"\").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e=\"\")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:a.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:\"Incompatible TLS version.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,a=r.length();a<e.record.length?t=e.record.length-a:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:\"Invalid fragmented record.\",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})),e.record.ready=!0));return t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var r=t.type-u.ContentType.change_cipher_spec,a=_[e.entity][e.expect];r in a?a[r](e,t):u.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return u.queue(o,u.createRecord(o,{type:u.ContentType.application_data,data:a.util.createBuffer(e)})),u.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof a.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,u.queue(o,u.createRecord(o,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_request,e,t)})),u.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,u.queue(o,u.createAlert(o,{level:u.Alert.Level.warning,description:u.Alert.Description.close_notify})),u.flush(o)),o.closed(o)),o.reset(e)},o},e.exports=a.tls=a.tls||{},u)\"function\"!=typeof u[G]&&(a.tls[G]=u[G]);a.tls.prf_tls1=n,a.tls.hmac_sha1=function(e,t,r){var n=a.hmac.create();n.start(\"SHA1\",e);var i=a.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(r.type),i.putByte(r.version.major),i.putByte(r.version.minor),i.putInt16(r.length),i.putBytes(r.fragment.bytes()),n.update(i.getBytes()),n.digest().getBytes()},a.tls.createSessionCache=u.createSessionCache,a.tls.createConnection=u.createConnection},function(e,t,r){var a=r(0);r(3),r(6),r(22),r(7),r(15),r(28),r(18),r(11),r(1),r(17);var n=a.asn1,i=e.exports=a.pki=a.pki||{};i.pemToDer=function(e){var t=a.pem.decode(e)[0];if(t.procType&&\"ENCRYPTED\"===t.procType.type)throw new Error(\"Could not convert PEM to DER; PEM is encrypted.\");return a.util.createBuffer(t.body)},i.privateKeyFromPem=function(e){var t=a.pem.decode(e)[0];if(\"PRIVATE KEY\"!==t.type&&\"RSA PRIVATE KEY\"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not \"PRIVATE KEY\" or \"RSA PRIVATE KEY\".');throw r.headerType=t.type,r}if(t.procType&&\"ENCRYPTED\"===t.procType.type)throw new Error(\"Could not convert private key from PEM; PEM is encrypted.\");var s=n.fromDer(t.body);return i.privateKeyFromAsn1(s)},i.privateKeyToPem=function(e,t){var r={type:\"RSA PRIVATE KEY\",body:n.toDer(i.privateKeyToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},i.privateKeyInfoToPem=function(e,t){var r={type:\"PRIVATE KEY\",body:n.toDer(e).getBytes()};return a.pem.encode(r,{maxline:t})}},function(e,t,r){var a=r(0);if(r(5),r(3),r(10),r(4),r(6),r(15),r(7),r(2),r(25),r(11),r(1),void 0===n)var n=a.jsbn.BigInteger;var i=a.asn1,s=a.pki=a.pki||{};e.exports=s.pbe=a.pbe=a.pbe||{};var o=s.oids,c={name:\"EncryptedPrivateKeyInfo\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"EncryptedPrivateKeyInfo.encryptionAlgorithm\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"AlgorithmIdentifier.algorithm\",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:\"encryptionOid\"},{name:\"AlgorithmIdentifier.parameters\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:\"encryptionParams\"}]},{name:\"EncryptedPrivateKeyInfo.encryptedData\",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:\"encryptedData\"}]},u={name:\"PBES2Algorithms\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"PBES2Algorithms.keyDerivationFunc\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"PBES2Algorithms.keyDerivationFunc.oid\",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:\"kdfOid\"},{name:\"PBES2Algorithms.params\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"PBES2Algorithms.params.salt\",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:\"kdfSalt\"},{name:\"PBES2Algorithms.params.iterationCount\",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:\"kdfIterationCount\"},{name:\"PBES2Algorithms.params.keyLength\",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:\"keyLength\"},{name:\"PBES2Algorithms.params.prf\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:\"PBES2Algorithms.params.prf.algorithm\",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:\"prfOid\"}]}]}]},{name:\"PBES2Algorithms.encryptionScheme\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"PBES2Algorithms.encryptionScheme.oid\",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:\"encOid\"},{name:\"PBES2Algorithms.encryptionScheme.iv\",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:\"encIv\"}]}]},l={name:\"pkcs-12PbeParams\",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:\"pkcs-12PbeParams.salt\",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:\"salt\"},{name:\"pkcs-12PbeParams.iterations\",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:\"iterations\"}]};function p(e,t){return e.start().update(t).digest().getBytes()}function f(e){var t;if(e){if(!(t=s.oids[i.derToOid(e)])){var r=new Error(\"Unsupported PRF OID.\");throw r.oid=e,r.supported=[\"hmacWithSHA1\",\"hmacWithSHA224\",\"hmacWithSHA256\",\"hmacWithSHA384\",\"hmacWithSHA512\"],r}}else t=\"hmacWithSHA1\";return h(t)}function h(e){var t=a.md;switch(e){case\"hmacWithSHA224\":t=a.md.sha512;case\"hmacWithSHA1\":case\"hmacWithSHA256\":case\"hmacWithSHA384\":case\"hmacWithSHA512\":e=e.substr(8).toLowerCase();break;default:var r=new Error(\"Unsupported PRF algorithm.\");throw r.algorithm=e,r.supported=[\"hmacWithSHA1\",\"hmacWithSHA224\",\"hmacWithSHA256\",\"hmacWithSHA384\",\"hmacWithSHA512\"],r}if(!t||!(e in t))throw new Error(\"Unknown hash algorithm: \"+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||\"aes128\",r.prfAlgorithm=r.prfAlgorithm||\"sha1\";var n,c,u,l=a.random.getBytesSync(r.saltSize),p=r.count,f=i.integerToDer(p);if(0===r.algorithm.indexOf(\"aes\")||\"des\"===r.algorithm){var d,y,g;switch(r.algorithm){case\"aes128\":n=16,d=16,y=o[\"aes128-CBC\"],g=a.aes.createEncryptionCipher;break;case\"aes192\":n=24,d=16,y=o[\"aes192-CBC\"],g=a.aes.createEncryptionCipher;break;case\"aes256\":n=32,d=16,y=o[\"aes256-CBC\"],g=a.aes.createEncryptionCipher;break;case\"des\":n=8,d=8,y=o.desCBC,g=a.des.createEncryptionCipher;break;default:throw(T=new Error(\"Cannot encrypt private key. Unknown encryption algorithm.\")).algorithm=r.algorithm,T}var v=\"hmacWith\"+r.prfAlgorithm.toUpperCase(),m=h(v),C=a.pkcs5.pbkdf2(t,l,p,n,m),E=a.random.getBytesSync(d);(I=g(C)).start(E),I.update(i.toDer(e)),I.finish(),u=I.output.getBytes();var S=function(e,t,r,n){var o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,t.getBytes())]);\"hmacWithSHA1\"!==n&&o.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(r.toString(16))),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids[n]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,\"\")]));return o}(l,f,n,v);c=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.pkcs5PBES2).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.pkcs5PBKDF2).getBytes()),S]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(y).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,E)])])])}else{var T;if(\"3des\"!==r.algorithm)throw(T=new Error(\"Cannot encrypt private key. Unknown encryption algorithm.\")).algorithm=r.algorithm,T;n=24;var I,A=new a.util.ByteBuffer(l);C=s.pbe.generatePkcs12Key(t,A,1,p,n),E=s.pbe.generatePkcs12Key(t,A,2,p,n);(I=a.des.createEncryptionCipher(C)).start(E),I.update(i.toDer(e)),I.finish(),u=I.output.getBytes(),c=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o[\"pbeWithSHAAnd3-KeyTripleDES-CBC\"]).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,l),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,f.getBytes())])])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[c,i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,u)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,n={},o=[];if(!i.validate(e,c,n,o)){var u=new Error(\"Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.\");throw u.errors=o,u}var l=i.derToOid(n.encryptionOid),p=s.pbe.getCipher(l,n.encryptionParams,t),f=a.util.createBuffer(n.encryptedData);return p.update(f),p.finish()&&(r=i.fromDer(p.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:\"ENCRYPTED PRIVATE KEY\",body:i.toDer(e).getBytes()};return a.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=a.pem.decode(e)[0];if(\"ENCRYPTED PRIVATE KEY\"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is \"ENCRYPTED PRIVATE KEY\".');throw r.headerType=t.type,r}if(t.procType&&\"ENCRYPTED\"===t.procType.type)throw new Error(\"Could not convert encrypted private key from PEM; PEM is encrypted.\");return i.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var n=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return n=s.encryptPrivateKeyInfo(n,t,r),s.encryptedPrivateKeyToPem(n)}var o,c,u,l;switch(r.algorithm){case\"aes128\":o=\"AES-128-CBC\",u=16,c=a.random.getBytesSync(16),l=a.aes.createEncryptionCipher;break;case\"aes192\":o=\"AES-192-CBC\",u=24,c=a.random.getBytesSync(16),l=a.aes.createEncryptionCipher;break;case\"aes256\":o=\"AES-256-CBC\",u=32,c=a.random.getBytesSync(16),l=a.aes.createEncryptionCipher;break;case\"3des\":o=\"DES-EDE3-CBC\",u=24,c=a.random.getBytesSync(8),l=a.des.createEncryptionCipher;break;case\"des\":o=\"DES-CBC\",u=8,c=a.random.getBytesSync(8),l=a.des.createEncryptionCipher;break;default:var p=new Error('Could not encrypt RSA private key; unsupported encryption algorithm \"'+r.algorithm+'\".');throw p.algorithm=r.algorithm,p}var f=l(a.pbe.opensslDeriveBytes(t,c.substr(0,8),u));f.start(c),f.update(i.toDer(s.privateKeyToAsn1(e))),f.finish();var h={type:\"RSA PRIVATE KEY\",procType:{version:\"4\",type:\"ENCRYPTED\"},dekInfo:{algorithm:o,parameters:a.util.bytesToHex(c).toUpperCase()},body:f.output.getBytes()};return a.pem.encode(h)},s.decryptRsaPrivateKey=function(e,t){var r=null,n=a.pem.decode(e)[0];if(\"ENCRYPTED PRIVATE KEY\"!==n.type&&\"PRIVATE KEY\"!==n.type&&\"RSA PRIVATE KEY\"!==n.type)throw(u=new Error('Could not convert private key from PEM; PEM header type is not \"ENCRYPTED PRIVATE KEY\", \"PRIVATE KEY\", or \"RSA PRIVATE KEY\".')).headerType=u,u;if(n.procType&&\"ENCRYPTED\"===n.procType.type){var o,c;switch(n.dekInfo.algorithm){case\"DES-CBC\":o=8,c=a.des.createDecryptionCipher;break;case\"DES-EDE3-CBC\":o=24,c=a.des.createDecryptionCipher;break;case\"AES-128-CBC\":o=16,c=a.aes.createDecryptionCipher;break;case\"AES-192-CBC\":o=24,c=a.aes.createDecryptionCipher;break;case\"AES-256-CBC\":o=32,c=a.aes.createDecryptionCipher;break;case\"RC2-40-CBC\":o=5,c=function(e){return a.rc2.createDecryptionCipher(e,40)};break;case\"RC2-64-CBC\":o=8,c=function(e){return a.rc2.createDecryptionCipher(e,64)};break;case\"RC2-128-CBC\":o=16,c=function(e){return a.rc2.createDecryptionCipher(e,128)};break;default:var u;throw(u=new Error('Could not decrypt private key; unsupported encryption algorithm \"'+n.dekInfo.algorithm+'\".')).algorithm=n.dekInfo.algorithm,u}var l=a.util.hexToBytes(n.dekInfo.parameters),p=c(a.pbe.opensslDeriveBytes(t,l.substr(0,8),o));if(p.start(l),p.update(a.util.createBuffer(n.body)),!p.finish())return r;r=p.output.getBytes()}else r=n.body;return null!==(r=\"ENCRYPTED PRIVATE KEY\"===n.type?s.decryptPrivateKeyInfo(i.fromDer(r),t):i.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,n,i,s){var o,c;if(null==s){if(!(\"sha1\"in a.md))throw new Error('\"sha1\" hash algorithm unavailable.');s=a.md.sha1.create()}var u=s.digestLength,l=s.blockLength,p=new a.util.ByteBuffer,f=new a.util.ByteBuffer;if(null!=e){for(c=0;c<e.length;c++)f.putInt16(e.charCodeAt(c));f.putInt16(0)}var h=f.length(),d=t.length(),y=new a.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(d/l),v=new a.util.ByteBuffer;for(c=0;c<g;c++)v.putByte(t.at(c%d));var m=l*Math.ceil(h/l),C=new a.util.ByteBuffer;for(c=0;c<m;c++)C.putByte(f.at(c%h));var E=v;E.putBuffer(C);for(var S=Math.ceil(i/u),T=1;T<=S;T++){var I=new a.util.ByteBuffer;I.putBytes(y.bytes()),I.putBytes(E.bytes());for(var A=0;A<n;A++)s.start(),s.update(I.getBytes()),I=s.digest();var B=new a.util.ByteBuffer;for(c=0;c<l;c++)B.putByte(I.at(c%u));var b=Math.ceil(d/l)+Math.ceil(h/l),N=new a.util.ByteBuffer;for(o=0;o<b;o++){var R=new a.util.ByteBuffer(E.getBytes(l)),w=511;for(c=B.length()-1;c>=0;c--)w>>=8,w+=B.at(c)+R.at(c),R.setAt(c,255&w);N.putBuffer(R)}E=N,p.putBuffer(I)}return p.truncate(p.length()-i),p},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids[\"pbeWithSHAAnd3-KeyTripleDES-CBC\"]:case s.oids[\"pbewithSHAAnd40BitRC2-CBC\"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var a=new Error(\"Cannot read encrypted PBE data block. Unsupported OID.\");throw a.oid=e,a.supportedOids=[\"pkcs5PBES2\",\"pbeWithSHAAnd3-KeyTripleDES-CBC\",\"pbewithSHAAnd40BitRC2-CBC\"],a}},s.pbe.getCipherForPBES2=function(e,t,r){var n,o={},c=[];if(!i.validate(t,u,o,c))throw(n=new Error(\"Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.\")).errors=c,n;if((e=i.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(n=new Error(\"Cannot read encrypted private key. Unsupported key derivation function OID.\")).oid=e,n.supportedOids=[\"pkcs5PBKDF2\"],n;if((e=i.derToOid(o.encOid))!==s.oids[\"aes128-CBC\"]&&e!==s.oids[\"aes192-CBC\"]&&e!==s.oids[\"aes256-CBC\"]&&e!==s.oids[\"des-EDE3-CBC\"]&&e!==s.oids.desCBC)throw(n=new Error(\"Cannot read encrypted private key. Unsupported encryption scheme OID.\")).oid=e,n.supportedOids=[\"aes128-CBC\",\"aes192-CBC\",\"aes256-CBC\",\"des-EDE3-CBC\",\"desCBC\"],n;var l,p,h=o.kdfSalt,d=a.util.createBuffer(o.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case\"aes128-CBC\":l=16,p=a.aes.createDecryptionCipher;break;case\"aes192-CBC\":l=24,p=a.aes.createDecryptionCipher;break;case\"aes256-CBC\":l=32,p=a.aes.createDecryptionCipher;break;case\"des-EDE3-CBC\":l=24,p=a.des.createDecryptionCipher;break;case\"desCBC\":l=8,p=a.des.createDecryptionCipher}var y=f(o.prfOid),g=a.pkcs5.pbkdf2(r,h,d,l,y),v=o.encIv,m=p(g);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},o=[];if(!i.validate(t,l,n,o))throw(y=new Error(\"Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.\")).errors=o,y;var c,u,p,h=a.util.createBuffer(n.salt),d=a.util.createBuffer(n.iterations);switch(d=d.getInt(d.length()<<3),e){case s.oids[\"pbeWithSHAAnd3-KeyTripleDES-CBC\"]:c=24,u=8,p=a.des.startDecrypting;break;case s.oids[\"pbewithSHAAnd40BitRC2-CBC\"]:c=5,u=8,p=function(e,t){var r=a.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error(\"Cannot read PKCS #12 PBE data block. Unsupported OID.\")).oid=e,y}var g=f(n.prfOid),v=s.pbe.generatePkcs12Key(r,h,1,d,c,g);return g.start(),p(v,s.pbe.generatePkcs12Key(r,h,2,d,u,g))},s.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!(\"md5\"in a.md))throw new Error('\"md5\" hash algorithm unavailable.');n=a.md.md5.create()}null===t&&(t=\"\");for(var i=[p(n,e+t)],s=16,o=1;s<r;++o,s+=16)i.push(p(n,i[o-1]+e+t));return i.join(\"\").substr(0,r)}},function(e,t,r){var a=r(0);r(4),r(1);var n=e.exports=a.sha256=a.sha256||{};a.md.sha256=a.md.algorithms.sha256=n,n.create=function(){s||(i=String.fromCharCode(128),i+=a.util.fillString(String.fromCharCode(0),64),o=[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],s=!0);var e=null,t=a.util.createBuffer(),r=new Array(64),n={algorithm:\"sha256\",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var r=n.messageLengthSize/4,i=0;i<r;++i)n.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n}};return n.start(),n.update=function(i,s){\"utf8\"===s&&(i=a.util.encodeUtf8(i));var o=i.length;n.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=o[1],o[1]=o[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o,u=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-u));for(var l=8*n.fullMessageLength[0],p=0;p<n.fullMessageLength.length-1;++p)l+=(o=8*n.fullMessageLength[p+1])/4294967296>>>0,s.putInt32(l>>>0),l=o>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(f,r,s);var h=a.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var i=null,s=!1,o=null;function c(e,t,r){for(var a,n,i,s,c,u,l,p,f,h,d,y,g,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)a=((a=t[c-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10,n=((n=t[c-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[c]=a+t[c-7]+n+t[c-16]|0;for(u=e.h0,l=e.h1,p=e.h2,f=e.h3,h=e.h4,d=e.h5,y=e.h6,g=e.h7,c=0;c<64;++c)i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|p&(u^l),a=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(y^h&(d^y))+o[c]+t[c],g=y,y=d,d=h,h=f+a>>>0,f=p,p=l,l=u,u=a+(n=i+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+p|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,v-=64}}},function(e,t,r){var a=r(0);r(1);var n=null;!a.util.isNodejs||a.options.usePureJavaScript||process.versions[\"node-webkit\"]||(n=r(16)),(e.exports=a.prng=a.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:\"\"},r=e.md,i=new Array(32),s=0;s<32;++s)i[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,a=0;a<32;++a)t.reseeds%r==0&&(e.update(t.pools[a].digest().getBytes()),t.pools[a].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var n=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(n),t.generated=0}function u(e){var t=null,r=a.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var i=a.util.createBuffer();if(t)for(;i.length()<e;){var s=Math.max(1,Math.min(e-i.length(),65536)/4),o=new Uint32Array(Math.floor(s));try{t(o);for(var c=0;c<o.length;++c)i.putInt32(o[c])}catch(e){if(!(\"undefined\"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(i.length()<e)for(var u,l,p,f=Math.floor(65536*Math.random());i.length()<e;){l=16807*(65535&f),l+=(32767&(u=16807*(f>>16)))<<16,f=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)p=f>>>(c<<3),p^=Math.floor(256*Math.random()),i.putByte(255&p)}return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=a.util.createBuffer();t.key=null,function l(p){if(p)return r(p);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return a.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,a){if(r)return e(r);t.collect(a),c(),e()}))}(l)}));var f=n(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=s(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed)),a.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,i=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=a.util.createBuffer();c.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=i(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},n?(t.seedFile=function(e,t){n.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return n.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,a=0;a<r;++a)t.pools[t.pool].update(e.substr(a,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var a=\"\",n=0;n<r;n+=8)a+=String.fromCharCode(e>>n&255);t.collect(a)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener(\"message\",(function e(r){var a=r.data;a.forge&&a.forge.prng&&(self.removeEventListener(\"message\",e),t(a.forge.prng.err,a.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener(\"message\",(function(r){var a=r.data;a.forge&&a.forge.prng&&t.seedFile(a.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},function(e,t,r){var a=r(0);r(1);var n=[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],i=[1,2,3,5],s=function(e,t){return e<<t&65535|(65535&e)>>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=a.rc2=a.rc2||{},a.rc2.expandKey=function(e,t){\"string\"==typeof e&&(e=a.util.createBuffer(e)),t=t||128;var r,i=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)i.putByte(n[i.at(r-1)+i.at(r-s)&255]);for(i.setAt(128-c,n[i.at(128-c)&u]),r=127-c;r>=0;r--)i.setAt(r,n[i.at(r+1)^i.at(r+c)]);return i};var c=function(e,t,r){var n,c,u,l,p=!1,f=null,h=null,d=null,y=[];for(e=a.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(n=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],i[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(n=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],i[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var a=f.getInt16Le();null!==d&&(r?a^=d.getInt16Le():d.putInt16Le(a)),t.push(65535&a)}l=r?0:63;for(var n=0;n<e.length;n++)for(var i=0;i<e[n][0];i++)e[n][1](t);for(u=0;u<4;u++)null!==d&&(r?d.putInt16Le(t[u]):t[u]^=d.getInt16Le()),h.putInt16Le(t[u])},v=null;return v={start:function(e,t){e&&\"string\"==typeof e&&(e=a.util.createBuffer(e)),p=!1,f=a.util.createBuffer(),h=t||new a.util.createBuffer,d=e,v.output=h},update:function(e){for(p||f.putBuffer(e);f.length()>=8;)g([[5,n],[1,c],[6,n],[1,c],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var a=8===f.length()?8:8-f.length();f.fillWithByte(a,a)}if(t&&(p=!0,v.update()),!r&&(t=0===f.length()))if(e)t=e(8,h,!r);else{var n=h.length(),i=h.at(n-1);i>n?t=!1:h.truncate(i)}return t}}};a.rc2.startEncrypting=function(e,t,r){var n=a.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},a.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},a.rc2.startDecrypting=function(e,t,r){var n=a.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},a.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},function(e,t,r){var a=r(0);r(1),r(2),r(9);var n=e.exports=a.pkcs1=a.pkcs1||{};function i(e,t,r){r||(r=a.md.sha1.create());for(var n=\"\",i=Math.ceil(t/r.digestLength),s=0;s<i;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}n.encode_rsa_oaep=function(e,t,r){var n,s,o,c;\"string\"==typeof r?(n=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(n=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=a.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l)throw(g=new Error(\"RSAES-OAEP input message length is too long.\")).length=t.length,g.maxLength=l,g;n||(n=\"\"),o.update(n,\"raw\");for(var p=o.digest(),f=\"\",h=l-t.length,d=0;d<h;d++)f+=\"\\0\";var y=p.getBytes()+f+\"\u0001\"+t;if(s){if(s.length!==o.digestLength){var g;throw(g=new Error(\"Invalid RSAES-OAEP seed. The seed length must match the digest length.\")).seedLength=s.length,g.digestLength=o.digestLength,g}}else s=a.random.getBytes(o.digestLength);var v=i(s,u-o.digestLength-1,c),m=a.util.xorBytes(y,v,y.length),C=i(m,o.digestLength,c),E=a.util.xorBytes(s,C,s.length);return\"\\0\"+E+m},n.decode_rsa_oaep=function(e,t,r){var n,s,o;\"string\"==typeof r?(n=r,s=arguments[3]||void 0):r&&(n=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var c=Math.ceil(e.n.bitLength()/8);if(t.length!==c)throw(m=new Error(\"RSAES-OAEP encoded message length is invalid.\")).length=t.length,m.expectedLength=c,m;if(void 0===s?s=a.md.sha1.create():s.start(),o||(o=s),c<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=t.charAt(0),p=t.substring(1,s.digestLength+1),f=t.substring(1+s.digestLength),h=i(f,s.digestLength,o),d=a.util.xorBytes(p,h,p.length),y=i(d,c-s.digestLength-1,o),g=a.util.xorBytes(f,y,f.length),v=g.substring(0,s.digestLength),m=\"\\0\"!==l,C=0;C<s.digestLength;++C)m|=u.charAt(C)!==v.charAt(C);for(var E=1,S=s.digestLength,T=s.digestLength;T<g.length;T++){var I=g.charCodeAt(T),A=1&I^1,B=E?65534:0;m|=I&B,S+=E&=A}if(m||1!==g.charCodeAt(S))throw new Error(\"Invalid RSAES-OAEP padding.\");return g.substring(S+1)}},function(e,t,r){var a=r(0);r(1),r(12),r(2),function(){if(a.prime)e.exports=a.prime;else{var t=e.exports=a.prime=a.prime||{},r=a.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],i=new r(null);i.fromInt(30);var s=function(e,t){return e|t};t.generateProbablePrime=function(e,t,n){\"function\"==typeof t&&(n=t,t={});var i=(t=t||{}).algorithm||\"PRIMEINC\";\"string\"==typeof i&&(i={name:i}),i.options=i.options||{};var s=t.prng||a.random,u={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if(\"PRIMEINC\"===i.name)return function(e,t,n,i){if(\"workers\"in n)return function(e,t,n,i){if(\"undefined\"==typeof Worker)return o(e,t,n,i);var s=c(e,t),u=n.workers,l=n.workLoad||100,p=30*l/8,f=n.workerScript||\"forge/prime.worker.js\";if(-1===u)return a.util.estimateCores((function(e,t){e&&(t=2),u=t-1,h()}));function h(){u=Math.max(1,u);for(var a=[],n=0;n<u;++n)a[n]=new Worker(f);for(n=0;n<u;++n)a[n].addEventListener(\"message\",h);var o=!1;function h(n){if(!o){0;var u=n.data;if(u.found){for(var f=0;f<a.length;++f)a[f].terminate();return o=!0,i(null,new r(u.prime,16))}s.bitLength()>e&&(s=c(e,t));var h=s.toString(16);n.target.postMessage({hex:h,workLoad:l}),s.dAddOffset(p,0)}}}h()}(e,t,n,i);return o(e,t,n,i)}(e,u,i.options,n);throw new Error(\"Invalid prime generation algorithm: \"+i.name)}}function o(e,t,r,i){var s=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(s.bitLength());\"millerRabinTests\"in r&&(o=r.millerRabinTests);var u=10;\"maxBlockTime\"in r&&(u=r.maxBlockTime),function e(t,r,i,s,o,u,l){var p=+new Date;do{if(t.bitLength()>r&&(t=c(r,i)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(n[s++%8],0)}while(u<0||+new Date-p<u);a.util.setImmediate((function(){e(t,r,i,s,o,u,l)}))}(s,e,t,0,o,u,i)}function c(e,t){var a=new r(e,t),n=e-1;return a.testBit(n)||a.bitwiseTo(r.ONE.shiftLeft(n),s,a),a.dAddOffset(31-a.mod(i).byteValue(),0),a}}()},function(e,t,r){var a=r(0);r(3),r(8),r(6),r(29),r(22),r(2),r(11),r(9),r(1),r(17);var n=a.asn1,i=a.pki,s=e.exports=a.pkcs12=a.pkcs12||{},o={name:\"ContentInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"ContentInfo.contentType\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"contentType\"},{name:\"ContentInfo.content\",tagClass:n.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:\"content\"}]},c={name:\"PFX\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"PFX.version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"version\"},o,{name:\"PFX.macData\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:\"mac\",value:[{name:\"PFX.macData.mac\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"PFX.macData.mac.digestAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"PFX.macData.mac.digestAlgorithm.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"macAlgorithm\"},{name:\"PFX.macData.mac.digestAlgorithm.parameters\",tagClass:n.Class.UNIVERSAL,captureAsn1:\"macAlgorithmParameters\"}]},{name:\"PFX.macData.mac.digest\",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:\"macDigest\"}]},{name:\"PFX.macData.macSalt\",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:\"macSalt\"},{name:\"PFX.macData.iterations\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,optional:!0,capture:\"macIterations\"}]}]},u={name:\"SafeBag\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"SafeBag.bagId\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"bagId\"},{name:\"SafeBag.bagValue\",tagClass:n.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:\"bagValue\"},{name:\"SafeBag.bagAttributes\",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,optional:!0,capture:\"bagAttributes\"}]},l={name:\"Attribute\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"Attribute.attrId\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"oid\"},{name:\"Attribute.attrValues\",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,capture:\"values\"}]},p={name:\"CertBag\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"CertBag.certId\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"certId\"},{name:\"CertBag.certValue\",tagClass:n.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:\"CertBag.certValue[0]\",tagClass:n.Class.UNIVERSAL,type:n.Class.OCTETSTRING,constructed:!1,capture:\"cert\"}]}]};function f(e,t,r,a){for(var n=[],i=0;i<e.length;i++)for(var s=0;s<e[i].safeBags.length;s++){var o=e[i].safeBags[s];void 0!==a&&o.type!==a||(null!==t?void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&n.push(o):n.push(o))}return n}function h(e){if(e.composed||e.constructed){for(var t=a.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t){var r={},s=[];if(!n.validate(e,a.pkcs7.asn1.encryptedDataValidator,r,s))throw(o=new Error(\"Cannot read EncryptedContentInfo.\")).errors=s,o;var o,c=n.derToOid(r.contentType);if(c!==i.oids.data)throw(o=new Error(\"PKCS#12 EncryptedContentInfo ContentType is not Data.\")).oid=c,o;c=n.derToOid(r.encAlgorithm);var u=i.pbe.getCipher(c,r.encParameter,t),l=h(r.encryptedContentAsn1),p=a.util.createBuffer(l.value);if(u.update(p),!u.finish())throw new Error(\"Failed to decrypt PKCS#12 SafeContents.\");return u.output.getBytes()}function y(e,t,r){if(!t&&0===e.length)return[];if((e=n.fromDer(e,t)).tagClass!==n.Class.UNIVERSAL||e.type!==n.Type.SEQUENCE||!0!==e.constructed)throw new Error(\"PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.\");for(var a=[],s=0;s<e.value.length;s++){var o=e.value[s],c={},l=[];if(!n.validate(o,u,c,l))throw(v=new Error(\"Cannot read SafeBag.\")).errors=l,v;var f,h,d={type:n.derToOid(c.bagId),attributes:g(c.bagAttributes)};a.push(d);var y=c.bagValue.value[0];switch(d.type){case i.oids.pkcs8ShroudedKeyBag:if(null===(y=i.decryptPrivateKeyInfo(y,r)))throw new Error(\"Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?\");case i.oids.keyBag:try{d.key=i.privateKeyFromAsn1(y)}catch(e){d.key=null,d.asn1=y}continue;case i.oids.certBag:f=p,h=function(){if(n.derToOid(c.certId)!==i.oids.x509Certificate){var e=new Error(\"Unsupported certificate type, only X.509 supported.\");throw e.oid=n.derToOid(c.certId),e}var r=n.fromDer(c.cert,t);try{d.cert=i.certificateFromAsn1(r,!0)}catch(e){d.cert=null,d.asn1=r}};break;default:var v;throw(v=new Error(\"Unsupported PKCS#12 SafeBag type.\")).oid=d.type,v}if(void 0!==f&&!n.validate(y,f,c,l))throw(v=new Error(\"Cannot read PKCS#12 \"+f.name)).errors=l,v;h()}return a}function g(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var a={},s=[];if(!n.validate(e[r],l,a,s)){var o=new Error(\"Cannot read PKCS#12 BagAttribute.\");throw o.errors=s,o}var c=n.derToOid(a.oid);if(void 0!==i.oids[c]){t[i.oids[c]]=[];for(var u=0;u<a.values.length;++u)t[i.oids[c]].push(a.values[u].value)}}return t}s.pkcs12FromAsn1=function(e,t,r){\"string\"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var u={};if(!n.validate(e,c,u,[]))throw(l=new Error(\"Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.\")).errors=l,l;var l,p={version:u.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return\"localKeyId\"in e?t=e.localKeyId:\"localKeyIdHex\"in e&&(t=a.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!(\"friendlyName\"in e)&&\"bagType\"in e&&(r[e.bagType]=f(p.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=f(p.safeContents,\"localKeyId\",t,e.bagType)),\"friendlyName\"in e&&(r.friendlyName=f(p.safeContents,\"friendlyName\",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return f(p.safeContents,\"friendlyName\",e,t)},getBagsByLocalKeyId:function(e,t){return f(p.safeContents,\"localKeyId\",e,t)}};if(3!==u.version.charCodeAt(0))throw(l=new Error(\"PKCS#12 PFX of version other than 3 not supported.\")).version=u.version.charCodeAt(0),l;if(n.derToOid(u.contentType)!==i.oids.data)throw(l=new Error(\"Only PKCS#12 PFX in password integrity mode supported.\")).oid=n.derToOid(u.contentType),l;var g=u.content.value[0];if(g.tagClass!==n.Class.UNIVERSAL||g.type!==n.Type.OCTETSTRING)throw new Error(\"PKCS#12 authSafe content data is not an OCTET STRING.\");if(g=h(g),u.mac){var v=null,m=0,C=n.derToOid(u.macAlgorithm);switch(C){case i.oids.sha1:v=a.md.sha1.create(),m=20;break;case i.oids.sha256:v=a.md.sha256.create(),m=32;break;case i.oids.sha384:v=a.md.sha384.create(),m=48;break;case i.oids.sha512:v=a.md.sha512.create(),m=64;break;case i.oids.md5:v=a.md.md5.create(),m=16}if(null===v)throw new Error(\"PKCS#12 uses unsupported MAC algorithm: \"+C);var E=new a.util.ByteBuffer(u.macSalt),S=\"macIterations\"in u?parseInt(a.util.bytesToHex(u.macIterations),16):1,T=s.generateKey(r,E,3,S,m,v),I=a.hmac.create();if(I.start(v,T),I.update(g.value),I.getMac().getBytes()!==u.macDigest)throw new Error(\"PKCS#12 MAC could not be verified. Invalid password?\")}return function(e,t,r,a){if((t=n.fromDer(t,r)).tagClass!==n.Class.UNIVERSAL||t.type!==n.Type.SEQUENCE||!0!==t.constructed)throw new Error(\"PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo\");for(var s=0;s<t.value.length;s++){var c=t.value[s],u={},l=[];if(!n.validate(c,o,u,l))throw(v=new Error(\"Cannot read ContentInfo.\")).errors=l,v;var p={encrypted:!1},f=null,g=u.content.value[0];switch(n.derToOid(u.contentType)){case i.oids.data:if(g.tagClass!==n.Class.UNIVERSAL||g.type!==n.Type.OCTETSTRING)throw new Error(\"PKCS#12 SafeContents Data is not an OCTET STRING.\");f=h(g).value;break;case i.oids.encryptedData:f=d(g,a),p.encrypted=!0;break;default:var v;throw(v=new Error(\"Unsupported PKCS#12 contentType.\")).contentType=n.derToOid(u.contentType),v}p.safeBags=y(f,r,a),e.safeContents.push(p)}}(p,g.value,t,r),p},s.toPkcs12Asn1=function(e,t,r,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||\"aes128\",\"useMac\"in o||(o.useMac=!0),\"localKeyId\"in o||(o.localKeyId=null),\"generateLocalKeyId\"in o||(o.generateLocalKeyId=!0);var c,u=o.localKeyId;if(null!==u)u=a.util.hexToBytes(u);else if(o.generateLocalKeyId)if(t){var l=a.util.isArray(t)?t[0]:t;\"string\"==typeof l&&(l=i.certificateFromPem(l)),(N=a.md.sha1.create()).update(n.toDer(i.certificateToAsn1(l)).getBytes()),u=N.digest().getBytes()}else u=a.random.getBytes(20);var p=[];null!==u&&p.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.localKeyId).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,u)])])),\"friendlyName\"in o&&p.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.friendlyName).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[n.create(n.Class.UNIVERSAL,n.Type.BMPSTRING,!1,o.friendlyName)])])),p.length>0&&(c=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,p));var f=[],h=[];null!==t&&(h=a.util.isArray(t)?t:[t]);for(var d=[],y=0;y<h.length;++y){\"string\"==typeof(t=h[y])&&(t=i.certificateFromPem(t));var g=0===y?c:void 0,v=i.certificateToAsn1(t),m=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.certBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.x509Certificate).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(v).getBytes())])])]),g]);d.push(m)}if(d.length>0){var C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,d),E=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(C).getBytes())])]);f.push(E)}var S=null;if(null!==e){var T=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=null===r?n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.keyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[T]),c]):n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(T,r,o)]),c]);var I=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[S]),A=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(I).getBytes())])]);f.push(A)}var B,b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,f);if(o.useMac){var N=a.md.sha1.create(),R=new a.util.ByteBuffer(a.random.getBytes(o.saltSize)),w=o.count,_=(e=s.generateKey(r,R,3,w,20),a.hmac.create());_.start(N,e),_.update(n.toDer(b).getBytes());var L=_.getMac();B=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.sha1).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,L.getBytes())]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,R.getBytes()),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(w).getBytes())])}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(3).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(b).getBytes())])]),B])},s.generateKey=a.pbe.generatePkcs12Key},function(e,t,r){var a=r(0);r(3),r(1);var n=a.asn1,i=e.exports=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=a.pkcs7||{},a.pkcs7.asn1=i;var s={name:\"ContentInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"ContentInfo.ContentType\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"contentType\"},{name:\"ContentInfo.content\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:\"content\"}]};i.contentInfoValidator=s;var o={name:\"EncryptedContentInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"EncryptedContentInfo.contentType\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"contentType\"},{name:\"EncryptedContentInfo.contentEncryptionAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"encAlgorithm\"},{name:\"EncryptedContentInfo.contentEncryptionAlgorithm.parameter\",tagClass:n.Class.UNIVERSAL,captureAsn1:\"encParameter\"}]},{name:\"EncryptedContentInfo.encryptedContent\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,capture:\"encryptedContent\",captureAsn1:\"encryptedContentAsn1\"}]};i.envelopedDataValidator={name:\"EnvelopedData\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"EnvelopedData.Version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"version\"},{name:\"EnvelopedData.RecipientInfos\",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:\"recipientInfos\"}].concat(o)},i.encryptedDataValidator={name:\"EncryptedData\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"EncryptedData.Version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"version\"}].concat(o)};var c={name:\"SignerInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"SignerInfo.version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1},{name:\"SignerInfo.issuerAndSerialNumber\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"SignerInfo.issuerAndSerialNumber.issuer\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"issuer\"},{name:\"SignerInfo.issuerAndSerialNumber.serialNumber\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"serial\"}]},{name:\"SignerInfo.digestAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"SignerInfo.digestAlgorithm.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"digestAlgorithm\"},{name:\"SignerInfo.digestAlgorithm.parameter\",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:\"digestParameter\",optional:!0}]},{name:\"SignerInfo.authenticatedAttributes\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:\"authenticatedAttributes\"},{name:\"SignerInfo.digestEncryptionAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,capture:\"signatureAlgorithm\"},{name:\"SignerInfo.encryptedDigest\",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:\"signature\"},{name:\"SignerInfo.unauthenticatedAttributes\",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:\"unauthenticatedAttributes\"}]};i.signedDataValidator={name:\"SignedData\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"SignedData.Version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"version\"},{name:\"SignedData.DigestAlgorithms\",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:\"digestAlgorithms\"},s,{name:\"SignedData.Certificates\",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:\"certificates\"},{name:\"SignedData.CertificateRevocationLists\",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:\"crls\"},{name:\"SignedData.SignerInfos\",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,capture:\"signerInfos\",optional:!0,value:[c]}]},i.recipientInfoValidator={name:\"RecipientInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"RecipientInfo.version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"version\"},{name:\"RecipientInfo.issuerAndSerial\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"RecipientInfo.issuerAndSerial.issuer\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"issuer\"},{name:\"RecipientInfo.issuerAndSerial.serialNumber\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"serial\"}]},{name:\"RecipientInfo.keyEncryptionAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"RecipientInfo.keyEncryptionAlgorithm.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"encAlgorithm\"},{name:\"RecipientInfo.keyEncryptionAlgorithm.parameter\",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:\"encParameter\",optional:!0}]},{name:\"RecipientInfo.encryptedKey\",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:\"encKey\"}]}},function(e,t,r){var a=r(0);r(1),a.mgf=a.mgf||{},(e.exports=a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(e){return{generate:function(t,r){for(var n=new a.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s<i;s++){var o=new a.util.ByteBuffer;o.putInt32(s),e.start(),e.update(t+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}}}},function(e,t,r){var a=r(0);r(4),r(1);var n=e.exports=a.sha512=a.sha512||{};a.md.sha512=a.md.algorithms.sha512=n;var i=a.sha384=a.sha512.sha384=a.sha512.sha384||{};i.create=function(){return n.create(\"SHA-384\")},a.md.sha384=a.md.algorithms.sha384=i,a.sha512.sha256=a.sha512.sha256||{create:function(){return n.create(\"SHA-512/256\")}},a.md[\"sha512/256\"]=a.md.algorithms[\"sha512/256\"]=a.sha512.sha256,a.sha512.sha224=a.sha512.sha224||{create:function(){return n.create(\"SHA-512/224\")}},a.md[\"sha512/224\"]=a.md.algorithms[\"sha512/224\"]=a.sha512.sha224,n.create=function(e){if(o||(s=String.fromCharCode(128),s+=a.util.fillString(String.fromCharCode(0),128),c=[[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]],(u={})[\"SHA-512\"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],u[\"SHA-384\"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],u[\"SHA-512/256\"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],u[\"SHA-512/224\"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===e&&(e=\"SHA-512\"),!(e in u))throw new Error(\"Invalid SHA-512 algorithm: \"+e);for(var t=u[e],r=null,n=a.util.createBuffer(),i=new Array(80),p=0;p<80;++p)i[p]=new Array(2);var f=64;switch(e){case\"SHA-384\":f=48;break;case\"SHA-512/256\":f=32;break;case\"SHA-512/224\":f=28}var h={algorithm:e.replace(\"-\",\"\").toLowerCase(),blockLength:128,digestLength:f,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,i=0;i<e;++i)h.fullMessageLength.push(0);n=a.util.createBuffer(),r=new Array(t.length);for(i=0;i<t.length;++i)r[i]=t[i].slice(0);return h}};return h.start(),h.update=function(e,t){\"utf8\"===t&&(e=a.util.encodeUtf8(e));var s=e.length;h.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/4294967296>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return n.putBytes(e),l(r,i,n),(n.read>2048||0===n.length())&&n.compact(),h},h.digest=function(){var t=a.util.createBuffer();t.putBytes(n.bytes());var o,c=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(s.substr(0,h.blockLength-c));for(var u=8*h.fullMessageLength[0],p=0;p<h.fullMessageLength.length-1;++p)u+=(o=8*h.fullMessageLength[p+1])/4294967296>>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var f=new Array(r.length);for(p=0;p<r.length;++p)f[p]=r[p].slice(0);l(f,i,t);var d,y=a.util.createBuffer();d=\"SHA-512\"===e?f.length:\"SHA-384\"===e?f.length-2:f.length-4;for(p=0;p<d;++p)y.putInt32(f[p][0]),p===d-1&&\"SHA-512/224\"===e||y.putInt32(f[p][1]);return y},h};var s=null,o=!1,c=null,u=null;function l(e,t,r){for(var a,n,i,s,o,u,l,p,f,h,d,y,g,v,m,C,E,S,T,I,A,B,b,N,R,w,_,L,k,U,D,P,V,O=r.length();O>=128;){for(_=0;_<16;++_)t[_][0]=r.getInt32()>>>0,t[_][1]=r.getInt32()>>>0;for(;_<80;++_)a=(((L=(U=t[_-2])[0])>>>19|(k=U[1])<<13)^(k>>>29|L<<3)^L>>>6)>>>0,n=((L<<13|k>>>19)^(k<<3|L>>>29)^(L<<26|k>>>6))>>>0,i=(((L=(P=t[_-15])[0])>>>1|(k=P[1])<<31)^(L>>>8|k<<24)^L>>>7)>>>0,s=((L<<31|k>>>1)^(L<<24|k>>>8)^(L<<25|k>>>7))>>>0,D=t[_-7],V=t[_-16],k=n+D[1]+s+V[1],t[_][0]=a+D[0]+i+V[0]+(k/4294967296>>>0)>>>0,t[_][1]=k>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],v=e[1][1],m=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],T=e[4][0],I=e[4][1],A=e[5][0],B=e[5][1],b=e[6][0],N=e[6][1],R=e[7][0],w=e[7][1],_=0;_<80;++_)l=((T>>>14|I<<18)^(T>>>18|I<<14)^(I>>>9|T<<23))>>>0,p=(b^T&(A^b))>>>0,o=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,u=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,f=(d&g|m&(d^g))>>>0,h=(y&v|C&(y^v))>>>0,k=w+(((T<<18|I>>>14)^(T<<14|I>>>18)^(I<<23|T>>>9))>>>0)+((N^I&(B^N))>>>0)+c[_][1]+t[_][1],a=R+l+p+c[_][0]+t[_][0]+(k/4294967296>>>0)>>>0,n=k>>>0,i=o+f+((k=u+h)/4294967296>>>0)>>>0,s=k>>>0,R=b,w=N,b=A,N=B,A=T,B=I,T=E+a+((k=S+n)/4294967296>>>0)>>>0,I=k>>>0,E=m,S=C,m=g,C=v,g=d,v=y,d=a+i+((k=n+s)/4294967296>>>0)>>>0,y=k>>>0;k=e[0][1]+y,e[0][0]=e[0][0]+d+(k/4294967296>>>0)>>>0,e[0][1]=k>>>0,k=e[1][1]+v,e[1][0]=e[1][0]+g+(k/4294967296>>>0)>>>0,e[1][1]=k>>>0,k=e[2][1]+C,e[2][0]=e[2][0]+m+(k/4294967296>>>0)>>>0,e[2][1]=k>>>0,k=e[3][1]+S,e[3][0]=e[3][0]+E+(k/4294967296>>>0)>>>0,e[3][1]=k>>>0,k=e[4][1]+I,e[4][0]=e[4][0]+T+(k/4294967296>>>0)>>>0,e[4][1]=k>>>0,k=e[5][1]+B,e[5][0]=e[5][0]+A+(k/4294967296>>>0)>>>0,e[5][1]=k>>>0,k=e[6][1]+N,e[6][0]=e[6][0]+b+(k/4294967296>>>0)>>>0,e[6][1]=k>>>0,k=e[7][1]+w,e[7][0]=e[7][0]+R+(k/4294967296>>>0)>>>0,e[7][1]=k>>>0,O-=128}}},function(e,t,r){e.exports=r(33)},function(e,t,r){e.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(e,t){var r;r=function(){return this}();try{r=r||new Function(\"return this\")()}catch(e){\"object\"==typeof window&&(r=window)}e.exports=r},function(e,t){var r={};e.exports=r;var a={};r.encode=function(e,t,r){if(\"string\"!=typeof t)throw new TypeError('\"alphabet\" must be a string.');if(void 0!==r&&\"number\"!=typeof r)throw new TypeError('\"maxline\" must be a number.');var a=\"\";if(e instanceof Uint8Array){var n=0,i=t.length,s=t.charAt(0),o=[0];for(n=0;n<e.length;++n){for(var c=0,u=e[n];c<o.length;++c)u+=o[c]<<8,o[c]=u%i,u=u/i|0;for(;u>0;)o.push(u%i),u=u/i|0}for(n=0;0===e[n]&&n<e.length-1;++n)a+=s;for(n=o.length-1;n>=0;--n)a+=t[o[n]]}else a=function(e,t){var r=0,a=t.length,n=t.charAt(0),i=[0];for(r=0;r<e.length();++r){for(var s=0,o=e.at(r);s<i.length;++s)o+=i[s]<<8,i[s]=o%a,o=o/a|0;for(;o>0;)i.push(o%a),o=o/a|0}var c=\"\";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=n;for(r=i.length-1;r>=0;--r)c+=t[i[r]];return c}(e,t);if(r){var l=new RegExp(\".{1,\"+r+\"}\",\"g\");a=a.match(l).join(\"\\r\\n\")}return a},r.decode=function(e,t){if(\"string\"!=typeof e)throw new TypeError('\"input\" must be a string.');if(\"string\"!=typeof t)throw new TypeError('\"alphabet\" must be a string.');var r=a[t];if(!r){r=a[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\\s/g,\"\");var i=t.length,s=t.charAt(0),o=[0];for(n=0;n<e.length;n++){var c=r[e.charCodeAt(n)];if(void 0===c)return;for(var u=0,l=c;u<o.length;++u)l+=o[u]*i,o[u]=255&l,l>>=8;for(;l>0;)o.push(255&l),l>>=8}for(var p=0;e[p]===s&&p<e.length-1;++p)o.push(0);return\"undefined\"!=typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())}},function(e,t,r){var a=r(0);r(5),r(20);var n=e.exports=a.tls;function i(e,t,r){var i=t.entity===a.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:a.cipher.createDecipher(\"AES-CBC\",i?r.keys.server_write_key:r.keys.client_write_key),iv:i?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:a.cipher.createCipher(\"AES-CBC\",i?r.keys.client_write_key:r.keys.server_write_key),iv:i?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=s,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=n.hmac_sha1}function s(e,t){var r,i=!1,s=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(s),t.updateSequenceNumber(),r=e.version.minor===n.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:a.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=n.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),i=!0),i}function o(e,t,r){if(!r){var a=e-t.length()%e;t.fillWithByte(a-1,a)}return!0}function c(e,t,r){var a=!0;if(r){for(var n=t.length(),i=t.last(),s=n-1-i;s<n-1;++s)a=a&&t.at(s)==i;a&&t.truncate(i+1)}return a}function u(e,t){var r,i=!1;r=e.version.minor===n.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var s=t.cipherState.cipher;s.start({iv:r}),s.update(e.fragment),i=s.finish(c);var o=t.macLength,u=a.random.getBytesSync(o),l=s.output.length();l>=o?(e.fragment=s.output.getBytes(l-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=a.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=function(e,t,r){var n=a.hmac.create();return n.start(\"SHA1\",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),t===r}(t.macKey,u,p)&&i}n.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:\"TLS_RSA_WITH_AES_128_CBC_SHA\",initSecurityParameters:function(e){e.bulk_cipher_algorithm=n.BulkCipherAlgorithm.aes,e.cipher_type=n.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=n.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},n.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:\"TLS_RSA_WITH_AES_256_CBC_SHA\",initSecurityParameters:function(e){e.bulk_cipher_algorithm=n.BulkCipherAlgorithm.aes,e.cipher_type=n.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=n.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i}},function(e,t,r){var a=r(0);r(30),e.exports=a.mgf=a.mgf||{},a.mgf.mgf1=a.mgf1},function(e,t,r){var a=r(0);r(12),r(2),r(31),r(1);var n=r(39),i=n.publicKeyValidator,s=n.privateKeyValidator;if(void 0===o)var o=a.jsbn.BigInteger;var c=a.util.ByteBuffer,u=\"undefined\"==typeof Buffer?Uint8Array:Buffer;a.pki=a.pki||{},e.exports=a.pki.ed25519=a.ed25519=a.ed25519||{};var l=a.ed25519;function p(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('\"options.message\" or \"options.md\" not specified.');t=e.md.digest().getBytes(),r=\"binary\"}if(\"string\"==typeof t&&!r)throw new TypeError('\"options.encoding\" must be \"binary\" or \"utf8\".');if(\"string\"==typeof t){if(\"undefined\"!=typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))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 a=new u(t.length()),n=0;n<a.length;++n)a[n]=t.at(n);return a}l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=a.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if(\"string\"==typeof t){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw new TypeError('\"seed\" must be '+l.constants.SEED_BYTE_LENGTH+\" bytes in length.\")}else if(!(t instanceof Uint8Array))throw new TypeError('\"seed\" must be a node.js Buffer, Uint8Array, or a binary string.');t=p({message:t,encoding:\"binary\"});for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),n=new u(l.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)n[i]=t[i];return function(e,t){var r,a=[P(),P(),P(),P()],n=E(t,32);for(n[0]&=248,n[31]&=127,n[31]|=64,L(a,n),B(e,a),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!a.asn1.validate(e,s,t,r)){var n=new Error(\"Invalid Key.\");throw n.errors=r,n}var i=a.asn1.derToOid(t.privateKeyOid),o=a.oids.EdDSA25519;if(i!==o)throw new Error('Invalid OID \"'+i+'\"; OID must be \"'+o+'\".');var c=t.privateKey;return{privateKeyBytes:p({message:a.asn1.fromDer(c).value,encoding:\"binary\"})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!a.asn1.validate(e,i,t,r)){var n=new Error(\"Invalid Key.\");throw n.errors=r,n}var s=a.asn1.derToOid(t.publicKeyOid),o=a.oids.EdDSA25519;if(s!==o)throw new Error('Invalid OID \"'+s+'\"; OID must be \"'+o+'\".');var c=t.ed25519PublicKey;if(c.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error(\"Key length is invalid.\");return p({message:c,encoding:\"binary\"})},l.publicKeyFromPrivateKey=function(e){var t=p({message:(e=e||{}).privateKey,encoding:\"binary\"});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('\"options.privateKey\" must have a byte length of '+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),a=0;a<r.length;++a)r[a]=t[32+a];return r},l.sign=function(e){var t=p(e=e||{}),r=p({message:e.privateKey,encoding:\"binary\"});if(r.length===l.constants.SEED_BYTE_LENGTH)r=l.generateKeyPair({seed:r}).privateKey;else if(r.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('\"options.privateKey\" must have a byte length of '+l.constants.SEED_BYTE_LENGTH+\" or \"+l.constants.PRIVATE_KEY_BYTE_LENGTH);var a=new u(l.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,a){var n,i,s=new Float64Array(64),o=[P(),P(),P(),P()],c=E(a,32);c[0]&=248,c[31]&=127,c[31]|=64;var u=r+64;for(n=0;n<r;++n)e[64+n]=t[n];for(n=0;n<32;++n)e[32+n]=c[32+n];var l=E(e.subarray(32),r+32);for(T(l),L(o,l),B(e,o),n=32;n<64;++n)e[n]=a[n];var p=E(e,r+64);for(T(p),n=32;n<64;++n)s[n]=0;for(n=0;n<32;++n)s[n]=l[n];for(n=0;n<32;++n)for(i=0;i<32;i++)s[n+i]+=p[n]*c[i];S(e.subarray(32),s)}(a,t,t.length,r);for(var n=new u(l.constants.SIGN_BYTE_LENGTH),i=0;i<n.length;++i)n[i]=a[i];return n},l.verify=function(e){var t=p(e=e||{});if(void 0===e.signature)throw new TypeError('\"options.signature\" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=p({message:e.signature,encoding:\"binary\"});if(r.length!==l.constants.SIGN_BYTE_LENGTH)throw new TypeError('\"options.signature\" must have a byte length of '+l.constants.SIGN_BYTE_LENGTH);var a=p({message:e.publicKey,encoding:\"binary\"});if(a.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('\"options.publicKey\" must have a byte length of '+l.constants.PUBLIC_KEY_BYTE_LENGTH);var n,i=new u(l.constants.SIGN_BYTE_LENGTH+t.length),s=new u(l.constants.SIGN_BYTE_LENGTH+t.length);for(n=0;n<l.constants.SIGN_BYTE_LENGTH;++n)i[n]=r[n];for(n=0;n<t.length;++n)i[n+l.constants.SIGN_BYTE_LENGTH]=t[n];return function(e,t,r,a){var n,i=new u(32),s=[P(),P(),P(),P()],o=[P(),P(),P(),P()];if(-1,r<64)return-1;if(function(e,t){var r=P(),a=P(),n=P(),i=P(),s=P(),o=P(),c=P();k(e[2],h),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),K(n,e[1]),x(i,n,d),O(n,n,e[2]),V(i,e[2],i),K(s,i),K(o,s),x(c,o,s),x(r,c,n),x(r,r,i),function(e,t){var r,a=P();for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)K(a,a),1!==r&&x(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(r,r),x(r,r,n),x(r,r,i),x(r,r,i),x(e[0],r,i),K(a,e[0]),x(a,a,i),N(a,n)&&x(e[0],e[0],C);if(K(a,e[0]),x(a,a,i),N(a,n))return-1;w(e[0])===t[31]>>7&&O(e[0],f,e[0]);return x(e[3],e[0],e[1]),0}(o,a))return-1;for(n=0;n<r;++n)e[n]=t[n];for(n=0;n<32;++n)e[n+32]=a[n];var c=E(e,r);if(T(c),_(s,o,c),L(o,t.subarray(32)),I(s,o),B(i,s),r-=64,R(t,0,i,0)){for(n=0;n<r;++n)e[n]=0;return-1}for(n=0;n<r;++n)e[n]=t[n+64];return r}(s,i,i.length,a)>=0};var f=P(),h=P([1]),d=P([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=P([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=P([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=P([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=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]),C=P([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=a.md.sha512.create(),n=new c(e);r.update(n.getBytes(t),\"binary\");var i=r.digest().getBytes();if(\"undefined\"!=typeof Buffer)return Buffer.from(i,\"binary\");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=i.charCodeAt(o);return s}function S(e,t){var r,a,n,i;for(a=63;a>=32;--a){for(r=0,n=a-32,i=a-12;n<i;++n)t[n]+=r-16*t[a]*m[n-(a-32)],r=t[n]+128>>8,t[n]-=256*r;t[n]+=r,t[a]=0}for(r=0,n=0;n<32;++n)t[n]+=r-(t[31]>>4)*m[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=r*m[n];for(a=0;a<32;++a)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function I(e,t){var r=P(),a=P(),n=P(),i=P(),s=P(),o=P(),c=P(),u=P(),l=P();O(r,e[1],e[0]),O(l,t[1],t[0]),x(r,r,l),V(a,e[0],e[1]),V(l,t[0],t[1]),x(a,a,l),x(n,e[3],t[3]),x(n,n,y),x(i,e[2],t[2]),V(i,i,i),O(s,a,r),O(o,i,n),V(c,i,n),V(u,a,r),x(e[0],s,o),x(e[1],u,c),x(e[2],c,o),x(e[3],s,u)}function A(e,t,r){for(var a=0;a<4;++a)D(e[a],t[a],r)}function B(e,t){var r=P(),a=P(),n=P();!function(e,t){var r,a=P();for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)K(a,a),2!==r&&4!==r&&x(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(n,t[2]),x(r,t[0],n),x(a,t[1],n),b(e,a),e[31]^=w(r)<<7}function b(e,t){var r,a,n,i=P(),s=P();for(r=0;r<16;++r)s[r]=t[r];for(U(s),U(s),U(s),a=0;a<2;++a){for(i[0]=s[0]-65517,r=1;r<15;++r)i[r]=s[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,D(s,i,1-n)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function N(e,t){var r=new u(32),a=new u(32);return b(r,e),b(a,t),R(r,0,a,0)}function R(e,t,r,a){return function(e,t,r,a,n){var i,s=0;for(i=0;i<n;++i)s|=e[t+i]^r[a+i];return(1&s-1>>>8)-1}(e,t,r,a,32)}function w(e){var t=new u(32);return b(t,e),1&t[0]}function _(e,t,r){var a,n;for(k(e[0],f),k(e[1],h),k(e[2],h),k(e[3],f),n=255;n>=0;--n)A(e,t,a=r[n/8|0]>>(7&n)&1),I(t,e),I(e,e),A(e,t,a)}function L(e,t){var r=[P(),P(),P(),P()];k(r[0],g),k(r[1],v),k(r[2],h),x(r[3],g,v),_(e,r,t)}function k(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,a=1;for(t=0;t<16;++t)r=e[t]+a+65535,a=Math.floor(r/65536),e[t]=r-65536*a;e[0]+=a-1+37*(a-1)}function D(e,t,r){for(var a,n=~(r-1),i=0;i<16;++i)a=n&(e[i]^t[i]),e[i]^=a,t[i]^=a}function P(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function V(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]+r[a]}function O(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]-r[a]}function K(e,t){x(e,t,t)}function x(e,t,r){var a,n,i=0,s=0,o=0,c=0,u=0,l=0,p=0,f=0,h=0,d=0,y=0,g=0,v=0,m=0,C=0,E=0,S=0,T=0,I=0,A=0,B=0,b=0,N=0,R=0,w=0,_=0,L=0,k=0,U=0,D=0,P=0,V=r[0],O=r[1],K=r[2],x=r[3],M=r[4],F=r[5],j=r[6],G=r[7],H=r[8],q=r[9],Q=r[10],z=r[11],Y=r[12],X=r[13],W=r[14],Z=r[15];i+=(a=t[0])*V,s+=a*O,o+=a*K,c+=a*x,u+=a*M,l+=a*F,p+=a*j,f+=a*G,h+=a*H,d+=a*q,y+=a*Q,g+=a*z,v+=a*Y,m+=a*X,C+=a*W,E+=a*Z,s+=(a=t[1])*V,o+=a*O,c+=a*K,u+=a*x,l+=a*M,p+=a*F,f+=a*j,h+=a*G,d+=a*H,y+=a*q,g+=a*Q,v+=a*z,m+=a*Y,C+=a*X,E+=a*W,S+=a*Z,o+=(a=t[2])*V,c+=a*O,u+=a*K,l+=a*x,p+=a*M,f+=a*F,h+=a*j,d+=a*G,y+=a*H,g+=a*q,v+=a*Q,m+=a*z,C+=a*Y,E+=a*X,S+=a*W,T+=a*Z,c+=(a=t[3])*V,u+=a*O,l+=a*K,p+=a*x,f+=a*M,h+=a*F,d+=a*j,y+=a*G,g+=a*H,v+=a*q,m+=a*Q,C+=a*z,E+=a*Y,S+=a*X,T+=a*W,I+=a*Z,u+=(a=t[4])*V,l+=a*O,p+=a*K,f+=a*x,h+=a*M,d+=a*F,y+=a*j,g+=a*G,v+=a*H,m+=a*q,C+=a*Q,E+=a*z,S+=a*Y,T+=a*X,I+=a*W,A+=a*Z,l+=(a=t[5])*V,p+=a*O,f+=a*K,h+=a*x,d+=a*M,y+=a*F,g+=a*j,v+=a*G,m+=a*H,C+=a*q,E+=a*Q,S+=a*z,T+=a*Y,I+=a*X,A+=a*W,B+=a*Z,p+=(a=t[6])*V,f+=a*O,h+=a*K,d+=a*x,y+=a*M,g+=a*F,v+=a*j,m+=a*G,C+=a*H,E+=a*q,S+=a*Q,T+=a*z,I+=a*Y,A+=a*X,B+=a*W,b+=a*Z,f+=(a=t[7])*V,h+=a*O,d+=a*K,y+=a*x,g+=a*M,v+=a*F,m+=a*j,C+=a*G,E+=a*H,S+=a*q,T+=a*Q,I+=a*z,A+=a*Y,B+=a*X,b+=a*W,N+=a*Z,h+=(a=t[8])*V,d+=a*O,y+=a*K,g+=a*x,v+=a*M,m+=a*F,C+=a*j,E+=a*G,S+=a*H,T+=a*q,I+=a*Q,A+=a*z,B+=a*Y,b+=a*X,N+=a*W,R+=a*Z,d+=(a=t[9])*V,y+=a*O,g+=a*K,v+=a*x,m+=a*M,C+=a*F,E+=a*j,S+=a*G,T+=a*H,I+=a*q,A+=a*Q,B+=a*z,b+=a*Y,N+=a*X,R+=a*W,w+=a*Z,y+=(a=t[10])*V,g+=a*O,v+=a*K,m+=a*x,C+=a*M,E+=a*F,S+=a*j,T+=a*G,I+=a*H,A+=a*q,B+=a*Q,b+=a*z,N+=a*Y,R+=a*X,w+=a*W,_+=a*Z,g+=(a=t[11])*V,v+=a*O,m+=a*K,C+=a*x,E+=a*M,S+=a*F,T+=a*j,I+=a*G,A+=a*H,B+=a*q,b+=a*Q,N+=a*z,R+=a*Y,w+=a*X,_+=a*W,L+=a*Z,v+=(a=t[12])*V,m+=a*O,C+=a*K,E+=a*x,S+=a*M,T+=a*F,I+=a*j,A+=a*G,B+=a*H,b+=a*q,N+=a*Q,R+=a*z,w+=a*Y,_+=a*X,L+=a*W,k+=a*Z,m+=(a=t[13])*V,C+=a*O,E+=a*K,S+=a*x,T+=a*M,I+=a*F,A+=a*j,B+=a*G,b+=a*H,N+=a*q,R+=a*Q,w+=a*z,_+=a*Y,L+=a*X,k+=a*W,U+=a*Z,C+=(a=t[14])*V,E+=a*O,S+=a*K,T+=a*x,I+=a*M,A+=a*F,B+=a*j,b+=a*G,N+=a*H,R+=a*q,w+=a*Q,_+=a*z,L+=a*Y,k+=a*X,U+=a*W,D+=a*Z,E+=(a=t[15])*V,s+=38*(T+=a*K),o+=38*(I+=a*x),c+=38*(A+=a*M),u+=38*(B+=a*F),l+=38*(b+=a*j),p+=38*(N+=a*G),f+=38*(R+=a*H),h+=38*(w+=a*q),d+=38*(_+=a*Q),y+=38*(L+=a*z),g+=38*(k+=a*Y),v+=38*(U+=a*X),m+=38*(D+=a*W),C+=38*(P+=a*Z),i=(a=(i+=38*(S+=a*O))+(n=1)+65535)-65536*(n=Math.floor(a/65536)),s=(a=s+n+65535)-65536*(n=Math.floor(a/65536)),o=(a=o+n+65535)-65536*(n=Math.floor(a/65536)),c=(a=c+n+65535)-65536*(n=Math.floor(a/65536)),u=(a=u+n+65535)-65536*(n=Math.floor(a/65536)),l=(a=l+n+65535)-65536*(n=Math.floor(a/65536)),p=(a=p+n+65535)-65536*(n=Math.floor(a/65536)),f=(a=f+n+65535)-65536*(n=Math.floor(a/65536)),h=(a=h+n+65535)-65536*(n=Math.floor(a/65536)),d=(a=d+n+65535)-65536*(n=Math.floor(a/65536)),y=(a=y+n+65535)-65536*(n=Math.floor(a/65536)),g=(a=g+n+65535)-65536*(n=Math.floor(a/65536)),v=(a=v+n+65535)-65536*(n=Math.floor(a/65536)),m=(a=m+n+65535)-65536*(n=Math.floor(a/65536)),C=(a=C+n+65535)-65536*(n=Math.floor(a/65536)),E=(a=E+n+65535)-65536*(n=Math.floor(a/65536)),i=(a=(i+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(a/65536)),s=(a=s+n+65535)-65536*(n=Math.floor(a/65536)),o=(a=o+n+65535)-65536*(n=Math.floor(a/65536)),c=(a=c+n+65535)-65536*(n=Math.floor(a/65536)),u=(a=u+n+65535)-65536*(n=Math.floor(a/65536)),l=(a=l+n+65535)-65536*(n=Math.floor(a/65536)),p=(a=p+n+65535)-65536*(n=Math.floor(a/65536)),f=(a=f+n+65535)-65536*(n=Math.floor(a/65536)),h=(a=h+n+65535)-65536*(n=Math.floor(a/65536)),d=(a=d+n+65535)-65536*(n=Math.floor(a/65536)),y=(a=y+n+65535)-65536*(n=Math.floor(a/65536)),g=(a=g+n+65535)-65536*(n=Math.floor(a/65536)),v=(a=v+n+65535)-65536*(n=Math.floor(a/65536)),m=(a=m+n+65535)-65536*(n=Math.floor(a/65536)),C=(a=C+n+65535)-65536*(n=Math.floor(a/65536)),E=(a=E+n+65535)-65536*(n=Math.floor(a/65536)),i+=n-1+37*(n-1),e[0]=i,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=l,e[6]=p,e[7]=f,e[8]=h,e[9]=d,e[10]=y,e[11]=g,e[12]=v,e[13]=m,e[14]=C,e[15]=E}},function(e,t,r){var a=r(0);r(3);var n=a.asn1;t.privateKeyValidator={name:\"PrivateKeyInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"PrivateKeyInfo.version\",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:\"privateKeyVersion\"},{name:\"PrivateKeyInfo.privateKeyAlgorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"AlgorithmIdentifier.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"privateKeyOid\"}]},{name:\"PrivateKeyInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:\"privateKey\"}]},t.publicKeyValidator={name:\"SubjectPublicKeyInfo\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:\"subjectPublicKeyInfo\",value:[{name:\"SubjectPublicKeyInfo.AlgorithmIdentifier\",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:\"AlgorithmIdentifier.algorithm\",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:\"publicKeyOid\"}]},{tagClass:n.Class.UNIVERSAL,type:n.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:\"ed25519PublicKey\"}]}},function(e,t,r){var a=r(0);r(1),r(2),r(12),e.exports=a.kem=a.kem||{};var n=a.jsbn.BigInteger;function i(e,t,r,n){e.generate=function(e,i){for(var s=new a.util.ByteBuffer,o=Math.ceil(i/n)+r,c=new a.util.ByteBuffer,u=r;u<o;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var l=t.digest();s.putBytes(l.getBytes(n))}return s.truncate(s.length()-i),s.getBytes()}}a.kem.rsa={},a.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||a.random,i={encrypt:function(t,i){var s,o=Math.ceil(t.n.bitLength()/8);do{s=new n(a.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n)}while(s.compareTo(n.ONE)<=0);var c=o-(s=a.util.hexToBytes(s.toString(16))).length;return c>0&&(s=a.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,\"NONE\"),key:e.generate(s,i)}},decrypt:function(t,r,a){var n=t.decrypt(r,\"NONE\");return e.generate(n,a)}};return i},a.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},a.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)}},function(e,t,r){var a=r(0);r(1),e.exports=a.log=a.log||{},a.log.levels=[\"none\",\"error\",\"warning\",\"info\",\"debug\",\"verbose\",\"max\"];var n={},i=[],s=null;a.log.LEVEL_LOCKED=2,a.log.NO_LEVEL_CHECK=4,a.log.INTERPOLATE=8;for(var o=0;o<a.log.levels.length;++o){var c=a.log.levels[o];n[c]={index:o,name:c.toUpperCase()}}a.log.logMessage=function(e){for(var t=n[e.level].index,r=0;r<i.length;++r){var s=i[r];if(s.flags&a.log.NO_LEVEL_CHECK)s.f(e);else t<=n[s.level].index&&s.f(s,e)}},a.log.prepareStandard=function(e){\"standard\"in e||(e.standard=n[e.level].name+\" [\"+e.category+\"] \"+e.message)},a.log.prepareFull=function(e){if(!(\"full\"in e)){var t=[e.message];t=t.concat([]||!1),e.full=a.util.format.apply(this,t)}},a.log.prepareStandardFull=function(e){\"standardFull\"in e||(a.log.prepareStandard(e),e.standardFull=e.standard)};var u=[\"error\",\"warning\",\"info\",\"debug\",\"verbose\"];for(o=0;o<u.length;++o)!function(e){a.log[e]=function(t,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:r,arguments:n};a.log.logMessage(i)}}(u[o]);if(a.log.makeLogger=function(e){var t={flags:0,f:e};return a.log.setLevel(t,\"none\"),t},a.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&a.log.LEVEL_LOCKED))for(var n=0;n<a.log.levels.length;++n){if(t==a.log.levels[n]){e.level=t,r=!0;break}}return r},a.log.lock=function(e,t){void 0===t||t?e.flags|=a.log.LEVEL_LOCKED:e.flags&=~a.log.LEVEL_LOCKED},a.log.addLogger=function(e){i.push(e)},\"undefined\"!=typeof console&&\"log\"in console){var l;if(console.error&&console.warn&&console.info&&console.debug){var p={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},f=function(e,t){a.log.prepareStandard(t);var r=p[t.level],n=[t.standard];n=n.concat(t.arguments.slice()),r.apply(console,n)};l=a.log.makeLogger(f)}else{f=function(e,t){a.log.prepareStandardFull(t),console.log(t.standardFull)};l=a.log.makeLogger(f)}a.log.setLevel(l,\"debug\"),a.log.addLogger(l),s=l}else console={log:function(){}};if(null!==s&&\"undefined\"!=typeof window&&window.location){var h=new URL(window.location.href).searchParams;if(h.has(\"console.level\")&&a.log.setLevel(s,h.get(\"console.level\").slice(-1)[0]),h.has(\"console.lock\"))\"true\"==h.get(\"console.lock\").slice(-1)[0]&&a.log.lock(s)}a.log.consoleLogger=s},function(e,t,r){e.exports=r(4),r(14),r(9),r(23),r(31)},function(e,t,r){var a=r(0);r(5),r(3),r(10),r(6),r(7),r(29),r(2),r(1),r(17);var n=a.asn1,i=e.exports=a.pkcs7=a.pkcs7||{};function s(e){var t={},r=[];if(!n.validate(e,i.asn1.recipientInfoValidator,t,r)){var s=new Error(\"Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.\");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(t.issuer),serialNumber:a.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:n.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function o(e){for(var t,r=[],i=0;i<e.length;++i)r.push((t=e[i],n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(t.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:t.issuer}),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,a.util.hexToBytes(t.serialNumber))]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.encryptedContent.algorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function c(e){var t=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:e.issuer}),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,a.util.hexToBytes(e.serialNumber))]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.digestAlgorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.signatureAlgorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")])),t.value.push(n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i<e.unauthenticatedAttributes.length;++i){var s=e.unauthenticatedAttributes[i];r.values.push(u(s))}t.value.push(r)}return t}function u(e){var t;if(e.type===a.pki.oids.contentType)t=n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.value).getBytes());else if(e.type===a.pki.oids.messageDigest)t=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===a.pki.oids.signingTime){var r=new Date(\"1950-01-01T00:00:00Z\"),i=new Date(\"2050-01-01T00:00:00Z\"),s=e.value;if(\"string\"==typeof s){var o=Date.parse(s);s=isNaN(o)?13===s.length?n.utcTimeToDate(s):n.generalizedTimeToDate(s):new Date(o)}t=s>=r&&s<i?n.create(n.Class.UNIVERSAL,n.Type.UTCTIME,!1,n.dateToUtcTime(s)):n.create(n.Class.UNIVERSAL,n.Type.GENERALIZEDTIME,!1,n.dateToGeneralizedTime(s))}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.type).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[t])])}function l(e,t,r){var i={};if(!n.validate(t,r,i,[])){var s=new Error(\"Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.\");throw s.errors=s,s}if(n.derToOid(i.contentType)!==a.pki.oids.data)throw new Error(\"Unsupported PKCS#7 message. Only wrapped ContentType Data supported.\");if(i.encryptedContent){var o=\"\";if(a.util.isArray(i.encryptedContent))for(var c=0;c<i.encryptedContent.length;++c){if(i.encryptedContent[c].type!==n.Type.OCTETSTRING)throw new Error(\"Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.\");o+=i.encryptedContent[c].value}else o=i.encryptedContent;e.encryptedContent={algorithm:n.derToOid(i.encAlgorithm),parameter:a.util.createBuffer(i.encParameter.value),content:a.util.createBuffer(o)}}if(i.content){o=\"\";if(a.util.isArray(i.content))for(c=0;c<i.content.length;++c){if(i.content[c].type!==n.Type.OCTETSTRING)throw new Error(\"Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.\");o+=i.content[c].value}else o=i.content;e.content=a.util.createBuffer(o)}return e.version=i.version.charCodeAt(0),e.rawCapture=i,i}function p(e){if(void 0===e.encryptedContent.key)throw new Error(\"Symmetric key not available.\");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case a.pki.oids[\"aes128-CBC\"]:case a.pki.oids[\"aes192-CBC\"]:case a.pki.oids[\"aes256-CBC\"]:t=a.aes.createDecryptionCipher(e.encryptedContent.key);break;case a.pki.oids.desCBC:case a.pki.oids[\"des-EDE3-CBC\"]:t=a.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error(\"Unsupported symmetric cipher, OID \"+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error(\"Symmetric decryption failed.\");e.content=t.output}}i.messageFromPem=function(e){var t=a.pem.decode(e)[0];if(\"PKCS7\"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not \"PKCS#7\".');throw r.headerType=t.type,r}if(t.procType&&\"ENCRYPTED\"===t.procType.type)throw new Error(\"Could not convert PKCS#7 message from PEM; PEM is encrypted.\");var s=n.fromDer(t.body);return i.messageFromAsn1(s)},i.messageToPem=function(e,t){var r={type:\"PKCS7\",body:n.toDer(e.toAsn1()).getBytes()};return a.pem.encode(r,{maxline:t})},i.messageFromAsn1=function(e){var t={},r=[];if(!n.validate(e,i.asn1.contentInfoValidator,t,r)){var s=new Error(\"Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.\");throw s.errors=r,s}var o,c=n.derToOid(t.contentType);switch(c){case a.pki.oids.envelopedData:o=i.createEnvelopedData();break;case a.pki.oids.encryptedData:o=i.createEncryptedData();break;case a.pki.oids.signedData:o=i.createSignedData();break;default:throw new Error(\"Cannot read PKCS#7 message. ContentType with OID \"+c+\" is not (yet) supported.\")}return o.fromAsn1(t.content.value[0]),o},i.createSignedData=function(){var e=null;return e={type:a.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,i.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,n=0;n<r.length;++n)e.certificates.push(a.pki.certificateFromAsn1(r[n]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(a.pki.certificateToAsn1(e.certificates[r]));var i=[],s=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,t)),i.length>0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(n.create(n.Class.UNIVERSAL,n.Type.SET,!0,e.signerInfos)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var i=t.certificate;\"string\"==typeof i&&(i=a.pki.certificateFromPem(i)),r=i.issuer.attributes,n=i.serialNumber}var s=t.key;if(!s)throw new Error(\"Could not add PKCS#7 signer; no private key specified.\");\"string\"==typeof s&&(s=a.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||a.pki.oids.sha1;switch(o){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw new Error(\"Could not add PKCS#7 signer; unknown message digest algorithm: \"+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,p=0;p<c.length;++p){var f=c[p];if(u||f.type!==a.pki.oids.contentType){if(l||f.type!==a.pki.oids.messageDigest);else if(l=!0,u)break}else if(u=!0,l)break}if(!u||!l)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.\")}e.signers.push({key:s,version:1,issuer:r,serialNumber:n,digestAlgorithm:o,signatureAlgorithm:a.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},\"object\"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.pki.oids.data).getBytes())]),\"content\"in e&&(e.content instanceof a.util.ByteBuffer?r=e.content.bytes():\"string\"==typeof e.content&&(r=a.util.encodeUtf8(e.content)),t.detached?e.detachedContent=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error(\"Could not sign PKCS#7 message; there is no content to sign.\");var i=n.derToOid(e.contentInfo.value[0].value),s=n.toDer(r);for(var o in s.getByte(),n.getBerValueLength(s),s=s.getBytes(),t)t[o].start().update(s);for(var l=new Date,p=0;p<e.signers.length;++p){var f=e.signers[p];if(0===f.authenticatedAttributes.length){if(i!==a.pki.oids.data)throw new Error(\"Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.\")}else{f.authenticatedAttributesAsn1=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var h=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[]),d=0;d<f.authenticatedAttributes.length;++d){var y=f.authenticatedAttributes[d];y.type===a.pki.oids.messageDigest?y.value=t[f.digestAlgorithm].digest():y.type===a.pki.oids.signingTime&&(y.value||(y.value=l)),h.value.push(u(y)),f.authenticatedAttributesAsn1.value.push(u(y))}s=n.toDer(h).getBytes(),f.md.start().update(s)}f.signature=f.key.sign(f.md,\"RSASSA-PKCS1-V1_5\")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(c(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var i=e.signers[r];(s=i.digestAlgorithm)in t||(t[s]=a.md[a.pki.oids[s]].create()),0===i.authenticatedAttributes.length?i.md=t[s]:i.md=a.md[a.pki.oids[s]].create()}for(var s in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,\"\")]));return t}())},verify:function(){throw new Error(\"PKCS#7 signature verification not yet implemented.\")},addCertificate:function(t){\"string\"==typeof t&&(t=a.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error(\"PKCS#7 CRL support not yet implemented.\")}}},i.createEncryptedData=function(){var e=null;return e={type:a.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:a.pki.oids[\"aes256-CBC\"]},fromAsn1:function(t){l(e,t,i.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),p(e)}}},i.createEnvelopedData=function(){var e=null;return e={type:a.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:a.pki.oids[\"aes256-CBC\"]},fromAsn1:function(t){var r=l(e,t,i.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(s(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.type).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,o(e.recipients)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,(t=e.encryptedContent,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.pki.oids.data).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(t.algorithm).getBytes()),t.parameter?n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,t.parameter.getBytes()):void 0]),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,a=0;a<e.recipients.length;++a){var n=e.recipients[a],i=n.issuer;if(n.serialNumber===t.serialNumber&&i.length===r.length){for(var s=!0,o=0;o<r.length;++o)if(i[o].type!==r[o].type||i[o].value!==r[o].value){s=!1;break}if(s)return n}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:case a.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=a.util.createBuffer(n);break;default:throw new Error(\"Unsupported asymmetric cipher, OID \"+t.encryptedContent.algorithm)}p(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:a.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var n,i,s;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case a.pki.oids[\"aes128-CBC\"]:n=16,i=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids[\"aes192-CBC\"]:n=24,i=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids[\"aes256-CBC\"]:n=32,i=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids[\"des-EDE3-CBC\"]:n=24,i=8,s=a.des.createEncryptionCipher;break;default:throw new Error(\"Unsupported symmetric cipher, OID \"+r)}if(void 0===t)t=a.util.createBuffer(a.random.getBytes(n));else if(t.length()!=n)throw new Error(\"Symmetric key has wrong length; got \"+t.length()+\" bytes, expected \"+n+\".\");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=a.util.createBuffer(a.random.getBytes(i));var o=s(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error(\"Symmetric encryption failed.\");e.encryptedContent.content=o.output}for(var c=0;c<e.recipients.length;++c){var u=e.recipients[c];if(void 0===u.encryptedContent.content)switch(u.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error(\"Unsupported asymmetric cipher, OID \"+u.encryptedContent.algorithm)}}}}}},function(e,t,r){var a=r(0);r(5),r(8),r(14),r(9),r(1);var n=e.exports=a.ssh=a.ssh||{};function i(e,t){var r=t.toString(16);r[0]>=\"8\"&&(r=\"00\"+r);var n=a.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=a.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}n.privateKeyToPutty=function(e,t,r){var n=\"\"===(t=t||\"\")?\"none\":\"aes256-cbc\",c=\"PuTTY-User-Key-File-2: ssh-rsa\\r\\n\";c+=\"Encryption: \"+n+\"\\r\\n\",c+=\"Comment: \"+(r=r||\"\")+\"\\r\\n\";var u=a.util.createBuffer();s(u,\"ssh-rsa\"),i(u,e.e),i(u,e.n);var l=a.util.encode64(u.bytes(),64),p=Math.floor(l.length/66)+1;c+=\"Public-Lines: \"+p+\"\\r\\n\",c+=l;var f,h=a.util.createBuffer();if(i(h,e.d),i(h,e.p),i(h,e.q),i(h,e.qInv),t){var d=h.length()+16-1;d-=d%16;var y=o(h.bytes());y.truncate(y.length()-d+h.length()),h.putBuffer(y);var g=a.util.createBuffer();g.putBuffer(o(\"\\0\\0\\0\\0\",t)),g.putBuffer(o(\"\\0\\0\\0\u0001\",t));var v=a.aes.createEncryptionCipher(g.truncate(8),\"CBC\");v.start(a.util.createBuffer().fillWithByte(0,16)),v.update(h.copy()),v.finish();var m=v.output;m.truncate(16),f=a.util.encode64(m.bytes(),64)}else f=a.util.encode64(h.bytes(),64);c+=\"\\r\\nPrivate-Lines: \"+(p=Math.floor(f.length/66)+1)+\"\\r\\n\",c+=f;var C=o(\"putty-private-key-file-mac-key\",t),E=a.util.createBuffer();s(E,\"ssh-rsa\"),s(E,n),s(E,r),E.putInt32(u.length()),E.putBuffer(u),E.putInt32(h.length()),E.putBuffer(h);var S=a.hmac.create();return S.start(\"sha1\",C),S.update(E.bytes()),c+=\"\\r\\nPrivate-MAC: \"+S.digest().toHex()+\"\\r\\n\"},n.publicKeyToOpenSSH=function(e,t){t=t||\"\";var r=a.util.createBuffer();return s(r,\"ssh-rsa\"),i(r,e.e),i(r,e.n),\"ssh-rsa \"+a.util.encode64(r.bytes())+\" \"+t},n.privateKeyToOpenSSH=function(e,t){return t?a.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:\"aes128\"}):a.pki.privateKeyToPem(e)},n.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||a.md.md5.create(),n=a.util.createBuffer();s(n,\"ssh-rsa\"),i(n,e.e),i(n,e.n),r.start(),r.update(n.getBytes());var o=r.digest();if(\"hex\"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if(\"binary\"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding \"'+t.encoding+'\".');return o}}])}));\n//# sourceMappingURL=forge.min.js.map",
"type": "string"
}
]
}