From f473abae63568c16f50a1857fd5e016a65e8c866 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 15 Oct 2021 13:47:59 -0400 Subject: [PATCH] Activating PhotoIDs via QRs --- img/janedoe.jpeg | Bin 0 -> 7139 bytes index.v5.html | 36 ++++++++++++++++++++++++++++-------- js/base32url.min.js | 13 +++++++++++++ js/cred-sdk.min.js | 2 +- js/ui-utils.js | 14 ++++++++++++++ 5 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 img/janedoe.jpeg create mode 100644 js/base32url.min.js diff --git a/img/janedoe.jpeg b/img/janedoe.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..0dc9f4b33a91e3b48d430955f3f7809697723d44 GIT binary patch literal 7139 zcmX|GbyU<(wEyms(y^c{-LZvAl;4d z_?`F8yEFHkna};4`r#`{3~&mK_t{a1h#7gzyS zFhEQIm=uIT3cBwFXaE2V#`y23|8F2LHU=gZ4(>x#h6DhEz?hgAm^j!N*fWP0sP9+Z@a!}mg~y6ceH!X&(IvrCpc$jDO2; zLYhgMy-q&2zy4*{q&MwOahR4C28p%4*R!fyg^LMOy2m3=vP20!;TI5N4O+(4rNFkC zDlUl&@KwQQjdg0f#Ry^pP~e^Rs{r>K>yRSDL_|_&QO^OF5w<-(zTpXxKnJMgOra-uMv<2vO`X1A=Up98|KIMFw7iUTJ-7+Tmr9C?uquy5T z&y-}H=sRlM1-njF6+Q5w&*@1CCtO7GOPpTD^wrNdYV&ttj;vX`Ptpcguu@&ESjcJ~ zL5H&0%{_kAq306SU*#_74Y#7ee1U)9f%u+^U?|JevCp(z%oJVNQ1#-rGxT)TpM08d z3Y}^MCs{NM{qDmslN(2MEtB zs!iGGv7{$F^L9s``KxYBM1n_Gv3|purQZ{CCoH%vxKmyqEh!B=%X-nuRYRp1XlTTb zZAeuY8PxGwf1iG2<;WqzatK{^Zgx5?(gEkjOsZ7sZ49@n~mIqqkvqC#|(1bY^ds$=?6Zw zySmzt&Z6arRwady(m3K5ZWujB2rs=wa$QCveG7)Go#IZjFtK2e6Tw*Ze88(z;7?9= zL&XTuqa&f@(Y$hp&sLhPynqd`Bya|YMqX3xVcyYy;o@%F+B$^dQf#HG=f~ieFE(Av zWoW1yjOS*%G<}&^?`z6knH6u~nHz!JF$ui>g?V~X+Te`}H}+1P4U{xXHLVVio9XFm zZJ1;5%;kgkcTng}x=+_T)5|y2k%?z_U1)xD==77inzCyuEAMZXMx%a@lki=Di2~yu zVfOCON2s+NTMOR=R9S7a`grl&DA~dm7=uK@L;l%&SOTWHXx*!oP z`^BBtWsa6gCQt!Q@gfvY#SXL0*At05{NEFI*IFE+=H;y312g8Xk7lV(nG3u%4V(#H z@{MIgE%1oP#t~&pK|YSCxwLadc``J-Xl;*45Bsx{sR0f9;u6)O1OV1CeN~}kU&NM<@&BR%+%Z^QUlOn_r&PP1)2Pc ztU$cWs7sixGt&A+c#hF5UPd$pmBEWDO%l{rYnV>mXS< zSx8YjviRg4p!2~^+ij44ZlqnfMMv792F8WP^+B2KsrfE4tgz)9<14$aco{zJdQ zk7fn?;<;ow@*YsqGhUW&;zO6w8pP3y*cW$buSn#ExeE6`a#%jMWAvr9jGYj8zp_BL zm~5z=Lggzbqp}NJ{uqGSO^x;lA7!{1H#g6jO3DkHAm6s96Qilz#E(-My!Dc<`5F-x zMq(3+m)~x=21fNDzsA09Xn_+IVtZBMTlLA)s_a}=h}k*xG+FF_rVz7gQ^m~SKK!b^LIpH!Q-LPjs* z9rSr-W|U0oHhcO+5Uo4f0o_|F`l4~>T6?wWin32zl5n`MolN4@dLlje)5)sYm>_#g zl{bF}VyFjPmlGWPcckGv2?K{#NtMqA^mJITEFkMCCA7XfQC}UFIt&DE${^e$mK!+* zS2~UQMkeB7!||K#cHcj#Qw=>)ZhW=ZYwf|1OO2J7_W@7dcH@Xns%qOWroD*wJf?(< zz1uDQWT}Pn(xI=H;qezfz%YiFNjk8-ew$dSD*8wLcM;y{$_ol=lb|q+fj!!esmH_O z?iw(LKPHqbH21){n7_c(>MgBfa^J#}>%4GN&|m4Y0GzJ&X_!MzmB|!~3JH_G!w!{| z)zn1K*3qBt^_dE<-F>1LT`Hl@fA_93e@Mz3IK4|34UH7MWp5ah34Al-$<#u_9wXkG z(?iA=kF0nM+x;v9IMJ76(@r;()|O4p6={55zf2o$Gn<7W zGTZdj#n0M(;qys6l85QuCIO?RUszv{r&t}#S}@eNq92_-6Ogd#=7X6T&wx@>30~~r zuVC2D{7yIiG?88XSidg~Bu=5WIbE!~^f`;{=pINZZ%i2O>^=mKR@;lVktr|O?<f2VHpKQhs)U`sk;Tz@bvgEQLc%NJboG2A@ z0uITsGVBYg`%_-`6P8I}A-zj-`{d_z^V&xHQu&>UnU!(Y{ymVEa*=);IJIWnWCCjR z9>g!M`8H4xgt$(0JFS#_+)@!ol}TZ!r#4=tK4zEKCtTRjYCivt>-sA%A%+X{-Nxt7 z_0uaK*Ln!vW;ooU!%IzU=L2FaIt{Gc?sRjnZMSXfBkzHc$Cqvw+M%CT}#DZqO-JW)4Td$Mfkl#97J`V_}XOOPis{sMjii1FR z*9XI?rw72+YH8|qzJD&YpP+Y+y%{I8E4XPlDBFd1(fW<4z$tpQMU2w+FSO7lK0Tbi zspofhWvbe`rtl|TI?4neyv52z=lG(}`PF9`a;u%q=Pm#Apd4sCIn0A`N_v_)-958M>BdiKKx|KJ=CF!kVAbEtL@Z)r;n!EAUnAcC? z%gqeYTL;ti8<-D?;YXfu8zz}r-0|xf?aafWhL=obsjo{k7+$*5uGTfH{ndY+RQMYk zqZ>SU1l@6E9c*w2b+^Wo)_sZ$7Gj>-R0&Y_oip4nIM2MJResFR)VQSK&t&_hSH&6s z?PvfPR?)>voa)eCq!leDLr_Gdfs;i%o!UKM;@(@aVsXl8idUD_y2n(hU*~dqd3tOm z@$`h2?zKs*feqbguS6OD^G;`Dld@`auUh&nf8G31&w4?JQayt4ucT)(FR^!hH6d5} zQQSJ!gqbEIO1)`6#!`h4nZpEM3YWhJ477H}8p`9C;rnBk(|qiJMbscKQ~tp!`aHj? z4DRlee+=yMWl5cc1{nSH30#BryPvCd)g<6XMjfAAX~Tqwh{QT)#{92mj$1zmOC_<8 zVQ$NN?o}w2d#b#7)yIslhJ=+ZU)0$%DYspi@T1l}>B z#k8ZSjqufuTPWyA+=Jzo@yZU_+8u^j(=2pKF)5&lmdOkb21EZe_fBWc4qZGCDm)CY z(oPLIBg%LH^!PnK^o_ofS$ zy^q(kdWvZr&pe!lz6`1sPHYsf5}%g161H8Ib1ppZ;mu7%&sv+X?!>%bR}STa)1cUN z9!dnq=%%MlvFeScTEEt{F_o#(a{?c*ovo>#t}}urlkPKiC)S+}o4n|i%6H@RsAHOkg`zC2EI|NFaCO&Q4?DmI0Zp7HUxG=6TT6Fc&lH;9epoP4^bPuDYn`mtuptYkDpPQ-f|!ak2nhiM<% z5nKz@TQ4a2LDa=`;i8w9uuBh>{glllWGl$XS&jo`gJepgV6ugqvT(7u7ZLKy*sL|R z$FSfxYRxeurLQLn4XJH@vn#1&?eOa&WnFY*04Jbni2?(OB23+;(ZUN9tz}xPu+kYA zAaijn;r3#aNCAX3!rC+>=H6vt;P)rlGS13-3%Z|auxENL)fKcNME{M&mp?UEb%(Xm zr>kb;>CPXGtABH}#II5}viM2L^0;ln*1JoI-dgn4F<4Gm3m|CA^+__QS)|8Pad<*X zQmV(}iM9Uf9KAukm z-^BTdD~;}QFxP3Zv1EszeF+?3y|Htdx0Xxik?SW4$Nd%gi&_h=2?rr36vi2~N`g${ z9adE%x))kt6n# zNWUm$f(^b*Hb`TsOIBp5W^)rwR>e^~J>J1t`?q7{R3u(bI4TSamSe<8xf|K~^II=X zG^fgafx+6({G*{R?I4T#@u=sWk*2m>&hNIFU}m1)`2;QEc7@#3H)89-^aowbmQC(6 zDE;WuOFbP|M6ersr|P@>!rf5ns& z-`b@d&PJJc4BlOPy8Tr%dX|F@*MVlPFpd^o|O+v$N&>( zrcAeek3aNDH|`ky0pE_tuzD{_6slG}r4~y5bKPHpXGYD=5~j4Ef#l2X;scHUOLk{R zC^fy)d%;&-gY9SI*Edxe_exLWTYQay=`Y4c@#sbFECt&+^e*f z>_#b~O@z|l&kXDy|t)ChL7IqLSzFB)dgzN?g?@W469$>yZ=@+#339SC?H=CCL;ltJ`1B*SuR?Jy2tN%Yn$ zR5WYIJl*P8v~!G|%@WZj2zxZcIVo_$iV~e}OKEp{z1uz`BeGCEgj5#PO@5IO`(b>l zHF(%zEN*vsttZkK=e1rUO)kIzexjT(Q8jO5?5+~n7paFV{z z53I8eNe_I}_9!kQ`@=IM9Y)%Zuy+|JVJ4H!(M4B2YR%r!?ZzuH!F_cl!X_H$)-n|h zKZ6_hg(8V2aTF1k%lXajf=5_7$u2b;OlosIif4%FhGp%IKuP4wnccs_#@kzWl^#p3h6)cGK84{g3?N zukE=h;cVsqhU^QAj-6y#sTrR4v%>UAL zr8J7>H*h1Gf#Amru@}8?14(=@*jF{f7xnO5uY39=GR%g81i)Pky63{-IdS&$?g(-Q@k|jeq1+#{9ByVRDy3v_?8^75FTZ+0b z74lS?UAjPOZ_{Y_55jk+c{r=p2eQTTD69IF zU0JxsTYecbqOWeiNHA=|eojZDq^t~%hXlmCs}FCXzZ%jKlS`t@3x7}I;GyTh@K)!M(^<#CR=RfxIEK-SqEGa^WJY;6}GF+7nS9Y zTlQ<<9@ap1p1}nzyga|~Z`Ru_>^_vKE6}tyMc?q7=lMwb+yANjd1`cdz6~NHt)^V{;>-vABkXQhy3JjcL z*oIUSh|&^ed+Tfz4ZElEa51F|XzWneTcYhbs;Q88&N6yR9H{6?cFj^e4hk-dXeCFq4||vt|Vh6LnNi=uU*FZTm}De3^QsInve|-x=L<*Og(o z@U8zGFe|U-_6sMlZQY`UGR=kW@48z+4C4Oz`%h^Pl^vhLY^9 zM8LsfDiRafK@9RPcE-l9kKaBe;1M$M|Jfg{aw8yVZLUmLgyUpv%H@{!Y!=?fi3-Zp z(LzE~v7-TPNNFEt*|Q3S4j!krEeB=YLsf4wlMn(F!!@O#QAO{dfOaMp1V9DJ0yd~< z0PlnBL(4};6|gCk#Vl2YXmIKLg<~ltPq77QN~3J>q% + @@ -192,7 +193,11 @@ DcJqR5clbAYlO9lHmvb4lsPLZHjugQ== function getValueArray(elemArray) { const fields = elemArray.map(function(elemId) { - return e(elemId).value; + if (elemId.endsWith("url")) { + return Base32URL.encode(e(elemId).value); + } else { + return e(elemId).value; + } }) return fields; } @@ -217,6 +222,18 @@ DcJqR5clbAYlO9lHmvb4lsPLZHjugQ== CRED.unpackAndVerify(uri).then(result => { UIUtils.drawVerifiedSymbol(elemPref+'-code',result); + + CRED.mapHeaders(result, _type, _version).then(headers => { + if (headers["photo-url"] && headers["photo-hash"]) { + const url = Base32URL.decodeAsString(headers["photo-url"]); + CRED.verifyEndPoint(url, headers["photo-hash"]).then(verified => { + console.log(verified); + if (verified) { + UIUtils.drawPicture(elemPref+'-code',url); + } + }); + } + }); }); }); }); @@ -267,18 +284,21 @@ DcJqR5clbAYlO9lHmvb4lsPLZHjugQ== signAndDisplayQR("qr-coupon", "coupon","1", priKeyPEM, pubKeyLink, couponArray); // PassKey QR - const passKeyArray = getValueArray(["qr-passkey-name", "qr-passkey-dob", "qr-passkey-salt", "qr-passkey-phone"]); - signAndDisplayQR("qr-passkey", "passkey","1", priKeyPEM, pubKeyLink, passKeyArray); + const passKeyArray = getValueArray(["qr-passkey-name", "qr-passkey-dob", "qr-passkey-salt", "qr-passkey-phone", + "qr-passkey-photo-url", "qr-passkey-photo-hash"]); + signAndDisplayQR("qr-passkey", "passkey","3", priKeyPEM, pubKeyLink, passKeyArray); // Badge QR const badgeArray = getValueArray(["qr-badge-date", "qr-badge-manuf", "qr-badge-product", "qr-badge-lot", "qr-badge-required_doses", "qr-badge-vaccinee", "qr-badge-route", - "qr-badge-site", "qr-badge-dose", "qr-badge-name", "qr-badge-dob"]); - signAndDisplayQR("qr-badge", "badge","2", priKeyPEM, pubKeyLink, badgeArray); + "qr-badge-site", "qr-badge-dose", "qr-badge-name", "qr-badge-dob", + "qr-badge-photo-url", "qr-badge-photo-hash"]); + signAndDisplayQR("qr-badge", "badge","3", priKeyPEM, pubKeyLink, badgeArray); // Status QR - const statusArray = getValueArray(["qr-status-vaccinated", "qr-status-vaccinee", "qr-status-vaccinee-red"]); - signAndDisplayQR("qr-status", "status","2", priKeyPEM, pubKeyLink, statusArray); + const statusArray = getValueArray(["qr-status-vaccinated", "qr-status-vaccinee", "qr-status-vaccinee-red", + "qr-status-photo-url", "qr-status-photo-hash"]); + signAndDisplayQR("qr-status", "status","3", priKeyPEM, pubKeyLink, statusArray); } function verifyQRCode() { @@ -373,7 +393,7 @@ DcJqR5clbAYlO9lHmvb4lsPLZHjugQ== e("qr-passkey-phone").value = "16173332345"; e("qr-passkey-dob").value = "19820321"; e("qr-passkey-photo-hash").value = ""; - e("qr-passkey-photo-url").value = "https://github.pathcheck.org/img/profile.png"; + e("qr-passkey-photo-url").value = "https://github.pathcheck.org/img/janedoe.jpeg"; e("qr-badge-manuf").value = "Moderna"; e("qr-badge-product").value = "COVID19"; diff --git a/js/base32url.min.js b/js/base32url.min.js new file mode 100644 index 0000000..74aefc6 --- /dev/null +++ b/js/base32url.min.js @@ -0,0 +1,13 @@ +!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Base32URL=t():r.Base32URL=t()}(window,(function(){return function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)e.d(n,o,function(t){return r[t]}.bind(null,o));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=4)}([function(r,t,e){(function(t,n){var o; +/* + * [hi-base32]{@link https://github.com/emn178/hi-base32} + * + * @version 0.5.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */!function(){"use strict";var c="object"==typeof window?window:{};!c.HI_BASE32_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node&&(c=n);var a=!c.HI_BASE32_NO_COMMON_JS&&"object"==typeof r&&r.exports,i=e(3),u="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),h={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},f=[0,0,0,0,0,0,0,0],d=function(r,t){t.length>10&&(t="..."+t.substr(-10));var e=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+r+" bytes: "+t+" <-");throw e.position=r,e},s=function(r){if(""===r)return[];if(!/^[A-Z2-7=]+$/.test(r))throw new Error("Invalid base32 characters");for(var t,e,n,o,c,a,i,u,f=[],d=0,s=(r=r.replace(/=/g,"")).length,l=0,A=s>>3<<3;l>>2),f[d++]=255&(e<<6|n<<1|o>>>4),f[d++]=255&(o<<4|c>>>1),f[d++]=255&(c<<7|a<<2|i>>>3),f[d++]=255&(i<<5|u);var p=s-A;return 2===p?(t=h[r.charAt(l++)],e=h[r.charAt(l++)],f[d++]=255&(t<<3|e>>>2)):4===p?(t=h[r.charAt(l++)],e=h[r.charAt(l++)],n=h[r.charAt(l++)],o=h[r.charAt(l++)],f[d++]=255&(t<<3|e>>>2),f[d++]=255&(e<<6|n<<1|o>>>4)):5===p?(t=h[r.charAt(l++)],e=h[r.charAt(l++)],n=h[r.charAt(l++)],o=h[r.charAt(l++)],c=h[r.charAt(l++)],f[d++]=255&(t<<3|e>>>2),f[d++]=255&(e<<6|n<<1|o>>>4),f[d++]=255&(o<<4|c>>>1)):7===p&&(t=h[r.charAt(l++)],e=h[r.charAt(l++)],n=h[r.charAt(l++)],o=h[r.charAt(l++)],c=h[r.charAt(l++)],a=h[r.charAt(l++)],i=h[r.charAt(l++)],f[d++]=255&(t<<3|e>>>2),f[d++]=255&(e<<6|n<<1|o>>>4),f[d++]=255&(o<<4|c>>>1),f[d++]=255&(c<<7|a<<2|i>>>3)),f},l=function(r,t){if(!t)return function(r){for(var t,e,n="",o=r.length,c=0,a=0;c191&&t<=223?(e=31&t,a=1):t<=239?(e=15&t,a=2):t<=247?(e=7&t,a=3):d(c,n);for(var i=0;i191)&&d(c,n),e<<=6,e+=63&t;e>=55296&&e<=57343&&d(c,n),e>1114111&&d(c,n),e<=65535?n+=String.fromCharCode(e):(e-=65536,n+=String.fromCharCode(55296+(e>>10)),n+=String.fromCharCode(56320+(1023&e)))}return n}(s(r));if(""===r)return"";if(!/^[A-Z2-7=]+$/.test(r))throw new Error("Invalid base32 characters");var e,n,o,c,a,i,u,f,l="",A=r.indexOf("=");-1===A&&(A=r.length);for(var p=0,C=A>>3<<3;p>>2))+String.fromCharCode(255&(n<<6|o<<1|c>>>4))+String.fromCharCode(255&(c<<4|a>>>1))+String.fromCharCode(255&(a<<7|i<<2|u>>>3))+String.fromCharCode(255&(u<<5|f));var g=A-C;return 2===g?(e=h[r.charAt(p++)],n=h[r.charAt(p++)],l+=String.fromCharCode(255&(e<<3|n>>>2))):4===g?(e=h[r.charAt(p++)],n=h[r.charAt(p++)],o=h[r.charAt(p++)],c=h[r.charAt(p++)],l+=String.fromCharCode(255&(e<<3|n>>>2))+String.fromCharCode(255&(n<<6|o<<1|c>>>4))):5===g?(e=h[r.charAt(p++)],n=h[r.charAt(p++)],o=h[r.charAt(p++)],c=h[r.charAt(p++)],a=h[r.charAt(p++)],l+=String.fromCharCode(255&(e<<3|n>>>2))+String.fromCharCode(255&(n<<6|o<<1|c>>>4))+String.fromCharCode(255&(c<<4|a>>>1))):7===g&&(e=h[r.charAt(p++)],n=h[r.charAt(p++)],o=h[r.charAt(p++)],c=h[r.charAt(p++)],a=h[r.charAt(p++)],i=h[r.charAt(p++)],u=h[r.charAt(p++)],l+=String.fromCharCode(255&(e<<3|n>>>2))+String.fromCharCode(255&(n<<6|o<<1|c>>>4))+String.fromCharCode(255&(c<<4|a>>>1))+String.fromCharCode(255&(a<<7|i<<2|u>>>3))),l},A={encode:function(r,t){var e="string"!=typeof r;return e&&r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),e?function(r){for(var t,e,n,o,c,a="",i=r.length,h=0,f=5*parseInt(i/5);h>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[31&(n<<1|o>>>7)]+u[o>>>2&31]+u[31&(o<<3|c>>>5)]+u[31&c];var d=i-f;return 1===d?(t=r[h],a+=u[t>>>3]+u[t<<2&31]+"======"):2===d?(t=r[h++],e=r[h],a+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[e<<4&31]+"===="):3===d?(t=r[h++],e=r[h++],n=r[h],a+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[n<<1&31]+"==="):4===d&&(t=r[h++],e=r[h++],n=r[h++],o=r[h],a+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[31&(n<<1|o>>>7)]+u[o>>>2&31]+u[o<<3&31]+"="),a}(r):t?function(r){for(var t,e,n,o,c,a="",i=r.length,h=0,f=5*parseInt(i/5);h>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[31&(n<<1|o>>>7)]+u[o>>>2&31]+u[31&(o<<3|c>>>5)]+u[31&c];var d=i-f;return 1===d?(t=r.charCodeAt(h),a+=u[t>>>3]+u[t<<2&31]+"======"):2===d?(t=r.charCodeAt(h++),e=r.charCodeAt(h),a+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[e<<4&31]+"===="):3===d?(t=r.charCodeAt(h++),e=r.charCodeAt(h++),n=r.charCodeAt(h),a+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[n<<1&31]+"==="):4===d&&(t=r.charCodeAt(h++),e=r.charCodeAt(h++),n=r.charCodeAt(h++),o=r.charCodeAt(h),a+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[31&(n<<1|o>>>7)]+u[o>>>2&31]+u[o<<3&31]+"="),a}(r):function(r){var t,e,n,o,c,a,i,h=!1,d="",s=0,l=0,A=r.length;if(""===r)return d;do{for(f[0]=f[5],f[1]=f[6],f[2]=f[7],i=l;s>6,f[i++]=128|63&a):a<55296||a>=57344?(f[i++]=224|a>>12,f[i++]=128|a>>6&63,f[i++]=128|63&a):(a=65536+((1023&a)<<10|1023&r.charCodeAt(++s)),f[i++]=240|a>>18,f[i++]=128|a>>12&63,f[i++]=128|a>>6&63,f[i++]=128|63&a);i-l,l=i-5,s===A&&++s,s>A&&i<6&&(h=!0),t=f[0],i>4?(e=f[1],n=f[2],o=f[3],c=f[4],d+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[31&(n<<1|o>>>7)]+u[o>>>2&31]+u[31&(o<<3|c>>>5)]+u[31&c]):1===i?d+=u[t>>>3]+u[t<<2&31]+"======":2===i?(e=f[1],d+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[e<<4&31]+"===="):3===i?(e=f[1],n=f[2],d+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[n<<1&31]+"==="):(e=f[1],n=f[2],o=f[3],d+=u[t>>>3]+u[31&(t<<2|e>>>6)]+u[e>>>1&31]+u[31&(e<<4|n>>>4)]+u[31&(n<<1|o>>>7)]+u[o>>>2&31]+u[o<<3&31]+"=")}while(!h);return d}(r)},decode:l};l.asBytes=s,a?r.exports=A:(c.base32=A,i&&(void 0===(o=function(){return A}.call(A,e,A,r))||(r.exports=o)))}()}).call(this,e(1),e(2))},function(r,t){var e,n,o=r.exports={};function c(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(r){if(e===setTimeout)return setTimeout(r,0);if((e===c||!e)&&setTimeout)return e=setTimeout,setTimeout(r,0);try{return e(r,0)}catch(t){try{return e.call(null,r,0)}catch(t){return e.call(this,r,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:c}catch(r){e=c}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(r){n=a}}();var u,h=[],f=!1,d=-1;function s(){f&&u&&(f=!1,u.length?h=u.concat(h):d=-1,h.length&&l())}function l(){if(!f){var r=i(s);f=!0;for(var t=h.length;t;){for(u=h,h=[];++d1)for(var e=1;e{var t={9809:(t,e,r)=>{"use strict";const i=e;i.bignum=r(3550),i.define=r(2500).define,i.base=r(1979),i.constants=r(6826),i.decoders=r(8307),i.encoders=r(6579)},2500:(t,e,r)=>{"use strict";const i=r(6579),n=r(8307),f=r(5717);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return f(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},6625:(t,e,r)=>{"use strict";const i=r(5717),n=r(8465).b,f=r(2399).Buffer;function o(t,e){n.call(this,e),f.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=f.byteLength(t);else{if(!f.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(o,n),e.C=o,o.isDecoderBuffer=function(t){return t instanceof o||"object"==typeof t&&f.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},o.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},o.prototype.restore=function(t){const e=new o(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=f.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):f.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},1979:(t,e,r)=>{"use strict";const i=e;i.Reporter=r(8465).b,i.DecoderBuffer=r(6625).C,i.EncoderBuffer=r(6625).R,i.Node=r(1949)},1949:(t,e,r)=>{"use strict";const i=r(8465).b,n=r(6625).R,f=r(6625).C,o=r(9746),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"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function d(t,e,r){const i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=d;const c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];d.prototype.clone=function(){const t=this._baseState,e={};c.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},d.prototype._wrap=function(){const t=this._baseState;s.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},d.prototype._init=function(t){const e=this._baseState;o(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),o.equal(e.children.length,1,"Root node can have only one child")},d.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(o(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(o(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){d.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){d.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===e.tag),e.tag=t,this._useArgs(r),this}})),d.prototype.use=function(t){o(t);const e=this._baseState;return o(null===e.use),e.use=t,this},d.prototype.optional=function(){return this._baseState.optional=!0,this},d.prototype.def=function(t){const e=this._baseState;return o(null===e.default),e.default=t,e.optional=!0,this},d.prototype.explicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.explicit=t,this},d.prototype.implicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.implicit=t,this},d.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},d.prototype.key=function(t){const e=this._baseState;return o(null===e.key),e.key=t,this},d.prototype.any=function(){return this._baseState.any=!0,this},d.prototype.choice=function(t){const e=this._baseState;return o(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},d.prototype.contains=function(t){const e=this._baseState;return o(null===e.use),e.contains=t,this},d.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let i,n=r.default,o=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let i=null;if(null!==r.explicit?i=r.explicit:null!==r.implicit?i=r.implicit:null!==r.tag&&(i=r.tag),null!==i||r.any){if(o=this._peekTag(t,i,r.any),t.isError(o))return o}else{const i=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(i)}}if(r.obj&&o&&(i=t.enterObject()),o){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const i=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const i=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(i))return i;r.any?n=t.raw(e):t=i}if(e&&e.track&&null!==r.tag&&e.track(t.path(),i,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const i=new f(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(i,e)}}return r.obj&&o&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,n),n},d.prototype._decodeGeneric=function(t,e,r){const i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},d.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},d.prototype._decodeChoice=function(t,e){const r=this._baseState;let i=null,n=!1;return Object.keys(r.choice).some((function(f){const o=t.save(),a=r.choice[f];try{const r=a._decode(t,e);if(t.isError(r))return!1;i={type:f,value:r},n=!0}catch(e){return t.restore(o),!1}return!0}),this),n?i:t.error("Choice not matched")},d.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},d.prototype._encode=function(t,e,r){const i=this._baseState;if(null!==i.default&&i.default===t)return;const n=this._encodeValue(t,e,r);return void 0===n||this._skipDefault(n,e,r)?void 0:n},d.prototype._encodeValue=function(t,e,r){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);let f=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}let o=null,a=!1;if(n.any)f=this._createEncoderBuffer(t);else if(n.choice)f=this._encodeChoice(t,e);else if(n.contains)o=this._getUse(n.contains,r)._encode(t,e),a=!0;else if(n.children)o=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const i=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(r){const i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),r))}else null!==n.use?f=this._getUse(n.use,r)._encode(t,e):(o=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){const t=null!==n.implicit?n.implicit:n.tag,r=null===n.implicit?"universal":"context";null===t?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(f=this._encodeComposite(t,a,r,o))}return null!==n.explicit&&(f=this._encodeComposite(n.explicit,!1,"context",f)),f},d.prototype._encodeChoice=function(t,e){const r=this._baseState,i=r.choice[t.type];return i||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},d.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},d.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},d.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},8465:(t,e,r)=>{"use strict";const i=r(5717);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function f(t,e){this.path=t,this.rethrow(e)}e.b=n,n.prototype.isError=function(t){return t instanceof f},n.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){const i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){let e;const r=this._reporterState,i=t instanceof f;if(e=i?t:new f(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(f,Error),f.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,f),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},160:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.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"},e.tagByName=r(e.tag)},6826:(t,e,r)=>{"use strict";const i=e;i._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e},i.der=r(160)},1671:(t,e,r)=>{"use strict";const i=r(5717),n=r(3550),f=r(6625).C,o=r(1949),a=r(160);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new d,this.tree._init(t.body)}function d(t){o.call(this,"der",t)}function c(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=t.readUInt8(e),t.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function h(t,e,r){let i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;const n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(let e=0;e{"use strict";const i=e;i.der=r(1671),i.pem=r(9631)},9631:(t,e,r)=>{"use strict";const i=r(5717),n=r(2399).Buffer,f=r(1671);function o(t){f.call(this,t),this.enc="pem"}i(o,f),t.exports=o,o.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,s=-1;for(let t=0;t{"use strict";const i=r(5717),n=r(2399).Buffer,f=r(1949),o=r(160);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new s,this.tree._init(t.body)}function s(t){f.call(this,"der",t)}function d(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(s,f),s.prototype._encodeComposite=function(t,e,r,i){const f=function(t,e,r,i){let n;if("seqof"===t?t="seq":"setof"===t&&(t="set"),o.tagByName.hasOwnProperty(t))n=o.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);n=t}return n>=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=o.tagClassByName[r||"universal"]<<6,n)}(t,e,r,this.reporter);if(i.length<128){const t=n.alloc(2);return t[0]=f,t[1]=i.length,this._createEncoderBuffer([t,i])}let a=1;for(let t=i.length;t>=256;t>>=8)a++;const s=n.alloc(2+a);s[0]=f,s[1]=128|a;for(let t=1+a,e=i.length;e>0;t--,e>>=8)s[t]=255&e;return this._createEncoderBuffer([s,i])},s.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=n.alloc(2*t.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let i=0;for(let e=0;e=128;r>>=7)i++}const f=n.alloc(i);let o=f.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(f[o--]=127&r;(r>>=7)>0;)f[o--]=128|127&r}return this._createEncoderBuffer(f)},s.prototype._encodeTime=function(t,e){let r;const i=new Date(t);return"gentime"===e?r=[d(i.getUTCFullYear()),d(i.getUTCMonth()+1),d(i.getUTCDate()),d(i.getUTCHours()),d(i.getUTCMinutes()),d(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[d(i.getUTCFullYear()%100),d(i.getUTCMonth()+1),d(i.getUTCDate()),d(i.getUTCHours()),d(i.getUTCMinutes()),d(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=n.from(e)}if(n.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=n.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const i=new Array(r);for(let e=i.length-1;e>=0;e--)i[e]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(n.from(i))},s.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},s.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},s.prototype._skipDefault=function(t,e,r){const i=this._baseState;let n;if(null===i.default)return!1;const f=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),f.length!==i.defaultBuffer.length)return!1;for(n=0;n{"use strict";const i=e;i.der=r(6984),i.pem=r(2883)},2883:(t,e,r)=>{"use strict";const i=r(5717),n=r(6984);function f(t){n.call(this,t),this.enc="pem"}i(f,n),t.exports=f,f.prototype.encode=function(t,e){const r=n.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"];for(let t=0;t{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,f=s(t),o=f[0],a=f[1],d=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,a)),c=0,h=a>0?o-4:o;for(r=0;r>16&255,d[c++]=e>>8&255,d[c++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,d[c++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,d[c++]=e>>8&255,d[c++]=255&e),d},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,f=[],o=16383,a=0,s=i-n;as?s:a+o));return 1===n?(e=t[i-1],f.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],f.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),f.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=f.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function d(t,e,i){for(var n,f,o=[],a=e;a>18&63]+r[f>>12&63]+r[f>>6&63]+r[63&f]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},3550:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function f(t,e,r){if(f.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function d(t,e,r,i){for(var n=0,f=Math.min(t.length,r),o=e;o=49?a-49+10:a>=17?a-17+10:a}return n}f.isBN=function(t){return t instanceof f||null!==t&&"object"==typeof t&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,e){return t.cmp(e)>0?t:e},f.min=function(t,e){return t.cmp(e)<0?t:e},f.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[f]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(n=0,f=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=s(t,e,i)<=18?(f-=18,o+=1,this.words[o]|=n>>>26):f+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(f-=18,o+=1,this.words[o]|=n>>>26):f+=8;this.strip()},f.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var f=t.length-r,o=f%i,a=Math.min(f,f-o)+r,s=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var c=["","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"],h=[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],u=[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 l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],f=0|e.words[0],o=n*f,a=67108863&o,s=o/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&s,u=Math.min(d,e.length-1),l=Math.max(0,d-t.length+1);l<=u;l++){var b=d-l|0;c+=(o=(n=0|t.words[b])*(f=0|e.words[l])+h)/67108864|0,h=67108863&o}r.words[d]=0|h,s=0|c}return 0!==s?r.words[d]=0|s:r.length--,r.strip()}f.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,f=0,o=0;o>>24-n&16777215)||o!==this.length-1?c[6-s.length]+s+r:s+r,(n+=2)>=26&&(n-=26,o--)}for(0!==f&&(r=f.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=h[t],l=u[t];r="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(l).toString(t);r=(b=b.idivn(l)).isZero()?p+r:c[d-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},f.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,e){return i(void 0!==o),this.toArrayLike(o,t,e)},f.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},f.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),f=r||Math.max(1,n);i(n<=f,"byte array longer than desired length"),i(f>0,"Requested array length <= 0"),this.strip();var o,a,s="le"===e,d=new t(f),c=this.clone();if(s){for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),d[a]=o;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},f.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},f.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,f=0;f>>26;for(;0!==n&&f>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ft.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var f=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==f&&o>26,this.words[o]=67108863&e;if(0===f&&o>>13,l=0|o[1],b=8191&l,p=l>>>13,y=0|o[2],m=8191&y,g=y>>>13,v=0|o[3],w=8191&v,M=v>>>13,_=0|o[4],A=8191&_,S=_>>>13,E=0|o[5],x=8191&E,I=E>>>13,B=0|o[6],R=8191&B,k=B>>>13,C=0|o[7],P=8191&C,j=C>>>13,O=0|o[8],T=8191&O,U=O>>>13,z=0|o[9],q=8191&z,N=z>>>13,L=0|a[0],D=8191&L,F=L>>>13,H=0|a[1],K=8191&H,$=H>>>13,J=0|a[2],Z=8191&J,V=J>>>13,X=0|a[3],Y=8191&X,G=X>>>13,W=0|a[4],Q=8191&W,tt=W>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ft=8191&nt,ot=nt>>>13,at=0|a[7],st=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,lt=0|a[9],bt=8191<,pt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(d+(i=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,F))+Math.imul(u,D)|0))<<13)|0;d=((f=Math.imul(u,F))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,D),n=(n=Math.imul(b,F))+Math.imul(p,D)|0,f=Math.imul(p,F);var mt=(d+(i=i+Math.imul(h,K)|0)|0)+((8191&(n=(n=n+Math.imul(h,$)|0)+Math.imul(u,K)|0))<<13)|0;d=((f=f+Math.imul(u,$)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,D),n=(n=Math.imul(m,F))+Math.imul(g,D)|0,f=Math.imul(g,F),i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(p,K)|0,f=f+Math.imul(p,$)|0;var gt=(d+(i=i+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,Z)|0))<<13)|0;d=((f=f+Math.imul(u,V)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(w,D),n=(n=Math.imul(w,F))+Math.imul(M,D)|0,f=Math.imul(M,F),i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(g,K)|0,f=f+Math.imul(g,$)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(p,Z)|0,f=f+Math.imul(p,V)|0;var vt=(d+(i=i+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,G)|0)+Math.imul(u,Y)|0))<<13)|0;d=((f=f+Math.imul(u,G)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(A,D),n=(n=Math.imul(A,F))+Math.imul(S,D)|0,f=Math.imul(S,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(M,K)|0,f=f+Math.imul(M,$)|0,i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,Z)|0,f=f+Math.imul(g,V)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(p,Y)|0,f=f+Math.imul(p,G)|0;var wt=(d+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((f=f+Math.imul(u,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(x,D),n=(n=Math.imul(x,F))+Math.imul(I,D)|0,f=Math.imul(I,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(S,K)|0,f=f+Math.imul(S,$)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,Z)|0,f=f+Math.imul(M,V)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,G)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,G)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(p,Q)|0,f=f+Math.imul(p,tt)|0;var Mt=(d+(i=i+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(u,rt)|0))<<13)|0;d=((f=f+Math.imul(u,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(R,D),n=(n=Math.imul(R,F))+Math.imul(k,D)|0,f=Math.imul(k,F),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(I,K)|0,f=f+Math.imul(I,$)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(S,Z)|0,f=f+Math.imul(S,V)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,G)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(g,Q)|0,f=f+Math.imul(g,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(p,rt)|0,f=f+Math.imul(p,it)|0;var _t=(d+(i=i+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,ot)|0)+Math.imul(u,ft)|0))<<13)|0;d=((f=f+Math.imul(u,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,D),n=(n=Math.imul(P,F))+Math.imul(j,D)|0,f=Math.imul(j,F),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(k,K)|0,f=f+Math.imul(k,$)|0,i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(I,Z)|0,f=f+Math.imul(I,V)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,f=f+Math.imul(M,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(g,rt)|0,f=f+Math.imul(g,it)|0,i=i+Math.imul(b,ft)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(p,ft)|0,f=f+Math.imul(p,ot)|0;var At=(d+(i=i+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,st)|0))<<13)|0;d=((f=f+Math.imul(u,dt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(T,D),n=(n=Math.imul(T,F))+Math.imul(U,D)|0,f=Math.imul(U,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(j,K)|0,f=f+Math.imul(j,$)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(k,Z)|0,f=f+Math.imul(k,V)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,G)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,G)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(S,Q)|0,f=f+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,f=f+Math.imul(M,it)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,ot)|0)+Math.imul(g,ft)|0,f=f+Math.imul(g,ot)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(p,st)|0,f=f+Math.imul(p,dt)|0;var St=(d+(i=i+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((f=f+Math.imul(u,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(q,D),n=(n=Math.imul(q,F))+Math.imul(N,D)|0,f=Math.imul(N,F),i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(U,K)|0,f=f+Math.imul(U,$)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(j,Z)|0,f=f+Math.imul(j,V)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(k,Y)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,f=f+Math.imul(I,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(S,rt)|0,f=f+Math.imul(S,it)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(M,ft)|0,f=f+Math.imul(M,ot)|0,i=i+Math.imul(m,st)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(g,st)|0,f=f+Math.imul(g,dt)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(p,ht)|0,f=f+Math.imul(p,ut)|0;var Et=(d+(i=i+Math.imul(h,bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,pt)|0)+Math.imul(u,bt)|0))<<13)|0;d=((f=f+Math.imul(u,pt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,K),n=(n=Math.imul(q,$))+Math.imul(N,K)|0,f=Math.imul(N,$),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(U,Z)|0,f=f+Math.imul(U,V)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(j,Y)|0,f=f+Math.imul(j,G)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(k,Q)|0,f=f+Math.imul(k,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(I,rt)|0,f=f+Math.imul(I,it)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,ot)|0)+Math.imul(S,ft)|0,f=f+Math.imul(S,ot)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(M,st)|0,f=f+Math.imul(M,dt)|0,i=i+Math.imul(m,ht)|0,n=(n=n+Math.imul(m,ut)|0)+Math.imul(g,ht)|0,f=f+Math.imul(g,ut)|0;var xt=(d+(i=i+Math.imul(b,bt)|0)|0)+((8191&(n=(n=n+Math.imul(b,pt)|0)+Math.imul(p,bt)|0))<<13)|0;d=((f=f+Math.imul(p,pt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,V))+Math.imul(N,Z)|0,f=Math.imul(N,V),i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(U,Y)|0,f=f+Math.imul(U,G)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(j,Q)|0,f=f+Math.imul(j,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(k,rt)|0,f=f+Math.imul(k,it)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,ot)|0)+Math.imul(I,ft)|0,f=f+Math.imul(I,ot)|0,i=i+Math.imul(A,st)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(S,st)|0,f=f+Math.imul(S,dt)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,f=f+Math.imul(M,ut)|0;var It=(d+(i=i+Math.imul(m,bt)|0)|0)+((8191&(n=(n=n+Math.imul(m,pt)|0)+Math.imul(g,bt)|0))<<13)|0;d=((f=f+Math.imul(g,pt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,Y),n=(n=Math.imul(q,G))+Math.imul(N,Y)|0,f=Math.imul(N,G),i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(U,Q)|0,f=f+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(j,rt)|0,f=f+Math.imul(j,it)|0,i=i+Math.imul(R,ft)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(k,ft)|0,f=f+Math.imul(k,ot)|0,i=i+Math.imul(x,st)|0,n=(n=n+Math.imul(x,dt)|0)+Math.imul(I,st)|0,f=f+Math.imul(I,dt)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(S,ht)|0,f=f+Math.imul(S,ut)|0;var Bt=(d+(i=i+Math.imul(w,bt)|0)|0)+((8191&(n=(n=n+Math.imul(w,pt)|0)+Math.imul(M,bt)|0))<<13)|0;d=((f=f+Math.imul(M,pt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(N,Q)|0,f=Math.imul(N,tt),i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(U,rt)|0,f=f+Math.imul(U,it)|0,i=i+Math.imul(P,ft)|0,n=(n=n+Math.imul(P,ot)|0)+Math.imul(j,ft)|0,f=f+Math.imul(j,ot)|0,i=i+Math.imul(R,st)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(k,st)|0,f=f+Math.imul(k,dt)|0,i=i+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(I,ht)|0,f=f+Math.imul(I,ut)|0;var Rt=(d+(i=i+Math.imul(A,bt)|0)|0)+((8191&(n=(n=n+Math.imul(A,pt)|0)+Math.imul(S,bt)|0))<<13)|0;d=((f=f+Math.imul(S,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(N,rt)|0,f=Math.imul(N,it),i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(U,ft)|0,f=f+Math.imul(U,ot)|0,i=i+Math.imul(P,st)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(j,st)|0,f=f+Math.imul(j,dt)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(k,ht)|0,f=f+Math.imul(k,ut)|0;var kt=(d+(i=i+Math.imul(x,bt)|0)|0)+((8191&(n=(n=n+Math.imul(x,pt)|0)+Math.imul(I,bt)|0))<<13)|0;d=((f=f+Math.imul(I,pt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,ft),n=(n=Math.imul(q,ot))+Math.imul(N,ft)|0,f=Math.imul(N,ot),i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(U,st)|0,f=f+Math.imul(U,dt)|0,i=i+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(j,ht)|0,f=f+Math.imul(j,ut)|0;var Ct=(d+(i=i+Math.imul(R,bt)|0)|0)+((8191&(n=(n=n+Math.imul(R,pt)|0)+Math.imul(k,bt)|0))<<13)|0;d=((f=f+Math.imul(k,pt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(q,st),n=(n=Math.imul(q,dt))+Math.imul(N,st)|0,f=Math.imul(N,dt),i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(U,ht)|0,f=f+Math.imul(U,ut)|0;var Pt=(d+(i=i+Math.imul(P,bt)|0)|0)+((8191&(n=(n=n+Math.imul(P,pt)|0)+Math.imul(j,bt)|0))<<13)|0;d=((f=f+Math.imul(j,pt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(N,ht)|0,f=Math.imul(N,ut);var jt=(d+(i=i+Math.imul(T,bt)|0)|0)+((8191&(n=(n=n+Math.imul(T,pt)|0)+Math.imul(U,bt)|0))<<13)|0;d=((f=f+Math.imul(U,pt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(d+(i=Math.imul(q,bt))|0)+((8191&(n=(n=Math.imul(q,pt))+Math.imul(N,bt)|0))<<13)|0;return d=((f=Math.imul(N,pt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,s[0]=yt,s[1]=mt,s[2]=gt,s[3]=vt,s[4]=wt,s[5]=Mt,s[6]=_t,s[7]=At,s[8]=St,s[9]=Et,s[10]=xt,s[11]=It,s[12]=Bt,s[13]=Rt,s[14]=kt,s[15]=Ct,s[16]=Pt,s[17]=jt,s[18]=Ot,0!==d&&(s[19]=d,r.length++),r};function p(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(b=l),f.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,f=0;f>>26)|0)>>>26,o&=67108863}r.words[f]=a,i=o,o=n}return 0!==i?r.words[f]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=f.prototype._countBits(t)-1,i=0;i>=1;return i},y.prototype.permute=function(t,e,r,i,n,f){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&f,f>>>=13;for(o=2*e;o>=26,e+=n/67108864|0,e+=f>>>26,this.words[r]=67108863&f}return 0!==e&&(this.words[r]=e,this.length++),this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new f(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var f=t%26,o=Math.min((t-f)/26,this.length),a=67108863^67108863>>>f<o)for(this.length-=o,d=0;d=0&&(0!==c||d>=n);d--){var h=0|this.words[d];this.words[d]=c<<26-f|h>>>f,c=h&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},f.prototype.isubn=function(t){if(i("number"==typeof t),i(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 e=0;e>26)-(s/67108864|0),this.words[n+r]=67108863&f}for(;n>26,this.words[n+r]=67108863&f;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==e){(a=new f(null)).length=s+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var u=67108864*(0|i.words[n.length+h])+(0|i.words[n.length+h-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(n,u,h);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},f.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),f=r.cmp(i);return f<0||1===n&&0===f?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},f.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},f.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new f(1),o=new f(0),a=new f(0),s=new f(1),d=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var b=0,p=1;0==(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(c),s.isub(h)),a.iushrn(1),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(s)):(r.isub(e),a.isub(n),s.isub(o))}return{a,b:s,gcd:r.iushln(d)}},f.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new f(1),a=new f(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(e.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(e.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var h=0,u=1;0==(r.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var f=e;e=r,r=f}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==f&&(this.words[o]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},f.prototype.gtn=function(t){return 1===this.cmpn(t)},f.prototype.gt=function(t){return 1===this.cmp(t)},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return-1===this.cmpn(t)},f.prototype.lt=function(t){return-1===this.cmp(t)},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return 0===this.cmpn(t)},f.prototype.eq=function(t){return 0===this.cmp(t)},f.red=function(t){return new A(t)},f.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new f(e,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=f._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(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)}g.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(v,g),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,f=o}f>>>=22,t.words[n-10]=f,0===f&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},f._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},A.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new f(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new f(1).toRed(this),s=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new f(2*c*c).toRed(this);0!==this.pow(c,d).cmp(s);)c.redIAdd(s);for(var h=this.pow(c,n),u=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),b=o;0!==l.cmp(a);){for(var p=l,y=0;0!==p.cmp(a);y++)p=p.redSqr();i(y=0;i--){for(var d=e.words[i],c=s-1;c>=0;c--){var h=d>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}s=26}return n},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},f.mont=function(t){return new S(t)},n(S,A),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),f=n;return n.cmp(this.m)>=0?f=n.isub(this.m):n.cmpn(0)<0&&(f=n.iadd(this.m)),f._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new f(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9931:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{"use strict";const i=r(9742),n=r(645),f="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return d(t,e,r)}function d(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let i=a(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return s.from(i,e,r);const n=function(t){if(s.isBuffer(t)){const e=0|b(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),a(t<0?0:0|b(t))}function u(t){const e=t.length<0?0:0|b(t.length),r=a(e);for(let i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return i?-1:J(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){let f,o=1,a=t.length,s=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,s/=2,r/=2}function d(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(f=r;fa&&(r=a-s),f=r;f>=0;f--){let r=!0;for(let i=0;in&&(i=n):i=n;const f=e.length;let o;for(i>f/2&&(i=f/2),o=0;o>8,n=r%256,f.push(n),f.push(i);return f}(e,t.length-r),t,r,i)}function E(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,a,s;switch(o){case 1:e<128&&(f=e);break;case 2:r=t[n+1],128==(192&r)&&(s=(31&e)<<6|63&r,s>127&&(f=s));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(s=(15&e)<<12|(63&r)<<6|63&i,s>2047&&(s<55296||s>57343)&&(f=s));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(s=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,s>65535&&s<1114112&&(f=s))}}null===f?(f=65533,o=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=o}return function(t){const e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},f&&(s.prototype[f]=s.prototype.inspect),s.prototype.compare=function(t,e,r,i,n){if(X(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let f=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(f,o),d=this.slice(i,n),c=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let f=!1;for(;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function B(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;ni)&&(r=i);let n="";for(let i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,i,n,f){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function O(t,e,r,i,n){F(e,i,n,t,r,7);let f=Number(e&BigInt(4294967295));t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function T(t,e,r,i,n){F(e,i,n,t,r,7);let f=Number(e&BigInt(4294967295));t[r+7]=f,f>>=8,t[r+6]=f,f>>=8,t[r+5]=f,f>>=8,t[r+4]=f;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function U(t,e,r,i,n,f){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(t,e,r,i,f){return e=+e,r>>>=0,f||U(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function q(t,e,r,i,f){return e=+e,r>>>=0,f||U(t,0,r,8),n.write(t,e,r,i,52,8),r+8}s.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||P(t,e,this.length);let i=this[t],n=1,f=0;for(;++f>>=0,e>>>=0,r||P(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=W((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<>>=0,e>>>=0,r||P(t,e,this.length);let i=this[t],n=1,f=0;for(;++f=n&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let i=e,n=1,f=this[t+--i];for(;i>0&&(n*=256);)f+=this[t+--i]*n;return n*=128,f>=n&&(f-=Math.pow(2,8*e)),f},s.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=W((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<>>=0,e||P(t,4,this.length),n.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),n.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),n.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),n.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,f=0;for(this[e]=255&t;++f>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,f=1;for(this[e+n]=255&t;--n>=0&&(f*=256);)this[e+n]=t/f&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=W((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=W((function(t,e=0){return T(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=0,f=1,o=0;for(this[e]=255&t;++n>0)-o&255;return e+r},s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=r-1,f=1,o=0;for(this[e+n]=255&t;--n>=0&&(f*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/f>>0)-o&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=W((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=W((function(t,e=0){return T(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(t,e,r){return z(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return z(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,i){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,f){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(f+1)}${i}`:`>= -(2${i} ** ${8*(f+1)-1}${i}) and < 2 ** ${8*(f+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new N.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(i,n,f)}function H(t,e){if("number"!=typeof t)throw new N.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new N.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}L("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),L("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),L("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=D(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=D(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function J(t,e){let r;e=e||1/0;const i=t.length;let n=null;const f=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&f.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&f.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&f.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&f.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;f.push(r)}else if(r<2048){if((e-=2)<0)break;f.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;f.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;f.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return f}function Z(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const G=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function W(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},4098:function(t,e){var r="undefined"!=typeof self?self:this,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),f="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function d(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function b(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function p(t){var e=new FileReader,r=b(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:f&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,e,r,i=l(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=b(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function M(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},M.error=function(){var t=new M(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];M.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new M(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function A(t,r){return new Promise((function(i,f){var o=new v(t,r);if(o.signal&&o.signal.aborted)return f(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new M(n,r))},a.onerror=function(){f(new TypeError("Network request failed"))},a.ontimeout=function(){f(new TypeError("Network request failed"))},a.onabort=function(){f(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",s)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}A.polyfill=!0,t.fetch||(t.fetch=A,t.Headers=u,t.Request=v,t.Response=M),e.Headers=u,e.Request=v,e.Response=M,e.fetch=A,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},6266:(t,e,r)=>{"use strict";var i=e;i.version=r(7519).i8,i.utils=r(953),i.rand=r(9931),i.curve=r(8254),i.curves=r(5427),i.ec=r(7954),i.eddsa=r(5980)},4918:(t,e,r)=>{"use strict";var i=r(3550),n=r(953),f=n.getNAF,o=n.getJSF,a=n.assert;function s(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function d(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=f(e,1,this._bitLength),n=(1<=o;c--)s=(s<<1)+i[c];d.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o=0;d--){for(var c=0;d>=0&&0===o[d];d--)c++;if(d>=0&&c++,s=s.dblp(c),d<0)break;var h=o[d];a(0!==h),s="affine"===t.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===t.type?s.toP():s},s.prototype._wnafMulAdd=function(t,e,r,i,n){var a,s,d,c=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(a=0;a=1;a-=2){var p=a-1,y=a;if(1===c[p]&&1===c[y]){var m=[e[p],null,null,e[y]];0===e[p].y.cmp(e[y].y)?(m[1]=e[p].add(e[y]),m[2]=e[p].toJ().mixedAdd(e[y].neg())):0===e[p].y.cmp(e[y].y.redNeg())?(m[1]=e[p].toJ().mixedAdd(e[y]),m[2]=e[p].add(e[y].neg())):(m[1]=e[p].toJ().mixedAdd(e[y]),m[2]=e[p].toJ().mixedAdd(e[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[p],r[y]);for(l=Math.max(v[0].length,l),u[p]=new Array(l),u[y]=new Array(l),s=0;s=0;a--){for(var S=0;a>=0;){var E=!0;for(s=0;s=0&&S++,_=_.dblp(S),a<0)break;for(s=0;s0?d=h[s][x-1>>1]:x<0&&(d=h[s][-x-1>>1].neg()),_="affine"===d.type?_.mixedAdd(d):_.add(d))}}for(a=0;a=Math.ceil((t.bitLength()+1)/e.step)},d.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n{"use strict";var i=r(953),n=r(3550),f=r(5717),o=r(4918),a=i.assert;function s(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function d(t,e,r,i,f){o.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=f&&new n(f,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}f(s,o),t.exports=s,s.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},s.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},s.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},s.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),f=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(f.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(e&&!s||!e&&s)&&(a=a.redNeg()),this.point(t,a)},s.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),f=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(f.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},s.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},f(d,o.BasePoint),s.prototype.pointFromJSON=function(t){return d.fromJSON(this,t)},s.prototype.point=function(t,e,r,i){return new d(this,t,e,r,i)},d.fromJSON=function(t,e){return new d(t,e[0],e[1],e[2])},d.prototype.inspect=function(){return this.isInfinity()?"":""},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),f=i.redAdd(e),o=f.redSub(r),a=i.redSub(e),s=n.redMul(o),d=f.redMul(a),c=n.redMul(a),h=o.redMul(f);return this.curve.point(s,d,h,c)},d.prototype._projDbl=function(){var t,e,r,i,n,f,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var d=(i=this.curve._mulA(a)).redAdd(s);this.zOne?(t=o.redSub(a).redSub(s).redMul(d.redSub(this.curve.two)),e=d.redMul(i.redSub(s)),r=d.redSqr().redSub(d).redSub(d)):(n=this.z.redSqr(),f=d.redSub(n).redISub(n),t=o.redSub(a).redISub(s).redMul(f),e=d.redMul(i.redSub(s)),r=d.redMul(f))}else i=a.redAdd(s),n=this.curve._mulC(this.z).redSqr(),f=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(f),e=this.curve._mulC(i).redMul(a.redISub(s)),r=i.redMul(f);return this.curve.point(t,e,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),f=r.redSub(e),o=n.redSub(i),a=n.redAdd(i),s=r.redAdd(e),d=f.redMul(o),c=a.redMul(s),h=f.redMul(s),u=o.redMul(a);return this.curve.point(d,c,u,h)},d.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),f=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(f).redMul(o),s=n.redSub(a),d=n.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(f).redISub(o),h=i.redMul(s).redMul(c);return this.curve.twisted?(e=i.redMul(d).redMul(o.redSub(this.curve._mulA(f))),r=s.redMul(d)):(e=i.redMul(d).redMul(o.redSub(f)),r=this.curve._mulC(s).redMul(d)),this.curve.point(h,e,r)},d.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},d.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},d.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},d.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},d.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},8254:(t,e,r)=>{"use strict";var i=e;i.base=r(4918),i.short=r(6673),i.mont=r(2881),i.edwards=r(1138)},2881:(t,e,r)=>{"use strict";var i=r(3550),n=r(5717),f=r(4918),o=r(953);function a(t){f.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function s(t,e,r){f.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,f),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(s,f.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new s(this,t,e)},a.prototype.pointFromJSON=function(t){return s.fromJSON(this,t)},s.prototype.precompute=function(){},s.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},s.fromJSON=function(t,e){return new s(t,e[0],e[1]||t.one)},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},s.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},s.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),f=t.x.redSub(t.z).redMul(r),o=n.redMul(i),a=e.z.redMul(f.redAdd(o).redSqr()),s=e.x.redMul(f.redISub(o).redSqr());return this.curve.point(a,s)},s.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var f=n.length-1;f>=0;f--)0===n[f]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},s.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},s.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(t,e,r)=>{"use strict";var i=r(953),n=r(3550),f=r(5717),o=r(4918),a=i.assert;function s(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(t,e,r,i){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,i){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}f(s,o),t.exports=s,s.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var f=this._getEndoRoots(this.n);0===this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))?r=f[0]:(r=f[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},s.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),f=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(f).fromRed(),i.redSub(f).fromRed()]},s.prototype._getEndoBasis=function(t){for(var e,r,i,f,o,a,s,d,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=t,l=this.n.clone(),b=new n(1),p=new n(0),y=new n(0),m=new n(1),g=0;0!==u.cmpn(0);){var v=l.div(u);d=l.sub(v.mul(u)),c=y.sub(v.mul(b));var w=m.sub(v.mul(p));if(!i&&d.cmp(h)<0)e=s.neg(),r=b,i=d.neg(),f=c;else if(i&&2==++g)break;s=d,l=u,u=d,y=b,b=c,m=p,p=w}o=d.neg(),a=c;var M=i.sqr().add(f.sqr());return o.sqr().add(a.sqr()).cmp(M)>=0&&(o=e,a=r),i.negative&&(i=i.neg(),f=f.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:f},{a:o,b:a}]},s.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),f=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=f.mul(i.a),s=n.mul(r.b),d=f.mul(i.b);return{k1:t.sub(o).sub(a),k2:s.add(d).neg()}},s.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var f=i.fromRed().isOdd();return(e&&!f||!e&&f)&&(i=i.redNeg()),this.point(t,i)},s.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},s.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,f=0;f":""},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},d.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),f=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,o)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},d.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},d.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},d.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},d.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},f(c,o.BasePoint),s.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),f=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),s=f.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=a.redSqr(),c=d.redMul(a),h=i.redMul(d),u=s.redSqr().redIAdd(c).redISub(h).redISub(h),l=s.redMul(h.redISub(u)).redISub(f.redMul(c)),b=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(u,l,b)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,f=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(f);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=o.redSqr(),d=s.redMul(o),c=r.redMul(s),h=a.redSqr().redIAdd(d).redISub(c).redISub(c),u=a.redMul(c.redISub(h)).redISub(n.redMul(d)),l=this.z.redMul(o);return this.curve.jpoint(h,u,l)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:(t,e,r)=>{"use strict";var i,n=e,f=r(3715),o=r(8254),a=r(953).assert;function s(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function d(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new s(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=s,d("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:f.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),d("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:f.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),d("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:f.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),d("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:f.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),d("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:f.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),d("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["9"]}),d("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(1037)}catch(t){i=void 0}d("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:f.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},7954:(t,e,r)=>{"use strict";var i=r(3550),n=r(2156),f=r(953),o=r(5427),a=r(9931),s=f.assert,d=r(1251),c=r(611);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(s(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new d(this,t)},h.prototype.keyFromPrivate=function(t,e){return d.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return d.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),f=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(f)>0))return o.iaddn(1),this.keyFromPrivate(o)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,f){"object"==typeof r&&(f=r,r=null),f||(f={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),s=t.toArray("be",o),d=new n({hash:this.hash,entropy:a,nonce:s,pers:f.pers,persEnc:f.persEnc||"utf8"}),h=this.n.sub(new i(1)),u=0;;u++){var l=f.k?f.k(u):new i(d.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var b=this.g.mul(l);if(!b.isInfinity()){var p=b.getX(),y=p.umod(this.n);if(0!==y.cmpn(0)){var m=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(b.getY().isOdd()?1:0)|(0!==p.cmp(y)?2:0);return f.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new c({r:y,s:m,recoveryParam:g})}}}}}},h.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var f=(e=new c(e,"hex")).r,o=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),d=s.mul(t).umod(this.n),h=s.mul(f).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(d,r.getPublic(),h)).isInfinity()&&a.eqXToP(f):!(a=this.g.mulAdd(d,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(f)},h.prototype.recoverPubKey=function(t,e,r,n){s((3&r)===r,"The recovery param is more than two bits"),e=new c(e,n);var f=this.n,o=new i(t),a=e.r,d=e.s,h=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),h):this.curve.pointFromX(a,h);var l=e.r.invm(f),b=f.sub(o).mul(l).umod(f),p=d.mul(l).umod(f);return this.g.mulAdd(b,a,p)},h.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new c(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var f;try{f=this.recoverPubKey(t,e,n)}catch(t){continue}if(f.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},1251:(t,e,r)=>{"use strict";var i=r(3550),n=r(953).assert;function f(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=f,f.fromPublic=function(t,e,r){return e instanceof f?e:new f(t,{pub:e,pubEnc:r})},f.fromPrivate=function(t,e,r){return e instanceof f?e:new f(t,{priv:e,privEnc:r})},f.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},f.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},f.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},f.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},f.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},f.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},f.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},f.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},f.prototype.inspect=function(){return""}},611:(t,e,r)=>{"use strict";var i=r(3550),n=r(953),f=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(f(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function s(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,f=0,o=e.place;f>>=0;return!(n<=127)&&(e.place=o,n)}function d(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var f=s(t,r);if(!1===f)return!1;if(f+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=s(t,r);if(!1===o)return!1;var d=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var c=s(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var h=t.slice(r.place,c+r.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new i(d),this.s=new i(h),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=d(e),r=d(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];c(i,e.length),(i=i.concat(e)).push(2),c(i,r.length);var f=i.concat(r),o=[48];return c(o,f.length),o=o.concat(f),n.encode(o,t)}},5980:(t,e,r)=>{"use strict";var i=r(3715),n=r(5427),f=r(953),o=f.assert,a=f.parseBytes,s=r(9087),d=r(3622);function c(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=c,c.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),f=this.encodePoint(n),o=this.hashInt(f,r.pubBytes(),t).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:f})},c.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),f=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(f)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{"use strict";var i=r(953),n=i.assert,f=i.parseBytes,o=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=f(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=f(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},3622:(t,e,r)=>{"use strict";var i=r(3550),n=r(953),f=n.assert,o=n.cachedProperty,a=n.parseBytes;function s(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),f(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(s,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(s,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(s,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(s,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),s.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},s.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=s},1037:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:(t,e,r)=>{"use strict";var i=e,n=r(3550),f=r(9746),o=r(4504);i.assert=f,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,f.isubn(a)):a=0,i[o]=a,f.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,f=0;t.cmpn(-n)>0||e.cmpn(-f)>0;){var o,a,s=t.andln(3)+n&3,d=e.andln(3)+f&3;3===s&&(s=-1),3===d&&(d=-1),o=0==(1&s)?0:3!=(i=t.andln(7)+n&7)&&5!==i||2!==d?s:-s,r[0].push(o),a=0==(1&d)?0:3!=(i=e.andln(7)+f&7)&&5!==i||2!==s?d:-d,r[1].push(a),2*n===o+1&&(n=1-n),2*f===a+1&&(f=1-f),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},7519:t=>{"use strict";t.exports={i8:"6.5.4"}},3715:(t,e,r)=>{var i=e;i.utils=r(6436),i.common=r(5772),i.sha=r(9041),i.ripemd=r(2949),i.hmac=r(2344),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},5772:(t,e,r)=>{"use strict";var i=r(6436),n=r(9746);function f(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=f,f.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,f=8;f{"use strict";var i=r(6436),n=r(9746);function f(t,e,r){if(!(this instanceof f))return new f(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=f,f.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e{"use strict";var i=r(6436),n=r(5772),f=i.rotl32,o=i.sum32,a=i.sum32_3,s=i.sum32_4,d=n.BlockHash;function c(){if(!(this instanceof c))return new c;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function u(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(c,d),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],d=this.h[3],c=this.h[4],g=r,v=i,w=n,M=d,_=c,A=0;A<80;A++){var S=o(f(s(r,h(A,i,n,d),t[b[A]+e],u(A)),y[A]),c);r=c,c=d,d=f(n,10),n=i,i=S,S=o(f(s(g,h(79-A,v,w,M),t[p[A]+e],l(A)),m[A]),_),g=_,_=M,M=f(w,10),w=v,v=S}S=a(this.h[1],n,M),this.h[1]=a(this.h[2],d,_),this.h[2]=a(this.h[3],c,g),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],i,w),this.h[0]=S},c.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var b=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:(t,e,r)=>{"use strict";e.sha1=r(4761),e.sha224=r(799),e.sha256=r(9344),e.sha384=r(772),e.sha512=r(5900)},4761:(t,e,r)=>{"use strict";var i=r(6436),n=r(5772),f=r(7038),o=i.rotl32,a=i.sum32,s=i.sum32_5,d=f.ft_1,c=n.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(u,c),t.exports=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{"use strict";var i=r(6436),n=r(9344);function f(){if(!(this instanceof f))return new f;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(f,n),t.exports=f,f.blockSize=512,f.outSize=224,f.hmacStrength=192,f.padLength=64,f.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},9344:(t,e,r)=>{"use strict";var i=r(6436),n=r(5772),f=r(7038),o=r(9746),a=i.sum32,s=i.sum32_4,d=i.sum32_5,c=f.ch32,h=f.maj32,u=f.s0_256,l=f.s1_256,b=f.g0_256,p=f.g1_256,y=n.BlockHash,m=[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];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(g,y),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{"use strict";var i=r(6436),n=r(5900);function f(){if(!(this instanceof f))return new f;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(f,n),t.exports=f,f.blockSize=1024,f.outSize=384,f.hmacStrength=192,f.padLength=128,f.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},5900:(t,e,r)=>{"use strict";var i=r(6436),n=r(5772),f=r(9746),o=i.rotr64_hi,a=i.rotr64_lo,s=i.shr64_hi,d=i.shr64_lo,c=i.sum64,h=i.sum64_hi,u=i.sum64_lo,l=i.sum64_4_hi,b=i.sum64_4_lo,p=i.sum64_5_hi,y=i.sum64_5_lo,m=n.BlockHash,g=[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];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(t,e,r,i,n){var f=t&r^~t&n;return f<0&&(f+=4294967296),f}function M(t,e,r,i,n,f){var o=e&i^~e&f;return o<0&&(o+=4294967296),o}function _(t,e,r,i,n){var f=t&r^t&n^r&n;return f<0&&(f+=4294967296),f}function A(t,e,r,i,n,f){var o=e&i^e&f^i&f;return o<0&&(o+=4294967296),o}function S(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function I(t,e){var r=o(t,e,1)^o(t,e,8)^s(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,1)^a(t,e,8)^d(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,19)^a(e,t,29)^d(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(v,m),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i{"use strict";var i=r(6436).rotr32;function n(t,e,r){return t&e^~t&r}function f(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?f(e,r,i):void 0},e.ch32=n,e.maj32=f,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},6436:(t,e,r)=>{"use strict";var i=r(9746),n=r(5717);function f(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=63&o|128):f(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=f>>>16&255,r[n+2]=f>>>8&255,r[n+3]=255&f):(r[n+3]=f>>>24,r[n+2]=f>>>16&255,r[n+1]=f>>>8&255,r[n]=255&f)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],f=i+t[e+1]>>>0,o=(f>>0,t[e+1]=f},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,f,o,a){var s=0,d=e;return s+=(d=d+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,f,o,a){return e+i+f+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,f,o,a,s,d){var c=0,h=e;return c+=(h=h+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,f,o,a,s,d){return e+i+f+a+d>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},9090:(t,e,r)=>{var i;!function(){"use strict";var e="object"==typeof window?window:{};!e.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);var n=!e.HI_BASE32_NO_COMMON_JS&&t.exports,f=r.amdO,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),a={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},s=[0,0,0,0,0,0,0,0],d=function(t,e){e.length>10&&(e="..."+e.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+t+" bytes: "+e+" <-");throw r.position=t,r},c=function(t){if(""===t)return[];if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");for(var e,r,i,n,f,o,s,d,c=[],h=0,u=(t=t.replace(/=/g,"")).length,l=0,b=u>>3<<3;l>>2),c[h++]=255&(r<<6|i<<1|n>>>4),c[h++]=255&(n<<4|f>>>1),c[h++]=255&(f<<7|o<<2|s>>>3),c[h++]=255&(s<<5|d);var p=u-b;return 2===p?(e=a[t.charAt(l++)],r=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2)):4===p?(e=a[t.charAt(l++)],r=a[t.charAt(l++)],i=a[t.charAt(l++)],n=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2),c[h++]=255&(r<<6|i<<1|n>>>4)):5===p?(e=a[t.charAt(l++)],r=a[t.charAt(l++)],i=a[t.charAt(l++)],n=a[t.charAt(l++)],f=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2),c[h++]=255&(r<<6|i<<1|n>>>4),c[h++]=255&(n<<4|f>>>1)):7===p&&(e=a[t.charAt(l++)],r=a[t.charAt(l++)],i=a[t.charAt(l++)],n=a[t.charAt(l++)],f=a[t.charAt(l++)],o=a[t.charAt(l++)],s=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2),c[h++]=255&(r<<6|i<<1|n>>>4),c[h++]=255&(n<<4|f>>>1),c[h++]=255&(f<<7|o<<2|s>>>3)),c},h=function(t,e){if(!e)return function(t){for(var e,r,i="",n=t.length,f=0,o=0;f191&&e<=223?(r=31&e,o=1):e<=239?(r=15&e,o=2):e<=247?(r=7&e,o=3):d(f,i);for(var a=0;a191)&&d(f,i),r<<=6,r+=63&e;r>=55296&&r<=57343&&d(f,i),r>1114111&&d(f,i),r<=65535?i+=String.fromCharCode(r):(r-=65536,i+=String.fromCharCode(55296+(r>>10)),i+=String.fromCharCode(56320+(1023&r)))}return i}(c(t));if(""===t)return"";if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");var r,i,n,f,o,s,h,u,l="",b=t.indexOf("=");-1===b&&(b=t.length);for(var p=0,y=b>>3<<3;p>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))+String.fromCharCode(255&(f<<4|o>>>1))+String.fromCharCode(255&(o<<7|s<<2|h>>>3))+String.fromCharCode(255&(h<<5|u));var m=b-y;return 2===m?(r=a[t.charAt(p++)],i=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))):4===m?(r=a[t.charAt(p++)],i=a[t.charAt(p++)],n=a[t.charAt(p++)],f=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))):5===m?(r=a[t.charAt(p++)],i=a[t.charAt(p++)],n=a[t.charAt(p++)],f=a[t.charAt(p++)],o=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))+String.fromCharCode(255&(f<<4|o>>>1))):7===m&&(r=a[t.charAt(p++)],i=a[t.charAt(p++)],n=a[t.charAt(p++)],f=a[t.charAt(p++)],o=a[t.charAt(p++)],s=a[t.charAt(p++)],h=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))+String.fromCharCode(255&(f<<4|o>>>1))+String.fromCharCode(255&(o<<7|s<<2|h>>>3))),l},u={encode:function(t,e){var r="string"!=typeof t;return r&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),r?function(t){for(var e,r,i,n,f,a="",s=t.length,d=0,c=5*parseInt(s/5);d>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|f>>>5)]+o[31&f];var h=s-c;return 1===h?(e=t[d],a+=o[e>>>3]+o[e<<2&31]+"======"):2===h?(e=t[d++],r=t[d],a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===h?(e=t[d++],r=t[d++],i=t[d],a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[i<<1&31]+"==="):4===h&&(e=t[d++],r=t[d++],i=t[d++],n=t[d],a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"="),a}(t):e?function(t){for(var e,r,i,n,f,a="",s=t.length,d=0,c=5*parseInt(s/5);d>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|f>>>5)]+o[31&f];var h=s-c;return 1===h?(e=t.charCodeAt(d),a+=o[e>>>3]+o[e<<2&31]+"======"):2===h?(e=t.charCodeAt(d++),r=t.charCodeAt(d),a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===h?(e=t.charCodeAt(d++),r=t.charCodeAt(d++),i=t.charCodeAt(d),a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[i<<1&31]+"==="):4===h&&(e=t.charCodeAt(d++),r=t.charCodeAt(d++),i=t.charCodeAt(d++),n=t.charCodeAt(d),a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"="),a}(t):function(t){var e,r,i,n,f,a,d,c=!1,h="",u=0,l=0,b=t.length;if(""===t)return h;do{for(s[0]=s[5],s[1]=s[6],s[2]=s[7],d=l;u>6,s[d++]=128|63&a):a<55296||a>=57344?(s[d++]=224|a>>12,s[d++]=128|a>>6&63,s[d++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++u)),s[d++]=240|a>>18,s[d++]=128|a>>12&63,s[d++]=128|a>>6&63,s[d++]=128|63&a);l=d-5,u===b&&++u,u>b&&d<6&&(c=!0),e=s[0],d>4?(r=s[1],i=s[2],n=s[3],f=s[4],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|f>>>5)]+o[31&f]):1===d?h+=o[e>>>3]+o[e<<2&31]+"======":2===d?(r=s[1],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===d?(r=s[1],i=s[2],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[i<<1&31]+"==="):(r=s[1],i=s[2],n=s[3],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"=")}while(!c);return h}(t)},decode:h};h.asBytes=c,n?t.exports=u:(e.base32=u,f&&(void 0===(i=function(){return u}.call(u,r,u,t))||(t.exports=i)))}()},2156:(t,e,r)=>{"use strict";var i=r(3715),n=r(4504),f=r(9746);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");f(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=o,o.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var f=[];f.length{e.read=function(t,e,r,i,n){var f,o,a=8*n-i-1,s=(1<>1,c=-7,h=r?n-1:0,u=r?-1:1,l=t[e+h];for(h+=u,f=l&(1<<-c)-1,l>>=-c,c+=a;c>0;f=256*f+t[e+h],h+=u,c-=8);for(o=f&(1<<-c)-1,f>>=-c,c+=i;c>0;o=256*o+t[e+h],h+=u,c-=8);if(0===f)f=1-d;else{if(f===s)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,i),f-=d}return(l?-1:1)*o*Math.pow(2,f-i)},e.write=function(t,e,r,i,n,f){var o,a,s,d=8*f-n-1,c=(1<>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:f-1,b=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),(e+=o+h>=1?u/s:u*Math.pow(2,1-h))*s>=2&&(o++,s/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(e*s-1)*Math.pow(2,n),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[r+l]=255&a,l+=b,a/=256,n-=8);for(o=o<0;t[r+l]=255&o,l+=b,o/=256,d-=8);t[r+l-b]|=128*p}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},4504:(t,e)=>{"use strict";var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r>8,o=255&n;f?r.push(f,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},2399:(t,e,r)=>{"use strict";var i,n=r(8764),f=n.Buffer,o={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=n[i]);var a=o.Buffer={};for(i in f)f.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=f[i]);if(o.Buffer.prototype=f.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){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 f(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){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 i=f(t);return e&&0!==e.length?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(t){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o},6601:()=>{},9214:()=>{}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var f=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(f.exports,f,f.exports,r),f.loaded=!0,f.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";r.r(i),r.d(i,{getKeyId:()=>p,getPayloadHeader:()=>y,hashEndPoint:()=>R,hashPayload:()=>B,mapHeaders:()=>P,pack:()=>S,parseHeader:()=>m,resolveKey:()=>I,sign:()=>_,signAndPack:()=>E,unpack:()=>A,unpackAndVerify:()=>x,verify:()=>M});var t=r(6266),e=r(9809),n=r.n(e),f=r(9344),o=r.n(f),a=r(4098),s=r.n(a),d=r(9090),c=r.n(d);function h(t,e){return c().encode(t,e).replace(/=/g,"")}var u={},l={};async function b(t){const e=await s()(t);if(e.status>=400)throw new Error("Bad response from server");return await e.text()}async function p(t){if(u[t])return u[t];try{const e=await async function(t){const e=await s()(t);if(e.status>=400)throw new Error("Bad response from server");return await e.json()}("https://dns.google/resolve?name="+t+"&type=TXT");if(e.Answer){let r=e.Answer[0].data.replace(/\\n/g,"\n");if(r)return r.includes("-----BEGIN PUBLIC KEY-----")||(r="-----BEGIN PUBLIC KEY-----\n"+r+"\n-----END PUBLIC KEY-----\n"),u[t]={type:"DNS",key:r,debugPath:"https://dns.google/resolve?name="+t+"&type=TXT"},u[t]}}catch(t){}try{const e=await b("https://"+t);if(e.includes("-----BEGIN PUBLIC KEY-----"))return u[t]={type:"URL",key:e,debugPath:"https://"+t},u[t]}catch(t){}try{const e=t.split(".")[0],r=t.split(".")[1];let i=await b("https://raw.githubusercontent.com/Path-Check/paper-cred/main/keys/"+r+"/"+e+".pem");if(null!=i&&i.includes("-----BEGIN PUBLIC KEY-----"))return u[t]={type:"GITDB",key:i,debugPath:"https://github.com/Path-Check/paper-cred/tree/main/keys/"+r+"/"+e+".pem"},u[t]}catch(t){}}async function y(t,e){const r=t.toLowerCase()+"."+e;if(l[r])return l[r];try{return l[r]=await b("https://raw.githubusercontent.com/Path-Check/paper-cred/main/payloads/"+r+".fields"),l[r]}catch(t){return}}async function m(t){if(!t)return;let e=t.split("\n"),r=e[0].split("/"),i=new Map;for(let t=1;t=400)throw new Error("Bad response from server");const r=await e.arrayBuffer();return h(o()().update(r).digest())}async function k(t,e){let r={},i=0;for(;t.length>0&&i{var t={9809:(t,e,r)=>{"use strict";const i=e;i.bignum=r(3550),i.define=r(2500).define,i.base=r(1979),i.constants=r(6826),i.decoders=r(8307),i.encoders=r(6579)},2500:(t,e,r)=>{"use strict";const i=r(6579),n=r(8307),f=r(5717);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return f(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(i[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},6625:(t,e,r)=>{"use strict";const i=r(5717),n=r(8465).b,f=r(2399).Buffer;function o(t,e){n.call(this,e),f.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=f.byteLength(t);else{if(!f.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}i(o,n),e.C=o,o.isDecoderBuffer=function(t){return t instanceof o||"object"==typeof t&&f.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},o.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},o.prototype.restore=function(t){const e=new o(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,n.prototype.restore.call(this,t.reporter),e},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=f.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):f.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},1979:(t,e,r)=>{"use strict";const i=e;i.Reporter=r(8465).b,i.DecoderBuffer=r(6625).C,i.EncoderBuffer=r(6625).R,i.Node=r(1949)},1949:(t,e,r)=>{"use strict";const i=r(8465).b,n=r(6625).R,f=r(6625).C,o=r(9746),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"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function d(t,e,r){const i={};this._baseState=i,i.name=r,i.enc=t,i.parent=e||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=d;const c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];d.prototype.clone=function(){const t=this._baseState,e={};c.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},d.prototype._wrap=function(){const t=this._baseState;s.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},d.prototype._init=function(t){const e=this._baseState;o(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),o.equal(e.children.length,1,"Root node can have only one child")},d.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(o(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(o(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const i=t[r];e[i]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){d.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){d.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===e.tag),e.tag=t,this._useArgs(r),this}})),d.prototype.use=function(t){o(t);const e=this._baseState;return o(null===e.use),e.use=t,this},d.prototype.optional=function(){return this._baseState.optional=!0,this},d.prototype.def=function(t){const e=this._baseState;return o(null===e.default),e.default=t,e.optional=!0,this},d.prototype.explicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.explicit=t,this},d.prototype.implicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.implicit=t,this},d.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},d.prototype.key=function(t){const e=this._baseState;return o(null===e.key),e.key=t,this},d.prototype.any=function(){return this._baseState.any=!0,this},d.prototype.choice=function(t){const e=this._baseState;return o(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},d.prototype.contains=function(t){const e=this._baseState;return o(null===e.use),e.contains=t,this},d.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let i,n=r.default,o=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let i=null;if(null!==r.explicit?i=r.explicit:null!==r.implicit?i=r.implicit:null!==r.tag&&(i=r.tag),null!==i||r.any){if(o=this._peekTag(t,i,r.any),t.isError(o))return o}else{const i=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(i)}}if(r.obj&&o&&(i=t.enterObject()),o){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const i=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const i=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(i))return i;r.any?n=t.raw(e):t=i}if(e&&e.track&&null!==r.tag&&e.track(t.path(),i,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const i=new f(n);n=this._getUse(r.contains,t._reporterState.obj)._decode(i,e)}}return r.obj&&o&&(n=t.leaveObject(i)),null===r.key||null===n&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,n),n},d.prototype._decodeGeneric=function(t,e,r){const i=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,i.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&i.args?this._decodeObjid(e,i.args[0],i.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},d.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},d.prototype._decodeChoice=function(t,e){const r=this._baseState;let i=null,n=!1;return Object.keys(r.choice).some((function(f){const o=t.save(),a=r.choice[f];try{const r=a._decode(t,e);if(t.isError(r))return!1;i={type:f,value:r},n=!0}catch(e){return t.restore(o),!1}return!0}),this),n?i:t.error("Choice not matched")},d.prototype._createEncoderBuffer=function(t){return new n(t,this.reporter)},d.prototype._encode=function(t,e,r){const i=this._baseState;if(null!==i.default&&i.default===t)return;const n=this._encodeValue(t,e,r);return void 0===n||this._skipDefault(n,e,r)?void 0:n},d.prototype._encodeValue=function(t,e,r){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,e||new i);let f=null;if(this.reporter=e,n.optional&&void 0===t){if(null===n.default)return;t=n.default}let o=null,a=!1;if(n.any)f=this._createEncoderBuffer(t);else if(n.choice)f=this._encodeChoice(t,e);else if(n.contains)o=this._getUse(n.contains,r)._encode(t,e),a=!0;else if(n.children)o=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const i=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),n}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return e.error("Too many args for : "+n.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(r){const i=this._baseState;return this._getUse(i.args[0],t)._encode(r,e)}),r))}else null!==n.use?f=this._getUse(n.use,r)._encode(t,e):(o=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){const t=null!==n.implicit?n.implicit:n.tag,r=null===n.implicit?"universal":"context";null===t?null===n.use&&e.error("Tag could be omitted only for .use()"):null===n.use&&(f=this._encodeComposite(t,a,r,o))}return null!==n.explicit&&(f=this._encodeComposite(n.explicit,!1,"context",f)),f},d.prototype._encodeChoice=function(t,e){const r=this._baseState,i=r.choice[t.type];return i||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(t.value,e)},d.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},d.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},d.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},8465:(t,e,r)=>{"use strict";const i=r(5717);function n(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function f(t,e){this.path=t,this.rethrow(e)}e.b=n,n.prototype.isError=function(t){return t instanceof f},n.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},n.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},n.prototype.enterKey=function(t){return this._reporterState.path.push(t)},n.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},n.prototype.leaveKey=function(t,e,r){const i=this._reporterState;this.exitKey(t),null!==i.obj&&(i.obj[e]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},n.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},n.prototype.error=function(t){let e;const r=this._reporterState,i=t instanceof f;if(e=i?t:new f(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return i||r.errors.push(e),e},n.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},i(f,Error),f.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,f),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},160:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.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"},e.tagByName=r(e.tag)},6826:(t,e,r)=>{"use strict";const i=e;i._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const i=t[r];e[i]=r})),e},i.der=r(160)},1671:(t,e,r)=>{"use strict";const i=r(5717),n=r(3550),f=r(6625).C,o=r(1949),a=r(160);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new d,this.tree._init(t.body)}function d(t){o.call(this,"der",t)}function c(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=t.readUInt8(e),t.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function h(t,e,r){let i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;const n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(let e=0;e{"use strict";const i=e;i.der=r(1671),i.pem=r(9631)},9631:(t,e,r)=>{"use strict";const i=r(5717),n=r(2399).Buffer,f=r(1671);function o(t){f.call(this,t),this.enc="pem"}i(o,f),t.exports=o,o.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),i=e.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,s=-1;for(let t=0;t{"use strict";const i=r(5717),n=r(2399).Buffer,f=r(1949),o=r(160);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new s,this.tree._init(t.body)}function s(t){f.call(this,"der",t)}function d(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},i(s,f),s.prototype._encodeComposite=function(t,e,r,i){const f=function(t,e,r,i){let n;if("seqof"===t?t="seq":"setof"===t&&(t="set"),o.tagByName.hasOwnProperty(t))n=o.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return i.error("Unknown tag: "+t);n=t}return n>=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=o.tagClassByName[r||"universal"]<<6,n)}(t,e,r,this.reporter);if(i.length<128){const t=n.alloc(2);return t[0]=f,t[1]=i.length,this._createEncoderBuffer([t,i])}let a=1;for(let t=i.length;t>=256;t>>=8)a++;const s=n.alloc(2+a);s[0]=f,s[1]=128|a;for(let t=1+a,e=i.length;e>0;t--,e>>=8)s[t]=255&e;return this._createEncoderBuffer([s,i])},s.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=n.alloc(2*t.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let i=0;for(let e=0;e=128;r>>=7)i++}const f=n.alloc(i);let o=f.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(f[o--]=127&r;(r>>=7)>0;)f[o--]=128|127&r}return this._createEncoderBuffer(f)},s.prototype._encodeTime=function(t,e){let r;const i=new Date(t);return"gentime"===e?r=[d(i.getUTCFullYear()),d(i.getUTCMonth()+1),d(i.getUTCDate()),d(i.getUTCHours()),d(i.getUTCMinutes()),d(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[d(i.getUTCFullYear()%100),d(i.getUTCMonth()+1),d(i.getUTCDate()),d(i.getUTCHours()),d(i.getUTCMinutes()),d(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!n.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=n.from(e)}if(n.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=n.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const i=new Array(r);for(let e=i.length-1;e>=0;e--)i[e]=255&t,t>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(n.from(i))},s.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},s.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},s.prototype._skipDefault=function(t,e,r){const i=this._baseState;let n;if(null===i.default)return!1;const f=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),f.length!==i.defaultBuffer.length)return!1;for(n=0;n{"use strict";const i=e;i.der=r(6984),i.pem=r(2883)},2883:(t,e,r)=>{"use strict";const i=r(5717),n=r(6984);function f(t){n.call(this,t),this.enc="pem"}i(f,n),t.exports=f,f.prototype.encode=function(t,e){const r=n.prototype.encode.call(this,t).toString("base64"),i=["-----BEGIN "+e.label+"-----"];for(let t=0;t{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,f=s(t),o=f[0],a=f[1],d=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,a)),c=0,h=a>0?o-4:o;for(r=0;r>16&255,d[c++]=e>>8&255,d[c++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,d[c++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,d[c++]=e>>8&255,d[c++]=255&e),d},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,f=[],o=16383,a=0,s=i-n;as?s:a+o));return 1===n?(e=t[i-1],f.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],f.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),f.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=f.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function d(t,e,i){for(var n,f,o=[],a=e;a>18&63]+r[f>>12&63]+r[f>>6&63]+r[63&f]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},3550:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function f(t,e,r){if(f.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function d(t,e,r,i){for(var n=0,f=Math.min(t.length,r),o=e;o=49?a-49+10:a>=17?a-17+10:a}return n}f.isBN=function(t){return t instanceof f||null!==t&&"object"==typeof t&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,e){return t.cmp(e)>0?t:e},f.min=function(t,e){return t.cmp(e)<0?t:e},f.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[f]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);else if("le"===r)for(n=0,f=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,f++);return this.strip()},f.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=s(t,e,i)<=18?(f-=18,o+=1,this.words[o]|=n>>>26):f+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(f-=18,o+=1,this.words[o]|=n>>>26):f+=8;this.strip()},f.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var f=t.length-r,o=f%i,a=Math.min(f,f-o)+r,s=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var c=["","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"],h=[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],u=[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 l(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],f=0|e.words[0],o=n*f,a=67108863&o,s=o/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&s,u=Math.min(d,e.length-1),l=Math.max(0,d-t.length+1);l<=u;l++){var b=d-l|0;c+=(o=(n=0|t.words[b])*(f=0|e.words[l])+h)/67108864|0,h=67108863&o}r.words[d]=0|h,s=0|c}return 0!==s?r.words[d]=0|s:r.length--,r.strip()}f.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,f=0,o=0;o>>24-n&16777215)||o!==this.length-1?c[6-s.length]+s+r:s+r,(n+=2)>=26&&(n-=26,o--)}for(0!==f&&(r=f.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=h[t],l=u[t];r="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(l).toString(t);r=(b=b.idivn(l)).isZero()?p+r:c[d-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},f.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,e){return i(void 0!==o),this.toArrayLike(o,t,e)},f.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},f.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),f=r||Math.max(1,n);i(n<=f,"byte array longer than desired length"),i(f>0,"Requested array length <= 0"),this.strip();var o,a,s="le"===e,d=new t(f),c=this.clone();if(s){for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),d[a]=o;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},f.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},f.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,f=0;f>>26;for(;0!==n&&f>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ft.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var f=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==f&&o>26,this.words[o]=67108863&e;if(0===f&&o>>13,l=0|o[1],b=8191&l,p=l>>>13,y=0|o[2],m=8191&y,g=y>>>13,v=0|o[3],w=8191&v,M=v>>>13,_=0|o[4],A=8191&_,S=_>>>13,E=0|o[5],x=8191&E,I=E>>>13,B=0|o[6],R=8191&B,k=B>>>13,C=0|o[7],P=8191&C,j=C>>>13,O=0|o[8],T=8191&O,U=O>>>13,z=0|o[9],q=8191&z,N=z>>>13,L=0|a[0],D=8191&L,F=L>>>13,H=0|a[1],K=8191&H,$=H>>>13,J=0|a[2],Z=8191&J,V=J>>>13,X=0|a[3],Y=8191&X,G=X>>>13,W=0|a[4],Q=8191&W,tt=W>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ft=8191&nt,ot=nt>>>13,at=0|a[7],st=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,lt=0|a[9],bt=8191<,pt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(d+(i=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,F))+Math.imul(u,D)|0))<<13)|0;d=((f=Math.imul(u,F))+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,D),n=(n=Math.imul(b,F))+Math.imul(p,D)|0,f=Math.imul(p,F);var mt=(d+(i=i+Math.imul(h,K)|0)|0)+((8191&(n=(n=n+Math.imul(h,$)|0)+Math.imul(u,K)|0))<<13)|0;d=((f=f+Math.imul(u,$)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,D),n=(n=Math.imul(m,F))+Math.imul(g,D)|0,f=Math.imul(g,F),i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(p,K)|0,f=f+Math.imul(p,$)|0;var gt=(d+(i=i+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,Z)|0))<<13)|0;d=((f=f+Math.imul(u,V)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(w,D),n=(n=Math.imul(w,F))+Math.imul(M,D)|0,f=Math.imul(M,F),i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(g,K)|0,f=f+Math.imul(g,$)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(p,Z)|0,f=f+Math.imul(p,V)|0;var vt=(d+(i=i+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,G)|0)+Math.imul(u,Y)|0))<<13)|0;d=((f=f+Math.imul(u,G)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(A,D),n=(n=Math.imul(A,F))+Math.imul(S,D)|0,f=Math.imul(S,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(M,K)|0,f=f+Math.imul(M,$)|0,i=i+Math.imul(m,Z)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,Z)|0,f=f+Math.imul(g,V)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(p,Y)|0,f=f+Math.imul(p,G)|0;var wt=(d+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((f=f+Math.imul(u,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(x,D),n=(n=Math.imul(x,F))+Math.imul(I,D)|0,f=Math.imul(I,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(S,K)|0,f=f+Math.imul(S,$)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,V)|0)+Math.imul(M,Z)|0,f=f+Math.imul(M,V)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,G)|0)+Math.imul(g,Y)|0,f=f+Math.imul(g,G)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(p,Q)|0,f=f+Math.imul(p,tt)|0;var Mt=(d+(i=i+Math.imul(h,rt)|0)|0)+((8191&(n=(n=n+Math.imul(h,it)|0)+Math.imul(u,rt)|0))<<13)|0;d=((f=f+Math.imul(u,it)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(R,D),n=(n=Math.imul(R,F))+Math.imul(k,D)|0,f=Math.imul(k,F),i=i+Math.imul(x,K)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(I,K)|0,f=f+Math.imul(I,$)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(S,Z)|0,f=f+Math.imul(S,V)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(M,Y)|0,f=f+Math.imul(M,G)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(g,Q)|0,f=f+Math.imul(g,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(p,rt)|0,f=f+Math.imul(p,it)|0;var _t=(d+(i=i+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,ot)|0)+Math.imul(u,ft)|0))<<13)|0;d=((f=f+Math.imul(u,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(P,D),n=(n=Math.imul(P,F))+Math.imul(j,D)|0,f=Math.imul(j,F),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(k,K)|0,f=f+Math.imul(k,$)|0,i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,V)|0)+Math.imul(I,Z)|0,f=f+Math.imul(I,V)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(S,Y)|0,f=f+Math.imul(S,G)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,f=f+Math.imul(M,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(g,rt)|0,f=f+Math.imul(g,it)|0,i=i+Math.imul(b,ft)|0,n=(n=n+Math.imul(b,ot)|0)+Math.imul(p,ft)|0,f=f+Math.imul(p,ot)|0;var At=(d+(i=i+Math.imul(h,st)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,st)|0))<<13)|0;d=((f=f+Math.imul(u,dt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(T,D),n=(n=Math.imul(T,F))+Math.imul(U,D)|0,f=Math.imul(U,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(j,K)|0,f=f+Math.imul(j,$)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(k,Z)|0,f=f+Math.imul(k,V)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,G)|0)+Math.imul(I,Y)|0,f=f+Math.imul(I,G)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(S,Q)|0,f=f+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(M,rt)|0,f=f+Math.imul(M,it)|0,i=i+Math.imul(m,ft)|0,n=(n=n+Math.imul(m,ot)|0)+Math.imul(g,ft)|0,f=f+Math.imul(g,ot)|0,i=i+Math.imul(b,st)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(p,st)|0,f=f+Math.imul(p,dt)|0;var St=(d+(i=i+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((f=f+Math.imul(u,ut)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(q,D),n=(n=Math.imul(q,F))+Math.imul(N,D)|0,f=Math.imul(N,F),i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(U,K)|0,f=f+Math.imul(U,$)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(j,Z)|0,f=f+Math.imul(j,V)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(k,Y)|0,f=f+Math.imul(k,G)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,f=f+Math.imul(I,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(S,rt)|0,f=f+Math.imul(S,it)|0,i=i+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,ot)|0)+Math.imul(M,ft)|0,f=f+Math.imul(M,ot)|0,i=i+Math.imul(m,st)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(g,st)|0,f=f+Math.imul(g,dt)|0,i=i+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(p,ht)|0,f=f+Math.imul(p,ut)|0;var Et=(d+(i=i+Math.imul(h,bt)|0)|0)+((8191&(n=(n=n+Math.imul(h,pt)|0)+Math.imul(u,bt)|0))<<13)|0;d=((f=f+Math.imul(u,pt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(q,K),n=(n=Math.imul(q,$))+Math.imul(N,K)|0,f=Math.imul(N,$),i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,V)|0)+Math.imul(U,Z)|0,f=f+Math.imul(U,V)|0,i=i+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(j,Y)|0,f=f+Math.imul(j,G)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(k,Q)|0,f=f+Math.imul(k,tt)|0,i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(I,rt)|0,f=f+Math.imul(I,it)|0,i=i+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,ot)|0)+Math.imul(S,ft)|0,f=f+Math.imul(S,ot)|0,i=i+Math.imul(w,st)|0,n=(n=n+Math.imul(w,dt)|0)+Math.imul(M,st)|0,f=f+Math.imul(M,dt)|0,i=i+Math.imul(m,ht)|0,n=(n=n+Math.imul(m,ut)|0)+Math.imul(g,ht)|0,f=f+Math.imul(g,ut)|0;var xt=(d+(i=i+Math.imul(b,bt)|0)|0)+((8191&(n=(n=n+Math.imul(b,pt)|0)+Math.imul(p,bt)|0))<<13)|0;d=((f=f+Math.imul(p,pt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(q,Z),n=(n=Math.imul(q,V))+Math.imul(N,Z)|0,f=Math.imul(N,V),i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(U,Y)|0,f=f+Math.imul(U,G)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(j,Q)|0,f=f+Math.imul(j,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(k,rt)|0,f=f+Math.imul(k,it)|0,i=i+Math.imul(x,ft)|0,n=(n=n+Math.imul(x,ot)|0)+Math.imul(I,ft)|0,f=f+Math.imul(I,ot)|0,i=i+Math.imul(A,st)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(S,st)|0,f=f+Math.imul(S,dt)|0,i=i+Math.imul(w,ht)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(M,ht)|0,f=f+Math.imul(M,ut)|0;var It=(d+(i=i+Math.imul(m,bt)|0)|0)+((8191&(n=(n=n+Math.imul(m,pt)|0)+Math.imul(g,bt)|0))<<13)|0;d=((f=f+Math.imul(g,pt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(q,Y),n=(n=Math.imul(q,G))+Math.imul(N,Y)|0,f=Math.imul(N,G),i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(U,Q)|0,f=f+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(j,rt)|0,f=f+Math.imul(j,it)|0,i=i+Math.imul(R,ft)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(k,ft)|0,f=f+Math.imul(k,ot)|0,i=i+Math.imul(x,st)|0,n=(n=n+Math.imul(x,dt)|0)+Math.imul(I,st)|0,f=f+Math.imul(I,dt)|0,i=i+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(S,ht)|0,f=f+Math.imul(S,ut)|0;var Bt=(d+(i=i+Math.imul(w,bt)|0)|0)+((8191&(n=(n=n+Math.imul(w,pt)|0)+Math.imul(M,bt)|0))<<13)|0;d=((f=f+Math.imul(M,pt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(q,Q),n=(n=Math.imul(q,tt))+Math.imul(N,Q)|0,f=Math.imul(N,tt),i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(U,rt)|0,f=f+Math.imul(U,it)|0,i=i+Math.imul(P,ft)|0,n=(n=n+Math.imul(P,ot)|0)+Math.imul(j,ft)|0,f=f+Math.imul(j,ot)|0,i=i+Math.imul(R,st)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(k,st)|0,f=f+Math.imul(k,dt)|0,i=i+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,ut)|0)+Math.imul(I,ht)|0,f=f+Math.imul(I,ut)|0;var Rt=(d+(i=i+Math.imul(A,bt)|0)|0)+((8191&(n=(n=n+Math.imul(A,pt)|0)+Math.imul(S,bt)|0))<<13)|0;d=((f=f+Math.imul(S,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(q,rt),n=(n=Math.imul(q,it))+Math.imul(N,rt)|0,f=Math.imul(N,it),i=i+Math.imul(T,ft)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(U,ft)|0,f=f+Math.imul(U,ot)|0,i=i+Math.imul(P,st)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(j,st)|0,f=f+Math.imul(j,dt)|0,i=i+Math.imul(R,ht)|0,n=(n=n+Math.imul(R,ut)|0)+Math.imul(k,ht)|0,f=f+Math.imul(k,ut)|0;var kt=(d+(i=i+Math.imul(x,bt)|0)|0)+((8191&(n=(n=n+Math.imul(x,pt)|0)+Math.imul(I,bt)|0))<<13)|0;d=((f=f+Math.imul(I,pt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(q,ft),n=(n=Math.imul(q,ot))+Math.imul(N,ft)|0,f=Math.imul(N,ot),i=i+Math.imul(T,st)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(U,st)|0,f=f+Math.imul(U,dt)|0,i=i+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,ut)|0)+Math.imul(j,ht)|0,f=f+Math.imul(j,ut)|0;var Ct=(d+(i=i+Math.imul(R,bt)|0)|0)+((8191&(n=(n=n+Math.imul(R,pt)|0)+Math.imul(k,bt)|0))<<13)|0;d=((f=f+Math.imul(k,pt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(q,st),n=(n=Math.imul(q,dt))+Math.imul(N,st)|0,f=Math.imul(N,dt),i=i+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ut)|0)+Math.imul(U,ht)|0,f=f+Math.imul(U,ut)|0;var Pt=(d+(i=i+Math.imul(P,bt)|0)|0)+((8191&(n=(n=n+Math.imul(P,pt)|0)+Math.imul(j,bt)|0))<<13)|0;d=((f=f+Math.imul(j,pt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(q,ht),n=(n=Math.imul(q,ut))+Math.imul(N,ht)|0,f=Math.imul(N,ut);var jt=(d+(i=i+Math.imul(T,bt)|0)|0)+((8191&(n=(n=n+Math.imul(T,pt)|0)+Math.imul(U,bt)|0))<<13)|0;d=((f=f+Math.imul(U,pt)|0)+(n>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Ot=(d+(i=Math.imul(q,bt))|0)+((8191&(n=(n=Math.imul(q,pt))+Math.imul(N,bt)|0))<<13)|0;return d=((f=Math.imul(N,pt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,s[0]=yt,s[1]=mt,s[2]=gt,s[3]=vt,s[4]=wt,s[5]=Mt,s[6]=_t,s[7]=At,s[8]=St,s[9]=Et,s[10]=xt,s[11]=It,s[12]=Bt,s[13]=Rt,s[14]=kt,s[15]=Ct,s[16]=Pt,s[17]=jt,s[18]=Ot,0!==d&&(s[19]=d,r.length++),r};function p(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(b=l),f.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,f=0;f>>26)|0)>>>26,o&=67108863}r.words[f]=a,i=o,o=n}return 0!==i?r.words[f]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=f.prototype._countBits(t)-1,i=0;i>=1;return i},y.prototype.permute=function(t,e,r,i,n,f){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&f,f>>>=13;for(o=2*e;o>=26,e+=n/67108864|0,e+=f>>>26,this.words[r]=67108863&f}return 0!==e&&(this.words[r]=e,this.length++),this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new f(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,f=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var f=t%26,o=Math.min((t-f)/26,this.length),a=67108863^67108863>>>f<o)for(this.length-=o,d=0;d=0&&(0!==c||d>=n);d--){var h=0|this.words[d];this.words[d]=c<<26-f|h>>>f,c=h&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},f.prototype.isubn=function(t){if(i("number"==typeof t),i(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 e=0;e>26)-(s/67108864|0),this.words[n+r]=67108863&f}for(;n>26,this.words[n+r]=67108863&f;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&f;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==e){(a=new f(null)).length=s+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var u=67108864*(0|i.words[n.length+h])+(0|i.words[n.length+h-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(n,u,h);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},f.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new f(0),mod:new f(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,a},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),f=r.cmp(i);return f<0||1===n&&0===f?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},f.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},f.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new f(1),o=new f(0),a=new f(0),s=new f(1),d=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var b=0,p=1;0==(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(c),s.isub(h)),a.iushrn(1),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(s)):(r.isub(e),a.isub(n),s.isub(o))}return{a,b:s,gcd:r.iushln(d)}},f.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new f(1),a=new f(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(e.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(e.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var h=0,u=1;0==(r.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(n=0===e.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(t),n},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var f=e;e=r,r=f}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return 0==(1&this.words[0])},f.prototype.isOdd=function(){return 1==(1&this.words[0])},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==f&&(this.words[o]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},f.prototype.gtn=function(t){return 1===this.cmpn(t)},f.prototype.gt=function(t){return 1===this.cmp(t)},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return-1===this.cmpn(t)},f.prototype.lt=function(t){return-1===this.cmp(t)},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return 0===this.cmpn(t)},f.prototype.eq=function(t){return 0===this.cmp(t)},f.red=function(t){return new A(t)},f.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new f(e,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=f._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new f(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)}g.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},n(v,g),v.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,f=o}f>>>=22,t.words[n-10]=f,0===f&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},f._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},A.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new f(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new f(1).toRed(this),s=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new f(2*c*c).toRed(this);0!==this.pow(c,d).cmp(s);)c.redIAdd(s);for(var h=this.pow(c,n),u=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),b=o;0!==l.cmp(a);){for(var p=l,y=0;0!==p.cmp(a);y++)p=p.redSqr();i(y=0;i--){for(var d=e.words[i],c=s-1;c>=0;c--){var h=d>>c&1;n!==r[0]&&(n=this.sqr(n)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===i&&0===c)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}s=26}return n},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},f.mont=function(t){return new S(t)},n(S,A),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),f=n;return n.cmp(this.m)>=0?f=n.isub(this.m):n.cmpn(0)<0&&(f=n.iadd(this.m)),f._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new f(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9931:(t,e,r)=>{var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{"use strict";const i=r(9742),n=r(645),f="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50;const o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return d(t,e,r)}function d(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let i=a(r);const n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return s.from(i,e,r);const n=function(t){if(s.isBuffer(t)){const e=0|b(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),a(t<0?0:0|b(t))}function u(t){const e=t.length<0?0:0|b(t.length),r=a(e);for(let i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return i?-1:J(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){let i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){const i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){let f,o=1,a=t.length,s=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,s/=2,r/=2}function d(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){let i=-1;for(f=r;fa&&(r=a-s),f=r;f>=0;f--){let r=!0;for(let i=0;in&&(i=n):i=n;const f=e.length;let o;for(i>f/2&&(i=f/2),o=0;o>8,n=r%256,f.push(n),f.push(i);return f}(e,t.length-r),t,r,i)}function E(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);const i=[];let n=e;for(;n239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,a,s;switch(o){case 1:e<128&&(f=e);break;case 2:r=t[n+1],128==(192&r)&&(s=(31&e)<<6|63&r,s>127&&(f=s));break;case 3:r=t[n+1],i=t[n+2],128==(192&r)&&128==(192&i)&&(s=(15&e)<<12|(63&r)<<6|63&i,s>2047&&(s<55296||s>57343)&&(f=s));break;case 4:r=t[n+1],i=t[n+2],a=t[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(s=(15&e)<<18|(63&r)<<12|(63&i)<<6|63&a,s>65535&&s<1114112&&(f=s))}}null===f?(f=65533,o=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=o}return function(t){const e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(i,n)}n+=e.length}return i},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},f&&(s.prototype[f]=s.prototype.inspect),s.prototype.compare=function(t,e,r,i,n){if(X(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;let f=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0);const a=Math.min(f,o),d=this.slice(i,n),c=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let f=!1;for(;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function B(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;ni)&&(r=i);let n="";for(let i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,i,n,f){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function O(t,e,r,i,n){F(e,i,n,t,r,7);let f=Number(e&BigInt(4294967295));t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function T(t,e,r,i,n){F(e,i,n,t,r,7);let f=Number(e&BigInt(4294967295));t[r+7]=f,f>>=8,t[r+6]=f,f>>=8,t[r+5]=f,f>>=8,t[r+4]=f;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function U(t,e,r,i,n,f){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(t,e,r,i,f){return e=+e,r>>>=0,f||U(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function q(t,e,r,i,f){return e=+e,r>>>=0,f||U(t,0,r,8),n.write(t,e,r,i,52,8),r+8}s.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||P(t,e,this.length);let i=this[t],n=1,f=0;for(;++f>>=0,e>>>=0,r||P(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=W((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,n=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(i)+(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=e*2**24+65536*this[++t]+256*this[++t]+this[++t],n=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(i)<>>=0,e>>>=0,r||P(t,e,this.length);let i=this[t],n=1,f=0;for(;++f=n&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let i=e,n=1,f=this[t+--i];for(;i>0&&(n*=256);)f+=this[t+--i]*n;return n*=128,f>=n&&(f-=Math.pow(2,8*e)),f},s.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=W((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const i=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(i)<>>=0,e||P(t,4,this.length),n.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),n.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),n.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),n.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=1,f=0;for(this[e]=255&t;++f>>=0,r>>>=0,i||j(this,t,e,r,Math.pow(2,8*r)-1,0);let n=r-1,f=1;for(this[e+n]=255&t;--n>=0&&(f*=256);)this[e+n]=t/f&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=W((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=W((function(t,e=0){return T(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=0,f=1,o=0;for(this[e]=255&t;++n>0)-o&255;return e+r},s.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){const i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}let n=r-1,f=1,o=0;for(this[e+n]=255&t;--n>=0&&(f*=256);)t<0&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/f>>0)-o&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=W((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=W((function(t,e=0){return T(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(t,e,r){return z(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return z(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,i){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function F(t,e,r,i,n,f){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(f+1)}${i}`:`>= -(2${i} ** ${8*(f+1)-1}${i}) and < 2 ** ${8*(f+1)-1}${i}`:`>= ${e}${i} and <= ${r}${i}`,new N.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(i,n,f)}function H(t,e){if("number"!=typeof t)throw new N.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new N.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}L("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),L("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),L("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=D(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=D(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function J(t,e){let r;e=e||1/0;const i=t.length;let n=null;const f=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&f.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&f.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&f.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&f.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;f.push(r)}else if(r<2048){if((e-=2)<0)break;f.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;f.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;f.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return f}function Z(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace($,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const G=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function W(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},4098:function(t,e){var r="undefined"!=typeof self?self:this,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),f="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function d(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function b(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function p(t){var e=new FileReader,r=b(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:f&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,e,r,i=l(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=b(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function M(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},M.error=function(){var t=new M(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];M.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new M(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function A(t,r){return new Promise((function(i,f){var o=new v(t,r);if(o.signal&&o.signal.aborted)return f(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new M(n,r))},a.onerror=function(){f(new TypeError("Network request failed"))},a.ontimeout=function(){f(new TypeError("Network request failed"))},a.onabort=function(){f(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",s)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}A.polyfill=!0,t.fetch||(t.fetch=A,t.Headers=u,t.Request=v,t.Response=M),e.Headers=u,e.Request=v,e.Response=M,e.fetch=A,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},6266:(t,e,r)=>{"use strict";var i=e;i.version=r(7519).i8,i.utils=r(953),i.rand=r(9931),i.curve=r(8254),i.curves=r(5427),i.ec=r(7954),i.eddsa=r(5980)},4918:(t,e,r)=>{"use strict";var i=r(3550),n=r(953),f=n.getNAF,o=n.getJSF,a=n.assert;function s(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function d(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),i=f(e,1,this._bitLength),n=(1<=o;c--)s=(s<<1)+i[c];d.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o=0;d--){for(var c=0;d>=0&&0===o[d];d--)c++;if(d>=0&&c++,s=s.dblp(c),d<0)break;var h=o[d];a(0!==h),s="affine"===t.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===t.type?s.toP():s},s.prototype._wnafMulAdd=function(t,e,r,i,n){var a,s,d,c=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(a=0;a=1;a-=2){var p=a-1,y=a;if(1===c[p]&&1===c[y]){var m=[e[p],null,null,e[y]];0===e[p].y.cmp(e[y].y)?(m[1]=e[p].add(e[y]),m[2]=e[p].toJ().mixedAdd(e[y].neg())):0===e[p].y.cmp(e[y].y.redNeg())?(m[1]=e[p].toJ().mixedAdd(e[y]),m[2]=e[p].add(e[y].neg())):(m[1]=e[p].toJ().mixedAdd(e[y]),m[2]=e[p].toJ().mixedAdd(e[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[p],r[y]);for(l=Math.max(v[0].length,l),u[p]=new Array(l),u[y]=new Array(l),s=0;s=0;a--){for(var S=0;a>=0;){var E=!0;for(s=0;s=0&&S++,_=_.dblp(S),a<0)break;for(s=0;s0?d=h[s][x-1>>1]:x<0&&(d=h[s][-x-1>>1].neg()),_="affine"===d.type?_.mixedAdd(d):_.add(d))}}for(a=0;a=Math.ceil((t.bitLength()+1)/e.step)},d.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n{"use strict";var i=r(953),n=r(3550),f=r(5717),o=r(4918),a=i.assert;function s(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new n(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function d(t,e,r,i,f){o.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(e,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=f&&new n(f,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}f(s,o),t.exports=s,s.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},s.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},s.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},s.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),f=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(f.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(e&&!s||!e&&s)&&(a=a.redNeg()),this.point(t,a)},s.prototype.pointFromY=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.c2),f=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(f.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},s.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},f(d,o.BasePoint),s.prototype.pointFromJSON=function(t){return d.fromJSON(this,t)},s.prototype.point=function(t,e,r,i){return new d(this,t,e,r,i)},d.fromJSON=function(t,e){return new d(t,e[0],e[1],e[2])},d.prototype.inspect=function(){return this.isInfinity()?"":""},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),f=i.redAdd(e),o=f.redSub(r),a=i.redSub(e),s=n.redMul(o),d=f.redMul(a),c=n.redMul(a),h=o.redMul(f);return this.curve.point(s,d,h,c)},d.prototype._projDbl=function(){var t,e,r,i,n,f,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var d=(i=this.curve._mulA(a)).redAdd(s);this.zOne?(t=o.redSub(a).redSub(s).redMul(d.redSub(this.curve.two)),e=d.redMul(i.redSub(s)),r=d.redSqr().redSub(d).redSub(d)):(n=this.z.redSqr(),f=d.redSub(n).redISub(n),t=o.redSub(a).redISub(s).redMul(f),e=d.redMul(i.redSub(s)),r=d.redMul(f))}else i=a.redAdd(s),n=this.curve._mulC(this.z).redSqr(),f=i.redSub(n).redSub(n),t=this.curve._mulC(o.redISub(i)).redMul(f),e=this.curve._mulC(i).redMul(a.redISub(s)),r=i.redMul(f);return this.curve.point(t,e,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),f=r.redSub(e),o=n.redSub(i),a=n.redAdd(i),s=r.redAdd(e),d=f.redMul(o),c=a.redMul(s),h=f.redMul(s),u=o.redMul(a);return this.curve.point(d,c,u,h)},d.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),f=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(f).redMul(o),s=n.redSub(a),d=n.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(f).redISub(o),h=i.redMul(s).redMul(c);return this.curve.twisted?(e=i.redMul(d).redMul(o.redSub(this.curve._mulA(f))),r=s.redMul(d)):(e=i.redMul(d).redMul(o.redSub(f)),r=this.curve._mulC(s).redMul(d)),this.curve.point(h,e,r)},d.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},d.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},d.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},d.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},d.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},8254:(t,e,r)=>{"use strict";var i=e;i.base=r(4918),i.short=r(6673),i.mont=r(2881),i.edwards=r(1138)},2881:(t,e,r)=>{"use strict";var i=r(3550),n=r(5717),f=r(4918),o=r(953);function a(t){f.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function s(t,e,r){f.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,f),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},n(s,f.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new s(this,t,e)},a.prototype.pointFromJSON=function(t){return s.fromJSON(this,t)},s.prototype.precompute=function(){},s.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},s.fromJSON=function(t,e){return new s(t,e[0],e[1]||t.one)},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},s.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),n=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},s.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),f=t.x.redSub(t.z).redMul(r),o=n.redMul(i),a=e.z.redMul(f.redAdd(o).redSqr()),s=e.x.redMul(f.redISub(o).redSqr());return this.curve.point(a,s)},s.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var f=n.length-1;f>=0;f--)0===n[f]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},s.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},s.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(t,e,r)=>{"use strict";var i=r(953),n=r(3550),f=r(5717),o=r(4918),a=i.assert;function s(t){o.call(this,"short",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(t,e,r,i){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(e,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,i){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(e,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}f(s,o),t.exports=s,s.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new n(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=(e=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(t.lambda)r=new n(t.lambda,16);else{var f=this._getEndoRoots(this.n);0===this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))?r=f[0]:(r=f[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new n(t.a,16),b:new n(t.b,16)}})):this._getEndoBasis(r)}}},s.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:n.mont(t),r=new n(2).toRed(e).redInvm(),i=r.redNeg(),f=new n(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(f).fromRed(),i.redSub(f).fromRed()]},s.prototype._getEndoBasis=function(t){for(var e,r,i,f,o,a,s,d,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=t,l=this.n.clone(),b=new n(1),p=new n(0),y=new n(0),m=new n(1),g=0;0!==u.cmpn(0);){var v=l.div(u);d=l.sub(v.mul(u)),c=y.sub(v.mul(b));var w=m.sub(v.mul(p));if(!i&&d.cmp(h)<0)e=s.neg(),r=b,i=d.neg(),f=c;else if(i&&2==++g)break;s=d,l=u,u=d,y=b,b=c,m=p,p=w}o=d.neg(),a=c;var M=i.sqr().add(f.sqr());return o.sqr().add(a.sqr()).cmp(M)>=0&&(o=e,a=r),i.negative&&(i=i.neg(),f=f.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:f},{a:o,b:a}]},s.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),f=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),a=f.mul(i.a),s=n.mul(r.b),d=f.mul(i.b);return{k1:t.sub(o).sub(a),k2:s.add(d).neg()}},s.prototype.pointFromX=function(t,e){(t=new n(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var f=i.fromRed().isOdd();return(e&&!f||!e&&f)&&(i=i.redNeg()),this.point(t,i)},s.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},s.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,f=0;f":""},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},d.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),f=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,o)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(t){return t=new n(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},d.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},d.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},d.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},d.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},f(c,o.BasePoint),s.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),f=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=i.redSub(n),s=f.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=a.redSqr(),c=d.redMul(a),h=i.redMul(d),u=s.redSqr().redIAdd(c).redISub(h).redISub(h),l=s.redMul(h.redISub(u)).redISub(f.redMul(c)),b=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(u,l,b)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,f=t.y.redMul(e).redMul(this.z),o=r.redSub(i),a=n.redSub(f);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=o.redSqr(),d=s.redMul(o),c=r.redMul(s),h=a.redSqr().redIAdd(d).redISub(c).redISub(c),u=a.redMul(c.redISub(h)).redISub(n.redMul(d)),l=this.z.redMul(o);return this.curve.jpoint(h,u,l)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:(t,e,r)=>{"use strict";var i,n=e,f=r(3715),o=r(8254),a=r(953).assert;function s(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function d(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new s(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=s,d("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:f.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),d("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:f.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),d("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:f.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),d("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:f.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),d("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:f.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),d("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["9"]}),d("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(1037)}catch(t){i=void 0}d("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:f.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},7954:(t,e,r)=>{"use strict";var i=r(3550),n=r(2156),f=r(953),o=r(5427),a=r(9931),s=f.assert,d=r(1251),c=r(611);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(s(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new d(this,t)},h.prototype.keyFromPrivate=function(t,e){return d.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return d.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new n({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),f=this.n.sub(new i(2));;){var o=new i(e.generate(r));if(!(o.cmp(f)>0))return o.iaddn(1),this.keyFromPrivate(o)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,f){"object"==typeof r&&(f=r,r=null),f||(f={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),s=t.toArray("be",o),d=new n({hash:this.hash,entropy:a,nonce:s,pers:f.pers,persEnc:f.persEnc||"utf8"}),h=this.n.sub(new i(1)),u=0;;u++){var l=f.k?f.k(u):new i(d.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var b=this.g.mul(l);if(!b.isInfinity()){var p=b.getX(),y=p.umod(this.n);if(0!==y.cmpn(0)){var m=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(b.getY().isOdd()?1:0)|(0!==p.cmp(y)?2:0);return f.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new c({r:y,s:m,recoveryParam:g})}}}}}},h.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var f=(e=new c(e,"hex")).r,o=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),d=s.mul(t).umod(this.n),h=s.mul(f).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(d,r.getPublic(),h)).isInfinity()&&a.eqXToP(f):!(a=this.g.mulAdd(d,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(f)},h.prototype.recoverPubKey=function(t,e,r,n){s((3&r)===r,"The recovery param is more than two bits"),e=new c(e,n);var f=this.n,o=new i(t),a=e.r,d=e.s,h=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),h):this.curve.pointFromX(a,h);var l=e.r.invm(f),b=f.sub(o).mul(l).umod(f),p=d.mul(l).umod(f);return this.g.mulAdd(b,a,p)},h.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new c(e,i)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var f;try{f=this.recoverPubKey(t,e,n)}catch(t){continue}if(f.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},1251:(t,e,r)=>{"use strict";var i=r(3550),n=r(953).assert;function f(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=f,f.fromPublic=function(t,e,r){return e instanceof f?e:new f(t,{pub:e,pubEnc:r})},f.fromPrivate=function(t,e,r){return e instanceof f?e:new f(t,{priv:e,privEnc:r})},f.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},f.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},f.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},f.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},f.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?n(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},f.prototype.derive=function(t){return t.validate()||n(t.validate(),"public point not validated"),t.mul(this.priv).getX()},f.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},f.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},f.prototype.inspect=function(){return""}},611:(t,e,r)=>{"use strict";var i=r(3550),n=r(953),f=n.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(f(t.r&&t.s,"Signature without r or s"),this.r=new i(t.r,16),this.s=new i(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function s(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,f=0,o=e.place;f>>=0;return!(n<=127)&&(e.place=o,n)}function d(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=o,o.prototype._importDER=function(t,e){t=n.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var f=s(t,r);if(!1===f)return!1;if(f+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=s(t,r);if(!1===o)return!1;var d=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var c=s(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var h=t.slice(r.place,c+r.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new i(d),this.s=new i(h),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=d(e),r=d(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];c(i,e.length),(i=i.concat(e)).push(2),c(i,r.length);var f=i.concat(r),o=[48];return c(o,f.length),o=o.concat(f),n.encode(o,t)}},5980:(t,e,r)=>{"use strict";var i=r(3715),n=r(5427),f=r(953),o=f.assert,a=f.parseBytes,s=r(9087),d=r(3622);function c(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=n[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}t.exports=c,c.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),f=this.encodePoint(n),o=this.hashInt(f,r.pubBytes(),t).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:f})},c.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),f=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(f)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{"use strict";var i=r(953),n=i.assert,f=i.parseBytes,o=i.cachedProperty;function a(t,e){this.eddsa=t,this._secret=f(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=f(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,i=e.slice(0,t.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),t)},a.prototype.getPublic=function(t){return i.encode(this.pubBytes(),t)},t.exports=a},3622:(t,e,r)=>{"use strict";var i=r(3550),n=r(953),f=n.assert,o=n.cachedProperty,a=n.parseBytes;function s(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),f(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(s,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(s,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(s,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(s,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),s.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},s.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=s},1037:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:(t,e,r)=>{"use strict";var i=e,n=r(3550),f=r(9746),o=r(4504);i.assert=f,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(t,e,r){var i=new Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-s:s,f.isubn(a)):a=0,i[o]=a,f.iushrn(1)}return i},i.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,f=0;t.cmpn(-n)>0||e.cmpn(-f)>0;){var o,a,s=t.andln(3)+n&3,d=e.andln(3)+f&3;3===s&&(s=-1),3===d&&(d=-1),o=0==(1&s)?0:3!=(i=t.andln(7)+n&7)&&5!==i||2!==d?s:-s,r[0].push(o),a=0==(1&d)?0:3!=(i=e.andln(7)+f&7)&&5!==i||2!==s?d:-d,r[1].push(a),2*n===o+1&&(n=1-n),2*f===a+1&&(f=1-f),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"==typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},7519:t=>{"use strict";t.exports={i8:"6.5.4"}},3715:(t,e,r)=>{var i=e;i.utils=r(6436),i.common=r(5772),i.sha=r(9041),i.ripemd=r(2949),i.hmac=r(2344),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},5772:(t,e,r)=>{"use strict";var i=r(6436),n=r(9746);function f(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=f,f.prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,f=8;f{"use strict";var i=r(6436),n=r(9746);function f(t,e,r){if(!(this instanceof f))return new f(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(e,r))}t.exports=f,f.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),n(t.length<=this.blockSize);for(var e=t.length;e{"use strict";var i=r(6436),n=r(5772),f=i.rotl32,o=i.sum32,a=i.sum32_3,s=i.sum32_4,d=n.BlockHash;function c(){if(!(this instanceof c))return new c;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function u(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}i.inherits(c,d),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],d=this.h[3],c=this.h[4],g=r,v=i,w=n,M=d,_=c,A=0;A<80;A++){var S=o(f(s(r,h(A,i,n,d),t[b[A]+e],u(A)),y[A]),c);r=c,c=d,d=f(n,10),n=i,i=S,S=o(f(s(g,h(79-A,v,w,M),t[p[A]+e],l(A)),m[A]),_),g=_,_=M,M=f(w,10),w=v,v=S}S=a(this.h[1],n,M),this.h[1]=a(this.h[2],d,_),this.h[2]=a(this.h[3],c,g),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],i,w),this.h[0]=S},c.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var b=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:(t,e,r)=>{"use strict";e.sha1=r(4761),e.sha224=r(799),e.sha256=r(9344),e.sha384=r(772),e.sha512=r(5900)},4761:(t,e,r)=>{"use strict";var i=r(6436),n=r(5772),f=r(7038),o=i.rotl32,a=i.sum32,s=i.sum32_5,d=f.ft_1,c=n.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(u,c),t.exports=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{"use strict";var i=r(6436),n=r(9344);function f(){if(!(this instanceof f))return new f;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(f,n),t.exports=f,f.blockSize=512,f.outSize=224,f.hmacStrength=192,f.padLength=64,f.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},9344:(t,e,r)=>{"use strict";var i=r(6436),n=r(5772),f=r(7038),o=r(9746),a=i.sum32,s=i.sum32_4,d=i.sum32_5,c=f.ch32,h=f.maj32,u=f.s0_256,l=f.s1_256,b=f.g0_256,p=f.g1_256,y=n.BlockHash,m=[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];function g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(g,y),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i{"use strict";var i=r(6436),n=r(5900);function f(){if(!(this instanceof f))return new f;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(f,n),t.exports=f,f.blockSize=1024,f.outSize=384,f.hmacStrength=192,f.padLength=128,f.prototype._digest=function(t){return"hex"===t?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},5900:(t,e,r)=>{"use strict";var i=r(6436),n=r(5772),f=r(9746),o=i.rotr64_hi,a=i.rotr64_lo,s=i.shr64_hi,d=i.shr64_lo,c=i.sum64,h=i.sum64_hi,u=i.sum64_lo,l=i.sum64_4_hi,b=i.sum64_4_lo,p=i.sum64_5_hi,y=i.sum64_5_lo,m=n.BlockHash,g=[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];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(t,e,r,i,n){var f=t&r^~t&n;return f<0&&(f+=4294967296),f}function M(t,e,r,i,n,f){var o=e&i^~e&f;return o<0&&(o+=4294967296),o}function _(t,e,r,i,n){var f=t&r^t&n^r&n;return f<0&&(f+=4294967296),f}function A(t,e,r,i,n,f){var o=e&i^e&f^i&f;return o<0&&(o+=4294967296),o}function S(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function I(t,e){var r=o(t,e,1)^o(t,e,8)^s(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,1)^a(t,e,8)^d(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,19)^a(e,t,29)^d(t,e,6);return r<0&&(r+=4294967296),r}i.inherits(v,m),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i{"use strict";var i=r(6436).rotr32;function n(t,e,r){return t&e^~t&r}function f(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?o(e,r,i):2===t?f(e,r,i):void 0},e.ch32=n,e.maj32=f,e.p32=o,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},6436:(t,e,r)=>{"use strict";var i=r(9746),n=r(5717);function f(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>6|192,r[i++]=63&o|128):f(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=f>>>16&255,r[n+2]=f>>>8&255,r[n+3]=255&f):(r[n+3]=f>>>24,r[n+2]=f>>>16&255,r[n+1]=f>>>8&255,r[n]=255&f)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],f=i+t[e+1]>>>0,o=(f>>0,t[e+1]=f},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,f,o,a){var s=0,d=e;return s+=(d=d+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,f,o,a){return e+i+f+a>>>0},e.sum64_5_hi=function(t,e,r,i,n,f,o,a,s,d){var c=0,h=e;return c+=(h=h+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,f,o,a,s,d){return e+i+f+a+d>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},9090:(t,e,r)=>{var i;!function(){"use strict";var e="object"==typeof window?window:{};!e.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);var n=!e.HI_BASE32_NO_COMMON_JS&&t.exports,f=r.amdO,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),a={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},s=[0,0,0,0,0,0,0,0],d=function(t,e){e.length>10&&(e="..."+e.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+t+" bytes: "+e+" <-");throw r.position=t,r},c=function(t){if(""===t)return[];if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");for(var e,r,i,n,f,o,s,d,c=[],h=0,u=(t=t.replace(/=/g,"")).length,l=0,b=u>>3<<3;l>>2),c[h++]=255&(r<<6|i<<1|n>>>4),c[h++]=255&(n<<4|f>>>1),c[h++]=255&(f<<7|o<<2|s>>>3),c[h++]=255&(s<<5|d);var p=u-b;return 2===p?(e=a[t.charAt(l++)],r=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2)):4===p?(e=a[t.charAt(l++)],r=a[t.charAt(l++)],i=a[t.charAt(l++)],n=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2),c[h++]=255&(r<<6|i<<1|n>>>4)):5===p?(e=a[t.charAt(l++)],r=a[t.charAt(l++)],i=a[t.charAt(l++)],n=a[t.charAt(l++)],f=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2),c[h++]=255&(r<<6|i<<1|n>>>4),c[h++]=255&(n<<4|f>>>1)):7===p&&(e=a[t.charAt(l++)],r=a[t.charAt(l++)],i=a[t.charAt(l++)],n=a[t.charAt(l++)],f=a[t.charAt(l++)],o=a[t.charAt(l++)],s=a[t.charAt(l++)],c[h++]=255&(e<<3|r>>>2),c[h++]=255&(r<<6|i<<1|n>>>4),c[h++]=255&(n<<4|f>>>1),c[h++]=255&(f<<7|o<<2|s>>>3)),c},h=function(t,e){if(!e)return function(t){for(var e,r,i="",n=t.length,f=0,o=0;f191&&e<=223?(r=31&e,o=1):e<=239?(r=15&e,o=2):e<=247?(r=7&e,o=3):d(f,i);for(var a=0;a191)&&d(f,i),r<<=6,r+=63&e;r>=55296&&r<=57343&&d(f,i),r>1114111&&d(f,i),r<=65535?i+=String.fromCharCode(r):(r-=65536,i+=String.fromCharCode(55296+(r>>10)),i+=String.fromCharCode(56320+(1023&r)))}return i}(c(t));if(""===t)return"";if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");var r,i,n,f,o,s,h,u,l="",b=t.indexOf("=");-1===b&&(b=t.length);for(var p=0,y=b>>3<<3;p>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))+String.fromCharCode(255&(f<<4|o>>>1))+String.fromCharCode(255&(o<<7|s<<2|h>>>3))+String.fromCharCode(255&(h<<5|u));var m=b-y;return 2===m?(r=a[t.charAt(p++)],i=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))):4===m?(r=a[t.charAt(p++)],i=a[t.charAt(p++)],n=a[t.charAt(p++)],f=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))):5===m?(r=a[t.charAt(p++)],i=a[t.charAt(p++)],n=a[t.charAt(p++)],f=a[t.charAt(p++)],o=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))+String.fromCharCode(255&(f<<4|o>>>1))):7===m&&(r=a[t.charAt(p++)],i=a[t.charAt(p++)],n=a[t.charAt(p++)],f=a[t.charAt(p++)],o=a[t.charAt(p++)],s=a[t.charAt(p++)],h=a[t.charAt(p++)],l+=String.fromCharCode(255&(r<<3|i>>>2))+String.fromCharCode(255&(i<<6|n<<1|f>>>4))+String.fromCharCode(255&(f<<4|o>>>1))+String.fromCharCode(255&(o<<7|s<<2|h>>>3))),l},u={encode:function(t,e){var r="string"!=typeof t;return r&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),r?function(t){for(var e,r,i,n,f,a="",s=t.length,d=0,c=5*parseInt(s/5);d>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|f>>>5)]+o[31&f];var h=s-c;return 1===h?(e=t[d],a+=o[e>>>3]+o[e<<2&31]+"======"):2===h?(e=t[d++],r=t[d],a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===h?(e=t[d++],r=t[d++],i=t[d],a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[i<<1&31]+"==="):4===h&&(e=t[d++],r=t[d++],i=t[d++],n=t[d],a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"="),a}(t):e?function(t){for(var e,r,i,n,f,a="",s=t.length,d=0,c=5*parseInt(s/5);d>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|f>>>5)]+o[31&f];var h=s-c;return 1===h?(e=t.charCodeAt(d),a+=o[e>>>3]+o[e<<2&31]+"======"):2===h?(e=t.charCodeAt(d++),r=t.charCodeAt(d),a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===h?(e=t.charCodeAt(d++),r=t.charCodeAt(d++),i=t.charCodeAt(d),a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[i<<1&31]+"==="):4===h&&(e=t.charCodeAt(d++),r=t.charCodeAt(d++),i=t.charCodeAt(d++),n=t.charCodeAt(d),a+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"="),a}(t):function(t){var e,r,i,n,f,a,d,c=!1,h="",u=0,l=0,b=t.length;if(""===t)return h;do{for(s[0]=s[5],s[1]=s[6],s[2]=s[7],d=l;u>6,s[d++]=128|63&a):a<55296||a>=57344?(s[d++]=224|a>>12,s[d++]=128|a>>6&63,s[d++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++u)),s[d++]=240|a>>18,s[d++]=128|a>>12&63,s[d++]=128|a>>6&63,s[d++]=128|63&a);l=d-5,u===b&&++u,u>b&&d<6&&(c=!0),e=s[0],d>4?(r=s[1],i=s[2],n=s[3],f=s[4],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|f>>>5)]+o[31&f]):1===d?h+=o[e>>>3]+o[e<<2&31]+"======":2===d?(r=s[1],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===d?(r=s[1],i=s[2],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[i<<1&31]+"==="):(r=s[1],i=s[2],n=s[3],h+=o[e>>>3]+o[31&(e<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|i>>>4)]+o[31&(i<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"=")}while(!c);return h}(t)},decode:h};h.asBytes=c,n?t.exports=u:(e.base32=u,f&&(void 0===(i=function(){return u}.call(u,r,u,t))||(t.exports=i)))}()},2156:(t,e,r)=>{"use strict";var i=r(3715),n=r(4504),f=r(9746);function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=n.toArray(t.entropy,t.entropyEnc||"hex"),r=n.toArray(t.nonce,t.nonceEnc||"hex"),i=n.toArray(t.pers,t.persEnc||"hex");f(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}t.exports=o,o.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var f=[];f.length{e.read=function(t,e,r,i,n){var f,o,a=8*n-i-1,s=(1<>1,c=-7,h=r?n-1:0,u=r?-1:1,l=t[e+h];for(h+=u,f=l&(1<<-c)-1,l>>=-c,c+=a;c>0;f=256*f+t[e+h],h+=u,c-=8);for(o=f&(1<<-c)-1,f>>=-c,c+=i;c>0;o=256*o+t[e+h],h+=u,c-=8);if(0===f)f=1-d;else{if(f===s)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,i),f-=d}return(l?-1:1)*o*Math.pow(2,f-i)},e.write=function(t,e,r,i,n,f){var o,a,s,d=8*f-n-1,c=(1<>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:f-1,b=i?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),(e+=o+h>=1?u/s:u*Math.pow(2,1-h))*s>=2&&(o++,s/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(e*s-1)*Math.pow(2,n),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[r+l]=255&a,l+=b,a/=256,n-=8);for(o=o<0;t[r+l]=255&o,l+=b,o/=256,d-=8);t[r+l-b]|=128*p}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},4504:(t,e)=>{"use strict";var r=e;function i(t){return 1===t.length?"0"+t:t}function n(t){for(var e="",r=0;r>8,o=255&n;f?r.push(f,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(t,e){return"hex"===e?n(t):t}},2399:(t,e,r)=>{"use strict";var i,n=r(8764),f=n.Buffer,o={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=n[i]);var a=o.Buffer={};for(i in f)f.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=f[i]);if(o.Buffer.prototype=f.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){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 f(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){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 i=f(t);return e&&0!==e.length?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(t){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o},6601:()=>{},9214:()=>{}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var f=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(f.exports,f,f.exports,r),f.loaded=!0,f.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";r.r(i),r.d(i,{getKeyId:()=>p,getPayloadHeader:()=>y,hashEndPoint:()=>R,hashPayload:()=>B,mapHeaders:()=>j,pack:()=>S,parseHeader:()=>m,resolveKey:()=>I,sign:()=>_,signAndPack:()=>E,unpack:()=>A,unpackAndVerify:()=>x,verify:()=>M,verifyEndPoint:()=>k});var t=r(6266),e=r(9809),n=r.n(e),f=r(9344),o=r.n(f),a=r(4098),s=r.n(a),d=r(9090),c=r.n(d);function h(t,e){return c().encode(t,e).replace(/=/g,"")}var u={},l={};async function b(t){const e=await s()(t);if(e.status>=400)throw new Error("Bad response from server");return await e.text()}async function p(t){if(u[t])return u[t];try{const e=await async function(t){const e=await s()(t);if(e.status>=400)throw new Error("Bad response from server");return await e.json()}("https://dns.google/resolve?name="+t+"&type=TXT");if(e.Answer){let r=e.Answer[0].data.replace(/\\n/g,"\n");if(r)return r.includes("-----BEGIN PUBLIC KEY-----")||(r="-----BEGIN PUBLIC KEY-----\n"+r+"\n-----END PUBLIC KEY-----\n"),u[t]={type:"DNS",key:r,debugPath:"https://dns.google/resolve?name="+t+"&type=TXT"},u[t]}}catch(t){}try{const e=await b("https://"+t);if(e.includes("-----BEGIN PUBLIC KEY-----"))return u[t]={type:"URL",key:e,debugPath:"https://"+t},u[t]}catch(t){}try{const e=t.split(".")[0],r=t.split(".")[1];let i=await b("https://raw.githubusercontent.com/Path-Check/paper-cred/main/keys/"+r+"/"+e+".pem");if(null!=i&&i.includes("-----BEGIN PUBLIC KEY-----"))return u[t]={type:"GITDB",key:i,debugPath:"https://github.com/Path-Check/paper-cred/tree/main/keys/"+r+"/"+e+".pem"},u[t]}catch(t){}}async function y(t,e){const r=t.toLowerCase()+"."+e;if(l[r])return l[r];try{return l[r]=await b("https://raw.githubusercontent.com/Path-Check/paper-cred/main/payloads/"+r+".fields"),l[r]}catch(t){return}}async function m(t){if(!t)return;let e=t.split("\n"),r=e[0].split("/"),i=new Map;for(let t=1;t=400)throw new Error("Bad response from server");const r=await e.arrayBuffer();return h(o()().update(r).digest())}async function k(t,e){return await R(t)===e}async function C(t,e){let r={},i=0;for(;t.length>0&&i