!function(e,r)“object”==typeof exports&&“object”==typeof module?module.exports=r():“function”==typeof define&&define.amd?define([],r):“object”==typeof exports?exports.XpringCommonJS=r():e.XpringCommonJS=r()}(“undefined”!=typeof self?self:this,(function(){return function(e){var r={};function t(o){if(r[o])return r[o].exports;var i=r[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:o})},t.r=function(e){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:“Module”}),Object.defineProperty(e,“__esModule”,{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&“object”==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,“default”,{enumerable:!0,value:e}),2&r&&“string”!=typeof e)for(var i in e)t.d(o,i,function®{return e[r]}.bind(null,i));return o},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,“a”,r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p=“”,t(t.s=128)}([function(e,r){e.exports=require(“crypto”)},function(e,r){const t={JOSEAlgNotWhitelisted:“ERR_JOSE_ALG_NOT_WHITELISTED”,JOSECritNotUnderstood:“ERR_JOSE_CRIT_NOT_UNDERSTOOD”,JOSEInvalidEncoding:“ERR_JOSE_INVALID_ENCODING”,JOSEMultiError:“ERR_JOSE_MULTIPLE_ERRORS”,JOSENotSupported:“ERR_JOSE_NOT_SUPPORTED”,JWEDecryptionFailed:“ERR_JWE_DECRYPTION_FAILED”,JWEInvalid:“ERR_JWE_INVALID”,JWKImportFailed:“ERR_JWK_IMPORT_FAILED”,JWKInvalid:“ERR_JWK_INVALID”,JWKKeySupport:“ERR_JWK_KEY_SUPPORT”,JWKSNoMatchingKey:“ERR_JWKS_NO_MATCHING_KEY”,JWSInvalid:“ERR_JWS_INVALID”,JWSVerificationFailed:“ERR_JWS_VERIFICATION_FAILED”,JWTClaimInvalid:“ERR_JWT_CLAIM_INVALID”,JWTExpired:“ERR_JWT_EXPIRED”,JWTMalformed:“ERR_JWT_MALFORMED”},o={JWEDecryptionFailed:“decryption operation failed”,JWEInvalid:“JWE invalid”,JWKSNoMatchingKey:“no matching key found in the KeyStore”,JWSInvalid:“JWS invalid”,JWSVerificationFailed:“signature verification failed”};class i extends Error{constructor(e){super(e),void 0===e&&(this.message=o[this.constructor.name]),this.name=this.constructor.name,this.code=t[this.constructor.name],Error.captureStackTrace(this,this.constructor)}}const n=e=>e instanceof a;class a extends i{constructor(e){let r;for(super();(r=e.findIndex(n))&&-1!==r;)e.splice(r,1,…e[r]);Object.defineProperty(this,“errors”,{value:e})}*[Symbol.iterator](){for(const e of this.errors)yield e}}e.exports.JOSEError=i,e.exports.JOSEAlgNotWhitelisted=class extends i{},e.exports.JOSECritNotUnderstood=class extends i{},e.exports.JOSEInvalidEncoding=class extends i{},e.exports.JOSEMultiError=a,e.exports.JOSENotSupported=class extends i{},e.exports.JWEDecryptionFailed=class extends i{},e.exports.JWEInvalid=class extends i{},e.exports.JWKImportFailed=class extends i{},e.exports.JWKInvalid=class extends i{},e.exports.JWKKeySupport=class extends i{},e.exports.JWKSNoMatchingKey=class extends i{},e.exports.JWSInvalid=class extends i{},e.exports.JWSVerificationFailed=class extends i{};class s extends i{constructor(e,r=“unspecified”,t=“unspecified”){super(e),this.claim=r,this.reason=t}}e.exports.JWTClaimInvalid=s,e.exports.JWTExpired=class extends s{},e.exports.JWTMalformed=class extends i{}},function(e,r){e.exports.KEYOBJECT=Symbol(“KEYOBJECT”),e.exports.PRIVATE_MEMBERS=Symbol(“PRIVATE_MEMBERS”),e.exports.PUBLIC_MEMBERS=Symbol(“PUBLIC_MEMBERS”),e.exports.THUMBPRINT_MATERIAL=Symbol(“THUMBPRINT_MATERIAL”),e.exports.JWK_MEMBERS=Symbol(“JWK_MEMBERS”),e.exports.KEY_MANAGEMENT_ENCRYPT=Symbol(“KEY_MANAGEMENT_ENCRYPT”),e.exports.KEY_MANAGEMENT_DECRYPT=Symbol(“KEY_MANAGEMENT_DECRYPT”);const t={sig:new Set([“sign”,“verify”]),enc:new Set([“encrypt”,“decrypt”,“wrapKey”,“unwrapKey”,“deriveKey”])},o=new Set([…t.sig,…t.enc]),i=new Set(Object.keys(t));e.exports.USES_MAPPING=t,e.exports.OPS=o,e.exports.USES=i},function(e,r){e.exports=require(“util”)},function(e,r,t){const{keyObjectSupported:o}=t(6);let i,n,a,s,u;if(o)({createPublicKey:i,createPrivateKey:n,createSecretKey:a,KeyObject:s}=t(0)),u=e=>e;else{const{EOL:e}=t(27),r=t(1),o=t(8),l=t(73),c=Symbol(“toInput”),p=Symbol(“namedCurve”);u=(e,r)=>e instanceof s?e[c]®:a(e)[c]®;const g=e=>Buffer.from(e.replace(/(?:—–(?:BEGIN|END)(?: (?:RSA|EC))? (?:PRIVATE|PUBLIC) KEY—–|s)/g,“”),“base64”),d=(r,t)=>`—–BEGIN ${t}—–${e}${(r.toString(“base64”).match(/.{1,64}/g)||[]).join(e)}${e}—–END ${t}—–`,f=e=>{const t=“string”==typeof e?e:“OID ”+e.join(“.”);throw new r.JOSENotSupported(t+“ is not supported in your Node.js runtime version”)};s=class{export({cipher:e,passphrase:t,type:o,format:i}={}){if(“secret”===this._type)return this._buffer;if(“public”===this._type){if(“rsa”===this.asymmetricKeyType)switch(o){case“pkcs1”:return“pem”===i?this._pem:g(this._pem);case“spki”:{const e=l.get(“PublicKeyInfo”).encode({algorithm:{algorithm:“rsaEncryption”,parameters:{type:“null”}},publicKey:{unused:0,data:g(this._pem)}},“pem”,{label:“PUBLIC KEY”});return“pem”===i?e:g(e)}default:throw new TypeError(`The value ${o} is invalid for option “type”`)}if(“ec”===this.asymmetricKeyType){if(“spki”!==o)throw new TypeError(`The value ${o} is invalid for option “type”`);return“pem”===i?this._pem:g(this._pem)}}if(“private”===this._type){if(void 0!==t||void 0!==e)throw new r.JOSENotSupported(“encrypted private keys are not supported in your Node.js runtime version”);if(“pkcs8”===o){if(this._pkcs8)return“der”===i&&“string”==typeof this._pkcs8?g(this._pkcs8):“pem”===i&&Buffer.isBuffer(this._pkcs8)?d(this._pkcs8,“PRIVATE KEY”):this._pkcs8;if(“rsa”===this.asymmetricKeyType){const e=this._asn1,r=l.get(“RSAPrivateKey”).encode(e),t=l.get(“PrivateKeyInfo”).encode({version:0,privateKey:r,algorithm:{algorithm:“rsaEncryption”,parameters:{type:“null”}}});return this._pkcs8=t,this.export({type:o,format:i})}if(“ec”===this.asymmetricKeyType){const e=this._asn1,r=l.get(“ECPrivateKey”).encode({version:e.version,privateKey:e.privateKey,publicKey:e.publicKey}),t=l.get(“PrivateKeyInfo”).encode({version:0,privateKey:r,algorithm:{algorithm:“ecPublicKey”,parameters:this._asn1.parameters}});return this._pkcs8=t,this.export({type:o,format:i})}}if(“rsa”===this.asymmetricKeyType&&“pkcs1”===o)return“pem”===i?this._pem:g(this._pem);if(“ec”===this.asymmetricKeyType&&“sec1”===o)return“pem”===i?this._pem:g(this._pem);throw new TypeError(`The value ${o} is invalid for option “type”`)}}get type(){return this._type}get asymmetricKeyType(){return this._asymmetricKeyType}get symmetricKeySize(){return this._symmetricKeySize(e)switch(this._type){case“secret”:return this._buffer;case“public”:return this._pem;default:return e?(“_pub”in this||(this._pub=i(this)),this._pub[c](!1)):this._pem}}},a=e=>{if(!Buffer.isBuffer(e)||!e.length)throw new TypeError(“input must be a non-empty Buffer instance”);const r=new s;return r._buffer=Buffer.from(e),r._symmetricKeySize=e.length,r._type=“secret”,r},i=e=>{if(e instanceof s){if(“private”!==e.type)throw new TypeError(`Invalid key object type ${e.type}, expected private.`);switch(e.asymmetricKeyType){case“ec”:{const r=l.get(“PublicKeyInfo”).encode({algorithm:{algorithm:“ecPublicKey”,parameters:e._asn1.parameters},publicKey:e._asn1.publicKey});return i({key:r,format:“der”,type:“spki”})}case“rsa”:{const r=l.get(“RSAPublicKey”).encode(e._asn1);return i({key:r,format:“der”,type:“pkcs1”})}}}if((“string”==typeof e||Buffer.isBuffer(e))&&(e={key:e,format:“pem”}),!o(e))throw new TypeError(“input must be a string, Buffer or an object”);const{format:t,passphrase:a}=e;let u,{key:c,type:p}=e;if(“string”!=typeof c&&!Buffer.isBuffer©)throw new TypeError(“key must be a string or Buffer”);if(“pem”!==t&&“der”!==t)throw new TypeError(‘format must be one of “pem” or “der”’);if(“pem”===t)switch(c=c.toString(),c.split(/r?n/g)[0].toString()){case“—–BEGIN PUBLIC KEY—–”:p=“spki”,u=“PUBLIC KEY”;break;case“—–BEGIN RSA PUBLIC KEY—–”:p=“pkcs1”,u=“RSA PUBLIC KEY”;break;case“—–BEGIN CERTIFICATE—–”:throw new r.JOSENotSupported(“X.509 certificates are not supported in your Node.js runtime version”);case“—–BEGIN PRIVATE KEY—–”:case“—–BEGIN EC PRIVATE KEY—–”:case“—–BEGIN RSA PRIVATE KEY—–”:return i(n©);default:throw new TypeError(“unknown/unsupported PEM type”)}switch(p){case“spki”:{const e=l.get(“PublicKeyInfo”),r=e.decode(c,t,{label:u});let o,n;switch(r.algorithm.algorithm){case“ecPublicKey”:n=new s,n._asn1=r,n._asymmetricKeyType=“ec”,n._type=“public”,n._pem=e.encode(r,“pem”,{label:“PUBLIC KEY”});break;case“rsaEncryption”:o=“pkcs1”,n=i({type:o,key:r.publicKey.data,format:“der”});break;default:f(r.algorithm.algorithm)}return n}case“pkcs1”:{const e=l.get(“RSAPublicKey”),r=e.decode(c,t,{label:u});if(r.n===BigInt(0))return i(n({key:c,format:t,type:p,passphrase:a}));const o=new s;return o._asn1=r,o._asymmetricKeyType=“rsa”,o._type=“public”,o._pem=e.encode(r,“pem”,{label:“RSA PUBLIC KEY”}),o}case“pkcs8”:case“sec1”:return i(n({format:t,key:c,type:p,passphrase:a}));default:throw new TypeError(`The value ${p} is invalid for option “type”`)}},n=(e,t)=>{if((“string”==typeof e||Buffer.isBuffer(e))&&(e={key:e,format:“pem”}),!o(e))throw new TypeError(“input must be a string, Buffer or an object”);const{format:i,passphrase:a}=e;let u,{key:c,type:g}=e;if(“string”!=typeof c&&!Buffer.isBuffer©)throw new TypeError(“key must be a string or Buffer”);if(void 0!==a)throw new r.JOSENotSupported(“encrypted private keys are not supported in your Node.js runtime version”);if(“pem”!==i&&“der”!==i)throw new TypeError(‘format must be one of “pem” or “der”’);if(“pem”===i)switch(c=c.toString(),c.split(/r?n/g)[0].toString()){case“—–BEGIN PRIVATE KEY—–”:g=“pkcs8”,u=“PRIVATE KEY”;break;case“—–BEGIN EC PRIVATE KEY—–”:g=“sec1”,u=“EC PRIVATE KEY”;break;case“—–BEGIN RSA PRIVATE KEY—–”:g=“pkcs1”,u=“RSA PRIVATE KEY”;break;default:throw new TypeError(“unknown/unsupported PEM type”)}switch(g){case“pkcs8”:{const e=l.get(“PrivateKeyInfo”).decode(c,i,{label:u});let r,t;switch(e.algorithm.algorithm){case“ecPublicKey”:r=“sec1”,t=n({type:r,key:e.privateKey,format:“der”},{[p]:e.algorithm.parameters.value});break;case“rsaEncryption”:r=“pkcs1”,t=n({type:r,key:e.privateKey,format:“der”});break;default:f(e.algorithm.algorithm)}return t._pkcs8=c,t}case“pkcs1”:{const e=l.get(“RSAPrivateKey”),r=e.decode(c,i,{label:u}),t=new s;return t._asn1=r,t._asymmetricKeyType=“rsa”,t._type=“private”,t._pem=e.encode(r,“pem”,{label:“RSA PRIVATE KEY”}),t}case“sec1”:{const e=l.get(“ECPrivateKey”);let r=e.decode(c,i,{label:u});if(!(“parameters”in r)&&!t[p])throw new Error(“invalid sec1”);“parameters”in r||(r={…r,parameters:{type:“namedCurve”,value:t[p]}});const o=new s;return o._asn1=r,o._asymmetricKeyType=“ec”,o._type=“private”,o._pem=e.encode(r,“pem”,{label:“EC PRIVATE KEY”}),o}default:throw new TypeError(`The value ${g} is invalid for option “type”`)}}}e.exports={createPublicKey:i,createPrivateKey:n,createSecretKey:a,KeyObject:s,asInput:u}},function(e,r){const t=e=>e.replace(/=/g,“”).replace(/+/g,“-”).replace(///g,“_”),o=(e,r=“utf8”)=>t(Buffer.from(e,r).toString(“base64”)),i=e=>t(e.toString(“base64”)),n=e=>Buffer.from(e,“base64”),a=(e,r=“utf8”)=>n(e).toString®,s={encode:e=>o(JSON.stringify(e)),decode:(e,r=“utf8”)=>JSON.parse(a(e,r))};s.decode.try=(e,r=“utf8”)=>{try{return s.decode(e,r)}catch(t){return a(e,r)}};e.exports.decode=a,e.exports.decodeToBuffer=n,e.exports.encode=o,e.exports.encodeBuffer=i,e.exports.JSON=s,e.exports.encodeBigInt=e=>i(Buffer.from((e=>{let r=BigInt(e).toString(16);r.length%2&&(r=“0”+r);const t=r.length/2,o=new Uint8Array(t);let i=0,n=0;for(;iparseInt(e,10));e.exports={oaepHashSupported:s>12||12===s&&u>=9,keyObjectSupported:!!i&&s>=12,edDSASupported:!!n&&!!a,dsaEncodingSupported:s>13||13===s&&u>=2||12===s&&u>=16,improvedDH:!!o}},function(e,r,t){“use strict”;var o=r,i=t(13),n=t(15),a=t(104);o.assert=n,o.toArray=a.toArray,o.zero2=a.zero2,o.toHex=a.toHex,o.encode=a.encode,o.getNAF=function(e,r,t){var o=new Array(Math.max(e.bitLength(),t)+1);o.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,n.isubn(s)):s=0,o[a]=s,n.iushrn(1)}return o},o.getJSF=function(e,r){var t=[[],[]];e=e.clone(),r=r.clone();for(var o=0,i=0;e.cmpn(-o)>0||r.cmpn(-i)>0;){var n,a,s,u=e.andln(3)+o&3,l=r.andln(3)+i&3;if(3===u&&(u=-1),3===l&&(l=-1),0==(1&u))n=0;else n=3!==(s=e.andln(7)+o&7)&&5!==s||2!==l?u:-u;if(t[0].push(n),0==(1&l))a=0;else a=3!==(s=r.andln(7)+i&7)&&5!==s||2!==u?l:-l;t[1].push(a),2*o===n+1&&(o=1-o),2*i===a+1&&(i=1-i),e.iushrn(1),r.iushrn(1)}return t},o.cachedProperty=function(e,r,t){var o=“_”+r;e.prototype[r]=function(){return void 0!==this[o]?this[o]:this[o]=t.call(this)}},o.parseBytes=function(e){return“string”==typeof e?o.toArray(e,“hex”):e},o.intFromLE=function(e){return new i(e,“hex”,“le”)}},function(e,r){e.exports=e=>!!e&&e.constructor===Object},function(e,r){e.exports=require(“assert”)},function(e,r,t){“use strict”;var o=t(15),i=t(35);function n(e,r){return 55296==(64512&e.charCodeAt®)&&(!(r<0||r+1>=e.length)&&56320==(64512&e.charCodeAt(r+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?“0”+e:e}function u(e){return 7===e.length?“0”+e:6===e.length?“00”+e:5===e.length?“000”+e:4===e.length?“0000”+e:3===e.length?“00000”+e:2===e.length?“000000”+e:1===e.length?“0000000”+e:e}r.inherits=i,r.toArray=function(e,r){if(Array.isArray(e))return e.slice();if(!e)return[];var t=[];if(“string”==typeof e)if®{if(“hex”===r)for((e=e.replace(/[^a-z0-9]+/gi,“”)).length%2!=0&&(e=“0”+e),i=0;i>6|192,t[o++]=63&a|128):n(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),t[o++]=a>>18|240,t[o++]=a>>12&63|128,t[o++]=a>>6&63|128,t[o++]=63&a|128):(t[o++]=a>>12|224,t[o++]=a>>6&63|128,t[o++]=63&a|128)}else for(i=0;i>>0}return a},r.split32=function(e,r){for(var t=new Array(4*e.length),o=0,i=0;o>>24,t[i+1]=n>>>16&255,t[i+2]=n>>>8&255,t[i+3]=255&n):(t[i+3]=n>>>24,t[i+2]=n>>>16&255,t[i+1]=n>>>8&255,t[i]=255&n)}return t},r.rotr32=function(e,r){return e>>>r|e<<32-r},r.rotl32=function(e,r){return e<>>32-r},r.sum32=function(e,r){return e+r>>>0},r.sum32_3=function(e,r,t){return e+r+t>>>0},r.sum32_4=function(e,r,t,o){return e+r+t+o>>>0},r.sum32_5=function(e,r,t,o,i){return e+r+t+o+i>>>0},r.sum64=function(e,r,t,o){var i=e[r],n=o+e[r+1]>>>0,a=(n>>0,e[r+1]=n},r.sum64_hi=function(e,r,t,o){return(r+o>>>0>>0},r.sum64_lo=function(e,r,t,o){return r+o>>>0},r.sum64_4_hi=function(e,r,t,o,i,n,a,s){var u=0,l=r;return u+=(l=l+o>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,r,t,o,i,n,a,s){return r+o+n+s>>>0},r.sum64_5_hi=function(e,r,t,o,i,n,a,s,u,l){var c=0,p=r;return c+=(p=p+o>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,r,t,o,i,n,a,s,u,l){return r+o+n+s+l>>>0},r.rotr64_hi=function(e,r,t){return(r<<32-t|e>>>t)>>>0},r.rotr64_lo=function(e,r,t){return(e<<32-t|r>>>t)>>>0},r.shr64_hi=function(e,r,t){return e>>>t},r.shr64_lo=function(e,r,t){return(e<<32-t|r>>>t)>>>0}},function(e,r,t){const o=t(136),i=t(137),n=t(138),a=t(139),s=t(140),u=t(141),l=t(142);e.exports={EC_CURVES:o,ECDH_DERIVE_LENGTHS:l,IVLENGTHS:i,JWA:n,JWK:a,KEYLENGTHS:s,OKP_CURVES:u}},function(e,r,t){const{strict:o}=t(9),{inspect:i}=t(3),{EOL:n}=t(27),{keyObjectSupported:a}=t(6),{createPublicKey:s}=t(4),{keyObjectToJWK:u}=t(79),{THUMBPRINT_MATERIAL:l,PUBLIC_MEMBERS:c,PRIVATE_MEMBERS:p,JWK_MEMBERS:g,KEYOBJECT:d,USES_MAPPING:f,OPS:h,USES:y}=t(2),m=t(8),v=t(158),b=t(1),S=Symbol(“privateApi”),{JWK:_}=t(11);class w{constructor(e,{alg:r,use:t,kid:i,key_ops:u,x5c:c,x5t:p,“x5t#S256”:g}={}){if(void 0!==t&&(“string”!=typeof t||!y.has(t)))throw new TypeError(‘`use` must be either “sig” or “enc” string when provided’);if(void 0!==r&&(“string”!=typeof r||!r))throw new TypeError(“`alg` must be a non-empty string when provided”);if(void 0!==i&&(“string”!=typeof i||!i))throw new TypeError(“`kid` must be a non-empty string when provided”);if(void 0!==u){if(!Array.isArray(u)||!u.length||u.some(e=>“string”!=typeof e))throw new TypeError(“`key_ops` must be a non-empty array of strings when provided”);u=Array.from(new Set(u)).filter(e=>h.has(e))}if(u&&t&&(“enc”===t&&u.some(e=>f.sig.has(e))||“sig”===t&&u.some(e=>f.enc.has(e))))throw new b.JWKInvalid(‘inconsistent JWK “use” and “key_ops”’);if(a&&void 0!==c){if(!Array.isArray©||!c.length||c.some(e=>“string”!=typeof e))throw new TypeError(“`x5c` must be an array of one or more PKIX certificates when provided”);c.forEach((r,t)=>{let i;try{i=s({key:`—–BEGIN CERTIFICATE—–${n}${(r.match(/.{1,64}/g)||[]).join(n)}${n}—–END CERTIFICATE—–`,format:“pem”})}catch(e){throw new b.JWKInvalid(``x5c` member at index ${t} is not a valid base64-encoded DER PKIX certificate`)}if(0===t)try{o.deepEqual(i.export({type:“spki”,format:“der”}),(“public”===e.type?e:s(e)).export({type:“spki”,format:“der”}))}catch(e){throw new b.JWKInvalid(“The key in the first `x5c` certificate MUST match the public key represented by the JWK”)}})}Object.defineProperties(this,{[d]:{value:m(e)?void 0:e},keyObject:{get(){if(!a)throw new b.JOSENotSupported(“KeyObject class is not supported in your Node.js runtime version”);return this[d]}},type:{value:e.type},private:{value:“private”===e.type},public:{value:“public”===e.type},secret:{value:“secret”===e.type},alg:{value:r,enumerable:void 0!==r},use:{value:t,enumerable:void 0!==t},x5c:{enumerable:void 0!==c,…c?{get:()=>[…c]}:{value:void 0}},key_ops:{enumerable:void 0!==u,…u?{get:()=>[…u]}:{value:void 0}},kid:{enumerable:!0,…i?{value:i}:{get(){return Object.defineProperty(this,“kid”,{value:this.thumbprint,configurable:!1}),this.kid},configurable:!0}},…c?{x5t:{enumerable:!0,…p?{value:p}:{get(){return Object.defineProperty(this,“x5t”,{value:v.x5t(this.x5c[0]),configurable:!1}),this.x5t},configurable:!0}}}:void 0,…c?{“x5t#S256”:{enumerable:!0,…g?{value:g}:{get(){return Object.defineProperty(this,“x5t#S256”,{value:v[“x5t#S256”](this.x5c[0]),configurable:!1}),this[“x5t#S256”]},configurable:!0}}}:void 0,thumbprint:{get(){return Object.defineProperty(this,“thumbprint”,{value:v.kid(this[l]()),configurable:!1}),this.thumbprint},configurable:!0}})}toPEM(e=!1,r={}){if(this.secret)throw new TypeError(“symmetric keys cannot be exported as PEM”);if(e&&!0===this.public)throw new TypeError(“public key cannot be exported as private”);const{type:t=(e?“pkcs8”:“spki”),cipher:o,passphrase:i}=r;let n=this[d];if(!e&&(this.private&&(n=s(n)),o||i))throw new TypeError(“cipher and passphrase can only be applied when exporting private keys”);return e?n.export({format:“pem”,type:t,cipher:o,passphrase:i}):n.export({format:“pem”,type:t})}toJWK(e=!1){if(e&&!0===this.public)throw new TypeError(“public key cannot be exported as private”);const r=[…this.constructor[e?p:c]].map(e=>[e,this[e]]),t={};return Object.keys®.forEach(e=>{const[o,i]=r[e];t[o]=i}),t.kty=this.kty,t.kid=this.kid,this.alg&&(t.alg=this.alg),this.key_ops&&this.key_ops.length&&(t.key_ops=this.key_ops),this.use&&(t.use=this.use),this.x5c&&(t.x5c=this.x5c),this.x5t&&(t.x5t=this.x5t),this[“x5t#S256”]&&(t[“x5t#S256”]=this[“x5t#S256”]),t()const e=“private”===this[d].type?this.constructor[p]:this.constructor[c];Object.defineProperties(this,[…e].reduce((r,t)=>(r[t]={get(){const r=u(this[d]);return Object.defineProperties(this,Object.entries®.filter(([r])=>e.has®).reduce((e,[r,t])=>(e[r]={value:t,enumerable:this.constructor[c].has®,configurable:!1},e),{})),this[t]},enumerable:this.constructor[c].has(t),configurable:!0},r),{}))()return`${this.constructor.name} ${i(this.toJWK(!1),{depth:1/0,colors:process.stdout.isTTY,compact:!1,sorted:!0})}`(){throw new Error(‘“[THUMBPRINT_MATERIAL]()” is not implemented on ’+this.constructor.name)}algorithms(e,r,t){const{use:o=this.use,alg:i=this.alg,key_ops:n=this.key_ops}=r===S?t:{};if(i)return new Set(this.algorithms(e,S,{alg:null,use:o,key_ops:n}).has(i)?[i]:void 0);if(“symbol”==typeof e)try{return this[e]()}catch(e){return new Set}if(e&&n&&!n.includes(e))return new Set;switch(e){case“decrypt”:case“deriveKey”:case“encrypt”:case“sign”:case“unwrapKey”:case“verify”:case“wrapKey”:return new Set(Object.entries(_[this.kty][e]).map(([e,r])=>r(this)?e:void 0).filter(Boolean));case void 0:return new Set([…this.algorithms(“sign”),…this.algorithms(“verify”),…this.algorithms(“decrypt”),…this.algorithms(“encrypt”),…this.algorithms(“unwrapKey”),…this.algorithms(“wrapKey”),…this.algorithms(“deriveKey”)]);default:throw new TypeError(“invalid key operation”)}}static async generate(){throw new Error(‘“static async generate()” is not implemented on ’+this.name)}static generateSync(){throw new Error(‘“static generateSync()” is not implemented on ’+this.name)}static get[c](){throw new Error(‘“static get [PUBLIC_MEMBERS]()” is not implemented on ’+this.name)}static get[p](){throw new Error(‘“static get [PRIVATE_MEMBERS]()” is not implemented on ’+this.name)}}e.exports=w},function(e,r,t){(function(e){!function(e,r){“use strict”;function o(e,r){if(!e)throw new Error(r||“Assertion failed”)}function i(e,r){e.super_=r;var t=function(){};t.prototype=r.prototype,e.prototype=new t,e.prototype.constructor=e}function n(e,r,t){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(“le”!==r&&“be”!==r||(t=r,r=10),this._init(e||0,r||10,t||“be”))}var a;“object”==typeof e?e.exports=n:r.BN=n,n.BN=n,n.wordSize=26;try{a=t(33).Buffer}catch(e){}function s(e,r,t){for(var o=0,i=Math.min(e.length,t),n=r;n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return o}function u(e,r,t,o){for(var i=0,n=Math.min(e.length,t),a=r;a=49?s-49+10:s>=17?s-17+10:s}return i}n.isBN=function(e){return e instanceof n||null!==e&&“object”==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp®>0?e:r},n.min=function(e,r){return e.cmp®<0?e:r},n.prototype._init=function(e,r,t){if("number"==typeof e)return this._initNumber(e,r,t);if("object"==typeof e)return this._initArray(e,r,t);"hex"===r&&(r=16),o(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===r?this._parseHex(e,i):this._parseBase(e,r,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===t&&this._initArray(this.toArray(),r,t)},n.prototype._initNumber=function(e,r,t){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(o(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===t&&this._initArray(this.toArray(),r,t)},n.prototype._initArray=function(e,r,t){if(o("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[n]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if(“le”===t)for(i=0,n=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},n.prototype._parseHex=function(e,r){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var t=0;t=r;t-=6)i=s(e,t,t+6),this.words[o]|=i<>>26-n&4194303,(n+=24)>=26&&(n-=26,o++);t+6!==r&&(i=s(e,r,t+6),this.words[o]|=i<>>26-n&4194303),this.strip()},n.prototype._parseBase=function(e,r,t){this.words=[0],this.length=1;for(var o=0,i=1;i<=67108863;i*=r)o++;o--,i=i/r|0;for(var n=e.length-t,a=n%o,s=Math.min(n,n-a)+t,l=0,c=t;c1&&0===this.words[this.length-1];)this.length–;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?“”};var l=[“”,“0”,“00”,“000”,“0000”,“00000”,“000000”,“0000000”,“00000000”,“000000000”,“0000000000”,“00000000000”,“000000000000”,“0000000000000”,“00000000000000”,“000000000000000”,“0000000000000000”,“00000000000000000”,“000000000000000000”,“0000000000000000000”,“00000000000000000000”,“000000000000000000000”,“0000000000000000000000”,“00000000000000000000000”,“000000000000000000000000”,“0000000000000000000000000”],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[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 g(e,r,t){t.negative=r.negative^e.negative;var o=e.length+r.length|0;t.length=o,o=o-1|0;var i=0|e.words[0],n=0|r.words[0],a=i*n,s=67108863&a,u=a/67108864|0;t.words[0]=s;for(var l=1;l>>26,p=67108863&u,g=Math.min(l,r.length-1),d=Math.max(0,l-e.length+1);d<=g;d++){var f=l-d|0;c+=(a=(i=0|e.words[f])*(n=0|r.words[d])+p)/67108864|0,p=67108863&a}t.words[l]=0|p,u=0|c}return 0!==u?t.words[l]=0|u:t.length--,t.strip()}n.prototype.toString=function(e,r){var t;if(r=0|r||1,16===(e=e||10)||"hex"===e){t="";for(var i=0,n=0,a=0;a>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+t:u+t,(i+=2)>=26&&(i-=26,a–)}for(0!==n&&(t=n.toString(16)+t);t.length%r!=0;)t=“0”+t;return 0!==this.negative&&(t=“-”+t),t}if(e===(0|e)&&e>=2&&e<=36){var g=c[e],d=p[e];t="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modn(d).toString(e);t=(f=f.idivn(d)).isZero()?h+t:l[g-h.length]+h+t}for(this.isZero()&&(t="0"+t);t.length%r!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}o(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,“Number can only safely store up to 53 bits”),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return o(void 0!==a),this.toArrayLike(a,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,t){var i=this.byteLength(),n=t||Math.max(1,i);o(i<=n,"byte array longer than desired length"),o(n>0,“Requested array length <= 0"),this.strip();var a,s,u="le"===r,l=new e(n),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s=4096&&(t+=13,r>>>=13),r>=64&&(t+=7,r>>>=7),r>=8&&(t+=4,r>>>=4),r>=2&&(t+=2,r>>>=2),t+r},n.prototype._zeroBits=function(e){if(0===e)return 26;var r=e,t=0;return 0==(8191&r)&&(t+=13,r>>>=13),0==(127&r)&&(t+=7,r>>>=7),0==(15&r)&&(t+=4,r>>>=4),0==(3&r)&&(t+=2,r>>>=2),0==(1&r)&&t++,t},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return 26*(this.length-1)+r},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;re.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;r=this.length>e.length?e:this;for(var t=0;te.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,t;this.length>e.length?(r=this,t=e):(r=e,t=this);for(var o=0;oe.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){o(”number“==typeof e&&e>=0);var r=0|Math.ceil(e/26),t=e%26;this._expand®,t>0&&r–;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-t),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){o(”number“==typeof e&&e>=0);var t=e/26|0,i=e%26;return this._expand(t+1),this.words[t]=r?this.words[t]|1<e.length?(t=this,o=e):(t=e,o=this);for(var i=0,n=0;n>>26;for(;0!==i&&n>>26;if(this.length=t.length,0!==i)this.words[this.length]=i,this.length++;else if(t!==this)for(;ne.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var t,o,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,o=e):(t=e,o=this);for(var n=0,a=0;a>26,this.words[a]=67108863&r;for(;0!==n&&a>26,this.words[a]=67108863&r;if(0===n&&a>>13,d=0|a[1],f=8191&d,h=d>>>13,y=0|a[2],m=8191&y,v=y>>>13,b=0|a[3],S=8191&b,_=b>>>13,w=0|a[4],x=8191&w,E=w>>>13,T=0|a[5],M=8191&T,A=T>>>13,O=0|a[6],B=8191&O,C=O>>>13,I=0|a[7],F=8191&I,R=I>>>13,N=0|a[8],j=8191&N,D=N>>>13,P=0|a[9],k=8191&P,z=P>>>13,L=0|s[0],U=8191&L,W=L>>>13,V=0|s[1],H=8191&V,K=V>>>13,G=0|s[2],q=8191&G,J=G>>>13,Y=0|s[3],$=8191&Y,Q=Y>>>13,X=0|s[4],Z=8191&X,ee=X>>>13,re=0|s[5],te=8191&re,oe=re>>>13,ie=0|s[6],ne=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],pe=8191&ce,ge=ce>>>13,de=0|s[9],fe=8191&de,he=de>>>13;t.negative=e.negative^r.negative,t.length=19;var ye=(l+(o=Math.imul(p,U))|0)+((8191&(i=(i=Math.imul(p,W))+Math.imul(g,U)|0))<<13)|0;l=((n=Math.imul(g,W))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,o=Math.imul(f,U),i=(i=Math.imul(f,W))+Math.imul(h,U)|0,n=Math.imul(h,W);var me=(l+(o=o+Math.imul(p,H)|0)|0)+((8191&(i=(i=i+Math.imul(p,K)|0)+Math.imul(g,H)|0))<<13)|0;l=((n=n+Math.imul(g,K)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,o=Math.imul(m,U),i=(i=Math.imul(m,W))+Math.imul(v,U)|0,n=Math.imul(v,W),o=o+Math.imul(f,H)|0,i=(i=i+Math.imul(f,K)|0)+Math.imul(h,H)|0,n=n+Math.imul(h,K)|0;var ve=(l+(o=o+Math.imul(p,q)|0)|0)+((8191&(i=(i=i+Math.imul(p,J)|0)+Math.imul(g,q)|0))<<13)|0;l=((n=n+Math.imul(g,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,o=Math.imul(S,U),i=(i=Math.imul(S,W))+Math.imul(_,U)|0,n=Math.imul(_,W),o=o+Math.imul(m,H)|0,i=(i=i+Math.imul(m,K)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,K)|0,o=o+Math.imul(f,q)|0,i=(i=i+Math.imul(f,J)|0)+Math.imul(h,q)|0,n=n+Math.imul(h,J)|0;var be=(l+(o=o+Math.imul(p,$)|0)|0)+((8191&(i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,$)|0))<<13)|0;l=((n=n+Math.imul(g,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,o=Math.imul(x,U),i=(i=Math.imul(x,W))+Math.imul(E,U)|0,n=Math.imul(E,W),o=o+Math.imul(S,H)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,H)|0,n=n+Math.imul(_,K)|0,o=o+Math.imul(m,q)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(v,q)|0,n=n+Math.imul(v,J)|0,o=o+Math.imul(f,$)|0,i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,$)|0,n=n+Math.imul(h,Q)|0;var Se=(l+(o=o+Math.imul(p,Z)|0)|0)+((8191&(i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Z)|0))<<13)|0;l=((n=n+Math.imul(g,ee)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,o=Math.imul(M,U),i=(i=Math.imul(M,W))+Math.imul(A,U)|0,n=Math.imul(A,W),o=o+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(E,H)|0,n=n+Math.imul(E,K)|0,o=o+Math.imul(S,q)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(_,q)|0,n=n+Math.imul(_,J)|0,o=o+Math.imul(m,$)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(v,$)|0,n=n+Math.imul(v,Q)|0,o=o+Math.imul(f,Z)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Z)|0,n=n+Math.imul(h,ee)|0;var _e=(l+(o=o+Math.imul(p,te)|0)|0)+((8191&(i=(i=i+Math.imul(p,oe)|0)+Math.imul(g,te)|0))<<13)|0;l=((n=n+Math.imul(g,oe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,o=Math.imul(B,U),i=(i=Math.imul(B,W))+Math.imul(C,U)|0,n=Math.imul(C,W),o=o+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(A,H)|0,n=n+Math.imul(A,K)|0,o=o+Math.imul(x,q)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(E,q)|0,n=n+Math.imul(E,J)|0,o=o+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(_,$)|0,n=n+Math.imul(_,Q)|0,o=o+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(v,Z)|0,n=n+Math.imul(v,ee)|0,o=o+Math.imul(f,te)|0,i=(i=i+Math.imul(f,oe)|0)+Math.imul(h,te)|0,n=n+Math.imul(h,oe)|0;var we=(l+(o=o+Math.imul(p,ne)|0)|0)+((8191&(i=(i=i+Math.imul(p,ae)|0)+Math.imul(g,ne)|0))<<13)|0;l=((n=n+Math.imul(g,ae)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,o=Math.imul(F,U),i=(i=Math.imul(F,W))+Math.imul(R,U)|0,n=Math.imul(R,W),o=o+Math.imul(B,H)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(C,H)|0,n=n+Math.imul(C,K)|0,o=o+Math.imul(M,q)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,q)|0,n=n+Math.imul(A,J)|0,o=o+Math.imul(x,$)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(E,$)|0,n=n+Math.imul(E,Q)|0,o=o+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(_,Z)|0,n=n+Math.imul(_,ee)|0,o=o+Math.imul(m,te)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(v,te)|0,n=n+Math.imul(v,oe)|0,o=o+Math.imul(f,ne)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,ne)|0,n=n+Math.imul(h,ae)|0;var xe=(l+(o=o+Math.imul(p,ue)|0)|0)+((8191&(i=(i=i+Math.imul(p,le)|0)+Math.imul(g,ue)|0))<<13)|0;l=((n=n+Math.imul(g,le)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,o=Math.imul(j,U),i=(i=Math.imul(j,W))+Math.imul(D,U)|0,n=Math.imul(D,W),o=o+Math.imul(F,H)|0,i=(i=i+Math.imul(F,K)|0)+Math.imul(R,H)|0,n=n+Math.imul(R,K)|0,o=o+Math.imul(B,q)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(C,q)|0,n=n+Math.imul(C,J)|0,o=o+Math.imul(M,$)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(A,$)|0,n=n+Math.imul(A,Q)|0,o=o+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(E,Z)|0,n=n+Math.imul(E,ee)|0,o=o+Math.imul(S,te)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(_,te)|0,n=n+Math.imul(_,oe)|0,o=o+Math.imul(m,ne)|0,i=(i=i+Math.imul(m,ae)|0)+Math.imul(v,ne)|0,n=n+Math.imul(v,ae)|0,o=o+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,le)|0)+Math.imul(h,ue)|0,n=n+Math.imul(h,le)|0;var Ee=(l+(o=o+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;l=((n=n+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,o=Math.imul(k,U),i=(i=Math.imul(k,W))+Math.imul(z,U)|0,n=Math.imul(z,W),o=o+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,n=n+Math.imul(D,K)|0,o=o+Math.imul(F,q)|0,i=(i=i+Math.imul(F,J)|0)+Math.imul(R,q)|0,n=n+Math.imul(R,J)|0,o=o+Math.imul(B,$)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(C,$)|0,n=n+Math.imul(C,Q)|0,o=o+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(A,Z)|0,n=n+Math.imul(A,ee)|0,o=o+Math.imul(x,te)|0,i=(i=i+Math.imul(x,oe)|0)+Math.imul(E,te)|0,n=n+Math.imul(E,oe)|0,o=o+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(_,ne)|0,n=n+Math.imul(_,ae)|0,o=o+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(v,ue)|0,n=n+Math.imul(v,le)|0,o=o+Math.imul(f,pe)|0,i=(i=i+Math.imul(f,ge)|0)+Math.imul(h,pe)|0,n=n+Math.imul(h,ge)|0;var Te=(l+(o=o+Math.imul(p,fe)|0)|0)+((8191&(i=(i=i+Math.imul(p,he)|0)+Math.imul(g,fe)|0))<<13)|0;l=((n=n+Math.imul(g,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,o=Math.imul(k,H),i=(i=Math.imul(k,K))+Math.imul(z,H)|0,n=Math.imul(z,K),o=o+Math.imul(j,q)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(D,q)|0,n=n+Math.imul(D,J)|0,o=o+Math.imul(F,$)|0,i=(i=i+Math.imul(F,Q)|0)+Math.imul(R,$)|0,n=n+Math.imul(R,Q)|0,o=o+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(C,Z)|0,n=n+Math.imul(C,ee)|0,o=o+Math.imul(M,te)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(A,te)|0,n=n+Math.imul(A,oe)|0,o=o+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(E,ne)|0,n=n+Math.imul(E,ae)|0,o=o+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(_,ue)|0,n=n+Math.imul(_,le)|0,o=o+Math.imul(m,pe)|0,i=(i=i+Math.imul(m,ge)|0)+Math.imul(v,pe)|0,n=n+Math.imul(v,ge)|0;var Me=(l+(o=o+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((n=n+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,o=Math.imul(k,q),i=(i=Math.imul(k,J))+Math.imul(z,q)|0,n=Math.imul(z,J),o=o+Math.imul(j,$)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul(D,$)|0,n=n+Math.imul(D,Q)|0,o=o+Math.imul(F,Z)|0,i=(i=i+Math.imul(F,ee)|0)+Math.imul(R,Z)|0,n=n+Math.imul(R,ee)|0,o=o+Math.imul(B,te)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(C,te)|0,n=n+Math.imul(C,oe)|0,o=o+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(A,ne)|0,n=n+Math.imul(A,ae)|0,o=o+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(E,ue)|0,n=n+Math.imul(E,le)|0,o=o+Math.imul(S,pe)|0,i=(i=i+Math.imul(S,ge)|0)+Math.imul(_,pe)|0,n=n+Math.imul(_,ge)|0;var Ae=(l+(o=o+Math.imul(m,fe)|0)|0)+((8191&(i=(i=i+Math.imul(m,he)|0)+Math.imul(v,fe)|0))<<13)|0;l=((n=n+Math.imul(v,he)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,o=Math.imul(k,$),i=(i=Math.imul(k,Q))+Math.imul(z,$)|0,n=Math.imul(z,Q),o=o+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Z)|0,n=n+Math.imul(D,ee)|0,o=o+Math.imul(F,te)|0,i=(i=i+Math.imul(F,oe)|0)+Math.imul(R,te)|0,n=n+Math.imul(R,oe)|0,o=o+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(C,ne)|0,n=n+Math.imul(C,ae)|0,o=o+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(A,ue)|0,n=n+Math.imul(A,le)|0,o=o+Math.imul(x,pe)|0,i=(i=i+Math.imul(x,ge)|0)+Math.imul(E,pe)|0,n=n+Math.imul(E,ge)|0;var Oe=(l+(o=o+Math.imul(S,fe)|0)|0)+((8191&(i=(i=i+Math.imul(S,he)|0)+Math.imul(_,fe)|0))<<13)|0;l=((n=n+Math.imul(_,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,o=Math.imul(k,Z),i=(i=Math.imul(k,ee))+Math.imul(z,Z)|0,n=Math.imul(z,ee),o=o+Math.imul(j,te)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(D,te)|0,n=n+Math.imul(D,oe)|0,o=o+Math.imul(F,ne)|0,i=(i=i+Math.imul(F,ae)|0)+Math.imul(R,ne)|0,n=n+Math.imul(R,ae)|0,o=o+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(C,ue)|0,n=n+Math.imul(C,le)|0,o=o+Math.imul(M,pe)|0,i=(i=i+Math.imul(M,ge)|0)+Math.imul(A,pe)|0,n=n+Math.imul(A,ge)|0;var Be=(l+(o=o+Math.imul(x,fe)|0)|0)+((8191&(i=(i=i+Math.imul(x,he)|0)+Math.imul(E,fe)|0))<<13)|0;l=((n=n+Math.imul(E,he)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,o=Math.imul(k,te),i=(i=Math.imul(k,oe))+Math.imul(z,te)|0,n=Math.imul(z,oe),o=o+Math.imul(j,ne)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,ne)|0,n=n+Math.imul(D,ae)|0,o=o+Math.imul(F,ue)|0,i=(i=i+Math.imul(F,le)|0)+Math.imul(R,ue)|0,n=n+Math.imul(R,le)|0,o=o+Math.imul(B,pe)|0,i=(i=i+Math.imul(B,ge)|0)+Math.imul(C,pe)|0,n=n+Math.imul(C,ge)|0;var Ce=(l+(o=o+Math.imul(M,fe)|0)|0)+((8191&(i=(i=i+Math.imul(M,he)|0)+Math.imul(A,fe)|0))<<13)|0;l=((n=n+Math.imul(A,he)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,o=Math.imul(k,ne),i=(i=Math.imul(k,ae))+Math.imul(z,ne)|0,n=Math.imul(z,ae),o=o+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,ue)|0,n=n+Math.imul(D,le)|0,o=o+Math.imul(F,pe)|0,i=(i=i+Math.imul(F,ge)|0)+Math.imul(R,pe)|0,n=n+Math.imul(R,ge)|0;var Ie=(l+(o=o+Math.imul(B,fe)|0)|0)+((8191&(i=(i=i+Math.imul(B,he)|0)+Math.imul(C,fe)|0))<<13)|0;l=((n=n+Math.imul(C,he)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,o=Math.imul(k,ue),i=(i=Math.imul(k,le))+Math.imul(z,ue)|0,n=Math.imul(z,le),o=o+Math.imul(j,pe)|0,i=(i=i+Math.imul(j,ge)|0)+Math.imul(D,pe)|0,n=n+Math.imul(D,ge)|0;var Fe=(l+(o=o+Math.imul(F,fe)|0)|0)+((8191&(i=(i=i+Math.imul(F,he)|0)+Math.imul(R,fe)|0))<<13)|0;l=((n=n+Math.imul(R,he)|0)+(i>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,o=Math.imul(k,pe),i=(i=Math.imul(k,ge))+Math.imul(z,pe)|0,n=Math.imul(z,ge);var Re=(l+(o=o+Math.imul(j,fe)|0)|0)+((8191&(i=(i=i+Math.imul(j,he)|0)+Math.imul(D,fe)|0))<<13)|0;l=((n=n+Math.imul(D,he)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(l+(o=Math.imul(k,fe))|0)+((8191&(i=(i=Math.imul(k,he))+Math.imul(z,fe)|0))<<13)|0;return l=((n=Math.imul(z,he))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=be,u[4]=Se,u[5]=_e,u[6]=we,u[7]=xe,u[8]=Ee,u[9]=Te,u[10]=Me,u[11]=Ae,u[12]=Oe,u[13]=Be,u[14]=Ce,u[15]=Ie,u[16]=Fe,u[17]=Re,u[18]=Ne,0!==l&&(u[19]=l,t.length++),t};function f(e,r,t){return(new h).mulp(e,r,t)}function h(e,r){this.x=e,this.y=r}Math.imul||(d=g),n.prototype.mulTo=function(e,r){var t=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,r):t<63?g(this,e,r):t<1024?function(e,r,t){t.negative=r.negative^e.negative,t.length=e.length+r.length;for(var o=0,i=0,n=0;n>>26)|0)>>>26,a&=67108863}t.words[n]=s,o=a,a=i}return 0!==o?t.words[n]=o:t.length–,t.strip()}(this,e,r):f(this,e,r)},h.prototype.makeRBT=function(e){for(var r=new Array(e),t=n.prototype._countBits(e)-1,o=0;o>=1;return o},h.prototype.permute=function(e,r,t,o,i,n){for(var a=0;a>>=1)i++;return 1<>>=13,t[2*a+1]=8191&n,n>>>=13;for(a=2*r;a>=26,r+=i/67108864|0,r+=n>>>26,this.words[t]=67108863&n}return 0!==r&&(this.words[t]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=function(e){for(var r=new Array(e.bitLength()),t=0;t>>i}return r}(e);if(0===r.length)return new n(1);for(var t=this,o=0;o=0);var r,t=e%26,i=(e-t)/26,n=67108863>>>26-t<<26-t;if(0!==t){var a=0;for(r=0;r>>26-t}a&&(this.words[r]=a,this.length++)}if(0!==i){for(r=this.length-1;r>=0;r–)this.words[r+i]=this.words[r];for(r=0;r=0),i=r?(r-r%26)/26:0;var n=e%26,a=Math.min((e-n)/26,this.length),s=67108863^67108863>>>n<a)for(this.length-=a,l=0;l=0&&(0!==c||l>=i);l–){var p=0|this.words[l];this.words[l]=c<<26-n|p>>>n,c=p&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,t){return o(0===this.negative),this.iushrn(e,r,t)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){o(”number“==typeof e&&e>=0);var r=e%26,t=(e-r)/26,i=1<=0);var r=e%26,t=(e-r)/26;if(o(0===this.negative,”imaskn works only with positive numbers“),this.length<=t)return this;if(0!==r&&t++,this.length=Math.min(t,this.length),0!==r){var i=67108863^67108863>>>r<=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(o(”number“==typeof e),o(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r>26)-(u/67108864|0),this.words[i+t]=67108863&n}for(;i>26,this.words[i+t]=67108863&n;if(0===s)return this.strip();for(o(-1===s),s=0,i=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var t=(this.length,e.length),o=this.clone(),i=e,a=0|i.words[i.length-1];0!==(t=26-this._countBits(a))&&(i=i.ushln(t),o.iushln(t),a=0|i.words[i.length-1]);var s,u=o.length-i.length;if(”mod“!==r){(s=new n(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;p–){var g=67108864*(0|o.words[i.length+p])+(0|o.words[i.length+p-1]);for(g=Math.min(g/a|0,67108863),o._ishlnsubmul(i,g,p);0!==o.negative;)g–,o.negative=0,o._ishlnsubmul(i,1,p),o.isZero()||(o.negative^=1);s&&(s.words[p]=g)}return s&&s.strip(),o.strip(),”div“!==r&&0!==t&&o.iushrn(t),{div:s||null,mod:o}},n.prototype.divmod=function(e,r,t){return o(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,r),”mod“!==r&&(i=s.div.neg()),”div“!==r&&(a=s.mod.neg(),t&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),r),”mod“!==r&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),r),”div“!==r&&(a=s.mod.neg(),t&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===r?{div:this.divn(e.words[0]),mod:null}:"mod"===r?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r);var i,a,s},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var t=0!==r.div.negative?r.mod.isub(e):r.mod,o=e.ushrn(1),i=e.andln(1),n=t.cmp(o);return n<0||1===i&&0===n?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){o(e<=67108863);for(var r=(1<<26)%e,t=0,i=this.length-1;i>=0;i–)t=(r*t+(0|this.words[i]))%e;return t},n.prototype.idivn=function(e){o(e<=67108863);for(var r=0,t=this.length-1;t>=0;t–){var i=(0|this.words[t])+67108864*r;this.words[t]=i/e|0,r=i%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){o(0===e.negative),o(!e.isZero());var r=this,t=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var i=new n(1),a=new n(0),s=new n(0),u=new n(1),l=0;r.isEven()&&t.isEven();)r.iushrn(1),t.iushrn(1),++l;for(var c=t.clone(),p=r.clone();!r.isZero();){for(var g=0,d=1;0==(r.words[0]&d)&&g<26;++g,d<<=1);if(g>0)for(r.iushrn(g);g– >0;)(i.isOdd()||a.isOdd())&&(i.iadd©,a.isub(p)),i.iushrn(1),a.iushrn(1);for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f– >0;)(s.isOdd()||u.isOdd())&&(s.iadd©,u.isub(p)),s.iushrn(1),u.iushrn(1);r.cmp(t)>=0?(r.isub(t),i.isub(s),a.isub(u)):(t.isub®,s.isub(i),u.isub(a))}return{a:s,b:u,gcd:t.iushln(l)}},n.prototype._invmp=function(e){o(0===e.negative),o(!e.isZero());var r=this,t=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var i,a=new n(1),s=new n(0),u=t.clone();r.cmpn(1)>0&&t.cmpn(1)>0;){for(var l=0,c=1;0==(r.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l– >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var p=0,g=1;0==(t.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(t.iushrn(p);p– >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);r.cmp(t)>=0?(r.isub(t),a.isub(s)):(t.isub®,s.isub(a))}return(i=0===r.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),t=e.clone();r.negative=0,t.negative=0;for(var o=0;r.isEven()&&t.isEven();o++)r.iushrn(1),t.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;t.isEven();)t.iushrn(1);var i=r.cmp(t);if(i<0){var n=r;r=t,t=n}else if(0===i||0===t.cmpn(1))break;r.isub(t)}return t.iushln(o)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){o("number"==typeof e);var r=e%26,t=(e-r)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==n&&(this.words[a]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var r,t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)r=1;else{t&&(e=-e),o(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;t–){var o=0|this.words[t],i=0|e.words[t];if(o!==i){oi&&(r=1);break}}return r},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new w(e)},n.prototype.toRed=function(e){return o(!this.red,"Already a number in reduction context"),o(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return o(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return o(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function m(e,r){this.name=e,this.p=new n(r,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(e){if("string"==typeof e){var r=n._prime(e);this.m=r.p,this.prime=r}else o(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){w.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var r,t=e;do{this.split(t,this.tmp),r=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(r>this.n);var o=r0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},m.prototype.split=function(e,r){e.iushrn(this.n,0,r)},m.prototype.imulK=function(e){return e.imul(this.k)},i(v,m),v.prototype.split=function(e,r){for(var t=Math.min(e.length,9),o=0;o>>22,i=n}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,t=0;t>>=26,e.words[t]=i,r=o}return 0!==r&&(e.words[e.length++]=r),e},n._prime=function(e){if(y[e])return y[e];var r;if(”k256“===e)r=new v;else if(”p224“===e)r=new b;else if(”p192“===e)r=new S;else{if(”p25519“!==e)throw new Error(”Unknown prime “+e);r=new _}return y[e]=r,r},w.prototype._verify1=function(e){o(0===e.negative,”red works only with positives“),o(e.red,”red works only with red numbers“)},w.prototype._verify2=function(e,r){o(0==(e.negative|r.negative),”red works only with positives“),o(e.red&&e.red===r.red,”red works only with red numbers“)},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,r){this._verify2(e,r);var t=e.add®;return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},w.prototype.iadd=function(e,r){this._verify2(e,r);var t=e.iadd®;return t.cmp(this.m)>=0&&t.isub(this.m),t},w.prototype.sub=function(e,r){this._verify2(e,r);var t=e.sub®;return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},w.prototype.isub=function(e,r){this._verify2(e,r);var t=e.isub(r);return t.cmpn(0)<0&&t.iadd(this.m),t},w.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},w.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},w.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(o(r%2==1),3===r){var t=this.m.add(new n(1)).iushrn(2);return this.pow(e,t)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);o(!i.isZero());var s=new n(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new n(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var p=this.pow(c,i),g=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),f=a;0!==d.cmp(s);){for(var h=d,y=0;0!==h.cmp(s);y++)h=h.redSqr();o(y=0;o–){for(var l=r.words[o],c=u-1;c>=0;c–){var p=l>>c&1;i!==t[0]&&(i=this.sqr(i)),0!==p||0!==a?(a<<=1,a|=p,(4===++s||0===o&&0===c)&&(i=this.mul(i,t[a]),s=0,a=0)):s=0}u=26}return i},w.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},w.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new x(e)},i(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},x.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var t=e.imul(r),o=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=t.isub(o).iushrn(this.shift),n=i;return i.cmp(this.m)>=0?n=i.isub(this.m):i.cmpn(0)<0&&(n=i.iadd(this.m)),n._forceRed(this)},x.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var t=e.mul(r),o=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=t.isub(o).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,t(54)(e))},function(e,r,t){"use strict";var o,i=this&&this.__extends||(o=function(e,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(e,r)},function(e,r){function t(){this.constructor=e}o(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)});Object.defineProperty(r,"__esModule",{value:!0}),r.Comparable=r.SerializedType=void 0;var n=t(25),a=function(){function e(e){this.bytes=Buffer.alloc(0),this.bytes=null!=e?e:Buffer.alloc(0)}return e.fromParser=function(e,r){throw new Error("fromParser not implemented")},e.from=function(e){throw new Error("from not implemented")},e.prototype.toBytesSink=function(e){e.put(this.bytes)},e.prototype.toHex=function(){return this.toBytes().toString("hex").toUpperCase()},e.prototype.toBytes=function(){if(this.bytes)return this.bytes;var e=new n.BytesList;return this.toBytesSink(e),e.toBytes()},e.prototype.toJSON=function(){return this.toHex()},e.prototype.toString=function(){return this.toHex()},e}();r.SerializedType=a;var s=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r.prototype.lt=function(e){return this.compareTo(e)<0},r.prototype.eq=function(e){return 0===this.compareTo(e)},r.prototype.gt=function(e){return this.compareTo(e)>0},r.prototype.gte=function(e){return this.compareTo(e)>-1},r.prototype.lte=function(e){return this.compareTo(e)<1},r.prototype.compareTo=function(e){throw new Error("cannot compare "+this.toString()+" and "+e.toString())},r}(a);r.Comparable=s},function(e,r){function t(e,r){if(!e)throw new Error(r||"Assertion failed")}e.exports=t,t.equal=function(e,r,t){if(e!=r)throw new Error(t||"Assertion failed: "e” != “+r)}},function(e,r,t){”use strict“;Object.defineProperty(r,”__esModule“,{value:!0});const o=t(0),i={toHex:e=>Buffer.from(e).toString(”hex“).toUpperCase(),toBytes:e=>Uint8Array.from(Buffer.from(e,”hex“)),isHex(e){var r;return(null!==(r=e.match(/(?:[0-9]|[a-f])/gimu))&&void 0!==r?r:[]).length===e.length},sha512Half(e){const r=o.createHash(”sha512“).update(e).digest(”hex“).toUpperCase(),t=this.toBytes®;return t.slice(0,t.length/2)},hexFromBuffer:e=>e.toString(”hex“).toUpperCase()};r.default=i},function(e,r,t){const{deprecate:o}=t(3),i=o(()=>{},‘”P-256K“ EC curve name is deprecated’);e.exports={name:”secp256k1“,rename®{”secp256k1“!==r&&i(),e.exports.name=r}}},function(e,r,t){const o=t(1),i=t(12),n=t(21),{KeyStore:a}=t(83);e.exports=(e,r=!1)=>{if(e instanceof i)return e;if(e instanceof a){if(!r)throw new TypeError(”key argument for this operation must not be a JWKS.KeyStore instance“);return e}try{return n(e)}catch(e){if(e instanceof o.JOSEError&&!(e instanceof o.JWKImportFailed))throw e;let t;throw t=r?”key must be an instance of a key instantiated by JWK.asKey, a valid JWK.asKey input, or a JWKS.KeyStore instance“:”key must be an instance of a key instantiated by JWK.asKey, or a valid JWK.asKey input“,new TypeError(t)}}},function(e,r,t){var o=r;o.utils=t(10),o.common=t(24),o.sha=t(203),o.ripemd=t(207),o.hmac=t(208),o.sha1=o.sha.sha1,o.sha256=o.sha.sha256,o.sha224=o.sha.sha224,o.sha384=o.sha.sha384,o.sha512=o.sha.sha512,o.ripemd160=o.ripemd.ripemd160},function(e,r,t){”use strict“;Object.defineProperty(r,”__esModule“,{value:!0}),r.BinaryParser=void 0;var o=t(9),i=t(39),n=function(){function e(e){this.bytes=Buffer.from(e,”hex“)}return e.prototype.peek=function(){return o(0!==this.bytes.byteLength),this.bytes[0]},e.prototype.skip=function(e){o(e<=this.bytes.byteLength),this.bytes=this.bytes.slice(e)},e.prototype.read=function(e){o(e<=this.bytes.byteLength);var r=this.bytes.slice(0,e);return this.skip(e),r},e.prototype.readUIntN=function(e){return o(0>>0},e.prototype.readUInt8=function(){return this.readUIntN(1)},e.prototype.readUInt16=function(){return this.readUIntN(2)},e.prototype.readUInt32=function(){return this.readUIntN(4)},e.prototype.size=function(){return this.bytes.byteLength},e.prototype.end=function(e){var r=this.bytes.byteLength;return 0===r||void 0!==e&&r<=e},e.prototype.readVariableLength=function(){return this.read(this.readVariableLengthLength())},e.prototype.readVariableLengthLength=function(){var e=this.readUInt8();if(e<=192)return e;if(e<=240)return 193+256*(e-193)+this.readUInt8();if(e<=254)return 12481+65536*(e-241)+256*this.readUInt8()+this.readUInt8();throw new Error("Invalid variable length indicator")},e.prototype.readFieldOrdinal=function(){var e=this.readUInt8(),r=15&e;if(0===(e>>=4)&&(0===(e=this.readUInt8())||e<16))throw new Error("Cannot read FieldOrdinal, type_code out of range");if(0===r&&(0===(r=this.readUInt8())||r<16))throw new Error("Cannot read FieldOrdinal, field_code out of range");return e<<16|r},e.prototype.readField=function(){return i.Field.fromString(this.readFieldOrdinal().toString())},e.prototype.readType=function(e){return e.fromParser(this)},e.prototype.typeForField=function(e){return e.associatedType},e.prototype.readFieldValue=function(e){var r=this.typeForField(e);if(!r)throw new Error("unsupported: ("e.name”, “e.type.name”)“);var t=e.isVariableLengthEncoded?this.readVariableLengthLength():void 0,o=r.fromParser(this,t);if(void 0===o)throw new Error(”fromParser for (“e.name”, “e.type.name”) -> undefined “);return o},e.prototype.readFieldAndValue=function(){var e=this.readField();return[e,this.readFieldValue(e)]},e}();r.BinaryParser=n},function(e,r,t){const{deprecate:o}=t(3),{createPublicKey:i,createPrivateKey:n,createSecretKey:a,KeyObject:s}=t(4),u=t(5),l=t(8),{jwkToPem:c}=t(79),p=t(1),g=t(80),d=t(81),f=t(82),h=t(49),y=new Set([”string“,”buffer“,”object“]),m=(e={},r={})=>({alg:r.alg,key_ops:r.key_ops,kid:r.kid,use:r.use,x5c:r.x5c,x5t:r.x5t,”x5t#S256“:r[”x5t#S256“],…e}),v=/^[a-zA-Z0-9-]+ AAAA(?:[0-9A-Za-z+/])+(?:==|=)?(?: .*)?$/,b=(e,r,{calculateMissingRSAPrimes:t=!1}={})=>{let o,b,S;if(!y.has(typeof e))throw new TypeError(”key argument must be a string, buffer or an object“);if(void 0!==r&&!l®)throw new TypeError(”parameters argument must be a plain object when provided“);if(e instanceof s)switch(e.type){case”private“:o=e;break;case”public“:b=e;break;case”secret“:S=e}else if(”object“==typeof e&&e&&”kty“in e&&”oct“===e.kty){try{S=a(u.decodeToBuffer(e.k))}catch®{”k“in e||(S={type:”secret“})}r=m(r,e)}else if(”object“==typeof e&&e&&”kty“in e){let a;({calculateMissingRSAPrimes:t=!1}=r||{calculateMissingRSAPrimes:t});try{a=c(e,{calculateMissingRSAPrimes:t})}catch(e){if(e instanceof p.JOSEError)throw e}a&&e.d?o=n(a):a&&(b=i(a)),r=m({},e)}else if(e&&(”object“==typeof e||”string“==typeof e)){try{o=n(e)}catch(e){if(e instanceof p.JOSEError)throw e}try{b=i(e),!e.startsWith(”—–BEGIN CERTIFICATE—–“)||r&&”x5c“in r||(r=m(r,{x5c:[e.replace(/(?:—–(?:BEGIN|END) CERTIFICATE—–|s)/g,”“)]}))}catch(e){if(e instanceof p.JOSEError)throw e}try{e.includes(”—–BEGIN“)||v.test(e.toString(”ascii“).replace(/[rn]/g,”“))||(S=a(Buffer.isBuffer(e)?e:Buffer.from(e)))}catch(e){}}const _=o||b||S;if(o||b)switch(_.asymmetricKeyType){case”rsa“:return new g(_,r);case”ec“:return new d(_,r);case”ed25519“:case”ed448“:case”x25519“:case”x448“:return new f(_,r);default:throw new p.JOSENotSupported(”only RSA, EC and OKP asymmetric keys are supported“)}else if(S)return new h(_,r);throw new p.JWKImportFailed(”key import failed“)};e.exports=b,Object.defineProperty(b,”deprecated“,{value:o((e,r)=>b(e,r,{calculateMissingRSAPrimes:!0}),”JWK.importKey() is deprecated, use JWK.asKey() instead“),enumerable:!1})},function(e,r,t){e.exports=t(0).createHash},function(e,r,t){var o=t(33),i=o.Buffer;function n(e,r){for(var t in e)r[t]=e[t]}function a(e,r,t){return i(e,r,t)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=o:(n(o,r),r.Buffer=a),a.prototype=Object.create(i.prototype),n(i,a),a.from=function(e,r,t){if(”number“==typeof e)throw new TypeError(”Argument must not be a number“);return i(e,r,t)},a.alloc=function(e,r,t){if(”number“!=typeof e)throw new TypeError(”Argument must be a number“);var o=i(e);return void 0!==r?”string“==typeof t?o.fill(r,t):o.fill®:o.fill(0),o},a.allocUnsafe=function(e){if(”number“!=typeof e)throw new TypeError(”Argument must be a number“);return i(e)},a.allocUnsafeSlow=function(e){if(”number“!=typeof e)throw new TypeError(”Argument must be a number“);return o.SlowBuffer(e)}},function(e,r,t){”use strict“;var o=t(10),i=t(15);function n(){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}r.BlockHash=n,n.prototype.update=function(e,r){if(e=o.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var t=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-t,e.length),0===this.pending.length&&(this.pending=null),e=o.join32(e,0,e.length-t,this.endian);for(var i=0;i>>24&255,o[i++]=e>>>16&255,o[i++]=e>>>8&255,o[i++]=255&e}else for(o[i++]=255&e,o[i++]=e>>>8&255,o[i++]=e>>>16&255,o[i++]=e>>>24&255,o[i++]=0,o[i++]=0,o[i++]=0,o[i++]=0,n=8;n>>8),r[1]=255&e,r.slice(0,2);if(e<=918744)return e-=12481,r[0]=241+(e>>>16),r[1]=e>>8&255,r[2]=255&e,r.slice(0,3);throw new Error(”Overflow error“)},e.prototype.writeFieldAndValue=function(e,r){var t=e.associatedType.from®;o(void 0!==t.toBytesSink),o(void 0!==e.name),this.sink.put(e.header),e.isVariableLengthEncoded?this.writeLengthEncoded(t):t.toBytesSink(this.sink)},e.prototype.writeLengthEncoded=function(e){var r=new i;e.toBytesSink®,this.put(this.encodeVariableLength(r.getLength())),this.writeBytesList®},e}();r.BinarySerializer=n},function(e,r,t){”use strict“;function o(e){var r=Buffer.alloc(4);return r.writeUInt32BE(e),r}Object.defineProperty(r,”__esModule“,{value:!0}),r.HashPrefix=void 0;var i={transactionID:o(1415073280),transaction:o(1397638144),accountStateEntry:o(1296846336),innerNode:o(1296649728),ledgerHeader:o(1280791040),transactionSig:o(1398036480),transactionMultiSig:o(1397576704),validation:o(1447119872),proposal:o(1347571712),paymentChannelClaim:o(1129073920)};r.HashPrefix=i},function(e,r){e.exports=require(”os“)},function(e,r,t){const o=t(1),i=t(21),n=t(80),a=t(81),s=t(82),u=t(49);e.exports.generate=async(e,r,t,l=!0)=>{switch(e){case”RSA“:return i(await n.generate(r,l),t);case”EC“:return i(await a.generate(r,l),t);case”OKP“:return i(await s.generate(r,l),t);case”oct“:return i(await u.generate(r,l),t);default:throw new o.JOSENotSupported(”unsupported key type: “+e)}},e.exports.generateSync=(e,r,t,l=!0)=>{switch(e){case”RSA“:return i(n.generateSync(r,l),t);case”EC“:return i(a.generateSync(r,l),t);case”OKP“:return i(s.generateSync(r,l),t);case”oct“:return i(u.generateSync(r,l),t);default:throw new o.JOSENotSupported(”unsupported key type: “+e)}}},function(e,r,t){const o=t(12),i=t(159),n=t(160),a=t(161),s=t(21),u=t(28);e.exports={…u,asKey:s,isKey:e=>e instanceof o,None:i,EmbeddedJWK:n,EmbeddedX5C:a},Object.defineProperty(e.exports,”importKey“,{value:s.deprecated,enumerable:!1})},function(e,r,t){const{JWKKeySupport:o,JOSENotSupported:i}=t(1),{KEY_MANAGEMENT_ENCRYPT:n,KEY_MANAGEMENT_DECRYPT:a}=t(2),{JWA:s,JWK:u}=t(11);t(162)(s,u),t(163)(s,u),t(165)(s,u),t(166)(s,u),t(167)(s,u),t(168)(s),t(169)(s,u),t(171)(s,u),t(172)(s,u),t(173)(s,u),t(174)(s,u),t(175)(s,u),t(176)(s,u),t(178)(s,u);const l=(e,r,t)=>{const u=`_${r}_${t}`;let c,p;if(”keyManagementEncrypt“===r?(c=”key management (encryption)“,p=n):”keyManagementDecrypt“===r&&(c=”key management (decryption)“,p=a),u in e){if(e[u])return;throw new o(`the key does not support ${t} ${c||r} algorithm`)}let g=!0;if(!s[r].has(t))throw new i(`unsupported ${c||r} alg: ${t}`);if(e.algorithms(p).has(t)||(g=!1),Object.defineProperty(e,u,{value:g,enumerable:!1}),!g)return l(e,r,t)};e.exports={check:l,sign:(e,r,t)=>(l(r,”sign“,e),s.sign.get(e)(r,t)),verify:(e,r,t,o)=>(l(r,”verify“,e),s.verify.get(e)(r,t,o)),keyManagementEncrypt:(e,r,t,o)=>(l(r,”keyManagementEncrypt“,e),s.keyManagementEncrypt.get(e)(r,t,o)),keyManagementDecrypt:(e,r,t,o)=>(l(r,”keyManagementDecrypt“,e),s.keyManagementDecrypt.get(e)(r,t,o)),encrypt:(e,r,t,o)=>(l(r,”encrypt“,e),s.encrypt.get(e)(r,t,o)),decrypt:(e,r,t,o)=>(l(r,”decrypt“,e),s.decrypt.get(e)(r,t,o))}},function(e,r){e.exports=e=>”sha“+e.substr(2,3)},function(e,r,t){const{JOSECritNotUnderstood:o,JWSInvalid:i}=t(1),n=new Set([”alg“,”jku“,”jwk“,”kid“,”x5u“,”x5c“,”x5t“,”x5t#S256“,”typ“,”cty“,”crit“,”enc“,”zip“,”epk“,”apu“,”apv“,”iv“,”tag“,”p2s“,”p2c“]);e.exports=function(e,r,t,a){if(r&&”crit“in r){if(!Array.isArray(r.crit)||0===r.crit.length||r.crit.some(e=>”string“!=typeof e||!e))throw new e(‘”crit“ Header Parameter MUST be an array of non-empty strings when present’);const s=new Set(a),u={…r,…t};r.crit.forEach(t=>{if(n.has(t))throw new e(”The critical list contains a non-extension Header Parameter “+t);if(!s.has(t))throw new o(`critical ”${t}“ is not understood`);if(”b64“===t){if(!(”b64“in r))throw new i(‘”b64“ critical parameter must be integrity protected’);if(”boolean“!=typeof r.b64)throw new i(‘”b64“ critical parameter must be a boolean’)}else if(!(t in u))throw new e(`critical parameter ”${t}“ is missing`)})}if(t&&”crit“in t)throw new e(‘”crit“ Header Parameter MUST be integrity protected when present’)}},function(e,r){e.exports=require(”buffer“)},function(e,r,t){”use strict“;var o=t(13),i=t(7),n=i.getNAF,a=i.getJSF,s=i.assert;function u(e,r){this.type=e,this.p=new o(r.p,16),this.red=r.prime?o.red(r.prime):o.mont(this.p),this.zero=new o(0).toRed(this.red),this.one=new o(1).toRed(this.red),this.two=new o(2).toRed(this.red),this.n=r.n&&new o(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.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 t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,r){this.curve=e,this.type=r,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error(”Not implemented“)},u.prototype.validate=function(){throw new Error(”Not implemented“)},u.prototype._fixedNafMul=function(e,r){s(e.precomputed);var t=e._getDoubles(),o=n(r,1,this._bitLength),i=(1<=u;r–)l=(l<<1)+o[r];a.push(l)}for(var c=this.jpoint(null,null,null),p=this.jpoint(null,null,null),g=i;g>0;g–){for(u=0;u=0;l–){for(r=0;l>=0&&0===a[l];l–)r++;if(l>=0&&r++,u=u.dblp®,l<0)break;var c=a[l];s(0!==c),u="affine"===e.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return”affine“===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,r,t,o,i){for(var s=this._wnafT1,u=this._wnafT2,l=this._wnafT3,c=0,p=0;p=1;p-=2){var d=p-1,f=p;if(1===s[d]&&1===s[f]){var h=[r[d],null,null,r[f]];0===r[d].y.cmp(r[f].y)?(h[1]=r[d].add(r[f]),h[2]=r[d].toJ().mixedAdd(r[f].neg())):0===r[d].y.cmp(r[f].y.redNeg())?(h[1]=r[d].toJ().mixedAdd(r[f]),h[2]=r[d].add(r[f].neg())):(h[1]=r[d].toJ().mixedAdd(r[f]),h[2]=r[d].toJ().mixedAdd(r[f].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],m=a(t[d],t[f]);c=Math.max(m[0].length,c),l[d]=new Array©,l[f]=new Array©;for(var v=0;v=0;p–){for(var x=0;p>=0;){var E=!0;for(v=0;v=0&&x++,_=_.dblp(x),p<0)break;for(v=0;v0?T=u[v][M-1>>1]:M<0&&(T=u[v][-M-1>>1].neg()),_=”affine“===T.type?_.mixedAdd(T):_.add(T))}}for(p=0;p:.toP()},u.BasePoint=l,l.prototype.eq=function(){throw new Error(”Not implemented“)},l.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,r){e=i.toArray(e,r);var t=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*t)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+t),e.slice(1+t,1+2*t));if((2===e[0]||3===e[0])&&e.length-1===t)return this.pointFromX(e.slice(1,1+t),3===e[0]);throw new Error(”Unknown point format“)},l.prototype.encodeCompressed=function(e){return this.encode(e,!0)},l.prototype._encode=function(e){var r=this.curve.p.byteLength(),t=this.getX().toArray(”be“,r);return e?[this.getY().isEven()?2:3].concat(t):[4].concat(t,this.getY().toArray(”be“,r))},l.prototype.encode=function(e,r){return i.encode(this._encode®,e)},l.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},l.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return!!r&&r.points.length>=Math.ceil((e.bitLength()+1)/r.step)},l.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],o=this,i=0;i>8&255,r>>16&255,r>>24&255,0,0,0,0])]);return o.codec.encodeChecked(a)}function s(e){const r=o.codec.decodeChecked(e),t=function(e){const r=e.slice(0,2);if(n.MAIN.equals®)return!1;if(n.TEST.equals®)return!0;throw new Error(”Invalid X-address: bad prefix“)}®;return{accountId:r.slice(2,22),tag:function(e){const r=e[22];if(r>=2)throw new Error(”Unsupported X-address“);if(1===r)return e[23]+256*e[24]+65536*e[25]+16777216*e[26];return i.strictEqual(r,0,”flag must be zero to indicate no tag“),i.ok(Buffer.from(”0000000000000000“,”hex“).equals(e.slice(23,31)),”remaining bytes must be zero“),!1}®,test:t}}r.classicAddressToXAddress=function(e,r,t){return a(o.decodeAccountID(e),r,t)},r.encodeXAddress=a,r.xAddressToClassicAddress=function(e){const{accountId:r,tag:t,test:i}=s(e);return{classicAddress:o.encodeAccountID®,tag:t,test:i}},r.decodeXAddress=s,r.isValidXAddress=function(e){try{s(e)}catch(e){return!1}return!0}},function(e,r,t){”use strict“;var o=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),i=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,”default“,{enumerable:!0,value:r})}:function(e,r){e.default=r}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)”default“!==t&&Object.hasOwnProperty.call(e,t)&&o(r,e,t);return i(r,e),r},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,”__esModule“,{value:!0});const s=n(t(36)),u=a(t(16)),l=a(t(116)),c={isValidAddress:e=>s.isValidClassicAddress(e)||s.isValidXAddress(e),isValidXAddress:e=>s.isValidXAddress(e),isValidClassicAddress:e=>s.isValidClassicAddress(e),encodeXAddress(e,r,t=!1){if(!s.isValidClassicAddress(e))return;const o=null!=r&&r;return s.classicAddressToXAddress(e,o,t)},decodeXAddress(e){if(!s.isValidXAddress(e))return;const r=s.xAddressToClassicAddress(e);return{address:r.classicAddress,tag:!1===r.tag?void 0:r.tag,test:r.test}},transactionBlobToTransactionHash(e){if(!u.default.isHex(e))return;const r=u.default.toBytes(”54584E00“+e),t=u.default.sha512Half®;return u.default.toHex(t)},isTestNetwork:e=>e===l.default.Test||e===l.default.Dev};r.default=c},function(module,exports){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,r,t){e instanceof String&&(e=String(e));for(var o=e.length,i=0;it” must not be null or undefined“);if(r instanceof RegExp)throw new TypeError(”First argument to String.prototype.“t” must not be a regular expression“);return e+”“},$jscomp.polyfill(”String.prototype.endsWith“,(function(e){return e||function(e,r){var t=$jscomp.checkStringArgs(this,e,”endsWith“);e+=”“,void 0===r&&(r=t.length),r=Math.max(0,Math.min(0|r,t.length));for(var o=e.length;0=o}}),”es6“,”es3“),$jscomp.polyfill(”Array.prototype.find“,(function(e){return e||function(e,r){return $jscomp.findInternal(this,e,r).v}}),”es6“,”es3“),$jscomp.polyfill(”String.prototype.startsWith“,(function(e){return e||function(e,r){var t=$jscomp.checkStringArgs(this,e,”startsWith“);e+=”“;var o=t.length,i=e.length;r=Math.max(0,Math.min(0|r,t.length));for(var n=0;n=i}}),”es6“,”es3“),$jscomp.polyfill(”String.prototype.repeat“,(function(e){return e||function(e){var r=$jscomp.checkStringArgs(this,null,”repeat“);if(0>e||1342177279>>=1)&&(r+=r);return t}}),”es6“,”es3“);var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return void 0!==e},goog.isString=function(e){return”string“==typeof e},goog.isBoolean=function(e){return”boolean“==typeof e},goog.isNumber=function(e){return”number“==typeof e},goog.exportPath_=function(e,r,t){e=e.split(”.“),t=t||goog.global,e[0]in t||void 0===t.execScript||t.execScript(”var “+e[0]);for(var o;e.length&&(o=e.shift());)!e.length&&goog.isDef®?t[o]=r:t=t[o]&&t[o]!==Object.prototype[o]?t[o]:t[o]={}},goog.define=function(e,r){if(!COMPILED){var t=goog.global.CLOSURE_UNCOMPILED_DEFINES,o=goog.global.CLOSURE_DEFINES;t&&void 0===t.nodeType&&Object.prototype.hasOwnProperty.call(t,e)?r=t[e]:o&&void 0===o.nodeType&&Object.prototype.hasOwnProperty.call(o,e)&&(r=o[e])}return r},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE=”en“,goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error(”goog.provide cannot be used within a module.“);if(!COMPILED&&goog.isProvided_(e))throw Error(‘Namespace ”’e‘“ already declared.’);goog.constructNamespace_(e)},goog.constructNamespace_=function(e,r){if(!COMPILED){delete goog.implicitNamespaces_[e];for(var t=e;(t=t.substring(0,t.lastIndexOf(”.“)))&&!goog.getObjectByName(t);)goog.implicitNamespaces_[t]=!0}goog.exportPath_(e,r)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector(”script[nonce]“))&&(e=e.nonce||e.getAttribute(”nonce“))&&goog.NONCE_PATTERN_.test(e)?e:”“},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error(”Invalid module identifier“);if(!goog.isInGoogModuleLoader_())throw Error(”Module “e” has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You’re likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.“);if(goog.moduleLoaderState_.moduleName)throw Error(”goog.module may only be called once per module.“);if(goog.moduleLoaderState_.moduleName=e,!COMPILED){if(goog.isProvided_(e))throw Error(‘Namespace ”’e‘“ already declared.’);delete goog.implicitNamespaces_[e]}},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){if(!COMPILED){if(e in goog.loadedModules_)return goog.loadedModules_[e].exports;if(!goog.implicitNamespaces_[e])return null!=(e=goog.getObjectByName(e))?e:null}return null},goog.ModuleType={ES6:”es6“,GOOG:”goog“},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&(”function“==typeof e.getCurrentModulePath&&!!e.getCurrentModulePath())},goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error(”goog.module.declareLegacyNamespace must be called from within a goog.module“);if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error(”goog.module must be called prior to goog.module.declareLegacyNamespace.“);goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error(”goog.declareModuleId may only be called from within an ES6 module“);if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error(”goog.declareModuleId may only be called once per module.“);if(e in goog.loadedModules_)throw Error(‘Module with namespace ”’e‘“ already exists.’)}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var r=goog.global.$jscomp;if(!r||”function“!=typeof r.getCurrentModulePath)throw Error(‘Module with namespace ”’e‘“ has been loaded incorrectly.’);r=r.require(r.getCurrentModulePath()),goog.loadedModules_[e]={exports:r,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||”“,Error(”Importing test-only code into non-debug environment“+(e?”: “+e:”.“))},goog.forwardDeclare=function(e){},COMPILED||(goog.isProvided_=function(e){return e in goog.loadedModules_||!goog.implicitNamespaces_[e]&&goog.isDefAndNotNull(goog.getObjectByName(e))},goog.implicitNamespaces_={”goog.module“:!0}),goog.getObjectByName=function(e,r){e=e.split(”.“),r=r||goog.global;for(var t=0;te”n;})();n“},goog.loadModule=function(e){var r=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:”“,declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var t=e.call(void 0,{});else{if(!goog.isString(e))throw Error(”Invalid module definition“);goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),t=goog.loadModuleFromSource_.call(void 0,e)}var o=goog.moduleLoaderState_.moduleName;if(!goog.isString(o)||!o)throw Error(‘Invalid module name ”’o‘“’);goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(o,t):goog.SEAL_MODULE_EXPORTS&&Object.seal&&”object“==typeof t&&null!=t&&Object.seal(t),goog.loadedModules_[o]={exports:t,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=r}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split(”/“);for(var r=0;r>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var r=goog.typeOf(e);if(”object“==r||”array“==r){if(”function“==typeof e.clone)return e.clone();for(var t in r=”array“==r?[]:{},e)r[t]=goog.cloneObject(e[t]);return r}return e},goog.bindNative_=function(e,r,t){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,r,t){if(!e)throw Error();if(2evalTest = 1;”)}catch(e){}if(void 0!==goog.global.evalTest){try{delete goog.global.evalTest}catch(e){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var r=goog.global.document,t=r.createElement(“SCRIPT”);t.type=“text/javascript”,t.defer=!1,t.appendChild(r.createTextNode(e)),r.head.appendChild(t),r.head.removeChild(t)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,r){if(“.”==String(e).charAt(0))throw Error(‘className passed in goog.getCssName must not start with “.”. You passed: ’+e);var t=function(e){return goog.cssNameMapping_[e]||e},o=function(e){e=e.split(“-”);for(var r=[],o=0;o{“use strict”;class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()‘)})),a(“es7”,(function(){return b(“2 ** 2 == 4”)})),a(“es8”,(function(){return b(“async () => 1, true”)})),a(“es9”,(function(){return b(“({…rest} = {}), true”)})),a(“es_next”,(function(){return!1})),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(e,r){if(“always”==goog.TRANSPILE)return!0;if(“never”==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var t=this.createRequiresTranspilation_();this.requiresTranspilation_=t.map,this.transpilationTarget_=this.transpilationTarget_||t.target}if(e in this.requiresTranspilation_)return!!this.requiresTranspilation_[e]||!(!goog.inHtmlDocument_()||“es6”!=r||“noModule”in goog.global.document.createElement(“script”));throw Error(“Unknown language mode: ”+e)},goog.Transpiler.prototype.transpile=function(e,r){return goog.transpile_(e,r,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(e){return e.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(e,r){function t(){o&&(goog.global.setTimeout(o,0),o=null)}var o=r;if(e.length){r=[];for(var i=0;ie“ does not exist (was base.js loaded more than once?).”);for(var t=goog.Dependency.callbackMap_[e],o=[],i=1;ithis.path’“ after document load’)}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var t=goog.Dependency.registerCallback_((function®{goog.DebugLoader_.IS_OLD_IE_&&”complete“!=r.readyState||(goog.Dependency.unregisterCallback_(t),e.loaded())})),o=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?‘ nonce=”’+goog.getScriptNonce()+‘“’:”“;o=‘