@multiplechain/bitcoin 0.1.17 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +7 -1
  2. package/dist/assets/Coin.d.ts +38 -0
  3. package/dist/assets/index.d.ts +1 -0
  4. package/dist/browser/Wallet.d.ts +81 -0
  5. package/dist/browser/adapters/Leather.d.ts +16 -0
  6. package/dist/browser/adapters/UniSat.d.ts +19 -0
  7. package/dist/browser/adapters/Xverse.d.ts +6 -0
  8. package/dist/browser/adapters/icons.d.ts +6 -0
  9. package/dist/browser/adapters/index.d.ts +3 -0
  10. package/dist/browser/index.d.ts +11 -0
  11. package/dist/index.cjs +83 -0
  12. package/dist/index.cjs.map +7 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.es.js +43583 -0
  15. package/dist/index.es.js.map +1 -0
  16. package/dist/index.umd.js +133 -0
  17. package/dist/index.umd.js.map +1 -0
  18. package/dist/models/CoinTransaction.d.ts +24 -0
  19. package/dist/models/Transaction.d.ts +106 -0
  20. package/dist/models/index.d.ts +2 -0
  21. package/dist/services/Provider.d.ts +80 -0
  22. package/dist/services/TransactionListener.d.ts +120 -0
  23. package/dist/services/TransactionSigner.d.ts +50 -0
  24. package/dist/services/index.d.ts +2 -0
  25. package/dist/utils.d.ts +3 -0
  26. package/package.json +85 -50
  27. package/LICENSE +0 -21
  28. package/dist/bitcoin-provider.js +0 -2
  29. package/dist/bitcoin-provider.js.LICENSE.txt +0 -30
  30. package/src/adapters/leather.js +0 -75
  31. package/src/adapters/trustwallet.js +0 -32
  32. package/src/adapters/unisat.js +0 -42
  33. package/src/adapters/xverse.js +0 -86
  34. package/src/entity/coin.js +0 -74
  35. package/src/entity/token.js +0 -5
  36. package/src/entity/transaction.js +0 -183
  37. package/src/get-adapter.js +0 -14
  38. package/src/provider.js +0 -221
  39. package/src/utils.js +0 -26
  40. package/src/wallet.js +0 -180
@@ -0,0 +1,133 @@
1
+ (function(ar,Rr){typeof exports=="object"&&typeof module<"u"?Rr(exports):typeof define=="function"&&define.amd?define(["exports"],Rr):(ar=typeof globalThis<"u"?globalThis:ar||self,Rr(ar.Bitcoin={}))})(this,function(exports){"use strict";var Hp=Object.defineProperty;var Fp=(ar,Rr,t)=>Rr in ar?Hp(ar,Rr,{enumerable:!0,configurable:!0,writable:!0,value:t}):ar[Rr]=t;var Tt=(ar,Rr,t)=>(Fp(ar,typeof Rr!="symbol"?Rr+"":Rr,t),t);var Rr;var AssetDirectionEnum=(t=>(t.INCOMING="INCOMING",t.OUTGOING="OUTGOING",t))(AssetDirectionEnum||{}),TransactionTypeEnum=(t=>(t.GENERAL="GENERAL",t.CONTRACT="CONTRACT",t.COIN="COIN",t.TOKEN="TOKEN",t.NFT="NFT",t))(TransactionTypeEnum||{}),TransactionStatusEnum=(t=>(t.FAILED="FAILED",t.PENDING="PENDING",t.CONFIRMED="CONFIRMED",t))(TransactionStatusEnum||{}),ErrorTypeEnum=(t=>(t.RPC_TIMEOUT="RPC_TIMEOUT",t.RPC_REQUEST_ERROR="RPC_REQUEST_ERROR",t.RPC_ACCESS_DENIED="RPC_ACCESS_DENIED",t.WS_URL_NOT_DEFINED="WS_URL_NOT_DEFINED",t.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",t.UNACCEPTED_CHAIN="UNACCEPTED_CHAIN",t.UNAUTHORIZED_ADDRESS="UNAUTHORIZED_ADDRESS",t.INSUFFICIENT_BALANCE="INSUFFICIENT_BALANCE",t.INVALID_AMOUNT="INVALID_AMOUNT",t.INVALID_ADDRESS="INVALID_ADDRESS",t.INVALID_PRIVATE_KEY="INVALID_PRIVATE_KEY",t.INVALID_PUBLIC_KEY="INVALID_PUBLIC_KEY",t.INVALID_TRANSACTION_ID="INVALID_TRANSACTION_ID",t.PROVIDER_IS_REQUIRED="PROVIDER_IS_REQUIRED",t.PROVIDER_IS_NOT_INITIALIZED="PROVIDER_IS_NOT_INITIALIZED",t.PROVIDER_IS_ALREADY_INITIALIZED="PROVIDER_IS_ALREADY_INITIALIZED",t.WALLET_ALREADY_PROCESSING="WALLET_ALREADY_PROCESSING",t.WALLET_CONNECT_REJECTED="WALLET_CONNECT_REJECTED",t.WALLET_REQUEST_REJECTED="WALLET_REQUEST_REJECTED",t.WALLET_CONNECTION_FAILED="WALLET_CONNECTION_FAILED",t.WALLET_CONNECTION_TIMEOUT="WALLET_CONNECTION_TIMEOUT",t.TRANSACTION_CREATION_FAILED="TRANSACTION_CREATION_FAILED",t.TRANSACTION_NOT_FOUND="TRANSACTION_NOT_FOUND",t.CLOSED_WALLETCONNECT_MODAL="CLOSED_WALLETCONNECT_MODAL",t.PROJECT_ID_IS_REQUIRED="PROJECT_ID_IS_REQUIRED",t.METADATA_IS_REQUIRED="METADATA_IS_REQUIRED",t.CONFIG_IS_REQUIRED="CONFIG_IS_REQUIRED",t))(ErrorTypeEnum||{}),WalletPlatformEnum=(t=>(t.BROWSER="BROWSER",t.MOBILE="MOBILE",t.DESKTOP="DESKTOP",t.UNIVERSAL="UNIVERSAL",t))(WalletPlatformEnum||{});const TransactionListenerProcessIndex={[TransactionTypeEnum.GENERAL]:"generalProcess",[TransactionTypeEnum.CONTRACT]:"contractProcess",[TransactionTypeEnum.COIN]:"coinProcess",[TransactionTypeEnum.TOKEN]:"tokenProcess",[TransactionTypeEnum.NFT]:"nftProcess"},index$3=Object.freeze(Object.defineProperty({__proto__:null,AssetDirectionEnum,ErrorTypeEnum,TransactionListenerProcessIndex,TransactionStatusEnum,TransactionTypeEnum,WalletPlatformEnum},Symbol.toStringTag,{value:"Module"})),global$1=globalThis||void 0||self;function bind$2(t,e){return function(){return t.apply(e,arguments)}}const{toString}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,kindOf=(t=>e=>{const a=toString.call(e);return t[a]||(t[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=t=>(t=t.toLowerCase(),e=>kindOf(e)===t),typeOfTest=t=>e=>typeof e===t,{isArray:isArray$3}=Array,isUndefined=typeOfTest("undefined");function isBuffer(t){return t!==null&&!isUndefined(t)&&t.constructor!==null&&!isUndefined(t.constructor)&&isFunction$1(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&isArrayBuffer(t.buffer),e}const isString$1=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$1=t=>t!==null&&typeof t=="object",isBoolean$1=t=>t===!0||t===!1,isPlainObject=t=>{if(kindOf(t)!=="object")return!1;const e=getPrototypeOf$1(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=t=>isObject$1(t)&&isFunction$1(t.pipe),isFormData=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||isFunction$1(t.append)&&((e=kindOf(t))==="formdata"||e==="object"&&isFunction$1(t.toString)&&t.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$2(t,e,{allOwnKeys:a=!1}={}){if(t===null||typeof t>"u")return;let u,d;if(typeof t!="object"&&(t=[t]),isArray$3(t))for(u=0,d=t.length;u<d;u++)e.call(null,t[u],u,t);else{const c=a?Object.getOwnPropertyNames(t):Object.keys(t),l=c.length;let m;for(u=0;u<l;u++)m=c[u],e.call(null,t[m],m,t)}}function findKey(t,e){e=e.toLowerCase();const a=Object.keys(t);let u=a.length,d;for(;u-- >0;)if(d=a[u],e===d.toLowerCase())return d;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=t=>!isUndefined(t)&&t!==_global;function merge(){const{caseless:t}=isContextDefined(this)&&this||{},e={},a=(u,d)=>{const c=t&&findKey(e,d)||d;isPlainObject(e[c])&&isPlainObject(u)?e[c]=merge(e[c],u):isPlainObject(u)?e[c]=merge({},u):isArray$3(u)?e[c]=u.slice():e[c]=u};for(let u=0,d=arguments.length;u<d;u++)arguments[u]&&forEach$2(arguments[u],a);return e}const extend=(t,e,a,{allOwnKeys:u}={})=>(forEach$2(e,(d,c)=>{a&&isFunction$1(d)?t[c]=bind$2(d,a):t[c]=d},{allOwnKeys:u}),t),stripBOM=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),inherits$A=(t,e,a,u)=>{t.prototype=Object.create(e.prototype,u),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),a&&Object.assign(t.prototype,a)},toFlatObject=(t,e,a,u)=>{let d,c,l;const m={};if(e=e||{},t==null)return e;do{for(d=Object.getOwnPropertyNames(t),c=d.length;c-- >0;)l=d[c],(!u||u(l,t,e))&&!m[l]&&(e[l]=t[l],m[l]=!0);t=a!==!1&&getPrototypeOf$1(t)}while(t&&(!a||a(t,e))&&t!==Object.prototype);return e},endsWith$1=(t,e,a)=>{t=String(t),(a===void 0||a>t.length)&&(a=t.length),a-=e.length;const u=t.indexOf(e,a);return u!==-1&&u===a},toArray$3=t=>{if(!t)return null;if(isArray$3(t))return t;let e=t.length;if(!isNumber$1(e))return null;const a=new Array(e);for(;e-- >0;)a[e]=t[e];return a},isTypedArray$1=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&getPrototypeOf$1(Uint8Array)),forEachEntry=(t,e)=>{const u=(t&&t[Symbol.iterator]).call(t);let d;for(;(d=u.next())&&!d.done;){const c=d.value;e.call(t,c[0],c[1])}},matchAll=(t,e)=>{let a;const u=[];for(;(a=t.exec(e))!==null;)u.push(a);return u},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,u,d){return u.toUpperCase()+d}),hasOwnProperty$3=(({hasOwnProperty:t})=>(e,a)=>t.call(e,a))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(t,e)=>{const a=Object.getOwnPropertyDescriptors(t),u={};forEach$2(a,(d,c)=>{let l;(l=e(d,c,t))!==!1&&(u[c]=l||d)}),Object.defineProperties(t,u)},freezeMethods=t=>{reduceDescriptors(t,(e,a)=>{if(isFunction$1(t)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const u=t[a];if(isFunction$1(u)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},toObjectSet=(t,e)=>{const a={},u=d=>{d.forEach(c=>{a[c]=!0})};return isArray$3(t)?u(t):u(String(t).split(e)),a},noop$3=()=>{},toFiniteNumber=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET$3={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(t=16,e=ALPHABET$3.ALPHA_DIGIT)=>{let a="";const{length:u}=e;for(;t--;)a+=e[Math.random()*u|0];return a};function isSpecCompliantForm(t){return!!(t&&isFunction$1(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const toJSONObject=t=>{const e=new Array(10),a=(u,d)=>{if(isObject$1(u)){if(e.indexOf(u)>=0)return;if(!("toJSON"in u)){e[d]=u;const c=isArray$3(u)?[]:{};return forEach$2(u,(l,m)=>{const I=a(l,d+1);!isUndefined(I)&&(c[m]=I)}),e[d]=void 0,c}}return u};return a(t,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=t=>t&&(isObject$1(t)||isFunction$1(t))&&isFunction$1(t.then)&&isFunction$1(t.catch),utils$P={isArray:isArray$3,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean:isBoolean$1,isObject:isObject$1,isPlainObject,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray:isTypedArray$1,isFileList,forEach:forEach$2,merge,extend,trim,stripBOM,inherits:inherits$A,toFlatObject,kindOf,kindOfTest,endsWith:endsWith$1,toArray:toArray$3,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$3,hasOwnProp:hasOwnProperty$3,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$3,toFiniteNumber,findKey,global:_global,isContextDefined,ALPHABET:ALPHABET$3,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};var buffer$4={},base64Js$1={};base64Js$1.byteLength=byteLength$1,base64Js$1.toByteArray=toByteArray$1,base64Js$1.fromByteArray=fromByteArray$1;for(var lookup$1=[],revLookup$1=[],Arr$1=typeof Uint8Array<"u"?Uint8Array:Array,code$1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$2=0,len$1=code$1.length;i$2<len$1;++i$2)lookup$1[i$2]=code$1[i$2],revLookup$1[code$1.charCodeAt(i$2)]=i$2;revLookup$1[45]=62,revLookup$1[95]=63;function getLens$1(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.indexOf("=");a===-1&&(a=e);var u=a===e?0:4-a%4;return[a,u]}function byteLength$1(t){var e=getLens$1(t),a=e[0],u=e[1];return(a+u)*3/4-u}function _byteLength$1(t,e,a){return(e+a)*3/4-a}function toByteArray$1(t){var e,a=getLens$1(t),u=a[0],d=a[1],c=new Arr$1(_byteLength$1(t,u,d)),l=0,m=d>0?u-4:u,I;for(I=0;I<m;I+=4)e=revLookup$1[t.charCodeAt(I)]<<18|revLookup$1[t.charCodeAt(I+1)]<<12|revLookup$1[t.charCodeAt(I+2)]<<6|revLookup$1[t.charCodeAt(I+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=e&255;return d===2&&(e=revLookup$1[t.charCodeAt(I)]<<2|revLookup$1[t.charCodeAt(I+1)]>>4,c[l++]=e&255),d===1&&(e=revLookup$1[t.charCodeAt(I)]<<10|revLookup$1[t.charCodeAt(I+1)]<<4|revLookup$1[t.charCodeAt(I+2)]>>2,c[l++]=e>>8&255,c[l++]=e&255),c}function tripletToBase64$1(t){return lookup$1[t>>18&63]+lookup$1[t>>12&63]+lookup$1[t>>6&63]+lookup$1[t&63]}function encodeChunk$1(t,e,a){for(var u,d=[],c=e;c<a;c+=3)u=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),d.push(tripletToBase64$1(u));return d.join("")}function fromByteArray$1(t){for(var e,a=t.length,u=a%3,d=[],c=16383,l=0,m=a-u;l<m;l+=c)d.push(encodeChunk$1(t,l,l+c>m?m:l+c));return u===1?(e=t[a-1],d.push(lookup$1[e>>2]+lookup$1[e<<4&63]+"==")):u===2&&(e=(t[a-2]<<8)+t[a-1],d.push(lookup$1[e>>10]+lookup$1[e>>4&63]+lookup$1[e<<2&63]+"=")),d.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(t,e,a,u,d){var c,l,m=d*8-u-1,I=(1<<m)-1,O=I>>1,T=-7,C=a?d-1:0,j=a?-1:1,F=t[e+C];for(C+=j,c=F&(1<<-T)-1,F>>=-T,T+=m;T>0;c=c*256+t[e+C],C+=j,T-=8);for(l=c&(1<<-T)-1,c>>=-T,T+=u;T>0;l=l*256+t[e+C],C+=j,T-=8);if(c===0)c=1-O;else{if(c===I)return l?NaN:(F?-1:1)*(1/0);l=l+Math.pow(2,u),c=c-O}return(F?-1:1)*l*Math.pow(2,c-u)},ieee754.write=function(t,e,a,u,d,c){var l,m,I,O=c*8-d-1,T=(1<<O)-1,C=T>>1,j=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=u?0:c-1,U=u?1:-1,Z=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,l=T):(l=Math.floor(Math.log(e)/Math.LN2),e*(I=Math.pow(2,-l))<1&&(l--,I*=2),l+C>=1?e+=j/I:e+=j*Math.pow(2,1-C),e*I>=2&&(l++,I/=2),l+C>=T?(m=0,l=T):l+C>=1?(m=(e*I-1)*Math.pow(2,d),l=l+C):(m=e*Math.pow(2,C-1)*Math.pow(2,d),l=0));d>=8;t[a+F]=m&255,F+=U,m/=256,d-=8);for(l=l<<d|m,O+=d;O>0;t[a+F]=l&255,F+=U,l/=256,O-=8);t[a+F-U]|=Z*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(t){const e=base64Js$1,a=ieee754,u=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=T,t.SlowBuffer=pe,t.INSPECT_MAX_BYTES=50;const d=2147483647;t.kMaxLength=d;const{Uint8Array:c,ArrayBuffer:l,SharedArrayBuffer:m}=globalThis;T.TYPED_ARRAY_SUPPORT=I(),!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function I(){try{const oe=new c(1),ee={foo:function(){return 42}};return Object.setPrototypeOf(ee,c.prototype),Object.setPrototypeOf(oe,ee),oe.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}}),Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function O(oe){if(oe>d)throw new RangeError('The value "'+oe+'" is invalid for option "size"');const ee=new c(oe);return Object.setPrototypeOf(ee,T.prototype),ee}function T(oe,ee,re){if(typeof oe=="number"){if(typeof ee=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return U(oe)}return C(oe,ee,re)}T.poolSize=8192;function C(oe,ee,re){if(typeof oe=="string")return Z(oe,ee);if(l.isView(oe))return X(oe);if(oe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe);if(Me(oe,l)||oe&&Me(oe.buffer,l)||typeof m<"u"&&(Me(oe,m)||oe&&Me(oe.buffer,m)))return Q(oe,ee,re);if(typeof oe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const be=oe.valueOf&&oe.valueOf();if(be!=null&&be!==oe)return T.from(be,ee,re);const Pe=te(oe);if(Pe)return Pe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oe[Symbol.toPrimitive]=="function")return T.from(oe[Symbol.toPrimitive]("string"),ee,re);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oe)}T.from=function(oe,ee,re){return C(oe,ee,re)},Object.setPrototypeOf(T.prototype,c.prototype),Object.setPrototypeOf(T,c);function j(oe){if(typeof oe!="number")throw new TypeError('"size" argument must be of type number');if(oe<0)throw new RangeError('The value "'+oe+'" is invalid for option "size"')}function F(oe,ee,re){return j(oe),oe<=0?O(oe):ee!==void 0?typeof re=="string"?O(oe).fill(ee,re):O(oe).fill(ee):O(oe)}T.alloc=function(oe,ee,re){return F(oe,ee,re)};function U(oe){return j(oe),O(oe<0?0:se(oe)|0)}T.allocUnsafe=function(oe){return U(oe)},T.allocUnsafeSlow=function(oe){return U(oe)};function Z(oe,ee){if((typeof ee!="string"||ee==="")&&(ee="utf8"),!T.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);const re=me(oe,ee)|0;let be=O(re);const Pe=be.write(oe,ee);return Pe!==re&&(be=be.slice(0,Pe)),be}function J(oe){const ee=oe.length<0?0:se(oe.length)|0,re=O(ee);for(let be=0;be<ee;be+=1)re[be]=oe[be]&255;return re}function X(oe){if(Me(oe,c)){const ee=new c(oe);return Q(ee.buffer,ee.byteOffset,ee.byteLength)}return J(oe)}function Q(oe,ee,re){if(ee<0||oe.byteLength<ee)throw new RangeError('"offset" is outside of buffer bounds');if(oe.byteLength<ee+(re||0))throw new RangeError('"length" is outside of buffer bounds');let be;return ee===void 0&&re===void 0?be=new c(oe):re===void 0?be=new c(oe,ee):be=new c(oe,ee,re),Object.setPrototypeOf(be,T.prototype),be}function te(oe){if(T.isBuffer(oe)){const ee=se(oe.length)|0,re=O(ee);return re.length===0||oe.copy(re,0,0,ee),re}if(oe.length!==void 0)return typeof oe.length!="number"||Ze(oe.length)?O(0):J(oe);if(oe.type==="Buffer"&&Array.isArray(oe.data))return J(oe.data)}function se(oe){if(oe>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return oe|0}function pe(oe){return+oe!=oe&&(oe=0),T.alloc(+oe)}T.isBuffer=function(ee){return ee!=null&&ee._isBuffer===!0&&ee!==T.prototype},T.compare=function(ee,re){if(Me(ee,c)&&(ee=T.from(ee,ee.offset,ee.byteLength)),Me(re,c)&&(re=T.from(re,re.offset,re.byteLength)),!T.isBuffer(ee)||!T.isBuffer(re))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ee===re)return 0;let be=ee.length,Pe=re.length;for(let Ne=0,Oe=Math.min(be,Pe);Ne<Oe;++Ne)if(ee[Ne]!==re[Ne]){be=ee[Ne],Pe=re[Ne];break}return be<Pe?-1:Pe<be?1:0},T.isEncoding=function(ee){switch(String(ee).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},T.concat=function(ee,re){if(!Array.isArray(ee))throw new TypeError('"list" argument must be an Array of Buffers');if(ee.length===0)return T.alloc(0);let be;if(re===void 0)for(re=0,be=0;be<ee.length;++be)re+=ee[be].length;const Pe=T.allocUnsafe(re);let Ne=0;for(be=0;be<ee.length;++be){let Oe=ee[be];if(Me(Oe,c))Ne+Oe.length>Pe.length?(T.isBuffer(Oe)||(Oe=T.from(Oe)),Oe.copy(Pe,Ne)):c.prototype.set.call(Pe,Oe,Ne);else if(T.isBuffer(Oe))Oe.copy(Pe,Ne);else throw new TypeError('"list" argument must be an Array of Buffers');Ne+=Oe.length}return Pe};function me(oe,ee){if(T.isBuffer(oe))return oe.length;if(l.isView(oe)||Me(oe,l))return oe.byteLength;if(typeof oe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oe);const re=oe.length,be=arguments.length>2&&arguments[2]===!0;if(!be&&re===0)return 0;let Pe=!1;for(;;)switch(ee){case"ascii":case"latin1":case"binary":return re;case"utf8":case"utf-8":return wt(oe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re*2;case"hex":return re>>>1;case"base64":return gt(oe).length;default:if(Pe)return be?-1:wt(oe).length;ee=(""+ee).toLowerCase(),Pe=!0}}T.byteLength=me;function Ee(oe,ee,re){let be=!1;if((ee===void 0||ee<0)&&(ee=0),ee>this.length||((re===void 0||re>this.length)&&(re=this.length),re<=0)||(re>>>=0,ee>>>=0,re<=ee))return"";for(oe||(oe="utf8");;)switch(oe){case"hex":return H(this,ee,re);case"utf8":case"utf-8":return L(this,ee,re);case"ascii":return A(this,ee,re);case"latin1":case"binary":return D(this,ee,re);case"base64":return P(this,ee,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,ee,re);default:if(be)throw new TypeError("Unknown encoding: "+oe);oe=(oe+"").toLowerCase(),be=!0}}T.prototype._isBuffer=!0;function V(oe,ee,re){const be=oe[ee];oe[ee]=oe[re],oe[re]=be}T.prototype.swap16=function(){const ee=this.length;if(ee%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let re=0;re<ee;re+=2)V(this,re,re+1);return this},T.prototype.swap32=function(){const ee=this.length;if(ee%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let re=0;re<ee;re+=4)V(this,re,re+3),V(this,re+1,re+2);return this},T.prototype.swap64=function(){const ee=this.length;if(ee%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let re=0;re<ee;re+=8)V(this,re,re+7),V(this,re+1,re+6),V(this,re+2,re+5),V(this,re+3,re+4);return this},T.prototype.toString=function(){const ee=this.length;return ee===0?"":arguments.length===0?L(this,0,ee):Ee.apply(this,arguments)},T.prototype.toLocaleString=T.prototype.toString,T.prototype.equals=function(ee){if(!T.isBuffer(ee))throw new TypeError("Argument must be a Buffer");return this===ee?!0:T.compare(this,ee)===0},T.prototype.inspect=function(){let ee="";const re=t.INSPECT_MAX_BYTES;return ee=this.toString("hex",0,re).replace(/(.{2})/g,"$1 ").trim(),this.length>re&&(ee+=" ... "),"<Buffer "+ee+">"},u&&(T.prototype[u]=T.prototype.inspect),T.prototype.compare=function(ee,re,be,Pe,Ne){if(Me(ee,c)&&(ee=T.from(ee,ee.offset,ee.byteLength)),!T.isBuffer(ee))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ee);if(re===void 0&&(re=0),be===void 0&&(be=ee?ee.length:0),Pe===void 0&&(Pe=0),Ne===void 0&&(Ne=this.length),re<0||be>ee.length||Pe<0||Ne>this.length)throw new RangeError("out of range index");if(Pe>=Ne&&re>=be)return 0;if(Pe>=Ne)return-1;if(re>=be)return 1;if(re>>>=0,be>>>=0,Pe>>>=0,Ne>>>=0,this===ee)return 0;let Oe=Ne-Pe,ut=be-re;const lt=Math.min(Oe,ut),Je=this.slice(Pe,Ne),bt=ee.slice(re,be);for(let vt=0;vt<lt;++vt)if(Je[vt]!==bt[vt]){Oe=Je[vt],ut=bt[vt];break}return Oe<ut?-1:ut<Oe?1:0};function ae(oe,ee,re,be,Pe){if(oe.length===0)return-1;if(typeof re=="string"?(be=re,re=0):re>2147483647?re=2147483647:re<-2147483648&&(re=-2147483648),re=+re,Ze(re)&&(re=Pe?0:oe.length-1),re<0&&(re=oe.length+re),re>=oe.length){if(Pe)return-1;re=oe.length-1}else if(re<0)if(Pe)re=0;else return-1;if(typeof ee=="string"&&(ee=T.from(ee,be)),T.isBuffer(ee))return ee.length===0?-1:ne(oe,ee,re,be,Pe);if(typeof ee=="number")return ee=ee&255,typeof c.prototype.indexOf=="function"?Pe?c.prototype.indexOf.call(oe,ee,re):c.prototype.lastIndexOf.call(oe,ee,re):ne(oe,[ee],re,be,Pe);throw new TypeError("val must be string, number or Buffer")}function ne(oe,ee,re,be,Pe){let Ne=1,Oe=oe.length,ut=ee.length;if(be!==void 0&&(be=String(be).toLowerCase(),be==="ucs2"||be==="ucs-2"||be==="utf16le"||be==="utf-16le")){if(oe.length<2||ee.length<2)return-1;Ne=2,Oe/=2,ut/=2,re/=2}function lt(bt,vt){return Ne===1?bt[vt]:bt.readUInt16BE(vt*Ne)}let Je;if(Pe){let bt=-1;for(Je=re;Je<Oe;Je++)if(lt(oe,Je)===lt(ee,bt===-1?0:Je-bt)){if(bt===-1&&(bt=Je),Je-bt+1===ut)return bt*Ne}else bt!==-1&&(Je-=Je-bt),bt=-1}else for(re+ut>Oe&&(re=Oe-ut),Je=re;Je>=0;Je--){let bt=!0;for(let vt=0;vt<ut;vt++)if(lt(oe,Je+vt)!==lt(ee,vt)){bt=!1;break}if(bt)return Je}return-1}T.prototype.includes=function(ee,re,be){return this.indexOf(ee,re,be)!==-1},T.prototype.indexOf=function(ee,re,be){return ae(this,ee,re,be,!0)},T.prototype.lastIndexOf=function(ee,re,be){return ae(this,ee,re,be,!1)};function M(oe,ee,re,be){re=Number(re)||0;const Pe=oe.length-re;be?(be=Number(be),be>Pe&&(be=Pe)):be=Pe;const Ne=ee.length;be>Ne/2&&(be=Ne/2);let Oe;for(Oe=0;Oe<be;++Oe){const ut=parseInt(ee.substr(Oe*2,2),16);if(Ze(ut))return Oe;oe[re+Oe]=ut}return Oe}function v(oe,ee,re,be){return $e(wt(ee,oe.length-re),oe,re,be)}function S(oe,ee,re,be){return $e(et(ee),oe,re,be)}function y(oe,ee,re,be){return $e(gt(ee),oe,re,be)}function w(oe,ee,re,be){return $e(At(ee,oe.length-re),oe,re,be)}T.prototype.write=function(ee,re,be,Pe){if(re===void 0)Pe="utf8",be=this.length,re=0;else if(be===void 0&&typeof re=="string")Pe=re,be=this.length,re=0;else if(isFinite(re))re=re>>>0,isFinite(be)?(be=be>>>0,Pe===void 0&&(Pe="utf8")):(Pe=be,be=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Ne=this.length-re;if((be===void 0||be>Ne)&&(be=Ne),ee.length>0&&(be<0||re<0)||re>this.length)throw new RangeError("Attempt to write outside buffer bounds");Pe||(Pe="utf8");let Oe=!1;for(;;)switch(Pe){case"hex":return M(this,ee,re,be);case"utf8":case"utf-8":return v(this,ee,re,be);case"ascii":case"latin1":case"binary":return S(this,ee,re,be);case"base64":return y(this,ee,re,be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,ee,re,be);default:if(Oe)throw new TypeError("Unknown encoding: "+Pe);Pe=(""+Pe).toLowerCase(),Oe=!0}},T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(oe,ee,re){return ee===0&&re===oe.length?e.fromByteArray(oe):e.fromByteArray(oe.slice(ee,re))}function L(oe,ee,re){re=Math.min(oe.length,re);const be=[];let Pe=ee;for(;Pe<re;){const Ne=oe[Pe];let Oe=null,ut=Ne>239?4:Ne>223?3:Ne>191?2:1;if(Pe+ut<=re){let lt,Je,bt,vt;switch(ut){case 1:Ne<128&&(Oe=Ne);break;case 2:lt=oe[Pe+1],(lt&192)===128&&(vt=(Ne&31)<<6|lt&63,vt>127&&(Oe=vt));break;case 3:lt=oe[Pe+1],Je=oe[Pe+2],(lt&192)===128&&(Je&192)===128&&(vt=(Ne&15)<<12|(lt&63)<<6|Je&63,vt>2047&&(vt<55296||vt>57343)&&(Oe=vt));break;case 4:lt=oe[Pe+1],Je=oe[Pe+2],bt=oe[Pe+3],(lt&192)===128&&(Je&192)===128&&(bt&192)===128&&(vt=(Ne&15)<<18|(lt&63)<<12|(Je&63)<<6|bt&63,vt>65535&&vt<1114112&&(Oe=vt))}}Oe===null?(Oe=65533,ut=1):Oe>65535&&(Oe-=65536,be.push(Oe>>>10&1023|55296),Oe=56320|Oe&1023),be.push(Oe),Pe+=ut}return E(be)}const N=4096;function E(oe){const ee=oe.length;if(ee<=N)return String.fromCharCode.apply(String,oe);let re="",be=0;for(;be<ee;)re+=String.fromCharCode.apply(String,oe.slice(be,be+=N));return re}function A(oe,ee,re){let be="";re=Math.min(oe.length,re);for(let Pe=ee;Pe<re;++Pe)be+=String.fromCharCode(oe[Pe]&127);return be}function D(oe,ee,re){let be="";re=Math.min(oe.length,re);for(let Pe=ee;Pe<re;++Pe)be+=String.fromCharCode(oe[Pe]);return be}function H(oe,ee,re){const be=oe.length;(!ee||ee<0)&&(ee=0),(!re||re<0||re>be)&&(re=be);let Pe="";for(let Ne=ee;Ne<re;++Ne)Pe+=ze[oe[Ne]];return Pe}function Y(oe,ee,re){const be=oe.slice(ee,re);let Pe="";for(let Ne=0;Ne<be.length-1;Ne+=2)Pe+=String.fromCharCode(be[Ne]+be[Ne+1]*256);return Pe}T.prototype.slice=function(ee,re){const be=this.length;ee=~~ee,re=re===void 0?be:~~re,ee<0?(ee+=be,ee<0&&(ee=0)):ee>be&&(ee=be),re<0?(re+=be,re<0&&(re=0)):re>be&&(re=be),re<ee&&(re=ee);const Pe=this.subarray(ee,re);return Object.setPrototypeOf(Pe,T.prototype),Pe};function le(oe,ee,re){if(oe%1!==0||oe<0)throw new RangeError("offset is not uint");if(oe+ee>re)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(ee,re,be){ee=ee>>>0,re=re>>>0,be||le(ee,re,this.length);let Pe=this[ee],Ne=1,Oe=0;for(;++Oe<re&&(Ne*=256);)Pe+=this[ee+Oe]*Ne;return Pe},T.prototype.readUintBE=T.prototype.readUIntBE=function(ee,re,be){ee=ee>>>0,re=re>>>0,be||le(ee,re,this.length);let Pe=this[ee+--re],Ne=1;for(;re>0&&(Ne*=256);)Pe+=this[ee+--re]*Ne;return Pe},T.prototype.readUint8=T.prototype.readUInt8=function(ee,re){return ee=ee>>>0,re||le(ee,1,this.length),this[ee]},T.prototype.readUint16LE=T.prototype.readUInt16LE=function(ee,re){return ee=ee>>>0,re||le(ee,2,this.length),this[ee]|this[ee+1]<<8},T.prototype.readUint16BE=T.prototype.readUInt16BE=function(ee,re){return ee=ee>>>0,re||le(ee,2,this.length),this[ee]<<8|this[ee+1]},T.prototype.readUint32LE=T.prototype.readUInt32LE=function(ee,re){return ee=ee>>>0,re||le(ee,4,this.length),(this[ee]|this[ee+1]<<8|this[ee+2]<<16)+this[ee+3]*16777216},T.prototype.readUint32BE=T.prototype.readUInt32BE=function(ee,re){return ee=ee>>>0,re||le(ee,4,this.length),this[ee]*16777216+(this[ee+1]<<16|this[ee+2]<<8|this[ee+3])},T.prototype.readBigUInt64LE=Ge(function(ee){ee=ee>>>0,Qe(ee,"offset");const re=this[ee],be=this[ee+7];(re===void 0||be===void 0)&&it(ee,this.length-8);const Pe=re+this[++ee]*2**8+this[++ee]*2**16+this[++ee]*2**24,Ne=this[++ee]+this[++ee]*2**8+this[++ee]*2**16+be*2**24;return BigInt(Pe)+(BigInt(Ne)<<BigInt(32))}),T.prototype.readBigUInt64BE=Ge(function(ee){ee=ee>>>0,Qe(ee,"offset");const re=this[ee],be=this[ee+7];(re===void 0||be===void 0)&&it(ee,this.length-8);const Pe=re*2**24+this[++ee]*2**16+this[++ee]*2**8+this[++ee],Ne=this[++ee]*2**24+this[++ee]*2**16+this[++ee]*2**8+be;return(BigInt(Pe)<<BigInt(32))+BigInt(Ne)}),T.prototype.readIntLE=function(ee,re,be){ee=ee>>>0,re=re>>>0,be||le(ee,re,this.length);let Pe=this[ee],Ne=1,Oe=0;for(;++Oe<re&&(Ne*=256);)Pe+=this[ee+Oe]*Ne;return Ne*=128,Pe>=Ne&&(Pe-=Math.pow(2,8*re)),Pe},T.prototype.readIntBE=function(ee,re,be){ee=ee>>>0,re=re>>>0,be||le(ee,re,this.length);let Pe=re,Ne=1,Oe=this[ee+--Pe];for(;Pe>0&&(Ne*=256);)Oe+=this[ee+--Pe]*Ne;return Ne*=128,Oe>=Ne&&(Oe-=Math.pow(2,8*re)),Oe},T.prototype.readInt8=function(ee,re){return ee=ee>>>0,re||le(ee,1,this.length),this[ee]&128?(255-this[ee]+1)*-1:this[ee]},T.prototype.readInt16LE=function(ee,re){ee=ee>>>0,re||le(ee,2,this.length);const be=this[ee]|this[ee+1]<<8;return be&32768?be|4294901760:be},T.prototype.readInt16BE=function(ee,re){ee=ee>>>0,re||le(ee,2,this.length);const be=this[ee+1]|this[ee]<<8;return be&32768?be|4294901760:be},T.prototype.readInt32LE=function(ee,re){return ee=ee>>>0,re||le(ee,4,this.length),this[ee]|this[ee+1]<<8|this[ee+2]<<16|this[ee+3]<<24},T.prototype.readInt32BE=function(ee,re){return ee=ee>>>0,re||le(ee,4,this.length),this[ee]<<24|this[ee+1]<<16|this[ee+2]<<8|this[ee+3]},T.prototype.readBigInt64LE=Ge(function(ee){ee=ee>>>0,Qe(ee,"offset");const re=this[ee],be=this[ee+7];(re===void 0||be===void 0)&&it(ee,this.length-8);const Pe=this[ee+4]+this[ee+5]*2**8+this[ee+6]*2**16+(be<<24);return(BigInt(Pe)<<BigInt(32))+BigInt(re+this[++ee]*2**8+this[++ee]*2**16+this[++ee]*2**24)}),T.prototype.readBigInt64BE=Ge(function(ee){ee=ee>>>0,Qe(ee,"offset");const re=this[ee],be=this[ee+7];(re===void 0||be===void 0)&&it(ee,this.length-8);const Pe=(re<<24)+this[++ee]*2**16+this[++ee]*2**8+this[++ee];return(BigInt(Pe)<<BigInt(32))+BigInt(this[++ee]*2**24+this[++ee]*2**16+this[++ee]*2**8+be)}),T.prototype.readFloatLE=function(ee,re){return ee=ee>>>0,re||le(ee,4,this.length),a.read(this,ee,!0,23,4)},T.prototype.readFloatBE=function(ee,re){return ee=ee>>>0,re||le(ee,4,this.length),a.read(this,ee,!1,23,4)},T.prototype.readDoubleLE=function(ee,re){return ee=ee>>>0,re||le(ee,8,this.length),a.read(this,ee,!0,52,8)},T.prototype.readDoubleBE=function(ee,re){return ee=ee>>>0,re||le(ee,8,this.length),a.read(this,ee,!1,52,8)};function _e(oe,ee,re,be,Pe,Ne){if(!T.isBuffer(oe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ee>Pe||ee<Ne)throw new RangeError('"value" argument is out of bounds');if(re+be>oe.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(ee,re,be,Pe){if(ee=+ee,re=re>>>0,be=be>>>0,!Pe){const ut=Math.pow(2,8*be)-1;_e(this,ee,re,be,ut,0)}let Ne=1,Oe=0;for(this[re]=ee&255;++Oe<be&&(Ne*=256);)this[re+Oe]=ee/Ne&255;return re+be},T.prototype.writeUintBE=T.prototype.writeUIntBE=function(ee,re,be,Pe){if(ee=+ee,re=re>>>0,be=be>>>0,!Pe){const ut=Math.pow(2,8*be)-1;_e(this,ee,re,be,ut,0)}let Ne=be-1,Oe=1;for(this[re+Ne]=ee&255;--Ne>=0&&(Oe*=256);)this[re+Ne]=ee/Oe&255;return re+be},T.prototype.writeUint8=T.prototype.writeUInt8=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,1,255,0),this[re]=ee&255,re+1},T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,2,65535,0),this[re]=ee&255,this[re+1]=ee>>>8,re+2},T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,2,65535,0),this[re]=ee>>>8,this[re+1]=ee&255,re+2},T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,4,4294967295,0),this[re+3]=ee>>>24,this[re+2]=ee>>>16,this[re+1]=ee>>>8,this[re]=ee&255,re+4},T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,4,4294967295,0),this[re]=ee>>>24,this[re+1]=ee>>>16,this[re+2]=ee>>>8,this[re+3]=ee&255,re+4};function he(oe,ee,re,be,Pe){He(ee,be,Pe,oe,re,7);let Ne=Number(ee&BigInt(4294967295));oe[re++]=Ne,Ne=Ne>>8,oe[re++]=Ne,Ne=Ne>>8,oe[re++]=Ne,Ne=Ne>>8,oe[re++]=Ne;let Oe=Number(ee>>BigInt(32)&BigInt(4294967295));return oe[re++]=Oe,Oe=Oe>>8,oe[re++]=Oe,Oe=Oe>>8,oe[re++]=Oe,Oe=Oe>>8,oe[re++]=Oe,re}function fe(oe,ee,re,be,Pe){He(ee,be,Pe,oe,re,7);let Ne=Number(ee&BigInt(4294967295));oe[re+7]=Ne,Ne=Ne>>8,oe[re+6]=Ne,Ne=Ne>>8,oe[re+5]=Ne,Ne=Ne>>8,oe[re+4]=Ne;let Oe=Number(ee>>BigInt(32)&BigInt(4294967295));return oe[re+3]=Oe,Oe=Oe>>8,oe[re+2]=Oe,Oe=Oe>>8,oe[re+1]=Oe,Oe=Oe>>8,oe[re]=Oe,re+8}T.prototype.writeBigUInt64LE=Ge(function(ee,re=0){return he(this,ee,re,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeBigUInt64BE=Ge(function(ee,re=0){return fe(this,ee,re,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeIntLE=function(ee,re,be,Pe){if(ee=+ee,re=re>>>0,!Pe){const lt=Math.pow(2,8*be-1);_e(this,ee,re,be,lt-1,-lt)}let Ne=0,Oe=1,ut=0;for(this[re]=ee&255;++Ne<be&&(Oe*=256);)ee<0&&ut===0&&this[re+Ne-1]!==0&&(ut=1),this[re+Ne]=(ee/Oe>>0)-ut&255;return re+be},T.prototype.writeIntBE=function(ee,re,be,Pe){if(ee=+ee,re=re>>>0,!Pe){const lt=Math.pow(2,8*be-1);_e(this,ee,re,be,lt-1,-lt)}let Ne=be-1,Oe=1,ut=0;for(this[re+Ne]=ee&255;--Ne>=0&&(Oe*=256);)ee<0&&ut===0&&this[re+Ne+1]!==0&&(ut=1),this[re+Ne]=(ee/Oe>>0)-ut&255;return re+be},T.prototype.writeInt8=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,1,127,-128),ee<0&&(ee=255+ee+1),this[re]=ee&255,re+1},T.prototype.writeInt16LE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,2,32767,-32768),this[re]=ee&255,this[re+1]=ee>>>8,re+2},T.prototype.writeInt16BE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,2,32767,-32768),this[re]=ee>>>8,this[re+1]=ee&255,re+2},T.prototype.writeInt32LE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,4,2147483647,-2147483648),this[re]=ee&255,this[re+1]=ee>>>8,this[re+2]=ee>>>16,this[re+3]=ee>>>24,re+4},T.prototype.writeInt32BE=function(ee,re,be){return ee=+ee,re=re>>>0,be||_e(this,ee,re,4,2147483647,-2147483648),ee<0&&(ee=4294967295+ee+1),this[re]=ee>>>24,this[re+1]=ee>>>16,this[re+2]=ee>>>8,this[re+3]=ee&255,re+4},T.prototype.writeBigInt64LE=Ge(function(ee,re=0){return he(this,ee,re,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),T.prototype.writeBigInt64BE=Ge(function(ee,re=0){return fe(this,ee,re,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ve(oe,ee,re,be,Pe,Ne){if(re+be>oe.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("Index out of range")}function ge(oe,ee,re,be,Pe){return ee=+ee,re=re>>>0,Pe||ve(oe,ee,re,4),a.write(oe,ee,re,be,23,4),re+4}T.prototype.writeFloatLE=function(ee,re,be){return ge(this,ee,re,!0,be)},T.prototype.writeFloatBE=function(ee,re,be){return ge(this,ee,re,!1,be)};function Ie(oe,ee,re,be,Pe){return ee=+ee,re=re>>>0,Pe||ve(oe,ee,re,8),a.write(oe,ee,re,be,52,8),re+8}T.prototype.writeDoubleLE=function(ee,re,be){return Ie(this,ee,re,!0,be)},T.prototype.writeDoubleBE=function(ee,re,be){return Ie(this,ee,re,!1,be)},T.prototype.copy=function(ee,re,be,Pe){if(!T.isBuffer(ee))throw new TypeError("argument should be a Buffer");if(be||(be=0),!Pe&&Pe!==0&&(Pe=this.length),re>=ee.length&&(re=ee.length),re||(re=0),Pe>0&&Pe<be&&(Pe=be),Pe===be||ee.length===0||this.length===0)return 0;if(re<0)throw new RangeError("targetStart out of bounds");if(be<0||be>=this.length)throw new RangeError("Index out of range");if(Pe<0)throw new RangeError("sourceEnd out of bounds");Pe>this.length&&(Pe=this.length),ee.length-re<Pe-be&&(Pe=ee.length-re+be);const Ne=Pe-be;return this===ee&&typeof c.prototype.copyWithin=="function"?this.copyWithin(re,be,Pe):c.prototype.set.call(ee,this.subarray(be,Pe),re),Ne},T.prototype.fill=function(ee,re,be,Pe){if(typeof ee=="string"){if(typeof re=="string"?(Pe=re,re=0,be=this.length):typeof be=="string"&&(Pe=be,be=this.length),Pe!==void 0&&typeof Pe!="string")throw new TypeError("encoding must be a string");if(typeof Pe=="string"&&!T.isEncoding(Pe))throw new TypeError("Unknown encoding: "+Pe);if(ee.length===1){const Oe=ee.charCodeAt(0);(Pe==="utf8"&&Oe<128||Pe==="latin1")&&(ee=Oe)}}else typeof ee=="number"?ee=ee&255:typeof ee=="boolean"&&(ee=Number(ee));if(re<0||this.length<re||this.length<be)throw new RangeError("Out of range index");if(be<=re)return this;re=re>>>0,be=be===void 0?this.length:be>>>0,ee||(ee=0);let Ne;if(typeof ee=="number")for(Ne=re;Ne<be;++Ne)this[Ne]=ee;else{const Oe=T.isBuffer(ee)?ee:T.from(ee,Pe),ut=Oe.length;if(ut===0)throw new TypeError('The value "'+ee+'" is invalid for argument "value"');for(Ne=0;Ne<be-re;++Ne)this[Ne+re]=Oe[Ne%ut]}return this};const ue={};function ce(oe,ee,re){ue[oe]=class extends re{constructor(){super(),Object.defineProperty(this,"message",{value:ee.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${oe}]`,this.stack,delete this.name}get code(){return oe}set code(Pe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Pe,writable:!0})}toString(){return`${this.name} [${oe}]: ${this.message}`}}}ce("ERR_BUFFER_OUT_OF_BOUNDS",function(oe){return oe?`${oe} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ce("ERR_INVALID_ARG_TYPE",function(oe,ee){return`The "${oe}" argument must be of type number. Received type ${typeof ee}`},TypeError),ce("ERR_OUT_OF_RANGE",function(oe,ee,re){let be=`The value of "${oe}" is out of range.`,Pe=re;return Number.isInteger(re)&&Math.abs(re)>2**32?Pe=Te(String(re)):typeof re=="bigint"&&(Pe=String(re),(re>BigInt(2)**BigInt(32)||re<-(BigInt(2)**BigInt(32)))&&(Pe=Te(Pe)),Pe+="n"),be+=` It must be ${ee}. Received ${Pe}`,be},RangeError);function Te(oe){let ee="",re=oe.length;const be=oe[0]==="-"?1:0;for(;re>=be+4;re-=3)ee=`_${oe.slice(re-3,re)}${ee}`;return`${oe.slice(0,re)}${ee}`}function ke(oe,ee,re){Qe(ee,"offset"),(oe[ee]===void 0||oe[ee+re]===void 0)&&it(ee,oe.length-(re+1))}function He(oe,ee,re,be,Pe,Ne){if(oe>re||oe<ee){const Oe=typeof ee=="bigint"?"n":"";let ut;throw Ne>3?ee===0||ee===BigInt(0)?ut=`>= 0${Oe} and < 2${Oe} ** ${(Ne+1)*8}${Oe}`:ut=`>= -(2${Oe} ** ${(Ne+1)*8-1}${Oe}) and < 2 ** ${(Ne+1)*8-1}${Oe}`:ut=`>= ${ee}${Oe} and <= ${re}${Oe}`,new ue.ERR_OUT_OF_RANGE("value",ut,oe)}ke(be,Pe,Ne)}function Qe(oe,ee){if(typeof oe!="number")throw new ue.ERR_INVALID_ARG_TYPE(ee,"number",oe)}function it(oe,ee,re){throw Math.floor(oe)!==oe?(Qe(oe,re),new ue.ERR_OUT_OF_RANGE(re||"offset","an integer",oe)):ee<0?new ue.ERR_BUFFER_OUT_OF_BOUNDS:new ue.ERR_OUT_OF_RANGE(re||"offset",`>= ${re?1:0} and <= ${ee}`,oe)}const rt=/[^+/0-9A-Za-z-_]/g;function Fe(oe){if(oe=oe.split("=")[0],oe=oe.trim().replace(rt,""),oe.length<2)return"";for(;oe.length%4!==0;)oe=oe+"=";return oe}function wt(oe,ee){ee=ee||1/0;let re;const be=oe.length;let Pe=null;const Ne=[];for(let Oe=0;Oe<be;++Oe){if(re=oe.charCodeAt(Oe),re>55295&&re<57344){if(!Pe){if(re>56319){(ee-=3)>-1&&Ne.push(239,191,189);continue}else if(Oe+1===be){(ee-=3)>-1&&Ne.push(239,191,189);continue}Pe=re;continue}if(re<56320){(ee-=3)>-1&&Ne.push(239,191,189),Pe=re;continue}re=(Pe-55296<<10|re-56320)+65536}else Pe&&(ee-=3)>-1&&Ne.push(239,191,189);if(Pe=null,re<128){if((ee-=1)<0)break;Ne.push(re)}else if(re<2048){if((ee-=2)<0)break;Ne.push(re>>6|192,re&63|128)}else if(re<65536){if((ee-=3)<0)break;Ne.push(re>>12|224,re>>6&63|128,re&63|128)}else if(re<1114112){if((ee-=4)<0)break;Ne.push(re>>18|240,re>>12&63|128,re>>6&63|128,re&63|128)}else throw new Error("Invalid code point")}return Ne}function et(oe){const ee=[];for(let re=0;re<oe.length;++re)ee.push(oe.charCodeAt(re)&255);return ee}function At(oe,ee){let re,be,Pe;const Ne=[];for(let Oe=0;Oe<oe.length&&!((ee-=2)<0);++Oe)re=oe.charCodeAt(Oe),be=re>>8,Pe=re%256,Ne.push(Pe),Ne.push(be);return Ne}function gt(oe){return e.toByteArray(Fe(oe))}function $e(oe,ee,re,be){let Pe;for(Pe=0;Pe<be&&!(Pe+re>=ee.length||Pe>=oe.length);++Pe)ee[Pe+re]=oe[Pe];return Pe}function Me(oe,ee){return oe instanceof ee||oe!=null&&oe.constructor!=null&&oe.constructor.name!=null&&oe.constructor.name===ee.name}function Ze(oe){return oe!==oe}const ze=function(){const oe="0123456789abcdef",ee=new Array(256);for(let re=0;re<16;++re){const be=re*16;for(let Pe=0;Pe<16;++Pe)ee[be+Pe]=oe[re]+oe[Pe]}return ee}();function Ge(oe){return typeof BigInt>"u"?ht:oe}function ht(){throw new Error("BigInt not supported")}})(buffer$4);const Buffer$N=buffer$4.Buffer,Blob$2=buffer$4.Blob,BlobOptions=buffer$4.BlobOptions,Buffer$1$1=buffer$4.Buffer,File=buffer$4.File,FileOptions=buffer$4.FileOptions,INSPECT_MAX_BYTES=buffer$4.INSPECT_MAX_BYTES,SlowBuffer=buffer$4.SlowBuffer,TranscodeEncoding=buffer$4.TranscodeEncoding,atob=buffer$4.atob,btoa$1=buffer$4.btoa,constants$1=buffer$4.constants,isAscii=buffer$4.isAscii,isUtf8=buffer$4.isUtf8,kMaxLength=buffer$4.kMaxLength,kStringMaxLength=buffer$4.kStringMaxLength,resolveObjectURL=buffer$4.resolveObjectURL,transcode=buffer$4.transcode,dist$1=Object.freeze(Object.defineProperty({__proto__:null,Blob:Blob$2,BlobOptions,Buffer:Buffer$1$1,File,FileOptions,INSPECT_MAX_BYTES,SlowBuffer,TranscodeEncoding,atob,btoa:btoa$1,constants:constants$1,default:Buffer$N,isAscii,isUtf8,kMaxLength,kStringMaxLength,resolveObjectURL,transcode},Symbol.toStringTag,{value:"Module"}));function AxiosError(t,e,a,u,d){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),a&&(this.config=a),u&&(this.request=u),d&&(this.response=d)}utils$P.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{descriptors[t]={value:t}}),Object.defineProperties(AxiosError,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError.from=(t,e,a,u,d,c)=>{const l=Object.create(prototype$1);return utils$P.toFlatObject(t,l,function(I){return I!==Error.prototype},m=>m!=="isAxiosError"),AxiosError.call(l,t.message,e,a,u,d),l.cause=t,l.name=t.name,c&&Object.assign(l,c),l};const httpAdapter=null;function isVisitable(t){return utils$P.isPlainObject(t)||utils$P.isArray(t)}function removeBrackets(t){return utils$P.endsWith(t,"[]")?t.slice(0,-2):t}function renderKey(t,e,a){return t?t.concat(e).map(function(d,c){return d=removeBrackets(d),!a&&c?"["+d+"]":d}).join(a?".":""):e}function isFlatArray(t){return utils$P.isArray(t)&&!t.some(isVisitable)}const predicates=utils$P.toFlatObject(utils$P,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(t,e,a){if(!utils$P.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,a=utils$P.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Z,J){return!utils$P.isUndefined(J[Z])});const u=a.metaTokens,d=a.visitor||T,c=a.dots,l=a.indexes,I=(a.Blob||typeof Blob<"u"&&Blob)&&utils$P.isSpecCompliantForm(e);if(!utils$P.isFunction(d))throw new TypeError("visitor must be a function");function O(U){if(U===null)return"";if(utils$P.isDate(U))return U.toISOString();if(!I&&utils$P.isBlob(U))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$P.isArrayBuffer(U)||utils$P.isTypedArray(U)?I&&typeof Blob=="function"?new Blob([U]):Buffer$N.from(U):U}function T(U,Z,J){let X=U;if(U&&!J&&typeof U=="object"){if(utils$P.endsWith(Z,"{}"))Z=u?Z:Z.slice(0,-2),U=JSON.stringify(U);else if(utils$P.isArray(U)&&isFlatArray(U)||(utils$P.isFileList(U)||utils$P.endsWith(Z,"[]"))&&(X=utils$P.toArray(U)))return Z=removeBrackets(Z),X.forEach(function(te,se){!(utils$P.isUndefined(te)||te===null)&&e.append(l===!0?renderKey([Z],se,c):l===null?Z:Z+"[]",O(te))}),!1}return isVisitable(U)?!0:(e.append(renderKey(J,Z,c),O(U)),!1)}const C=[],j=Object.assign(predicates,{defaultVisitor:T,convertValue:O,isVisitable});function F(U,Z){if(!utils$P.isUndefined(U)){if(C.indexOf(U)!==-1)throw Error("Circular reference detected in "+Z.join("."));C.push(U),utils$P.forEach(U,function(X,Q){(!(utils$P.isUndefined(X)||X===null)&&d.call(e,X,utils$P.isString(Q)?Q.trim():Q,Z,j))===!0&&F(X,Z?Z.concat(Q):[Q])}),C.pop()}}if(!utils$P.isObject(t))throw new TypeError("data must be an object");return F(t),e}function encode$5(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(u){return e[u]})}function AxiosURLSearchParams(t,e){this._pairs=[],t&&toFormData(t,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,a){this._pairs.push([e,a])},prototype.toString=function(e){const a=e?function(u){return e.call(this,u,encode$5)}:encode$5;return this._pairs.map(function(d){return a(d[0])+"="+a(d[1])},"").join("&")};function encode$4(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(t,e,a){if(!e)return t;const u=a&&a.encode||encode$4,d=a&&a.serialize;let c;if(d?c=d(e,a):c=utils$P.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,a).toString(u),c){const l=t.indexOf("#");l!==-1&&(t=t.slice(0,l)),t+=(t.indexOf("?")===-1?"?":"&")+c}return t}class InterceptorManager{constructor(){this.handlers=[]}use(e,a,u){return this.handlers.push({fulfilled:e,rejected:a,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils$P.forEach(this.handlers,function(u){u!==null&&e(u)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$2=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$2,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv=(t=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",utils$O=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv},Symbol.toStringTag,{value:"Module"})),platform={...utils$O,...platform$1};function toURLEncodedForm(t,e){return toFormData(t,new platform.classes.URLSearchParams,Object.assign({visitor:function(a,u,d,c){return platform.isNode&&utils$P.isBuffer(a)?(this.append(u,a.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(t){return utils$P.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(t){const e={},a=Object.keys(t);let u;const d=a.length;let c;for(u=0;u<d;u++)c=a[u],e[c]=t[c];return e}function formDataToJSON(t){function e(a,u,d,c){let l=a[c++];if(l==="__proto__")return!0;const m=Number.isFinite(+l),I=c>=a.length;return l=!l&&utils$P.isArray(d)?d.length:l,I?(utils$P.hasOwnProp(d,l)?d[l]=[d[l],u]:d[l]=u,!m):((!d[l]||!utils$P.isObject(d[l]))&&(d[l]=[]),e(a,u,d[l],c)&&utils$P.isArray(d[l])&&(d[l]=arrayToObject(d[l])),!m)}if(utils$P.isFormData(t)&&utils$P.isFunction(t.entries)){const a={};return utils$P.forEachEntry(t,(u,d)=>{e(parsePropPath(u),d,a,0)}),a}return null}function stringifySafely(t,e,a){if(utils$P.isString(t))try{return(e||JSON.parse)(t),utils$P.trim(t)}catch(u){if(u.name!=="SyntaxError")throw u}return(a||JSON.stringify)(t)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(e,a){const u=a.getContentType()||"",d=u.indexOf("application/json")>-1,c=utils$P.isObject(e);if(c&&utils$P.isHTMLForm(e)&&(e=new FormData(e)),utils$P.isFormData(e))return d?JSON.stringify(formDataToJSON(e)):e;if(utils$P.isArrayBuffer(e)||utils$P.isBuffer(e)||utils$P.isStream(e)||utils$P.isFile(e)||utils$P.isBlob(e))return e;if(utils$P.isArrayBufferView(e))return e.buffer;if(utils$P.isURLSearchParams(e))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let m;if(c){if(u.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((m=utils$P.isFileList(e))||u.indexOf("multipart/form-data")>-1){const I=this.env&&this.env.FormData;return toFormData(m?{"files[]":e}:e,I&&new I,this.formSerializer)}}return c||d?(a.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const a=this.transitional||defaults.transitional,u=a&&a.forcedJSONParsing,d=this.responseType==="json";if(e&&utils$P.isString(e)&&(u&&!this.responseType||d)){const l=!(a&&a.silentJSONParsing)&&d;try{return JSON.parse(e)}catch(m){if(l)throw m.name==="SyntaxError"?AxiosError.from(m,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):m}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$P.forEach(["delete","get","head","post","put","patch"],t=>{defaults.headers[t]={}});const defaults$1=defaults,ignoreDuplicateOf=utils$P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=t=>{const e={};let a,u,d;return t&&t.split(`
7
+ `).forEach(function(l){d=l.indexOf(":"),a=l.substring(0,d).trim().toLowerCase(),u=l.substring(d+1).trim(),!(!a||e[a]&&ignoreDuplicateOf[a])&&(a==="set-cookie"?e[a]?e[a].push(u):e[a]=[u]:e[a]=e[a]?e[a]+", "+u:u)}),e},$internals=Symbol("internals");function normalizeHeader(t){return t&&String(t).trim().toLowerCase()}function normalizeValue(t){return t===!1||t==null?t:utils$P.isArray(t)?t.map(normalizeValue):String(t)}function parseTokens(t){const e=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=a.exec(t);)e[u[1]]=u[2];return e}const isValidHeaderName=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function matchHeaderValue(t,e,a,u,d){if(utils$P.isFunction(u))return u.call(this,e,a);if(d&&(e=a),!!utils$P.isString(e)){if(utils$P.isString(u))return e.indexOf(u)!==-1;if(utils$P.isRegExp(u))return u.test(e)}}function formatHeader(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,a,u)=>a.toUpperCase()+u)}function buildAccessors(t,e){const a=utils$P.toCamelCase(" "+e);["get","set","has"].forEach(u=>{Object.defineProperty(t,u+a,{value:function(d,c,l){return this[u].call(this,e,d,c,l)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,a,u){const d=this;function c(m,I,O){const T=normalizeHeader(I);if(!T)throw new Error("header name must be a non-empty string");const C=utils$P.findKey(d,T);(!C||d[C]===void 0||O===!0||O===void 0&&d[C]!==!1)&&(d[C||I]=normalizeValue(m))}const l=(m,I)=>utils$P.forEach(m,(O,T)=>c(O,T,I));return utils$P.isPlainObject(e)||e instanceof this.constructor?l(e,a):utils$P.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)?l(parseHeaders(e),a):e!=null&&c(a,e,u),this}get(e,a){if(e=normalizeHeader(e),e){const u=utils$P.findKey(this,e);if(u){const d=this[u];if(!a)return d;if(a===!0)return parseTokens(d);if(utils$P.isFunction(a))return a.call(this,d,u);if(utils$P.isRegExp(a))return a.exec(d);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,a){if(e=normalizeHeader(e),e){const u=utils$P.findKey(this,e);return!!(u&&this[u]!==void 0&&(!a||matchHeaderValue(this,this[u],u,a)))}return!1}delete(e,a){const u=this;let d=!1;function c(l){if(l=normalizeHeader(l),l){const m=utils$P.findKey(u,l);m&&(!a||matchHeaderValue(u,u[m],m,a))&&(delete u[m],d=!0)}}return utils$P.isArray(e)?e.forEach(c):c(e),d}clear(e){const a=Object.keys(this);let u=a.length,d=!1;for(;u--;){const c=a[u];(!e||matchHeaderValue(this,this[c],c,e,!0))&&(delete this[c],d=!0)}return d}normalize(e){const a=this,u={};return utils$P.forEach(this,(d,c)=>{const l=utils$P.findKey(u,c);if(l){a[l]=normalizeValue(d),delete a[c];return}const m=e?formatHeader(c):String(c).trim();m!==c&&delete a[c],a[m]=normalizeValue(d),u[m]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const a=Object.create(null);return utils$P.forEach(this,(u,d)=>{u!=null&&u!==!1&&(a[d]=e&&utils$P.isArray(u)?u.join(", "):u)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,a])=>e+": "+a).join(`
8
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...a){const u=new this(e);return a.forEach(d=>u.set(d)),u}static accessor(e){const u=(this[$internals]=this[$internals]={accessors:{}}).accessors,d=this.prototype;function c(l){const m=normalizeHeader(l);u[m]||(buildAccessors(d,l),u[m]=!0)}return utils$P.isArray(e)?e.forEach(c):c(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$P.reduceDescriptors(AxiosHeaders.prototype,({value:t},e)=>{let a=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(u){this[a]=u}}}),utils$P.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(t,e){const a=this||defaults$1,u=e||a,d=AxiosHeaders$1.from(u.headers);let c=u.data;return utils$P.forEach(t,function(m){c=m.call(a,c,d.normalize(),e?e.status:void 0)}),d.normalize(),c}function isCancel(t){return!!(t&&t.__CANCEL__)}function CanceledError(t,e,a){AxiosError.call(this,t??"canceled",AxiosError.ERR_CANCELED,e,a),this.name="CanceledError"}utils$P.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(t,e,a){const u=a.config.validateStatus;!a.status||!u||u(a.status)?t(a):e(new AxiosError("Request failed with status code "+a.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}const cookies=platform.hasStandardBrowserEnv?{write(t,e,a,u,d,c){const l=[t+"="+encodeURIComponent(e)];utils$P.isNumber(a)&&l.push("expires="+new Date(a).toGMTString()),utils$P.isString(u)&&l.push("path="+u),utils$P.isString(d)&&l.push("domain="+d),c===!0&&l.push("secure"),document.cookie=l.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function combineURLs(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function buildFullPath(t,e){return t&&!isAbsoluteURL(e)?combineURLs(t,e):e}const isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a");let u;function d(c){let l=c;return e&&(a.setAttribute("href",l),l=a.href),a.setAttribute("href",l),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return u=d(window.location.href),function(l){const m=utils$P.isString(l)?d(l):l;return m.protocol===u.protocol&&m.host===u.host}}():function(){return function(){return!0}}();function parseProtocol(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function speedometer(t,e){t=t||10;const a=new Array(t),u=new Array(t);let d=0,c=0,l;return e=e!==void 0?e:1e3,function(I){const O=Date.now(),T=u[c];l||(l=O),a[d]=I,u[d]=O;let C=c,j=0;for(;C!==d;)j+=a[C++],C=C%t;if(d=(d+1)%t,d===c&&(c=(c+1)%t),O-l<e)return;const F=T&&O-T;return F?Math.round(j*1e3/F):void 0}}function progressEventReducer(t,e){let a=0;const u=speedometer(50,250);return d=>{const c=d.loaded,l=d.lengthComputable?d.total:void 0,m=c-a,I=u(m),O=c<=l;a=c;const T={loaded:c,total:l,progress:l?c/l:void 0,bytes:m,rate:I||void 0,estimated:I&&l&&O?(l-c)/I:void 0,event:d};T[e?"download":"upload"]=!0,t(T)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(t){return new Promise(function(a,u){let d=t.data;const c=AxiosHeaders$1.from(t.headers).normalize();let{responseType:l,withXSRFToken:m}=t,I;function O(){t.cancelToken&&t.cancelToken.unsubscribe(I),t.signal&&t.signal.removeEventListener("abort",I)}let T;if(utils$P.isFormData(d)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)c.setContentType(!1);else if((T=c.getContentType())!==!1){const[Z,...J]=T?T.split(";").map(X=>X.trim()).filter(Boolean):[];c.setContentType([Z||"multipart/form-data",...J].join("; "))}}let C=new XMLHttpRequest;if(t.auth){const Z=t.auth.username||"",J=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";c.set("Authorization","Basic "+btoa(Z+":"+J))}const j=buildFullPath(t.baseURL,t.url);C.open(t.method.toUpperCase(),buildURL(j,t.params,t.paramsSerializer),!0),C.timeout=t.timeout;function F(){if(!C)return;const Z=AxiosHeaders$1.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),X={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:Z,config:t,request:C};settle(function(te){a(te),O()},function(te){u(te),O()},X),C=null}if("onloadend"in C?C.onloadend=F:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(F)},C.onabort=function(){C&&(u(new AxiosError("Request aborted",AxiosError.ECONNABORTED,t,C)),C=null)},C.onerror=function(){u(new AxiosError("Network Error",AxiosError.ERR_NETWORK,t,C)),C=null},C.ontimeout=function(){let J=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const X=t.transitional||transitionalDefaults;t.timeoutErrorMessage&&(J=t.timeoutErrorMessage),u(new AxiosError(J,X.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,t,C)),C=null},platform.hasStandardBrowserEnv&&(m&&utils$P.isFunction(m)&&(m=m(t)),m||m!==!1&&isURLSameOrigin(j))){const Z=t.xsrfHeaderName&&t.xsrfCookieName&&cookies.read(t.xsrfCookieName);Z&&c.set(t.xsrfHeaderName,Z)}d===void 0&&c.setContentType(null),"setRequestHeader"in C&&utils$P.forEach(c.toJSON(),function(J,X){C.setRequestHeader(X,J)}),utils$P.isUndefined(t.withCredentials)||(C.withCredentials=!!t.withCredentials),l&&l!=="json"&&(C.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&C.addEventListener("progress",progressEventReducer(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&C.upload&&C.upload.addEventListener("progress",progressEventReducer(t.onUploadProgress)),(t.cancelToken||t.signal)&&(I=Z=>{C&&(u(!Z||Z.type?new CanceledError(null,t,C):Z),C.abort(),C=null)},t.cancelToken&&t.cancelToken.subscribe(I),t.signal&&(t.signal.aborted?I():t.signal.addEventListener("abort",I)));const U=parseProtocol(j);if(U&&platform.protocols.indexOf(U)===-1){u(new AxiosError("Unsupported protocol "+U+":",AxiosError.ERR_BAD_REQUEST,t));return}C.send(d||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$P.forEach(knownAdapters,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const renderReason=t=>`- ${t}`,isResolvedHandle=t=>utils$P.isFunction(t)||t===null||t===!1,adapters$1={getAdapter:t=>{t=utils$P.isArray(t)?t:[t];const{length:e}=t;let a,u;const d={};for(let c=0;c<e;c++){a=t[c];let l;if(u=a,!isResolvedHandle(a)&&(u=knownAdapters[(l=String(a)).toLowerCase()],u===void 0))throw new AxiosError(`Unknown adapter '${l}'`);if(u)break;d[l||"#"+c]=u}if(!u){const c=Object.entries(d).map(([m,I])=>`adapter ${m} `+(I===!1?"is not supported by the environment":"is not available in the build"));let l=e?c.length>1?`since :
9
+ `+c.map(renderReason).join(`
10
+ `):" "+renderReason(c[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return u},adapters:knownAdapters};function throwIfCancellationRequested(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new CanceledError(null,t)}function dispatchRequest(t){return throwIfCancellationRequested(t),t.headers=AxiosHeaders$1.from(t.headers),t.data=transformData.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(t.adapter||defaults$1.adapter)(t).then(function(u){return throwIfCancellationRequested(t),u.data=transformData.call(t,t.transformResponse,u),u.headers=AxiosHeaders$1.from(u.headers),u},function(u){return isCancel(u)||(throwIfCancellationRequested(t),u&&u.response&&(u.response.data=transformData.call(t,t.transformResponse,u.response),u.response.headers=AxiosHeaders$1.from(u.response.headers))),Promise.reject(u)})}const headersToObject=t=>t instanceof AxiosHeaders$1?{...t}:t;function mergeConfig(t,e){e=e||{};const a={};function u(O,T,C){return utils$P.isPlainObject(O)&&utils$P.isPlainObject(T)?utils$P.merge.call({caseless:C},O,T):utils$P.isPlainObject(T)?utils$P.merge({},T):utils$P.isArray(T)?T.slice():T}function d(O,T,C){if(utils$P.isUndefined(T)){if(!utils$P.isUndefined(O))return u(void 0,O,C)}else return u(O,T,C)}function c(O,T){if(!utils$P.isUndefined(T))return u(void 0,T)}function l(O,T){if(utils$P.isUndefined(T)){if(!utils$P.isUndefined(O))return u(void 0,O)}else return u(void 0,T)}function m(O,T,C){if(C in e)return u(O,T);if(C in t)return u(void 0,O)}const I={url:c,method:c,data:c,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:m,headers:(O,T)=>d(headersToObject(O),headersToObject(T),!0)};return utils$P.forEach(Object.keys(Object.assign({},t,e)),function(T){const C=I[T]||d,j=C(t[T],e[T],T);utils$P.isUndefined(j)&&C!==m||(a[T]=j)}),a}const VERSION="1.6.8",validators$1={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{validators$1[t]=function(u){return typeof u===t||"a"+(e<1?"n ":" ")+t}});const deprecatedWarnings={};validators$1.transitional=function(e,a,u){function d(c,l){return"[Axios v"+VERSION+"] Transitional option '"+c+"'"+l+(u?". "+u:"")}return(c,l,m)=>{if(e===!1)throw new AxiosError(d(l," has been removed"+(a?" in "+a:"")),AxiosError.ERR_DEPRECATED);return a&&!deprecatedWarnings[l]&&(deprecatedWarnings[l]=!0,console.warn(d(l," has been deprecated since v"+a+" and will be removed in the near future"))),e?e(c,l,m):!0}};function assertOptions(t,e,a){if(typeof t!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const u=Object.keys(t);let d=u.length;for(;d-- >0;){const c=u[d],l=e[c];if(l){const m=t[c],I=m===void 0||l(m,c,t);if(I!==!0)throw new AxiosError("option "+c+" must be "+I,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new AxiosError("Unknown option "+c,AxiosError.ERR_BAD_OPTION)}}const validator$1={assertOptions,validators:validators$1},validators=validator$1.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,a){try{return await this._request(e,a)}catch(u){if(u instanceof Error){let d;Error.captureStackTrace?Error.captureStackTrace(d={}):d=new Error;const c=d.stack?d.stack.replace(/^.+\n/,""):"";u.stack?c&&!String(u.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(u.stack+=`
11
+ `+c):u.stack=c}throw u}}_request(e,a){typeof e=="string"?(a=a||{},a.url=e):a=e||{},a=mergeConfig(this.defaults,a);const{transitional:u,paramsSerializer:d,headers:c}=a;u!==void 0&&validator$1.assertOptions(u,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),d!=null&&(utils$P.isFunction(d)?a.paramsSerializer={serialize:d}:validator$1.assertOptions(d,{encode:validators.function,serialize:validators.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let l=c&&utils$P.merge(c.common,c[a.method]);c&&utils$P.forEach(["delete","get","head","post","put","patch","common"],U=>{delete c[U]}),a.headers=AxiosHeaders$1.concat(l,c);const m=[];let I=!0;this.interceptors.request.forEach(function(Z){typeof Z.runWhen=="function"&&Z.runWhen(a)===!1||(I=I&&Z.synchronous,m.unshift(Z.fulfilled,Z.rejected))});const O=[];this.interceptors.response.forEach(function(Z){O.push(Z.fulfilled,Z.rejected)});let T,C=0,j;if(!I){const U=[dispatchRequest.bind(this),void 0];for(U.unshift.apply(U,m),U.push.apply(U,O),j=U.length,T=Promise.resolve(a);C<j;)T=T.then(U[C++],U[C++]);return T}j=m.length;let F=a;for(C=0;C<j;){const U=m[C++],Z=m[C++];try{F=U(F)}catch(J){Z.call(this,J);break}}try{T=dispatchRequest.call(this,F)}catch(U){return Promise.reject(U)}for(C=0,j=O.length;C<j;)T=T.then(O[C++],O[C++]);return T}getUri(e){e=mergeConfig(this.defaults,e);const a=buildFullPath(e.baseURL,e.url);return buildURL(a,e.params,e.paramsSerializer)}}utils$P.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(a,u){return this.request(mergeConfig(u||{},{method:e,url:a,data:(u||{}).data}))}}),utils$P.forEach(["post","put","patch"],function(e){function a(u){return function(c,l,m){return this.request(mergeConfig(m||{},{method:e,headers:u?{"Content-Type":"multipart/form-data"}:{},url:c,data:l}))}}Axios.prototype[e]=a(),Axios.prototype[e+"Form"]=a(!0)});const Axios$1=Axios;class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function(c){a=c});const u=this;this.promise.then(d=>{if(!u._listeners)return;let c=u._listeners.length;for(;c-- >0;)u._listeners[c](d);u._listeners=null}),this.promise.then=d=>{let c;const l=new Promise(m=>{u.subscribe(m),c=m}).then(d);return l.cancel=function(){u.unsubscribe(c)},l},e(function(c,l,m){u.reason||(u.reason=new CanceledError(c,l,m),a(u.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const a=this._listeners.indexOf(e);a!==-1&&this._listeners.splice(a,1)}static source(){let e;return{token:new CancelToken(function(d){e=d}),cancel:e}}}const CancelToken$1=CancelToken;function spread(t){return function(a){return t.apply(null,a)}}function isAxiosError(t){return utils$P.isObject(t)&&t.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([t,e])=>{HttpStatusCode[e]=t});const HttpStatusCode$1=HttpStatusCode;function createInstance(t){const e=new Axios$1(t),a=bind$2(Axios$1.prototype.request,e);return utils$P.extend(a,Axios$1.prototype,e,{allOwnKeys:!0}),utils$P.extend(a,e,null,{allOwnKeys:!0}),a.create=function(d){return createInstance(mergeConfig(t,d))},a}const axios=createInstance(defaults$1);axios.Axios=Axios$1,axios.CanceledError=CanceledError,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel,axios.VERSION=VERSION,axios.toFormData=toFormData,axios.AxiosError=AxiosError,axios.Cancel=axios.CanceledError,axios.all=function(e){return Promise.all(e)},axios.spread=spread,axios.isAxiosError=isAxiosError,axios.mergeConfig=mergeConfig,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=t=>formDataToJSON(utils$P.isHTMLForm(t)?new FormData(t):t),axios.getAdapter=adapters$1.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;function number$1(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function bool$1(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function isBytes$3(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function bytes$1(t,...e){if(!isBytes$3(t))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function hash$a(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(t.outputLen),number$1(t.blockLen)}function exists$1(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function output$2(t,e){bytes$1(t);const a=e.outputLen;if(t.length<a)throw new Error(`digestInto() expects output buffer of length at least ${a}`)}const assert$G={number:number$1,bool:bool$1,bytes:bytes$1,hash:hash$a,exists:exists$1,output:output$2},U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(t,e=!1){return e?{h:Number(t&U32_MASK64),l:Number(t>>_32n&U32_MASK64)}:{h:Number(t>>_32n&U32_MASK64)|0,l:Number(t&U32_MASK64)|0}}function split(t,e=!1){let a=new Uint32Array(t.length),u=new Uint32Array(t.length);for(let d=0;d<t.length;d++){const{h:c,l}=fromBig(t[d],e);[a[d],u[d]]=[c,l]}return[a,u]}const rotlSH=(t,e,a)=>t<<a|e>>>32-a,rotlSL=(t,e,a)=>e<<a|t>>>32-a,rotlBH=(t,e,a)=>e<<a-32|t>>>64-a,rotlBL=(t,e,a)=>t<<a-32|e>>>64-a,crypto$5=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,crypto$6=Object.freeze(Object.defineProperty({__proto__:null,crypto:crypto$5},Symbol.toStringTag,{value:"Module"}));/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function isBytes$2(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function toBytes(t){if(typeof t=="string"&&(t=utf8ToBytes(t)),!isBytes$2(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}let Hash$c=class{clone(){return this._cloneInto()}};function wrapConstructor(t){const e=u=>t().update(toBytes(u)).digest(),a=t();return e.outputLen=a.outputLen,e.blockLen=a.blockLen,e.create=()=>t(),e}const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]],_0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let t=0,e=_1n,a=1,u=0;t<24;t++){[a,u]=[u,(2*a+3*u)%5],SHA3_PI.push(2*(5*u+a)),SHA3_ROTL.push((t+1)*(t+2)/2%64);let d=_0n;for(let c=0;c<7;c++)e=(e<<_1n^(e>>_7n)*_0x71n)%_256n,e&_2n&&(d^=_1n<<(_1n<<BigInt(c))-_1n);_SHA3_IOTA.push(d)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split(_SHA3_IOTA,!0),rotlH=(t,e,a)=>a>32?rotlBH(t,e,a):rotlSH(t,e,a),rotlL=(t,e,a)=>a>32?rotlBL(t,e,a):rotlSL(t,e,a);function keccakP(t,e=24){const a=new Uint32Array(10);for(let u=24-e;u<24;u++){for(let l=0;l<10;l++)a[l]=t[l]^t[l+10]^t[l+20]^t[l+30]^t[l+40];for(let l=0;l<10;l+=2){const m=(l+8)%10,I=(l+2)%10,O=a[I],T=a[I+1],C=rotlH(O,T,1)^a[m],j=rotlL(O,T,1)^a[m+1];for(let F=0;F<50;F+=10)t[l+F]^=C,t[l+F+1]^=j}let d=t[2],c=t[3];for(let l=0;l<24;l++){const m=SHA3_ROTL[l],I=rotlH(d,c,m),O=rotlL(d,c,m),T=SHA3_PI[l];d=t[T],c=t[T+1],t[T]=I,t[T+1]=O}for(let l=0;l<50;l+=10){for(let m=0;m<10;m++)a[m]=t[l+m];for(let m=0;m<10;m++)t[l+m]^=~a[(m+2)%10]&a[(m+4)%10]}t[0]^=SHA3_IOTA_H[u],t[1]^=SHA3_IOTA_L[u]}a.fill(0)}class Keccak extends Hash$c{constructor(e,a,u,d=!1,c=24){if(super(),this.blockLen=e,this.suffix=a,this.outputLen=u,this.enableXOF=d,this.rounds=c,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$1(u),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){exists$1(this);const{blockLen:a,state:u}=this;e=toBytes(e);const d=e.length;for(let c=0;c<d;){const l=Math.min(a-this.pos,d-c);for(let m=0;m<l;m++)u[this.pos++]^=e[c++];this.pos===a&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:a,pos:u,blockLen:d}=this;e[u]^=a,a&128&&u===d-1&&this.keccak(),e[d-1]^=128,this.keccak()}writeInto(e){exists$1(this,!1),bytes$1(e),this.finish();const a=this.state,{blockLen:u}=this;for(let d=0,c=e.length;d<c;){this.posOut>=u&&this.keccak();const l=Math.min(u-this.posOut,c-d);e.set(a.subarray(this.posOut,this.posOut+l),d),this.posOut+=l,d+=l}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return number$1(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(output$2(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:a,suffix:u,outputLen:d,rounds:c,enableXOF:l}=this;return e||(e=new Keccak(a,u,d,l,c)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=c,e.suffix=u,e.outputLen=d,e.enableXOF=l,e.destroyed=this.destroyed,e}}const gen=(t,e,a)=>wrapConstructor(()=>new Keccak(e,t,a)),keccak_256=gen(1,136,256/8);function wrapHash(t){return e=>(assert$G.bytes(e),t(e))}(()=>{const t=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,e=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:e&&!t?e("crypto"):void 0,web:t}})();const keccak256=(()=>{const t=wrapHash(keccak_256);return t.create=keccak_256.create,t})(),JSONRPC_ERR_REJECTED_REQUEST=4001,JSONRPC_ERR_UNAUTHORIZED=4100,JSONRPC_ERR_UNSUPPORTED_METHOD=4200,JSONRPC_ERR_DISCONNECTED=4900,JSONRPC_ERR_CHAIN_DISCONNECTED=4901,ERR_INVALID_BYTES=1002,ERR_INVALID_NUMBER=1003,ERR_INVALID_HEX=1006,ERR_VALIDATION=1100,ERR_SCHEMA_FORMAT=1200,ERR_RPC_INVALID_JSON=-32700,ERR_RPC_INVALID_REQUEST=-32600,ERR_RPC_INVALID_METHOD=-32601,ERR_RPC_INVALID_PARAMS=-32602,ERR_RPC_INTERNAL_ERROR=-32603,ERR_RPC_INVALID_INPUT=-32e3,ERR_RPC_MISSING_RESOURCE=-32001,ERR_RPC_UNAVAILABLE_RESOURCE=-32002,ERR_RPC_TRANSACTION_REJECTED=-32003,ERR_RPC_UNSUPPORTED_METHOD=-32004,ERR_RPC_LIMIT_EXCEEDED=-32005,ERR_RPC_NOT_SUPPORTED=-32006;class BaseWeb3Error extends Error{constructor(e,a){super(e),this.innerError=a,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(e,a=!1){if(e==null)return"undefined";const u=JSON.stringify(e,(d,c)=>typeof c=="bigint"?c.toString():c);return a&&["bigint","string"].includes(typeof e)?u.replace(/['\\"]+/g,""):u}toJSON(){return{name:this.name,code:this.code,message:this.message,innerError:this.innerError}}}class InvalidValueError extends BaseWeb3Error{constructor(e,a){super(`Invalid value given "${BaseWeb3Error.convertToString(e,!0)}". Error: ${a}.`),this.name=this.constructor.name}}class InvalidBytesError extends InvalidValueError{constructor(e){super(e,"can not parse as byte data"),this.code=ERR_INVALID_BYTES}}class InvalidNumberError extends InvalidValueError{constructor(e){super(e,"can not parse as number data"),this.code=ERR_INVALID_NUMBER}}class HexProcessingError extends InvalidValueError{constructor(e){super(e,"can not be converted to hex"),this.code=ERR_INVALID_HEX}}const genericRpcErrorMessageTemplate="An Rpc error has occured with a code of *code*",RpcErrorMessages={[ERR_RPC_INVALID_JSON]:{message:"Parse error",description:"Invalid JSON"},[ERR_RPC_INVALID_REQUEST]:{message:"Invalid request",description:"JSON is not a valid request object "},[ERR_RPC_INVALID_METHOD]:{message:"Method not found",description:"Method does not exist "},[ERR_RPC_INVALID_PARAMS]:{message:"Invalid params",description:"Invalid method parameters"},[ERR_RPC_INTERNAL_ERROR]:{message:"Internal error",description:"Internal JSON-RPC error"},[ERR_RPC_INVALID_INPUT]:{message:"Invalid input",description:"Missing or invalid parameters"},[ERR_RPC_MISSING_RESOURCE]:{message:"Resource not found",description:"Requested resource not found"},[ERR_RPC_UNAVAILABLE_RESOURCE]:{message:"Resource unavailable",description:"Requested resource not available"},[ERR_RPC_TRANSACTION_REJECTED]:{message:"Transaction rejected",description:"Transaction creation failed"},[ERR_RPC_UNSUPPORTED_METHOD]:{message:"Method not supported",description:"Method is not implemented"},[ERR_RPC_LIMIT_EXCEEDED]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[ERR_RPC_NOT_SUPPORTED]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[JSONRPC_ERR_REJECTED_REQUEST]:{name:"User Rejected Request",message:"The user rejected the request."},[JSONRPC_ERR_UNAUTHORIZED]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[JSONRPC_ERR_UNSUPPORTED_METHOD]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[JSONRPC_ERR_DISCONNECTED]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[JSONRPC_ERR_CHAIN_DISCONNECTED]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class RpcError extends BaseWeb3Error{constructor(e,a){super(a??genericRpcErrorMessageTemplate.replace("*code*",e.error.code.toString())),this.code=e.error.code,this.id=e.id,this.jsonrpc=e.jsonrpc,this.jsonRpcError=e.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class ParseError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_INVALID_JSON].message),this.code=ERR_RPC_INVALID_JSON}}class InvalidRequestError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_INVALID_REQUEST].message),this.code=ERR_RPC_INVALID_REQUEST}}class MethodNotFoundError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_INVALID_METHOD].message),this.code=ERR_RPC_INVALID_METHOD}}class InvalidParamsError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_INVALID_PARAMS].message),this.code=ERR_RPC_INVALID_PARAMS}}class InternalError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_INTERNAL_ERROR].message),this.code=ERR_RPC_INTERNAL_ERROR}}class InvalidInputError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_INVALID_INPUT].message),this.code=ERR_RPC_INVALID_INPUT}}class MethodNotSupported extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_UNSUPPORTED_METHOD].message),this.code=ERR_RPC_UNSUPPORTED_METHOD}}class ResourceUnavailableError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_UNAVAILABLE_RESOURCE].message),this.code=ERR_RPC_UNAVAILABLE_RESOURCE}}class ResourcesNotFoundError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_MISSING_RESOURCE].message),this.code=ERR_RPC_MISSING_RESOURCE}}class VersionNotSupportedError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_NOT_SUPPORTED].message),this.code=ERR_RPC_NOT_SUPPORTED}}class TransactionRejectedError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_TRANSACTION_REJECTED].message),this.code=ERR_RPC_TRANSACTION_REJECTED}}class LimitExceededError extends RpcError{constructor(e){super(e,RpcErrorMessages[ERR_RPC_LIMIT_EXCEEDED].message),this.code=ERR_RPC_LIMIT_EXCEEDED}}const rpcErrorsMap=new Map;rpcErrorsMap.set(ERR_RPC_INVALID_JSON,{error:ParseError}),rpcErrorsMap.set(ERR_RPC_INVALID_REQUEST,{error:InvalidRequestError}),rpcErrorsMap.set(ERR_RPC_INVALID_METHOD,{error:MethodNotFoundError}),rpcErrorsMap.set(ERR_RPC_INVALID_PARAMS,{error:InvalidParamsError}),rpcErrorsMap.set(ERR_RPC_INTERNAL_ERROR,{error:InternalError}),rpcErrorsMap.set(ERR_RPC_INVALID_INPUT,{error:InvalidInputError}),rpcErrorsMap.set(ERR_RPC_UNSUPPORTED_METHOD,{error:MethodNotSupported}),rpcErrorsMap.set(ERR_RPC_UNAVAILABLE_RESOURCE,{error:ResourceUnavailableError}),rpcErrorsMap.set(ERR_RPC_TRANSACTION_REJECTED,{error:TransactionRejectedError}),rpcErrorsMap.set(ERR_RPC_MISSING_RESOURCE,{error:ResourcesNotFoundError}),rpcErrorsMap.set(ERR_RPC_NOT_SUPPORTED,{error:VersionNotSupportedError}),rpcErrorsMap.set(ERR_RPC_LIMIT_EXCEEDED,{error:LimitExceededError});class SchemaFormatError extends BaseWeb3Error{constructor(e){super(`Format for the type ${e} is unsupported`),this.type=e,this.code=ERR_SCHEMA_FORMAT}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}var util$3;(function(t){t.assertEqual=d=>d;function e(d){}t.assertIs=e;function a(d){throw new Error}t.assertNever=a,t.arrayToEnum=d=>{const c={};for(const l of d)c[l]=l;return c},t.getValidEnumValues=d=>{const c=t.objectKeys(d).filter(m=>typeof d[d[m]]!="number"),l={};for(const m of c)l[m]=d[m];return t.objectValues(l)},t.objectValues=d=>t.objectKeys(d).map(function(c){return d[c]}),t.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{const c=[];for(const l in d)Object.prototype.hasOwnProperty.call(d,l)&&c.push(l);return c},t.find=(d,c)=>{for(const l of d)if(c(l))return l},t.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&isFinite(d)&&Math.floor(d)===d;function u(d,c=" | "){return d.map(l=>typeof l=="string"?`'${l}'`:l).join(c)}t.joinValues=u,t.jsonStringifyReplacer=(d,c)=>typeof c=="bigint"?c.toString():c})(util$3||(util$3={}));var objectUtil;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(objectUtil||(objectUtil={}));const ZodParsedType=util$3.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=t=>{switch(typeof t){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(t)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(t)?ZodParsedType.array:t===null?ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?ZodParsedType.map:typeof Set<"u"&&t instanceof Set?ZodParsedType.set:typeof Date<"u"&&t instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$3.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(e){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const a=e||function(c){return c.message},u={_errors:[]},d=c=>{for(const l of c.issues)if(l.code==="invalid_union")l.unionErrors.map(d);else if(l.code==="invalid_return_type")d(l.returnTypeError);else if(l.code==="invalid_arguments")d(l.argumentsError);else if(l.path.length===0)u._errors.push(a(l));else{let m=u,I=0;for(;I<l.path.length;){const O=l.path[I];I===l.path.length-1?(m[O]=m[O]||{_errors:[]},m[O]._errors.push(a(l))):m[O]=m[O]||{_errors:[]},m=m[O],I++}}};return d(this),u}toString(){return this.message}get message(){return JSON.stringify(this.issues,util$3.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a={},u=[];for(const d of this.issues)d.path.length>0?(a[d.path[0]]=a[d.path[0]]||[],a[d.path[0]].push(e(d))):u.push(e(d));return{formErrors:u,fieldErrors:a}}get formErrors(){return this.flatten()}}ZodError.create=t=>new ZodError(t);const errorMap=(t,e)=>{let a;switch(t.code){case ZodIssueCode.invalid_type:t.received===ZodParsedType.undefined?a="Required":a=`Expected ${t.expected}, received ${t.received}`;break;case ZodIssueCode.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,util$3.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:a=`Unrecognized key(s) in object: ${util$3.joinValues(t.keys,", ")}`;break;case ZodIssueCode.invalid_union:a="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${util$3.joinValues(t.options)}`;break;case ZodIssueCode.invalid_enum_value:a=`Invalid enum value. Expected ${util$3.joinValues(t.options)}, received '${t.received}'`;break;case ZodIssueCode.invalid_arguments:a="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:a="Invalid function return type";break;case ZodIssueCode.invalid_date:a="Invalid date";break;case ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:util$3.assertNever(t.validation):t.validation!=="regex"?a=`Invalid ${t.validation}`:a="Invalid";break;case ZodIssueCode.too_small:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:a="Invalid input";break;case ZodIssueCode.too_big:t.type==="array"?a=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?a=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?a=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?a=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?a=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:a="Invalid input";break;case ZodIssueCode.custom:a="Invalid input";break;case ZodIssueCode.invalid_intersection_types:a="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case ZodIssueCode.not_finite:a="Number must be finite";break;default:a=e.defaultError,util$3.assertNever(t)}return{message:a}};let overrideErrorMap=errorMap;function setErrorMap(t){overrideErrorMap=t}function getErrorMap(){return overrideErrorMap}const makeIssue=t=>{const{data:e,path:a,errorMaps:u,issueData:d}=t,c=[...a,...d.path||[]],l={...d,path:c};let m="";const I=u.filter(O=>!!O).slice().reverse();for(const O of I)m=O(l,{data:e,defaultError:m}).message;return{...d,path:c,message:d.message||m}},EMPTY_PATH=[];function addIssueToContext(t,e){const a=makeIssue({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter(u=>!!u)});t.common.issues.push(a)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){const u=[];for(const d of a){if(d.status==="aborted")return INVALID;d.status==="dirty"&&e.dirty(),u.push(d.value)}return{status:e.value,value:u}}static async mergeObjectAsync(e,a){const u=[];for(const d of a)u.push({key:await d.key,value:await d.value});return ParseStatus.mergeObjectSync(e,u)}static mergeObjectSync(e,a){const u={};for(const d of a){const{key:c,value:l}=d;if(c.status==="aborted"||l.status==="aborted")return INVALID;c.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),c.value!=="__proto__"&&(typeof l.value<"u"||d.alwaysSet)&&(u[c.value]=l.value)}return{status:e.value,value:u}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=t=>({status:"dirty",value:t}),OK=t=>({status:"valid",value:t}),isAborted=t=>t.status==="aborted",isDirty=t=>t.status==="dirty",isValid=t=>t.status==="valid",isAsync=t=>typeof Promise<"u"&&t instanceof Promise;var errorUtil;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(e,a,u,d){this._cachedPath=[],this.parent=e,this.data=a,this._path=u,this._key=d}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(t,e)=>{if(isValid(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new ZodError(t.common.issues);return this._error=a,this._error}}};function processCreateParams(t){if(!t)return{};const{errorMap:e,invalid_type_error:a,required_error:u,description:d}=t;if(e&&(a||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:d}:{errorMap:(l,m)=>l.code!=="invalid_type"?{message:m.defaultError}:typeof m.data>"u"?{message:u??m.defaultError}:{message:a??m.defaultError},description:d}}class ZodType{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,a){return a||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const a=this._parse(e);if(isAsync(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(e){const a=this._parse(e);return Promise.resolve(a)}parse(e,a){const u=this.safeParse(e,a);if(u.success)return u.data;throw u.error}safeParse(e,a){var u;const d={common:{issues:[],async:(u=a==null?void 0:a.async)!==null&&u!==void 0?u:!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},c=this._parseSync({data:e,path:d.path,parent:d});return handleResult(d,c)}async parseAsync(e,a){const u=await this.safeParseAsync(e,a);if(u.success)return u.data;throw u.error}async safeParseAsync(e,a){const u={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},d=this._parse({data:e,path:u.path,parent:u}),c=await(isAsync(d)?d:Promise.resolve(d));return handleResult(u,c)}refine(e,a){const u=d=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(d):a;return this._refinement((d,c)=>{const l=e(d),m=()=>c.addIssue({code:ZodIssueCode.custom,...u(d)});return typeof Promise<"u"&&l instanceof Promise?l.then(I=>I?!0:(m(),!1)):l?!0:(m(),!1)})}refinement(e,a){return this._refinement((u,d)=>e(u)?!0:(d.addIssue(typeof a=="function"?a(u,d):a),!1))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const a=typeof e=="function"?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:a,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const a=typeof e=="function"?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:a,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){const a=this.constructor;return new a({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(t,e){return!!((e==="v4"||!e)&&ipv4Regex.test(t)||(e==="v6"||!e)&&ipv6Regex.test(t))}class ZodString extends ZodType{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ZodParsedType.string){const c=this._getOrReturnCtx(e);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:c.parsedType}),INVALID}const u=new ParseStatus;let d;for(const c of this._def.checks)if(c.kind==="min")e.data.length<c.value&&(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),u.dirty());else if(c.kind==="max")e.data.length>c.value&&(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),u.dirty());else if(c.kind==="length"){const l=e.data.length>c.value,m=e.data.length<c.value;(l||m)&&(d=this._getOrReturnCtx(e,d),l?addIssueToContext(d,{code:ZodIssueCode.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):m&&addIssueToContext(d,{code:ZodIssueCode.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),u.dirty())}else if(c.kind==="email")emailRegex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"email",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty());else if(c.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"emoji",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty());else if(c.kind==="uuid")uuidRegex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"uuid",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty());else if(c.kind==="cuid")cuidRegex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"cuid",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty());else if(c.kind==="cuid2")cuid2Regex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty());else if(c.kind==="ulid")ulidRegex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"ulid",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty());else if(c.kind==="url")try{new URL(e.data)}catch{d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"url",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"regex",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty())):c.kind==="trim"?e.data=e.data.trim():c.kind==="includes"?e.data.includes(c.value,c.position)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),u.dirty()):c.kind==="toLowerCase"?e.data=e.data.toLowerCase():c.kind==="toUpperCase"?e.data=e.data.toUpperCase():c.kind==="startsWith"?e.data.startsWith(c.value)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.invalid_string,validation:{startsWith:c.value},message:c.message}),u.dirty()):c.kind==="endsWith"?e.data.endsWith(c.value)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.invalid_string,validation:{endsWith:c.value},message:c.message}),u.dirty()):c.kind==="datetime"?datetimeRegex(c).test(e.data)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.invalid_string,validation:"datetime",message:c.message}),u.dirty()):c.kind==="ip"?isValidIP(e.data,c.version)||(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{validation:"ip",code:ZodIssueCode.invalid_string,message:c.message}),u.dirty()):util$3.assertNever(c);return{status:u.value,value:e.data}}_regex(e,a,u){return this.refinement(d=>e.test(d),{validation:a,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(u)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}datetime(e){var a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(a=e==null?void 0:e.offset)!==null&&a!==void 0?a:!1,...errorUtil.errToObj(e==null?void 0:e.message)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a==null?void 0:a.position,...errorUtil.errToObj(a==null?void 0:a.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(a)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}}ZodString.create=t=>{var e;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...processCreateParams(t)})};function floatSafeRemainder(t,e){const a=(t.toString().split(".")[1]||"").length,u=(e.toString().split(".")[1]||"").length,d=a>u?a:u,c=parseInt(t.toFixed(d).replace(".","")),l=parseInt(e.toFixed(d).replace(".",""));return c%l/Math.pow(10,d)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ZodParsedType.number){const c=this._getOrReturnCtx(e);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:c.parsedType}),INVALID}let u;const d=new ParseStatus;for(const c of this._def.checks)c.kind==="int"?util$3.isInteger(e.data)||(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:c.message}),d.dirty()):c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),d.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),d.dirty()):c.kind==="multipleOf"?floatSafeRemainder(e.data,c.value)!==0&&(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.not_multiple_of,multipleOf:c.value,message:c.message}),d.dirty()):c.kind==="finite"?Number.isFinite(e.data)||(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.not_finite,message:c.message}),d.dirty()):util$3.assertNever(c);return{status:d.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,errorUtil.toString(a))}gt(e,a){return this.setLimit("min",e,!1,errorUtil.toString(a))}lte(e,a){return this.setLimit("max",e,!0,errorUtil.toString(a))}lt(e,a){return this.setLimit("max",e,!1,errorUtil.toString(a))}setLimit(e,a,u,d){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:u,message:errorUtil.toString(d)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&util$3.isInteger(e.value))}get isFinite(){let e=null,a=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(a===null||u.value>a)&&(a=u.value):u.kind==="max"&&(e===null||u.value<e)&&(e=u.value)}return Number.isFinite(a)&&Number.isFinite(e)}}ZodNumber.create=t=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...processCreateParams(t)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ZodParsedType.bigint){const c=this._getOrReturnCtx(e);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:c.parsedType}),INVALID}let u;const d=new ParseStatus;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?e.data<c.value:e.data<=c.value)&&(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),d.dirty()):c.kind==="max"?(c.inclusive?e.data>c.value:e.data>=c.value)&&(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),d.dirty()):c.kind==="multipleOf"?e.data%c.value!==BigInt(0)&&(u=this._getOrReturnCtx(e,u),addIssueToContext(u,{code:ZodIssueCode.not_multiple_of,multipleOf:c.value,message:c.message}),d.dirty()):util$3.assertNever(c);return{status:d.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,errorUtil.toString(a))}gt(e,a){return this.setLimit("min",e,!1,errorUtil.toString(a))}lte(e,a){return this.setLimit("max",e,!0,errorUtil.toString(a))}lt(e,a){return this.setLimit("max",e,!1,errorUtil.toString(a))}setLimit(e,a,u,d){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:u,message:errorUtil.toString(d)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(a)})}get minValue(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}}ZodBigInt.create=t=>{var e;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...processCreateParams(t)})};class ZodBoolean extends ZodType{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ZodParsedType.boolean){const u=this._getOrReturnCtx(e);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:u.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=t=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...processCreateParams(t)});class ZodDate extends ZodType{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ZodParsedType.date){const c=this._getOrReturnCtx(e);return addIssueToContext(c,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:c.parsedType}),INVALID}if(isNaN(e.data.getTime())){const c=this._getOrReturnCtx(e);return addIssueToContext(c,{code:ZodIssueCode.invalid_date}),INVALID}const u=new ParseStatus;let d;for(const c of this._def.checks)c.kind==="min"?e.data.getTime()<c.value&&(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),u.dirty()):c.kind==="max"?e.data.getTime()>c.value&&(d=this._getOrReturnCtx(e,d),addIssueToContext(d,{code:ZodIssueCode.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),u.dirty()):util$3.assertNever(c);return{status:u.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(a)})}get minDate(){let e=null;for(const a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e!=null?new Date(e):null}}ZodDate.create=t=>new ZodDate({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(t)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const u=this._getOrReturnCtx(e);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:u.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=t=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(t)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const u=this._getOrReturnCtx(e);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:u.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=t=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(t)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const u=this._getOrReturnCtx(e);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:u.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=t=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(t)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=t=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(t)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=t=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(t)});class ZodNever extends ZodType{_parse(e){const a=this._getOrReturnCtx(e);return addIssueToContext(a,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:a.parsedType}),INVALID}}ZodNever.create=t=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(t)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const u=this._getOrReturnCtx(e);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:u.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=t=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(t)});class ZodArray extends ZodType{_parse(e){const{ctx:a,status:u}=this._processInputParams(e),d=this._def;if(a.parsedType!==ZodParsedType.array)return addIssueToContext(a,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:a.parsedType}),INVALID;if(d.exactLength!==null){const l=a.data.length>d.exactLength.value,m=a.data.length<d.exactLength.value;(l||m)&&(addIssueToContext(a,{code:l?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:m?d.exactLength.value:void 0,maximum:l?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),u.dirty())}if(d.minLength!==null&&a.data.length<d.minLength.value&&(addIssueToContext(a,{code:ZodIssueCode.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),u.dirty()),d.maxLength!==null&&a.data.length>d.maxLength.value&&(addIssueToContext(a,{code:ZodIssueCode.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),u.dirty()),a.common.async)return Promise.all([...a.data].map((l,m)=>d.type._parseAsync(new ParseInputLazyPath(a,l,a.path,m)))).then(l=>ParseStatus.mergeArray(u,l));const c=[...a.data].map((l,m)=>d.type._parseSync(new ParseInputLazyPath(a,l,a.path,m)));return ParseStatus.mergeArray(u,c)}get element(){return this._def.type}min(e,a){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(a)}})}max(e,a){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(a)}})}length(e,a){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(a)}})}nonempty(e){return this.min(1,e)}}ZodArray.create=(t,e)=>new ZodArray({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(e)});function deepPartialify(t){if(t instanceof ZodObject){const e={};for(const a in t.shape){const u=t.shape[a];e[a]=ZodOptional.create(deepPartialify(u))}return new ZodObject({...t._def,shape:()=>e})}else return t instanceof ZodArray?new ZodArray({...t._def,type:deepPartialify(t.element)}):t instanceof ZodOptional?ZodOptional.create(deepPartialify(t.unwrap())):t instanceof ZodNullable?ZodNullable.create(deepPartialify(t.unwrap())):t instanceof ZodTuple?ZodTuple.create(t.items.map(e=>deepPartialify(e))):t}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),a=util$3.objectKeys(e);return this._cached={shape:e,keys:a}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const O=this._getOrReturnCtx(e);return addIssueToContext(O,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:O.parsedType}),INVALID}const{status:u,ctx:d}=this._processInputParams(e),{shape:c,keys:l}=this._getCached(),m=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const O in d.data)l.includes(O)||m.push(O);const I=[];for(const O of l){const T=c[O],C=d.data[O];I.push({key:{status:"valid",value:O},value:T._parse(new ParseInputLazyPath(d,C,d.path,O)),alwaysSet:O in d.data})}if(this._def.catchall instanceof ZodNever){const O=this._def.unknownKeys;if(O==="passthrough")for(const T of m)I.push({key:{status:"valid",value:T},value:{status:"valid",value:d.data[T]}});else if(O==="strict")m.length>0&&(addIssueToContext(d,{code:ZodIssueCode.unrecognized_keys,keys:m}),u.dirty());else if(O!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const O=this._def.catchall;for(const T of m){const C=d.data[T];I.push({key:{status:"valid",value:T},value:O._parse(new ParseInputLazyPath(d,C,d.path,T)),alwaysSet:T in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const O=[];for(const T of I){const C=await T.key;O.push({key:C,value:await T.value,alwaysSet:T.alwaysSet})}return O}).then(O=>ParseStatus.mergeObjectSync(u,O)):ParseStatus.mergeObjectSync(u,I)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(a,u)=>{var d,c,l,m;const I=(l=(c=(d=this._def).errorMap)===null||c===void 0?void 0:c.call(d,a,u).message)!==null&&l!==void 0?l:u.defaultError;return a.code==="unrecognized_keys"?{message:(m=errorUtil.errToObj(e).message)!==null&&m!==void 0?m:I}:{message:I}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const a={};return util$3.objectKeys(e).forEach(u=>{e[u]&&this.shape[u]&&(a[u]=this.shape[u])}),new ZodObject({...this._def,shape:()=>a})}omit(e){const a={};return util$3.objectKeys(this.shape).forEach(u=>{e[u]||(a[u]=this.shape[u])}),new ZodObject({...this._def,shape:()=>a})}deepPartial(){return deepPartialify(this)}partial(e){const a={};return util$3.objectKeys(this.shape).forEach(u=>{const d=this.shape[u];e&&!e[u]?a[u]=d:a[u]=d.optional()}),new ZodObject({...this._def,shape:()=>a})}required(e){const a={};return util$3.objectKeys(this.shape).forEach(u=>{if(e&&!e[u])a[u]=this.shape[u];else{let c=this.shape[u];for(;c instanceof ZodOptional;)c=c._def.innerType;a[u]=c}}),new ZodObject({...this._def,shape:()=>a})}keyof(){return createZodEnum(util$3.objectKeys(this.shape))}}ZodObject.create=(t,e)=>new ZodObject({shape:()=>t,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(e)}),ZodObject.strictCreate=(t,e)=>new ZodObject({shape:()=>t,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(e)}),ZodObject.lazycreate=(t,e)=>new ZodObject({shape:t,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(e)});class ZodUnion extends ZodType{_parse(e){const{ctx:a}=this._processInputParams(e),u=this._def.options;function d(c){for(const m of c)if(m.result.status==="valid")return m.result;for(const m of c)if(m.result.status==="dirty")return a.common.issues.push(...m.ctx.common.issues),m.result;const l=c.map(m=>new ZodError(m.ctx.common.issues));return addIssueToContext(a,{code:ZodIssueCode.invalid_union,unionErrors:l}),INVALID}if(a.common.async)return Promise.all(u.map(async c=>{const l={...a,common:{...a.common,issues:[]},parent:null};return{result:await c._parseAsync({data:a.data,path:a.path,parent:l}),ctx:l}})).then(d);{let c;const l=[];for(const I of u){const O={...a,common:{...a.common,issues:[]},parent:null},T=I._parseSync({data:a.data,path:a.path,parent:O});if(T.status==="valid")return T;T.status==="dirty"&&!c&&(c={result:T,ctx:O}),O.common.issues.length&&l.push(O.common.issues)}if(c)return a.common.issues.push(...c.ctx.common.issues),c.result;const m=l.map(I=>new ZodError(I));return addIssueToContext(a,{code:ZodIssueCode.invalid_union,unionErrors:m}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(t,e)=>new ZodUnion({options:t,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(e)});const getDiscriminator=t=>t instanceof ZodLazy?getDiscriminator(t.schema):t instanceof ZodEffects?getDiscriminator(t.innerType()):t instanceof ZodLiteral?[t.value]:t instanceof ZodEnum?t.options:t instanceof ZodNativeEnum?Object.keys(t.enum):t instanceof ZodDefault?getDiscriminator(t._def.innerType):t instanceof ZodUndefined?[void 0]:t instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==ZodParsedType.object)return addIssueToContext(a,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:a.parsedType}),INVALID;const u=this.discriminator,d=a.data[u],c=this.optionsMap.get(d);return c?a.common.async?c._parseAsync({data:a.data,path:a.path,parent:a}):c._parseSync({data:a.data,path:a.path,parent:a}):(addIssueToContext(a,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,u){const d=new Map;for(const c of a){const l=getDiscriminator(c.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const m of l){if(d.has(m))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(m)}`);d.set(m,c)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:d,...processCreateParams(u)})}}function mergeValues(t,e){const a=getParsedType(t),u=getParsedType(e);if(t===e)return{valid:!0,data:t};if(a===ZodParsedType.object&&u===ZodParsedType.object){const d=util$3.objectKeys(e),c=util$3.objectKeys(t).filter(m=>d.indexOf(m)!==-1),l={...t,...e};for(const m of c){const I=mergeValues(t[m],e[m]);if(!I.valid)return{valid:!1};l[m]=I.data}return{valid:!0,data:l}}else if(a===ZodParsedType.array&&u===ZodParsedType.array){if(t.length!==e.length)return{valid:!1};const d=[];for(let c=0;c<t.length;c++){const l=t[c],m=e[c],I=mergeValues(l,m);if(!I.valid)return{valid:!1};d.push(I.data)}return{valid:!0,data:d}}else return a===ZodParsedType.date&&u===ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:a,ctx:u}=this._processInputParams(e),d=(c,l)=>{if(isAborted(c)||isAborted(l))return INVALID;const m=mergeValues(c.value,l.value);return m.valid?((isDirty(c)||isDirty(l))&&a.dirty(),{status:a.value,value:m.data}):(addIssueToContext(u,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([c,l])=>d(c,l)):d(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}ZodIntersection.create=(t,e,a)=>new ZodIntersection({left:t,right:e,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(a)});class ZodTuple extends ZodType{_parse(e){const{status:a,ctx:u}=this._processInputParams(e);if(u.parsedType!==ZodParsedType.array)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:u.parsedType}),INVALID;if(u.data.length<this._def.items.length)return addIssueToContext(u,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&u.data.length>this._def.items.length&&(addIssueToContext(u,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const c=[...u.data].map((l,m)=>{const I=this._def.items[m]||this._def.rest;return I?I._parse(new ParseInputLazyPath(u,l,u.path,m)):null}).filter(l=>!!l);return u.common.async?Promise.all(c).then(l=>ParseStatus.mergeArray(a,l)):ParseStatus.mergeArray(a,c)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:t,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(e)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:a,ctx:u}=this._processInputParams(e);if(u.parsedType!==ZodParsedType.object)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:u.parsedType}),INVALID;const d=[],c=this._def.keyType,l=this._def.valueType;for(const m in u.data)d.push({key:c._parse(new ParseInputLazyPath(u,m,u.path,m)),value:l._parse(new ParseInputLazyPath(u,u.data[m],u.path,m))});return u.common.async?ParseStatus.mergeObjectAsync(a,d):ParseStatus.mergeObjectSync(a,d)}get element(){return this._def.valueType}static create(e,a,u){return a instanceof ZodType?new ZodRecord({keyType:e,valueType:a,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(u)}):new ZodRecord({keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(a)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:a,ctx:u}=this._processInputParams(e);if(u.parsedType!==ZodParsedType.map)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:u.parsedType}),INVALID;const d=this._def.keyType,c=this._def.valueType,l=[...u.data.entries()].map(([m,I],O)=>({key:d._parse(new ParseInputLazyPath(u,m,u.path,[O,"key"])),value:c._parse(new ParseInputLazyPath(u,I,u.path,[O,"value"]))}));if(u.common.async){const m=new Map;return Promise.resolve().then(async()=>{for(const I of l){const O=await I.key,T=await I.value;if(O.status==="aborted"||T.status==="aborted")return INVALID;(O.status==="dirty"||T.status==="dirty")&&a.dirty(),m.set(O.value,T.value)}return{status:a.value,value:m}})}else{const m=new Map;for(const I of l){const O=I.key,T=I.value;if(O.status==="aborted"||T.status==="aborted")return INVALID;(O.status==="dirty"||T.status==="dirty")&&a.dirty(),m.set(O.value,T.value)}return{status:a.value,value:m}}}}ZodMap.create=(t,e,a)=>new ZodMap({valueType:e,keyType:t,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(a)});class ZodSet extends ZodType{_parse(e){const{status:a,ctx:u}=this._processInputParams(e);if(u.parsedType!==ZodParsedType.set)return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:u.parsedType}),INVALID;const d=this._def;d.minSize!==null&&u.data.size<d.minSize.value&&(addIssueToContext(u,{code:ZodIssueCode.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),a.dirty()),d.maxSize!==null&&u.data.size>d.maxSize.value&&(addIssueToContext(u,{code:ZodIssueCode.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),a.dirty());const c=this._def.valueType;function l(I){const O=new Set;for(const T of I){if(T.status==="aborted")return INVALID;T.status==="dirty"&&a.dirty(),O.add(T.value)}return{status:a.value,value:O}}const m=[...u.data.values()].map((I,O)=>c._parse(new ParseInputLazyPath(u,I,u.path,O)));return u.common.async?Promise.all(m).then(I=>l(I)):l(m)}min(e,a){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(a)}})}max(e,a){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}}ZodSet.create=(t,e)=>new ZodSet({valueType:t,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(e)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==ZodParsedType.function)return addIssueToContext(a,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:a.parsedType}),INVALID;function u(m,I){return makeIssue({data:m,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,getErrorMap(),errorMap].filter(O=>!!O),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:I}})}function d(m,I){return makeIssue({data:m,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,getErrorMap(),errorMap].filter(O=>!!O),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:I}})}const c={errorMap:a.common.contextualErrorMap},l=a.data;if(this._def.returns instanceof ZodPromise){const m=this;return OK(async function(...I){const O=new ZodError([]),T=await m._def.args.parseAsync(I,c).catch(F=>{throw O.addIssue(u(I,F)),O}),C=await Reflect.apply(l,this,T);return await m._def.returns._def.type.parseAsync(C,c).catch(F=>{throw O.addIssue(d(C,F)),O})})}else{const m=this;return OK(function(...I){const O=m._def.args.safeParse(I,c);if(!O.success)throw new ZodError([u(I,O.error)]);const T=Reflect.apply(l,this,O.data),C=m._def.returns.safeParse(T,c);if(!C.success)throw new ZodError([d(T,C.error)]);return C.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,u){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:a||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(u)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:a}=this._processInputParams(e);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}ZodLazy.create=(t,e)=>new ZodLazy({getter:t,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(e)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const a=this._getOrReturnCtx(e);return addIssueToContext(a,{received:a.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}ZodLiteral.create=(t,e)=>new ZodLiteral({value:t,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(e)});function createZodEnum(t,e){return new ZodEnum({values:t,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(e)})}class ZodEnum extends ZodType{_parse(e){if(typeof e.data!="string"){const a=this._getOrReturnCtx(e),u=this._def.values;return addIssueToContext(a,{expected:util$3.joinValues(u),received:a.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._def.values.indexOf(e.data)===-1){const a=this._getOrReturnCtx(e),u=this._def.values;return addIssueToContext(a,{received:a.data,code:ZodIssueCode.invalid_enum_value,options:u}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const a of this._def.values)e[a]=a;return e}get Values(){const e={};for(const a of this._def.values)e[a]=a;return e}get Enum(){const e={};for(const a of this._def.values)e[a]=a;return e}extract(e){return ZodEnum.create(e)}exclude(e){return ZodEnum.create(this.options.filter(a=>!e.includes(a)))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(e){const a=util$3.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(e);if(u.parsedType!==ZodParsedType.string&&u.parsedType!==ZodParsedType.number){const d=util$3.objectValues(a);return addIssueToContext(u,{expected:util$3.joinValues(d),received:u.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(a.indexOf(e.data)===-1){const d=util$3.objectValues(a);return addIssueToContext(u,{received:u.data,code:ZodIssueCode.invalid_enum_value,options:d}),INVALID}return OK(e.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(t,e)=>new ZodNativeEnum({values:t,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(e)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:a}=this._processInputParams(e);if(a.parsedType!==ZodParsedType.promise&&a.common.async===!1)return addIssueToContext(a,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:a.parsedType}),INVALID;const u=a.parsedType===ZodParsedType.promise?a.data:Promise.resolve(a.data);return OK(u.then(d=>this._def.type.parseAsync(d,{path:a.path,errorMap:a.common.contextualErrorMap})))}}ZodPromise.create=(t,e)=>new ZodPromise({type:t,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(e)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:a,ctx:u}=this._processInputParams(e),d=this._def.effect||null,c={addIssue:l=>{addIssueToContext(u,l),l.fatal?a.abort():a.dirty()},get path(){return u.path}};if(c.addIssue=c.addIssue.bind(c),d.type==="preprocess"){const l=d.transform(u.data,c);return u.common.issues.length?{status:"dirty",value:u.data}:u.common.async?Promise.resolve(l).then(m=>this._def.schema._parseAsync({data:m,path:u.path,parent:u})):this._def.schema._parseSync({data:l,path:u.path,parent:u})}if(d.type==="refinement"){const l=m=>{const I=d.refinement(m,c);if(u.common.async)return Promise.resolve(I);if(I instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(u.common.async===!1){const m=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return m.status==="aborted"?INVALID:(m.status==="dirty"&&a.dirty(),l(m.value),{status:a.value,value:m.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(m=>m.status==="aborted"?INVALID:(m.status==="dirty"&&a.dirty(),l(m.value).then(()=>({status:a.value,value:m.value}))))}if(d.type==="transform")if(u.common.async===!1){const l=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!isValid(l))return l;const m=d.transform(l.value,c);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:m}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(l=>isValid(l)?Promise.resolve(d.transform(l.value,c)).then(m=>({status:a.value,value:m})):l);util$3.assertNever(d)}}ZodEffects.create=(t,e,a)=>new ZodEffects({schema:t,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:e,...processCreateParams(a)}),ZodEffects.createWithPreprocess=(t,e,a)=>new ZodEffects({schema:e,effect:{type:"preprocess",transform:t},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(a)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(t,e)=>new ZodOptional({innerType:t,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(e)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(t,e)=>new ZodNullable({innerType:t,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(e)});class ZodDefault extends ZodType{_parse(e){const{ctx:a}=this._processInputParams(e);let u=a.data;return a.parsedType===ZodParsedType.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}ZodDefault.create=(t,e)=>new ZodDefault({innerType:t,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...processCreateParams(e)});class ZodCatch extends ZodType{_parse(e){const{ctx:a}=this._processInputParams(e),u={...a,common:{...a.common,issues:[]}},d=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return isAsync(d)?d.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new ZodError(u.common.issues)},input:u.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new ZodError(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(t,e)=>new ZodCatch({innerType:t,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...processCreateParams(e)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const u=this._getOrReturnCtx(e);return addIssueToContext(u,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:u.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=t=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(t)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:a}=this._processInputParams(e),u=a.data;return this._def.type._parse({data:u,path:a.path,parent:a})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:a,ctx:u}=this._processInputParams(e);if(u.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return c.status==="aborted"?INVALID:c.status==="dirty"?(a.dirty(),DIRTY(c.value)):this._def.out._parseAsync({data:c.value,path:u.path,parent:u})})();{const d=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return d.status==="aborted"?INVALID:d.status==="dirty"?(a.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:u.path,parent:u})}}static create(e,a){return new ZodPipeline({in:e,out:a,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const a=this._def.innerType._parse(e);return isValid(a)&&(a.value=Object.freeze(a.value)),a}}ZodReadonly.create=(t,e)=>new ZodReadonly({innerType:t,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(e)});const custom=(t,e={},a)=>t?ZodAny.create().superRefine((u,d)=>{var c,l;if(!t(u)){const m=typeof e=="function"?e(u):typeof e=="string"?{message:e}:e,I=(l=(c=m.fatal)!==null&&c!==void 0?c:a)!==null&&l!==void 0?l:!0,O=typeof m=="string"?{message:m}:m;d.addIssue({code:"custom",...O,fatal:I})}}):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(t,e={message:`Input not instance of ${t.name}`})=>custom(a=>a instanceof t,e),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:t=>ZodString.create({...t,coerce:!0}),number:t=>ZodNumber.create({...t,coerce:!0}),boolean:t=>ZodBoolean.create({...t,coerce:!0}),bigint:t=>ZodBigInt.create({...t,coerce:!0}),date:t=>ZodDate.create({...t,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util$3},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const errorFormatter=t=>t.message?t.message:"unspecified error";class Web3ValidatorError extends BaseWeb3Error{constructor(e){super(),this.code=ERR_VALIDATION,this.errors=e,super.message=`Web3 validator found ${e.length} error[s]:
12
+ ${this._compileErrors().join(`
13
+ `)}`}_compileErrors(){return this.errors.map(errorFormatter)}}const VALID_ETH_BASE_TYPES=["bool","int","uint","bytes","string","address","tuple"],isAbiParameterSchema=t=>typeof t=="object"&&"type"in t&&"name"in t,isString=t=>typeof t=="string",isHexStrict=t=>typeof t=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(t),isHex=t=>typeof t=="number"||typeof t=="bigint"||typeof t=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(t),extraTypes=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],parseBaseType=t=>{let e=t.replace(/ /,""),a,u=!1,d=[];if(t.includes("[")&&(e=e.slice(0,e.indexOf("[")),d=[...t.matchAll(/(?:\[(\d*)\])/g)].map(c=>parseInt(c[1],10)).map(c=>Number.isNaN(c)?-1:c),u=d.length>0),VALID_ETH_BASE_TYPES.includes(e))return{baseType:e,isArray:u,baseTypeSize:a,arraySizes:d};if(e.startsWith("int"))a=parseInt(e.substring(3),10),e="int";else if(e.startsWith("uint"))a=parseInt(t.substring(4),10),e="uint";else if(e.startsWith("bytes"))a=parseInt(e.substring(5),10),e="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:d};return{baseType:e,isArray:u,baseTypeSize:a,arraySizes:d}},convertEthType=(t,e={})=>{if(Object.keys(e).includes("type"))throw new Web3ValidatorError([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:t},instancePath:"",schemaPath:""}]);const{baseType:u,baseTypeSize:d}=parseBaseType(t);if(!u&&!extraTypes.includes(t))throw new Web3ValidatorError([{keyword:"eth",message:`Eth data type "${t}" is not valid`,params:{eth:t},instancePath:"",schemaPath:""}]);if(u){if(u==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${u}${d??""}`,required:!0}}return t?{format:t,required:!0}:{}},abiSchemaToJsonSchema=(t,e="/0")=>{const a={type:"array",items:[],maxItems:t.length,minItems:t.length};for(const[u,d]of t.entries()){let c,l,m=[];isAbiParameterSchema(d)?(c=d.type,l=d.name,m=d.components):typeof d=="string"?(c=d,l=`${e}/${u}`):Array.isArray(d)&&(d[0]&&typeof d[0]=="string"&&d[0].startsWith("tuple")&&!Array.isArray(d[0])&&d[1]&&Array.isArray(d[1])?(c=d[0],l=`${e}/${u}`,m=d[1]):(c="tuple",l=`${e}/${u}`,m=d));const{baseType:I,isArray:O,arraySizes:T}=parseBaseType(c);let C,j=a;for(let F=T.length-1;F>0;F-=1)C={type:"array",items:[],maxItems:T[F],minItems:T[F]},T[F]<0&&(delete C.maxItems,delete C.minItems),Array.isArray(j.items)?j.items.length===0?j.items=C:j.items.push(C):j.items=[j.items,C],j=C;if(I==="tuple"&&!O){const F=abiSchemaToJsonSchema(m,l);F.$id=l,j.items.push(F)}else if(I==="tuple"&&O){const F=T[0],U={$id:l,type:"array",items:abiSchemaToJsonSchema(m,l),maxItems:F,minItems:F};F<0&&(delete U.maxItems,delete U.minItems),j.items.push(U)}else if(O){const F=T[0],U={type:"array",$id:l,items:convertEthType(String(I)),minItems:F,maxItems:F};F<0&&(delete U.maxItems,delete U.minItems),j.items.push(U)}else Array.isArray(j.items)?j.items.push(Object.assign({$id:l},convertEthType(c))):j.items.items.push(Object.assign({$id:l},convertEthType(c)));j=a}return a},ethAbiToJsonSchema=t=>abiSchemaToJsonSchema(t),fetchArrayElement=(t,e)=>e===1?t:fetchArrayElement(t[0],e-1),transformJsonDataToAbiFormat=(t,e,a)=>{const u=[];for(const[d,c]of t.entries()){let l,m,I=[];isAbiParameterSchema(c)?(l=c.type,m=c.name,I=c.components):typeof c=="string"?l=c:Array.isArray(c)&&(c[1]&&Array.isArray(c[1])?(l=c[0],I=c[1]):(l="tuple",I=c));const{baseType:O,isArray:T,arraySizes:C}=parseBaseType(l),j=Array.isArray(e)?e[d]:e[m];if(O==="tuple"&&!T)u.push(transformJsonDataToAbiFormat(I,j,a));else if(O==="tuple"&&T){const F=[];for(const U of j)if(C.length>1){const Z=fetchArrayElement(U,C.length-1),J=[];for(const X of Z)J.push(transformJsonDataToAbiFormat(I,X,a));F.push(J)}else F.push(transformJsonDataToAbiFormat(I,U,a));u.push(F)}else u.push(j)}return a=a??[],a.push(...u),a},codePointToInt=t=>{if(t>=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error(`Invalid code point: ${t}`)},hexToNumber$1=t=>{if(!isHexStrict(t))throw new Error("Invalid hex string");const[e,a]=t.startsWith("-")?[!0,t.slice(1)]:[!1,t],u=BigInt(a);return u>Number.MAX_SAFE_INTEGER?e?-u:u:u<Number.MIN_SAFE_INTEGER?u:e?-1*Number(u):Number(u)},numberToHex$2=t=>{if((typeof t=="number"||typeof t=="bigint")&&t<0)return`-0x${t.toString(16).slice(1)}`;if((typeof t=="number"||typeof t=="bigint")&&t>=0)return`0x${t.toString(16)}`;if(typeof t=="string"&&isHexStrict(t)){const[e,a]=t.startsWith("-")?[!0,t.slice(1)]:[!1,t],u=a.split(/^(-)?0(x|X)/).slice(-1)[0];return`${e?"-":""}0x${u.replace(/^0+/,"").toLowerCase()}`}if(typeof t=="string"&&!isHexStrict(t))return numberToHex$2(BigInt(t));throw new InvalidNumberError(t)},padLeft=(t,e,a="0")=>{if(typeof t=="string"&&!isHexStrict(t))return t.padStart(e,a);const u=typeof t=="string"&&isHexStrict(t)?t:numberToHex$2(t),[d,c]=u.startsWith("-")?["-0x",u.slice(3)]:["0x",u.slice(2)];return`${d}${c.padStart(e,a)}`};function uint8ArrayToHexString$1(t){let e="0x";for(const a of t){const u=a.toString(16);e+=u.length===1?`0${u}`:u}return e}const charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16(t){if(t>=charCodeMap.zero&&t<=charCodeMap.nine)return t-charCodeMap.zero;if(t>=charCodeMap.A&&t<=charCodeMap.F)return t-(charCodeMap.A-10);if(t>=charCodeMap.a&&t<=charCodeMap.f)return t-(charCodeMap.a-10)}function hexToUint8Array(t){let e=0;if(t.startsWith("0")&&(t[1]==="x"||t[1]==="X")&&(e=2),t.length%2!==0)throw new InvalidBytesError(`hex string has odd length: ${t}`);const a=(t.length-e)/2,u=new Uint8Array(a);for(let d=0,c=e;d<a;d+=1){const l=charCodeToBase16(t.charCodeAt(c++)),m=charCodeToBase16(t.charCodeAt(c++));if(l===void 0||m===void 0)throw new InvalidBytesError(`Invalid byte sequence ("${t[c-2]}${t[c-1]}" in "${t}").`);u[d]=l*16+m}return u}function ensureIfUint8Array(t){var e;return!(t instanceof Uint8Array)&&((e=t==null?void 0:t.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"?Uint8Array.from(t):t}const utils$N=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema,codePointToInt,ensureIfUint8Array,ethAbiToJsonSchema,fetchArrayElement,hexToNumber:hexToNumber$1,hexToUint8Array,numberToHex:numberToHex$2,padLeft,parseBaseType,transformJsonDataToAbiFormat,uint8ArrayToHexString:uint8ArrayToHexString$1},Symbol.toStringTag,{value:"Module"})),isUint8Array$1=t=>{var e;return t instanceof Uint8Array||((e=t==null?void 0:t.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"},isBytes$1=(t,e={abiType:"bytes"})=>{if(typeof t!="string"&&!Array.isArray(t)&&!isUint8Array$1(t)||typeof t=="string"&&isHexStrict(t)&&t.startsWith("-")||typeof t=="string"&&!isHexStrict(t))return!1;let a;if(typeof t=="string"){if(t.length%2!==0)return!1;a=hexToUint8Array(t)}else if(Array.isArray(t)){if(t.some(u=>u<0||u>255||!Number.isInteger(u)))return!1;a=new Uint8Array(t)}else a=t;if(e!=null&&e.abiType){const{baseTypeSize:u}=parseBaseType(e.abiType);return u?a.length===u:!0}return e!=null&&e.size?a.length===(e==null?void 0:e.size):!0},checkAddressCheckSum=t=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(t))return!1;const e=t.slice(2),a=utf8ToBytes(e.toLowerCase()),u=uint8ArrayToHexString$1(keccak256(ensureIfUint8Array(a))).slice(2);for(let d=0;d<40;d+=1)if(parseInt(u[d],16)>7&&e[d].toUpperCase()!==e[d]||parseInt(u[d],16)<=7&&e[d].toLowerCase()!==e[d])return!1;return!0},isAddress=(t,e=!0)=>{if(typeof t!="string"&&!isUint8Array$1(t))return!1;let a;return isUint8Array$1(t)?a=uint8ArrayToHexString$1(t):typeof t=="string"&&!isHexStrict(t)?a=t.toLowerCase().startsWith("0x")?t:`0x${t}`:a=t,/^(0x)?[0-9a-f]{40}$/i.test(a)?/^(0x|0X)?[0-9a-f]{40}$/.test(a)||/^(0x|0X)?[0-9A-F]{40}$/.test(a)?!0:e?checkAddressCheckSum(a):!0:!1};var FMT_NUMBER;(function(t){t.NUMBER="NUMBER_NUMBER",t.HEX="NUMBER_HEX",t.STR="NUMBER_STR",t.BIGINT="NUMBER_BIGINT"})(FMT_NUMBER||(FMT_NUMBER={}));var FMT_BYTES;(function(t){t.HEX="BYTES_HEX",t.UINT8ARRAY="BYTES_UINT8ARRAY"})(FMT_BYTES||(FMT_BYTES={})),FMT_NUMBER.BIGINT,FMT_BYTES.HEX,FMT_NUMBER.HEX,FMT_BYTES.HEX;var BlockTags;(function(t){t.EARLIEST="earliest",t.LATEST="latest",t.PENDING="pending",t.SAFE="safe",t.FINALIZED="finalized"})(BlockTags||(BlockTags={}));var HardforksOrdered;(function(t){t.chainstart="chainstart",t.frontier="frontier",t.homestead="homestead",t.dao="dao",t.tangerineWhistle="tangerineWhistle",t.spuriousDragon="spuriousDragon",t.byzantium="byzantium",t.constantinople="constantinople",t.petersburg="petersburg",t.istanbul="istanbul",t.muirGlacier="muirGlacier",t.berlin="berlin",t.london="london",t.altair="altair",t.arrowGlacier="arrowGlacier",t.grayGlacier="grayGlacier",t.bellatrix="bellatrix",t.merge="merge",t.capella="capella",t.shanghai="shanghai"})(HardforksOrdered||(HardforksOrdered={}));const bigintPower=(t,e)=>{let a=t;for(let u=1;u<e;u+=1)a*=t;return a},isUInt=(t,e={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof t)||typeof t=="string"&&t.length===0)return!1;let a;if(e!=null&&e.abiType){const{baseTypeSize:d}=parseBaseType(e.abiType);d&&(a=d)}else e.bitSize&&(a=e.bitSize);const u=bigintPower(BigInt(2),BigInt(a??256))-BigInt(1);try{const d=typeof t=="string"&&isHexStrict(t)?BigInt(hexToNumber$1(t)):BigInt(t);return d>=0&&d<=u}catch{return!1}},isInt=(t,e={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof t)||typeof t=="number"&&t>Number.MAX_SAFE_INTEGER)return!1;let a;if(e!=null&&e.abiType){const{baseTypeSize:c,baseType:l}=parseBaseType(e.abiType);if(l!=="int")return!1;c&&(a=c)}else e.bitSize&&(a=e.bitSize);const u=bigintPower(BigInt(2),BigInt((a??256)-1)),d=BigInt(-1)*bigintPower(BigInt(2),BigInt((a??256)-1));try{const c=typeof t=="string"&&isHexStrict(t)?BigInt(hexToNumber$1(t)):BigInt(t);return c>=d&&c<=u}catch{return!1}},isNumber=t=>!!(isInt(t)||typeof t=="string"&&/[0-9.]/.test(t)&&t.indexOf(".")===t.lastIndexOf(".")||typeof t=="number"),isBlockNumber=t=>isUInt(t),isBlockTag=t=>Object.values(BlockTags).includes(t),isBlockNumberOrTag=t=>isBlockTag(t)||isBlockNumber(t),isBloom=t=>typeof t!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(t)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(t)||/^(0x)?[0-9A-F]{512}$/.test(t)),isBoolean=t=>["number","string","boolean"].includes(typeof t)?typeof t=="boolean"?!0:typeof t=="string"&&!isHexStrict(t)?t==="1"||t==="0":typeof t=="string"&&isHexStrict(t)?t==="0x1"||t==="0x0":t===1||t===0:!1,isNullish=t=>t==null,isTopic=t=>typeof t!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(t)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(t)||/^(0x)?[0-9A-F]{64}$/.test(t)),isFilterObject=t=>{const e=["fromBlock","toBlock","address","topics","blockHash"];if(isNullish(t)||typeof t!="object"||!Object.keys(t).every(a=>e.includes(a))||!isNullish(t.fromBlock)&&!isBlockNumberOrTag(t.fromBlock)||!isNullish(t.toBlock)&&!isBlockNumberOrTag(t.toBlock))return!1;if(!isNullish(t.address)){if(Array.isArray(t.address)){if(!t.address.every(a=>isAddress(a)))return!1}else if(!isAddress(t.address))return!1}return!(!isNullish(t.topics)&&!t.topics.every(a=>isNullish(a)?!0:Array.isArray(a)?a.every(u=>isTopic(u)):!!isTopic(a)))},formats={address:t=>isAddress(t),bloom:t=>isBloom(t),blockNumber:t=>isBlockNumber(t),blockTag:t=>isBlockTag(t),blockNumberOrTag:t=>isBlockNumberOrTag(t),bool:t=>isBoolean(t),bytes:t=>isBytes$1(t),filter:t=>isFilterObject(t),hex:t=>isHexStrict(t),uint:t=>isUInt(t),int:t=>isInt(t),number:t=>isNumber(t),string:t=>isString(t)};for(let t=8;t<=256;t+=8)formats[`int${t}`]=e=>isInt(e,{bitSize:t}),formats[`uint${t}`]=e=>isUInt(e,{bitSize:t});for(let t=1;t<=32;t+=1)formats[`bytes${t}`]=e=>isBytes$1(e,{size:t});formats.bytes256=formats.bytes;const convertToZod=t=>{if((!(t!=null&&t.type)||(t==null?void 0:t.type)==="object")&&(t!=null&&t.properties)){const e={};for(const a of Object.keys(t.properties)){const u=convertToZod(t.properties[a]);u&&(e[a]=u)}return Array.isArray(t.required)?z.object(e).partial().required(t.required.reduce((a,u)=>Object.assign(Object.assign({},a),{[u]:!0}),{})):z.object(e).partial()}if((t==null?void 0:t.type)==="array"&&(t!=null&&t.items)){if(Array.isArray(t.items)&&t.items.length>0){const e=[];for(const a of t.items){const u=convertToZod(a);u&&e.push(u)}return z.tuple(e)}return z.array(convertToZod(t.items))}if(t.oneOf&&Array.isArray(t.oneOf))return z.union(t.oneOf.map(e=>convertToZod(e)));if(t!=null&&t.format){if(!formats[t.format])throw new SchemaFormatError(t.format);return z.any().refine(formats[t.format],e=>({params:{value:e,format:t.format}}))}return t!=null&&t.type&&(t==null?void 0:t.type)!=="object"&&typeof z[String(t.type)]=="function"?z[String(t.type)]():z.object({data:z.any()}).partial()};class Validator{static factory(){return Validator.validatorInstance||(Validator.validatorInstance=new Validator),Validator.validatorInstance}validate(e,a,u){var d,c;const m=convertToZod(e).safeParse(a);if(!m.success){const I=this.convertErrors((c=(d=m.error)===null||d===void 0?void 0:d.issues)!==null&&c!==void 0?c:[]);if(I){if(u!=null&&u.silent)return I;throw new Web3ValidatorError(I)}}}convertErrors(e){if(e&&Array.isArray(e)&&e.length>0)return e.map(a=>{var u;let d,c,l,m;m=a.path.join("/");const I=String(a.path[a.path.length-1]),O=a.path.join("/");if(a.code===ZodIssueCode.too_big)c="maxItems",m=`${O}/maxItems`,l={limit:a.maximum},d=`must NOT have more than ${a.maximum} items`;else if(a.code===ZodIssueCode.too_small)c="minItems",m=`${O}/minItems`,l={limit:a.minimum},d=`must NOT have fewer than ${a.minimum} items`;else if(a.code===ZodIssueCode.custom){const{value:T,format:C}=(u=a.params)!==null&&u!==void 0?u:{};typeof T>"u"?d=`value at "/${m}" is required`:d=`value "${typeof T=="object"?JSON.stringify(T):T}" at "/${m}" must pass "${C}" validation`,l={value:T}}return{keyword:c??I,instancePath:O?`/${O}`:"",schemaPath:m?`#${m}`:"#",params:l??{value:a.message},message:d??a.message}})}}class Web3Validator{constructor(){this._validator=Validator.factory()}validateJSONSchema(e,a,u){return this._validator.validate(e,a,u)}validate(e,a,u={silent:!1}){var d,c;const l=ethAbiToJsonSchema(e);if(!(Array.isArray(l.items)&&((d=l.items)===null||d===void 0?void 0:d.length)===0&&a.length===0)){if(Array.isArray(l.items)&&((c=l.items)===null||c===void 0?void 0:c.length)===0&&a.length!==0)throw new Web3ValidatorError([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:a}]);return this._validator.validate(l,a,u)}}}const validator=new Web3Validator;function isUint8Array(t){var e;return t instanceof Uint8Array||((e=t==null?void 0:t.constructor)===null||e===void 0?void 0:e.name)==="Uint8Array"}BigInt(0),BigInt(1),BigInt(1e3),BigInt(1e3),BigInt(1e3),BigInt(1e3),BigInt(1e6),BigInt(1e6),BigInt(1e6),BigInt(1e6),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e9),BigInt(1e12),BigInt(1e12),BigInt(1e12),BigInt(1e15),BigInt(1e15),BigInt(1e15),BigInt("1000000000000000000"),BigInt("1000000000000000000000"),BigInt("1000000000000000000000"),BigInt("1000000000000000000000000"),BigInt("1000000000000000000000000000"),BigInt("1000000000000000000000000000000");const bytesToUint8Array=t=>{if(validator.validate(["bytes"],[t]),isUint8Array(t))return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="string")return hexToUint8Array(t);throw new InvalidBytesError(t)},{uint8ArrayToHexString}=utils$N,bytesToHex=t=>uint8ArrayToHexString(bytesToUint8Array(t)),numberToHex$1=(t,e)=>{typeof t!="bigint"&&validator.validate(["int"],[t]);let a=numberToHex$2(t);return e&&(!a.startsWith("-")&&a.length%2===1?a="0x0".concat(a.slice(2)):a.length%2===0&&a.startsWith("-")&&(a="-0x0".concat(a.slice(3)))),a},utf8ToHex=t=>{validator.validate(["string"],[t]);let e=t.replace(/^(?:\u0000)/,"");return e=e.replace(/(?:\u0000)$/,""),bytesToHex(new TextEncoder().encode(e))},toHex$2=(t,e)=>{if(typeof t=="string"&&isAddress(t))return e?"address":`0x${t.toLowerCase().replace(/^0x/i,"")}`;if(typeof t=="boolean")return e?"bool":t?"0x01":"0x00";if(typeof t=="number")return e?t<0?"int256":"uint256":numberToHex$1(t);if(typeof t=="bigint")return e?"bigint":numberToHex$1(t);if(typeof t=="object"&&t)return e?"string":utf8ToHex(JSON.stringify(t));if(typeof t=="string"){if(t.startsWith("-0x")||t.startsWith("-0X"))return e?"int256":numberToHex$1(t);if(isHexStrict(t))return e?"bytes":t;if(isHex(t)&&!isInt(t)&&!isUInt(t))return e?"bytes":`0x${t}`;if(isHex(t)&&!isInt(t)&&isUInt(t))return e?"uint":numberToHex$1(t);if(!Number.isFinite(t))return e?"string":utf8ToHex(t)}throw new HexProcessingError(t)};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function getAugmentedNamespace(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var a=function u(){return this instanceof u?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(t).forEach(function(u){var d=Object.getOwnPropertyDescriptor(t,u);Object.defineProperty(a,u,d.get?d:{enumerable:!0,get:function(){return t[u]}})}),a}var isNumeric$1=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(t){var e,a,u,d=Q.prototype={constructor:Q,toString:null,valueOf:null},c=new Q(1),l=20,m=4,I=-7,O=21,T=-1e7,C=1e7,j=!1,F=1,U=0,Z={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},J="0123456789abcdefghijklmnopqrstuvwxyz",X=!0;function Q(V,ae){var ne,M,v,S,y,w,P,L,N=this;if(!(N instanceof Q))return new Q(V,ae);if(ae==null){if(V&&V._isBigNumber===!0){N.s=V.s,!V.c||V.e>C?N.c=N.e=null:V.e<T?N.c=[N.e=0]:(N.e=V.e,N.c=V.c.slice());return}if((w=typeof V=="number")&&V*0==0){if(N.s=1/V<0?(V=-V,-1):1,V===~~V){for(S=0,y=V;y>=10;y/=10,S++);S>C?N.c=N.e=null:(N.e=S,N.c=[V]);return}L=String(V)}else{if(!isNumeric$1.test(L=String(V)))return u(N,L,w);N.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(S=L.indexOf("."))>-1&&(L=L.replace(".","")),(y=L.search(/e/i))>0?(S<0&&(S=y),S+=+L.slice(y+1),L=L.substring(0,y)):S<0&&(S=L.length)}else{if(intCheck(ae,2,J.length,"Base"),ae==10&&X)return N=new Q(V),me(N,l+N.e+1,m);if(L=String(V),w=typeof V=="number"){if(V*0!=0)return u(N,L,w,ae);if(N.s=1/V<0?(L=L.slice(1),-1):1,Q.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+V)}else N.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(ne=J.slice(0,ae),S=y=0,P=L.length;y<P;y++)if(ne.indexOf(M=L.charAt(y))<0){if(M=="."){if(y>S){S=P;continue}}else if(!v&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){v=!0,y=-1,S=0;continue}return u(N,String(V),w,ae)}w=!1,L=a(L,ae,10,N.s),(S=L.indexOf("."))>-1?L=L.replace(".",""):S=L.length}for(y=0;L.charCodeAt(y)===48;y++);for(P=L.length;L.charCodeAt(--P)===48;);if(L=L.slice(y,++P)){if(P-=y,w&&Q.DEBUG&&P>15&&(V>MAX_SAFE_INTEGER$1||V!==mathfloor(V)))throw Error(tooManyDigits+N.s*V);if((S=S-y-1)>C)N.c=N.e=null;else if(S<T)N.c=[N.e=0];else{if(N.e=S,N.c=[],y=(S+1)%LOG_BASE,S<0&&(y+=LOG_BASE),y<P){for(y&&N.c.push(+L.slice(0,y)),P-=LOG_BASE;y<P;)N.c.push(+L.slice(y,y+=LOG_BASE));y=LOG_BASE-(L=L.slice(y)).length}else y-=P;for(;y--;L+="0");N.c.push(+L)}}else N.c=[N.e=0]}Q.clone=clone,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(V){var ae,ne;if(V!=null)if(typeof V=="object"){if(V.hasOwnProperty(ae="DECIMAL_PLACES")&&(ne=V[ae],intCheck(ne,0,MAX,ae),l=ne),V.hasOwnProperty(ae="ROUNDING_MODE")&&(ne=V[ae],intCheck(ne,0,8,ae),m=ne),V.hasOwnProperty(ae="EXPONENTIAL_AT")&&(ne=V[ae],ne&&ne.pop?(intCheck(ne[0],-MAX,0,ae),intCheck(ne[1],0,MAX,ae),I=ne[0],O=ne[1]):(intCheck(ne,-MAX,MAX,ae),I=-(O=ne<0?-ne:ne))),V.hasOwnProperty(ae="RANGE"))if(ne=V[ae],ne&&ne.pop)intCheck(ne[0],-MAX,-1,ae),intCheck(ne[1],1,MAX,ae),T=ne[0],C=ne[1];else if(intCheck(ne,-MAX,MAX,ae),ne)T=-(C=ne<0?-ne:ne);else throw Error(bignumberError+ae+" cannot be zero: "+ne);if(V.hasOwnProperty(ae="CRYPTO"))if(ne=V[ae],ne===!!ne)if(ne)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=ne;else throw j=!ne,Error(bignumberError+"crypto unavailable");else j=ne;else throw Error(bignumberError+ae+" not true or false: "+ne);if(V.hasOwnProperty(ae="MODULO_MODE")&&(ne=V[ae],intCheck(ne,0,9,ae),F=ne),V.hasOwnProperty(ae="POW_PRECISION")&&(ne=V[ae],intCheck(ne,0,MAX,ae),U=ne),V.hasOwnProperty(ae="FORMAT"))if(ne=V[ae],typeof ne=="object")Z=ne;else throw Error(bignumberError+ae+" not an object: "+ne);if(V.hasOwnProperty(ae="ALPHABET"))if(ne=V[ae],typeof ne=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(ne))X=ne.slice(0,10)=="0123456789",J=ne;else throw Error(bignumberError+ae+" invalid: "+ne)}else throw Error(bignumberError+"Object expected: "+V);return{DECIMAL_PLACES:l,ROUNDING_MODE:m,EXPONENTIAL_AT:[I,O],RANGE:[T,C],CRYPTO:j,MODULO_MODE:F,POW_PRECISION:U,FORMAT:Z,ALPHABET:J}},Q.isBigNumber=function(V){if(!V||V._isBigNumber!==!0)return!1;if(!Q.DEBUG)return!0;var ae,ne,M=V.c,v=V.e,S=V.s;e:if({}.toString.call(M)=="[object Array]"){if((S===1||S===-1)&&v>=-MAX&&v<=MAX&&v===mathfloor(v)){if(M[0]===0){if(v===0&&M.length===1)return!0;break e}if(ae=(v+1)%LOG_BASE,ae<1&&(ae+=LOG_BASE),String(M[0]).length==ae){for(ae=0;ae<M.length;ae++)if(ne=M[ae],ne<0||ne>=BASE||ne!==mathfloor(ne))break e;if(ne!==0)return!0}}}else if(M===null&&v===null&&(S===null||S===1||S===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+V)},Q.maximum=Q.max=function(){return se(arguments,-1)},Q.minimum=Q.min=function(){return se(arguments,1)},Q.random=function(){var V=9007199254740992,ae=Math.random()*V&2097151?function(){return mathfloor(Math.random()*V)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(ne){var M,v,S,y,w,P=0,L=[],N=new Q(c);if(ne==null?ne=l:intCheck(ne,0,MAX),y=mathceil(ne/LOG_BASE),j)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(y*=2));P<y;)w=M[P]*131072+(M[P+1]>>>11),w>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),M[P]=v[0],M[P+1]=v[1]):(L.push(w%1e14),P+=2);P=y/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(y*=7);P<y;)w=(M[P]&31)*281474976710656+M[P+1]*1099511627776+M[P+2]*4294967296+M[P+3]*16777216+(M[P+4]<<16)+(M[P+5]<<8)+M[P+6],w>=9e15?crypto.randomBytes(7).copy(M,P):(L.push(w%1e14),P+=7);P=y/7}else throw j=!1,Error(bignumberError+"crypto unavailable");if(!j)for(;P<y;)w=ae(),w<9e15&&(L[P++]=w%1e14);for(y=L[--P],ne%=LOG_BASE,y&&ne&&(w=POWS_TEN[LOG_BASE-ne],L[P]=mathfloor(y/w)*w);L[P]===0;L.pop(),P--);if(P<0)L=[S=0];else{for(S=-1;L[0]===0;L.splice(0,1),S-=LOG_BASE);for(P=1,w=L[0];w>=10;w/=10,P++);P<LOG_BASE&&(S-=LOG_BASE-P)}return N.e=S,N.c=L,N}}(),Q.sum=function(){for(var V=1,ae=arguments,ne=new Q(ae[0]);V<ae.length;)ne=ne.plus(ae[V++]);return ne},a=function(){var V="0123456789";function ae(ne,M,v,S){for(var y,w=[0],P,L=0,N=ne.length;L<N;){for(P=w.length;P--;w[P]*=M);for(w[0]+=S.indexOf(ne.charAt(L++)),y=0;y<w.length;y++)w[y]>v-1&&(w[y+1]==null&&(w[y+1]=0),w[y+1]+=w[y]/v|0,w[y]%=v)}return w.reverse()}return function(ne,M,v,S,y){var w,P,L,N,E,A,D,H,Y=ne.indexOf("."),le=l,_e=m;for(Y>=0&&(N=U,U=0,ne=ne.replace(".",""),H=new Q(M),A=H.pow(ne.length-Y),U=N,H.c=ae(toFixedPoint(coeffToString(A.c),A.e,"0"),10,v,V),H.e=H.c.length),D=ae(ne,M,v,y?(w=J,V):(w=V,J)),L=N=D.length;D[--N]==0;D.pop());if(!D[0])return w.charAt(0);if(Y<0?--L:(A.c=D,A.e=L,A.s=S,A=e(A,H,le,_e,v),D=A.c,E=A.r,L=A.e),P=L+le+1,Y=D[P],N=v/2,E=E||P<0||D[P+1]!=null,E=_e<4?(Y!=null||E)&&(_e==0||_e==(A.s<0?3:2)):Y>N||Y==N&&(_e==4||E||_e==6&&D[P-1]&1||_e==(A.s<0?8:7)),P<1||!D[0])ne=E?toFixedPoint(w.charAt(1),-le,w.charAt(0)):w.charAt(0);else{if(D.length=P,E)for(--v;++D[--P]>v;)D[P]=0,P||(++L,D=[1].concat(D));for(N=D.length;!D[--N];);for(Y=0,ne="";Y<=N;ne+=w.charAt(D[Y++]));ne=toFixedPoint(ne,L,w.charAt(0))}return ne}}(),e=function(){function V(M,v,S){var y,w,P,L,N=0,E=M.length,A=v%SQRT_BASE,D=v/SQRT_BASE|0;for(M=M.slice();E--;)P=M[E]%SQRT_BASE,L=M[E]/SQRT_BASE|0,y=D*P+L*A,w=A*P+y%SQRT_BASE*SQRT_BASE+N,N=(w/S|0)+(y/SQRT_BASE|0)+D*L,M[E]=w%S;return N&&(M=[N].concat(M)),M}function ae(M,v,S,y){var w,P;if(S!=y)P=S>y?1:-1;else for(w=P=0;w<S;w++)if(M[w]!=v[w]){P=M[w]>v[w]?1:-1;break}return P}function ne(M,v,S,y){for(var w=0;S--;)M[S]-=w,w=M[S]<v[S]?1:0,M[S]=w*y+M[S]-v[S];for(;!M[0]&&M.length>1;M.splice(0,1));}return function(M,v,S,y,w){var P,L,N,E,A,D,H,Y,le,_e,he,fe,ve,ge,Ie,ue,ce,Te=M.s==v.s?1:-1,ke=M.c,He=v.c;if(!ke||!ke[0]||!He||!He[0])return new Q(!M.s||!v.s||(ke?He&&ke[0]==He[0]:!He)?NaN:ke&&ke[0]==0||!He?Te*0:Te/0);for(Y=new Q(Te),le=Y.c=[],L=M.e-v.e,Te=S+L+1,w||(w=BASE,L=bitFloor(M.e/LOG_BASE)-bitFloor(v.e/LOG_BASE),Te=Te/LOG_BASE|0),N=0;He[N]==(ke[N]||0);N++);if(He[N]>(ke[N]||0)&&L--,Te<0)le.push(1),E=!0;else{for(ge=ke.length,ue=He.length,N=0,Te+=2,A=mathfloor(w/(He[0]+1)),A>1&&(He=V(He,A,w),ke=V(ke,A,w),ue=He.length,ge=ke.length),ve=ue,_e=ke.slice(0,ue),he=_e.length;he<ue;_e[he++]=0);ce=He.slice(),ce=[0].concat(ce),Ie=He[0],He[1]>=w/2&&Ie++;do{if(A=0,P=ae(He,_e,ue,he),P<0){if(fe=_e[0],ue!=he&&(fe=fe*w+(_e[1]||0)),A=mathfloor(fe/Ie),A>1)for(A>=w&&(A=w-1),D=V(He,A,w),H=D.length,he=_e.length;ae(D,_e,H,he)==1;)A--,ne(D,ue<H?ce:He,H,w),H=D.length,P=1;else A==0&&(P=A=1),D=He.slice(),H=D.length;if(H<he&&(D=[0].concat(D)),ne(_e,D,he,w),he=_e.length,P==-1)for(;ae(He,_e,ue,he)<1;)A++,ne(_e,ue<he?ce:He,he,w),he=_e.length}else P===0&&(A++,_e=[0]);le[N++]=A,_e[0]?_e[he++]=ke[ve]||0:(_e=[ke[ve]],he=1)}while((ve++<ge||_e[0]!=null)&&Te--);E=_e[0]!=null,le[0]||le.splice(0,1)}if(w==BASE){for(N=1,Te=le[0];Te>=10;Te/=10,N++);me(Y,S+(Y.e=N+L*LOG_BASE-1)+1,y,E)}else Y.e=L,Y.r=+E;return Y}}();function te(V,ae,ne,M){var v,S,y,w,P;if(ne==null?ne=m:intCheck(ne,0,8),!V.c)return V.toString();if(v=V.c[0],y=V.e,ae==null)P=coeffToString(V.c),P=M==1||M==2&&(y<=I||y>=O)?toExponential(P,y):toFixedPoint(P,y,"0");else if(V=me(new Q(V),ae,ne),S=V.e,P=coeffToString(V.c),w=P.length,M==1||M==2&&(ae<=S||S<=I)){for(;w<ae;P+="0",w++);P=toExponential(P,S)}else if(ae-=y,P=toFixedPoint(P,S,"0"),S+1>w){if(--ae>0)for(P+=".";ae--;P+="0");}else if(ae+=S-w,ae>0)for(S+1==w&&(P+=".");ae--;P+="0");return V.s<0&&v?"-"+P:P}function se(V,ae){for(var ne,M,v=1,S=new Q(V[0]);v<V.length;v++)M=new Q(V[v]),(!M.s||(ne=compare$1(S,M))===ae||ne===0&&S.s===ae)&&(S=M);return S}function pe(V,ae,ne){for(var M=1,v=ae.length;!ae[--v];ae.pop());for(v=ae[0];v>=10;v/=10,M++);return(ne=M+ne*LOG_BASE-1)>C?V.c=V.e=null:ne<T?V.c=[V.e=0]:(V.e=ne,V.c=ae),V}u=function(){var V=/^(-?)0([xbo])(?=\w[\w.]*$)/i,ae=/^([^.]+)\.$/,ne=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(S,y,w,P){var L,N=w?y:y.replace(v,"");if(M.test(N))S.s=isNaN(N)?null:N<0?-1:1;else{if(!w&&(N=N.replace(V,function(E,A,D){return L=(D=D.toLowerCase())=="x"?16:D=="b"?2:8,!P||P==L?A:E}),P&&(L=P,N=N.replace(ae,"$1").replace(ne,"0.$1")),y!=N))return new Q(N,L);if(Q.DEBUG)throw Error(bignumberError+"Not a"+(P?" base "+P:"")+" number: "+y);S.s=null}S.c=S.e=null}}();function me(V,ae,ne,M){var v,S,y,w,P,L,N,E=V.c,A=POWS_TEN;if(E){e:{for(v=1,w=E[0];w>=10;w/=10,v++);if(S=ae-v,S<0)S+=LOG_BASE,y=ae,P=E[L=0],N=mathfloor(P/A[v-y-1]%10);else if(L=mathceil((S+1)/LOG_BASE),L>=E.length)if(M){for(;E.length<=L;E.push(0));P=N=0,v=1,S%=LOG_BASE,y=S-LOG_BASE+1}else break e;else{for(P=w=E[L],v=1;w>=10;w/=10,v++);S%=LOG_BASE,y=S-LOG_BASE+v,N=y<0?0:mathfloor(P/A[v-y-1]%10)}if(M=M||ae<0||E[L+1]!=null||(y<0?P:P%A[v-y-1]),M=ne<4?(N||M)&&(ne==0||ne==(V.s<0?3:2)):N>5||N==5&&(ne==4||M||ne==6&&(S>0?y>0?P/A[v-y]:0:E[L-1])%10&1||ne==(V.s<0?8:7)),ae<1||!E[0])return E.length=0,M?(ae-=V.e+1,E[0]=A[(LOG_BASE-ae%LOG_BASE)%LOG_BASE],V.e=-ae||0):E[0]=V.e=0,V;if(S==0?(E.length=L,w=1,L--):(E.length=L+1,w=A[LOG_BASE-S],E[L]=y>0?mathfloor(P/A[v-y]%A[y])*w:0),M)for(;;)if(L==0){for(S=1,y=E[0];y>=10;y/=10,S++);for(y=E[0]+=w,w=1;y>=10;y/=10,w++);S!=w&&(V.e++,E[0]==BASE&&(E[0]=1));break}else{if(E[L]+=w,E[L]!=BASE)break;E[L--]=0,w=1}for(S=E.length;E[--S]===0;E.pop());}V.e>C?V.c=V.e=null:V.e<T&&(V.c=[V.e=0])}return V}function Ee(V){var ae,ne=V.e;return ne===null?V.toString():(ae=coeffToString(V.c),ae=ne<=I||ne>=O?toExponential(ae,ne):toFixedPoint(ae,ne,"0"),V.s<0?"-"+ae:ae)}return d.absoluteValue=d.abs=function(){var V=new Q(this);return V.s<0&&(V.s=1),V},d.comparedTo=function(V,ae){return compare$1(this,new Q(V,ae))},d.decimalPlaces=d.dp=function(V,ae){var ne,M,v,S=this;if(V!=null)return intCheck(V,0,MAX),ae==null?ae=m:intCheck(ae,0,8),me(new Q(S),V+S.e+1,ae);if(!(ne=S.c))return null;if(M=((v=ne.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,v=ne[v])for(;v%10==0;v/=10,M--);return M<0&&(M=0),M},d.dividedBy=d.div=function(V,ae){return e(this,new Q(V,ae),l,m)},d.dividedToIntegerBy=d.idiv=function(V,ae){return e(this,new Q(V,ae),0,1)},d.exponentiatedBy=d.pow=function(V,ae){var ne,M,v,S,y,w,P,L,N,E=this;if(V=new Q(V),V.c&&!V.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Ee(V));if(ae!=null&&(ae=new Q(ae)),w=V.e>14,!E.c||!E.c[0]||E.c[0]==1&&!E.e&&E.c.length==1||!V.c||!V.c[0])return N=new Q(Math.pow(+Ee(E),w?V.s*(2-isOdd(V)):+Ee(V))),ae?N.mod(ae):N;if(P=V.s<0,ae){if(ae.c?!ae.c[0]:!ae.s)return new Q(NaN);M=!P&&E.isInteger()&&ae.isInteger(),M&&(E=E.mod(ae))}else{if(V.e>9&&(E.e>0||E.e<-1||(E.e==0?E.c[0]>1||w&&E.c[1]>=24e7:E.c[0]<8e13||w&&E.c[0]<=9999975e7)))return S=E.s<0&&isOdd(V)?-0:0,E.e>-1&&(S=1/S),new Q(P?1/S:S);U&&(S=mathceil(U/LOG_BASE+2))}for(w?(ne=new Q(.5),P&&(V.s=1),L=isOdd(V)):(v=Math.abs(+Ee(V)),L=v%2),N=new Q(c);;){if(L){if(N=N.times(E),!N.c)break;S?N.c.length>S&&(N.c.length=S):M&&(N=N.mod(ae))}if(v){if(v=mathfloor(v/2),v===0)break;L=v%2}else if(V=V.times(ne),me(V,V.e+1,1),V.e>14)L=isOdd(V);else{if(v=+Ee(V),v===0)break;L=v%2}E=E.times(E),S?E.c&&E.c.length>S&&(E.c.length=S):M&&(E=E.mod(ae))}return M?N:(P&&(N=c.div(N)),ae?N.mod(ae):S?me(N,U,m,y):N)},d.integerValue=function(V){var ae=new Q(this);return V==null?V=m:intCheck(V,0,8),me(ae,ae.e+1,V)},d.isEqualTo=d.eq=function(V,ae){return compare$1(this,new Q(V,ae))===0},d.isFinite=function(){return!!this.c},d.isGreaterThan=d.gt=function(V,ae){return compare$1(this,new Q(V,ae))>0},d.isGreaterThanOrEqualTo=d.gte=function(V,ae){return(ae=compare$1(this,new Q(V,ae)))===1||ae===0},d.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},d.isLessThan=d.lt=function(V,ae){return compare$1(this,new Q(V,ae))<0},d.isLessThanOrEqualTo=d.lte=function(V,ae){return(ae=compare$1(this,new Q(V,ae)))===-1||ae===0},d.isNaN=function(){return!this.s},d.isNegative=function(){return this.s<0},d.isPositive=function(){return this.s>0},d.isZero=function(){return!!this.c&&this.c[0]==0},d.minus=function(V,ae){var ne,M,v,S,y=this,w=y.s;if(V=new Q(V,ae),ae=V.s,!w||!ae)return new Q(NaN);if(w!=ae)return V.s=-ae,y.plus(V);var P=y.e/LOG_BASE,L=V.e/LOG_BASE,N=y.c,E=V.c;if(!P||!L){if(!N||!E)return N?(V.s=-ae,V):new Q(E?y:NaN);if(!N[0]||!E[0])return E[0]?(V.s=-ae,V):new Q(N[0]?y:m==3?-0:0)}if(P=bitFloor(P),L=bitFloor(L),N=N.slice(),w=P-L){for((S=w<0)?(w=-w,v=N):(L=P,v=E),v.reverse(),ae=w;ae--;v.push(0));v.reverse()}else for(M=(S=(w=N.length)<(ae=E.length))?w:ae,w=ae=0;ae<M;ae++)if(N[ae]!=E[ae]){S=N[ae]<E[ae];break}if(S&&(v=N,N=E,E=v,V.s=-V.s),ae=(M=E.length)-(ne=N.length),ae>0)for(;ae--;N[ne++]=0);for(ae=BASE-1;M>w;){if(N[--M]<E[M]){for(ne=M;ne&&!N[--ne];N[ne]=ae);--N[ne],N[M]+=BASE}N[M]-=E[M]}for(;N[0]==0;N.splice(0,1),--L);return N[0]?pe(V,N,L):(V.s=m==3?-1:1,V.c=[V.e=0],V)},d.modulo=d.mod=function(V,ae){var ne,M,v=this;return V=new Q(V,ae),!v.c||!V.s||V.c&&!V.c[0]?new Q(NaN):!V.c||v.c&&!v.c[0]?new Q(v):(F==9?(M=V.s,V.s=1,ne=e(v,V,0,3),V.s=M,ne.s*=M):ne=e(v,V,0,F),V=v.minus(ne.times(V)),!V.c[0]&&F==1&&(V.s=v.s),V)},d.multipliedBy=d.times=function(V,ae){var ne,M,v,S,y,w,P,L,N,E,A,D,H,Y,le,_e=this,he=_e.c,fe=(V=new Q(V,ae)).c;if(!he||!fe||!he[0]||!fe[0])return!_e.s||!V.s||he&&!he[0]&&!fe||fe&&!fe[0]&&!he?V.c=V.e=V.s=null:(V.s*=_e.s,!he||!fe?V.c=V.e=null:(V.c=[0],V.e=0)),V;for(M=bitFloor(_e.e/LOG_BASE)+bitFloor(V.e/LOG_BASE),V.s*=_e.s,P=he.length,E=fe.length,P<E&&(H=he,he=fe,fe=H,v=P,P=E,E=v),v=P+E,H=[];v--;H.push(0));for(Y=BASE,le=SQRT_BASE,v=E;--v>=0;){for(ne=0,A=fe[v]%le,D=fe[v]/le|0,y=P,S=v+y;S>v;)L=he[--y]%le,N=he[y]/le|0,w=D*L+N*A,L=A*L+w%le*le+H[S]+ne,ne=(L/Y|0)+(w/le|0)+D*N,H[S--]=L%Y;H[S]=ne}return ne?++M:H.splice(0,1),pe(V,H,M)},d.negated=function(){var V=new Q(this);return V.s=-V.s||null,V},d.plus=function(V,ae){var ne,M=this,v=M.s;if(V=new Q(V,ae),ae=V.s,!v||!ae)return new Q(NaN);if(v!=ae)return V.s=-ae,M.minus(V);var S=M.e/LOG_BASE,y=V.e/LOG_BASE,w=M.c,P=V.c;if(!S||!y){if(!w||!P)return new Q(v/0);if(!w[0]||!P[0])return P[0]?V:new Q(w[0]?M:v*0)}if(S=bitFloor(S),y=bitFloor(y),w=w.slice(),v=S-y){for(v>0?(y=S,ne=P):(v=-v,ne=w),ne.reverse();v--;ne.push(0));ne.reverse()}for(v=w.length,ae=P.length,v-ae<0&&(ne=P,P=w,w=ne,ae=v),v=0;ae;)v=(w[--ae]=w[ae]+P[ae]+v)/BASE|0,w[ae]=BASE===w[ae]?0:w[ae]%BASE;return v&&(w=[v].concat(w),++y),pe(V,w,y)},d.precision=d.sd=function(V,ae){var ne,M,v,S=this;if(V!=null&&V!==!!V)return intCheck(V,1,MAX),ae==null?ae=m:intCheck(ae,0,8),me(new Q(S),V,ae);if(!(ne=S.c))return null;if(v=ne.length-1,M=v*LOG_BASE+1,v=ne[v]){for(;v%10==0;v/=10,M--);for(v=ne[0];v>=10;v/=10,M++);}return V&&S.e+1>M&&(M=S.e+1),M},d.shiftedBy=function(V){return intCheck(V,-MAX_SAFE_INTEGER$1,MAX_SAFE_INTEGER$1),this.times("1e"+V)},d.squareRoot=d.sqrt=function(){var V,ae,ne,M,v,S=this,y=S.c,w=S.s,P=S.e,L=l+4,N=new Q("0.5");if(w!==1||!y||!y[0])return new Q(!w||w<0&&(!y||y[0])?NaN:y?S:1/0);if(w=Math.sqrt(+Ee(S)),w==0||w==1/0?(ae=coeffToString(y),(ae.length+P)%2==0&&(ae+="0"),w=Math.sqrt(+ae),P=bitFloor((P+1)/2)-(P<0||P%2),w==1/0?ae="5e"+P:(ae=w.toExponential(),ae=ae.slice(0,ae.indexOf("e")+1)+P),ne=new Q(ae)):ne=new Q(w+""),ne.c[0]){for(P=ne.e,w=P+L,w<3&&(w=0);;)if(v=ne,ne=N.times(v.plus(e(S,v,L,1))),coeffToString(v.c).slice(0,w)===(ae=coeffToString(ne.c)).slice(0,w))if(ne.e<P&&--w,ae=ae.slice(w-3,w+1),ae=="9999"||!M&&ae=="4999"){if(!M&&(me(v,v.e+l+2,0),v.times(v).eq(S))){ne=v;break}L+=4,w+=4,M=1}else{(!+ae||!+ae.slice(1)&&ae.charAt(0)=="5")&&(me(ne,ne.e+l+2,1),V=!ne.times(ne).eq(S));break}}return me(ne,ne.e+l+1,m,V)},d.toExponential=function(V,ae){return V!=null&&(intCheck(V,0,MAX),V++),te(this,V,ae,1)},d.toFixed=function(V,ae){return V!=null&&(intCheck(V,0,MAX),V=V+this.e+1),te(this,V,ae)},d.toFormat=function(V,ae,ne){var M,v=this;if(ne==null)V!=null&&ae&&typeof ae=="object"?(ne=ae,ae=null):V&&typeof V=="object"?(ne=V,V=ae=null):ne=Z;else if(typeof ne!="object")throw Error(bignumberError+"Argument not an object: "+ne);if(M=v.toFixed(V,ae),v.c){var S,y=M.split("."),w=+ne.groupSize,P=+ne.secondaryGroupSize,L=ne.groupSeparator||"",N=y[0],E=y[1],A=v.s<0,D=A?N.slice(1):N,H=D.length;if(P&&(S=w,w=P,P=S,H-=S),w>0&&H>0){for(S=H%w||w,N=D.substr(0,S);S<H;S+=w)N+=L+D.substr(S,w);P>0&&(N+=L+D.slice(S)),A&&(N="-"+N)}M=E?N+(ne.decimalSeparator||"")+((P=+ne.fractionGroupSize)?E.replace(new RegExp("\\d{"+P+"}\\B","g"),"$&"+(ne.fractionGroupSeparator||"")):E):N}return(ne.prefix||"")+M+(ne.suffix||"")},d.toFraction=function(V){var ae,ne,M,v,S,y,w,P,L,N,E,A,D=this,H=D.c;if(V!=null&&(w=new Q(V),!w.isInteger()&&(w.c||w.s!==1)||w.lt(c)))throw Error(bignumberError+"Argument "+(w.isInteger()?"out of range: ":"not an integer: ")+Ee(w));if(!H)return new Q(D);for(ae=new Q(c),L=ne=new Q(c),M=P=new Q(c),A=coeffToString(H),S=ae.e=A.length-D.e-1,ae.c[0]=POWS_TEN[(y=S%LOG_BASE)<0?LOG_BASE+y:y],V=!V||w.comparedTo(ae)>0?S>0?ae:L:w,y=C,C=1/0,w=new Q(A),P.c[0]=0;N=e(w,ae,0,1),v=ne.plus(N.times(M)),v.comparedTo(V)!=1;)ne=M,M=v,L=P.plus(N.times(v=L)),P=v,ae=w.minus(N.times(v=ae)),w=v;return v=e(V.minus(ne),M,0,1),P=P.plus(v.times(L)),ne=ne.plus(v.times(M)),P.s=L.s=D.s,S=S*2,E=e(L,M,S,m).minus(D).abs().comparedTo(e(P,ne,S,m).minus(D).abs())<1?[L,M]:[P,ne],C=y,E},d.toNumber=function(){return+Ee(this)},d.toPrecision=function(V,ae){return V!=null&&intCheck(V,1,MAX),te(this,V,ae,2)},d.toString=function(V){var ae,ne=this,M=ne.s,v=ne.e;return v===null?M?(ae="Infinity",M<0&&(ae="-"+ae)):ae="NaN":(V==null?ae=v<=I||v>=O?toExponential(coeffToString(ne.c),v):toFixedPoint(coeffToString(ne.c),v,"0"):V===10&&X?(ne=me(new Q(ne),l+v+1,m),ae=toFixedPoint(coeffToString(ne.c),ne.e,"0")):(intCheck(V,2,J.length,"Base"),ae=a(toFixedPoint(coeffToString(ne.c),v,"0"),10,V,M,!0)),M<0&&ne.c[0]&&(ae="-"+ae)),ae},d.valueOf=d.toJSON=function(){return Ee(this)},d._isBigNumber=!0,d[Symbol.toStringTag]="BigNumber",d[Symbol.for("nodejs.util.inspect.custom")]=d.valueOf,t!=null&&Q.set(t),Q}function bitFloor(t){var e=t|0;return t>0||t===e?e:e-1}function coeffToString(t){for(var e,a,u=1,d=t.length,c=t[0]+"";u<d;){for(e=t[u++]+"",a=LOG_BASE-e.length;a--;e="0"+e);c+=e}for(d=c.length;c.charCodeAt(--d)===48;);return c.slice(0,d+1||1)}function compare$1(t,e){var a,u,d=t.c,c=e.c,l=t.s,m=e.s,I=t.e,O=e.e;if(!l||!m)return null;if(a=d&&!d[0],u=c&&!c[0],a||u)return a?u?0:-m:l;if(l!=m)return l;if(a=l<0,u=I==O,!d||!c)return u?0:!d^a?1:-1;if(!u)return I>O^a?1:-1;for(m=(I=d.length)<(O=c.length)?I:O,l=0;l<m;l++)if(d[l]!=c[l])return d[l]>c[l]^a?1:-1;return I==O?0:I>O^a?1:-1}function intCheck(t,e,a,u){if(t<e||t>a||t!==mathfloor(t))throw Error(bignumberError+(u||"Argument")+(typeof t=="number"?t<e||t>a?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function isOdd(t){var e=t.c.length-1;return bitFloor(t.e/LOG_BASE)==e&&t.c[e]%2!=0}function toExponential(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function toFixedPoint(t,e,a){var u,d;if(e<0){for(d=a+".";++e;d+=a);t=d+t}else if(u=t.length,++e>u){for(d=a,e-=u;--e;d+=a);t+=d}else e<u&&(t=t.slice(0,e)+"."+t.slice(e));return t}var BigNumber=clone(),browser$g=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};const WebSocket$1=getDefaultExportFromCjs$1(browser$g),BASE58_ALPHABET="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",numberToHex=(t,e)=>{const a="1"+"0".repeat(e),u=new BigNumber(t.toString(10),10);return toHex$2(u.times(a).toString(16))},hexToNumber=(t,e)=>{const a="1"+"0".repeat(e),u=new BigNumber(t.toString(),10);return parseFloat(u.dividedBy(a).toString())},base58Encode=t=>{typeof t=="string"&&(t=new Uint8Array(Buffer$N.from(t)));const e=[];let a=BigInt("0x"+Buffer$N.from(t).toString("hex"));for(;a>BigInt(0);){const u=Number(a%BigInt(58));e.unshift(BASE58_ALPHABET[u]),a=a/BigInt(58)}for(let u=0;u<t.length&&t[u]===0;u++)e.unshift(BASE58_ALPHABET[0]);return e.join("")},base58Decode=t=>{let e=BigInt(0);for(let d=0;d<t.length;d++)e=e*BigInt(58)+BigInt(BASE58_ALPHABET.indexOf(t[d]));const a=e.toString(16),u=a.length%2===0?a:"0"+a;return new Uint8Array(Buffer$N.from(u,"hex"))},bufferToString=t=>Buffer$N.from(t).toString("utf8"),stringToBuffer=t=>Buffer$N.from(t,"utf8"),isNumeric=t=>!isNaN(Number(t)),sleep=async t=>{await new Promise(e=>setTimeout(e,t))},objectsEqual=(t,e)=>JSON.stringify(t)===JSON.stringify(e),toReadableString=t=>{const[e,a]=t.toExponential().split("e").map(d=>parseFloat(d));let u=(e*Math.pow(10,a)).toString();return u=parseFloat(u).toString(),u},checkWebSocket=async t=>await new Promise((e,a)=>{let u;typeof window<"u"?u=new WebSocket(t):u=new browser$g.WebSocket(t),u.onopen=()=>{e(!0),u.close()},u.onerror=d=>{a(new Error(d.message)),u.close()}}),math$4={add:(t,e,a=18)=>parseFloat(new BigNumber(t).plus(new BigNumber(e)).toFixed(a)),sub:(t,e,a=18)=>parseFloat(new BigNumber(t).minus(new BigNumber(e)).toFixed(a)),mul:(t,e,a=18)=>parseFloat(new BigNumber(t).times(new BigNumber(e)).toFixed(a)),div:(t,e,a=18)=>parseFloat(new BigNumber(t).div(new BigNumber(e)).toFixed(a)),pow:(t,e,a=18)=>parseFloat(new BigNumber(t).pow(e).toFixed(a)),sqrt:(t,e=18)=>parseFloat(new BigNumber(t).sqrt().toFixed(e)),abs:(t,e=18)=>parseFloat(new BigNumber(t).absoluteValue().toFixed(e)),ceil:(t,e=18)=>parseFloat(new BigNumber(t).integerValue(BigNumber.ROUND_CEIL).toFixed(e)),floor:(t,e=18)=>parseFloat(new BigNumber(t).integerValue(BigNumber.ROUND_FLOOR).toFixed(e)),round:(t,e=18)=>parseFloat(new BigNumber(t).integerValue(BigNumber.ROUND_HALF_UP).toFixed(e))},isMobile=()=>typeof window>"u"?!1:function(t){return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(t.substr(0,4)))}(navigator.userAgent||navigator.vendor||window.opera),isWebview=()=>{if(typeof window>"u")return!1;const t=window.navigator;if(window.WebViewJavascriptBridge||window.webkit&&window.webkit.messageHandlers||t.userAgent.match(/WebView/i))return!0;const e=t.standalone,a=t.userAgent.toLowerCase(),u=/safari/.test(a);return/iphone|ipod|ipad/.test(a)?!e&&!u:a.includes("wv")},ar=class ar{constructor(e){Tt(this,"network");Tt(this,"api");Tt(this,"explorer");Tt(this,"wsUrl");Tt(this,"blockCypherToken");Tt(this,"defaultBlockCypherToken","49d43a59a4f24d31a9731eb067ab971c");this.update(e)}static get instance(){if(ar._instance===void 0)throw new Error(ErrorTypeEnum.PROVIDER_IS_NOT_INITIALIZED);return ar._instance}static initialize(e){if(ar._instance!==void 0)throw new Error(ErrorTypeEnum.PROVIDER_IS_ALREADY_INITIALIZED);ar._instance=new ar(e)}async checkRpcConnection(e){try{const a=await axios.get(e??this.createEndpoint("blocks/tip/height"));return a.status!==200?new Error(a.statusText+": "+JSON.stringify(a.data)):!0}catch(a){return a}}async checkWsConnection(e){try{const a=await checkWebSocket(e??this.wsUrl);return a instanceof Error?a:!0}catch(a){return a}}update(e){if(this.network=e,ar._instance=this,this.blockCypherToken=this.network.blockCypherToken,this.network.testnet){this.api="https://blockstream.info/testnet/api/",this.explorer="https://blockstream.info/testnet/";const a=this.network.blockCypherToken??this.defaultBlockCypherToken;this.wsUrl="wss://socket.blockcypher.com/v1/btc/test3?token="+a}else this.api="https://blockstream.info/api/",this.explorer="https://blockstream.info/",this.network.blockCypherToken!==void 0?this.wsUrl="wss://socket.blockcypher.com/v1/btc/main?token="+this.network.blockCypherToken:this.wsUrl="wss://ws.blockchain.info/inv"}createEndpoint(e){return this.api+e}isTestnet(){var e;return((e=this.network)==null?void 0:e.testnet)??!1}};Tt(ar,"_instance");let Provider=ar;const rejectMap=(t,e)=>{if(console.error("MultipleChain Bitcoin Wallet Error:",t),typeof t=="object"){if(t.code===4001||String(t.message).includes("User rejected the request"))return e(ErrorTypeEnum.WALLET_REQUEST_REJECTED);if(String(t).includes("is not valid JSON"))return e(ErrorTypeEnum.UNACCEPTED_CHAIN)}return e(t)};class Wallet{constructor(e,a){Tt(this,"adapter");Tt(this,"walletProvider");Tt(this,"networkProvider");this.adapter=e,this.networkProvider=a??Provider.instance}getId(){return this.adapter.id}getName(){return this.adapter.name}getIcon(){return this.adapter.icon}getPlatforms(){return this.adapter.platforms}getDownloadLink(){return this.adapter.downloadLink}createDeepLink(e,a){return this.adapter.createDeepLink===void 0?null:this.adapter.createDeepLink(e,a)}async connect(e){return await new Promise((a,u)=>{this.adapter.connect(this.networkProvider,e).then(async d=>{this.walletProvider=d,a(await this.getAddress())}).catch(d=>{rejectMap(d,l=>{l.message===ErrorTypeEnum.WALLET_REQUEST_REJECTED?u(new Error(ErrorTypeEnum.WALLET_CONNECT_REJECTED)):u(l)})})})}async isDetected(){return await this.adapter.isDetected()}async isConnected(){return await this.adapter.isConnected()}async getAddress(){return await this.walletProvider.getAddress()}async signMessage(e){return await new Promise((a,u)=>{this.walletProvider.signMessage(e).then(d=>{a(d)}).catch(d=>{rejectMap(d,u)})})}async sendTransaction(e){const a=e.getRawData();return await new Promise((u,d)=>{this.walletProvider.sendBitcoin(a.receiver,a.amount).then(c=>{u(c)}).catch(c=>{rejectMap(c,d)})})}on(e,a){this.walletProvider.on(e,a)}}const icons={UniSat:"data:image/png;base64,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",Xverse:"data:image/png;base64,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",Leather:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAIFQTFRFEhAPLywrWVZUdnNwoJ2arqunysfD2dXRvLm1kY6LS0hH5+Pf9fHtZ2ViIB4dg4F+LiwrkY+MdXJwkY+Lg4B+Z2RiZ2VjoJ2ZoJyZdXNxWVdVPTo5Ly0rkY6MhIB+ko6LdnJxWVZVrqqon5yadnJwdXJxZ2Rjko6MrquooJyadnNxIbUX4gAAClxJREFUeJzt3X9D4rgWh3EQpLV1KndHZ3aWi7Pu7nUd3/8LvII6o9B+cxLSHybP529B6CEnJ2mSzmYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADA1M3PFsvzVbFXnl8sqrE/UM6qRVlfHikX87E/WJaqi5ZgvFh9GvvT5aa56o7GXnFFMxlOVepoPIeEVjIQUzj2nQmNZADrc2M4do3kbOxPmz5X33HgauzPm7iq8AoHEenZf3zDQUT6tF4FxOPy8rexP3eqKr/e4xcmU3pxFRiOp1qrGfuzpyik+3j1eewPn57GOhZsR9KKrAnrzn8qx/4CiVl7jz5oIn06PR40kWdL4dr8LqfmK5rIqxt1hb6Y3yZGPC7t8U+YqowK87t8jRGPy7rH7/lRrNUFMjeQ8PHge+Ss2e/i8qysb/ItUjyY0ZrNVG30h/E9NrHiQZ0lu3RrDxKh4H1FJ6LutFp7kCgF1ov/9vptp68R18baQGJ16HvWLJkqlbGWtreoTBe63t7Mm9m82jrS202/33fyVMayrc4xdSDll183O27lX+Y+NBS394wFjyqbX9TvO6ONuqdobJapUunG1qXLiZdn3w9vBf5JQLpsxaUxZSx3wqrvjl8lmshfsb/ixyIKVtso3Zmwira4it9B3iNDVfSacsedKx5l68oFkefyDojqQkwDAlfC+r39ZSIgefch1+Jabgyvdw0JO+JBQLqIWyGWSaW1Y01cVzzUDyHvcYjIOJZc7ujRV50r38QPIev5d9WnG8pPeWuro756JlpW1neoVJ9uSB16VZyIx5l4WdbrSdWFcacOR8nbMh58dWLXlS5VZLlnXXXJe9v9QpXq8h6GqIkTZ0D0JJa6l6Jqgaz79NnfpwRENpBaTITJVGcZ/aRL9cqugOgG8o94pYqkfR1YklRAXLlDlliqJ5Cj+7zH6fKiXuiX6vu2ImGpyi7zUYhOHo7fqhykqwpLdj2ZZyy5fEdfGzlIFy9tdK1sX9qdJtkPyCGzbCDisjq2vOV+6Im8PCqdhzYQxxL5zLt0PQ6Rk1mBW0pcWxZybyA6IOqeuuoJukteVzyybyByLkvlLFnzdr3MvWU6+wbiGG13j0RCtpS4T0ARxXIu9LaOuqvOCtlztXGu3+JkDX3H8LK7Ww/YUvLNfSJN7mOQPf2z7ZqyVZ1B62VtDCeg0KPvyDKrq2BSGas1hu50JW/45uR/jsvUOuWrbmu1/c4N6YqE9cKxbuSybrtfpH7vx3+/Nh0QRIX1wpVMWjKJKs2Oat7Gtt0t91neX/TQsDUiKmMdJp4z2/ZcOpCf3PsDjy6Wusbv/9Z8tHXeN9Lfc1+z+v3Z7CpjvavKzOGQN+Cz46qzdr7OjS94k7Hs4aBDf6ex1KRvH2CgLvRr4JqFx1ECxOM9Z7f+EpKXi21YdVgtfU7uJR4HTE1k53wfEzWP9TSMbG68okE8WtiayN7q/FquHFp6H0JDPI6Zm0gPiEeb+9HiQb3b7rTjqIO1nSiAHdfezX4UjM87jZG0eBKY8u/g8fg+9leetiinUnuo78f+xlMX8RhLA9KV25ARYfRhIY95i4nqysiyNiSCW9bDWQ2Rteg9fPQekZrFPn6ah17DQbbyp8/UPcmSbBXirqe0VWa+4Tnc+gfhmJj72I2EcJxoHXOusd7Sd5wuWt5aUVlF4rHQrVO9JFdFdGpIykcaR2QnJC6i0Y91SMVVL2+IRn+qHz4xKZaPFFW9s8WkWF7f0TKGslH7plbXN3e0i4EZt4VgKJZtIRiOOoTD/ARjxKPOEnWcX4o+qAOZmB8Zgah7836ewUjUXujMHzw4DoreiaHonRaK3omh6J0Yit6JoeidForeiaHonRiK3mlRRS+HJY5AFb0cfzwCit4+NZub62VZvBaydVGWF4tK7sNUKxyG+thpmi86D7Sqy+uuHztPru1HdeFay1Off2qrmdQZchS9gTZXxl3o5aej16qily3nQbyWTRdfD5qJ+ttxvs8H57+K/evb7kSdfU3R68/2cIJDbzahqaL3jxG/2AdlezhBW0heE5cqBVjK62lzyjFYz30JRW9EpkfbCJ/nzoOT4cHwJC6H4hNFbzTN+cnxeKLiQdHrY4BTFCl6PQxxqiVFr4co+cohrOhtqk4J330MHn54CCx6Rdl2E/ciTIh+CnQkgUVvjgEZ5iz3wKJXPK4k2YAMcrxoaNGbYUC+DRGP4KI3v4AMdEZ1aNErHlCdaEDUfHlEoTO9YuyfZkBcD4COJHimN7uADNRArkM/n6gAk1zkZSt5i3K5vX6yfSgDS+TQi6fWpSYZEPeY8PA4q6aSDydsFzzTq27RJzmd75pULL+09cbre8+YBM/0qh9MineEHV163f3kQL/z/IJXyKljnkLfc8p0xlrJ+VSfkARPzIoWnOQNL5l5Hlw5wT6m/Bz4+VSfnuSaCVUzFYYc/ae16LoK+3y57TVR2zNtaca8sC4sImqUFDy0mbAYP0DrI0SCIqIaYIq3hNWz0c39cGXsSQL6EVlzpDgMEVOpHmeSWPt2XbS1UfkwySMIxBf22eFvfRZV4RkR2cUlWWSJgPjUMPby1+/GuoxzkqfYiAvpERCfW1yH23sUPWpNcmpRXEl7H1J5TQAXx5vgOjQ6zinOZMnlDdafsveaLmsj0Yu/k+xC5FyvrUrdBOy4qk1DEkeg09zbIFeQGpJ0E7iFwZC3vjjeIsVRiByHGIrUxrp5OiAkrkSY5FSvPtnK9STz6uK0BY9F67EDz9wtL8WJrJmey9q56rpmzSLCU9ne76d+wzAZk+jKd+caoOLz8TdvqqsY0Xh+/+OYmGKdZo0107OpL1YXZ6+pq5mfLZar2Euzy6d/8DKoaDaLc9PbJ3toiuzV3yqKotclp/XuH5hDnWiXPhtoZ0h8yTaQWTPI1pDY0m0gjlUOU5VuA9ErA6cq5QbiXro4QSk3kNnsvpdrVsd85v2BFJf/vNVHNVtv+tuY5Xsf+MPpoRep9yNJ8yI6P2knrJ3ohdbrpGTY6XQOt+NerCHE3qb+JqfEbyRZPDHpLuolK9/e7PbbtOCWfAfyLGZJdJhS7mN27pnEI2I3Uhzf4YjYSOpc4hHtuKz2HSWxGom+g5kWxxoom/qu692j5MRs8tVehDbyXSxdizBM9F+q/cGd+CsuHauGTs1b34e5ClNi3XkTEo7ZiZ17ZzZMWnBeMYRj//7BIXFuP01VUCMxhmMnZOHpU++R5EJ3G+8fcb31u1r+D8Mo0p9NlLxCUj765xK/mJdnPXzHD2b9w9aXFLeBA7W1teLybX7pqlwxqcvHk4YFm60zJk/RyLUrb7V57Doaq364jXGp1vcPnUEplo8ZTZPYravHbbn6edmK1cP28S7mgLl5+gcP5a8Vi8XupLSbDS3DaT7v+SI189xmRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBM/B8SalT5oO6znAAAAABJRU5ErkJggg=="},UniSat={id:"unisat",name:"UniSat",icon:icons.UniSat,provider:window.unisat,platforms:[WalletPlatformEnum.BROWSER],downloadLink:"https://unisat.io/download",isDetected:()=>{var t;return!!((t=window.unisat)!=null&&t.requestAccounts)},isConnected:async()=>{var t;return((t=window==null?void 0:window.unisat)==null?void 0:t._isConnected)??!1},connect:async t=>await new Promise((e,a)=>{const u=t!==void 0&&(t!=null&&t.isTestnet())?"testnet":"livenet",d={on:window.unisat.on,signMessage:window.unisat.signMessage,sendBitcoin:window.unisat.sendBitcoin,getAddress:async()=>(await window.unisat.getAccounts())[0]};try{window.unisat.requestAccounts().then(()=>{window.unisat.switchNetwork(u).then(()=>{e(d)}).catch(a)}).catch(a)}catch(c){a(c)}})};var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,freeGlobal=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function apply(t,e,a){switch(a.length){case 0:return t.call(e);case 1:return t.call(e,a[0]);case 2:return t.call(e,a[0],a[1]);case 3:return t.call(e,a[0],a[1],a[2])}return t.apply(e,a)}function arrayIncludes(t,e){var a=t?t.length:0;return!!a&&baseIndexOf(t,e,0)>-1}function arrayIncludesWith(t,e,a){for(var u=-1,d=t?t.length:0;++u<d;)if(a(e,t[u]))return!0;return!1}function arrayMap(t,e){for(var a=-1,u=t?t.length:0,d=Array(u);++a<u;)d[a]=e(t[a],a,t);return d}function arrayPush(t,e){for(var a=-1,u=e.length,d=t.length;++a<u;)t[d+a]=e[a];return t}function baseFindIndex(t,e,a,u){for(var d=t.length,c=a+(u?1:-1);u?c--:++c<d;)if(e(t[c],c,t))return c;return-1}function baseIndexOf(t,e,a){if(e!==e)return baseFindIndex(t,baseIsNaN,a);for(var u=a-1,d=t.length;++u<d;)if(t[u]===e)return u;return-1}function baseIsNaN(t){return t!==t}function baseTimes(t,e){for(var a=-1,u=Array(t);++a<t;)u[a]=e(a);return u}function baseUnary(t){return function(e){return t(e)}}function cacheHas(t,e){return t.has(e)}function getValue(t,e){return t==null?void 0:t[e]}function isHostObject(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function overArg(t,e){return function(a){return t(e(a))}}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),funcToString=funcProto.toString,hasOwnProperty$2=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol$1=root.Symbol,getPrototype=overArg(Object.getPrototypeOf,Object),propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0,nativeGetSymbols=Object.getOwnPropertySymbols,nativeMax=Math.max,Map$1=getNative(root,"Map"),nativeCreate=getNative(Object,"create");function Hash$b(t){var e=-1,a=t?t.length:0;for(this.clear();++e<a;){var u=t[e];this.set(u[0],u[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(t){return this.has(t)&&delete this.__data__[t]}function hashGet(t){var e=this.__data__;if(nativeCreate){var a=e[t];return a===HASH_UNDEFINED?void 0:a}return hasOwnProperty$2.call(e,t)?e[t]:void 0}function hashHas(t){var e=this.__data__;return nativeCreate?e[t]!==void 0:hasOwnProperty$2.call(e,t)}function hashSet(t,e){var a=this.__data__;return a[t]=nativeCreate&&e===void 0?HASH_UNDEFINED:e,this}Hash$b.prototype.clear=hashClear,Hash$b.prototype.delete=hashDelete,Hash$b.prototype.get=hashGet,Hash$b.prototype.has=hashHas,Hash$b.prototype.set=hashSet;function ListCache(t){var e=-1,a=t?t.length:0;for(this.clear();++e<a;){var u=t[e];this.set(u[0],u[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(t){var e=this.__data__,a=assocIndexOf(e,t);if(a<0)return!1;var u=e.length-1;return a==u?e.pop():splice.call(e,a,1),!0}function listCacheGet(t){var e=this.__data__,a=assocIndexOf(e,t);return a<0?void 0:e[a][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,e){var a=this.__data__,u=assocIndexOf(a,t);return u<0?a.push([t,e]):a[u][1]=e,this}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;function MapCache(t){var e=-1,a=t?t.length:0;for(this.clear();++e<a;){var u=t[e];this.set(u[0],u[1])}}function mapCacheClear(){this.__data__={hash:new Hash$b,map:new(Map$1||ListCache),string:new Hash$b}}function mapCacheDelete(t){return getMapData(this,t).delete(t)}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,e){return getMapData(this,t).set(t,e),this}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;function SetCache(t){var e=-1,a=t?t.length:0;for(this.__data__=new MapCache;++e<a;)this.add(t[e])}function setCacheAdd(t){return this.__data__.set(t,HASH_UNDEFINED),this}function setCacheHas(t){return this.__data__.has(t)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;function arrayLikeKeys(t,e){var a=isArray$2(t)||isArguments$2(t)?baseTimes(t.length,String):[],u=a.length,d=!!u;for(var c in t)(e||hasOwnProperty$2.call(t,c))&&!(d&&(c=="length"||isIndex(c,u)))&&a.push(c);return a}function assocIndexOf(t,e){for(var a=t.length;a--;)if(eq(t[a][0],e))return a;return-1}function baseDifference(t,e,a,u){var d=-1,c=arrayIncludes,l=!0,m=t.length,I=[],O=e.length;if(!m)return I;a&&(e=arrayMap(e,baseUnary(a))),u?(c=arrayIncludesWith,l=!1):e.length>=LARGE_ARRAY_SIZE&&(c=cacheHas,l=!1,e=new SetCache(e));e:for(;++d<m;){var T=t[d],C=a?a(T):T;if(T=u||T!==0?T:0,l&&C===C){for(var j=O;j--;)if(e[j]===C)continue e;I.push(T)}else c(e,C,u)||I.push(T)}return I}function baseFlatten(t,e,a,u,d){var c=-1,l=t.length;for(a||(a=isFlattenable),d||(d=[]);++c<l;){var m=t[c];e>0&&a(m)?e>1?baseFlatten(m,e-1,a,u,d):arrayPush(d,m):u||(d[d.length]=m)}return d}function baseGetAllKeys(t,e,a){var u=e(t);return isArray$2(t)?u:arrayPush(u,a(t))}function baseIsNative(t){if(!isObject(t)||isMasked(t))return!1;var e=isFunction(t)||isHostObject(t)?reIsNative:reIsHostCtor;return e.test(toSource(t))}function baseKeysIn(t){if(!isObject(t))return nativeKeysIn(t);var e=isPrototype(t),a=[];for(var u in t)u=="constructor"&&(e||!hasOwnProperty$2.call(t,u))||a.push(u);return a}function basePick(t,e){return t=Object(t),basePickBy(t,e,function(a,u){return u in t})}function basePickBy(t,e,a){for(var u=-1,d=e.length,c={};++u<d;){var l=e[u],m=t[l];a(m,l)&&(c[l]=m)}return c}function baseRest(t,e){return e=nativeMax(e===void 0?t.length-1:e,0),function(){for(var a=arguments,u=-1,d=nativeMax(a.length-e,0),c=Array(d);++u<d;)c[u]=a[e+u];u=-1;for(var l=Array(e+1);++u<e;)l[u]=a[u];return l[e]=c,apply(t,this,l)}}function getAllKeysIn(t){return baseGetAllKeys(t,keysIn,getSymbolsIn)}function getMapData(t,e){var a=t.__data__;return isKeyable(e)?a[typeof e=="string"?"string":"hash"]:a.map}function getNative(t,e){var a=getValue(t,e);return baseIsNative(a)?a:void 0}var getSymbols=nativeGetSymbols?overArg(nativeGetSymbols,Object):stubArray,getSymbolsIn=nativeGetSymbols?function(t){for(var e=[];t;)arrayPush(e,getSymbols(t)),t=getPrototype(t);return e}:stubArray;function isFlattenable(t){return isArray$2(t)||isArguments$2(t)||!!(spreadableSymbol&&t&&t[spreadableSymbol])}function isIndex(t,e){return e=e??MAX_SAFE_INTEGER,!!e&&(typeof t=="number"||reIsUint.test(t))&&t>-1&&t%1==0&&t<e}function isKeyable(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function isMasked(t){return!!maskSrcKey&&maskSrcKey in t}function isPrototype(t){var e=t&&t.constructor,a=typeof e=="function"&&e.prototype||objectProto;return t===a}function nativeKeysIn(t){var e=[];if(t!=null)for(var a in Object(t))e.push(a);return e}function toKey(t){if(typeof t=="string"||isSymbol(t))return t;var e=t+"";return e=="0"&&1/t==-INFINITY?"-0":e}function toSource(t){if(t!=null){try{return funcToString.call(t)}catch{}try{return t+""}catch{}}return""}function eq(t,e){return t===e||t!==t&&e!==e}function isArguments$2(t){return isArrayLikeObject(t)&&hasOwnProperty$2.call(t,"callee")&&(!propertyIsEnumerable.call(t,"callee")||objectToString.call(t)==argsTag)}var isArray$2=Array.isArray;function isArrayLike(t){return t!=null&&isLength(t.length)&&!isFunction(t)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function isFunction(t){var e=isObject(t)?objectToString.call(t):"";return e==funcTag||e==genTag}function isLength(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER}function isObject(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function isObjectLike(t){return!!t&&typeof t=="object"}function isSymbol(t){return typeof t=="symbol"||isObjectLike(t)&&objectToString.call(t)==symbolTag}function keysIn(t){return isArrayLike(t)?arrayLikeKeys(t,!0):baseKeysIn(t)}baseRest(function(t,e){return t==null?{}:(e=arrayMap(baseFlatten(e,1),toKey),basePick(t,baseDifference(getAllKeysIn(t),e)))});function stubArray(){return[]}/*! *****************************************************************************
14
+ Copyright (c) Microsoft Corporation.
15
+
16
+ Permission to use, copy, modify, and/or distribute this software for any
17
+ purpose with or without fee is hereby granted.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
+ PERFORMANCE OF THIS SOFTWARE.
26
+ ***************************************************************************** */var r$3="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";(()=>{const t=Array(256).fill(-1);for(let e=0;e<r$3.length;++e)t[r$3.charCodeAt(e)]=e})();var s$2,i$1,o,h=(s$2=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.bech32m=e.bech32=void 0;const a="qpzry9x8gf2tvdw0s3jn54khce6mua7l",u={};for(let C=0;C<32;C++){const j=a.charAt(C);u[j]=C}function d(C){const j=C>>25;return(33554431&C)<<5^996825010&-(j>>0&1)^642813549&-(j>>1&1)^513874426&-(j>>2&1)^1027748829&-(j>>3&1)^705979059&-(j>>4&1)}function c(C){let j=1;for(let F=0;F<C.length;++F){const U=C.charCodeAt(F);if(U<33||U>126)return"Invalid prefix ("+C+")";j=d(j)^U>>5}j=d(j);for(let F=0;F<C.length;++F){const U=C.charCodeAt(F);j=d(j)^31&U}return j}function l(C,j,F,U){let Z=0,J=0;const X=(1<<F)-1,Q=[];for(let te=0;te<C.length;++te)for(Z=Z<<j|C[te],J+=j;J>=F;)J-=F,Q.push(Z>>J&X);if(U)J>0&&Q.push(Z<<F-J&X);else{if(J>=j)return"Excess padding";if(Z<<F-J&X)return"Non-zero padding"}return Q}function m(C){return l(C,8,5,!0)}function I(C){const j=l(C,5,8,!1);if(Array.isArray(j))return j}function O(C){const j=l(C,5,8,!1);if(Array.isArray(j))return j;throw new Error(j)}function T(C){let j;function F(U,Z){if(Z=Z||90,U.length<8)return U+" too short";if(U.length>Z)return"Exceeds length limit";const J=U.toLowerCase(),X=U.toUpperCase();if(U!==J&&U!==X)return"Mixed-case string "+U;const Q=(U=J).lastIndexOf("1");if(Q===-1)return"No separator character for "+U;if(Q===0)return"Missing prefix for "+U;const te=U.slice(0,Q),se=U.slice(Q+1);if(se.length<6)return"Data too short";let pe=c(te);if(typeof pe=="string")return pe;const me=[];for(let Ee=0;Ee<se.length;++Ee){const V=se.charAt(Ee),ae=u[V];if(ae===void 0)return"Unknown character "+V;pe=d(pe)^ae,Ee+6>=se.length||me.push(ae)}return pe!==j?"Invalid checksum for "+U:{prefix:te,words:me}}return j=C==="bech32"?1:734539939,{decodeUnsafe:function(U,Z){const J=F(U,Z);if(typeof J=="object")return J},decode:function(U,Z){const J=F(U,Z);if(typeof J=="object")return J;throw new Error(J)},encode:function(U,Z,J){if(J=J||90,U.length+7+Z.length>J)throw new TypeError("Exceeds length limit");let X=c(U=U.toLowerCase());if(typeof X=="string")throw new Error(X);let Q=U+"1";for(let te=0;te<Z.length;++te){const se=Z[te];if(se>>5)throw new Error("Non 5-bit word");X=d(X)^se,Q+=a.charAt(se)}for(let te=0;te<6;++te)X=d(X);X^=j;for(let te=0;te<6;++te)Q+=a.charAt(X>>5*(5-te)&31);return Q},toWords:m,fromWordsUnsafe:I,fromWords:O}}e.bech32=T("bech32"),e.bech32m=T("bech32m")},s$2(i$1={exports:{}},i$1.exports),i$1.exports);(o=h)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")&&o.default,h.bech32m,h.bech32,new Uint8Array(new Uint16Array([65279]).buffer)[0];var x,k$1;(function(t){t.mainnet="mainnet",t.testnet="testnet",t.regtest="regtest"})(x||(x={})),function(t){t.p2pkh="p2pkh",t.p2sh="p2sh",t.p2wpkh="p2wpkh",t.p2wsh="p2wsh",t.p2tr="p2tr"}(k$1||(k$1={})),k$1.p2pkh,x.mainnet,k$1.p2pkh,x.testnet,k$1.p2sh,x.mainnet,k$1.p2sh,x.testnet;var lib$3={},signer={},base64Url={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.indexOf("=");a===-1&&(a=e);var u=a===e?0:4-a%4;return[a,u]}function byteLength(t){var e=getLens(t),a=e[0],u=e[1];return(a+u)*3/4-u}function _byteLength(t,e,a){return(e+a)*3/4-a}function toByteArray(t){var e,a=getLens(t),u=a[0],d=a[1],c=new Arr(_byteLength(t,u,d)),l=0,m=d>0?u-4:u,I;for(I=0;I<m;I+=4)e=revLookup[t.charCodeAt(I)]<<18|revLookup[t.charCodeAt(I+1)]<<12|revLookup[t.charCodeAt(I+2)]<<6|revLookup[t.charCodeAt(I+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=e&255;return d===2&&(e=revLookup[t.charCodeAt(I)]<<2|revLookup[t.charCodeAt(I+1)]>>4,c[l++]=e&255),d===1&&(e=revLookup[t.charCodeAt(I)]<<10|revLookup[t.charCodeAt(I+1)]<<4|revLookup[t.charCodeAt(I+2)]>>2,c[l++]=e>>8&255,c[l++]=e&255),c}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,e,a){for(var u,d=[],c=e;c<a;c+=3)u=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),d.push(tripletToBase64(u));return d.join("")}function fromByteArray(t){for(var e,a=t.length,u=a%3,d=[],c=16383,l=0,m=a-u;l<m;l+=c)d.push(encodeChunk(t,l,l+c>m?m:l+c));return u===1?(e=t[a-1],d.push(lookup[e>>2]+lookup[e<<4&63]+"==")):u===2&&(e=(t[a-2]<<8)+t[a-1],d.push(lookup[e>>10]+lookup[e>>4&63]+lookup[e<<2&63]+"=")),d.join("")}Object.defineProperty(base64Url,"__esModule",{value:!0}),base64Url.decode=base64Url.encode=base64Url.unescape=base64Url.escape=base64Url.pad=void 0;const base64_js_1$1=base64Js;function pad(t){return`${t}${"=".repeat(4-(t.length%4||4))}`}base64Url.pad=pad;function escape$1(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}base64Url.escape=escape$1;function unescape$1(t){return pad(t).replace(/-/g,"+").replace(/_/g,"/")}base64Url.unescape=unescape$1;function encode$3(t){return escape$1((0,base64_js_1$1.fromByteArray)(new TextEncoder().encode(t)))}base64Url.encode=encode$3;function decode$4(t){return new TextDecoder().decode((0,base64_js_1$1.toByteArray)(pad(unescape$1(t))))}base64Url.decode=decode$4;var cryptoClients={},secp256k1$3={},hmac$2={},_assert={};Object.defineProperty(_assert,"__esModule",{value:!0}),_assert.output=_assert.exists=_assert.hash=_assert.bytes=_assert.bool=_assert.number=void 0;function number(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}_assert.number=number;function bool(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}_assert.bool=bool;function isBytes(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function bytes(t,...e){if(!isBytes(t))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}_assert.bytes=bytes;function hash$9(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(t.outputLen),number(t.blockLen)}_assert.hash=hash$9;function exists(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}_assert.exists=exists;function output$1(t,e){bytes(t);const a=e.outputLen;if(t.length<a)throw new Error(`digestInto() expects output buffer of length at least ${a}`)}_assert.output=output$1;const assert$F={number,bool,bytes,hash:hash$9,exists,output:output$1};_assert.default=assert$F;var utils$M={};const require$$0$5=getAugmentedNamespace(crypto$6);(function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const e=require$$0$5,a=V=>new Uint8Array(V.buffer,V.byteOffset,V.byteLength);t.u8=a;const u=V=>new Uint32Array(V.buffer,V.byteOffset,Math.floor(V.byteLength/4));t.u32=u;function d(V){return V instanceof Uint8Array||V!=null&&typeof V=="object"&&V.constructor.name==="Uint8Array"}const c=V=>new DataView(V.buffer,V.byteOffset,V.byteLength);t.createView=c;const l=(V,ae)=>V<<32-ae|V>>>ae;if(t.rotr=l,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!t.isLE)throw new Error("Non little-endian hardware is not supported");const m=Array.from({length:256},(V,ae)=>ae.toString(16).padStart(2,"0"));function I(V){if(!d(V))throw new Error("Uint8Array expected");let ae="";for(let ne=0;ne<V.length;ne++)ae+=m[V[ne]];return ae}t.bytesToHex=I;const O={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function T(V){if(V>=O._0&&V<=O._9)return V-O._0;if(V>=O._A&&V<=O._F)return V-(O._A-10);if(V>=O._a&&V<=O._f)return V-(O._a-10)}function C(V){if(typeof V!="string")throw new Error("hex string expected, got "+typeof V);const ae=V.length,ne=ae/2;if(ae%2)throw new Error("padded hex string expected, got unpadded hex of length "+ae);const M=new Uint8Array(ne);for(let v=0,S=0;v<ne;v++,S+=2){const y=T(V.charCodeAt(S)),w=T(V.charCodeAt(S+1));if(y===void 0||w===void 0){const P=V[S]+V[S+1];throw new Error('hex string expected, got non-hex character "'+P+'" at index '+S)}M[v]=y*16+w}return M}t.hexToBytes=C;const j=async()=>{};t.nextTick=j;async function F(V,ae,ne){let M=Date.now();for(let v=0;v<V;v++){ne(v);const S=Date.now()-M;S>=0&&S<ae||(await(0,t.nextTick)(),M+=S)}}t.asyncLoop=F;function U(V){if(typeof V!="string")throw new Error(`utf8ToBytes expected string, got ${typeof V}`);return new Uint8Array(new TextEncoder().encode(V))}t.utf8ToBytes=U;function Z(V){if(typeof V=="string"&&(V=U(V)),!d(V))throw new Error(`expected Uint8Array, got ${typeof V}`);return V}t.toBytes=Z;function J(...V){let ae=0;for(let M=0;M<V.length;M++){const v=V[M];if(!d(v))throw new Error("Uint8Array expected");ae+=v.length}const ne=new Uint8Array(ae);for(let M=0,v=0;M<V.length;M++){const S=V[M];ne.set(S,v),v+=S.length}return ne}t.concatBytes=J;class X{clone(){return this._cloneInto()}}t.Hash=X;const Q={}.toString;function te(V,ae){if(ae!==void 0&&Q.call(ae)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(V,ae)}t.checkOpts=te;function se(V){const ae=M=>V().update(Z(M)).digest(),ne=V();return ae.outputLen=ne.outputLen,ae.blockLen=ne.blockLen,ae.create=()=>V(),ae}t.wrapConstructor=se;function pe(V){const ae=(M,v)=>V(v).update(Z(M)).digest(),ne=V({});return ae.outputLen=ne.outputLen,ae.blockLen=ne.blockLen,ae.create=M=>V(M),ae}t.wrapConstructorWithOpts=pe;function me(V){const ae=(M,v)=>V(v).update(Z(M)).digest(),ne=V({});return ae.outputLen=ne.outputLen,ae.blockLen=ne.blockLen,ae.create=M=>V(M),ae}t.wrapXOFConstructorWithOpts=me;function Ee(V=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(V));throw new Error("crypto.getRandomValues must be defined")}t.randomBytes=Ee})(utils$M),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=_assert,a=utils$M;class u extends a.Hash{constructor(l,m){super(),this.finished=!1,this.destroyed=!1,(0,e.hash)(l);const I=(0,a.toBytes)(m);if(this.iHash=l.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const O=this.blockLen,T=new Uint8Array(O);T.set(I.length>O?l.create().update(I).digest():I);for(let C=0;C<T.length;C++)T[C]^=54;this.iHash.update(T),this.oHash=l.create();for(let C=0;C<T.length;C++)T[C]^=106;this.oHash.update(T),T.fill(0)}update(l){return(0,e.exists)(this),this.iHash.update(l),this}digestInto(l){(0,e.exists)(this),(0,e.bytes)(l,this.outputLen),this.finished=!0,this.iHash.digestInto(l),this.oHash.update(l),this.oHash.digestInto(l),this.destroy()}digest(){const l=new Uint8Array(this.oHash.outputLen);return this.digestInto(l),l}_cloneInto(l){l||(l=Object.create(Object.getPrototypeOf(this),{}));const{oHash:m,iHash:I,finished:O,destroyed:T,blockLen:C,outputLen:j}=this;return l=l,l.finished=O,l.destroyed=T,l.blockLen=C,l.outputLen=j,l.oHash=m._cloneInto(l.oHash),l.iHash=I._cloneInto(l.iHash),l}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=u;const d=(c,l,m)=>new u(c,l).update(m).digest();t.hmac=d,t.hmac.create=(c,l)=>new u(c,l)}(hmac$2);var sha256$5={},_sha2={};Object.defineProperty(_sha2,"__esModule",{value:!0}),_sha2.SHA2=void 0;const _assert_js_1=_assert,utils_js_1$1=utils$M;function setBigUint64(t,e,a,u){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,a,u);const d=BigInt(32),c=BigInt(4294967295),l=Number(a>>d&c),m=Number(a&c),I=u?4:0,O=u?0:4;t.setUint32(e+I,l,u),t.setUint32(e+O,m,u)}class SHA2 extends utils_js_1$1.Hash{constructor(e,a,u,d){super(),this.blockLen=e,this.outputLen=a,this.padOffset=u,this.isLE=d,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,utils_js_1$1.createView)(this.buffer)}update(e){(0,_assert_js_1.exists)(this);const{view:a,buffer:u,blockLen:d}=this;e=(0,utils_js_1$1.toBytes)(e);const c=e.length;for(let l=0;l<c;){const m=Math.min(d-this.pos,c-l);if(m===d){const I=(0,utils_js_1$1.createView)(e);for(;d<=c-l;l+=d)this.process(I,l);continue}u.set(e.subarray(l,l+m),this.pos),this.pos+=m,l+=m,this.pos===d&&(this.process(a,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,_assert_js_1.exists)(this),(0,_assert_js_1.output)(e,this),this.finished=!0;const{buffer:a,view:u,blockLen:d,isLE:c}=this;let{pos:l}=this;a[l++]=128,this.buffer.subarray(l).fill(0),this.padOffset>d-l&&(this.process(u,0),l=0);for(let C=l;C<d;C++)a[C]=0;setBigUint64(u,d-8,BigInt(this.length*8),c),this.process(u,0);const m=(0,utils_js_1$1.createView)(e),I=this.outputLen;if(I%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const O=I/4,T=this.get();if(O>T.length)throw new Error("_sha2: outputLen bigger than state");for(let C=0;C<O;C++)m.setUint32(4*C,T[C],c)}digest(){const{buffer:e,outputLen:a}=this;this.digestInto(e);const u=e.slice(0,a);return this.destroy(),u}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:a,buffer:u,length:d,finished:c,destroyed:l,pos:m}=this;return e.length=d,e.pos=m,e.finished=c,e.destroyed=l,d%a&&e.buffer.set(u),e}}_sha2.SHA2=SHA2,Object.defineProperty(sha256$5,"__esModule",{value:!0}),sha256$5.sha224=sha256$5.sha256=void 0;const _sha2_js_1=_sha2,utils_js_1=utils$M,Chi=(t,e,a)=>t&e^~t&a,Maj=(t,e,a)=>t&e^t&a^e&a,SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);let SHA256$4=class extends _sha2_js_1.SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:e,B:a,C:u,D:d,E:c,F:l,G:m,H:I}=this;return[e,a,u,d,c,l,m,I]}set(e,a,u,d,c,l,m,I){this.A=e|0,this.B=a|0,this.C=u|0,this.D=d|0,this.E=c|0,this.F=l|0,this.G=m|0,this.H=I|0}process(e,a){for(let C=0;C<16;C++,a+=4)SHA256_W[C]=e.getUint32(a,!1);for(let C=16;C<64;C++){const j=SHA256_W[C-15],F=SHA256_W[C-2],U=(0,utils_js_1.rotr)(j,7)^(0,utils_js_1.rotr)(j,18)^j>>>3,Z=(0,utils_js_1.rotr)(F,17)^(0,utils_js_1.rotr)(F,19)^F>>>10;SHA256_W[C]=Z+SHA256_W[C-7]+U+SHA256_W[C-16]|0}let{A:u,B:d,C:c,D:l,E:m,F:I,G:O,H:T}=this;for(let C=0;C<64;C++){const j=(0,utils_js_1.rotr)(m,6)^(0,utils_js_1.rotr)(m,11)^(0,utils_js_1.rotr)(m,25),F=T+j+Chi(m,I,O)+SHA256_K[C]+SHA256_W[C]|0,Z=((0,utils_js_1.rotr)(u,2)^(0,utils_js_1.rotr)(u,13)^(0,utils_js_1.rotr)(u,22))+Maj(u,d,c)|0;T=O,O=I,I=m,m=l+F|0,l=c,c=d,d=u,u=F+Z|0}u=u+this.A|0,d=d+this.B|0,c=c+this.C|0,l=l+this.D|0,m=m+this.E|0,I=I+this.F|0,O=O+this.G|0,T=T+this.H|0,this.set(u,d,c,l,m,I,O,T)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},SHA224$2=class extends SHA256$4{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};sha256$5.sha256=(0,utils_js_1.wrapConstructor)(()=>new SHA256$4),sha256$5.sha224=(0,utils_js_1.wrapConstructor)(()=>new SHA224$2);var lib$2={},cryptoBrowserify={};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var browser$f={exports:{}},process=browser$f.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var e=queue.length;e;){for(currentQueue=queue,queue=[];++queueIndex<e;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,e=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}process.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)e[a-1]=arguments[a];queue.push(new Item(t,e)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(t,e){this.fun=t,this.array=e}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$2(){}process.on=noop$2,process.addListener=noop$2,process.once=noop$2,process.off=noop$2,process.removeListener=noop$2,process.removeAllListeners=noop$2,process.emit=noop$2,process.prependListener=noop$2,process.prependOnceListener=noop$2,process.listeners=function(t){return[]},process.binding=function(t){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(t){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports$2=browser$f.exports;const process$1=getDefaultExportFromCjs(browserExports$2);var browser$e={exports:{}},safeBuffer$2={exports:{}};const require$$1$4=getAugmentedNamespace(dist$1);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var a=require$$1$4,u=a.Buffer;function d(l,m){for(var I in l)m[I]=l[I]}u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?t.exports=a:(d(a,e),e.Buffer=c);function c(l,m,I){return u(l,m,I)}c.prototype=Object.create(u.prototype),d(u,c),c.from=function(l,m,I){if(typeof l=="number")throw new TypeError("Argument must not be a number");return u(l,m,I)},c.alloc=function(l,m,I){if(typeof l!="number")throw new TypeError("Argument must be a number");var O=u(l);return m!==void 0?typeof I=="string"?O.fill(m,I):O.fill(m):O.fill(0),O},c.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return u(l)},c.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return a.SlowBuffer(l)}})(safeBuffer$2,safeBuffer$2.exports);var safeBufferExports$1=safeBuffer$2.exports,MAX_BYTES$1=65536,MAX_UINT32$1=4294967295;function oldBrowser$2(){throw new Error(`Secure random number generation is not supported by this browser.
27
+ Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$M=safeBufferExports$1.Buffer,crypto$4=commonjsGlobal.crypto||commonjsGlobal.msCrypto;crypto$4&&crypto$4.getRandomValues?browser$e.exports=randomBytes$4:browser$e.exports=oldBrowser$2;function randomBytes$4(t,e){if(t>MAX_UINT32$1)throw new RangeError("requested too many random bytes");var a=Buffer$M.allocUnsafe(t);if(t>0)if(t>MAX_BYTES$1)for(var u=0;u<t;u+=MAX_BYTES$1)crypto$4.getRandomValues(a.slice(u,u+MAX_BYTES$1));else crypto$4.getRandomValues(a);return typeof e=="function"?process$1.nextTick(function(){e(null,a)}):a}var browserExports$1=browser$e.exports,inherits_browser$2={exports:{}};typeof Object.create=="function"?inherits_browser$2.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser$2.exports=function(e,a){if(a){e.super_=a;var u=function(){};u.prototype=a.prototype,e.prototype=new u,e.prototype.constructor=e}};var inherits_browserExports$2=inherits_browser$2.exports,readableBrowser={exports:{}},events={exports:{}},R=typeof Reflect=="object"?Reflect:null,ReflectApply=R&&typeof R.apply=="function"?R.apply:function(e,a,u){return Function.prototype.apply.call(e,a,u)},ReflectOwnKeys;R&&typeof R.ownKeys=="function"?ReflectOwnKeys=R.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ReflectOwnKeys=function(e){return Object.getOwnPropertyNames(e)};function ProcessEmitWarning(t){console&&console.warn&&console.warn(t)}var NumberIsNaN=Number.isNaN||function(e){return e!==e};function EventEmitter(){EventEmitter.init.call(this)}events.exports=EventEmitter,events.exports.once=once$2,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(t){if(typeof t!="number"||t<0||NumberIsNaN(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");defaultMaxListeners=t}}),EventEmitter.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||NumberIsNaN(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function _getMaxListeners(t){return t._maxListeners===void 0?EventEmitter.defaultMaxListeners:t._maxListeners}EventEmitter.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function(e){for(var a=[],u=1;u<arguments.length;u++)a.push(arguments[u]);var d=e==="error",c=this._events;if(c!==void 0)d=d&&c.error===void 0;else if(!d)return!1;if(d){var l;if(a.length>0&&(l=a[0]),l instanceof Error)throw l;var m=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw m.context=l,m}var I=c[e];if(I===void 0)return!1;if(typeof I=="function")ReflectApply(I,this,a);else for(var O=I.length,T=arrayClone(I,O),u=0;u<O;++u)ReflectApply(T[u],this,a);return!0};function _addListener(t,e,a,u){var d,c,l;if(checkListener(a),c=t._events,c===void 0?(c=t._events=Object.create(null),t._eventsCount=0):(c.newListener!==void 0&&(t.emit("newListener",e,a.listener?a.listener:a),c=t._events),l=c[e]),l===void 0)l=c[e]=a,++t._eventsCount;else if(typeof l=="function"?l=c[e]=u?[a,l]:[l,a]:u?l.unshift(a):l.push(a),d=_getMaxListeners(t),d>0&&l.length>d&&!l.warned){l.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=t,m.type=e,m.count=l.length,ProcessEmitWarning(m)}return t}EventEmitter.prototype.addListener=function(e,a){return _addListener(this,e,a,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(e,a){return _addListener(this,e,a,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(t,e,a){var u={fired:!1,wrapFn:void 0,target:t,type:e,listener:a},d=onceWrapper.bind(u);return d.listener=a,u.wrapFn=d,d}EventEmitter.prototype.once=function(e,a){return checkListener(a),this.on(e,_onceWrap(this,e,a)),this},EventEmitter.prototype.prependOnceListener=function(e,a){return checkListener(a),this.prependListener(e,_onceWrap(this,e,a)),this},EventEmitter.prototype.removeListener=function(e,a){var u,d,c,l,m;if(checkListener(a),d=this._events,d===void 0)return this;if(u=d[e],u===void 0)return this;if(u===a||u.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete d[e],d.removeListener&&this.emit("removeListener",e,u.listener||a));else if(typeof u!="function"){for(c=-1,l=u.length-1;l>=0;l--)if(u[l]===a||u[l].listener===a){m=u[l].listener,c=l;break}if(c<0)return this;c===0?u.shift():spliceOne(u,c),u.length===1&&(d[e]=u[0]),d.removeListener!==void 0&&this.emit("removeListener",e,m||a)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function(e){var a,u,d;if(u=this._events,u===void 0)return this;if(u.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):u[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete u[e]),this;if(arguments.length===0){var c=Object.keys(u),l;for(d=0;d<c.length;++d)l=c[d],l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=u[e],typeof a=="function")this.removeListener(e,a);else if(a!==void 0)for(d=a.length-1;d>=0;d--)this.removeListener(e,a[d]);return this};function _listeners(t,e,a){var u=t._events;if(u===void 0)return[];var d=u[e];return d===void 0?[]:typeof d=="function"?a?[d.listener||d]:[d]:a?unwrapListeners(d):arrayClone(d,d.length)}EventEmitter.prototype.listeners=function(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):listenerCount.call(t,e)},EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(t){var e=this._events;if(e!==void 0){var a=e[t];if(typeof a=="function")return 1;if(a!==void 0)return a.length}return 0}EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(t,e){for(var a=new Array(e),u=0;u<e;++u)a[u]=t[u];return a}function spliceOne(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function unwrapListeners(t){for(var e=new Array(t.length),a=0;a<e.length;++a)e[a]=t[a].listener||t[a];return e}function once$2(t,e){return new Promise(function(a,u){function d(l){t.removeListener(e,c),u(l)}function c(){typeof t.removeListener=="function"&&t.removeListener("error",d),a([].slice.call(arguments))}eventTargetAgnosticAddListener(t,e,c,{once:!0}),e!=="error"&&addErrorHandlerIfEventEmitter(t,d,{once:!0})})}function addErrorHandlerIfEventEmitter(t,e,a){typeof t.on=="function"&&eventTargetAgnosticAddListener(t,"error",e,a)}function eventTargetAgnosticAddListener(t,e,a,u){if(typeof t.on=="function")u.once?t.once(e,a):t.on(e,a);else if(typeof t.addEventListener=="function")t.addEventListener(e,function d(c){u.once&&t.removeEventListener(e,d),a(c)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var eventsExports=events.exports,streamBrowser=eventsExports.EventEmitter,util$2={},types={},shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},a=Symbol("test"),u=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(u)!=="[object Symbol]")return!1;var d=42;e[a]=d;for(a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==a||!Object.prototype.propertyIsEnumerable.call(e,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,a);if(l.value!==d||l.enumerable!==!0)return!1}return!0},hasSymbols$3=shams$1,shams=function(){return hasSymbols$3()&&!!Symbol.toStringTag},esErrors=Error,_eval=EvalError,range=RangeError,ref=ReferenceError,syntax=SyntaxError,type=TypeError,uri$1=URIError,origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=shams$1,hasSymbols$2=function(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()},test={__proto__:null,foo:{}},$Object=Object,hasProto$1=function(){return{__proto__:test}.foo===test.foo&&!(test instanceof $Object)},ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr$4=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function(e,a){for(var u=[],d=0;d<e.length;d+=1)u[d]=e[d];for(var c=0;c<a.length;c+=1)u[c+e.length]=a[c];return u},slicy=function(e,a){for(var u=[],d=a||0,c=0;d<e.length;d+=1,c+=1)u[c]=e[d];return u},joiny=function(t,e){for(var a="",u=0;u<t.length;u+=1)a+=t[u],u+1<t.length&&(a+=e);return a},implementation$7=function(e){var a=this;if(typeof a!="function"||toStr$4.apply(a)!==funcType)throw new TypeError(ERROR_MESSAGE+a);for(var u=slicy(arguments,1),d,c=function(){if(this instanceof d){var T=a.apply(this,concatty(u,arguments));return Object(T)===T?T:this}return a.apply(e,concatty(u,arguments))},l=max(0,a.length-u.length),m=[],I=0;I<l;I++)m[I]="$"+I;if(d=Function("binder","return function ("+joiny(m,",")+"){ return binder.apply(this,arguments); }")(c),a.prototype){var O=function(){};O.prototype=a.prototype,d.prototype=new O,O.prototype=null}return d},implementation$6=implementation$7,functionBind=Function.prototype.bind||implementation$6,call$1=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind$1=functionBind,hasown=bind$1.call(call$1,$hasOwn),undefined$1,$Error=esErrors,$EvalError=_eval,$RangeError=range,$ReferenceError=ref,$SyntaxError$1=syntax,$TypeError$2=type,$URIError=uri$1,$Function=Function,getEvalledConstructor=function(t){try{return $Function('"use strict"; return ('+t+").constructor;")()}catch{}},$gOPD$1=Object.getOwnPropertyDescriptor;if($gOPD$1)try{$gOPD$1({},"")}catch{$gOPD$1=null}var throwTypeError=function(){throw new $TypeError$2},ThrowTypeError=$gOPD$1?function(){try{return arguments.callee,throwTypeError}catch{try{return $gOPD$1(arguments,"callee").get}catch{return throwTypeError}}}():throwTypeError,hasSymbols$1=hasSymbols$2(),hasProto=hasProto$1(),getProto$1=Object.getPrototypeOf||(hasProto?function(t){return t.__proto__}:null),needsEval={},TypedArray=typeof Uint8Array>"u"||!getProto$1?undefined$1:getProto$1(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(getProto$1([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols$1||!getProto$1?undefined$1:getProto$1(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols$1&&getProto$1?getProto$1(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols$1?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$2,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet};if(getProto$1)try{null.error}catch(t){var errorProto=getProto$1(getProto$1(t));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function t(e){var a;if(e==="%AsyncFunction%")a=getEvalledConstructor("async function () {}");else if(e==="%GeneratorFunction%")a=getEvalledConstructor("function* () {}");else if(e==="%AsyncGeneratorFunction%")a=getEvalledConstructor("async function* () {}");else if(e==="%AsyncGenerator%"){var u=t("%AsyncGeneratorFunction%");u&&(a=u.prototype)}else if(e==="%AsyncIteratorPrototype%"){var d=t("%AsyncGenerator%");d&&getProto$1&&(a=getProto$1(d.prototype))}return INTRINSICS[e]=a,a},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=functionBind,hasOwn=hasown,$concat=bind.call(Function.call,Array.prototype.concat),$spliceApply=bind.call(Function.apply,Array.prototype.splice),$replace=bind.call(Function.call,String.prototype.replace),$strSlice=bind.call(Function.call,String.prototype.slice),$exec=bind.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(e){var a=$strSlice(e,0,1),u=$strSlice(e,-1);if(a==="%"&&u!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(u==="%"&&a!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var d=[];return $replace(e,rePropName,function(c,l,m,I){d[d.length]=m?$replace(I,reEscapeChar,"$1"):l||c}),d},getBaseIntrinsic=function(e,a){var u=e,d;if(hasOwn(LEGACY_ALIASES,u)&&(d=LEGACY_ALIASES[u],u="%"+d[0]+"%"),hasOwn(INTRINSICS,u)){var c=INTRINSICS[u];if(c===needsEval&&(c=doEval(u)),typeof c>"u"&&!a)throw new $TypeError$2("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:d,name:u,value:c}}throw new $SyntaxError$1("intrinsic "+e+" does not exist!")},getIntrinsic=function(e,a){if(typeof e!="string"||e.length===0)throw new $TypeError$2("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new $TypeError$2('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,e)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var u=stringToPath(e),d=u.length>0?u[0]:"",c=getBaseIntrinsic("%"+d+"%",a),l=c.name,m=c.value,I=!1,O=c.alias;O&&(d=O[0],$spliceApply(u,$concat([0,1],O)));for(var T=1,C=!0;T<u.length;T+=1){var j=u[T],F=$strSlice(j,0,1),U=$strSlice(j,-1);if((F==='"'||F==="'"||F==="`"||U==='"'||U==="'"||U==="`")&&F!==U)throw new $SyntaxError$1("property names with quotes must have matching quotes");if((j==="constructor"||!C)&&(I=!0),d+="."+j,l="%"+d+"%",hasOwn(INTRINSICS,l))m=INTRINSICS[l];else if(m!=null){if(!(j in m)){if(!a)throw new $TypeError$2("base intrinsic for "+e+" exists, but the property is not available.");return}if($gOPD$1&&T+1>=u.length){var Z=$gOPD$1(m,j);C=!!Z,C&&"get"in Z&&!("originalValue"in Z.get)?m=Z.get:m=m[j]}else C=hasOwn(m,j),m=m[j];C&&!I&&(INTRINSICS[l]=m)}}return m},callBind$2={exports:{}},esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var t=getIntrinsic,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return esDefineProperty=e,esDefineProperty}var GetIntrinsic$2=getIntrinsic,$gOPD=GetIntrinsic$2("%Object.getOwnPropertyDescriptor%",!0);if($gOPD)try{$gOPD([],"length")}catch{$gOPD=null}var gopd$1=$gOPD,$defineProperty$1=requireEsDefineProperty(),$SyntaxError=syntax,$TypeError$1=type,gopd=gopd$1,defineDataProperty=function(e,a,u){if(!e||typeof e!="object"&&typeof e!="function")throw new $TypeError$1("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new $TypeError$1("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var d=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,m=arguments.length>6?arguments[6]:!1,I=!!gopd&&gopd(e,a);if($defineProperty$1)$defineProperty$1(e,a,{configurable:l===null&&I?I.configurable:!l,enumerable:d===null&&I?I.enumerable:!d,value:u,writable:c===null&&I?I.writable:!c});else if(m||!d&&!c&&!l)e[a]=u;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},$defineProperty=requireEsDefineProperty(),hasPropertyDescriptors=function(){return!!$defineProperty};hasPropertyDescriptors.hasArrayLengthDefineBug=function(){if(!$defineProperty)return null;try{return $defineProperty([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors,GetIntrinsic$1=getIntrinsic,define=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$1=gopd$1,$TypeError=type,$floor=GetIntrinsic$1("%Math.floor%"),setFunctionLength=function(e,a){if(typeof e!="function")throw new $TypeError("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||$floor(a)!==a)throw new $TypeError("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],d=!0,c=!0;if("length"in e&&gOPD$1){var l=gOPD$1(e,"length");l&&!l.configurable&&(d=!1),l&&!l.writable&&(c=!1)}return(d||c||!u)&&(hasDescriptors?define(e,"length",a,!0,!0):define(e,"length",a)),e};(function(t){var e=functionBind,a=getIntrinsic,u=setFunctionLength,d=type,c=a("%Function.prototype.apply%"),l=a("%Function.prototype.call%"),m=a("%Reflect.apply%",!0)||e.call(l,c),I=requireEsDefineProperty(),O=a("%Math.max%");t.exports=function(j){if(typeof j!="function")throw new d("a function is required");var F=m(e,l,arguments);return u(F,1+O(0,j.length-(arguments.length-1)),!0)};var T=function(){return m(e,c,arguments)};I?I(t.exports,"apply",{value:T}):t.exports.apply=T})(callBind$2);var callBindExports=callBind$2.exports,GetIntrinsic=getIntrinsic,callBind$1=callBindExports,$indexOf$1=callBind$1(GetIntrinsic("String.prototype.indexOf")),callBound$3=function(e,a){var u=GetIntrinsic(e,!!a);return typeof u=="function"&&$indexOf$1(e,".prototype.")>-1?callBind$1(u):u},hasToStringTag$3=shams(),callBound$2=callBound$3,$toString$1=callBound$2("Object.prototype.toString"),isStandardArguments=function(e){return hasToStringTag$3&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:$toString$1(e)==="[object Arguments]"},isLegacyArguments=function(e){return isStandardArguments(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&$toString$1(e)!=="[object Array]"&&$toString$1(e.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments$1=supportsStandardArguments?isStandardArguments:isLegacyArguments,toStr$3=Object.prototype.toString,fnToStr$1=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,hasToStringTag$2=shams(),getProto=Object.getPrototypeOf,getGeneratorFunc=function(){if(!hasToStringTag$2)return!1;try{return Function("return function*() {}")()}catch{}},GeneratorFunction,isGeneratorFunction=function(e){if(typeof e!="function")return!1;if(isFnRegex.test(fnToStr$1.call(e)))return!0;if(!hasToStringTag$2){var a=toStr$3.call(e);return a==="[object GeneratorFunction]"}if(!getProto)return!1;if(typeof GeneratorFunction>"u"){var u=getGeneratorFunc();GeneratorFunction=u?getProto(u):!1}return getProto(e)===GeneratorFunction},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(t){t!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(e){try{var a=fnToStr.call(e);return constructorRegex.test(a)}catch{return!1}},tryFunctionObject=function(e){try{return isES6ClassFn(e)?!1:(fnToStr.call(e),!0)}catch{return!1}},toStr$2=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$2.call(all)===toStr$2.call(document.all)&&(isDDA=function(e){if((isIE68||!e)&&(typeof e>"u"||typeof e=="object"))try{var a=toStr$2.call(e);return(a===ddaClass||a===ddaClass2||a===ddaClass3||a===objectClass)&&e("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(e){if(isDDA(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{reflectApply(e,null,badArrayLike)}catch(a){if(a!==isCallableMarker)return!1}return!isES6ClassFn(e)&&tryFunctionObject(e)}:function(e){if(isDDA(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(e);if(isES6ClassFn(e))return!1;var a=toStr$2.call(e);return a!==fnClass&&a!==genClass&&!/^\[object HTML/.test(a)?!1:tryFunctionObject(e)},isCallable=isCallable$1,toStr$1=Object.prototype.toString,hasOwnProperty$1=Object.prototype.hasOwnProperty,forEachArray=function(e,a,u){for(var d=0,c=e.length;d<c;d++)hasOwnProperty$1.call(e,d)&&(u==null?a(e[d],d,e):a.call(u,e[d],d,e))},forEachString=function(e,a,u){for(var d=0,c=e.length;d<c;d++)u==null?a(e.charAt(d),d,e):a.call(u,e.charAt(d),d,e)},forEachObject=function(e,a,u){for(var d in e)hasOwnProperty$1.call(e,d)&&(u==null?a(e[d],d,e):a.call(u,e[d],d,e))},forEach$1=function(e,a,u){if(!isCallable(a))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=u),toStr$1.call(e)==="[object Array]"?forEachArray(e,a,d):typeof e=="string"?forEachString(e,a,d):forEachObject(e,a,d)},forEach_1=forEach$1,possibleTypedArrayNames=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],possibleNames=possibleTypedArrayNames,g$1=typeof globalThis>"u"?commonjsGlobal:globalThis,availableTypedArrays$1=function(){for(var e=[],a=0;a<possibleNames.length;a++)typeof g$1[possibleNames[a]]=="function"&&(e[e.length]=possibleNames[a]);return e},forEach=forEach_1,availableTypedArrays=availableTypedArrays$1,callBind=callBindExports,callBound$1=callBound$3,gOPD=gopd$1,$toString=callBound$1("Object.prototype.toString"),hasToStringTag=shams(),g=typeof globalThis>"u"?commonjsGlobal:globalThis,typedArrays=availableTypedArrays(),$slice=callBound$1("String.prototype.slice"),getPrototypeOf=Object.getPrototypeOf,$indexOf=callBound$1("Array.prototype.indexOf",!0)||function(e,a){for(var u=0;u<e.length;u+=1)if(e[u]===a)return u;return-1},cache={__proto__:null};hasToStringTag&&gOPD&&getPrototypeOf?forEach(typedArrays,function(t){var e=new g[t];if(Symbol.toStringTag in e){var a=getPrototypeOf(e),u=gOPD(a,Symbol.toStringTag);if(!u){var d=getPrototypeOf(a);u=gOPD(d,Symbol.toStringTag)}cache["$"+t]=callBind(u.get)}}):forEach(typedArrays,function(t){var e=new g[t],a=e.slice||e.set;a&&(cache["$"+t]=callBind(a))});var tryTypedArrays=function(e){var a=!1;return forEach(cache,function(u,d){if(!a)try{"$"+u(e)===d&&(a=$slice(d,1))}catch{}}),a},trySlices=function(e){var a=!1;return forEach(cache,function(u,d){if(!a)try{u(e),a=$slice(d,1)}catch{}}),a},whichTypedArray$1=function(e){if(!e||typeof e!="object")return!1;if(!hasToStringTag){var a=$slice($toString(e),8,-1);return $indexOf(typedArrays,a)>-1?a:a!=="Object"?!1:trySlices(e)}return gOPD?tryTypedArrays(e):null},whichTypedArray=whichTypedArray$1,isTypedArray=function(e){return!!whichTypedArray(e)};(function(t){var e=isArguments$1,a=isGeneratorFunction,u=whichTypedArray$1,d=isTypedArray;function c(Fe){return Fe.call.bind(Fe)}var l=typeof BigInt<"u",m=typeof Symbol<"u",I=c(Object.prototype.toString),O=c(Number.prototype.valueOf),T=c(String.prototype.valueOf),C=c(Boolean.prototype.valueOf);if(l)var j=c(BigInt.prototype.valueOf);if(m)var F=c(Symbol.prototype.valueOf);function U(Fe,wt){if(typeof Fe!="object")return!1;try{return wt(Fe),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=a,t.isTypedArray=d;function Z(Fe){return typeof Promise<"u"&&Fe instanceof Promise||Fe!==null&&typeof Fe=="object"&&typeof Fe.then=="function"&&typeof Fe.catch=="function"}t.isPromise=Z;function J(Fe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Fe):d(Fe)||Y(Fe)}t.isArrayBufferView=J;function X(Fe){return u(Fe)==="Uint8Array"}t.isUint8Array=X;function Q(Fe){return u(Fe)==="Uint8ClampedArray"}t.isUint8ClampedArray=Q;function te(Fe){return u(Fe)==="Uint16Array"}t.isUint16Array=te;function se(Fe){return u(Fe)==="Uint32Array"}t.isUint32Array=se;function pe(Fe){return u(Fe)==="Int8Array"}t.isInt8Array=pe;function me(Fe){return u(Fe)==="Int16Array"}t.isInt16Array=me;function Ee(Fe){return u(Fe)==="Int32Array"}t.isInt32Array=Ee;function V(Fe){return u(Fe)==="Float32Array"}t.isFloat32Array=V;function ae(Fe){return u(Fe)==="Float64Array"}t.isFloat64Array=ae;function ne(Fe){return u(Fe)==="BigInt64Array"}t.isBigInt64Array=ne;function M(Fe){return u(Fe)==="BigUint64Array"}t.isBigUint64Array=M;function v(Fe){return I(Fe)==="[object Map]"}v.working=typeof Map<"u"&&v(new Map);function S(Fe){return typeof Map>"u"?!1:v.working?v(Fe):Fe instanceof Map}t.isMap=S;function y(Fe){return I(Fe)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function w(Fe){return typeof Set>"u"?!1:y.working?y(Fe):Fe instanceof Set}t.isSet=w;function P(Fe){return I(Fe)==="[object WeakMap]"}P.working=typeof WeakMap<"u"&&P(new WeakMap);function L(Fe){return typeof WeakMap>"u"?!1:P.working?P(Fe):Fe instanceof WeakMap}t.isWeakMap=L;function N(Fe){return I(Fe)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function E(Fe){return N(Fe)}t.isWeakSet=E;function A(Fe){return I(Fe)==="[object ArrayBuffer]"}A.working=typeof ArrayBuffer<"u"&&A(new ArrayBuffer);function D(Fe){return typeof ArrayBuffer>"u"?!1:A.working?A(Fe):Fe instanceof ArrayBuffer}t.isArrayBuffer=D;function H(Fe){return I(Fe)==="[object DataView]"}H.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&H(new DataView(new ArrayBuffer(1),0,1));function Y(Fe){return typeof DataView>"u"?!1:H.working?H(Fe):Fe instanceof DataView}t.isDataView=Y;var le=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function _e(Fe){return I(Fe)==="[object SharedArrayBuffer]"}function he(Fe){return typeof le>"u"?!1:(typeof _e.working>"u"&&(_e.working=_e(new le)),_e.working?_e(Fe):Fe instanceof le)}t.isSharedArrayBuffer=he;function fe(Fe){return I(Fe)==="[object AsyncFunction]"}t.isAsyncFunction=fe;function ve(Fe){return I(Fe)==="[object Map Iterator]"}t.isMapIterator=ve;function ge(Fe){return I(Fe)==="[object Set Iterator]"}t.isSetIterator=ge;function Ie(Fe){return I(Fe)==="[object Generator]"}t.isGeneratorObject=Ie;function ue(Fe){return I(Fe)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=ue;function ce(Fe){return U(Fe,O)}t.isNumberObject=ce;function Te(Fe){return U(Fe,T)}t.isStringObject=Te;function ke(Fe){return U(Fe,C)}t.isBooleanObject=ke;function He(Fe){return l&&U(Fe,j)}t.isBigIntObject=He;function Qe(Fe){return m&&U(Fe,F)}t.isSymbolObject=Qe;function it(Fe){return ce(Fe)||Te(Fe)||ke(Fe)||He(Fe)||Qe(Fe)}t.isBoxedPrimitive=it;function rt(Fe){return typeof Uint8Array<"u"&&(D(Fe)||he(Fe))}t.isAnyArrayBuffer=rt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Fe){Object.defineProperty(t,Fe,{enumerable:!1,value:function(){throw new Error(Fe+" is not supported in userland")}})})})(types);var isBufferBrowser=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"};(function(t){var e=Object.getOwnPropertyDescriptors||function(Y){for(var le=Object.keys(Y),_e={},he=0;he<le.length;he++)_e[le[he]]=Object.getOwnPropertyDescriptor(Y,le[he]);return _e},a=/%[sdj%]/g;t.format=function(H){if(!pe(H)){for(var Y=[],le=0;le<arguments.length;le++)Y.push(l(arguments[le]));return Y.join(" ")}for(var le=1,_e=arguments,he=_e.length,fe=String(H).replace(a,function(ge){if(ge==="%%")return"%";if(le>=he)return ge;switch(ge){case"%s":return String(_e[le++]);case"%d":return Number(_e[le++]);case"%j":try{return JSON.stringify(_e[le++])}catch{return"[Circular]"}default:return ge}}),ve=_e[le];le<he;ve=_e[++le])Q(ve)||!ae(ve)?fe+=" "+ve:fe+=" "+l(ve);return fe},t.deprecate=function(H,Y){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return H;if(typeof process$1>"u")return function(){return t.deprecate(H,Y).apply(this,arguments)};var le=!1;function _e(){if(!le){if(process$1.throwDeprecation)throw new Error(Y);process$1.traceDeprecation?console.trace(Y):console.error(Y),le=!0}return H.apply(this,arguments)}return _e};var u={},d=/^$/;if(process$1.env.NODE_DEBUG){var c=process$1.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),d=new RegExp("^"+c+"$","i")}t.debuglog=function(H){if(H=H.toUpperCase(),!u[H])if(d.test(H)){var Y=process$1.pid;u[H]=function(){var le=t.format.apply(t,arguments);console.error("%s %d: %s",H,Y,le)}}else u[H]=function(){};return u[H]};function l(H,Y){var le={seen:[],stylize:I};return arguments.length>=3&&(le.depth=arguments[2]),arguments.length>=4&&(le.colors=arguments[3]),X(Y)?le.showHidden=Y:Y&&t._extend(le,Y),Ee(le.showHidden)&&(le.showHidden=!1),Ee(le.depth)&&(le.depth=2),Ee(le.colors)&&(le.colors=!1),Ee(le.customInspect)&&(le.customInspect=!0),le.colors&&(le.stylize=m),T(le,H,le.depth)}t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function m(H,Y){var le=l.styles[Y];return le?"\x1B["+l.colors[le][0]+"m"+H+"\x1B["+l.colors[le][1]+"m":H}function I(H,Y){return H}function O(H){var Y={};return H.forEach(function(le,_e){Y[le]=!0}),Y}function T(H,Y,le){if(H.customInspect&&Y&&v(Y.inspect)&&Y.inspect!==t.inspect&&!(Y.constructor&&Y.constructor.prototype===Y)){var _e=Y.inspect(le,H);return pe(_e)||(_e=T(H,_e,le)),_e}var he=C(H,Y);if(he)return he;var fe=Object.keys(Y),ve=O(fe);if(H.showHidden&&(fe=Object.getOwnPropertyNames(Y)),M(Y)&&(fe.indexOf("message")>=0||fe.indexOf("description")>=0))return j(Y);if(fe.length===0){if(v(Y)){var ge=Y.name?": "+Y.name:"";return H.stylize("[Function"+ge+"]","special")}if(V(Y))return H.stylize(RegExp.prototype.toString.call(Y),"regexp");if(ne(Y))return H.stylize(Date.prototype.toString.call(Y),"date");if(M(Y))return j(Y)}var Ie="",ue=!1,ce=["{","}"];if(J(Y)&&(ue=!0,ce=["[","]"]),v(Y)){var Te=Y.name?": "+Y.name:"";Ie=" [Function"+Te+"]"}if(V(Y)&&(Ie=" "+RegExp.prototype.toString.call(Y)),ne(Y)&&(Ie=" "+Date.prototype.toUTCString.call(Y)),M(Y)&&(Ie=" "+j(Y)),fe.length===0&&(!ue||Y.length==0))return ce[0]+Ie+ce[1];if(le<0)return V(Y)?H.stylize(RegExp.prototype.toString.call(Y),"regexp"):H.stylize("[Object]","special");H.seen.push(Y);var ke;return ue?ke=F(H,Y,le,ve,fe):ke=fe.map(function(He){return U(H,Y,le,ve,He,ue)}),H.seen.pop(),Z(ke,Ie,ce)}function C(H,Y){if(Ee(Y))return H.stylize("undefined","undefined");if(pe(Y)){var le="'"+JSON.stringify(Y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return H.stylize(le,"string")}if(se(Y))return H.stylize(""+Y,"number");if(X(Y))return H.stylize(""+Y,"boolean");if(Q(Y))return H.stylize("null","null")}function j(H){return"["+Error.prototype.toString.call(H)+"]"}function F(H,Y,le,_e,he){for(var fe=[],ve=0,ge=Y.length;ve<ge;++ve)N(Y,String(ve))?fe.push(U(H,Y,le,_e,String(ve),!0)):fe.push("");return he.forEach(function(Ie){Ie.match(/^\d+$/)||fe.push(U(H,Y,le,_e,Ie,!0))}),fe}function U(H,Y,le,_e,he,fe){var ve,ge,Ie;if(Ie=Object.getOwnPropertyDescriptor(Y,he)||{value:Y[he]},Ie.get?Ie.set?ge=H.stylize("[Getter/Setter]","special"):ge=H.stylize("[Getter]","special"):Ie.set&&(ge=H.stylize("[Setter]","special")),N(_e,he)||(ve="["+he+"]"),ge||(H.seen.indexOf(Ie.value)<0?(Q(le)?ge=T(H,Ie.value,null):ge=T(H,Ie.value,le-1),ge.indexOf(`
28
+ `)>-1&&(fe?ge=ge.split(`
29
+ `).map(function(ue){return" "+ue}).join(`
30
+ `).slice(2):ge=`
31
+ `+ge.split(`
32
+ `).map(function(ue){return" "+ue}).join(`
33
+ `))):ge=H.stylize("[Circular]","special")),Ee(ve)){if(fe&&he.match(/^\d+$/))return ge;ve=JSON.stringify(""+he),ve.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ve=ve.slice(1,-1),ve=H.stylize(ve,"name")):(ve=ve.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ve=H.stylize(ve,"string"))}return ve+": "+ge}function Z(H,Y,le){var _e=H.reduce(function(he,fe){return fe.indexOf(`
34
+ `)>=0,he+fe.replace(/\u001b\[\d\d?m/g,"").length+1},0);return _e>60?le[0]+(Y===""?"":Y+`
35
+ `)+" "+H.join(`,
36
+ `)+" "+le[1]:le[0]+Y+" "+H.join(", ")+" "+le[1]}t.types=types;function J(H){return Array.isArray(H)}t.isArray=J;function X(H){return typeof H=="boolean"}t.isBoolean=X;function Q(H){return H===null}t.isNull=Q;function te(H){return H==null}t.isNullOrUndefined=te;function se(H){return typeof H=="number"}t.isNumber=se;function pe(H){return typeof H=="string"}t.isString=pe;function me(H){return typeof H=="symbol"}t.isSymbol=me;function Ee(H){return H===void 0}t.isUndefined=Ee;function V(H){return ae(H)&&y(H)==="[object RegExp]"}t.isRegExp=V,t.types.isRegExp=V;function ae(H){return typeof H=="object"&&H!==null}t.isObject=ae;function ne(H){return ae(H)&&y(H)==="[object Date]"}t.isDate=ne,t.types.isDate=ne;function M(H){return ae(H)&&(y(H)==="[object Error]"||H instanceof Error)}t.isError=M,t.types.isNativeError=M;function v(H){return typeof H=="function"}t.isFunction=v;function S(H){return H===null||typeof H=="boolean"||typeof H=="number"||typeof H=="string"||typeof H=="symbol"||typeof H>"u"}t.isPrimitive=S,t.isBuffer=isBufferBrowser;function y(H){return Object.prototype.toString.call(H)}function w(H){return H<10?"0"+H.toString(10):H.toString(10)}var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(){var H=new Date,Y=[w(H.getHours()),w(H.getMinutes()),w(H.getSeconds())].join(":");return[H.getDate(),P[H.getMonth()],Y].join(" ")}t.log=function(){console.log("%s - %s",L(),t.format.apply(t,arguments))},t.inherits=inherits_browserExports$2,t._extend=function(H,Y){if(!Y||!ae(Y))return H;for(var le=Object.keys(Y),_e=le.length;_e--;)H[le[_e]]=Y[le[_e]];return H};function N(H,Y){return Object.prototype.hasOwnProperty.call(H,Y)}var E=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(Y){if(typeof Y!="function")throw new TypeError('The "original" argument must be of type Function');if(E&&Y[E]){var le=Y[E];if(typeof le!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(le,E,{value:le,enumerable:!1,writable:!1,configurable:!0}),le}function le(){for(var _e,he,fe=new Promise(function(Ie,ue){_e=Ie,he=ue}),ve=[],ge=0;ge<arguments.length;ge++)ve.push(arguments[ge]);ve.push(function(Ie,ue){Ie?he(Ie):_e(ue)});try{Y.apply(this,ve)}catch(Ie){he(Ie)}return fe}return Object.setPrototypeOf(le,Object.getPrototypeOf(Y)),E&&Object.defineProperty(le,E,{value:le,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(le,e(Y))},t.promisify.custom=E;function A(H,Y){if(!H){var le=new Error("Promise was rejected with a falsy value");le.reason=H,H=le}return Y(H)}function D(H){if(typeof H!="function")throw new TypeError('The "original" argument must be of type Function');function Y(){for(var le=[],_e=0;_e<arguments.length;_e++)le.push(arguments[_e]);var he=le.pop();if(typeof he!="function")throw new TypeError("The last argument must be of type Function");var fe=this,ve=function(){return he.apply(fe,arguments)};H.apply(this,le).then(function(ge){process$1.nextTick(ve.bind(null,null,ge))},function(ge){process$1.nextTick(A.bind(null,ge,ve))})}return Object.setPrototypeOf(Y,Object.getPrototypeOf(H)),Object.defineProperties(Y,e(H)),Y}t.callbackify=D})(util$2);var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function t(U,Z){var J=Object.keys(U);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(U);Z&&(X=X.filter(function(Q){return Object.getOwnPropertyDescriptor(U,Q).enumerable})),J.push.apply(J,X)}return J}function e(U){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?t(Object(J),!0).forEach(function(X){a(U,X,J[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(J)):t(Object(J)).forEach(function(X){Object.defineProperty(U,X,Object.getOwnPropertyDescriptor(J,X))})}return U}function a(U,Z,J){return Z=l(Z),Z in U?Object.defineProperty(U,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):U[Z]=J,U}function u(U,Z){if(!(U instanceof Z))throw new TypeError("Cannot call a class as a function")}function d(U,Z){for(var J=0;J<Z.length;J++){var X=Z[J];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(U,l(X.key),X)}}function c(U,Z,J){return Z&&d(U.prototype,Z),J&&d(U,J),Object.defineProperty(U,"prototype",{writable:!1}),U}function l(U){var Z=m(U,"string");return typeof Z=="symbol"?Z:String(Z)}function m(U,Z){if(typeof U!="object"||U===null)return U;var J=U[Symbol.toPrimitive];if(J!==void 0){var X=J.call(U,Z||"default");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)(U)}var I=require$$1$4,O=I.Buffer,T=util$2,C=T.inspect,j=C&&C.custom||"inspect";function F(U,Z,J){O.prototype.copy.call(U,Z,J)}return buffer_list=function(){function U(){u(this,U),this.head=null,this.tail=null,this.length=0}return c(U,[{key:"push",value:function(J){var X={data:J,next:null};this.length>0?this.tail.next=X:this.head=X,this.tail=X,++this.length}},{key:"unshift",value:function(J){var X={data:J,next:this.head};this.length===0&&(this.tail=X),this.head=X,++this.length}},{key:"shift",value:function(){if(this.length!==0){var J=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,J}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(J){if(this.length===0)return"";for(var X=this.head,Q=""+X.data;X=X.next;)Q+=J+X.data;return Q}},{key:"concat",value:function(J){if(this.length===0)return O.alloc(0);for(var X=O.allocUnsafe(J>>>0),Q=this.head,te=0;Q;)F(Q.data,X,te),te+=Q.data.length,Q=Q.next;return X}},{key:"consume",value:function(J,X){var Q;return J<this.head.data.length?(Q=this.head.data.slice(0,J),this.head.data=this.head.data.slice(J)):J===this.head.data.length?Q=this.shift():Q=X?this._getString(J):this._getBuffer(J),Q}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(J){var X=this.head,Q=1,te=X.data;for(J-=te.length;X=X.next;){var se=X.data,pe=J>se.length?se.length:J;if(pe===se.length?te+=se:te+=se.slice(0,J),J-=pe,J===0){pe===se.length?(++Q,X.next?this.head=X.next:this.head=this.tail=null):(this.head=X,X.data=se.slice(pe));break}++Q}return this.length-=Q,te}},{key:"_getBuffer",value:function(J){var X=O.allocUnsafe(J),Q=this.head,te=1;for(Q.data.copy(X),J-=Q.data.length;Q=Q.next;){var se=Q.data,pe=J>se.length?se.length:J;if(se.copy(X,X.length-J,0,pe),J-=pe,J===0){pe===se.length?(++te,Q.next?this.head=Q.next:this.head=this.tail=null):(this.head=Q,Q.data=se.slice(pe));break}++te}return this.length-=te,X}},{key:j,value:function(J,X){return C(this,e(e({},X),{},{depth:0,customInspect:!1}))}}]),U}(),buffer_list}function destroy(t,e){var a=this,u=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return u||d?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(emitErrorNT,this,t)):process$1.nextTick(emitErrorNT,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(c){!e&&c?a._writableState?a._writableState.errorEmitted?process$1.nextTick(emitCloseNT,a):(a._writableState.errorEmitted=!0,process$1.nextTick(emitErrorAndCloseNT,a,c)):process$1.nextTick(emitErrorAndCloseNT,a,c):e?(process$1.nextTick(emitCloseNT,a),e(c)):process$1.nextTick(emitCloseNT,a)}),this)}function emitErrorAndCloseNT(t,e){emitErrorNT(t,e),emitCloseNT(t)}function emitCloseNT(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function undestroy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function emitErrorNT(t,e){t.emit("error",e)}function errorOrDestroy(t,e){var a=t._readableState,u=t._writableState;a&&a.autoDestroy||u&&u.autoDestroy?t.destroy(e):t.emit("error",e)}var destroy_1={destroy,undestroy,errorOrDestroy},errorsBrowser={};function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var codes={};function createErrorType(t,e,a){a||(a=Error);function u(c,l,m){return typeof e=="string"?e:e(c,l,m)}var d=function(c){_inheritsLoose(l,c);function l(m,I,O){return c.call(this,u(m,I,O))||this}return l}(a);d.prototype.name=a.name,d.prototype.code=t,codes[t]=d}function oneOf(t,e){if(Array.isArray(t)){var a=t.length;return t=t.map(function(u){return String(u)}),a>2?"one of ".concat(e," ").concat(t.slice(0,a-1).join(", "),", or ")+t[a-1]:a===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function startsWith(t,e,a){return t.substr(!a||a<0?0:+a,e.length)===e}function endsWith(t,e,a){return(a===void 0||a>t.length)&&(a=t.length),t.substring(a-e.length,a)===e}function includes(t,e,a){return typeof a!="number"&&(a=0),a+e.length>t.length?!1:t.indexOf(e,a)!==-1}createErrorType("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),createErrorType("ERR_INVALID_ARG_TYPE",function(t,e,a){var u;typeof e=="string"&&startsWith(e,"not ")?(u="must not be",e=e.replace(/^not /,"")):u="must be";var d;if(endsWith(t," argument"))d="The ".concat(t," ").concat(u," ").concat(oneOf(e,"type"));else{var c=includes(t,".")?"property":"argument";d='The "'.concat(t,'" ').concat(c," ").concat(u," ").concat(oneOf(e,"type"))}return d+=". Received type ".concat(typeof a),d},TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=codes;var ERR_INVALID_OPT_VALUE=errorsBrowser.codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(t,e,a){return t.highWaterMark!=null?t.highWaterMark:e?t[a]:null}function getHighWaterMark(t,e,a,u){var d=highWaterMarkFrom(e,u,a);if(d!=null){if(!(isFinite(d)&&Math.floor(d)===d)||d<0){var c=u?a:"highWaterMark";throw new ERR_INVALID_OPT_VALUE(c,d)}return Math.floor(d)}return t.objectMode?16:16*1024}var state={getHighWaterMark},browser$d=deprecate;function deprecate(t,e){if(config("noDeprecation"))return t;var a=!1;function u(){if(!a){if(config("throwDeprecation"))throw new Error(e);config("traceDeprecation")?console.trace(e):console.warn(e),a=!0}return t.apply(this,arguments)}return u}function config(t){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var e=commonjsGlobal.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1,_stream_writable=V;function t(he){var fe=this;this.next=null,this.entry=null,this.finish=function(){_e(fe,he)}}var e;V.WritableState=me;var a={deprecate:browser$d},u=streamBrowser,d=require$$1$4.Buffer,c=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function l(he){return d.from(he)}function m(he){return d.isBuffer(he)||he instanceof c}var I=destroy_1,O=state,T=O.getHighWaterMark,C=errorsBrowser.codes,j=C.ERR_INVALID_ARG_TYPE,F=C.ERR_METHOD_NOT_IMPLEMENTED,U=C.ERR_MULTIPLE_CALLBACK,Z=C.ERR_STREAM_CANNOT_PIPE,J=C.ERR_STREAM_DESTROYED,X=C.ERR_STREAM_NULL_VALUES,Q=C.ERR_STREAM_WRITE_AFTER_END,te=C.ERR_UNKNOWN_ENCODING,se=I.errorOrDestroy;inherits_browserExports$2(V,u);function pe(){}function me(he,fe,ve){e=e||require_stream_duplex(),he=he||{},typeof ve!="boolean"&&(ve=fe instanceof e),this.objectMode=!!he.objectMode,ve&&(this.objectMode=this.objectMode||!!he.writableObjectMode),this.highWaterMark=T(this,he,"writableHighWaterMark",ve),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ge=he.decodeStrings===!1;this.decodeStrings=!ge,this.defaultEncoding=he.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Ie){P(fe,Ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=he.emitClose!==!1,this.autoDestroy=!!he.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}me.prototype.getBuffer=function(){for(var fe=this.bufferedRequest,ve=[];fe;)ve.push(fe),fe=fe.next;return ve},function(){try{Object.defineProperty(me.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ee;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ee=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(fe){return Ee.call(this,fe)?!0:this!==V?!1:fe&&fe._writableState instanceof me}})):Ee=function(fe){return fe instanceof this};function V(he){e=e||require_stream_duplex();var fe=this instanceof e;if(!fe&&!Ee.call(V,this))return new V(he);this._writableState=new me(he,this,fe),this.writable=!0,he&&(typeof he.write=="function"&&(this._write=he.write),typeof he.writev=="function"&&(this._writev=he.writev),typeof he.destroy=="function"&&(this._destroy=he.destroy),typeof he.final=="function"&&(this._final=he.final)),u.call(this)}V.prototype.pipe=function(){se(this,new Z)};function ae(he,fe){var ve=new Q;se(he,ve),process$1.nextTick(fe,ve)}function ne(he,fe,ve,ge){var Ie;return ve===null?Ie=new X:typeof ve!="string"&&!fe.objectMode&&(Ie=new j("chunk",["string","Buffer"],ve)),Ie?(se(he,Ie),process$1.nextTick(ge,Ie),!1):!0}V.prototype.write=function(he,fe,ve){var ge=this._writableState,Ie=!1,ue=!ge.objectMode&&m(he);return ue&&!d.isBuffer(he)&&(he=l(he)),typeof fe=="function"&&(ve=fe,fe=null),ue?fe="buffer":fe||(fe=ge.defaultEncoding),typeof ve!="function"&&(ve=pe),ge.ending?ae(this,ve):(ue||ne(this,ge,he,ve))&&(ge.pendingcb++,Ie=v(this,ge,ue,he,fe,ve)),Ie},V.prototype.cork=function(){this._writableState.corked++},V.prototype.uncork=function(){var he=this._writableState;he.corked&&(he.corked--,!he.writing&&!he.corked&&!he.bufferProcessing&&he.bufferedRequest&&E(this,he))},V.prototype.setDefaultEncoding=function(fe){if(typeof fe=="string"&&(fe=fe.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((fe+"").toLowerCase())>-1))throw new te(fe);return this._writableState.defaultEncoding=fe,this},Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function M(he,fe,ve){return!he.objectMode&&he.decodeStrings!==!1&&typeof fe=="string"&&(fe=d.from(fe,ve)),fe}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function v(he,fe,ve,ge,Ie,ue){if(!ve){var ce=M(fe,ge,Ie);ge!==ce&&(ve=!0,Ie="buffer",ge=ce)}var Te=fe.objectMode?1:ge.length;fe.length+=Te;var ke=fe.length<fe.highWaterMark;if(ke||(fe.needDrain=!0),fe.writing||fe.corked){var He=fe.lastBufferedRequest;fe.lastBufferedRequest={chunk:ge,encoding:Ie,isBuf:ve,callback:ue,next:null},He?He.next=fe.lastBufferedRequest:fe.bufferedRequest=fe.lastBufferedRequest,fe.bufferedRequestCount+=1}else S(he,fe,!1,Te,ge,Ie,ue);return ke}function S(he,fe,ve,ge,Ie,ue,ce){fe.writelen=ge,fe.writecb=ce,fe.writing=!0,fe.sync=!0,fe.destroyed?fe.onwrite(new J("write")):ve?he._writev(Ie,fe.onwrite):he._write(Ie,ue,fe.onwrite),fe.sync=!1}function y(he,fe,ve,ge,Ie){--fe.pendingcb,ve?(process$1.nextTick(Ie,ge),process$1.nextTick(Y,he,fe),he._writableState.errorEmitted=!0,se(he,ge)):(Ie(ge),he._writableState.errorEmitted=!0,se(he,ge),Y(he,fe))}function w(he){he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0}function P(he,fe){var ve=he._writableState,ge=ve.sync,Ie=ve.writecb;if(typeof Ie!="function")throw new U;if(w(ve),fe)y(he,ve,ge,fe,Ie);else{var ue=A(ve)||he.destroyed;!ue&&!ve.corked&&!ve.bufferProcessing&&ve.bufferedRequest&&E(he,ve),ge?process$1.nextTick(L,he,ve,ue,Ie):L(he,ve,ue,Ie)}}function L(he,fe,ve,ge){ve||N(he,fe),fe.pendingcb--,ge(),Y(he,fe)}function N(he,fe){fe.length===0&&fe.needDrain&&(fe.needDrain=!1,he.emit("drain"))}function E(he,fe){fe.bufferProcessing=!0;var ve=fe.bufferedRequest;if(he._writev&&ve&&ve.next){var ge=fe.bufferedRequestCount,Ie=new Array(ge),ue=fe.corkedRequestsFree;ue.entry=ve;for(var ce=0,Te=!0;ve;)Ie[ce]=ve,ve.isBuf||(Te=!1),ve=ve.next,ce+=1;Ie.allBuffers=Te,S(he,fe,!0,fe.length,Ie,"",ue.finish),fe.pendingcb++,fe.lastBufferedRequest=null,ue.next?(fe.corkedRequestsFree=ue.next,ue.next=null):fe.corkedRequestsFree=new t(fe),fe.bufferedRequestCount=0}else{for(;ve;){var ke=ve.chunk,He=ve.encoding,Qe=ve.callback,it=fe.objectMode?1:ke.length;if(S(he,fe,!1,it,ke,He,Qe),ve=ve.next,fe.bufferedRequestCount--,fe.writing)break}ve===null&&(fe.lastBufferedRequest=null)}fe.bufferedRequest=ve,fe.bufferProcessing=!1}V.prototype._write=function(he,fe,ve){ve(new F("_write()"))},V.prototype._writev=null,V.prototype.end=function(he,fe,ve){var ge=this._writableState;return typeof he=="function"?(ve=he,he=null,fe=null):typeof fe=="function"&&(ve=fe,fe=null),he!=null&&this.write(he,fe),ge.corked&&(ge.corked=1,this.uncork()),ge.ending||le(this,ge,ve),this},Object.defineProperty(V.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function A(he){return he.ending&&he.length===0&&he.bufferedRequest===null&&!he.finished&&!he.writing}function D(he,fe){he._final(function(ve){fe.pendingcb--,ve&&se(he,ve),fe.prefinished=!0,he.emit("prefinish"),Y(he,fe)})}function H(he,fe){!fe.prefinished&&!fe.finalCalled&&(typeof he._final=="function"&&!fe.destroyed?(fe.pendingcb++,fe.finalCalled=!0,process$1.nextTick(D,he,fe)):(fe.prefinished=!0,he.emit("prefinish")))}function Y(he,fe){var ve=A(fe);if(ve&&(H(he,fe),fe.pendingcb===0&&(fe.finished=!0,he.emit("finish"),fe.autoDestroy))){var ge=he._readableState;(!ge||ge.autoDestroy&&ge.endEmitted)&&he.destroy()}return ve}function le(he,fe,ve){fe.ending=!0,Y(he,fe),ve&&(fe.finished?process$1.nextTick(ve):he.once("finish",ve)),fe.ended=!0,he.writable=!1}function _e(he,fe,ve){var ge=he.entry;for(he.entry=null;ge;){var Ie=ge.callback;fe.pendingcb--,Ie(ve),ge=ge.next}fe.corkedRequestsFree.next=he}return Object.defineProperty(V.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(fe){this._writableState&&(this._writableState.destroyed=fe)}}),V.prototype.destroy=I.destroy,V.prototype._undestroy=I.undestroy,V.prototype._destroy=function(he,fe){fe(he)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var t=Object.keys||function(O){var T=[];for(var C in O)T.push(C);return T};_stream_duplex=l;var e=require_stream_readable(),a=require_stream_writable();inherits_browserExports$2(l,e);for(var u=t(a.prototype),d=0;d<u.length;d++){var c=u[d];l.prototype[c]||(l.prototype[c]=a.prototype[c])}function l(O){if(!(this instanceof l))return new l(O);e.call(this,O),a.call(this,O),this.allowHalfOpen=!0,O&&(O.readable===!1&&(this.readable=!1),O.writable===!1&&(this.writable=!1),O.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",m)))}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function m(){this._writableState.ended||process$1.nextTick(I,this)}function I(O){O.end()}return Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(T){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=T,this._writableState.destroyed=T)}}),_stream_duplex}var string_decoder={},Buffer$L=safeBufferExports$1.Buffer,isEncoding=Buffer$L.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _normalizeEncoding(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function normalizeEncoding(t){var e=_normalizeEncoding(t);if(typeof e!="string"&&(Buffer$L.isEncoding===isEncoding||!isEncoding(t)))throw new Error("Unknown encoding: "+t);return e||t}string_decoder.StringDecoder=StringDecoder$1;function StringDecoder$1(t){this.encoding=normalizeEncoding(t);var e;switch(this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,e=4;break;case"utf8":this.fillLast=utf8FillLast,e=4;break;case"base64":this.text=base64Text,this.end=base64End,e=3;break;default:this.write=simpleWrite,this.end=simpleEnd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer$L.allocUnsafe(e)}StringDecoder$1.prototype.write=function(t){if(t.length===0)return"";var e,a;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";a=this.lastNeed,this.lastNeed=0}else a=0;return a<t.length?e?e+this.text(t,a):this.text(t,a):e||""},StringDecoder$1.prototype.end=utf8End,StringDecoder$1.prototype.text=utf8Text,StringDecoder$1.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function utf8CheckByte(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function utf8CheckIncomplete(t,e,a){var u=e.length-1;if(u<a)return 0;var d=utf8CheckByte(e[u]);return d>=0?(d>0&&(t.lastNeed=d-1),d):--u<a||d===-2?0:(d=utf8CheckByte(e[u]),d>=0?(d>0&&(t.lastNeed=d-2),d):--u<a||d===-2?0:(d=utf8CheckByte(e[u]),d>=0?(d>0&&(d===2?d=0:t.lastNeed=d-3),d):0))}function utf8CheckExtraBytes(t,e,a){if((e[0]&192)!==128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"�"}}function utf8FillLast(t){var e=this.lastTotal-this.lastNeed,a=utf8CheckExtraBytes(this,t);if(a!==void 0)return a;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function utf8Text(t,e){var a=utf8CheckIncomplete(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=a;var u=t.length-(a-this.lastNeed);return t.copy(this.lastChar,0,u),t.toString("utf8",e,u)}function utf8End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function utf16Text(t,e){if((t.length-e)%2===0){var a=t.toString("utf16le",e);if(a){var u=a.charCodeAt(a.length-1);if(u>=55296&&u<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],a.slice(0,-1)}return a}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function utf16End(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,a)}return e}function base64Text(t,e){var a=(t.length-e)%3;return a===0?t.toString("base64",e):(this.lastNeed=3-a,this.lastTotal=3,a===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-a))}function base64End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}var ERR_STREAM_PREMATURE_CLOSE=errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;function once$1(t){var e=!1;return function(){if(!e){e=!0;for(var a=arguments.length,u=new Array(a),d=0;d<a;d++)u[d]=arguments[d];t.apply(this,u)}}}function noop$1(){}function isRequest$1(t){return t.setHeader&&typeof t.abort=="function"}function eos$1(t,e,a){if(typeof e=="function")return eos$1(t,null,e);e||(e={}),a=once$1(a||noop$1);var u=e.readable||e.readable!==!1&&t.readable,d=e.writable||e.writable!==!1&&t.writable,c=function(){t.writable||m()},l=t._writableState&&t._writableState.finished,m=function(){d=!1,l=!0,u||a.call(t)},I=t._readableState&&t._readableState.endEmitted,O=function(){u=!1,I=!0,d||a.call(t)},T=function(U){a.call(t,U)},C=function(){var U;if(u&&!I)return(!t._readableState||!t._readableState.ended)&&(U=new ERR_STREAM_PREMATURE_CLOSE),a.call(t,U);if(d&&!l)return(!t._writableState||!t._writableState.ended)&&(U=new ERR_STREAM_PREMATURE_CLOSE),a.call(t,U)},j=function(){t.req.on("finish",m)};return isRequest$1(t)?(t.on("complete",m),t.on("abort",C),t.req?j():t.on("request",j)):d&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",O),t.on("finish",m),e.error!==!1&&t.on("error",T),t.on("close",C),function(){t.removeListener("complete",m),t.removeListener("abort",C),t.removeListener("request",j),t.req&&t.req.removeListener("finish",m),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",m),t.removeListener("end",O),t.removeListener("error",T),t.removeListener("close",C)}}var endOfStream=eos$1,async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var t;function e(te,se,pe){return se=a(se),se in te?Object.defineProperty(te,se,{value:pe,enumerable:!0,configurable:!0,writable:!0}):te[se]=pe,te}function a(te){var se=u(te,"string");return typeof se=="symbol"?se:String(se)}function u(te,se){if(typeof te!="object"||te===null)return te;var pe=te[Symbol.toPrimitive];if(pe!==void 0){var me=pe.call(te,se||"default");if(typeof me!="object")return me;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(te)}var d=endOfStream,c=Symbol("lastResolve"),l=Symbol("lastReject"),m=Symbol("error"),I=Symbol("ended"),O=Symbol("lastPromise"),T=Symbol("handlePromise"),C=Symbol("stream");function j(te,se){return{value:te,done:se}}function F(te){var se=te[c];if(se!==null){var pe=te[C].read();pe!==null&&(te[O]=null,te[c]=null,te[l]=null,se(j(pe,!1)))}}function U(te){process$1.nextTick(F,te)}function Z(te,se){return function(pe,me){te.then(function(){if(se[I]){pe(j(void 0,!0));return}se[T](pe,me)},me)}}var J=Object.getPrototypeOf(function(){}),X=Object.setPrototypeOf((t={get stream(){return this[C]},next:function(){var se=this,pe=this[m];if(pe!==null)return Promise.reject(pe);if(this[I])return Promise.resolve(j(void 0,!0));if(this[C].destroyed)return new Promise(function(ae,ne){process$1.nextTick(function(){se[m]?ne(se[m]):ae(j(void 0,!0))})});var me=this[O],Ee;if(me)Ee=new Promise(Z(me,this));else{var V=this[C].read();if(V!==null)return Promise.resolve(j(V,!1));Ee=new Promise(this[T])}return this[O]=Ee,Ee}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var se=this;return new Promise(function(pe,me){se[C].destroy(null,function(Ee){if(Ee){me(Ee);return}pe(j(void 0,!0))})})}),t),J),Q=function(se){var pe,me=Object.create(X,(pe={},e(pe,C,{value:se,writable:!0}),e(pe,c,{value:null,writable:!0}),e(pe,l,{value:null,writable:!0}),e(pe,m,{value:null,writable:!0}),e(pe,I,{value:se._readableState.endEmitted,writable:!0}),e(pe,T,{value:function(V,ae){var ne=me[C].read();ne?(me[O]=null,me[c]=null,me[l]=null,V(j(ne,!1))):(me[c]=V,me[l]=ae)},writable:!0}),pe));return me[O]=null,d(se,function(Ee){if(Ee&&Ee.code!=="ERR_STREAM_PREMATURE_CLOSE"){var V=me[l];V!==null&&(me[O]=null,me[c]=null,me[l]=null,V(Ee)),me[m]=Ee;return}var ae=me[c];ae!==null&&(me[O]=null,me[c]=null,me[l]=null,ae(j(void 0,!0))),me[I]=!0}),se.on("readable",U.bind(null,me)),me};return async_iterator=Q,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1,_stream_readable=ae;var t;ae.ReadableState=V,eventsExports.EventEmitter;var e=function(ce,Te){return ce.listeners(Te).length},a=streamBrowser,u=require$$1$4.Buffer,d=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(ue){return u.from(ue)}function l(ue){return u.isBuffer(ue)||ue instanceof d}var m=util$2,I;m&&m.debuglog?I=m.debuglog("stream"):I=function(){};var O=requireBuffer_list(),T=destroy_1,C=state,j=C.getHighWaterMark,F=errorsBrowser.codes,U=F.ERR_INVALID_ARG_TYPE,Z=F.ERR_STREAM_PUSH_AFTER_EOF,J=F.ERR_METHOD_NOT_IMPLEMENTED,X=F.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Q,te,se;inherits_browserExports$2(ae,a);var pe=T.errorOrDestroy,me=["error","close","destroy","pause","resume"];function Ee(ue,ce,Te){if(typeof ue.prependListener=="function")return ue.prependListener(ce,Te);!ue._events||!ue._events[ce]?ue.on(ce,Te):Array.isArray(ue._events[ce])?ue._events[ce].unshift(Te):ue._events[ce]=[Te,ue._events[ce]]}function V(ue,ce,Te){t=t||require_stream_duplex(),ue=ue||{},typeof Te!="boolean"&&(Te=ce instanceof t),this.objectMode=!!ue.objectMode,Te&&(this.objectMode=this.objectMode||!!ue.readableObjectMode),this.highWaterMark=j(this,ue,"readableHighWaterMark",Te),this.buffer=new O,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ue.emitClose!==!1,this.autoDestroy=!!ue.autoDestroy,this.destroyed=!1,this.defaultEncoding=ue.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ue.encoding&&(Q||(Q=string_decoder.StringDecoder),this.decoder=new Q(ue.encoding),this.encoding=ue.encoding)}function ae(ue){if(t=t||require_stream_duplex(),!(this instanceof ae))return new ae(ue);var ce=this instanceof t;this._readableState=new V(ue,this,ce),this.readable=!0,ue&&(typeof ue.read=="function"&&(this._read=ue.read),typeof ue.destroy=="function"&&(this._destroy=ue.destroy)),a.call(this)}Object.defineProperty(ae.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ce){this._readableState&&(this._readableState.destroyed=ce)}}),ae.prototype.destroy=T.destroy,ae.prototype._undestroy=T.undestroy,ae.prototype._destroy=function(ue,ce){ce(ue)},ae.prototype.push=function(ue,ce){var Te=this._readableState,ke;return Te.objectMode?ke=!0:typeof ue=="string"&&(ce=ce||Te.defaultEncoding,ce!==Te.encoding&&(ue=u.from(ue,ce),ce=""),ke=!0),ne(this,ue,ce,!1,ke)},ae.prototype.unshift=function(ue){return ne(this,ue,null,!0,!1)};function ne(ue,ce,Te,ke,He){I("readableAddChunk",ce);var Qe=ue._readableState;if(ce===null)Qe.reading=!1,P(ue,Qe);else{var it;if(He||(it=v(Qe,ce)),it)pe(ue,it);else if(Qe.objectMode||ce&&ce.length>0)if(typeof ce!="string"&&!Qe.objectMode&&Object.getPrototypeOf(ce)!==u.prototype&&(ce=c(ce)),ke)Qe.endEmitted?pe(ue,new X):M(ue,Qe,ce,!0);else if(Qe.ended)pe(ue,new Z);else{if(Qe.destroyed)return!1;Qe.reading=!1,Qe.decoder&&!Te?(ce=Qe.decoder.write(ce),Qe.objectMode||ce.length!==0?M(ue,Qe,ce,!1):E(ue,Qe)):M(ue,Qe,ce,!1)}else ke||(Qe.reading=!1,E(ue,Qe))}return!Qe.ended&&(Qe.length<Qe.highWaterMark||Qe.length===0)}function M(ue,ce,Te,ke){ce.flowing&&ce.length===0&&!ce.sync?(ce.awaitDrain=0,ue.emit("data",Te)):(ce.length+=ce.objectMode?1:Te.length,ke?ce.buffer.unshift(Te):ce.buffer.push(Te),ce.needReadable&&L(ue)),E(ue,ce)}function v(ue,ce){var Te;return!l(ce)&&typeof ce!="string"&&ce!==void 0&&!ue.objectMode&&(Te=new U("chunk",["string","Buffer","Uint8Array"],ce)),Te}ae.prototype.isPaused=function(){return this._readableState.flowing===!1},ae.prototype.setEncoding=function(ue){Q||(Q=string_decoder.StringDecoder);var ce=new Q(ue);this._readableState.decoder=ce,this._readableState.encoding=this._readableState.decoder.encoding;for(var Te=this._readableState.buffer.head,ke="";Te!==null;)ke+=ce.write(Te.data),Te=Te.next;return this._readableState.buffer.clear(),ke!==""&&this._readableState.buffer.push(ke),this._readableState.length=ke.length,this};var S=1073741824;function y(ue){return ue>=S?ue=S:(ue--,ue|=ue>>>1,ue|=ue>>>2,ue|=ue>>>4,ue|=ue>>>8,ue|=ue>>>16,ue++),ue}function w(ue,ce){return ue<=0||ce.length===0&&ce.ended?0:ce.objectMode?1:ue!==ue?ce.flowing&&ce.length?ce.buffer.head.data.length:ce.length:(ue>ce.highWaterMark&&(ce.highWaterMark=y(ue)),ue<=ce.length?ue:ce.ended?ce.length:(ce.needReadable=!0,0))}ae.prototype.read=function(ue){I("read",ue),ue=parseInt(ue,10);var ce=this._readableState,Te=ue;if(ue!==0&&(ce.emittedReadable=!1),ue===0&&ce.needReadable&&((ce.highWaterMark!==0?ce.length>=ce.highWaterMark:ce.length>0)||ce.ended))return I("read: emitReadable",ce.length,ce.ended),ce.length===0&&ce.ended?ve(this):L(this),null;if(ue=w(ue,ce),ue===0&&ce.ended)return ce.length===0&&ve(this),null;var ke=ce.needReadable;I("need readable",ke),(ce.length===0||ce.length-ue<ce.highWaterMark)&&(ke=!0,I("length less than watermark",ke)),ce.ended||ce.reading?(ke=!1,I("reading or ended",ke)):ke&&(I("do read"),ce.reading=!0,ce.sync=!0,ce.length===0&&(ce.needReadable=!0),this._read(ce.highWaterMark),ce.sync=!1,ce.reading||(ue=w(Te,ce)));var He;return ue>0?He=fe(ue,ce):He=null,He===null?(ce.needReadable=ce.length<=ce.highWaterMark,ue=0):(ce.length-=ue,ce.awaitDrain=0),ce.length===0&&(ce.ended||(ce.needReadable=!0),Te!==ue&&ce.ended&&ve(this)),He!==null&&this.emit("data",He),He};function P(ue,ce){if(I("onEofChunk"),!ce.ended){if(ce.decoder){var Te=ce.decoder.end();Te&&Te.length&&(ce.buffer.push(Te),ce.length+=ce.objectMode?1:Te.length)}ce.ended=!0,ce.sync?L(ue):(ce.needReadable=!1,ce.emittedReadable||(ce.emittedReadable=!0,N(ue)))}}function L(ue){var ce=ue._readableState;I("emitReadable",ce.needReadable,ce.emittedReadable),ce.needReadable=!1,ce.emittedReadable||(I("emitReadable",ce.flowing),ce.emittedReadable=!0,process$1.nextTick(N,ue))}function N(ue){var ce=ue._readableState;I("emitReadable_",ce.destroyed,ce.length,ce.ended),!ce.destroyed&&(ce.length||ce.ended)&&(ue.emit("readable"),ce.emittedReadable=!1),ce.needReadable=!ce.flowing&&!ce.ended&&ce.length<=ce.highWaterMark,he(ue)}function E(ue,ce){ce.readingMore||(ce.readingMore=!0,process$1.nextTick(A,ue,ce))}function A(ue,ce){for(;!ce.reading&&!ce.ended&&(ce.length<ce.highWaterMark||ce.flowing&&ce.length===0);){var Te=ce.length;if(I("maybeReadMore read 0"),ue.read(0),Te===ce.length)break}ce.readingMore=!1}ae.prototype._read=function(ue){pe(this,new J("_read()"))},ae.prototype.pipe=function(ue,ce){var Te=this,ke=this._readableState;switch(ke.pipesCount){case 0:ke.pipes=ue;break;case 1:ke.pipes=[ke.pipes,ue];break;default:ke.pipes.push(ue);break}ke.pipesCount+=1,I("pipe count=%d opts=%j",ke.pipesCount,ce);var He=(!ce||ce.end!==!1)&&ue!==process$1.stdout&&ue!==process$1.stderr,Qe=He?rt:Ze;ke.endEmitted?process$1.nextTick(Qe):Te.once("end",Qe),ue.on("unpipe",it);function it(ze,Ge){I("onunpipe"),ze===Te&&Ge&&Ge.hasUnpiped===!1&&(Ge.hasUnpiped=!0,et())}function rt(){I("onend"),ue.end()}var Fe=D(Te);ue.on("drain",Fe);var wt=!1;function et(){I("cleanup"),ue.removeListener("close",$e),ue.removeListener("finish",Me),ue.removeListener("drain",Fe),ue.removeListener("error",gt),ue.removeListener("unpipe",it),Te.removeListener("end",rt),Te.removeListener("end",Ze),Te.removeListener("data",At),wt=!0,ke.awaitDrain&&(!ue._writableState||ue._writableState.needDrain)&&Fe()}Te.on("data",At);function At(ze){I("ondata");var Ge=ue.write(ze);I("dest.write",Ge),Ge===!1&&((ke.pipesCount===1&&ke.pipes===ue||ke.pipesCount>1&&Ie(ke.pipes,ue)!==-1)&&!wt&&(I("false write response, pause",ke.awaitDrain),ke.awaitDrain++),Te.pause())}function gt(ze){I("onerror",ze),Ze(),ue.removeListener("error",gt),e(ue,"error")===0&&pe(ue,ze)}Ee(ue,"error",gt);function $e(){ue.removeListener("finish",Me),Ze()}ue.once("close",$e);function Me(){I("onfinish"),ue.removeListener("close",$e),Ze()}ue.once("finish",Me);function Ze(){I("unpipe"),Te.unpipe(ue)}return ue.emit("pipe",Te),ke.flowing||(I("pipe resume"),Te.resume()),ue};function D(ue){return function(){var Te=ue._readableState;I("pipeOnDrain",Te.awaitDrain),Te.awaitDrain&&Te.awaitDrain--,Te.awaitDrain===0&&e(ue,"data")&&(Te.flowing=!0,he(ue))}}ae.prototype.unpipe=function(ue){var ce=this._readableState,Te={hasUnpiped:!1};if(ce.pipesCount===0)return this;if(ce.pipesCount===1)return ue&&ue!==ce.pipes?this:(ue||(ue=ce.pipes),ce.pipes=null,ce.pipesCount=0,ce.flowing=!1,ue&&ue.emit("unpipe",this,Te),this);if(!ue){var ke=ce.pipes,He=ce.pipesCount;ce.pipes=null,ce.pipesCount=0,ce.flowing=!1;for(var Qe=0;Qe<He;Qe++)ke[Qe].emit("unpipe",this,{hasUnpiped:!1});return this}var it=Ie(ce.pipes,ue);return it===-1?this:(ce.pipes.splice(it,1),ce.pipesCount-=1,ce.pipesCount===1&&(ce.pipes=ce.pipes[0]),ue.emit("unpipe",this,Te),this)},ae.prototype.on=function(ue,ce){var Te=a.prototype.on.call(this,ue,ce),ke=this._readableState;return ue==="data"?(ke.readableListening=this.listenerCount("readable")>0,ke.flowing!==!1&&this.resume()):ue==="readable"&&!ke.endEmitted&&!ke.readableListening&&(ke.readableListening=ke.needReadable=!0,ke.flowing=!1,ke.emittedReadable=!1,I("on readable",ke.length,ke.reading),ke.length?L(this):ke.reading||process$1.nextTick(Y,this)),Te},ae.prototype.addListener=ae.prototype.on,ae.prototype.removeListener=function(ue,ce){var Te=a.prototype.removeListener.call(this,ue,ce);return ue==="readable"&&process$1.nextTick(H,this),Te},ae.prototype.removeAllListeners=function(ue){var ce=a.prototype.removeAllListeners.apply(this,arguments);return(ue==="readable"||ue===void 0)&&process$1.nextTick(H,this),ce};function H(ue){var ce=ue._readableState;ce.readableListening=ue.listenerCount("readable")>0,ce.resumeScheduled&&!ce.paused?ce.flowing=!0:ue.listenerCount("data")>0&&ue.resume()}function Y(ue){I("readable nexttick read 0"),ue.read(0)}ae.prototype.resume=function(){var ue=this._readableState;return ue.flowing||(I("resume"),ue.flowing=!ue.readableListening,le(this,ue)),ue.paused=!1,this};function le(ue,ce){ce.resumeScheduled||(ce.resumeScheduled=!0,process$1.nextTick(_e,ue,ce))}function _e(ue,ce){I("resume",ce.reading),ce.reading||ue.read(0),ce.resumeScheduled=!1,ue.emit("resume"),he(ue),ce.flowing&&!ce.reading&&ue.read(0)}ae.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function he(ue){var ce=ue._readableState;for(I("flow",ce.flowing);ce.flowing&&ue.read()!==null;);}ae.prototype.wrap=function(ue){var ce=this,Te=this._readableState,ke=!1;ue.on("end",function(){if(I("wrapped end"),Te.decoder&&!Te.ended){var it=Te.decoder.end();it&&it.length&&ce.push(it)}ce.push(null)}),ue.on("data",function(it){if(I("wrapped data"),Te.decoder&&(it=Te.decoder.write(it)),!(Te.objectMode&&it==null)&&!(!Te.objectMode&&(!it||!it.length))){var rt=ce.push(it);rt||(ke=!0,ue.pause())}});for(var He in ue)this[He]===void 0&&typeof ue[He]=="function"&&(this[He]=function(rt){return function(){return ue[rt].apply(ue,arguments)}}(He));for(var Qe=0;Qe<me.length;Qe++)ue.on(me[Qe],this.emit.bind(this,me[Qe]));return this._read=function(it){I("wrapped _read",it),ke&&(ke=!1,ue.resume())},this},typeof Symbol=="function"&&(ae.prototype[Symbol.asyncIterator]=function(){return te===void 0&&(te=requireAsync_iterator()),te(this)}),Object.defineProperty(ae.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ae.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ae.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ce){this._readableState&&(this._readableState.flowing=ce)}}),ae._fromList=fe,Object.defineProperty(ae.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function fe(ue,ce){if(ce.length===0)return null;var Te;return ce.objectMode?Te=ce.buffer.shift():!ue||ue>=ce.length?(ce.decoder?Te=ce.buffer.join(""):ce.buffer.length===1?Te=ce.buffer.first():Te=ce.buffer.concat(ce.length),ce.buffer.clear()):Te=ce.buffer.consume(ue,ce.decoder),Te}function ve(ue){var ce=ue._readableState;I("endReadable",ce.endEmitted),ce.endEmitted||(ce.ended=!0,process$1.nextTick(ge,ce,ue))}function ge(ue,ce){if(I("endReadableNT",ue.endEmitted,ue.length),!ue.endEmitted&&ue.length===0&&(ue.endEmitted=!0,ce.readable=!1,ce.emit("end"),ue.autoDestroy)){var Te=ce._writableState;(!Te||Te.autoDestroy&&Te.finished)&&ce.destroy()}}typeof Symbol=="function"&&(ae.from=function(ue,ce){return se===void 0&&(se=requireFromBrowser()),se(ae,ue,ce)});function Ie(ue,ce){for(var Te=0,ke=ue.length;Te<ke;Te++)if(ue[Te]===ce)return Te;return-1}return _stream_readable}var _stream_transform=Transform$7,_require$codes$1=errorsBrowser.codes,ERR_METHOD_NOT_IMPLEMENTED=_require$codes$1.ERR_METHOD_NOT_IMPLEMENTED,ERR_MULTIPLE_CALLBACK=_require$codes$1.ERR_MULTIPLE_CALLBACK,ERR_TRANSFORM_ALREADY_TRANSFORMING=_require$codes$1.ERR_TRANSFORM_ALREADY_TRANSFORMING,ERR_TRANSFORM_WITH_LENGTH_0=_require$codes$1.ERR_TRANSFORM_WITH_LENGTH_0,Duplex=require_stream_duplex();inherits_browserExports$2(Transform$7,Duplex);function afterTransform(t,e){var a=this._transformState;a.transforming=!1;var u=a.writecb;if(u===null)return this.emit("error",new ERR_MULTIPLE_CALLBACK);a.writechunk=null,a.writecb=null,e!=null&&this.push(e),u(t);var d=this._readableState;d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}function Transform$7(t){if(!(this instanceof Transform$7))return new Transform$7(t);Duplex.call(this,t),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",prefinish)}function prefinish(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,a){done(t,e,a)}):done(this,null,null)}Transform$7.prototype.push=function(t,e){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,t,e)},Transform$7.prototype._transform=function(t,e,a){a(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"))},Transform$7.prototype._write=function(t,e,a){var u=this._transformState;if(u.writecb=a,u.writechunk=t,u.writeencoding=e,!u.transforming){var d=this._readableState;(u.needTransform||d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}},Transform$7.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},Transform$7.prototype._destroy=function(t,e){Duplex.prototype._destroy.call(this,t,function(a){e(a)})};function done(t,e,a){if(e)return t.emit("error",e);if(a!=null&&t.push(a),t._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0;if(t._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING;return t.push(null)}var _stream_passthrough=PassThrough,Transform$6=_stream_transform;inherits_browserExports$2(PassThrough,Transform$6);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);Transform$6.call(this,t)}PassThrough.prototype._transform=function(t,e,a){a(null,t)};var eos;function once(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var _require$codes=errorsBrowser.codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop(t){if(t)throw t}function isRequest(t){return t.setHeader&&typeof t.abort=="function"}function destroyer(t,e,a,u){u=once(u);var d=!1;t.on("close",function(){d=!0}),eos===void 0&&(eos=endOfStream),eos(t,{readable:e,writable:a},function(l){if(l)return u(l);d=!0,u()});var c=!1;return function(l){if(!d&&!c){if(c=!0,isRequest(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();u(l||new ERR_STREAM_DESTROYED("pipe"))}}}function call(t){t()}function pipe(t,e){return t.pipe(e)}function popCallback(t){return!t.length||typeof t[t.length-1]!="function"?noop:t.pop()}function pipeline(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];var u=popCallback(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new ERR_MISSING_ARGS("streams");var d,c=e.map(function(l,m){var I=m<e.length-1,O=m>0;return destroyer(l,I,O,function(T){d||(d=T),T&&c.forEach(call),!I&&(c.forEach(call),u(d))})});return e.reduce(pipe)}var pipeline_1=pipeline;(function(t,e){e=t.exports=require_stream_readable(),e.Stream=e,e.Readable=e,e.Writable=require_stream_writable(),e.Duplex=require_stream_duplex(),e.Transform=_stream_transform,e.PassThrough=_stream_passthrough,e.finished=endOfStream,e.pipeline=pipeline_1})(readableBrowser,readableBrowser.exports);var readableBrowserExports=readableBrowser.exports,Buffer$K=safeBufferExports$1.Buffer,Transform$5=readableBrowserExports.Transform,inherits$z=inherits_browserExports$2;function throwIfNotStringOrBuffer(t,e){if(!Buffer$K.isBuffer(t)&&typeof t!="string")throw new TypeError(e+" must be a string or a buffer")}function HashBase$2(t){Transform$5.call(this),this._block=Buffer$K.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits$z(HashBase$2,Transform$5),HashBase$2.prototype._transform=function(t,e,a){var u=null;try{this.update(t,e)}catch(d){u=d}a(u)},HashBase$2.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(a){e=a}t(e)},HashBase$2.prototype.update=function(t,e){if(throwIfNotStringOrBuffer(t,"Data"),this._finalized)throw new Error("Digest already called");Buffer$K.isBuffer(t)||(t=Buffer$K.from(t,e));for(var a=this._block,u=0;this._blockOffset+t.length-u>=this._blockSize;){for(var d=this._blockOffset;d<this._blockSize;)a[d++]=t[u++];this._update(),this._blockOffset=0}for(;u<t.length;)a[this._blockOffset++]=t[u++];for(var c=0,l=t.length*8;l>0;++c)this._length[c]+=l,l=this._length[c]/4294967296|0,l>0&&(this._length[c]-=4294967296*l);return this},HashBase$2.prototype._update=function(){throw new Error("_update is not implemented")},HashBase$2.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();t!==void 0&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var a=0;a<4;++a)this._length[a]=0;return e},HashBase$2.prototype._digest=function(){throw new Error("_digest is not implemented")};var hashBase=HashBase$2,inherits$y=inherits_browserExports$2,HashBase$1=hashBase,Buffer$J=safeBufferExports$1.Buffer,ARRAY16$1=new Array(16);function MD5$3(){HashBase$1.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}inherits$y(MD5$3,HashBase$1),MD5$3.prototype._update=function(){for(var t=ARRAY16$1,e=0;e<16;++e)t[e]=this._block.readInt32LE(e*4);var a=this._a,u=this._b,d=this._c,c=this._d;a=fnF(a,u,d,c,t[0],3614090360,7),c=fnF(c,a,u,d,t[1],3905402710,12),d=fnF(d,c,a,u,t[2],606105819,17),u=fnF(u,d,c,a,t[3],3250441966,22),a=fnF(a,u,d,c,t[4],4118548399,7),c=fnF(c,a,u,d,t[5],1200080426,12),d=fnF(d,c,a,u,t[6],2821735955,17),u=fnF(u,d,c,a,t[7],4249261313,22),a=fnF(a,u,d,c,t[8],1770035416,7),c=fnF(c,a,u,d,t[9],2336552879,12),d=fnF(d,c,a,u,t[10],4294925233,17),u=fnF(u,d,c,a,t[11],2304563134,22),a=fnF(a,u,d,c,t[12],1804603682,7),c=fnF(c,a,u,d,t[13],4254626195,12),d=fnF(d,c,a,u,t[14],2792965006,17),u=fnF(u,d,c,a,t[15],1236535329,22),a=fnG(a,u,d,c,t[1],4129170786,5),c=fnG(c,a,u,d,t[6],3225465664,9),d=fnG(d,c,a,u,t[11],643717713,14),u=fnG(u,d,c,a,t[0],3921069994,20),a=fnG(a,u,d,c,t[5],3593408605,5),c=fnG(c,a,u,d,t[10],38016083,9),d=fnG(d,c,a,u,t[15],3634488961,14),u=fnG(u,d,c,a,t[4],3889429448,20),a=fnG(a,u,d,c,t[9],568446438,5),c=fnG(c,a,u,d,t[14],3275163606,9),d=fnG(d,c,a,u,t[3],4107603335,14),u=fnG(u,d,c,a,t[8],1163531501,20),a=fnG(a,u,d,c,t[13],2850285829,5),c=fnG(c,a,u,d,t[2],4243563512,9),d=fnG(d,c,a,u,t[7],1735328473,14),u=fnG(u,d,c,a,t[12],2368359562,20),a=fnH(a,u,d,c,t[5],4294588738,4),c=fnH(c,a,u,d,t[8],2272392833,11),d=fnH(d,c,a,u,t[11],1839030562,16),u=fnH(u,d,c,a,t[14],4259657740,23),a=fnH(a,u,d,c,t[1],2763975236,4),c=fnH(c,a,u,d,t[4],1272893353,11),d=fnH(d,c,a,u,t[7],4139469664,16),u=fnH(u,d,c,a,t[10],3200236656,23),a=fnH(a,u,d,c,t[13],681279174,4),c=fnH(c,a,u,d,t[0],3936430074,11),d=fnH(d,c,a,u,t[3],3572445317,16),u=fnH(u,d,c,a,t[6],76029189,23),a=fnH(a,u,d,c,t[9],3654602809,4),c=fnH(c,a,u,d,t[12],3873151461,11),d=fnH(d,c,a,u,t[15],530742520,16),u=fnH(u,d,c,a,t[2],3299628645,23),a=fnI(a,u,d,c,t[0],4096336452,6),c=fnI(c,a,u,d,t[7],1126891415,10),d=fnI(d,c,a,u,t[14],2878612391,15),u=fnI(u,d,c,a,t[5],4237533241,21),a=fnI(a,u,d,c,t[12],1700485571,6),c=fnI(c,a,u,d,t[3],2399980690,10),d=fnI(d,c,a,u,t[10],4293915773,15),u=fnI(u,d,c,a,t[1],2240044497,21),a=fnI(a,u,d,c,t[8],1873313359,6),c=fnI(c,a,u,d,t[15],4264355552,10),d=fnI(d,c,a,u,t[6],2734768916,15),u=fnI(u,d,c,a,t[13],1309151649,21),a=fnI(a,u,d,c,t[4],4149444226,6),c=fnI(c,a,u,d,t[11],3174756917,10),d=fnI(d,c,a,u,t[2],718787259,15),u=fnI(u,d,c,a,t[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+u|0,this._c=this._c+d|0,this._d=this._d+c|0},MD5$3.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=Buffer$J.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t};function rotl$1(t,e){return t<<e|t>>>32-e}function fnF(t,e,a,u,d,c,l){return rotl$1(t+(e&a|~e&u)+d+c|0,l)+e|0}function fnG(t,e,a,u,d,c,l){return rotl$1(t+(e&u|a&~u)+d+c|0,l)+e|0}function fnH(t,e,a,u,d,c,l){return rotl$1(t+(e^a^u)+d+c|0,l)+e|0}function fnI(t,e,a,u,d,c,l){return rotl$1(t+(a^(e|~u))+d+c|0,l)+e|0}var md5_js=MD5$3,Buffer$I=require$$1$4.Buffer,inherits$x=inherits_browserExports$2,HashBase=hashBase,ARRAY16=new Array(16),zl=[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],zr=[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],sl=[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],sr=[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],hl=[0,1518500249,1859775393,2400959708,2840853838],hr=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160$5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}inherits$x(RIPEMD160$5,HashBase),RIPEMD160$5.prototype._update=function(){for(var t=ARRAY16,e=0;e<16;++e)t[e]=this._block.readInt32LE(e*4);for(var a=this._a|0,u=this._b|0,d=this._c|0,c=this._d|0,l=this._e|0,m=this._a|0,I=this._b|0,O=this._c|0,T=this._d|0,C=this._e|0,j=0;j<80;j+=1){var F,U;j<16?(F=fn1(a,u,d,c,l,t[zl[j]],hl[0],sl[j]),U=fn5(m,I,O,T,C,t[zr[j]],hr[0],sr[j])):j<32?(F=fn2(a,u,d,c,l,t[zl[j]],hl[1],sl[j]),U=fn4(m,I,O,T,C,t[zr[j]],hr[1],sr[j])):j<48?(F=fn3(a,u,d,c,l,t[zl[j]],hl[2],sl[j]),U=fn3(m,I,O,T,C,t[zr[j]],hr[2],sr[j])):j<64?(F=fn4(a,u,d,c,l,t[zl[j]],hl[3],sl[j]),U=fn2(m,I,O,T,C,t[zr[j]],hr[3],sr[j])):(F=fn5(a,u,d,c,l,t[zl[j]],hl[4],sl[j]),U=fn1(m,I,O,T,C,t[zr[j]],hr[4],sr[j])),a=l,l=c,c=rotl(d,10),d=u,u=F,m=C,C=T,T=rotl(O,10),O=I,I=U}var Z=this._b+d+T|0;this._b=this._c+c+C|0,this._c=this._d+l+m|0,this._d=this._e+a+I|0,this._e=this._a+u+O|0,this._a=Z},RIPEMD160$5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=Buffer$I.alloc?Buffer$I.alloc(20):new Buffer$I(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t};function rotl(t,e){return t<<e|t>>>32-e}function fn1(t,e,a,u,d,c,l,m){return rotl(t+(e^a^u)+c+l|0,m)+d|0}function fn2(t,e,a,u,d,c,l,m){return rotl(t+(e&a|~e&u)+c+l|0,m)+d|0}function fn3(t,e,a,u,d,c,l,m){return rotl(t+((e|~a)^u)+c+l|0,m)+d|0}function fn4(t,e,a,u,d,c,l,m){return rotl(t+(e&u|a&~u)+c+l|0,m)+d|0}function fn5(t,e,a,u,d,c,l,m){return rotl(t+(e^(a|~u))+c+l|0,m)+d|0}var ripemd160=RIPEMD160$5,sha_js={exports:{}},Buffer$H=safeBufferExports$1.Buffer;function Hash$a(t,e){this._block=Buffer$H.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Hash$a.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Buffer$H.from(t,e));for(var a=this._block,u=this._blockSize,d=t.length,c=this._len,l=0;l<d;){for(var m=c%u,I=Math.min(d-l,u-m),O=0;O<I;O++)a[m+O]=t[l+O];c+=I,l+=I,c%u===0&&this._update(a)}return this._len+=d,this},Hash$a.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=this._len*8;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var u=(a&4294967295)>>>0,d=(a-u)/4294967296;this._block.writeUInt32BE(d,this._blockSize-8),this._block.writeUInt32BE(u,this._blockSize-4)}this._update(this._block);var c=this._hash();return t?c.toString(t):c},Hash$a.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hash$8=Hash$a,inherits$w=inherits_browserExports$2,Hash$9=hash$8,Buffer$G=safeBufferExports$1.Buffer,K$5=[1518500249,1859775393,-1894007588,-899497514],W$5=new Array(80);function Sha(){this.init(),this._w=W$5,Hash$9.call(this,64,56)}inherits$w(Sha,Hash$9),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl5$1(t){return t<<5|t>>>27}function rotl30$1(t){return t<<30|t>>>2}function ft$1(t,e,a,u){return t===0?e&a|~e&u:t===2?e&a|e&u|a&u:e^a^u}Sha.prototype._update=function(t){for(var e=this._w,a=this._a|0,u=this._b|0,d=this._c|0,c=this._d|0,l=this._e|0,m=0;m<16;++m)e[m]=t.readInt32BE(m*4);for(;m<80;++m)e[m]=e[m-3]^e[m-8]^e[m-14]^e[m-16];for(var I=0;I<80;++I){var O=~~(I/20),T=rotl5$1(a)+ft$1(O,u,d,c)+l+e[I]+K$5[O]|0;l=c,c=d,d=rotl30$1(u),u=a,a=T}this._a=a+this._a|0,this._b=u+this._b|0,this._c=d+this._c|0,this._d=c+this._d|0,this._e=l+this._e|0},Sha.prototype._hash=function(){var t=Buffer$G.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var sha$5=Sha,inherits$v=inherits_browserExports$2,Hash$8=hash$8,Buffer$F=safeBufferExports$1.Buffer,K$4=[1518500249,1859775393,-1894007588,-899497514],W$4=new Array(80);function Sha1(){this.init(),this._w=W$4,Hash$8.call(this,64,56)}inherits$v(Sha1,Hash$8),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function rotl1(t){return t<<1|t>>>31}function rotl5(t){return t<<5|t>>>27}function rotl30(t){return t<<30|t>>>2}function ft(t,e,a,u){return t===0?e&a|~e&u:t===2?e&a|e&u|a&u:e^a^u}Sha1.prototype._update=function(t){for(var e=this._w,a=this._a|0,u=this._b|0,d=this._c|0,c=this._d|0,l=this._e|0,m=0;m<16;++m)e[m]=t.readInt32BE(m*4);for(;m<80;++m)e[m]=rotl1(e[m-3]^e[m-8]^e[m-14]^e[m-16]);for(var I=0;I<80;++I){var O=~~(I/20),T=rotl5(a)+ft(O,u,d,c)+l+e[I]+K$4[O]|0;l=c,c=d,d=rotl30(u),u=a,a=T}this._a=a+this._a|0,this._b=u+this._b|0,this._c=d+this._c|0,this._d=c+this._d|0,this._e=l+this._e|0},Sha1.prototype._hash=function(){var t=Buffer$F.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var sha1=Sha1,inherits$u=inherits_browserExports$2,Hash$7=hash$8,Buffer$E=safeBufferExports$1.Buffer,K$3=[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],W$3=new Array(64);function Sha256$1(){this.init(),this._w=W$3,Hash$7.call(this,64,56)}inherits$u(Sha256$1,Hash$7),Sha256$1.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ch(t,e,a){return a^t&(e^a)}function maj$1(t,e,a){return t&e|a&(t|e)}function sigma0$1(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function sigma1$1(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function gamma0(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function gamma1(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Sha256$1.prototype._update=function(t){for(var e=this._w,a=this._a|0,u=this._b|0,d=this._c|0,c=this._d|0,l=this._e|0,m=this._f|0,I=this._g|0,O=this._h|0,T=0;T<16;++T)e[T]=t.readInt32BE(T*4);for(;T<64;++T)e[T]=gamma1(e[T-2])+e[T-7]+gamma0(e[T-15])+e[T-16]|0;for(var C=0;C<64;++C){var j=O+sigma1$1(l)+ch(l,m,I)+K$3[C]+e[C]|0,F=sigma0$1(a)+maj$1(a,u,d)|0;O=I,I=m,m=l,l=c+j|0,c=d,d=u,u=a,a=j+F|0}this._a=a+this._a|0,this._b=u+this._b|0,this._c=d+this._c|0,this._d=c+this._d|0,this._e=l+this._e|0,this._f=m+this._f|0,this._g=I+this._g|0,this._h=O+this._h|0},Sha256$1.prototype._hash=function(){var t=Buffer$E.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var sha256$4=Sha256$1,inherits$t=inherits_browserExports$2,Sha256=sha256$4,Hash$6=hash$8,Buffer$D=safeBufferExports$1.Buffer,W$2=new Array(64);function Sha224(){this.init(),this._w=W$2,Hash$6.call(this,64,56)}inherits$t(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var t=Buffer$D.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var sha224$1=Sha224,inherits$s=inherits_browserExports$2,Hash$5=hash$8,Buffer$C=safeBufferExports$1.Buffer,K$2=[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],W$1=new Array(160);function Sha512(){this.init(),this._w=W$1,Hash$5.call(this,128,112)}inherits$s(Sha512,Hash$5),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ch(t,e,a){return a^t&(e^a)}function maj(t,e,a){return t&e|a&(t|e)}function sigma0(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function sigma1(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Gamma0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Gamma0l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function Gamma1(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Gamma1l(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function getCarry(t,e){return t>>>0<e>>>0?1:0}Sha512.prototype._update=function(t){for(var e=this._w,a=this._ah|0,u=this._bh|0,d=this._ch|0,c=this._dh|0,l=this._eh|0,m=this._fh|0,I=this._gh|0,O=this._hh|0,T=this._al|0,C=this._bl|0,j=this._cl|0,F=this._dl|0,U=this._el|0,Z=this._fl|0,J=this._gl|0,X=this._hl|0,Q=0;Q<32;Q+=2)e[Q]=t.readInt32BE(Q*4),e[Q+1]=t.readInt32BE(Q*4+4);for(;Q<160;Q+=2){var te=e[Q-30],se=e[Q-15*2+1],pe=Gamma0(te,se),me=Gamma0l(se,te);te=e[Q-2*2],se=e[Q-2*2+1];var Ee=Gamma1(te,se),V=Gamma1l(se,te),ae=e[Q-7*2],ne=e[Q-7*2+1],M=e[Q-16*2],v=e[Q-16*2+1],S=me+ne|0,y=pe+ae+getCarry(S,me)|0;S=S+V|0,y=y+Ee+getCarry(S,V)|0,S=S+v|0,y=y+M+getCarry(S,v)|0,e[Q]=y,e[Q+1]=S}for(var w=0;w<160;w+=2){y=e[w],S=e[w+1];var P=maj(a,u,d),L=maj(T,C,j),N=sigma0(a,T),E=sigma0(T,a),A=sigma1(l,U),D=sigma1(U,l),H=K$2[w],Y=K$2[w+1],le=Ch(l,m,I),_e=Ch(U,Z,J),he=X+D|0,fe=O+A+getCarry(he,X)|0;he=he+_e|0,fe=fe+le+getCarry(he,_e)|0,he=he+Y|0,fe=fe+H+getCarry(he,Y)|0,he=he+S|0,fe=fe+y+getCarry(he,S)|0;var ve=E+L|0,ge=N+P+getCarry(ve,E)|0;O=I,X=J,I=m,J=Z,m=l,Z=U,U=F+he|0,l=c+fe+getCarry(U,F)|0,c=d,F=j,d=u,j=C,u=a,C=T,T=he+ve|0,a=fe+ge+getCarry(T,he)|0}this._al=this._al+T|0,this._bl=this._bl+C|0,this._cl=this._cl+j|0,this._dl=this._dl+F|0,this._el=this._el+U|0,this._fl=this._fl+Z|0,this._gl=this._gl+J|0,this._hl=this._hl+X|0,this._ah=this._ah+a+getCarry(this._al,T)|0,this._bh=this._bh+u+getCarry(this._bl,C)|0,this._ch=this._ch+d+getCarry(this._cl,j)|0,this._dh=this._dh+c+getCarry(this._dl,F)|0,this._eh=this._eh+l+getCarry(this._el,U)|0,this._fh=this._fh+m+getCarry(this._fl,Z)|0,this._gh=this._gh+I+getCarry(this._gl,J)|0,this._hh=this._hh+O+getCarry(this._hl,X)|0},Sha512.prototype._hash=function(){var t=Buffer$C.allocUnsafe(64);function e(a,u,d){t.writeInt32BE(a,d),t.writeInt32BE(u,d+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var sha512$1=Sha512,inherits$r=inherits_browserExports$2,SHA512$4=sha512$1,Hash$4=hash$8,Buffer$B=safeBufferExports$1.Buffer,W=new Array(160);function Sha384(){this.init(),this._w=W,Hash$4.call(this,128,112)}inherits$r(Sha384,SHA512$4),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){var t=Buffer$B.allocUnsafe(48);function e(a,u,d){t.writeInt32BE(a,d),t.writeInt32BE(u,d+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var sha384$1=Sha384,exports$1=sha_js.exports=function(e){e=e.toLowerCase();var a=exports$1[e];if(!a)throw new Error(e+" is not supported (we accept pull requests)");return new a};exports$1.sha=sha$5,exports$1.sha1=sha1,exports$1.sha224=sha224$1,exports$1.sha256=sha256$4,exports$1.sha384=sha384$1,exports$1.sha512=sha512$1;var sha_jsExports=sha_js.exports,streamBrowserify=Stream,EE=eventsExports.EventEmitter,inherits$q=inherits_browserExports$2;inherits$q(Stream,EE),Stream.Readable=require_stream_readable(),Stream.Writable=require_stream_writable(),Stream.Duplex=require_stream_duplex(),Stream.Transform=_stream_transform,Stream.PassThrough=_stream_passthrough,Stream.finished=endOfStream,Stream.pipeline=pipeline_1,Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(t,e){var a=this;function u(T){t.writable&&t.write(T)===!1&&a.pause&&a.pause()}a.on("data",u);function d(){a.readable&&a.resume&&a.resume()}t.on("drain",d),!t._isStdio&&(!e||e.end!==!1)&&(a.on("end",l),a.on("close",m));var c=!1;function l(){c||(c=!0,t.end())}function m(){c||(c=!0,typeof t.destroy=="function"&&t.destroy())}function I(T){if(O(),EE.listenerCount(this,"error")===0)throw T}a.on("error",I),t.on("error",I);function O(){a.removeListener("data",u),t.removeListener("drain",d),a.removeListener("end",l),a.removeListener("close",m),a.removeListener("error",I),t.removeListener("error",I),a.removeListener("end",O),a.removeListener("close",O),t.removeListener("close",O)}return a.on("end",O),a.on("close",O),t.on("close",O),t.emit("pipe",a),t};var Buffer$A=safeBufferExports$1.Buffer,Transform$4=streamBrowserify.Transform,StringDecoder=string_decoder.StringDecoder,inherits$p=inherits_browserExports$2;function CipherBase$1(t){Transform$4.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits$p(CipherBase$1,Transform$4),CipherBase$1.prototype.update=function(t,e,a){typeof t=="string"&&(t=Buffer$A.from(t,e));var u=this._update(t);return this.hashMode?this:(a&&(u=this._toString(u,a)),u)},CipherBase$1.prototype.setAutoPadding=function(){},CipherBase$1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase$1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase$1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase$1.prototype._transform=function(t,e,a){var u;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(d){u=d}finally{a(u)}},CipherBase$1.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(a){e=a}t(e)},CipherBase$1.prototype._finalOrDigest=function(t){var e=this.__final()||Buffer$A.alloc(0);return t&&(e=this._toString(e,t,!0)),e},CipherBase$1.prototype._toString=function(t,e,a){if(this._decoder||(this._decoder=new StringDecoder(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var u=this._decoder.write(t);return a&&(u+=this._decoder.end()),u};var cipherBase=CipherBase$1,inherits$o=inherits_browserExports$2,MD5$2=md5_js,RIPEMD160$4=ripemd160,sha$4=sha_jsExports,Base$8=cipherBase;function Hash$3(t){Base$8.call(this,"digest"),this._hash=t}inherits$o(Hash$3,Base$8),Hash$3.prototype._update=function(t){this._hash.update(t)},Hash$3.prototype._final=function(){return this._hash.digest()};var browser$c=function(e){return e=e.toLowerCase(),e==="md5"?new MD5$2:e==="rmd160"||e==="ripemd160"?new RIPEMD160$4:new Hash$3(sha$4(e))},inherits$n=inherits_browserExports$2,Buffer$z=safeBufferExports$1.Buffer,Base$7=cipherBase,ZEROS$2=Buffer$z.alloc(128),blocksize=64;function Hmac$4(t,e){Base$7.call(this,"digest"),typeof e=="string"&&(e=Buffer$z.from(e)),this._alg=t,this._key=e,e.length>blocksize?e=t(e):e.length<blocksize&&(e=Buffer$z.concat([e,ZEROS$2],blocksize));for(var a=this._ipad=Buffer$z.allocUnsafe(blocksize),u=this._opad=Buffer$z.allocUnsafe(blocksize),d=0;d<blocksize;d++)a[d]=e[d]^54,u[d]=e[d]^92;this._hash=[a]}inherits$n(Hmac$4,Base$7),Hmac$4.prototype._update=function(t){this._hash.push(t)},Hmac$4.prototype._final=function(){var t=this._alg(Buffer$z.concat(this._hash));return this._alg(Buffer$z.concat([this._opad,t]))};var legacy=Hmac$4,MD5$1=md5_js,md5$2=function(t){return new MD5$1().update(t).digest()},inherits$m=inherits_browserExports$2,Legacy=legacy,Base$6=cipherBase,Buffer$y=safeBufferExports$1.Buffer,md5$1=md5$2,RIPEMD160$3=ripemd160,sha$3=sha_jsExports,ZEROS$1=Buffer$y.alloc(128);function Hmac$3(t,e){Base$6.call(this,"digest"),typeof e=="string"&&(e=Buffer$y.from(e));var a=t==="sha512"||t==="sha384"?128:64;if(this._alg=t,this._key=e,e.length>a){var u=t==="rmd160"?new RIPEMD160$3:sha$3(t);e=u.update(e).digest()}else e.length<a&&(e=Buffer$y.concat([e,ZEROS$1],a));for(var d=this._ipad=Buffer$y.allocUnsafe(a),c=this._opad=Buffer$y.allocUnsafe(a),l=0;l<a;l++)d[l]=e[l]^54,c[l]=e[l]^92;this._hash=t==="rmd160"?new RIPEMD160$3:sha$3(t),this._hash.update(d)}inherits$m(Hmac$3,Base$6),Hmac$3.prototype._update=function(t){this._hash.update(t)},Hmac$3.prototype._final=function(){var t=this._hash.digest(),e=this._alg==="rmd160"?new RIPEMD160$3:sha$3(this._alg);return e.update(this._opad).update(t).digest()};var browser$b=function(e,a){return e=e.toLowerCase(),e==="rmd160"||e==="ripemd160"?new Hmac$3("rmd160",a):e==="md5"?new Legacy(md5$1,a):new Hmac$3(e,a)};const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256$3={sign:"ecdsa",hash:"sha256",id:""},sha224={sign:"ecdsa",hash:"sha224",id:""},sha384={sign:"ecdsa",hash:"sha384",id:""},sha512={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:sha256$3,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos=require$$6,browser$a={},MAX_ALLOC=Math.pow(2,30)-1,precondition=function(t,e){if(typeof t!="number")throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if(typeof e!="number")throw new TypeError("Key length not a number");if(e<0||e>MAX_ALLOC||e!==e)throw new TypeError("Bad key length")},defaultEncoding$2;if(commonjsGlobal.process&&commonjsGlobal.process.browser)defaultEncoding$2="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var pVersionMajor=parseInt(process$1.version.split(".")[0].slice(1),10);defaultEncoding$2=pVersionMajor>=6?"utf-8":"binary"}else defaultEncoding$2="utf-8";var defaultEncoding_1=defaultEncoding$2,Buffer$x=safeBufferExports$1.Buffer,toBuffer$2=function(t,e,a){if(Buffer$x.isBuffer(t))return t;if(typeof t=="string")return Buffer$x.from(t,e);if(ArrayBuffer.isView(t))return Buffer$x.from(t.buffer);throw new TypeError(a+" must be a string, a Buffer, a typed array or a DataView")},md5=md5$2,RIPEMD160$2=ripemd160,sha$2=sha_jsExports,Buffer$w=safeBufferExports$1.Buffer,checkParameters$1=precondition,defaultEncoding$1=defaultEncoding_1,toBuffer$1=toBuffer$2,ZEROS=Buffer$w.alloc(128),sizes={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac$2(t,e,a){var u=getDigest(t),d=t==="sha512"||t==="sha384"?128:64;e.length>d?e=u(e):e.length<d&&(e=Buffer$w.concat([e,ZEROS],d));for(var c=Buffer$w.allocUnsafe(d+sizes[t]),l=Buffer$w.allocUnsafe(d+sizes[t]),m=0;m<d;m++)c[m]=e[m]^54,l[m]=e[m]^92;var I=Buffer$w.allocUnsafe(d+a+4);c.copy(I,0,0,d),this.ipad1=I,this.ipad2=c,this.opad=l,this.alg=t,this.blocksize=d,this.hash=u,this.size=sizes[t]}Hmac$2.prototype.run=function(t,e){t.copy(e,this.blocksize);var a=this.hash(e);return a.copy(this.opad,this.blocksize),this.hash(this.opad)};function getDigest(t){function e(u){return sha$2(t).update(u).digest()}function a(u){return new RIPEMD160$2().update(u).digest()}return t==="rmd160"||t==="ripemd160"?a:t==="md5"?md5:e}function pbkdf2(t,e,a,u,d){checkParameters$1(a,u),t=toBuffer$1(t,defaultEncoding$1,"Password"),e=toBuffer$1(e,defaultEncoding$1,"Salt"),d=d||"sha1";var c=new Hmac$2(d,t,e.length),l=Buffer$w.allocUnsafe(u),m=Buffer$w.allocUnsafe(e.length+4);e.copy(m,0,0,e.length);for(var I=0,O=sizes[d],T=Math.ceil(u/O),C=1;C<=T;C++){m.writeUInt32BE(C,e.length);for(var j=c.run(m,c.ipad1),F=j,U=1;U<a;U++){F=c.run(F,c.ipad2);for(var Z=0;Z<O;Z++)j[Z]^=F[Z]}j.copy(l,I),I+=O}return l}var syncBrowser=pbkdf2,Buffer$v=safeBufferExports$1.Buffer,checkParameters=precondition,defaultEncoding=defaultEncoding_1,sync=syncBrowser,toBuffer=toBuffer$2,ZERO_BUF,subtle=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,toBrowser={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},checks=[];function checkNative(t){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!subtle||!subtle.importKey||!subtle.deriveBits)return Promise.resolve(!1);if(checks[t]!==void 0)return checks[t];ZERO_BUF=ZERO_BUF||Buffer$v.alloc(8);var e=browserPbkdf2(ZERO_BUF,ZERO_BUF,10,128,t).then(function(){return!0}).catch(function(){return!1});return checks[t]=e,e}var nextTick;function getNextTick(){return nextTick||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?nextTick=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?nextTick=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?nextTick=commonjsGlobal.setImmediate:nextTick=commonjsGlobal.setTimeout,nextTick)}function browserPbkdf2(t,e,a,u,d){return subtle.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then(function(c){return subtle.deriveBits({name:"PBKDF2",salt:e,iterations:a,hash:{name:d}},c,u<<3)}).then(function(c){return Buffer$v.from(c)})}function resolvePromise(t,e){t.then(function(a){getNextTick()(function(){e(null,a)})},function(a){getNextTick()(function(){e(a)})})}var async=function(t,e,a,u,d,c){typeof d=="function"&&(c=d,d=void 0),d=d||"sha1";var l=toBrowser[d.toLowerCase()];if(!l||typeof commonjsGlobal.Promise!="function"){getNextTick()(function(){var m;try{m=sync(t,e,a,u,d)}catch(I){return c(I)}c(null,m)});return}if(checkParameters(a,u),t=toBuffer(t,defaultEncoding,"Password"),e=toBuffer(e,defaultEncoding,"Salt"),typeof c!="function")throw new Error("No callback provided to pbkdf2");resolvePromise(checkNative(l).then(function(m){return m?browserPbkdf2(t,e,a,u,l):sync(t,e,a,u,d)}),c)};browser$a.pbkdf2=async,browser$a.pbkdf2Sync=syncBrowser;var browser$9={},des$2={},utils$L={};utils$L.readUInt32BE=function(e,a){var u=e[0+a]<<24|e[1+a]<<16|e[2+a]<<8|e[3+a];return u>>>0},utils$L.writeUInt32BE=function(e,a,u){e[0+u]=a>>>24,e[1+u]=a>>>16&255,e[2+u]=a>>>8&255,e[3+u]=a&255},utils$L.ip=function(e,a,u,d){for(var c=0,l=0,m=6;m>=0;m-=2){for(var I=0;I<=24;I+=8)c<<=1,c|=a>>>I+m&1;for(var I=0;I<=24;I+=8)c<<=1,c|=e>>>I+m&1}for(var m=6;m>=0;m-=2){for(var I=1;I<=25;I+=8)l<<=1,l|=a>>>I+m&1;for(var I=1;I<=25;I+=8)l<<=1,l|=e>>>I+m&1}u[d+0]=c>>>0,u[d+1]=l>>>0},utils$L.rip=function(e,a,u,d){for(var c=0,l=0,m=0;m<4;m++)for(var I=24;I>=0;I-=8)c<<=1,c|=a>>>I+m&1,c<<=1,c|=e>>>I+m&1;for(var m=4;m<8;m++)for(var I=24;I>=0;I-=8)l<<=1,l|=a>>>I+m&1,l<<=1,l|=e>>>I+m&1;u[d+0]=c>>>0,u[d+1]=l>>>0},utils$L.pc1=function(e,a,u,d){for(var c=0,l=0,m=7;m>=5;m--){for(var I=0;I<=24;I+=8)c<<=1,c|=a>>I+m&1;for(var I=0;I<=24;I+=8)c<<=1,c|=e>>I+m&1}for(var I=0;I<=24;I+=8)c<<=1,c|=a>>I+m&1;for(var m=1;m<=3;m++){for(var I=0;I<=24;I+=8)l<<=1,l|=a>>I+m&1;for(var I=0;I<=24;I+=8)l<<=1,l|=e>>I+m&1}for(var I=0;I<=24;I+=8)l<<=1,l|=e>>I+m&1;u[d+0]=c>>>0,u[d+1]=l>>>0},utils$L.r28shl=function(e,a){return e<<a&268435455|e>>>28-a};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$L.pc2=function(e,a,u,d){for(var c=0,l=0,m=pc2table.length>>>1,I=0;I<m;I++)c<<=1,c|=e>>>pc2table[I]&1;for(var I=m;I<pc2table.length;I++)l<<=1,l|=a>>>pc2table[I]&1;u[d+0]=c>>>0,u[d+1]=l>>>0},utils$L.expand=function(e,a,u){var d=0,c=0;d=(e&1)<<5|e>>>27;for(var l=23;l>=15;l-=4)d<<=6,d|=e>>>l&63;for(var l=11;l>=3;l-=4)c|=e>>>l&63,c<<=6;c|=(e&31)<<1|e>>>31,a[u+0]=d>>>0,a[u+1]=c>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$L.substitute=function(e,a){for(var u=0,d=0;d<4;d++){var c=e>>>18-d*6&63,l=sTable[d*64+c];u<<=4,u|=l}for(var d=0;d<4;d++){var c=a>>>18-d*6&63,l=sTable[4*64+d*64+c];u<<=4,u|=l}return u>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];utils$L.permute=function(e){for(var a=0,u=0;u<permuteTable.length;u++)a<<=1,a|=e>>>permuteTable[u]&1;return a>>>0},utils$L.padSplit=function(e,a,u){for(var d=e.toString(2);d.length<a;)d="0"+d;for(var c=[],l=0;l<a;l+=u)c.push(d.slice(l,l+u));return c.join(" ")};var minimalisticAssert$1=assert$E;function assert$E(t,e){if(!t)throw new Error(e||"Assertion failed")}assert$E.equal=function(e,a,u){if(e!=a)throw new Error(u||"Assertion failed: "+e+" != "+a)};var assert$D=minimalisticAssert$1;function Cipher$3(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=t.padding!==!1}var cipher=Cipher$3;Cipher$3.prototype._init=function(){},Cipher$3.prototype.update=function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},Cipher$3.prototype._buffer=function(e,a){for(var u=Math.min(this.buffer.length-this.bufferOff,e.length-a),d=0;d<u;d++)this.buffer[this.bufferOff+d]=e[a+d];return this.bufferOff+=u,u},Cipher$3.prototype._flushBuffer=function(e,a){return this._update(this.buffer,0,e,a),this.bufferOff=0,this.blockSize},Cipher$3.prototype._updateEncrypt=function(e){var a=0,u=0,d=(this.bufferOff+e.length)/this.blockSize|0,c=new Array(d*this.blockSize);this.bufferOff!==0&&(a+=this._buffer(e,a),this.bufferOff===this.buffer.length&&(u+=this._flushBuffer(c,u)));for(var l=e.length-(e.length-a)%this.blockSize;a<l;a+=this.blockSize)this._update(e,a,c,u),u+=this.blockSize;for(;a<e.length;a++,this.bufferOff++)this.buffer[this.bufferOff]=e[a];return c},Cipher$3.prototype._updateDecrypt=function(e){for(var a=0,u=0,d=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,c=new Array(d*this.blockSize);d>0;d--)a+=this._buffer(e,a),u+=this._flushBuffer(c,u);return a+=this._buffer(e,a),c},Cipher$3.prototype.final=function(e){var a;e&&(a=this.update(e));var u;return this.type==="encrypt"?u=this._finalEncrypt():u=this._finalDecrypt(),a?a.concat(u):u},Cipher$3.prototype._pad=function(e,a){if(a===0)return!1;for(;a<e.length;)e[a++]=0;return!0},Cipher$3.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},Cipher$3.prototype._unpad=function(e){return e},Cipher$3.prototype._finalDecrypt=function(){assert$D.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)};var assert$C=minimalisticAssert$1,inherits$l=inherits_browserExports$2,utils$K=utils$L,Cipher$2=cipher;function DESState(){this.tmp=new Array(2),this.keys=null}function DES$3(t){Cipher$2.call(this,t);var e=new DESState;this._desState=e,this.deriveKeys(e,t.key)}inherits$l(DES$3,Cipher$2);var des$1=DES$3;DES$3.create=function(e){return new DES$3(e)};var shiftTable=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];DES$3.prototype.deriveKeys=function(e,a){e.keys=new Array(16*2),assert$C.equal(a.length,this.blockSize,"Invalid key length");var u=utils$K.readUInt32BE(a,0),d=utils$K.readUInt32BE(a,4);utils$K.pc1(u,d,e.tmp,0),u=e.tmp[0],d=e.tmp[1];for(var c=0;c<e.keys.length;c+=2){var l=shiftTable[c>>>1];u=utils$K.r28shl(u,l),d=utils$K.r28shl(d,l),utils$K.pc2(u,d,e.keys,c)}},DES$3.prototype._update=function(e,a,u,d){var c=this._desState,l=utils$K.readUInt32BE(e,a),m=utils$K.readUInt32BE(e,a+4);utils$K.ip(l,m,c.tmp,0),l=c.tmp[0],m=c.tmp[1],this.type==="encrypt"?this._encrypt(c,l,m,c.tmp,0):this._decrypt(c,l,m,c.tmp,0),l=c.tmp[0],m=c.tmp[1],utils$K.writeUInt32BE(u,l,d),utils$K.writeUInt32BE(u,m,d+4)},DES$3.prototype._pad=function(e,a){if(this.padding===!1)return!1;for(var u=e.length-a,d=a;d<e.length;d++)e[d]=u;return!0},DES$3.prototype._unpad=function(e){if(this.padding===!1)return e;for(var a=e[e.length-1],u=e.length-a;u<e.length;u++)assert$C.equal(e[u],a);return e.slice(0,e.length-a)},DES$3.prototype._encrypt=function(e,a,u,d,c){for(var l=a,m=u,I=0;I<e.keys.length;I+=2){var O=e.keys[I],T=e.keys[I+1];utils$K.expand(m,e.tmp,0),O^=e.tmp[0],T^=e.tmp[1];var C=utils$K.substitute(O,T),j=utils$K.permute(C),F=m;m=(l^j)>>>0,l=F}utils$K.rip(m,l,d,c)},DES$3.prototype._decrypt=function(e,a,u,d,c){for(var l=u,m=a,I=e.keys.length-2;I>=0;I-=2){var O=e.keys[I],T=e.keys[I+1];utils$K.expand(l,e.tmp,0),O^=e.tmp[0],T^=e.tmp[1];var C=utils$K.substitute(O,T),j=utils$K.permute(C),F=l;l=(m^j)>>>0,m=F}utils$K.rip(l,m,d,c)};var cbc$1={},assert$B=minimalisticAssert$1,inherits$k=inherits_browserExports$2,proto$1={};function CBCState(t){assert$B.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}function instantiate(t){function e(c){t.call(this,c),this._cbcInit()}inherits$k(e,t);for(var a=Object.keys(proto$1),u=0;u<a.length;u++){var d=a[u];e.prototype[d]=proto$1[d]}return e.create=function(l){return new e(l)},e}cbc$1.instantiate=instantiate,proto$1._cbcInit=function(){var e=new CBCState(this.options.iv);this._cbcState=e},proto$1._update=function(e,a,u,d){var c=this._cbcState,l=this.constructor.super_.prototype,m=c.iv;if(this.type==="encrypt"){for(var I=0;I<this.blockSize;I++)m[I]^=e[a+I];l._update.call(this,m,0,u,d);for(var I=0;I<this.blockSize;I++)m[I]=u[d+I]}else{l._update.call(this,e,a,u,d);for(var I=0;I<this.blockSize;I++)u[d+I]^=m[I];for(var I=0;I<this.blockSize;I++)m[I]=e[a+I]}};var assert$A=minimalisticAssert$1,inherits$j=inherits_browserExports$2,Cipher$1=cipher,DES$2=des$1;function EDEState(t,e){assert$A.equal(e.length,24,"Invalid key length");var a=e.slice(0,8),u=e.slice(8,16),d=e.slice(16,24);t==="encrypt"?this.ciphers=[DES$2.create({type:"encrypt",key:a}),DES$2.create({type:"decrypt",key:u}),DES$2.create({type:"encrypt",key:d})]:this.ciphers=[DES$2.create({type:"decrypt",key:d}),DES$2.create({type:"encrypt",key:u}),DES$2.create({type:"decrypt",key:a})]}function EDE(t){Cipher$1.call(this,t);var e=new EDEState(this.type,this.options.key);this._edeState=e}inherits$j(EDE,Cipher$1);var ede=EDE;EDE.create=function(e){return new EDE(e)},EDE.prototype._update=function(e,a,u,d){var c=this._edeState;c.ciphers[0]._update(e,a,u,d),c.ciphers[1]._update(u,d,u,d),c.ciphers[2]._update(u,d,u,d)},EDE.prototype._pad=DES$2.prototype._pad,EDE.prototype._unpad=DES$2.prototype._unpad,des$2.utils=utils$L,des$2.Cipher=cipher,des$2.DES=des$1,des$2.CBC=cbc$1,des$2.EDE=ede;var CipherBase=cipherBase,des=des$2,inherits$i=inherits_browserExports$2,Buffer$u=safeBufferExports$1.Buffer,modes$3={"des-ede3-cbc":des.CBC.instantiate(des.EDE),"des-ede3":des.EDE,"des-ede-cbc":des.CBC.instantiate(des.EDE),"des-ede":des.EDE,"des-cbc":des.CBC.instantiate(des.DES),"des-ecb":des.DES};modes$3.des=modes$3["des-cbc"],modes$3.des3=modes$3["des-ede3-cbc"];var browserifyDes=DES$1;inherits$i(DES$1,CipherBase);function DES$1(t){CipherBase.call(this);var e=t.mode.toLowerCase(),a=modes$3[e],u;t.decrypt?u="decrypt":u="encrypt";var d=t.key;Buffer$u.isBuffer(d)||(d=Buffer$u.from(d)),(e==="des-ede"||e==="des-ede-cbc")&&(d=Buffer$u.concat([d,d.slice(0,8)]));var c=t.iv;Buffer$u.isBuffer(c)||(c=Buffer$u.from(c)),this._des=a.create({key:d,iv:c,type:u})}DES$1.prototype._update=function(t){return Buffer$u.from(this._des.update(t))},DES$1.prototype._final=function(){return Buffer$u.from(this._des.final())};var browser$8={},encrypter={},ecb={};ecb.encrypt=function(t,e){return t._cipher.encryptBlock(e)},ecb.decrypt=function(t,e){return t._cipher.decryptBlock(e)};var cbc={},bufferXor=function(e,a){for(var u=Math.min(e.length,a.length),d=new Buffer$N(u),c=0;c<u;++c)d[c]=e[c]^a[c];return d},xor$7=bufferXor;cbc.encrypt=function(t,e){var a=xor$7(e,t._prev);return t._prev=t._cipher.encryptBlock(a),t._prev},cbc.decrypt=function(t,e){var a=t._prev;t._prev=e;var u=t._cipher.decryptBlock(e);return xor$7(u,a)};var cfb={},Buffer$t=safeBufferExports$1.Buffer,xor$6=bufferXor;function encryptStart(t,e,a){var u=e.length,d=xor$6(e,t._cache);return t._cache=t._cache.slice(u),t._prev=Buffer$t.concat([t._prev,a?e:d]),d}cfb.encrypt=function(t,e,a){for(var u=Buffer$t.allocUnsafe(0),d;e.length;)if(t._cache.length===0&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=Buffer$t.allocUnsafe(0)),t._cache.length<=e.length)d=t._cache.length,u=Buffer$t.concat([u,encryptStart(t,e.slice(0,d),a)]),e=e.slice(d);else{u=Buffer$t.concat([u,encryptStart(t,e,a)]);break}return u};var cfb8={},Buffer$s=safeBufferExports$1.Buffer;function encryptByte$1(t,e,a){var u=t._cipher.encryptBlock(t._prev),d=u[0]^e;return t._prev=Buffer$s.concat([t._prev.slice(1),Buffer$s.from([a?e:d])]),d}cfb8.encrypt=function(t,e,a){for(var u=e.length,d=Buffer$s.allocUnsafe(u),c=-1;++c<u;)d[c]=encryptByte$1(t,e[c],a);return d};var cfb1={},Buffer$r=safeBufferExports$1.Buffer;function encryptByte(t,e,a){for(var u,d=-1,c=8,l=0,m,I;++d<c;)u=t._cipher.encryptBlock(t._prev),m=e&1<<7-d?128:0,I=u[0]^m,l+=(I&128)>>d%8,t._prev=shiftIn(t._prev,a?m:I);return l}function shiftIn(t,e){var a=t.length,u=-1,d=Buffer$r.allocUnsafe(t.length);for(t=Buffer$r.concat([t,Buffer$r.from([e])]);++u<a;)d[u]=t[u]<<1|t[u+1]>>7;return d}cfb1.encrypt=function(t,e,a){for(var u=e.length,d=Buffer$r.allocUnsafe(u),c=-1;++c<u;)d[c]=encryptByte(t,e[c],a);return d};var ofb={},xor$5=bufferXor;function getBlock$1(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}ofb.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=Buffer$N.concat([t._cache,getBlock$1(t)]);var a=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),xor$5(e,a)};var ctr={};function incr32$2(t){for(var e=t.length,a;e--;)if(a=t.readUInt8(e),a===255)t.writeUInt8(0,e);else{a++,t.writeUInt8(a,e);break}}var incr32_1=incr32$2,xor$4=bufferXor,Buffer$q=safeBufferExports$1.Buffer,incr32$1=incr32_1;function getBlock(t){var e=t._cipher.encryptBlockRaw(t._prev);return incr32$1(t._prev),e}var blockSize=16;ctr.encrypt=function(t,e){var a=Math.ceil(e.length/blockSize),u=t._cache.length;t._cache=Buffer$q.concat([t._cache,Buffer$q.allocUnsafe(a*blockSize)]);for(var d=0;d<a;d++){var c=getBlock(t),l=u+d*blockSize;t._cache.writeUInt32BE(c[0],l+0),t._cache.writeUInt32BE(c[1],l+4),t._cache.writeUInt32BE(c[2],l+8),t._cache.writeUInt32BE(c[3],l+12)}var m=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),xor$4(e,m)};const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modeModules={ECB:ecb,CBC:cbc,CFB:cfb,CFB8:cfb8,CFB1:cfb1,OFB:ofb,CTR:ctr,GCM:ctr},modes$2=require$$2;for(var key$5 in modes$2)modes$2[key$5].module=modeModules[modes$2[key$5].mode];var modes_1=modes$2,aes$5={},Buffer$p=safeBufferExports$1.Buffer;function asUInt32Array(t){Buffer$p.isBuffer(t)||(t=Buffer$p.from(t));for(var e=t.length/4|0,a=new Array(e),u=0;u<e;u++)a[u]=t.readUInt32BE(u*4);return a}function scrubVec(t){for(var e=0;e<t.length;t++)t[e]=0}function cryptBlock(t,e,a,u,d){for(var c=a[0],l=a[1],m=a[2],I=a[3],O=t[0]^e[0],T=t[1]^e[1],C=t[2]^e[2],j=t[3]^e[3],F,U,Z,J,X=4,Q=1;Q<d;Q++)F=c[O>>>24]^l[T>>>16&255]^m[C>>>8&255]^I[j&255]^e[X++],U=c[T>>>24]^l[C>>>16&255]^m[j>>>8&255]^I[O&255]^e[X++],Z=c[C>>>24]^l[j>>>16&255]^m[O>>>8&255]^I[T&255]^e[X++],J=c[j>>>24]^l[O>>>16&255]^m[T>>>8&255]^I[C&255]^e[X++],O=F,T=U,C=Z,j=J;return F=(u[O>>>24]<<24|u[T>>>16&255]<<16|u[C>>>8&255]<<8|u[j&255])^e[X++],U=(u[T>>>24]<<24|u[C>>>16&255]<<16|u[j>>>8&255]<<8|u[O&255])^e[X++],Z=(u[C>>>24]<<24|u[j>>>16&255]<<16|u[O>>>8&255]<<8|u[T&255])^e[X++],J=(u[j>>>24]<<24|u[O>>>16&255]<<16|u[T>>>8&255]<<8|u[C&255])^e[X++],F=F>>>0,U=U>>>0,Z=Z>>>0,J=J>>>0,[F,U,Z,J]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G$4=function(){for(var t=new Array(256),e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var a=[],u=[],d=[[],[],[],[]],c=[[],[],[],[]],l=0,m=0,I=0;I<256;++I){var O=m^m<<1^m<<2^m<<3^m<<4;O=O>>>8^O&255^99,a[l]=O,u[O]=l;var T=t[l],C=t[T],j=t[C],F=t[O]*257^O*16843008;d[0][l]=F<<24|F>>>8,d[1][l]=F<<16|F>>>16,d[2][l]=F<<8|F>>>24,d[3][l]=F,F=j*16843009^C*65537^T*257^l*16843008,c[0][O]=F<<24|F>>>8,c[1][O]=F<<16|F>>>16,c[2][O]=F<<8|F>>>24,c[3][O]=F,l===0?l=m=1:(l=T^t[t[t[j^T]]],m^=t[t[m]])}return{SBOX:a,INV_SBOX:u,SUB_MIX:d,INV_SUB_MIX:c}}();function AES(t){this._key=asUInt32Array(t),this._reset()}AES.blockSize=4*4,AES.keySize=256/8,AES.prototype.blockSize=AES.blockSize,AES.prototype.keySize=AES.keySize,AES.prototype._reset=function(){for(var t=this._key,e=t.length,a=e+6,u=(a+1)*4,d=[],c=0;c<e;c++)d[c]=t[c];for(c=e;c<u;c++){var l=d[c-1];c%e===0?(l=l<<8|l>>>24,l=G$4.SBOX[l>>>24]<<24|G$4.SBOX[l>>>16&255]<<16|G$4.SBOX[l>>>8&255]<<8|G$4.SBOX[l&255],l^=RCON[c/e|0]<<24):e>6&&c%e===4&&(l=G$4.SBOX[l>>>24]<<24|G$4.SBOX[l>>>16&255]<<16|G$4.SBOX[l>>>8&255]<<8|G$4.SBOX[l&255]),d[c]=d[c-e]^l}for(var m=[],I=0;I<u;I++){var O=u-I,T=d[O-(I%4?0:4)];I<4||O<=4?m[I]=T:m[I]=G$4.INV_SUB_MIX[0][G$4.SBOX[T>>>24]]^G$4.INV_SUB_MIX[1][G$4.SBOX[T>>>16&255]]^G$4.INV_SUB_MIX[2][G$4.SBOX[T>>>8&255]]^G$4.INV_SUB_MIX[3][G$4.SBOX[T&255]]}this._nRounds=a,this._keySchedule=d,this._invKeySchedule=m},AES.prototype.encryptBlockRaw=function(t){return t=asUInt32Array(t),cryptBlock(t,this._keySchedule,G$4.SUB_MIX,G$4.SBOX,this._nRounds)},AES.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),a=Buffer$p.allocUnsafe(16);return a.writeUInt32BE(e[0],0),a.writeUInt32BE(e[1],4),a.writeUInt32BE(e[2],8),a.writeUInt32BE(e[3],12),a},AES.prototype.decryptBlock=function(t){t=asUInt32Array(t);var e=t[1];t[1]=t[3],t[3]=e;var a=cryptBlock(t,this._invKeySchedule,G$4.INV_SUB_MIX,G$4.INV_SBOX,this._nRounds),u=Buffer$p.allocUnsafe(16);return u.writeUInt32BE(a[0],0),u.writeUInt32BE(a[3],4),u.writeUInt32BE(a[2],8),u.writeUInt32BE(a[1],12),u},AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)},aes$5.AES=AES;var Buffer$o=safeBufferExports$1.Buffer,ZEROES=Buffer$o.alloc(16,0);function toArray$2(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function fromArray(t){var e=Buffer$o.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function GHASH$1(t){this.h=t,this.state=Buffer$o.alloc(16,0),this.cache=Buffer$o.allocUnsafe(0)}GHASH$1.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},GHASH$1.prototype._multiply=function(){for(var t=toArray$2(this.h),e=[0,0,0,0],a,u,d,c=-1;++c<128;){for(u=(this.state[~~(c/8)]&1<<7-c%8)!==0,u&&(e[0]^=t[0],e[1]^=t[1],e[2]^=t[2],e[3]^=t[3]),d=(t[3]&1)!==0,a=3;a>0;a--)t[a]=t[a]>>>1|(t[a-1]&1)<<31;t[0]=t[0]>>>1,d&&(t[0]=t[0]^225<<24)}this.state=fromArray(e)},GHASH$1.prototype.update=function(t){this.cache=Buffer$o.concat([this.cache,t]);for(var e;this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},GHASH$1.prototype.final=function(t,e){return this.cache.length&&this.ghash(Buffer$o.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,t,0,e])),this.state};var ghash=GHASH$1,aes$4=aes$5,Buffer$n=safeBufferExports$1.Buffer,Transform$3=cipherBase,inherits$h=inherits_browserExports$2,GHASH=ghash,xor$3=bufferXor,incr32=incr32_1;function xorTest(t,e){var a=0;t.length!==e.length&&a++;for(var u=Math.min(t.length,e.length),d=0;d<u;++d)a+=t[d]^e[d];return a}function calcIv(t,e,a){if(e.length===12)return t._finID=Buffer$n.concat([e,Buffer$n.from([0,0,0,1])]),Buffer$n.concat([e,Buffer$n.from([0,0,0,2])]);var u=new GHASH(a),d=e.length,c=d%16;u.update(e),c&&(c=16-c,u.update(Buffer$n.alloc(c,0))),u.update(Buffer$n.alloc(8,0));var l=d*8,m=Buffer$n.alloc(8);m.writeUIntBE(l,0,8),u.update(m),t._finID=u.state;var I=Buffer$n.from(t._finID);return incr32(I),I}function StreamCipher$3(t,e,a,u){Transform$3.call(this);var d=Buffer$n.alloc(4,0);this._cipher=new aes$4.AES(e);var c=this._cipher.encryptBlock(d);this._ghash=new GHASH(c),a=calcIv(this,a,c),this._prev=Buffer$n.from(a),this._cache=Buffer$n.allocUnsafe(0),this._secCache=Buffer$n.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}inherits$h(StreamCipher$3,Transform$3),StreamCipher$3.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=Buffer$n.alloc(e,0),this._ghash.update(e))}this._called=!0;var a=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(a),this._len+=t.length,a},StreamCipher$3.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=xor$3(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&xorTest(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},StreamCipher$3.prototype.getAuthTag=function(){if(this._decrypt||!Buffer$n.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},StreamCipher$3.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},StreamCipher$3.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length};var authCipher=StreamCipher$3,aes$3=aes$5,Buffer$m=safeBufferExports$1.Buffer,Transform$2=cipherBase,inherits$g=inherits_browserExports$2;function StreamCipher$2(t,e,a,u){Transform$2.call(this),this._cipher=new aes$3.AES(e),this._prev=Buffer$m.from(a),this._cache=Buffer$m.allocUnsafe(0),this._secCache=Buffer$m.allocUnsafe(0),this._decrypt=u,this._mode=t}inherits$g(StreamCipher$2,Transform$2),StreamCipher$2.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},StreamCipher$2.prototype._final=function(){this._cipher.scrub()};var streamCipher=StreamCipher$2,Buffer$l=safeBufferExports$1.Buffer,MD5=md5_js;function EVP_BytesToKey(t,e,a,u){if(Buffer$l.isBuffer(t)||(t=Buffer$l.from(t,"binary")),e&&(Buffer$l.isBuffer(e)||(e=Buffer$l.from(e,"binary")),e.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var d=a/8,c=Buffer$l.alloc(d),l=Buffer$l.alloc(u||0),m=Buffer$l.alloc(0);d>0||u>0;){var I=new MD5;I.update(m),I.update(t),e&&I.update(e),m=I.digest();var O=0;if(d>0){var T=c.length-d;O=Math.min(d,m.length),m.copy(c,T,0,O),d-=O}if(O<m.length&&u>0){var C=l.length-u,j=Math.min(u,m.length-O);m.copy(l,C,O,O+j),u-=j}}return m.fill(0),{key:c,iv:l}}var evp_bytestokey=EVP_BytesToKey,MODES$1=modes_1,AuthCipher$1=authCipher,Buffer$k=safeBufferExports$1.Buffer,StreamCipher$1=streamCipher,Transform$1=cipherBase,aes$2=aes$5,ebtk$2=evp_bytestokey,inherits$f=inherits_browserExports$2;function Cipher(t,e,a){Transform$1.call(this),this._cache=new Splitter$1,this._cipher=new aes$2.AES(e),this._prev=Buffer$k.from(a),this._mode=t,this._autopadding=!0}inherits$f(Cipher,Transform$1),Cipher.prototype._update=function(t){this._cache.add(t);for(var e,a,u=[];e=this._cache.get();)a=this._mode.encrypt(this,e),u.push(a);return Buffer$k.concat(u)};var PADDING=Buffer$k.alloc(16,16);Cipher.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this};function Splitter$1(){this.cache=Buffer$k.allocUnsafe(0)}Splitter$1.prototype.add=function(t){this.cache=Buffer$k.concat([this.cache,t])},Splitter$1.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},Splitter$1.prototype.flush=function(){for(var t=16-this.cache.length,e=Buffer$k.allocUnsafe(t),a=-1;++a<t;)e.writeUInt8(t,a);return Buffer$k.concat([this.cache,e])};function createCipheriv$1(t,e,a){var u=MODES$1[t.toLowerCase()];if(!u)throw new TypeError("invalid suite type");if(typeof e=="string"&&(e=Buffer$k.from(e)),e.length!==u.key/8)throw new TypeError("invalid key length "+e.length);if(typeof a=="string"&&(a=Buffer$k.from(a)),u.mode!=="GCM"&&a.length!==u.iv)throw new TypeError("invalid iv length "+a.length);return u.type==="stream"?new StreamCipher$1(u.module,e,a):u.type==="auth"?new AuthCipher$1(u.module,e,a):new Cipher(u.module,e,a)}function createCipher$1(t,e){var a=MODES$1[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");var u=ebtk$2(e,!1,a.key,a.iv);return createCipheriv$1(t,u.key,u.iv)}encrypter.createCipheriv=createCipheriv$1,encrypter.createCipher=createCipher$1;var decrypter={},AuthCipher=authCipher,Buffer$j=safeBufferExports$1.Buffer,MODES=modes_1,StreamCipher=streamCipher,Transform=cipherBase,aes$1=aes$5,ebtk$1=evp_bytestokey,inherits$e=inherits_browserExports$2;function Decipher(t,e,a){Transform.call(this),this._cache=new Splitter,this._last=void 0,this._cipher=new aes$1.AES(e),this._prev=Buffer$j.from(a),this._mode=t,this._autopadding=!0}inherits$e(Decipher,Transform),Decipher.prototype._update=function(t){this._cache.add(t);for(var e,a,u=[];e=this._cache.get(this._autopadding);)a=this._mode.decrypt(this,e),u.push(a);return Buffer$j.concat(u)},Decipher.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return unpad(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},Decipher.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this};function Splitter(){this.cache=Buffer$j.allocUnsafe(0)}Splitter.prototype.add=function(t){this.cache=Buffer$j.concat([this.cache,t])},Splitter.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var a=-1;++a<e;)if(t[a+(16-e)]!==e)throw new Error("unable to decrypt data");if(e!==16)return t.slice(0,16-e)}function createDecipheriv$1(t,e,a){var u=MODES[t.toLowerCase()];if(!u)throw new TypeError("invalid suite type");if(typeof a=="string"&&(a=Buffer$j.from(a)),u.mode!=="GCM"&&a.length!==u.iv)throw new TypeError("invalid iv length "+a.length);if(typeof e=="string"&&(e=Buffer$j.from(e)),e.length!==u.key/8)throw new TypeError("invalid key length "+e.length);return u.type==="stream"?new StreamCipher(u.module,e,a,!0):u.type==="auth"?new AuthCipher(u.module,e,a,!0):new Decipher(u.module,e,a)}function createDecipher$1(t,e){var a=MODES[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");var u=ebtk$1(e,!1,a.key,a.iv);return createDecipheriv$1(t,u.key,u.iv)}decrypter.createDecipher=createDecipher$1,decrypter.createDecipheriv=createDecipheriv$1;var ciphers$2=encrypter,deciphers=decrypter,modes$1=require$$2;function getCiphers$1(){return Object.keys(modes$1)}browser$8.createCipher=browser$8.Cipher=ciphers$2.createCipher,browser$8.createCipheriv=browser$8.Cipheriv=ciphers$2.createCipheriv,browser$8.createDecipher=browser$8.Decipher=deciphers.createDecipher,browser$8.createDecipheriv=browser$8.Decipheriv=deciphers.createDecipheriv,browser$8.listCiphers=browser$8.getCiphers=getCiphers$1;var modes={};(function(t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}})(modes);var DES=browserifyDes,aes=browser$8,aesModes=modes_1,desModes=modes,ebtk=evp_bytestokey;function createCipher(t,e){t=t.toLowerCase();var a,u;if(aesModes[t])a=aesModes[t].key,u=aesModes[t].iv;else if(desModes[t])a=desModes[t].key*8,u=desModes[t].iv;else throw new TypeError("invalid suite type");var d=ebtk(e,!1,a,u);return createCipheriv(t,d.key,d.iv)}function createDecipher(t,e){t=t.toLowerCase();var a,u;if(aesModes[t])a=aesModes[t].key,u=aesModes[t].iv;else if(desModes[t])a=desModes[t].key*8,u=desModes[t].iv;else throw new TypeError("invalid suite type");var d=ebtk(e,!1,a,u);return createDecipheriv(t,d.key,d.iv)}function createCipheriv(t,e,a){if(t=t.toLowerCase(),aesModes[t])return aes.createCipheriv(t,e,a);if(desModes[t])return new DES({key:e,iv:a,mode:t});throw new TypeError("invalid suite type")}function createDecipheriv(t,e,a){if(t=t.toLowerCase(),aesModes[t])return aes.createDecipheriv(t,e,a);if(desModes[t])return new DES({key:e,iv:a,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}function getCiphers(){return Object.keys(desModes).concat(aes.getCiphers())}browser$9.createCipher=browser$9.Cipher=createCipher,browser$9.createCipheriv=browser$9.Cipheriv=createCipheriv,browser$9.createDecipher=browser$9.Decipher=createDecipher,browser$9.createDecipheriv=browser$9.Decipheriv=createDecipheriv,browser$9.listCiphers=browser$9.getCiphers=getCiphers;var browser$7={},bn$4={exports:{}};bn$4.exports,function(t){(function(e,a){function u(M,v){if(!M)throw new Error(v||"Assertion failed")}function d(M,v){M.super_=v;var S=function(){};S.prototype=v.prototype,M.prototype=new S,M.prototype.constructor=M}function c(M,v,S){if(c.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((v==="le"||v==="be")&&(S=v,v=10),this._init(M||0,v||10,S||"be"))}typeof e=="object"?e.exports=c:a.BN=c,c.BN=c,c.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=require$$1$4.Buffer}catch{}c.isBN=function(v){return v instanceof c?!0:v!==null&&typeof v=="object"&&v.constructor.wordSize===c.wordSize&&Array.isArray(v.words)},c.max=function(v,S){return v.cmp(S)>0?v:S},c.min=function(v,S){return v.cmp(S)<0?v:S},c.prototype._init=function(v,S,y){if(typeof v=="number")return this._initNumber(v,S,y);if(typeof v=="object")return this._initArray(v,S,y);S==="hex"&&(S=16),u(S===(S|0)&&S>=2&&S<=36),v=v.toString().replace(/\s+/g,"");var w=0;v[0]==="-"&&(w++,this.negative=1),w<v.length&&(S===16?this._parseHex(v,w,y):(this._parseBase(v,S,w),y==="le"&&this._initArray(this.toArray(),S,y)))},c.prototype._initNumber=function(v,S,y){v<0&&(this.negative=1,v=-v),v<67108864?(this.words=[v&67108863],this.length=1):v<4503599627370496?(this.words=[v&67108863,v/67108864&67108863],this.length=2):(u(v<9007199254740992),this.words=[v&67108863,v/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),S,y)},c.prototype._initArray=function(v,S,y){if(u(typeof v.length=="number"),v.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(v.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var P,L,N=0;if(y==="be")for(w=v.length-1,P=0;w>=0;w-=3)L=v[w]|v[w-1]<<8|v[w-2]<<16,this.words[P]|=L<<N&67108863,this.words[P+1]=L>>>26-N&67108863,N+=24,N>=26&&(N-=26,P++);else if(y==="le")for(w=0,P=0;w<v.length;w+=3)L=v[w]|v[w+1]<<8|v[w+2]<<16,this.words[P]|=L<<N&67108863,this.words[P+1]=L>>>26-N&67108863,N+=24,N>=26&&(N-=26,P++);return this.strip()};function m(M,v){var S=M.charCodeAt(v);return S>=65&&S<=70?S-55:S>=97&&S<=102?S-87:S-48&15}function I(M,v,S){var y=m(M,S);return S-1>=v&&(y|=m(M,S-1)<<4),y}c.prototype._parseHex=function(v,S,y){this.length=Math.ceil((v.length-S)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var P=0,L=0,N;if(y==="be")for(w=v.length-1;w>=S;w-=2)N=I(v,S,w)<<P,this.words[L]|=N&67108863,P>=18?(P-=18,L+=1,this.words[L]|=N>>>26):P+=8;else{var E=v.length-S;for(w=E%2===0?S+1:S;w<v.length;w+=2)N=I(v,S,w)<<P,this.words[L]|=N&67108863,P>=18?(P-=18,L+=1,this.words[L]|=N>>>26):P+=8}this.strip()};function O(M,v,S,y){for(var w=0,P=Math.min(M.length,S),L=v;L<P;L++){var N=M.charCodeAt(L)-48;w*=y,N>=49?w+=N-49+10:N>=17?w+=N-17+10:w+=N}return w}c.prototype._parseBase=function(v,S,y){this.words=[0],this.length=1;for(var w=0,P=1;P<=67108863;P*=S)w++;w--,P=P/S|0;for(var L=v.length-y,N=L%w,E=Math.min(L,L-N)+y,A=0,D=y;D<E;D+=w)A=O(v,D,D+w,S),this.imuln(P),this.words[0]+A<67108864?this.words[0]+=A:this._iaddn(A);if(N!==0){var H=1;for(A=O(v,D,v.length,S),D=0;D<N;D++)H*=S;this.imuln(H),this.words[0]+A<67108864?this.words[0]+=A:this._iaddn(A)}this.strip()},c.prototype.copy=function(v){v.words=new Array(this.length);for(var S=0;S<this.length;S++)v.words[S]=this.words[S];v.length=this.length,v.negative=this.negative,v.red=this.red},c.prototype.clone=function(){var v=new c(null);return this.copy(v),v},c.prototype._expand=function(v){for(;this.length<v;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var T=["","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],j=[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];c.prototype.toString=function(v,S){v=v||10,S=S|0||1;var y;if(v===16||v==="hex"){y="";for(var w=0,P=0,L=0;L<this.length;L++){var N=this.words[L],E=((N<<w|P)&16777215).toString(16);P=N>>>24-w&16777215,P!==0||L!==this.length-1?y=T[6-E.length]+E+y:y=E+y,w+=2,w>=26&&(w-=26,L--)}for(P!==0&&(y=P.toString(16)+y);y.length%S!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(v===(v|0)&&v>=2&&v<=36){var A=C[v],D=j[v];y="";var H=this.clone();for(H.negative=0;!H.isZero();){var Y=H.modn(D).toString(v);H=H.idivn(D),H.isZero()?y=Y+y:y=T[A-Y.length]+Y+y}for(this.isZero()&&(y="0"+y);y.length%S!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}u(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=this.words[1]*67108864:this.length===3&&this.words[2]===1?v+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(v,S){return u(typeof l<"u"),this.toArrayLike(l,v,S)},c.prototype.toArray=function(v,S){return this.toArrayLike(Array,v,S)},c.prototype.toArrayLike=function(v,S,y){var w=this.byteLength(),P=y||Math.max(1,w);u(w<=P,"byte array longer than desired length"),u(P>0,"Requested array length <= 0"),this.strip();var L=S==="le",N=new v(P),E,A,D=this.clone();if(L){for(A=0;!D.isZero();A++)E=D.andln(255),D.iushrn(8),N[A]=E;for(;A<P;A++)N[A]=0}else{for(A=0;A<P-w;A++)N[A]=0;for(A=0;!D.isZero();A++)E=D.andln(255),D.iushrn(8),N[P-A-1]=E}return N},Math.clz32?c.prototype._countBits=function(v){return 32-Math.clz32(v)}:c.prototype._countBits=function(v){var S=v,y=0;return S>=4096&&(y+=13,S>>>=13),S>=64&&(y+=7,S>>>=7),S>=8&&(y+=4,S>>>=4),S>=2&&(y+=2,S>>>=2),y+S},c.prototype._zeroBits=function(v){if(v===0)return 26;var S=v,y=0;return S&8191||(y+=13,S>>>=13),S&127||(y+=7,S>>>=7),S&15||(y+=4,S>>>=4),S&3||(y+=2,S>>>=2),S&1||y++,y},c.prototype.bitLength=function(){var v=this.words[this.length-1],S=this._countBits(v);return(this.length-1)*26+S};function F(M){for(var v=new Array(M.bitLength()),S=0;S<v.length;S++){var y=S/26|0,w=S%26;v[S]=(M.words[y]&1<<w)>>>w}return v}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,S=0;S<this.length;S++){var y=this._zeroBits(this.words[S]);if(v+=y,y!==26)break}return v},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(v){return this.negative!==0?this.abs().inotn(v).iaddn(1):this.clone()},c.prototype.fromTwos=function(v){return this.testn(v-1)?this.notn(v).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(v){for(;this.length<v.length;)this.words[this.length++]=0;for(var S=0;S<v.length;S++)this.words[S]=this.words[S]|v.words[S];return this.strip()},c.prototype.ior=function(v){return u((this.negative|v.negative)===0),this.iuor(v)},c.prototype.or=function(v){return this.length>v.length?this.clone().ior(v):v.clone().ior(this)},c.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},c.prototype.iuand=function(v){var S;this.length>v.length?S=v:S=this;for(var y=0;y<S.length;y++)this.words[y]=this.words[y]&v.words[y];return this.length=S.length,this.strip()},c.prototype.iand=function(v){return u((this.negative|v.negative)===0),this.iuand(v)},c.prototype.and=function(v){return this.length>v.length?this.clone().iand(v):v.clone().iand(this)},c.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},c.prototype.iuxor=function(v){var S,y;this.length>v.length?(S=this,y=v):(S=v,y=this);for(var w=0;w<y.length;w++)this.words[w]=S.words[w]^y.words[w];if(this!==S)for(;w<S.length;w++)this.words[w]=S.words[w];return this.length=S.length,this.strip()},c.prototype.ixor=function(v){return u((this.negative|v.negative)===0),this.iuxor(v)},c.prototype.xor=function(v){return this.length>v.length?this.clone().ixor(v):v.clone().ixor(this)},c.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},c.prototype.inotn=function(v){u(typeof v=="number"&&v>=0);var S=Math.ceil(v/26)|0,y=v%26;this._expand(S),y>0&&S--;for(var w=0;w<S;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this.strip()},c.prototype.notn=function(v){return this.clone().inotn(v)},c.prototype.setn=function(v,S){u(typeof v=="number"&&v>=0);var y=v/26|0,w=v%26;return this._expand(y+1),S?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this.strip()},c.prototype.iadd=function(v){var S;if(this.negative!==0&&v.negative===0)return this.negative=0,S=this.isub(v),this.negative^=1,this._normSign();if(this.negative===0&&v.negative!==0)return v.negative=0,S=this.isub(v),v.negative=1,S._normSign();var y,w;this.length>v.length?(y=this,w=v):(y=v,w=this);for(var P=0,L=0;L<w.length;L++)S=(y.words[L]|0)+(w.words[L]|0)+P,this.words[L]=S&67108863,P=S>>>26;for(;P!==0&&L<y.length;L++)S=(y.words[L]|0)+P,this.words[L]=S&67108863,P=S>>>26;if(this.length=y.length,P!==0)this.words[this.length]=P,this.length++;else if(y!==this)for(;L<y.length;L++)this.words[L]=y.words[L];return this},c.prototype.add=function(v){var S;return v.negative!==0&&this.negative===0?(v.negative=0,S=this.sub(v),v.negative^=1,S):v.negative===0&&this.negative!==0?(this.negative=0,S=v.sub(this),this.negative=1,S):this.length>v.length?this.clone().iadd(v):v.clone().iadd(this)},c.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var S=this.iadd(v);return v.negative=1,S._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,P;y>0?(w=this,P=v):(w=v,P=this);for(var L=0,N=0;N<P.length;N++)S=(w.words[N]|0)-(P.words[N]|0)+L,L=S>>26,this.words[N]=S&67108863;for(;L!==0&&N<w.length;N++)S=(w.words[N]|0)+L,L=S>>26,this.words[N]=S&67108863;if(L===0&&N<w.length&&w!==this)for(;N<w.length;N++)this.words[N]=w.words[N];return this.length=Math.max(this.length,N),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(v){return this.clone().isub(v)};function U(M,v,S){S.negative=v.negative^M.negative;var y=M.length+v.length|0;S.length=y,y=y-1|0;var w=M.words[0]|0,P=v.words[0]|0,L=w*P,N=L&67108863,E=L/67108864|0;S.words[0]=N;for(var A=1;A<y;A++){for(var D=E>>>26,H=E&67108863,Y=Math.min(A,v.length-1),le=Math.max(0,A-M.length+1);le<=Y;le++){var _e=A-le|0;w=M.words[_e]|0,P=v.words[le]|0,L=w*P+H,D+=L/67108864|0,H=L&67108863}S.words[A]=H|0,E=D|0}return E!==0?S.words[A]=E|0:S.length--,S.strip()}var Z=function(v,S,y){var w=v.words,P=S.words,L=y.words,N=0,E,A,D,H=w[0]|0,Y=H&8191,le=H>>>13,_e=w[1]|0,he=_e&8191,fe=_e>>>13,ve=w[2]|0,ge=ve&8191,Ie=ve>>>13,ue=w[3]|0,ce=ue&8191,Te=ue>>>13,ke=w[4]|0,He=ke&8191,Qe=ke>>>13,it=w[5]|0,rt=it&8191,Fe=it>>>13,wt=w[6]|0,et=wt&8191,At=wt>>>13,gt=w[7]|0,$e=gt&8191,Me=gt>>>13,Ze=w[8]|0,ze=Ze&8191,Ge=Ze>>>13,ht=w[9]|0,oe=ht&8191,ee=ht>>>13,re=P[0]|0,be=re&8191,Pe=re>>>13,Ne=P[1]|0,Oe=Ne&8191,ut=Ne>>>13,lt=P[2]|0,Je=lt&8191,bt=lt>>>13,vt=P[3]|0,ot=vt&8191,Et=vt>>>13,Bt=P[4]|0,Se=Bt&8191,ye=Bt>>>13,xe=P[5]|0,Be=xe&8191,Le=xe>>>13,je=P[6]|0,qe=je&8191,Xe=je>>>13,at=P[7]|0,Ve=at&8191,dt=at>>>13,pt=P[8]|0,Ye=pt&8191,_t=pt>>>13,yt=P[9]|0,ct=yt&8191,$t=yt>>>13;y.negative=v.negative^S.negative,y.length=19,E=Math.imul(Y,be),A=Math.imul(Y,Pe),A=A+Math.imul(le,be)|0,D=Math.imul(le,Pe);var Ct=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,E=Math.imul(he,be),A=Math.imul(he,Pe),A=A+Math.imul(fe,be)|0,D=Math.imul(fe,Pe),E=E+Math.imul(Y,Oe)|0,A=A+Math.imul(Y,ut)|0,A=A+Math.imul(le,Oe)|0,D=D+Math.imul(le,ut)|0;var Nt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,E=Math.imul(ge,be),A=Math.imul(ge,Pe),A=A+Math.imul(Ie,be)|0,D=Math.imul(Ie,Pe),E=E+Math.imul(he,Oe)|0,A=A+Math.imul(he,ut)|0,A=A+Math.imul(fe,Oe)|0,D=D+Math.imul(fe,ut)|0,E=E+Math.imul(Y,Je)|0,A=A+Math.imul(Y,bt)|0,A=A+Math.imul(le,Je)|0,D=D+Math.imul(le,bt)|0;var Jt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,E=Math.imul(ce,be),A=Math.imul(ce,Pe),A=A+Math.imul(Te,be)|0,D=Math.imul(Te,Pe),E=E+Math.imul(ge,Oe)|0,A=A+Math.imul(ge,ut)|0,A=A+Math.imul(Ie,Oe)|0,D=D+Math.imul(Ie,ut)|0,E=E+Math.imul(he,Je)|0,A=A+Math.imul(he,bt)|0,A=A+Math.imul(fe,Je)|0,D=D+Math.imul(fe,bt)|0,E=E+Math.imul(Y,ot)|0,A=A+Math.imul(Y,Et)|0,A=A+Math.imul(le,ot)|0,D=D+Math.imul(le,Et)|0;var Qt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,E=Math.imul(He,be),A=Math.imul(He,Pe),A=A+Math.imul(Qe,be)|0,D=Math.imul(Qe,Pe),E=E+Math.imul(ce,Oe)|0,A=A+Math.imul(ce,ut)|0,A=A+Math.imul(Te,Oe)|0,D=D+Math.imul(Te,ut)|0,E=E+Math.imul(ge,Je)|0,A=A+Math.imul(ge,bt)|0,A=A+Math.imul(Ie,Je)|0,D=D+Math.imul(Ie,bt)|0,E=E+Math.imul(he,ot)|0,A=A+Math.imul(he,Et)|0,A=A+Math.imul(fe,ot)|0,D=D+Math.imul(fe,Et)|0,E=E+Math.imul(Y,Se)|0,A=A+Math.imul(Y,ye)|0,A=A+Math.imul(le,Se)|0,D=D+Math.imul(le,ye)|0;var Wt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,E=Math.imul(rt,be),A=Math.imul(rt,Pe),A=A+Math.imul(Fe,be)|0,D=Math.imul(Fe,Pe),E=E+Math.imul(He,Oe)|0,A=A+Math.imul(He,ut)|0,A=A+Math.imul(Qe,Oe)|0,D=D+Math.imul(Qe,ut)|0,E=E+Math.imul(ce,Je)|0,A=A+Math.imul(ce,bt)|0,A=A+Math.imul(Te,Je)|0,D=D+Math.imul(Te,bt)|0,E=E+Math.imul(ge,ot)|0,A=A+Math.imul(ge,Et)|0,A=A+Math.imul(Ie,ot)|0,D=D+Math.imul(Ie,Et)|0,E=E+Math.imul(he,Se)|0,A=A+Math.imul(he,ye)|0,A=A+Math.imul(fe,Se)|0,D=D+Math.imul(fe,ye)|0,E=E+Math.imul(Y,Be)|0,A=A+Math.imul(Y,Le)|0,A=A+Math.imul(le,Be)|0,D=D+Math.imul(le,Le)|0;var ur=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(ur>>>26)|0,ur&=67108863,E=Math.imul(et,be),A=Math.imul(et,Pe),A=A+Math.imul(At,be)|0,D=Math.imul(At,Pe),E=E+Math.imul(rt,Oe)|0,A=A+Math.imul(rt,ut)|0,A=A+Math.imul(Fe,Oe)|0,D=D+Math.imul(Fe,ut)|0,E=E+Math.imul(He,Je)|0,A=A+Math.imul(He,bt)|0,A=A+Math.imul(Qe,Je)|0,D=D+Math.imul(Qe,bt)|0,E=E+Math.imul(ce,ot)|0,A=A+Math.imul(ce,Et)|0,A=A+Math.imul(Te,ot)|0,D=D+Math.imul(Te,Et)|0,E=E+Math.imul(ge,Se)|0,A=A+Math.imul(ge,ye)|0,A=A+Math.imul(Ie,Se)|0,D=D+Math.imul(Ie,ye)|0,E=E+Math.imul(he,Be)|0,A=A+Math.imul(he,Le)|0,A=A+Math.imul(fe,Be)|0,D=D+Math.imul(fe,Le)|0,E=E+Math.imul(Y,qe)|0,A=A+Math.imul(Y,Xe)|0,A=A+Math.imul(le,qe)|0,D=D+Math.imul(le,Xe)|0;var vr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(vr>>>26)|0,vr&=67108863,E=Math.imul($e,be),A=Math.imul($e,Pe),A=A+Math.imul(Me,be)|0,D=Math.imul(Me,Pe),E=E+Math.imul(et,Oe)|0,A=A+Math.imul(et,ut)|0,A=A+Math.imul(At,Oe)|0,D=D+Math.imul(At,ut)|0,E=E+Math.imul(rt,Je)|0,A=A+Math.imul(rt,bt)|0,A=A+Math.imul(Fe,Je)|0,D=D+Math.imul(Fe,bt)|0,E=E+Math.imul(He,ot)|0,A=A+Math.imul(He,Et)|0,A=A+Math.imul(Qe,ot)|0,D=D+Math.imul(Qe,Et)|0,E=E+Math.imul(ce,Se)|0,A=A+Math.imul(ce,ye)|0,A=A+Math.imul(Te,Se)|0,D=D+Math.imul(Te,ye)|0,E=E+Math.imul(ge,Be)|0,A=A+Math.imul(ge,Le)|0,A=A+Math.imul(Ie,Be)|0,D=D+Math.imul(Ie,Le)|0,E=E+Math.imul(he,qe)|0,A=A+Math.imul(he,Xe)|0,A=A+Math.imul(fe,qe)|0,D=D+Math.imul(fe,Xe)|0,E=E+Math.imul(Y,Ve)|0,A=A+Math.imul(Y,dt)|0,A=A+Math.imul(le,Ve)|0,D=D+Math.imul(le,dt)|0;var nr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(nr>>>26)|0,nr&=67108863,E=Math.imul(ze,be),A=Math.imul(ze,Pe),A=A+Math.imul(Ge,be)|0,D=Math.imul(Ge,Pe),E=E+Math.imul($e,Oe)|0,A=A+Math.imul($e,ut)|0,A=A+Math.imul(Me,Oe)|0,D=D+Math.imul(Me,ut)|0,E=E+Math.imul(et,Je)|0,A=A+Math.imul(et,bt)|0,A=A+Math.imul(At,Je)|0,D=D+Math.imul(At,bt)|0,E=E+Math.imul(rt,ot)|0,A=A+Math.imul(rt,Et)|0,A=A+Math.imul(Fe,ot)|0,D=D+Math.imul(Fe,Et)|0,E=E+Math.imul(He,Se)|0,A=A+Math.imul(He,ye)|0,A=A+Math.imul(Qe,Se)|0,D=D+Math.imul(Qe,ye)|0,E=E+Math.imul(ce,Be)|0,A=A+Math.imul(ce,Le)|0,A=A+Math.imul(Te,Be)|0,D=D+Math.imul(Te,Le)|0,E=E+Math.imul(ge,qe)|0,A=A+Math.imul(ge,Xe)|0,A=A+Math.imul(Ie,qe)|0,D=D+Math.imul(Ie,Xe)|0,E=E+Math.imul(he,Ve)|0,A=A+Math.imul(he,dt)|0,A=A+Math.imul(fe,Ve)|0,D=D+Math.imul(fe,dt)|0,E=E+Math.imul(Y,Ye)|0,A=A+Math.imul(Y,_t)|0,A=A+Math.imul(le,Ye)|0,D=D+Math.imul(le,_t)|0;var br=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(br>>>26)|0,br&=67108863,E=Math.imul(oe,be),A=Math.imul(oe,Pe),A=A+Math.imul(ee,be)|0,D=Math.imul(ee,Pe),E=E+Math.imul(ze,Oe)|0,A=A+Math.imul(ze,ut)|0,A=A+Math.imul(Ge,Oe)|0,D=D+Math.imul(Ge,ut)|0,E=E+Math.imul($e,Je)|0,A=A+Math.imul($e,bt)|0,A=A+Math.imul(Me,Je)|0,D=D+Math.imul(Me,bt)|0,E=E+Math.imul(et,ot)|0,A=A+Math.imul(et,Et)|0,A=A+Math.imul(At,ot)|0,D=D+Math.imul(At,Et)|0,E=E+Math.imul(rt,Se)|0,A=A+Math.imul(rt,ye)|0,A=A+Math.imul(Fe,Se)|0,D=D+Math.imul(Fe,ye)|0,E=E+Math.imul(He,Be)|0,A=A+Math.imul(He,Le)|0,A=A+Math.imul(Qe,Be)|0,D=D+Math.imul(Qe,Le)|0,E=E+Math.imul(ce,qe)|0,A=A+Math.imul(ce,Xe)|0,A=A+Math.imul(Te,qe)|0,D=D+Math.imul(Te,Xe)|0,E=E+Math.imul(ge,Ve)|0,A=A+Math.imul(ge,dt)|0,A=A+Math.imul(Ie,Ve)|0,D=D+Math.imul(Ie,dt)|0,E=E+Math.imul(he,Ye)|0,A=A+Math.imul(he,_t)|0,A=A+Math.imul(fe,Ye)|0,D=D+Math.imul(fe,_t)|0,E=E+Math.imul(Y,ct)|0,A=A+Math.imul(Y,$t)|0,A=A+Math.imul(le,ct)|0,D=D+Math.imul(le,$t)|0;var ir=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(ir>>>26)|0,ir&=67108863,E=Math.imul(oe,Oe),A=Math.imul(oe,ut),A=A+Math.imul(ee,Oe)|0,D=Math.imul(ee,ut),E=E+Math.imul(ze,Je)|0,A=A+Math.imul(ze,bt)|0,A=A+Math.imul(Ge,Je)|0,D=D+Math.imul(Ge,bt)|0,E=E+Math.imul($e,ot)|0,A=A+Math.imul($e,Et)|0,A=A+Math.imul(Me,ot)|0,D=D+Math.imul(Me,Et)|0,E=E+Math.imul(et,Se)|0,A=A+Math.imul(et,ye)|0,A=A+Math.imul(At,Se)|0,D=D+Math.imul(At,ye)|0,E=E+Math.imul(rt,Be)|0,A=A+Math.imul(rt,Le)|0,A=A+Math.imul(Fe,Be)|0,D=D+Math.imul(Fe,Le)|0,E=E+Math.imul(He,qe)|0,A=A+Math.imul(He,Xe)|0,A=A+Math.imul(Qe,qe)|0,D=D+Math.imul(Qe,Xe)|0,E=E+Math.imul(ce,Ve)|0,A=A+Math.imul(ce,dt)|0,A=A+Math.imul(Te,Ve)|0,D=D+Math.imul(Te,dt)|0,E=E+Math.imul(ge,Ye)|0,A=A+Math.imul(ge,_t)|0,A=A+Math.imul(Ie,Ye)|0,D=D+Math.imul(Ie,_t)|0,E=E+Math.imul(he,ct)|0,A=A+Math.imul(he,$t)|0,A=A+Math.imul(fe,ct)|0,D=D+Math.imul(fe,$t)|0;var gr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(gr>>>26)|0,gr&=67108863,E=Math.imul(oe,Je),A=Math.imul(oe,bt),A=A+Math.imul(ee,Je)|0,D=Math.imul(ee,bt),E=E+Math.imul(ze,ot)|0,A=A+Math.imul(ze,Et)|0,A=A+Math.imul(Ge,ot)|0,D=D+Math.imul(Ge,Et)|0,E=E+Math.imul($e,Se)|0,A=A+Math.imul($e,ye)|0,A=A+Math.imul(Me,Se)|0,D=D+Math.imul(Me,ye)|0,E=E+Math.imul(et,Be)|0,A=A+Math.imul(et,Le)|0,A=A+Math.imul(At,Be)|0,D=D+Math.imul(At,Le)|0,E=E+Math.imul(rt,qe)|0,A=A+Math.imul(rt,Xe)|0,A=A+Math.imul(Fe,qe)|0,D=D+Math.imul(Fe,Xe)|0,E=E+Math.imul(He,Ve)|0,A=A+Math.imul(He,dt)|0,A=A+Math.imul(Qe,Ve)|0,D=D+Math.imul(Qe,dt)|0,E=E+Math.imul(ce,Ye)|0,A=A+Math.imul(ce,_t)|0,A=A+Math.imul(Te,Ye)|0,D=D+Math.imul(Te,_t)|0,E=E+Math.imul(ge,ct)|0,A=A+Math.imul(ge,$t)|0,A=A+Math.imul(Ie,ct)|0,D=D+Math.imul(Ie,$t)|0;var yr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(yr>>>26)|0,yr&=67108863,E=Math.imul(oe,ot),A=Math.imul(oe,Et),A=A+Math.imul(ee,ot)|0,D=Math.imul(ee,Et),E=E+Math.imul(ze,Se)|0,A=A+Math.imul(ze,ye)|0,A=A+Math.imul(Ge,Se)|0,D=D+Math.imul(Ge,ye)|0,E=E+Math.imul($e,Be)|0,A=A+Math.imul($e,Le)|0,A=A+Math.imul(Me,Be)|0,D=D+Math.imul(Me,Le)|0,E=E+Math.imul(et,qe)|0,A=A+Math.imul(et,Xe)|0,A=A+Math.imul(At,qe)|0,D=D+Math.imul(At,Xe)|0,E=E+Math.imul(rt,Ve)|0,A=A+Math.imul(rt,dt)|0,A=A+Math.imul(Fe,Ve)|0,D=D+Math.imul(Fe,dt)|0,E=E+Math.imul(He,Ye)|0,A=A+Math.imul(He,_t)|0,A=A+Math.imul(Qe,Ye)|0,D=D+Math.imul(Qe,_t)|0,E=E+Math.imul(ce,ct)|0,A=A+Math.imul(ce,$t)|0,A=A+Math.imul(Te,ct)|0,D=D+Math.imul(Te,$t)|0;var wr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(wr>>>26)|0,wr&=67108863,E=Math.imul(oe,Se),A=Math.imul(oe,ye),A=A+Math.imul(ee,Se)|0,D=Math.imul(ee,ye),E=E+Math.imul(ze,Be)|0,A=A+Math.imul(ze,Le)|0,A=A+Math.imul(Ge,Be)|0,D=D+Math.imul(Ge,Le)|0,E=E+Math.imul($e,qe)|0,A=A+Math.imul($e,Xe)|0,A=A+Math.imul(Me,qe)|0,D=D+Math.imul(Me,Xe)|0,E=E+Math.imul(et,Ve)|0,A=A+Math.imul(et,dt)|0,A=A+Math.imul(At,Ve)|0,D=D+Math.imul(At,dt)|0,E=E+Math.imul(rt,Ye)|0,A=A+Math.imul(rt,_t)|0,A=A+Math.imul(Fe,Ye)|0,D=D+Math.imul(Fe,_t)|0,E=E+Math.imul(He,ct)|0,A=A+Math.imul(He,$t)|0,A=A+Math.imul(Qe,ct)|0,D=D+Math.imul(Qe,$t)|0;var cr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(cr>>>26)|0,cr&=67108863,E=Math.imul(oe,Be),A=Math.imul(oe,Le),A=A+Math.imul(ee,Be)|0,D=Math.imul(ee,Le),E=E+Math.imul(ze,qe)|0,A=A+Math.imul(ze,Xe)|0,A=A+Math.imul(Ge,qe)|0,D=D+Math.imul(Ge,Xe)|0,E=E+Math.imul($e,Ve)|0,A=A+Math.imul($e,dt)|0,A=A+Math.imul(Me,Ve)|0,D=D+Math.imul(Me,dt)|0,E=E+Math.imul(et,Ye)|0,A=A+Math.imul(et,_t)|0,A=A+Math.imul(At,Ye)|0,D=D+Math.imul(At,_t)|0,E=E+Math.imul(rt,ct)|0,A=A+Math.imul(rt,$t)|0,A=A+Math.imul(Fe,ct)|0,D=D+Math.imul(Fe,$t)|0;var dr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(dr>>>26)|0,dr&=67108863,E=Math.imul(oe,qe),A=Math.imul(oe,Xe),A=A+Math.imul(ee,qe)|0,D=Math.imul(ee,Xe),E=E+Math.imul(ze,Ve)|0,A=A+Math.imul(ze,dt)|0,A=A+Math.imul(Ge,Ve)|0,D=D+Math.imul(Ge,dt)|0,E=E+Math.imul($e,Ye)|0,A=A+Math.imul($e,_t)|0,A=A+Math.imul(Me,Ye)|0,D=D+Math.imul(Me,_t)|0,E=E+Math.imul(et,ct)|0,A=A+Math.imul(et,$t)|0,A=A+Math.imul(At,ct)|0,D=D+Math.imul(At,$t)|0;var lr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(lr>>>26)|0,lr&=67108863,E=Math.imul(oe,Ve),A=Math.imul(oe,dt),A=A+Math.imul(ee,Ve)|0,D=Math.imul(ee,dt),E=E+Math.imul(ze,Ye)|0,A=A+Math.imul(ze,_t)|0,A=A+Math.imul(Ge,Ye)|0,D=D+Math.imul(Ge,_t)|0,E=E+Math.imul($e,ct)|0,A=A+Math.imul($e,$t)|0,A=A+Math.imul(Me,ct)|0,D=D+Math.imul(Me,$t)|0;var _r=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(_r>>>26)|0,_r&=67108863,E=Math.imul(oe,Ye),A=Math.imul(oe,_t),A=A+Math.imul(ee,Ye)|0,D=Math.imul(ee,_t),E=E+Math.imul(ze,ct)|0,A=A+Math.imul(ze,$t)|0,A=A+Math.imul(Ge,ct)|0,D=D+Math.imul(Ge,$t)|0;var Ar=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,E=Math.imul(oe,ct),A=Math.imul(oe,$t),A=A+Math.imul(ee,ct)|0,D=Math.imul(ee,$t);var Nr=(N+E|0)+((A&8191)<<13)|0;return N=(D+(A>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,L[0]=Ct,L[1]=Nt,L[2]=Jt,L[3]=Qt,L[4]=Wt,L[5]=ur,L[6]=vr,L[7]=nr,L[8]=br,L[9]=ir,L[10]=gr,L[11]=yr,L[12]=wr,L[13]=cr,L[14]=dr,L[15]=lr,L[16]=_r,L[17]=Ar,L[18]=Nr,N!==0&&(L[19]=N,y.length++),y};Math.imul||(Z=U);function J(M,v,S){S.negative=v.negative^M.negative,S.length=M.length+v.length;for(var y=0,w=0,P=0;P<S.length-1;P++){var L=w;w=0;for(var N=y&67108863,E=Math.min(P,v.length-1),A=Math.max(0,P-M.length+1);A<=E;A++){var D=P-A,H=M.words[D]|0,Y=v.words[A]|0,le=H*Y,_e=le&67108863;L=L+(le/67108864|0)|0,_e=_e+N|0,N=_e&67108863,L=L+(_e>>>26)|0,w+=L>>>26,L&=67108863}S.words[P]=N,y=L,L=w}return y!==0?S.words[P]=y:S.length--,S.strip()}function X(M,v,S){var y=new Q;return y.mulp(M,v,S)}c.prototype.mulTo=function(v,S){var y,w=this.length+v.length;return this.length===10&&v.length===10?y=Z(this,v,S):w<63?y=U(this,v,S):w<1024?y=J(this,v,S):y=X(this,v,S),y};function Q(M,v){this.x=M,this.y=v}Q.prototype.makeRBT=function(v){for(var S=new Array(v),y=c.prototype._countBits(v)-1,w=0;w<v;w++)S[w]=this.revBin(w,y,v);return S},Q.prototype.revBin=function(v,S,y){if(v===0||v===y-1)return v;for(var w=0,P=0;P<S;P++)w|=(v&1)<<S-P-1,v>>=1;return w},Q.prototype.permute=function(v,S,y,w,P,L){for(var N=0;N<L;N++)w[N]=S[v[N]],P[N]=y[v[N]]},Q.prototype.transform=function(v,S,y,w,P,L){this.permute(L,v,S,y,w,P);for(var N=1;N<P;N<<=1)for(var E=N<<1,A=Math.cos(2*Math.PI/E),D=Math.sin(2*Math.PI/E),H=0;H<P;H+=E)for(var Y=A,le=D,_e=0;_e<N;_e++){var he=y[H+_e],fe=w[H+_e],ve=y[H+_e+N],ge=w[H+_e+N],Ie=Y*ve-le*ge;ge=Y*ge+le*ve,ve=Ie,y[H+_e]=he+ve,w[H+_e]=fe+ge,y[H+_e+N]=he-ve,w[H+_e+N]=fe-ge,_e!==E&&(Ie=A*Y-D*le,le=A*le+D*Y,Y=Ie)}},Q.prototype.guessLen13b=function(v,S){var y=Math.max(S,v)|1,w=y&1,P=0;for(y=y/2|0;y;y=y>>>1)P++;return 1<<P+1+w},Q.prototype.conjugate=function(v,S,y){if(!(y<=1))for(var w=0;w<y/2;w++){var P=v[w];v[w]=v[y-w-1],v[y-w-1]=P,P=S[w],S[w]=-S[y-w-1],S[y-w-1]=-P}},Q.prototype.normalize13b=function(v,S){for(var y=0,w=0;w<S/2;w++){var P=Math.round(v[2*w+1]/S)*8192+Math.round(v[2*w]/S)+y;v[w]=P&67108863,P<67108864?y=0:y=P/67108864|0}return v},Q.prototype.convert13b=function(v,S,y,w){for(var P=0,L=0;L<S;L++)P=P+(v[L]|0),y[2*L]=P&8191,P=P>>>13,y[2*L+1]=P&8191,P=P>>>13;for(L=2*S;L<w;++L)y[L]=0;u(P===0),u((P&-8192)===0)},Q.prototype.stub=function(v){for(var S=new Array(v),y=0;y<v;y++)S[y]=0;return S},Q.prototype.mulp=function(v,S,y){var w=2*this.guessLen13b(v.length,S.length),P=this.makeRBT(w),L=this.stub(w),N=new Array(w),E=new Array(w),A=new Array(w),D=new Array(w),H=new Array(w),Y=new Array(w),le=y.words;le.length=w,this.convert13b(v.words,v.length,N,w),this.convert13b(S.words,S.length,D,w),this.transform(N,L,E,A,w,P),this.transform(D,L,H,Y,w,P);for(var _e=0;_e<w;_e++){var he=E[_e]*H[_e]-A[_e]*Y[_e];A[_e]=E[_e]*Y[_e]+A[_e]*H[_e],E[_e]=he}return this.conjugate(E,A,w),this.transform(E,A,le,L,w,P),this.conjugate(le,L,w),this.normalize13b(le,w),y.negative=v.negative^S.negative,y.length=v.length+S.length,y.strip()},c.prototype.mul=function(v){var S=new c(null);return S.words=new Array(this.length+v.length),this.mulTo(v,S)},c.prototype.mulf=function(v){var S=new c(null);return S.words=new Array(this.length+v.length),X(this,v,S)},c.prototype.imul=function(v){return this.clone().mulTo(v,this)},c.prototype.imuln=function(v){u(typeof v=="number"),u(v<67108864);for(var S=0,y=0;y<this.length;y++){var w=(this.words[y]|0)*v,P=(w&67108863)+(S&67108863);S>>=26,S+=w/67108864|0,S+=P>>>26,this.words[y]=P&67108863}return S!==0&&(this.words[y]=S,this.length++),this},c.prototype.muln=function(v){return this.clone().imuln(v)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(v){var S=F(v);if(S.length===0)return new c(1);for(var y=this,w=0;w<S.length&&S[w]===0;w++,y=y.sqr());if(++w<S.length)for(var P=y.sqr();w<S.length;w++,P=P.sqr())S[w]!==0&&(y=y.mul(P));return y},c.prototype.iushln=function(v){u(typeof v=="number"&&v>=0);var S=v%26,y=(v-S)/26,w=67108863>>>26-S<<26-S,P;if(S!==0){var L=0;for(P=0;P<this.length;P++){var N=this.words[P]&w,E=(this.words[P]|0)-N<<S;this.words[P]=E|L,L=N>>>26-S}L&&(this.words[P]=L,this.length++)}if(y!==0){for(P=this.length-1;P>=0;P--)this.words[P+y]=this.words[P];for(P=0;P<y;P++)this.words[P]=0;this.length+=y}return this.strip()},c.prototype.ishln=function(v){return u(this.negative===0),this.iushln(v)},c.prototype.iushrn=function(v,S,y){u(typeof v=="number"&&v>=0);var w;S?w=(S-S%26)/26:w=0;var P=v%26,L=Math.min((v-P)/26,this.length),N=67108863^67108863>>>P<<P,E=y;if(w-=L,w=Math.max(0,w),E){for(var A=0;A<L;A++)E.words[A]=this.words[A];E.length=L}if(L!==0)if(this.length>L)for(this.length-=L,A=0;A<this.length;A++)this.words[A]=this.words[A+L];else this.words[0]=0,this.length=1;var D=0;for(A=this.length-1;A>=0&&(D!==0||A>=w);A--){var H=this.words[A]|0;this.words[A]=D<<26-P|H>>>P,D=H&N}return E&&D!==0&&(E.words[E.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(v,S,y){return u(this.negative===0),this.iushrn(v,S,y)},c.prototype.shln=function(v){return this.clone().ishln(v)},c.prototype.ushln=function(v){return this.clone().iushln(v)},c.prototype.shrn=function(v){return this.clone().ishrn(v)},c.prototype.ushrn=function(v){return this.clone().iushrn(v)},c.prototype.testn=function(v){u(typeof v=="number"&&v>=0);var S=v%26,y=(v-S)/26,w=1<<S;if(this.length<=y)return!1;var P=this.words[y];return!!(P&w)},c.prototype.imaskn=function(v){u(typeof v=="number"&&v>=0);var S=v%26,y=(v-S)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(S!==0&&y++,this.length=Math.min(y,this.length),S!==0){var w=67108863^67108863>>>S<<S;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(v){return this.clone().imaskn(v)},c.prototype.iaddn=function(v){return u(typeof v=="number"),u(v<67108864),v<0?this.isubn(-v):this.negative!==0?this.length===1&&(this.words[0]|0)<v?(this.words[0]=v-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(v),this.negative=1,this):this._iaddn(v)},c.prototype._iaddn=function(v){this.words[0]+=v;for(var S=0;S<this.length&&this.words[S]>=67108864;S++)this.words[S]-=67108864,S===this.length-1?this.words[S+1]=1:this.words[S+1]++;return this.length=Math.max(this.length,S+1),this},c.prototype.isubn=function(v){if(u(typeof v=="number"),u(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var S=0;S<this.length&&this.words[S]<0;S++)this.words[S]+=67108864,this.words[S+1]-=1;return this.strip()},c.prototype.addn=function(v){return this.clone().iaddn(v)},c.prototype.subn=function(v){return this.clone().isubn(v)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(v,S,y){var w=v.length+y,P;this._expand(w);var L,N=0;for(P=0;P<v.length;P++){L=(this.words[P+y]|0)+N;var E=(v.words[P]|0)*S;L-=E&67108863,N=(L>>26)-(E/67108864|0),this.words[P+y]=L&67108863}for(;P<this.length-y;P++)L=(this.words[P+y]|0)+N,N=L>>26,this.words[P+y]=L&67108863;if(N===0)return this.strip();for(u(N===-1),N=0,P=0;P<this.length;P++)L=-(this.words[P]|0)+N,N=L>>26,this.words[P]=L&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(v,S){var y=this.length-v.length,w=this.clone(),P=v,L=P.words[P.length-1]|0,N=this._countBits(L);y=26-N,y!==0&&(P=P.ushln(y),w.iushln(y),L=P.words[P.length-1]|0);var E=w.length-P.length,A;if(S!=="mod"){A=new c(null),A.length=E+1,A.words=new Array(A.length);for(var D=0;D<A.length;D++)A.words[D]=0}var H=w.clone()._ishlnsubmul(P,1,E);H.negative===0&&(w=H,A&&(A.words[E]=1));for(var Y=E-1;Y>=0;Y--){var le=(w.words[P.length+Y]|0)*67108864+(w.words[P.length+Y-1]|0);for(le=Math.min(le/L|0,67108863),w._ishlnsubmul(P,le,Y);w.negative!==0;)le--,w.negative=0,w._ishlnsubmul(P,1,Y),w.isZero()||(w.negative^=1);A&&(A.words[Y]=le)}return A&&A.strip(),w.strip(),S!=="div"&&y!==0&&w.iushrn(y),{div:A||null,mod:w}},c.prototype.divmod=function(v,S,y){if(u(!v.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,P,L;return this.negative!==0&&v.negative===0?(L=this.neg().divmod(v,S),S!=="mod"&&(w=L.div.neg()),S!=="div"&&(P=L.mod.neg(),y&&P.negative!==0&&P.iadd(v)),{div:w,mod:P}):this.negative===0&&v.negative!==0?(L=this.divmod(v.neg(),S),S!=="mod"&&(w=L.div.neg()),{div:w,mod:L.mod}):this.negative&v.negative?(L=this.neg().divmod(v.neg(),S),S!=="div"&&(P=L.mod.neg(),y&&P.negative!==0&&P.isub(v)),{div:L.div,mod:P}):v.length>this.length||this.cmp(v)<0?{div:new c(0),mod:this}:v.length===1?S==="div"?{div:this.divn(v.words[0]),mod:null}:S==="mod"?{div:null,mod:new c(this.modn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new c(this.modn(v.words[0]))}:this._wordDiv(v,S)},c.prototype.div=function(v){return this.divmod(v,"div",!1).div},c.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},c.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},c.prototype.divRound=function(v){var S=this.divmod(v);if(S.mod.isZero())return S.div;var y=S.div.negative!==0?S.mod.isub(v):S.mod,w=v.ushrn(1),P=v.andln(1),L=y.cmp(w);return L<0||P===1&&L===0?S.div:S.div.negative!==0?S.div.isubn(1):S.div.iaddn(1)},c.prototype.modn=function(v){u(v<=67108863);for(var S=(1<<26)%v,y=0,w=this.length-1;w>=0;w--)y=(S*y+(this.words[w]|0))%v;return y},c.prototype.idivn=function(v){u(v<=67108863);for(var S=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+S*67108864;this.words[y]=w/v|0,S=w%v}return this.strip()},c.prototype.divn=function(v){return this.clone().idivn(v)},c.prototype.egcd=function(v){u(v.negative===0),u(!v.isZero());var S=this,y=v.clone();S.negative!==0?S=S.umod(v):S=S.clone();for(var w=new c(1),P=new c(0),L=new c(0),N=new c(1),E=0;S.isEven()&&y.isEven();)S.iushrn(1),y.iushrn(1),++E;for(var A=y.clone(),D=S.clone();!S.isZero();){for(var H=0,Y=1;!(S.words[0]&Y)&&H<26;++H,Y<<=1);if(H>0)for(S.iushrn(H);H-- >0;)(w.isOdd()||P.isOdd())&&(w.iadd(A),P.isub(D)),w.iushrn(1),P.iushrn(1);for(var le=0,_e=1;!(y.words[0]&_e)&&le<26;++le,_e<<=1);if(le>0)for(y.iushrn(le);le-- >0;)(L.isOdd()||N.isOdd())&&(L.iadd(A),N.isub(D)),L.iushrn(1),N.iushrn(1);S.cmp(y)>=0?(S.isub(y),w.isub(L),P.isub(N)):(y.isub(S),L.isub(w),N.isub(P))}return{a:L,b:N,gcd:y.iushln(E)}},c.prototype._invmp=function(v){u(v.negative===0),u(!v.isZero());var S=this,y=v.clone();S.negative!==0?S=S.umod(v):S=S.clone();for(var w=new c(1),P=new c(0),L=y.clone();S.cmpn(1)>0&&y.cmpn(1)>0;){for(var N=0,E=1;!(S.words[0]&E)&&N<26;++N,E<<=1);if(N>0)for(S.iushrn(N);N-- >0;)w.isOdd()&&w.iadd(L),w.iushrn(1);for(var A=0,D=1;!(y.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(y.iushrn(A);A-- >0;)P.isOdd()&&P.iadd(L),P.iushrn(1);S.cmp(y)>=0?(S.isub(y),w.isub(P)):(y.isub(S),P.isub(w))}var H;return S.cmpn(1)===0?H=w:H=P,H.cmpn(0)<0&&H.iadd(v),H},c.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var S=this.clone(),y=v.clone();S.negative=0,y.negative=0;for(var w=0;S.isEven()&&y.isEven();w++)S.iushrn(1),y.iushrn(1);do{for(;S.isEven();)S.iushrn(1);for(;y.isEven();)y.iushrn(1);var P=S.cmp(y);if(P<0){var L=S;S=y,y=L}else if(P===0||y.cmpn(1)===0)break;S.isub(y)}while(!0);return y.iushln(w)},c.prototype.invm=function(v){return this.egcd(v).a.umod(v)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(v){return this.words[0]&v},c.prototype.bincn=function(v){u(typeof v=="number");var S=v%26,y=(v-S)/26,w=1<<S;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var P=w,L=y;P!==0&&L<this.length;L++){var N=this.words[L]|0;N+=P,P=N>>>26,N&=67108863,this.words[L]=N}return P!==0&&(this.words[L]=P,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(v){var S=v<0;if(this.negative!==0&&!S)return-1;if(this.negative===0&&S)return 1;this.strip();var y;if(this.length>1)y=1;else{S&&(v=-v),u(v<=67108863,"Number is too big");var w=this.words[0]|0;y=w===v?0:w<v?-1:1}return this.negative!==0?-y|0:y},c.prototype.cmp=function(v){if(this.negative!==0&&v.negative===0)return-1;if(this.negative===0&&v.negative!==0)return 1;var S=this.ucmp(v);return this.negative!==0?-S|0:S},c.prototype.ucmp=function(v){if(this.length>v.length)return 1;if(this.length<v.length)return-1;for(var S=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,P=v.words[y]|0;if(w!==P){w<P?S=-1:w>P&&(S=1);break}}return S},c.prototype.gtn=function(v){return this.cmpn(v)===1},c.prototype.gt=function(v){return this.cmp(v)===1},c.prototype.gten=function(v){return this.cmpn(v)>=0},c.prototype.gte=function(v){return this.cmp(v)>=0},c.prototype.ltn=function(v){return this.cmpn(v)===-1},c.prototype.lt=function(v){return this.cmp(v)===-1},c.prototype.lten=function(v){return this.cmpn(v)<=0},c.prototype.lte=function(v){return this.cmp(v)<=0},c.prototype.eqn=function(v){return this.cmpn(v)===0},c.prototype.eq=function(v){return this.cmp(v)===0},c.red=function(v){return new ae(v)},c.prototype.toRed=function(v){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},c.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(v){return this.red=v,this},c.prototype.forceRed=function(v){return u(!this.red,"Already a number in reduction context"),this._forceRed(v)},c.prototype.redAdd=function(v){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},c.prototype.redIAdd=function(v){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},c.prototype.redSub=function(v){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},c.prototype.redISub=function(v){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},c.prototype.redShl=function(v){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},c.prototype.redMul=function(v){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},c.prototype.redIMul=function(v){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},c.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(v){return u(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var te={k256:null,p224:null,p192:null,p25519:null};function se(M,v){this.name=M,this.p=new c(v,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}se.prototype._tmp=function(){var v=new c(null);return v.words=new Array(Math.ceil(this.n/13)),v},se.prototype.ireduce=function(v){var S=v,y;do this.split(S,this.tmp),S=this.imulK(S),S=S.iadd(this.tmp),y=S.bitLength();while(y>this.n);var w=y<this.n?-1:S.ucmp(this.p);return w===0?(S.words[0]=0,S.length=1):w>0?S.isub(this.p):S.strip!==void 0?S.strip():S._strip(),S},se.prototype.split=function(v,S){v.iushrn(this.n,0,S)},se.prototype.imulK=function(v){return v.imul(this.k)};function pe(){se.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(pe,se),pe.prototype.split=function(v,S){for(var y=4194303,w=Math.min(v.length,9),P=0;P<w;P++)S.words[P]=v.words[P];if(S.length=w,v.length<=9){v.words[0]=0,v.length=1;return}var L=v.words[9];for(S.words[S.length++]=L&y,P=10;P<v.length;P++){var N=v.words[P]|0;v.words[P-10]=(N&y)<<4|L>>>22,L=N}L>>>=22,v.words[P-10]=L,L===0&&v.length>10?v.length-=10:v.length-=9},pe.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var S=0,y=0;y<v.length;y++){var w=v.words[y]|0;S+=w*977,v.words[y]=S&67108863,S=w*64+(S/67108864|0)}return v.words[v.length-1]===0&&(v.length--,v.words[v.length-1]===0&&v.length--),v};function me(){se.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(me,se);function Ee(){se.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(Ee,se);function V(){se.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(V,se),V.prototype.imulK=function(v){for(var S=0,y=0;y<v.length;y++){var w=(v.words[y]|0)*19+S,P=w&67108863;w>>>=26,v.words[y]=P,S=w}return S!==0&&(v.words[v.length++]=S),v},c._prime=function(v){if(te[v])return te[v];var S;if(v==="k256")S=new pe;else if(v==="p224")S=new me;else if(v==="p192")S=new Ee;else if(v==="p25519")S=new V;else throw new Error("Unknown prime "+v);return te[v]=S,S};function ae(M){if(typeof M=="string"){var v=c._prime(M);this.m=v.p,this.prime=v}else u(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}ae.prototype._verify1=function(v){u(v.negative===0,"red works only with positives"),u(v.red,"red works only with red numbers")},ae.prototype._verify2=function(v,S){u((v.negative|S.negative)===0,"red works only with positives"),u(v.red&&v.red===S.red,"red works only with red numbers")},ae.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):v.umod(this.m)._forceRed(this)},ae.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},ae.prototype.add=function(v,S){this._verify2(v,S);var y=v.add(S);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},ae.prototype.iadd=function(v,S){this._verify2(v,S);var y=v.iadd(S);return y.cmp(this.m)>=0&&y.isub(this.m),y},ae.prototype.sub=function(v,S){this._verify2(v,S);var y=v.sub(S);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},ae.prototype.isub=function(v,S){this._verify2(v,S);var y=v.isub(S);return y.cmpn(0)<0&&y.iadd(this.m),y},ae.prototype.shl=function(v,S){return this._verify1(v),this.imod(v.ushln(S))},ae.prototype.imul=function(v,S){return this._verify2(v,S),this.imod(v.imul(S))},ae.prototype.mul=function(v,S){return this._verify2(v,S),this.imod(v.mul(S))},ae.prototype.isqr=function(v){return this.imul(v,v.clone())},ae.prototype.sqr=function(v){return this.mul(v,v)},ae.prototype.sqrt=function(v){if(v.isZero())return v.clone();var S=this.m.andln(3);if(u(S%2===1),S===3){var y=this.m.add(new c(1)).iushrn(2);return this.pow(v,y)}for(var w=this.m.subn(1),P=0;!w.isZero()&&w.andln(1)===0;)P++,w.iushrn(1);u(!w.isZero());var L=new c(1).toRed(this),N=L.redNeg(),E=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new c(2*A*A).toRed(this);this.pow(A,E).cmp(N)!==0;)A.redIAdd(N);for(var D=this.pow(A,w),H=this.pow(v,w.addn(1).iushrn(1)),Y=this.pow(v,w),le=P;Y.cmp(L)!==0;){for(var _e=Y,he=0;_e.cmp(L)!==0;he++)_e=_e.redSqr();u(he<le);var fe=this.pow(D,new c(1).iushln(le-he-1));H=H.redMul(fe),D=fe.redSqr(),Y=Y.redMul(D),le=he}return H},ae.prototype.invm=function(v){var S=v._invmp(this.m);return S.negative!==0?(S.negative=0,this.imod(S).redNeg()):this.imod(S)},ae.prototype.pow=function(v,S){if(S.isZero())return new c(1).toRed(this);if(S.cmpn(1)===0)return v.clone();var y=4,w=new Array(1<<y);w[0]=new c(1).toRed(this),w[1]=v;for(var P=2;P<w.length;P++)w[P]=this.mul(w[P-1],v);var L=w[0],N=0,E=0,A=S.bitLength()%26;for(A===0&&(A=26),P=S.length-1;P>=0;P--){for(var D=S.words[P],H=A-1;H>=0;H--){var Y=D>>H&1;if(L!==w[0]&&(L=this.sqr(L)),Y===0&&N===0){E=0;continue}N<<=1,N|=Y,E++,!(E!==y&&(P!==0||H!==0))&&(L=this.mul(L,w[N]),E=0,N=0)}A=26}return L},ae.prototype.convertTo=function(v){var S=v.umod(this.m);return S===v?S.clone():S},ae.prototype.convertFrom=function(v){var S=v.clone();return S.red=null,S},c.mont=function(v){return new ne(v)};function ne(M){ae.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}d(ne,ae),ne.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},ne.prototype.convertFrom=function(v){var S=this.imod(v.mul(this.rinv));return S.red=null,S},ne.prototype.imul=function(v,S){if(v.isZero()||S.isZero())return v.words[0]=0,v.length=1,v;var y=v.imul(S),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=y.isub(w).iushrn(this.shift),L=P;return P.cmp(this.m)>=0?L=P.isub(this.m):P.cmpn(0)<0&&(L=P.iadd(this.m)),L._forceRed(this)},ne.prototype.mul=function(v,S){if(v.isZero()||S.isZero())return new c(0)._forceRed(this);var y=v.mul(S),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=y.isub(w).iushrn(this.shift),L=P;return P.cmp(this.m)>=0?L=P.isub(this.m):P.cmpn(0)<0&&(L=P.iadd(this.m)),L._forceRed(this)},ne.prototype.invm=function(v){var S=this.imod(v._invmp(this.m).mul(this.r2));return S._forceRed(this)}})(t,commonjsGlobal)}(bn$4);var bnExports$3=bn$4.exports,brorand$1={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand$1.exports;hasRequiredBrorand=1;var t;brorand$1.exports=function(d){return t||(t=new e(null)),t.generate(d)};function e(u){this.rand=u}if(brorand$1.exports.Rand=e,e.prototype.generate=function(d){return this._rand(d)},e.prototype._rand=function(d){if(this.rand.getBytes)return this.rand.getBytes(d);for(var c=new Uint8Array(d),l=0;l<c.length;l++)c[l]=this.rand.getByte();return c},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(d){var c=new Uint8Array(d);return self.crypto.getRandomValues(c),c}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(d){var c=new Uint8Array(d);return self.msCrypto.getRandomValues(c),c}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=requireCryptoBrowserify();if(typeof a.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(d){return a.randomBytes(d)}}catch{}return brorand$1.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var t=bnExports$3,e=requireBrorand();function a(u){this.rand=u||new e.Rand}return mr=a,a.create=function(d){return new a(d)},a.prototype._randbelow=function(d){var c=d.bitLength(),l=Math.ceil(c/8);do var m=new t(this.rand.generate(l));while(m.cmp(d)>=0);return m},a.prototype._randrange=function(d,c){var l=c.sub(d);return d.add(this._randbelow(l))},a.prototype.test=function(d,c,l){var m=d.bitLength(),I=t.mont(d),O=new t(1).toRed(I);c||(c=Math.max(1,m/48|0));for(var T=d.subn(1),C=0;!T.testn(C);C++);for(var j=d.shrn(C),F=T.toRed(I),U=!0;c>0;c--){var Z=this._randrange(new t(2),T);l&&l(Z);var J=Z.toRed(I).redPow(j);if(!(J.cmp(O)===0||J.cmp(F)===0)){for(var X=1;X<C;X++){if(J=J.redSqr(),J.cmp(O)===0)return!1;if(J.cmp(F)===0)break}if(X===C)return!1}}return U},a.prototype.getDivisor=function(d,c){var l=d.bitLength(),m=t.mont(d),I=new t(1).toRed(m);c||(c=Math.max(1,l/48|0));for(var O=d.subn(1),T=0;!O.testn(T);T++);for(var C=d.shrn(T),j=O.toRed(m);c>0;c--){var F=this._randrange(new t(2),O),U=d.gcd(F);if(U.cmpn(1)!==0)return U;var Z=F.toRed(m).redPow(C);if(!(Z.cmp(I)===0||Z.cmp(j)===0)){for(var J=1;J<T;J++){if(Z=Z.redSqr(),Z.cmp(I)===0)return Z.fromRed().subn(1).gcd(d);if(Z.cmp(j)===0)break}if(J===T)return Z=Z.redSqr(),Z.fromRed().subn(1).gcd(d)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var t=browserExports$1;generatePrime=J,J.simpleSieve=U,J.fermatTest=Z;var e=bnExports$3,a=new e(24),u=requireMr(),d=new u,c=new e(1),l=new e(2),m=new e(5);new e(16),new e(8);var I=new e(10),O=new e(3);new e(7);var T=new e(11),C=new e(4);new e(12);var j=null;function F(){if(j!==null)return j;var X=1048576,Q=[];Q[0]=2;for(var te=1,se=3;se<X;se+=2){for(var pe=Math.ceil(Math.sqrt(se)),me=0;me<te&&Q[me]<=pe&&se%Q[me]!==0;me++);te!==me&&Q[me]<=pe||(Q[te++]=se)}return j=Q,Q}function U(X){for(var Q=F(),te=0;te<Q.length;te++)if(X.modn(Q[te])===0)return X.cmpn(Q[te])===0;return!0}function Z(X){var Q=e.mont(X);return l.toRed(Q).redPow(X.subn(1)).fromRed().cmpn(1)===0}function J(X,Q){if(X<16)return Q===2||Q===5?new e([140,123]):new e([140,39]);Q=new e(Q);for(var te,se;;){for(te=new e(t(Math.ceil(X/8)));te.bitLength()>X;)te.ishrn(1);if(te.isEven()&&te.iadd(c),te.testn(1)||te.iadd(l),Q.cmp(l)){if(!Q.cmp(m))for(;te.mod(I).cmp(O);)te.iadd(C)}else for(;te.mod(a).cmp(T);)te.iadd(C);if(se=te.shrn(1),U(se)&&U(te)&&Z(se)&&Z(te)&&d.test(se)&&d.test(te))return te}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$3={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var t=bnExports$3,e=requireMr(),a=new e,u=new t(24),d=new t(11),c=new t(10),l=new t(3),m=new t(7),I=requireGeneratePrime(),O=browserExports$1;dh=U;function T(J,X){return X=X||"utf8",Buffer$N.isBuffer(J)||(J=new Buffer$N(J,X)),this._pub=new t(J),this}function C(J,X){return X=X||"utf8",Buffer$N.isBuffer(J)||(J=new Buffer$N(J,X)),this._priv=new t(J),this}var j={};function F(J,X){var Q=X.toString("hex"),te=[Q,J.toString(16)].join("_");if(te in j)return j[te];var se=0;if(J.isEven()||!I.simpleSieve||!I.fermatTest(J)||!a.test(J))return se+=1,Q==="02"||Q==="05"?se+=8:se+=4,j[te]=se,se;a.test(J.shrn(1))||(se+=2);var pe;switch(Q){case"02":J.mod(u).cmp(d)&&(se+=8);break;case"05":pe=J.mod(c),pe.cmp(l)&&pe.cmp(m)&&(se+=8);break;default:se+=4}return j[te]=se,se}function U(J,X,Q){this.setGenerator(X),this.__prime=new t(J),this._prime=t.mont(this.__prime),this._primeLen=J.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,Q?(this.setPublicKey=T,this.setPrivateKey=C):this._primeCode=8}Object.defineProperty(U.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=F(this.__prime,this.__gen)),this._primeCode}}),U.prototype.generateKeys=function(){return this._priv||(this._priv=new t(O(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},U.prototype.computeSecret=function(J){J=new t(J),J=J.toRed(this._prime);var X=J.redPow(this._priv).fromRed(),Q=new Buffer$N(X.toArray()),te=this.getPrime();if(Q.length<te.length){var se=new Buffer$N(te.length-Q.length);se.fill(0),Q=Buffer$N.concat([se,Q])}return Q},U.prototype.getPublicKey=function(X){return Z(this._pub,X)},U.prototype.getPrivateKey=function(X){return Z(this._priv,X)},U.prototype.getPrime=function(J){return Z(this.__prime,J)},U.prototype.getGenerator=function(J){return Z(this._gen,J)},U.prototype.setGenerator=function(J,X){return X=X||"utf8",Buffer$N.isBuffer(J)||(J=new Buffer$N(J,X)),this.__gen=J,this._gen=new t(J),this};function Z(J,X){var Q=new Buffer$N(J.toArray());return X?Q.toString(X):Q}return dh}var hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$7;hasRequiredBrowser$2=1;var t=requireGeneratePrime(),e=require$$1$3,a=requireDh();function u(l){var m=new Buffer$N(e[l].prime,"hex"),I=new Buffer$N(e[l].gen,"hex");return new a(m,I)}var d={binary:!0,hex:!0,base64:!0};function c(l,m,I,O){return Buffer$N.isBuffer(m)||d[m]===void 0?c(l,"binary",m,I):(m=m||"binary",O=O||"binary",I=I||new Buffer$N([2]),Buffer$N.isBuffer(I)||(I=new Buffer$N(I,O)),typeof l=="number"?new a(t(l,I),I,!0):(Buffer$N.isBuffer(l)||(l=new Buffer$N(l,m)),new a(l,I,!0)))}return browser$7.DiffieHellmanGroup=browser$7.createDiffieHellmanGroup=browser$7.getDiffieHellman=u,browser$7.createDiffieHellman=browser$7.DiffieHellman=c,browser$7}var sign$1={exports:{}},bn$3={exports:{}};bn$3.exports,function(t){(function(e,a){function u(S,y){if(!S)throw new Error(y||"Assertion failed")}function d(S,y){S.super_=y;var w=function(){};w.prototype=y.prototype,S.prototype=new w,S.prototype.constructor=S}function c(S,y,w){if(c.isBN(S))return S;this.negative=0,this.words=null,this.length=0,this.red=null,S!==null&&((y==="le"||y==="be")&&(w=y,y=10),this._init(S||0,y||10,w||"be"))}typeof e=="object"?e.exports=c:a.BN=c,c.BN=c,c.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=require$$1$4.Buffer}catch{}c.isBN=function(y){return y instanceof c?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===c.wordSize&&Array.isArray(y.words)},c.max=function(y,w){return y.cmp(w)>0?y:w},c.min=function(y,w){return y.cmp(w)<0?y:w},c.prototype._init=function(y,w,P){if(typeof y=="number")return this._initNumber(y,w,P);if(typeof y=="object")return this._initArray(y,w,P);w==="hex"&&(w=16),u(w===(w|0)&&w>=2&&w<=36),y=y.toString().replace(/\s+/g,"");var L=0;y[0]==="-"&&(L++,this.negative=1),L<y.length&&(w===16?this._parseHex(y,L,P):(this._parseBase(y,w,L),P==="le"&&this._initArray(this.toArray(),w,P)))},c.prototype._initNumber=function(y,w,P){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(u(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),P==="le"&&this._initArray(this.toArray(),w,P)},c.prototype._initArray=function(y,w,P){if(u(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var N,E,A=0;if(P==="be")for(L=y.length-1,N=0;L>=0;L-=3)E=y[L]|y[L-1]<<8|y[L-2]<<16,this.words[N]|=E<<A&67108863,this.words[N+1]=E>>>26-A&67108863,A+=24,A>=26&&(A-=26,N++);else if(P==="le")for(L=0,N=0;L<y.length;L+=3)E=y[L]|y[L+1]<<8|y[L+2]<<16,this.words[N]|=E<<A&67108863,this.words[N+1]=E>>>26-A&67108863,A+=24,A>=26&&(A-=26,N++);return this._strip()};function m(S,y){var w=S.charCodeAt(y);if(w>=48&&w<=57)return w-48;if(w>=65&&w<=70)return w-55;if(w>=97&&w<=102)return w-87;u(!1,"Invalid character in "+S)}function I(S,y,w){var P=m(S,w);return w-1>=y&&(P|=m(S,w-1)<<4),P}c.prototype._parseHex=function(y,w,P){this.length=Math.ceil((y.length-w)/6),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var N=0,E=0,A;if(P==="be")for(L=y.length-1;L>=w;L-=2)A=I(y,w,L)<<N,this.words[E]|=A&67108863,N>=18?(N-=18,E+=1,this.words[E]|=A>>>26):N+=8;else{var D=y.length-w;for(L=D%2===0?w+1:w;L<y.length;L+=2)A=I(y,w,L)<<N,this.words[E]|=A&67108863,N>=18?(N-=18,E+=1,this.words[E]|=A>>>26):N+=8}this._strip()};function O(S,y,w,P){for(var L=0,N=0,E=Math.min(S.length,w),A=y;A<E;A++){var D=S.charCodeAt(A)-48;L*=P,D>=49?N=D-49+10:D>=17?N=D-17+10:N=D,u(D>=0&&N<P,"Invalid character"),L+=N}return L}c.prototype._parseBase=function(y,w,P){this.words=[0],this.length=1;for(var L=0,N=1;N<=67108863;N*=w)L++;L--,N=N/w|0;for(var E=y.length-P,A=E%L,D=Math.min(E,E-A)+P,H=0,Y=P;Y<D;Y+=L)H=O(y,Y,Y+L,w),this.imuln(N),this.words[0]+H<67108864?this.words[0]+=H:this._iaddn(H);if(A!==0){var le=1;for(H=O(y,Y,y.length,w),Y=0;Y<A;Y++)le*=w;this.imuln(le),this.words[0]+H<67108864?this.words[0]+=H:this._iaddn(H)}this._strip()},c.prototype.copy=function(y){y.words=new Array(this.length);for(var w=0;w<this.length;w++)y.words[w]=this.words[w];y.length=this.length,y.negative=this.negative,y.red=this.red};function T(S,y){S.words=y.words,S.length=y.length,S.negative=y.negative,S.red=y.red}if(c.prototype._move=function(y){T(y,this)},c.prototype.clone=function(){var y=new c(null);return this.copy(y),y},c.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},c.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{c.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{c.prototype.inspect=C}else c.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var j=["","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"],F=[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];c.prototype.toString=function(y,w){y=y||10,w=w|0||1;var P;if(y===16||y==="hex"){P="";for(var L=0,N=0,E=0;E<this.length;E++){var A=this.words[E],D=((A<<L|N)&16777215).toString(16);N=A>>>24-L&16777215,L+=2,L>=26&&(L-=26,E--),N!==0||E!==this.length-1?P=j[6-D.length]+D+P:P=D+P}for(N!==0&&(P=N.toString(16)+P);P.length%w!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}if(y===(y|0)&&y>=2&&y<=36){var H=F[y],Y=U[y];P="";var le=this.clone();for(le.negative=0;!le.isZero();){var _e=le.modrn(Y).toString(y);le=le.idivn(Y),le.isZero()?P=_e+P:P=j[H-_e.length]+_e+P}for(this.isZero()&&(P="0"+P);P.length%w!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}u(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},c.prototype.toJSON=function(){return this.toString(16,2)},l&&(c.prototype.toBuffer=function(y,w){return this.toArrayLike(l,y,w)}),c.prototype.toArray=function(y,w){return this.toArrayLike(Array,y,w)};var Z=function(y,w){return y.allocUnsafe?y.allocUnsafe(w):new y(w)};c.prototype.toArrayLike=function(y,w,P){this._strip();var L=this.byteLength(),N=P||Math.max(1,L);u(L<=N,"byte array longer than desired length"),u(N>0,"Requested array length <= 0");var E=Z(y,N),A=w==="le"?"LE":"BE";return this["_toArrayLike"+A](E,L),E},c.prototype._toArrayLikeLE=function(y,w){for(var P=0,L=0,N=0,E=0;N<this.length;N++){var A=this.words[N]<<E|L;y[P++]=A&255,P<y.length&&(y[P++]=A>>8&255),P<y.length&&(y[P++]=A>>16&255),E===6?(P<y.length&&(y[P++]=A>>24&255),L=0,E=0):(L=A>>>24,E+=2)}if(P<y.length)for(y[P++]=L;P<y.length;)y[P++]=0},c.prototype._toArrayLikeBE=function(y,w){for(var P=y.length-1,L=0,N=0,E=0;N<this.length;N++){var A=this.words[N]<<E|L;y[P--]=A&255,P>=0&&(y[P--]=A>>8&255),P>=0&&(y[P--]=A>>16&255),E===6?(P>=0&&(y[P--]=A>>24&255),L=0,E=0):(L=A>>>24,E+=2)}if(P>=0)for(y[P--]=L;P>=0;)y[P--]=0},Math.clz32?c.prototype._countBits=function(y){return 32-Math.clz32(y)}:c.prototype._countBits=function(y){var w=y,P=0;return w>=4096&&(P+=13,w>>>=13),w>=64&&(P+=7,w>>>=7),w>=8&&(P+=4,w>>>=4),w>=2&&(P+=2,w>>>=2),P+w},c.prototype._zeroBits=function(y){if(y===0)return 26;var w=y,P=0;return w&8191||(P+=13,w>>>=13),w&127||(P+=7,w>>>=7),w&15||(P+=4,w>>>=4),w&3||(P+=2,w>>>=2),w&1||P++,P},c.prototype.bitLength=function(){var y=this.words[this.length-1],w=this._countBits(y);return(this.length-1)*26+w};function J(S){for(var y=new Array(S.bitLength()),w=0;w<y.length;w++){var P=w/26|0,L=w%26;y[w]=S.words[P]>>>L&1}return y}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,w=0;w<this.length;w++){var P=this._zeroBits(this.words[w]);if(y+=P,P!==26)break}return y},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},c.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var w=0;w<y.length;w++)this.words[w]=this.words[w]|y.words[w];return this._strip()},c.prototype.ior=function(y){return u((this.negative|y.negative)===0),this.iuor(y)},c.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},c.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},c.prototype.iuand=function(y){var w;this.length>y.length?w=y:w=this;for(var P=0;P<w.length;P++)this.words[P]=this.words[P]&y.words[P];return this.length=w.length,this._strip()},c.prototype.iand=function(y){return u((this.negative|y.negative)===0),this.iuand(y)},c.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},c.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},c.prototype.iuxor=function(y){var w,P;this.length>y.length?(w=this,P=y):(w=y,P=this);for(var L=0;L<P.length;L++)this.words[L]=w.words[L]^P.words[L];if(this!==w)for(;L<w.length;L++)this.words[L]=w.words[L];return this.length=w.length,this._strip()},c.prototype.ixor=function(y){return u((this.negative|y.negative)===0),this.iuxor(y)},c.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},c.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},c.prototype.inotn=function(y){u(typeof y=="number"&&y>=0);var w=Math.ceil(y/26)|0,P=y%26;this._expand(w),P>0&&w--;for(var L=0;L<w;L++)this.words[L]=~this.words[L]&67108863;return P>0&&(this.words[L]=~this.words[L]&67108863>>26-P),this._strip()},c.prototype.notn=function(y){return this.clone().inotn(y)},c.prototype.setn=function(y,w){u(typeof y=="number"&&y>=0);var P=y/26|0,L=y%26;return this._expand(P+1),w?this.words[P]=this.words[P]|1<<L:this.words[P]=this.words[P]&~(1<<L),this._strip()},c.prototype.iadd=function(y){var w;if(this.negative!==0&&y.negative===0)return this.negative=0,w=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,w=this.isub(y),y.negative=1,w._normSign();var P,L;this.length>y.length?(P=this,L=y):(P=y,L=this);for(var N=0,E=0;E<L.length;E++)w=(P.words[E]|0)+(L.words[E]|0)+N,this.words[E]=w&67108863,N=w>>>26;for(;N!==0&&E<P.length;E++)w=(P.words[E]|0)+N,this.words[E]=w&67108863,N=w>>>26;if(this.length=P.length,N!==0)this.words[this.length]=N,this.length++;else if(P!==this)for(;E<P.length;E++)this.words[E]=P.words[E];return this},c.prototype.add=function(y){var w;return y.negative!==0&&this.negative===0?(y.negative=0,w=this.sub(y),y.negative^=1,w):y.negative===0&&this.negative!==0?(this.negative=0,w=y.sub(this),this.negative=1,w):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},c.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var w=this.iadd(y);return y.negative=1,w._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var P=this.cmp(y);if(P===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,N;P>0?(L=this,N=y):(L=y,N=this);for(var E=0,A=0;A<N.length;A++)w=(L.words[A]|0)-(N.words[A]|0)+E,E=w>>26,this.words[A]=w&67108863;for(;E!==0&&A<L.length;A++)w=(L.words[A]|0)+E,E=w>>26,this.words[A]=w&67108863;if(E===0&&A<L.length&&L!==this)for(;A<L.length;A++)this.words[A]=L.words[A];return this.length=Math.max(this.length,A),L!==this&&(this.negative=1),this._strip()},c.prototype.sub=function(y){return this.clone().isub(y)};function X(S,y,w){w.negative=y.negative^S.negative;var P=S.length+y.length|0;w.length=P,P=P-1|0;var L=S.words[0]|0,N=y.words[0]|0,E=L*N,A=E&67108863,D=E/67108864|0;w.words[0]=A;for(var H=1;H<P;H++){for(var Y=D>>>26,le=D&67108863,_e=Math.min(H,y.length-1),he=Math.max(0,H-S.length+1);he<=_e;he++){var fe=H-he|0;L=S.words[fe]|0,N=y.words[he]|0,E=L*N+le,Y+=E/67108864|0,le=E&67108863}w.words[H]=le|0,D=Y|0}return D!==0?w.words[H]=D|0:w.length--,w._strip()}var Q=function(y,w,P){var L=y.words,N=w.words,E=P.words,A=0,D,H,Y,le=L[0]|0,_e=le&8191,he=le>>>13,fe=L[1]|0,ve=fe&8191,ge=fe>>>13,Ie=L[2]|0,ue=Ie&8191,ce=Ie>>>13,Te=L[3]|0,ke=Te&8191,He=Te>>>13,Qe=L[4]|0,it=Qe&8191,rt=Qe>>>13,Fe=L[5]|0,wt=Fe&8191,et=Fe>>>13,At=L[6]|0,gt=At&8191,$e=At>>>13,Me=L[7]|0,Ze=Me&8191,ze=Me>>>13,Ge=L[8]|0,ht=Ge&8191,oe=Ge>>>13,ee=L[9]|0,re=ee&8191,be=ee>>>13,Pe=N[0]|0,Ne=Pe&8191,Oe=Pe>>>13,ut=N[1]|0,lt=ut&8191,Je=ut>>>13,bt=N[2]|0,vt=bt&8191,ot=bt>>>13,Et=N[3]|0,Bt=Et&8191,Se=Et>>>13,ye=N[4]|0,xe=ye&8191,Be=ye>>>13,Le=N[5]|0,je=Le&8191,qe=Le>>>13,Xe=N[6]|0,at=Xe&8191,Ve=Xe>>>13,dt=N[7]|0,pt=dt&8191,Ye=dt>>>13,_t=N[8]|0,yt=_t&8191,ct=_t>>>13,$t=N[9]|0,Ct=$t&8191,Nt=$t>>>13;P.negative=y.negative^w.negative,P.length=19,D=Math.imul(_e,Ne),H=Math.imul(_e,Oe),H=H+Math.imul(he,Ne)|0,Y=Math.imul(he,Oe);var Jt=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,D=Math.imul(ve,Ne),H=Math.imul(ve,Oe),H=H+Math.imul(ge,Ne)|0,Y=Math.imul(ge,Oe),D=D+Math.imul(_e,lt)|0,H=H+Math.imul(_e,Je)|0,H=H+Math.imul(he,lt)|0,Y=Y+Math.imul(he,Je)|0;var Qt=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,D=Math.imul(ue,Ne),H=Math.imul(ue,Oe),H=H+Math.imul(ce,Ne)|0,Y=Math.imul(ce,Oe),D=D+Math.imul(ve,lt)|0,H=H+Math.imul(ve,Je)|0,H=H+Math.imul(ge,lt)|0,Y=Y+Math.imul(ge,Je)|0,D=D+Math.imul(_e,vt)|0,H=H+Math.imul(_e,ot)|0,H=H+Math.imul(he,vt)|0,Y=Y+Math.imul(he,ot)|0;var Wt=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,D=Math.imul(ke,Ne),H=Math.imul(ke,Oe),H=H+Math.imul(He,Ne)|0,Y=Math.imul(He,Oe),D=D+Math.imul(ue,lt)|0,H=H+Math.imul(ue,Je)|0,H=H+Math.imul(ce,lt)|0,Y=Y+Math.imul(ce,Je)|0,D=D+Math.imul(ve,vt)|0,H=H+Math.imul(ve,ot)|0,H=H+Math.imul(ge,vt)|0,Y=Y+Math.imul(ge,ot)|0,D=D+Math.imul(_e,Bt)|0,H=H+Math.imul(_e,Se)|0,H=H+Math.imul(he,Bt)|0,Y=Y+Math.imul(he,Se)|0;var ur=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(ur>>>26)|0,ur&=67108863,D=Math.imul(it,Ne),H=Math.imul(it,Oe),H=H+Math.imul(rt,Ne)|0,Y=Math.imul(rt,Oe),D=D+Math.imul(ke,lt)|0,H=H+Math.imul(ke,Je)|0,H=H+Math.imul(He,lt)|0,Y=Y+Math.imul(He,Je)|0,D=D+Math.imul(ue,vt)|0,H=H+Math.imul(ue,ot)|0,H=H+Math.imul(ce,vt)|0,Y=Y+Math.imul(ce,ot)|0,D=D+Math.imul(ve,Bt)|0,H=H+Math.imul(ve,Se)|0,H=H+Math.imul(ge,Bt)|0,Y=Y+Math.imul(ge,Se)|0,D=D+Math.imul(_e,xe)|0,H=H+Math.imul(_e,Be)|0,H=H+Math.imul(he,xe)|0,Y=Y+Math.imul(he,Be)|0;var vr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(vr>>>26)|0,vr&=67108863,D=Math.imul(wt,Ne),H=Math.imul(wt,Oe),H=H+Math.imul(et,Ne)|0,Y=Math.imul(et,Oe),D=D+Math.imul(it,lt)|0,H=H+Math.imul(it,Je)|0,H=H+Math.imul(rt,lt)|0,Y=Y+Math.imul(rt,Je)|0,D=D+Math.imul(ke,vt)|0,H=H+Math.imul(ke,ot)|0,H=H+Math.imul(He,vt)|0,Y=Y+Math.imul(He,ot)|0,D=D+Math.imul(ue,Bt)|0,H=H+Math.imul(ue,Se)|0,H=H+Math.imul(ce,Bt)|0,Y=Y+Math.imul(ce,Se)|0,D=D+Math.imul(ve,xe)|0,H=H+Math.imul(ve,Be)|0,H=H+Math.imul(ge,xe)|0,Y=Y+Math.imul(ge,Be)|0,D=D+Math.imul(_e,je)|0,H=H+Math.imul(_e,qe)|0,H=H+Math.imul(he,je)|0,Y=Y+Math.imul(he,qe)|0;var nr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(nr>>>26)|0,nr&=67108863,D=Math.imul(gt,Ne),H=Math.imul(gt,Oe),H=H+Math.imul($e,Ne)|0,Y=Math.imul($e,Oe),D=D+Math.imul(wt,lt)|0,H=H+Math.imul(wt,Je)|0,H=H+Math.imul(et,lt)|0,Y=Y+Math.imul(et,Je)|0,D=D+Math.imul(it,vt)|0,H=H+Math.imul(it,ot)|0,H=H+Math.imul(rt,vt)|0,Y=Y+Math.imul(rt,ot)|0,D=D+Math.imul(ke,Bt)|0,H=H+Math.imul(ke,Se)|0,H=H+Math.imul(He,Bt)|0,Y=Y+Math.imul(He,Se)|0,D=D+Math.imul(ue,xe)|0,H=H+Math.imul(ue,Be)|0,H=H+Math.imul(ce,xe)|0,Y=Y+Math.imul(ce,Be)|0,D=D+Math.imul(ve,je)|0,H=H+Math.imul(ve,qe)|0,H=H+Math.imul(ge,je)|0,Y=Y+Math.imul(ge,qe)|0,D=D+Math.imul(_e,at)|0,H=H+Math.imul(_e,Ve)|0,H=H+Math.imul(he,at)|0,Y=Y+Math.imul(he,Ve)|0;var br=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(br>>>26)|0,br&=67108863,D=Math.imul(Ze,Ne),H=Math.imul(Ze,Oe),H=H+Math.imul(ze,Ne)|0,Y=Math.imul(ze,Oe),D=D+Math.imul(gt,lt)|0,H=H+Math.imul(gt,Je)|0,H=H+Math.imul($e,lt)|0,Y=Y+Math.imul($e,Je)|0,D=D+Math.imul(wt,vt)|0,H=H+Math.imul(wt,ot)|0,H=H+Math.imul(et,vt)|0,Y=Y+Math.imul(et,ot)|0,D=D+Math.imul(it,Bt)|0,H=H+Math.imul(it,Se)|0,H=H+Math.imul(rt,Bt)|0,Y=Y+Math.imul(rt,Se)|0,D=D+Math.imul(ke,xe)|0,H=H+Math.imul(ke,Be)|0,H=H+Math.imul(He,xe)|0,Y=Y+Math.imul(He,Be)|0,D=D+Math.imul(ue,je)|0,H=H+Math.imul(ue,qe)|0,H=H+Math.imul(ce,je)|0,Y=Y+Math.imul(ce,qe)|0,D=D+Math.imul(ve,at)|0,H=H+Math.imul(ve,Ve)|0,H=H+Math.imul(ge,at)|0,Y=Y+Math.imul(ge,Ve)|0,D=D+Math.imul(_e,pt)|0,H=H+Math.imul(_e,Ye)|0,H=H+Math.imul(he,pt)|0,Y=Y+Math.imul(he,Ye)|0;var ir=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(ir>>>26)|0,ir&=67108863,D=Math.imul(ht,Ne),H=Math.imul(ht,Oe),H=H+Math.imul(oe,Ne)|0,Y=Math.imul(oe,Oe),D=D+Math.imul(Ze,lt)|0,H=H+Math.imul(Ze,Je)|0,H=H+Math.imul(ze,lt)|0,Y=Y+Math.imul(ze,Je)|0,D=D+Math.imul(gt,vt)|0,H=H+Math.imul(gt,ot)|0,H=H+Math.imul($e,vt)|0,Y=Y+Math.imul($e,ot)|0,D=D+Math.imul(wt,Bt)|0,H=H+Math.imul(wt,Se)|0,H=H+Math.imul(et,Bt)|0,Y=Y+Math.imul(et,Se)|0,D=D+Math.imul(it,xe)|0,H=H+Math.imul(it,Be)|0,H=H+Math.imul(rt,xe)|0,Y=Y+Math.imul(rt,Be)|0,D=D+Math.imul(ke,je)|0,H=H+Math.imul(ke,qe)|0,H=H+Math.imul(He,je)|0,Y=Y+Math.imul(He,qe)|0,D=D+Math.imul(ue,at)|0,H=H+Math.imul(ue,Ve)|0,H=H+Math.imul(ce,at)|0,Y=Y+Math.imul(ce,Ve)|0,D=D+Math.imul(ve,pt)|0,H=H+Math.imul(ve,Ye)|0,H=H+Math.imul(ge,pt)|0,Y=Y+Math.imul(ge,Ye)|0,D=D+Math.imul(_e,yt)|0,H=H+Math.imul(_e,ct)|0,H=H+Math.imul(he,yt)|0,Y=Y+Math.imul(he,ct)|0;var gr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(gr>>>26)|0,gr&=67108863,D=Math.imul(re,Ne),H=Math.imul(re,Oe),H=H+Math.imul(be,Ne)|0,Y=Math.imul(be,Oe),D=D+Math.imul(ht,lt)|0,H=H+Math.imul(ht,Je)|0,H=H+Math.imul(oe,lt)|0,Y=Y+Math.imul(oe,Je)|0,D=D+Math.imul(Ze,vt)|0,H=H+Math.imul(Ze,ot)|0,H=H+Math.imul(ze,vt)|0,Y=Y+Math.imul(ze,ot)|0,D=D+Math.imul(gt,Bt)|0,H=H+Math.imul(gt,Se)|0,H=H+Math.imul($e,Bt)|0,Y=Y+Math.imul($e,Se)|0,D=D+Math.imul(wt,xe)|0,H=H+Math.imul(wt,Be)|0,H=H+Math.imul(et,xe)|0,Y=Y+Math.imul(et,Be)|0,D=D+Math.imul(it,je)|0,H=H+Math.imul(it,qe)|0,H=H+Math.imul(rt,je)|0,Y=Y+Math.imul(rt,qe)|0,D=D+Math.imul(ke,at)|0,H=H+Math.imul(ke,Ve)|0,H=H+Math.imul(He,at)|0,Y=Y+Math.imul(He,Ve)|0,D=D+Math.imul(ue,pt)|0,H=H+Math.imul(ue,Ye)|0,H=H+Math.imul(ce,pt)|0,Y=Y+Math.imul(ce,Ye)|0,D=D+Math.imul(ve,yt)|0,H=H+Math.imul(ve,ct)|0,H=H+Math.imul(ge,yt)|0,Y=Y+Math.imul(ge,ct)|0,D=D+Math.imul(_e,Ct)|0,H=H+Math.imul(_e,Nt)|0,H=H+Math.imul(he,Ct)|0,Y=Y+Math.imul(he,Nt)|0;var yr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(yr>>>26)|0,yr&=67108863,D=Math.imul(re,lt),H=Math.imul(re,Je),H=H+Math.imul(be,lt)|0,Y=Math.imul(be,Je),D=D+Math.imul(ht,vt)|0,H=H+Math.imul(ht,ot)|0,H=H+Math.imul(oe,vt)|0,Y=Y+Math.imul(oe,ot)|0,D=D+Math.imul(Ze,Bt)|0,H=H+Math.imul(Ze,Se)|0,H=H+Math.imul(ze,Bt)|0,Y=Y+Math.imul(ze,Se)|0,D=D+Math.imul(gt,xe)|0,H=H+Math.imul(gt,Be)|0,H=H+Math.imul($e,xe)|0,Y=Y+Math.imul($e,Be)|0,D=D+Math.imul(wt,je)|0,H=H+Math.imul(wt,qe)|0,H=H+Math.imul(et,je)|0,Y=Y+Math.imul(et,qe)|0,D=D+Math.imul(it,at)|0,H=H+Math.imul(it,Ve)|0,H=H+Math.imul(rt,at)|0,Y=Y+Math.imul(rt,Ve)|0,D=D+Math.imul(ke,pt)|0,H=H+Math.imul(ke,Ye)|0,H=H+Math.imul(He,pt)|0,Y=Y+Math.imul(He,Ye)|0,D=D+Math.imul(ue,yt)|0,H=H+Math.imul(ue,ct)|0,H=H+Math.imul(ce,yt)|0,Y=Y+Math.imul(ce,ct)|0,D=D+Math.imul(ve,Ct)|0,H=H+Math.imul(ve,Nt)|0,H=H+Math.imul(ge,Ct)|0,Y=Y+Math.imul(ge,Nt)|0;var wr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(wr>>>26)|0,wr&=67108863,D=Math.imul(re,vt),H=Math.imul(re,ot),H=H+Math.imul(be,vt)|0,Y=Math.imul(be,ot),D=D+Math.imul(ht,Bt)|0,H=H+Math.imul(ht,Se)|0,H=H+Math.imul(oe,Bt)|0,Y=Y+Math.imul(oe,Se)|0,D=D+Math.imul(Ze,xe)|0,H=H+Math.imul(Ze,Be)|0,H=H+Math.imul(ze,xe)|0,Y=Y+Math.imul(ze,Be)|0,D=D+Math.imul(gt,je)|0,H=H+Math.imul(gt,qe)|0,H=H+Math.imul($e,je)|0,Y=Y+Math.imul($e,qe)|0,D=D+Math.imul(wt,at)|0,H=H+Math.imul(wt,Ve)|0,H=H+Math.imul(et,at)|0,Y=Y+Math.imul(et,Ve)|0,D=D+Math.imul(it,pt)|0,H=H+Math.imul(it,Ye)|0,H=H+Math.imul(rt,pt)|0,Y=Y+Math.imul(rt,Ye)|0,D=D+Math.imul(ke,yt)|0,H=H+Math.imul(ke,ct)|0,H=H+Math.imul(He,yt)|0,Y=Y+Math.imul(He,ct)|0,D=D+Math.imul(ue,Ct)|0,H=H+Math.imul(ue,Nt)|0,H=H+Math.imul(ce,Ct)|0,Y=Y+Math.imul(ce,Nt)|0;var cr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(cr>>>26)|0,cr&=67108863,D=Math.imul(re,Bt),H=Math.imul(re,Se),H=H+Math.imul(be,Bt)|0,Y=Math.imul(be,Se),D=D+Math.imul(ht,xe)|0,H=H+Math.imul(ht,Be)|0,H=H+Math.imul(oe,xe)|0,Y=Y+Math.imul(oe,Be)|0,D=D+Math.imul(Ze,je)|0,H=H+Math.imul(Ze,qe)|0,H=H+Math.imul(ze,je)|0,Y=Y+Math.imul(ze,qe)|0,D=D+Math.imul(gt,at)|0,H=H+Math.imul(gt,Ve)|0,H=H+Math.imul($e,at)|0,Y=Y+Math.imul($e,Ve)|0,D=D+Math.imul(wt,pt)|0,H=H+Math.imul(wt,Ye)|0,H=H+Math.imul(et,pt)|0,Y=Y+Math.imul(et,Ye)|0,D=D+Math.imul(it,yt)|0,H=H+Math.imul(it,ct)|0,H=H+Math.imul(rt,yt)|0,Y=Y+Math.imul(rt,ct)|0,D=D+Math.imul(ke,Ct)|0,H=H+Math.imul(ke,Nt)|0,H=H+Math.imul(He,Ct)|0,Y=Y+Math.imul(He,Nt)|0;var dr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(dr>>>26)|0,dr&=67108863,D=Math.imul(re,xe),H=Math.imul(re,Be),H=H+Math.imul(be,xe)|0,Y=Math.imul(be,Be),D=D+Math.imul(ht,je)|0,H=H+Math.imul(ht,qe)|0,H=H+Math.imul(oe,je)|0,Y=Y+Math.imul(oe,qe)|0,D=D+Math.imul(Ze,at)|0,H=H+Math.imul(Ze,Ve)|0,H=H+Math.imul(ze,at)|0,Y=Y+Math.imul(ze,Ve)|0,D=D+Math.imul(gt,pt)|0,H=H+Math.imul(gt,Ye)|0,H=H+Math.imul($e,pt)|0,Y=Y+Math.imul($e,Ye)|0,D=D+Math.imul(wt,yt)|0,H=H+Math.imul(wt,ct)|0,H=H+Math.imul(et,yt)|0,Y=Y+Math.imul(et,ct)|0,D=D+Math.imul(it,Ct)|0,H=H+Math.imul(it,Nt)|0,H=H+Math.imul(rt,Ct)|0,Y=Y+Math.imul(rt,Nt)|0;var lr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(lr>>>26)|0,lr&=67108863,D=Math.imul(re,je),H=Math.imul(re,qe),H=H+Math.imul(be,je)|0,Y=Math.imul(be,qe),D=D+Math.imul(ht,at)|0,H=H+Math.imul(ht,Ve)|0,H=H+Math.imul(oe,at)|0,Y=Y+Math.imul(oe,Ve)|0,D=D+Math.imul(Ze,pt)|0,H=H+Math.imul(Ze,Ye)|0,H=H+Math.imul(ze,pt)|0,Y=Y+Math.imul(ze,Ye)|0,D=D+Math.imul(gt,yt)|0,H=H+Math.imul(gt,ct)|0,H=H+Math.imul($e,yt)|0,Y=Y+Math.imul($e,ct)|0,D=D+Math.imul(wt,Ct)|0,H=H+Math.imul(wt,Nt)|0,H=H+Math.imul(et,Ct)|0,Y=Y+Math.imul(et,Nt)|0;var _r=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(_r>>>26)|0,_r&=67108863,D=Math.imul(re,at),H=Math.imul(re,Ve),H=H+Math.imul(be,at)|0,Y=Math.imul(be,Ve),D=D+Math.imul(ht,pt)|0,H=H+Math.imul(ht,Ye)|0,H=H+Math.imul(oe,pt)|0,Y=Y+Math.imul(oe,Ye)|0,D=D+Math.imul(Ze,yt)|0,H=H+Math.imul(Ze,ct)|0,H=H+Math.imul(ze,yt)|0,Y=Y+Math.imul(ze,ct)|0,D=D+Math.imul(gt,Ct)|0,H=H+Math.imul(gt,Nt)|0,H=H+Math.imul($e,Ct)|0,Y=Y+Math.imul($e,Nt)|0;var Ar=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,D=Math.imul(re,pt),H=Math.imul(re,Ye),H=H+Math.imul(be,pt)|0,Y=Math.imul(be,Ye),D=D+Math.imul(ht,yt)|0,H=H+Math.imul(ht,ct)|0,H=H+Math.imul(oe,yt)|0,Y=Y+Math.imul(oe,ct)|0,D=D+Math.imul(Ze,Ct)|0,H=H+Math.imul(Ze,Nt)|0,H=H+Math.imul(ze,Ct)|0,Y=Y+Math.imul(ze,Nt)|0;var Nr=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,D=Math.imul(re,yt),H=Math.imul(re,ct),H=H+Math.imul(be,yt)|0,Y=Math.imul(be,ct),D=D+Math.imul(ht,Ct)|0,H=H+Math.imul(ht,Nt)|0,H=H+Math.imul(oe,Ct)|0,Y=Y+Math.imul(oe,Nt)|0;var Gn=(A+D|0)+((H&8191)<<13)|0;A=(Y+(H>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,D=Math.imul(re,Ct),H=Math.imul(re,Nt),H=H+Math.imul(be,Ct)|0,Y=Math.imul(be,Nt);var On=(A+D|0)+((H&8191)<<13)|0;return A=(Y+(H>>>13)|0)+(On>>>26)|0,On&=67108863,E[0]=Jt,E[1]=Qt,E[2]=Wt,E[3]=ur,E[4]=vr,E[5]=nr,E[6]=br,E[7]=ir,E[8]=gr,E[9]=yr,E[10]=wr,E[11]=cr,E[12]=dr,E[13]=lr,E[14]=_r,E[15]=Ar,E[16]=Nr,E[17]=Gn,E[18]=On,A!==0&&(E[19]=A,P.length++),P};Math.imul||(Q=X);function te(S,y,w){w.negative=y.negative^S.negative,w.length=S.length+y.length;for(var P=0,L=0,N=0;N<w.length-1;N++){var E=L;L=0;for(var A=P&67108863,D=Math.min(N,y.length-1),H=Math.max(0,N-S.length+1);H<=D;H++){var Y=N-H,le=S.words[Y]|0,_e=y.words[H]|0,he=le*_e,fe=he&67108863;E=E+(he/67108864|0)|0,fe=fe+A|0,A=fe&67108863,E=E+(fe>>>26)|0,L+=E>>>26,E&=67108863}w.words[N]=A,P=E,E=L}return P!==0?w.words[N]=P:w.length--,w._strip()}function se(S,y,w){return te(S,y,w)}c.prototype.mulTo=function(y,w){var P,L=this.length+y.length;return this.length===10&&y.length===10?P=Q(this,y,w):L<63?P=X(this,y,w):L<1024?P=te(this,y,w):P=se(this,y,w),P},c.prototype.mul=function(y){var w=new c(null);return w.words=new Array(this.length+y.length),this.mulTo(y,w)},c.prototype.mulf=function(y){var w=new c(null);return w.words=new Array(this.length+y.length),se(this,y,w)},c.prototype.imul=function(y){return this.clone().mulTo(y,this)},c.prototype.imuln=function(y){var w=y<0;w&&(y=-y),u(typeof y=="number"),u(y<67108864);for(var P=0,L=0;L<this.length;L++){var N=(this.words[L]|0)*y,E=(N&67108863)+(P&67108863);P>>=26,P+=N/67108864|0,P+=E>>>26,this.words[L]=E&67108863}return P!==0&&(this.words[L]=P,this.length++),w?this.ineg():this},c.prototype.muln=function(y){return this.clone().imuln(y)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(y){var w=J(y);if(w.length===0)return new c(1);for(var P=this,L=0;L<w.length&&w[L]===0;L++,P=P.sqr());if(++L<w.length)for(var N=P.sqr();L<w.length;L++,N=N.sqr())w[L]!==0&&(P=P.mul(N));return P},c.prototype.iushln=function(y){u(typeof y=="number"&&y>=0);var w=y%26,P=(y-w)/26,L=67108863>>>26-w<<26-w,N;if(w!==0){var E=0;for(N=0;N<this.length;N++){var A=this.words[N]&L,D=(this.words[N]|0)-A<<w;this.words[N]=D|E,E=A>>>26-w}E&&(this.words[N]=E,this.length++)}if(P!==0){for(N=this.length-1;N>=0;N--)this.words[N+P]=this.words[N];for(N=0;N<P;N++)this.words[N]=0;this.length+=P}return this._strip()},c.prototype.ishln=function(y){return u(this.negative===0),this.iushln(y)},c.prototype.iushrn=function(y,w,P){u(typeof y=="number"&&y>=0);var L;w?L=(w-w%26)/26:L=0;var N=y%26,E=Math.min((y-N)/26,this.length),A=67108863^67108863>>>N<<N,D=P;if(L-=E,L=Math.max(0,L),D){for(var H=0;H<E;H++)D.words[H]=this.words[H];D.length=E}if(E!==0)if(this.length>E)for(this.length-=E,H=0;H<this.length;H++)this.words[H]=this.words[H+E];else this.words[0]=0,this.length=1;var Y=0;for(H=this.length-1;H>=0&&(Y!==0||H>=L);H--){var le=this.words[H]|0;this.words[H]=Y<<26-N|le>>>N,Y=le&A}return D&&Y!==0&&(D.words[D.length++]=Y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},c.prototype.ishrn=function(y,w,P){return u(this.negative===0),this.iushrn(y,w,P)},c.prototype.shln=function(y){return this.clone().ishln(y)},c.prototype.ushln=function(y){return this.clone().iushln(y)},c.prototype.shrn=function(y){return this.clone().ishrn(y)},c.prototype.ushrn=function(y){return this.clone().iushrn(y)},c.prototype.testn=function(y){u(typeof y=="number"&&y>=0);var w=y%26,P=(y-w)/26,L=1<<w;if(this.length<=P)return!1;var N=this.words[P];return!!(N&L)},c.prototype.imaskn=function(y){u(typeof y=="number"&&y>=0);var w=y%26,P=(y-w)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=P)return this;if(w!==0&&P++,this.length=Math.min(P,this.length),w!==0){var L=67108863^67108863>>>w<<w;this.words[this.length-1]&=L}return this._strip()},c.prototype.maskn=function(y){return this.clone().imaskn(y)},c.prototype.iaddn=function(y){return u(typeof y=="number"),u(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},c.prototype._iaddn=function(y){this.words[0]+=y;for(var w=0;w<this.length&&this.words[w]>=67108864;w++)this.words[w]-=67108864,w===this.length-1?this.words[w+1]=1:this.words[w+1]++;return this.length=Math.max(this.length,w+1),this},c.prototype.isubn=function(y){if(u(typeof y=="number"),u(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var w=0;w<this.length&&this.words[w]<0;w++)this.words[w]+=67108864,this.words[w+1]-=1;return this._strip()},c.prototype.addn=function(y){return this.clone().iaddn(y)},c.prototype.subn=function(y){return this.clone().isubn(y)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(y,w,P){var L=y.length+P,N;this._expand(L);var E,A=0;for(N=0;N<y.length;N++){E=(this.words[N+P]|0)+A;var D=(y.words[N]|0)*w;E-=D&67108863,A=(E>>26)-(D/67108864|0),this.words[N+P]=E&67108863}for(;N<this.length-P;N++)E=(this.words[N+P]|0)+A,A=E>>26,this.words[N+P]=E&67108863;if(A===0)return this._strip();for(u(A===-1),A=0,N=0;N<this.length;N++)E=-(this.words[N]|0)+A,A=E>>26,this.words[N]=E&67108863;return this.negative=1,this._strip()},c.prototype._wordDiv=function(y,w){var P=this.length-y.length,L=this.clone(),N=y,E=N.words[N.length-1]|0,A=this._countBits(E);P=26-A,P!==0&&(N=N.ushln(P),L.iushln(P),E=N.words[N.length-1]|0);var D=L.length-N.length,H;if(w!=="mod"){H=new c(null),H.length=D+1,H.words=new Array(H.length);for(var Y=0;Y<H.length;Y++)H.words[Y]=0}var le=L.clone()._ishlnsubmul(N,1,D);le.negative===0&&(L=le,H&&(H.words[D]=1));for(var _e=D-1;_e>=0;_e--){var he=(L.words[N.length+_e]|0)*67108864+(L.words[N.length+_e-1]|0);for(he=Math.min(he/E|0,67108863),L._ishlnsubmul(N,he,_e);L.negative!==0;)he--,L.negative=0,L._ishlnsubmul(N,1,_e),L.isZero()||(L.negative^=1);H&&(H.words[_e]=he)}return H&&H._strip(),L._strip(),w!=="div"&&P!==0&&L.iushrn(P),{div:H||null,mod:L}},c.prototype.divmod=function(y,w,P){if(u(!y.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var L,N,E;return this.negative!==0&&y.negative===0?(E=this.neg().divmod(y,w),w!=="mod"&&(L=E.div.neg()),w!=="div"&&(N=E.mod.neg(),P&&N.negative!==0&&N.iadd(y)),{div:L,mod:N}):this.negative===0&&y.negative!==0?(E=this.divmod(y.neg(),w),w!=="mod"&&(L=E.div.neg()),{div:L,mod:E.mod}):this.negative&y.negative?(E=this.neg().divmod(y.neg(),w),w!=="div"&&(N=E.mod.neg(),P&&N.negative!==0&&N.isub(y)),{div:E.div,mod:N}):y.length>this.length||this.cmp(y)<0?{div:new c(0),mod:this}:y.length===1?w==="div"?{div:this.divn(y.words[0]),mod:null}:w==="mod"?{div:null,mod:new c(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new c(this.modrn(y.words[0]))}:this._wordDiv(y,w)},c.prototype.div=function(y){return this.divmod(y,"div",!1).div},c.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},c.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},c.prototype.divRound=function(y){var w=this.divmod(y);if(w.mod.isZero())return w.div;var P=w.div.negative!==0?w.mod.isub(y):w.mod,L=y.ushrn(1),N=y.andln(1),E=P.cmp(L);return E<0||N===1&&E===0?w.div:w.div.negative!==0?w.div.isubn(1):w.div.iaddn(1)},c.prototype.modrn=function(y){var w=y<0;w&&(y=-y),u(y<=67108863);for(var P=(1<<26)%y,L=0,N=this.length-1;N>=0;N--)L=(P*L+(this.words[N]|0))%y;return w?-L:L},c.prototype.modn=function(y){return this.modrn(y)},c.prototype.idivn=function(y){var w=y<0;w&&(y=-y),u(y<=67108863);for(var P=0,L=this.length-1;L>=0;L--){var N=(this.words[L]|0)+P*67108864;this.words[L]=N/y|0,P=N%y}return this._strip(),w?this.ineg():this},c.prototype.divn=function(y){return this.clone().idivn(y)},c.prototype.egcd=function(y){u(y.negative===0),u(!y.isZero());var w=this,P=y.clone();w.negative!==0?w=w.umod(y):w=w.clone();for(var L=new c(1),N=new c(0),E=new c(0),A=new c(1),D=0;w.isEven()&&P.isEven();)w.iushrn(1),P.iushrn(1),++D;for(var H=P.clone(),Y=w.clone();!w.isZero();){for(var le=0,_e=1;!(w.words[0]&_e)&&le<26;++le,_e<<=1);if(le>0)for(w.iushrn(le);le-- >0;)(L.isOdd()||N.isOdd())&&(L.iadd(H),N.isub(Y)),L.iushrn(1),N.iushrn(1);for(var he=0,fe=1;!(P.words[0]&fe)&&he<26;++he,fe<<=1);if(he>0)for(P.iushrn(he);he-- >0;)(E.isOdd()||A.isOdd())&&(E.iadd(H),A.isub(Y)),E.iushrn(1),A.iushrn(1);w.cmp(P)>=0?(w.isub(P),L.isub(E),N.isub(A)):(P.isub(w),E.isub(L),A.isub(N))}return{a:E,b:A,gcd:P.iushln(D)}},c.prototype._invmp=function(y){u(y.negative===0),u(!y.isZero());var w=this,P=y.clone();w.negative!==0?w=w.umod(y):w=w.clone();for(var L=new c(1),N=new c(0),E=P.clone();w.cmpn(1)>0&&P.cmpn(1)>0;){for(var A=0,D=1;!(w.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(w.iushrn(A);A-- >0;)L.isOdd()&&L.iadd(E),L.iushrn(1);for(var H=0,Y=1;!(P.words[0]&Y)&&H<26;++H,Y<<=1);if(H>0)for(P.iushrn(H);H-- >0;)N.isOdd()&&N.iadd(E),N.iushrn(1);w.cmp(P)>=0?(w.isub(P),L.isub(N)):(P.isub(w),N.isub(L))}var le;return w.cmpn(1)===0?le=L:le=N,le.cmpn(0)<0&&le.iadd(y),le},c.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var w=this.clone(),P=y.clone();w.negative=0,P.negative=0;for(var L=0;w.isEven()&&P.isEven();L++)w.iushrn(1),P.iushrn(1);do{for(;w.isEven();)w.iushrn(1);for(;P.isEven();)P.iushrn(1);var N=w.cmp(P);if(N<0){var E=w;w=P,P=E}else if(N===0||P.cmpn(1)===0)break;w.isub(P)}while(!0);return P.iushln(L)},c.prototype.invm=function(y){return this.egcd(y).a.umod(y)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(y){return this.words[0]&y},c.prototype.bincn=function(y){u(typeof y=="number");var w=y%26,P=(y-w)/26,L=1<<w;if(this.length<=P)return this._expand(P+1),this.words[P]|=L,this;for(var N=L,E=P;N!==0&&E<this.length;E++){var A=this.words[E]|0;A+=N,N=A>>>26,A&=67108863,this.words[E]=A}return N!==0&&(this.words[E]=N,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(y){var w=y<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;this._strip();var P;if(this.length>1)P=1;else{w&&(y=-y),u(y<=67108863,"Number is too big");var L=this.words[0]|0;P=L===y?0:L<y?-1:1}return this.negative!==0?-P|0:P},c.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var w=this.ucmp(y);return this.negative!==0?-w|0:w},c.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var w=0,P=this.length-1;P>=0;P--){var L=this.words[P]|0,N=y.words[P]|0;if(L!==N){L<N?w=-1:L>N&&(w=1);break}}return w},c.prototype.gtn=function(y){return this.cmpn(y)===1},c.prototype.gt=function(y){return this.cmp(y)===1},c.prototype.gten=function(y){return this.cmpn(y)>=0},c.prototype.gte=function(y){return this.cmp(y)>=0},c.prototype.ltn=function(y){return this.cmpn(y)===-1},c.prototype.lt=function(y){return this.cmp(y)===-1},c.prototype.lten=function(y){return this.cmpn(y)<=0},c.prototype.lte=function(y){return this.cmp(y)<=0},c.prototype.eqn=function(y){return this.cmpn(y)===0},c.prototype.eq=function(y){return this.cmp(y)===0},c.red=function(y){return new M(y)},c.prototype.toRed=function(y){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},c.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(y){return this.red=y,this},c.prototype.forceRed=function(y){return u(!this.red,"Already a number in reduction context"),this._forceRed(y)},c.prototype.redAdd=function(y){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},c.prototype.redIAdd=function(y){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},c.prototype.redSub=function(y){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},c.prototype.redISub=function(y){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},c.prototype.redShl=function(y){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},c.prototype.redMul=function(y){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},c.prototype.redIMul=function(y){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},c.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(y){return u(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var pe={k256:null,p224:null,p192:null,p25519:null};function me(S,y){this.name=S,this.p=new c(y,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}me.prototype._tmp=function(){var y=new c(null);return y.words=new Array(Math.ceil(this.n/13)),y},me.prototype.ireduce=function(y){var w=y,P;do this.split(w,this.tmp),w=this.imulK(w),w=w.iadd(this.tmp),P=w.bitLength();while(P>this.n);var L=P<this.n?-1:w.ucmp(this.p);return L===0?(w.words[0]=0,w.length=1):L>0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},me.prototype.split=function(y,w){y.iushrn(this.n,0,w)},me.prototype.imulK=function(y){return y.imul(this.k)};function Ee(){me.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(Ee,me),Ee.prototype.split=function(y,w){for(var P=4194303,L=Math.min(y.length,9),N=0;N<L;N++)w.words[N]=y.words[N];if(w.length=L,y.length<=9){y.words[0]=0,y.length=1;return}var E=y.words[9];for(w.words[w.length++]=E&P,N=10;N<y.length;N++){var A=y.words[N]|0;y.words[N-10]=(A&P)<<4|E>>>22,E=A}E>>>=22,y.words[N-10]=E,E===0&&y.length>10?y.length-=10:y.length-=9},Ee.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var w=0,P=0;P<y.length;P++){var L=y.words[P]|0;w+=L*977,y.words[P]=w&67108863,w=L*64+(w/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function V(){me.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(V,me);function ae(){me.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(ae,me);function ne(){me.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(ne,me),ne.prototype.imulK=function(y){for(var w=0,P=0;P<y.length;P++){var L=(y.words[P]|0)*19+w,N=L&67108863;L>>>=26,y.words[P]=N,w=L}return w!==0&&(y.words[y.length++]=w),y},c._prime=function(y){if(pe[y])return pe[y];var w;if(y==="k256")w=new Ee;else if(y==="p224")w=new V;else if(y==="p192")w=new ae;else if(y==="p25519")w=new ne;else throw new Error("Unknown prime "+y);return pe[y]=w,w};function M(S){if(typeof S=="string"){var y=c._prime(S);this.m=y.p,this.prime=y}else u(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}M.prototype._verify1=function(y){u(y.negative===0,"red works only with positives"),u(y.red,"red works only with red numbers")},M.prototype._verify2=function(y,w){u((y.negative|w.negative)===0,"red works only with positives"),u(y.red&&y.red===w.red,"red works only with red numbers")},M.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(T(y,y.umod(this.m)._forceRed(this)),y)},M.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},M.prototype.add=function(y,w){this._verify2(y,w);var P=y.add(w);return P.cmp(this.m)>=0&&P.isub(this.m),P._forceRed(this)},M.prototype.iadd=function(y,w){this._verify2(y,w);var P=y.iadd(w);return P.cmp(this.m)>=0&&P.isub(this.m),P},M.prototype.sub=function(y,w){this._verify2(y,w);var P=y.sub(w);return P.cmpn(0)<0&&P.iadd(this.m),P._forceRed(this)},M.prototype.isub=function(y,w){this._verify2(y,w);var P=y.isub(w);return P.cmpn(0)<0&&P.iadd(this.m),P},M.prototype.shl=function(y,w){return this._verify1(y),this.imod(y.ushln(w))},M.prototype.imul=function(y,w){return this._verify2(y,w),this.imod(y.imul(w))},M.prototype.mul=function(y,w){return this._verify2(y,w),this.imod(y.mul(w))},M.prototype.isqr=function(y){return this.imul(y,y.clone())},M.prototype.sqr=function(y){return this.mul(y,y)},M.prototype.sqrt=function(y){if(y.isZero())return y.clone();var w=this.m.andln(3);if(u(w%2===1),w===3){var P=this.m.add(new c(1)).iushrn(2);return this.pow(y,P)}for(var L=this.m.subn(1),N=0;!L.isZero()&&L.andln(1)===0;)N++,L.iushrn(1);u(!L.isZero());var E=new c(1).toRed(this),A=E.redNeg(),D=this.m.subn(1).iushrn(1),H=this.m.bitLength();for(H=new c(2*H*H).toRed(this);this.pow(H,D).cmp(A)!==0;)H.redIAdd(A);for(var Y=this.pow(H,L),le=this.pow(y,L.addn(1).iushrn(1)),_e=this.pow(y,L),he=N;_e.cmp(E)!==0;){for(var fe=_e,ve=0;fe.cmp(E)!==0;ve++)fe=fe.redSqr();u(ve<he);var ge=this.pow(Y,new c(1).iushln(he-ve-1));le=le.redMul(ge),Y=ge.redSqr(),_e=_e.redMul(Y),he=ve}return le},M.prototype.invm=function(y){var w=y._invmp(this.m);return w.negative!==0?(w.negative=0,this.imod(w).redNeg()):this.imod(w)},M.prototype.pow=function(y,w){if(w.isZero())return new c(1).toRed(this);if(w.cmpn(1)===0)return y.clone();var P=4,L=new Array(1<<P);L[0]=new c(1).toRed(this),L[1]=y;for(var N=2;N<L.length;N++)L[N]=this.mul(L[N-1],y);var E=L[0],A=0,D=0,H=w.bitLength()%26;for(H===0&&(H=26),N=w.length-1;N>=0;N--){for(var Y=w.words[N],le=H-1;le>=0;le--){var _e=Y>>le&1;if(E!==L[0]&&(E=this.sqr(E)),_e===0&&A===0){D=0;continue}A<<=1,A|=_e,D++,!(D!==P&&(N!==0||le!==0))&&(E=this.mul(E,L[A]),D=0,A=0)}H=26}return E},M.prototype.convertTo=function(y){var w=y.umod(this.m);return w===y?w.clone():w},M.prototype.convertFrom=function(y){var w=y.clone();return w.red=null,w},c.mont=function(y){return new v(y)};function v(S){M.call(this,S),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}d(v,M),v.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},v.prototype.convertFrom=function(y){var w=this.imod(y.mul(this.rinv));return w.red=null,w},v.prototype.imul=function(y,w){if(y.isZero()||w.isZero())return y.words[0]=0,y.length=1,y;var P=y.imul(w),L=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=P.isub(L).iushrn(this.shift),E=N;return N.cmp(this.m)>=0?E=N.isub(this.m):N.cmpn(0)<0&&(E=N.iadd(this.m)),E._forceRed(this)},v.prototype.mul=function(y,w){if(y.isZero()||w.isZero())return new c(0)._forceRed(this);var P=y.mul(w),L=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=P.isub(L).iushrn(this.shift),E=N;return N.cmp(this.m)>=0?E=N.isub(this.m):N.cmpn(0)<0&&(E=N.iadd(this.m)),E._forceRed(this)},v.prototype.invm=function(y){var w=this.imod(y._invmp(this.m).mul(this.r2));return w._forceRed(this)}})(t,commonjsGlobal)}(bn$3);var bnExports$2=bn$3.exports,BN$p=bnExports$2,randomBytes$3=browserExports$1;function blind(t){var e=getr(t),a=e.toRed(BN$p.mont(t.modulus)).redPow(new BN$p(t.publicExponent)).fromRed();return{blinder:a,unblinder:e.invm(t.modulus)}}function getr(t){var e=t.modulus.byteLength(),a;do a=new BN$p(randomBytes$3(e));while(a.cmp(t.modulus)>=0||!a.umod(t.prime1)||!a.umod(t.prime2));return a}function crt$2(t,e){var a=blind(e),u=e.modulus.byteLength(),d=new BN$p(t).mul(a.blinder).umod(e.modulus),c=d.toRed(BN$p.mont(e.prime1)),l=d.toRed(BN$p.mont(e.prime2)),m=e.coefficient,I=e.prime1,O=e.prime2,T=c.redPow(e.exponent1).fromRed(),C=l.redPow(e.exponent2).fromRed(),j=T.isub(C).imul(m).umod(I).imul(O);return C.iadd(j).imul(a.unblinder).umod(e.modulus).toArrayLike(Buffer$N,"be",u)}crt$2.getr=getr;var browserifyRsa=crt$2,elliptic$1={};const name$3="elliptic",version$3="6.5.4",description$3="EC cryptography",main$3="lib/elliptic.js",files$1=["lib"],scripts$3={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository$3={type:"git",url:"git@github.com:indutny/elliptic"},keywords$3=["EC","Elliptic","curve","Cryptography"],author$2="Fedor Indutny <fedor@indutny.com>",license$2="MIT",bugs$1={url:"https://github.com/indutny/elliptic/issues"},homepage$1="https://github.com/indutny/elliptic",devDependencies$3={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$3={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$4={name:name$3,version:version$3,description:description$3,main:main$3,files:files$1,scripts:scripts$3,repository:repository$3,keywords:keywords$3,author:author$2,license:license$2,bugs:bugs$1,homepage:homepage$1,devDependencies:devDependencies$3,dependencies:dependencies$3};var utils$J={},utils$I={};(function(t){var e=t;function a(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var m=[];if(typeof c!="string"){for(var I=0;I<c.length;I++)m[I]=c[I]|0;return m}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var I=0;I<c.length;I+=2)m.push(parseInt(c[I]+c[I+1],16))}else for(var I=0;I<c.length;I++){var O=c.charCodeAt(I),T=O>>8,C=O&255;T?m.push(T,C):m.push(C)}return m}e.toArray=a;function u(c){return c.length===1?"0"+c:c}e.zero2=u;function d(c){for(var l="",m=0;m<c.length;m++)l+=u(c[m].toString(16));return l}e.toHex=d,e.encode=function(l,m){return m==="hex"?d(l):l}})(utils$I),function(t){var e=t,a=bnExports$3,u=minimalisticAssert$1,d=utils$I;e.assert=u,e.toArray=d.toArray,e.zero2=d.zero2,e.toHex=d.toHex,e.encode=d.encode;function c(T,C,j){var F=new Array(Math.max(T.bitLength(),j)+1);F.fill(0);for(var U=1<<C+1,Z=T.clone(),J=0;J<F.length;J++){var X,Q=Z.andln(U-1);Z.isOdd()?(Q>(U>>1)-1?X=(U>>1)-Q:X=Q,Z.isubn(X)):X=0,F[J]=X,Z.iushrn(1)}return F}e.getNAF=c;function l(T,C){var j=[[],[]];T=T.clone(),C=C.clone();for(var F=0,U=0,Z;T.cmpn(-F)>0||C.cmpn(-U)>0;){var J=T.andln(3)+F&3,X=C.andln(3)+U&3;J===3&&(J=-1),X===3&&(X=-1);var Q;J&1?(Z=T.andln(7)+F&7,(Z===3||Z===5)&&X===2?Q=-J:Q=J):Q=0,j[0].push(Q);var te;X&1?(Z=C.andln(7)+U&7,(Z===3||Z===5)&&J===2?te=-X:te=X):te=0,j[1].push(te),2*F===Q+1&&(F=1-F),2*U===te+1&&(U=1-U),T.iushrn(1),C.iushrn(1)}return j}e.getJSF=l;function m(T,C,j){var F="_"+C;T.prototype[C]=function(){return this[F]!==void 0?this[F]:this[F]=j.call(this)}}e.cachedProperty=m;function I(T){return typeof T=="string"?e.toArray(T,"hex"):T}e.parseBytes=I;function O(T){return new a(T,"hex","le")}e.intFromLE=O}(utils$J);var curve$7={},BN$o=bnExports$3,utils$H=utils$J,getNAF$1=utils$H.getNAF,getJSF$1=utils$H.getJSF,assert$z=utils$H.assert;function BaseCurve$1(t,e){this.type=t,this.p=new BN$o(e.p,16),this.red=e.prime?BN$o.red(e.prime):BN$o.mont(this.p),this.zero=new BN$o(0).toRed(this.red),this.one=new BN$o(1).toRed(this.red),this.two=new BN$o(2).toRed(this.red),this.n=e.n&&new BN$o(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 a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$3=BaseCurve$1;BaseCurve$1.prototype.point=function(){throw new Error("Not implemented")},BaseCurve$1.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve$1.prototype._fixedNafMul=function(e,a){assert$z(e.precomputed);var u=e._getDoubles(),d=getNAF$1(a,1,this._bitLength),c=(1<<u.step+1)-(u.step%2===0?2:1);c/=3;var l=[],m,I;for(m=0;m<d.length;m+=u.step){I=0;for(var O=m+u.step-1;O>=m;O--)I=(I<<1)+d[O];l.push(I)}for(var T=this.jpoint(null,null,null),C=this.jpoint(null,null,null),j=c;j>0;j--){for(m=0;m<l.length;m++)I=l[m],I===j?C=C.mixedAdd(u.points[m]):I===-j&&(C=C.mixedAdd(u.points[m].neg()));T=T.add(C)}return T.toP()},BaseCurve$1.prototype._wnafMul=function(e,a){var u=4,d=e._getNAFPoints(u);u=d.wnd;for(var c=d.points,l=getNAF$1(a,u,this._bitLength),m=this.jpoint(null,null,null),I=l.length-1;I>=0;I--){for(var O=0;I>=0&&l[I]===0;I--)O++;if(I>=0&&O++,m=m.dblp(O),I<0)break;var T=l[I];assert$z(T!==0),e.type==="affine"?T>0?m=m.mixedAdd(c[T-1>>1]):m=m.mixedAdd(c[-T-1>>1].neg()):T>0?m=m.add(c[T-1>>1]):m=m.add(c[-T-1>>1].neg())}return e.type==="affine"?m.toP():m},BaseCurve$1.prototype._wnafMulAdd=function(e,a,u,d,c){var l=this._wnafT1,m=this._wnafT2,I=this._wnafT3,O=0,T,C,j;for(T=0;T<d;T++){j=a[T];var F=j._getNAFPoints(e);l[T]=F.wnd,m[T]=F.points}for(T=d-1;T>=1;T-=2){var U=T-1,Z=T;if(l[U]!==1||l[Z]!==1){I[U]=getNAF$1(u[U],l[U],this._bitLength),I[Z]=getNAF$1(u[Z],l[Z],this._bitLength),O=Math.max(I[U].length,O),O=Math.max(I[Z].length,O);continue}var J=[a[U],null,null,a[Z]];a[U].y.cmp(a[Z].y)===0?(J[1]=a[U].add(a[Z]),J[2]=a[U].toJ().mixedAdd(a[Z].neg())):a[U].y.cmp(a[Z].y.redNeg())===0?(J[1]=a[U].toJ().mixedAdd(a[Z]),J[2]=a[U].add(a[Z].neg())):(J[1]=a[U].toJ().mixedAdd(a[Z]),J[2]=a[U].toJ().mixedAdd(a[Z].neg()));var X=[-3,-1,-5,-7,0,7,5,1,3],Q=getJSF$1(u[U],u[Z]);for(O=Math.max(Q[0].length,O),I[U]=new Array(O),I[Z]=new Array(O),C=0;C<O;C++){var te=Q[0][C]|0,se=Q[1][C]|0;I[U][C]=X[(te+1)*3+(se+1)],I[Z][C]=0,m[U]=J}}var pe=this.jpoint(null,null,null),me=this._wnafT4;for(T=O;T>=0;T--){for(var Ee=0;T>=0;){var V=!0;for(C=0;C<d;C++)me[C]=I[C][T]|0,me[C]!==0&&(V=!1);if(!V)break;Ee++,T--}if(T>=0&&Ee++,pe=pe.dblp(Ee),T<0)break;for(C=0;C<d;C++){var ae=me[C];ae!==0&&(ae>0?j=m[C][ae-1>>1]:ae<0&&(j=m[C][-ae-1>>1].neg()),j.type==="affine"?pe=pe.mixedAdd(j):pe=pe.add(j))}}for(T=0;T<d;T++)m[T]=null;return c?pe:pe.toP()};function BasePoint$1(t,e){this.curve=t,this.type=e,this.precomputed=null}BaseCurve$1.BasePoint=BasePoint$1,BasePoint$1.prototype.eq=function(){throw new Error("Not implemented")},BasePoint$1.prototype.validate=function(){return this.curve.validate(this)},BaseCurve$1.prototype.decodePoint=function(e,a){e=utils$H.toArray(e,a);var u=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*u){e[0]===6?assert$z(e[e.length-1]%2===0):e[0]===7&&assert$z(e[e.length-1]%2===1);var d=this.point(e.slice(1,1+u),e.slice(1+u,1+2*u));return d}else if((e[0]===2||e[0]===3)&&e.length-1===u)return this.pointFromX(e.slice(1,1+u),e[0]===3);throw new Error("Unknown point format")},BasePoint$1.prototype.encodeCompressed=function(e){return this.encode(e,!0)},BasePoint$1.prototype._encode=function(e){var a=this.curve.p.byteLength(),u=this.getX().toArray("be",a);return e?[this.getY().isEven()?2:3].concat(u):[4].concat(u,this.getY().toArray("be",a))},BasePoint$1.prototype.encode=function(e,a){return utils$H.encode(this._encode(a),e)},BasePoint$1.prototype.precompute=function(e){if(this.precomputed)return this;var a={doubles:null,naf:null,beta:null};return a.naf=this._getNAFPoints(8),a.doubles=this._getDoubles(4,e),a.beta=this._getBeta(),this.precomputed=a,this},BasePoint$1.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var a=this.precomputed.doubles;return a?a.points.length>=Math.ceil((e.bitLength()+1)/a.step):!1},BasePoint$1.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var u=[this],d=this,c=0;c<a;c+=e){for(var l=0;l<e;l++)d=d.dbl();u.push(d)}return{step:e,points:u}},BasePoint$1.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var a=[this],u=(1<<e)-1,d=u===1?null:this.dbl(),c=1;c<u;c++)a[c]=a[c-1].add(d);return{wnd:e,points:a}},BasePoint$1.prototype._getBeta=function(){return null},BasePoint$1.prototype.dblp=function(e){for(var a=this,u=0;u<e;u++)a=a.dbl();return a};var utils$G=utils$J,BN$n=bnExports$3,inherits$d=inherits_browserExports$2,Base$5=base$3,assert$y=utils$G.assert;function ShortCurve$1(t){Base$5.call(this,"short",t),this.a=new BN$n(t.a,16).toRed(this.red),this.b=new BN$n(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits$d(ShortCurve$1,Base$5);var short$1=ShortCurve$1;ShortCurve$1.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var a,u;if(e.beta)a=new BN$n(e.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);a=d[0].cmp(d[1])<0?d[0]:d[1],a=a.toRed(this.red)}if(e.lambda)u=new BN$n(e.lambda,16);else{var c=this._getEndoRoots(this.n);this.g.mul(c[0]).x.cmp(this.g.x.redMul(a))===0?u=c[0]:(u=c[1],assert$y(this.g.mul(u).x.cmp(this.g.x.redMul(a))===0))}var l;return e.basis?l=e.basis.map(function(m){return{a:new BN$n(m.a,16),b:new BN$n(m.b,16)}}):l=this._getEndoBasis(u),{beta:a,lambda:u,basis:l}}},ShortCurve$1.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:BN$n.mont(e),u=new BN$n(2).toRed(a).redInvm(),d=u.redNeg(),c=new BN$n(3).toRed(a).redNeg().redSqrt().redMul(u),l=d.redAdd(c).fromRed(),m=d.redSub(c).fromRed();return[l,m]},ShortCurve$1.prototype._getEndoBasis=function(e){for(var a=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=e,d=this.n.clone(),c=new BN$n(1),l=new BN$n(0),m=new BN$n(0),I=new BN$n(1),O,T,C,j,F,U,Z,J=0,X,Q;u.cmpn(0)!==0;){var te=d.div(u);X=d.sub(te.mul(u)),Q=m.sub(te.mul(c));var se=I.sub(te.mul(l));if(!C&&X.cmp(a)<0)O=Z.neg(),T=c,C=X.neg(),j=Q;else if(C&&++J===2)break;Z=X,d=u,u=X,m=c,c=Q,I=l,l=se}F=X.neg(),U=Q;var pe=C.sqr().add(j.sqr()),me=F.sqr().add(U.sqr());return me.cmp(pe)>=0&&(F=O,U=T),C.negative&&(C=C.neg(),j=j.neg()),F.negative&&(F=F.neg(),U=U.neg()),[{a:C,b:j},{a:F,b:U}]},ShortCurve$1.prototype._endoSplit=function(e){var a=this.endo.basis,u=a[0],d=a[1],c=d.b.mul(e).divRound(this.n),l=u.b.neg().mul(e).divRound(this.n),m=c.mul(u.a),I=l.mul(d.a),O=c.mul(u.b),T=l.mul(d.b),C=e.sub(m).sub(I),j=O.add(T).neg();return{k1:C,k2:j}},ShortCurve$1.prototype.pointFromX=function(e,a){e=new BN$n(e,16),e.red||(e=e.toRed(this.red));var u=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),d=u.redSqrt();if(d.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");var c=d.fromRed().isOdd();return(a&&!c||!a&&c)&&(d=d.redNeg()),this.point(e,d)},ShortCurve$1.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,u=e.y,d=this.a.redMul(a),c=a.redSqr().redMul(a).redIAdd(d).redIAdd(this.b);return u.redSqr().redISub(c).cmpn(0)===0},ShortCurve$1.prototype._endoWnafMulAdd=function(e,a,u){for(var d=this._endoWnafT1,c=this._endoWnafT2,l=0;l<e.length;l++){var m=this._endoSplit(a[l]),I=e[l],O=I._getBeta();m.k1.negative&&(m.k1.ineg(),I=I.neg(!0)),m.k2.negative&&(m.k2.ineg(),O=O.neg(!0)),d[l*2]=I,d[l*2+1]=O,c[l*2]=m.k1,c[l*2+1]=m.k2}for(var T=this._wnafMulAdd(1,d,c,l*2,u),C=0;C<l*2;C++)d[C]=null,c[C]=null;return T};function Point$9(t,e,a,u){Base$5.BasePoint.call(this,t,"affine"),e===null&&a===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$n(e,16),this.y=new BN$n(a,16),u&&(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)}inherits$d(Point$9,Base$5.BasePoint),ShortCurve$1.prototype.point=function(e,a,u){return new Point$9(this,e,a,u)},ShortCurve$1.prototype.pointFromJSON=function(e,a){return Point$9.fromJSON(this,e,a)},Point$9.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var a=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var u=this.curve,d=function(c){return u.point(c.x.redMul(u.endo.beta),c.y)};e.beta=a,a.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(d)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(d)}}}return a}},Point$9.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point$9.fromJSON=function(e,a,u){typeof a=="string"&&(a=JSON.parse(a));var d=e.point(a[0],a[1],u);if(!a[2])return d;function c(m){return e.point(m[0],m[1],u)}var l=a[2];return d.precomputed={beta:null,doubles:l.doubles&&{step:l.doubles.step,points:[d].concat(l.doubles.points.map(c))},naf:l.naf&&{wnd:l.naf.wnd,points:[d].concat(l.naf.points.map(c))}},d},Point$9.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point$9.prototype.isInfinity=function(){return this.inf},Point$9.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var a=this.y.redSub(e.y);a.cmpn(0)!==0&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var u=a.redSqr().redISub(this.x).redISub(e.x),d=a.redMul(this.x.redSub(u)).redISub(this.y);return this.curve.point(u,d)},Point$9.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var a=this.curve.a,u=this.x.redSqr(),d=e.redInvm(),c=u.redAdd(u).redIAdd(u).redIAdd(a).redMul(d),l=c.redSqr().redISub(this.x.redAdd(this.x)),m=c.redMul(this.x.redSub(l)).redISub(this.y);return this.curve.point(l,m)},Point$9.prototype.getX=function(){return this.x.fromRed()},Point$9.prototype.getY=function(){return this.y.fromRed()},Point$9.prototype.mul=function(e){return e=new BN$n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Point$9.prototype.mulAdd=function(e,a,u){var d=[this,a],c=[e,u];return this.curve.endo?this.curve._endoWnafMulAdd(d,c):this.curve._wnafMulAdd(1,d,c,2)},Point$9.prototype.jmulAdd=function(e,a,u){var d=[this,a],c=[e,u];return this.curve.endo?this.curve._endoWnafMulAdd(d,c,!0):this.curve._wnafMulAdd(1,d,c,2,!0)},Point$9.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Point$9.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var u=this.precomputed,d=function(c){return c.neg()};a.precomputed={naf:u.naf&&{wnd:u.naf.wnd,points:u.naf.points.map(d)},doubles:u.doubles&&{step:u.doubles.step,points:u.doubles.points.map(d)}}}return a},Point$9.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint$1(t,e,a,u){Base$5.BasePoint.call(this,t,"jacobian"),e===null&&a===null&&u===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$n(0)):(this.x=new BN$n(e,16),this.y=new BN$n(a,16),this.z=new BN$n(u,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}inherits$d(JPoint$1,Base$5.BasePoint),ShortCurve$1.prototype.jpoint=function(e,a,u){return new JPoint$1(this,e,a,u)},JPoint$1.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),u=this.x.redMul(a),d=this.y.redMul(a).redMul(e);return this.curve.point(u,d)},JPoint$1.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint$1.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),u=this.z.redSqr(),d=this.x.redMul(a),c=e.x.redMul(u),l=this.y.redMul(a.redMul(e.z)),m=e.y.redMul(u.redMul(this.z)),I=d.redSub(c),O=l.redSub(m);if(I.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var T=I.redSqr(),C=T.redMul(I),j=d.redMul(T),F=O.redSqr().redIAdd(C).redISub(j).redISub(j),U=O.redMul(j.redISub(F)).redISub(l.redMul(C)),Z=this.z.redMul(e.z).redMul(I);return this.curve.jpoint(F,U,Z)},JPoint$1.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),u=this.x,d=e.x.redMul(a),c=this.y,l=e.y.redMul(a).redMul(this.z),m=u.redSub(d),I=c.redSub(l);if(m.cmpn(0)===0)return I.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=m.redSqr(),T=O.redMul(m),C=u.redMul(O),j=I.redSqr().redIAdd(T).redISub(C).redISub(C),F=I.redMul(C.redISub(j)).redISub(c.redMul(T)),U=this.z.redMul(m);return this.curve.jpoint(j,F,U)},JPoint$1.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var u=this;for(a=0;a<e;a++)u=u.dbl();return u}var d=this.curve.a,c=this.curve.tinv,l=this.x,m=this.y,I=this.z,O=I.redSqr().redSqr(),T=m.redAdd(m);for(a=0;a<e;a++){var C=l.redSqr(),j=T.redSqr(),F=j.redSqr(),U=C.redAdd(C).redIAdd(C).redIAdd(d.redMul(O)),Z=l.redMul(j),J=U.redSqr().redISub(Z.redAdd(Z)),X=Z.redISub(J),Q=U.redMul(X);Q=Q.redIAdd(Q).redISub(F);var te=T.redMul(I);a+1<e&&(O=O.redMul(F)),l=J,I=te,T=Q}return this.curve.jpoint(l,T.redMul(c),I)},JPoint$1.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint$1.prototype._zeroDbl=function(){var e,a,u;if(this.zOne){var d=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),m=this.x.redAdd(c).redSqr().redISub(d).redISub(l);m=m.redIAdd(m);var I=d.redAdd(d).redIAdd(d),O=I.redSqr().redISub(m).redISub(m),T=l.redIAdd(l);T=T.redIAdd(T),T=T.redIAdd(T),e=O,a=I.redMul(m.redISub(O)).redISub(T),u=this.y.redAdd(this.y)}else{var C=this.x.redSqr(),j=this.y.redSqr(),F=j.redSqr(),U=this.x.redAdd(j).redSqr().redISub(C).redISub(F);U=U.redIAdd(U);var Z=C.redAdd(C).redIAdd(C),J=Z.redSqr(),X=F.redIAdd(F);X=X.redIAdd(X),X=X.redIAdd(X),e=J.redISub(U).redISub(U),a=Z.redMul(U.redISub(e)).redISub(X),u=this.y.redMul(this.z),u=u.redIAdd(u)}return this.curve.jpoint(e,a,u)},JPoint$1.prototype._threeDbl=function(){var e,a,u;if(this.zOne){var d=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),m=this.x.redAdd(c).redSqr().redISub(d).redISub(l);m=m.redIAdd(m);var I=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),O=I.redSqr().redISub(m).redISub(m);e=O;var T=l.redIAdd(l);T=T.redIAdd(T),T=T.redIAdd(T),a=I.redMul(m.redISub(O)).redISub(T),u=this.y.redAdd(this.y)}else{var C=this.z.redSqr(),j=this.y.redSqr(),F=this.x.redMul(j),U=this.x.redSub(C).redMul(this.x.redAdd(C));U=U.redAdd(U).redIAdd(U);var Z=F.redIAdd(F);Z=Z.redIAdd(Z);var J=Z.redAdd(Z);e=U.redSqr().redISub(J),u=this.y.redAdd(this.z).redSqr().redISub(j).redISub(C);var X=j.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X),a=U.redMul(Z.redISub(e)).redISub(X)}return this.curve.jpoint(e,a,u)},JPoint$1.prototype._dbl=function(){var e=this.curve.a,a=this.x,u=this.y,d=this.z,c=d.redSqr().redSqr(),l=a.redSqr(),m=u.redSqr(),I=l.redAdd(l).redIAdd(l).redIAdd(e.redMul(c)),O=a.redAdd(a);O=O.redIAdd(O);var T=O.redMul(m),C=I.redSqr().redISub(T.redAdd(T)),j=T.redISub(C),F=m.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var U=I.redMul(j).redISub(F),Z=u.redAdd(u).redMul(d);return this.curve.jpoint(C,U,Z)},JPoint$1.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),a=this.y.redSqr(),u=this.z.redSqr(),d=a.redSqr(),c=e.redAdd(e).redIAdd(e),l=c.redSqr(),m=this.x.redAdd(a).redSqr().redISub(e).redISub(d);m=m.redIAdd(m),m=m.redAdd(m).redIAdd(m),m=m.redISub(l);var I=m.redSqr(),O=d.redIAdd(d);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=c.redIAdd(m).redSqr().redISub(l).redISub(I).redISub(O),C=a.redMul(T);C=C.redIAdd(C),C=C.redIAdd(C);var j=this.x.redMul(I).redISub(C);j=j.redIAdd(j),j=j.redIAdd(j);var F=this.y.redMul(T.redMul(O.redISub(T)).redISub(m.redMul(I)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var U=this.z.redAdd(m).redSqr().redISub(u).redISub(I);return this.curve.jpoint(j,F,U)},JPoint$1.prototype.mul=function(e,a){return e=new BN$n(e,a),this.curve._wnafMul(this,e)},JPoint$1.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var a=this.z.redSqr(),u=e.z.redSqr();if(this.x.redMul(u).redISub(e.x.redMul(a)).cmpn(0)!==0)return!1;var d=a.redMul(this.z),c=u.redMul(e.z);return this.y.redMul(c).redISub(e.y.redMul(d)).cmpn(0)===0},JPoint$1.prototype.eqXToP=function(e){var a=this.z.redSqr(),u=e.toRed(this.curve.red).redMul(a);if(this.x.cmp(u)===0)return!0;for(var d=e.clone(),c=this.curve.redN.redMul(a);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(c),this.x.cmp(u)===0)return!0}},JPoint$1.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$m=bnExports$3,inherits$c=inherits_browserExports$2,Base$4=base$3,utils$F=utils$J;function MontCurve$1(t){Base$4.call(this,"mont",t),this.a=new BN$m(t.a,16).toRed(this.red),this.b=new BN$m(t.b,16).toRed(this.red),this.i4=new BN$m(4).toRed(this.red).redInvm(),this.two=new BN$m(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$c(MontCurve$1,Base$4);var mont$1=MontCurve$1;MontCurve$1.prototype.validate=function(e){var a=e.normalize().x,u=a.redSqr(),d=u.redMul(a).redAdd(u.redMul(this.a)).redAdd(a),c=d.redSqrt();return c.redSqr().cmp(d)===0};function Point$8(t,e,a){Base$4.BasePoint.call(this,t,"projective"),e===null&&a===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$m(e,16),this.z=new BN$m(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$c(Point$8,Base$4.BasePoint),MontCurve$1.prototype.decodePoint=function(e,a){return this.point(utils$F.toArray(e,a),1)},MontCurve$1.prototype.point=function(e,a){return new Point$8(this,e,a)},MontCurve$1.prototype.pointFromJSON=function(e){return Point$8.fromJSON(this,e)},Point$8.prototype.precompute=function(){},Point$8.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point$8.fromJSON=function(e,a){return new Point$8(e,a[0],a[1]||e.one)},Point$8.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$8.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Point$8.prototype.dbl=function(){var e=this.x.redAdd(this.z),a=e.redSqr(),u=this.x.redSub(this.z),d=u.redSqr(),c=a.redSub(d),l=a.redMul(d),m=c.redMul(d.redAdd(this.curve.a24.redMul(c)));return this.curve.point(l,m)},Point$8.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point$8.prototype.diffAdd=function(e,a){var u=this.x.redAdd(this.z),d=this.x.redSub(this.z),c=e.x.redAdd(e.z),l=e.x.redSub(e.z),m=l.redMul(u),I=c.redMul(d),O=a.z.redMul(m.redAdd(I).redSqr()),T=a.x.redMul(m.redISub(I).redSqr());return this.curve.point(O,T)},Point$8.prototype.mul=function(e){for(var a=e.clone(),u=this,d=this.curve.point(null,null),c=this,l=[];a.cmpn(0)!==0;a.iushrn(1))l.push(a.andln(1));for(var m=l.length-1;m>=0;m--)l[m]===0?(u=u.diffAdd(d,c),d=d.dbl()):(d=u.diffAdd(d,c),u=u.dbl());return d},Point$8.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point$8.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point$8.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},Point$8.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point$8.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$E=utils$J,BN$l=bnExports$3,inherits$b=inherits_browserExports$2,Base$3=base$3,assert$x=utils$E.assert;function EdwardsCurve$1(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Base$3.call(this,"edwards",t),this.a=new BN$l(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$l(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$l(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$x(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}inherits$b(EdwardsCurve$1,Base$3);var edwards$1=EdwardsCurve$1;EdwardsCurve$1.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},EdwardsCurve$1.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},EdwardsCurve$1.prototype.jpoint=function(e,a,u,d){return this.point(e,a,u,d)},EdwardsCurve$1.prototype.pointFromX=function(e,a){e=new BN$l(e,16),e.red||(e=e.toRed(this.red));var u=e.redSqr(),d=this.c2.redSub(this.a.redMul(u)),c=this.one.redSub(this.c2.redMul(this.d).redMul(u)),l=d.redMul(c.redInvm()),m=l.redSqrt();if(m.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");var I=m.fromRed().isOdd();return(a&&!I||!a&&I)&&(m=m.redNeg()),this.point(e,m)},EdwardsCurve$1.prototype.pointFromY=function(e,a){e=new BN$l(e,16),e.red||(e=e.toRed(this.red));var u=e.redSqr(),d=u.redSub(this.c2),c=u.redMul(this.d).redMul(this.c2).redSub(this.a),l=d.redMul(c.redInvm());if(l.cmp(this.zero)===0){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var m=l.redSqrt();if(m.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");return m.fromRed().isOdd()!==a&&(m=m.redNeg()),this.point(m,e)},EdwardsCurve$1.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),u=e.y.redSqr(),d=a.redMul(this.a).redAdd(u),c=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(u)));return d.cmp(c)===0};function Point$7(t,e,a,u,d){Base$3.BasePoint.call(this,t,"projective"),e===null&&a===null&&u===null?(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 BN$l(e,16),this.y=new BN$l(a,16),this.z=u?new BN$l(u,16):this.curve.one,this.t=d&&new BN$l(d,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()))))}inherits$b(Point$7,Base$3.BasePoint),EdwardsCurve$1.prototype.pointFromJSON=function(e){return Point$7.fromJSON(this,e)},EdwardsCurve$1.prototype.point=function(e,a,u,d){return new Point$7(this,e,a,u,d)},Point$7.fromJSON=function(e,a){return new Point$7(e,a[0],a[1],a[2])},Point$7.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$7.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},Point$7.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),u=this.z.redSqr();u=u.redIAdd(u);var d=this.curve._mulA(e),c=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),l=d.redAdd(a),m=l.redSub(u),I=d.redSub(a),O=c.redMul(m),T=l.redMul(I),C=c.redMul(I),j=m.redMul(l);return this.curve.point(O,T,j,C)},Point$7.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr(),d,c,l,m,I,O;if(this.curve.twisted){m=this.curve._mulA(a);var T=m.redAdd(u);this.zOne?(d=e.redSub(a).redSub(u).redMul(T.redSub(this.curve.two)),c=T.redMul(m.redSub(u)),l=T.redSqr().redSub(T).redSub(T)):(I=this.z.redSqr(),O=T.redSub(I).redISub(I),d=e.redSub(a).redISub(u).redMul(O),c=T.redMul(m.redSub(u)),l=T.redMul(O))}else m=a.redAdd(u),I=this.curve._mulC(this.z).redSqr(),O=m.redSub(I).redSub(I),d=this.curve._mulC(e.redISub(m)).redMul(O),c=this.curve._mulC(m).redMul(a.redISub(u)),l=m.redMul(O);return this.curve.point(d,c,l)},Point$7.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point$7.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),u=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),d=this.t.redMul(this.curve.dd).redMul(e.t),c=this.z.redMul(e.z.redAdd(e.z)),l=u.redSub(a),m=c.redSub(d),I=c.redAdd(d),O=u.redAdd(a),T=l.redMul(m),C=I.redMul(O),j=l.redMul(O),F=m.redMul(I);return this.curve.point(T,C,F,j)},Point$7.prototype._projAdd=function(e){var a=this.z.redMul(e.z),u=a.redSqr(),d=this.x.redMul(e.x),c=this.y.redMul(e.y),l=this.curve.d.redMul(d).redMul(c),m=u.redSub(l),I=u.redAdd(l),O=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(c),T=a.redMul(m).redMul(O),C,j;return this.curve.twisted?(C=a.redMul(I).redMul(c.redSub(this.curve._mulA(d))),j=m.redMul(I)):(C=a.redMul(I).redMul(c.redSub(d)),j=this.curve._mulC(m).redMul(I)),this.curve.point(T,C,j)},Point$7.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Point$7.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Point$7.prototype.mulAdd=function(e,a,u){return this.curve._wnafMulAdd(1,[this,a],[e,u],2,!1)},Point$7.prototype.jmulAdd=function(e,a,u){return this.curve._wnafMulAdd(1,[this,a],[e,u],2,!0)},Point$7.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Point$7.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point$7.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point$7.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point$7.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},Point$7.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(a)===0)return!0;for(var u=e.clone(),d=this.curve.redN.redMul(this.z);;){if(u.iadd(this.curve.n),u.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(d),this.x.cmp(a)===0)return!0}},Point$7.prototype.toP=Point$7.prototype.normalize,Point$7.prototype.mixedAdd=Point$7.prototype.add,function(t){var e=t;e.base=base$3,e.short=short$1,e.mont=mont$1,e.edwards=edwards$1}(curve$7);var curves$5={},hash$7={},utils$D={},assert$w=minimalisticAssert$1,inherits$a=inherits_browserExports$2;utils$D.inherits=inherits$a;function isSurrogatePair$1(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function toArray$1(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var a=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),d=0;d<t.length;d+=2)a.push(parseInt(t[d]+t[d+1],16))}else for(var u=0,d=0;d<t.length;d++){var c=t.charCodeAt(d);c<128?a[u++]=c:c<2048?(a[u++]=c>>6|192,a[u++]=c&63|128):isSurrogatePair$1(t,d)?(c=65536+((c&1023)<<10)+(t.charCodeAt(++d)&1023),a[u++]=c>>18|240,a[u++]=c>>12&63|128,a[u++]=c>>6&63|128,a[u++]=c&63|128):(a[u++]=c>>12|224,a[u++]=c>>6&63|128,a[u++]=c&63|128)}else for(d=0;d<t.length;d++)a[d]=t[d]|0;return a}utils$D.toArray=toArray$1;function toHex$1(t){for(var e="",a=0;a<t.length;a++)e+=zero2$1(t[a].toString(16));return e}utils$D.toHex=toHex$1;function htonl$1(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}utils$D.htonl=htonl$1;function toHex32$1(t,e){for(var a="",u=0;u<t.length;u++){var d=t[u];e==="little"&&(d=htonl$1(d)),a+=zero8$1(d.toString(16))}return a}utils$D.toHex32=toHex32$1;function zero2$1(t){return t.length===1?"0"+t:t}utils$D.zero2=zero2$1;function zero8$1(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}utils$D.zero8=zero8$1;function join32$1(t,e,a,u){var d=a-e;assert$w(d%4===0);for(var c=new Array(d/4),l=0,m=e;l<c.length;l++,m+=4){var I;u==="big"?I=t[m]<<24|t[m+1]<<16|t[m+2]<<8|t[m+3]:I=t[m+3]<<24|t[m+2]<<16|t[m+1]<<8|t[m],c[l]=I>>>0}return c}utils$D.join32=join32$1;function split32$1(t,e){for(var a=new Array(t.length*4),u=0,d=0;u<t.length;u++,d+=4){var c=t[u];e==="big"?(a[d]=c>>>24,a[d+1]=c>>>16&255,a[d+2]=c>>>8&255,a[d+3]=c&255):(a[d+3]=c>>>24,a[d+2]=c>>>16&255,a[d+1]=c>>>8&255,a[d]=c&255)}return a}utils$D.split32=split32$1;function rotr32$3(t,e){return t>>>e|t<<32-e}utils$D.rotr32=rotr32$3;function rotl32$5(t,e){return t<<e|t>>>32-e}utils$D.rotl32=rotl32$5;function sum32$7(t,e){return t+e>>>0}utils$D.sum32=sum32$7;function sum32_3$3(t,e,a){return t+e+a>>>0}utils$D.sum32_3=sum32_3$3;function sum32_4$5(t,e,a,u){return t+e+a+u>>>0}utils$D.sum32_4=sum32_4$5;function sum32_5$5(t,e,a,u,d){return t+e+a+u+d>>>0}utils$D.sum32_5=sum32_5$5;function sum64$3(t,e,a,u){var d=t[e],c=t[e+1],l=u+c>>>0,m=(l<u?1:0)+a+d;t[e]=m>>>0,t[e+1]=l}utils$D.sum64=sum64$3;function sum64_hi$3(t,e,a,u){var d=e+u>>>0,c=(d<e?1:0)+t+a;return c>>>0}utils$D.sum64_hi=sum64_hi$3;function sum64_lo$3(t,e,a,u){var d=e+u;return d>>>0}utils$D.sum64_lo=sum64_lo$3;function sum64_4_hi$3(t,e,a,u,d,c,l,m){var I=0,O=e;O=O+u>>>0,I+=O<e?1:0,O=O+c>>>0,I+=O<c?1:0,O=O+m>>>0,I+=O<m?1:0;var T=t+a+d+l+I;return T>>>0}utils$D.sum64_4_hi=sum64_4_hi$3;function sum64_4_lo$3(t,e,a,u,d,c,l,m){var I=e+u+c+m;return I>>>0}utils$D.sum64_4_lo=sum64_4_lo$3;function sum64_5_hi$3(t,e,a,u,d,c,l,m,I,O){var T=0,C=e;C=C+u>>>0,T+=C<e?1:0,C=C+c>>>0,T+=C<c?1:0,C=C+m>>>0,T+=C<m?1:0,C=C+O>>>0,T+=C<O?1:0;var j=t+a+d+l+I+T;return j>>>0}utils$D.sum64_5_hi=sum64_5_hi$3;function sum64_5_lo$3(t,e,a,u,d,c,l,m,I,O){var T=e+u+c+m+O;return T>>>0}utils$D.sum64_5_lo=sum64_5_lo$3;function rotr64_hi$3(t,e,a){var u=e<<32-a|t>>>a;return u>>>0}utils$D.rotr64_hi=rotr64_hi$3;function rotr64_lo$3(t,e,a){var u=t<<32-a|e>>>a;return u>>>0}utils$D.rotr64_lo=rotr64_lo$3;function shr64_hi$3(t,e,a){return t>>>a}utils$D.shr64_hi=shr64_hi$3;function shr64_lo$3(t,e,a){var u=t<<32-a|e>>>a;return u>>>0}utils$D.shr64_lo=shr64_lo$3;var common$b={},utils$C=utils$D,assert$v=minimalisticAssert$1;function BlockHash$9(){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}common$b.BlockHash=BlockHash$9,BlockHash$9.prototype.update=function(e,a){if(e=utils$C.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var u=e.length%this._delta8;this.pending=e.slice(e.length-u,e.length),this.pending.length===0&&(this.pending=null),e=utils$C.join32(e,0,e.length-u,this.endian);for(var d=0;d<e.length;d+=this._delta32)this._update(e,d,d+this._delta32)}return this},BlockHash$9.prototype.digest=function(e){return this.update(this._pad()),assert$v(this.pending===null),this._digest(e)},BlockHash$9.prototype._pad=function(){var e=this.pendingTotal,a=this._delta8,u=a-(e+this.padLength)%a,d=new Array(u+this.padLength);d[0]=128;for(var c=1;c<u;c++)d[c]=0;if(e<<=3,this.endian==="big"){for(var l=8;l<this.padLength;l++)d[c++]=0;d[c++]=0,d[c++]=0,d[c++]=0,d[c++]=0,d[c++]=e>>>24&255,d[c++]=e>>>16&255,d[c++]=e>>>8&255,d[c++]=e&255}else for(d[c++]=e&255,d[c++]=e>>>8&255,d[c++]=e>>>16&255,d[c++]=e>>>24&255,d[c++]=0,d[c++]=0,d[c++]=0,d[c++]=0,l=8;l<this.padLength;l++)d[c++]=0;return d};var sha$1={},common$a={},utils$B=utils$D,rotr32$2=utils$B.rotr32;function ft_1$3(t,e,a,u){if(t===0)return ch32$3(e,a,u);if(t===1||t===3)return p32$1(e,a,u);if(t===2)return maj32$3(e,a,u)}common$a.ft_1=ft_1$3;function ch32$3(t,e,a){return t&e^~t&a}common$a.ch32=ch32$3;function maj32$3(t,e,a){return t&e^t&a^e&a}common$a.maj32=maj32$3;function p32$1(t,e,a){return t^e^a}common$a.p32=p32$1;function s0_256$3(t){return rotr32$2(t,2)^rotr32$2(t,13)^rotr32$2(t,22)}common$a.s0_256=s0_256$3;function s1_256$3(t){return rotr32$2(t,6)^rotr32$2(t,11)^rotr32$2(t,25)}common$a.s1_256=s1_256$3;function g0_256$3(t){return rotr32$2(t,7)^rotr32$2(t,18)^t>>>3}common$a.g0_256=g0_256$3;function g1_256$3(t){return rotr32$2(t,17)^rotr32$2(t,19)^t>>>10}common$a.g1_256=g1_256$3;var utils$A=utils$D,common$9=common$b,shaCommon$3=common$a,rotl32$4=utils$A.rotl32,sum32$6=utils$A.sum32,sum32_5$4=utils$A.sum32_5,ft_1$2=shaCommon$3.ft_1,BlockHash$8=common$9.BlockHash,sha1_K$1=[1518500249,1859775393,2400959708,3395469782];function SHA1$1(){if(!(this instanceof SHA1$1))return new SHA1$1;BlockHash$8.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$A.inherits(SHA1$1,BlockHash$8);var _1$1=SHA1$1;SHA1$1.blockSize=512,SHA1$1.outSize=160,SHA1$1.hmacStrength=80,SHA1$1.padLength=64,SHA1$1.prototype._update=function(e,a){for(var u=this.W,d=0;d<16;d++)u[d]=e[a+d];for(;d<u.length;d++)u[d]=rotl32$4(u[d-3]^u[d-8]^u[d-14]^u[d-16],1);var c=this.h[0],l=this.h[1],m=this.h[2],I=this.h[3],O=this.h[4];for(d=0;d<u.length;d++){var T=~~(d/20),C=sum32_5$4(rotl32$4(c,5),ft_1$2(T,l,m,I),O,u[d],sha1_K$1[T]);O=I,I=m,m=rotl32$4(l,30),l=c,c=C}this.h[0]=sum32$6(this.h[0],c),this.h[1]=sum32$6(this.h[1],l),this.h[2]=sum32$6(this.h[2],m),this.h[3]=sum32$6(this.h[3],I),this.h[4]=sum32$6(this.h[4],O)},SHA1$1.prototype._digest=function(e){return e==="hex"?utils$A.toHex32(this.h,"big"):utils$A.split32(this.h,"big")};var utils$z=utils$D,common$8=common$b,shaCommon$2=common$a,assert$u=minimalisticAssert$1,sum32$5=utils$z.sum32,sum32_4$4=utils$z.sum32_4,sum32_5$3=utils$z.sum32_5,ch32$2=shaCommon$2.ch32,maj32$2=shaCommon$2.maj32,s0_256$2=shaCommon$2.s0_256,s1_256$2=shaCommon$2.s1_256,g0_256$2=shaCommon$2.g0_256,g1_256$2=shaCommon$2.g1_256,BlockHash$7=common$8.BlockHash,sha256_K$1=[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 SHA256$3(){if(!(this instanceof SHA256$3))return new SHA256$3;BlockHash$7.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K$1,this.W=new Array(64)}utils$z.inherits(SHA256$3,BlockHash$7);var _256$1=SHA256$3;SHA256$3.blockSize=512,SHA256$3.outSize=256,SHA256$3.hmacStrength=192,SHA256$3.padLength=64,SHA256$3.prototype._update=function(e,a){for(var u=this.W,d=0;d<16;d++)u[d]=e[a+d];for(;d<u.length;d++)u[d]=sum32_4$4(g1_256$2(u[d-2]),u[d-7],g0_256$2(u[d-15]),u[d-16]);var c=this.h[0],l=this.h[1],m=this.h[2],I=this.h[3],O=this.h[4],T=this.h[5],C=this.h[6],j=this.h[7];for(assert$u(this.k.length===u.length),d=0;d<u.length;d++){var F=sum32_5$3(j,s1_256$2(O),ch32$2(O,T,C),this.k[d],u[d]),U=sum32$5(s0_256$2(c),maj32$2(c,l,m));j=C,C=T,T=O,O=sum32$5(I,F),I=m,m=l,l=c,c=sum32$5(F,U)}this.h[0]=sum32$5(this.h[0],c),this.h[1]=sum32$5(this.h[1],l),this.h[2]=sum32$5(this.h[2],m),this.h[3]=sum32$5(this.h[3],I),this.h[4]=sum32$5(this.h[4],O),this.h[5]=sum32$5(this.h[5],T),this.h[6]=sum32$5(this.h[6],C),this.h[7]=sum32$5(this.h[7],j)},SHA256$3.prototype._digest=function(e){return e==="hex"?utils$z.toHex32(this.h,"big"):utils$z.split32(this.h,"big")};var utils$y=utils$D,SHA256$2=_256$1;function SHA224$1(){if(!(this instanceof SHA224$1))return new SHA224$1;SHA256$2.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}utils$y.inherits(SHA224$1,SHA256$2);var _224$1=SHA224$1;SHA224$1.blockSize=512,SHA224$1.outSize=224,SHA224$1.hmacStrength=192,SHA224$1.padLength=64,SHA224$1.prototype._digest=function(e){return e==="hex"?utils$y.toHex32(this.h.slice(0,7),"big"):utils$y.split32(this.h.slice(0,7),"big")};var utils$x=utils$D,common$7=common$b,assert$t=minimalisticAssert$1,rotr64_hi$2=utils$x.rotr64_hi,rotr64_lo$2=utils$x.rotr64_lo,shr64_hi$2=utils$x.shr64_hi,shr64_lo$2=utils$x.shr64_lo,sum64$2=utils$x.sum64,sum64_hi$2=utils$x.sum64_hi,sum64_lo$2=utils$x.sum64_lo,sum64_4_hi$2=utils$x.sum64_4_hi,sum64_4_lo$2=utils$x.sum64_4_lo,sum64_5_hi$2=utils$x.sum64_5_hi,sum64_5_lo$2=utils$x.sum64_5_lo,BlockHash$6=common$7.BlockHash,sha512_K$1=[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 SHA512$3(){if(!(this instanceof SHA512$3))return new SHA512$3;BlockHash$6.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K$1,this.W=new Array(160)}utils$x.inherits(SHA512$3,BlockHash$6);var _512$1=SHA512$3;SHA512$3.blockSize=1024,SHA512$3.outSize=512,SHA512$3.hmacStrength=192,SHA512$3.padLength=128,SHA512$3.prototype._prepareBlock=function(e,a){for(var u=this.W,d=0;d<32;d++)u[d]=e[a+d];for(;d<u.length;d+=2){var c=g1_512_hi$1(u[d-4],u[d-3]),l=g1_512_lo$1(u[d-4],u[d-3]),m=u[d-14],I=u[d-13],O=g0_512_hi$1(u[d-30],u[d-29]),T=g0_512_lo$1(u[d-30],u[d-29]),C=u[d-32],j=u[d-31];u[d]=sum64_4_hi$2(c,l,m,I,O,T,C,j),u[d+1]=sum64_4_lo$2(c,l,m,I,O,T,C,j)}},SHA512$3.prototype._update=function(e,a){this._prepareBlock(e,a);var u=this.W,d=this.h[0],c=this.h[1],l=this.h[2],m=this.h[3],I=this.h[4],O=this.h[5],T=this.h[6],C=this.h[7],j=this.h[8],F=this.h[9],U=this.h[10],Z=this.h[11],J=this.h[12],X=this.h[13],Q=this.h[14],te=this.h[15];assert$t(this.k.length===u.length);for(var se=0;se<u.length;se+=2){var pe=Q,me=te,Ee=s1_512_hi$1(j,F),V=s1_512_lo$1(j,F),ae=ch64_hi$1(j,F,U,Z,J),ne=ch64_lo$1(j,F,U,Z,J,X),M=this.k[se],v=this.k[se+1],S=u[se],y=u[se+1],w=sum64_5_hi$2(pe,me,Ee,V,ae,ne,M,v,S,y),P=sum64_5_lo$2(pe,me,Ee,V,ae,ne,M,v,S,y);pe=s0_512_hi$1(d,c),me=s0_512_lo$1(d,c),Ee=maj64_hi$1(d,c,l,m,I),V=maj64_lo$1(d,c,l,m,I,O);var L=sum64_hi$2(pe,me,Ee,V),N=sum64_lo$2(pe,me,Ee,V);Q=J,te=X,J=U,X=Z,U=j,Z=F,j=sum64_hi$2(T,C,w,P),F=sum64_lo$2(C,C,w,P),T=I,C=O,I=l,O=m,l=d,m=c,d=sum64_hi$2(w,P,L,N),c=sum64_lo$2(w,P,L,N)}sum64$2(this.h,0,d,c),sum64$2(this.h,2,l,m),sum64$2(this.h,4,I,O),sum64$2(this.h,6,T,C),sum64$2(this.h,8,j,F),sum64$2(this.h,10,U,Z),sum64$2(this.h,12,J,X),sum64$2(this.h,14,Q,te)},SHA512$3.prototype._digest=function(e){return e==="hex"?utils$x.toHex32(this.h,"big"):utils$x.split32(this.h,"big")};function ch64_hi$1(t,e,a,u,d){var c=t&a^~t&d;return c<0&&(c+=4294967296),c}function ch64_lo$1(t,e,a,u,d,c){var l=e&u^~e&c;return l<0&&(l+=4294967296),l}function maj64_hi$1(t,e,a,u,d){var c=t&a^t&d^a&d;return c<0&&(c+=4294967296),c}function maj64_lo$1(t,e,a,u,d,c){var l=e&u^e&c^u&c;return l<0&&(l+=4294967296),l}function s0_512_hi$1(t,e){var a=rotr64_hi$2(t,e,28),u=rotr64_hi$2(e,t,2),d=rotr64_hi$2(e,t,7),c=a^u^d;return c<0&&(c+=4294967296),c}function s0_512_lo$1(t,e){var a=rotr64_lo$2(t,e,28),u=rotr64_lo$2(e,t,2),d=rotr64_lo$2(e,t,7),c=a^u^d;return c<0&&(c+=4294967296),c}function s1_512_hi$1(t,e){var a=rotr64_hi$2(t,e,14),u=rotr64_hi$2(t,e,18),d=rotr64_hi$2(e,t,9),c=a^u^d;return c<0&&(c+=4294967296),c}function s1_512_lo$1(t,e){var a=rotr64_lo$2(t,e,14),u=rotr64_lo$2(t,e,18),d=rotr64_lo$2(e,t,9),c=a^u^d;return c<0&&(c+=4294967296),c}function g0_512_hi$1(t,e){var a=rotr64_hi$2(t,e,1),u=rotr64_hi$2(t,e,8),d=shr64_hi$2(t,e,7),c=a^u^d;return c<0&&(c+=4294967296),c}function g0_512_lo$1(t,e){var a=rotr64_lo$2(t,e,1),u=rotr64_lo$2(t,e,8),d=shr64_lo$2(t,e,7),c=a^u^d;return c<0&&(c+=4294967296),c}function g1_512_hi$1(t,e){var a=rotr64_hi$2(t,e,19),u=rotr64_hi$2(e,t,29),d=shr64_hi$2(t,e,6),c=a^u^d;return c<0&&(c+=4294967296),c}function g1_512_lo$1(t,e){var a=rotr64_lo$2(t,e,19),u=rotr64_lo$2(e,t,29),d=shr64_lo$2(t,e,6),c=a^u^d;return c<0&&(c+=4294967296),c}var utils$w=utils$D,SHA512$2=_512$1;function SHA384$1(){if(!(this instanceof SHA384$1))return new SHA384$1;SHA512$2.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}utils$w.inherits(SHA384$1,SHA512$2);var _384$1=SHA384$1;SHA384$1.blockSize=1024,SHA384$1.outSize=384,SHA384$1.hmacStrength=192,SHA384$1.padLength=128,SHA384$1.prototype._digest=function(e){return e==="hex"?utils$w.toHex32(this.h.slice(0,12),"big"):utils$w.split32(this.h.slice(0,12),"big")},sha$1.sha1=_1$1,sha$1.sha224=_224$1,sha$1.sha256=_256$1,sha$1.sha384=_384$1,sha$1.sha512=_512$1;var ripemd$1={},utils$v=utils$D,common$6=common$b,rotl32$3=utils$v.rotl32,sum32$4=utils$v.sum32,sum32_3$2=utils$v.sum32_3,sum32_4$3=utils$v.sum32_4,BlockHash$5=common$6.BlockHash;function RIPEMD160$1(){if(!(this instanceof RIPEMD160$1))return new RIPEMD160$1;BlockHash$5.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils$v.inherits(RIPEMD160$1,BlockHash$5),ripemd$1.ripemd160=RIPEMD160$1,RIPEMD160$1.blockSize=512,RIPEMD160$1.outSize=160,RIPEMD160$1.hmacStrength=192,RIPEMD160$1.padLength=64,RIPEMD160$1.prototype._update=function(e,a){for(var u=this.h[0],d=this.h[1],c=this.h[2],l=this.h[3],m=this.h[4],I=u,O=d,T=c,C=l,j=m,F=0;F<80;F++){var U=sum32$4(rotl32$3(sum32_4$3(u,f$1(F,d,c,l),e[r$2[F]+a],K$1(F)),s$1[F]),m);u=m,m=l,l=rotl32$3(c,10),c=d,d=U,U=sum32$4(rotl32$3(sum32_4$3(I,f$1(79-F,O,T,C),e[rh$1[F]+a],Kh$1(F)),sh$1[F]),j),I=j,j=C,C=rotl32$3(T,10),T=O,O=U}U=sum32_3$2(this.h[1],c,C),this.h[1]=sum32_3$2(this.h[2],l,j),this.h[2]=sum32_3$2(this.h[3],m,I),this.h[3]=sum32_3$2(this.h[4],u,O),this.h[4]=sum32_3$2(this.h[0],d,T),this.h[0]=U},RIPEMD160$1.prototype._digest=function(e){return e==="hex"?utils$v.toHex32(this.h,"little"):utils$v.split32(this.h,"little")};function f$1(t,e,a,u){return t<=15?e^a^u:t<=31?e&a|~e&u:t<=47?(e|~a)^u:t<=63?e&u|a&~u:e^(a|~u)}function K$1(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh$1(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var r$2=[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],rh$1=[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],s$1=[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],sh$1=[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],utils$u=utils$D,assert$s=minimalisticAssert$1;function Hmac$1(t,e,a){if(!(this instanceof Hmac$1))return new Hmac$1(t,e,a);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils$u.toArray(e,a))}var hmac$1=Hmac$1;Hmac$1.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),assert$s(e.length<=this.blockSize);for(var a=e.length;a<this.blockSize;a++)e.push(0);for(a=0;a<e.length;a++)e[a]^=54;for(this.inner=new this.Hash().update(e),a=0;a<e.length;a++)e[a]^=106;this.outer=new this.Hash().update(e)},Hmac$1.prototype.update=function(e,a){return this.inner.update(e,a),this},Hmac$1.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(t){var e=t;e.utils=utils$D,e.common=common$b,e.sha=sha$1,e.ripemd=ripemd$1,e.hmac=hmac$1,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(hash$7);var secp256k1$2,hasRequiredSecp256k1$1;function requireSecp256k1$1(){return hasRequiredSecp256k1$1||(hasRequiredSecp256k1$1=1,secp256k1$2={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"]]}}),secp256k1$2}(function(t){var e=t,a=hash$7,u=curve$7,d=utils$J,c=d.assert;function l(O){O.type==="short"?this.curve=new u.short(O):O.type==="edwards"?this.curve=new u.edwards(O):this.curve=new u.mont(O),this.g=this.curve.g,this.n=this.curve.n,this.hash=O.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=l;function m(O,T){Object.defineProperty(e,O,{configurable:!0,enumerable:!0,get:function(){var C=new l(T);return Object.defineProperty(e,O,{configurable:!0,enumerable:!0,value:C}),C}})}m("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:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),m("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:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),m("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:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),m("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:a.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"]}),m("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:a.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"]}),m("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),m("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:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var I;try{I=requireSecp256k1$1()}catch{I=void 0}m("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:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",I]})})(curves$5);var hash$6=hash$7,utils$t=utils$I,assert$r=minimalisticAssert$1;function HmacDRBG$2(t){if(!(this instanceof HmacDRBG$2))return new HmacDRBG$2(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=utils$t.toArray(t.entropy,t.entropyEnc||"hex"),a=utils$t.toArray(t.nonce,t.nonceEnc||"hex"),u=utils$t.toArray(t.pers,t.persEnc||"hex");assert$r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,a,u)}var hmacDrbg$1=HmacDRBG$2;HmacDRBG$2.prototype._init=function(e,a,u){var d=e.concat(a).concat(u);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var c=0;c<this.V.length;c++)this.K[c]=0,this.V[c]=1;this._update(d),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG$2.prototype._hmac=function(){return new hash$6.hmac(this.hash,this.K)},HmacDRBG$2.prototype._update=function(e){var a=this._hmac().update(this.V).update([0]);e&&(a=a.update(e)),this.K=a.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG$2.prototype.reseed=function(e,a,u,d){typeof a!="string"&&(d=u,u=a,a=null),e=utils$t.toArray(e,a),u=utils$t.toArray(u,d),assert$r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(u||[])),this._reseed=1},HmacDRBG$2.prototype.generate=function(e,a,u,d){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof a!="string"&&(d=u,u=a,a=null),u&&(u=utils$t.toArray(u,d||"hex"),this._update(u));for(var c=[];c.length<e;)this.V=this._hmac().update(this.V).digest(),c=c.concat(this.V);var l=c.slice(0,e);return this._update(u),this._reseed++,utils$t.encode(l,a)};var BN$k=bnExports$3,utils$s=utils$J,assert$q=utils$s.assert;function KeyPair$6(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)}var key$4=KeyPair$6;KeyPair$6.fromPublic=function(e,a,u){return a instanceof KeyPair$6?a:new KeyPair$6(e,{pub:a,pubEnc:u})},KeyPair$6.fromPrivate=function(e,a,u){return a instanceof KeyPair$6?a:new KeyPair$6(e,{priv:a,privEnc:u})},KeyPair$6.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},KeyPair$6.prototype.getPublic=function(e,a){return typeof e=="string"&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},KeyPair$6.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},KeyPair$6.prototype._importPrivate=function(e,a){this.priv=new BN$k(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair$6.prototype._importPublic=function(e,a){if(e.x||e.y){this.ec.curve.type==="mont"?assert$q(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$q(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,a)},KeyPair$6.prototype.derive=function(e){return e.validate()||assert$q(e.validate(),"public point not validated"),e.mul(this.priv).getX()},KeyPair$6.prototype.sign=function(e,a,u){return this.ec.sign(e,this,a,u)},KeyPair$6.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},KeyPair$6.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var BN$j=bnExports$3,utils$r=utils$J,assert$p=utils$r.assert;function Signature$8(t,e){if(t instanceof Signature$8)return t;this._importDER(t,e)||(assert$p(t.r&&t.s,"Signature without r or s"),this.r=new BN$j(t.r,16),this.s=new BN$j(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var signature$5=Signature$8;function Position$1(){this.place=0}function getLength$1(t,e){var a=t[e.place++];if(!(a&128))return a;var u=a&15;if(u===0||u>4)return!1;for(var d=0,c=0,l=e.place;c<u;c++,l++)d<<=8,d|=t[l],d>>>=0;return d<=127?!1:(e.place=l,d)}function rmPadding$1(t){for(var e=0,a=t.length-1;!t[e]&&!(t[e+1]&128)&&e<a;)e++;return e===0?t:t.slice(e)}Signature$8.prototype._importDER=function(e,a){e=utils$r.toArray(e,a);var u=new Position$1;if(e[u.place++]!==48)return!1;var d=getLength$1(e,u);if(d===!1||d+u.place!==e.length||e[u.place++]!==2)return!1;var c=getLength$1(e,u);if(c===!1)return!1;var l=e.slice(u.place,c+u.place);if(u.place+=c,e[u.place++]!==2)return!1;var m=getLength$1(e,u);if(m===!1||e.length!==m+u.place)return!1;var I=e.slice(u.place,m+u.place);if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;if(I[0]===0)if(I[1]&128)I=I.slice(1);else return!1;return this.r=new BN$j(l),this.s=new BN$j(I),this.recoveryParam=null,!0};function constructLength$1(t,e){if(e<128){t.push(e);return}var a=1+(Math.log(e)/Math.LN2>>>3);for(t.push(a|128);--a;)t.push(e>>>(a<<3)&255);t.push(e)}Signature$8.prototype.toDER=function(e){var a=this.r.toArray(),u=this.s.toArray();for(a[0]&128&&(a=[0].concat(a)),u[0]&128&&(u=[0].concat(u)),a=rmPadding$1(a),u=rmPadding$1(u);!u[0]&&!(u[1]&128);)u=u.slice(1);var d=[2];constructLength$1(d,a.length),d=d.concat(a),d.push(2),constructLength$1(d,u.length);var c=d.concat(u),l=[48];return constructLength$1(l,c.length),l=l.concat(c),utils$r.encode(l,e)};var ec$2,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$2;hasRequiredEc=1;var t=bnExports$3,e=hmacDrbg$1,a=utils$J,u=curves$5,d=requireBrorand(),c=a.assert,l=key$4,m=signature$5;function I(O){if(!(this instanceof I))return new I(O);typeof O=="string"&&(c(Object.prototype.hasOwnProperty.call(u,O),"Unknown curve "+O),O=u[O]),O instanceof u.PresetCurve&&(O={curve:O}),this.curve=O.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=O.curve.g,this.g.precompute(O.curve.n.bitLength()+1),this.hash=O.hash||O.curve.hash}return ec$2=I,I.prototype.keyPair=function(T){return new l(this,T)},I.prototype.keyFromPrivate=function(T,C){return l.fromPrivate(this,T,C)},I.prototype.keyFromPublic=function(T,C){return l.fromPublic(this,T,C)},I.prototype.genKeyPair=function(T){T||(T={});for(var C=new e({hash:this.hash,pers:T.pers,persEnc:T.persEnc||"utf8",entropy:T.entropy||d(this.hash.hmacStrength),entropyEnc:T.entropy&&T.entropyEnc||"utf8",nonce:this.n.toArray()}),j=this.n.byteLength(),F=this.n.sub(new t(2));;){var U=new t(C.generate(j));if(!(U.cmp(F)>0))return U.iaddn(1),this.keyFromPrivate(U)}},I.prototype._truncateToN=function(T,C){var j=T.byteLength()*8-this.n.bitLength();return j>0&&(T=T.ushrn(j)),!C&&T.cmp(this.n)>=0?T.sub(this.n):T},I.prototype.sign=function(T,C,j,F){typeof j=="object"&&(F=j,j=null),F||(F={}),C=this.keyFromPrivate(C,j),T=this._truncateToN(new t(T,16));for(var U=this.n.byteLength(),Z=C.getPrivate().toArray("be",U),J=T.toArray("be",U),X=new e({hash:this.hash,entropy:Z,nonce:J,pers:F.pers,persEnc:F.persEnc||"utf8"}),Q=this.n.sub(new t(1)),te=0;;te++){var se=F.k?F.k(te):new t(X.generate(this.n.byteLength()));if(se=this._truncateToN(se,!0),!(se.cmpn(1)<=0||se.cmp(Q)>=0)){var pe=this.g.mul(se);if(!pe.isInfinity()){var me=pe.getX(),Ee=me.umod(this.n);if(Ee.cmpn(0)!==0){var V=se.invm(this.n).mul(Ee.mul(C.getPrivate()).iadd(T));if(V=V.umod(this.n),V.cmpn(0)!==0){var ae=(pe.getY().isOdd()?1:0)|(me.cmp(Ee)!==0?2:0);return F.canonical&&V.cmp(this.nh)>0&&(V=this.n.sub(V),ae^=1),new m({r:Ee,s:V,recoveryParam:ae})}}}}}},I.prototype.verify=function(T,C,j,F){T=this._truncateToN(new t(T,16)),j=this.keyFromPublic(j,F),C=new m(C,"hex");var U=C.r,Z=C.s;if(U.cmpn(1)<0||U.cmp(this.n)>=0||Z.cmpn(1)<0||Z.cmp(this.n)>=0)return!1;var J=Z.invm(this.n),X=J.mul(T).umod(this.n),Q=J.mul(U).umod(this.n),te;return this.curve._maxwellTrick?(te=this.g.jmulAdd(X,j.getPublic(),Q),te.isInfinity()?!1:te.eqXToP(U)):(te=this.g.mulAdd(X,j.getPublic(),Q),te.isInfinity()?!1:te.getX().umod(this.n).cmp(U)===0)},I.prototype.recoverPubKey=function(O,T,C,j){c((3&C)===C,"The recovery param is more than two bits"),T=new m(T,j);var F=this.n,U=new t(O),Z=T.r,J=T.s,X=C&1,Q=C>>1;if(Z.cmp(this.curve.p.umod(this.curve.n))>=0&&Q)throw new Error("Unable to find sencond key candinate");Q?Z=this.curve.pointFromX(Z.add(this.curve.n),X):Z=this.curve.pointFromX(Z,X);var te=T.r.invm(F),se=F.sub(U).mul(te).umod(F),pe=J.mul(te).umod(F);return this.g.mulAdd(se,Z,pe)},I.prototype.getKeyRecoveryParam=function(O,T,C,j){if(T=new m(T,j),T.recoveryParam!==null)return T.recoveryParam;for(var F=0;F<4;F++){var U;try{U=this.recoverPubKey(O,T,F)}catch{continue}if(U.eq(C))return F}throw new Error("Unable to find valid recovery factor")},ec$2}var utils$q=utils$J,assert$o=utils$q.assert,parseBytes$5=utils$q.parseBytes,cachedProperty$3=utils$q.cachedProperty;function KeyPair$5(t,e){this.eddsa=t,this._secret=parseBytes$5(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=parseBytes$5(e.pub)}KeyPair$5.fromPublic=function(e,a){return a instanceof KeyPair$5?a:new KeyPair$5(e,{pub:a})},KeyPair$5.fromSecret=function(e,a){return a instanceof KeyPair$5?a:new KeyPair$5(e,{secret:a})},KeyPair$5.prototype.secret=function(){return this._secret},cachedProperty$3(KeyPair$5,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),cachedProperty$3(KeyPair$5,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty$3(KeyPair$5,"privBytes",function(){var e=this.eddsa,a=this.hash(),u=e.encodingLength-1,d=a.slice(0,e.encodingLength);return d[0]&=248,d[u]&=127,d[u]|=64,d}),cachedProperty$3(KeyPair$5,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty$3(KeyPair$5,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty$3(KeyPair$5,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair$5.prototype.sign=function(e){return assert$o(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},KeyPair$5.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},KeyPair$5.prototype.getSecret=function(e){return assert$o(this._secret,"KeyPair is public only"),utils$q.encode(this.secret(),e)},KeyPair$5.prototype.getPublic=function(e){return utils$q.encode(this.pubBytes(),e)};var key$3=KeyPair$5,BN$i=bnExports$3,utils$p=utils$J,assert$n=utils$p.assert,cachedProperty$2=utils$p.cachedProperty,parseBytes$4=utils$p.parseBytes;function Signature$7(t,e){this.eddsa=t,typeof e!="object"&&(e=parseBytes$4(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),assert$n(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof BN$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}cachedProperty$2(Signature$7,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty$2(Signature$7,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty$2(Signature$7,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),cachedProperty$2(Signature$7,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Signature$7.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Signature$7.prototype.toHex=function(){return utils$p.encode(this.toBytes(),"hex").toUpperCase()};var signature$4=Signature$7,hash$5=hash$7,curves$4=curves$5,utils$o=utils$J,assert$m=utils$o.assert,parseBytes$3=utils$o.parseBytes,KeyPair$4=key$3,Signature$6=signature$4;function EDDSA$1(t){if(assert$m(t==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA$1))return new EDDSA$1(t);t=curves$4[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=hash$5.sha512}var eddsa$1=EDDSA$1;EDDSA$1.prototype.sign=function(e,a){e=parseBytes$3(e);var u=this.keyFromSecret(a),d=this.hashInt(u.messagePrefix(),e),c=this.g.mul(d),l=this.encodePoint(c),m=this.hashInt(l,u.pubBytes(),e).mul(u.priv()),I=d.add(m).umod(this.curve.n);return this.makeSignature({R:c,S:I,Rencoded:l})},EDDSA$1.prototype.verify=function(e,a,u){e=parseBytes$3(e),a=this.makeSignature(a);var d=this.keyFromPublic(u),c=this.hashInt(a.Rencoded(),d.pubBytes(),e),l=this.g.mul(a.S()),m=a.R().add(d.pub().mul(c));return m.eq(l)},EDDSA$1.prototype.hashInt=function(){for(var e=this.hash(),a=0;a<arguments.length;a++)e.update(arguments[a]);return utils$o.intFromLE(e.digest()).umod(this.curve.n)},EDDSA$1.prototype.keyFromPublic=function(e){return KeyPair$4.fromPublic(this,e)},EDDSA$1.prototype.keyFromSecret=function(e){return KeyPair$4.fromSecret(this,e)},EDDSA$1.prototype.makeSignature=function(e){return e instanceof Signature$6?e:new Signature$6(this,e)},EDDSA$1.prototype.encodePoint=function(e){var a=e.getY().toArray("le",this.encodingLength);return a[this.encodingLength-1]|=e.getX().isOdd()?128:0,a},EDDSA$1.prototype.decodePoint=function(e){e=utils$o.parseBytes(e);var a=e.length-1,u=e.slice(0,a).concat(e[a]&-129),d=(e[a]&128)!==0,c=utils$o.intFromLE(u);return this.curve.pointFromY(c,d)},EDDSA$1.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},EDDSA$1.prototype.decodeInt=function(e){return utils$o.intFromLE(e)},EDDSA$1.prototype.isPoint=function(e){return e instanceof this.pointClass};var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,function(t){var e=t;e.version=require$$0$4.version,e.utils=utils$J,e.rand=requireBrorand(),e.curve=curve$7,e.curves=curves$5,e.ec=requireEc(),e.eddsa=eddsa$1}(elliptic$1)),elliptic$1}var asn1$3={},asn1$2={},api$2={},encoders={},buffer$3=require$$1$4,Buffer$i=buffer$3.Buffer,safer={},key$2;for(key$2 in buffer$3)buffer$3.hasOwnProperty(key$2)&&(key$2==="SlowBuffer"||key$2==="Buffer"||(safer[key$2]=buffer$3[key$2]));var Safer=safer.Buffer={};for(key$2 in Buffer$i)Buffer$i.hasOwnProperty(key$2)&&(key$2==="allocUnsafe"||key$2==="allocUnsafeSlow"||(Safer[key$2]=Buffer$i[key$2]));if(safer.Buffer.prototype=Buffer$i.prototype,(!Safer.from||Safer.from===Uint8Array.from)&&(Safer.from=function(t,e,a){if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&typeof t.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return Buffer$i(t,e,a)}),Safer.alloc||(Safer.alloc=function(t,e,a){if(typeof t!="number")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 u=Buffer$i(t);return!e||e.length===0?u.fill(0):typeof a=="string"?u.fill(e,a):u.fill(e),u}),!safer.kStringMaxLength)try{safer.kStringMaxLength=process$1.binding("buffer").kStringMaxLength}catch{}safer.constants||(safer.constants={MAX_LENGTH:safer.kMaxLength},safer.kStringMaxLength&&(safer.constants.MAX_STRING_LENGTH=safer.kStringMaxLength));var safer_1=safer,reporter={};const inherits$9=inherits_browserExports$2;function Reporter$2(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}reporter.Reporter=Reporter$2,Reporter$2.prototype.isError=function(e){return e instanceof ReporterError},Reporter$2.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},Reporter$2.prototype.restore=function(e){const a=this._reporterState;a.obj=e.obj,a.path=a.path.slice(0,e.pathLen)},Reporter$2.prototype.enterKey=function(e){return this._reporterState.path.push(e)},Reporter$2.prototype.exitKey=function(e){const a=this._reporterState;a.path=a.path.slice(0,e-1)},Reporter$2.prototype.leaveKey=function(e,a,u){const d=this._reporterState;this.exitKey(e),d.obj!==null&&(d.obj[a]=u)},Reporter$2.prototype.path=function(){return this._reporterState.path.join("/")},Reporter$2.prototype.enterObject=function(){const e=this._reporterState,a=e.obj;return e.obj={},a},Reporter$2.prototype.leaveObject=function(e){const a=this._reporterState,u=a.obj;return a.obj=e,u},Reporter$2.prototype.error=function(e){let a;const u=this._reporterState,d=e instanceof ReporterError;if(d?a=e:a=new ReporterError(u.path.map(function(c){return"["+JSON.stringify(c)+"]"}).join(""),e.message||e,e.stack),!u.options.partial)throw a;return d||u.errors.push(a),a},Reporter$2.prototype.wrapResult=function(e){const a=this._reporterState;return a.options.partial?{result:this.isError(e)?null:e,errors:a.errors}:e};function ReporterError(t,e){this.path=t,this.rethrow(e)}inherits$9(ReporterError,Error),ReporterError.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(a){this.stack=a.stack}return this};var buffer$2={};const inherits$8=inherits_browserExports$2,Reporter$1=reporter.Reporter,Buffer$h=safer_1.Buffer;function DecoderBuffer$2(t,e){if(Reporter$1.call(this,e),!Buffer$h.isBuffer(t)){this.error("Input not Buffer");return}this.base=t,this.offset=0,this.length=t.length}inherits$8(DecoderBuffer$2,Reporter$1),buffer$2.DecoderBuffer=DecoderBuffer$2,DecoderBuffer$2.isDecoderBuffer=function(e){return e instanceof DecoderBuffer$2?!0:typeof e=="object"&&Buffer$h.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"},DecoderBuffer$2.prototype.save=function(){return{offset:this.offset,reporter:Reporter$1.prototype.save.call(this)}},DecoderBuffer$2.prototype.restore=function(e){const a=new DecoderBuffer$2(this.base);return a.offset=e.offset,a.length=this.offset,this.offset=e.offset,Reporter$1.prototype.restore.call(this,e.reporter),a},DecoderBuffer$2.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer$2.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},DecoderBuffer$2.prototype.skip=function(e,a){if(!(this.offset+e<=this.length))return this.error(a||"DecoderBuffer overrun");const u=new DecoderBuffer$2(this.base);return u._reporterState=this._reporterState,u.offset=this.offset,u.length=this.offset+e,this.offset+=e,u},DecoderBuffer$2.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function EncoderBuffer$1(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(a){return EncoderBuffer$1.isEncoderBuffer(a)||(a=new EncoderBuffer$1(a,e)),this.length+=a.length,a},this);else if(typeof t=="number"){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if(typeof t=="string")this.value=t,this.length=Buffer$h.byteLength(t);else if(Buffer$h.isBuffer(t))this.value=t,this.length=t.length;else return e.error("Unsupported type: "+typeof t)}buffer$2.EncoderBuffer=EncoderBuffer$1,EncoderBuffer$1.isEncoderBuffer=function(e){return e instanceof EncoderBuffer$1?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"},EncoderBuffer$1.prototype.join=function(e,a){return e||(e=Buffer$h.alloc(this.length)),a||(a=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(u){u.join(e,a),a+=u.length}):(typeof this.value=="number"?e[a]=this.value:typeof this.value=="string"?e.write(this.value,a):Buffer$h.isBuffer(this.value)&&this.value.copy(e,a),a+=this.length)),e};const Reporter=reporter.Reporter,EncoderBuffer=buffer$2.EncoderBuffer,DecoderBuffer$1=buffer$2.DecoderBuffer,assert$l=minimalisticAssert$1,tags=["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"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node$2(t,e,a){const u={};this._baseState=u,u.name=a,u.enc=t,u.parent=e||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}var node=Node$2;const stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node$2.prototype.clone=function(){const e=this._baseState,a={};stateProps.forEach(function(d){a[d]=e[d]});const u=new this.constructor(a.parent);return u._baseState=a,u},Node$2.prototype._wrap=function(){const e=this._baseState;methods.forEach(function(a){this[a]=function(){const d=new this.constructor(this);return e.children.push(d),d[a].apply(d,arguments)}},this)},Node$2.prototype._init=function(e){const a=this._baseState;assert$l(a.parent===null),e.call(this),a.children=a.children.filter(function(u){return u._baseState.parent===this},this),assert$l.equal(a.children.length,1,"Root node can have only one child")},Node$2.prototype._useArgs=function(e){const a=this._baseState,u=e.filter(function(d){return d instanceof this.constructor},this);e=e.filter(function(d){return!(d instanceof this.constructor)},this),u.length!==0&&(assert$l(a.children===null),a.children=u,u.forEach(function(d){d._baseState.parent=this},this)),e.length!==0&&(assert$l(a.args===null),a.args=e,a.reverseArgs=e.map(function(d){if(typeof d!="object"||d.constructor!==Object)return d;const c={};return Object.keys(d).forEach(function(l){l==(l|0)&&(l|=0);const m=d[l];c[m]=l}),c}))},overrided.forEach(function(t){Node$2.prototype[t]=function(){const a=this._baseState;throw new Error(t+" not implemented for encoding: "+a.enc)}}),tags.forEach(function(t){Node$2.prototype[t]=function(){const a=this._baseState,u=Array.prototype.slice.call(arguments);return assert$l(a.tag===null),a.tag=t,this._useArgs(u),this}}),Node$2.prototype.use=function(e){assert$l(e);const a=this._baseState;return assert$l(a.use===null),a.use=e,this},Node$2.prototype.optional=function(){const e=this._baseState;return e.optional=!0,this},Node$2.prototype.def=function(e){const a=this._baseState;return assert$l(a.default===null),a.default=e,a.optional=!0,this},Node$2.prototype.explicit=function(e){const a=this._baseState;return assert$l(a.explicit===null&&a.implicit===null),a.explicit=e,this},Node$2.prototype.implicit=function(e){const a=this._baseState;return assert$l(a.explicit===null&&a.implicit===null),a.implicit=e,this},Node$2.prototype.obj=function(){const e=this._baseState,a=Array.prototype.slice.call(arguments);return e.obj=!0,a.length!==0&&this._useArgs(a),this},Node$2.prototype.key=function(e){const a=this._baseState;return assert$l(a.key===null),a.key=e,this},Node$2.prototype.any=function(){const e=this._baseState;return e.any=!0,this},Node$2.prototype.choice=function(e){const a=this._baseState;return assert$l(a.choice===null),a.choice=e,this._useArgs(Object.keys(e).map(function(u){return e[u]})),this},Node$2.prototype.contains=function(e){const a=this._baseState;return assert$l(a.use===null),a.contains=e,this},Node$2.prototype._decode=function(e,a){const u=this._baseState;if(u.parent===null)return e.wrapResult(u.children[0]._decode(e,a));let d=u.default,c=!0,l=null;if(u.key!==null&&(l=e.enterKey(u.key)),u.optional){let I=null;if(u.explicit!==null?I=u.explicit:u.implicit!==null?I=u.implicit:u.tag!==null&&(I=u.tag),I===null&&!u.any){const O=e.save();try{u.choice===null?this._decodeGeneric(u.tag,e,a):this._decodeChoice(e,a),c=!0}catch{c=!1}e.restore(O)}else if(c=this._peekTag(e,I,u.any),e.isError(c))return c}let m;if(u.obj&&c&&(m=e.enterObject()),c){if(u.explicit!==null){const O=this._decodeTag(e,u.explicit);if(e.isError(O))return O;e=O}const I=e.offset;if(u.use===null&&u.choice===null){let O;u.any&&(O=e.save());const T=this._decodeTag(e,u.implicit!==null?u.implicit:u.tag,u.any);if(e.isError(T))return T;u.any?d=e.raw(O):e=T}if(a&&a.track&&u.tag!==null&&a.track(e.path(),I,e.length,"tagged"),a&&a.track&&u.tag!==null&&a.track(e.path(),e.offset,e.length,"content"),u.any||(u.choice===null?d=this._decodeGeneric(u.tag,e,a):d=this._decodeChoice(e,a)),e.isError(d))return d;if(!u.any&&u.choice===null&&u.children!==null&&u.children.forEach(function(T){T._decode(e,a)}),u.contains&&(u.tag==="octstr"||u.tag==="bitstr")){const O=new DecoderBuffer$1(d);d=this._getUse(u.contains,e._reporterState.obj)._decode(O,a)}}return u.obj&&c&&(d=e.leaveObject(m)),u.key!==null&&(d!==null||c===!0)?e.leaveKey(l,u.key,d):l!==null&&e.exitKey(l),d},Node$2.prototype._decodeGeneric=function(e,a,u){const d=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(a,e,d.args[0],u):/str$/.test(e)?this._decodeStr(a,e,u):e==="objid"&&d.args?this._decodeObjid(a,d.args[0],d.args[1],u):e==="objid"?this._decodeObjid(a,null,null,u):e==="gentime"||e==="utctime"?this._decodeTime(a,e,u):e==="null_"?this._decodeNull(a,u):e==="bool"?this._decodeBool(a,u):e==="objDesc"?this._decodeStr(a,e,u):e==="int"||e==="enum"?this._decodeInt(a,d.args&&d.args[0],u):d.use!==null?this._getUse(d.use,a._reporterState.obj)._decode(a,u):a.error("unknown tag: "+e)},Node$2.prototype._getUse=function(e,a){const u=this._baseState;return u.useDecoder=this._use(e,a),assert$l(u.useDecoder._baseState.parent===null),u.useDecoder=u.useDecoder._baseState.children[0],u.implicit!==u.useDecoder._baseState.implicit&&(u.useDecoder=u.useDecoder.clone(),u.useDecoder._baseState.implicit=u.implicit),u.useDecoder},Node$2.prototype._decodeChoice=function(e,a){const u=this._baseState;let d=null,c=!1;return Object.keys(u.choice).some(function(l){const m=e.save(),I=u.choice[l];try{const O=I._decode(e,a);if(e.isError(O))return!1;d={type:l,value:O},c=!0}catch{return e.restore(m),!1}return!0},this),c?d:e.error("Choice not matched")},Node$2.prototype._createEncoderBuffer=function(e){return new EncoderBuffer(e,this.reporter)},Node$2.prototype._encode=function(e,a,u){const d=this._baseState;if(d.default!==null&&d.default===e)return;const c=this._encodeValue(e,a,u);if(c!==void 0&&!this._skipDefault(c,a,u))return c},Node$2.prototype._encodeValue=function(e,a,u){const d=this._baseState;if(d.parent===null)return d.children[0]._encode(e,a||new Reporter);let c=null;if(this.reporter=a,d.optional&&e===void 0)if(d.default!==null)e=d.default;else return;let l=null,m=!1;if(d.any)c=this._createEncoderBuffer(e);else if(d.choice)c=this._encodeChoice(e,a);else if(d.contains)l=this._getUse(d.contains,u)._encode(e,a),m=!0;else if(d.children)l=d.children.map(function(I){if(I._baseState.tag==="null_")return I._encode(null,a,e);if(I._baseState.key===null)return a.error("Child should have a key");const O=a.enterKey(I._baseState.key);if(typeof e!="object")return a.error("Child expected, but input is not object");const T=I._encode(e[I._baseState.key],a,e);return a.leaveKey(O),T},this).filter(function(I){return I}),l=this._createEncoderBuffer(l);else if(d.tag==="seqof"||d.tag==="setof"){if(!(d.args&&d.args.length===1))return a.error("Too many args for : "+d.tag);if(!Array.isArray(e))return a.error("seqof/setof, but data is not Array");const I=this.clone();I._baseState.implicit=null,l=this._createEncoderBuffer(e.map(function(O){const T=this._baseState;return this._getUse(T.args[0],e)._encode(O,a)},I))}else d.use!==null?c=this._getUse(d.use,u)._encode(e,a):(l=this._encodePrimitive(d.tag,e),m=!0);if(!d.any&&d.choice===null){const I=d.implicit!==null?d.implicit:d.tag,O=d.implicit===null?"universal":"context";I===null?d.use===null&&a.error("Tag could be omitted only for .use()"):d.use===null&&(c=this._encodeComposite(I,m,O,l))}return d.explicit!==null&&(c=this._encodeComposite(d.explicit,!1,"context",c)),c},Node$2.prototype._encodeChoice=function(e,a){const u=this._baseState,d=u.choice[e.type];return d||assert$l(!1,e.type+" not found in "+JSON.stringify(Object.keys(u.choice))),d._encode(e.value,a)},Node$2.prototype._encodePrimitive=function(e,a){const u=this._baseState;if(/str$/.test(e))return this._encodeStr(a,e);if(e==="objid"&&u.args)return this._encodeObjid(a,u.reverseArgs[0],u.args[1]);if(e==="objid")return this._encodeObjid(a,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(a,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(a,u.args&&u.reverseArgs[0]);if(e==="bool")return this._encodeBool(a);if(e==="objDesc")return this._encodeStr(a,e);throw new Error("Unsupported tag: "+e)},Node$2.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},Node$2.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)};var der$2={};(function(t){function e(a){const u={};return Object.keys(a).forEach(function(d){(d|0)==d&&(d=d|0);const c=a[d];u[c]=d}),u}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=e(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=e(t.tag)})(der$2);const inherits$7=inherits_browserExports$2,Buffer$g=safer_1.Buffer,Node$1=node,der$1=der$2;function DEREncoder$1(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new DERNode$1,this.tree._init(t.body)}var der_1$1=DEREncoder$1;DEREncoder$1.prototype.encode=function(e,a){return this.tree._encode(e,a).join()};function DERNode$1(t){Node$1.call(this,"der",t)}inherits$7(DERNode$1,Node$1),DERNode$1.prototype._encodeComposite=function(e,a,u,d){const c=encodeTag(e,a,u,this.reporter);if(d.length<128){const I=Buffer$g.alloc(2);return I[0]=c,I[1]=d.length,this._createEncoderBuffer([I,d])}let l=1;for(let I=d.length;I>=256;I>>=8)l++;const m=Buffer$g.alloc(2+l);m[0]=c,m[1]=128|l;for(let I=1+l,O=d.length;O>0;I--,O>>=8)m[I]=O&255;return this._createEncoderBuffer([m,d])},DERNode$1.prototype._encodeStr=function(e,a){if(a==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(a==="bmpstr"){const u=Buffer$g.alloc(e.length*2);for(let d=0;d<e.length;d++)u.writeUInt16BE(e.charCodeAt(d),d*2);return this._createEncoderBuffer(u)}else return a==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):a==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(a)?this._createEncoderBuffer(e):a==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+a+" unsupported")},DERNode$1.prototype._encodeObjid=function(e,a,u){if(typeof e=="string"){if(!a)return this.reporter.error("string objid given, but no values map found");if(!a.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=a[e].split(/[\s.]+/g);for(let m=0;m<e.length;m++)e[m]|=0}else if(Array.isArray(e)){e=e.slice();for(let m=0;m<e.length;m++)e[m]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!u){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let d=0;for(let m=0;m<e.length;m++){let I=e[m];for(d++;I>=128;I>>=7)d++}const c=Buffer$g.alloc(d);let l=c.length-1;for(let m=e.length-1;m>=0;m--){let I=e[m];for(c[l--]=I&127;(I>>=7)>0;)c[l--]=128|I&127}return this._createEncoderBuffer(c)};function two$1(t){return t<10?"0"+t:t}DERNode$1.prototype._encodeTime=function(e,a){let u;const d=new Date(e);return a==="gentime"?u=[two$1(d.getUTCFullYear()),two$1(d.getUTCMonth()+1),two$1(d.getUTCDate()),two$1(d.getUTCHours()),two$1(d.getUTCMinutes()),two$1(d.getUTCSeconds()),"Z"].join(""):a==="utctime"?u=[two$1(d.getUTCFullYear()%100),two$1(d.getUTCMonth()+1),two$1(d.getUTCDate()),two$1(d.getUTCHours()),two$1(d.getUTCMinutes()),two$1(d.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+a+" time is not supported yet"),this._encodeStr(u,"octstr")},DERNode$1.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode$1.prototype._encodeInt=function(e,a){if(typeof e=="string"){if(!a)return this.reporter.error("String int or enum given, but no values map");if(!a.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=a[e]}if(typeof e!="number"&&!Buffer$g.isBuffer(e)){const c=e.toArray();!e.sign&&c[0]&128&&c.unshift(0),e=Buffer$g.from(c)}if(Buffer$g.isBuffer(e)){let c=e.length;e.length===0&&c++;const l=Buffer$g.alloc(c);return e.copy(l),e.length===0&&(l[0]=0),this._createEncoderBuffer(l)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let u=1;for(let c=e;c>=256;c>>=8)u++;const d=new Array(u);for(let c=d.length-1;c>=0;c--)d[c]=e&255,e>>=8;return d[0]&128&&d.unshift(0),this._createEncoderBuffer(Buffer$g.from(d))},DERNode$1.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},DERNode$1.prototype._use=function(e,a){return typeof e=="function"&&(e=e(a)),e._getEncoder("der").tree},DERNode$1.prototype._skipDefault=function(e,a,u){const d=this._baseState;let c;if(d.default===null)return!1;const l=e.join();if(d.defaultBuffer===void 0&&(d.defaultBuffer=this._encodeValue(d.default,a,u).join()),l.length!==d.defaultBuffer.length)return!1;for(c=0;c<l.length;c++)if(l[c]!==d.defaultBuffer[c])return!1;return!0};function encodeTag(t,e,a,u){let d;if(t==="seqof"?t="seq":t==="setof"&&(t="set"),der$1.tagByName.hasOwnProperty(t))d=der$1.tagByName[t];else if(typeof t=="number"&&(t|0)===t)d=t;else return u.error("Unknown tag: "+t);return d>=31?u.error("Multi-octet tag encoding unsupported"):(e||(d|=32),d|=der$1.tagClassByName[a||"universal"]<<6,d)}const inherits$6=inherits_browserExports$2,DEREncoder=der_1$1;function PEMEncoder(t){DEREncoder.call(this,t),this.enc="pem"}inherits$6(PEMEncoder,DEREncoder);var pem$1=PEMEncoder;PEMEncoder.prototype.encode=function(e,a){const d=DEREncoder.prototype.encode.call(this,e).toString("base64"),c=["-----BEGIN "+a.label+"-----"];for(let l=0;l<d.length;l+=64)c.push(d.slice(l,l+64));return c.push("-----END "+a.label+"-----"),c.join(`
37
+ `)},function(t){const e=t;e.der=der_1$1,e.pem=pem$1}(encoders);var decoders={};const inherits$5=inherits_browserExports$2,bignum=bnExports$3,DecoderBuffer=buffer$2.DecoderBuffer,Node=node,der=der$2;function DERDecoder$1(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new DERNode,this.tree._init(t.body)}var der_1=DERDecoder$1;DERDecoder$1.prototype.decode=function(e,a){return DecoderBuffer.isDecoderBuffer(e)||(e=new DecoderBuffer(e,a)),this.tree._decode(e,a)};function DERNode(t){Node.call(this,"der",t)}inherits$5(DERNode,Node),DERNode.prototype._peekTag=function(e,a,u){if(e.isEmpty())return!1;const d=e.save(),c=derDecodeTag(e,'Failed to peek tag: "'+a+'"');return e.isError(c)?c:(e.restore(d),c.tag===a||c.tagStr===a||c.tagStr+"of"===a||u)},DERNode.prototype._decodeTag=function(e,a,u){const d=derDecodeTag(e,'Failed to decode tag of "'+a+'"');if(e.isError(d))return d;let c=derDecodeLen(e,d.primitive,'Failed to get length of "'+a+'"');if(e.isError(c))return c;if(!u&&d.tag!==a&&d.tagStr!==a&&d.tagStr+"of"!==a)return e.error('Failed to match tag: "'+a+'"');if(d.primitive||c!==null)return e.skip(c,'Failed to match body of: "'+a+'"');const l=e.save(),m=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(m)?m:(c=e.offset-l.offset,e.restore(l),e.skip(c,'Failed to match body of: "'+a+'"'))},DERNode.prototype._skipUntilEnd=function(e,a){for(;;){const u=derDecodeTag(e,a);if(e.isError(u))return u;const d=derDecodeLen(e,u.primitive,a);if(e.isError(d))return d;let c;if(u.primitive||d!==null?c=e.skip(d):c=this._skipUntilEnd(e,a),e.isError(c))return c;if(u.tagStr==="end")break}},DERNode.prototype._decodeList=function(e,a,u,d){const c=[];for(;!e.isEmpty();){const l=this._peekTag(e,"end");if(e.isError(l))return l;const m=u.decode(e,"der",d);if(e.isError(m)&&l)break;c.push(m)}return c},DERNode.prototype._decodeStr=function(e,a){if(a==="bitstr"){const u=e.readUInt8();return e.isError(u)?u:{unused:u,data:e.raw()}}else if(a==="bmpstr"){const u=e.raw();if(u.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let d="";for(let c=0;c<u.length/2;c++)d+=String.fromCharCode(u.readUInt16BE(c*2));return d}else if(a==="numstr"){const u=e.raw().toString("ascii");return this._isNumstr(u)?u:e.error("Decoding of string type: numstr unsupported characters")}else{if(a==="octstr")return e.raw();if(a==="objDesc")return e.raw();if(a==="printstr"){const u=e.raw().toString("ascii");return this._isPrintstr(u)?u:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(a)?e.raw().toString():e.error("Decoding of string type: "+a+" unsupported")}},DERNode.prototype._decodeObjid=function(e,a,u){let d;const c=[];let l=0,m=0;for(;!e.isEmpty();)m=e.readUInt8(),l<<=7,l|=m&127,m&128||(c.push(l),l=0);m&128&&c.push(l);const I=c[0]/40|0,O=c[0]%40;if(u?d=c:d=[I,O].concat(c.slice(1)),a){let T=a[d.join(" ")];T===void 0&&(T=a[d.join(".")]),T!==void 0&&(d=T)}return d},DERNode.prototype._decodeTime=function(e,a){const u=e.raw().toString();let d,c,l,m,I,O;if(a==="gentime")d=u.slice(0,4)|0,c=u.slice(4,6)|0,l=u.slice(6,8)|0,m=u.slice(8,10)|0,I=u.slice(10,12)|0,O=u.slice(12,14)|0;else if(a==="utctime")d=u.slice(0,2)|0,c=u.slice(2,4)|0,l=u.slice(4,6)|0,m=u.slice(6,8)|0,I=u.slice(8,10)|0,O=u.slice(10,12)|0,d<70?d=2e3+d:d=1900+d;else return e.error("Decoding "+a+" time is not supported yet");return Date.UTC(d,c-1,l,m,I,O,0)},DERNode.prototype._decodeNull=function(){return null},DERNode.prototype._decodeBool=function(e){const a=e.readUInt8();return e.isError(a)?a:a!==0},DERNode.prototype._decodeInt=function(e,a){const u=e.raw();let d=new bignum(u);return a&&(d=a[d.toString(10)]||d),d},DERNode.prototype._use=function(e,a){return typeof e=="function"&&(e=e(a)),e._getDecoder("der").tree};function derDecodeTag(t,e){let a=t.readUInt8(e);if(t.isError(a))return a;const u=der.tagClass[a>>6],d=(a&32)===0;if((a&31)===31){let l=a;for(a=0;(l&128)===128;){if(l=t.readUInt8(e),t.isError(l))return l;a<<=7,a|=l&127}}else a&=31;const c=der.tag[a];return{cls:u,primitive:d,tag:a,tagStr:c}}function derDecodeLen(t,e,a){let u=t.readUInt8(a);if(t.isError(u))return u;if(!e&&u===128)return null;if(!(u&128))return u;const d=u&127;if(d>4)return t.error("length octect is too long");u=0;for(let c=0;c<d;c++){u<<=8;const l=t.readUInt8(a);if(t.isError(l))return l;u|=l}return u}const inherits$4=inherits_browserExports$2,Buffer$f=safer_1.Buffer,DERDecoder=der_1;function PEMDecoder(t){DERDecoder.call(this,t),this.enc="pem"}inherits$4(PEMDecoder,DERDecoder);var pem=PEMDecoder;PEMDecoder.prototype.decode=function(e,a){const u=e.toString().split(/[\r\n]+/g),d=a.label.toUpperCase(),c=/^-----(BEGIN|END) ([^-]+)-----$/;let l=-1,m=-1;for(let T=0;T<u.length;T++){const C=u[T].match(c);if(C!==null&&C[2]===d)if(l===-1){if(C[1]!=="BEGIN")break;l=T}else{if(C[1]!=="END")break;m=T;break}}if(l===-1||m===-1)throw new Error("PEM section not found for: "+d);const I=u.slice(l+1,m).join("");I.replace(/[^a-z0-9+/=]+/gi,"");const O=Buffer$f.from(I,"base64");return DERDecoder.prototype.decode.call(this,O,a)},function(t){const e=t;e.der=der_1,e.pem=pem}(decoders),function(t){const e=encoders,a=decoders,u=inherits_browserExports$2,d=t;d.define=function(m,I){return new c(m,I)};function c(l,m){this.name=l,this.body=m,this.decoders={},this.encoders={}}c.prototype._createNamed=function(m){const I=this.name;function O(T){this._initNamed(T,I)}return u(O,m),O.prototype._initNamed=function(C,j){m.call(this,C,j)},new O(this)},c.prototype._getDecoder=function(m){return m=m||"der",this.decoders.hasOwnProperty(m)||(this.decoders[m]=this._createNamed(a[m])),this.decoders[m]},c.prototype.decode=function(m,I,O){return this._getDecoder(I).decode(m,O)},c.prototype._getEncoder=function(m){return m=m||"der",this.encoders.hasOwnProperty(m)||(this.encoders[m]=this._createNamed(e[m])),this.encoders[m]},c.prototype.encode=function(m,I,O){return this._getEncoder(I).encode(m,O)}}(api$2);var base$2={};(function(t){const e=t;e.Reporter=reporter.Reporter,e.DecoderBuffer=buffer$2.DecoderBuffer,e.EncoderBuffer=buffer$2.EncoderBuffer,e.Node=node})(base$2);var constants={};(function(t){const e=t;e._reverse=function(u){const d={};return Object.keys(u).forEach(function(c){(c|0)==c&&(c=c|0);const l=u[c];d[l]=c}),d},e.der=der$2})(constants),function(t){const e=t;e.bignum=bnExports$3,e.define=api$2.define,e.base=base$2,e.constants=constants,e.decoders=decoders,e.encoders=encoders}(asn1$2);var asn=asn1$2,Time=asn.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),AttributeTypeValue=asn.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),AlgorithmIdentifier$1=asn.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),SubjectPublicKeyInfo=asn.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier$1),this.key("subjectPublicKey").bitstr())}),RelativeDistinguishedName=asn.define("RelativeDistinguishedName",function(){this.setof(AttributeTypeValue)}),RDNSequence=asn.define("RDNSequence",function(){this.seqof(RelativeDistinguishedName)}),Name=asn.define("Name",function(){this.choice({rdnSequence:this.use(RDNSequence)})}),Validity=asn.define("Validity",function(){this.seq().obj(this.key("notBefore").use(Time),this.key("notAfter").use(Time))}),Extension=asn.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),TBSCertificate=asn.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(AlgorithmIdentifier$1),this.key("issuer").use(Name),this.key("validity").use(Validity),this.key("subject").use(Name),this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(Extension).optional())}),X509Certificate=asn.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(TBSCertificate),this.key("signatureAlgorithm").use(AlgorithmIdentifier$1),this.key("signatureValue").bitstr())}),certificate=X509Certificate,asn1$1=asn1$2;asn1$3.certificate=certificate;var RSAPrivateKey=asn1$1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});asn1$3.RSAPrivateKey=RSAPrivateKey;var RSAPublicKey=asn1$1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$3.RSAPublicKey=RSAPublicKey;var PublicKey$1=asn1$1.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())});asn1$3.PublicKey=PublicKey$1;var AlgorithmIdentifier=asn1$1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),PrivateKeyInfo=asn1$1.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPrivateKey").octstr())});asn1$3.PrivateKey=PrivateKeyInfo;var EncryptedPrivateKeyInfo=asn1$1.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});asn1$3.EncryptedPrivateKey=EncryptedPrivateKeyInfo;var DSAPrivateKey=asn1$1.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});asn1$3.DSAPrivateKey=DSAPrivateKey,asn1$3.DSAparam=asn1$1.define("DSAparam",function(){this.int()});var ECPrivateKey=asn1$1.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(ECParameters),this.key("publicKey").optional().explicit(1).bitstr())});asn1$3.ECPrivateKey=ECPrivateKey;var ECParameters=asn1$1.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});asn1$3.signature=asn1$1.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});const require$$1$2={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var findProc=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,startRegex=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,fullRegex=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,evp=evp_bytestokey,ciphers$1=browser$8,Buffer$e=safeBufferExports$1.Buffer,fixProc$1=function(t,e){var a=t.toString(),u=a.match(findProc),d;if(u){var l="aes"+u[1],m=Buffer$e.from(u[2],"hex"),I=Buffer$e.from(u[3].replace(/[\r\n]/g,""),"base64"),O=evp(e,m.slice(0,8),parseInt(u[1],10)).key,T=[],C=ciphers$1.createDecipheriv(l,O,m);T.push(C.update(I)),T.push(C.final()),d=Buffer$e.concat(T)}else{var c=a.match(fullRegex);d=Buffer$e.from(c[2].replace(/[\r\n]/g,""),"base64")}var j=a.match(startRegex)[1];return{tag:j,data:d}},asn1=asn1$3,aesid=require$$1$2,fixProc=fixProc$1,ciphers=browser$8,compat=browser$a,Buffer$d=safeBufferExports$1.Buffer,parseAsn1=parseKeys$2;function parseKeys$2(t){var e;typeof t=="object"&&!Buffer$d.isBuffer(t)&&(e=t.passphrase,t=t.key),typeof t=="string"&&(t=Buffer$d.from(t));var a=fixProc(t,e),u=a.tag,d=a.data,c,l;switch(u){case"CERTIFICATE":l=asn1.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(l||(l=asn1.PublicKey.decode(d,"der")),c=l.algorithm.algorithm.join("."),c){case"1.2.840.113549.1.1.1":return asn1.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=asn1.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+c)}case"ENCRYPTED PRIVATE KEY":d=asn1.EncryptedPrivateKey.decode(d,"der"),d=decrypt(d,e);case"PRIVATE KEY":switch(l=asn1.PrivateKey.decode(d,"der"),c=l.algorithm.algorithm.join("."),c){case"1.2.840.113549.1.1.1":return asn1.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:asn1.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=asn1.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+c)}case"RSA PUBLIC KEY":return asn1.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return asn1.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:asn1.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return d=asn1.ECPrivateKey.decode(d,"der"),{curve:d.parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+u)}}parseKeys$2.signature=asn1.signature;function decrypt(t,e){var a=t.algorithm.decrypt.kde.kdeparams.salt,u=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=aesid[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,l=t.subjectPrivateKey,m=parseInt(d.split("-")[1],10)/8,I=compat.pbkdf2Sync(e,a,u,m,"sha1"),O=ciphers.createDecipheriv(d,I,c),T=[];return T.push(O.update(l)),T.push(O.final()),Buffer$d.concat(T)}const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign$1.exports;hasRequiredSign=1;var t=safeBufferExports$1.Buffer,e=browser$b,a=browserifyRsa,u=requireElliptic().ec,d=bnExports$2,c=parseAsn1,l=require$$4,m=1;function I(X,Q,te,se,pe){var me=c(Q);if(me.curve){if(se!=="ecdsa"&&se!=="ecdsa/rsa")throw new Error("wrong private key type");return O(X,me)}else if(me.type==="dsa"){if(se!=="dsa")throw new Error("wrong private key type");return T(X,me,te)}if(se!=="rsa"&&se!=="ecdsa/rsa")throw new Error("wrong private key type");if(Q.padding!==void 0&&Q.padding!==m)throw new Error("illegal or unsupported padding mode");X=t.concat([pe,X]);for(var Ee=me.modulus.byteLength(),V=[0,1];X.length+V.length+1<Ee;)V.push(255);V.push(0);for(var ae=-1;++ae<X.length;)V.push(X[ae]);var ne=a(V,me);return ne}function O(X,Q){var te=l[Q.curve.join(".")];if(!te)throw new Error("unknown curve "+Q.curve.join("."));var se=new u(te),pe=se.keyFromPrivate(Q.privateKey),me=pe.sign(X);return t.from(me.toDER())}function T(X,Q,te){for(var se=Q.params.priv_key,pe=Q.params.p,me=Q.params.q,Ee=Q.params.g,V=new d(0),ae,ne=F(X,me).mod(me),M=!1,v=j(se,me,X,te);M===!1;)ae=Z(me,v,te),V=J(Ee,ae,pe,me),M=ae.invm(me).imul(ne.add(se.mul(V))).mod(me),M.cmpn(0)===0&&(M=!1,V=new d(0));return C(V,M)}function C(X,Q){X=X.toArray(),Q=Q.toArray(),X[0]&128&&(X=[0].concat(X)),Q[0]&128&&(Q=[0].concat(Q));var te=X.length+Q.length+4,se=[48,te,2,X.length];return se=se.concat(X,[2,Q.length],Q),t.from(se)}function j(X,Q,te,se){if(X=t.from(X.toArray()),X.length<Q.byteLength()){var pe=t.alloc(Q.byteLength()-X.length);X=t.concat([pe,X])}var me=te.length,Ee=U(te,Q),V=t.alloc(me);V.fill(1);var ae=t.alloc(me);return ae=e(se,ae).update(V).update(t.from([0])).update(X).update(Ee).digest(),V=e(se,ae).update(V).digest(),ae=e(se,ae).update(V).update(t.from([1])).update(X).update(Ee).digest(),V=e(se,ae).update(V).digest(),{k:ae,v:V}}function F(X,Q){var te=new d(X),se=(X.length<<3)-Q.bitLength();return se>0&&te.ishrn(se),te}function U(X,Q){X=F(X,Q),X=X.mod(Q);var te=t.from(X.toArray());if(te.length<Q.byteLength()){var se=t.alloc(Q.byteLength()-te.length);te=t.concat([se,te])}return te}function Z(X,Q,te){var se,pe;do{for(se=t.alloc(0);se.length*8<X.bitLength();)Q.v=e(te,Q.k).update(Q.v).digest(),se=t.concat([se,Q.v]);pe=F(se,X),Q.k=e(te,Q.k).update(Q.v).update(t.from([0])).digest(),Q.v=e(te,Q.k).update(Q.v).digest()}while(pe.cmp(X)!==-1);return pe}function J(X,Q,te,se){return X.toRed(d.mont(te)).redPow(Q).fromRed().mod(se)}return sign$1.exports=I,sign$1.exports.getKey=j,sign$1.exports.makeKey=Z,sign$1.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var t=safeBufferExports$1.Buffer,e=bnExports$2,a=requireElliptic().ec,u=parseAsn1,d=require$$4;function c(O,T,C,j,F){var U=u(C);if(U.type==="ec"){if(j!=="ecdsa"&&j!=="ecdsa/rsa")throw new Error("wrong public key type");return l(O,T,U)}else if(U.type==="dsa"){if(j!=="dsa")throw new Error("wrong public key type");return m(O,T,U)}if(j!=="rsa"&&j!=="ecdsa/rsa")throw new Error("wrong public key type");T=t.concat([F,T]);for(var Z=U.modulus.byteLength(),J=[1],X=0;T.length+J.length+2<Z;)J.push(255),X+=1;J.push(0);for(var Q=-1;++Q<T.length;)J.push(T[Q]);J=t.from(J);var te=e.mont(U.modulus);O=new e(O).toRed(te),O=O.redPow(new e(U.publicExponent)),O=t.from(O.fromRed().toArray());var se=X<8?1:0;for(Z=Math.min(O.length,J.length),O.length!==J.length&&(se=1),Q=-1;++Q<Z;)se|=O[Q]^J[Q];return se===0}function l(O,T,C){var j=d[C.data.algorithm.curve.join(".")];if(!j)throw new Error("unknown curve "+C.data.algorithm.curve.join("."));var F=new a(j),U=C.data.subjectPrivateKey.data;return F.verify(T,O,U)}function m(O,T,C){var j=C.data.p,F=C.data.q,U=C.data.g,Z=C.data.pub_key,J=u.signature.decode(O,"der"),X=J.s,Q=J.r;I(X,F),I(Q,F);var te=e.mont(j),se=X.invm(F),pe=U.toRed(te).redPow(new e(T).mul(se).mod(F)).fromRed().mul(Z.toRed(te).redPow(Q.mul(se).mod(F)).fromRed()).mod(j).mod(F);return pe.cmp(Q)===0}function I(O,T){if(O.cmpn(0)<=0)throw new Error("invalid sig");if(O.cmp(T)>=0)throw new Error("invalid sig")}return verify_1=c,verify_1}var browser$6,hasRequiredBrowser$1;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$6;hasRequiredBrowser$1=1;var t=safeBufferExports$1.Buffer,e=browser$c,a=readableBrowserExports,u=inherits_browserExports$2,d=requireSign(),c=requireVerify(),l=require$$6;Object.keys(l).forEach(function(C){l[C].id=t.from(l[C].id,"hex"),l[C.toLowerCase()]=l[C]});function m(C){a.Writable.call(this);var j=l[C];if(!j)throw new Error("Unknown message digest");this._hashType=j.hash,this._hash=e(j.hash),this._tag=j.id,this._signType=j.sign}u(m,a.Writable),m.prototype._write=function(j,F,U){this._hash.update(j),U()},m.prototype.update=function(j,F){return this._hash.update(typeof j=="string"?t.from(j,F):j),this},m.prototype.sign=function(j,F){this.end();var U=this._hash.digest(),Z=d(U,j,this._hashType,this._signType,this._tag);return F?Z.toString(F):Z};function I(C){a.Writable.call(this);var j=l[C];if(!j)throw new Error("Unknown message digest");this._hash=e(j.hash),this._tag=j.id,this._signType=j.sign}u(I,a.Writable),I.prototype._write=function(j,F,U){this._hash.update(j),U()},I.prototype.update=function(j,F){return this._hash.update(typeof j=="string"?t.from(j,F):j),this},I.prototype.verify=function(j,F,U){var Z=typeof F=="string"?t.from(F,U):F;this.end();var J=this._hash.digest();return c(Z,J,j,this._signType,this._tag)};function O(C){return new m(C)}function T(C){return new I(C)}return browser$6={Sign:O,Verify:T,createSign:O,createVerify:T},browser$6}var browser$5,hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser$5;hasRequiredBrowser=1;var t=requireElliptic(),e=bnExports$3;browser$5=function(l){return new u(l)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1;function u(c){this.curveType=a[c],this.curveType||(this.curveType={name:c}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}u.prototype.generateKeys=function(c,l){return this.keys=this.curve.genKeyPair(),this.getPublicKey(c,l)},u.prototype.computeSecret=function(c,l,m){l=l||"utf8",Buffer$N.isBuffer(c)||(c=new Buffer$N(c,l));var I=this.curve.keyFromPublic(c).getPublic(),O=I.mul(this.keys.getPrivate()).getX();return d(O,m,this.curveType.byteLength)},u.prototype.getPublicKey=function(c,l){var m=this.keys.getPublic(l==="compressed",!0);return l==="hybrid"&&(m[m.length-1]%2?m[0]=7:m[0]=6),d(m,c)},u.prototype.getPrivateKey=function(c){return d(this.keys.getPrivate(),c)},u.prototype.setPublicKey=function(c,l){return l=l||"utf8",Buffer$N.isBuffer(c)||(c=new Buffer$N(c,l)),this.keys._importPublic(c),this},u.prototype.setPrivateKey=function(c,l){l=l||"utf8",Buffer$N.isBuffer(c)||(c=new Buffer$N(c,l));var m=new e(c);return m=m.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(m),this};function d(c,l,m){Array.isArray(c)||(c=c.toArray());var I=new Buffer$N(c);if(m&&I.length<m){var O=new Buffer$N(m-I.length);O.fill(0),I=Buffer$N.concat([O,I])}return l?I.toString(l):I}return browser$5}var browser$4={},createHash$2=browser$c,Buffer$c=safeBufferExports$1.Buffer,mgf$2=function(t,e){for(var a=Buffer$c.alloc(0),u=0,d;a.length<e;)d=i2ops(u++),a=Buffer$c.concat([a,createHash$2("sha1").update(t).update(d).digest()]);return a.slice(0,e)};function i2ops(t){var e=Buffer$c.allocUnsafe(4);return e.writeUInt32BE(t,0),e}var xor$2=function(e,a){for(var u=e.length,d=-1;++d<u;)e[d]^=a[d];return e},BN$h=bnExports$3,Buffer$b=safeBufferExports$1.Buffer;function withPublic$2(t,e){return Buffer$b.from(t.toRed(BN$h.mont(e.modulus)).redPow(new BN$h(e.publicExponent)).fromRed().toArray())}var withPublic_1=withPublic$2,parseKeys$1=parseAsn1,randomBytes$2=browserExports$1,createHash$1=browser$c,mgf$1=mgf$2,xor$1=xor$2,BN$g=bnExports$3,withPublic$1=withPublic_1,crt$1=browserifyRsa,Buffer$a=safeBufferExports$1.Buffer,publicEncrypt=function(e,a,u){var d;e.padding?d=e.padding:u?d=1:d=4;var c=parseKeys$1(e),l;if(d===4)l=oaep$1(c,a);else if(d===1)l=pkcs1$1(c,a,u);else if(d===3){if(l=new BN$g(a),l.cmp(c.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return u?crt$1(l,c):withPublic$1(l,c)};function oaep$1(t,e){var a=t.modulus.byteLength(),u=e.length,d=createHash$1("sha1").update(Buffer$a.alloc(0)).digest(),c=d.length,l=2*c;if(u>a-l-2)throw new Error("message too long");var m=Buffer$a.alloc(a-u-l-2),I=a-c-1,O=randomBytes$2(c),T=xor$1(Buffer$a.concat([d,m,Buffer$a.alloc(1,1),e],I),mgf$1(O,I)),C=xor$1(O,mgf$1(T,c));return new BN$g(Buffer$a.concat([Buffer$a.alloc(1),C,T],a))}function pkcs1$1(t,e,a){var u=e.length,d=t.modulus.byteLength();if(u>d-11)throw new Error("message too long");var c;return a?c=Buffer$a.alloc(d-u-3,255):c=nonZero(d-u-3),new BN$g(Buffer$a.concat([Buffer$a.from([0,a?1:2]),c,Buffer$a.alloc(1),e],d))}function nonZero(t){for(var e=Buffer$a.allocUnsafe(t),a=0,u=randomBytes$2(t*2),d=0,c;a<t;)d===u.length&&(u=randomBytes$2(t*2),d=0),c=u[d++],c&&(e[a++]=c);return e}var parseKeys=parseAsn1,mgf=mgf$2,xor=xor$2,BN$f=bnExports$3,crt=browserifyRsa,createHash=browser$c,withPublic=withPublic_1,Buffer$9=safeBufferExports$1.Buffer,privateDecrypt=function(e,a,u){var d;e.padding?d=e.padding:u?d=1:d=4;var c=parseKeys(e),l=c.modulus.byteLength();if(a.length>l||new BN$f(a).cmp(c.modulus)>=0)throw new Error("decryption error");var m;u?m=withPublic(new BN$f(a),c):m=crt(a,c);var I=Buffer$9.alloc(l-m.length);if(m=Buffer$9.concat([I,m],l),d===4)return oaep(c,m);if(d===1)return pkcs1(c,m,u);if(d===3)return m;throw new Error("unknown padding")};function oaep(t,e){var a=t.modulus.byteLength(),u=createHash("sha1").update(Buffer$9.alloc(0)).digest(),d=u.length;if(e[0]!==0)throw new Error("decryption error");var c=e.slice(1,d+1),l=e.slice(d+1),m=xor(c,mgf(l,d)),I=xor(l,mgf(m,a-d-1));if(compare(u,I.slice(0,d)))throw new Error("decryption error");for(var O=d;I[O]===0;)O++;if(I[O++]!==1)throw new Error("decryption error");return I.slice(O)}function pkcs1(t,e,a){for(var u=e.slice(0,2),d=2,c=0;e[d++]!==0;)if(d>=e.length){c++;break}var l=e.slice(2,d-1);if((u.toString("hex")!=="0002"&&!a||u.toString("hex")!=="0001"&&a)&&c++,l.length<8&&c++,c)throw new Error("decryption error");return e.slice(d)}function compare(t,e){t=Buffer$9.from(t),e=Buffer$9.from(e);var a=0,u=t.length;t.length!==e.length&&(a++,u=Math.min(t.length,e.length));for(var d=-1;++d<u;)a+=t[d]^e[d];return a}(function(t){t.publicEncrypt=publicEncrypt,t.privateDecrypt=privateDecrypt,t.privateEncrypt=function(a,u){return t.publicEncrypt(a,u,!0)},t.publicDecrypt=function(a,u){return t.privateDecrypt(a,u,!0)}})(browser$4);var browser$3={};function oldBrowser$1(){throw new Error(`secure random number generation not supported by this browser
38
+ use chrome, FireFox or Internet Explorer 11`)}var safeBuffer$1=safeBufferExports$1,randombytes=browserExports$1,Buffer$8=safeBuffer$1.Buffer,kBufferMaxLength=safeBuffer$1.kMaxLength,crypto$3=commonjsGlobal.crypto||commonjsGlobal.msCrypto,kMaxUint32=Math.pow(2,32)-1;function assertOffset(t,e){if(typeof t!="number"||t!==t)throw new TypeError("offset must be a number");if(t>kMaxUint32||t<0)throw new TypeError("offset must be a uint32");if(t>kBufferMaxLength||t>e)throw new RangeError("offset out of range")}function assertSize(t,e,a){if(typeof t!="number"||t!==t)throw new TypeError("size must be a number");if(t>kMaxUint32||t<0)throw new TypeError("size must be a uint32");if(t+e>a||t>kBufferMaxLength)throw new RangeError("buffer too small")}crypto$3&&crypto$3.getRandomValues||!process$1.browser?(browser$3.randomFill=randomFill,browser$3.randomFillSync=randomFillSync):(browser$3.randomFill=oldBrowser$1,browser$3.randomFillSync=oldBrowser$1);function randomFill(t,e,a,u){if(!Buffer$8.isBuffer(t)&&!(t instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof e=="function")u=e,e=0,a=t.length;else if(typeof a=="function")u=a,a=t.length-e;else if(typeof u!="function")throw new TypeError('"cb" argument must be a function');return assertOffset(e,t.length),assertSize(a,e,t.length),actualFill(t,e,a,u)}function actualFill(t,e,a,u){if(process$1.browser){var d=t.buffer,c=new Uint8Array(d,e,a);if(crypto$3.getRandomValues(c),u){process$1.nextTick(function(){u(null,t)});return}return t}if(u){randombytes(a,function(m,I){if(m)return u(m);I.copy(t,e),u(null,t)});return}var l=randombytes(a);return l.copy(t,e),t}function randomFillSync(t,e,a){if(typeof e>"u"&&(e=0),!Buffer$8.isBuffer(t)&&!(t instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return assertOffset(e,t.length),a===void 0&&(a=t.length-e),assertSize(a,e,t.length),actualFill(t,e,a)}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=browserExports$1,cryptoBrowserify.createHash=cryptoBrowserify.Hash=browser$c,cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=browser$b;var t=algos,e=Object.keys(t),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(e);cryptoBrowserify.getHashes=function(){return a};var u=browser$a;cryptoBrowserify.pbkdf2=u.pbkdf2,cryptoBrowserify.pbkdf2Sync=u.pbkdf2Sync;var d=browser$9;cryptoBrowserify.Cipher=d.Cipher,cryptoBrowserify.createCipher=d.createCipher,cryptoBrowserify.Cipheriv=d.Cipheriv,cryptoBrowserify.createCipheriv=d.createCipheriv,cryptoBrowserify.Decipher=d.Decipher,cryptoBrowserify.createDecipher=d.createDecipher,cryptoBrowserify.Decipheriv=d.Decipheriv,cryptoBrowserify.createDecipheriv=d.createDecipheriv,cryptoBrowserify.getCiphers=d.getCiphers,cryptoBrowserify.listCiphers=d.listCiphers;var c=requireBrowser$2();cryptoBrowserify.DiffieHellmanGroup=c.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=c.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=c.getDiffieHellman,cryptoBrowserify.createDiffieHellman=c.createDiffieHellman,cryptoBrowserify.DiffieHellman=c.DiffieHellman;var l=requireBrowser$1();cryptoBrowserify.createSign=l.createSign,cryptoBrowserify.Sign=l.Sign,cryptoBrowserify.createVerify=l.createVerify,cryptoBrowserify.Verify=l.Verify,cryptoBrowserify.createECDH=requireBrowser();var m=browser$4;cryptoBrowserify.publicEncrypt=m.publicEncrypt,cryptoBrowserify.privateEncrypt=m.privateEncrypt,cryptoBrowserify.publicDecrypt=m.publicDecrypt,cryptoBrowserify.privateDecrypt=m.privateDecrypt;var I=browser$3;return cryptoBrowserify.randomFill=I.randomFill,cryptoBrowserify.randomFillSync=I.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(`
39
+ `))},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}(function(t){/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const e=requireCryptoBrowserify(),a=BigInt(0),u=BigInt(1),d=BigInt(2),c=BigInt(3),l=BigInt(8),m=Object.freeze({a,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});t.CURVE=m;const I=(Se,ye)=>(Se+ye/d)/ye,O={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(Se){const{n:ye}=m,xe=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),Be=-u*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),Le=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),je=xe,qe=BigInt("0x100000000000000000000000000000000"),Xe=I(je*Se,ye),at=I(-Be*Se,ye);let Ve=Y(Se-Xe*xe-at*Le,ye),dt=Y(-Xe*Be-at*je,ye);const pt=Ve>qe,Ye=dt>qe;if(pt&&(Ve=ye-Ve),Ye&&(dt=ye-dt),Ve>qe||dt>qe)throw new Error("splitScalarEndo: Endomorphism failed, k="+Se);return{k1neg:pt,k1:Ve,k2neg:Ye,k2:dt}}},T=32,C=32,j=32,F=T+1,U=2*T+1;function Z(Se){const{a:ye,b:xe}=m,Be=Y(Se*Se),Le=Y(Be*Se);return Y(Le+ye*Se+xe)}const J=m.a===a;class X extends Error{constructor(ye){super(ye)}}function Q(Se){if(!(Se instanceof te))throw new TypeError("JacobianPoint expected")}class te{constructor(ye,xe,Be){this.x=ye,this.y=xe,this.z=Be}static fromAffine(ye){if(!(ye instanceof me))throw new TypeError("JacobianPoint#fromAffine: expected Point");return ye.equals(me.ZERO)?te.ZERO:new te(ye.x,ye.y,u)}static toAffineBatch(ye){const xe=fe(ye.map(Be=>Be.z));return ye.map((Be,Le)=>Be.toAffine(xe[Le]))}static normalizeZ(ye){return te.toAffineBatch(ye).map(te.fromAffine)}equals(ye){Q(ye);const{x:xe,y:Be,z:Le}=this,{x:je,y:qe,z:Xe}=ye,at=Y(Le*Le),Ve=Y(Xe*Xe),dt=Y(xe*Ve),pt=Y(je*at),Ye=Y(Y(Be*Xe)*Ve),_t=Y(Y(qe*Le)*at);return dt===pt&&Ye===_t}negate(){return new te(this.x,Y(-this.y),this.z)}double(){const{x:ye,y:xe,z:Be}=this,Le=Y(ye*ye),je=Y(xe*xe),qe=Y(je*je),Xe=ye+je,at=Y(d*(Y(Xe*Xe)-Le-qe)),Ve=Y(c*Le),dt=Y(Ve*Ve),pt=Y(dt-d*at),Ye=Y(Ve*(at-pt)-l*qe),_t=Y(d*xe*Be);return new te(pt,Ye,_t)}add(ye){Q(ye);const{x:xe,y:Be,z:Le}=this,{x:je,y:qe,z:Xe}=ye;if(je===a||qe===a)return this;if(xe===a||Be===a)return ye;const at=Y(Le*Le),Ve=Y(Xe*Xe),dt=Y(xe*Ve),pt=Y(je*at),Ye=Y(Y(Be*Xe)*Ve),_t=Y(Y(qe*Le)*at),yt=Y(pt-dt),ct=Y(_t-Ye);if(yt===a)return ct===a?this.double():te.ZERO;const $t=Y(yt*yt),Ct=Y(yt*$t),Nt=Y(dt*$t),Jt=Y(ct*ct-Ct-d*Nt),Qt=Y(ct*(Nt-Jt)-Ye*Ct),Wt=Y(Le*Xe*yt);return new te(Jt,Qt,Wt)}subtract(ye){return this.add(ye.negate())}multiplyUnsafe(ye){const xe=te.ZERO;if(typeof ye=="bigint"&&ye===a)return xe;let Be=H(ye);if(Be===u)return this;if(!J){let pt=xe,Ye=this;for(;Be>a;)Be&u&&(pt=pt.add(Ye)),Ye=Ye.double(),Be>>=u;return pt}let{k1neg:Le,k1:je,k2neg:qe,k2:Xe}=O.splitScalar(Be),at=xe,Ve=xe,dt=this;for(;je>a||Xe>a;)je&u&&(at=at.add(dt)),Xe&u&&(Ve=Ve.add(dt)),dt=dt.double(),je>>=u,Xe>>=u;return Le&&(at=at.negate()),qe&&(Ve=Ve.negate()),Ve=new te(Y(Ve.x*O.beta),Ve.y,Ve.z),at.add(Ve)}precomputeWindow(ye){const xe=J?128/ye+1:256/ye+1,Be=[];let Le=this,je=Le;for(let qe=0;qe<xe;qe++){je=Le,Be.push(je);for(let Xe=1;Xe<2**(ye-1);Xe++)je=je.add(Le),Be.push(je);Le=je.double()}return Be}wNAF(ye,xe){!xe&&this.equals(te.BASE)&&(xe=me.BASE);const Be=xe&&xe._WINDOW_SIZE||1;if(256%Be)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let Le=xe&&pe.get(xe);Le||(Le=this.precomputeWindow(Be),xe&&Be!==1&&(Le=te.normalizeZ(Le),pe.set(xe,Le)));let je=te.ZERO,qe=te.BASE;const Xe=1+(J?128/Be:256/Be),at=2**(Be-1),Ve=BigInt(2**Be-1),dt=2**Be,pt=BigInt(Be);for(let Ye=0;Ye<Xe;Ye++){const _t=Ye*at;let yt=Number(ye&Ve);ye>>=pt,yt>at&&(yt-=dt,ye+=u);const ct=_t,$t=_t+Math.abs(yt)-1,Ct=Ye%2!==0,Nt=yt<0;yt===0?qe=qe.add(se(Ct,Le[ct])):je=je.add(se(Nt,Le[$t]))}return{p:je,f:qe}}multiply(ye,xe){let Be=H(ye),Le,je;if(J){const{k1neg:qe,k1:Xe,k2neg:at,k2:Ve}=O.splitScalar(Be);let{p:dt,f:pt}=this.wNAF(Xe,xe),{p:Ye,f:_t}=this.wNAF(Ve,xe);dt=se(qe,dt),Ye=se(at,Ye),Ye=new te(Y(Ye.x*O.beta),Ye.y,Ye.z),Le=dt.add(Ye),je=pt.add(_t)}else{const{p:qe,f:Xe}=this.wNAF(Be,xe);Le=qe,je=Xe}return te.normalizeZ([Le,je])[0]}toAffine(ye){const{x:xe,y:Be,z:Le}=this,je=this.equals(te.ZERO);ye==null&&(ye=je?l:he(Le));const qe=ye,Xe=Y(qe*qe),at=Y(Xe*qe),Ve=Y(xe*Xe),dt=Y(Be*at),pt=Y(Le*qe);if(je)return me.ZERO;if(pt!==u)throw new Error("invZ was invalid");return new me(Ve,dt)}}te.BASE=new te(m.Gx,m.Gy,u),te.ZERO=new te(a,u,a);function se(Se,ye){const xe=ye.negate();return Se?xe:ye}const pe=new WeakMap;class me{constructor(ye,xe){this.x=ye,this.y=xe}_setWindowSize(ye){this._WINDOW_SIZE=ye,pe.delete(this)}hasEvenY(){return this.y%d===a}static fromCompressedHex(ye){const xe=ye.length===32,Be=A(xe?ye:ye.subarray(1));if(!ke(Be))throw new Error("Point is not on curve");const Le=Z(Be);let je=_e(Le);const qe=(je&u)===u;xe?qe&&(je=Y(-je)):(ye[0]&1)===1!==qe&&(je=Y(-je));const Xe=new me(Be,je);return Xe.assertValidity(),Xe}static fromUncompressedHex(ye){const xe=A(ye.subarray(1,T+1)),Be=A(ye.subarray(T+1,T*2+1)),Le=new me(xe,Be);return Le.assertValidity(),Le}static fromHex(ye){const xe=D(ye),Be=xe.length,Le=xe[0];if(Be===T)return this.fromCompressedHex(xe);if(Be===F&&(Le===2||Le===3))return this.fromCompressedHex(xe);if(Be===U&&Le===4)return this.fromUncompressedHex(xe);throw new Error(`Point.fromHex: received invalid point. Expected 32-${F} compressed bytes or ${U} uncompressed bytes, not ${Be}`)}static fromPrivateKey(ye){return me.BASE.multiply(Qe(ye))}static fromSignature(ye,xe,Be){const{r:Le,s:je}=rt(xe);if(![0,1,2,3].includes(Be))throw new Error("Cannot recover: invalid recovery bit");const qe=ge(D(ye)),{n:Xe}=m,at=Be===2||Be===3?Le+Xe:Le,Ve=he(at,Xe),dt=Y(-qe*Ve,Xe),pt=Y(je*Ve,Xe),Ye=Be&1?"03":"02",_t=me.fromHex(Ye+w(at)),yt=me.BASE.multiplyAndAddUnsafe(_t,dt,pt);if(!yt)throw new Error("Cannot recover signature: point at infinify");return yt.assertValidity(),yt}toRawBytes(ye=!1){return E(this.toHex(ye))}toHex(ye=!1){const xe=w(this.x);return ye?`${this.hasEvenY()?"02":"03"}${xe}`:`04${xe}${w(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const ye="Point is not on elliptic curve",{x:xe,y:Be}=this;if(!ke(xe)||!ke(Be))throw new Error(ye);const Le=Y(Be*Be),je=Z(xe);if(Y(Le-je)!==a)throw new Error(ye)}equals(ye){return this.x===ye.x&&this.y===ye.y}negate(){return new me(this.x,Y(-this.y))}double(){return te.fromAffine(this).double().toAffine()}add(ye){return te.fromAffine(this).add(te.fromAffine(ye)).toAffine()}subtract(ye){return this.add(ye.negate())}multiply(ye){return te.fromAffine(this).multiply(ye,this).toAffine()}multiplyAndAddUnsafe(ye,xe,Be){const Le=te.fromAffine(this),je=xe===a||xe===u||this!==me.BASE?Le.multiplyUnsafe(xe):Le.multiply(xe),qe=te.fromAffine(ye).multiplyUnsafe(Be),Xe=je.add(qe);return Xe.equals(te.ZERO)?void 0:Xe.toAffine()}}t.Point=me,me.BASE=new me(m.Gx,m.Gy),me.ZERO=new me(a,a);function Ee(Se){return Number.parseInt(Se[0],16)>=8?"00"+Se:Se}function V(Se){if(Se.length<2||Se[0]!==2)throw new Error(`Invalid signature integer tag: ${S(Se)}`);const ye=Se[1],xe=Se.subarray(2,ye+2);if(!ye||xe.length!==ye)throw new Error("Invalid signature integer: wrong length");if(xe[0]===0&&xe[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:A(xe),left:Se.subarray(ye+2)}}function ae(Se){if(Se.length<2||Se[0]!=48)throw new Error(`Invalid signature tag: ${S(Se)}`);if(Se[1]!==Se.length-2)throw new Error("Invalid signature: incorrect length");const{data:ye,left:xe}=V(Se.subarray(2)),{data:Be,left:Le}=V(xe);if(Le.length)throw new Error(`Invalid signature: left bytes after parsing: ${S(Le)}`);return{r:ye,s:Be}}class ne{constructor(ye,xe){this.r=ye,this.s=xe,this.assertValidity()}static fromCompact(ye){const xe=ye instanceof Uint8Array,Be="Signature.fromCompact";if(typeof ye!="string"&&!xe)throw new TypeError(`${Be}: Expected string or Uint8Array`);const Le=xe?S(ye):ye;if(Le.length!==128)throw new Error(`${Be}: Expected 64-byte hex`);return new ne(N(Le.slice(0,64)),N(Le.slice(64,128)))}static fromDER(ye){const xe=ye instanceof Uint8Array;if(typeof ye!="string"&&!xe)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:Be,s:Le}=ae(xe?ye:E(ye));return new ne(Be,Le)}static fromHex(ye){return this.fromDER(ye)}assertValidity(){const{r:ye,s:xe}=this;if(!Te(ye))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Te(xe))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const ye=m.n>>u;return this.s>ye}normalizeS(){return this.hasHighS()?new ne(this.r,Y(-this.s,m.n)):this}toDERRawBytes(){return E(this.toDERHex())}toDERHex(){const ye=Ee(L(this.s)),xe=Ee(L(this.r)),Be=ye.length/2,Le=xe.length/2,je=L(Be),qe=L(Le);return`30${L(Le+Be+4)}02${qe}${xe}02${je}${ye}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return E(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}t.Signature=ne;function M(...Se){if(!Se.every(Be=>Be instanceof Uint8Array))throw new Error("Uint8Array list expected");if(Se.length===1)return Se[0];const ye=Se.reduce((Be,Le)=>Be+Le.length,0),xe=new Uint8Array(ye);for(let Be=0,Le=0;Be<Se.length;Be++){const je=Se[Be];xe.set(je,Le),Le+=je.length}return xe}const v=Array.from({length:256},(Se,ye)=>ye.toString(16).padStart(2,"0"));function S(Se){if(!(Se instanceof Uint8Array))throw new Error("Expected Uint8Array");let ye="";for(let xe=0;xe<Se.length;xe++)ye+=v[Se[xe]];return ye}const y=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function w(Se){if(typeof Se!="bigint")throw new Error("Expected bigint");if(!(a<=Se&&Se<y))throw new Error("Expected number 0 <= n < 2^256");return Se.toString(16).padStart(64,"0")}function P(Se){const ye=E(w(Se));if(ye.length!==32)throw new Error("Error: expected 32 bytes");return ye}function L(Se){const ye=Se.toString(16);return ye.length&1?`0${ye}`:ye}function N(Se){if(typeof Se!="string")throw new TypeError("hexToNumber: expected string, got "+typeof Se);return BigInt(`0x${Se}`)}function E(Se){if(typeof Se!="string")throw new TypeError("hexToBytes: expected string, got "+typeof Se);if(Se.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+Se.length);const ye=new Uint8Array(Se.length/2);for(let xe=0;xe<ye.length;xe++){const Be=xe*2,Le=Se.slice(Be,Be+2),je=Number.parseInt(Le,16);if(Number.isNaN(je)||je<0)throw new Error("Invalid byte sequence");ye[xe]=je}return ye}function A(Se){return N(S(Se))}function D(Se){return Se instanceof Uint8Array?Uint8Array.from(Se):E(Se)}function H(Se){if(typeof Se=="number"&&Number.isSafeInteger(Se)&&Se>0)return BigInt(Se);if(typeof Se=="bigint"&&Te(Se))return Se;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Y(Se,ye=m.P){const xe=Se%ye;return xe>=a?xe:ye+xe}function le(Se,ye){const{P:xe}=m;let Be=Se;for(;ye-- >a;)Be*=Be,Be%=xe;return Be}function _e(Se){const{P:ye}=m,xe=BigInt(6),Be=BigInt(11),Le=BigInt(22),je=BigInt(23),qe=BigInt(44),Xe=BigInt(88),at=Se*Se*Se%ye,Ve=at*at*Se%ye,dt=le(Ve,c)*Ve%ye,pt=le(dt,c)*Ve%ye,Ye=le(pt,d)*at%ye,_t=le(Ye,Be)*Ye%ye,yt=le(_t,Le)*_t%ye,ct=le(yt,qe)*yt%ye,$t=le(ct,Xe)*ct%ye,Ct=le($t,qe)*yt%ye,Nt=le(Ct,c)*Ve%ye,Jt=le(Nt,je)*_t%ye,Qt=le(Jt,xe)*at%ye,Wt=le(Qt,d);if(Wt*Wt%ye!==Se)throw new Error("Cannot find square root");return Wt}function he(Se,ye=m.P){if(Se===a||ye<=a)throw new Error(`invert: expected positive integers, got n=${Se} mod=${ye}`);let xe=Y(Se,ye),Be=ye,Le=a,je=u;for(;xe!==a;){const Xe=Be/xe,at=Be%xe,Ve=Le-je*Xe;Be=xe,xe=at,Le=je,je=Ve}if(Be!==u)throw new Error("invert: does not exist");return Y(Le,ye)}function fe(Se,ye=m.P){const xe=new Array(Se.length),Be=Se.reduce((je,qe,Xe)=>qe===a?je:(xe[Xe]=je,Y(je*qe,ye)),u),Le=he(Be,ye);return Se.reduceRight((je,qe,Xe)=>qe===a?je:(xe[Xe]=Y(je*xe[Xe],ye),Y(je*qe,ye)),Le),xe}function ve(Se){const ye=Se.length*8-C*8,xe=A(Se);return ye>0?xe>>BigInt(ye):xe}function ge(Se,ye=!1){const xe=ve(Se);if(ye)return xe;const{n:Be}=m;return xe>=Be?xe-Be:xe}let Ie,ue;class ce{constructor(ye,xe){if(this.hashLen=ye,this.qByteLen=xe,typeof ye!="number"||ye<2)throw new Error("hashLen must be a number");if(typeof xe!="number"||xe<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(ye).fill(1),this.k=new Uint8Array(ye).fill(0),this.counter=0}hmac(...ye){return t.utils.hmacSha256(this.k,...ye)}hmacSync(...ye){return ue(this.k,...ye)}checkSync(){if(typeof ue!="function")throw new X("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(ye=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),ye),this.v=await this.hmac(this.v),ye.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),ye),this.v=await this.hmac(this.v))}reseedSync(ye=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),ye),this.v=this.hmacSync(this.v),ye.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),ye),this.v=this.hmacSync(this.v))}async generate(){this.incr();let ye=0;const xe=[];for(;ye<this.qByteLen;){this.v=await this.hmac(this.v);const Be=this.v.slice();xe.push(Be),ye+=this.v.length}return M(...xe)}generateSync(){this.checkSync(),this.incr();let ye=0;const xe=[];for(;ye<this.qByteLen;){this.v=this.hmacSync(this.v);const Be=this.v.slice();xe.push(Be),ye+=this.v.length}return M(...xe)}}function Te(Se){return a<Se&&Se<m.n}function ke(Se){return a<Se&&Se<m.P}function He(Se,ye,xe,Be=!0){const{n:Le}=m,je=ge(Se,!0);if(!Te(je))return;const qe=he(je,Le),Xe=me.BASE.multiply(je),at=Y(Xe.x,Le);if(at===a)return;const Ve=Y(qe*Y(ye+xe*at,Le),Le);if(Ve===a)return;let dt=new ne(at,Ve),pt=(Xe.x===dt.r?0:2)|Number(Xe.y&u);return Be&&dt.hasHighS()&&(dt=dt.normalizeS(),pt^=1),{sig:dt,recovery:pt}}function Qe(Se){let ye;if(typeof Se=="bigint")ye=Se;else if(typeof Se=="number"&&Number.isSafeInteger(Se)&&Se>0)ye=BigInt(Se);else if(typeof Se=="string"){if(Se.length!==2*C)throw new Error("Expected 32 bytes of private key");ye=N(Se)}else if(Se instanceof Uint8Array){if(Se.length!==C)throw new Error("Expected 32 bytes of private key");ye=A(Se)}else throw new TypeError("Expected valid private key");if(!Te(ye))throw new Error("Expected private key: 0 < key < n");return ye}function it(Se){return Se instanceof me?(Se.assertValidity(),Se):me.fromHex(Se)}function rt(Se){if(Se instanceof ne)return Se.assertValidity(),Se;try{return ne.fromDER(Se)}catch{return ne.fromCompact(Se)}}function Fe(Se,ye=!1){return me.fromPrivateKey(Se).toRawBytes(ye)}t.getPublicKey=Fe;function wt(Se,ye,xe,Be=!1){return me.fromSignature(Se,ye,xe).toRawBytes(Be)}t.recoverPublicKey=wt;function et(Se){const ye=Se instanceof Uint8Array,xe=typeof Se=="string",Be=(ye||xe)&&Se.length;return ye?Be===F||Be===U:xe?Be===F*2||Be===U*2:Se instanceof me}function At(Se,ye,xe=!1){if(et(Se))throw new TypeError("getSharedSecret: first arg must be private key");if(!et(ye))throw new TypeError("getSharedSecret: second arg must be public key");const Be=it(ye);return Be.assertValidity(),Be.multiply(Qe(Se)).toRawBytes(xe)}t.getSharedSecret=At;function gt(Se){const ye=Se.length>T?Se.slice(0,T):Se;return A(ye)}function $e(Se){const ye=gt(Se),xe=Y(ye,m.n);return Me(xe<a?ye:xe)}function Me(Se){return P(Se)}function Ze(Se,ye,xe){if(Se==null)throw new Error(`sign: expected valid message hash, not "${Se}"`);const Be=D(Se),Le=Qe(ye),je=[Me(Le),$e(Be)];if(xe!=null){xe===!0&&(xe=t.utils.randomBytes(T));const at=D(xe);if(at.length!==T)throw new Error(`sign: Expected ${T} bytes of extra data`);je.push(at)}const qe=M(...je),Xe=gt(Be);return{seed:qe,m:Xe,d:Le}}function ze(Se,ye){const{sig:xe,recovery:Be}=Se,{der:Le,recovered:je}=Object.assign({canonical:!0,der:!0},ye),qe=Le?xe.toDERRawBytes():xe.toCompactRawBytes();return je?[qe,Be]:qe}async function Ge(Se,ye,xe={}){const{seed:Be,m:Le,d:je}=Ze(Se,ye,xe.extraEntropy),qe=new ce(j,C);await qe.reseed(Be);let Xe;for(;!(Xe=He(await qe.generate(),Le,je,xe.canonical));)await qe.reseed();return ze(Xe,xe)}t.sign=Ge;function ht(Se,ye,xe={}){const{seed:Be,m:Le,d:je}=Ze(Se,ye,xe.extraEntropy),qe=new ce(j,C);qe.reseedSync(Be);let Xe;for(;!(Xe=He(qe.generateSync(),Le,je,xe.canonical));)qe.reseedSync();return ze(Xe,xe)}t.signSync=ht;const oe={strict:!0};function ee(Se,ye,xe,Be=oe){let Le;try{Le=rt(Se),ye=D(ye)}catch{return!1}const{r:je,s:qe}=Le;if(Be.strict&&Le.hasHighS())return!1;const Xe=ge(ye);let at;try{at=it(xe)}catch{return!1}const{n:Ve}=m,dt=he(qe,Ve),pt=Y(Xe*dt,Ve),Ye=Y(je*dt,Ve),_t=me.BASE.multiplyAndAddUnsafe(at,pt,Ye);return _t?Y(_t.x,Ve)===je:!1}t.verify=ee;function re(Se){return Y(A(Se),m.n)}class be{constructor(ye,xe){this.r=ye,this.s=xe,this.assertValidity()}static fromHex(ye){const xe=D(ye);if(xe.length!==64)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${xe.length}`);const Be=A(xe.subarray(0,32)),Le=A(xe.subarray(32,64));return new be(Be,Le)}assertValidity(){const{r:ye,s:xe}=this;if(!ke(ye)||!Te(xe))throw new Error("Invalid signature")}toHex(){return w(this.r)+w(this.s)}toRawBytes(){return E(this.toHex())}}function Pe(Se){return me.fromPrivateKey(Se).toRawX()}class Ne{constructor(ye,xe,Be=t.utils.randomBytes()){if(ye==null)throw new TypeError(`sign: Expected valid message, not "${ye}"`);this.m=D(ye);const{x:Le,scalar:je}=this.getScalar(Qe(xe));if(this.px=Le,this.d=je,this.rand=D(Be),this.rand.length!==32)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(ye){const xe=me.fromPrivateKey(ye),Be=xe.hasEvenY()?ye:m.n-ye;return{point:xe,scalar:Be,x:xe.toRawX()}}initNonce(ye,xe){return P(ye^A(xe))}finalizeNonce(ye){const xe=Y(A(ye),m.n);if(xe===a)throw new Error("sign: Creation of signature failed. k is zero");const{point:Be,x:Le,scalar:je}=this.getScalar(xe);return{R:Be,rx:Le,k:je}}finalizeSig(ye,xe,Be,Le){return new be(ye.x,Y(xe+Be*Le,m.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:ye,d:xe,px:Be,rand:Le}=this,je=t.utils.taggedHash,qe=this.initNonce(xe,await je(Et.aux,Le)),{R:Xe,rx:at,k:Ve}=this.finalizeNonce(await je(Et.nonce,qe,Be,ye)),dt=re(await je(Et.challenge,at,Be,ye)),pt=this.finalizeSig(Xe,Ve,dt,xe);return await bt(pt,ye,Be)||this.error(),pt}calcSync(){const{m:ye,d:xe,px:Be,rand:Le}=this,je=t.utils.taggedHashSync,qe=this.initNonce(xe,je(Et.aux,Le)),{R:Xe,rx:at,k:Ve}=this.finalizeNonce(je(Et.nonce,qe,Be,ye)),dt=re(je(Et.challenge,at,Be,ye)),pt=this.finalizeSig(Xe,Ve,dt,xe);return vt(pt,ye,Be)||this.error(),pt}}async function Oe(Se,ye,xe){return new Ne(Se,ye,xe).calc()}function ut(Se,ye,xe){return new Ne(Se,ye,xe).calcSync()}function lt(Se,ye,xe){const Be=Se instanceof be,Le=Be?Se:be.fromHex(Se);return Be&&Le.assertValidity(),{...Le,m:D(ye),P:it(xe)}}function Je(Se,ye,xe,Be){const Le=me.BASE.multiplyAndAddUnsafe(ye,Qe(xe),Y(-Be,m.n));return!(!Le||!Le.hasEvenY()||Le.x!==Se)}async function bt(Se,ye,xe){try{const{r:Be,s:Le,m:je,P:qe}=lt(Se,ye,xe),Xe=re(await t.utils.taggedHash(Et.challenge,P(Be),qe.toRawX(),je));return Je(Be,qe,Le,Xe)}catch{return!1}}function vt(Se,ye,xe){try{const{r:Be,s:Le,m:je,P:qe}=lt(Se,ye,xe),Xe=re(t.utils.taggedHashSync(Et.challenge,P(Be),qe.toRawX(),je));return Je(Be,qe,Le,Xe)}catch(Be){if(Be instanceof X)throw Be;return!1}}t.schnorr={Signature:be,getPublicKey:Pe,sign:Oe,verify:bt,signSync:ut,verifySync:vt},me.BASE._setWindowSize(8);const ot={node:e,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Et={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},Bt={};t.utils={bytesToHex:S,hexToBytes:E,concatBytes:M,mod:Y,invert:he,isValidPrivateKey(Se){try{return Qe(Se),!0}catch{return!1}},_bigintTo32Bytes:P,_normalizePrivateKey:Qe,hashToPrivateKey:Se=>{Se=D(Se);const ye=C+8;if(Se.length<ye||Se.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const xe=Y(A(Se),m.n-u)+u;return P(xe)},randomBytes:(Se=32)=>{if(ot.web)return ot.web.getRandomValues(new Uint8Array(Se));if(ot.node){const{randomBytes:ye}=ot.node;return Uint8Array.from(ye(Se))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.hashToPrivateKey(t.utils.randomBytes(C+8)),precompute(Se=8,ye=me.BASE){const xe=ye===me.BASE?ye:new me(ye.x,ye.y);return xe._setWindowSize(Se),xe.multiply(c),xe},sha256:async(...Se)=>{if(ot.web){const ye=await ot.web.subtle.digest("SHA-256",M(...Se));return new Uint8Array(ye)}else if(ot.node){const{createHash:ye}=ot.node,xe=ye("sha256");return Se.forEach(Be=>xe.update(Be)),Uint8Array.from(xe.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(Se,...ye)=>{if(ot.web){const xe=await ot.web.subtle.importKey("raw",Se,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Be=M(...ye),Le=await ot.web.subtle.sign("HMAC",xe,Be);return new Uint8Array(Le)}else if(ot.node){const{createHmac:xe}=ot.node,Be=xe("sha256",Se);return ye.forEach(Le=>Be.update(Le)),Uint8Array.from(Be.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(Se,...ye)=>{let xe=Bt[Se];if(xe===void 0){const Be=await t.utils.sha256(Uint8Array.from(Se,Le=>Le.charCodeAt(0)));xe=M(Be,Be),Bt[Se]=xe}return t.utils.sha256(xe,...ye)},taggedHashSync:(Se,...ye)=>{if(typeof Ie!="function")throw new X("sha256Sync is undefined, you need to set it");let xe=Bt[Se];if(xe===void 0){const Be=Ie(Uint8Array.from(Se,Le=>Le.charCodeAt(0)));xe=M(Be,Be),Bt[Se]=xe}return Ie(xe,...ye)},_JacobianPoint:te},Object.defineProperties(t.utils,{sha256Sync:{configurable:!1,get(){return Ie},set(Se){Ie||(Ie=Se)}},hmacSha256Sync:{configurable:!1,get(){return ue},set(Se){ue||(ue=Se)}}})})(lib$2);var ecdsaSigFormatter={};Object.defineProperty(ecdsaSigFormatter,"__esModule",{value:!0}),ecdsaSigFormatter.joseToDer=ecdsaSigFormatter.derToJose=void 0;const base64_js_1=base64Js,base64Url_1=base64Url;function getParamSize(t){return(t/8|0)+(t%8===0?0:1)}const paramBytesForAlg={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};function getParamBytesForAlg(t){const e=paramBytesForAlg[t];if(e)return e;throw new Error(`Unknown algorithm "${t}"`)}const MAX_OCTET=128,CLASS_UNIVERSAL=0,PRIMITIVE_BIT=32,TAG_SEQ=16,TAG_INT=2,ENCODED_TAG_SEQ=TAG_SEQ|PRIMITIVE_BIT|CLASS_UNIVERSAL<<6,ENCODED_TAG_INT=TAG_INT|CLASS_UNIVERSAL<<6;function signatureAsBytes(t){if(t instanceof Uint8Array)return t;if(typeof t=="string")return(0,base64_js_1.toByteArray)((0,base64Url_1.pad)(t));throw new TypeError("ECDSA signature must be a Base64 string or a Uint8Array")}function derToJose(t,e){const a=signatureAsBytes(t),u=getParamBytesForAlg(e),d=u+1,c=a.length;let l=0;if(a[l++]!==ENCODED_TAG_SEQ)throw new Error('Could not find expected "seq"');let m=a[l++];if(m===(MAX_OCTET|1)&&(m=a[l++]),c-l<m)throw new Error(`"seq" specified length of "${m}", only "${c-l}" remaining`);if(a[l++]!==ENCODED_TAG_INT)throw new Error('Could not find expected "int" for "r"');const I=a[l++];if(c-l-2<I)throw new Error(`"r" specified length of "${I}", only "${c-l-2}" available`);if(d<I)throw new Error(`"r" specified length of "${I}", max of "${d}" is acceptable`);const O=l;if(l+=I,a[l++]!==ENCODED_TAG_INT)throw new Error('Could not find expected "int" for "s"');const T=a[l++];if(c-l!==T)throw new Error(`"s" specified length of "${T}", expected "${c-l}"`);if(d<T)throw new Error(`"s" specified length of "${T}", max of "${d}" is acceptable`);const C=l;if(l+=T,l!==c)throw new Error(`Expected to consume entire array, but "${c-l}" bytes remain`);const j=u-I,F=u-T,U=new Uint8Array(j+I+F+T);for(l=0;l<j;++l)U[l]=0;U.set(a.subarray(O+Math.max(-j,0),O+I),l),l=u;for(const Z=l;l<Z+F;++l)U[l]=0;return U.set(a.subarray(C+Math.max(-F,0),C+T),l),(0,base64Url_1.escape)((0,base64_js_1.fromByteArray)(U))}ecdsaSigFormatter.derToJose=derToJose;function countPadding(t,e,a){let u=0;for(;e+u<a&&t[e+u]===0;)++u;return t[e+u]>=MAX_OCTET&&--u,u}function joseToDer(t,e){t=signatureAsBytes(t);const a=getParamBytesForAlg(e),u=t.length;if(u!==a*2)throw new TypeError(`"${e}" signatures must be "${a*2}" bytes, saw "${u}"`);const d=countPadding(t,0,a),c=countPadding(t,a,t.length),l=a-d,m=a-c,I=2+l+1+1+m,O=I<MAX_OCTET,T=new Uint8Array((O?2:3)+I);let C=0;return T[C++]=ENCODED_TAG_SEQ,O?T[C++]=I:(T[C++]=MAX_OCTET|1,T[C++]=I&255),T[C++]=ENCODED_TAG_INT,T[C++]=l,d<0?(T[C++]=0,T.set(t.subarray(0,a),C),C+=a):(T.set(t.subarray(d,a),C),C+=a-d),T[C++]=ENCODED_TAG_INT,T[C++]=m,c<0?(T[C++]=0,T.set(t.subarray(a),C)):T.set(t.subarray(a+c),C),T}ecdsaSigFormatter.joseToDer=joseToDer;var errors$5={};Object.defineProperty(errors$5,"__esModule",{value:!0}),errors$5.InvalidTokenError=errors$5.MissingParametersError=void 0;class MissingParametersError extends Error{constructor(e){super(),this.name="MissingParametersError",this.message=e||""}}errors$5.MissingParametersError=MissingParametersError;class InvalidTokenError extends Error{constructor(e){super(),this.name="InvalidTokenError",this.message=e||""}}errors$5.InvalidTokenError=InvalidTokenError,Object.defineProperty(secp256k1$3,"__esModule",{value:!0}),secp256k1$3.SECP256K1Client=void 0;const hmac_1=hmac$2,sha256_1$3=sha256$5,secp=lib$2,ecdsaSigFormatter_1=ecdsaSigFormatter,errors_1$2=errors$5,utils_1=utils$M;secp.utils.hmacSha256Sync=(t,...e)=>{const a=hmac_1.hmac.create(sha256_1$3.sha256,t);return e.forEach(u=>a.update(u)),a.digest()};class SECP256K1Client{static derivePublicKey(e,a=!0){return e.length===66&&(e=e.slice(0,64)),e.length<64&&(e=e.padStart(64,"0")),(0,utils_1.bytesToHex)(secp.getPublicKey(e,a))}static signHash(e,a,u="jose"){if(!e||!a)throw new errors_1$2.MissingParametersError("a signing input hash and private key are all required");const d=secp.signSync(e,a.slice(0,64),{der:!0,canonical:!1});if(u==="der")return(0,utils_1.bytesToHex)(d);if(u==="jose")return(0,ecdsaSigFormatter_1.derToJose)(d,"ES256");throw Error("Invalid signature format")}static loadSignature(e){return(0,ecdsaSigFormatter_1.joseToDer)(e,"ES256")}static verifyHash(e,a,u){if(!e||!a||!u)throw new errors_1$2.MissingParametersError("a signing input hash, der signature, and public key are all required");return secp.verify(a,e,u,{strict:!1})}}secp256k1$3.SECP256K1Client=SECP256K1Client,SECP256K1Client.algorithmName="ES256K",function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.cryptoClients=t.SECP256K1Client=void 0;const e=secp256k1$3;Object.defineProperty(t,"SECP256K1Client",{enumerable:!0,get:function(){return e.SECP256K1Client}});const a={ES256K:e.SECP256K1Client};t.cryptoClients=a}(cryptoClients);var sha256$2={},__awaiter$1=commonjsGlobal&&commonjsGlobal.__awaiter||function(t,e,a,u){function d(c){return c instanceof a?c:new a(function(l){l(c)})}return new(a||(a=Promise))(function(c,l){function m(T){try{O(u.next(T))}catch(C){l(C)}}function I(T){try{O(u.throw(T))}catch(C){l(C)}}function O(T){T.done?c(T.value):d(T.value).then(m,I)}O((u=u.apply(t,e||[])).next())})};Object.defineProperty(sha256$2,"__esModule",{value:!0}),sha256$2.hashSha256Async=sha256$2.hashSha256=void 0;const sha256_1$2=sha256$5;function hashSha256(t){return(0,sha256_1$2.sha256)(t)}sha256$2.hashSha256=hashSha256;function hashSha256Async(t){return __awaiter$1(this,void 0,void 0,function*(){try{if(typeof crypto<"u"&&typeof crypto.subtle<"u"){const a=typeof t=="string"?new TextEncoder().encode(t):t,u=yield crypto.subtle.digest("SHA-256",a);return new Uint8Array(u)}else{const a=requireCryptoBrowserify();if(!a.createHash)throw new Error("`crypto` module does not contain `createHash`");return Promise.resolve(a.createHash("sha256").update(t).digest())}}catch(e){return console.log(e),console.log('Crypto lib not found. Neither the global `crypto.subtle` Web Crypto API, nor the or the Node.js `require("crypto").createHash` module is available. Falling back to JS implementation.'),Promise.resolve(hashSha256(t))}})}sha256$2.hashSha256Async=hashSha256Async;var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(t,e,a,u){function d(c){return c instanceof a?c:new a(function(l){l(c)})}return new(a||(a=Promise))(function(c,l){function m(T){try{O(u.next(T))}catch(C){l(C)}}function I(T){try{O(u.throw(T))}catch(C){l(C)}}function O(T){T.done?c(T.value):d(T.value).then(m,I)}O((u=u.apply(t,e||[])).next())})};Object.defineProperty(signer,"__esModule",{value:!0}),signer.TokenSigner=signer.createUnsecuredToken=void 0;const base64url$2=base64Url,cryptoClients_1$1=cryptoClients,errors_1$1=errors$5,sha256_1$1=sha256$2;function createSigningInput(t,e){const a=[],u=base64url$2.encode(JSON.stringify(e));a.push(u);const d=base64url$2.encode(JSON.stringify(t));return a.push(d),a.join(".")}function createUnsecuredToken(t){return createSigningInput(t,{typ:"JWT",alg:"none"})+"."}signer.createUnsecuredToken=createUnsecuredToken;class TokenSigner{constructor(e,a){if(!(e&&a))throw new errors_1$1.MissingParametersError("a signing algorithm and private key are required");if(typeof e!="string")throw new Error("signing algorithm parameter must be a string");if(e=e.toUpperCase(),!cryptoClients_1$1.cryptoClients.hasOwnProperty(e))throw new Error("invalid signing algorithm");this.tokenType="JWT",this.cryptoClient=cryptoClients_1$1.cryptoClients[e],this.rawPrivateKey=a}header(e={}){const a={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},a,e)}sign(e,a=!1,u={}){const d=this.header(u),c=createSigningInput(e,d),l=(0,sha256_1$1.hashSha256)(c);return this.createWithSignedHash(e,a,d,c,l)}signAsync(e,a=!1,u={}){return __awaiter(this,void 0,void 0,function*(){const d=this.header(u),c=createSigningInput(e,d),l=yield(0,sha256_1$1.hashSha256Async)(c);return this.createWithSignedHash(e,a,d,c,l)})}createWithSignedHash(e,a,u,d,c){const l=this.cryptoClient.signHash(c,this.rawPrivateKey);return a?{header:[base64url$2.encode(JSON.stringify(u))],payload:JSON.stringify(e),signature:[l]}:[d,l].join(".")}}signer.TokenSigner=TokenSigner;var verifier={};Object.defineProperty(verifier,"__esModule",{value:!0}),verifier.TokenVerifier=void 0;const base64url$1=base64Url,cryptoClients_1=cryptoClients,errors_1=errors$5,sha256_1=sha256$2;class TokenVerifier{constructor(e,a){if(!(e&&a))throw new errors_1.MissingParametersError("a signing algorithm and public key are required");if(typeof e!="string")throw"signing algorithm parameter must be a string";if(e=e.toUpperCase(),!cryptoClients_1.cryptoClients.hasOwnProperty(e))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=cryptoClients_1.cryptoClients[e],this.rawPublicKey=a}verify(e){return typeof e=="string"?this.verifyCompact(e,!1):typeof e=="object"?this.verifyExpanded(e,!1):!1}verifyAsync(e){return typeof e=="string"?this.verifyCompact(e,!0):typeof e=="object"?this.verifyExpanded(e,!0):Promise.resolve(!1)}verifyCompact(e,a){const u=e.split("."),d=u[0]+"."+u[1],c=l=>{const m=this.cryptoClient.loadSignature(u[2]);return this.cryptoClient.verifyHash(l,m,this.rawPublicKey)};if(a)return(0,sha256_1.hashSha256Async)(d).then(l=>c(l));{const l=(0,sha256_1.hashSha256)(d);return c(l)}}verifyExpanded(e,a){const u=[e.header.join("."),base64url$1.encode(e.payload)].join(".");let d=!0;const c=l=>(e.signature.map(m=>{const I=this.cryptoClient.loadSignature(m);this.cryptoClient.verifyHash(l,I,this.rawPublicKey)||(d=!1)}),d);if(a)return(0,sha256_1.hashSha256Async)(u).then(l=>c(l));{const l=(0,sha256_1.hashSha256)(u);return c(l)}}}verifier.TokenVerifier=TokenVerifier;var decode$3={};Object.defineProperty(decode$3,"__esModule",{value:!0}),decode$3.decodeToken=void 0;const base64url=base64Url;function decodeToken(t){if(typeof t=="string"){const e=t.split("."),a=JSON.parse(base64url.decode(e[0])),u=JSON.parse(base64url.decode(e[1])),d=e[2];return{header:a,payload:u,signature:d}}else if(typeof t=="object"){if(typeof t.payload!="string")throw new Error("Expected token payload to be a base64 or json string");let e=t.payload;t.payload[0]!=="{"&&(e=base64url.decode(e));const a=[];return t.header.map(u=>{const d=JSON.parse(base64url.decode(u));a.push(d)}),{header:a,payload:JSON.parse(e),signature:t.signature}}}decode$3.decodeToken=decodeToken,function(t){var e=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(u,d,c,l){l===void 0&&(l=c);var m=Object.getOwnPropertyDescriptor(d,c);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[c]}}),Object.defineProperty(u,l,m)}:function(u,d,c,l){l===void 0&&(l=c),u[l]=d[c]}),a=commonjsGlobal&&commonjsGlobal.__exportStar||function(u,d){for(var c in u)c!=="default"&&!Object.prototype.hasOwnProperty.call(d,c)&&e(d,u,c)};Object.defineProperty(t,"__esModule",{value:!0}),a(signer,t),a(verifier,t),a(decode$3,t),a(errors$5,t),a(cryptoClients,t)}(lib$3);var BitcoinNetworkType=(t=>(t.Mainnet="Mainnet",t.Testnet="Testnet",t))(BitcoinNetworkType||{}),ORDINALS_API_BASE_URL$1=(t="Mainnet")=>`https://ordinals${t==="Testnet"?"-testnet":""}.xverse.app/v1`,RunesApi$1=class{constructor(e){Tt(this,"client");Tt(this,"parseError",e=>{var a,u;return{code:(a=e.response)==null?void 0:a.status,message:JSON.stringify((u=e.response)==null?void 0:u.data)}});Tt(this,"estimateMintCost",async e=>{try{return{data:(await this.client.post("/runes/mint/estimate",{...e})).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"estimateEtchCost",async e=>{try{return{data:(await this.client.post("/runes/etch/estimate",{...e})).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"createMintOrder",async e=>{try{return{data:(await this.client.post("/runes/mint/orders",{...e})).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"createEtchOrder",async e=>{try{return{data:(await this.client.post("/runes/etch/orders",{...e})).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"executeMint",async(e,a)=>{try{return{data:(await this.client.post(`/runes/mint/orders/${e}/execute`,{fundTransactionId:a})).data}}catch(u){const d=u;return{error:this.parseError(d)}}});Tt(this,"executeEtch",async(e,a)=>{try{return{data:(await this.client.post(`/runes/etch/orders/${e}/execute`,{fundTransactionId:a})).data}}catch(u){const d=u;return{error:this.parseError(d)}}});Tt(this,"getOrder",async e=>{try{return{data:(await this.client.get(`/orders/${e}`)).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"rbfOrder",async e=>{const{orderId:a,newFeeRate:u}=e;try{return{data:(await this.client.post(`/orders/${a}/rbf-estimate`,{newFeeRate:u})).data}}catch(d){const c=d;return{error:this.parseError(c)}}});this.client=axios.create({baseURL:ORDINALS_API_BASE_URL$1(e)})}};new RunesApi$1("Testnet"),new RunesApi$1("Mainnet");async function getProviderOrThrow(t){var a;const e=await(t==null?void 0:t())||((a=window.XverseProviders)==null?void 0:a.BitcoinProvider)||window.BitcoinProvider;if(!e)throw new Error("No Bitcoin wallet installed");return e}var AddressPurpose=(t=>(t.Ordinals="ordinals",t.Payment="payment",t.Stacks="stacks",t))(AddressPurpose||{}),getAddress=async t=>{var u,d;const e=await getProviderOrThrow(t.getProvider),{purposes:a}=t.payload;if(!a)throw new Error("Address purposes are required");try{const c=lib$3.createUnsecuredToken(t.payload),l=await e.connect(c);(u=t.onFinish)==null||u.call(t,l)}catch(c){console.error("[Connect] Error during address request",c),(d=t.onCancel)==null||d.call(t)}},signMessage=async t=>{var d,c;const e=await getProviderOrThrow(t.getProvider),{address:a,message:u}=t.payload;if(!a)throw new Error("An address is required to sign a message");if(!u)throw new Error("A message to be signed is required");try{const l=lib$3.createUnsecuredToken(t.payload),m=await e.signMessage(l);(d=t.onFinish)==null||d.call(t,m)}catch(l){console.error("[Connect] Error during sign message request",l),(c=t.onCancel)==null||c.call(t)}},serializer=t=>t.map(e=>{const{address:a,amountSats:u}=e;return{address:a,amountSats:u.toString()}}),sendBtcTransaction=async t=>{var l,m;const e=await getProviderOrThrow(t.getProvider),{recipients:a,senderAddress:u,network:d,message:c}=t.payload;if(!a||a.length===0)throw new Error("At least one recipient is required");if(a.some(I=>typeof I.address!="string"||typeof I.amountSats!="bigint"))throw new Error("Incorrect recipient format");if(!u)throw new Error("The sender address is required");try{const I=serializer(a),O={network:d,senderAddress:u,message:c,recipients:I},T=lib$3.createUnsecuredToken(O),C=await e.sendBtcTransaction(T);(l=t.onFinish)==null||l.call(t,C)}catch(I){console.error("[Connect] Error during send BTC transaction request",I),(m=t.onCancel)==null||m.call(t)}},ORDINALS_API_BASE_URL=(t="Mainnet")=>`https://ordinals${t==="Testnet"?"-testnet":""}.xverse.app/v1`,RunesApi=class{constructor(t){Tt(this,"client");Tt(this,"parseError",t=>{var e,a;return{code:(e=t.response)==null?void 0:e.status,message:JSON.stringify((a=t.response)==null?void 0:a.data)}});Tt(this,"estimateMintCost",async t=>{try{return{data:(await this.client.post("/runes/mint/estimate",{...t})).data}}catch(e){const a=e;return{error:this.parseError(a)}}});Tt(this,"estimateEtchCost",async t=>{try{return{data:(await this.client.post("/runes/etch/estimate",{...t})).data}}catch(e){const a=e;return{error:this.parseError(a)}}});Tt(this,"createMintOrder",async t=>{try{return{data:(await this.client.post("/runes/mint/orders",{...t})).data}}catch(e){const a=e;return{error:this.parseError(a)}}});Tt(this,"createEtchOrder",async t=>{try{return{data:(await this.client.post("/runes/etch/orders",{...t})).data}}catch(e){const a=e;return{error:this.parseError(a)}}});Tt(this,"executeMint",async(t,e)=>{try{return{data:(await this.client.post(`/runes/mint/orders/${t}/execute`,{fundTransactionId:e})).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"executeEtch",async(t,e)=>{try{return{data:(await this.client.post(`/runes/etch/orders/${t}/execute`,{fundTransactionId:e})).data}}catch(a){const u=a;return{error:this.parseError(u)}}});Tt(this,"getOrder",async t=>{try{return{data:(await this.client.get(`/orders/${t}`)).data}}catch(e){const a=e;return{error:this.parseError(a)}}});this.client=axios.create({baseURL:ORDINALS_API_BASE_URL(t)})}};new RunesApi("Testnet"),new RunesApi("Mainnet");let connected$1=!1;const Xverse={id:"xverse",name:"Xverse",icon:icons.Xverse,provider:(Rr=window.XverseProviders)==null?void 0:Rr.BitcoinProvider,platforms:[WalletPlatformEnum.BROWSER,WalletPlatformEnum.MOBILE],downloadLink:"https://www.xverse.app/download",isDetected:()=>{var t;return!!((t=window.XverseProviders)!=null&&t.BitcoinProvider)},isConnected:async()=>connected$1,connect:async t=>await new Promise((e,a)=>{const u=t!==void 0&&(t!=null&&t.isTestnet())?BitcoinNetworkType.Testnet:BitcoinNetworkType.Mainnet,d={on:(l,m)=>{},signMessage:async l=>{const m=await d.getAddress();return await new Promise((I,O)=>{signMessage({payload:{network:{type:u},address:m,message:l},onFinish:T=>{I(T)},onCancel:()=>{O(ErrorTypeEnum.WALLET_REQUEST_REJECTED)}}).catch(O)})},sendBitcoin:async(l,m)=>{const I=await d.getAddress();return await new Promise((O,T)=>{sendBtcTransaction({payload:{network:{type:u},recipients:[{address:l,amountSats:BigInt(m)}],senderAddress:I},onFinish:C=>{O(C)},onCancel:()=>{T(ErrorTypeEnum.WALLET_REQUEST_REJECTED)}}).catch(T)})},getAddress:async()=>""},c=async()=>await new Promise((l,m)=>{try{getAddress({payload:{purposes:[AddressPurpose.Payment,AddressPurpose.Ordinals],message:"Address for receiving Ordinals and payments",network:{type:u}},onFinish:I=>{const T=Object.values(I.addresses).find(C=>C.purpose===AddressPurpose.Payment);if(T===void 0){m(ErrorTypeEnum.WALLET_CONNECTION_FAILED);return}d.getAddress=async()=>T.address,l(d)},onCancel:()=>{m(ErrorTypeEnum.WALLET_REQUEST_REJECTED)}}).catch(m)}catch(I){m(I)}});try{c().then(l=>{connected$1=!0,e(l)}).catch(a)}catch(l){a(l)}})};let connected=!1;const Leather={id:"leather",name:"Leather",icon:icons.Leather,provider:window.LeatherProvider,platforms:[WalletPlatformEnum.BROWSER],downloadLink:"https://leather.io/install-extension",isDetected:()=>!!window.LeatherProvider,isConnected:async()=>connected,connect:async t=>await new Promise((e,a)=>{const u=window.LeatherProvider,d=t!==void 0&&(t!=null&&t.isTestnet())?"testnet":"mainnet",c={on:(m,I)=>{var O;((O=window.btc)==null?void 0:O.listen)!==void 0&&window.btc.listen(m,I)},signMessage:async m=>(await u.request("signMessage",{message:m,network:d,account:0,paymentType:"p2wpkh"})).result.signature,sendBitcoin:async(m,I)=>await new Promise((O,T)=>{try{u.request("sendTransfer",{address:m,amount:I,network:d}).then(C=>{O(C.result.txid)}).catch(({error:C})=>{T(C)})}catch(C){T(C)}}),getAddress:async()=>""},l=async()=>{const I=(await u.request("getAddresses",{network:d})).result.addresses.find(O=>O.type==="p2wpkh");return c.getAddress=async()=>I.address,c};try{l().then(m=>{connected=!0,e(m)}).catch(a)}catch(m){a(m)}})},adapterList=Object.freeze(Object.defineProperty({__proto__:null,Leather,UniSat,Xverse},Symbol.toStringTag,{value:"Module"})),fromSatoshi=t=>math$4.div(t,1e8,8),toSatoshi=t=>math$4.mul(t,1e8,8),utils$n=Object.freeze(Object.defineProperty({__proto__:null,base58Decode,base58Encode,bufferToString,checkWebSocket,fromSatoshi,hexToNumber,isMobile,isNumeric,isWebview,math:math$4,numberToHex,objectsEqual,sleep,stringToBuffer,toHex:toHex$2,toReadableString,toSatoshi},Symbol.toStringTag,{value:"Module"}));var bitcoreLib={exports:{}};const name$2="bitcore-lib",version$2="10.0.28",description$2="A pure and powerful JavaScript Bitcoin library.",author$1="BitPay <dev@bitpay.com>",main$2="index.js",scripts$2={test:"gulp test","test:ci":"npm run test",coverage:"gulp coverage",build:"gulp",pub:"npm run build && npm publish"},keywords$2=["bitcoin","transaction","address","p2p","ecies","cryptocurrency","blockchain","payment","bip21","bip32","bip37","bip69","bip70","multisig"],repository$2={type:"git",url:"https://github.com/bitpay/bitcore/tree/master/packages/bitcore-lib"},browser$2={request:"browser-request"},dependencies$2={bech32:"=2.0.0","bip-schnorr":"=0.6.4","bn.js":"=4.11.8",bs58:"^4.0.1","buffer-compare":"=1.1.1",elliptic:"^6.5.3",inherits:"=2.0.1",lodash:"^4.17.20"},devDependencies$2={"bitcore-build":"^10.0.21",brfs:"^2.0.1",chai:"^4.2.0",gulp:"^4.0.0",sinon:"^7.1.1"},license$1="MIT",gitHead="c47030e29c2ef353b41955d78fd0ca5c8422c590",require$$0$3={name:name$2,version:version$2,description:description$2,author:author$1,main:main$2,scripts:scripts$2,keywords:keywords$2,repository:repository$2,browser:browser$2,dependencies:dependencies$2,devDependencies:devDependencies$2,license:license$1,gitHead};var bn$2={exports:{}};bn$2.exports,function(t){(function(e,a){function u(ne,M){if(!ne)throw new Error(M||"Assertion failed")}function d(ne,M){ne.super_=M;var v=function(){};v.prototype=M.prototype,ne.prototype=new v,ne.prototype.constructor=ne}function c(ne,M,v){if(c.isBN(ne))return ne;this.negative=0,this.words=null,this.length=0,this.red=null,ne!==null&&((M==="le"||M==="be")&&(v=M,M=10),this._init(ne||0,M||10,v||"be"))}typeof e=="object"?e.exports=c:a.BN=c,c.BN=c,c.wordSize=26;var l;try{l=require$$1$4.Buffer}catch{}c.isBN=function(M){return M instanceof c?!0:M!==null&&typeof M=="object"&&M.constructor.wordSize===c.wordSize&&Array.isArray(M.words)},c.max=function(M,v){return M.cmp(v)>0?M:v},c.min=function(M,v){return M.cmp(v)<0?M:v},c.prototype._init=function(M,v,S){if(typeof M=="number")return this._initNumber(M,v,S);if(typeof M=="object")return this._initArray(M,v,S);v==="hex"&&(v=16),u(v===(v|0)&&v>=2&&v<=36),M=M.toString().replace(/\s+/g,"");var y=0;M[0]==="-"&&y++,v===16?this._parseHex(M,y):this._parseBase(M,v,y),M[0]==="-"&&(this.negative=1),this.strip(),S==="le"&&this._initArray(this.toArray(),v,S)},c.prototype._initNumber=function(M,v,S){M<0&&(this.negative=1,M=-M),M<67108864?(this.words=[M&67108863],this.length=1):M<4503599627370496?(this.words=[M&67108863,M/67108864&67108863],this.length=2):(u(M<9007199254740992),this.words=[M&67108863,M/67108864&67108863,1],this.length=3),S==="le"&&this._initArray(this.toArray(),v,S)},c.prototype._initArray=function(M,v,S){if(u(typeof M.length=="number"),M.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(M.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var w,P,L=0;if(S==="be")for(y=M.length-1,w=0;y>=0;y-=3)P=M[y]|M[y-1]<<8|M[y-2]<<16,this.words[w]|=P<<L&67108863,this.words[w+1]=P>>>26-L&67108863,L+=24,L>=26&&(L-=26,w++);else if(S==="le")for(y=0,w=0;y<M.length;y+=3)P=M[y]|M[y+1]<<8|M[y+2]<<16,this.words[w]|=P<<L&67108863,this.words[w+1]=P>>>26-L&67108863,L+=24,L>=26&&(L-=26,w++);return this.strip()};function m(ne,M,v){for(var S=0,y=Math.min(ne.length,v),w=M;w<y;w++){var P=ne.charCodeAt(w)-48;S<<=4,P>=49&&P<=54?S|=P-49+10:P>=17&&P<=22?S|=P-17+10:S|=P&15}return S}c.prototype._parseHex=function(M,v){this.length=Math.ceil((M.length-v)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var y,w,P=0;for(S=M.length-6,y=0;S>=v;S-=6)w=m(M,S,S+6),this.words[y]|=w<<P&67108863,this.words[y+1]|=w>>>26-P&4194303,P+=24,P>=26&&(P-=26,y++);S+6!==v&&(w=m(M,v,S+6),this.words[y]|=w<<P&67108863,this.words[y+1]|=w>>>26-P&4194303),this.strip()};function I(ne,M,v,S){for(var y=0,w=Math.min(ne.length,v),P=M;P<w;P++){var L=ne.charCodeAt(P)-48;y*=S,L>=49?y+=L-49+10:L>=17?y+=L-17+10:y+=L}return y}c.prototype._parseBase=function(M,v,S){this.words=[0],this.length=1;for(var y=0,w=1;w<=67108863;w*=v)y++;y--,w=w/v|0;for(var P=M.length-S,L=P%y,N=Math.min(P,P-L)+S,E=0,A=S;A<N;A+=y)E=I(M,A,A+y,v),this.imuln(w),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E);if(L!==0){var D=1;for(E=I(M,A,M.length,v),A=0;A<L;A++)D*=v;this.imuln(D),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E)}},c.prototype.copy=function(M){M.words=new Array(this.length);for(var v=0;v<this.length;v++)M.words[v]=this.words[v];M.length=this.length,M.negative=this.negative,M.red=this.red},c.prototype.clone=function(){var M=new c(null);return this.copy(M),M},c.prototype._expand=function(M){for(;this.length<M;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var O=["","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"],T=[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],C=[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];c.prototype.toString=function(M,v){M=M||10,v=v|0||1;var S;if(M===16||M==="hex"){S="";for(var y=0,w=0,P=0;P<this.length;P++){var L=this.words[P],N=((L<<y|w)&16777215).toString(16);w=L>>>24-y&16777215,w!==0||P!==this.length-1?S=O[6-N.length]+N+S:S=N+S,y+=2,y>=26&&(y-=26,P--)}for(w!==0&&(S=w.toString(16)+S);S.length%v!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(M===(M|0)&&M>=2&&M<=36){var E=T[M],A=C[M];S="";var D=this.clone();for(D.negative=0;!D.isZero();){var H=D.modn(A).toString(M);D=D.idivn(A),D.isZero()?S=H+S:S=O[E-H.length]+H+S}for(this.isZero()&&(S="0"+S);S.length%v!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}u(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var M=this.words[0];return this.length===2?M+=this.words[1]*67108864:this.length===3&&this.words[2]===1?M+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-M:M},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(M,v){return u(typeof l<"u"),this.toArrayLike(l,M,v)},c.prototype.toArray=function(M,v){return this.toArrayLike(Array,M,v)},c.prototype.toArrayLike=function(M,v,S){var y=this.byteLength(),w=S||Math.max(1,y);u(y<=w,"byte array longer than desired length"),u(w>0,"Requested array length <= 0"),this.strip();var P=v==="le",L=new M(w),N,E,A=this.clone();if(P){for(E=0;!A.isZero();E++)N=A.andln(255),A.iushrn(8),L[E]=N;for(;E<w;E++)L[E]=0}else{for(E=0;E<w-y;E++)L[E]=0;for(E=0;!A.isZero();E++)N=A.andln(255),A.iushrn(8),L[w-E-1]=N}return L},Math.clz32?c.prototype._countBits=function(M){return 32-Math.clz32(M)}:c.prototype._countBits=function(M){var v=M,S=0;return v>=4096&&(S+=13,v>>>=13),v>=64&&(S+=7,v>>>=7),v>=8&&(S+=4,v>>>=4),v>=2&&(S+=2,v>>>=2),S+v},c.prototype._zeroBits=function(M){if(M===0)return 26;var v=M,S=0;return v&8191||(S+=13,v>>>=13),v&127||(S+=7,v>>>=7),v&15||(S+=4,v>>>=4),v&3||(S+=2,v>>>=2),v&1||S++,S},c.prototype.bitLength=function(){var M=this.words[this.length-1],v=this._countBits(M);return(this.length-1)*26+v};function j(ne){for(var M=new Array(ne.bitLength()),v=0;v<M.length;v++){var S=v/26|0,y=v%26;M[v]=(ne.words[S]&1<<y)>>>y}return M}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var M=0,v=0;v<this.length;v++){var S=this._zeroBits(this.words[v]);if(M+=S,S!==26)break}return M},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(M){return this.negative!==0?this.abs().inotn(M).iaddn(1):this.clone()},c.prototype.fromTwos=function(M){return this.testn(M-1)?this.notn(M).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(M){for(;this.length<M.length;)this.words[this.length++]=0;for(var v=0;v<M.length;v++)this.words[v]=this.words[v]|M.words[v];return this.strip()},c.prototype.ior=function(M){return u((this.negative|M.negative)===0),this.iuor(M)},c.prototype.or=function(M){return this.length>M.length?this.clone().ior(M):M.clone().ior(this)},c.prototype.uor=function(M){return this.length>M.length?this.clone().iuor(M):M.clone().iuor(this)},c.prototype.iuand=function(M){var v;this.length>M.length?v=M:v=this;for(var S=0;S<v.length;S++)this.words[S]=this.words[S]&M.words[S];return this.length=v.length,this.strip()},c.prototype.iand=function(M){return u((this.negative|M.negative)===0),this.iuand(M)},c.prototype.and=function(M){return this.length>M.length?this.clone().iand(M):M.clone().iand(this)},c.prototype.uand=function(M){return this.length>M.length?this.clone().iuand(M):M.clone().iuand(this)},c.prototype.iuxor=function(M){var v,S;this.length>M.length?(v=this,S=M):(v=M,S=this);for(var y=0;y<S.length;y++)this.words[y]=v.words[y]^S.words[y];if(this!==v)for(;y<v.length;y++)this.words[y]=v.words[y];return this.length=v.length,this.strip()},c.prototype.ixor=function(M){return u((this.negative|M.negative)===0),this.iuxor(M)},c.prototype.xor=function(M){return this.length>M.length?this.clone().ixor(M):M.clone().ixor(this)},c.prototype.uxor=function(M){return this.length>M.length?this.clone().iuxor(M):M.clone().iuxor(this)},c.prototype.inotn=function(M){u(typeof M=="number"&&M>=0);var v=Math.ceil(M/26)|0,S=M%26;this._expand(v),S>0&&v--;for(var y=0;y<v;y++)this.words[y]=~this.words[y]&67108863;return S>0&&(this.words[y]=~this.words[y]&67108863>>26-S),this.strip()},c.prototype.notn=function(M){return this.clone().inotn(M)},c.prototype.setn=function(M,v){u(typeof M=="number"&&M>=0);var S=M/26|0,y=M%26;return this._expand(S+1),v?this.words[S]=this.words[S]|1<<y:this.words[S]=this.words[S]&~(1<<y),this.strip()},c.prototype.iadd=function(M){var v;if(this.negative!==0&&M.negative===0)return this.negative=0,v=this.isub(M),this.negative^=1,this._normSign();if(this.negative===0&&M.negative!==0)return M.negative=0,v=this.isub(M),M.negative=1,v._normSign();var S,y;this.length>M.length?(S=this,y=M):(S=M,y=this);for(var w=0,P=0;P<y.length;P++)v=(S.words[P]|0)+(y.words[P]|0)+w,this.words[P]=v&67108863,w=v>>>26;for(;w!==0&&P<S.length;P++)v=(S.words[P]|0)+w,this.words[P]=v&67108863,w=v>>>26;if(this.length=S.length,w!==0)this.words[this.length]=w,this.length++;else if(S!==this)for(;P<S.length;P++)this.words[P]=S.words[P];return this},c.prototype.add=function(M){var v;return M.negative!==0&&this.negative===0?(M.negative=0,v=this.sub(M),M.negative^=1,v):M.negative===0&&this.negative!==0?(this.negative=0,v=M.sub(this),this.negative=1,v):this.length>M.length?this.clone().iadd(M):M.clone().iadd(this)},c.prototype.isub=function(M){if(M.negative!==0){M.negative=0;var v=this.iadd(M);return M.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(M),this.negative=1,this._normSign();var S=this.cmp(M);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,w;S>0?(y=this,w=M):(y=M,w=this);for(var P=0,L=0;L<w.length;L++)v=(y.words[L]|0)-(w.words[L]|0)+P,P=v>>26,this.words[L]=v&67108863;for(;P!==0&&L<y.length;L++)v=(y.words[L]|0)+P,P=v>>26,this.words[L]=v&67108863;if(P===0&&L<y.length&&y!==this)for(;L<y.length;L++)this.words[L]=y.words[L];return this.length=Math.max(this.length,L),y!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(M){return this.clone().isub(M)};function F(ne,M,v){v.negative=M.negative^ne.negative;var S=ne.length+M.length|0;v.length=S,S=S-1|0;var y=ne.words[0]|0,w=M.words[0]|0,P=y*w,L=P&67108863,N=P/67108864|0;v.words[0]=L;for(var E=1;E<S;E++){for(var A=N>>>26,D=N&67108863,H=Math.min(E,M.length-1),Y=Math.max(0,E-ne.length+1);Y<=H;Y++){var le=E-Y|0;y=ne.words[le]|0,w=M.words[Y]|0,P=y*w+D,A+=P/67108864|0,D=P&67108863}v.words[E]=D|0,N=A|0}return N!==0?v.words[E]=N|0:v.length--,v.strip()}var U=function(M,v,S){var y=M.words,w=v.words,P=S.words,L=0,N,E,A,D=y[0]|0,H=D&8191,Y=D>>>13,le=y[1]|0,_e=le&8191,he=le>>>13,fe=y[2]|0,ve=fe&8191,ge=fe>>>13,Ie=y[3]|0,ue=Ie&8191,ce=Ie>>>13,Te=y[4]|0,ke=Te&8191,He=Te>>>13,Qe=y[5]|0,it=Qe&8191,rt=Qe>>>13,Fe=y[6]|0,wt=Fe&8191,et=Fe>>>13,At=y[7]|0,gt=At&8191,$e=At>>>13,Me=y[8]|0,Ze=Me&8191,ze=Me>>>13,Ge=y[9]|0,ht=Ge&8191,oe=Ge>>>13,ee=w[0]|0,re=ee&8191,be=ee>>>13,Pe=w[1]|0,Ne=Pe&8191,Oe=Pe>>>13,ut=w[2]|0,lt=ut&8191,Je=ut>>>13,bt=w[3]|0,vt=bt&8191,ot=bt>>>13,Et=w[4]|0,Bt=Et&8191,Se=Et>>>13,ye=w[5]|0,xe=ye&8191,Be=ye>>>13,Le=w[6]|0,je=Le&8191,qe=Le>>>13,Xe=w[7]|0,at=Xe&8191,Ve=Xe>>>13,dt=w[8]|0,pt=dt&8191,Ye=dt>>>13,_t=w[9]|0,yt=_t&8191,ct=_t>>>13;S.negative=M.negative^v.negative,S.length=19,N=Math.imul(H,re),E=Math.imul(H,be),E=E+Math.imul(Y,re)|0,A=Math.imul(Y,be);var $t=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+($t>>>26)|0,$t&=67108863,N=Math.imul(_e,re),E=Math.imul(_e,be),E=E+Math.imul(he,re)|0,A=Math.imul(he,be),N=N+Math.imul(H,Ne)|0,E=E+Math.imul(H,Oe)|0,E=E+Math.imul(Y,Ne)|0,A=A+Math.imul(Y,Oe)|0;var Ct=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,N=Math.imul(ve,re),E=Math.imul(ve,be),E=E+Math.imul(ge,re)|0,A=Math.imul(ge,be),N=N+Math.imul(_e,Ne)|0,E=E+Math.imul(_e,Oe)|0,E=E+Math.imul(he,Ne)|0,A=A+Math.imul(he,Oe)|0,N=N+Math.imul(H,lt)|0,E=E+Math.imul(H,Je)|0,E=E+Math.imul(Y,lt)|0,A=A+Math.imul(Y,Je)|0;var Nt=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,N=Math.imul(ue,re),E=Math.imul(ue,be),E=E+Math.imul(ce,re)|0,A=Math.imul(ce,be),N=N+Math.imul(ve,Ne)|0,E=E+Math.imul(ve,Oe)|0,E=E+Math.imul(ge,Ne)|0,A=A+Math.imul(ge,Oe)|0,N=N+Math.imul(_e,lt)|0,E=E+Math.imul(_e,Je)|0,E=E+Math.imul(he,lt)|0,A=A+Math.imul(he,Je)|0,N=N+Math.imul(H,vt)|0,E=E+Math.imul(H,ot)|0,E=E+Math.imul(Y,vt)|0,A=A+Math.imul(Y,ot)|0;var Jt=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,N=Math.imul(ke,re),E=Math.imul(ke,be),E=E+Math.imul(He,re)|0,A=Math.imul(He,be),N=N+Math.imul(ue,Ne)|0,E=E+Math.imul(ue,Oe)|0,E=E+Math.imul(ce,Ne)|0,A=A+Math.imul(ce,Oe)|0,N=N+Math.imul(ve,lt)|0,E=E+Math.imul(ve,Je)|0,E=E+Math.imul(ge,lt)|0,A=A+Math.imul(ge,Je)|0,N=N+Math.imul(_e,vt)|0,E=E+Math.imul(_e,ot)|0,E=E+Math.imul(he,vt)|0,A=A+Math.imul(he,ot)|0,N=N+Math.imul(H,Bt)|0,E=E+Math.imul(H,Se)|0,E=E+Math.imul(Y,Bt)|0,A=A+Math.imul(Y,Se)|0;var Qt=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,N=Math.imul(it,re),E=Math.imul(it,be),E=E+Math.imul(rt,re)|0,A=Math.imul(rt,be),N=N+Math.imul(ke,Ne)|0,E=E+Math.imul(ke,Oe)|0,E=E+Math.imul(He,Ne)|0,A=A+Math.imul(He,Oe)|0,N=N+Math.imul(ue,lt)|0,E=E+Math.imul(ue,Je)|0,E=E+Math.imul(ce,lt)|0,A=A+Math.imul(ce,Je)|0,N=N+Math.imul(ve,vt)|0,E=E+Math.imul(ve,ot)|0,E=E+Math.imul(ge,vt)|0,A=A+Math.imul(ge,ot)|0,N=N+Math.imul(_e,Bt)|0,E=E+Math.imul(_e,Se)|0,E=E+Math.imul(he,Bt)|0,A=A+Math.imul(he,Se)|0,N=N+Math.imul(H,xe)|0,E=E+Math.imul(H,Be)|0,E=E+Math.imul(Y,xe)|0,A=A+Math.imul(Y,Be)|0;var Wt=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,N=Math.imul(wt,re),E=Math.imul(wt,be),E=E+Math.imul(et,re)|0,A=Math.imul(et,be),N=N+Math.imul(it,Ne)|0,E=E+Math.imul(it,Oe)|0,E=E+Math.imul(rt,Ne)|0,A=A+Math.imul(rt,Oe)|0,N=N+Math.imul(ke,lt)|0,E=E+Math.imul(ke,Je)|0,E=E+Math.imul(He,lt)|0,A=A+Math.imul(He,Je)|0,N=N+Math.imul(ue,vt)|0,E=E+Math.imul(ue,ot)|0,E=E+Math.imul(ce,vt)|0,A=A+Math.imul(ce,ot)|0,N=N+Math.imul(ve,Bt)|0,E=E+Math.imul(ve,Se)|0,E=E+Math.imul(ge,Bt)|0,A=A+Math.imul(ge,Se)|0,N=N+Math.imul(_e,xe)|0,E=E+Math.imul(_e,Be)|0,E=E+Math.imul(he,xe)|0,A=A+Math.imul(he,Be)|0,N=N+Math.imul(H,je)|0,E=E+Math.imul(H,qe)|0,E=E+Math.imul(Y,je)|0,A=A+Math.imul(Y,qe)|0;var ur=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(ur>>>26)|0,ur&=67108863,N=Math.imul(gt,re),E=Math.imul(gt,be),E=E+Math.imul($e,re)|0,A=Math.imul($e,be),N=N+Math.imul(wt,Ne)|0,E=E+Math.imul(wt,Oe)|0,E=E+Math.imul(et,Ne)|0,A=A+Math.imul(et,Oe)|0,N=N+Math.imul(it,lt)|0,E=E+Math.imul(it,Je)|0,E=E+Math.imul(rt,lt)|0,A=A+Math.imul(rt,Je)|0,N=N+Math.imul(ke,vt)|0,E=E+Math.imul(ke,ot)|0,E=E+Math.imul(He,vt)|0,A=A+Math.imul(He,ot)|0,N=N+Math.imul(ue,Bt)|0,E=E+Math.imul(ue,Se)|0,E=E+Math.imul(ce,Bt)|0,A=A+Math.imul(ce,Se)|0,N=N+Math.imul(ve,xe)|0,E=E+Math.imul(ve,Be)|0,E=E+Math.imul(ge,xe)|0,A=A+Math.imul(ge,Be)|0,N=N+Math.imul(_e,je)|0,E=E+Math.imul(_e,qe)|0,E=E+Math.imul(he,je)|0,A=A+Math.imul(he,qe)|0,N=N+Math.imul(H,at)|0,E=E+Math.imul(H,Ve)|0,E=E+Math.imul(Y,at)|0,A=A+Math.imul(Y,Ve)|0;var vr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(vr>>>26)|0,vr&=67108863,N=Math.imul(Ze,re),E=Math.imul(Ze,be),E=E+Math.imul(ze,re)|0,A=Math.imul(ze,be),N=N+Math.imul(gt,Ne)|0,E=E+Math.imul(gt,Oe)|0,E=E+Math.imul($e,Ne)|0,A=A+Math.imul($e,Oe)|0,N=N+Math.imul(wt,lt)|0,E=E+Math.imul(wt,Je)|0,E=E+Math.imul(et,lt)|0,A=A+Math.imul(et,Je)|0,N=N+Math.imul(it,vt)|0,E=E+Math.imul(it,ot)|0,E=E+Math.imul(rt,vt)|0,A=A+Math.imul(rt,ot)|0,N=N+Math.imul(ke,Bt)|0,E=E+Math.imul(ke,Se)|0,E=E+Math.imul(He,Bt)|0,A=A+Math.imul(He,Se)|0,N=N+Math.imul(ue,xe)|0,E=E+Math.imul(ue,Be)|0,E=E+Math.imul(ce,xe)|0,A=A+Math.imul(ce,Be)|0,N=N+Math.imul(ve,je)|0,E=E+Math.imul(ve,qe)|0,E=E+Math.imul(ge,je)|0,A=A+Math.imul(ge,qe)|0,N=N+Math.imul(_e,at)|0,E=E+Math.imul(_e,Ve)|0,E=E+Math.imul(he,at)|0,A=A+Math.imul(he,Ve)|0,N=N+Math.imul(H,pt)|0,E=E+Math.imul(H,Ye)|0,E=E+Math.imul(Y,pt)|0,A=A+Math.imul(Y,Ye)|0;var nr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(nr>>>26)|0,nr&=67108863,N=Math.imul(ht,re),E=Math.imul(ht,be),E=E+Math.imul(oe,re)|0,A=Math.imul(oe,be),N=N+Math.imul(Ze,Ne)|0,E=E+Math.imul(Ze,Oe)|0,E=E+Math.imul(ze,Ne)|0,A=A+Math.imul(ze,Oe)|0,N=N+Math.imul(gt,lt)|0,E=E+Math.imul(gt,Je)|0,E=E+Math.imul($e,lt)|0,A=A+Math.imul($e,Je)|0,N=N+Math.imul(wt,vt)|0,E=E+Math.imul(wt,ot)|0,E=E+Math.imul(et,vt)|0,A=A+Math.imul(et,ot)|0,N=N+Math.imul(it,Bt)|0,E=E+Math.imul(it,Se)|0,E=E+Math.imul(rt,Bt)|0,A=A+Math.imul(rt,Se)|0,N=N+Math.imul(ke,xe)|0,E=E+Math.imul(ke,Be)|0,E=E+Math.imul(He,xe)|0,A=A+Math.imul(He,Be)|0,N=N+Math.imul(ue,je)|0,E=E+Math.imul(ue,qe)|0,E=E+Math.imul(ce,je)|0,A=A+Math.imul(ce,qe)|0,N=N+Math.imul(ve,at)|0,E=E+Math.imul(ve,Ve)|0,E=E+Math.imul(ge,at)|0,A=A+Math.imul(ge,Ve)|0,N=N+Math.imul(_e,pt)|0,E=E+Math.imul(_e,Ye)|0,E=E+Math.imul(he,pt)|0,A=A+Math.imul(he,Ye)|0,N=N+Math.imul(H,yt)|0,E=E+Math.imul(H,ct)|0,E=E+Math.imul(Y,yt)|0,A=A+Math.imul(Y,ct)|0;var br=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(br>>>26)|0,br&=67108863,N=Math.imul(ht,Ne),E=Math.imul(ht,Oe),E=E+Math.imul(oe,Ne)|0,A=Math.imul(oe,Oe),N=N+Math.imul(Ze,lt)|0,E=E+Math.imul(Ze,Je)|0,E=E+Math.imul(ze,lt)|0,A=A+Math.imul(ze,Je)|0,N=N+Math.imul(gt,vt)|0,E=E+Math.imul(gt,ot)|0,E=E+Math.imul($e,vt)|0,A=A+Math.imul($e,ot)|0,N=N+Math.imul(wt,Bt)|0,E=E+Math.imul(wt,Se)|0,E=E+Math.imul(et,Bt)|0,A=A+Math.imul(et,Se)|0,N=N+Math.imul(it,xe)|0,E=E+Math.imul(it,Be)|0,E=E+Math.imul(rt,xe)|0,A=A+Math.imul(rt,Be)|0,N=N+Math.imul(ke,je)|0,E=E+Math.imul(ke,qe)|0,E=E+Math.imul(He,je)|0,A=A+Math.imul(He,qe)|0,N=N+Math.imul(ue,at)|0,E=E+Math.imul(ue,Ve)|0,E=E+Math.imul(ce,at)|0,A=A+Math.imul(ce,Ve)|0,N=N+Math.imul(ve,pt)|0,E=E+Math.imul(ve,Ye)|0,E=E+Math.imul(ge,pt)|0,A=A+Math.imul(ge,Ye)|0,N=N+Math.imul(_e,yt)|0,E=E+Math.imul(_e,ct)|0,E=E+Math.imul(he,yt)|0,A=A+Math.imul(he,ct)|0;var ir=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(ir>>>26)|0,ir&=67108863,N=Math.imul(ht,lt),E=Math.imul(ht,Je),E=E+Math.imul(oe,lt)|0,A=Math.imul(oe,Je),N=N+Math.imul(Ze,vt)|0,E=E+Math.imul(Ze,ot)|0,E=E+Math.imul(ze,vt)|0,A=A+Math.imul(ze,ot)|0,N=N+Math.imul(gt,Bt)|0,E=E+Math.imul(gt,Se)|0,E=E+Math.imul($e,Bt)|0,A=A+Math.imul($e,Se)|0,N=N+Math.imul(wt,xe)|0,E=E+Math.imul(wt,Be)|0,E=E+Math.imul(et,xe)|0,A=A+Math.imul(et,Be)|0,N=N+Math.imul(it,je)|0,E=E+Math.imul(it,qe)|0,E=E+Math.imul(rt,je)|0,A=A+Math.imul(rt,qe)|0,N=N+Math.imul(ke,at)|0,E=E+Math.imul(ke,Ve)|0,E=E+Math.imul(He,at)|0,A=A+Math.imul(He,Ve)|0,N=N+Math.imul(ue,pt)|0,E=E+Math.imul(ue,Ye)|0,E=E+Math.imul(ce,pt)|0,A=A+Math.imul(ce,Ye)|0,N=N+Math.imul(ve,yt)|0,E=E+Math.imul(ve,ct)|0,E=E+Math.imul(ge,yt)|0,A=A+Math.imul(ge,ct)|0;var gr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(gr>>>26)|0,gr&=67108863,N=Math.imul(ht,vt),E=Math.imul(ht,ot),E=E+Math.imul(oe,vt)|0,A=Math.imul(oe,ot),N=N+Math.imul(Ze,Bt)|0,E=E+Math.imul(Ze,Se)|0,E=E+Math.imul(ze,Bt)|0,A=A+Math.imul(ze,Se)|0,N=N+Math.imul(gt,xe)|0,E=E+Math.imul(gt,Be)|0,E=E+Math.imul($e,xe)|0,A=A+Math.imul($e,Be)|0,N=N+Math.imul(wt,je)|0,E=E+Math.imul(wt,qe)|0,E=E+Math.imul(et,je)|0,A=A+Math.imul(et,qe)|0,N=N+Math.imul(it,at)|0,E=E+Math.imul(it,Ve)|0,E=E+Math.imul(rt,at)|0,A=A+Math.imul(rt,Ve)|0,N=N+Math.imul(ke,pt)|0,E=E+Math.imul(ke,Ye)|0,E=E+Math.imul(He,pt)|0,A=A+Math.imul(He,Ye)|0,N=N+Math.imul(ue,yt)|0,E=E+Math.imul(ue,ct)|0,E=E+Math.imul(ce,yt)|0,A=A+Math.imul(ce,ct)|0;var yr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(yr>>>26)|0,yr&=67108863,N=Math.imul(ht,Bt),E=Math.imul(ht,Se),E=E+Math.imul(oe,Bt)|0,A=Math.imul(oe,Se),N=N+Math.imul(Ze,xe)|0,E=E+Math.imul(Ze,Be)|0,E=E+Math.imul(ze,xe)|0,A=A+Math.imul(ze,Be)|0,N=N+Math.imul(gt,je)|0,E=E+Math.imul(gt,qe)|0,E=E+Math.imul($e,je)|0,A=A+Math.imul($e,qe)|0,N=N+Math.imul(wt,at)|0,E=E+Math.imul(wt,Ve)|0,E=E+Math.imul(et,at)|0,A=A+Math.imul(et,Ve)|0,N=N+Math.imul(it,pt)|0,E=E+Math.imul(it,Ye)|0,E=E+Math.imul(rt,pt)|0,A=A+Math.imul(rt,Ye)|0,N=N+Math.imul(ke,yt)|0,E=E+Math.imul(ke,ct)|0,E=E+Math.imul(He,yt)|0,A=A+Math.imul(He,ct)|0;var wr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(wr>>>26)|0,wr&=67108863,N=Math.imul(ht,xe),E=Math.imul(ht,Be),E=E+Math.imul(oe,xe)|0,A=Math.imul(oe,Be),N=N+Math.imul(Ze,je)|0,E=E+Math.imul(Ze,qe)|0,E=E+Math.imul(ze,je)|0,A=A+Math.imul(ze,qe)|0,N=N+Math.imul(gt,at)|0,E=E+Math.imul(gt,Ve)|0,E=E+Math.imul($e,at)|0,A=A+Math.imul($e,Ve)|0,N=N+Math.imul(wt,pt)|0,E=E+Math.imul(wt,Ye)|0,E=E+Math.imul(et,pt)|0,A=A+Math.imul(et,Ye)|0,N=N+Math.imul(it,yt)|0,E=E+Math.imul(it,ct)|0,E=E+Math.imul(rt,yt)|0,A=A+Math.imul(rt,ct)|0;var cr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(cr>>>26)|0,cr&=67108863,N=Math.imul(ht,je),E=Math.imul(ht,qe),E=E+Math.imul(oe,je)|0,A=Math.imul(oe,qe),N=N+Math.imul(Ze,at)|0,E=E+Math.imul(Ze,Ve)|0,E=E+Math.imul(ze,at)|0,A=A+Math.imul(ze,Ve)|0,N=N+Math.imul(gt,pt)|0,E=E+Math.imul(gt,Ye)|0,E=E+Math.imul($e,pt)|0,A=A+Math.imul($e,Ye)|0,N=N+Math.imul(wt,yt)|0,E=E+Math.imul(wt,ct)|0,E=E+Math.imul(et,yt)|0,A=A+Math.imul(et,ct)|0;var dr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(dr>>>26)|0,dr&=67108863,N=Math.imul(ht,at),E=Math.imul(ht,Ve),E=E+Math.imul(oe,at)|0,A=Math.imul(oe,Ve),N=N+Math.imul(Ze,pt)|0,E=E+Math.imul(Ze,Ye)|0,E=E+Math.imul(ze,pt)|0,A=A+Math.imul(ze,Ye)|0,N=N+Math.imul(gt,yt)|0,E=E+Math.imul(gt,ct)|0,E=E+Math.imul($e,yt)|0,A=A+Math.imul($e,ct)|0;var lr=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(lr>>>26)|0,lr&=67108863,N=Math.imul(ht,pt),E=Math.imul(ht,Ye),E=E+Math.imul(oe,pt)|0,A=Math.imul(oe,Ye),N=N+Math.imul(Ze,yt)|0,E=E+Math.imul(Ze,ct)|0,E=E+Math.imul(ze,yt)|0,A=A+Math.imul(ze,ct)|0;var _r=(L+N|0)+((E&8191)<<13)|0;L=(A+(E>>>13)|0)+(_r>>>26)|0,_r&=67108863,N=Math.imul(ht,yt),E=Math.imul(ht,ct),E=E+Math.imul(oe,yt)|0,A=Math.imul(oe,ct);var Ar=(L+N|0)+((E&8191)<<13)|0;return L=(A+(E>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,P[0]=$t,P[1]=Ct,P[2]=Nt,P[3]=Jt,P[4]=Qt,P[5]=Wt,P[6]=ur,P[7]=vr,P[8]=nr,P[9]=br,P[10]=ir,P[11]=gr,P[12]=yr,P[13]=wr,P[14]=cr,P[15]=dr,P[16]=lr,P[17]=_r,P[18]=Ar,L!==0&&(P[19]=L,S.length++),S};Math.imul||(U=F);function Z(ne,M,v){v.negative=M.negative^ne.negative,v.length=ne.length+M.length;for(var S=0,y=0,w=0;w<v.length-1;w++){var P=y;y=0;for(var L=S&67108863,N=Math.min(w,M.length-1),E=Math.max(0,w-ne.length+1);E<=N;E++){var A=w-E,D=ne.words[A]|0,H=M.words[E]|0,Y=D*H,le=Y&67108863;P=P+(Y/67108864|0)|0,le=le+L|0,L=le&67108863,P=P+(le>>>26)|0,y+=P>>>26,P&=67108863}v.words[w]=L,S=P,P=y}return S!==0?v.words[w]=S:v.length--,v.strip()}function J(ne,M,v){var S=new X;return S.mulp(ne,M,v)}c.prototype.mulTo=function(M,v){var S,y=this.length+M.length;return this.length===10&&M.length===10?S=U(this,M,v):y<63?S=F(this,M,v):y<1024?S=Z(this,M,v):S=J(this,M,v),S};function X(ne,M){this.x=ne,this.y=M}X.prototype.makeRBT=function(M){for(var v=new Array(M),S=c.prototype._countBits(M)-1,y=0;y<M;y++)v[y]=this.revBin(y,S,M);return v},X.prototype.revBin=function(M,v,S){if(M===0||M===S-1)return M;for(var y=0,w=0;w<v;w++)y|=(M&1)<<v-w-1,M>>=1;return y},X.prototype.permute=function(M,v,S,y,w,P){for(var L=0;L<P;L++)y[L]=v[M[L]],w[L]=S[M[L]]},X.prototype.transform=function(M,v,S,y,w,P){this.permute(P,M,v,S,y,w);for(var L=1;L<w;L<<=1)for(var N=L<<1,E=Math.cos(2*Math.PI/N),A=Math.sin(2*Math.PI/N),D=0;D<w;D+=N)for(var H=E,Y=A,le=0;le<L;le++){var _e=S[D+le],he=y[D+le],fe=S[D+le+L],ve=y[D+le+L],ge=H*fe-Y*ve;ve=H*ve+Y*fe,fe=ge,S[D+le]=_e+fe,y[D+le]=he+ve,S[D+le+L]=_e-fe,y[D+le+L]=he-ve,le!==N&&(ge=E*H-A*Y,Y=E*Y+A*H,H=ge)}},X.prototype.guessLen13b=function(M,v){var S=Math.max(v,M)|1,y=S&1,w=0;for(S=S/2|0;S;S=S>>>1)w++;return 1<<w+1+y},X.prototype.conjugate=function(M,v,S){if(!(S<=1))for(var y=0;y<S/2;y++){var w=M[y];M[y]=M[S-y-1],M[S-y-1]=w,w=v[y],v[y]=-v[S-y-1],v[S-y-1]=-w}},X.prototype.normalize13b=function(M,v){for(var S=0,y=0;y<v/2;y++){var w=Math.round(M[2*y+1]/v)*8192+Math.round(M[2*y]/v)+S;M[y]=w&67108863,w<67108864?S=0:S=w/67108864|0}return M},X.prototype.convert13b=function(M,v,S,y){for(var w=0,P=0;P<v;P++)w=w+(M[P]|0),S[2*P]=w&8191,w=w>>>13,S[2*P+1]=w&8191,w=w>>>13;for(P=2*v;P<y;++P)S[P]=0;u(w===0),u((w&-8192)===0)},X.prototype.stub=function(M){for(var v=new Array(M),S=0;S<M;S++)v[S]=0;return v},X.prototype.mulp=function(M,v,S){var y=2*this.guessLen13b(M.length,v.length),w=this.makeRBT(y),P=this.stub(y),L=new Array(y),N=new Array(y),E=new Array(y),A=new Array(y),D=new Array(y),H=new Array(y),Y=S.words;Y.length=y,this.convert13b(M.words,M.length,L,y),this.convert13b(v.words,v.length,A,y),this.transform(L,P,N,E,y,w),this.transform(A,P,D,H,y,w);for(var le=0;le<y;le++){var _e=N[le]*D[le]-E[le]*H[le];E[le]=N[le]*H[le]+E[le]*D[le],N[le]=_e}return this.conjugate(N,E,y),this.transform(N,E,Y,P,y,w),this.conjugate(Y,P,y),this.normalize13b(Y,y),S.negative=M.negative^v.negative,S.length=M.length+v.length,S.strip()},c.prototype.mul=function(M){var v=new c(null);return v.words=new Array(this.length+M.length),this.mulTo(M,v)},c.prototype.mulf=function(M){var v=new c(null);return v.words=new Array(this.length+M.length),J(this,M,v)},c.prototype.imul=function(M){return this.clone().mulTo(M,this)},c.prototype.imuln=function(M){u(typeof M=="number"),u(M<67108864);for(var v=0,S=0;S<this.length;S++){var y=(this.words[S]|0)*M,w=(y&67108863)+(v&67108863);v>>=26,v+=y/67108864|0,v+=w>>>26,this.words[S]=w&67108863}return v!==0&&(this.words[S]=v,this.length++),this},c.prototype.muln=function(M){return this.clone().imuln(M)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(M){var v=j(M);if(v.length===0)return new c(1);for(var S=this,y=0;y<v.length&&v[y]===0;y++,S=S.sqr());if(++y<v.length)for(var w=S.sqr();y<v.length;y++,w=w.sqr())v[y]!==0&&(S=S.mul(w));return S},c.prototype.iushln=function(M){u(typeof M=="number"&&M>=0);var v=M%26,S=(M-v)/26,y=67108863>>>26-v<<26-v,w;if(v!==0){var P=0;for(w=0;w<this.length;w++){var L=this.words[w]&y,N=(this.words[w]|0)-L<<v;this.words[w]=N|P,P=L>>>26-v}P&&(this.words[w]=P,this.length++)}if(S!==0){for(w=this.length-1;w>=0;w--)this.words[w+S]=this.words[w];for(w=0;w<S;w++)this.words[w]=0;this.length+=S}return this.strip()},c.prototype.ishln=function(M){return u(this.negative===0),this.iushln(M)},c.prototype.iushrn=function(M,v,S){u(typeof M=="number"&&M>=0);var y;v?y=(v-v%26)/26:y=0;var w=M%26,P=Math.min((M-w)/26,this.length),L=67108863^67108863>>>w<<w,N=S;if(y-=P,y=Math.max(0,y),N){for(var E=0;E<P;E++)N.words[E]=this.words[E];N.length=P}if(P!==0)if(this.length>P)for(this.length-=P,E=0;E<this.length;E++)this.words[E]=this.words[E+P];else this.words[0]=0,this.length=1;var A=0;for(E=this.length-1;E>=0&&(A!==0||E>=y);E--){var D=this.words[E]|0;this.words[E]=A<<26-w|D>>>w,A=D&L}return N&&A!==0&&(N.words[N.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(M,v,S){return u(this.negative===0),this.iushrn(M,v,S)},c.prototype.shln=function(M){return this.clone().ishln(M)},c.prototype.ushln=function(M){return this.clone().iushln(M)},c.prototype.shrn=function(M){return this.clone().ishrn(M)},c.prototype.ushrn=function(M){return this.clone().iushrn(M)},c.prototype.testn=function(M){u(typeof M=="number"&&M>=0);var v=M%26,S=(M-v)/26,y=1<<v;if(this.length<=S)return!1;var w=this.words[S];return!!(w&y)},c.prototype.imaskn=function(M){u(typeof M=="number"&&M>=0);var v=M%26,S=(M-v)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(v!==0&&S++,this.length=Math.min(S,this.length),v!==0){var y=67108863^67108863>>>v<<v;this.words[this.length-1]&=y}return this.strip()},c.prototype.maskn=function(M){return this.clone().imaskn(M)},c.prototype.iaddn=function(M){return u(typeof M=="number"),u(M<67108864),M<0?this.isubn(-M):this.negative!==0?this.length===1&&(this.words[0]|0)<M?(this.words[0]=M-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(M),this.negative=1,this):this._iaddn(M)},c.prototype._iaddn=function(M){this.words[0]+=M;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},c.prototype.isubn=function(M){if(u(typeof M=="number"),u(M<67108864),M<0)return this.iaddn(-M);if(this.negative!==0)return this.negative=0,this.iaddn(M),this.negative=1,this;if(this.words[0]-=M,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this.strip()},c.prototype.addn=function(M){return this.clone().iaddn(M)},c.prototype.subn=function(M){return this.clone().isubn(M)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(M,v,S){var y=M.length+S,w;this._expand(y);var P,L=0;for(w=0;w<M.length;w++){P=(this.words[w+S]|0)+L;var N=(M.words[w]|0)*v;P-=N&67108863,L=(P>>26)-(N/67108864|0),this.words[w+S]=P&67108863}for(;w<this.length-S;w++)P=(this.words[w+S]|0)+L,L=P>>26,this.words[w+S]=P&67108863;if(L===0)return this.strip();for(u(L===-1),L=0,w=0;w<this.length;w++)P=-(this.words[w]|0)+L,L=P>>26,this.words[w]=P&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(M,v){var S=this.length-M.length,y=this.clone(),w=M,P=w.words[w.length-1]|0,L=this._countBits(P);S=26-L,S!==0&&(w=w.ushln(S),y.iushln(S),P=w.words[w.length-1]|0);var N=y.length-w.length,E;if(v!=="mod"){E=new c(null),E.length=N+1,E.words=new Array(E.length);for(var A=0;A<E.length;A++)E.words[A]=0}var D=y.clone()._ishlnsubmul(w,1,N);D.negative===0&&(y=D,E&&(E.words[N]=1));for(var H=N-1;H>=0;H--){var Y=(y.words[w.length+H]|0)*67108864+(y.words[w.length+H-1]|0);for(Y=Math.min(Y/P|0,67108863),y._ishlnsubmul(w,Y,H);y.negative!==0;)Y--,y.negative=0,y._ishlnsubmul(w,1,H),y.isZero()||(y.negative^=1);E&&(E.words[H]=Y)}return E&&E.strip(),y.strip(),v!=="div"&&S!==0&&y.iushrn(S),{div:E||null,mod:y}},c.prototype.divmod=function(M,v,S){if(u(!M.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var y,w,P;return this.negative!==0&&M.negative===0?(P=this.neg().divmod(M,v),v!=="mod"&&(y=P.div.neg()),v!=="div"&&(w=P.mod.neg(),S&&w.negative!==0&&w.iadd(M)),{div:y,mod:w}):this.negative===0&&M.negative!==0?(P=this.divmod(M.neg(),v),v!=="mod"&&(y=P.div.neg()),{div:y,mod:P.mod}):this.negative&M.negative?(P=this.neg().divmod(M.neg(),v),v!=="div"&&(w=P.mod.neg(),S&&w.negative!==0&&w.isub(M)),{div:P.div,mod:w}):M.length>this.length||this.cmp(M)<0?{div:new c(0),mod:this}:M.length===1?v==="div"?{div:this.divn(M.words[0]),mod:null}:v==="mod"?{div:null,mod:new c(this.modn(M.words[0]))}:{div:this.divn(M.words[0]),mod:new c(this.modn(M.words[0]))}:this._wordDiv(M,v)},c.prototype.div=function(M){return this.divmod(M,"div",!1).div},c.prototype.mod=function(M){return this.divmod(M,"mod",!1).mod},c.prototype.umod=function(M){return this.divmod(M,"mod",!0).mod},c.prototype.divRound=function(M){var v=this.divmod(M);if(v.mod.isZero())return v.div;var S=v.div.negative!==0?v.mod.isub(M):v.mod,y=M.ushrn(1),w=M.andln(1),P=S.cmp(y);return P<0||w===1&&P===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},c.prototype.modn=function(M){u(M<=67108863);for(var v=(1<<26)%M,S=0,y=this.length-1;y>=0;y--)S=(v*S+(this.words[y]|0))%M;return S},c.prototype.idivn=function(M){u(M<=67108863);for(var v=0,S=this.length-1;S>=0;S--){var y=(this.words[S]|0)+v*67108864;this.words[S]=y/M|0,v=y%M}return this.strip()},c.prototype.divn=function(M){return this.clone().idivn(M)},c.prototype.egcd=function(M){u(M.negative===0),u(!M.isZero());var v=this,S=M.clone();v.negative!==0?v=v.umod(M):v=v.clone();for(var y=new c(1),w=new c(0),P=new c(0),L=new c(1),N=0;v.isEven()&&S.isEven();)v.iushrn(1),S.iushrn(1),++N;for(var E=S.clone(),A=v.clone();!v.isZero();){for(var D=0,H=1;!(v.words[0]&H)&&D<26;++D,H<<=1);if(D>0)for(v.iushrn(D);D-- >0;)(y.isOdd()||w.isOdd())&&(y.iadd(E),w.isub(A)),y.iushrn(1),w.iushrn(1);for(var Y=0,le=1;!(S.words[0]&le)&&Y<26;++Y,le<<=1);if(Y>0)for(S.iushrn(Y);Y-- >0;)(P.isOdd()||L.isOdd())&&(P.iadd(E),L.isub(A)),P.iushrn(1),L.iushrn(1);v.cmp(S)>=0?(v.isub(S),y.isub(P),w.isub(L)):(S.isub(v),P.isub(y),L.isub(w))}return{a:P,b:L,gcd:S.iushln(N)}},c.prototype._invmp=function(M){u(M.negative===0),u(!M.isZero());var v=this,S=M.clone();v.negative!==0?v=v.umod(M):v=v.clone();for(var y=new c(1),w=new c(0),P=S.clone();v.cmpn(1)>0&&S.cmpn(1)>0;){for(var L=0,N=1;!(v.words[0]&N)&&L<26;++L,N<<=1);if(L>0)for(v.iushrn(L);L-- >0;)y.isOdd()&&y.iadd(P),y.iushrn(1);for(var E=0,A=1;!(S.words[0]&A)&&E<26;++E,A<<=1);if(E>0)for(S.iushrn(E);E-- >0;)w.isOdd()&&w.iadd(P),w.iushrn(1);v.cmp(S)>=0?(v.isub(S),y.isub(w)):(S.isub(v),w.isub(y))}var D;return v.cmpn(1)===0?D=y:D=w,D.cmpn(0)<0&&D.iadd(M),D},c.prototype.gcd=function(M){if(this.isZero())return M.abs();if(M.isZero())return this.abs();var v=this.clone(),S=M.clone();v.negative=0,S.negative=0;for(var y=0;v.isEven()&&S.isEven();y++)v.iushrn(1),S.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;S.isEven();)S.iushrn(1);var w=v.cmp(S);if(w<0){var P=v;v=S,S=P}else if(w===0||S.cmpn(1)===0)break;v.isub(S)}while(!0);return S.iushln(y)},c.prototype.invm=function(M){return this.egcd(M).a.umod(M)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(M){return this.words[0]&M},c.prototype.bincn=function(M){u(typeof M=="number");var v=M%26,S=(M-v)/26,y=1<<v;if(this.length<=S)return this._expand(S+1),this.words[S]|=y,this;for(var w=y,P=S;w!==0&&P<this.length;P++){var L=this.words[P]|0;L+=w,w=L>>>26,L&=67108863,this.words[P]=L}return w!==0&&(this.words[P]=w,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(M){var v=M<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var S;if(this.length>1)S=1;else{v&&(M=-M),u(M<=67108863,"Number is too big");var y=this.words[0]|0;S=y===M?0:y<M?-1:1}return this.negative!==0?-S|0:S},c.prototype.cmp=function(M){if(this.negative!==0&&M.negative===0)return-1;if(this.negative===0&&M.negative!==0)return 1;var v=this.ucmp(M);return this.negative!==0?-v|0:v},c.prototype.ucmp=function(M){if(this.length>M.length)return 1;if(this.length<M.length)return-1;for(var v=0,S=this.length-1;S>=0;S--){var y=this.words[S]|0,w=M.words[S]|0;if(y!==w){y<w?v=-1:y>w&&(v=1);break}}return v},c.prototype.gtn=function(M){return this.cmpn(M)===1},c.prototype.gt=function(M){return this.cmp(M)===1},c.prototype.gten=function(M){return this.cmpn(M)>=0},c.prototype.gte=function(M){return this.cmp(M)>=0},c.prototype.ltn=function(M){return this.cmpn(M)===-1},c.prototype.lt=function(M){return this.cmp(M)===-1},c.prototype.lten=function(M){return this.cmpn(M)<=0},c.prototype.lte=function(M){return this.cmp(M)<=0},c.prototype.eqn=function(M){return this.cmpn(M)===0},c.prototype.eq=function(M){return this.cmp(M)===0},c.red=function(M){return new V(M)},c.prototype.toRed=function(M){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),M.convertTo(this)._forceRed(M)},c.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(M){return this.red=M,this},c.prototype.forceRed=function(M){return u(!this.red,"Already a number in reduction context"),this._forceRed(M)},c.prototype.redAdd=function(M){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,M)},c.prototype.redIAdd=function(M){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,M)},c.prototype.redSub=function(M){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,M)},c.prototype.redISub=function(M){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,M)},c.prototype.redShl=function(M){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,M)},c.prototype.redMul=function(M){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,M),this.red.mul(this,M)},c.prototype.redIMul=function(M){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,M),this.red.imul(this,M)},c.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(M){return u(this.red&&!M.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,M)};var Q={k256:null,p224:null,p192:null,p25519:null};function te(ne,M){this.name=ne,this.p=new c(M,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}te.prototype._tmp=function(){var M=new c(null);return M.words=new Array(Math.ceil(this.n/13)),M},te.prototype.ireduce=function(M){var v=M,S;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),S=v.bitLength();while(S>this.n);var y=S<this.n?-1:v.ucmp(this.p);return y===0?(v.words[0]=0,v.length=1):y>0?v.isub(this.p):v.strip(),v},te.prototype.split=function(M,v){M.iushrn(this.n,0,v)},te.prototype.imulK=function(M){return M.imul(this.k)};function se(){te.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(se,te),se.prototype.split=function(M,v){for(var S=4194303,y=Math.min(M.length,9),w=0;w<y;w++)v.words[w]=M.words[w];if(v.length=y,M.length<=9){M.words[0]=0,M.length=1;return}var P=M.words[9];for(v.words[v.length++]=P&S,w=10;w<M.length;w++){var L=M.words[w]|0;M.words[w-10]=(L&S)<<4|P>>>22,P=L}P>>>=22,M.words[w-10]=P,P===0&&M.length>10?M.length-=10:M.length-=9},se.prototype.imulK=function(M){M.words[M.length]=0,M.words[M.length+1]=0,M.length+=2;for(var v=0,S=0;S<M.length;S++){var y=M.words[S]|0;v+=y*977,M.words[S]=v&67108863,v=y*64+(v/67108864|0)}return M.words[M.length-1]===0&&(M.length--,M.words[M.length-1]===0&&M.length--),M};function pe(){te.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(pe,te);function me(){te.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(me,te);function Ee(){te.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(Ee,te),Ee.prototype.imulK=function(M){for(var v=0,S=0;S<M.length;S++){var y=(M.words[S]|0)*19+v,w=y&67108863;y>>>=26,M.words[S]=w,v=y}return v!==0&&(M.words[M.length++]=v),M},c._prime=function(M){if(Q[M])return Q[M];var v;if(M==="k256")v=new se;else if(M==="p224")v=new pe;else if(M==="p192")v=new me;else if(M==="p25519")v=new Ee;else throw new Error("Unknown prime "+M);return Q[M]=v,v};function V(ne){if(typeof ne=="string"){var M=c._prime(ne);this.m=M.p,this.prime=M}else u(ne.gtn(1),"modulus must be greater than 1"),this.m=ne,this.prime=null}V.prototype._verify1=function(M){u(M.negative===0,"red works only with positives"),u(M.red,"red works only with red numbers")},V.prototype._verify2=function(M,v){u((M.negative|v.negative)===0,"red works only with positives"),u(M.red&&M.red===v.red,"red works only with red numbers")},V.prototype.imod=function(M){return this.prime?this.prime.ireduce(M)._forceRed(this):M.umod(this.m)._forceRed(this)},V.prototype.neg=function(M){return M.isZero()?M.clone():this.m.sub(M)._forceRed(this)},V.prototype.add=function(M,v){this._verify2(M,v);var S=M.add(v);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},V.prototype.iadd=function(M,v){this._verify2(M,v);var S=M.iadd(v);return S.cmp(this.m)>=0&&S.isub(this.m),S},V.prototype.sub=function(M,v){this._verify2(M,v);var S=M.sub(v);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},V.prototype.isub=function(M,v){this._verify2(M,v);var S=M.isub(v);return S.cmpn(0)<0&&S.iadd(this.m),S},V.prototype.shl=function(M,v){return this._verify1(M),this.imod(M.ushln(v))},V.prototype.imul=function(M,v){return this._verify2(M,v),this.imod(M.imul(v))},V.prototype.mul=function(M,v){return this._verify2(M,v),this.imod(M.mul(v))},V.prototype.isqr=function(M){return this.imul(M,M.clone())},V.prototype.sqr=function(M){return this.mul(M,M)},V.prototype.sqrt=function(M){if(M.isZero())return M.clone();var v=this.m.andln(3);if(u(v%2===1),v===3){var S=this.m.add(new c(1)).iushrn(2);return this.pow(M,S)}for(var y=this.m.subn(1),w=0;!y.isZero()&&y.andln(1)===0;)w++,y.iushrn(1);u(!y.isZero());var P=new c(1).toRed(this),L=P.redNeg(),N=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new c(2*E*E).toRed(this);this.pow(E,N).cmp(L)!==0;)E.redIAdd(L);for(var A=this.pow(E,y),D=this.pow(M,y.addn(1).iushrn(1)),H=this.pow(M,y),Y=w;H.cmp(P)!==0;){for(var le=H,_e=0;le.cmp(P)!==0;_e++)le=le.redSqr();u(_e<Y);var he=this.pow(A,new c(1).iushln(Y-_e-1));D=D.redMul(he),A=he.redSqr(),H=H.redMul(A),Y=_e}return D},V.prototype.invm=function(M){var v=M._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},V.prototype.pow=function(M,v){if(v.isZero())return new c(1).toRed(this);if(v.cmpn(1)===0)return M.clone();var S=4,y=new Array(1<<S);y[0]=new c(1).toRed(this),y[1]=M;for(var w=2;w<y.length;w++)y[w]=this.mul(y[w-1],M);var P=y[0],L=0,N=0,E=v.bitLength()%26;for(E===0&&(E=26),w=v.length-1;w>=0;w--){for(var A=v.words[w],D=E-1;D>=0;D--){var H=A>>D&1;if(P!==y[0]&&(P=this.sqr(P)),H===0&&L===0){N=0;continue}L<<=1,L|=H,N++,!(N!==S&&(w!==0||D!==0))&&(P=this.mul(P,y[L]),N=0,L=0)}E=26}return P},V.prototype.convertTo=function(M){var v=M.umod(this.m);return v===M?v.clone():v},V.prototype.convertFrom=function(M){var v=M.clone();return v.red=null,v},c.mont=function(M){return new ae(M)};function ae(ne){V.call(this,ne),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}d(ae,V),ae.prototype.convertTo=function(M){return this.imod(M.ushln(this.shift))},ae.prototype.convertFrom=function(M){var v=this.imod(M.mul(this.rinv));return v.red=null,v},ae.prototype.imul=function(M,v){if(M.isZero()||v.isZero())return M.words[0]=0,M.length=1,M;var S=M.imul(v),y=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=S.isub(y).iushrn(this.shift),P=w;return w.cmp(this.m)>=0?P=w.isub(this.m):w.cmpn(0)<0&&(P=w.iadd(this.m)),P._forceRed(this)},ae.prototype.mul=function(M,v){if(M.isZero()||v.isZero())return new c(0)._forceRed(this);var S=M.mul(v),y=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=S.isub(y).iushrn(this.shift),P=w;return w.cmp(this.m)>=0?P=w.isub(this.m):w.cmpn(0)<0&&(P=w.iadd(this.m)),P._forceRed(this)},ae.prototype.invm=function(M){var v=this.imod(M._invmp(this.m).mul(this.r2));return v._forceRed(this)}})(t,commonjsGlobal)}(bn$2);var bnExports$1=bn$2.exports,errors$4={exports:{}},lodash={exports:{}};/**
40
+ * @license
41
+ * Lodash <https://lodash.com/>
42
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
43
+ * Released under MIT license <https://lodash.com/license>
44
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
45
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
46
+ */lodash.exports,function(t,e){(function(){var a,u="4.17.21",d=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",m="Invalid `variable` option passed into `_.template`",I="__lodash_hash_undefined__",O=500,T="__lodash_placeholder__",C=1,j=2,F=4,U=1,Z=2,J=1,X=2,Q=4,te=8,se=16,pe=32,me=64,Ee=128,V=256,ae=512,ne=30,M="...",v=800,S=16,y=1,w=2,P=3,L=1/0,N=9007199254740991,E=17976931348623157e292,A=NaN,D=4294967295,H=D-1,Y=D>>>1,le=[["ary",Ee],["bind",J],["bindKey",X],["curry",te],["curryRight",se],["flip",ae],["partial",pe],["partialRight",me],["rearg",V]],_e="[object Arguments]",he="[object Array]",fe="[object AsyncFunction]",ve="[object Boolean]",ge="[object Date]",Ie="[object DOMException]",ue="[object Error]",ce="[object Function]",Te="[object GeneratorFunction]",ke="[object Map]",He="[object Number]",Qe="[object Null]",it="[object Object]",rt="[object Promise]",Fe="[object Proxy]",wt="[object RegExp]",et="[object Set]",At="[object String]",gt="[object Symbol]",$e="[object Undefined]",Me="[object WeakMap]",Ze="[object WeakSet]",ze="[object ArrayBuffer]",Ge="[object DataView]",ht="[object Float32Array]",oe="[object Float64Array]",ee="[object Int8Array]",re="[object Int16Array]",be="[object Int32Array]",Pe="[object Uint8Array]",Ne="[object Uint8ClampedArray]",Oe="[object Uint16Array]",ut="[object Uint32Array]",lt=/\b__p \+= '';/g,Je=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vt=/&(?:amp|lt|gt|quot|#39);/g,ot=/[&<>"']/g,Et=RegExp(vt.source),Bt=RegExp(ot.source),Se=/<%-([\s\S]+?)%>/g,ye=/<%([\s\S]+?)%>/g,xe=/<%=([\s\S]+?)%>/g,Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Le=/^\w*$/,je=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qe=/[\\^$.*+?()[\]{}|]/g,Xe=RegExp(qe.source),at=/^\s+/,Ve=/\s/,dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ye=/,? & /,_t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,$t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ct=/\w*$/,Nt=/^[-+]0x[0-9a-f]+$/i,Jt=/^0b[01]+$/i,Qt=/^\[object .+?Constructor\]$/,Wt=/^0o[0-7]+$/i,ur=/^(?:0|[1-9]\d*)$/,vr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nr=/($^)/,br=/['\n\r\u2028\u2029\\]/g,ir="\\ud800-\\udfff",gr="\\u0300-\\u036f",yr="\\ufe20-\\ufe2f",wr="\\u20d0-\\u20ff",cr=gr+yr+wr,dr="\\u2700-\\u27bf",lr="a-z\\xdf-\\xf6\\xf8-\\xff",_r="\\xac\\xb1\\xd7\\xf7",Ar="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Nr="\\u2000-\\u206f",Gn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",On="A-Z\\xc0-\\xd6\\xd8-\\xde",oa="\\ufe0e\\ufe0f",fa=_r+Ar+Nr+Gn,Xi="['’]",Rf="["+ir+"]",ua="["+fa+"]",ci="["+cr+"]",ca="\\d+",Tf="["+dr+"]",ha="["+lr+"]",da="[^"+ir+fa+ca+dr+lr+On+"]",Ji="\\ud83c[\\udffb-\\udfff]",Mf="(?:"+ci+"|"+Ji+")",la="[^"+ir+"]",Yi="(?:\\ud83c[\\udde6-\\uddff]){2}",Qi="[\\ud800-\\udbff][\\udc00-\\udfff]",Cn="["+On+"]",pa="\\u200d",va="(?:"+ha+"|"+da+")",Of="(?:"+Cn+"|"+da+")",ba="(?:"+Xi+"(?:d|ll|m|re|s|t|ve))?",ma="(?:"+Xi+"(?:D|LL|M|RE|S|T|VE))?",ga=Mf+"?",ya="["+oa+"]?",Cf="(?:"+pa+"(?:"+[la,Yi,Qi].join("|")+")"+ya+ga+")*",Nf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wa=ya+ga+Cf,Df="(?:"+[Tf,Yi,Qi].join("|")+")"+wa,Lf="(?:"+[la+ci+"?",ci,Yi,Qi,Rf].join("|")+")",Uf=RegExp(Xi,"g"),Hf=RegExp(ci,"g"),es=RegExp(Ji+"(?="+Ji+")|"+Lf+wa,"g"),Ff=RegExp([Cn+"?"+ha+"+"+ba+"(?="+[ua,Cn,"$"].join("|")+")",Of+"+"+ma+"(?="+[ua,Cn+va,"$"].join("|")+")",Cn+"?"+va+"+"+ba,Cn+"+"+ma,kf,Nf,ca,Df].join("|"),"g"),qf=RegExp("["+pa+ir+cr+oa+"]"),zf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,jf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Kf=-1,Vt={};Vt[ht]=Vt[oe]=Vt[ee]=Vt[re]=Vt[be]=Vt[Pe]=Vt[Ne]=Vt[Oe]=Vt[ut]=!0,Vt[_e]=Vt[he]=Vt[ze]=Vt[ve]=Vt[Ge]=Vt[ge]=Vt[ue]=Vt[ce]=Vt[ke]=Vt[He]=Vt[it]=Vt[wt]=Vt[et]=Vt[At]=Vt[Me]=!1;var Zt={};Zt[_e]=Zt[he]=Zt[ze]=Zt[Ge]=Zt[ve]=Zt[ge]=Zt[ht]=Zt[oe]=Zt[ee]=Zt[re]=Zt[be]=Zt[ke]=Zt[He]=Zt[it]=Zt[wt]=Zt[et]=Zt[At]=Zt[gt]=Zt[Pe]=Zt[Ne]=Zt[Oe]=Zt[ut]=!0,Zt[ue]=Zt[ce]=Zt[Me]=!1;var Zf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Vf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Wf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xf=parseFloat,Jf=parseInt,_a=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Yf=typeof self=="object"&&self&&self.Object===Object&&self,Sr=_a||Yf||Function("return this")(),ts=e&&!e.nodeType&&e,xn=ts&&!0&&t&&!t.nodeType&&t,Aa=xn&&xn.exports===ts,rs=Aa&&_a.process,qr=function(){try{var De=xn&&xn.require&&xn.require("util").types;return De||rs&&rs.binding&&rs.binding("util")}catch{}}(),Sa=qr&&qr.isArrayBuffer,xa=qr&&qr.isDate,Ea=qr&&qr.isMap,$a=qr&&qr.isRegExp,Ba=qr&&qr.isSet,Ia=qr&&qr.isTypedArray;function kr(De,We,Ke){switch(Ke.length){case 0:return De.call(We);case 1:return De.call(We,Ke[0]);case 2:return De.call(We,Ke[0],Ke[1]);case 3:return De.call(We,Ke[0],Ke[1],Ke[2])}return De.apply(We,Ke)}function Qf(De,We,Ke,St){for(var Mt=-1,qt=De==null?0:De.length;++Mt<qt;){var or=De[Mt];We(St,or,Ke(or),De)}return St}function jr(De,We){for(var Ke=-1,St=De==null?0:De.length;++Ke<St&&We(De[Ke],Ke,De)!==!1;);return De}function eu(De,We){for(var Ke=De==null?0:De.length;Ke--&&We(De[Ke],Ke,De)!==!1;);return De}function Pa(De,We){for(var Ke=-1,St=De==null?0:De.length;++Ke<St;)if(!We(De[Ke],Ke,De))return!1;return!0}function pn(De,We){for(var Ke=-1,St=De==null?0:De.length,Mt=0,qt=[];++Ke<St;){var or=De[Ke];We(or,Ke,De)&&(qt[Mt++]=or)}return qt}function hi(De,We){var Ke=De==null?0:De.length;return!!Ke&&Nn(De,We,0)>-1}function ns(De,We,Ke){for(var St=-1,Mt=De==null?0:De.length;++St<Mt;)if(Ke(We,De[St]))return!0;return!1}function Gt(De,We){for(var Ke=-1,St=De==null?0:De.length,Mt=Array(St);++Ke<St;)Mt[Ke]=We(De[Ke],Ke,De);return Mt}function vn(De,We){for(var Ke=-1,St=We.length,Mt=De.length;++Ke<St;)De[Mt+Ke]=We[Ke];return De}function is(De,We,Ke,St){var Mt=-1,qt=De==null?0:De.length;for(St&&qt&&(Ke=De[++Mt]);++Mt<qt;)Ke=We(Ke,De[Mt],Mt,De);return Ke}function tu(De,We,Ke,St){var Mt=De==null?0:De.length;for(St&&Mt&&(Ke=De[--Mt]);Mt--;)Ke=We(Ke,De[Mt],Mt,De);return Ke}function ss(De,We){for(var Ke=-1,St=De==null?0:De.length;++Ke<St;)if(We(De[Ke],Ke,De))return!0;return!1}var ru=as("length");function nu(De){return De.split("")}function iu(De){return De.match(_t)||[]}function Ra(De,We,Ke){var St;return Ke(De,function(Mt,qt,or){if(We(Mt,qt,or))return St=qt,!1}),St}function di(De,We,Ke,St){for(var Mt=De.length,qt=Ke+(St?1:-1);St?qt--:++qt<Mt;)if(We(De[qt],qt,De))return qt;return-1}function Nn(De,We,Ke){return We===We?bu(De,We,Ke):di(De,Ta,Ke)}function su(De,We,Ke,St){for(var Mt=Ke-1,qt=De.length;++Mt<qt;)if(St(De[Mt],We))return Mt;return-1}function Ta(De){return De!==De}function Ma(De,We){var Ke=De==null?0:De.length;return Ke?fs(De,We)/Ke:A}function as(De){return function(We){return We==null?a:We[De]}}function os(De){return function(We){return De==null?a:De[We]}}function Oa(De,We,Ke,St,Mt){return Mt(De,function(qt,or,Kt){Ke=St?(St=!1,qt):We(Ke,qt,or,Kt)}),Ke}function au(De,We){var Ke=De.length;for(De.sort(We);Ke--;)De[Ke]=De[Ke].value;return De}function fs(De,We){for(var Ke,St=-1,Mt=De.length;++St<Mt;){var qt=We(De[St]);qt!==a&&(Ke=Ke===a?qt:Ke+qt)}return Ke}function us(De,We){for(var Ke=-1,St=Array(De);++Ke<De;)St[Ke]=We(Ke);return St}function ou(De,We){return Gt(We,function(Ke){return[Ke,De[Ke]]})}function Ca(De){return De&&De.slice(0,La(De)+1).replace(at,"")}function Dr(De){return function(We){return De(We)}}function cs(De,We){return Gt(We,function(Ke){return De[Ke]})}function Wn(De,We){return De.has(We)}function Na(De,We){for(var Ke=-1,St=De.length;++Ke<St&&Nn(We,De[Ke],0)>-1;);return Ke}function ka(De,We){for(var Ke=De.length;Ke--&&Nn(We,De[Ke],0)>-1;);return Ke}function fu(De,We){for(var Ke=De.length,St=0;Ke--;)De[Ke]===We&&++St;return St}var uu=os(Zf),cu=os(Vf);function hu(De){return"\\"+Wf[De]}function du(De,We){return De==null?a:De[We]}function kn(De){return qf.test(De)}function lu(De){return zf.test(De)}function pu(De){for(var We,Ke=[];!(We=De.next()).done;)Ke.push(We.value);return Ke}function hs(De){var We=-1,Ke=Array(De.size);return De.forEach(function(St,Mt){Ke[++We]=[Mt,St]}),Ke}function Da(De,We){return function(Ke){return De(We(Ke))}}function mn(De,We){for(var Ke=-1,St=De.length,Mt=0,qt=[];++Ke<St;){var or=De[Ke];(or===We||or===T)&&(De[Ke]=T,qt[Mt++]=Ke)}return qt}function li(De){var We=-1,Ke=Array(De.size);return De.forEach(function(St){Ke[++We]=St}),Ke}function vu(De){var We=-1,Ke=Array(De.size);return De.forEach(function(St){Ke[++We]=[St,St]}),Ke}function bu(De,We,Ke){for(var St=Ke-1,Mt=De.length;++St<Mt;)if(De[St]===We)return St;return-1}function mu(De,We,Ke){for(var St=Ke+1;St--;)if(De[St]===We)return St;return St}function Dn(De){return kn(De)?yu(De):ru(De)}function Jr(De){return kn(De)?wu(De):nu(De)}function La(De){for(var We=De.length;We--&&Ve.test(De.charAt(We)););return We}var gu=os(Gf);function yu(De){for(var We=es.lastIndex=0;es.test(De);)++We;return We}function wu(De){return De.match(es)||[]}function _u(De){return De.match(Ff)||[]}var Au=function De(We){We=We==null?Sr:Ln.defaults(Sr.Object(),We,Ln.pick(Sr,jf));var Ke=We.Array,St=We.Date,Mt=We.Error,qt=We.Function,or=We.Math,Kt=We.Object,ds=We.RegExp,Su=We.String,Kr=We.TypeError,pi=Ke.prototype,xu=qt.prototype,Un=Kt.prototype,vi=We["__core-js_shared__"],bi=xu.toString,jt=Un.hasOwnProperty,Eu=0,Ua=function(){var b=/[^.]+$/.exec(vi&&vi.keys&&vi.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),mi=Un.toString,$u=bi.call(Kt),Bu=Sr._,Iu=ds("^"+bi.call(jt).replace(qe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gi=Aa?We.Buffer:a,gn=We.Symbol,yi=We.Uint8Array,Ha=gi?gi.allocUnsafe:a,wi=Da(Kt.getPrototypeOf,Kt),Fa=Kt.create,qa=Un.propertyIsEnumerable,_i=pi.splice,za=gn?gn.isConcatSpreadable:a,Xn=gn?gn.iterator:a,En=gn?gn.toStringTag:a,Ai=function(){try{var b=Rn(Kt,"defineProperty");return b({},"",{}),b}catch{}}(),Pu=We.clearTimeout!==Sr.clearTimeout&&We.clearTimeout,Ru=St&&St.now!==Sr.Date.now&&St.now,Tu=We.setTimeout!==Sr.setTimeout&&We.setTimeout,Si=or.ceil,xi=or.floor,ls=Kt.getOwnPropertySymbols,Mu=gi?gi.isBuffer:a,ja=We.isFinite,Ou=pi.join,Cu=Da(Kt.keys,Kt),fr=or.max,Er=or.min,Nu=St.now,ku=We.parseInt,Ka=or.random,Du=pi.reverse,ps=Rn(We,"DataView"),Jn=Rn(We,"Map"),vs=Rn(We,"Promise"),Hn=Rn(We,"Set"),Yn=Rn(We,"WeakMap"),Qn=Rn(Kt,"create"),Ei=Yn&&new Yn,Fn={},Lu=Tn(ps),Uu=Tn(Jn),Hu=Tn(vs),Fu=Tn(Hn),qu=Tn(Yn),$i=gn?gn.prototype:a,ei=$i?$i.valueOf:a,Za=$i?$i.toString:a;function we(b){if(Yt(b)&&!Ot(b)&&!(b instanceof Ht)){if(b instanceof Zr)return b;if(jt.call(b,"__wrapped__"))return Go(b)}return new Zr(b)}var qn=function(){function b(){}return function(B){if(!Xt(B))return{};if(Fa)return Fa(B);b.prototype=B;var q=new b;return b.prototype=a,q}}();function Bi(){}function Zr(b,B){this.__wrapped__=b,this.__actions__=[],this.__chain__=!!B,this.__index__=0,this.__values__=a}we.templateSettings={escape:Se,evaluate:ye,interpolate:xe,variable:"",imports:{_:we}},we.prototype=Bi.prototype,we.prototype.constructor=we,Zr.prototype=qn(Bi.prototype),Zr.prototype.constructor=Zr;function Ht(b){this.__wrapped__=b,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function zu(){var b=new Ht(this.__wrapped__);return b.__actions__=Tr(this.__actions__),b.__dir__=this.__dir__,b.__filtered__=this.__filtered__,b.__iteratees__=Tr(this.__iteratees__),b.__takeCount__=this.__takeCount__,b.__views__=Tr(this.__views__),b}function ju(){if(this.__filtered__){var b=new Ht(this);b.__dir__=-1,b.__filtered__=!0}else b=this.clone(),b.__dir__*=-1;return b}function Ku(){var b=this.__wrapped__.value(),B=this.__dir__,q=Ot(b),ie=B<0,de=q?b.length:0,Ae=ah(0,de,this.__views__),Re=Ae.start,Ce=Ae.end,Ue=Ce-Re,tt=ie?Ce:Re-1,nt=this.__iteratees__,st=nt.length,mt=0,xt=Er(Ue,this.__takeCount__);if(!q||!ie&&de==Ue&&xt==Ue)return mo(b,this.__actions__);var Pt=[];e:for(;Ue--&&mt<xt;){tt+=B;for(var Dt=-1,Rt=b[tt];++Dt<st;){var Ut=nt[Dt],Ft=Ut.iteratee,Hr=Ut.type,Pr=Ft(Rt);if(Hr==w)Rt=Pr;else if(!Pr){if(Hr==y)continue e;break e}}Pt[mt++]=Rt}return Pt}Ht.prototype=qn(Bi.prototype),Ht.prototype.constructor=Ht;function $n(b){var B=-1,q=b==null?0:b.length;for(this.clear();++B<q;){var ie=b[B];this.set(ie[0],ie[1])}}function Zu(){this.__data__=Qn?Qn(null):{},this.size=0}function Vu(b){var B=this.has(b)&&delete this.__data__[b];return this.size-=B?1:0,B}function Gu(b){var B=this.__data__;if(Qn){var q=B[b];return q===I?a:q}return jt.call(B,b)?B[b]:a}function Wu(b){var B=this.__data__;return Qn?B[b]!==a:jt.call(B,b)}function Xu(b,B){var q=this.__data__;return this.size+=this.has(b)?0:1,q[b]=Qn&&B===a?I:B,this}$n.prototype.clear=Zu,$n.prototype.delete=Vu,$n.prototype.get=Gu,$n.prototype.has=Wu,$n.prototype.set=Xu;function sn(b){var B=-1,q=b==null?0:b.length;for(this.clear();++B<q;){var ie=b[B];this.set(ie[0],ie[1])}}function Ju(){this.__data__=[],this.size=0}function Yu(b){var B=this.__data__,q=Ii(B,b);if(q<0)return!1;var ie=B.length-1;return q==ie?B.pop():_i.call(B,q,1),--this.size,!0}function Qu(b){var B=this.__data__,q=Ii(B,b);return q<0?a:B[q][1]}function tc(b){return Ii(this.__data__,b)>-1}function rc(b,B){var q=this.__data__,ie=Ii(q,b);return ie<0?(++this.size,q.push([b,B])):q[ie][1]=B,this}sn.prototype.clear=Ju,sn.prototype.delete=Yu,sn.prototype.get=Qu,sn.prototype.has=tc,sn.prototype.set=rc;function an(b){var B=-1,q=b==null?0:b.length;for(this.clear();++B<q;){var ie=b[B];this.set(ie[0],ie[1])}}function nc(){this.size=0,this.__data__={hash:new $n,map:new(Jn||sn),string:new $n}}function ic(b){var B=Hi(this,b).delete(b);return this.size-=B?1:0,B}function sc(b){return Hi(this,b).get(b)}function ac(b){return Hi(this,b).has(b)}function oc(b,B){var q=Hi(this,b),ie=q.size;return q.set(b,B),this.size+=q.size==ie?0:1,this}an.prototype.clear=nc,an.prototype.delete=ic,an.prototype.get=sc,an.prototype.has=ac,an.prototype.set=oc;function Bn(b){var B=-1,q=b==null?0:b.length;for(this.__data__=new an;++B<q;)this.add(b[B])}function fc(b){return this.__data__.set(b,I),this}function uc(b){return this.__data__.has(b)}Bn.prototype.add=Bn.prototype.push=fc,Bn.prototype.has=uc;function Yr(b){var B=this.__data__=new sn(b);this.size=B.size}function cc(){this.__data__=new sn,this.size=0}function hc(b){var B=this.__data__,q=B.delete(b);return this.size=B.size,q}function dc(b){return this.__data__.get(b)}function lc(b){return this.__data__.has(b)}function pc(b,B){var q=this.__data__;if(q instanceof sn){var ie=q.__data__;if(!Jn||ie.length<d-1)return ie.push([b,B]),this.size=++q.size,this;q=this.__data__=new an(ie)}return q.set(b,B),this.size=q.size,this}Yr.prototype.clear=cc,Yr.prototype.delete=hc,Yr.prototype.get=dc,Yr.prototype.has=lc,Yr.prototype.set=pc;function Va(b,B){var q=Ot(b),ie=!q&&Mn(b),de=!q&&!ie&&Sn(b),Ae=!q&&!ie&&!de&&Zn(b),Re=q||ie||de||Ae,Ce=Re?us(b.length,Su):[],Ue=Ce.length;for(var tt in b)(B||jt.call(b,tt))&&!(Re&&(tt=="length"||de&&(tt=="offset"||tt=="parent")||Ae&&(tt=="buffer"||tt=="byteLength"||tt=="byteOffset")||cn(tt,Ue)))&&Ce.push(tt);return Ce}function Ga(b){var B=b.length;return B?b[$s(0,B-1)]:a}function vc(b,B){return Fi(Tr(b),In(B,0,b.length))}function bc(b){return Fi(Tr(b))}function bs(b,B,q){(q!==a&&!Qr(b[B],q)||q===a&&!(B in b))&&on(b,B,q)}function ti(b,B,q){var ie=b[B];(!(jt.call(b,B)&&Qr(ie,q))||q===a&&!(B in b))&&on(b,B,q)}function Ii(b,B){for(var q=b.length;q--;)if(Qr(b[q][0],B))return q;return-1}function mc(b,B,q,ie){return yn(b,function(de,Ae,Re){B(ie,de,q(de),Re)}),ie}function Wa(b,B){return b&&rn(B,pr(B),b)}function gc(b,B){return b&&rn(B,Or(B),b)}function on(b,B,q){B=="__proto__"&&Ai?Ai(b,B,{configurable:!0,enumerable:!0,value:q,writable:!0}):b[B]=q}function ms(b,B){for(var q=-1,ie=B.length,de=Ke(ie),Ae=b==null;++q<ie;)de[q]=Ae?a:Ys(b,B[q]);return de}function In(b,B,q){return b===b&&(q!==a&&(b=b<=q?b:q),B!==a&&(b=b>=B?b:B)),b}function Vr(b,B,q,ie,de,Ae){var Re,Ce=B&C,Ue=B&j,tt=B&F;if(q&&(Re=de?q(b,ie,de,Ae):q(b)),Re!==a)return Re;if(!Xt(b))return b;var nt=Ot(b);if(nt){if(Re=fh(b),!Ce)return Tr(b,Re)}else{var st=$r(b),mt=st==ce||st==Te;if(Sn(b))return wo(b,Ce);if(st==it||st==_e||mt&&!de){if(Re=Ue||mt?{}:Uo(b),!Ce)return Ue?Wc(b,gc(Re,b)):Gc(b,Wa(Re,b))}else{if(!Zt[st])return de?b:{};Re=uh(b,st,Ce)}}Ae||(Ae=new Yr);var xt=Ae.get(b);if(xt)return xt;Ae.set(b,Re),vf(b)?b.forEach(function(Rt){Re.add(Vr(Rt,B,q,Rt,b,Ae))}):lf(b)&&b.forEach(function(Rt,Ut){Re.set(Ut,Vr(Rt,B,q,Ut,b,Ae))});var Pt=tt?Ue?Ds:ks:Ue?Or:pr,Dt=nt?a:Pt(b);return jr(Dt||b,function(Rt,Ut){Dt&&(Ut=Rt,Rt=b[Ut]),ti(Re,Ut,Vr(Rt,B,q,Ut,b,Ae))}),Re}function yc(b){var B=pr(b);return function(q){return Xa(q,b,B)}}function Xa(b,B,q){var ie=q.length;if(b==null)return!ie;for(b=Kt(b);ie--;){var de=q[ie],Ae=B[de],Re=b[de];if(Re===a&&!(de in b)||!Ae(Re))return!1}return!0}function Ja(b,B,q){if(typeof b!="function")throw new Kr(l);return fi(function(){b.apply(a,q)},B)}function ri(b,B,q,ie){var de=-1,Ae=hi,Re=!0,Ce=b.length,Ue=[],tt=B.length;if(!Ce)return Ue;q&&(B=Gt(B,Dr(q))),ie?(Ae=ns,Re=!1):B.length>=d&&(Ae=Wn,Re=!1,B=new Bn(B));e:for(;++de<Ce;){var nt=b[de],st=q==null?nt:q(nt);if(nt=ie||nt!==0?nt:0,Re&&st===st){for(var mt=tt;mt--;)if(B[mt]===st)continue e;Ue.push(nt)}else Ae(B,st,ie)||Ue.push(nt)}return Ue}var yn=Eo(tn),Ya=Eo(ys,!0);function wc(b,B){var q=!0;return yn(b,function(ie,de,Ae){return q=!!B(ie,de,Ae),q}),q}function Pi(b,B,q){for(var ie=-1,de=b.length;++ie<de;){var Ae=b[ie],Re=B(Ae);if(Re!=null&&(Ce===a?Re===Re&&!Ur(Re):q(Re,Ce)))var Ce=Re,Ue=Ae}return Ue}function _c(b,B,q,ie){var de=b.length;for(q=kt(q),q<0&&(q=-q>de?0:de+q),ie=ie===a||ie>de?de:kt(ie),ie<0&&(ie+=de),ie=q>ie?0:mf(ie);q<ie;)b[q++]=B;return b}function Qa(b,B){var q=[];return yn(b,function(ie,de,Ae){B(ie,de,Ae)&&q.push(ie)}),q}function xr(b,B,q,ie,de){var Ae=-1,Re=b.length;for(q||(q=lh),de||(de=[]);++Ae<Re;){var Ce=b[Ae];B>0&&q(Ce)?B>1?xr(Ce,B-1,q,ie,de):vn(de,Ce):ie||(de[de.length]=Ce)}return de}var gs=$o(),eo=$o(!0);function tn(b,B){return b&&gs(b,B,pr)}function ys(b,B){return b&&eo(b,B,pr)}function Ri(b,B){return pn(B,function(q){return hn(b[q])})}function Pn(b,B){B=_n(B,b);for(var q=0,ie=B.length;b!=null&&q<ie;)b=b[nn(B[q++])];return q&&q==ie?b:a}function to(b,B,q){var ie=B(b);return Ot(b)?ie:vn(ie,q(b))}function Br(b){return b==null?b===a?$e:Qe:En&&En in Kt(b)?ih(b):wh(b)}function ws(b,B){return b>B}function Ac(b,B){return b!=null&&jt.call(b,B)}function Sc(b,B){return b!=null&&B in Kt(b)}function xc(b,B,q){return b>=Er(B,q)&&b<fr(B,q)}function _s(b,B,q){for(var ie=q?ns:hi,de=b[0].length,Ae=b.length,Re=Ae,Ce=Ke(Ae),Ue=1/0,tt=[];Re--;){var nt=b[Re];Re&&B&&(nt=Gt(nt,Dr(B))),Ue=Er(nt.length,Ue),Ce[Re]=!q&&(B||de>=120&&nt.length>=120)?new Bn(Re&&nt):a}nt=b[0];var st=-1,mt=Ce[0];e:for(;++st<de&&tt.length<Ue;){var xt=nt[st],Pt=B?B(xt):xt;if(xt=q||xt!==0?xt:0,!(mt?Wn(mt,Pt):ie(tt,Pt,q))){for(Re=Ae;--Re;){var Dt=Ce[Re];if(!(Dt?Wn(Dt,Pt):ie(b[Re],Pt,q)))continue e}mt&&mt.push(Pt),tt.push(xt)}}return tt}function Ec(b,B,q,ie){return tn(b,function(de,Ae,Re){B(ie,q(de),Ae,Re)}),ie}function ni(b,B,q){B=_n(B,b),b=zo(b,B);var ie=b==null?b:b[nn(Wr(B))];return ie==null?a:kr(ie,b,q)}function ro(b){return Yt(b)&&Br(b)==_e}function $c(b){return Yt(b)&&Br(b)==ze}function Bc(b){return Yt(b)&&Br(b)==ge}function ii(b,B,q,ie,de){return b===B?!0:b==null||B==null||!Yt(b)&&!Yt(B)?b!==b&&B!==B:Ic(b,B,q,ie,ii,de)}function Ic(b,B,q,ie,de,Ae){var Re=Ot(b),Ce=Ot(B),Ue=Re?he:$r(b),tt=Ce?he:$r(B);Ue=Ue==_e?it:Ue,tt=tt==_e?it:tt;var nt=Ue==it,st=tt==it,mt=Ue==tt;if(mt&&Sn(b)){if(!Sn(B))return!1;Re=!0,nt=!1}if(mt&&!nt)return Ae||(Ae=new Yr),Re||Zn(b)?ko(b,B,q,ie,de,Ae):th(b,B,Ue,q,ie,de,Ae);if(!(q&U)){var xt=nt&&jt.call(b,"__wrapped__"),Pt=st&&jt.call(B,"__wrapped__");if(xt||Pt){var Dt=xt?b.value():b,Rt=Pt?B.value():B;return Ae||(Ae=new Yr),de(Dt,Rt,q,ie,Ae)}}return mt?(Ae||(Ae=new Yr),nh(b,B,q,ie,de,Ae)):!1}function Pc(b){return Yt(b)&&$r(b)==ke}function As(b,B,q,ie){var de=q.length,Ae=de,Re=!ie;if(b==null)return!Ae;for(b=Kt(b);de--;){var Ce=q[de];if(Re&&Ce[2]?Ce[1]!==b[Ce[0]]:!(Ce[0]in b))return!1}for(;++de<Ae;){Ce=q[de];var Ue=Ce[0],tt=b[Ue],nt=Ce[1];if(Re&&Ce[2]){if(tt===a&&!(Ue in b))return!1}else{var st=new Yr;if(ie)var mt=ie(tt,nt,Ue,b,B,st);if(!(mt===a?ii(nt,tt,U|Z,ie,st):mt))return!1}}return!0}function no(b){if(!Xt(b)||vh(b))return!1;var B=hn(b)?Iu:Qt;return B.test(Tn(b))}function Rc(b){return Yt(b)&&Br(b)==wt}function Tc(b){return Yt(b)&&$r(b)==et}function Mc(b){return Yt(b)&&Vi(b.length)&&!!Vt[Br(b)]}function io(b){return typeof b=="function"?b:b==null?Cr:typeof b=="object"?Ot(b)?oo(b[0],b[1]):ao(b):If(b)}function Ss(b){if(!oi(b))return Cu(b);var B=[];for(var q in Kt(b))jt.call(b,q)&&q!="constructor"&&B.push(q);return B}function Oc(b){if(!Xt(b))return yh(b);var B=oi(b),q=[];for(var ie in b)ie=="constructor"&&(B||!jt.call(b,ie))||q.push(ie);return q}function xs(b,B){return b<B}function so(b,B){var q=-1,ie=Mr(b)?Ke(b.length):[];return yn(b,function(de,Ae,Re){ie[++q]=B(de,Ae,Re)}),ie}function ao(b){var B=Us(b);return B.length==1&&B[0][2]?Fo(B[0][0],B[0][1]):function(q){return q===b||As(q,b,B)}}function oo(b,B){return Fs(b)&&Ho(B)?Fo(nn(b),B):function(q){var ie=Ys(q,b);return ie===a&&ie===B?Qs(q,b):ii(B,ie,U|Z)}}function Ti(b,B,q,ie,de){b!==B&&gs(B,function(Ae,Re){if(de||(de=new Yr),Xt(Ae))Cc(b,B,Re,q,Ti,ie,de);else{var Ce=ie?ie(zs(b,Re),Ae,Re+"",b,B,de):a;Ce===a&&(Ce=Ae),bs(b,Re,Ce)}},Or)}function Cc(b,B,q,ie,de,Ae,Re){var Ce=zs(b,q),Ue=zs(B,q),tt=Re.get(Ue);if(tt){bs(b,q,tt);return}var nt=Ae?Ae(Ce,Ue,q+"",b,B,Re):a,st=nt===a;if(st){var mt=Ot(Ue),xt=!mt&&Sn(Ue),Pt=!mt&&!xt&&Zn(Ue);nt=Ue,mt||xt||Pt?Ot(Ce)?nt=Ce:er(Ce)?nt=Tr(Ce):xt?(st=!1,nt=wo(Ue,!0)):Pt?(st=!1,nt=_o(Ue,!0)):nt=[]:ui(Ue)||Mn(Ue)?(nt=Ce,Mn(Ce)?nt=gf(Ce):(!Xt(Ce)||hn(Ce))&&(nt=Uo(Ue))):st=!1}st&&(Re.set(Ue,nt),de(nt,Ue,ie,Ae,Re),Re.delete(Ue)),bs(b,q,nt)}function fo(b,B){var q=b.length;if(q)return B+=B<0?q:0,cn(B,q)?b[B]:a}function uo(b,B,q){B.length?B=Gt(B,function(Ae){return Ot(Ae)?function(Re){return Pn(Re,Ae.length===1?Ae[0]:Ae)}:Ae}):B=[Cr];var ie=-1;B=Gt(B,Dr(It()));var de=so(b,function(Ae,Re,Ce){var Ue=Gt(B,function(tt){return tt(Ae)});return{criteria:Ue,index:++ie,value:Ae}});return au(de,function(Ae,Re){return Vc(Ae,Re,q)})}function Nc(b,B){return co(b,B,function(q,ie){return Qs(b,ie)})}function co(b,B,q){for(var ie=-1,de=B.length,Ae={};++ie<de;){var Re=B[ie],Ce=Pn(b,Re);q(Ce,Re)&&si(Ae,_n(Re,b),Ce)}return Ae}function kc(b){return function(B){return Pn(B,b)}}function Es(b,B,q,ie){var de=ie?su:Nn,Ae=-1,Re=B.length,Ce=b;for(b===B&&(B=Tr(B)),q&&(Ce=Gt(b,Dr(q)));++Ae<Re;)for(var Ue=0,tt=B[Ae],nt=q?q(tt):tt;(Ue=de(Ce,nt,Ue,ie))>-1;)Ce!==b&&_i.call(Ce,Ue,1),_i.call(b,Ue,1);return b}function ho(b,B){for(var q=b?B.length:0,ie=q-1;q--;){var de=B[q];if(q==ie||de!==Ae){var Ae=de;cn(de)?_i.call(b,de,1):Ps(b,de)}}return b}function $s(b,B){return b+xi(Ka()*(B-b+1))}function Dc(b,B,q,ie){for(var de=-1,Ae=fr(Si((B-b)/(q||1)),0),Re=Ke(Ae);Ae--;)Re[ie?Ae:++de]=b,b+=q;return Re}function Bs(b,B){var q="";if(!b||B<1||B>N)return q;do B%2&&(q+=b),B=xi(B/2),B&&(b+=b);while(B);return q}function Lt(b,B){return Ks(qo(b,B,Cr),b+"")}function Lc(b){return Ga(Vn(b))}function Uc(b,B){var q=Vn(b);return Fi(q,In(B,0,q.length))}function si(b,B,q,ie){if(!Xt(b))return b;B=_n(B,b);for(var de=-1,Ae=B.length,Re=Ae-1,Ce=b;Ce!=null&&++de<Ae;){var Ue=nn(B[de]),tt=q;if(Ue==="__proto__"||Ue==="constructor"||Ue==="prototype")return b;if(de!=Re){var nt=Ce[Ue];tt=ie?ie(nt,Ue,Ce):a,tt===a&&(tt=Xt(nt)?nt:cn(B[de+1])?[]:{})}ti(Ce,Ue,tt),Ce=Ce[Ue]}return b}var lo=Ei?function(b,B){return Ei.set(b,B),b}:Cr,Hc=Ai?function(b,B){return Ai(b,"toString",{configurable:!0,enumerable:!1,value:ta(B),writable:!0})}:Cr;function Fc(b){return Fi(Vn(b))}function Gr(b,B,q){var ie=-1,de=b.length;B<0&&(B=-B>de?0:de+B),q=q>de?de:q,q<0&&(q+=de),de=B>q?0:q-B>>>0,B>>>=0;for(var Ae=Ke(de);++ie<de;)Ae[ie]=b[ie+B];return Ae}function qc(b,B){var q;return yn(b,function(ie,de,Ae){return q=B(ie,de,Ae),!q}),!!q}function Mi(b,B,q){var ie=0,de=b==null?ie:b.length;if(typeof B=="number"&&B===B&&de<=Y){for(;ie<de;){var Ae=ie+de>>>1,Re=b[Ae];Re!==null&&!Ur(Re)&&(q?Re<=B:Re<B)?ie=Ae+1:de=Ae}return de}return Is(b,B,Cr,q)}function Is(b,B,q,ie){var de=0,Ae=b==null?0:b.length;if(Ae===0)return 0;B=q(B);for(var Re=B!==B,Ce=B===null,Ue=Ur(B),tt=B===a;de<Ae;){var nt=xi((de+Ae)/2),st=q(b[nt]),mt=st!==a,xt=st===null,Pt=st===st,Dt=Ur(st);if(Re)var Rt=ie||Pt;else tt?Rt=Pt&&(ie||mt):Ce?Rt=Pt&&mt&&(ie||!xt):Ue?Rt=Pt&&mt&&!xt&&(ie||!Dt):xt||Dt?Rt=!1:Rt=ie?st<=B:st<B;Rt?de=nt+1:Ae=nt}return Er(Ae,H)}function po(b,B){for(var q=-1,ie=b.length,de=0,Ae=[];++q<ie;){var Re=b[q],Ce=B?B(Re):Re;if(!q||!Qr(Ce,Ue)){var Ue=Ce;Ae[de++]=Re===0?0:Re}}return Ae}function vo(b){return typeof b=="number"?b:Ur(b)?A:+b}function Lr(b){if(typeof b=="string")return b;if(Ot(b))return Gt(b,Lr)+"";if(Ur(b))return Za?Za.call(b):"";var B=b+"";return B=="0"&&1/b==-L?"-0":B}function wn(b,B,q){var ie=-1,de=hi,Ae=b.length,Re=!0,Ce=[],Ue=Ce;if(q)Re=!1,de=ns;else if(Ae>=d){var tt=B?null:Qc(b);if(tt)return li(tt);Re=!1,de=Wn,Ue=new Bn}else Ue=B?[]:Ce;e:for(;++ie<Ae;){var nt=b[ie],st=B?B(nt):nt;if(nt=q||nt!==0?nt:0,Re&&st===st){for(var mt=Ue.length;mt--;)if(Ue[mt]===st)continue e;B&&Ue.push(st),Ce.push(nt)}else de(Ue,st,q)||(Ue!==Ce&&Ue.push(st),Ce.push(nt))}return Ce}function Ps(b,B){return B=_n(B,b),b=zo(b,B),b==null||delete b[nn(Wr(B))]}function bo(b,B,q,ie){return si(b,B,q(Pn(b,B)),ie)}function Oi(b,B,q,ie){for(var de=b.length,Ae=ie?de:-1;(ie?Ae--:++Ae<de)&&B(b[Ae],Ae,b););return q?Gr(b,ie?0:Ae,ie?Ae+1:de):Gr(b,ie?Ae+1:0,ie?de:Ae)}function mo(b,B){var q=b;return q instanceof Ht&&(q=q.value()),is(B,function(ie,de){return de.func.apply(de.thisArg,vn([ie],de.args))},q)}function Rs(b,B,q){var ie=b.length;if(ie<2)return ie?wn(b[0]):[];for(var de=-1,Ae=Ke(ie);++de<ie;)for(var Re=b[de],Ce=-1;++Ce<ie;)Ce!=de&&(Ae[de]=ri(Ae[de]||Re,b[Ce],B,q));return wn(xr(Ae,1),B,q)}function go(b,B,q){for(var ie=-1,de=b.length,Ae=B.length,Re={};++ie<de;){var Ce=ie<Ae?B[ie]:a;q(Re,b[ie],Ce)}return Re}function Ts(b){return er(b)?b:[]}function Ms(b){return typeof b=="function"?b:Cr}function _n(b,B){return Ot(b)?b:Fs(b,B)?[b]:Vo(zt(b))}var zc=Lt;function An(b,B,q){var ie=b.length;return q=q===a?ie:q,!B&&q>=ie?b:Gr(b,B,q)}var yo=Pu||function(b){return Sr.clearTimeout(b)};function wo(b,B){if(B)return b.slice();var q=b.length,ie=Ha?Ha(q):new b.constructor(q);return b.copy(ie),ie}function Os(b){var B=new b.constructor(b.byteLength);return new yi(B).set(new yi(b)),B}function jc(b,B){var q=B?Os(b.buffer):b.buffer;return new b.constructor(q,b.byteOffset,b.byteLength)}function Kc(b){var B=new b.constructor(b.source,Ct.exec(b));return B.lastIndex=b.lastIndex,B}function Zc(b){return ei?Kt(ei.call(b)):{}}function _o(b,B){var q=B?Os(b.buffer):b.buffer;return new b.constructor(q,b.byteOffset,b.length)}function Ao(b,B){if(b!==B){var q=b!==a,ie=b===null,de=b===b,Ae=Ur(b),Re=B!==a,Ce=B===null,Ue=B===B,tt=Ur(B);if(!Ce&&!tt&&!Ae&&b>B||Ae&&Re&&Ue&&!Ce&&!tt||ie&&Re&&Ue||!q&&Ue||!de)return 1;if(!ie&&!Ae&&!tt&&b<B||tt&&q&&de&&!ie&&!Ae||Ce&&q&&de||!Re&&de||!Ue)return-1}return 0}function Vc(b,B,q){for(var ie=-1,de=b.criteria,Ae=B.criteria,Re=de.length,Ce=q.length;++ie<Re;){var Ue=Ao(de[ie],Ae[ie]);if(Ue){if(ie>=Ce)return Ue;var tt=q[ie];return Ue*(tt=="desc"?-1:1)}}return b.index-B.index}function So(b,B,q,ie){for(var de=-1,Ae=b.length,Re=q.length,Ce=-1,Ue=B.length,tt=fr(Ae-Re,0),nt=Ke(Ue+tt),st=!ie;++Ce<Ue;)nt[Ce]=B[Ce];for(;++de<Re;)(st||de<Ae)&&(nt[q[de]]=b[de]);for(;tt--;)nt[Ce++]=b[de++];return nt}function xo(b,B,q,ie){for(var de=-1,Ae=b.length,Re=-1,Ce=q.length,Ue=-1,tt=B.length,nt=fr(Ae-Ce,0),st=Ke(nt+tt),mt=!ie;++de<nt;)st[de]=b[de];for(var xt=de;++Ue<tt;)st[xt+Ue]=B[Ue];for(;++Re<Ce;)(mt||de<Ae)&&(st[xt+q[Re]]=b[de++]);return st}function Tr(b,B){var q=-1,ie=b.length;for(B||(B=Ke(ie));++q<ie;)B[q]=b[q];return B}function rn(b,B,q,ie){var de=!q;q||(q={});for(var Ae=-1,Re=B.length;++Ae<Re;){var Ce=B[Ae],Ue=ie?ie(q[Ce],b[Ce],Ce,q,b):a;Ue===a&&(Ue=b[Ce]),de?on(q,Ce,Ue):ti(q,Ce,Ue)}return q}function Gc(b,B){return rn(b,Hs(b),B)}function Wc(b,B){return rn(b,Do(b),B)}function Ci(b,B){return function(q,ie){var de=Ot(q)?Qf:mc,Ae=B?B():{};return de(q,b,It(ie,2),Ae)}}function zn(b){return Lt(function(B,q){var ie=-1,de=q.length,Ae=de>1?q[de-1]:a,Re=de>2?q[2]:a;for(Ae=b.length>3&&typeof Ae=="function"?(de--,Ae):a,Re&&Ir(q[0],q[1],Re)&&(Ae=de<3?a:Ae,de=1),B=Kt(B);++ie<de;){var Ce=q[ie];Ce&&b(B,Ce,ie,Ae)}return B})}function Eo(b,B){return function(q,ie){if(q==null)return q;if(!Mr(q))return b(q,ie);for(var de=q.length,Ae=B?de:-1,Re=Kt(q);(B?Ae--:++Ae<de)&&ie(Re[Ae],Ae,Re)!==!1;);return q}}function $o(b){return function(B,q,ie){for(var de=-1,Ae=Kt(B),Re=ie(B),Ce=Re.length;Ce--;){var Ue=Re[b?Ce:++de];if(q(Ae[Ue],Ue,Ae)===!1)break}return B}}function Xc(b,B,q){var ie=B&J,de=ai(b);function Ae(){var Re=this&&this!==Sr&&this instanceof Ae?de:b;return Re.apply(ie?q:this,arguments)}return Ae}function Bo(b){return function(B){B=zt(B);var q=kn(B)?Jr(B):a,ie=q?q[0]:B.charAt(0),de=q?An(q,1).join(""):B.slice(1);return ie[b]()+de}}function jn(b){return function(B){return is($f(Ef(B).replace(Uf,"")),b,"")}}function ai(b){return function(){var B=arguments;switch(B.length){case 0:return new b;case 1:return new b(B[0]);case 2:return new b(B[0],B[1]);case 3:return new b(B[0],B[1],B[2]);case 4:return new b(B[0],B[1],B[2],B[3]);case 5:return new b(B[0],B[1],B[2],B[3],B[4]);case 6:return new b(B[0],B[1],B[2],B[3],B[4],B[5]);case 7:return new b(B[0],B[1],B[2],B[3],B[4],B[5],B[6])}var q=qn(b.prototype),ie=b.apply(q,B);return Xt(ie)?ie:q}}function Jc(b,B,q){var ie=ai(b);function de(){for(var Ae=arguments.length,Re=Ke(Ae),Ce=Ae,Ue=Kn(de);Ce--;)Re[Ce]=arguments[Ce];var tt=Ae<3&&Re[0]!==Ue&&Re[Ae-1]!==Ue?[]:mn(Re,Ue);if(Ae-=tt.length,Ae<q)return Mo(b,B,Ni,de.placeholder,a,Re,tt,a,a,q-Ae);var nt=this&&this!==Sr&&this instanceof de?ie:b;return kr(nt,this,Re)}return de}function Io(b){return function(B,q,ie){var de=Kt(B);if(!Mr(B)){var Ae=It(q,3);B=pr(B),q=function(Ce){return Ae(de[Ce],Ce,de)}}var Re=b(B,q,ie);return Re>-1?de[Ae?B[Re]:Re]:a}}function Po(b){return un(function(B){var q=B.length,ie=q,de=Zr.prototype.thru;for(b&&B.reverse();ie--;){var Ae=B[ie];if(typeof Ae!="function")throw new Kr(l);if(de&&!Re&&Ui(Ae)=="wrapper")var Re=new Zr([],!0)}for(ie=Re?ie:q;++ie<q;){Ae=B[ie];var Ce=Ui(Ae),Ue=Ce=="wrapper"?Ls(Ae):a;Ue&&qs(Ue[0])&&Ue[1]==(Ee|te|pe|V)&&!Ue[4].length&&Ue[9]==1?Re=Re[Ui(Ue[0])].apply(Re,Ue[3]):Re=Ae.length==1&&qs(Ae)?Re[Ce]():Re.thru(Ae)}return function(){var tt=arguments,nt=tt[0];if(Re&&tt.length==1&&Ot(nt))return Re.plant(nt).value();for(var st=0,mt=q?B[st].apply(this,tt):nt;++st<q;)mt=B[st].call(this,mt);return mt}})}function Ni(b,B,q,ie,de,Ae,Re,Ce,Ue,tt){var nt=B&Ee,st=B&J,mt=B&X,xt=B&(te|se),Pt=B&ae,Dt=mt?a:ai(b);function Rt(){for(var Ut=arguments.length,Ft=Ke(Ut),Hr=Ut;Hr--;)Ft[Hr]=arguments[Hr];if(xt)var Pr=Kn(Rt),Fr=fu(Ft,Pr);if(ie&&(Ft=So(Ft,ie,de,xt)),Ae&&(Ft=xo(Ft,Ae,Re,xt)),Ut-=Fr,xt&&Ut<tt){var tr=mn(Ft,Pr);return Mo(b,B,Ni,Rt.placeholder,q,Ft,tr,Ce,Ue,tt-Ut)}var en=st?q:this,ln=mt?en[b]:b;return Ut=Ft.length,Ce?Ft=_h(Ft,Ce):Pt&&Ut>1&&Ft.reverse(),nt&&Ue<Ut&&(Ft.length=Ue),this&&this!==Sr&&this instanceof Rt&&(ln=Dt||ai(ln)),ln.apply(en,Ft)}return Rt}function Ro(b,B){return function(q,ie){return Ec(q,b,B(ie),{})}}function ki(b,B){return function(q,ie){var de;if(q===a&&ie===a)return B;if(q!==a&&(de=q),ie!==a){if(de===a)return ie;typeof q=="string"||typeof ie=="string"?(q=Lr(q),ie=Lr(ie)):(q=vo(q),ie=vo(ie)),de=b(q,ie)}return de}}function Cs(b){return un(function(B){return B=Gt(B,Dr(It())),Lt(function(q){var ie=this;return b(B,function(de){return kr(de,ie,q)})})})}function Di(b,B){B=B===a?" ":Lr(B);var q=B.length;if(q<2)return q?Bs(B,b):B;var ie=Bs(B,Si(b/Dn(B)));return kn(B)?An(Jr(ie),0,b).join(""):ie.slice(0,b)}function Yc(b,B,q,ie){var de=B&J,Ae=ai(b);function Re(){for(var Ce=-1,Ue=arguments.length,tt=-1,nt=ie.length,st=Ke(nt+Ue),mt=this&&this!==Sr&&this instanceof Re?Ae:b;++tt<nt;)st[tt]=ie[tt];for(;Ue--;)st[tt++]=arguments[++Ce];return kr(mt,de?q:this,st)}return Re}function To(b){return function(B,q,ie){return ie&&typeof ie!="number"&&Ir(B,q,ie)&&(q=ie=a),B=dn(B),q===a?(q=B,B=0):q=dn(q),ie=ie===a?B<q?1:-1:dn(ie),Dc(B,q,ie,b)}}function Li(b){return function(B,q){return typeof B=="string"&&typeof q=="string"||(B=Xr(B),q=Xr(q)),b(B,q)}}function Mo(b,B,q,ie,de,Ae,Re,Ce,Ue,tt){var nt=B&te,st=nt?Re:a,mt=nt?a:Re,xt=nt?Ae:a,Pt=nt?a:Ae;B|=nt?pe:me,B&=~(nt?me:pe),B&Q||(B&=~(J|X));var Dt=[b,B,de,xt,st,Pt,mt,Ce,Ue,tt],Rt=q.apply(a,Dt);return qs(b)&&jo(Rt,Dt),Rt.placeholder=ie,Ko(Rt,b,B)}function Ns(b){var B=or[b];return function(q,ie){if(q=Xr(q),ie=ie==null?0:Er(kt(ie),292),ie&&ja(q)){var de=(zt(q)+"e").split("e"),Ae=B(de[0]+"e"+(+de[1]+ie));return de=(zt(Ae)+"e").split("e"),+(de[0]+"e"+(+de[1]-ie))}return B(q)}}var Qc=Hn&&1/li(new Hn([,-0]))[1]==L?function(b){return new Hn(b)}:ia;function Oo(b){return function(B){var q=$r(B);return q==ke?hs(B):q==et?vu(B):ou(B,b(B))}}function fn(b,B,q,ie,de,Ae,Re,Ce){var Ue=B&X;if(!Ue&&typeof b!="function")throw new Kr(l);var tt=ie?ie.length:0;if(tt||(B&=~(pe|me),ie=de=a),Re=Re===a?Re:fr(kt(Re),0),Ce=Ce===a?Ce:kt(Ce),tt-=de?de.length:0,B&me){var nt=ie,st=de;ie=de=a}var mt=Ue?a:Ls(b),xt=[b,B,q,ie,de,nt,st,Ae,Re,Ce];if(mt&&gh(xt,mt),b=xt[0],B=xt[1],q=xt[2],ie=xt[3],de=xt[4],Ce=xt[9]=xt[9]===a?Ue?0:b.length:fr(xt[9]-tt,0),!Ce&&B&(te|se)&&(B&=~(te|se)),!B||B==J)var Pt=Xc(b,B,q);else B==te||B==se?Pt=Jc(b,B,Ce):(B==pe||B==(J|pe))&&!de.length?Pt=Yc(b,B,q,ie):Pt=Ni.apply(a,xt);var Dt=mt?lo:jo;return Ko(Dt(Pt,xt),b,B)}function Co(b,B,q,ie){return b===a||Qr(b,Un[q])&&!jt.call(ie,q)?B:b}function No(b,B,q,ie,de,Ae){return Xt(b)&&Xt(B)&&(Ae.set(B,b),Ti(b,B,a,No,Ae),Ae.delete(B)),b}function eh(b){return ui(b)?a:b}function ko(b,B,q,ie,de,Ae){var Re=q&U,Ce=b.length,Ue=B.length;if(Ce!=Ue&&!(Re&&Ue>Ce))return!1;var tt=Ae.get(b),nt=Ae.get(B);if(tt&&nt)return tt==B&&nt==b;var st=-1,mt=!0,xt=q&Z?new Bn:a;for(Ae.set(b,B),Ae.set(B,b);++st<Ce;){var Pt=b[st],Dt=B[st];if(ie)var Rt=Re?ie(Dt,Pt,st,B,b,Ae):ie(Pt,Dt,st,b,B,Ae);if(Rt!==a){if(Rt)continue;mt=!1;break}if(xt){if(!ss(B,function(Ut,Ft){if(!Wn(xt,Ft)&&(Pt===Ut||de(Pt,Ut,q,ie,Ae)))return xt.push(Ft)})){mt=!1;break}}else if(!(Pt===Dt||de(Pt,Dt,q,ie,Ae))){mt=!1;break}}return Ae.delete(b),Ae.delete(B),mt}function th(b,B,q,ie,de,Ae,Re){switch(q){case Ge:if(b.byteLength!=B.byteLength||b.byteOffset!=B.byteOffset)return!1;b=b.buffer,B=B.buffer;case ze:return!(b.byteLength!=B.byteLength||!Ae(new yi(b),new yi(B)));case ve:case ge:case He:return Qr(+b,+B);case ue:return b.name==B.name&&b.message==B.message;case wt:case At:return b==B+"";case ke:var Ce=hs;case et:var Ue=ie&U;if(Ce||(Ce=li),b.size!=B.size&&!Ue)return!1;var tt=Re.get(b);if(tt)return tt==B;ie|=Z,Re.set(b,B);var nt=ko(Ce(b),Ce(B),ie,de,Ae,Re);return Re.delete(b),nt;case gt:if(ei)return ei.call(b)==ei.call(B)}return!1}function nh(b,B,q,ie,de,Ae){var Re=q&U,Ce=ks(b),Ue=Ce.length,tt=ks(B),nt=tt.length;if(Ue!=nt&&!Re)return!1;for(var st=Ue;st--;){var mt=Ce[st];if(!(Re?mt in B:jt.call(B,mt)))return!1}var xt=Ae.get(b),Pt=Ae.get(B);if(xt&&Pt)return xt==B&&Pt==b;var Dt=!0;Ae.set(b,B),Ae.set(B,b);for(var Rt=Re;++st<Ue;){mt=Ce[st];var Ut=b[mt],Ft=B[mt];if(ie)var Hr=Re?ie(Ft,Ut,mt,B,b,Ae):ie(Ut,Ft,mt,b,B,Ae);if(!(Hr===a?Ut===Ft||de(Ut,Ft,q,ie,Ae):Hr)){Dt=!1;break}Rt||(Rt=mt=="constructor")}if(Dt&&!Rt){var Pr=b.constructor,Fr=B.constructor;Pr!=Fr&&"constructor"in b&&"constructor"in B&&!(typeof Pr=="function"&&Pr instanceof Pr&&typeof Fr=="function"&&Fr instanceof Fr)&&(Dt=!1)}return Ae.delete(b),Ae.delete(B),Dt}function un(b){return Ks(qo(b,a,Jo),b+"")}function ks(b){return to(b,pr,Hs)}function Ds(b){return to(b,Or,Do)}var Ls=Ei?function(b){return Ei.get(b)}:ia;function Ui(b){for(var B=b.name+"",q=Fn[B],ie=jt.call(Fn,B)?q.length:0;ie--;){var de=q[ie],Ae=de.func;if(Ae==null||Ae==b)return de.name}return B}function Kn(b){var B=jt.call(we,"placeholder")?we:b;return B.placeholder}function It(){var b=we.iteratee||ra;return b=b===ra?io:b,arguments.length?b(arguments[0],arguments[1]):b}function Hi(b,B){var q=b.__data__;return ph(B)?q[typeof B=="string"?"string":"hash"]:q.map}function Us(b){for(var B=pr(b),q=B.length;q--;){var ie=B[q],de=b[ie];B[q]=[ie,de,Ho(de)]}return B}function Rn(b,B){var q=du(b,B);return no(q)?q:a}function ih(b){var B=jt.call(b,En),q=b[En];try{b[En]=a;var ie=!0}catch{}var de=mi.call(b);return ie&&(B?b[En]=q:delete b[En]),de}var Hs=ls?function(b){return b==null?[]:(b=Kt(b),pn(ls(b),function(B){return qa.call(b,B)}))}:sa,Do=ls?function(b){for(var B=[];b;)vn(B,Hs(b)),b=wi(b);return B}:sa,$r=Br;(ps&&$r(new ps(new ArrayBuffer(1)))!=Ge||Jn&&$r(new Jn)!=ke||vs&&$r(vs.resolve())!=rt||Hn&&$r(new Hn)!=et||Yn&&$r(new Yn)!=Me)&&($r=function(b){var B=Br(b),q=B==it?b.constructor:a,ie=q?Tn(q):"";if(ie)switch(ie){case Lu:return Ge;case Uu:return ke;case Hu:return rt;case Fu:return et;case qu:return Me}return B});function ah(b,B,q){for(var ie=-1,de=q.length;++ie<de;){var Ae=q[ie],Re=Ae.size;switch(Ae.type){case"drop":b+=Re;break;case"dropRight":B-=Re;break;case"take":B=Er(B,b+Re);break;case"takeRight":b=fr(b,B-Re);break}}return{start:b,end:B}}function oh(b){var B=b.match(pt);return B?B[1].split(Ye):[]}function Lo(b,B,q){B=_n(B,b);for(var ie=-1,de=B.length,Ae=!1;++ie<de;){var Re=nn(B[ie]);if(!(Ae=b!=null&&q(b,Re)))break;b=b[Re]}return Ae||++ie!=de?Ae:(de=b==null?0:b.length,!!de&&Vi(de)&&cn(Re,de)&&(Ot(b)||Mn(b)))}function fh(b){var B=b.length,q=new b.constructor(B);return B&&typeof b[0]=="string"&&jt.call(b,"index")&&(q.index=b.index,q.input=b.input),q}function Uo(b){return typeof b.constructor=="function"&&!oi(b)?qn(wi(b)):{}}function uh(b,B,q){var ie=b.constructor;switch(B){case ze:return Os(b);case ve:case ge:return new ie(+b);case Ge:return jc(b,q);case ht:case oe:case ee:case re:case be:case Pe:case Ne:case Oe:case ut:return _o(b,q);case ke:return new ie;case He:case At:return new ie(b);case wt:return Kc(b);case et:return new ie;case gt:return Zc(b)}}function hh(b,B){var q=B.length;if(!q)return b;var ie=q-1;return B[ie]=(q>1?"& ":"")+B[ie],B=B.join(q>2?", ":" "),b.replace(dt,`{
47
+ /* [wrapped with `+B+`] */
48
+ `)}function lh(b){return Ot(b)||Mn(b)||!!(za&&b&&b[za])}function cn(b,B){var q=typeof b;return B=B??N,!!B&&(q=="number"||q!="symbol"&&ur.test(b))&&b>-1&&b%1==0&&b<B}function Ir(b,B,q){if(!Xt(q))return!1;var ie=typeof B;return(ie=="number"?Mr(q)&&cn(B,q.length):ie=="string"&&B in q)?Qr(q[B],b):!1}function Fs(b,B){if(Ot(b))return!1;var q=typeof b;return q=="number"||q=="symbol"||q=="boolean"||b==null||Ur(b)?!0:Le.test(b)||!Be.test(b)||B!=null&&b in Kt(B)}function ph(b){var B=typeof b;return B=="string"||B=="number"||B=="symbol"||B=="boolean"?b!=="__proto__":b===null}function qs(b){var B=Ui(b),q=we[B];if(typeof q!="function"||!(B in Ht.prototype))return!1;if(b===q)return!0;var ie=Ls(q);return!!ie&&b===ie[0]}function vh(b){return!!Ua&&Ua in b}var bh=vi?hn:aa;function oi(b){var B=b&&b.constructor,q=typeof B=="function"&&B.prototype||Un;return b===q}function Ho(b){return b===b&&!Xt(b)}function Fo(b,B){return function(q){return q==null?!1:q[b]===B&&(B!==a||b in Kt(q))}}function mh(b){var B=Ki(b,function(ie){return q.size===O&&q.clear(),ie}),q=B.cache;return B}function gh(b,B){var q=b[1],ie=B[1],de=q|ie,Ae=de<(J|X|Ee),Re=ie==Ee&&q==te||ie==Ee&&q==V&&b[7].length<=B[8]||ie==(Ee|V)&&B[7].length<=B[8]&&q==te;if(!(Ae||Re))return b;ie&J&&(b[2]=B[2],de|=q&J?0:Q);var Ce=B[3];if(Ce){var Ue=b[3];b[3]=Ue?So(Ue,Ce,B[4]):Ce,b[4]=Ue?mn(b[3],T):B[4]}return Ce=B[5],Ce&&(Ue=b[5],b[5]=Ue?xo(Ue,Ce,B[6]):Ce,b[6]=Ue?mn(b[5],T):B[6]),Ce=B[7],Ce&&(b[7]=Ce),ie&Ee&&(b[8]=b[8]==null?B[8]:Er(b[8],B[8])),b[9]==null&&(b[9]=B[9]),b[0]=B[0],b[1]=de,b}function yh(b){var B=[];if(b!=null)for(var q in Kt(b))B.push(q);return B}function wh(b){return mi.call(b)}function qo(b,B,q){return B=fr(B===a?b.length-1:B,0),function(){for(var ie=arguments,de=-1,Ae=fr(ie.length-B,0),Re=Ke(Ae);++de<Ae;)Re[de]=ie[B+de];de=-1;for(var Ce=Ke(B+1);++de<B;)Ce[de]=ie[de];return Ce[B]=q(Re),kr(b,this,Ce)}}function zo(b,B){return B.length<2?b:Pn(b,Gr(B,0,-1))}function _h(b,B){for(var q=b.length,ie=Er(B.length,q),de=Tr(b);ie--;){var Ae=B[ie];b[ie]=cn(Ae,q)?de[Ae]:a}return b}function zs(b,B){if(!(B==="constructor"&&typeof b[B]=="function")&&B!="__proto__")return b[B]}var jo=Zo(lo),fi=Tu||function(b,B){return Sr.setTimeout(b,B)},Ks=Zo(Hc);function Ko(b,B,q){var ie=B+"";return Ks(b,hh(ie,Ah(oh(ie),q)))}function Zo(b){var B=0,q=0;return function(){var ie=Nu(),de=S-(ie-q);if(q=ie,de>0){if(++B>=v)return arguments[0]}else B=0;return b.apply(a,arguments)}}function Fi(b,B){var q=-1,ie=b.length,de=ie-1;for(B=B===a?ie:B;++q<B;){var Ae=$s(q,de),Re=b[Ae];b[Ae]=b[q],b[q]=Re}return b.length=B,b}var Vo=mh(function(b){var B=[];return b.charCodeAt(0)===46&&B.push(""),b.replace(je,function(q,ie,de,Ae){B.push(de?Ae.replace(ct,"$1"):ie||q)}),B});function nn(b){if(typeof b=="string"||Ur(b))return b;var B=b+"";return B=="0"&&1/b==-L?"-0":B}function Tn(b){if(b!=null){try{return bi.call(b)}catch{}try{return b+""}catch{}}return""}function Ah(b,B){return jr(le,function(q){var ie="_."+q[0];B&q[1]&&!hi(b,ie)&&b.push(ie)}),b.sort()}function Go(b){if(b instanceof Ht)return b.clone();var B=new Zr(b.__wrapped__,b.__chain__);return B.__actions__=Tr(b.__actions__),B.__index__=b.__index__,B.__values__=b.__values__,B}function Sh(b,B,q){(q?Ir(b,B,q):B===a)?B=1:B=fr(kt(B),0);var ie=b==null?0:b.length;if(!ie||B<1)return[];for(var de=0,Ae=0,Re=Ke(Si(ie/B));de<ie;)Re[Ae++]=Gr(b,de,de+=B);return Re}function xh(b){for(var B=-1,q=b==null?0:b.length,ie=0,de=[];++B<q;){var Ae=b[B];Ae&&(de[ie++]=Ae)}return de}function Eh(){var b=arguments.length;if(!b)return[];for(var B=Ke(b-1),q=arguments[0],ie=b;ie--;)B[ie-1]=arguments[ie];return vn(Ot(q)?Tr(q):[q],xr(B,1))}var $h=Lt(function(b,B){return er(b)?ri(b,xr(B,1,er,!0)):[]}),Bh=Lt(function(b,B){var q=Wr(B);return er(q)&&(q=a),er(b)?ri(b,xr(B,1,er,!0),It(q,2)):[]}),Ih=Lt(function(b,B){var q=Wr(B);return er(q)&&(q=a),er(b)?ri(b,xr(B,1,er,!0),a,q):[]});function Ph(b,B,q){var ie=b==null?0:b.length;return ie?(B=q||B===a?1:kt(B),Gr(b,B<0?0:B,ie)):[]}function Rh(b,B,q){var ie=b==null?0:b.length;return ie?(B=q||B===a?1:kt(B),B=ie-B,Gr(b,0,B<0?0:B)):[]}function Th(b,B){return b&&b.length?Oi(b,It(B,3),!0,!0):[]}function Mh(b,B){return b&&b.length?Oi(b,It(B,3),!0):[]}function Oh(b,B,q,ie){var de=b==null?0:b.length;return de?(q&&typeof q!="number"&&Ir(b,B,q)&&(q=0,ie=de),_c(b,B,q,ie)):[]}function Wo(b,B,q){var ie=b==null?0:b.length;if(!ie)return-1;var de=q==null?0:kt(q);return de<0&&(de=fr(ie+de,0)),di(b,It(B,3),de)}function Xo(b,B,q){var ie=b==null?0:b.length;if(!ie)return-1;var de=ie-1;return q!==a&&(de=kt(q),de=q<0?fr(ie+de,0):Er(de,ie-1)),di(b,It(B,3),de,!0)}function Jo(b){var B=b==null?0:b.length;return B?xr(b,1):[]}function Nh(b){var B=b==null?0:b.length;return B?xr(b,L):[]}function kh(b,B){var q=b==null?0:b.length;return q?(B=B===a?1:kt(B),xr(b,B)):[]}function Dh(b){for(var B=-1,q=b==null?0:b.length,ie={};++B<q;){var de=b[B];ie[de[0]]=de[1]}return ie}function Yo(b){return b&&b.length?b[0]:a}function Lh(b,B,q){var ie=b==null?0:b.length;if(!ie)return-1;var de=q==null?0:kt(q);return de<0&&(de=fr(ie+de,0)),Nn(b,B,de)}function Uh(b){var B=b==null?0:b.length;return B?Gr(b,0,-1):[]}var Hh=Lt(function(b){var B=Gt(b,Ts);return B.length&&B[0]===b[0]?_s(B):[]}),Fh=Lt(function(b){var B=Wr(b),q=Gt(b,Ts);return B===Wr(q)?B=a:q.pop(),q.length&&q[0]===b[0]?_s(q,It(B,2)):[]}),qh=Lt(function(b){var B=Wr(b),q=Gt(b,Ts);return B=typeof B=="function"?B:a,B&&q.pop(),q.length&&q[0]===b[0]?_s(q,a,B):[]});function zh(b,B){return b==null?"":Ou.call(b,B)}function Wr(b){var B=b==null?0:b.length;return B?b[B-1]:a}function jh(b,B,q){var ie=b==null?0:b.length;if(!ie)return-1;var de=ie;return q!==a&&(de=kt(q),de=de<0?fr(ie+de,0):Er(de,ie-1)),B===B?mu(b,B,de):di(b,Ta,de,!0)}function Zh(b,B){return b&&b.length?fo(b,kt(B)):a}var Vh=Lt(Qo);function Qo(b,B){return b&&b.length&&B&&B.length?Es(b,B):b}function Gh(b,B,q){return b&&b.length&&B&&B.length?Es(b,B,It(q,2)):b}function Wh(b,B,q){return b&&b.length&&B&&B.length?Es(b,B,a,q):b}var Xh=un(function(b,B){var q=b==null?0:b.length,ie=ms(b,B);return ho(b,Gt(B,function(de){return cn(de,q)?+de:de}).sort(Ao)),ie});function Jh(b,B){var q=[];if(!(b&&b.length))return q;var ie=-1,de=[],Ae=b.length;for(B=It(B,3);++ie<Ae;){var Re=b[ie];B(Re,ie,b)&&(q.push(Re),de.push(ie))}return ho(b,de),q}function Zs(b){return b==null?b:Du.call(b)}function Yh(b,B,q){var ie=b==null?0:b.length;return ie?(q&&typeof q!="number"&&Ir(b,B,q)?(B=0,q=ie):(B=B==null?0:kt(B),q=q===a?ie:kt(q)),Gr(b,B,q)):[]}function Qh(b,B){return Mi(b,B)}function ed(b,B,q){return Is(b,B,It(q,2))}function td(b,B){var q=b==null?0:b.length;if(q){var ie=Mi(b,B);if(ie<q&&Qr(b[ie],B))return ie}return-1}function rd(b,B){return Mi(b,B,!0)}function nd(b,B,q){return Is(b,B,It(q,2),!0)}function id(b,B){var q=b==null?0:b.length;if(q){var ie=Mi(b,B,!0)-1;if(Qr(b[ie],B))return ie}return-1}function sd(b){return b&&b.length?po(b):[]}function ad(b,B){return b&&b.length?po(b,It(B,2)):[]}function od(b){var B=b==null?0:b.length;return B?Gr(b,1,B):[]}function fd(b,B,q){return b&&b.length?(B=q||B===a?1:kt(B),Gr(b,0,B<0?0:B)):[]}function ud(b,B,q){var ie=b==null?0:b.length;return ie?(B=q||B===a?1:kt(B),B=ie-B,Gr(b,B<0?0:B,ie)):[]}function cd(b,B){return b&&b.length?Oi(b,It(B,3),!1,!0):[]}function hd(b,B){return b&&b.length?Oi(b,It(B,3)):[]}var dd=Lt(function(b){return wn(xr(b,1,er,!0))}),ld=Lt(function(b){var B=Wr(b);return er(B)&&(B=a),wn(xr(b,1,er,!0),It(B,2))}),pd=Lt(function(b){var B=Wr(b);return B=typeof B=="function"?B:a,wn(xr(b,1,er,!0),a,B)});function vd(b){return b&&b.length?wn(b):[]}function bd(b,B){return b&&b.length?wn(b,It(B,2)):[]}function md(b,B){return B=typeof B=="function"?B:a,b&&b.length?wn(b,a,B):[]}function Vs(b){if(!(b&&b.length))return[];var B=0;return b=pn(b,function(q){if(er(q))return B=fr(q.length,B),!0}),us(B,function(q){return Gt(b,as(q))})}function ef(b,B){if(!(b&&b.length))return[];var q=Vs(b);return B==null?q:Gt(q,function(ie){return kr(B,a,ie)})}var gd=Lt(function(b,B){return er(b)?ri(b,B):[]}),yd=Lt(function(b){return Rs(pn(b,er))}),wd=Lt(function(b){var B=Wr(b);return er(B)&&(B=a),Rs(pn(b,er),It(B,2))}),_d=Lt(function(b){var B=Wr(b);return B=typeof B=="function"?B:a,Rs(pn(b,er),a,B)}),Ad=Lt(Vs);function Sd(b,B){return go(b||[],B||[],ti)}function xd(b,B){return go(b||[],B||[],si)}var Ed=Lt(function(b){var B=b.length,q=B>1?b[B-1]:a;return q=typeof q=="function"?(b.pop(),q):a,ef(b,q)});function tf(b){var B=we(b);return B.__chain__=!0,B}function $d(b,B){return B(b),b}function qi(b,B){return B(b)}var Bd=un(function(b){var B=b.length,q=B?b[0]:0,ie=this.__wrapped__,de=function(Ae){return ms(Ae,b)};return B>1||this.__actions__.length||!(ie instanceof Ht)||!cn(q)?this.thru(de):(ie=ie.slice(q,+q+(B?1:0)),ie.__actions__.push({func:qi,args:[de],thisArg:a}),new Zr(ie,this.__chain__).thru(function(Ae){return B&&!Ae.length&&Ae.push(a),Ae}))});function Id(){return tf(this)}function Pd(){return new Zr(this.value(),this.__chain__)}function Rd(){this.__values__===a&&(this.__values__=bf(this.value()));var b=this.__index__>=this.__values__.length,B=b?a:this.__values__[this.__index__++];return{done:b,value:B}}function Td(){return this}function Md(b){for(var B,q=this;q instanceof Bi;){var ie=Go(q);ie.__index__=0,ie.__values__=a,B?de.__wrapped__=ie:B=ie;var de=ie;q=q.__wrapped__}return de.__wrapped__=b,B}function Od(){var b=this.__wrapped__;if(b instanceof Ht){var B=b;return this.__actions__.length&&(B=new Ht(this)),B=B.reverse(),B.__actions__.push({func:qi,args:[Zs],thisArg:a}),new Zr(B,this.__chain__)}return this.thru(Zs)}function Cd(){return mo(this.__wrapped__,this.__actions__)}var Nd=Ci(function(b,B,q){jt.call(b,q)?++b[q]:on(b,q,1)});function kd(b,B,q){var ie=Ot(b)?Pa:wc;return q&&Ir(b,B,q)&&(B=a),ie(b,It(B,3))}function Dd(b,B){var q=Ot(b)?pn:Qa;return q(b,It(B,3))}var Ld=Io(Wo),Ud=Io(Xo);function Hd(b,B){return xr(zi(b,B),1)}function Fd(b,B){return xr(zi(b,B),L)}function qd(b,B,q){return q=q===a?1:kt(q),xr(zi(b,B),q)}function rf(b,B){var q=Ot(b)?jr:yn;return q(b,It(B,3))}function nf(b,B){var q=Ot(b)?eu:Ya;return q(b,It(B,3))}var zd=Ci(function(b,B,q){jt.call(b,q)?b[q].push(B):on(b,q,[B])});function jd(b,B,q,ie){b=Mr(b)?b:Vn(b),q=q&&!ie?kt(q):0;var de=b.length;return q<0&&(q=fr(de+q,0)),Gi(b)?q<=de&&b.indexOf(B,q)>-1:!!de&&Nn(b,B,q)>-1}var Kd=Lt(function(b,B,q){var ie=-1,de=typeof B=="function",Ae=Mr(b)?Ke(b.length):[];return yn(b,function(Re){Ae[++ie]=de?kr(B,Re,q):ni(Re,B,q)}),Ae}),Zd=Ci(function(b,B,q){on(b,q,B)});function zi(b,B){var q=Ot(b)?Gt:so;return q(b,It(B,3))}function Vd(b,B,q,ie){return b==null?[]:(Ot(B)||(B=B==null?[]:[B]),q=ie?a:q,Ot(q)||(q=q==null?[]:[q]),uo(b,B,q))}var Gd=Ci(function(b,B,q){b[q?0:1].push(B)},function(){return[[],[]]});function Wd(b,B,q){var ie=Ot(b)?is:Oa,de=arguments.length<3;return ie(b,It(B,4),q,de,yn)}function Xd(b,B,q){var ie=Ot(b)?tu:Oa,de=arguments.length<3;return ie(b,It(B,4),q,de,Ya)}function Jd(b,B){var q=Ot(b)?pn:Qa;return q(b,Zi(It(B,3)))}function Yd(b){var B=Ot(b)?Ga:Lc;return B(b)}function Qd(b,B,q){(q?Ir(b,B,q):B===a)?B=1:B=kt(B);var ie=Ot(b)?vc:Uc;return ie(b,B)}function el(b){var B=Ot(b)?bc:Fc;return B(b)}function tl(b){if(b==null)return 0;if(Mr(b))return Gi(b)?Dn(b):b.length;var B=$r(b);return B==ke||B==et?b.size:Ss(b).length}function rl(b,B,q){var ie=Ot(b)?ss:qc;return q&&Ir(b,B,q)&&(B=a),ie(b,It(B,3))}var nl=Lt(function(b,B){if(b==null)return[];var q=B.length;return q>1&&Ir(b,B[0],B[1])?B=[]:q>2&&Ir(B[0],B[1],B[2])&&(B=[B[0]]),uo(b,xr(B,1),[])}),ji=Ru||function(){return Sr.Date.now()};function il(b,B){if(typeof B!="function")throw new Kr(l);return b=kt(b),function(){if(--b<1)return B.apply(this,arguments)}}function sf(b,B,q){return B=q?a:B,B=b&&B==null?b.length:B,fn(b,Ee,a,a,a,a,B)}function af(b,B){var q;if(typeof B!="function")throw new Kr(l);return b=kt(b),function(){return--b>0&&(q=B.apply(this,arguments)),b<=1&&(B=a),q}}var Gs=Lt(function(b,B,q){var ie=J;if(q.length){var de=mn(q,Kn(Gs));ie|=pe}return fn(b,ie,B,q,de)}),of=Lt(function(b,B,q){var ie=J|X;if(q.length){var de=mn(q,Kn(of));ie|=pe}return fn(B,ie,b,q,de)});function ff(b,B,q){B=q?a:B;var ie=fn(b,te,a,a,a,a,a,B);return ie.placeholder=ff.placeholder,ie}function uf(b,B,q){B=q?a:B;var ie=fn(b,se,a,a,a,a,a,B);return ie.placeholder=uf.placeholder,ie}function cf(b,B,q){var ie,de,Ae,Re,Ce,Ue,tt=0,nt=!1,st=!1,mt=!0;if(typeof b!="function")throw new Kr(l);B=Xr(B)||0,Xt(q)&&(nt=!!q.leading,st="maxWait"in q,Ae=st?fr(Xr(q.maxWait)||0,B):Ae,mt="trailing"in q?!!q.trailing:mt);function xt(tr){var en=ie,ln=de;return ie=de=a,tt=tr,Re=b.apply(ln,en),Re}function Pt(tr){return tt=tr,Ce=fi(Ut,B),nt?xt(tr):Re}function Dt(tr){var en=tr-Ue,ln=tr-tt,Pf=B-en;return st?Er(Pf,Ae-ln):Pf}function Rt(tr){var en=tr-Ue,ln=tr-tt;return Ue===a||en>=B||en<0||st&&ln>=Ae}function Ut(){var tr=ji();if(Rt(tr))return Ft(tr);Ce=fi(Ut,Dt(tr))}function Ft(tr){return Ce=a,mt&&ie?xt(tr):(ie=de=a,Re)}function Hr(){Ce!==a&&yo(Ce),tt=0,ie=Ue=de=Ce=a}function Pr(){return Ce===a?Re:Ft(ji())}function Fr(){var tr=ji(),en=Rt(tr);if(ie=arguments,de=this,Ue=tr,en){if(Ce===a)return Pt(Ue);if(st)return yo(Ce),Ce=fi(Ut,B),xt(Ue)}return Ce===a&&(Ce=fi(Ut,B)),Re}return Fr.cancel=Hr,Fr.flush=Pr,Fr}var al=Lt(function(b,B){return Ja(b,1,B)}),ol=Lt(function(b,B,q){return Ja(b,Xr(B)||0,q)});function fl(b){return fn(b,ae)}function Ki(b,B){if(typeof b!="function"||B!=null&&typeof B!="function")throw new Kr(l);var q=function(){var ie=arguments,de=B?B.apply(this,ie):ie[0],Ae=q.cache;if(Ae.has(de))return Ae.get(de);var Re=b.apply(this,ie);return q.cache=Ae.set(de,Re)||Ae,Re};return q.cache=new(Ki.Cache||an),q}Ki.Cache=an;function Zi(b){if(typeof b!="function")throw new Kr(l);return function(){var B=arguments;switch(B.length){case 0:return!b.call(this);case 1:return!b.call(this,B[0]);case 2:return!b.call(this,B[0],B[1]);case 3:return!b.call(this,B[0],B[1],B[2])}return!b.apply(this,B)}}function ul(b){return af(2,b)}var cl=zc(function(b,B){B=B.length==1&&Ot(B[0])?Gt(B[0],Dr(It())):Gt(xr(B,1),Dr(It()));var q=B.length;return Lt(function(ie){for(var de=-1,Ae=Er(ie.length,q);++de<Ae;)ie[de]=B[de].call(this,ie[de]);return kr(b,this,ie)})}),Ws=Lt(function(b,B){var q=mn(B,Kn(Ws));return fn(b,pe,a,B,q)}),hf=Lt(function(b,B){var q=mn(B,Kn(hf));return fn(b,me,a,B,q)}),dl=un(function(b,B){return fn(b,V,a,a,a,B)});function ll(b,B){if(typeof b!="function")throw new Kr(l);return B=B===a?B:kt(B),Lt(b,B)}function pl(b,B){if(typeof b!="function")throw new Kr(l);return B=B==null?0:fr(kt(B),0),Lt(function(q){var ie=q[B],de=An(q,0,B);return ie&&vn(de,ie),kr(b,this,de)})}function vl(b,B,q){var ie=!0,de=!0;if(typeof b!="function")throw new Kr(l);return Xt(q)&&(ie="leading"in q?!!q.leading:ie,de="trailing"in q?!!q.trailing:de),cf(b,B,{leading:ie,maxWait:B,trailing:de})}function bl(b){return sf(b,1)}function ml(b,B){return Ws(Ms(B),b)}function gl(){if(!arguments.length)return[];var b=arguments[0];return Ot(b)?b:[b]}function yl(b){return Vr(b,F)}function wl(b,B){return B=typeof B=="function"?B:a,Vr(b,F,B)}function _l(b){return Vr(b,C|F)}function Al(b,B){return B=typeof B=="function"?B:a,Vr(b,C|F,B)}function Sl(b,B){return B==null||Xa(b,B,pr(B))}function Qr(b,B){return b===B||b!==b&&B!==B}var xl=Li(ws),El=Li(function(b,B){return b>=B}),Mn=ro(function(){return arguments}())?ro:function(b){return Yt(b)&&jt.call(b,"callee")&&!qa.call(b,"callee")},Ot=Ke.isArray,$l=Sa?Dr(Sa):$c;function Mr(b){return b!=null&&Vi(b.length)&&!hn(b)}function er(b){return Yt(b)&&Mr(b)}function Bl(b){return b===!0||b===!1||Yt(b)&&Br(b)==ve}var Sn=Mu||aa,Il=xa?Dr(xa):Bc;function Pl(b){return Yt(b)&&b.nodeType===1&&!ui(b)}function Rl(b){if(b==null)return!0;if(Mr(b)&&(Ot(b)||typeof b=="string"||typeof b.splice=="function"||Sn(b)||Zn(b)||Mn(b)))return!b.length;var B=$r(b);if(B==ke||B==et)return!b.size;if(oi(b))return!Ss(b).length;for(var q in b)if(jt.call(b,q))return!1;return!0}function Tl(b,B){return ii(b,B)}function Ml(b,B,q){q=typeof q=="function"?q:a;var ie=q?q(b,B):a;return ie===a?ii(b,B,a,q):!!ie}function Xs(b){if(!Yt(b))return!1;var B=Br(b);return B==ue||B==Ie||typeof b.message=="string"&&typeof b.name=="string"&&!ui(b)}function Ol(b){return typeof b=="number"&&ja(b)}function hn(b){if(!Xt(b))return!1;var B=Br(b);return B==ce||B==Te||B==fe||B==Fe}function df(b){return typeof b=="number"&&b==kt(b)}function Vi(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=N}function Xt(b){var B=typeof b;return b!=null&&(B=="object"||B=="function")}function Yt(b){return b!=null&&typeof b=="object"}var lf=Ea?Dr(Ea):Pc;function Cl(b,B){return b===B||As(b,B,Us(B))}function Nl(b,B,q){return q=typeof q=="function"?q:a,As(b,B,Us(B),q)}function kl(b){return pf(b)&&b!=+b}function Dl(b){if(bh(b))throw new Mt(c);return no(b)}function Ll(b){return b===null}function Ul(b){return b==null}function pf(b){return typeof b=="number"||Yt(b)&&Br(b)==He}function ui(b){if(!Yt(b)||Br(b)!=it)return!1;var B=wi(b);if(B===null)return!0;var q=jt.call(B,"constructor")&&B.constructor;return typeof q=="function"&&q instanceof q&&bi.call(q)==$u}var Js=$a?Dr($a):Rc;function Hl(b){return df(b)&&b>=-N&&b<=N}var vf=Ba?Dr(Ba):Tc;function Gi(b){return typeof b=="string"||!Ot(b)&&Yt(b)&&Br(b)==At}function Ur(b){return typeof b=="symbol"||Yt(b)&&Br(b)==gt}var Zn=Ia?Dr(Ia):Mc;function Fl(b){return b===a}function ql(b){return Yt(b)&&$r(b)==Me}function jl(b){return Yt(b)&&Br(b)==Ze}var Kl=Li(xs),Zl=Li(function(b,B){return b<=B});function bf(b){if(!b)return[];if(Mr(b))return Gi(b)?Jr(b):Tr(b);if(Xn&&b[Xn])return pu(b[Xn]());var B=$r(b),q=B==ke?hs:B==et?li:Vn;return q(b)}function dn(b){if(!b)return b===0?b:0;if(b=Xr(b),b===L||b===-L){var B=b<0?-1:1;return B*E}return b===b?b:0}function kt(b){var B=dn(b),q=B%1;return B===B?q?B-q:B:0}function mf(b){return b?In(kt(b),0,D):0}function Xr(b){if(typeof b=="number")return b;if(Ur(b))return A;if(Xt(b)){var B=typeof b.valueOf=="function"?b.valueOf():b;b=Xt(B)?B+"":B}if(typeof b!="string")return b===0?b:+b;b=Ca(b);var q=Jt.test(b);return q||Wt.test(b)?Jf(b.slice(2),q?2:8):Nt.test(b)?A:+b}function gf(b){return rn(b,Or(b))}function Vl(b){return b?In(kt(b),-N,N):b===0?b:0}function zt(b){return b==null?"":Lr(b)}var Gl=zn(function(b,B){if(oi(B)||Mr(B)){rn(B,pr(B),b);return}for(var q in B)jt.call(B,q)&&ti(b,q,B[q])}),yf=zn(function(b,B){rn(B,Or(B),b)}),Wi=zn(function(b,B,q,ie){rn(B,Or(B),b,ie)}),Wl=zn(function(b,B,q,ie){rn(B,pr(B),b,ie)}),Xl=un(ms);function Jl(b,B){var q=qn(b);return B==null?q:Wa(q,B)}var Yl=Lt(function(b,B){b=Kt(b);var q=-1,ie=B.length,de=ie>2?B[2]:a;for(de&&Ir(B[0],B[1],de)&&(ie=1);++q<ie;)for(var Ae=B[q],Re=Or(Ae),Ce=-1,Ue=Re.length;++Ce<Ue;){var tt=Re[Ce],nt=b[tt];(nt===a||Qr(nt,Un[tt])&&!jt.call(b,tt))&&(b[tt]=Ae[tt])}return b}),Ql=Lt(function(b){return b.push(a,No),kr(wf,a,b)});function e0(b,B){return Ra(b,It(B,3),tn)}function t0(b,B){return Ra(b,It(B,3),ys)}function r0(b,B){return b==null?b:gs(b,It(B,3),Or)}function n0(b,B){return b==null?b:eo(b,It(B,3),Or)}function i0(b,B){return b&&tn(b,It(B,3))}function s0(b,B){return b&&ys(b,It(B,3))}function a0(b){return b==null?[]:Ri(b,pr(b))}function o0(b){return b==null?[]:Ri(b,Or(b))}function Ys(b,B,q){var ie=b==null?a:Pn(b,B);return ie===a?q:ie}function f0(b,B){return b!=null&&Lo(b,B,Ac)}function Qs(b,B){return b!=null&&Lo(b,B,Sc)}var u0=Ro(function(b,B,q){B!=null&&typeof B.toString!="function"&&(B=mi.call(B)),b[B]=q},ta(Cr)),c0=Ro(function(b,B,q){B!=null&&typeof B.toString!="function"&&(B=mi.call(B)),jt.call(b,B)?b[B].push(q):b[B]=[q]},It),h0=Lt(ni);function pr(b){return Mr(b)?Va(b):Ss(b)}function Or(b){return Mr(b)?Va(b,!0):Oc(b)}function d0(b,B){var q={};return B=It(B,3),tn(b,function(ie,de,Ae){on(q,B(ie,de,Ae),ie)}),q}function l0(b,B){var q={};return B=It(B,3),tn(b,function(ie,de,Ae){on(q,de,B(ie,de,Ae))}),q}var p0=zn(function(b,B,q){Ti(b,B,q)}),wf=zn(function(b,B,q,ie){Ti(b,B,q,ie)}),v0=un(function(b,B){var q={};if(b==null)return q;var ie=!1;B=Gt(B,function(Ae){return Ae=_n(Ae,b),ie||(ie=Ae.length>1),Ae}),rn(b,Ds(b),q),ie&&(q=Vr(q,C|j|F,eh));for(var de=B.length;de--;)Ps(q,B[de]);return q});function b0(b,B){return _f(b,Zi(It(B)))}var m0=un(function(b,B){return b==null?{}:Nc(b,B)});function _f(b,B){if(b==null)return{};var q=Gt(Ds(b),function(ie){return[ie]});return B=It(B),co(b,q,function(ie,de){return B(ie,de[0])})}function g0(b,B,q){B=_n(B,b);var ie=-1,de=B.length;for(de||(de=1,b=a);++ie<de;){var Ae=b==null?a:b[nn(B[ie])];Ae===a&&(ie=de,Ae=q),b=hn(Ae)?Ae.call(b):Ae}return b}function y0(b,B,q){return b==null?b:si(b,B,q)}function w0(b,B,q,ie){return ie=typeof ie=="function"?ie:a,b==null?b:si(b,B,q,ie)}var Af=Oo(pr),Sf=Oo(Or);function _0(b,B,q){var ie=Ot(b),de=ie||Sn(b)||Zn(b);if(B=It(B,4),q==null){var Ae=b&&b.constructor;de?q=ie?new Ae:[]:Xt(b)?q=hn(Ae)?qn(wi(b)):{}:q={}}return(de?jr:tn)(b,function(Re,Ce,Ue){return B(q,Re,Ce,Ue)}),q}function A0(b,B){return b==null?!0:Ps(b,B)}function S0(b,B,q){return b==null?b:bo(b,B,Ms(q))}function x0(b,B,q,ie){return ie=typeof ie=="function"?ie:a,b==null?b:bo(b,B,Ms(q),ie)}function Vn(b){return b==null?[]:cs(b,pr(b))}function E0(b){return b==null?[]:cs(b,Or(b))}function $0(b,B,q){return q===a&&(q=B,B=a),q!==a&&(q=Xr(q),q=q===q?q:0),B!==a&&(B=Xr(B),B=B===B?B:0),In(Xr(b),B,q)}function B0(b,B,q){return B=dn(B),q===a?(q=B,B=0):q=dn(q),b=Xr(b),xc(b,B,q)}function I0(b,B,q){if(q&&typeof q!="boolean"&&Ir(b,B,q)&&(B=q=a),q===a&&(typeof B=="boolean"?(q=B,B=a):typeof b=="boolean"&&(q=b,b=a)),b===a&&B===a?(b=0,B=1):(b=dn(b),B===a?(B=b,b=0):B=dn(B)),b>B){var ie=b;b=B,B=ie}if(q||b%1||B%1){var de=Ka();return Er(b+de*(B-b+Xf("1e-"+((de+"").length-1))),B)}return $s(b,B)}var P0=jn(function(b,B,q){return B=B.toLowerCase(),b+(q?xf(B):B)});function xf(b){return ea(zt(b).toLowerCase())}function Ef(b){return b=zt(b),b&&b.replace(vr,uu).replace(Hf,"")}function R0(b,B,q){b=zt(b),B=Lr(B);var ie=b.length;q=q===a?ie:In(kt(q),0,ie);var de=q;return q-=B.length,q>=0&&b.slice(q,de)==B}function T0(b){return b=zt(b),b&&Bt.test(b)?b.replace(ot,cu):b}function M0(b){return b=zt(b),b&&Xe.test(b)?b.replace(qe,"\\$&"):b}var O0=jn(function(b,B,q){return b+(q?"-":"")+B.toLowerCase()}),C0=jn(function(b,B,q){return b+(q?" ":"")+B.toLowerCase()}),N0=Bo("toLowerCase");function k0(b,B,q){b=zt(b),B=kt(B);var ie=B?Dn(b):0;if(!B||ie>=B)return b;var de=(B-ie)/2;return Di(xi(de),q)+b+Di(Si(de),q)}function D0(b,B,q){b=zt(b),B=kt(B);var ie=B?Dn(b):0;return B&&ie<B?b+Di(B-ie,q):b}function L0(b,B,q){b=zt(b),B=kt(B);var ie=B?Dn(b):0;return B&&ie<B?Di(B-ie,q)+b:b}function U0(b,B,q){return q||B==null?B=0:B&&(B=+B),ku(zt(b).replace(at,""),B||0)}function H0(b,B,q){return(q?Ir(b,B,q):B===a)?B=1:B=kt(B),Bs(zt(b),B)}function F0(){var b=arguments,B=zt(b[0]);return b.length<3?B:B.replace(b[1],b[2])}var q0=jn(function(b,B,q){return b+(q?"_":"")+B.toLowerCase()});function z0(b,B,q){return q&&typeof q!="number"&&Ir(b,B,q)&&(B=q=a),q=q===a?D:q>>>0,q?(b=zt(b),b&&(typeof B=="string"||B!=null&&!Js(B))&&(B=Lr(B),!B&&kn(b))?An(Jr(b),0,q):b.split(B,q)):[]}var j0=jn(function(b,B,q){return b+(q?" ":"")+ea(B)});function K0(b,B,q){return b=zt(b),q=q==null?0:In(kt(q),0,b.length),B=Lr(B),b.slice(q,q+B.length)==B}function Z0(b,B,q){var ie=we.templateSettings;q&&Ir(b,B,q)&&(B=a),b=zt(b),B=Wi({},B,ie,Co);var de=Wi({},B.imports,ie.imports,Co),Ae=pr(de),Re=cs(de,Ae),Ce,Ue,tt=0,nt=B.interpolate||nr,st="__p += '",mt=ds((B.escape||nr).source+"|"+nt.source+"|"+(nt===xe?$t:nr).source+"|"+(B.evaluate||nr).source+"|$","g"),xt="//# sourceURL="+(jt.call(B,"sourceURL")?(B.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Kf+"]")+`
49
+ `;b.replace(mt,function(Rt,Ut,Ft,Hr,Pr,Fr){return Ft||(Ft=Hr),st+=b.slice(tt,Fr).replace(br,hu),Ut&&(Ce=!0,st+=`' +
50
+ __e(`+Ut+`) +
51
+ '`),Pr&&(Ue=!0,st+=`';
52
+ `+Pr+`;
53
+ __p += '`),Ft&&(st+=`' +
54
+ ((__t = (`+Ft+`)) == null ? '' : __t) +
55
+ '`),tt=Fr+Rt.length,Rt}),st+=`';
56
+ `;var Pt=jt.call(B,"variable")&&B.variable;if(!Pt)st=`with (obj) {
57
+ `+st+`
58
+ }
59
+ `;else if(yt.test(Pt))throw new Mt(m);st=(Ue?st.replace(lt,""):st).replace(Je,"$1").replace(bt,"$1;"),st="function("+(Pt||"obj")+`) {
60
+ `+(Pt?"":`obj || (obj = {});
61
+ `)+"var __t, __p = ''"+(Ce?", __e = _.escape":"")+(Ue?`, __j = Array.prototype.join;
62
+ function print() { __p += __j.call(arguments, '') }
63
+ `:`;
64
+ `)+st+`return __p
65
+ }`;var Dt=Bf(function(){return qt(Ae,xt+"return "+st).apply(a,Re)});if(Dt.source=st,Xs(Dt))throw Dt;return Dt}function V0(b){return zt(b).toLowerCase()}function G0(b){return zt(b).toUpperCase()}function W0(b,B,q){if(b=zt(b),b&&(q||B===a))return Ca(b);if(!b||!(B=Lr(B)))return b;var ie=Jr(b),de=Jr(B),Ae=Na(ie,de),Re=ka(ie,de)+1;return An(ie,Ae,Re).join("")}function X0(b,B,q){if(b=zt(b),b&&(q||B===a))return b.slice(0,La(b)+1);if(!b||!(B=Lr(B)))return b;var ie=Jr(b),de=ka(ie,Jr(B))+1;return An(ie,0,de).join("")}function J0(b,B,q){if(b=zt(b),b&&(q||B===a))return b.replace(at,"");if(!b||!(B=Lr(B)))return b;var ie=Jr(b),de=Na(ie,Jr(B));return An(ie,de).join("")}function Y0(b,B){var q=ne,ie=M;if(Xt(B)){var de="separator"in B?B.separator:de;q="length"in B?kt(B.length):q,ie="omission"in B?Lr(B.omission):ie}b=zt(b);var Ae=b.length;if(kn(b)){var Re=Jr(b);Ae=Re.length}if(q>=Ae)return b;var Ce=q-Dn(ie);if(Ce<1)return ie;var Ue=Re?An(Re,0,Ce).join(""):b.slice(0,Ce);if(de===a)return Ue+ie;if(Re&&(Ce+=Ue.length-Ce),Js(de)){if(b.slice(Ce).search(de)){var tt,nt=Ue;for(de.global||(de=ds(de.source,zt(Ct.exec(de))+"g")),de.lastIndex=0;tt=de.exec(nt);)var st=tt.index;Ue=Ue.slice(0,st===a?Ce:st)}}else if(b.indexOf(Lr(de),Ce)!=Ce){var mt=Ue.lastIndexOf(de);mt>-1&&(Ue=Ue.slice(0,mt))}return Ue+ie}function Q0(b){return b=zt(b),b&&Et.test(b)?b.replace(vt,gu):b}var ep=jn(function(b,B,q){return b+(q?" ":"")+B.toUpperCase()}),ea=Bo("toUpperCase");function $f(b,B,q){return b=zt(b),B=q?a:B,B===a?lu(b)?_u(b):iu(b):b.match(B)||[]}var Bf=Lt(function(b,B){try{return kr(b,a,B)}catch(q){return Xs(q)?q:new Mt(q)}}),tp=un(function(b,B){return jr(B,function(q){q=nn(q),on(b,q,Gs(b[q],b))}),b});function rp(b){var B=b==null?0:b.length,q=It();return b=B?Gt(b,function(ie){if(typeof ie[1]!="function")throw new Kr(l);return[q(ie[0]),ie[1]]}):[],Lt(function(ie){for(var de=-1;++de<B;){var Ae=b[de];if(kr(Ae[0],this,ie))return kr(Ae[1],this,ie)}})}function np(b){return yc(Vr(b,C))}function ta(b){return function(){return b}}function ip(b,B){return b==null||b!==b?B:b}var sp=Po(),ap=Po(!0);function Cr(b){return b}function ra(b){return io(typeof b=="function"?b:Vr(b,C))}function op(b){return ao(Vr(b,C))}function fp(b,B){return oo(b,Vr(B,C))}var up=Lt(function(b,B){return function(q){return ni(q,b,B)}}),cp=Lt(function(b,B){return function(q){return ni(b,q,B)}});function na(b,B,q){var ie=pr(B),de=Ri(B,ie);q==null&&!(Xt(B)&&(de.length||!ie.length))&&(q=B,B=b,b=this,de=Ri(B,pr(B)));var Ae=!(Xt(q)&&"chain"in q)||!!q.chain,Re=hn(b);return jr(de,function(Ce){var Ue=B[Ce];b[Ce]=Ue,Re&&(b.prototype[Ce]=function(){var tt=this.__chain__;if(Ae||tt){var nt=b(this.__wrapped__),st=nt.__actions__=Tr(this.__actions__);return st.push({func:Ue,args:arguments,thisArg:b}),nt.__chain__=tt,nt}return Ue.apply(b,vn([this.value()],arguments))})}),b}function hp(){return Sr._===this&&(Sr._=Bu),this}function ia(){}function dp(b){return b=kt(b),Lt(function(B){return fo(B,b)})}var lp=Cs(Gt),pp=Cs(Pa),vp=Cs(ss);function If(b){return Fs(b)?as(nn(b)):kc(b)}function bp(b){return function(B){return b==null?a:Pn(b,B)}}var mp=To(),gp=To(!0);function sa(){return[]}function aa(){return!1}function yp(){return{}}function wp(){return""}function _p(){return!0}function Ap(b,B){if(b=kt(b),b<1||b>N)return[];var q=D,ie=Er(b,D);B=It(B),b-=D;for(var de=us(ie,B);++q<b;)B(q);return de}function Sp(b){return Ot(b)?Gt(b,nn):Ur(b)?[b]:Tr(Vo(zt(b)))}function xp(b){var B=++Eu;return zt(b)+B}var Ep=ki(function(b,B){return b+B},0),$p=Ns("ceil"),Bp=ki(function(b,B){return b/B},1),Ip=Ns("floor");function Pp(b){return b&&b.length?Pi(b,Cr,ws):a}function Rp(b,B){return b&&b.length?Pi(b,It(B,2),ws):a}function Tp(b){return Ma(b,Cr)}function Mp(b,B){return Ma(b,It(B,2))}function Op(b){return b&&b.length?Pi(b,Cr,xs):a}function Cp(b,B){return b&&b.length?Pi(b,It(B,2),xs):a}var Np=ki(function(b,B){return b*B},1),kp=Ns("round"),Dp=ki(function(b,B){return b-B},0);function Lp(b){return b&&b.length?fs(b,Cr):0}function Up(b,B){return b&&b.length?fs(b,It(B,2)):0}return we.after=il,we.ary=sf,we.assign=Gl,we.assignIn=yf,we.assignInWith=Wi,we.assignWith=Wl,we.at=Xl,we.before=af,we.bind=Gs,we.bindAll=tp,we.bindKey=of,we.castArray=gl,we.chain=tf,we.chunk=Sh,we.compact=xh,we.concat=Eh,we.cond=rp,we.conforms=np,we.constant=ta,we.countBy=Nd,we.create=Jl,we.curry=ff,we.curryRight=uf,we.debounce=cf,we.defaults=Yl,we.defaultsDeep=Ql,we.defer=al,we.delay=ol,we.difference=$h,we.differenceBy=Bh,we.differenceWith=Ih,we.drop=Ph,we.dropRight=Rh,we.dropRightWhile=Th,we.dropWhile=Mh,we.fill=Oh,we.filter=Dd,we.flatMap=Hd,we.flatMapDeep=Fd,we.flatMapDepth=qd,we.flatten=Jo,we.flattenDeep=Nh,we.flattenDepth=kh,we.flip=fl,we.flow=sp,we.flowRight=ap,we.fromPairs=Dh,we.functions=a0,we.functionsIn=o0,we.groupBy=zd,we.initial=Uh,we.intersection=Hh,we.intersectionBy=Fh,we.intersectionWith=qh,we.invert=u0,we.invertBy=c0,we.invokeMap=Kd,we.iteratee=ra,we.keyBy=Zd,we.keys=pr,we.keysIn=Or,we.map=zi,we.mapKeys=d0,we.mapValues=l0,we.matches=op,we.matchesProperty=fp,we.memoize=Ki,we.merge=p0,we.mergeWith=wf,we.method=up,we.methodOf=cp,we.mixin=na,we.negate=Zi,we.nthArg=dp,we.omit=v0,we.omitBy=b0,we.once=ul,we.orderBy=Vd,we.over=lp,we.overArgs=cl,we.overEvery=pp,we.overSome=vp,we.partial=Ws,we.partialRight=hf,we.partition=Gd,we.pick=m0,we.pickBy=_f,we.property=If,we.propertyOf=bp,we.pull=Vh,we.pullAll=Qo,we.pullAllBy=Gh,we.pullAllWith=Wh,we.pullAt=Xh,we.range=mp,we.rangeRight=gp,we.rearg=dl,we.reject=Jd,we.remove=Jh,we.rest=ll,we.reverse=Zs,we.sampleSize=Qd,we.set=y0,we.setWith=w0,we.shuffle=el,we.slice=Yh,we.sortBy=nl,we.sortedUniq=sd,we.sortedUniqBy=ad,we.split=z0,we.spread=pl,we.tail=od,we.take=fd,we.takeRight=ud,we.takeRightWhile=cd,we.takeWhile=hd,we.tap=$d,we.throttle=vl,we.thru=qi,we.toArray=bf,we.toPairs=Af,we.toPairsIn=Sf,we.toPath=Sp,we.toPlainObject=gf,we.transform=_0,we.unary=bl,we.union=dd,we.unionBy=ld,we.unionWith=pd,we.uniq=vd,we.uniqBy=bd,we.uniqWith=md,we.unset=A0,we.unzip=Vs,we.unzipWith=ef,we.update=S0,we.updateWith=x0,we.values=Vn,we.valuesIn=E0,we.without=gd,we.words=$f,we.wrap=ml,we.xor=yd,we.xorBy=wd,we.xorWith=_d,we.zip=Ad,we.zipObject=Sd,we.zipObjectDeep=xd,we.zipWith=Ed,we.entries=Af,we.entriesIn=Sf,we.extend=yf,we.extendWith=Wi,na(we,we),we.add=Ep,we.attempt=Bf,we.camelCase=P0,we.capitalize=xf,we.ceil=$p,we.clamp=$0,we.clone=yl,we.cloneDeep=_l,we.cloneDeepWith=Al,we.cloneWith=wl,we.conformsTo=Sl,we.deburr=Ef,we.defaultTo=ip,we.divide=Bp,we.endsWith=R0,we.eq=Qr,we.escape=T0,we.escapeRegExp=M0,we.every=kd,we.find=Ld,we.findIndex=Wo,we.findKey=e0,we.findLast=Ud,we.findLastIndex=Xo,we.findLastKey=t0,we.floor=Ip,we.forEach=rf,we.forEachRight=nf,we.forIn=r0,we.forInRight=n0,we.forOwn=i0,we.forOwnRight=s0,we.get=Ys,we.gt=xl,we.gte=El,we.has=f0,we.hasIn=Qs,we.head=Yo,we.identity=Cr,we.includes=jd,we.indexOf=Lh,we.inRange=B0,we.invoke=h0,we.isArguments=Mn,we.isArray=Ot,we.isArrayBuffer=$l,we.isArrayLike=Mr,we.isArrayLikeObject=er,we.isBoolean=Bl,we.isBuffer=Sn,we.isDate=Il,we.isElement=Pl,we.isEmpty=Rl,we.isEqual=Tl,we.isEqualWith=Ml,we.isError=Xs,we.isFinite=Ol,we.isFunction=hn,we.isInteger=df,we.isLength=Vi,we.isMap=lf,we.isMatch=Cl,we.isMatchWith=Nl,we.isNaN=kl,we.isNative=Dl,we.isNil=Ul,we.isNull=Ll,we.isNumber=pf,we.isObject=Xt,we.isObjectLike=Yt,we.isPlainObject=ui,we.isRegExp=Js,we.isSafeInteger=Hl,we.isSet=vf,we.isString=Gi,we.isSymbol=Ur,we.isTypedArray=Zn,we.isUndefined=Fl,we.isWeakMap=ql,we.isWeakSet=jl,we.join=zh,we.kebabCase=O0,we.last=Wr,we.lastIndexOf=jh,we.lowerCase=C0,we.lowerFirst=N0,we.lt=Kl,we.lte=Zl,we.max=Pp,we.maxBy=Rp,we.mean=Tp,we.meanBy=Mp,we.min=Op,we.minBy=Cp,we.stubArray=sa,we.stubFalse=aa,we.stubObject=yp,we.stubString=wp,we.stubTrue=_p,we.multiply=Np,we.nth=Zh,we.noConflict=hp,we.noop=ia,we.now=ji,we.pad=k0,we.padEnd=D0,we.padStart=L0,we.parseInt=U0,we.random=I0,we.reduce=Wd,we.reduceRight=Xd,we.repeat=H0,we.replace=F0,we.result=g0,we.round=kp,we.runInContext=De,we.sample=Yd,we.size=tl,we.snakeCase=q0,we.some=rl,we.sortedIndex=Qh,we.sortedIndexBy=ed,we.sortedIndexOf=td,we.sortedLastIndex=rd,we.sortedLastIndexBy=nd,we.sortedLastIndexOf=id,we.startCase=j0,we.startsWith=K0,we.subtract=Dp,we.sum=Lp,we.sumBy=Up,we.template=Z0,we.times=Ap,we.toFinite=dn,we.toInteger=kt,we.toLength=mf,we.toLower=V0,we.toNumber=Xr,we.toSafeInteger=Vl,we.toString=zt,we.toUpper=G0,we.trim=W0,we.trimEnd=X0,we.trimStart=J0,we.truncate=Y0,we.unescape=Q0,we.uniqueId=xp,we.upperCase=ep,we.upperFirst=ea,we.each=rf,we.eachRight=nf,we.first=Yo,na(we,function(){var b={};return tn(we,function(B,q){jt.call(we.prototype,q)||(b[q]=B)}),b}(),{chain:!1}),we.VERSION=u,jr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(b){we[b].placeholder=we}),jr(["drop","take"],function(b,B){Ht.prototype[b]=function(q){q=q===a?1:fr(kt(q),0);var ie=this.__filtered__&&!B?new Ht(this):this.clone();return ie.__filtered__?ie.__takeCount__=Er(q,ie.__takeCount__):ie.__views__.push({size:Er(q,D),type:b+(ie.__dir__<0?"Right":"")}),ie},Ht.prototype[b+"Right"]=function(q){return this.reverse()[b](q).reverse()}}),jr(["filter","map","takeWhile"],function(b,B){var q=B+1,ie=q==y||q==P;Ht.prototype[b]=function(de){var Ae=this.clone();return Ae.__iteratees__.push({iteratee:It(de,3),type:q}),Ae.__filtered__=Ae.__filtered__||ie,Ae}}),jr(["head","last"],function(b,B){var q="take"+(B?"Right":"");Ht.prototype[b]=function(){return this[q](1).value()[0]}}),jr(["initial","tail"],function(b,B){var q="drop"+(B?"":"Right");Ht.prototype[b]=function(){return this.__filtered__?new Ht(this):this[q](1)}}),Ht.prototype.compact=function(){return this.filter(Cr)},Ht.prototype.find=function(b){return this.filter(b).head()},Ht.prototype.findLast=function(b){return this.reverse().find(b)},Ht.prototype.invokeMap=Lt(function(b,B){return typeof b=="function"?new Ht(this):this.map(function(q){return ni(q,b,B)})}),Ht.prototype.reject=function(b){return this.filter(Zi(It(b)))},Ht.prototype.slice=function(b,B){b=kt(b);var q=this;return q.__filtered__&&(b>0||B<0)?new Ht(q):(b<0?q=q.takeRight(-b):b&&(q=q.drop(b)),B!==a&&(B=kt(B),q=B<0?q.dropRight(-B):q.take(B-b)),q)},Ht.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},Ht.prototype.toArray=function(){return this.take(D)},tn(Ht.prototype,function(b,B){var q=/^(?:filter|find|map|reject)|While$/.test(B),ie=/^(?:head|last)$/.test(B),de=we[ie?"take"+(B=="last"?"Right":""):B],Ae=ie||/^find/.test(B);de&&(we.prototype[B]=function(){var Re=this.__wrapped__,Ce=ie?[1]:arguments,Ue=Re instanceof Ht,tt=Ce[0],nt=Ue||Ot(Re),st=function(Ut){var Ft=de.apply(we,vn([Ut],Ce));return ie&&mt?Ft[0]:Ft};nt&&q&&typeof tt=="function"&&tt.length!=1&&(Ue=nt=!1);var mt=this.__chain__,xt=!!this.__actions__.length,Pt=Ae&&!mt,Dt=Ue&&!xt;if(!Ae&&nt){Re=Dt?Re:new Ht(this);var Rt=b.apply(Re,Ce);return Rt.__actions__.push({func:qi,args:[st],thisArg:a}),new Zr(Rt,mt)}return Pt&&Dt?b.apply(this,Ce):(Rt=this.thru(st),Pt?ie?Rt.value()[0]:Rt.value():Rt)})}),jr(["pop","push","shift","sort","splice","unshift"],function(b){var B=pi[b],q=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",ie=/^(?:pop|shift)$/.test(b);we.prototype[b]=function(){var de=arguments;if(ie&&!this.__chain__){var Ae=this.value();return B.apply(Ot(Ae)?Ae:[],de)}return this[q](function(Re){return B.apply(Ot(Re)?Re:[],de)})}}),tn(Ht.prototype,function(b,B){var q=we[B];if(q){var ie=q.name+"";jt.call(Fn,ie)||(Fn[ie]=[]),Fn[ie].push({name:B,func:q})}}),Fn[Ni(a,X).name]=[{name:"wrapper",func:a}],Ht.prototype.clone=zu,Ht.prototype.reverse=ju,Ht.prototype.value=Ku,we.prototype.at=Bd,we.prototype.chain=Id,we.prototype.commit=Pd,we.prototype.next=Rd,we.prototype.plant=Md,we.prototype.reverse=Od,we.prototype.toJSON=we.prototype.valueOf=we.prototype.value=Cd,we.prototype.first=we.prototype.head,Xn&&(we.prototype[Xn]=Td),we},Ln=Au();xn?((xn.exports=Ln)._=Ln,ts._=Ln):Sr._=Ln}).call(commonjsGlobal)}(lodash,lodash.exports);var lodashExports=lodash.exports,spec,hasRequiredSpec;function requireSpec(){if(hasRequiredSpec)return spec;hasRequiredSpec=1;var t="http://bitcore.io/";return spec=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: "+t+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."},{name:"BlockHeightOutOfRange",message:"Block Height can only be between 0 and 65535"},{name:"LockTimeRange",message:"Seconds needs to be more that 0 and less that 33553920"}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}],spec}var _$f=lodashExports;function format$1(t,e){return t.replace("{0}",e[0]).replace("{1}",e[1]).replace("{2}",e[2])}var traverseNode=function(t,e){var a=function(){if(_$f.isString(e.message))this.message=format$1(e.message,arguments);else if(_$f.isFunction(e.message))this.message=e.message.apply(null,arguments);else throw new Error("Invalid error definition for "+e.name);this.stack=this.message+`
66
+ `+new Error().stack};return a.prototype=Object.create(t.prototype),a.prototype.name=t.prototype.name+e.name,t[e.name]=a,e.errors&&childDefinitions(a,e.errors),a},childDefinitions=function(t,e){_$f.each(e,function(a){traverseNode(t,a)})},traverseRoot=function(t,e){return childDefinitions(t,e),t},bitcore={};bitcore.Error=function(){this.message="Internal error",this.stack=this.message+`
67
+ `+new Error().stack},bitcore.Error.prototype=Object.create(Error.prototype),bitcore.Error.prototype.name="bitcore.Error";var data=requireSpec();traverseRoot(bitcore.Error,data),errors$4.exports=bitcore.Error,errors$4.exports.extend=function(t){return traverseNode(bitcore.Error,t)};var errorsExports=errors$4.exports,errors$3=errorsExports,_$e=lodashExports,preconditions={checkState:function(t,e){if(!t)throw new errors$3.InvalidState(e)},checkArgument:function(t,e,a,u){if(!t)throw new errors$3.InvalidArgument(e,a,u)},checkArgumentType:function(t,e,a){if(a=a||"(unknown name)",_$e.isString(e)){if(e==="Buffer"){var u=require$$1$4;if(!u.Buffer.isBuffer(t))throw new errors$3.InvalidArgumentType(t,e,a)}else if(typeof t!==e)throw new errors$3.InvalidArgumentType(t,e,a)}else if(!(t instanceof e))throw new errors$3.InvalidArgumentType(t,e.name,a)}},BN$e=bnExports$1,$$8=preconditions,_$d=lodashExports,reversebuf=function(t){for(var e=Buffer$N.alloc(t.length),a=0;a<t.length;a++)e[a]=t[t.length-1-a];return e};BN$e.Zero=new BN$e(0),BN$e.One=new BN$e(1),BN$e.Minus1=new BN$e(-1),BN$e.fromNumber=function(t){return $$8.checkArgument(_$d.isNumber(t)),new BN$e(t)},BN$e.fromString=function(t,e){return $$8.checkArgument(_$d.isString(t)),new BN$e(t,e)},BN$e.fromBuffer=function(t,e){typeof e<"u"&&e.endian==="little"&&(t=reversebuf(t));var a=t.toString("hex"),u=new BN$e(a,16);return u},BN$e.fromSM=function(t,e){var a;if(t.length===0)return BN$e.fromBuffer(Buffer$N.from([0]));var u="big";return e&&(u=e.endian),u==="little"&&(t=reversebuf(t)),t[0]&128?(t[0]=t[0]&127,a=BN$e.fromBuffer(t),a.neg().copy(a)):a=BN$e.fromBuffer(t),a},BN$e.prototype.toNumber=function(){return parseInt(this.toString(10),10)},BN$e.prototype.toBuffer=function(t){var e,a;if(t&&t.size){a=this.toString(16,2);var u=a.length/2;e=Buffer$N.from(a,"hex"),u===t.size?e=e:u>t.size?e=BN$e.trim(e,u):u<t.size&&(e=BN$e.pad(e,u,t.size))}else a=this.toString(16,2),e=Buffer$N.from(a,"hex");return typeof t<"u"&&t.endian==="little"&&(e=reversebuf(e)),e},BN$e.prototype.toSMBigEndian=function(){var t;return this.cmp(BN$e.Zero)===-1?(t=this.neg().toBuffer(),t[0]&128?t=Buffer$N.concat([Buffer$N.from([128]),t]):t[0]=t[0]|128):(t=this.toBuffer(),t[0]&128&&(t=Buffer$N.concat([Buffer$N.from([0]),t]))),t.length===1&t[0]===0&&(t=Buffer$N.from([])),t},BN$e.prototype.toSM=function(t){var e=t?t.endian:"big",a=this.toSMBigEndian();return e==="little"&&(a=reversebuf(a)),a},BN$e.fromScriptNumBuffer=function(t,e,a){var u=a||4;if($$8.checkArgument(t.length<=u,new Error("script number overflow")),e&&t.length>0&&!(t[t.length-1]&127)&&(t.length<=1||!(t[t.length-2]&128)))throw new Error("non-minimally encoded script number");return BN$e.fromSM(t,{endian:"little"})},BN$e.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},BN$e.trim=function(t,e){return t.slice(e-t.length,t.length)},BN$e.pad=function(t,e,a){for(var u=Buffer$N.alloc(a),d=0;d<t.length;d++)u[u.length-1-d]=t[t.length-1-d];for(d=0;d<a-e;d++)u[d]=0;return u};var bn$1=BN$e,buffer$1={exports:{}},assert$k={exports:{}},errors$2={},hasRequiredErrors;function requireErrors(){if(hasRequiredErrors)return errors$2;hasRequiredErrors=1;function t(pe){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(me){return typeof me}:function(me){return me&&typeof Symbol=="function"&&me.constructor===Symbol&&me!==Symbol.prototype?"symbol":typeof me},t(pe)}function e(pe,me){for(var Ee=0;Ee<me.length;Ee++){var V=me[Ee];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(pe,u(V.key),V)}}function a(pe,me,Ee){return me&&e(pe.prototype,me),Ee&&e(pe,Ee),Object.defineProperty(pe,"prototype",{writable:!1}),pe}function u(pe){var me=d(pe,"string");return t(me)==="symbol"?me:String(me)}function d(pe,me){if(t(pe)!=="object"||pe===null)return pe;var Ee=pe[Symbol.toPrimitive];if(Ee!==void 0){var V=Ee.call(pe,me||"default");if(t(V)!=="object")return V;throw new TypeError("@@toPrimitive must return a primitive value.")}return(me==="string"?String:Number)(pe)}function c(pe,me){if(!(pe instanceof me))throw new TypeError("Cannot call a class as a function")}function l(pe,me){if(typeof me!="function"&&me!==null)throw new TypeError("Super expression must either be null or a function");pe.prototype=Object.create(me&&me.prototype,{constructor:{value:pe,writable:!0,configurable:!0}}),Object.defineProperty(pe,"prototype",{writable:!1}),me&&m(pe,me)}function m(pe,me){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(V,ae){return V.__proto__=ae,V},m(pe,me)}function I(pe){var me=C();return function(){var V=j(pe),ae;if(me){var ne=j(this).constructor;ae=Reflect.construct(V,arguments,ne)}else ae=V.apply(this,arguments);return O(this,ae)}}function O(pe,me){if(me&&(t(me)==="object"||typeof me=="function"))return me;if(me!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T(pe)}function T(pe){if(pe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return pe}function C(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function j(pe){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Ee){return Ee.__proto__||Object.getPrototypeOf(Ee)},j(pe)}var F={},U,Z;function J(pe,me,Ee){Ee||(Ee=Error);function V(ne,M,v){return typeof me=="string"?me:me(ne,M,v)}var ae=function(ne){l(v,ne);var M=I(v);function v(S,y,w){var P;return c(this,v),P=M.call(this,V(S,y,w)),P.code=pe,P}return a(v)}(Ee);F[pe]=ae}function X(pe,me){if(Array.isArray(pe)){var Ee=pe.length;return pe=pe.map(function(V){return String(V)}),Ee>2?"one of ".concat(me," ").concat(pe.slice(0,Ee-1).join(", "),", or ")+pe[Ee-1]:Ee===2?"one of ".concat(me," ").concat(pe[0]," or ").concat(pe[1]):"of ".concat(me," ").concat(pe[0])}else return"of ".concat(me," ").concat(String(pe))}function Q(pe,me,Ee){return pe.substr(!Ee||Ee<0?0:+Ee,me.length)===me}function te(pe,me,Ee){return(Ee===void 0||Ee>pe.length)&&(Ee=pe.length),pe.substring(Ee-me.length,Ee)===me}function se(pe,me,Ee){return typeof Ee!="number"&&(Ee=0),Ee+me.length>pe.length?!1:pe.indexOf(me,Ee)!==-1}return J("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),J("ERR_INVALID_ARG_TYPE",function(pe,me,Ee){U===void 0&&(U=requireAssert()),U(typeof pe=="string","'name' must be a string");var V;typeof me=="string"&&Q(me,"not ")?(V="must not be",me=me.replace(/^not /,"")):V="must be";var ae;if(te(pe," argument"))ae="The ".concat(pe," ").concat(V," ").concat(X(me,"type"));else{var ne=se(pe,".")?"property":"argument";ae='The "'.concat(pe,'" ').concat(ne," ").concat(V," ").concat(X(me,"type"))}return ae+=". Received type ".concat(t(Ee)),ae},TypeError),J("ERR_INVALID_ARG_VALUE",function(pe,me){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";Z===void 0&&(Z=util$2);var V=Z.inspect(me);return V.length>128&&(V="".concat(V.slice(0,128),"...")),"The argument '".concat(pe,"' ").concat(Ee,". Received ").concat(V)},TypeError),J("ERR_INVALID_RETURN_VALUE",function(pe,me,Ee){var V;return Ee&&Ee.constructor&&Ee.constructor.name?V="instance of ".concat(Ee.constructor.name):V="type ".concat(t(Ee)),"Expected ".concat(pe,' to be returned from the "').concat(me,'"')+" function but got ".concat(V,".")},TypeError),J("ERR_MISSING_ARGS",function(){for(var pe=arguments.length,me=new Array(pe),Ee=0;Ee<pe;Ee++)me[Ee]=arguments[Ee];U===void 0&&(U=requireAssert()),U(me.length>0,"At least one arg needs to be specified");var V="The ",ae=me.length;switch(me=me.map(function(ne){return'"'.concat(ne,'"')}),ae){case 1:V+="".concat(me[0]," argument");break;case 2:V+="".concat(me[0]," and ").concat(me[1]," arguments");break;default:V+=me.slice(0,ae-1).join(", "),V+=", and ".concat(me[ae-1]," arguments");break}return"".concat(V," must be specified")},TypeError),errors$2.codes=F,errors$2}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function t(E,A){var D=Object.keys(E);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(E);A&&(H=H.filter(function(Y){return Object.getOwnPropertyDescriptor(E,Y).enumerable})),D.push.apply(D,H)}return D}function e(E){for(var A=1;A<arguments.length;A++){var D=arguments[A]!=null?arguments[A]:{};A%2?t(Object(D),!0).forEach(function(H){a(E,H,D[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(D)):t(Object(D)).forEach(function(H){Object.defineProperty(E,H,Object.getOwnPropertyDescriptor(D,H))})}return E}function a(E,A,D){return A=l(A),A in E?Object.defineProperty(E,A,{value:D,enumerable:!0,configurable:!0,writable:!0}):E[A]=D,E}function u(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function d(E,A){for(var D=0;D<A.length;D++){var H=A[D];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(E,l(H.key),H)}}function c(E,A,D){return A&&d(E.prototype,A),D&&d(E,D),Object.defineProperty(E,"prototype",{writable:!1}),E}function l(E){var A=m(E,"string");return Q(A)==="symbol"?A:String(A)}function m(E,A){if(Q(E)!=="object"||E===null)return E;var D=E[Symbol.toPrimitive];if(D!==void 0){var H=D.call(E,A||"default");if(Q(H)!=="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(E)}function I(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),A&&J(E,A)}function O(E){var A=U();return function(){var H=X(E),Y;if(A){var le=X(this).constructor;Y=Reflect.construct(H,arguments,le)}else Y=H.apply(this,arguments);return T(this,Y)}}function T(E,A){if(A&&(Q(A)==="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C(E)}function C(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function j(E){var A=typeof Map=="function"?new Map:void 0;return j=function(H){if(H===null||!Z(H))return H;if(typeof H!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A<"u"){if(A.has(H))return A.get(H);A.set(H,Y)}function Y(){return F(H,arguments,X(this).constructor)}return Y.prototype=Object.create(H.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}),J(Y,H)},j(E)}function F(E,A,D){return U()?F=Reflect.construct.bind():F=function(Y,le,_e){var he=[null];he.push.apply(he,le);var fe=Function.bind.apply(Y,he),ve=new fe;return _e&&J(ve,_e.prototype),ve},F.apply(null,arguments)}function U(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Z(E){return Function.toString.call(E).indexOf("[native code]")!==-1}function J(E,A){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(H,Y){return H.__proto__=Y,H},J(E,A)}function X(E){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(D){return D.__proto__||Object.getPrototypeOf(D)},X(E)}function Q(E){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Q(E)}var te=util$2,se=te.inspect,pe=requireErrors(),me=pe.codes.ERR_INVALID_ARG_TYPE;function Ee(E,A,D){return(D===void 0||D>E.length)&&(D=E.length),E.substring(D-A.length,D)===A}function V(E,A){if(A=Math.floor(A),E.length==0||A==0)return"";var D=E.length*A;for(A=Math.floor(Math.log(A)/Math.log(2));A;)E+=E,A--;return E+=E.substring(0,D-E.length),E}var ae="",ne="",M="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},y=10;function w(E){var A=Object.keys(E),D=Object.create(Object.getPrototypeOf(E));return A.forEach(function(H){D[H]=E[H]}),Object.defineProperty(D,"message",{value:E.message}),D}function P(E){return se(E,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function L(E,A,D){var H="",Y="",le=0,_e="",he=!1,fe=P(E),ve=fe.split(`
68
+ `),ge=P(A).split(`
69
+ `),Ie=0,ue="";if(D==="strictEqual"&&Q(E)==="object"&&Q(A)==="object"&&E!==null&&A!==null&&(D="strictEqualObject"),ve.length===1&&ge.length===1&&ve[0]!==ge[0]){var ce=ve[0].length+ge[0].length;if(ce<=y){if((Q(E)!=="object"||E===null)&&(Q(A)!=="object"||A===null)&&(E!==0||A!==0))return"".concat(S[D],`
70
+
71
+ `)+"".concat(ve[0]," !== ").concat(ge[0],`
72
+ `)}else if(D!=="strictEqualObject"){var Te=process$1.stderr&&process$1.stderr.isTTY?process$1.stderr.columns:80;if(ce<Te){for(;ve[0][Ie]===ge[0][Ie];)Ie++;Ie>2&&(ue=`
73
+ `.concat(V(" ",Ie),"^"),Ie=0)}}}for(var ke=ve[ve.length-1],He=ge[ge.length-1];ke===He&&(Ie++<2?_e=`
74
+ `.concat(ke).concat(_e):H=ke,ve.pop(),ge.pop(),!(ve.length===0||ge.length===0));)ke=ve[ve.length-1],He=ge[ge.length-1];var Qe=Math.max(ve.length,ge.length);if(Qe===0){var it=fe.split(`
75
+ `);if(it.length>30)for(it[26]="".concat(ae,"...").concat(v);it.length>27;)it.pop();return"".concat(S.notIdentical,`
76
+
77
+ `).concat(it.join(`
78
+ `),`
79
+ `)}Ie>3&&(_e=`
80
+ `.concat(ae,"...").concat(v).concat(_e),he=!0),H!==""&&(_e=`
81
+ `.concat(H).concat(_e),H="");var rt=0,Fe=S[D]+`
82
+ `.concat(ne,"+ actual").concat(v," ").concat(M,"- expected").concat(v),wt=" ".concat(ae,"...").concat(v," Lines skipped");for(Ie=0;Ie<Qe;Ie++){var et=Ie-le;if(ve.length<Ie+1)et>1&&Ie>2&&(et>4?(Y+=`
83
+ `.concat(ae,"...").concat(v),he=!0):et>3&&(Y+=`
84
+ `.concat(ge[Ie-2]),rt++),Y+=`
85
+ `.concat(ge[Ie-1]),rt++),le=Ie,H+=`
86
+ `.concat(M,"-").concat(v," ").concat(ge[Ie]),rt++;else if(ge.length<Ie+1)et>1&&Ie>2&&(et>4?(Y+=`
87
+ `.concat(ae,"...").concat(v),he=!0):et>3&&(Y+=`
88
+ `.concat(ve[Ie-2]),rt++),Y+=`
89
+ `.concat(ve[Ie-1]),rt++),le=Ie,Y+=`
90
+ `.concat(ne,"+").concat(v," ").concat(ve[Ie]),rt++;else{var At=ge[Ie],gt=ve[Ie],$e=gt!==At&&(!Ee(gt,",")||gt.slice(0,-1)!==At);$e&&Ee(At,",")&&At.slice(0,-1)===gt&&($e=!1,gt+=","),$e?(et>1&&Ie>2&&(et>4?(Y+=`
91
+ `.concat(ae,"...").concat(v),he=!0):et>3&&(Y+=`
92
+ `.concat(ve[Ie-2]),rt++),Y+=`
93
+ `.concat(ve[Ie-1]),rt++),le=Ie,Y+=`
94
+ `.concat(ne,"+").concat(v," ").concat(gt),H+=`
95
+ `.concat(M,"-").concat(v," ").concat(At),rt+=2):(Y+=H,H="",(et===1||Ie===0)&&(Y+=`
96
+ `.concat(gt),rt++))}if(rt>20&&Ie<Qe-2)return"".concat(Fe).concat(wt,`
97
+ `).concat(Y,`
98
+ `).concat(ae,"...").concat(v).concat(H,`
99
+ `)+"".concat(ae,"...").concat(v)}return"".concat(Fe).concat(he?wt:"",`
100
+ `).concat(Y).concat(H).concat(_e).concat(ue)}var N=function(E,A){I(H,E);var D=O(H);function H(Y){var le;if(u(this,H),Q(Y)!=="object"||Y===null)throw new me("options","Object",Y);var _e=Y.message,he=Y.operator,fe=Y.stackStartFn,ve=Y.actual,ge=Y.expected,Ie=Error.stackTraceLimit;if(Error.stackTraceLimit=0,_e!=null)le=D.call(this,String(_e));else if(process$1.stderr&&process$1.stderr.isTTY&&(process$1.stderr&&process$1.stderr.getColorDepth&&process$1.stderr.getColorDepth()!==1?(ae="\x1B[34m",ne="\x1B[32m",v="\x1B[39m",M="\x1B[31m"):(ae="",ne="",v="",M="")),Q(ve)==="object"&&ve!==null&&Q(ge)==="object"&&ge!==null&&"stack"in ve&&ve instanceof Error&&"stack"in ge&&ge instanceof Error&&(ve=w(ve),ge=w(ge)),he==="deepStrictEqual"||he==="strictEqual")le=D.call(this,L(ve,ge,he));else if(he==="notDeepStrictEqual"||he==="notStrictEqual"){var ue=S[he],ce=P(ve).split(`
101
+ `);if(he==="notStrictEqual"&&Q(ve)==="object"&&ve!==null&&(ue=S.notStrictEqualObject),ce.length>30)for(ce[26]="".concat(ae,"...").concat(v);ce.length>27;)ce.pop();ce.length===1?le=D.call(this,"".concat(ue," ").concat(ce[0])):le=D.call(this,"".concat(ue,`
102
+
103
+ `).concat(ce.join(`
104
+ `),`
105
+ `))}else{var Te=P(ve),ke="",He=S[he];he==="notDeepEqual"||he==="notEqual"?(Te="".concat(S[he],`
106
+
107
+ `).concat(Te),Te.length>1024&&(Te="".concat(Te.slice(0,1021),"..."))):(ke="".concat(P(ge)),Te.length>512&&(Te="".concat(Te.slice(0,509),"...")),ke.length>512&&(ke="".concat(ke.slice(0,509),"...")),he==="deepEqual"||he==="equal"?Te="".concat(He,`
108
+
109
+ `).concat(Te,`
110
+
111
+ should equal
112
+
113
+ `):ke=" ".concat(he," ").concat(ke)),le=D.call(this,"".concat(Te).concat(ke))}return Error.stackTraceLimit=Ie,le.generatedMessage=!_e,Object.defineProperty(C(le),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),le.code="ERR_ASSERTION",le.actual=ve,le.expected=ge,le.operator=he,Error.captureStackTrace&&Error.captureStackTrace(C(le),fe),le.stack,le.name="AssertionError",T(le)}return c(H,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:A,value:function(le,_e){return se(this,e(e({},_e),{},{customInspect:!1,depth:0}))}}]),H}(j(Error),se.custom);return assertion_error=N,assertion_error}var toStr=Object.prototype.toString,isArguments=function(e){var a=toStr.call(e),u=a==="[object Arguments]";return u||(u=a!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&toStr.call(e.callee)==="[object Function]"),u},implementation$5,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$5;hasRequiredImplementation$1=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,u=isArguments,d=Object.prototype.propertyIsEnumerable,c=!d.call({toString:null},"toString"),l=d.call(function(){},"prototype"),m=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],I=function(j){var F=j.constructor;return F&&F.prototype===j},O={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},T=function(){if(typeof window>"u")return!1;for(var j in window)try{if(!O["$"+j]&&e.call(window,j)&&window[j]!==null&&typeof window[j]=="object")try{I(window[j])}catch{return!0}}catch{return!0}return!1}(),C=function(j){if(typeof window>"u"||!T)return I(j);try{return I(j)}catch{return!1}};t=function(F){var U=F!==null&&typeof F=="object",Z=a.call(F)==="[object Function]",J=u(F),X=U&&a.call(F)==="[object String]",Q=[];if(!U&&!Z&&!J)throw new TypeError("Object.keys called on a non-object");var te=l&&Z;if(X&&F.length>0&&!e.call(F,0))for(var se=0;se<F.length;++se)Q.push(String(se));if(J&&F.length>0)for(var pe=0;pe<F.length;++pe)Q.push(String(pe));else for(var me in F)!(te&&me==="prototype")&&e.call(F,me)&&Q.push(String(me));if(c)for(var Ee=C(F),V=0;V<m.length;++V)!(Ee&&m[V]==="constructor")&&e.call(F,m[V])&&Q.push(m[V]);return Q}}return implementation$5=t,implementation$5}var slice=Array.prototype.slice,isArgs=isArguments,origKeys=Object.keys,keysShim=origKeys?function(e){return origKeys(e)}:requireImplementation$1(),originalKeys=Object.keys;keysShim.shim=function(){if(Object.keys){var e=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);e||(Object.keys=function(u){return isArgs(u)?originalKeys(slice.call(u)):originalKeys(u)})}else Object.keys=keysShim;return Object.keys||keysShim};var objectKeys$2=keysShim,objectKeys$1=objectKeys$2,hasSymbols=shams$1(),callBound=callBound$3,toObject=Object,$push=callBound("Array.prototype.push"),$propIsEnumerable=callBound("Object.prototype.propertyIsEnumerable"),originalGetSymbols=hasSymbols?Object.getOwnPropertySymbols:null,implementation$4=function(e,a){if(e==null)throw new TypeError("target must be an object");var u=toObject(e);if(arguments.length===1)return u;for(var d=1;d<arguments.length;++d){var c=toObject(arguments[d]),l=objectKeys$1(c),m=hasSymbols&&(Object.getOwnPropertySymbols||originalGetSymbols);if(m)for(var I=m(c),O=0;O<I.length;++O){var T=I[O];$propIsEnumerable(c,T)&&$push(l,T)}for(var C=0;C<l.length;++C){var j=l[C];if($propIsEnumerable(c,j)){var F=c[j];u[j]=F}}}return u},implementation$3=implementation$4,lacksProperEnumerationOrder=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),a={},u=0;u<e.length;++u)a[e[u]]=e[u];var d=Object.assign({},a),c="";for(var l in d)c+=l;return t!==c},assignHasPendingExceptions=function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch{return t[1]==="y"}return!1},polyfill$2=function(){return!Object.assign||lacksProperEnumerationOrder()||assignHasPendingExceptions()?implementation$3:Object.assign},numberIsNaN=function(t){return t!==t},implementation$2=function(e,a){return e===0&&a===0?1/e===1/a:!!(e===a||numberIsNaN(e)&&numberIsNaN(a))},implementation$1=implementation$2,polyfill$1=function(){return typeof Object.is=="function"?Object.is:implementation$1},defineProperties_1,hasRequiredDefineProperties;function requireDefineProperties(){if(hasRequiredDefineProperties)return defineProperties_1;hasRequiredDefineProperties=1;var t=objectKeys$2,e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",a=Object.prototype.toString,u=Array.prototype.concat,d=defineDataProperty,c=function(O){return typeof O=="function"&&a.call(O)==="[object Function]"},l=hasPropertyDescriptors_1(),m=function(O,T,C,j){if(T in O){if(j===!0){if(O[T]===C)return}else if(!c(j)||!j())return}l?d(O,T,C,!0):d(O,T,C)},I=function(O,T){var C=arguments.length>2?arguments[2]:{},j=t(T);e&&(j=u.call(j,Object.getOwnPropertySymbols(T)));for(var F=0;F<j.length;F+=1)m(O,j[F],T[j[F]],C[j[F]])};return I.supportsDescriptors=!!l,defineProperties_1=I,defineProperties_1}var shim$1,hasRequiredShim$1;function requireShim$1(){if(hasRequiredShim$1)return shim$1;hasRequiredShim$1=1;var t=polyfill$1,e=requireDefineProperties();return shim$1=function(){var u=t();return e(Object,{is:u},{is:function(){return Object.is!==u}}),u},shim$1}var objectIs,hasRequiredObjectIs;function requireObjectIs(){if(hasRequiredObjectIs)return objectIs;hasRequiredObjectIs=1;var t=requireDefineProperties(),e=callBindExports,a=implementation$2,u=polyfill$1,d=requireShim$1(),c=e(u(),Object);return t(c,{getPolyfill:u,implementation:a,shim:d}),objectIs=c,objectIs}var implementation,hasRequiredImplementation;function requireImplementation(){return hasRequiredImplementation||(hasRequiredImplementation=1,implementation=function(e){return e!==e}),implementation}var polyfill,hasRequiredPolyfill;function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var t=requireImplementation();return polyfill=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:t},polyfill}var shim,hasRequiredShim;function requireShim(){if(hasRequiredShim)return shim;hasRequiredShim=1;var t=requireDefineProperties(),e=requirePolyfill();return shim=function(){var u=e();return t(Number,{isNaN:u},{isNaN:function(){return Number.isNaN!==u}}),u},shim}var isNan,hasRequiredIsNan;function requireIsNan(){if(hasRequiredIsNan)return isNan;hasRequiredIsNan=1;var t=callBindExports,e=requireDefineProperties(),a=requireImplementation(),u=requirePolyfill(),d=requireShim(),c=t(u(),Number);return e(c,{getPolyfill:u,implementation:a,shim:d}),isNan=c,isNan}var comparisons,hasRequiredComparisons;function requireComparisons(){if(hasRequiredComparisons)return comparisons;hasRequiredComparisons=1;function t($e,Me){return c($e)||d($e,Me)||a($e,Me)||e()}function e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
114
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a($e,Me){if($e){if(typeof $e=="string")return u($e,Me);var Ze=Object.prototype.toString.call($e).slice(8,-1);if(Ze==="Object"&&$e.constructor&&(Ze=$e.constructor.name),Ze==="Map"||Ze==="Set")return Array.from($e);if(Ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ze))return u($e,Me)}}function u($e,Me){(Me==null||Me>$e.length)&&(Me=$e.length);for(var Ze=0,ze=new Array(Me);Ze<Me;Ze++)ze[Ze]=$e[Ze];return ze}function d($e,Me){var Ze=$e==null?null:typeof Symbol<"u"&&$e[Symbol.iterator]||$e["@@iterator"];if(Ze!=null){var ze,Ge,ht,oe,ee=[],re=!0,be=!1;try{if(ht=(Ze=Ze.call($e)).next,Me===0){if(Object(Ze)!==Ze)return;re=!1}else for(;!(re=(ze=ht.call(Ze)).done)&&(ee.push(ze.value),ee.length!==Me);re=!0);}catch(Pe){be=!0,Ge=Pe}finally{try{if(!re&&Ze.return!=null&&(oe=Ze.return(),Object(oe)!==oe))return}finally{if(be)throw Ge}}return ee}}function c($e){if(Array.isArray($e))return $e}function l($e){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Me){return typeof Me}:function(Me){return Me&&typeof Symbol=="function"&&Me.constructor===Symbol&&Me!==Symbol.prototype?"symbol":typeof Me},l($e)}var m=/a/g.flags!==void 0,I=function(Me){var Ze=[];return Me.forEach(function(ze){return Ze.push(ze)}),Ze},O=function(Me){var Ze=[];return Me.forEach(function(ze,Ge){return Ze.push([Ge,ze])}),Ze},T=Object.is?Object.is:requireObjectIs(),C=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},j=Number.isNaN?Number.isNaN:requireIsNan();function F($e){return $e.call.bind($e)}var U=F(Object.prototype.hasOwnProperty),Z=F(Object.prototype.propertyIsEnumerable),J=F(Object.prototype.toString),X=util$2.types,Q=X.isAnyArrayBuffer,te=X.isArrayBufferView,se=X.isDate,pe=X.isMap,me=X.isRegExp,Ee=X.isSet,V=X.isNativeError,ae=X.isBoxedPrimitive,ne=X.isNumberObject,M=X.isStringObject,v=X.isBooleanObject,S=X.isBigIntObject,y=X.isSymbolObject,w=X.isFloat32Array,P=X.isFloat64Array;function L($e){if($e.length===0||$e.length>10)return!0;for(var Me=0;Me<$e.length;Me++){var Ze=$e.charCodeAt(Me);if(Ze<48||Ze>57)return!0}return $e.length===10&&$e>=Math.pow(2,32)}function N($e){return Object.keys($e).filter(L).concat(C($e).filter(Object.prototype.propertyIsEnumerable.bind($e)))}/*!
115
+ * The buffer module from node.js, for the browser.
116
+ *
117
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
118
+ * @license MIT
119
+ */function E($e,Me){if($e===Me)return 0;for(var Ze=$e.length,ze=Me.length,Ge=0,ht=Math.min(Ze,ze);Ge<ht;++Ge)if($e[Ge]!==Me[Ge]){Ze=$e[Ge],ze=Me[Ge];break}return Ze<ze?-1:ze<Ze?1:0}var A=!0,D=!1,H=0,Y=1,le=2,_e=3;function he($e,Me){return m?$e.source===Me.source&&$e.flags===Me.flags:RegExp.prototype.toString.call($e)===RegExp.prototype.toString.call(Me)}function fe($e,Me){if($e.byteLength!==Me.byteLength)return!1;for(var Ze=0;Ze<$e.byteLength;Ze++)if($e[Ze]!==Me[Ze])return!1;return!0}function ve($e,Me){return $e.byteLength!==Me.byteLength?!1:E(new Uint8Array($e.buffer,$e.byteOffset,$e.byteLength),new Uint8Array(Me.buffer,Me.byteOffset,Me.byteLength))===0}function ge($e,Me){return $e.byteLength===Me.byteLength&&E(new Uint8Array($e),new Uint8Array(Me))===0}function Ie($e,Me){return ne($e)?ne(Me)&&T(Number.prototype.valueOf.call($e),Number.prototype.valueOf.call(Me)):M($e)?M(Me)&&String.prototype.valueOf.call($e)===String.prototype.valueOf.call(Me):v($e)?v(Me)&&Boolean.prototype.valueOf.call($e)===Boolean.prototype.valueOf.call(Me):S($e)?S(Me)&&BigInt.prototype.valueOf.call($e)===BigInt.prototype.valueOf.call(Me):y(Me)&&Symbol.prototype.valueOf.call($e)===Symbol.prototype.valueOf.call(Me)}function ue($e,Me,Ze,ze){if($e===Me)return $e!==0?!0:Ze?T($e,Me):!0;if(Ze){if(l($e)!=="object")return typeof $e=="number"&&j($e)&&j(Me);if(l(Me)!=="object"||$e===null||Me===null||Object.getPrototypeOf($e)!==Object.getPrototypeOf(Me))return!1}else{if($e===null||l($e)!=="object")return Me===null||l(Me)!=="object"?$e==Me:!1;if(Me===null||l(Me)!=="object")return!1}var Ge=J($e),ht=J(Me);if(Ge!==ht)return!1;if(Array.isArray($e)){if($e.length!==Me.length)return!1;var oe=N($e),ee=N(Me);return oe.length!==ee.length?!1:Te($e,Me,Ze,ze,Y,oe)}if(Ge==="[object Object]"&&(!pe($e)&&pe(Me)||!Ee($e)&&Ee(Me)))return!1;if(se($e)){if(!se(Me)||Date.prototype.getTime.call($e)!==Date.prototype.getTime.call(Me))return!1}else if(me($e)){if(!me(Me)||!he($e,Me))return!1}else if(V($e)||$e instanceof Error){if($e.message!==Me.message||$e.name!==Me.name)return!1}else if(te($e)){if(!Ze&&(w($e)||P($e))){if(!fe($e,Me))return!1}else if(!ve($e,Me))return!1;var re=N($e),be=N(Me);return re.length!==be.length?!1:Te($e,Me,Ze,ze,H,re)}else{if(Ee($e))return!Ee(Me)||$e.size!==Me.size?!1:Te($e,Me,Ze,ze,le);if(pe($e))return!pe(Me)||$e.size!==Me.size?!1:Te($e,Me,Ze,ze,_e);if(Q($e)){if(!ge($e,Me))return!1}else if(ae($e)&&!Ie($e,Me))return!1}return Te($e,Me,Ze,ze,H)}function ce($e,Me){return Me.filter(function(Ze){return Z($e,Ze)})}function Te($e,Me,Ze,ze,Ge,ht){if(arguments.length===5){ht=Object.keys($e);var oe=Object.keys(Me);if(ht.length!==oe.length)return!1}for(var ee=0;ee<ht.length;ee++)if(!U(Me,ht[ee]))return!1;if(Ze&&arguments.length===5){var re=C($e);if(re.length!==0){var be=0;for(ee=0;ee<re.length;ee++){var Pe=re[ee];if(Z($e,Pe)){if(!Z(Me,Pe))return!1;ht.push(Pe),be++}else if(Z(Me,Pe))return!1}var Ne=C(Me);if(re.length!==Ne.length&&ce(Me,Ne).length!==be)return!1}else{var Oe=C(Me);if(Oe.length!==0&&ce(Me,Oe).length!==0)return!1}}if(ht.length===0&&(Ge===H||Ge===Y&&$e.length===0||$e.size===0))return!0;if(ze===void 0)ze={val1:new Map,val2:new Map,position:0};else{var ut=ze.val1.get($e);if(ut!==void 0){var lt=ze.val2.get(Me);if(lt!==void 0)return ut===lt}ze.position++}ze.val1.set($e,ze.position),ze.val2.set(Me,ze.position);var Je=et($e,Me,Ze,ht,ze,Ge);return ze.val1.delete($e),ze.val2.delete(Me),Je}function ke($e,Me,Ze,ze){for(var Ge=I($e),ht=0;ht<Ge.length;ht++){var oe=Ge[ht];if(ue(Me,oe,Ze,ze))return $e.delete(oe),!0}return!1}function He($e){switch(l($e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":$e=+$e;case"number":if(j($e))return!1}return!0}function Qe($e,Me,Ze){var ze=He(Ze);return ze??(Me.has(ze)&&!$e.has(ze))}function it($e,Me,Ze,ze,Ge){var ht=He(Ze);if(ht!=null)return ht;var oe=Me.get(ht);return oe===void 0&&!Me.has(ht)||!ue(ze,oe,!1,Ge)?!1:!$e.has(ht)&&ue(ze,oe,!1,Ge)}function rt($e,Me,Ze,ze){for(var Ge=null,ht=I($e),oe=0;oe<ht.length;oe++){var ee=ht[oe];if(l(ee)==="object"&&ee!==null)Ge===null&&(Ge=new Set),Ge.add(ee);else if(!Me.has(ee)){if(Ze||!Qe($e,Me,ee))return!1;Ge===null&&(Ge=new Set),Ge.add(ee)}}if(Ge!==null){for(var re=I(Me),be=0;be<re.length;be++){var Pe=re[be];if(l(Pe)==="object"&&Pe!==null){if(!ke(Ge,Pe,Ze,ze))return!1}else if(!Ze&&!$e.has(Pe)&&!ke(Ge,Pe,Ze,ze))return!1}return Ge.size===0}return!0}function Fe($e,Me,Ze,ze,Ge,ht){for(var oe=I($e),ee=0;ee<oe.length;ee++){var re=oe[ee];if(ue(Ze,re,Ge,ht)&&ue(ze,Me.get(re),Ge,ht))return $e.delete(re),!0}return!1}function wt($e,Me,Ze,ze){for(var Ge=null,ht=O($e),oe=0;oe<ht.length;oe++){var ee=t(ht[oe],2),re=ee[0],be=ee[1];if(l(re)==="object"&&re!==null)Ge===null&&(Ge=new Set),Ge.add(re);else{var Pe=Me.get(re);if(Pe===void 0&&!Me.has(re)||!ue(be,Pe,Ze,ze)){if(Ze||!it($e,Me,re,be,ze))return!1;Ge===null&&(Ge=new Set),Ge.add(re)}}}if(Ge!==null){for(var Ne=O(Me),Oe=0;Oe<Ne.length;Oe++){var ut=t(Ne[Oe],2),lt=ut[0],Je=ut[1];if(l(lt)==="object"&&lt!==null){if(!Fe(Ge,$e,lt,Je,Ze,ze))return!1}else if(!Ze&&(!$e.has(lt)||!ue($e.get(lt),Je,!1,ze))&&!Fe(Ge,$e,lt,Je,!1,ze))return!1}return Ge.size===0}return!0}function et($e,Me,Ze,ze,Ge,ht){var oe=0;if(ht===le){if(!rt($e,Me,Ze,Ge))return!1}else if(ht===_e){if(!wt($e,Me,Ze,Ge))return!1}else if(ht===Y)for(;oe<$e.length;oe++)if(U($e,oe)){if(!U(Me,oe)||!ue($e[oe],Me[oe],Ze,Ge))return!1}else{if(U(Me,oe))return!1;for(var ee=Object.keys($e);oe<ee.length;oe++){var re=ee[oe];if(!U(Me,re)||!ue($e[re],Me[re],Ze,Ge))return!1}return ee.length===Object.keys(Me).length}for(oe=0;oe<ze.length;oe++){var be=ze[oe];if(!ue($e[be],Me[be],Ze,Ge))return!1}return!0}function At($e,Me){return ue($e,Me,D)}function gt($e,Me){return ue($e,Me,A)}return comparisons={isDeepEqual:At,isDeepStrictEqual:gt},comparisons}var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert$k.exports;hasRequiredAssert=1;function t(fe){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ve){return typeof ve}:function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},t(fe)}function e(fe,ve){for(var ge=0;ge<ve.length;ge++){var Ie=ve[ge];Ie.enumerable=Ie.enumerable||!1,Ie.configurable=!0,"value"in Ie&&(Ie.writable=!0),Object.defineProperty(fe,u(Ie.key),Ie)}}function a(fe,ve,ge){return ve&&e(fe.prototype,ve),ge&&e(fe,ge),Object.defineProperty(fe,"prototype",{writable:!1}),fe}function u(fe){var ve=d(fe,"string");return t(ve)==="symbol"?ve:String(ve)}function d(fe,ve){if(t(fe)!=="object"||fe===null)return fe;var ge=fe[Symbol.toPrimitive];if(ge!==void 0){var Ie=ge.call(fe,ve||"default");if(t(Ie)!=="object")return Ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ve==="string"?String:Number)(fe)}function c(fe,ve){if(!(fe instanceof ve))throw new TypeError("Cannot call a class as a function")}var l=requireErrors(),m=l.codes,I=m.ERR_AMBIGUOUS_ARGUMENT,O=m.ERR_INVALID_ARG_TYPE,T=m.ERR_INVALID_ARG_VALUE,C=m.ERR_INVALID_RETURN_VALUE,j=m.ERR_MISSING_ARGS,F=requireAssertion_error(),U=util$2,Z=U.inspect,J=util$2.types,X=J.isPromise,Q=J.isRegExp,te=polyfill$2(),se=polyfill$1(),pe=callBound$3("RegExp.prototype.test"),me,Ee;function V(){var fe=requireComparisons();me=fe.isDeepEqual,Ee=fe.isDeepStrictEqual}var ae=!1,ne=assert$k.exports=w,M={};function v(fe){throw fe.message instanceof Error?fe.message:new F(fe)}function S(fe,ve,ge,Ie,ue){var ce=arguments.length,Te;if(ce===0)Te="Failed";else if(ce===1)ge=fe,fe=void 0;else{if(ae===!1){ae=!0;var ke=process$1.emitWarning?process$1.emitWarning:console.warn.bind(console);ke("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}ce===2&&(Ie="!=")}if(ge instanceof Error)throw ge;var He={actual:fe,expected:ve,operator:Ie===void 0?"fail":Ie,stackStartFn:ue||S};ge!==void 0&&(He.message=ge);var Qe=new F(He);throw Te&&(Qe.message=Te,Qe.generatedMessage=!0),Qe}ne.fail=S,ne.AssertionError=F;function y(fe,ve,ge,Ie){if(!ge){var ue=!1;if(ve===0)ue=!0,Ie="No value argument passed to `assert.ok()`";else if(Ie instanceof Error)throw Ie;var ce=new F({actual:ge,expected:!0,message:Ie,operator:"==",stackStartFn:fe});throw ce.generatedMessage=ue,ce}}function w(){for(var fe=arguments.length,ve=new Array(fe),ge=0;ge<fe;ge++)ve[ge]=arguments[ge];y.apply(void 0,[w,ve.length].concat(ve))}ne.ok=w,ne.equal=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");ve!=ge&&v({actual:ve,expected:ge,message:Ie,operator:"==",stackStartFn:fe})},ne.notEqual=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");ve==ge&&v({actual:ve,expected:ge,message:Ie,operator:"!=",stackStartFn:fe})},ne.deepEqual=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");me===void 0&&V(),me(ve,ge)||v({actual:ve,expected:ge,message:Ie,operator:"deepEqual",stackStartFn:fe})},ne.notDeepEqual=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");me===void 0&&V(),me(ve,ge)&&v({actual:ve,expected:ge,message:Ie,operator:"notDeepEqual",stackStartFn:fe})},ne.deepStrictEqual=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");me===void 0&&V(),Ee(ve,ge)||v({actual:ve,expected:ge,message:Ie,operator:"deepStrictEqual",stackStartFn:fe})},ne.notDeepStrictEqual=P;function P(fe,ve,ge){if(arguments.length<2)throw new j("actual","expected");me===void 0&&V(),Ee(fe,ve)&&v({actual:fe,expected:ve,message:ge,operator:"notDeepStrictEqual",stackStartFn:P})}ne.strictEqual=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");se(ve,ge)||v({actual:ve,expected:ge,message:Ie,operator:"strictEqual",stackStartFn:fe})},ne.notStrictEqual=function fe(ve,ge,Ie){if(arguments.length<2)throw new j("actual","expected");se(ve,ge)&&v({actual:ve,expected:ge,message:Ie,operator:"notStrictEqual",stackStartFn:fe})};var L=a(function fe(ve,ge,Ie){var ue=this;c(this,fe),ge.forEach(function(ce){ce in ve&&(Ie!==void 0&&typeof Ie[ce]=="string"&&Q(ve[ce])&&pe(ve[ce],Ie[ce])?ue[ce]=Ie[ce]:ue[ce]=ve[ce])})});function N(fe,ve,ge,Ie,ue,ce){if(!(ge in fe)||!Ee(fe[ge],ve[ge])){if(!Ie){var Te=new L(fe,ue),ke=new L(ve,ue,fe),He=new F({actual:Te,expected:ke,operator:"deepStrictEqual",stackStartFn:ce});throw He.actual=fe,He.expected=ve,He.operator=ce.name,He}v({actual:fe,expected:ve,message:Ie,operator:ce.name,stackStartFn:ce})}}function E(fe,ve,ge,Ie){if(typeof ve!="function"){if(Q(ve))return pe(ve,fe);if(arguments.length===2)throw new O("expected",["Function","RegExp"],ve);if(t(fe)!=="object"||fe===null){var ue=new F({actual:fe,expected:ve,message:ge,operator:"deepStrictEqual",stackStartFn:Ie});throw ue.operator=Ie.name,ue}var ce=Object.keys(ve);if(ve instanceof Error)ce.push("name","message");else if(ce.length===0)throw new T("error",ve,"may not be an empty object");return me===void 0&&V(),ce.forEach(function(Te){typeof fe[Te]=="string"&&Q(ve[Te])&&pe(ve[Te],fe[Te])||N(fe,ve,Te,ge,ce,Ie)}),!0}return ve.prototype!==void 0&&fe instanceof ve?!0:Error.isPrototypeOf(ve)?!1:ve.call({},fe)===!0}function A(fe){if(typeof fe!="function")throw new O("fn","Function",fe);try{fe()}catch(ve){return ve}return M}function D(fe){return X(fe)||fe!==null&&t(fe)==="object"&&typeof fe.then=="function"&&typeof fe.catch=="function"}function H(fe){return Promise.resolve().then(function(){var ve;if(typeof fe=="function"){if(ve=fe(),!D(ve))throw new C("instance of Promise","promiseFn",ve)}else if(D(fe))ve=fe;else throw new O("promiseFn",["Function","Promise"],fe);return Promise.resolve().then(function(){return ve}).then(function(){return M}).catch(function(ge){return ge})})}function Y(fe,ve,ge,Ie){if(typeof ge=="string"){if(arguments.length===4)throw new O("error",["Object","Error","Function","RegExp"],ge);if(t(ve)==="object"&&ve!==null){if(ve.message===ge)throw new I("error/message",'The error message "'.concat(ve.message,'" is identical to the message.'))}else if(ve===ge)throw new I("error/message",'The error "'.concat(ve,'" is identical to the message.'));Ie=ge,ge=void 0}else if(ge!=null&&t(ge)!=="object"&&typeof ge!="function")throw new O("error",["Object","Error","Function","RegExp"],ge);if(ve===M){var ue="";ge&&ge.name&&(ue+=" (".concat(ge.name,")")),ue+=Ie?": ".concat(Ie):".";var ce=fe.name==="rejects"?"rejection":"exception";v({actual:void 0,expected:ge,operator:fe.name,message:"Missing expected ".concat(ce).concat(ue),stackStartFn:fe})}if(ge&&!E(ve,ge,Ie,fe))throw ve}function le(fe,ve,ge,Ie){if(ve!==M){if(typeof ge=="string"&&(Ie=ge,ge=void 0),!ge||E(ve,ge)){var ue=Ie?": ".concat(Ie):".",ce=fe.name==="doesNotReject"?"rejection":"exception";v({actual:ve,expected:ge,operator:fe.name,message:"Got unwanted ".concat(ce).concat(ue,`
120
+ `)+'Actual message: "'.concat(ve&&ve.message,'"'),stackStartFn:fe})}throw ve}}ne.throws=function fe(ve){for(var ge=arguments.length,Ie=new Array(ge>1?ge-1:0),ue=1;ue<ge;ue++)Ie[ue-1]=arguments[ue];Y.apply(void 0,[fe,A(ve)].concat(Ie))},ne.rejects=function fe(ve){for(var ge=arguments.length,Ie=new Array(ge>1?ge-1:0),ue=1;ue<ge;ue++)Ie[ue-1]=arguments[ue];return H(ve).then(function(ce){return Y.apply(void 0,[fe,ce].concat(Ie))})},ne.doesNotThrow=function fe(ve){for(var ge=arguments.length,Ie=new Array(ge>1?ge-1:0),ue=1;ue<ge;ue++)Ie[ue-1]=arguments[ue];le.apply(void 0,[fe,A(ve)].concat(Ie))},ne.doesNotReject=function fe(ve){for(var ge=arguments.length,Ie=new Array(ge>1?ge-1:0),ue=1;ue<ge;ue++)Ie[ue-1]=arguments[ue];return H(ve).then(function(ce){return le.apply(void 0,[fe,ce].concat(Ie))})},ne.ifError=function fe(ve){if(ve!=null){var ge="ifError got unwanted exception: ";t(ve)==="object"&&typeof ve.message=="string"?ve.message.length===0&&ve.constructor?ge+=ve.constructor.name:ge+=ve.message:ge+=Z(ve);var Ie=new F({actual:ve,expected:null,operator:"ifError",message:ge,stackStartFn:fe}),ue=ve.stack;if(typeof ue=="string"){var ce=ue.split(`
121
+ `);ce.shift();for(var Te=Ie.stack.split(`
122
+ `),ke=0;ke<ce.length;ke++){var He=Te.indexOf(ce[ke]);if(He!==-1){Te=Te.slice(0,He);break}}Ie.stack="".concat(Te.join(`
123
+ `),`
124
+ `).concat(ce.join(`
125
+ `))}throw Ie}};function _e(fe,ve,ge,Ie,ue){if(!Q(ve))throw new O("regexp","RegExp",ve);var ce=ue==="match";if(typeof fe!="string"||pe(ve,fe)!==ce){if(ge instanceof Error)throw ge;var Te=!ge;ge=ge||(typeof fe!="string"?'The "string" argument must be of type string. Received type '+"".concat(t(fe)," (").concat(Z(fe),")"):(ce?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(Z(ve),`. Input:
126
+
127
+ `).concat(Z(fe),`
128
+ `));var ke=new F({actual:fe,expected:ve,message:ge,operator:ue,stackStartFn:Ie});throw ke.generatedMessage=Te,ke}}ne.match=function fe(ve,ge,Ie){_e(ve,ge,Ie,fe,"match")},ne.doesNotMatch=function fe(ve,ge,Ie){_e(ve,ge,Ie,fe,"doesNotMatch")};function he(){for(var fe=arguments.length,ve=new Array(fe),ge=0;ge<fe;ge++)ve[ge]=arguments[ge];y.apply(void 0,[he,ve.length].concat(ve))}return ne.strict=te(he,ne,{equal:ne.strictEqual,deepEqual:ne.deepStrictEqual,notEqual:ne.notStrictEqual,notDeepEqual:ne.notDeepStrictEqual}),ne.strict.strict=ne.strict,assert$k.exports}var _$c=lodashExports,isHexa=function(e){return _$c.isString(e)?/^[0-9a-fA-F]+$/.test(e):!1},js={isValidJSON:function(e){var a;if(!_$c.isString(e))return!1;try{a=JSON.parse(e)}catch{return!1}return typeof a=="object"},isHexa,isHexaString:isHexa,cloneArray:function(t){return[].concat(t)},defineImmutable:function(e,a){return Object.keys(a).forEach(function(u){Object.defineProperty(e,u,{configurable:!1,enumerable:!0,value:a[u]})}),e},isNaturalNumber:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}};(function(t){var e=require$$1$4;requireAssert();var a=preconditions;function u(d,c){if(d.length!==c.length)return!1;for(var l=d.length,m=0;m<l;m++)if(d[m]!==c[m])return!1;return!0}t.exports={fill:function(c,l){a.checkArgumentType(c,"Buffer","buffer"),a.checkArgumentType(l,"number","value");for(var m=c.length,I=0;I<m;I++)c[I]=l;return c},copy:function(d){var c=Buffer$N.alloc(d.length);return d.copy(c),c},isBuffer:function(c){return e.Buffer.isBuffer(c)||c instanceof Uint8Array},emptyBuffer:function(c){a.checkArgumentType(c,"number","bytes");for(var l=Buffer$N.alloc(c),m=0;m<c;m++)l.write("\0",m);return l},concat:e.Buffer.concat,equals:u,equal:u,integerAsSingleByteBuffer:function(c){return a.checkArgumentType(c,"number","integer"),Buffer$N.from([c&255])},integerAsBuffer:function(c){a.checkArgumentType(c,"number","integer");var l=[];return l.push(c>>24&255),l.push(c>>16&255),l.push(c>>8&255),l.push(c&255),Buffer$N.from(l)},integerFromBuffer:function(c){return a.checkArgumentType(c,"Buffer","buffer"),c[0]<<24|c[1]<<16|c[2]<<8|c[3]},integerFromSingleByteBuffer:function(c){return a.checkArgumentType(c,"Buffer","buffer"),c[0]},bufferToHex:function(c){return a.checkArgumentType(c,"Buffer","buffer"),c.toString("hex")},reverse:function(c){return Buffer$N.from(c).reverse()}},t.exports.NULL_HASH=t.exports.fill(Buffer$N.alloc(32),0),t.exports.EMPTY_BUFFER=Buffer$N.alloc(0)})(buffer$1);var bufferExports=buffer$1.exports,elliptic={};const name$1="elliptic",version$1="6.5.5",description$1="EC cryptography",main$1="lib/elliptic.js",files=["lib"],scripts$1={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository$1={type:"git",url:"git@github.com:indutny/elliptic"},keywords$1=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny <fedor@indutny.com>",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies$1={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies$1={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0$2={name:name$1,version:version$1,description:description$1,main:main$1,files,scripts:scripts$1,repository:repository$1,keywords:keywords$1,author,license,bugs,homepage,devDependencies:devDependencies$1,dependencies:dependencies$1};var utils$m={},bn={exports:{}};bn.exports,function(t){(function(e,a){function u(M,v){if(!M)throw new Error(v||"Assertion failed")}function d(M,v){M.super_=v;var S=function(){};S.prototype=v.prototype,M.prototype=new S,M.prototype.constructor=M}function c(M,v,S){if(c.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((v==="le"||v==="be")&&(S=v,v=10),this._init(M||0,v||10,S||"be"))}typeof e=="object"?e.exports=c:a.BN=c,c.BN=c,c.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=require$$1$4.Buffer}catch{}c.isBN=function(v){return v instanceof c?!0:v!==null&&typeof v=="object"&&v.constructor.wordSize===c.wordSize&&Array.isArray(v.words)},c.max=function(v,S){return v.cmp(S)>0?v:S},c.min=function(v,S){return v.cmp(S)<0?v:S},c.prototype._init=function(v,S,y){if(typeof v=="number")return this._initNumber(v,S,y);if(typeof v=="object")return this._initArray(v,S,y);S==="hex"&&(S=16),u(S===(S|0)&&S>=2&&S<=36),v=v.toString().replace(/\s+/g,"");var w=0;v[0]==="-"&&(w++,this.negative=1),w<v.length&&(S===16?this._parseHex(v,w,y):(this._parseBase(v,S,w),y==="le"&&this._initArray(this.toArray(),S,y)))},c.prototype._initNumber=function(v,S,y){v<0&&(this.negative=1,v=-v),v<67108864?(this.words=[v&67108863],this.length=1):v<4503599627370496?(this.words=[v&67108863,v/67108864&67108863],this.length=2):(u(v<9007199254740992),this.words=[v&67108863,v/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),S,y)},c.prototype._initArray=function(v,S,y){if(u(typeof v.length=="number"),v.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(v.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var P,L,N=0;if(y==="be")for(w=v.length-1,P=0;w>=0;w-=3)L=v[w]|v[w-1]<<8|v[w-2]<<16,this.words[P]|=L<<N&67108863,this.words[P+1]=L>>>26-N&67108863,N+=24,N>=26&&(N-=26,P++);else if(y==="le")for(w=0,P=0;w<v.length;w+=3)L=v[w]|v[w+1]<<8|v[w+2]<<16,this.words[P]|=L<<N&67108863,this.words[P+1]=L>>>26-N&67108863,N+=24,N>=26&&(N-=26,P++);return this.strip()};function m(M,v){var S=M.charCodeAt(v);return S>=65&&S<=70?S-55:S>=97&&S<=102?S-87:S-48&15}function I(M,v,S){var y=m(M,S);return S-1>=v&&(y|=m(M,S-1)<<4),y}c.prototype._parseHex=function(v,S,y){this.length=Math.ceil((v.length-S)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var P=0,L=0,N;if(y==="be")for(w=v.length-1;w>=S;w-=2)N=I(v,S,w)<<P,this.words[L]|=N&67108863,P>=18?(P-=18,L+=1,this.words[L]|=N>>>26):P+=8;else{var E=v.length-S;for(w=E%2===0?S+1:S;w<v.length;w+=2)N=I(v,S,w)<<P,this.words[L]|=N&67108863,P>=18?(P-=18,L+=1,this.words[L]|=N>>>26):P+=8}this.strip()};function O(M,v,S,y){for(var w=0,P=Math.min(M.length,S),L=v;L<P;L++){var N=M.charCodeAt(L)-48;w*=y,N>=49?w+=N-49+10:N>=17?w+=N-17+10:w+=N}return w}c.prototype._parseBase=function(v,S,y){this.words=[0],this.length=1;for(var w=0,P=1;P<=67108863;P*=S)w++;w--,P=P/S|0;for(var L=v.length-y,N=L%w,E=Math.min(L,L-N)+y,A=0,D=y;D<E;D+=w)A=O(v,D,D+w,S),this.imuln(P),this.words[0]+A<67108864?this.words[0]+=A:this._iaddn(A);if(N!==0){var H=1;for(A=O(v,D,v.length,S),D=0;D<N;D++)H*=S;this.imuln(H),this.words[0]+A<67108864?this.words[0]+=A:this._iaddn(A)}this.strip()},c.prototype.copy=function(v){v.words=new Array(this.length);for(var S=0;S<this.length;S++)v.words[S]=this.words[S];v.length=this.length,v.negative=this.negative,v.red=this.red},c.prototype.clone=function(){var v=new c(null);return this.copy(v),v},c.prototype._expand=function(v){for(;this.length<v;)this.words[this.length++]=0;return this},c.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},c.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},c.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var T=["","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],j=[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];c.prototype.toString=function(v,S){v=v||10,S=S|0||1;var y;if(v===16||v==="hex"){y="";for(var w=0,P=0,L=0;L<this.length;L++){var N=this.words[L],E=((N<<w|P)&16777215).toString(16);P=N>>>24-w&16777215,P!==0||L!==this.length-1?y=T[6-E.length]+E+y:y=E+y,w+=2,w>=26&&(w-=26,L--)}for(P!==0&&(y=P.toString(16)+y);y.length%S!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(v===(v|0)&&v>=2&&v<=36){var A=C[v],D=j[v];y="";var H=this.clone();for(H.negative=0;!H.isZero();){var Y=H.modn(D).toString(v);H=H.idivn(D),H.isZero()?y=Y+y:y=T[A-Y.length]+Y+y}for(this.isZero()&&(y="0"+y);y.length%S!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}u(!1,"Base should be between 2 and 36")},c.prototype.toNumber=function(){var v=this.words[0];return this.length===2?v+=this.words[1]*67108864:this.length===3&&this.words[2]===1?v+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-v:v},c.prototype.toJSON=function(){return this.toString(16)},c.prototype.toBuffer=function(v,S){return u(typeof l<"u"),this.toArrayLike(l,v,S)},c.prototype.toArray=function(v,S){return this.toArrayLike(Array,v,S)},c.prototype.toArrayLike=function(v,S,y){var w=this.byteLength(),P=y||Math.max(1,w);u(w<=P,"byte array longer than desired length"),u(P>0,"Requested array length <= 0"),this.strip();var L=S==="le",N=new v(P),E,A,D=this.clone();if(L){for(A=0;!D.isZero();A++)E=D.andln(255),D.iushrn(8),N[A]=E;for(;A<P;A++)N[A]=0}else{for(A=0;A<P-w;A++)N[A]=0;for(A=0;!D.isZero();A++)E=D.andln(255),D.iushrn(8),N[P-A-1]=E}return N},Math.clz32?c.prototype._countBits=function(v){return 32-Math.clz32(v)}:c.prototype._countBits=function(v){var S=v,y=0;return S>=4096&&(y+=13,S>>>=13),S>=64&&(y+=7,S>>>=7),S>=8&&(y+=4,S>>>=4),S>=2&&(y+=2,S>>>=2),y+S},c.prototype._zeroBits=function(v){if(v===0)return 26;var S=v,y=0;return S&8191||(y+=13,S>>>=13),S&127||(y+=7,S>>>=7),S&15||(y+=4,S>>>=4),S&3||(y+=2,S>>>=2),S&1||y++,y},c.prototype.bitLength=function(){var v=this.words[this.length-1],S=this._countBits(v);return(this.length-1)*26+S};function F(M){for(var v=new Array(M.bitLength()),S=0;S<v.length;S++){var y=S/26|0,w=S%26;v[S]=(M.words[y]&1<<w)>>>w}return v}c.prototype.zeroBits=function(){if(this.isZero())return 0;for(var v=0,S=0;S<this.length;S++){var y=this._zeroBits(this.words[S]);if(v+=y,y!==26)break}return v},c.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},c.prototype.toTwos=function(v){return this.negative!==0?this.abs().inotn(v).iaddn(1):this.clone()},c.prototype.fromTwos=function(v){return this.testn(v-1)?this.notn(v).iaddn(1).ineg():this.clone()},c.prototype.isNeg=function(){return this.negative!==0},c.prototype.neg=function(){return this.clone().ineg()},c.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},c.prototype.iuor=function(v){for(;this.length<v.length;)this.words[this.length++]=0;for(var S=0;S<v.length;S++)this.words[S]=this.words[S]|v.words[S];return this.strip()},c.prototype.ior=function(v){return u((this.negative|v.negative)===0),this.iuor(v)},c.prototype.or=function(v){return this.length>v.length?this.clone().ior(v):v.clone().ior(this)},c.prototype.uor=function(v){return this.length>v.length?this.clone().iuor(v):v.clone().iuor(this)},c.prototype.iuand=function(v){var S;this.length>v.length?S=v:S=this;for(var y=0;y<S.length;y++)this.words[y]=this.words[y]&v.words[y];return this.length=S.length,this.strip()},c.prototype.iand=function(v){return u((this.negative|v.negative)===0),this.iuand(v)},c.prototype.and=function(v){return this.length>v.length?this.clone().iand(v):v.clone().iand(this)},c.prototype.uand=function(v){return this.length>v.length?this.clone().iuand(v):v.clone().iuand(this)},c.prototype.iuxor=function(v){var S,y;this.length>v.length?(S=this,y=v):(S=v,y=this);for(var w=0;w<y.length;w++)this.words[w]=S.words[w]^y.words[w];if(this!==S)for(;w<S.length;w++)this.words[w]=S.words[w];return this.length=S.length,this.strip()},c.prototype.ixor=function(v){return u((this.negative|v.negative)===0),this.iuxor(v)},c.prototype.xor=function(v){return this.length>v.length?this.clone().ixor(v):v.clone().ixor(this)},c.prototype.uxor=function(v){return this.length>v.length?this.clone().iuxor(v):v.clone().iuxor(this)},c.prototype.inotn=function(v){u(typeof v=="number"&&v>=0);var S=Math.ceil(v/26)|0,y=v%26;this._expand(S),y>0&&S--;for(var w=0;w<S;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this.strip()},c.prototype.notn=function(v){return this.clone().inotn(v)},c.prototype.setn=function(v,S){u(typeof v=="number"&&v>=0);var y=v/26|0,w=v%26;return this._expand(y+1),S?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this.strip()},c.prototype.iadd=function(v){var S;if(this.negative!==0&&v.negative===0)return this.negative=0,S=this.isub(v),this.negative^=1,this._normSign();if(this.negative===0&&v.negative!==0)return v.negative=0,S=this.isub(v),v.negative=1,S._normSign();var y,w;this.length>v.length?(y=this,w=v):(y=v,w=this);for(var P=0,L=0;L<w.length;L++)S=(y.words[L]|0)+(w.words[L]|0)+P,this.words[L]=S&67108863,P=S>>>26;for(;P!==0&&L<y.length;L++)S=(y.words[L]|0)+P,this.words[L]=S&67108863,P=S>>>26;if(this.length=y.length,P!==0)this.words[this.length]=P,this.length++;else if(y!==this)for(;L<y.length;L++)this.words[L]=y.words[L];return this},c.prototype.add=function(v){var S;return v.negative!==0&&this.negative===0?(v.negative=0,S=this.sub(v),v.negative^=1,S):v.negative===0&&this.negative!==0?(this.negative=0,S=v.sub(this),this.negative=1,S):this.length>v.length?this.clone().iadd(v):v.clone().iadd(this)},c.prototype.isub=function(v){if(v.negative!==0){v.negative=0;var S=this.iadd(v);return v.negative=1,S._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(v),this.negative=1,this._normSign();var y=this.cmp(v);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,P;y>0?(w=this,P=v):(w=v,P=this);for(var L=0,N=0;N<P.length;N++)S=(w.words[N]|0)-(P.words[N]|0)+L,L=S>>26,this.words[N]=S&67108863;for(;L!==0&&N<w.length;N++)S=(w.words[N]|0)+L,L=S>>26,this.words[N]=S&67108863;if(L===0&&N<w.length&&w!==this)for(;N<w.length;N++)this.words[N]=w.words[N];return this.length=Math.max(this.length,N),w!==this&&(this.negative=1),this.strip()},c.prototype.sub=function(v){return this.clone().isub(v)};function U(M,v,S){S.negative=v.negative^M.negative;var y=M.length+v.length|0;S.length=y,y=y-1|0;var w=M.words[0]|0,P=v.words[0]|0,L=w*P,N=L&67108863,E=L/67108864|0;S.words[0]=N;for(var A=1;A<y;A++){for(var D=E>>>26,H=E&67108863,Y=Math.min(A,v.length-1),le=Math.max(0,A-M.length+1);le<=Y;le++){var _e=A-le|0;w=M.words[_e]|0,P=v.words[le]|0,L=w*P+H,D+=L/67108864|0,H=L&67108863}S.words[A]=H|0,E=D|0}return E!==0?S.words[A]=E|0:S.length--,S.strip()}var Z=function(v,S,y){var w=v.words,P=S.words,L=y.words,N=0,E,A,D,H=w[0]|0,Y=H&8191,le=H>>>13,_e=w[1]|0,he=_e&8191,fe=_e>>>13,ve=w[2]|0,ge=ve&8191,Ie=ve>>>13,ue=w[3]|0,ce=ue&8191,Te=ue>>>13,ke=w[4]|0,He=ke&8191,Qe=ke>>>13,it=w[5]|0,rt=it&8191,Fe=it>>>13,wt=w[6]|0,et=wt&8191,At=wt>>>13,gt=w[7]|0,$e=gt&8191,Me=gt>>>13,Ze=w[8]|0,ze=Ze&8191,Ge=Ze>>>13,ht=w[9]|0,oe=ht&8191,ee=ht>>>13,re=P[0]|0,be=re&8191,Pe=re>>>13,Ne=P[1]|0,Oe=Ne&8191,ut=Ne>>>13,lt=P[2]|0,Je=lt&8191,bt=lt>>>13,vt=P[3]|0,ot=vt&8191,Et=vt>>>13,Bt=P[4]|0,Se=Bt&8191,ye=Bt>>>13,xe=P[5]|0,Be=xe&8191,Le=xe>>>13,je=P[6]|0,qe=je&8191,Xe=je>>>13,at=P[7]|0,Ve=at&8191,dt=at>>>13,pt=P[8]|0,Ye=pt&8191,_t=pt>>>13,yt=P[9]|0,ct=yt&8191,$t=yt>>>13;y.negative=v.negative^S.negative,y.length=19,E=Math.imul(Y,be),A=Math.imul(Y,Pe),A=A+Math.imul(le,be)|0,D=Math.imul(le,Pe);var Ct=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,E=Math.imul(he,be),A=Math.imul(he,Pe),A=A+Math.imul(fe,be)|0,D=Math.imul(fe,Pe),E=E+Math.imul(Y,Oe)|0,A=A+Math.imul(Y,ut)|0,A=A+Math.imul(le,Oe)|0,D=D+Math.imul(le,ut)|0;var Nt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,E=Math.imul(ge,be),A=Math.imul(ge,Pe),A=A+Math.imul(Ie,be)|0,D=Math.imul(Ie,Pe),E=E+Math.imul(he,Oe)|0,A=A+Math.imul(he,ut)|0,A=A+Math.imul(fe,Oe)|0,D=D+Math.imul(fe,ut)|0,E=E+Math.imul(Y,Je)|0,A=A+Math.imul(Y,bt)|0,A=A+Math.imul(le,Je)|0,D=D+Math.imul(le,bt)|0;var Jt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,E=Math.imul(ce,be),A=Math.imul(ce,Pe),A=A+Math.imul(Te,be)|0,D=Math.imul(Te,Pe),E=E+Math.imul(ge,Oe)|0,A=A+Math.imul(ge,ut)|0,A=A+Math.imul(Ie,Oe)|0,D=D+Math.imul(Ie,ut)|0,E=E+Math.imul(he,Je)|0,A=A+Math.imul(he,bt)|0,A=A+Math.imul(fe,Je)|0,D=D+Math.imul(fe,bt)|0,E=E+Math.imul(Y,ot)|0,A=A+Math.imul(Y,Et)|0,A=A+Math.imul(le,ot)|0,D=D+Math.imul(le,Et)|0;var Qt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,E=Math.imul(He,be),A=Math.imul(He,Pe),A=A+Math.imul(Qe,be)|0,D=Math.imul(Qe,Pe),E=E+Math.imul(ce,Oe)|0,A=A+Math.imul(ce,ut)|0,A=A+Math.imul(Te,Oe)|0,D=D+Math.imul(Te,ut)|0,E=E+Math.imul(ge,Je)|0,A=A+Math.imul(ge,bt)|0,A=A+Math.imul(Ie,Je)|0,D=D+Math.imul(Ie,bt)|0,E=E+Math.imul(he,ot)|0,A=A+Math.imul(he,Et)|0,A=A+Math.imul(fe,ot)|0,D=D+Math.imul(fe,Et)|0,E=E+Math.imul(Y,Se)|0,A=A+Math.imul(Y,ye)|0,A=A+Math.imul(le,Se)|0,D=D+Math.imul(le,ye)|0;var Wt=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,E=Math.imul(rt,be),A=Math.imul(rt,Pe),A=A+Math.imul(Fe,be)|0,D=Math.imul(Fe,Pe),E=E+Math.imul(He,Oe)|0,A=A+Math.imul(He,ut)|0,A=A+Math.imul(Qe,Oe)|0,D=D+Math.imul(Qe,ut)|0,E=E+Math.imul(ce,Je)|0,A=A+Math.imul(ce,bt)|0,A=A+Math.imul(Te,Je)|0,D=D+Math.imul(Te,bt)|0,E=E+Math.imul(ge,ot)|0,A=A+Math.imul(ge,Et)|0,A=A+Math.imul(Ie,ot)|0,D=D+Math.imul(Ie,Et)|0,E=E+Math.imul(he,Se)|0,A=A+Math.imul(he,ye)|0,A=A+Math.imul(fe,Se)|0,D=D+Math.imul(fe,ye)|0,E=E+Math.imul(Y,Be)|0,A=A+Math.imul(Y,Le)|0,A=A+Math.imul(le,Be)|0,D=D+Math.imul(le,Le)|0;var ur=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(ur>>>26)|0,ur&=67108863,E=Math.imul(et,be),A=Math.imul(et,Pe),A=A+Math.imul(At,be)|0,D=Math.imul(At,Pe),E=E+Math.imul(rt,Oe)|0,A=A+Math.imul(rt,ut)|0,A=A+Math.imul(Fe,Oe)|0,D=D+Math.imul(Fe,ut)|0,E=E+Math.imul(He,Je)|0,A=A+Math.imul(He,bt)|0,A=A+Math.imul(Qe,Je)|0,D=D+Math.imul(Qe,bt)|0,E=E+Math.imul(ce,ot)|0,A=A+Math.imul(ce,Et)|0,A=A+Math.imul(Te,ot)|0,D=D+Math.imul(Te,Et)|0,E=E+Math.imul(ge,Se)|0,A=A+Math.imul(ge,ye)|0,A=A+Math.imul(Ie,Se)|0,D=D+Math.imul(Ie,ye)|0,E=E+Math.imul(he,Be)|0,A=A+Math.imul(he,Le)|0,A=A+Math.imul(fe,Be)|0,D=D+Math.imul(fe,Le)|0,E=E+Math.imul(Y,qe)|0,A=A+Math.imul(Y,Xe)|0,A=A+Math.imul(le,qe)|0,D=D+Math.imul(le,Xe)|0;var vr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(vr>>>26)|0,vr&=67108863,E=Math.imul($e,be),A=Math.imul($e,Pe),A=A+Math.imul(Me,be)|0,D=Math.imul(Me,Pe),E=E+Math.imul(et,Oe)|0,A=A+Math.imul(et,ut)|0,A=A+Math.imul(At,Oe)|0,D=D+Math.imul(At,ut)|0,E=E+Math.imul(rt,Je)|0,A=A+Math.imul(rt,bt)|0,A=A+Math.imul(Fe,Je)|0,D=D+Math.imul(Fe,bt)|0,E=E+Math.imul(He,ot)|0,A=A+Math.imul(He,Et)|0,A=A+Math.imul(Qe,ot)|0,D=D+Math.imul(Qe,Et)|0,E=E+Math.imul(ce,Se)|0,A=A+Math.imul(ce,ye)|0,A=A+Math.imul(Te,Se)|0,D=D+Math.imul(Te,ye)|0,E=E+Math.imul(ge,Be)|0,A=A+Math.imul(ge,Le)|0,A=A+Math.imul(Ie,Be)|0,D=D+Math.imul(Ie,Le)|0,E=E+Math.imul(he,qe)|0,A=A+Math.imul(he,Xe)|0,A=A+Math.imul(fe,qe)|0,D=D+Math.imul(fe,Xe)|0,E=E+Math.imul(Y,Ve)|0,A=A+Math.imul(Y,dt)|0,A=A+Math.imul(le,Ve)|0,D=D+Math.imul(le,dt)|0;var nr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(nr>>>26)|0,nr&=67108863,E=Math.imul(ze,be),A=Math.imul(ze,Pe),A=A+Math.imul(Ge,be)|0,D=Math.imul(Ge,Pe),E=E+Math.imul($e,Oe)|0,A=A+Math.imul($e,ut)|0,A=A+Math.imul(Me,Oe)|0,D=D+Math.imul(Me,ut)|0,E=E+Math.imul(et,Je)|0,A=A+Math.imul(et,bt)|0,A=A+Math.imul(At,Je)|0,D=D+Math.imul(At,bt)|0,E=E+Math.imul(rt,ot)|0,A=A+Math.imul(rt,Et)|0,A=A+Math.imul(Fe,ot)|0,D=D+Math.imul(Fe,Et)|0,E=E+Math.imul(He,Se)|0,A=A+Math.imul(He,ye)|0,A=A+Math.imul(Qe,Se)|0,D=D+Math.imul(Qe,ye)|0,E=E+Math.imul(ce,Be)|0,A=A+Math.imul(ce,Le)|0,A=A+Math.imul(Te,Be)|0,D=D+Math.imul(Te,Le)|0,E=E+Math.imul(ge,qe)|0,A=A+Math.imul(ge,Xe)|0,A=A+Math.imul(Ie,qe)|0,D=D+Math.imul(Ie,Xe)|0,E=E+Math.imul(he,Ve)|0,A=A+Math.imul(he,dt)|0,A=A+Math.imul(fe,Ve)|0,D=D+Math.imul(fe,dt)|0,E=E+Math.imul(Y,Ye)|0,A=A+Math.imul(Y,_t)|0,A=A+Math.imul(le,Ye)|0,D=D+Math.imul(le,_t)|0;var br=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(br>>>26)|0,br&=67108863,E=Math.imul(oe,be),A=Math.imul(oe,Pe),A=A+Math.imul(ee,be)|0,D=Math.imul(ee,Pe),E=E+Math.imul(ze,Oe)|0,A=A+Math.imul(ze,ut)|0,A=A+Math.imul(Ge,Oe)|0,D=D+Math.imul(Ge,ut)|0,E=E+Math.imul($e,Je)|0,A=A+Math.imul($e,bt)|0,A=A+Math.imul(Me,Je)|0,D=D+Math.imul(Me,bt)|0,E=E+Math.imul(et,ot)|0,A=A+Math.imul(et,Et)|0,A=A+Math.imul(At,ot)|0,D=D+Math.imul(At,Et)|0,E=E+Math.imul(rt,Se)|0,A=A+Math.imul(rt,ye)|0,A=A+Math.imul(Fe,Se)|0,D=D+Math.imul(Fe,ye)|0,E=E+Math.imul(He,Be)|0,A=A+Math.imul(He,Le)|0,A=A+Math.imul(Qe,Be)|0,D=D+Math.imul(Qe,Le)|0,E=E+Math.imul(ce,qe)|0,A=A+Math.imul(ce,Xe)|0,A=A+Math.imul(Te,qe)|0,D=D+Math.imul(Te,Xe)|0,E=E+Math.imul(ge,Ve)|0,A=A+Math.imul(ge,dt)|0,A=A+Math.imul(Ie,Ve)|0,D=D+Math.imul(Ie,dt)|0,E=E+Math.imul(he,Ye)|0,A=A+Math.imul(he,_t)|0,A=A+Math.imul(fe,Ye)|0,D=D+Math.imul(fe,_t)|0,E=E+Math.imul(Y,ct)|0,A=A+Math.imul(Y,$t)|0,A=A+Math.imul(le,ct)|0,D=D+Math.imul(le,$t)|0;var ir=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(ir>>>26)|0,ir&=67108863,E=Math.imul(oe,Oe),A=Math.imul(oe,ut),A=A+Math.imul(ee,Oe)|0,D=Math.imul(ee,ut),E=E+Math.imul(ze,Je)|0,A=A+Math.imul(ze,bt)|0,A=A+Math.imul(Ge,Je)|0,D=D+Math.imul(Ge,bt)|0,E=E+Math.imul($e,ot)|0,A=A+Math.imul($e,Et)|0,A=A+Math.imul(Me,ot)|0,D=D+Math.imul(Me,Et)|0,E=E+Math.imul(et,Se)|0,A=A+Math.imul(et,ye)|0,A=A+Math.imul(At,Se)|0,D=D+Math.imul(At,ye)|0,E=E+Math.imul(rt,Be)|0,A=A+Math.imul(rt,Le)|0,A=A+Math.imul(Fe,Be)|0,D=D+Math.imul(Fe,Le)|0,E=E+Math.imul(He,qe)|0,A=A+Math.imul(He,Xe)|0,A=A+Math.imul(Qe,qe)|0,D=D+Math.imul(Qe,Xe)|0,E=E+Math.imul(ce,Ve)|0,A=A+Math.imul(ce,dt)|0,A=A+Math.imul(Te,Ve)|0,D=D+Math.imul(Te,dt)|0,E=E+Math.imul(ge,Ye)|0,A=A+Math.imul(ge,_t)|0,A=A+Math.imul(Ie,Ye)|0,D=D+Math.imul(Ie,_t)|0,E=E+Math.imul(he,ct)|0,A=A+Math.imul(he,$t)|0,A=A+Math.imul(fe,ct)|0,D=D+Math.imul(fe,$t)|0;var gr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(gr>>>26)|0,gr&=67108863,E=Math.imul(oe,Je),A=Math.imul(oe,bt),A=A+Math.imul(ee,Je)|0,D=Math.imul(ee,bt),E=E+Math.imul(ze,ot)|0,A=A+Math.imul(ze,Et)|0,A=A+Math.imul(Ge,ot)|0,D=D+Math.imul(Ge,Et)|0,E=E+Math.imul($e,Se)|0,A=A+Math.imul($e,ye)|0,A=A+Math.imul(Me,Se)|0,D=D+Math.imul(Me,ye)|0,E=E+Math.imul(et,Be)|0,A=A+Math.imul(et,Le)|0,A=A+Math.imul(At,Be)|0,D=D+Math.imul(At,Le)|0,E=E+Math.imul(rt,qe)|0,A=A+Math.imul(rt,Xe)|0,A=A+Math.imul(Fe,qe)|0,D=D+Math.imul(Fe,Xe)|0,E=E+Math.imul(He,Ve)|0,A=A+Math.imul(He,dt)|0,A=A+Math.imul(Qe,Ve)|0,D=D+Math.imul(Qe,dt)|0,E=E+Math.imul(ce,Ye)|0,A=A+Math.imul(ce,_t)|0,A=A+Math.imul(Te,Ye)|0,D=D+Math.imul(Te,_t)|0,E=E+Math.imul(ge,ct)|0,A=A+Math.imul(ge,$t)|0,A=A+Math.imul(Ie,ct)|0,D=D+Math.imul(Ie,$t)|0;var yr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(yr>>>26)|0,yr&=67108863,E=Math.imul(oe,ot),A=Math.imul(oe,Et),A=A+Math.imul(ee,ot)|0,D=Math.imul(ee,Et),E=E+Math.imul(ze,Se)|0,A=A+Math.imul(ze,ye)|0,A=A+Math.imul(Ge,Se)|0,D=D+Math.imul(Ge,ye)|0,E=E+Math.imul($e,Be)|0,A=A+Math.imul($e,Le)|0,A=A+Math.imul(Me,Be)|0,D=D+Math.imul(Me,Le)|0,E=E+Math.imul(et,qe)|0,A=A+Math.imul(et,Xe)|0,A=A+Math.imul(At,qe)|0,D=D+Math.imul(At,Xe)|0,E=E+Math.imul(rt,Ve)|0,A=A+Math.imul(rt,dt)|0,A=A+Math.imul(Fe,Ve)|0,D=D+Math.imul(Fe,dt)|0,E=E+Math.imul(He,Ye)|0,A=A+Math.imul(He,_t)|0,A=A+Math.imul(Qe,Ye)|0,D=D+Math.imul(Qe,_t)|0,E=E+Math.imul(ce,ct)|0,A=A+Math.imul(ce,$t)|0,A=A+Math.imul(Te,ct)|0,D=D+Math.imul(Te,$t)|0;var wr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(wr>>>26)|0,wr&=67108863,E=Math.imul(oe,Se),A=Math.imul(oe,ye),A=A+Math.imul(ee,Se)|0,D=Math.imul(ee,ye),E=E+Math.imul(ze,Be)|0,A=A+Math.imul(ze,Le)|0,A=A+Math.imul(Ge,Be)|0,D=D+Math.imul(Ge,Le)|0,E=E+Math.imul($e,qe)|0,A=A+Math.imul($e,Xe)|0,A=A+Math.imul(Me,qe)|0,D=D+Math.imul(Me,Xe)|0,E=E+Math.imul(et,Ve)|0,A=A+Math.imul(et,dt)|0,A=A+Math.imul(At,Ve)|0,D=D+Math.imul(At,dt)|0,E=E+Math.imul(rt,Ye)|0,A=A+Math.imul(rt,_t)|0,A=A+Math.imul(Fe,Ye)|0,D=D+Math.imul(Fe,_t)|0,E=E+Math.imul(He,ct)|0,A=A+Math.imul(He,$t)|0,A=A+Math.imul(Qe,ct)|0,D=D+Math.imul(Qe,$t)|0;var cr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(cr>>>26)|0,cr&=67108863,E=Math.imul(oe,Be),A=Math.imul(oe,Le),A=A+Math.imul(ee,Be)|0,D=Math.imul(ee,Le),E=E+Math.imul(ze,qe)|0,A=A+Math.imul(ze,Xe)|0,A=A+Math.imul(Ge,qe)|0,D=D+Math.imul(Ge,Xe)|0,E=E+Math.imul($e,Ve)|0,A=A+Math.imul($e,dt)|0,A=A+Math.imul(Me,Ve)|0,D=D+Math.imul(Me,dt)|0,E=E+Math.imul(et,Ye)|0,A=A+Math.imul(et,_t)|0,A=A+Math.imul(At,Ye)|0,D=D+Math.imul(At,_t)|0,E=E+Math.imul(rt,ct)|0,A=A+Math.imul(rt,$t)|0,A=A+Math.imul(Fe,ct)|0,D=D+Math.imul(Fe,$t)|0;var dr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(dr>>>26)|0,dr&=67108863,E=Math.imul(oe,qe),A=Math.imul(oe,Xe),A=A+Math.imul(ee,qe)|0,D=Math.imul(ee,Xe),E=E+Math.imul(ze,Ve)|0,A=A+Math.imul(ze,dt)|0,A=A+Math.imul(Ge,Ve)|0,D=D+Math.imul(Ge,dt)|0,E=E+Math.imul($e,Ye)|0,A=A+Math.imul($e,_t)|0,A=A+Math.imul(Me,Ye)|0,D=D+Math.imul(Me,_t)|0,E=E+Math.imul(et,ct)|0,A=A+Math.imul(et,$t)|0,A=A+Math.imul(At,ct)|0,D=D+Math.imul(At,$t)|0;var lr=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(lr>>>26)|0,lr&=67108863,E=Math.imul(oe,Ve),A=Math.imul(oe,dt),A=A+Math.imul(ee,Ve)|0,D=Math.imul(ee,dt),E=E+Math.imul(ze,Ye)|0,A=A+Math.imul(ze,_t)|0,A=A+Math.imul(Ge,Ye)|0,D=D+Math.imul(Ge,_t)|0,E=E+Math.imul($e,ct)|0,A=A+Math.imul($e,$t)|0,A=A+Math.imul(Me,ct)|0,D=D+Math.imul(Me,$t)|0;var _r=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(_r>>>26)|0,_r&=67108863,E=Math.imul(oe,Ye),A=Math.imul(oe,_t),A=A+Math.imul(ee,Ye)|0,D=Math.imul(ee,_t),E=E+Math.imul(ze,ct)|0,A=A+Math.imul(ze,$t)|0,A=A+Math.imul(Ge,ct)|0,D=D+Math.imul(Ge,$t)|0;var Ar=(N+E|0)+((A&8191)<<13)|0;N=(D+(A>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,E=Math.imul(oe,ct),A=Math.imul(oe,$t),A=A+Math.imul(ee,ct)|0,D=Math.imul(ee,$t);var Nr=(N+E|0)+((A&8191)<<13)|0;return N=(D+(A>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,L[0]=Ct,L[1]=Nt,L[2]=Jt,L[3]=Qt,L[4]=Wt,L[5]=ur,L[6]=vr,L[7]=nr,L[8]=br,L[9]=ir,L[10]=gr,L[11]=yr,L[12]=wr,L[13]=cr,L[14]=dr,L[15]=lr,L[16]=_r,L[17]=Ar,L[18]=Nr,N!==0&&(L[19]=N,y.length++),y};Math.imul||(Z=U);function J(M,v,S){S.negative=v.negative^M.negative,S.length=M.length+v.length;for(var y=0,w=0,P=0;P<S.length-1;P++){var L=w;w=0;for(var N=y&67108863,E=Math.min(P,v.length-1),A=Math.max(0,P-M.length+1);A<=E;A++){var D=P-A,H=M.words[D]|0,Y=v.words[A]|0,le=H*Y,_e=le&67108863;L=L+(le/67108864|0)|0,_e=_e+N|0,N=_e&67108863,L=L+(_e>>>26)|0,w+=L>>>26,L&=67108863}S.words[P]=N,y=L,L=w}return y!==0?S.words[P]=y:S.length--,S.strip()}function X(M,v,S){var y=new Q;return y.mulp(M,v,S)}c.prototype.mulTo=function(v,S){var y,w=this.length+v.length;return this.length===10&&v.length===10?y=Z(this,v,S):w<63?y=U(this,v,S):w<1024?y=J(this,v,S):y=X(this,v,S),y};function Q(M,v){this.x=M,this.y=v}Q.prototype.makeRBT=function(v){for(var S=new Array(v),y=c.prototype._countBits(v)-1,w=0;w<v;w++)S[w]=this.revBin(w,y,v);return S},Q.prototype.revBin=function(v,S,y){if(v===0||v===y-1)return v;for(var w=0,P=0;P<S;P++)w|=(v&1)<<S-P-1,v>>=1;return w},Q.prototype.permute=function(v,S,y,w,P,L){for(var N=0;N<L;N++)w[N]=S[v[N]],P[N]=y[v[N]]},Q.prototype.transform=function(v,S,y,w,P,L){this.permute(L,v,S,y,w,P);for(var N=1;N<P;N<<=1)for(var E=N<<1,A=Math.cos(2*Math.PI/E),D=Math.sin(2*Math.PI/E),H=0;H<P;H+=E)for(var Y=A,le=D,_e=0;_e<N;_e++){var he=y[H+_e],fe=w[H+_e],ve=y[H+_e+N],ge=w[H+_e+N],Ie=Y*ve-le*ge;ge=Y*ge+le*ve,ve=Ie,y[H+_e]=he+ve,w[H+_e]=fe+ge,y[H+_e+N]=he-ve,w[H+_e+N]=fe-ge,_e!==E&&(Ie=A*Y-D*le,le=A*le+D*Y,Y=Ie)}},Q.prototype.guessLen13b=function(v,S){var y=Math.max(S,v)|1,w=y&1,P=0;for(y=y/2|0;y;y=y>>>1)P++;return 1<<P+1+w},Q.prototype.conjugate=function(v,S,y){if(!(y<=1))for(var w=0;w<y/2;w++){var P=v[w];v[w]=v[y-w-1],v[y-w-1]=P,P=S[w],S[w]=-S[y-w-1],S[y-w-1]=-P}},Q.prototype.normalize13b=function(v,S){for(var y=0,w=0;w<S/2;w++){var P=Math.round(v[2*w+1]/S)*8192+Math.round(v[2*w]/S)+y;v[w]=P&67108863,P<67108864?y=0:y=P/67108864|0}return v},Q.prototype.convert13b=function(v,S,y,w){for(var P=0,L=0;L<S;L++)P=P+(v[L]|0),y[2*L]=P&8191,P=P>>>13,y[2*L+1]=P&8191,P=P>>>13;for(L=2*S;L<w;++L)y[L]=0;u(P===0),u((P&-8192)===0)},Q.prototype.stub=function(v){for(var S=new Array(v),y=0;y<v;y++)S[y]=0;return S},Q.prototype.mulp=function(v,S,y){var w=2*this.guessLen13b(v.length,S.length),P=this.makeRBT(w),L=this.stub(w),N=new Array(w),E=new Array(w),A=new Array(w),D=new Array(w),H=new Array(w),Y=new Array(w),le=y.words;le.length=w,this.convert13b(v.words,v.length,N,w),this.convert13b(S.words,S.length,D,w),this.transform(N,L,E,A,w,P),this.transform(D,L,H,Y,w,P);for(var _e=0;_e<w;_e++){var he=E[_e]*H[_e]-A[_e]*Y[_e];A[_e]=E[_e]*Y[_e]+A[_e]*H[_e],E[_e]=he}return this.conjugate(E,A,w),this.transform(E,A,le,L,w,P),this.conjugate(le,L,w),this.normalize13b(le,w),y.negative=v.negative^S.negative,y.length=v.length+S.length,y.strip()},c.prototype.mul=function(v){var S=new c(null);return S.words=new Array(this.length+v.length),this.mulTo(v,S)},c.prototype.mulf=function(v){var S=new c(null);return S.words=new Array(this.length+v.length),X(this,v,S)},c.prototype.imul=function(v){return this.clone().mulTo(v,this)},c.prototype.imuln=function(v){u(typeof v=="number"),u(v<67108864);for(var S=0,y=0;y<this.length;y++){var w=(this.words[y]|0)*v,P=(w&67108863)+(S&67108863);S>>=26,S+=w/67108864|0,S+=P>>>26,this.words[y]=P&67108863}return S!==0&&(this.words[y]=S,this.length++),this},c.prototype.muln=function(v){return this.clone().imuln(v)},c.prototype.sqr=function(){return this.mul(this)},c.prototype.isqr=function(){return this.imul(this.clone())},c.prototype.pow=function(v){var S=F(v);if(S.length===0)return new c(1);for(var y=this,w=0;w<S.length&&S[w]===0;w++,y=y.sqr());if(++w<S.length)for(var P=y.sqr();w<S.length;w++,P=P.sqr())S[w]!==0&&(y=y.mul(P));return y},c.prototype.iushln=function(v){u(typeof v=="number"&&v>=0);var S=v%26,y=(v-S)/26,w=67108863>>>26-S<<26-S,P;if(S!==0){var L=0;for(P=0;P<this.length;P++){var N=this.words[P]&w,E=(this.words[P]|0)-N<<S;this.words[P]=E|L,L=N>>>26-S}L&&(this.words[P]=L,this.length++)}if(y!==0){for(P=this.length-1;P>=0;P--)this.words[P+y]=this.words[P];for(P=0;P<y;P++)this.words[P]=0;this.length+=y}return this.strip()},c.prototype.ishln=function(v){return u(this.negative===0),this.iushln(v)},c.prototype.iushrn=function(v,S,y){u(typeof v=="number"&&v>=0);var w;S?w=(S-S%26)/26:w=0;var P=v%26,L=Math.min((v-P)/26,this.length),N=67108863^67108863>>>P<<P,E=y;if(w-=L,w=Math.max(0,w),E){for(var A=0;A<L;A++)E.words[A]=this.words[A];E.length=L}if(L!==0)if(this.length>L)for(this.length-=L,A=0;A<this.length;A++)this.words[A]=this.words[A+L];else this.words[0]=0,this.length=1;var D=0;for(A=this.length-1;A>=0&&(D!==0||A>=w);A--){var H=this.words[A]|0;this.words[A]=D<<26-P|H>>>P,D=H&N}return E&&D!==0&&(E.words[E.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},c.prototype.ishrn=function(v,S,y){return u(this.negative===0),this.iushrn(v,S,y)},c.prototype.shln=function(v){return this.clone().ishln(v)},c.prototype.ushln=function(v){return this.clone().iushln(v)},c.prototype.shrn=function(v){return this.clone().ishrn(v)},c.prototype.ushrn=function(v){return this.clone().iushrn(v)},c.prototype.testn=function(v){u(typeof v=="number"&&v>=0);var S=v%26,y=(v-S)/26,w=1<<S;if(this.length<=y)return!1;var P=this.words[y];return!!(P&w)},c.prototype.imaskn=function(v){u(typeof v=="number"&&v>=0);var S=v%26,y=(v-S)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(S!==0&&y++,this.length=Math.min(y,this.length),S!==0){var w=67108863^67108863>>>S<<S;this.words[this.length-1]&=w}return this.strip()},c.prototype.maskn=function(v){return this.clone().imaskn(v)},c.prototype.iaddn=function(v){return u(typeof v=="number"),u(v<67108864),v<0?this.isubn(-v):this.negative!==0?this.length===1&&(this.words[0]|0)<v?(this.words[0]=v-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(v),this.negative=1,this):this._iaddn(v)},c.prototype._iaddn=function(v){this.words[0]+=v;for(var S=0;S<this.length&&this.words[S]>=67108864;S++)this.words[S]-=67108864,S===this.length-1?this.words[S+1]=1:this.words[S+1]++;return this.length=Math.max(this.length,S+1),this},c.prototype.isubn=function(v){if(u(typeof v=="number"),u(v<67108864),v<0)return this.iaddn(-v);if(this.negative!==0)return this.negative=0,this.iaddn(v),this.negative=1,this;if(this.words[0]-=v,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var S=0;S<this.length&&this.words[S]<0;S++)this.words[S]+=67108864,this.words[S+1]-=1;return this.strip()},c.prototype.addn=function(v){return this.clone().iaddn(v)},c.prototype.subn=function(v){return this.clone().isubn(v)},c.prototype.iabs=function(){return this.negative=0,this},c.prototype.abs=function(){return this.clone().iabs()},c.prototype._ishlnsubmul=function(v,S,y){var w=v.length+y,P;this._expand(w);var L,N=0;for(P=0;P<v.length;P++){L=(this.words[P+y]|0)+N;var E=(v.words[P]|0)*S;L-=E&67108863,N=(L>>26)-(E/67108864|0),this.words[P+y]=L&67108863}for(;P<this.length-y;P++)L=(this.words[P+y]|0)+N,N=L>>26,this.words[P+y]=L&67108863;if(N===0)return this.strip();for(u(N===-1),N=0,P=0;P<this.length;P++)L=-(this.words[P]|0)+N,N=L>>26,this.words[P]=L&67108863;return this.negative=1,this.strip()},c.prototype._wordDiv=function(v,S){var y=this.length-v.length,w=this.clone(),P=v,L=P.words[P.length-1]|0,N=this._countBits(L);y=26-N,y!==0&&(P=P.ushln(y),w.iushln(y),L=P.words[P.length-1]|0);var E=w.length-P.length,A;if(S!=="mod"){A=new c(null),A.length=E+1,A.words=new Array(A.length);for(var D=0;D<A.length;D++)A.words[D]=0}var H=w.clone()._ishlnsubmul(P,1,E);H.negative===0&&(w=H,A&&(A.words[E]=1));for(var Y=E-1;Y>=0;Y--){var le=(w.words[P.length+Y]|0)*67108864+(w.words[P.length+Y-1]|0);for(le=Math.min(le/L|0,67108863),w._ishlnsubmul(P,le,Y);w.negative!==0;)le--,w.negative=0,w._ishlnsubmul(P,1,Y),w.isZero()||(w.negative^=1);A&&(A.words[Y]=le)}return A&&A.strip(),w.strip(),S!=="div"&&y!==0&&w.iushrn(y),{div:A||null,mod:w}},c.prototype.divmod=function(v,S,y){if(u(!v.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var w,P,L;return this.negative!==0&&v.negative===0?(L=this.neg().divmod(v,S),S!=="mod"&&(w=L.div.neg()),S!=="div"&&(P=L.mod.neg(),y&&P.negative!==0&&P.iadd(v)),{div:w,mod:P}):this.negative===0&&v.negative!==0?(L=this.divmod(v.neg(),S),S!=="mod"&&(w=L.div.neg()),{div:w,mod:L.mod}):this.negative&v.negative?(L=this.neg().divmod(v.neg(),S),S!=="div"&&(P=L.mod.neg(),y&&P.negative!==0&&P.isub(v)),{div:L.div,mod:P}):v.length>this.length||this.cmp(v)<0?{div:new c(0),mod:this}:v.length===1?S==="div"?{div:this.divn(v.words[0]),mod:null}:S==="mod"?{div:null,mod:new c(this.modn(v.words[0]))}:{div:this.divn(v.words[0]),mod:new c(this.modn(v.words[0]))}:this._wordDiv(v,S)},c.prototype.div=function(v){return this.divmod(v,"div",!1).div},c.prototype.mod=function(v){return this.divmod(v,"mod",!1).mod},c.prototype.umod=function(v){return this.divmod(v,"mod",!0).mod},c.prototype.divRound=function(v){var S=this.divmod(v);if(S.mod.isZero())return S.div;var y=S.div.negative!==0?S.mod.isub(v):S.mod,w=v.ushrn(1),P=v.andln(1),L=y.cmp(w);return L<0||P===1&&L===0?S.div:S.div.negative!==0?S.div.isubn(1):S.div.iaddn(1)},c.prototype.modn=function(v){u(v<=67108863);for(var S=(1<<26)%v,y=0,w=this.length-1;w>=0;w--)y=(S*y+(this.words[w]|0))%v;return y},c.prototype.idivn=function(v){u(v<=67108863);for(var S=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+S*67108864;this.words[y]=w/v|0,S=w%v}return this.strip()},c.prototype.divn=function(v){return this.clone().idivn(v)},c.prototype.egcd=function(v){u(v.negative===0),u(!v.isZero());var S=this,y=v.clone();S.negative!==0?S=S.umod(v):S=S.clone();for(var w=new c(1),P=new c(0),L=new c(0),N=new c(1),E=0;S.isEven()&&y.isEven();)S.iushrn(1),y.iushrn(1),++E;for(var A=y.clone(),D=S.clone();!S.isZero();){for(var H=0,Y=1;!(S.words[0]&Y)&&H<26;++H,Y<<=1);if(H>0)for(S.iushrn(H);H-- >0;)(w.isOdd()||P.isOdd())&&(w.iadd(A),P.isub(D)),w.iushrn(1),P.iushrn(1);for(var le=0,_e=1;!(y.words[0]&_e)&&le<26;++le,_e<<=1);if(le>0)for(y.iushrn(le);le-- >0;)(L.isOdd()||N.isOdd())&&(L.iadd(A),N.isub(D)),L.iushrn(1),N.iushrn(1);S.cmp(y)>=0?(S.isub(y),w.isub(L),P.isub(N)):(y.isub(S),L.isub(w),N.isub(P))}return{a:L,b:N,gcd:y.iushln(E)}},c.prototype._invmp=function(v){u(v.negative===0),u(!v.isZero());var S=this,y=v.clone();S.negative!==0?S=S.umod(v):S=S.clone();for(var w=new c(1),P=new c(0),L=y.clone();S.cmpn(1)>0&&y.cmpn(1)>0;){for(var N=0,E=1;!(S.words[0]&E)&&N<26;++N,E<<=1);if(N>0)for(S.iushrn(N);N-- >0;)w.isOdd()&&w.iadd(L),w.iushrn(1);for(var A=0,D=1;!(y.words[0]&D)&&A<26;++A,D<<=1);if(A>0)for(y.iushrn(A);A-- >0;)P.isOdd()&&P.iadd(L),P.iushrn(1);S.cmp(y)>=0?(S.isub(y),w.isub(P)):(y.isub(S),P.isub(w))}var H;return S.cmpn(1)===0?H=w:H=P,H.cmpn(0)<0&&H.iadd(v),H},c.prototype.gcd=function(v){if(this.isZero())return v.abs();if(v.isZero())return this.abs();var S=this.clone(),y=v.clone();S.negative=0,y.negative=0;for(var w=0;S.isEven()&&y.isEven();w++)S.iushrn(1),y.iushrn(1);do{for(;S.isEven();)S.iushrn(1);for(;y.isEven();)y.iushrn(1);var P=S.cmp(y);if(P<0){var L=S;S=y,y=L}else if(P===0||y.cmpn(1)===0)break;S.isub(y)}while(!0);return y.iushln(w)},c.prototype.invm=function(v){return this.egcd(v).a.umod(v)},c.prototype.isEven=function(){return(this.words[0]&1)===0},c.prototype.isOdd=function(){return(this.words[0]&1)===1},c.prototype.andln=function(v){return this.words[0]&v},c.prototype.bincn=function(v){u(typeof v=="number");var S=v%26,y=(v-S)/26,w=1<<S;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var P=w,L=y;P!==0&&L<this.length;L++){var N=this.words[L]|0;N+=P,P=N>>>26,N&=67108863,this.words[L]=N}return P!==0&&(this.words[L]=P,this.length++),this},c.prototype.isZero=function(){return this.length===1&&this.words[0]===0},c.prototype.cmpn=function(v){var S=v<0;if(this.negative!==0&&!S)return-1;if(this.negative===0&&S)return 1;this.strip();var y;if(this.length>1)y=1;else{S&&(v=-v),u(v<=67108863,"Number is too big");var w=this.words[0]|0;y=w===v?0:w<v?-1:1}return this.negative!==0?-y|0:y},c.prototype.cmp=function(v){if(this.negative!==0&&v.negative===0)return-1;if(this.negative===0&&v.negative!==0)return 1;var S=this.ucmp(v);return this.negative!==0?-S|0:S},c.prototype.ucmp=function(v){if(this.length>v.length)return 1;if(this.length<v.length)return-1;for(var S=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,P=v.words[y]|0;if(w!==P){w<P?S=-1:w>P&&(S=1);break}}return S},c.prototype.gtn=function(v){return this.cmpn(v)===1},c.prototype.gt=function(v){return this.cmp(v)===1},c.prototype.gten=function(v){return this.cmpn(v)>=0},c.prototype.gte=function(v){return this.cmp(v)>=0},c.prototype.ltn=function(v){return this.cmpn(v)===-1},c.prototype.lt=function(v){return this.cmp(v)===-1},c.prototype.lten=function(v){return this.cmpn(v)<=0},c.prototype.lte=function(v){return this.cmp(v)<=0},c.prototype.eqn=function(v){return this.cmpn(v)===0},c.prototype.eq=function(v){return this.cmp(v)===0},c.red=function(v){return new ae(v)},c.prototype.toRed=function(v){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),v.convertTo(this)._forceRed(v)},c.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},c.prototype._forceRed=function(v){return this.red=v,this},c.prototype.forceRed=function(v){return u(!this.red,"Already a number in reduction context"),this._forceRed(v)},c.prototype.redAdd=function(v){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,v)},c.prototype.redIAdd=function(v){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,v)},c.prototype.redSub=function(v){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,v)},c.prototype.redISub=function(v){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,v)},c.prototype.redShl=function(v){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,v)},c.prototype.redMul=function(v){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.mul(this,v)},c.prototype.redIMul=function(v){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,v),this.red.imul(this,v)},c.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},c.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},c.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},c.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},c.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},c.prototype.redPow=function(v){return u(this.red&&!v.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,v)};var te={k256:null,p224:null,p192:null,p25519:null};function se(M,v){this.name=M,this.p=new c(v,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}se.prototype._tmp=function(){var v=new c(null);return v.words=new Array(Math.ceil(this.n/13)),v},se.prototype.ireduce=function(v){var S=v,y;do this.split(S,this.tmp),S=this.imulK(S),S=S.iadd(this.tmp),y=S.bitLength();while(y>this.n);var w=y<this.n?-1:S.ucmp(this.p);return w===0?(S.words[0]=0,S.length=1):w>0?S.isub(this.p):S.strip!==void 0?S.strip():S._strip(),S},se.prototype.split=function(v,S){v.iushrn(this.n,0,S)},se.prototype.imulK=function(v){return v.imul(this.k)};function pe(){se.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(pe,se),pe.prototype.split=function(v,S){for(var y=4194303,w=Math.min(v.length,9),P=0;P<w;P++)S.words[P]=v.words[P];if(S.length=w,v.length<=9){v.words[0]=0,v.length=1;return}var L=v.words[9];for(S.words[S.length++]=L&y,P=10;P<v.length;P++){var N=v.words[P]|0;v.words[P-10]=(N&y)<<4|L>>>22,L=N}L>>>=22,v.words[P-10]=L,L===0&&v.length>10?v.length-=10:v.length-=9},pe.prototype.imulK=function(v){v.words[v.length]=0,v.words[v.length+1]=0,v.length+=2;for(var S=0,y=0;y<v.length;y++){var w=v.words[y]|0;S+=w*977,v.words[y]=S&67108863,S=w*64+(S/67108864|0)}return v.words[v.length-1]===0&&(v.length--,v.words[v.length-1]===0&&v.length--),v};function me(){se.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(me,se);function Ee(){se.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(Ee,se);function V(){se.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(V,se),V.prototype.imulK=function(v){for(var S=0,y=0;y<v.length;y++){var w=(v.words[y]|0)*19+S,P=w&67108863;w>>>=26,v.words[y]=P,S=w}return S!==0&&(v.words[v.length++]=S),v},c._prime=function(v){if(te[v])return te[v];var S;if(v==="k256")S=new pe;else if(v==="p224")S=new me;else if(v==="p192")S=new Ee;else if(v==="p25519")S=new V;else throw new Error("Unknown prime "+v);return te[v]=S,S};function ae(M){if(typeof M=="string"){var v=c._prime(M);this.m=v.p,this.prime=v}else u(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}ae.prototype._verify1=function(v){u(v.negative===0,"red works only with positives"),u(v.red,"red works only with red numbers")},ae.prototype._verify2=function(v,S){u((v.negative|S.negative)===0,"red works only with positives"),u(v.red&&v.red===S.red,"red works only with red numbers")},ae.prototype.imod=function(v){return this.prime?this.prime.ireduce(v)._forceRed(this):v.umod(this.m)._forceRed(this)},ae.prototype.neg=function(v){return v.isZero()?v.clone():this.m.sub(v)._forceRed(this)},ae.prototype.add=function(v,S){this._verify2(v,S);var y=v.add(S);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},ae.prototype.iadd=function(v,S){this._verify2(v,S);var y=v.iadd(S);return y.cmp(this.m)>=0&&y.isub(this.m),y},ae.prototype.sub=function(v,S){this._verify2(v,S);var y=v.sub(S);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},ae.prototype.isub=function(v,S){this._verify2(v,S);var y=v.isub(S);return y.cmpn(0)<0&&y.iadd(this.m),y},ae.prototype.shl=function(v,S){return this._verify1(v),this.imod(v.ushln(S))},ae.prototype.imul=function(v,S){return this._verify2(v,S),this.imod(v.imul(S))},ae.prototype.mul=function(v,S){return this._verify2(v,S),this.imod(v.mul(S))},ae.prototype.isqr=function(v){return this.imul(v,v.clone())},ae.prototype.sqr=function(v){return this.mul(v,v)},ae.prototype.sqrt=function(v){if(v.isZero())return v.clone();var S=this.m.andln(3);if(u(S%2===1),S===3){var y=this.m.add(new c(1)).iushrn(2);return this.pow(v,y)}for(var w=this.m.subn(1),P=0;!w.isZero()&&w.andln(1)===0;)P++,w.iushrn(1);u(!w.isZero());var L=new c(1).toRed(this),N=L.redNeg(),E=this.m.subn(1).iushrn(1),A=this.m.bitLength();for(A=new c(2*A*A).toRed(this);this.pow(A,E).cmp(N)!==0;)A.redIAdd(N);for(var D=this.pow(A,w),H=this.pow(v,w.addn(1).iushrn(1)),Y=this.pow(v,w),le=P;Y.cmp(L)!==0;){for(var _e=Y,he=0;_e.cmp(L)!==0;he++)_e=_e.redSqr();u(he<le);var fe=this.pow(D,new c(1).iushln(le-he-1));H=H.redMul(fe),D=fe.redSqr(),Y=Y.redMul(D),le=he}return H},ae.prototype.invm=function(v){var S=v._invmp(this.m);return S.negative!==0?(S.negative=0,this.imod(S).redNeg()):this.imod(S)},ae.prototype.pow=function(v,S){if(S.isZero())return new c(1).toRed(this);if(S.cmpn(1)===0)return v.clone();var y=4,w=new Array(1<<y);w[0]=new c(1).toRed(this),w[1]=v;for(var P=2;P<w.length;P++)w[P]=this.mul(w[P-1],v);var L=w[0],N=0,E=0,A=S.bitLength()%26;for(A===0&&(A=26),P=S.length-1;P>=0;P--){for(var D=S.words[P],H=A-1;H>=0;H--){var Y=D>>H&1;if(L!==w[0]&&(L=this.sqr(L)),Y===0&&N===0){E=0;continue}N<<=1,N|=Y,E++,!(E!==y&&(P!==0||H!==0))&&(L=this.mul(L,w[N]),E=0,N=0)}A=26}return L},ae.prototype.convertTo=function(v){var S=v.umod(this.m);return S===v?S.clone():S},ae.prototype.convertFrom=function(v){var S=v.clone();return S.red=null,S},c.mont=function(v){return new ne(v)};function ne(M){ae.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}d(ne,ae),ne.prototype.convertTo=function(v){return this.imod(v.ushln(this.shift))},ne.prototype.convertFrom=function(v){var S=this.imod(v.mul(this.rinv));return S.red=null,S},ne.prototype.imul=function(v,S){if(v.isZero()||S.isZero())return v.words[0]=0,v.length=1,v;var y=v.imul(S),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=y.isub(w).iushrn(this.shift),L=P;return P.cmp(this.m)>=0?L=P.isub(this.m):P.cmpn(0)<0&&(L=P.iadd(this.m)),L._forceRed(this)},ne.prototype.mul=function(v,S){if(v.isZero()||S.isZero())return new c(0)._forceRed(this);var y=v.mul(S),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=y.isub(w).iushrn(this.shift),L=P;return P.cmp(this.m)>=0?L=P.isub(this.m):P.cmpn(0)<0&&(L=P.iadd(this.m)),L._forceRed(this)},ne.prototype.invm=function(v){var S=this.imod(v._invmp(this.m).mul(this.r2));return S._forceRed(this)}})(t,commonjsGlobal)}(bn);var bnExports=bn.exports,minimalisticAssert=assert$j;function assert$j(t,e){if(!t)throw new Error(e||"Assertion failed")}assert$j.equal=function(e,a,u){if(e!=a)throw new Error(u||"Assertion failed: "+e+" != "+a)};var utils$l={};(function(t){var e=t;function a(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var m=[];if(typeof c!="string"){for(var I=0;I<c.length;I++)m[I]=c[I]|0;return m}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var I=0;I<c.length;I+=2)m.push(parseInt(c[I]+c[I+1],16))}else for(var I=0;I<c.length;I++){var O=c.charCodeAt(I),T=O>>8,C=O&255;T?m.push(T,C):m.push(C)}return m}e.toArray=a;function u(c){return c.length===1?"0"+c:c}e.zero2=u;function d(c){for(var l="",m=0;m<c.length;m++)l+=u(c[m].toString(16));return l}e.toHex=d,e.encode=function(l,m){return m==="hex"?d(l):l}})(utils$l),function(t){var e=t,a=bnExports,u=minimalisticAssert,d=utils$l;e.assert=u,e.toArray=d.toArray,e.zero2=d.zero2,e.toHex=d.toHex,e.encode=d.encode;function c(T,C,j){var F=new Array(Math.max(T.bitLength(),j)+1),U;for(U=0;U<F.length;U+=1)F[U]=0;var Z=1<<C+1,J=T.clone();for(U=0;U<F.length;U++){var X,Q=J.andln(Z-1);J.isOdd()?(Q>(Z>>1)-1?X=(Z>>1)-Q:X=Q,J.isubn(X)):X=0,F[U]=X,J.iushrn(1)}return F}e.getNAF=c;function l(T,C){var j=[[],[]];T=T.clone(),C=C.clone();for(var F=0,U=0,Z;T.cmpn(-F)>0||C.cmpn(-U)>0;){var J=T.andln(3)+F&3,X=C.andln(3)+U&3;J===3&&(J=-1),X===3&&(X=-1);var Q;J&1?(Z=T.andln(7)+F&7,(Z===3||Z===5)&&X===2?Q=-J:Q=J):Q=0,j[0].push(Q);var te;X&1?(Z=C.andln(7)+U&7,(Z===3||Z===5)&&J===2?te=-X:te=X):te=0,j[1].push(te),2*F===Q+1&&(F=1-F),2*U===te+1&&(U=1-U),T.iushrn(1),C.iushrn(1)}return j}e.getJSF=l;function m(T,C,j){var F="_"+C;T.prototype[C]=function(){return this[F]!==void 0?this[F]:this[F]=j.call(this)}}e.cachedProperty=m;function I(T){return typeof T=="string"?e.toArray(T,"hex"):T}e.parseBytes=I;function O(T){return new a(T,"hex","le")}e.intFromLE=O}(utils$m);var brorand={exports:{}},r$1;brorand.exports=function(e){return r$1||(r$1=new Rand(null)),r$1.generate(e)};function Rand(t){this.rand=t}if(brorand.exports.Rand=Rand,Rand.prototype.generate=function(e){return this._rand(e)},Rand.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var a=new Uint8Array(e),u=0;u<a.length;u++)a[u]=this.rand.getByte();return a},typeof self=="object")self.crypto&&self.crypto.getRandomValues?Rand.prototype._rand=function(e){var a=new Uint8Array(e);return self.crypto.getRandomValues(a),a}:self.msCrypto&&self.msCrypto.getRandomValues?Rand.prototype._rand=function(e){var a=new Uint8Array(e);return self.msCrypto.getRandomValues(a),a}:typeof window=="object"&&(Rand.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var crypto$2=requireCryptoBrowserify();if(typeof crypto$2.randomBytes!="function")throw new Error("Not supported");Rand.prototype._rand=function(e){return crypto$2.randomBytes(e)}}catch{}var brorandExports=brorand.exports,curve$6={},BN$d=bnExports,utils$k=utils$m,getNAF=utils$k.getNAF,getJSF=utils$k.getJSF,assert$i=utils$k.assert;function BaseCurve(t,e){this.type=t,this.p=new BN$d(e.p,16),this.red=e.prime?BN$d.red(e.prime):BN$d.mont(this.p),this.zero=new BN$d(0).toRed(this.red),this.one=new BN$d(1).toRed(this.red),this.two=new BN$d(2).toRed(this.red),this.n=e.n&&new BN$d(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 a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$1=BaseCurve;BaseCurve.prototype.point=function(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function(e,a){assert$i(e.precomputed);var u=e._getDoubles(),d=getNAF(a,1,this._bitLength),c=(1<<u.step+1)-(u.step%2===0?2:1);c/=3;var l=[],m,I;for(m=0;m<d.length;m+=u.step){I=0;for(var O=m+u.step-1;O>=m;O--)I=(I<<1)+d[O];l.push(I)}for(var T=this.jpoint(null,null,null),C=this.jpoint(null,null,null),j=c;j>0;j--){for(m=0;m<l.length;m++)I=l[m],I===j?C=C.mixedAdd(u.points[m]):I===-j&&(C=C.mixedAdd(u.points[m].neg()));T=T.add(C)}return T.toP()},BaseCurve.prototype._wnafMul=function(e,a){var u=4,d=e._getNAFPoints(u);u=d.wnd;for(var c=d.points,l=getNAF(a,u,this._bitLength),m=this.jpoint(null,null,null),I=l.length-1;I>=0;I--){for(var O=0;I>=0&&l[I]===0;I--)O++;if(I>=0&&O++,m=m.dblp(O),I<0)break;var T=l[I];assert$i(T!==0),e.type==="affine"?T>0?m=m.mixedAdd(c[T-1>>1]):m=m.mixedAdd(c[-T-1>>1].neg()):T>0?m=m.add(c[T-1>>1]):m=m.add(c[-T-1>>1].neg())}return e.type==="affine"?m.toP():m},BaseCurve.prototype._wnafMulAdd=function(e,a,u,d,c){var l=this._wnafT1,m=this._wnafT2,I=this._wnafT3,O=0,T,C,j;for(T=0;T<d;T++){j=a[T];var F=j._getNAFPoints(e);l[T]=F.wnd,m[T]=F.points}for(T=d-1;T>=1;T-=2){var U=T-1,Z=T;if(l[U]!==1||l[Z]!==1){I[U]=getNAF(u[U],l[U],this._bitLength),I[Z]=getNAF(u[Z],l[Z],this._bitLength),O=Math.max(I[U].length,O),O=Math.max(I[Z].length,O);continue}var J=[a[U],null,null,a[Z]];a[U].y.cmp(a[Z].y)===0?(J[1]=a[U].add(a[Z]),J[2]=a[U].toJ().mixedAdd(a[Z].neg())):a[U].y.cmp(a[Z].y.redNeg())===0?(J[1]=a[U].toJ().mixedAdd(a[Z]),J[2]=a[U].add(a[Z].neg())):(J[1]=a[U].toJ().mixedAdd(a[Z]),J[2]=a[U].toJ().mixedAdd(a[Z].neg()));var X=[-3,-1,-5,-7,0,7,5,1,3],Q=getJSF(u[U],u[Z]);for(O=Math.max(Q[0].length,O),I[U]=new Array(O),I[Z]=new Array(O),C=0;C<O;C++){var te=Q[0][C]|0,se=Q[1][C]|0;I[U][C]=X[(te+1)*3+(se+1)],I[Z][C]=0,m[U]=J}}var pe=this.jpoint(null,null,null),me=this._wnafT4;for(T=O;T>=0;T--){for(var Ee=0;T>=0;){var V=!0;for(C=0;C<d;C++)me[C]=I[C][T]|0,me[C]!==0&&(V=!1);if(!V)break;Ee++,T--}if(T>=0&&Ee++,pe=pe.dblp(Ee),T<0)break;for(C=0;C<d;C++){var ae=me[C];ae!==0&&(ae>0?j=m[C][ae-1>>1]:ae<0&&(j=m[C][-ae-1>>1].neg()),j.type==="affine"?pe=pe.mixedAdd(j):pe=pe.add(j))}}for(T=0;T<d;T++)m[T]=null;return c?pe:pe.toP()};function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function(){throw new Error("Not implemented")},BasePoint.prototype.validate=function(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function(e,a){e=utils$k.toArray(e,a);var u=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*u){e[0]===6?assert$i(e[e.length-1]%2===0):e[0]===7&&assert$i(e[e.length-1]%2===1);var d=this.point(e.slice(1,1+u),e.slice(1+u,1+2*u));return d}else if((e[0]===2||e[0]===3)&&e.length-1===u)return this.pointFromX(e.slice(1,1+u),e[0]===3);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function(e){return this.encode(e,!0)},BasePoint.prototype._encode=function(e){var a=this.curve.p.byteLength(),u=this.getX().toArray("be",a);return e?[this.getY().isEven()?2:3].concat(u):[4].concat(u,this.getY().toArray("be",a))},BasePoint.prototype.encode=function(e,a){return utils$k.encode(this._encode(a),e)},BasePoint.prototype.precompute=function(e){if(this.precomputed)return this;var a={doubles:null,naf:null,beta:null};return a.naf=this._getNAFPoints(8),a.doubles=this._getDoubles(4,e),a.beta=this._getBeta(),this.precomputed=a,this},BasePoint.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var a=this.precomputed.doubles;return a?a.points.length>=Math.ceil((e.bitLength()+1)/a.step):!1},BasePoint.prototype._getDoubles=function(e,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var u=[this],d=this,c=0;c<a;c+=e){for(var l=0;l<e;l++)d=d.dbl();u.push(d)}return{step:e,points:u}},BasePoint.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var a=[this],u=(1<<e)-1,d=u===1?null:this.dbl(),c=1;c<u;c++)a[c]=a[c-1].add(d);return{wnd:e,points:a}},BasePoint.prototype._getBeta=function(){return null},BasePoint.prototype.dblp=function(e){for(var a=this,u=0;u<e;u++)a=a.dbl();return a};var inherits_browser$1={exports:{}};typeof Object.create=="function"?inherits_browser$1.exports=function(e,a){a&&(e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser$1.exports=function(e,a){if(a){e.super_=a;var u=function(){};u.prototype=a.prototype,e.prototype=new u,e.prototype.constructor=e}};var inherits_browserExports$1=inherits_browser$1.exports,utils$j=utils$m,BN$c=bnExports,inherits$3=inherits_browserExports$1,Base$2=base$1,assert$h=utils$j.assert;function ShortCurve(t){Base$2.call(this,"short",t),this.a=new BN$c(t.a,16).toRed(this.red),this.b=new BN$c(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits$3(ShortCurve,Base$2);var short=ShortCurve;ShortCurve.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var a,u;if(e.beta)a=new BN$c(e.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);a=d[0].cmp(d[1])<0?d[0]:d[1],a=a.toRed(this.red)}if(e.lambda)u=new BN$c(e.lambda,16);else{var c=this._getEndoRoots(this.n);this.g.mul(c[0]).x.cmp(this.g.x.redMul(a))===0?u=c[0]:(u=c[1],assert$h(this.g.mul(u).x.cmp(this.g.x.redMul(a))===0))}var l;return e.basis?l=e.basis.map(function(m){return{a:new BN$c(m.a,16),b:new BN$c(m.b,16)}}):l=this._getEndoBasis(u),{beta:a,lambda:u,basis:l}}},ShortCurve.prototype._getEndoRoots=function(e){var a=e===this.p?this.red:BN$c.mont(e),u=new BN$c(2).toRed(a).redInvm(),d=u.redNeg(),c=new BN$c(3).toRed(a).redNeg().redSqrt().redMul(u),l=d.redAdd(c).fromRed(),m=d.redSub(c).fromRed();return[l,m]},ShortCurve.prototype._getEndoBasis=function(e){for(var a=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=e,d=this.n.clone(),c=new BN$c(1),l=new BN$c(0),m=new BN$c(0),I=new BN$c(1),O,T,C,j,F,U,Z,J=0,X,Q;u.cmpn(0)!==0;){var te=d.div(u);X=d.sub(te.mul(u)),Q=m.sub(te.mul(c));var se=I.sub(te.mul(l));if(!C&&X.cmp(a)<0)O=Z.neg(),T=c,C=X.neg(),j=Q;else if(C&&++J===2)break;Z=X,d=u,u=X,m=c,c=Q,I=l,l=se}F=X.neg(),U=Q;var pe=C.sqr().add(j.sqr()),me=F.sqr().add(U.sqr());return me.cmp(pe)>=0&&(F=O,U=T),C.negative&&(C=C.neg(),j=j.neg()),F.negative&&(F=F.neg(),U=U.neg()),[{a:C,b:j},{a:F,b:U}]},ShortCurve.prototype._endoSplit=function(e){var a=this.endo.basis,u=a[0],d=a[1],c=d.b.mul(e).divRound(this.n),l=u.b.neg().mul(e).divRound(this.n),m=c.mul(u.a),I=l.mul(d.a),O=c.mul(u.b),T=l.mul(d.b),C=e.sub(m).sub(I),j=O.add(T).neg();return{k1:C,k2:j}},ShortCurve.prototype.pointFromX=function(e,a){e=new BN$c(e,16),e.red||(e=e.toRed(this.red));var u=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),d=u.redSqrt();if(d.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");var c=d.fromRed().isOdd();return(a&&!c||!a&&c)&&(d=d.redNeg()),this.point(e,d)},ShortCurve.prototype.validate=function(e){if(e.inf)return!0;var a=e.x,u=e.y,d=this.a.redMul(a),c=a.redSqr().redMul(a).redIAdd(d).redIAdd(this.b);return u.redSqr().redISub(c).cmpn(0)===0},ShortCurve.prototype._endoWnafMulAdd=function(e,a,u){for(var d=this._endoWnafT1,c=this._endoWnafT2,l=0;l<e.length;l++){var m=this._endoSplit(a[l]),I=e[l],O=I._getBeta();m.k1.negative&&(m.k1.ineg(),I=I.neg(!0)),m.k2.negative&&(m.k2.ineg(),O=O.neg(!0)),d[l*2]=I,d[l*2+1]=O,c[l*2]=m.k1,c[l*2+1]=m.k2}for(var T=this._wnafMulAdd(1,d,c,l*2,u),C=0;C<l*2;C++)d[C]=null,c[C]=null;return T};function Point$6(t,e,a,u){Base$2.BasePoint.call(this,t,"affine"),e===null&&a===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$c(e,16),this.y=new BN$c(a,16),u&&(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)}inherits$3(Point$6,Base$2.BasePoint),ShortCurve.prototype.point=function(e,a,u){return new Point$6(this,e,a,u)},ShortCurve.prototype.pointFromJSON=function(e,a){return Point$6.fromJSON(this,e,a)},Point$6.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var a=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var u=this.curve,d=function(c){return u.point(c.x.redMul(u.endo.beta),c.y)};e.beta=a,a.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(d)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(d)}}}return a}},Point$6.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point$6.fromJSON=function(e,a,u){typeof a=="string"&&(a=JSON.parse(a));var d=e.point(a[0],a[1],u);if(!a[2])return d;function c(m){return e.point(m[0],m[1],u)}var l=a[2];return d.precomputed={beta:null,doubles:l.doubles&&{step:l.doubles.step,points:[d].concat(l.doubles.points.map(c))},naf:l.naf&&{wnd:l.naf.wnd,points:[d].concat(l.naf.points.map(c))}},d},Point$6.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point$6.prototype.isInfinity=function(){return this.inf},Point$6.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var a=this.y.redSub(e.y);a.cmpn(0)!==0&&(a=a.redMul(this.x.redSub(e.x).redInvm()));var u=a.redSqr().redISub(this.x).redISub(e.x),d=a.redMul(this.x.redSub(u)).redISub(this.y);return this.curve.point(u,d)},Point$6.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var a=this.curve.a,u=this.x.redSqr(),d=e.redInvm(),c=u.redAdd(u).redIAdd(u).redIAdd(a).redMul(d),l=c.redSqr().redISub(this.x.redAdd(this.x)),m=c.redMul(this.x.redSub(l)).redISub(this.y);return this.curve.point(l,m)},Point$6.prototype.getX=function(){return this.x.fromRed()},Point$6.prototype.getY=function(){return this.y.fromRed()},Point$6.prototype.mul=function(e){return e=new BN$c(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Point$6.prototype.mulAdd=function(e,a,u){var d=[this,a],c=[e,u];return this.curve.endo?this.curve._endoWnafMulAdd(d,c):this.curve._wnafMulAdd(1,d,c,2)},Point$6.prototype.jmulAdd=function(e,a,u){var d=[this,a],c=[e,u];return this.curve.endo?this.curve._endoWnafMulAdd(d,c,!0):this.curve._wnafMulAdd(1,d,c,2,!0)},Point$6.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Point$6.prototype.neg=function(e){if(this.inf)return this;var a=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var u=this.precomputed,d=function(c){return c.neg()};a.precomputed={naf:u.naf&&{wnd:u.naf.wnd,points:u.naf.points.map(d)},doubles:u.doubles&&{step:u.doubles.step,points:u.doubles.points.map(d)}}}return a},Point$6.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint(t,e,a,u){Base$2.BasePoint.call(this,t,"jacobian"),e===null&&a===null&&u===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$c(0)):(this.x=new BN$c(e,16),this.y=new BN$c(a,16),this.z=new BN$c(u,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}inherits$3(JPoint,Base$2.BasePoint),ShortCurve.prototype.jpoint=function(e,a,u){return new JPoint(this,e,a,u)},JPoint.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),a=e.redSqr(),u=this.x.redMul(a),d=this.y.redMul(a).redMul(e);return this.curve.point(u,d)},JPoint.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var a=e.z.redSqr(),u=this.z.redSqr(),d=this.x.redMul(a),c=e.x.redMul(u),l=this.y.redMul(a.redMul(e.z)),m=e.y.redMul(u.redMul(this.z)),I=d.redSub(c),O=l.redSub(m);if(I.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var T=I.redSqr(),C=T.redMul(I),j=d.redMul(T),F=O.redSqr().redIAdd(C).redISub(j).redISub(j),U=O.redMul(j.redISub(F)).redISub(l.redMul(C)),Z=this.z.redMul(e.z).redMul(I);return this.curve.jpoint(F,U,Z)},JPoint.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var a=this.z.redSqr(),u=this.x,d=e.x.redMul(a),c=this.y,l=e.y.redMul(a).redMul(this.z),m=u.redSub(d),I=c.redSub(l);if(m.cmpn(0)===0)return I.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=m.redSqr(),T=O.redMul(m),C=u.redMul(O),j=I.redSqr().redIAdd(T).redISub(C).redISub(C),F=I.redMul(C.redISub(j)).redISub(c.redMul(T)),U=this.z.redMul(m);return this.curve.jpoint(j,F,U)},JPoint.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var a;if(this.curve.zeroA||this.curve.threeA){var u=this;for(a=0;a<e;a++)u=u.dbl();return u}var d=this.curve.a,c=this.curve.tinv,l=this.x,m=this.y,I=this.z,O=I.redSqr().redSqr(),T=m.redAdd(m);for(a=0;a<e;a++){var C=l.redSqr(),j=T.redSqr(),F=j.redSqr(),U=C.redAdd(C).redIAdd(C).redIAdd(d.redMul(O)),Z=l.redMul(j),J=U.redSqr().redISub(Z.redAdd(Z)),X=Z.redISub(J),Q=U.redMul(X);Q=Q.redIAdd(Q).redISub(F);var te=T.redMul(I);a+1<e&&(O=O.redMul(F)),l=J,I=te,T=Q}return this.curve.jpoint(l,T.redMul(c),I)},JPoint.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function(){var e,a,u;if(this.zOne){var d=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),m=this.x.redAdd(c).redSqr().redISub(d).redISub(l);m=m.redIAdd(m);var I=d.redAdd(d).redIAdd(d),O=I.redSqr().redISub(m).redISub(m),T=l.redIAdd(l);T=T.redIAdd(T),T=T.redIAdd(T),e=O,a=I.redMul(m.redISub(O)).redISub(T),u=this.y.redAdd(this.y)}else{var C=this.x.redSqr(),j=this.y.redSqr(),F=j.redSqr(),U=this.x.redAdd(j).redSqr().redISub(C).redISub(F);U=U.redIAdd(U);var Z=C.redAdd(C).redIAdd(C),J=Z.redSqr(),X=F.redIAdd(F);X=X.redIAdd(X),X=X.redIAdd(X),e=J.redISub(U).redISub(U),a=Z.redMul(U.redISub(e)).redISub(X),u=this.y.redMul(this.z),u=u.redIAdd(u)}return this.curve.jpoint(e,a,u)},JPoint.prototype._threeDbl=function(){var e,a,u;if(this.zOne){var d=this.x.redSqr(),c=this.y.redSqr(),l=c.redSqr(),m=this.x.redAdd(c).redSqr().redISub(d).redISub(l);m=m.redIAdd(m);var I=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),O=I.redSqr().redISub(m).redISub(m);e=O;var T=l.redIAdd(l);T=T.redIAdd(T),T=T.redIAdd(T),a=I.redMul(m.redISub(O)).redISub(T),u=this.y.redAdd(this.y)}else{var C=this.z.redSqr(),j=this.y.redSqr(),F=this.x.redMul(j),U=this.x.redSub(C).redMul(this.x.redAdd(C));U=U.redAdd(U).redIAdd(U);var Z=F.redIAdd(F);Z=Z.redIAdd(Z);var J=Z.redAdd(Z);e=U.redSqr().redISub(J),u=this.y.redAdd(this.z).redSqr().redISub(j).redISub(C);var X=j.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X),a=U.redMul(Z.redISub(e)).redISub(X)}return this.curve.jpoint(e,a,u)},JPoint.prototype._dbl=function(){var e=this.curve.a,a=this.x,u=this.y,d=this.z,c=d.redSqr().redSqr(),l=a.redSqr(),m=u.redSqr(),I=l.redAdd(l).redIAdd(l).redIAdd(e.redMul(c)),O=a.redAdd(a);O=O.redIAdd(O);var T=O.redMul(m),C=I.redSqr().redISub(T.redAdd(T)),j=T.redISub(C),F=m.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var U=I.redMul(j).redISub(F),Z=u.redAdd(u).redMul(d);return this.curve.jpoint(C,U,Z)},JPoint.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),a=this.y.redSqr(),u=this.z.redSqr(),d=a.redSqr(),c=e.redAdd(e).redIAdd(e),l=c.redSqr(),m=this.x.redAdd(a).redSqr().redISub(e).redISub(d);m=m.redIAdd(m),m=m.redAdd(m).redIAdd(m),m=m.redISub(l);var I=m.redSqr(),O=d.redIAdd(d);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var T=c.redIAdd(m).redSqr().redISub(l).redISub(I).redISub(O),C=a.redMul(T);C=C.redIAdd(C),C=C.redIAdd(C);var j=this.x.redMul(I).redISub(C);j=j.redIAdd(j),j=j.redIAdd(j);var F=this.y.redMul(T.redMul(O.redISub(T)).redISub(m.redMul(I)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var U=this.z.redAdd(m).redSqr().redISub(u).redISub(I);return this.curve.jpoint(j,F,U)},JPoint.prototype.mul=function(e,a){return e=new BN$c(e,a),this.curve._wnafMul(this,e)},JPoint.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var a=this.z.redSqr(),u=e.z.redSqr();if(this.x.redMul(u).redISub(e.x.redMul(a)).cmpn(0)!==0)return!1;var d=a.redMul(this.z),c=u.redMul(e.z);return this.y.redMul(c).redISub(e.y.redMul(d)).cmpn(0)===0},JPoint.prototype.eqXToP=function(e){var a=this.z.redSqr(),u=e.toRed(this.curve.red).redMul(a);if(this.x.cmp(u)===0)return!0;for(var d=e.clone(),c=this.curve.redN.redMul(a);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(c),this.x.cmp(u)===0)return!0}},JPoint.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var BN$b=bnExports,inherits$2=inherits_browserExports$1,Base$1=base$1,utils$i=utils$m;function MontCurve(t){Base$1.call(this,"mont",t),this.a=new BN$b(t.a,16).toRed(this.red),this.b=new BN$b(t.b,16).toRed(this.red),this.i4=new BN$b(4).toRed(this.red).redInvm(),this.two=new BN$b(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$2(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function(e){var a=e.normalize().x,u=a.redSqr(),d=u.redMul(a).redAdd(u.redMul(this.a)).redAdd(a),c=d.redSqrt();return c.redSqr().cmp(d)===0};function Point$5(t,e,a){Base$1.BasePoint.call(this,t,"projective"),e===null&&a===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$b(e,16),this.z=new BN$b(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$2(Point$5,Base$1.BasePoint),MontCurve.prototype.decodePoint=function(e,a){return this.point(utils$i.toArray(e,a),1)},MontCurve.prototype.point=function(e,a){return new Point$5(this,e,a)},MontCurve.prototype.pointFromJSON=function(e){return Point$5.fromJSON(this,e)},Point$5.prototype.precompute=function(){},Point$5.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point$5.fromJSON=function(e,a){return new Point$5(e,a[0],a[1]||e.one)},Point$5.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$5.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Point$5.prototype.dbl=function(){var e=this.x.redAdd(this.z),a=e.redSqr(),u=this.x.redSub(this.z),d=u.redSqr(),c=a.redSub(d),l=a.redMul(d),m=c.redMul(d.redAdd(this.curve.a24.redMul(c)));return this.curve.point(l,m)},Point$5.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point$5.prototype.diffAdd=function(e,a){var u=this.x.redAdd(this.z),d=this.x.redSub(this.z),c=e.x.redAdd(e.z),l=e.x.redSub(e.z),m=l.redMul(u),I=c.redMul(d),O=a.z.redMul(m.redAdd(I).redSqr()),T=a.x.redMul(m.redISub(I).redSqr());return this.curve.point(O,T)},Point$5.prototype.mul=function(e){for(var a=e.clone(),u=this,d=this.curve.point(null,null),c=this,l=[];a.cmpn(0)!==0;a.iushrn(1))l.push(a.andln(1));for(var m=l.length-1;m>=0;m--)l[m]===0?(u=u.diffAdd(d,c),d=d.dbl()):(d=u.diffAdd(d,c),u=u.dbl());return d},Point$5.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point$5.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point$5.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},Point$5.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point$5.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var utils$h=utils$m,BN$a=bnExports,inherits$1=inherits_browserExports$1,Base=base$1,assert$g=utils$h.assert;function EdwardsCurve(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",t),this.a=new BN$a(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$a(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$a(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$g(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}inherits$1(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},EdwardsCurve.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},EdwardsCurve.prototype.jpoint=function(e,a,u,d){return this.point(e,a,u,d)},EdwardsCurve.prototype.pointFromX=function(e,a){e=new BN$a(e,16),e.red||(e=e.toRed(this.red));var u=e.redSqr(),d=this.c2.redSub(this.a.redMul(u)),c=this.one.redSub(this.c2.redMul(this.d).redMul(u)),l=d.redMul(c.redInvm()),m=l.redSqrt();if(m.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");var I=m.fromRed().isOdd();return(a&&!I||!a&&I)&&(m=m.redNeg()),this.point(e,m)},EdwardsCurve.prototype.pointFromY=function(e,a){e=new BN$a(e,16),e.red||(e=e.toRed(this.red));var u=e.redSqr(),d=u.redSub(this.c2),c=u.redMul(this.d).redMul(this.c2).redSub(this.a),l=d.redMul(c.redInvm());if(l.cmp(this.zero)===0){if(a)throw new Error("invalid point");return this.point(this.zero,e)}var m=l.redSqrt();if(m.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");return m.fromRed().isOdd()!==a&&(m=m.redNeg()),this.point(m,e)},EdwardsCurve.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var a=e.x.redSqr(),u=e.y.redSqr(),d=a.redMul(this.a).redAdd(u),c=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(u)));return d.cmp(c)===0};function Point$4(t,e,a,u,d){Base.BasePoint.call(this,t,"projective"),e===null&&a===null&&u===null?(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 BN$a(e,16),this.y=new BN$a(a,16),this.z=u?new BN$a(u,16):this.curve.one,this.t=d&&new BN$a(d,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()))))}inherits$1(Point$4,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function(e){return Point$4.fromJSON(this,e)},EdwardsCurve.prototype.point=function(e,a,u,d){return new Point$4(this,e,a,u,d)},Point$4.fromJSON=function(e,a){return new Point$4(e,a[0],a[1],a[2])},Point$4.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point$4.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},Point$4.prototype._extDbl=function(){var e=this.x.redSqr(),a=this.y.redSqr(),u=this.z.redSqr();u=u.redIAdd(u);var d=this.curve._mulA(e),c=this.x.redAdd(this.y).redSqr().redISub(e).redISub(a),l=d.redAdd(a),m=l.redSub(u),I=d.redSub(a),O=c.redMul(m),T=l.redMul(I),C=c.redMul(I),j=m.redMul(l);return this.curve.point(O,T,j,C)},Point$4.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr(),d,c,l,m,I,O;if(this.curve.twisted){m=this.curve._mulA(a);var T=m.redAdd(u);this.zOne?(d=e.redSub(a).redSub(u).redMul(T.redSub(this.curve.two)),c=T.redMul(m.redSub(u)),l=T.redSqr().redSub(T).redSub(T)):(I=this.z.redSqr(),O=T.redSub(I).redISub(I),d=e.redSub(a).redISub(u).redMul(O),c=T.redMul(m.redSub(u)),l=T.redMul(O))}else m=a.redAdd(u),I=this.curve._mulC(this.z).redSqr(),O=m.redSub(I).redSub(I),d=this.curve._mulC(e.redISub(m)).redMul(O),c=this.curve._mulC(m).redMul(a.redISub(u)),l=m.redMul(O);return this.curve.point(d,c,l)},Point$4.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point$4.prototype._extAdd=function(e){var a=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),u=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),d=this.t.redMul(this.curve.dd).redMul(e.t),c=this.z.redMul(e.z.redAdd(e.z)),l=u.redSub(a),m=c.redSub(d),I=c.redAdd(d),O=u.redAdd(a),T=l.redMul(m),C=I.redMul(O),j=l.redMul(O),F=m.redMul(I);return this.curve.point(T,C,F,j)},Point$4.prototype._projAdd=function(e){var a=this.z.redMul(e.z),u=a.redSqr(),d=this.x.redMul(e.x),c=this.y.redMul(e.y),l=this.curve.d.redMul(d).redMul(c),m=u.redSub(l),I=u.redAdd(l),O=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(c),T=a.redMul(m).redMul(O),C,j;return this.curve.twisted?(C=a.redMul(I).redMul(c.redSub(this.curve._mulA(d))),j=m.redMul(I)):(C=a.redMul(I).redMul(c.redSub(d)),j=this.curve._mulC(m).redMul(I)),this.curve.point(T,C,j)},Point$4.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Point$4.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Point$4.prototype.mulAdd=function(e,a,u){return this.curve._wnafMulAdd(1,[this,a],[e,u],2,!1)},Point$4.prototype.jmulAdd=function(e,a,u){return this.curve._wnafMulAdd(1,[this,a],[e,u],2,!0)},Point$4.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Point$4.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point$4.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point$4.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point$4.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},Point$4.prototype.eqXToP=function(e){var a=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(a)===0)return!0;for(var u=e.clone(),d=this.curve.redN.redMul(this.z);;){if(u.iadd(this.curve.n),u.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(d),this.x.cmp(a)===0)return!0}},Point$4.prototype.toP=Point$4.prototype.normalize,Point$4.prototype.mixedAdd=Point$4.prototype.add,function(t){var e=t;e.base=base$1,e.short=short,e.mont=mont,e.edwards=edwards}(curve$6);var curves$3={},hash$4={},utils$g={},assert$f=minimalisticAssert,inherits=inherits_browserExports$1;utils$g.inherits=inherits;function isSurrogatePair(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function toArray(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var a=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),d=0;d<t.length;d+=2)a.push(parseInt(t[d]+t[d+1],16))}else for(var u=0,d=0;d<t.length;d++){var c=t.charCodeAt(d);c<128?a[u++]=c:c<2048?(a[u++]=c>>6|192,a[u++]=c&63|128):isSurrogatePair(t,d)?(c=65536+((c&1023)<<10)+(t.charCodeAt(++d)&1023),a[u++]=c>>18|240,a[u++]=c>>12&63|128,a[u++]=c>>6&63|128,a[u++]=c&63|128):(a[u++]=c>>12|224,a[u++]=c>>6&63|128,a[u++]=c&63|128)}else for(d=0;d<t.length;d++)a[d]=t[d]|0;return a}utils$g.toArray=toArray;function toHex(t){for(var e="",a=0;a<t.length;a++)e+=zero2(t[a].toString(16));return e}utils$g.toHex=toHex;function htonl(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}utils$g.htonl=htonl;function toHex32(t,e){for(var a="",u=0;u<t.length;u++){var d=t[u];e==="little"&&(d=htonl(d)),a+=zero8(d.toString(16))}return a}utils$g.toHex32=toHex32;function zero2(t){return t.length===1?"0"+t:t}utils$g.zero2=zero2;function zero8(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}utils$g.zero8=zero8;function join32(t,e,a,u){var d=a-e;assert$f(d%4===0);for(var c=new Array(d/4),l=0,m=e;l<c.length;l++,m+=4){var I;u==="big"?I=t[m]<<24|t[m+1]<<16|t[m+2]<<8|t[m+3]:I=t[m+3]<<24|t[m+2]<<16|t[m+1]<<8|t[m],c[l]=I>>>0}return c}utils$g.join32=join32;function split32(t,e){for(var a=new Array(t.length*4),u=0,d=0;u<t.length;u++,d+=4){var c=t[u];e==="big"?(a[d]=c>>>24,a[d+1]=c>>>16&255,a[d+2]=c>>>8&255,a[d+3]=c&255):(a[d+3]=c>>>24,a[d+2]=c>>>16&255,a[d+1]=c>>>8&255,a[d]=c&255)}return a}utils$g.split32=split32;function rotr32$1(t,e){return t>>>e|t<<32-e}utils$g.rotr32=rotr32$1;function rotl32$2(t,e){return t<<e|t>>>32-e}utils$g.rotl32=rotl32$2;function sum32$3(t,e){return t+e>>>0}utils$g.sum32=sum32$3;function sum32_3$1(t,e,a){return t+e+a>>>0}utils$g.sum32_3=sum32_3$1;function sum32_4$2(t,e,a,u){return t+e+a+u>>>0}utils$g.sum32_4=sum32_4$2;function sum32_5$2(t,e,a,u,d){return t+e+a+u+d>>>0}utils$g.sum32_5=sum32_5$2;function sum64$1(t,e,a,u){var d=t[e],c=t[e+1],l=u+c>>>0,m=(l<u?1:0)+a+d;t[e]=m>>>0,t[e+1]=l}utils$g.sum64=sum64$1;function sum64_hi$1(t,e,a,u){var d=e+u>>>0,c=(d<e?1:0)+t+a;return c>>>0}utils$g.sum64_hi=sum64_hi$1;function sum64_lo$1(t,e,a,u){var d=e+u;return d>>>0}utils$g.sum64_lo=sum64_lo$1;function sum64_4_hi$1(t,e,a,u,d,c,l,m){var I=0,O=e;O=O+u>>>0,I+=O<e?1:0,O=O+c>>>0,I+=O<c?1:0,O=O+m>>>0,I+=O<m?1:0;var T=t+a+d+l+I;return T>>>0}utils$g.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(t,e,a,u,d,c,l,m){var I=e+u+c+m;return I>>>0}utils$g.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(t,e,a,u,d,c,l,m,I,O){var T=0,C=e;C=C+u>>>0,T+=C<e?1:0,C=C+c>>>0,T+=C<c?1:0,C=C+m>>>0,T+=C<m?1:0,C=C+O>>>0,T+=C<O?1:0;var j=t+a+d+l+I+T;return j>>>0}utils$g.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(t,e,a,u,d,c,l,m,I,O){var T=e+u+c+m+O;return T>>>0}utils$g.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(t,e,a){var u=e<<32-a|t>>>a;return u>>>0}utils$g.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(t,e,a){var u=t<<32-a|e>>>a;return u>>>0}utils$g.rotr64_lo=rotr64_lo$1;function shr64_hi$1(t,e,a){return t>>>a}utils$g.shr64_hi=shr64_hi$1;function shr64_lo$1(t,e,a){var u=t<<32-a|e>>>a;return u>>>0}utils$g.shr64_lo=shr64_lo$1;var common$5={},utils$f=utils$g,assert$e=minimalisticAssert;function BlockHash$4(){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}common$5.BlockHash=BlockHash$4,BlockHash$4.prototype.update=function(e,a){if(e=utils$f.toArray(e,a),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var u=e.length%this._delta8;this.pending=e.slice(e.length-u,e.length),this.pending.length===0&&(this.pending=null),e=utils$f.join32(e,0,e.length-u,this.endian);for(var d=0;d<e.length;d+=this._delta32)this._update(e,d,d+this._delta32)}return this},BlockHash$4.prototype.digest=function(e){return this.update(this._pad()),assert$e(this.pending===null),this._digest(e)},BlockHash$4.prototype._pad=function(){var e=this.pendingTotal,a=this._delta8,u=a-(e+this.padLength)%a,d=new Array(u+this.padLength);d[0]=128;for(var c=1;c<u;c++)d[c]=0;if(e<<=3,this.endian==="big"){for(var l=8;l<this.padLength;l++)d[c++]=0;d[c++]=0,d[c++]=0,d[c++]=0,d[c++]=0,d[c++]=e>>>24&255,d[c++]=e>>>16&255,d[c++]=e>>>8&255,d[c++]=e&255}else for(d[c++]=e&255,d[c++]=e>>>8&255,d[c++]=e>>>16&255,d[c++]=e>>>24&255,d[c++]=0,d[c++]=0,d[c++]=0,d[c++]=0,l=8;l<this.padLength;l++)d[c++]=0;return d};var sha={},common$4={},utils$e=utils$g,rotr32=utils$e.rotr32;function ft_1$1(t,e,a,u){if(t===0)return ch32$1(e,a,u);if(t===1||t===3)return p32(e,a,u);if(t===2)return maj32$1(e,a,u)}common$4.ft_1=ft_1$1;function ch32$1(t,e,a){return t&e^~t&a}common$4.ch32=ch32$1;function maj32$1(t,e,a){return t&e^t&a^e&a}common$4.maj32=maj32$1;function p32(t,e,a){return t^e^a}common$4.p32=p32;function s0_256$1(t){return rotr32(t,2)^rotr32(t,13)^rotr32(t,22)}common$4.s0_256=s0_256$1;function s1_256$1(t){return rotr32(t,6)^rotr32(t,11)^rotr32(t,25)}common$4.s1_256=s1_256$1;function g0_256$1(t){return rotr32(t,7)^rotr32(t,18)^t>>>3}common$4.g0_256=g0_256$1;function g1_256$1(t){return rotr32(t,17)^rotr32(t,19)^t>>>10}common$4.g1_256=g1_256$1;var utils$d=utils$g,common$3=common$5,shaCommon$1=common$4,rotl32$1=utils$d.rotl32,sum32$2=utils$d.sum32,sum32_5$1=utils$d.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$3.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$d.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function(e,a){for(var u=this.W,d=0;d<16;d++)u[d]=e[a+d];for(;d<u.length;d++)u[d]=rotl32$1(u[d-3]^u[d-8]^u[d-14]^u[d-16],1);var c=this.h[0],l=this.h[1],m=this.h[2],I=this.h[3],O=this.h[4];for(d=0;d<u.length;d++){var T=~~(d/20),C=sum32_5$1(rotl32$1(c,5),ft_1(T,l,m,I),O,u[d],sha1_K[T]);O=I,I=m,m=rotl32$1(l,30),l=c,c=C}this.h[0]=sum32$2(this.h[0],c),this.h[1]=sum32$2(this.h[1],l),this.h[2]=sum32$2(this.h[2],m),this.h[3]=sum32$2(this.h[3],I),this.h[4]=sum32$2(this.h[4],O)},SHA1.prototype._digest=function(e){return e==="hex"?utils$d.toHex32(this.h,"big"):utils$d.split32(this.h,"big")};var utils$c=utils$g,common$2=common$5,shaCommon=common$4,assert$d=minimalisticAssert,sum32$1=utils$c.sum32,sum32_4$1=utils$c.sum32_4,sum32_5=utils$c.sum32_5,ch32=shaCommon.ch32,maj32=shaCommon.maj32,s0_256=shaCommon.s0_256,s1_256=shaCommon.s1_256,g0_256=shaCommon.g0_256,g1_256=shaCommon.g1_256,BlockHash$2=common$2.BlockHash,sha256_K=[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 SHA256$1(){if(!(this instanceof SHA256$1))return new SHA256$1;BlockHash$2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils$c.inherits(SHA256$1,BlockHash$2);var _256=SHA256$1;SHA256$1.blockSize=512,SHA256$1.outSize=256,SHA256$1.hmacStrength=192,SHA256$1.padLength=64,SHA256$1.prototype._update=function(e,a){for(var u=this.W,d=0;d<16;d++)u[d]=e[a+d];for(;d<u.length;d++)u[d]=sum32_4$1(g1_256(u[d-2]),u[d-7],g0_256(u[d-15]),u[d-16]);var c=this.h[0],l=this.h[1],m=this.h[2],I=this.h[3],O=this.h[4],T=this.h[5],C=this.h[6],j=this.h[7];for(assert$d(this.k.length===u.length),d=0;d<u.length;d++){var F=sum32_5(j,s1_256(O),ch32(O,T,C),this.k[d],u[d]),U=sum32$1(s0_256(c),maj32(c,l,m));j=C,C=T,T=O,O=sum32$1(I,F),I=m,m=l,l=c,c=sum32$1(F,U)}this.h[0]=sum32$1(this.h[0],c),this.h[1]=sum32$1(this.h[1],l),this.h[2]=sum32$1(this.h[2],m),this.h[3]=sum32$1(this.h[3],I),this.h[4]=sum32$1(this.h[4],O),this.h[5]=sum32$1(this.h[5],T),this.h[6]=sum32$1(this.h[6],C),this.h[7]=sum32$1(this.h[7],j)},SHA256$1.prototype._digest=function(e){return e==="hex"?utils$c.toHex32(this.h,"big"):utils$c.split32(this.h,"big")};var utils$b=utils$g,SHA256=_256;function SHA224(){if(!(this instanceof SHA224))return new SHA224;SHA256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}utils$b.inherits(SHA224,SHA256);var _224=SHA224;SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function(e){return e==="hex"?utils$b.toHex32(this.h.slice(0,7),"big"):utils$b.split32(this.h.slice(0,7),"big")};var utils$a=utils$g,common$1=common$5,assert$c=minimalisticAssert,rotr64_hi=utils$a.rotr64_hi,rotr64_lo=utils$a.rotr64_lo,shr64_hi=utils$a.shr64_hi,shr64_lo=utils$a.shr64_lo,sum64=utils$a.sum64,sum64_hi=utils$a.sum64_hi,sum64_lo=utils$a.sum64_lo,sum64_4_hi=utils$a.sum64_4_hi,sum64_4_lo=utils$a.sum64_4_lo,sum64_5_hi=utils$a.sum64_5_hi,sum64_5_lo=utils$a.sum64_5_lo,BlockHash$1=common$1.BlockHash,sha512_K=[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 SHA512$1(){if(!(this instanceof SHA512$1))return new SHA512$1;BlockHash$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}utils$a.inherits(SHA512$1,BlockHash$1);var _512=SHA512$1;SHA512$1.blockSize=1024,SHA512$1.outSize=512,SHA512$1.hmacStrength=192,SHA512$1.padLength=128,SHA512$1.prototype._prepareBlock=function(e,a){for(var u=this.W,d=0;d<32;d++)u[d]=e[a+d];for(;d<u.length;d+=2){var c=g1_512_hi(u[d-4],u[d-3]),l=g1_512_lo(u[d-4],u[d-3]),m=u[d-14],I=u[d-13],O=g0_512_hi(u[d-30],u[d-29]),T=g0_512_lo(u[d-30],u[d-29]),C=u[d-32],j=u[d-31];u[d]=sum64_4_hi(c,l,m,I,O,T,C,j),u[d+1]=sum64_4_lo(c,l,m,I,O,T,C,j)}},SHA512$1.prototype._update=function(e,a){this._prepareBlock(e,a);var u=this.W,d=this.h[0],c=this.h[1],l=this.h[2],m=this.h[3],I=this.h[4],O=this.h[5],T=this.h[6],C=this.h[7],j=this.h[8],F=this.h[9],U=this.h[10],Z=this.h[11],J=this.h[12],X=this.h[13],Q=this.h[14],te=this.h[15];assert$c(this.k.length===u.length);for(var se=0;se<u.length;se+=2){var pe=Q,me=te,Ee=s1_512_hi(j,F),V=s1_512_lo(j,F),ae=ch64_hi(j,F,U,Z,J),ne=ch64_lo(j,F,U,Z,J,X),M=this.k[se],v=this.k[se+1],S=u[se],y=u[se+1],w=sum64_5_hi(pe,me,Ee,V,ae,ne,M,v,S,y),P=sum64_5_lo(pe,me,Ee,V,ae,ne,M,v,S,y);pe=s0_512_hi(d,c),me=s0_512_lo(d,c),Ee=maj64_hi(d,c,l,m,I),V=maj64_lo(d,c,l,m,I,O);var L=sum64_hi(pe,me,Ee,V),N=sum64_lo(pe,me,Ee,V);Q=J,te=X,J=U,X=Z,U=j,Z=F,j=sum64_hi(T,C,w,P),F=sum64_lo(C,C,w,P),T=I,C=O,I=l,O=m,l=d,m=c,d=sum64_hi(w,P,L,N),c=sum64_lo(w,P,L,N)}sum64(this.h,0,d,c),sum64(this.h,2,l,m),sum64(this.h,4,I,O),sum64(this.h,6,T,C),sum64(this.h,8,j,F),sum64(this.h,10,U,Z),sum64(this.h,12,J,X),sum64(this.h,14,Q,te)},SHA512$1.prototype._digest=function(e){return e==="hex"?utils$a.toHex32(this.h,"big"):utils$a.split32(this.h,"big")};function ch64_hi(t,e,a,u,d){var c=t&a^~t&d;return c<0&&(c+=4294967296),c}function ch64_lo(t,e,a,u,d,c){var l=e&u^~e&c;return l<0&&(l+=4294967296),l}function maj64_hi(t,e,a,u,d){var c=t&a^t&d^a&d;return c<0&&(c+=4294967296),c}function maj64_lo(t,e,a,u,d,c){var l=e&u^e&c^u&c;return l<0&&(l+=4294967296),l}function s0_512_hi(t,e){var a=rotr64_hi(t,e,28),u=rotr64_hi(e,t,2),d=rotr64_hi(e,t,7),c=a^u^d;return c<0&&(c+=4294967296),c}function s0_512_lo(t,e){var a=rotr64_lo(t,e,28),u=rotr64_lo(e,t,2),d=rotr64_lo(e,t,7),c=a^u^d;return c<0&&(c+=4294967296),c}function s1_512_hi(t,e){var a=rotr64_hi(t,e,14),u=rotr64_hi(t,e,18),d=rotr64_hi(e,t,9),c=a^u^d;return c<0&&(c+=4294967296),c}function s1_512_lo(t,e){var a=rotr64_lo(t,e,14),u=rotr64_lo(t,e,18),d=rotr64_lo(e,t,9),c=a^u^d;return c<0&&(c+=4294967296),c}function g0_512_hi(t,e){var a=rotr64_hi(t,e,1),u=rotr64_hi(t,e,8),d=shr64_hi(t,e,7),c=a^u^d;return c<0&&(c+=4294967296),c}function g0_512_lo(t,e){var a=rotr64_lo(t,e,1),u=rotr64_lo(t,e,8),d=shr64_lo(t,e,7),c=a^u^d;return c<0&&(c+=4294967296),c}function g1_512_hi(t,e){var a=rotr64_hi(t,e,19),u=rotr64_hi(e,t,29),d=shr64_hi(t,e,6),c=a^u^d;return c<0&&(c+=4294967296),c}function g1_512_lo(t,e){var a=rotr64_lo(t,e,19),u=rotr64_lo(e,t,29),d=shr64_lo(t,e,6),c=a^u^d;return c<0&&(c+=4294967296),c}var utils$9=utils$g,SHA512=_512;function SHA384(){if(!(this instanceof SHA384))return new SHA384;SHA512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}utils$9.inherits(SHA384,SHA512);var _384=SHA384;SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function(e){return e==="hex"?utils$9.toHex32(this.h.slice(0,12),"big"):utils$9.split32(this.h.slice(0,12),"big")},sha.sha1=_1,sha.sha224=_224,sha.sha256=_256,sha.sha384=_384,sha.sha512=_512;var ripemd={},utils$8=utils$g,common=common$5,rotl32=utils$8.rotl32,sum32=utils$8.sum32,sum32_3=utils$8.sum32_3,sum32_4=utils$8.sum32_4,BlockHash=common.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils$8.inherits(RIPEMD160,BlockHash),ripemd.ripemd160=RIPEMD160,RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.padLength=64,RIPEMD160.prototype._update=function(e,a){for(var u=this.h[0],d=this.h[1],c=this.h[2],l=this.h[3],m=this.h[4],I=u,O=d,T=c,C=l,j=m,F=0;F<80;F++){var U=sum32(rotl32(sum32_4(u,f(F,d,c,l),e[r[F]+a],K(F)),s[F]),m);u=m,m=l,l=rotl32(c,10),c=d,d=U,U=sum32(rotl32(sum32_4(I,f(79-F,O,T,C),e[rh[F]+a],Kh(F)),sh[F]),j),I=j,j=C,C=rotl32(T,10),T=O,O=U}U=sum32_3(this.h[1],c,C),this.h[1]=sum32_3(this.h[2],l,j),this.h[2]=sum32_3(this.h[3],m,I),this.h[3]=sum32_3(this.h[4],u,O),this.h[4]=sum32_3(this.h[0],d,T),this.h[0]=U},RIPEMD160.prototype._digest=function(e){return e==="hex"?utils$8.toHex32(this.h,"little"):utils$8.split32(this.h,"little")};function f(t,e,a,u){return t<=15?e^a^u:t<=31?e&a|~e&u:t<=47?(e|~a)^u:t<=63?e&u|a&~u:e^(a|~u)}function K(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var r=[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],rh=[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],s=[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],sh=[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],utils$7=utils$g,assert$b=minimalisticAssert;function Hmac(t,e,a){if(!(this instanceof Hmac))return new Hmac(t,e,a);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils$7.toArray(e,a))}var hmac=Hmac;Hmac.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),assert$b(e.length<=this.blockSize);for(var a=e.length;a<this.blockSize;a++)e.push(0);for(a=0;a<e.length;a++)e[a]^=54;for(this.inner=new this.Hash().update(e),a=0;a<e.length;a++)e[a]^=106;this.outer=new this.Hash().update(e)},Hmac.prototype.update=function(e,a){return this.inner.update(e,a),this},Hmac.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(t){var e=t;e.utils=utils$g,e.common=common$5,e.sha=sha,e.ripemd=ripemd,e.hmac=hmac,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(hash$4);var secp256k1$1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1$1={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"]]}}),secp256k1$1}(function(t){var e=t,a=hash$4,u=curve$6,d=utils$m,c=d.assert;function l(O){O.type==="short"?this.curve=new u.short(O):O.type==="edwards"?this.curve=new u.edwards(O):this.curve=new u.mont(O),this.g=this.curve.g,this.n=this.curve.n,this.hash=O.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=l;function m(O,T){Object.defineProperty(e,O,{configurable:!0,enumerable:!0,get:function(){var C=new l(T);return Object.defineProperty(e,O,{configurable:!0,enumerable:!0,value:C}),C}})}m("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:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),m("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:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),m("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:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),m("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:a.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"]}),m("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:a.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"]}),m("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),m("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:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var I;try{I=requireSecp256k1()}catch{I=void 0}m("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:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",I]})})(curves$3);var hash$3=hash$4,utils$6=utils$l,assert$a=minimalisticAssert;function HmacDRBG$1(t){if(!(this instanceof HmacDRBG$1))return new HmacDRBG$1(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=utils$6.toArray(t.entropy,t.entropyEnc||"hex"),a=utils$6.toArray(t.nonce,t.nonceEnc||"hex"),u=utils$6.toArray(t.pers,t.persEnc||"hex");assert$a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,a,u)}var hmacDrbg=HmacDRBG$1;HmacDRBG$1.prototype._init=function(e,a,u){var d=e.concat(a).concat(u);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var c=0;c<this.V.length;c++)this.K[c]=0,this.V[c]=1;this._update(d),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG$1.prototype._hmac=function(){return new hash$3.hmac(this.hash,this.K)},HmacDRBG$1.prototype._update=function(e){var a=this._hmac().update(this.V).update([0]);e&&(a=a.update(e)),this.K=a.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG$1.prototype.reseed=function(e,a,u,d){typeof a!="string"&&(d=u,u=a,a=null),e=utils$6.toArray(e,a),u=utils$6.toArray(u,d),assert$a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(u||[])),this._reseed=1},HmacDRBG$1.prototype.generate=function(e,a,u,d){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof a!="string"&&(d=u,u=a,a=null),u&&(u=utils$6.toArray(u,d||"hex"),this._update(u));for(var c=[];c.length<e;)this.V=this._hmac().update(this.V).digest(),c=c.concat(this.V);var l=c.slice(0,e);return this._update(u),this._reseed++,utils$6.encode(l,a)};var BN$9=bnExports,utils$5=utils$m,assert$9=utils$5.assert;function KeyPair$3(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)}var key$1=KeyPair$3;KeyPair$3.fromPublic=function(e,a,u){return a instanceof KeyPair$3?a:new KeyPair$3(e,{pub:a,pubEnc:u})},KeyPair$3.fromPrivate=function(e,a,u){return a instanceof KeyPair$3?a:new KeyPair$3(e,{priv:a,privEnc:u})},KeyPair$3.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},KeyPair$3.prototype.getPublic=function(e,a){return typeof e=="string"&&(a=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),a?this.pub.encode(a,e):this.pub},KeyPair$3.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},KeyPair$3.prototype._importPrivate=function(e,a){this.priv=new BN$9(e,a||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair$3.prototype._importPublic=function(e,a){if(e.x||e.y){this.ec.curve.type==="mont"?assert$9(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$9(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,a)},KeyPair$3.prototype.derive=function(e){return e.validate()||assert$9(e.validate(),"public point not validated"),e.mul(this.priv).getX()},KeyPair$3.prototype.sign=function(e,a,u){return this.ec.sign(e,this,a,u)},KeyPair$3.prototype.verify=function(e,a){return this.ec.verify(e,a,this)},KeyPair$3.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var BN$8=bnExports,utils$4=utils$m,assert$8=utils$4.assert;function Signature$5(t,e){if(t instanceof Signature$5)return t;this._importDER(t,e)||(assert$8(t.r&&t.s,"Signature without r or s"),this.r=new BN$8(t.r,16),this.s=new BN$8(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var signature$3=Signature$5;function Position(){this.place=0}function getLength(t,e){var a=t[e.place++];if(!(a&128))return a;var u=a&15;if(u===0||u>4)return!1;for(var d=0,c=0,l=e.place;c<u;c++,l++)d<<=8,d|=t[l],d>>>=0;return d<=127?!1:(e.place=l,d)}function rmPadding(t){for(var e=0,a=t.length-1;!t[e]&&!(t[e+1]&128)&&e<a;)e++;return e===0?t:t.slice(e)}Signature$5.prototype._importDER=function(e,a){e=utils$4.toArray(e,a);var u=new Position;if(e[u.place++]!==48)return!1;var d=getLength(e,u);if(d===!1||d+u.place!==e.length||e[u.place++]!==2)return!1;var c=getLength(e,u);if(c===!1)return!1;var l=e.slice(u.place,c+u.place);if(u.place+=c,e[u.place++]!==2)return!1;var m=getLength(e,u);if(m===!1||e.length!==m+u.place)return!1;var I=e.slice(u.place,m+u.place);if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;if(I[0]===0)if(I[1]&128)I=I.slice(1);else return!1;return this.r=new BN$8(l),this.s=new BN$8(I),this.recoveryParam=null,!0};function constructLength(t,e){if(e<128){t.push(e);return}var a=1+(Math.log(e)/Math.LN2>>>3);for(t.push(a|128);--a;)t.push(e>>>(a<<3)&255);t.push(e)}Signature$5.prototype.toDER=function(e){var a=this.r.toArray(),u=this.s.toArray();for(a[0]&128&&(a=[0].concat(a)),u[0]&128&&(u=[0].concat(u)),a=rmPadding(a),u=rmPadding(u);!u[0]&&!(u[1]&128);)u=u.slice(1);var d=[2];constructLength(d,a.length),d=d.concat(a),d.push(2),constructLength(d,u.length);var c=d.concat(u),l=[48];return constructLength(l,c.length),l=l.concat(c),utils$4.encode(l,e)};var BN$7=bnExports,HmacDRBG=hmacDrbg,utils$3=utils$m,curves$2=curves$3,rand=brorandExports,assert$7=utils$3.assert,KeyPair$2=key$1,Signature$4=signature$3;function EC$1(t){if(!(this instanceof EC$1))return new EC$1(t);typeof t=="string"&&(assert$7(Object.prototype.hasOwnProperty.call(curves$2,t),"Unknown curve "+t),t=curves$2[t]),t instanceof curves$2.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}var ec$1=EC$1;EC$1.prototype.keyPair=function(e){return new KeyPair$2(this,e)},EC$1.prototype.keyFromPrivate=function(e,a){return KeyPair$2.fromPrivate(this,e,a)},EC$1.prototype.keyFromPublic=function(e,a){return KeyPair$2.fromPublic(this,e,a)},EC$1.prototype.genKeyPair=function(e){e||(e={});for(var a=new HmacDRBG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),u=this.n.byteLength(),d=this.n.sub(new BN$7(2));;){var c=new BN$7(a.generate(u));if(!(c.cmp(d)>0))return c.iaddn(1),this.keyFromPrivate(c)}},EC$1.prototype._truncateToN=function(e,a){var u=e.byteLength()*8-this.n.bitLength();return u>0&&(e=e.ushrn(u)),!a&&e.cmp(this.n)>=0?e.sub(this.n):e},EC$1.prototype.sign=function(e,a,u,d){typeof u=="object"&&(d=u,u=null),d||(d={}),a=this.keyFromPrivate(a,u),e=this._truncateToN(new BN$7(e,16));for(var c=this.n.byteLength(),l=a.getPrivate().toArray("be",c),m=e.toArray("be",c),I=new HmacDRBG({hash:this.hash,entropy:l,nonce:m,pers:d.pers,persEnc:d.persEnc||"utf8"}),O=this.n.sub(new BN$7(1)),T=0;;T++){var C=d.k?d.k(T):new BN$7(I.generate(this.n.byteLength()));if(C=this._truncateToN(C,!0),!(C.cmpn(1)<=0||C.cmp(O)>=0)){var j=this.g.mul(C);if(!j.isInfinity()){var F=j.getX(),U=F.umod(this.n);if(U.cmpn(0)!==0){var Z=C.invm(this.n).mul(U.mul(a.getPrivate()).iadd(e));if(Z=Z.umod(this.n),Z.cmpn(0)!==0){var J=(j.getY().isOdd()?1:0)|(F.cmp(U)!==0?2:0);return d.canonical&&Z.cmp(this.nh)>0&&(Z=this.n.sub(Z),J^=1),new Signature$4({r:U,s:Z,recoveryParam:J})}}}}}},EC$1.prototype.verify=function(e,a,u,d){e=this._truncateToN(new BN$7(e,16)),u=this.keyFromPublic(u,d),a=new Signature$4(a,"hex");var c=a.r,l=a.s;if(c.cmpn(1)<0||c.cmp(this.n)>=0||l.cmpn(1)<0||l.cmp(this.n)>=0)return!1;var m=l.invm(this.n),I=m.mul(e).umod(this.n),O=m.mul(c).umod(this.n),T;return this.curve._maxwellTrick?(T=this.g.jmulAdd(I,u.getPublic(),O),T.isInfinity()?!1:T.eqXToP(c)):(T=this.g.mulAdd(I,u.getPublic(),O),T.isInfinity()?!1:T.getX().umod(this.n).cmp(c)===0)},EC$1.prototype.recoverPubKey=function(t,e,a,u){assert$7((3&a)===a,"The recovery param is more than two bits"),e=new Signature$4(e,u);var d=this.n,c=new BN$7(t),l=e.r,m=e.s,I=a&1,O=a>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&O)throw new Error("Unable to find sencond key candinate");O?l=this.curve.pointFromX(l.add(this.curve.n),I):l=this.curve.pointFromX(l,I);var T=e.r.invm(d),C=d.sub(c).mul(T).umod(d),j=m.mul(T).umod(d);return this.g.mulAdd(C,l,j)},EC$1.prototype.getKeyRecoveryParam=function(t,e,a,u){if(e=new Signature$4(e,u),e.recoveryParam!==null)return e.recoveryParam;for(var d=0;d<4;d++){var c;try{c=this.recoverPubKey(t,e,d)}catch{continue}if(c.eq(a))return d}throw new Error("Unable to find valid recovery factor")};var utils$2=utils$m,assert$6=utils$2.assert,parseBytes$2=utils$2.parseBytes,cachedProperty$1=utils$2.cachedProperty;function KeyPair$1(t,e){this.eddsa=t,this._secret=parseBytes$2(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=parseBytes$2(e.pub)}KeyPair$1.fromPublic=function(e,a){return a instanceof KeyPair$1?a:new KeyPair$1(e,{pub:a})},KeyPair$1.fromSecret=function(e,a){return a instanceof KeyPair$1?a:new KeyPair$1(e,{secret:a})},KeyPair$1.prototype.secret=function(){return this._secret},cachedProperty$1(KeyPair$1,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),cachedProperty$1(KeyPair$1,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty$1(KeyPair$1,"privBytes",function(){var e=this.eddsa,a=this.hash(),u=e.encodingLength-1,d=a.slice(0,e.encodingLength);return d[0]&=248,d[u]&=127,d[u]|=64,d}),cachedProperty$1(KeyPair$1,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty$1(KeyPair$1,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty$1(KeyPair$1,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair$1.prototype.sign=function(e){return assert$6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},KeyPair$1.prototype.verify=function(e,a){return this.eddsa.verify(e,a,this)},KeyPair$1.prototype.getSecret=function(e){return assert$6(this._secret,"KeyPair is public only"),utils$2.encode(this.secret(),e)},KeyPair$1.prototype.getPublic=function(e){return utils$2.encode(this.pubBytes(),e)};var key=KeyPair$1,BN$6=bnExports,utils$1=utils$m,assert$5=utils$1.assert,cachedProperty=utils$1.cachedProperty,parseBytes$1=utils$1.parseBytes;function Signature$3(t,e){this.eddsa=t,typeof e!="object"&&(e=parseBytes$1(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),assert$5(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof BN$6&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}cachedProperty(Signature$3,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature$3,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature$3,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature$3,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Signature$3.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Signature$3.prototype.toHex=function(){return utils$1.encode(this.toBytes(),"hex").toUpperCase()};var signature$2=Signature$3,hash$2=hash$4,curves$1=curves$3,utils=utils$m,assert$4=utils.assert,parseBytes=utils.parseBytes,KeyPair=key,Signature$2=signature$2;function EDDSA(t){if(assert$4(t==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(t);t=curves$1[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=hash$2.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function(e,a){e=parseBytes(e);var u=this.keyFromSecret(a),d=this.hashInt(u.messagePrefix(),e),c=this.g.mul(d),l=this.encodePoint(c),m=this.hashInt(l,u.pubBytes(),e).mul(u.priv()),I=d.add(m).umod(this.curve.n);return this.makeSignature({R:c,S:I,Rencoded:l})},EDDSA.prototype.verify=function(e,a,u){e=parseBytes(e),a=this.makeSignature(a);var d=this.keyFromPublic(u),c=this.hashInt(a.Rencoded(),d.pubBytes(),e),l=this.g.mul(a.S()),m=a.R().add(d.pub().mul(c));return m.eq(l)},EDDSA.prototype.hashInt=function(){for(var e=this.hash(),a=0;a<arguments.length;a++)e.update(arguments[a]);return utils.intFromLE(e.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function(e){return KeyPair.fromPublic(this,e)},EDDSA.prototype.keyFromSecret=function(e){return KeyPair.fromSecret(this,e)},EDDSA.prototype.makeSignature=function(e){return e instanceof Signature$2?e:new Signature$2(this,e)},EDDSA.prototype.encodePoint=function(e){var a=e.getY().toArray("le",this.encodingLength);return a[this.encodingLength-1]|=e.getX().isOdd()?128:0,a},EDDSA.prototype.decodePoint=function(e){e=utils.parseBytes(e);var a=e.length-1,u=e.slice(0,a).concat(e[a]&-129),d=(e[a]&128)!==0,c=utils.intFromLE(u);return this.curve.pointFromY(c,d)},EDDSA.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function(e){return utils.intFromLE(e)},EDDSA.prototype.isPoint=function(e){return e instanceof this.pointClass},function(t){var e=t;e.version=require$$0$2.version,e.utils=utils$m,e.rand=brorandExports,e.curve=curve$6,e.curves=curves$3,e.ec=ec$1,e.eddsa=eddsa}(elliptic);var BN$5=bn$1,BufferUtil$7=bufferExports,EC=elliptic.ec,ec=new EC("secp256k1"),ecPoint=ec.curve.point.bind(ec.curve),ecPointFromX=ec.curve.pointFromX.bind(ec.curve),Point$3=function(e,a,u){try{var d=ecPoint(e,a,u)}catch{throw new Error("Invalid Point")}return d.validate(),d};Point$3.prototype=Object.getPrototypeOf(ec.curve.point()),Point$3.fromX=function(e,a){try{var u=ecPointFromX(a,e)}catch{throw new Error("Invalid X")}return u.validate(),u},Point$3.getG=function(){return ec.curve.g},Point$3.getN=function(){return new BN$5(ec.curve.n.toArray())},Point$3.prototype._getX=Point$3.prototype.getX,Point$3.prototype.getX=function(){return new BN$5(this._getX().toArray())},Point$3.prototype._getY=Point$3.prototype.getY,Point$3.prototype.getY=function(){return new BN$5(this._getY().toArray())},Point$3.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var e;try{e=ecPointFromX(this.getX(),this.getY().isOdd())}catch{throw new Error("Point does not lie on the curve")}if(e.y.cmp(this.y)!==0)throw new Error("Invalid y value for curve.");if(!this.mul(Point$3.getN()).isInfinity())throw new Error("Point times N must be infinity");return this},Point$3.pointToCompressed=function(e){var a=e.getX().toBuffer({size:32}),u=e.getY().toBuffer({size:32}),d,c=u[u.length-1]%2;return c?d=Buffer$N.from([3]):d=Buffer$N.from([2]),BufferUtil$7.concat([d,a])};var point$1=Point$3,BN$4=bn$1,_$b=lodashExports,$$7=preconditions,BufferUtil$6=bufferExports,JSUtil$3=js,Signature$1=function t(e,a){if(!(this instanceof t))return new t(e,a);if(e instanceof BN$4)this.set({r:e,s:a});else if(e){var u=e;this.set(u)}};Signature$1.prototype.set=function(t){return this.r=t.r||this.r||void 0,this.s=t.s||this.s||void 0,this.i=typeof t.i<"u"?t.i:this.i,this.compressed=typeof t.compressed<"u"?t.compressed:this.compressed,this.nhashtype=t.nhashtype||this.nhashtype||void 0,this},Signature$1.fromCompact=function(t){$$7.checkArgument(BufferUtil$6.isBuffer(t),"Argument is expected to be a Buffer");var e=new Signature$1,a=!0,u=t.slice(0,1)[0]-27-4;u<0&&(a=!1,u=u+4);var d=t.slice(1,33),c=t.slice(33,65);return $$7.checkArgument(u===0||u===1||u===2||u===3,new Error("i must be 0, 1, 2, or 3")),$$7.checkArgument(d.length===32,new Error("r must be 32 bytes")),$$7.checkArgument(c.length===32,new Error("s must be 32 bytes")),e.compressed=a,e.i=u,e.r=BN$4.fromBuffer(d),e.s=BN$4.fromBuffer(c),e},Signature$1.fromDER=Signature$1.fromBuffer=function(t,e){var a=Signature$1.parseDER(t,e),u=new Signature$1;return u.r=a.r,u.s=a.s,u},Signature$1.fromTxFormat=function(t){var e=t.readUInt8(t.length-1),a=t.slice(0,t.length-1),u=new Signature$1.fromDER(a,!1);return u.nhashtype=e,u},Signature$1.fromString=function(t){var e=Buffer$N.from(t,"hex");return Signature$1.fromDER(e)},Signature$1.parseDER=function(t,e){$$7.checkArgument(BufferUtil$6.isBuffer(t),new Error("DER formatted signature should be a buffer")),_$b.isUndefined(e)&&(e=!0);var a=t[0];$$7.checkArgument(a===48,new Error("Header byte should be 0x30"));var u=t[1],d=t.slice(2).length;$$7.checkArgument(!e||u===d,new Error("Length byte should length of what follows")),u=u<d?u:d;var c=t[2];$$7.checkArgument(c===2,new Error("Integer byte for r should be 0x02"));var l=t[3],m=t.slice(4,4+l),I=BN$4.fromBuffer(m),O=t[4]===0;$$7.checkArgument(l===m.length,new Error("Length of r incorrect"));var T=t[4+l+0];$$7.checkArgument(T===2,new Error("Integer byte for s should be 0x02"));var C=t[4+l+1],j=t.slice(4+l+2,4+l+2+C),F=BN$4.fromBuffer(j),U=t[4+l+2+2]===0;$$7.checkArgument(C===j.length,new Error("Length of s incorrect"));var Z=4+l+2+C;$$7.checkArgument(u===Z-2,new Error("Length of signature incorrect"));var J={header:a,length:u,rheader:c,rlength:l,rneg:O,rbuf:m,r:I,sheader:T,slength:C,sneg:U,sbuf:j,s:F};return J},Signature$1.prototype.toCompact=function(t,e){if(t=typeof t=="number"?t:this.i,e=typeof e=="boolean"?e:this.compressed,!(t===0||t===1||t===2||t===3))throw new Error("i must be equal to 0, 1, 2, or 3");var a=t+27+4;e===!1&&(a=a-4);var u=Buffer$N.from([a]),d=this.r.toBuffer({size:32}),c=this.s.toBuffer({size:32});return Buffer$N.concat([u,d,c])},Signature$1.prototype.toBuffer=Signature$1.prototype.toDER=function(){var t=this.r.toBuffer(),e=this.s.toBuffer(),a=!!(t[0]&128),u=!!(e[0]&128),d=a?Buffer$N.concat([Buffer$N.from([0]),t]):t,c=u?Buffer$N.concat([Buffer$N.from([0]),e]):e,l=d.length,m=c.length,I=2+l+2+m,O=2,T=2,C=48,j=Buffer$N.concat([Buffer$N.from([C,I,O,l]),d,Buffer$N.from([T,m]),c]);return j},Signature$1.prototype.toString=function(){var t=this.toDER();return t.toString("hex")},Signature$1.isTxDER=function(t){if(t.length<9||t.length>73||t[0]!==48||t[1]!==t.length-3)return!1;var e=t[3];if(5+e>=t.length)return!1;var a=t[5+e];if(e+a+7!==t.length)return!1;var u=t.slice(4);if(t[2]!==2||e===0||u[0]&128||e>1&&u[0]===0&&!(u[1]&128))return!1;var d=t.slice(6+e);return!(t[6+e-2]!==2||a===0||d[0]&128||a>1&&d[0]===0&&!(d[1]&128))},Signature$1.prototype.hasLowS=function(){return!(this.s.lt(new BN$4(1))||this.s.gt(new BN$4("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))},Signature$1.prototype.hasDefinedHashtype=function(){if(!JSUtil$3.isNaturalNumber(this.nhashtype))return!1;var t=this.nhashtype&~Signature$1.SIGHASH_ANYONECANPAY;return!(t<Signature$1.SIGHASH_ALL||t>Signature$1.SIGHASH_SINGLE)},Signature$1.prototype.toTxFormat=function(){var t=this.toDER(),e=Buffer$N.alloc(1);return e.writeUInt8(this.nhashtype,0),Buffer$N.concat([t,e])},Signature$1.SIGHASH_ALL=1,Signature$1.SIGHASH_NONE=2,Signature$1.SIGHASH_SINGLE=3,Signature$1.SIGHASH_ANYONECANPAY=128;var signature$1=Signature$1,hash$1={exports:{}};(function(t){var e=requireCryptoBrowserify(),a=bufferExports,u=preconditions,d=t.exports;d.sha1=function(c){return u.checkArgument(a.isBuffer(c)),e.createHash("sha1").update(c).digest()},d.sha1.blocksize=512,d.sha256=function(c){return u.checkArgument(a.isBuffer(c)),e.createHash("sha256").update(c).digest()},d.sha256.blocksize=512,d.sha256sha256=function(c){return u.checkArgument(a.isBuffer(c)),d.sha256(d.sha256(c))},d.ripemd160=function(c){return u.checkArgument(a.isBuffer(c)),e.createHash("ripemd160").update(c).digest()},d.sha256ripemd160=function(c){return u.checkArgument(a.isBuffer(c)),d.ripemd160(d.sha256(c))},d.sha512=function(c){return u.checkArgument(a.isBuffer(c)),e.createHash("sha512").update(c).digest()},d.sha512.blocksize=1024,d.hmac=function(c,l,m){u.checkArgument(a.isBuffer(l)),u.checkArgument(a.isBuffer(m)),u.checkArgument(c.blocksize);var I=c.blocksize/8;if(m.length>I)m=c(m);else if(m<I){var O=Buffer$N.alloc(I);O.fill(0),m.copy(O),m=O}var T=Buffer$N.alloc(I);T.fill(92);var C=Buffer$N.alloc(I);C.fill(54);for(var j=Buffer$N.alloc(I),F=Buffer$N.alloc(I),U=0;U<I;U++)j[U]=T[U]^m[U],F[U]=C[U]^m[U];return c(Buffer$N.concat([j,c(Buffer$N.concat([F,l]))]))},d.sha256hmac=function(c,l){return d.hmac(d.sha256,c,l)},d.sha512hmac=function(c,l){return d.hmac(d.sha512,c,l)}})(hash$1);var hashExports=hash$1.exports,_$a=lodashExports,BufferUtil$5=bufferExports,JSUtil$2=js,networks=[],networkMaps={};function Network(){}Network.prototype.toString=function(){return this.name};function get(t,e){if(~networks.indexOf(t))return t;if(e){_$a.isArray(e)||(e=[e]);var a=function(d){return networks[u][d]===t};for(var u in networks)if(_$a.some(e,a))return networks[u];return}return networkMaps[t]&&networkMaps[t].length>=1?networkMaps[t][0]:networkMaps[t]}function addNetwork(t){var e=new Network;return JSUtil$2.defineImmutable(e,{name:t.name,alias:t.alias,pubkeyhash:t.pubkeyhash,privatekey:t.privatekey,scripthash:t.scripthash,bech32prefix:t.bech32prefix,xpubkey:t.xpubkey,xprivkey:t.xprivkey}),t.networkMagic&&JSUtil$2.defineImmutable(e,{networkMagic:BufferUtil$5.integerAsBuffer(t.networkMagic)}),t.port&&JSUtil$2.defineImmutable(e,{port:t.port}),t.dnsSeeds&&JSUtil$2.defineImmutable(e,{dnsSeeds:t.dnsSeeds}),_$a.each(e,function(a){!_$a.isUndefined(a)&&!_$a.isObject(a)&&(networkMaps[a]||(networkMaps[a]=[]),networkMaps[a].push(e))}),networks.push(e),e}function removeNetwork(t){typeof t!="object"&&(t=get(t));for(var e=0;e<networks.length;e++)networks[e]===t&&networks.splice(e,1);for(var a in networkMaps)if(networkMaps[a].length){const u=networkMaps[a].indexOf(t);u>=0&&networkMaps[a].splice(u,1),networkMaps[a].length===0&&delete networkMaps[a]}else networkMaps[a]===t&&delete networkMaps[a]}addNetwork({name:"livenet",alias:"mainnet",pubkeyhash:0,privatekey:128,scripthash:5,bech32prefix:"bc",xpubkey:76067358,xprivkey:76066276,networkMagic:4190024921,port:8333,dnsSeeds:["seed.bitcoin.sipa.be","dnsseed.bluematt.me","dnsseed.bitcoin.dashjr.org","seed.bitcoinstats.com","seed.bitnodes.io","bitseed.xf2.org"]});var livenet=get("livenet");addNetwork({name:"testnet",alias:"test",pubkeyhash:111,privatekey:239,scripthash:196,bech32prefix:"tb",xpubkey:70617039,xprivkey:70615956,networkMagic:185665799,port:18333,dnsSeeds:["testnet-seed.bitcoin.petertodd.org","testnet-seed.bluematt.me","testnet-seed.alexykot.me","testnet-seed.bitcoin.schildbach.de"]});var testnet=get("testnet");addNetwork({name:"regtest",alias:"dev",pubkeyhash:111,privatekey:239,scripthash:196,bech32prefix:"bcrt",xpubkey:70617039,xprivkey:70615956,networkMagic:4206867930,port:18444,dnsSeeds:[]});var regtest=get("regtest");function enableRegtest(){testnet.regtestEnabled=!0}function disableRegtest(){testnet.regtestEnabled=!1}var networks_1={add:addNetwork,remove:removeNetwork,defaultNetwork:livenet,livenet,mainnet:livenet,testnet,regtest,get,enableRegtest,disableRegtest},safeBuffer={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var a=require$$1$4,u=a.Buffer;function d(l,m){for(var I in l)m[I]=l[I]}u.from&&u.alloc&&u.allocUnsafe&&u.allocUnsafeSlow?t.exports=a:(d(a,e),e.Buffer=c);function c(l,m,I){return u(l,m,I)}c.prototype=Object.create(u.prototype),d(u,c),c.from=function(l,m,I){if(typeof l=="number")throw new TypeError("Argument must not be a number");return u(l,m,I)},c.alloc=function(l,m,I){if(typeof l!="number")throw new TypeError("Argument must be a number");var O=u(l);return m!==void 0?typeof I=="string"?O.fill(m,I):O.fill(m):O.fill(0),O},c.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return u(l)},c.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return a.SlowBuffer(l)}})(safeBuffer,safeBuffer.exports);var safeBufferExports=safeBuffer.exports,_Buffer=safeBufferExports.Buffer;function base(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),a=0;a<e.length;a++)e[a]=255;for(var u=0;u<t.length;u++){var d=t.charAt(u),c=d.charCodeAt(0);if(e[c]!==255)throw new TypeError(d+" is ambiguous");e[c]=u}var l=t.length,m=t.charAt(0),I=Math.log(l)/Math.log(256),O=Math.log(256)/Math.log(l);function T(F){if((Array.isArray(F)||F instanceof Uint8Array)&&(F=_Buffer.from(F)),!_Buffer.isBuffer(F))throw new TypeError("Expected Buffer");if(F.length===0)return"";for(var U=0,Z=0,J=0,X=F.length;J!==X&&F[J]===0;)J++,U++;for(var Q=(X-J)*O+1>>>0,te=new Uint8Array(Q);J!==X;){for(var se=F[J],pe=0,me=Q-1;(se!==0||pe<Z)&&me!==-1;me--,pe++)se+=256*te[me]>>>0,te[me]=se%l>>>0,se=se/l>>>0;if(se!==0)throw new Error("Non-zero carry");Z=pe,J++}for(var Ee=Q-Z;Ee!==Q&&te[Ee]===0;)Ee++;for(var V=m.repeat(U);Ee<Q;++Ee)V+=t.charAt(te[Ee]);return V}function C(F){if(typeof F!="string")throw new TypeError("Expected String");if(F.length===0)return _Buffer.alloc(0);for(var U=0,Z=0,J=0;F[U]===m;)Z++,U++;for(var X=(F.length-U)*I+1>>>0,Q=new Uint8Array(X);F[U];){var te=e[F.charCodeAt(U)];if(te===255)return;for(var se=0,pe=X-1;(te!==0||se<J)&&pe!==-1;pe--,se++)te+=l*Q[pe]>>>0,Q[pe]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");J=se,U++}for(var me=X-J;me!==X&&Q[me]===0;)me++;var Ee=_Buffer.allocUnsafe(Z+(X-me));Ee.fill(0,0,Z);for(var V=Z;me!==X;)Ee[V++]=Q[me++];return Ee}function j(F){var U=C(F);if(U)return U;throw new Error("Non-base"+l+" character")}return{encode:T,decodeUnsafe:C,decode:j}}var src$1=base,basex=src$1,ALPHABET$2="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",bs58$1=basex(ALPHABET$2),_$9=lodashExports,bs58=bs58$1,buffer=require$$1$4,ALPHABET$1="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),Base58$1=function t(e){if(!(this instanceof t))return new t(e);if(Buffer$N.isBuffer(e)){var a=e;this.fromBuffer(a)}else if(typeof e=="string"){var u=e;this.fromString(u)}else e&&this.set(e)};Base58$1.validCharacters=function(e){return buffer.Buffer.isBuffer(e)&&(e=e.toString()),_$9.every(_$9.map(e,function(a){return _$9.includes(ALPHABET$1,a)}))},Base58$1.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},Base58$1.encode=function(t){if(!buffer.Buffer.isBuffer(t))throw new Error("Input should be a buffer");return bs58.encode(t)},Base58$1.decode=function(t){if(typeof t!="string")throw new Error("Input should be a string");return Buffer$N.from(bs58.decode(t))},Base58$1.prototype.fromBuffer=function(t){return this.buf=t,this},Base58$1.prototype.fromString=function(t){var e=Base58$1.decode(t);return this.buf=e,this},Base58$1.prototype.toBuffer=function(){return this.buf},Base58$1.prototype.toString=function(){return Base58$1.encode(this.buf)};var base58=Base58$1,_$8=lodashExports,Base58=base58,sha256sha256$1=hashExports.sha256sha256,Base58Check=function t(e){if(!(this instanceof t))return new t(e);if(Buffer$N.isBuffer(e)){var a=e;this.fromBuffer(a)}else if(typeof e=="string"){var u=e;this.fromString(u)}else e&&this.set(e)};Base58Check.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},Base58Check.validChecksum=function(e,a){return _$8.isString(e)&&(e=Buffer$N.from(Base58.decode(e))),_$8.isString(a)&&(a=Buffer$N.from(Base58.decode(a))),a||(a=e.slice(-4),e=e.slice(0,-4)),Base58Check.checksum(e).toString("hex")===a.toString("hex")},Base58Check.decode=function(t){if(typeof t!="string")throw new Error("Input must be a string");var e=Buffer$N.from(Base58.decode(t));if(e.length<4)throw new Error("Input string too short");var a=e.slice(0,-4),u=e.slice(-4),d=sha256sha256$1(a),c=d.slice(0,4);if(u.toString("hex")!==c.toString("hex"))throw new Error("Checksum mismatch");return a},Base58Check.checksum=function(t){return sha256sha256$1(t).slice(0,4)},Base58Check.encode=function(t){if(!Buffer$N.isBuffer(t))throw new Error("Input must be a buffer");var e=Buffer$N.alloc(t.length+4),a=Base58Check.checksum(t);return t.copy(e),a.copy(e,t.length),Base58.encode(e)},Base58Check.prototype.fromBuffer=function(t){return this.buf=t,this},Base58Check.prototype.fromString=function(t){var e=Base58Check.decode(t);return this.buf=e,this},Base58Check.prototype.toBuffer=function(){return this.buf},Base58Check.prototype.toString=function(){return Base58Check.encode(this.buf)};var base58check=Base58Check,dist={};Object.defineProperty(dist,"__esModule",{value:!0}),dist.bech32m=dist.bech32=void 0;const ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(let t=0;t<ALPHABET.length;t++){const e=ALPHABET.charAt(t);ALPHABET_MAP[e]=t}function polymodStep(t){const e=t>>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function prefixChk(t){let e=1;for(let a=0;a<t.length;++a){const u=t.charCodeAt(a);if(u<33||u>126)return"Invalid prefix ("+t+")";e=polymodStep(e)^u>>5}e=polymodStep(e);for(let a=0;a<t.length;++a){const u=t.charCodeAt(a);e=polymodStep(e)^u&31}return e}function convert$5(t,e,a,u){let d=0,c=0;const l=(1<<a)-1,m=[];for(let I=0;I<t.length;++I)for(d=d<<e|t[I],c+=e;c>=a;)c-=a,m.push(d>>c&l);if(u)c>0&&m.push(d<<a-c&l);else{if(c>=e)return"Excess padding";if(d<<a-c&l)return"Non-zero padding"}return m}function toWords(t){return convert$5(t,8,5,!0)}function fromWordsUnsafe(t){const e=convert$5(t,5,8,!1);if(Array.isArray(e))return e}function fromWords(t){const e=convert$5(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}function getLibraryFromEncoding(t){let e;t==="bech32"?e=1:e=734539939;function a(l,m,I){if(I=I||90,l.length+7+m.length>I)throw new TypeError("Exceeds length limit");l=l.toLowerCase();let O=prefixChk(l);if(typeof O=="string")throw new Error(O);let T=l+"1";for(let C=0;C<m.length;++C){const j=m[C];if(j>>5)throw new Error("Non 5-bit word");O=polymodStep(O)^j,T+=ALPHABET.charAt(j)}for(let C=0;C<6;++C)O=polymodStep(O);O^=e;for(let C=0;C<6;++C){const j=O>>(5-C)*5&31;T+=ALPHABET.charAt(j)}return T}function u(l,m){if(m=m||90,l.length<8)return l+" too short";if(l.length>m)return"Exceeds length limit";const I=l.toLowerCase(),O=l.toUpperCase();if(l!==I&&l!==O)return"Mixed-case string "+l;l=I;const T=l.lastIndexOf("1");if(T===-1)return"No separator character for "+l;if(T===0)return"Missing prefix for "+l;const C=l.slice(0,T),j=l.slice(T+1);if(j.length<6)return"Data too short";let F=prefixChk(C);if(typeof F=="string")return F;const U=[];for(let Z=0;Z<j.length;++Z){const J=j.charAt(Z),X=ALPHABET_MAP[J];if(X===void 0)return"Unknown character "+J;F=polymodStep(F)^X,!(Z+6>=j.length)&&U.push(X)}return F!==e?"Invalid checksum for "+l:{prefix:C,words:U}}function d(l,m){const I=u(l,m);if(typeof I=="object")return I}function c(l,m){const I=u(l,m);if(typeof I=="object")return I;throw new Error(I)}return{decodeUnsafe:d,decode:c,encode:a,toWords,fromWordsUnsafe,fromWords}}dist.bech32=getLibraryFromEncoding("bech32"),dist.bech32m=getLibraryFromEncoding("bech32m");var bech32=dist,decode$2=function(t){if(typeof t!="string")throw new Error("Input should be a string");var e;let a=bech32.bech32.fromWords,u=encodings.BECH32;try{e=bech32.bech32.decode(t)}catch(c){if(c.message.indexOf("Invalid checksum")>-1)e=bech32.bech32m.decode(t),u=encodings.BECH32M,a=bech32.bech32m.fromWords;else throw c}const d=e.words[0];if(d>=1&&u!==encodings.BECH32M)throw new Error("Version 1+ witness address must use Bech32m checksum");return{prefix:e.prefix,data:Buffer$N.from(a(e.words.slice(1))),version:d}},encode$2=function(t,e,a,u){if(typeof t!="string")throw new Error("Prefix should be a string");if(typeof e!="number")throw new Error("version should be a number");if(u&&typeof u=="string"&&(u=encodings[u.toUpperCase()]||-1),u&&!(u==encodings.BECH32||u==encodings.BECH32M))throw new Error("Invalid encoding specified");let d=u==encodings.BECH32M?bech32.bech32m:bech32.bech32,c=d.toWords(a);return c.unshift(e),d.encode(t,c)};const encodings={BECH32:1,BECH32M:2};var bech32_1={decode:decode$2,encode:encode$2,encodings},script$1={exports:{}},_$7=lodashExports,$$6=preconditions,BufferUtil$4=bufferExports,BN$3=bn$1,BufferReader$4=function t(e){if(!(this instanceof t))return new t(e);if(!_$7.isUndefined(e))if(Buffer$N.isBuffer(e))this.set({buf:e});else if(_$7.isString(e))this.set({buf:Buffer$N.from(e,"hex")});else if(_$7.isObject(e)){var a=e;this.set(a)}else throw new TypeError("Unrecognized argument for BufferReader")};BufferReader$4.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this.pos=t.pos||this.pos||0,this},BufferReader$4.prototype.eof=function(){return this.buf?this.pos>=this.buf.length:!0},BufferReader$4.prototype.finished=BufferReader$4.prototype.eof,BufferReader$4.prototype.read=function(t){$$6.checkArgument(!_$7.isUndefined(t),"Must specify a length");var e=this.buf.slice(this.pos,this.pos+t);return this.pos=this.pos+t,e},BufferReader$4.prototype.readAll=function(){var t=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,t},BufferReader$4.prototype.readUInt8=function(){var t=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,t},BufferReader$4.prototype.readUInt16BE=function(){var t=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,t},BufferReader$4.prototype.readUInt16LE=function(){var t=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,t},BufferReader$4.prototype.readUInt32BE=function(){var t=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,t},BufferReader$4.prototype.readUInt32LE=function(){var t=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,t},BufferReader$4.prototype.readInt32LE=function(){var t=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,t},BufferReader$4.prototype.readUInt64BEBN=function(){var t=this.buf.slice(this.pos,this.pos+8),e=BN$3.fromBuffer(t);return this.pos=this.pos+8,e},BufferReader$4.prototype.readUInt64LEBN=function(){var t=this.buf.readUInt32LE(this.pos),e=this.buf.readUInt32LE(this.pos+4),a=e*4294967296+t,u;if(a<=9007199254740991)u=new BN$3(a);else{var d=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);u=new BN$3(d,10,"le")}return this.pos=this.pos+8,u},BufferReader$4.prototype.readVarintNum=function(){var t=this.readUInt8();switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var e=this.readUInt64LEBN(),a=e.toNumber();if(a<=Math.pow(2,53))return a;throw new Error("number too large to retain precision - use readVarintBN");default:return t}},BufferReader$4.prototype.readVarLengthBuffer=function(){var t=this.readVarintNum(),e=this.read(t);return $$6.checkState(e.length===t,"Invalid length while reading varlength buffer. Expected to read: "+t+" and read "+e.length),e},BufferReader$4.prototype.readVarintBuf=function(){var t=this.buf.readUInt8(this.pos);switch(t){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},BufferReader$4.prototype.readVarintBN=function(){var t=this.readUInt8();switch(t){case 253:return new BN$3(this.readUInt16LE());case 254:return new BN$3(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new BN$3(t)}},BufferReader$4.prototype.reverse=function(){for(var t=Buffer$N.alloc(this.buf.length),e=0;e<t.length;e++)t[e]=this.buf[this.buf.length-1-e];return this.buf=t,this},BufferReader$4.prototype.readReverse=function(t){_$7.isUndefined(t)&&(t=this.buf.length);var e=this.buf.slice(this.pos,this.pos+t);return this.pos=this.pos+t,BufferUtil$4.reverse(e)};var bufferreader=BufferReader$4,bufferUtil=bufferExports,assert$3=requireAssert(),BufferWriter$5=function t(e){if(!(this instanceof t))return new t(e);this.bufLen=0,e?this.set(e):this.bufs=[]};BufferWriter$5.prototype.set=function(t){return this.bufs=t.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(e,a){return e+a.length},0),this},BufferWriter$5.prototype.toBuffer=function(){return this.concat()},BufferWriter$5.prototype.concat=function(){return Buffer$N.concat(this.bufs,this.bufLen)},BufferWriter$5.prototype.write=function(t){return assert$3(bufferUtil.isBuffer(t)),this.bufs.push(t),this.bufLen+=t.length,this},BufferWriter$5.prototype.writeReverse=function(t){return assert$3(bufferUtil.isBuffer(t)),this.bufs.push(bufferUtil.reverse(t)),this.bufLen+=t.length,this},BufferWriter$5.prototype.writeUInt8=function(t){var e=Buffer$N.alloc(1);return e.writeUInt8(t,0),this.write(e),this},BufferWriter$5.prototype.writeUInt16BE=function(t){var e=Buffer$N.alloc(2);return e.writeUInt16BE(t,0),this.write(e),this},BufferWriter$5.prototype.writeUInt16LE=function(t){var e=Buffer$N.alloc(2);return e.writeUInt16LE(t,0),this.write(e),this},BufferWriter$5.prototype.writeUInt32BE=function(t){var e=Buffer$N.alloc(4);return e.writeUInt32BE(t,0),this.write(e),this},BufferWriter$5.prototype.writeInt32LE=function(t){var e=Buffer$N.alloc(4);return e.writeInt32LE(t,0),this.write(e),this},BufferWriter$5.prototype.writeUInt32LE=function(t){var e=Buffer$N.alloc(4);return e.writeUInt32LE(t,0),this.write(e),this},BufferWriter$5.prototype.writeUInt64BEBN=function(t){var e=t.toBuffer({size:8});return this.write(e),this},BufferWriter$5.prototype.writeUInt64LEBN=function(t){var e=t.toBuffer({size:8});return this.writeReverse(e),this},BufferWriter$5.prototype.writeVarintNum=function(t){var e=BufferWriter$5.varintBufNum(t);return this.write(e),this},BufferWriter$5.prototype.writeVarintBN=function(t){var e=BufferWriter$5.varintBufBN(t);return this.write(e),this},BufferWriter$5.varintBufNum=function(t){var e=void 0;return t<253?(e=Buffer$N.alloc(1),e.writeUInt8(t,0)):t<65536?(e=Buffer$N.alloc(3),e.writeUInt8(253,0),e.writeUInt16LE(t,1)):t<4294967296?(e=Buffer$N.alloc(5),e.writeUInt8(254,0),e.writeUInt32LE(t,1)):(e=Buffer$N.alloc(9),e.writeUInt8(255,0),e.writeInt32LE(t&-1,1),e.writeUInt32LE(Math.floor(t/4294967296),5)),e},BufferWriter$5.varintBufBN=function(t){var e=void 0,a=t.toNumber();if(a<253)e=Buffer$N.alloc(1),e.writeUInt8(a,0);else if(a<65536)e=Buffer$N.alloc(3),e.writeUInt8(253,0),e.writeUInt16LE(a,1);else if(a<4294967296)e=Buffer$N.alloc(5),e.writeUInt8(254,0),e.writeUInt32LE(a,1);else{var u=new BufferWriter$5;u.writeUInt8(255),u.writeUInt64LEBN(t);var e=u.concat()}return e};var bufferwriter=BufferWriter$5,_$6=lodashExports,$$5=preconditions,BufferUtil$3=bufferExports,JSUtil$1=js;function Opcode(t){if(!(this instanceof Opcode))return new Opcode(t);var e;if(_$6.isNumber(t))e=t;else if(_$6.isString(t))e=Opcode.map[t];else throw new TypeError('Unrecognized num type: "'+typeof t+'" for Opcode');return JSUtil$1.defineImmutable(this,{num:e}),this}Opcode.fromBuffer=function(t){return $$5.checkArgument(BufferUtil$3.isBuffer(t)),new Opcode(+("0x"+t.toString("hex")))},Opcode.fromNumber=function(t){return $$5.checkArgument(_$6.isNumber(t)),new Opcode(t)},Opcode.fromString=function(t){$$5.checkArgument(_$6.isString(t));var e=Opcode.map[t];if(typeof e>"u")throw new TypeError("Invalid opcodestr");return new Opcode(e)},Opcode.prototype.toHex=function(){return this.num.toString(16)},Opcode.prototype.toBuffer=function(){return Buffer$N.from(this.toHex(),"hex")},Opcode.prototype.toNumber=function(){return this.num},Opcode.prototype.toString=function(){var t=Opcode.reverseMap[this.num];if(typeof t>"u")throw new Error("Opcode does not have a string representation");return t},Opcode.smallInt=function(t){return $$5.checkArgument(_$6.isNumber(t),"Invalid Argument: n should be number"),$$5.checkArgument(t>=0&&t<=16,"Invalid Argument: n must be between 0 and 16"),t===0?Opcode("OP_0"):new Opcode(Opcode.map.OP_1+t-1)},Opcode.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},Opcode.reverseMap=[];for(var k in Opcode.map)Opcode.reverseMap[Opcode.map[k]]=k;_$6.extend(Opcode,Opcode.map),Opcode.isSmallIntOp=function(t){return t instanceof Opcode&&(t=t.toNumber()),t===Opcode.map.OP_0||t>=Opcode.map.OP_1&&t<=Opcode.map.OP_16},Opcode.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"};var opcode=Opcode,script,hasRequiredScript$1;function requireScript$1(){if(hasRequiredScript$1)return script;hasRequiredScript$1=1;var t=requireAddress(),e=bufferreader,a=bufferwriter,u=hashExports,d=opcode,c=requirePublickey(),l=signature$1,m=networks_1,I=preconditions,O=lodashExports,T=errorsExports,C=bufferExports,j=js,F=function U(Z){if(!(this instanceof U))return new U(Z);if(this.chunks=[],C.isBuffer(Z))return U.fromBuffer(Z);if(Z instanceof t)return U.fromAddress(Z);if(Z instanceof U)return U.fromBuffer(Z.toBuffer());if(typeof Z=="string")return U.fromString(Z);O.isObject(Z)&&Array.isArray(Z.chunks)&&this.set(Z)};return F.VERIFY_TAPROOT=1<<17,F.prototype.set=function(U){return I.checkArgument(O.isObject(U)),I.checkArgument(Array.isArray(U.chunks)),this.chunks=U.chunks,this},F.fromBuffer=function(U){var Z=new F;Z.chunks=[];for(var J=new e(U);!J.finished();)try{var X=J.readUInt8(),Q,te;X>0&&X<d.OP_PUSHDATA1?(Q=X,Z.chunks.push({buf:J.read(Q),len:Q,opcodenum:X})):X===d.OP_PUSHDATA1?(Q=J.readUInt8(),te=J.read(Q),Z.chunks.push({buf:te,len:Q,opcodenum:X})):X===d.OP_PUSHDATA2?(Q=J.readUInt16LE(),te=J.read(Q),Z.chunks.push({buf:te,len:Q,opcodenum:X})):X===d.OP_PUSHDATA4?(Q=J.readUInt32LE(),te=J.read(Q),Z.chunks.push({buf:te,len:Q,opcodenum:X})):Z.chunks.push({opcodenum:X})}catch(se){throw se instanceof RangeError?new T.Script.InvalidBuffer(U.toString("hex")):se}return Z},F.prototype.toBuffer=function(){for(var U=new a,Z=0;Z<this.chunks.length;Z++){var J=this.chunks[Z],X=J.opcodenum;U.writeUInt8(J.opcodenum),J.buf&&(X<d.OP_PUSHDATA1?U.write(J.buf):X===d.OP_PUSHDATA1?(U.writeUInt8(J.len),U.write(J.buf)):X===d.OP_PUSHDATA2?(U.writeUInt16LE(J.len),U.write(J.buf)):X===d.OP_PUSHDATA4&&(U.writeUInt32LE(J.len),U.write(J.buf)))}return U.concat()},F.fromASM=function(U){var Z=new F;Z.chunks=[];for(var J=U.split(" "),X=0;X<J.length;){var Q=J[X],te=d(Q),se=te.toNumber();if(se==null){var pe=Buffer$N.from(J[X],"hex");Z.chunks.push({buf:pe,len:pe.length,opcodenum:pe.length}),X=X+1}else se===d.OP_PUSHDATA1||se===d.OP_PUSHDATA2||se===d.OP_PUSHDATA4?(Z.chunks.push({buf:Buffer$N.from(J[X+2],"hex"),len:parseInt(J[X+1]),opcodenum:se}),X=X+3):(Z.chunks.push({opcodenum:se}),X=X+1)}return Z},F.fromHex=function(U){return new F(Buffer$N.from(U,"hex"))},F.fromString=function(U){if(j.isHexa(U)||U.length===0)return new F(Buffer$N.from(U,"hex"));var Z=new F;Z.chunks=[];for(var J=U.split(" "),X=0;X<J.length;){var Q=J[X],te=d(Q),se=te.toNumber();if(se==null)if(se=parseInt(Q),se>0&&se<d.OP_PUSHDATA1)Z.chunks.push({buf:Buffer$N.from(J[X+1].slice(2),"hex"),len:se,opcodenum:se}),X=X+2;else throw new Error("Invalid script: "+JSON.stringify(U));else if(se===d.OP_PUSHDATA1||se===d.OP_PUSHDATA2||se===d.OP_PUSHDATA4){if(J[X+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");Z.chunks.push({buf:Buffer$N.from(J[X+2].slice(2),"hex"),len:parseInt(J[X+1]),opcodenum:se}),X=X+3}else Z.chunks.push({opcodenum:se}),X=X+1}return Z},F.prototype._chunkToString=function(U,Z){var J=U.opcodenum,X=Z==="asm",Q="";if(U.buf)(!X&&J===d.OP_PUSHDATA1||J===d.OP_PUSHDATA2||J===d.OP_PUSHDATA4)&&(Q=Q+" "+d(J).toString()),U.len>0&&(X?Q=Q+" "+U.buf.toString("hex"):Q=Q+" "+U.len+" 0x"+U.buf.toString("hex"));else if(typeof d.reverseMap[J]<"u")X?J===0?Q=Q+" 0":J===79?Q=Q+" -1":Q=Q+" "+d(J).toString():Q=Q+" "+d(J).toString();else{var te=J.toString(16);te.length%2!==0&&(te="0"+te),X?Q=Q+" "+te:Q=Q+" 0x"+te}return Q},F.prototype.toASM=function(){for(var U="",Z=0;Z<this.chunks.length;Z++){var J=this.chunks[Z];U+=this._chunkToString(J,"asm")}return U.substr(1)},F.prototype.toString=function(){for(var U="",Z=0;Z<this.chunks.length;Z++){var J=this.chunks[Z];U+=this._chunkToString(J)}return U.substr(1)},F.prototype.toHex=function(){return this.toBuffer().toString("hex")},F.prototype.inspect=function(){return"<Script: "+this.toString()+">"},F.prototype.isPublicKeyHashOut=function(){return!!(this.chunks.length===5&&this.chunks[0].opcodenum===d.OP_DUP&&this.chunks[1].opcodenum===d.OP_HASH160&&this.chunks[2].buf&&this.chunks[2].buf.length===20&&this.chunks[3].opcodenum===d.OP_EQUALVERIFY&&this.chunks[4].opcodenum===d.OP_CHECKSIG)},F.prototype.isPublicKeyHashIn=function(){if(this.chunks.length===2){var U=this.chunks[0].buf,Z=this.chunks[1].buf;if(U&&U.length&&U[0]===48&&Z&&Z.length){var J=Z[0];if((J===4||J===6||J===7)&&Z.length===65)return!0;if((J===3||J===2)&&Z.length===33)return!0}}return!1},F.prototype.getPublicKey=function(){return I.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf},F.prototype.getPublicKeyHash=function(){if(this.isPublicKeyHashOut())return this.chunks[2].buf;if(this.isWitnessPublicKeyHashOut())return this.chunks[1].buf;throw new Error("Can't retrieve PublicKeyHash from a non-PKH output")},F.prototype.isPublicKeyOut=function(){if(this.chunks.length===2&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===d.OP_CHECKSIG){var U=this.chunks[0].buf,Z=U[0],J=!1;if(((Z===4||Z===6||Z===7)&&U.length===65||(Z===3||Z===2)&&U.length===33)&&(J=!0),J)return c.isValid(U)}return!1},F.prototype.isPublicKeyIn=function(){if(this.chunks.length===1){var U=this.chunks[0].buf;if(U&&U.length&&U[0]===48)return!0}return!1},F.prototype.isScriptHashOut=function(){var U=this.toBuffer();return U.length===23&&U[0]===d.OP_HASH160&&U[1]===20&&U[U.length-1]===d.OP_EQUAL},F.prototype.isWitnessScriptHashOut=function(){var U=this.toBuffer();return U.length===34&&U[0]===d.OP_0&&U[1]===32},F.prototype.isWitnessPublicKeyHashOut=function(){var U=this.toBuffer();return U.length===22&&U[0]===d.OP_0&&U[1]===20},F.prototype.isTaproot=function(){var U=this.toBuffer();return U.length===34&&U[0]===d.OP_1&&U[1]===32},F.prototype.isWitnessProgram=function(U){U||(U={});var Z=this.toBuffer();return Z.length<4||Z.length>42||Z[0]!==d.OP_0&&!(Z[0]>=d.OP_1&&Z[0]<=d.OP_16)?!1:Z.length===Z[1]+2?(U.version=Z[0],U.program=Z.slice(2,Z.length),!0):!1},F.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var U=this.chunks[this.chunks.length-1],Z=U.buf;if(!Z)return!1;var J;try{J=F.fromBuffer(Z)}catch(Q){if(Q instanceof T.Script.InvalidBuffer)return!1;throw Q}var X=J.classify();return X!==F.types.UNKNOWN},F.prototype.isMultisigOut=function(){return this.chunks.length>3&&d.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(U){return U.buf&&C.isBuffer(U.buf)})&&d.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===d.OP_CHECKMULTISIG},F.prototype.isMultisigIn=function(){return this.chunks.length>=2&&this.chunks[0].opcodenum===0&&this.chunks.slice(1,this.chunks.length).every(function(U){return U.buf&&C.isBuffer(U.buf)&&l.isTxDER(U.buf)})},F.prototype.isDataOut=function(){return this.chunks.length>=1&&this.chunks[0].opcodenum===d.OP_RETURN&&(this.chunks.length===1||this.chunks.length===2&&this.chunks[1].buf&&this.chunks[1].buf.length<=F.OP_RETURN_STANDARD_SIZE&&this.chunks[1].length===this.chunks.len)},F.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut()||this.isWitnessScriptHashOut()||this.isWitnessPublicKeyHashOut()||this.isTaproot())return this.chunks[1]==null?Buffer$N.alloc(0):Buffer$N.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return Buffer$N.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},F.prototype.isPushOnly=function(){return this.chunks.every(function(U){return U.opcodenum<=d.OP_16})},F.types={},F.types.UNKNOWN="Unknown",F.types.PUBKEY_OUT="Pay to public key",F.types.PUBKEY_IN="Spend from public key",F.types.PUBKEYHASH_OUT="Pay to public key hash",F.types.PUBKEYHASH_IN="Spend from public key hash",F.types.SCRIPTHASH_OUT="Pay to script hash",F.types.SCRIPTHASH_IN="Spend from script hash",F.types.MULTISIG_OUT="Pay to multisig",F.types.MULTISIG_IN="Spend from multisig",F.types.DATA_OUT="Data push",F.OP_RETURN_STANDARD_SIZE=80,F.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var U=this.classifyOutput();return U!=F.types.UNKNOWN?U:this.classifyInput()},F.outputIdentifiers={},F.outputIdentifiers.PUBKEY_OUT=F.prototype.isPublicKeyOut,F.outputIdentifiers.PUBKEYHASH_OUT=F.prototype.isPublicKeyHashOut,F.outputIdentifiers.MULTISIG_OUT=F.prototype.isMultisigOut,F.outputIdentifiers.SCRIPTHASH_OUT=F.prototype.isScriptHashOut,F.outputIdentifiers.DATA_OUT=F.prototype.isDataOut,F.prototype.classifyOutput=function(){for(var U in F.outputIdentifiers)if(F.outputIdentifiers[U].bind(this)())return F.types[U];return F.types.UNKNOWN},F.inputIdentifiers={},F.inputIdentifiers.PUBKEY_IN=F.prototype.isPublicKeyIn,F.inputIdentifiers.PUBKEYHASH_IN=F.prototype.isPublicKeyHashIn,F.inputIdentifiers.MULTISIG_IN=F.prototype.isMultisigIn,F.inputIdentifiers.SCRIPTHASH_IN=F.prototype.isScriptHashIn,F.prototype.classifyInput=function(){for(var U in F.inputIdentifiers)if(F.inputIdentifiers[U].bind(this)())return F.types[U];return F.types.UNKNOWN},F.prototype.isStandard=function(){return this.classify()!==F.types.UNKNOWN},F.prototype.prepend=function(U){return this._addByType(U,!0),this},F.prototype.equals=function(U){if(I.checkState(U instanceof F,"Must provide another script"),this.chunks.length!==U.chunks.length)return!1;var Z;for(Z=0;Z<this.chunks.length;Z++){if(C.isBuffer(this.chunks[Z].buf)&&!C.isBuffer(U.chunks[Z].buf)||C.isBuffer(this.chunks[Z].buf)&&!C.equals(this.chunks[Z].buf,U.chunks[Z].buf))return!1;if(this.chunks[Z].opcodenum!==U.chunks[Z].opcodenum)return!1}return!0},F.prototype.add=function(U){return this._addByType(U,!1),this},F.prototype._addByType=function(U,Z){if(typeof U=="string")this._addOpcode(U,Z);else if(typeof U=="number")this._addOpcode(U,Z);else if(U instanceof d)this._addOpcode(U,Z);else if(C.isBuffer(U))this._addBuffer(U,Z);else if(U instanceof F)this.chunks=this.chunks.concat(U.chunks);else if(typeof U=="object")this._insertAtPosition(U,Z);else throw new Error("Invalid script chunk")},F.prototype._insertAtPosition=function(U,Z){Z?this.chunks.unshift(U):this.chunks.push(U)},F.prototype._addOpcode=function(U,Z){var J;return typeof U=="number"?J=U:U instanceof d?J=U.toNumber():J=d(U).toNumber(),this._insertAtPosition({opcodenum:J},Z),this},F.prototype._addBuffer=function(U,Z){var J,X=U.length;if(X>=0&&X<d.OP_PUSHDATA1)J=X;else if(X<Math.pow(2,8))J=d.OP_PUSHDATA1;else if(X<Math.pow(2,16))J=d.OP_PUSHDATA2;else if(X<Math.pow(2,32))J=d.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this._insertAtPosition({buf:U,len:X,opcodenum:J},Z),this},F.prototype.hasCodeseparators=function(){for(var U=0;U<this.chunks.length;U++)if(this.chunks[U].opcodenum===d.OP_CODESEPARATOR)return!0;return!1},F.prototype.removeCodeseparators=function(){for(var U=[],Z=0;Z<this.chunks.length;Z++)this.chunks[Z].opcodenum!==d.OP_CODESEPARATOR&&U.push(this.chunks[Z]);return this.chunks=U,this},F.buildMultisigOut=function(U,Z,J){I.checkArgument(Z<=U.length,"Number of required signatures must be less than or equal to the number of public keys"),J=J||{};var X=new F;X.add(d.smallInt(Z)),U=U.map(c);var Q=U;J.noSorting||(Q=O.sortBy(U,function(pe){return pe.toString("hex")}));for(var te=0;te<Q.length;te++){var se=Q[te];X.add(se.toBuffer())}return X.add(d.smallInt(U.length)),X.add(d.OP_CHECKMULTISIG),X},F.buildWitnessMultisigOutFromScript=function(U){if(U instanceof F){var Z=new F;return Z.add(d.OP_0),Z.add(u.sha256(U.toBuffer())),Z}else throw new TypeError("First argument is expected to be a p2sh script")},F.buildMultisigIn=function(U,Z,J,X){I.checkArgument(Array.isArray(U)),I.checkArgument(!isNaN(Z)),I.checkArgument(Array.isArray(J));var Q=new F;Q.add(d.OP_0);for(const te of J)I.checkArgument(C.isBuffer(te),"Signatures must be an array of Buffers"),Q.add(te);return Q},F.buildP2SHMultisigIn=function(U,Z,J,X){I.checkArgument(Array.isArray(U)),I.checkArgument(!isNaN(Z)),I.checkArgument(Array.isArray(J)),X=X||{};var Q=new F;Q.add(d.OP_0);for(const te of J)I.checkArgument(C.isBuffer(te),"Signatures must be an array of Buffers"),Q.add(te);return Q.add((X.cachedMultisig||F.buildMultisigOut(U,Z,X)).toBuffer()),Q},F.buildPublicKeyHashOut=function(U){I.checkArgument(U!=null),I.checkArgument(U instanceof c||U instanceof t||typeof U=="string"),U instanceof c?U=U.toAddress():typeof U=="string"&&(U=new t(U));var Z=new F;return Z.add(d.OP_DUP).add(d.OP_HASH160).add(U.hashBuffer).add(d.OP_EQUALVERIFY).add(d.OP_CHECKSIG),Z._network=U.network,Z},F.buildWitnessV0Out=function(U){I.checkArgument(U!=null),I.checkArgument(U instanceof c||U instanceof t||typeof U=="string"),U instanceof c?U=U.toAddress(null,t.PayToWitnessPublicKeyHash):typeof U=="string"&&(U=new t(U));var Z=new F;return Z.add(d.OP_0).add(U.hashBuffer),Z._network=U.network,Z},F.buildPublicKeyOut=function(U){I.checkArgument(U instanceof c);var Z=new F;return Z.add(U.toBuffer()).add(d.OP_CHECKSIG),Z},F.buildDataOut=function(U,Z){I.checkArgument(U==null||typeof U=="string"||C.isBuffer(U)),typeof U=="string"&&(U=Buffer$N.from(U,Z));var J=new F;return J.add(d.OP_RETURN),U!=null&&J.add(U),J},F.buildScriptHashOut=function(U){I.checkArgument(U instanceof F||U instanceof t&&U.isPayToScriptHash());var Z=new F;return Z.add(d.OP_HASH160).add(U instanceof t?U.hashBuffer:u.sha256ripemd160(U.toBuffer())).add(d.OP_EQUAL),Z._network=U._network||U.network,Z},F.buildPublicKeyIn=function(U,Z){I.checkArgument(U instanceof l||C.isBuffer(U)),I.checkArgument(Z==null||!isNaN(Z)),U instanceof l&&(U=U.toBuffer());var J=new F;return J.add(C.concat([U,C.integerAsSingleByteBuffer(Z||l.SIGHASH_ALL)])),J},F.buildPublicKeyHashIn=function(U,Z,J){I.checkArgument(Z instanceof l||C.isBuffer(Z)),I.checkArgument(J==null||!isNaN(J)),Z instanceof l&&(Z=Z.toBuffer());var X=new F().add(C.concat([Z,C.integerAsSingleByteBuffer(J||l.SIGHASH_ALL)])).add(new c(U).toBuffer());return X},F.empty=function(){return new F},F.prototype.toScriptHashOut=function(){return F.buildScriptHashOut(this)},F.fromAddress=function(U){if(U=t(U),U.isPayToScriptHash())return F.buildScriptHashOut(U);if(U.isPayToPublicKeyHash())return F.buildPublicKeyHashOut(U);if(U.isPayToWitnessPublicKeyHash())return F.buildWitnessV0Out(U);if(U.isPayToWitnessScriptHash())return F.buildWitnessV0Out(U);throw new T.Script.UnrecognizedAddress(U)},F.prototype.getAddressInfo=function(U){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var Z=this._getOutputAddressInfo();return Z||this._getInputAddressInfo()},F.prototype._getOutputAddressInfo=function(){var U={};if(this.isScriptHashOut())U.hashBuffer=this.getData(),U.type=t.PayToScriptHash;else if(this.isPublicKeyHashOut())U.hashBuffer=this.getData(),U.type=t.PayToPublicKeyHash;else if(this.isWitnessScriptHashOut())U.hashBuffer=this.getData(),U.type=t.PayToWitnessScriptHash;else if(this.isWitnessPublicKeyHashOut())U.hashBuffer=this.getData(),U.type=t.PayToWitnessPublicKeyHash;else if(this.isTaproot())U.hashBuffer=this.getData(),U.type=t.PayToTaproot;else return!1;return U},F.prototype._getInputAddressInfo=function(){var U={};if(this.isPublicKeyHashIn())U.hashBuffer=u.sha256ripemd160(this.chunks[1].buf),U.type=t.PayToPublicKeyHash;else if(this.isScriptHashIn())U.hashBuffer=u.sha256ripemd160(this.chunks[this.chunks.length-1].buf),U.type=t.PayToScriptHash;else return!1;return U},F.prototype.toAddress=function(U){var Z=this.getAddressInfo();return Z?(Z.network=m.get(U)||this._network||m.defaultNetwork,new t(Z)):!1},F.prototype.findAndDelete=function(U){for(var Z=U.toBuffer(),J=Z.toString("hex"),X=0;X<this.chunks.length;X++){var Q=F({chunks:[this.chunks[X]]}),te=Q.toBuffer(),se=te.toString("hex");J===se&&this.chunks.splice(X,1)}return this},F.prototype.checkMinimalPush=function(U){var Z=this.chunks[U],J=Z.buf,X=Z.opcodenum;return J?J.length===0?X===d.OP_0:J.length===1&&J[0]>=1&&J[0]<=16?X===d.OP_1+(J[0]-1):J.length===1&&J[0]===129?X===d.OP_1NEGATE:J.length<=75?X===J.length:J.length<=255?X===d.OP_PUSHDATA1:J.length<=65535?X===d.OP_PUSHDATA2:!0:!0},F.prototype._decodeOP_N=function(U){if(U===d.OP_0)return 0;if(U>=d.OP_1&&U<=d.OP_16)return U-(d.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(U))},F.prototype.getSignatureOperationsCount=function(U){U=U??!0;var Z=0,J=d.OP_INVALIDOPCODE;for(const Q of this.chunks){var X=Q.opcodenum;X==d.OP_CHECKSIG||X==d.OP_CHECKSIGVERIFY?Z++:(X==d.OP_CHECKMULTISIG||X==d.OP_CHECKMULTISIGVERIFY)&&(U&&J>=d.OP_1&&J<=d.OP_16?Z+=this._decodeOP_N(J):Z+=20),J=X}return Z},script=F,script}var transaction$1={exports:{}},bufferCompare,hasRequiredBufferCompare;function requireBufferCompare(){return hasRequiredBufferCompare||(hasRequiredBufferCompare=1,bufferCompare=function(t,e){if(typeof t.compare=="function")return t.compare(e);if(t===e)return 0;for(var a=t.length,u=e.length,d=0,c=Math.min(a,u);d<c&&t[d]===e[d];)++d;return d!==c&&(a=t[d],u=e[d]),a<u?-1:u<a?1:0}),bufferCompare}var output,hasRequiredOutput;function requireOutput(){if(hasRequiredOutput)return output;hasRequiredOutput=1;var t=lodashExports,e=bn$1,a=bufferExports,u=js,d=bufferwriter,c=requireScript(),l=preconditions,m=errorsExports,I=9007199254740991;function O(T){if(!(this instanceof O))return new O(T);if(t.isObject(T))if(this.satoshis=T.satoshis,a.isBuffer(T.script))this._scriptBuffer=T.script;else{var C;t.isString(T.script)&&u.isHexa(T.script)?C=Buffer$N.from(T.script,"hex"):C=T.script,this.setScript(C)}else throw new TypeError("Unrecognized argument for Output")}return Object.defineProperty(O.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script?this._script:(this.setScriptFromBuffer(this._scriptBuffer),this._script)}}),Object.defineProperty(O.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(T){T instanceof e?(this._satoshisBN=T,this._satoshis=T.toNumber()):t.isString(T)?(this._satoshis=parseInt(T),this._satoshisBN=e.fromNumber(this._satoshis)):(l.checkArgument(u.isNaturalNumber(T),"Output satoshis is not a natural number"),this._satoshisBN=e.fromNumber(T),this._satoshis=T),l.checkState(u.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),O.prototype.invalidSatoshis=function(){return this._satoshis>I?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0?"transaction txout negative":!1},O.prototype.toObject=O.prototype.toJSON=function(){var C={satoshis:this.satoshis};return C.script=this._scriptBuffer.toString("hex"),C},O.fromObject=function(T){return new O(T)},O.prototype.setScriptFromBuffer=function(T){this._scriptBuffer=T;try{this._script=c.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(C){if(C instanceof m.Script.InvalidBuffer)this._script=null;else throw C}},O.prototype.setScript=function(T){if(T instanceof c)this._scriptBuffer=T.toBuffer(),this._script=T,this._script._isOutput=!0;else if(t.isString(T))this._script=c.fromString(T),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else if(a.isBuffer(T))this.setScriptFromBuffer(T);else throw new TypeError("Invalid argument type: script");return this},O.prototype.inspect=function(){var T;return this.script?T=this.script.inspect():T=this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+T+">"},O.fromBufferReader=function(T){var C={};C.satoshis=T.readUInt64LEBN();var j=T.readVarintNum();return j!==0?C.script=T.read(j):C.script=Buffer$N.from([]),new O(C)},O.prototype.toBufferWriter=function(T){T||(T=new d),T.writeUInt64LEBN(this._satoshisBN);var C=this._scriptBuffer;return T.writeVarintNum(C.length),T.write(C),T},O.prototype.calculateSize=function(){let T=8;return T+=d.varintBufNum(this._scriptBuffer.length).length,T+=this._scriptBuffer.length,T},output=O,output}const name="bigi",version="1.4.2",description="Big integers.",keywords=["cryptography","math","bitcoin","arbitrary","precision","arithmetic","big","integer","int","number","biginteger","bigint","bignumber","decimal","float"],devDependencies={coveralls:"^2.11.2",istanbul:"^0.3.5",jshint:"^2.5.1",mocha:"^2.1.0",mochify:"^2.1.0"},repository={url:"https://github.com/cryptocoinjs/bigi",type:"git"},main="./lib/index.js",scripts={"browser-test":"./node_modules/.bin/mochify --wd -R spec",test:"./node_modules/.bin/_mocha -- test/*.js",jshint:"./node_modules/.bin/jshint --config jshint.json lib/*.js ; true",unit:"./node_modules/.bin/mocha",coverage:"./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",coveralls:"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info"},dependencies={},testling={files:"test/*.js",harness:"mocha",browsers:["ie/9..latest","firefox/latest","chrome/latest","safari/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},require$$0$1={name,version,description,keywords,devDependencies,repository,main,scripts,dependencies,testling};function BigInteger$9(t,e,a){if(!(this instanceof BigInteger$9))return new BigInteger$9(t,e,a);t!=null&&(typeof t=="number"?this.fromNumber(t,e,a):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}var proto=BigInteger$9.prototype;proto.__bigi=require$$0$1.version,BigInteger$9.isBigInteger=function(t,e){return t&&t.__bigi&&(!e||t.__bigi===proto.__bigi)};var dbits;function am1(t,e,a,u,d,c){for(;--c>=0;){var l=e*this[t++]+a[u]+d;d=Math.floor(l/67108864),a[u++]=l&67108863}return d}BigInteger$9.prototype.am=am1,dbits=26,BigInteger$9.prototype.DB=dbits,BigInteger$9.prototype.DM=(1<<dbits)-1;var DV=BigInteger$9.prototype.DV=1<<dbits,BI_FP=52;BigInteger$9.prototype.FV=Math.pow(2,BI_FP),BigInteger$9.prototype.F1=BI_FP-dbits,BigInteger$9.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr=48,vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr=97,vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr=65,vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){var a=BI_RC[t.charCodeAt(e)];return a??-1}function bnpCopyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+DV:this.t=0}function nbv(t){var e=new BigInteger$9;return e.fromInt(t),e}function bnpFromString(t,e){var a=this,u;if(e==16)u=4;else if(e==8)u=3;else if(e==256)u=8;else if(e==2)u=1;else if(e==32)u=5;else if(e==4)u=2;else{a.fromRadix(t,e);return}a.t=0,a.s=0;for(var d=t.length,c=!1,l=0;--d>=0;){var m=u==8?t[d]&255:intAt(t,d);if(m<0){t.charAt(d)=="-"&&(c=!0);continue}c=!1,l==0?a[a.t++]=m:l+u>a.DB?(a[a.t-1]|=(m&(1<<a.DB-l)-1)<<l,a[a.t++]=m>>a.DB-l):a[a.t-1]|=m<<l,l+=u,l>=a.DB&&(l-=a.DB)}u==8&&t[0]&128&&(a.s=-1,l>0&&(a[a.t-1]|=(1<<a.DB-l)-1<<l)),a.clamp(),c&&BigInteger$9.ZERO.subTo(a,a)}function bnpClamp(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function bnToString(t){var e=this;if(e.s<0)return"-"+e.negate().toString(t);var a;if(t==16)a=4;else if(t==8)a=3;else if(t==2)a=1;else if(t==32)a=5;else if(t==4)a=2;else return e.toRadix(t);var u=(1<<a)-1,d,c=!1,l="",m=e.t,I=e.DB-m*e.DB%a;if(m-- >0)for(I<e.DB&&(d=e[m]>>I)>0&&(c=!0,l=int2char(d));m>=0;)I<a?(d=(e[m]&(1<<I)-1)<<a-I,d|=e[--m]>>(I+=e.DB-a)):(d=e[m]>>(I-=a)&u,I<=0&&(I+=e.DB,--m)),d>0&&(c=!0),c&&(l+=int2char(d));return c?l:"0"}function bnNegate(){var t=new BigInteger$9;return BigInteger$9.ZERO.subTo(this,t),t}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(t){var e=this.s-t.s;if(e!=0)return e;var a=this.t;if(e=a-t.t,e!=0)return this.s<0?-e:e;for(;--a>=0;)if((e=this[a]-t[a])!=0)return e;return 0}function nbits(t){var e=1,a;return(a=t>>>16)!=0&&(t=a,e+=16),(a=t>>8)!=0&&(t=a,e+=8),(a=t>>4)!=0&&(t=a,e+=4),(a=t>>2)!=0&&(t=a,e+=2),(a=t>>1)!=0&&(t=a,e+=1),e}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnByteLength(){return this.bitLength()>>3}function bnpDLShiftTo(t,e){var a;for(a=this.t-1;a>=0;--a)e[a+t]=this[a];for(a=t-1;a>=0;--a)e[a]=0;e.t=this.t+t,e.s=this.s}function bnpDRShiftTo(t,e){for(var a=t;a<this.t;++a)e[a-t]=this[a];e.t=Math.max(this.t-t,0),e.s=this.s}function bnpLShiftTo(t,e){var a=this,u=t%a.DB,d=a.DB-u,c=(1<<d)-1,l=Math.floor(t/a.DB),m=a.s<<u&a.DM,I;for(I=a.t-1;I>=0;--I)e[I+l+1]=a[I]>>d|m,m=(a[I]&c)<<u;for(I=l-1;I>=0;--I)e[I]=0;e[l]=m,e.t=a.t+l+1,e.s=a.s,e.clamp()}function bnpRShiftTo(t,e){var a=this;e.s=a.s;var u=Math.floor(t/a.DB);if(u>=a.t){e.t=0;return}var d=t%a.DB,c=a.DB-d,l=(1<<d)-1;e[0]=a[u]>>d;for(var m=u+1;m<a.t;++m)e[m-u-1]|=(a[m]&l)<<c,e[m-u]=a[m]>>d;d>0&&(e[a.t-u-1]|=(a.s&l)<<c),e.t=a.t-u,e.clamp()}function bnpSubTo(t,e){for(var a=this,u=0,d=0,c=Math.min(t.t,a.t);u<c;)d+=a[u]-t[u],e[u++]=d&a.DM,d>>=a.DB;if(t.t<a.t){for(d-=t.s;u<a.t;)d+=a[u],e[u++]=d&a.DM,d>>=a.DB;d+=a.s}else{for(d+=a.s;u<t.t;)d-=t[u],e[u++]=d&a.DM,d>>=a.DB;d-=t.s}e.s=d<0?-1:0,d<-1?e[u++]=a.DV+d:d>0&&(e[u++]=d),e.t=u,e.clamp()}function bnpMultiplyTo(t,e){var a=this.abs(),u=t.abs(),d=a.t;for(e.t=d+u.t;--d>=0;)e[d]=0;for(d=0;d<u.t;++d)e[d+a.t]=a.am(0,u[d],e,d,0,a.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger$9.ZERO.subTo(e,e)}function bnpSquareTo(t){for(var e=this.abs(),a=t.t=2*e.t;--a>=0;)t[a]=0;for(a=0;a<e.t-1;++a){var u=e.am(a,e[a],t,2*a,0,1);(t[a+e.t]+=e.am(a+1,2*e[a],t,2*a+1,u,e.t-a-1))>=e.DV&&(t[a+e.t]-=e.DV,t[a+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(a,e[a],t,2*a,0,1)),t.s=0,t.clamp()}function bnpDivRemTo(t,e,a){var u=this,d=t.abs();if(!(d.t<=0)){var c=u.abs();if(c.t<d.t){e!=null&&e.fromInt(0),a!=null&&u.copyTo(a);return}a==null&&(a=new BigInteger$9);var l=new BigInteger$9,m=u.s,I=t.s,O=u.DB-nbits(d[d.t-1]);O>0?(d.lShiftTo(O,l),c.lShiftTo(O,a)):(d.copyTo(l),c.copyTo(a));var T=l.t,C=l[T-1];if(C!=0){var j=C*(1<<u.F1)+(T>1?l[T-2]>>u.F2:0),F=u.FV/j,U=(1<<u.F1)/j,Z=1<<u.F2,J=a.t,X=J-T,Q=e??new BigInteger$9;for(l.dlShiftTo(X,Q),a.compareTo(Q)>=0&&(a[a.t++]=1,a.subTo(Q,a)),BigInteger$9.ONE.dlShiftTo(T,Q),Q.subTo(l,l);l.t<T;)l[l.t++]=0;for(;--X>=0;){var te=a[--J]==C?u.DM:Math.floor(a[J]*F+(a[J-1]+Z)*U);if((a[J]+=l.am(0,te,a,X,0,T))<te)for(l.dlShiftTo(X,Q),a.subTo(Q,a);a[J]<--te;)a.subTo(Q,a)}e!=null&&(a.drShiftTo(T,e),m!=I&&BigInteger$9.ZERO.subTo(e,e)),a.t=T,a.clamp(),O>0&&a.rShiftTo(O,a),m<0&&BigInteger$9.ZERO.subTo(a,a)}}}function bnMod(t){var e=new BigInteger$9;return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(BigInteger$9.ZERO)>0&&t.subTo(e,e),e}function Classic(t){this.m=t}function cConvert(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function cRevert(t){return t}function cReduce(t){t.divRemTo(this.m,null,t)}function cMulTo(t,e,a){t.multiplyTo(e,a),this.reduce(a)}function cSqrTo(t,e){t.squareTo(e),this.reduce(e)}Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo;function bnpInvDigit(){if(this.t<1)return 0;var t=this[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function Montgomery(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function montConvert(t){var e=new BigInteger$9;return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(BigInteger$9.ZERO)>0&&this.m.subTo(e,e),e}function montRevert(t){var e=new BigInteger$9;return t.copyTo(e),this.reduce(e),e}function montReduce(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var a=t[e]&32767,u=a*this.mpl+((a*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(a=e+this.m.t,t[a]+=this.m.am(0,u,t,e,0,this.m.t);t[a]>=t.DV;)t[a]-=t.DV,t[++a]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function montSqrTo(t,e){t.squareTo(e),this.reduce(e)}function montMulTo(t,e,a){t.multiplyTo(e,a),this.reduce(a)}Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return(this.t>0?this[0]&1:this.s)==0}function bnpExp(t,e){if(t>4294967295||t<1)return BigInteger$9.ONE;var a=new BigInteger$9,u=new BigInteger$9,d=e.convert(this),c=nbits(t)-1;for(d.copyTo(a);--c>=0;)if(e.sqrTo(a,u),(t&1<<c)>0)e.mulTo(u,d,a);else{var l=a;a=u,u=l}return e.revert(a)}function bnModPowInt(t,e){var a;return t<256||e.isEven()?a=new Classic(e):a=new Montgomery(e),this.exp(t,a)}proto.copyTo=bnpCopyTo,proto.fromInt=bnpFromInt,proto.fromString=bnpFromString,proto.clamp=bnpClamp,proto.dlShiftTo=bnpDLShiftTo,proto.drShiftTo=bnpDRShiftTo,proto.lShiftTo=bnpLShiftTo,proto.rShiftTo=bnpRShiftTo,proto.subTo=bnpSubTo,proto.multiplyTo=bnpMultiplyTo,proto.squareTo=bnpSquareTo,proto.divRemTo=bnpDivRemTo,proto.invDigit=bnpInvDigit,proto.isEven=bnpIsEven,proto.exp=bnpExp,proto.toString=bnToString,proto.negate=bnNegate,proto.abs=bnAbs,proto.compareTo=bnCompareTo,proto.bitLength=bnBitLength,proto.byteLength=bnByteLength,proto.mod=bnMod,proto.modPowInt=bnModPowInt;function bnClone(){var t=new BigInteger$9;return this.copyTo(t),t}function bnIntValue(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return this.t==0?this.s:this[0]<<24>>24}function bnShortValue(){return this.t==0?this.s:this[0]<<16>>16}function bnpChunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function bnSigNum(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function bnpToRadix(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),a=Math.pow(t,e),u=nbv(a),d=new BigInteger$9,c=new BigInteger$9,l="";for(this.divRemTo(u,d,c);d.signum()>0;)l=(a+c.intValue()).toString(t).substr(1)+l,d.divRemTo(u,d,c);return c.intValue().toString(t)+l}function bnpFromRadix(t,e){var a=this;a.fromInt(0),e==null&&(e=10);for(var u=a.chunkSize(e),d=Math.pow(e,u),c=!1,l=0,m=0,I=0;I<t.length;++I){var O=intAt(t,I);if(O<0){t.charAt(I)=="-"&&a.signum()==0&&(c=!0);continue}m=e*m+O,++l>=u&&(a.dMultiply(d),a.dAddOffset(m,0),l=0,m=0)}l>0&&(a.dMultiply(Math.pow(e,l)),a.dAddOffset(m,0)),c&&BigInteger$9.ZERO.subTo(a,a)}function bnpFromNumber(t,e,a){var u=this;if(typeof e=="number")if(t<2)u.fromInt(1);else for(u.fromNumber(t,a),u.testBit(t-1)||u.bitwiseTo(BigInteger$9.ONE.shiftLeft(t-1),op_or,u),u.isEven()&&u.dAddOffset(1,0);!u.isProbablePrime(e);)u.dAddOffset(2,0),u.bitLength()>t&&u.subTo(BigInteger$9.ONE.shiftLeft(t-1),u);else{var d=new Array,c=t&7;d.length=(t>>3)+1,e.nextBytes(d),c>0?d[0]&=(1<<c)-1:d[0]=0,u.fromString(d,256)}}function bnToByteArray(){var t=this,e=t.t,a=new Array;a[0]=t.s;var u=t.DB-e*t.DB%8,d,c=0;if(e-- >0)for(u<t.DB&&(d=t[e]>>u)!=(t.s&t.DM)>>u&&(a[c++]=d|t.s<<t.DB-u);e>=0;)u<8?(d=(t[e]&(1<<u)-1)<<8-u,d|=t[--e]>>(u+=t.DB-8)):(d=t[e]>>(u-=8)&255,u<=0&&(u+=t.DB,--e)),d&128&&(d|=-256),c===0&&(t.s&128)!=(d&128)&&++c,(c>0||d!=t.s)&&(a[c++]=d);return a}function bnEquals(t){return this.compareTo(t)==0}function bnMin(t){return this.compareTo(t)<0?this:t}function bnMax(t){return this.compareTo(t)>0?this:t}function bnpBitwiseTo(t,e,a){var u=this,d,c,l=Math.min(t.t,u.t);for(d=0;d<l;++d)a[d]=e(u[d],t[d]);if(t.t<u.t){for(c=t.s&u.DM,d=l;d<u.t;++d)a[d]=e(u[d],c);a.t=u.t}else{for(c=u.s&u.DM,d=l;d<t.t;++d)a[d]=e(c,t[d]);a.t=t.t}a.s=e(u.s,t.s),a.clamp()}function op_and(t,e){return t&e}function bnAnd(t){var e=new BigInteger$9;return this.bitwiseTo(t,op_and,e),e}function op_or(t,e){return t|e}function bnOr(t){var e=new BigInteger$9;return this.bitwiseTo(t,op_or,e),e}function op_xor(t,e){return t^e}function bnXor(t){var e=new BigInteger$9;return this.bitwiseTo(t,op_xor,e),e}function op_andnot(t,e){return t&~e}function bnAndNot(t){var e=new BigInteger$9;return this.bitwiseTo(t,op_andnot,e),e}function bnNot(){for(var t=new BigInteger$9,e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function bnShiftLeft(t){var e=new BigInteger$9;return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function bnShiftRight(t){var e=new BigInteger$9;return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function lbit(t){if(t==0)return-1;var e=0;return t&65535||(t>>=16,e+=16),t&255||(t>>=8,e+=8),t&15||(t>>=4,e+=4),t&3||(t>>=2,e+=2),t&1||++e,e}function bnGetLowestSetBit(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+lbit(this[t]);return this.s<0?this.t*this.DB:-1}function cbit(t){for(var e=0;t!=0;)t&=t-1,++e;return e}function bnBitCount(){for(var t=0,e=this.s&this.DM,a=0;a<this.t;++a)t+=cbit(this[a]^e);return t}function bnTestBit(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0}function bnpChangeBit(t,e){var a=BigInteger$9.ONE.shiftLeft(t);return this.bitwiseTo(a,e,a),a}function bnSetBit(t){return this.changeBit(t,op_or)}function bnClearBit(t){return this.changeBit(t,op_andnot)}function bnFlipBit(t){return this.changeBit(t,op_xor)}function bnpAddTo(t,e){for(var a=this,u=0,d=0,c=Math.min(t.t,a.t);u<c;)d+=a[u]+t[u],e[u++]=d&a.DM,d>>=a.DB;if(t.t<a.t){for(d+=t.s;u<a.t;)d+=a[u],e[u++]=d&a.DM,d>>=a.DB;d+=a.s}else{for(d+=a.s;u<t.t;)d+=t[u],e[u++]=d&a.DM,d>>=a.DB;d+=t.s}e.s=d<0?-1:0,d>0?e[u++]=d:d<-1&&(e[u++]=a.DV+d),e.t=u,e.clamp()}function bnAdd(t){var e=new BigInteger$9;return this.addTo(t,e),e}function bnSubtract(t){var e=new BigInteger$9;return this.subTo(t,e),e}function bnMultiply(t){var e=new BigInteger$9;return this.multiplyTo(t,e),e}function bnSquare(){var t=new BigInteger$9;return this.squareTo(t),t}function bnDivide(t){var e=new BigInteger$9;return this.divRemTo(t,e,null),e}function bnRemainder(t){var e=new BigInteger$9;return this.divRemTo(t,null,e),e}function bnDivideAndRemainder(t){var e=new BigInteger$9,a=new BigInteger$9;return this.divRemTo(t,e,a),new Array(e,a)}function bnpDMultiply(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function NullExp(){}function nNop(t){return t}function nMulTo(t,e,a){t.multiplyTo(e,a)}function nSqrTo(t,e){t.squareTo(e)}NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo;function bnPow(t){return this.exp(t,new NullExp)}function bnpMultiplyLowerTo(t,e,a){var u=Math.min(this.t+t.t,e);for(a.s=0,a.t=u;u>0;)a[--u]=0;var d;for(d=a.t-this.t;u<d;++u)a[u+this.t]=this.am(0,t[u],a,u,0,this.t);for(d=Math.min(t.t,e);u<d;++u)this.am(0,t[u],a,u,0,e-u);a.clamp()}function bnpMultiplyUpperTo(t,e,a){--e;var u=a.t=this.t+t.t-e;for(a.s=0;--u>=0;)a[u]=0;for(u=Math.max(e-this.t,0);u<t.t;++u)a[this.t+u-e]=this.am(e-u,t[u],a,0,0,this.t+u-e);a.clamp(),a.drShiftTo(1,a)}function Barrett(t){this.r2=new BigInteger$9,this.q3=new BigInteger$9,BigInteger$9.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function barrettConvert(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=new BigInteger$9;return t.copyTo(e),this.reduce(e),e}function barrettRevert(t){return t}function barrettReduce(t){var e=this;for(t.drShiftTo(e.m.t-1,e.r2),t.t>e.m.t+1&&(t.t=e.m.t+1,t.clamp()),e.mu.multiplyUpperTo(e.r2,e.m.t+1,e.q3),e.m.multiplyLowerTo(e.q3,e.m.t+1,e.r2);t.compareTo(e.r2)<0;)t.dAddOffset(1,e.m.t+1);for(t.subTo(e.r2,t);t.compareTo(e.m)>=0;)t.subTo(e.m,t)}function barrettSqrTo(t,e){t.squareTo(e),this.reduce(e)}function barrettMulTo(t,e,a){t.multiplyTo(e,a),this.reduce(a)}Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;function bnModPow(t,e){var a=t.bitLength(),u,d=nbv(1),c;if(a<=0)return d;a<18?u=1:a<48?u=3:a<144?u=4:a<768?u=5:u=6,a<8?c=new Classic(e):e.isEven()?c=new Barrett(e):c=new Montgomery(e);var l=new Array,m=3,I=u-1,O=(1<<u)-1;if(l[1]=c.convert(this),u>1){var T=new BigInteger$9;for(c.sqrTo(l[1],T);m<=O;)l[m]=new BigInteger$9,c.mulTo(T,l[m-2],l[m]),m+=2}var C=t.t-1,j,F=!0,U=new BigInteger$9,Z;for(a=nbits(t[C])-1;C>=0;){for(a>=I?j=t[C]>>a-I&O:(j=(t[C]&(1<<a+1)-1)<<I-a,C>0&&(j|=t[C-1]>>this.DB+a-I)),m=u;!(j&1);)j>>=1,--m;if((a-=m)<0&&(a+=this.DB,--C),F)l[j].copyTo(d),F=!1;else{for(;m>1;)c.sqrTo(d,U),c.sqrTo(U,d),m-=2;m>0?c.sqrTo(d,U):(Z=d,d=U,U=Z),c.mulTo(U,l[j],d)}for(;C>=0&&!(t[C]&1<<a);)c.sqrTo(d,U),Z=d,d=U,U=Z,--a<0&&(a=this.DB-1,--C)}return c.revert(d)}function bnGCD(t){var e=this.s<0?this.negate():this.clone(),a=t.s<0?t.negate():t.clone();if(e.compareTo(a)<0){var u=e;e=a,a=u}var d=e.getLowestSetBit(),c=a.getLowestSetBit();if(c<0)return e;for(d<c&&(c=d),c>0&&(e.rShiftTo(c,e),a.rShiftTo(c,a));e.signum()>0;)(d=e.getLowestSetBit())>0&&e.rShiftTo(d,e),(d=a.getLowestSetBit())>0&&a.rShiftTo(d,a),e.compareTo(a)>=0?(e.subTo(a,e),e.rShiftTo(1,e)):(a.subTo(e,a),a.rShiftTo(1,a));return c>0&&a.lShiftTo(c,a),a}function bnpModInt(t){if(t<=0)return 0;var e=this.DV%t,a=this.s<0?t-1:0;if(this.t>0)if(e==0)a=this[0]%t;else for(var u=this.t-1;u>=0;--u)a=(e*a+this[u])%t;return a}function bnModInverse(t){var e=t.isEven();if(this.signum()===0)throw new Error("division by zero");if(this.isEven()&&e||t.signum()==0)return BigInteger$9.ZERO;for(var a=t.clone(),u=this.clone(),d=nbv(1),c=nbv(0),l=nbv(0),m=nbv(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),e?((!d.isEven()||!c.isEven())&&(d.addTo(this,d),c.subTo(t,c)),d.rShiftTo(1,d)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);for(;u.isEven();)u.rShiftTo(1,u),e?((!l.isEven()||!m.isEven())&&(l.addTo(this,l),m.subTo(t,m)),l.rShiftTo(1,l)):m.isEven()||m.subTo(t,m),m.rShiftTo(1,m);a.compareTo(u)>=0?(a.subTo(u,a),e&&d.subTo(l,d),c.subTo(m,c)):(u.subTo(a,u),e&&l.subTo(d,l),m.subTo(c,m))}if(u.compareTo(BigInteger$9.ONE)!=0)return BigInteger$9.ZERO;for(;m.compareTo(t)>=0;)m.subTo(t,m);for(;m.signum()<0;)m.addTo(t,m);return m}var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];function bnIsProbablePrime(t){var e,a=this.abs();if(a.t==1&&a[0]<=lowprimes[lowprimes.length-1]){for(e=0;e<lowprimes.length;++e)if(a[0]==lowprimes[e])return!0;return!1}if(a.isEven())return!1;for(e=1;e<lowprimes.length;){for(var u=lowprimes[e],d=e+1;d<lowprimes.length&&u<lplim;)u*=lowprimes[d++];for(u=a.modInt(u);e<d;)if(u%lowprimes[e++]==0)return!1}return a.millerRabin(t)}function bnpMillerRabin(t){var e=this.subtract(BigInteger$9.ONE),a=e.getLowestSetBit();if(a<=0)return!1;var u=e.shiftRight(a);t=t+1>>1,t>lowprimes.length&&(t=lowprimes.length);for(var d=new BigInteger$9(null),c,l=[],m=0;m<t;++m){for(;c=lowprimes[Math.floor(Math.random()*lowprimes.length)],l.indexOf(c)!=-1;);l.push(c),d.fromInt(c);var I=d.modPow(u,this);if(I.compareTo(BigInteger$9.ONE)!=0&&I.compareTo(e)!=0){for(var c=1;c++<a&&I.compareTo(e)!=0;)if(I=I.modPowInt(2,this),I.compareTo(BigInteger$9.ONE)==0)return!1;if(I.compareTo(e)!=0)return!1}}return!0}proto.chunkSize=bnpChunkSize,proto.toRadix=bnpToRadix,proto.fromRadix=bnpFromRadix,proto.fromNumber=bnpFromNumber,proto.bitwiseTo=bnpBitwiseTo,proto.changeBit=bnpChangeBit,proto.addTo=bnpAddTo,proto.dMultiply=bnpDMultiply,proto.dAddOffset=bnpDAddOffset,proto.multiplyLowerTo=bnpMultiplyLowerTo,proto.multiplyUpperTo=bnpMultiplyUpperTo,proto.modInt=bnpModInt,proto.millerRabin=bnpMillerRabin,proto.clone=bnClone,proto.intValue=bnIntValue,proto.byteValue=bnByteValue,proto.shortValue=bnShortValue,proto.signum=bnSigNum,proto.toByteArray=bnToByteArray,proto.equals=bnEquals,proto.min=bnMin,proto.max=bnMax,proto.and=bnAnd,proto.or=bnOr,proto.xor=bnXor,proto.andNot=bnAndNot,proto.not=bnNot,proto.shiftLeft=bnShiftLeft,proto.shiftRight=bnShiftRight,proto.getLowestSetBit=bnGetLowestSetBit,proto.bitCount=bnBitCount,proto.testBit=bnTestBit,proto.setBit=bnSetBit,proto.clearBit=bnClearBit,proto.flipBit=bnFlipBit,proto.add=bnAdd,proto.subtract=bnSubtract,proto.multiply=bnMultiply,proto.divide=bnDivide,proto.remainder=bnRemainder,proto.divideAndRemainder=bnDivideAndRemainder,proto.modPow=bnModPow,proto.modInverse=bnModInverse,proto.pow=bnPow,proto.gcd=bnGCD,proto.isProbablePrime=bnIsProbablePrime,proto.square=bnSquare,BigInteger$9.ZERO=nbv(0),BigInteger$9.ONE=nbv(1),BigInteger$9.valueOf=nbv;var bigi=BigInteger$9,assert$2=requireAssert(),BigInteger$8=bigi;BigInteger$8.fromByteArrayUnsigned=function(t){return t[0]&128?new BigInteger$8([0].concat(t)):new BigInteger$8(t)},BigInteger$8.prototype.toByteArrayUnsigned=function(){var t=this.toByteArray();return t[0]===0?t.slice(1):t},BigInteger$8.fromDERInteger=function(t){return new BigInteger$8(t)},BigInteger$8.prototype.toDERInteger=BigInteger$8.prototype.toByteArray,BigInteger$8.fromBuffer=function(t){if(t[0]&128){var e=Array.prototype.slice.call(t);return new BigInteger$8([0].concat(e))}return new BigInteger$8(t)},BigInteger$8.fromHex=function(t){return t===""?BigInteger$8.ZERO:(assert$2.equal(t,t.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),assert$2.equal(t.length%2,0,"Incomplete hex"),new BigInteger$8(t,16))},BigInteger$8.prototype.toBuffer=function(t){for(var e=this.toByteArrayUnsigned(),a=[],u=t-e.length;a.length<u;)a.push(0);return new Buffer$N(a.concat(e))},BigInteger$8.prototype.toHex=function(t){return this.toBuffer(t).toString("hex")};var BigInteger$7=bigi,lib$1=BigInteger$7,assert$1=requireAssert(),Buffer$7=safeBufferExports.Buffer,BigInteger$6=lib$1,THREE=BigInteger$6.valueOf(3);function Point$2(t,e,a,u){assert$1.notStrictEqual(u,void 0,"Missing Z coordinate"),this.curve=t,this.x=e,this.y=a,this.z=u,this._zInv=null,this.compressed=!0}Object.defineProperty(Point$2.prototype,"zInv",{get:function(){return this._zInv===null&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(Point$2.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(Point$2.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),Point$2.fromAffine=function(t,e,a){return new Point$2(t,e,a,BigInteger$6.ONE)},Point$2.prototype.equals=function(t){if(t===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(t);if(this.curve.isInfinity(t))return this.curve.isInfinity(this);var e=t.y.multiply(this.z).subtract(this.y.multiply(t.z)).mod(this.curve.p);if(e.signum()!==0)return!1;var a=t.x.multiply(this.z).subtract(this.x.multiply(t.z)).mod(this.curve.p);return a.signum()===0},Point$2.prototype.negate=function(){var t=this.curve.p.subtract(this.y);return new Point$2(this.curve,this.x,t,this.z)},Point$2.prototype.add=function(t){if(this.curve.isInfinity(this))return t;if(this.curve.isInfinity(t))return this;var e=this.x,a=this.y,u=t.x,d=t.y,c=d.multiply(this.z).subtract(a.multiply(t.z)).mod(this.curve.p),l=u.multiply(this.z).subtract(e.multiply(t.z)).mod(this.curve.p);if(l.signum()===0)return c.signum()===0?this.twice():this.curve.infinity;var m=l.square(),I=m.multiply(l),O=e.multiply(m),T=c.square().multiply(this.z),C=T.subtract(O.shiftLeft(1)).multiply(t.z).subtract(I).multiply(l).mod(this.curve.p),j=O.multiply(THREE).multiply(c).subtract(a.multiply(I)).subtract(T.multiply(c)).multiply(t.z).add(c.multiply(I)).mod(this.curve.p),F=I.multiply(this.z).multiply(t.z).mod(this.curve.p);return new Point$2(this.curve,C,j,F)},Point$2.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(this.y.signum()===0)return this.curve.infinity;var t=this.x,e=this.y,a=e.multiply(this.z).mod(this.curve.p),u=a.multiply(e).mod(this.curve.p),d=this.curve.a,c=t.square().multiply(THREE);d.signum()!==0&&(c=c.add(this.z.square().multiply(d))),c=c.mod(this.curve.p);var l=c.square().subtract(t.shiftLeft(3).multiply(u)).shiftLeft(1).multiply(a).mod(this.curve.p),m=c.multiply(THREE).multiply(t).subtract(u.shiftLeft(1)).shiftLeft(2).multiply(u).subtract(c.pow(3)).mod(this.curve.p),I=a.pow(3).shiftLeft(3).mod(this.curve.p);return new Point$2(this.curve,l,m,I)},Point$2.prototype.multiply=function(t){if(this.curve.isInfinity(this))return this;if(t.signum()===0)return this.curve.infinity;for(var e=t,a=e.multiply(THREE),u=this.negate(),d=this,c=a.bitLength()-2;c>0;--c){var l=a.testBit(c),m=e.testBit(c);d=d.twice(),l!==m&&(d=d.add(l?this:u))}return d},Point$2.prototype.multiplyTwo=function(t,e,a){for(var u=Math.max(t.bitLength(),a.bitLength())-1,d=this.curve.infinity,c=this.add(e);u>=0;){var l=t.testBit(u),m=a.testBit(u);d=d.twice(),l?m?d=d.add(c):d=d.add(this):m&&(d=d.add(e)),--u}return d},Point$2.prototype.getEncoded=function(t){if(t==null&&(t=this.compressed),this.curve.isInfinity(this))return Buffer$7.alloc(1,0);var e=this.affineX,a=this.affineY,u=this.curve.pLength,d;return t?(d=Buffer$7.allocUnsafe(1+u),d.writeUInt8(a.isEven()?2:3,0)):(d=Buffer$7.allocUnsafe(1+u+u),d.writeUInt8(4,0),a.toBuffer(u).copy(d,1+u)),e.toBuffer(u).copy(d,1),d},Point$2.decodeFrom=function(t,e){var a=e.readUInt8(0),u=a!==4,d=Math.floor((t.p.bitLength()+7)/8),c=BigInteger$6.fromBuffer(e.slice(1,1+d)),l;if(u){assert$1.equal(e.length,d+1,"Invalid sequence length"),assert$1(a===2||a===3,"Invalid sequence tag");var m=a===3;l=t.pointFromX(m,c)}else{assert$1.equal(e.length,1+d+d,"Invalid sequence length");var I=BigInteger$6.fromBuffer(e.slice(1+d));l=Point$2.fromAffine(t,c,I)}return l.compressed=u,l},Point$2.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"};var point=Point$2,assert=requireAssert(),BigInteger$5=lib$1,Point$1=point;function Curve$2(t,e,a,u,d,c,l){this.p=t,this.a=e,this.b=a,this.G=Point$1.fromAffine(this,u,d),this.n=c,this.h=l,this.infinity=new Point$1(this,null,null,BigInteger$5.ZERO),this.pOverFour=t.add(BigInteger$5.ONE).shiftRight(2),this.pLength=Math.floor((this.p.bitLength()+7)/8)}Curve$2.prototype.pointFromX=function(t,e){var a=e.pow(3).add(this.a.multiply(e)).add(this.b).mod(this.p),u=a.modPow(this.pOverFour,this.p),d=u;return u.isEven()^!t&&(d=this.p.subtract(d)),Point$1.fromAffine(this,e,d)},Curve$2.prototype.isInfinity=function(t){return t===this.infinity?!0:t.z.signum()===0&&t.y.signum()!==0},Curve$2.prototype.isOnCurve=function(t){if(this.isInfinity(t))return!0;var e=t.affineX,a=t.affineY,u=this.a,d=this.b,c=this.p;if(e.signum()<0||e.compareTo(c)>=0||a.signum()<0||a.compareTo(c)>=0)return!1;var l=a.square().mod(c),m=e.pow(3).add(u.multiply(e)).add(d).mod(c);return l.equals(m)},Curve$2.prototype.validate=function(t){assert(!this.isInfinity(t),"Point is at infinity"),assert(this.isOnCurve(t),"Point is not on the curve");var e=t.multiply(this.n);return assert(this.isInfinity(e),"Point is not a scalar multiple of G"),!0};var curve$5=Curve$2;const secp128r1={p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1={p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1={p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1={p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1={p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1={p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1={p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"},require$$1$1={secp128r1,secp160k1,secp160r1,secp192k1,secp192r1,secp256k1,secp256r1};var BigInteger$4=lib$1,curves=require$$1$1,Curve$1=curve$5;function getCurveByName$1(t){var e=curves[t];if(!e)return null;var a=new BigInteger$4(e.p,16),u=new BigInteger$4(e.a,16),d=new BigInteger$4(e.b,16),c=new BigInteger$4(e.n,16),l=new BigInteger$4(e.h,16),m=new BigInteger$4(e.Gx,16),I=new BigInteger$4(e.Gy,16);return new Curve$1(a,u,d,m,I,c,l)}var names=getCurveByName$1,Point=point,Curve=curve$5,getCurveByName=names,lib={Curve,Point,getCurveByName},browser$1={exports:{}},MAX_BYTES=65536,MAX_UINT32=4294967295;function oldBrowser(){throw new Error(`Secure random number generation is not supported by this browser.
129
+ Use Chrome, Firefox or Internet Explorer 11`)}var Buffer$6=safeBufferExports.Buffer,crypto$1=commonjsGlobal.crypto||commonjsGlobal.msCrypto;crypto$1&&crypto$1.getRandomValues?browser$1.exports=randomBytes$1:browser$1.exports=oldBrowser;function randomBytes$1(t,e){if(t>MAX_UINT32)throw new RangeError("requested too many random bytes");var a=Buffer$6.allocUnsafe(t);if(t>0)if(t>MAX_BYTES)for(var u=0;u<t;u+=MAX_BYTES)crypto$1.getRandomValues(a.slice(u,u+MAX_BYTES));else crypto$1.getRandomValues(a);return typeof e=="function"?process$1.nextTick(function(){e(null,a)}):a}var browserExports=browser$1.exports;const BigInteger$3=lib$1,Buffer$5=safeBufferExports.Buffer,ecurve$4=lib,curve$4=ecurve$4.getCurveByName("secp256k1"),one$1=BigInteger$3.ONE,n$3=curve$4.n,p$1=curve$4.p;function checkBuffer(t,e,a,u){const d=u!==void 0?"["+u+"]":"";if(!Buffer$5.isBuffer(e))throw new Error(t+d+" must be a Buffer");if(e.length!==a)throw new Error(t+d+" must be "+a+" bytes long")}function checkArray(t,e){if(!e||!e.length)throw new Error(t+" must be an array with one or more elements")}function checkPubKeyArr(t){checkArray("pubKeys",t);for(let e=0;e<t.length;e++)checkBuffer("pubKey",t[e],32,e)}function checkMessageArr(t){checkArray("messages",t);for(let e=0;e<t.length;e++)checkBuffer("message",t[e],32,e)}function checkSignatureArr(t){checkArray("signatures",t);for(let e=0;e<t.length;e++)checkBuffer("signature",t[e],64,e)}function checkNonceArr(t){checkArray("nonces",t);for(let e=0;e<t.length;e++)checkBuffer("nonce",t[e],32,e)}function checkPrivateKey(t,e){const a=e!==void 0?"["+e+"]":"";if(!BigInteger$3.isBigInteger(t)&&typeof t!="string")throw new Error("privateKey"+a+" must be a BigInteger or valid hex string");if(typeof t=="string"){if(t.match(/[^a-f^A-F^0-9]+/))throw new Error("privateKey must be a BigInteger or valid hex string");checkRange("privateKey",BigInteger$3.fromHex(t));return}checkRange("privateKey",t)}function checkSignParams(t,e){checkPrivateKey(t),checkBuffer("message",e,32)}function checkVerifyParams(t,e,a){checkBuffer("pubKey",t,32),checkBuffer("message",e,32),checkBuffer("signature",a,64)}function checkBatchVerifyParams(t,e,a){if(checkPubKeyArr(t),checkMessageArr(e),checkSignatureArr(a),t.length!==e.length||e.length!==a.length)throw new Error("all parameters must be an array with the same length")}function checkSessionParams(t,e,a,u,d){checkSignParams(e,a),checkBuffer("sessionId",t,32),checkBuffer("pubKeyCombined",u,32),checkBuffer("ell",d,32)}function checkRange(t,e){if(e.compareTo(one$1)<0||e.compareTo(n$3.subtract(one$1))>0)throw new Error(t+" must be an integer in the range 1..n-1")}function checkSignatureInput(t,e){if(t.compareTo(p$1)>=0)throw new Error("r is larger than or equal to field size");if(e.compareTo(n$3)>=0)throw new Error("s is larger than or equal to curve order")}function checkPointExists(t,e){if(e.curve.isInfinity(e))throw new Error("point is at infinity");const a=e.affineY.isEven();if(t!==a)throw new Error("point does not exist")}function checkAux(t){if(t.length!==32)throw new Error("aux must be 32 bytes")}var check$3={checkSessionParams,checkSignParams,checkVerifyParams,checkBatchVerifyParams,checkRange,checkSignatureInput,checkPointExists,checkPubKeyArr,checkArray,checkNonceArr,checkAux},sha256$1={exports:{}};(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process$1=="object"&&process$1.versions&&process$1.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(a){return new Sha256(e,!0).update(a)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(d){return e.create().update(d)};for(var a=0;a<OUTPUT_TYPES.length;++a){var u=OUTPUT_TYPES[a];e[u]=createOutputMethod(u,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if(typeof t=="string")return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(t==null)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(a,u){return new HmacSha256(a,e,!0).update(u)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(d){return new HmacSha256(d,t)},e.update=function(d,c){return e.create(d).update(c)};for(var a=0;a<OUTPUT_TYPES.length;++a){var u=OUTPUT_TYPES[a];e[u]=createHmacOutputMethod(u,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}Sha256.prototype.update=function(t){if(!this.finalized){var e,a=typeof t;if(a!=="string"){if(a==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);e=!0}for(var u,d=0,c,l=t.length,m=this.blocks;d<l;){if(this.hashed&&(this.hashed=!1,m[0]=this.block,m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0),e)for(c=this.start;d<l&&c<64;++d)m[c>>2]|=t[d]<<SHIFT[c++&3];else for(c=this.start;d<l&&c<64;++d)u=t.charCodeAt(d),u<128?m[c>>2]|=u<<SHIFT[c++&3]:u<2048?(m[c>>2]|=(192|u>>6)<<SHIFT[c++&3],m[c>>2]|=(128|u&63)<<SHIFT[c++&3]):u<55296||u>=57344?(m[c>>2]|=(224|u>>12)<<SHIFT[c++&3],m[c>>2]|=(128|u>>6&63)<<SHIFT[c++&3],m[c>>2]|=(128|u&63)<<SHIFT[c++&3]):(u=65536+((u&1023)<<10|t.charCodeAt(++d)&1023),m[c>>2]|=(240|u>>18)<<SHIFT[c++&3],m[c>>2]|=(128|u>>12&63)<<SHIFT[c++&3],m[c>>2]|=(128|u>>6&63)<<SHIFT[c++&3],m[c>>2]|=(128|u&63)<<SHIFT[c++&3]);this.lastByteIndex=c,this.bytes+=c-this.start,c>=64?(this.block=m[16],this.start=c-64,this.hash(),this.hashed=!0):this.start=c}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,e=this.h1,a=this.h2,u=this.h3,d=this.h4,c=this.h5,l=this.h6,m=this.h7,I=this.blocks,O,T,C,j,F,U,Z,J,X,Q,te;for(O=16;O<64;++O)F=I[O-15],T=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3,F=I[O-2],C=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10,I[O]=I[O-16]+T+I[O-7]+C<<0;for(te=e&a,O=0;O<64;O+=4)this.first?(this.is224?(J=300032,F=I[0]-1413257819,m=F-150054599<<0,u=F+24177077<<0):(J=704751109,F=I[0]-210244248,m=F-1521486534<<0,u=F+143694565<<0),this.first=!1):(T=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),C=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),J=t&e,j=J^t&a^te,Z=d&c^~d&l,F=m+C+Z+K[O]+I[O],U=T+j,m=u+F<<0,u=F+U<<0),T=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),C=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),X=u&t,j=X^u&e^J,Z=m&d^~m&c,F=l+C+Z+K[O+1]+I[O+1],U=T+j,l=a+F<<0,a=F+U<<0,T=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),C=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),Q=a&u,j=Q^a&t^X,Z=l&m^~l&d,F=c+C+Z+K[O+2]+I[O+2],U=T+j,c=e+F<<0,e=F+U<<0,T=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),C=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),te=e&a,j=te^e&u^Q,Z=c&l^~c&m,F=d+C+Z+K[O+3]+I[O+3],U=T+j,d=t+F<<0,t=F+U<<0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+a<<0,this.h3=this.h3+u<<0,this.h4=this.h4+d<<0,this.h5=this.h5+c<<0,this.h6=this.h6+l<<0,this.h7=this.h7+m<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,a=this.h2,u=this.h3,d=this.h4,c=this.h5,l=this.h6,m=this.h7,I=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[u>>28&15]+HEX_CHARS[u>>24&15]+HEX_CHARS[u>>20&15]+HEX_CHARS[u>>16&15]+HEX_CHARS[u>>12&15]+HEX_CHARS[u>>8&15]+HEX_CHARS[u>>4&15]+HEX_CHARS[u&15]+HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15];return this.is224||(I+=HEX_CHARS[m>>28&15]+HEX_CHARS[m>>24&15]+HEX_CHARS[m>>20&15]+HEX_CHARS[m>>16&15]+HEX_CHARS[m>>12&15]+HEX_CHARS[m>>8&15]+HEX_CHARS[m>>4&15]+HEX_CHARS[m&15]),I},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,a=this.h2,u=this.h3,d=this.h4,c=this.h5,l=this.h6,m=this.h7,I=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,a>>24&255,a>>16&255,a>>8&255,a&255,u>>24&255,u>>16&255,u>>8&255,u&255,d>>24&255,d>>16&255,d>>8&255,d&255,c>>24&255,c>>16&255,c>>8&255,c&255,l>>24&255,l>>16&255,l>>8&255,l&255];return this.is224||I.push(m>>24&255,m>>16&255,m>>8&255,m&255),I},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};function HmacSha256(t,e,a){var u,d=typeof t;if(d==="string"){var c=[],l=t.length,m=0,I;for(u=0;u<l;++u)I=t.charCodeAt(u),I<128?c[m++]=I:I<2048?(c[m++]=192|I>>6,c[m++]=128|I&63):I<55296||I>=57344?(c[m++]=224|I>>12,c[m++]=128|I>>6&63,c[m++]=128|I&63):(I=65536+((I&1023)<<10|t.charCodeAt(++u)&1023),c[m++]=240|I>>18,c[m++]=128|I>>12&63,c[m++]=128|I>>6&63,c[m++]=128|I&63);t=c}else if(d==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(e,!0).update(t).array());var O=[],T=[];for(u=0;u<64;++u){var C=t[u]||0;O[u]=92^C,T[u]=54^C}Sha256.call(this,e,a),this.update(T),this.oKeyPad=O,this.inner=!0,this.sharedMemory=a}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256$1);var sha256Exports=sha256$1.exports;const BigInteger$2=lib$1,Buffer$4=safeBufferExports.Buffer,sha256=sha256Exports;function bufferToInt(t){return BigInteger$2.fromBuffer(t)}function intToBuffer(t){return t.toBuffer(32)}function hash(t){return Buffer$4.from(sha256.create().update(t).array())}var convert$4={bufferToInt,intToBuffer,hash};const BigInteger$1=lib$1,Buffer$3=safeBufferExports.Buffer,ecurve$3=lib,randomBytes=browserExports,curve$3=ecurve$3.getCurveByName("secp256k1"),check$2=check$3,convert$3=convert$4,concat$3=Buffer$3.concat,G$3=curve$3.G,p=curve$3.p,n$2=curve$3.n,zero$1=BigInteger$1.ZERO,one=BigInteger$1.ONE,two=BigInteger$1.valueOf(2),three=BigInteger$1.valueOf(3),four=BigInteger$1.valueOf(4),seven=BigInteger$1.valueOf(7);function deterministicGetK0(t,e,a){check$2.checkSignParams(t,a);const u=taggedHash("BIP0340/nonce",concat$3([convert$3.intToBuffer(t),e,a]));return convert$3.bufferToInt(u).mod(n$2)}function isEven(t){return t.affineY.mod(two).equals(zero$1)}function getEvenKey(t,e){return isEven(t)?e.clone():n$2.subtract(e)}function getE(t,e,a){const u=taggedHash("BIP0340/challenge",concat$3([t,e,a]));return convert$3.bufferToInt(u).mod(n$2)}function getR(t,e,a){const u=G$3.multiply(t),d=a.multiply(e);return u.add(d.negate())}function taggedHash(t,e){const a=convert$3.hash(t);return convert$3.hash(concat$3([a,a,Buffer$3.from(e)]))}function liftX(t){const e=convert$3.bufferToInt(t),a=e.pow(three).add(seven).mod(p),u=a.modPow(p.add(one).divide(four),p);if(a.compareTo(u.modPow(two,p))!==0)throw new Error("c is not equal to y^2");let d=ecurve$3.Point.fromAffine(curve$3,e,u);return isEven(d)||(d=ecurve$3.Point.fromAffine(curve$3,e,p.subtract(u))),check$2.checkPointExists(!0,d),d}function randomA(){let t=null;for(;;){t=convert$3.bufferToInt(Buffer$3.from(randomBytes(32)));try{return check$2.checkRange("a",t),t}catch{}}}var math$3={deterministicGetK0,isEven,getEvenKey,getE,getR,taggedHash,liftX,randomA};const BigInteger=lib$1,Buffer$2=safeBufferExports.Buffer,ecurve$2=lib,curve$2=ecurve$2.getCurveByName("secp256k1"),math$2=math$3,check$1=check$3,convert$2=convert$4,concat$2=Buffer$2.concat,G$2=curve$2.G;curve$2.p;const n$1=curve$2.n,zero=BigInteger.ZERO;function sign(t,e,a){check$1.checkSignParams(t,e),t=typeof t=="string"?BigInteger.fromHex(t):t;const u=G$2.multiply(t),d=convert$2.intToBuffer(u.affineX),c=math$2.getEvenKey(u,t);let l;if(a){check$1.checkAux(a);const C=convert$2.intToBuffer(c.xor(convert$2.bufferToInt(math$2.taggedHash("BIP0340/aux",a)))),j=math$2.taggedHash("BIP0340/nonce",concat$2([C,d,e]));l=convert$2.bufferToInt(j).mod(n$1)}else l=math$2.deterministicGetK0(c,d,e);if(l.signum()===0)throw new Error("kPrime is zero");const m=G$2.multiply(l),I=math$2.getEvenKey(m,l),O=convert$2.intToBuffer(m.affineX),T=math$2.getE(O,d,e);return concat$2([O,convert$2.intToBuffer(I.add(T.multiply(c)).mod(n$1))])}function verify(t,e,a){check$1.checkVerifyParams(t,e,a);const u=math$2.liftX(t),d=convert$2.intToBuffer(u.affineX),c=convert$2.bufferToInt(a.slice(0,32)),l=convert$2.bufferToInt(a.slice(32,64));check$1.checkSignatureInput(c,l);const m=math$2.getE(convert$2.intToBuffer(c),d,e),I=math$2.getR(l,m,u);if(I.curve.isInfinity(I)||!math$2.isEven(I)||!I.affineX.equals(c))throw new Error("signature verification failed")}function batchVerify(t,e,a){check$1.checkBatchVerifyParams(t,e,a);let u=zero,d=null;for(let c=0;c<t.length;c++){const l=math$2.liftX(t[c]),m=convert$2.intToBuffer(l.affineX),I=convert$2.bufferToInt(a[c].slice(0,32)),O=convert$2.bufferToInt(a[c].slice(32,64));check$1.checkSignatureInput(I,O);const T=math$2.getE(convert$2.intToBuffer(I),m,e[c]),C=math$2.liftX(a[c].slice(0,32));if(c===0)u=u.add(O),d=C,d=d.add(l.multiply(T));else{const j=math$2.randomA();u=u.add(j.multiply(O)),d=d.add(C.multiply(j)),d=d.add(l.multiply(j.multiply(T)))}}if(!G$2.multiply(u).equals(d))throw new Error("signature verification failed")}var schnorr$1={sign,verify,batchVerify};const Buffer$1=safeBufferExports.Buffer,ecurve$1=lib,curve$1=ecurve$1.getCurveByName("secp256k1"),math$1=math$3,check=check$3,convert$1=convert$4,concat$1=Buffer$1.concat,G$1=curve$1.G,n=curve$1.n,MUSIG_TAG=convert$1.hash(Buffer$1.from("MuSig coefficient"));function computeEll(t){return check.checkPubKeyArr(t),convert$1.hash(concat$1(t))}function computeCoefficient(t,e){const a=Buffer$1.alloc(4);a.writeUInt32LE(e);const u=concat$1([MUSIG_TAG,MUSIG_TAG,t,a]);return convert$1.bufferToInt(convert$1.hash(u)).mod(n)}function pubKeyCombine(t,e){const a=e||computeEll(t);let u=null;for(let d=0;d<t.length;d++){const c=math$1.liftX(t[d]),l=computeCoefficient(a,d),m=c.multiply(l);u===null?u=m:u=u.add(m)}return u}function sessionInitialize(t,e,a,u,d,c,l){check.checkSessionParams(t,e,a,u,c);const m={sessionId:t,message:a,pubKeyCombined:u,pkParity:d,ell:c,idx:l},I=computeCoefficient(c,l);m.secretKey=e.multiply(I).mod(n),m.ownKeyParity=math$1.isEven(G$1.multiply(e)),m.pkParity!==m.ownKeyParity&&(m.secretKey=n.subtract(m.secretKey));const O=concat$1([t,a,m.pubKeyCombined,convert$1.intToBuffer(e)]);m.secretNonce=convert$1.bufferToInt(convert$1.hash(O)),check.checkRange("secretNonce",m.secretNonce);const T=G$1.multiply(m.secretNonce);return m.nonce=convert$1.intToBuffer(T.affineX),m.nonceParity=math$1.isEven(T),m.commitment=convert$1.hash(m.nonce),m}function sessionNonceCombine(t,e){check.checkNonceArr(e);let a=math$1.liftX(e[0]);for(let u=1;u<e.length;u++)a=a.add(math$1.liftX(e[u]));return t.combinedNonceParity=math$1.isEven(a),convert$1.intToBuffer(a.affineX)}function partialSign(t,e,a,u){const d=math$1.getE(a,u,e),c=t.secretKey;let l=t.secretNonce;return t.nonceParity!==t.combinedNonceParity&&(l=n.subtract(l)),c.multiply(d).add(l).mod(n)}function partialSigVerify(t,e,a,u,d,c){let l=math$1.getE(a,t.pubKeyCombined,t.message);const m=computeCoefficient(t.ell,u),I=math$1.liftX(d),O=math$1.liftX(c);t.pkParity||(l=n.subtract(l));let T=math$1.getR(e,l.multiply(m).mod(n),I);t.combinedNonceParity&&(T=T.negate());const C=T.add(O);if(!C.curve.isInfinity(C))throw new Error("partial signature verification failed")}function partialSigCombine(t,e){const a=math$1.liftX(t);check.checkArray("partialSigs",e);const u=convert$1.intToBuffer(a.affineX);let d=e[0];for(let c=1;c<e.length;c++)d=d.add(e[c]).mod(n);return concat$1([u,convert$1.intToBuffer(d)])}var muSig={computeEll,computeCoefficient,pubKeyCombine,sessionInitialize,sessionNonceCombine,partialSign,partialSigVerify,partialSigCombine};const Buffer=safeBufferExports.Buffer,ecurve=lib,curve=ecurve.getCurveByName("secp256k1"),math=math$3,convert=convert$4,concat=Buffer.concat,G=curve.G;function taprootConstruct(t,e){e||(e=[]);const a=taprootTree(e),u=convert.intToBuffer(t.affineX),d=math.liftX(u),c=convert.bufferToInt(math.taggedHash("TapTweak",concat([u,a]))),l=d.add(G.multiply(c));return convert.intToBuffer(l.affineX)}function taprootTree(t){let e=Buffer.alloc(32,0);return!t||t.length===0?new Buffer(0):e}var taproot={taprootConstruct};const schnorr=schnorr$1;schnorr.check=check$3,schnorr.convert=convert$4,schnorr.math=math$3,schnorr.muSig=muSig,schnorr.taproot=taproot;var src=schnorr,input$1={exports:{}},input,hasRequiredInput$1;function requireInput$1(){if(hasRequiredInput$1)return input;hasRequiredInput$1=1;var t=lodashExports,e=preconditions;const a=errorsExports;var u=bufferwriter,d=bufferExports,c=js,l=requireScript(),m=requireSighash(),I=requireOutput(),O=4294967295,T=O,C=O-1,j=O-2;const F=Math.pow(2,31),U=Math.pow(2,22),Z=65535,J=512,X=Math.pow(2,16)-1;function Q(te){if(!(this instanceof Q))return new Q(te);if(te)return this._fromObject(te)}return Q.MAXINT=O,Q.DEFAULT_SEQNUMBER=T,Q.DEFAULT_LOCKTIME_SEQNUMBER=C,Q.DEFAULT_RBF_SEQNUMBER=j,Q.SEQUENCE_LOCKTIME_TYPE_FLAG=U,Object.defineProperty(Q.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new l(this._scriptBuffer),this._script._isInput=!0),this._script)}}),Q.fromObject=function(te){e.checkArgument(t.isObject(te));var se=new Q;return se._fromObject(te)},Q.prototype._fromObject=function(te){var se;if(typeof te.prevTxId=="string"&&c.isHexa(te.prevTxId)?se=Buffer$N.from(te.prevTxId,"hex"):se=te.prevTxId,this.witnesses=[],this.output=te.output?te.output instanceof I?te.output:new I(te.output):void 0,this.prevTxId=se||te.txidbuf,this.outputIndex=te.outputIndex==null?te.txoutnum:te.outputIndex,this.sequenceNumber=te.sequenceNumber==null?te.seqnum==null?T:te.seqnum:te.sequenceNumber,te.script===void 0&&te.scriptBuffer===void 0)throw new a.Transaction.Input.MissingScript;return this.setScript(te.scriptBuffer||te.script),this},Q.prototype.toObject=Q.prototype.toJSON=function(){var se={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(se.scriptString=this.script.toString()),this.output&&(se.output=this.output.toObject()),se},Q.fromBufferReader=function(te){var se=new Q;return se.prevTxId=te.readReverse(32),se.outputIndex=te.readUInt32LE(),se._scriptBuffer=te.readVarLengthBuffer(),se.sequenceNumber=te.readUInt32LE(),se},Q.prototype.toBufferWriter=function(te){te||(te=new u),te.writeReverse(this.prevTxId),te.writeUInt32LE(this.outputIndex);var se=this._scriptBuffer;return te.writeVarintNum(se.length),te.write(se),te.writeUInt32LE(this.sequenceNumber),te},Q.prototype.setScript=function(te){if(this._script=null,te instanceof l)this._script=te,this._script._isInput=!0,this._scriptBuffer=te.toBuffer();else if(c.isHexa(te))this._scriptBuffer=Buffer$N.from(te,"hex");else if(t.isString(te))this._script=new l(te),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(d.isBuffer(te))this._scriptBuffer=Buffer$N.from(te);else throw new TypeError("Invalid argument type: script");return this},Q.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},Q.prototype.getSatoshisBuffer=function(){return e.checkState(this.output instanceof I),e.checkState(this.output._satoshisBN),new u().writeUInt64LEBN(this.output._satoshisBN).toBuffer()},Q.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},Q.prototype.isFinal=function(){return this.sequenceNumber!==Q.MAXINT},Q.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},Q.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},Q.prototype.hasWitnesses=function(){return!!(this.witnesses&&this.witnesses.length>0)},Q.prototype.getWitnesses=function(){return this.witnesses},Q.prototype.setWitnesses=function(te){this.witnesses=te},Q.prototype.isValidSignature=function(te,se,pe){return pe=pe||"ecdsa",se.signature.nhashtype=se.sigtype,m.verify(te,se.signature,se.publicKey,se.inputIndex,this.output.script,pe)},Q.prototype.isNull=function(){return this.prevTxId.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.outputIndex===4294967295},Q.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},Q.prototype._getBaseSize=function(){return 40},Q.prototype.lockForSeconds=function(te){if(e.checkArgument(t.isNumber(te)),te<0||te>=J*Z)throw new a.Transaction.Input.LockTimeRange;return te=parseInt(Math.floor(te/J)),this.sequenceNumber=te|U,this},Q.prototype.lockUntilBlockHeight=function(te){if(e.checkArgument(t.isNumber(te)),te<0||te>=X)throw new a.Transaction.Input.BlockHeightOutOfRange;return this.sequenceNumber=te,this},Q.prototype.getLockTime=function(){if(this.sequenceNumber&F)return null;if(this.sequenceNumber&U){var te=J*(this.sequenceNumber&Z);return te}else{var se=this.sequenceNumber&Z;return se}},input=Q,input}var inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(e,a){e.super_=a,e.prototype=Object.create(a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:inherits_browser.exports=function(e,a){e.super_=a;var u=function(){};u.prototype=a.prototype,e.prototype=new u,e.prototype.constructor=e};var inherits_browserExports=inherits_browser.exports,signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var t=lodashExports,e=preconditions,a=inherits_browserExports,u=bufferExports,d=js,c=requirePublickey(),l=errorsExports,m=signature$1;function I(O){if(!(this instanceof I))return new I(O);if(O instanceof I)return O;if(t.isObject(O))return this._fromObject(O);throw new l.InvalidArgument("TransactionSignatures must be instantiated from an object")}return a(I,m),I.prototype._fromObject=function(O){return this._checkObjectArgs(O),this.publicKey=new c(O.publicKey),this.prevTxId=u.isBuffer(O.prevTxId)?O.prevTxId:Buffer$N.from(O.prevTxId,"hex"),this.outputIndex=O.outputIndex,this.inputIndex=O.inputIndex,this.signature=O.signature instanceof m?O.signature:u.isBuffer(O.signature)?m.fromBuffer(O.signature):m.fromString(O.signature),this.sigtype=O.sigtype,this},I.prototype._checkObjectArgs=function(O){e.checkArgument(c(O.publicKey),"publicKey"),e.checkArgument(!t.isUndefined(O.inputIndex),"inputIndex"),e.checkArgument(!t.isUndefined(O.outputIndex),"outputIndex"),e.checkState(t.isNumber(O.inputIndex),"inputIndex must be a number"),e.checkState(t.isNumber(O.outputIndex),"outputIndex must be a number"),e.checkArgument(O.signature,"signature"),e.checkArgument(O.prevTxId,"prevTxId"),e.checkState(O.signature instanceof m||u.isBuffer(O.signature)||d.isHexa(O.signature),"signature must be a buffer or hexa value"),e.checkState(u.isBuffer(O.prevTxId)||d.isHexa(O.prevTxId),"prevTxId must be a buffer or hexa value"),e.checkArgument(O.sigtype,"sigtype"),e.checkState(t.isNumber(O.sigtype),"sigtype must be a number")},I.prototype.toObject=I.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}},I.fromObject=function(O){return e.checkArgument(O),new I(O)},signature=I,signature}var publickey$1,hasRequiredPublickey$1;function requirePublickey$1(){if(hasRequiredPublickey$1)return publickey$1;hasRequiredPublickey$1=1;var t=inherits_browserExports,e=preconditions,a=requireInput$1(),u=requireOutput(),d=requireSighash(),c=requireScript(),l=signature$1,m=requireSignature();function I(){a.apply(this,arguments)}return t(I,a),I.prototype.getSignatures=function(O,T,C,j,F,U){e.checkState(this.output instanceof u),j=j||l.SIGHASH_ALL;var Z=T.toPublicKey();return Z.toString()===this.output.script.getPublicKey().toString("hex")?[new m({publicKey:Z,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:C,signature:d.sign(O,T,j,C,this.output.script,U),sigtype:j})]:[]},I.prototype.addSignature=function(O,T,C){return e.checkState(this.isValidSignature(O,T,C),"Signature is invalid"),this.setScript(c.buildPublicKeyIn(T.signature.toDER(),T.sigtype)),this},I.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},I.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},I.SCRIPT_MAX_SIZE=73,I.prototype._estimateSize=function(){return this._getBaseSize()+I.SCRIPT_MAX_SIZE},publickey$1=I,publickey$1}var sighashwitness,hasRequiredSighashwitness;function requireSighashwitness(){if(hasRequiredSighashwitness)return sighashwitness;hasRequiredSighashwitness=1;var t=signature$1;requireScript(),requireOutput();var e=bufferreader,a=bufferwriter,u=hashExports,d=requireEcdsa(),c=preconditions,l=lodashExports,m=function(C,j,F,U,Z){var J,X,Q;if(!(j&t.SIGHASH_ANYONECANPAY)){for(var te=[],se=0;se<C.inputs.length;se++){var pe=C.inputs[se],me=new e(pe.prevTxId).readReverse();te.push(me);var Ee=Buffer$N.alloc(4);Ee.writeUInt32LE(pe.outputIndex,0),te.push(Ee)}J=u.sha256sha256(Buffer$N.concat(te))}if(!(j&t.SIGHASH_ANYONECANPAY)&&(j&31)!==t.SIGHASH_SINGLE&&(j&31)!==t.SIGHASH_NONE){for(var V=[],ae=0;ae<C.inputs.length;ae++){var ne=Buffer$N.alloc(4);ne.writeUInt32LE(C.inputs[ae].sequenceNumber,0),V.push(ne)}X=u.sha256sha256(Buffer$N.concat(V))}var M=new a;if((j&31)!==t.SIGHASH_SINGLE&&(j&31)!==t.SIGHASH_NONE){for(var v=0;v<C.outputs.length;v++)C.outputs[v].toBufferWriter(M);Q=u.sha256sha256(M.toBuffer())}else(j&31)===t.SIGHASH_SINGLE&&F<C.outputs.length&&(C.outputs[F].toBufferWriter(M),Q=u.sha256sha256(M.toBuffer()));var S=new a;S.writeUInt32LE(C.version),S.write(J),S.write(X);var y=new e(C.inputs[F].prevTxId).readReverse();return S.write(y),S.writeUInt32LE(C.inputs[F].outputIndex),S.write(U),S.write(Z),S.writeUInt32LE(C.inputs[F].sequenceNumber),S.write(Q),S.writeUInt32LE(C.nLockTime),S.writeInt32LE(j),u.sha256sha256(S.toBuffer())};function I(T,C,j,F,U,Z,J){J=J||"ecdsa";var X;if(J==="ecdsa"){let Q=m(T,j,F,U,Z);return X=d.sign(Q,C).set({nhashtype:j}),X}throw new Error("signingMethod not supported ",J)}function O(T,C,j,F,U,Z,J){if(c.checkArgument(!l.isUndefined(T)),c.checkArgument(!l.isUndefined(C)&&!l.isUndefined(C.nhashtype)),J=J||"ecdsa",J==="ecdsa"){let X=m(T,C.nhashtype,F,U,Z);return d.verify(X,C,j)}throw new Error("signingMethod not supported ",J)}return sighashwitness={sighash:m,sign:I,verify:O},sighashwitness}var publickeyhash,hasRequiredPublickeyhash;function requirePublickeyhash(){if(hasRequiredPublickeyhash)return publickeyhash;hasRequiredPublickeyhash=1;var t=inherits_browserExports,e=preconditions,I=bufferExports;requireAddress();var a=hashExports,u=requireInput$1(),d=requireOutput(),c=requireSighash(),l=requireSighashwitness(),m=bufferwriter,I=bufferExports,O=requireScript(),T=signature$1,C=requireSignature();function j(){u.apply(this,arguments)}return t(j,u),j.prototype.getRedeemScript=function(F){if(!this.redeemScript){var U=O.buildWitnessV0Out(F);if(O.buildScriptHashOut(U).equals(this.output.script)){var Z=new O;Z.add(U.toBuffer()),this.setScript(Z),this.redeemScript=U}}return this.redeemScript},j.prototype.getScriptCode=function(F){var U=new m,Z;this.output.script.isScriptHashOut()?Z=this.getRedeemScript(F):Z=this.output.script;var J=O.buildPublicKeyHashOut(Z.toAddress()).toBuffer();return U.writeVarintNum(J.length),U.write(J),U.toBuffer()},j.prototype.getSighash=function(F,U,Z,J){var X=this.getScriptCode(U),Q=this.getSatoshisBuffer();return l.sighash(F,J,Z,X,Q)},j.prototype.getSignatures=function(F,U,Z,J,X,Q){e.checkState(this.output instanceof d),X=X||a.sha256ripemd160(U.publicKey.toBuffer()),J=J||T.SIGHASH_ALL,Q=Q||"ecdsa";var te;if(this.output.script.isScriptHashOut()?te=this.getRedeemScript(U.publicKey):te=this.output.script,te&&I.equals(X,te.getPublicKeyHash())){var se;if(te.isWitnessPublicKeyHashOut()){var pe=this.getSatoshisBuffer(),me=this.getScriptCode(U.publicKey);se=l.sign(F,U,J,Z,me,pe,Q)}else se=c.sign(F,U,J,Z,this.output.script,Q);return[new C({publicKey:U.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:Z,signature:se,sigtype:J})]}return[]},j.prototype.addSignature=function(F,U,Z){return e.checkState(this.isValidSignature(F,U,Z),"Signature is invalid"),this.output.script.isWitnessPublicKeyHashOut()||this.output.script.isScriptHashOut()?this.setWitnesses([I.concat([U.signature.toDER(),I.integerAsSingleByteBuffer(U.sigtype)]),U.publicKey.toBuffer()]):this.setScript(O.buildPublicKeyHashIn(U.publicKey,U.signature.toDER(),U.sigtype)),this},j.prototype.clearSignatures=function(){return this.setScript(O.empty()),this.setWitnesses([]),this},j.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()||this.hasWitnesses()},j.prototype.isValidSignature=function(F,U,Z){if(U.signature.nhashtype=U.sigtype,this.output.script.isWitnessPublicKeyHashOut()||this.output.script.isScriptHashOut()){var J=this.getScriptCode(),X=this.getSatoshisBuffer();return l.verify(F,U.signature,U.publicKey,U.inputIndex,J,X,Z)}else return c.verify(F,U.signature,U.publicKey,U.inputIndex,this.output.script,Z)},j.SCRIPT_MAX_SIZE=107,j.REDEEM_SCRIPT_SIZE=23,j.prototype._estimateSize=function(){let F=this._getBaseSize();F+=1;const Z=j.SCRIPT_MAX_SIZE/4;return this.output.script.isWitnessPublicKeyHashOut()?F+=Z:this.output.script.isScriptHashOut()?F+=Z+j.REDEEM_SCRIPT_SIZE:F+=j.SCRIPT_MAX_SIZE,F},publickeyhash=j,publickeyhash}var multisig,hasRequiredMultisig;function requireMultisig(){if(hasRequiredMultisig)return multisig;hasRequiredMultisig=1;var t=lodashExports,e=inherits_browserExports;requireTransaction$1();var a=requireInput$1(),u=requireOutput(),d=preconditions,c=requireScript(),l=signature$1,m=requireSighash();requirePublickey();var I=bufferExports,O=requireSignature();function T(C,j,F,U,Z){Z=Z||{},a.apply(this,arguments);var J=this;j=j||C.publicKeys,F=F||C.threshold,U=U||C.signatures,Z.noSorting?this.publicKeys=j:this.publicKeys=t.sortBy(j,function(X){return X.toString("hex")}),d.checkState(c.buildMultisigOut(this.publicKeys,F).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},t.each(this.publicKeys,function(X,Q){J.publicKeyIndex[X.toString()]=Q}),this.threshold=F,this.signatures=U?this._deserializeSignatures(U):new Array(this.publicKeys.length)}return e(T,a),T.prototype.toObject=function(){var C=a.prototype.toObject.apply(this,arguments);return C.threshold=this.threshold,C.publicKeys=t.map(this.publicKeys,function(j){return j.toString()}),C.signatures=this._serializeSignatures(),C},T.prototype._deserializeSignatures=function(C){return t.map(C,function(j){if(j)return new O(j)})},T.prototype._serializeSignatures=function(){return t.map(this.signatures,function(C){if(C)return C.toObject()})},T.prototype.getSignatures=function(C,j,F,U,Z,J){d.checkState(this.output instanceof u),U=U||l.SIGHASH_ALL,J=J||"ecdsa";var X=this,Q=[];return t.each(this.publicKeys,function(te){te.toString()===j.publicKey.toString()&&Q.push(new O({publicKey:j.publicKey,prevTxId:X.prevTxId,outputIndex:X.outputIndex,inputIndex:F,signature:m.sign(C,j,U,F,X.output.script,J),sigtype:U}))}),Q},T.prototype.addSignature=function(C,j,F){return d.checkState(!this.isFullySigned(),"All needed signatures have already been added"),d.checkArgument(!t.isUndefined(this.publicKeyIndex[j.publicKey.toString()],"Signature Undefined"),"Signature has no matching public key"),d.checkState(this.isValidSignature(C,j,F),"Invalid Signature"),this.signatures[this.publicKeyIndex[j.publicKey.toString()]]=j,this._updateScript(),this},T.prototype._updateScript=function(){return this.setScript(c.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},T.prototype._createSignatures=function(){return t.map(t.filter(this.signatures,function(C){return!t.isUndefined(C)}),function(C){return I.concat([C.signature.toDER(),I.integerAsSingleByteBuffer(C.sigtype)])})},T.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},T.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},T.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},T.prototype.countSignatures=function(){return t.reduce(this.signatures,function(C,j){return C+!!j},0)},T.prototype.publicKeysWithoutSignature=function(){var C=this;return t.filter(this.publicKeys,function(j){return!C.signatures[C.publicKeyIndex[j.toString()]]})},T.prototype.isValidSignature=function(C,j,F){return j.signature.nhashtype=j.sigtype,m.verify(C,j.signature,j.publicKey,j.inputIndex,this.output.script,F)},T.normalizeSignatures=function(C,j,F,U,Z,J){return Z.map(function(X){var Q=null;return U=U.filter(function(te){if(Q)return!0;var se=new O({signature:l.fromTxFormat(te),publicKey:X,prevTxId:j.prevTxId,outputIndex:j.outputIndex,inputIndex:F,sigtype:l.SIGHASH_ALL});se.signature.nhashtype=se.sigtype;var pe=m.verify(C,se.signature,se.publicKey,se.inputIndex,j.output.script,J);return pe?(Q=se,!1):!0}),Q||null})},T.OPCODES_SIZE=1,T.SIGNATURE_SIZE=73,T.prototype._estimateSize=function(){return this._getBaseSize()+T.OPCODES_SIZE+this.threshold*T.SIGNATURE_SIZE},multisig=T,multisig}var multisigscripthash,hasRequiredMultisigscripthash;function requireMultisigscripthash(){if(hasRequiredMultisigscripthash)return multisigscripthash;hasRequiredMultisigscripthash=1;var t=lodashExports,e=inherits_browserExports,a=requireInput$1(),u=requireOutput(),d=preconditions,c=requireAddress(),l=requireScript(),m=signature$1,I=requireSighash(),O=requireSighashwitness(),T=bufferwriter,C=bufferExports,j=requireSignature();function F(U,Z,J,X,Q){Q=Q||{},a.apply(this,arguments),Z=Z||U.publicKeys,J=J||U.threshold,X=X||U.signatures,Q.noSorting?this.publicKeys=Z:this.publicKeys=t.sortBy(Z,function(pe){return pe.toString("hex")}),this.redeemScript=l.buildMultisigOut(this.publicKeys,J,Q);var te=l.buildWitnessMultisigOutFromScript(this.redeemScript);if(te.equals(this.output.script))this.nestedWitness=!1,this.type=c.PayToWitnessScriptHash;else if(l.buildScriptHashOut(te).equals(this.output.script))this.nestedWitness=!0,this.type=c.PayToScriptHash;else if(l.buildScriptHashOut(this.redeemScript).equals(this.output.script))this.nestedWitness=!1,this.type=c.PayToScriptHash;else throw new Error("Provided public keys don't hash to the provided output");if(this.nestedWitness){var se=new l;se.add(te.toBuffer()),this.setScript(se)}this.publicKeyIndex={};for(let pe=0;pe<this.publicKeys.length;pe++){const me=this.publicKeys[pe];this.publicKeyIndex[me.toString()]=pe}this.threshold=J,this.signatures=X?this._deserializeSignatures(X):new Array(this.publicKeys.length)}return e(F,a),F.prototype.toObject=function(){var U=a.prototype.toObject.apply(this,arguments);return U.threshold=this.threshold,U.publicKeys=this.publicKeys.map(function(Z){return Z.toString()}),U.signatures=this._serializeSignatures(),U},F.prototype._deserializeSignatures=function(U){return U.map(function(Z){if(Z)return new j(Z)})},F.prototype._serializeSignatures=function(){return this.signatures.map(function(U){if(U)return U.toObject()})},F.prototype.getScriptCode=function(){var U=new T;if(this.redeemScript.hasCodeseparators())throw new Error("@TODO");var Z=this.redeemScript.toBuffer();return U.writeVarintNum(Z.length),U.write(Z),U.toBuffer()},F.prototype.getSighash=function(U,Z,J,X){var Q;if(this.nestedWitness||this.type===c.PayToWitnessScriptHash){var te=this.getScriptCode(),se=this.getSatoshisBuffer();Q=O.sighash(U,X,J,te,se)}else Q=I.sighash(U,X,J,this.redeemScript);return Q},F.prototype.getSignatures=function(U,Z,J,X,Q,te){d.checkState(this.output instanceof u),X=X||m.SIGHASH_ALL,te=te||"ecdsa";const se=[];for(const V of this.publicKeys)if(V.toString()===Z.publicKey.toString()){var pe;if(this.nestedWitness||this.type===c.PayToWitnessScriptHash){var me=this.getScriptCode(),Ee=this.getSatoshisBuffer();pe=O.sign(U,Z,X,J,me,Ee,te)}else pe=I.sign(U,Z,X,J,this.redeemScript,te);se.push(new j({publicKey:Z.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:J,signature:pe,sigtype:X}))}return se},F.prototype.addSignature=function(U,Z,J){return d.checkState(!this.isFullySigned(),"All needed signatures have already been added"),d.checkArgument(this.publicKeyIndex[Z.publicKey.toString()]!=null,"Signature has no matching public key"),d.checkState(this.isValidSignature(U,Z,J),"Invalid Signature!"),this.signatures[this.publicKeyIndex[Z.publicKey.toString()]]=Z,this._updateScript(),this},F.prototype._updateScript=function(){if(this.nestedWitness||this.type===c.PayToWitnessScriptHash){for(var U=[Buffer$N.alloc(0)],Z=this._createSignatures(),J=0;J<Z.length;J++)U.push(Z[J]);U.push(this.redeemScript.toBuffer()),this.setWitnesses(U)}else{var X=l.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript});this.setScript(X)}return this},F.prototype._createSignatures=function(){return this.signatures.filter(function(U){return U!=null}).map(function(U){return C.concat([U.signature.toDER(),C.integerAsSingleByteBuffer(U.sigtype)])})},F.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},F.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},F.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},F.prototype.countSignatures=function(){return this.signatures.reduce(function(U,Z){return U+!!Z},0)},F.prototype.publicKeysWithoutSignature=function(){return this.publicKeys.filter(U=>!this.signatures[this.publicKeyIndex[U.toString()]])},F.prototype.isValidSignature=function(U,Z,J){if(J=J||"ecdsa",this.nestedWitness||this.type===c.PayToWitnessScriptHash){Z.signature.nhashtype=Z.sigtype;var X=this.getScriptCode(),Q=this.getSatoshisBuffer();return O.verify(U,Z.signature,Z.publicKey,Z.inputIndex,X,Q,J)}else return Z.signature.nhashtype=Z.sigtype,I.verify(U,Z.signature,Z.publicKey,Z.inputIndex,this.redeemScript,J)},F.MAX_OPCODES_SIZE=8,F.MAX_SIGNATURE_SIZE=74,F.MAX_PUBKEY_SIZE=34,F.REDEEM_SCRIPT_SIZE=34,F.prototype._estimateSize=function(){let U=this._getBaseSize();const Z=4,J=F.MAX_OPCODES_SIZE+this.threshold*F.MAX_SIGNATURE_SIZE+this.publicKeys.length*F.MAX_PUBKEY_SIZE;return this.type===c.PayToWitnessScriptHash?U+=J/Z:this.nestedWitness?U+=J/Z+F.REDEEM_SCRIPT_SIZE:U+=J,U},multisigscripthash=F,multisigscripthash}var hasRequiredInput;function requireInput(){return hasRequiredInput||(hasRequiredInput=1,input$1.exports=requireInput$1(),input$1.exports.PublicKey=requirePublickey$1(),input$1.exports.PublicKeyHash=requirePublickeyhash(),input$1.exports.MultiSig=requireMultisig(),input$1.exports.MultiSigScriptHash=requireMultisigscripthash()),input$1.exports}var sighash_1,hasRequiredSighash;function requireSighash(){if(hasRequiredSighash)return sighash_1;hasRequiredSighash=1;var t=signature$1,e=requireScript(),a=requireOutput(),u=bufferreader,d=bufferwriter,c=bn$1,l=hashExports,m=requireEcdsa(),I=preconditions,O=lodashExports;const T=src;var C="0000000000000000000000000000000000000000000000000000000000000001",j="ffffffffffffffff",F=function(X,Q,te,se){var pe=requireTransaction$1(),me=requireInput(),Ee,V=pe.shallowCopy(X);for(se=new e(se),se.removeCodeseparators(),Ee=0;Ee<V.inputs.length;Ee++)V.inputs[Ee]=new me(V.inputs[Ee]).setScript(e.empty());if(V.inputs[te]=new me(V.inputs[te]).setScript(se),(Q&31)===t.SIGHASH_NONE||(Q&31)===t.SIGHASH_SINGLE)for(Ee=0;Ee<V.inputs.length;Ee++)Ee!==te&&(V.inputs[Ee].sequenceNumber=0);if((Q&31)===t.SIGHASH_NONE)V.outputs=[];else if((Q&31)===t.SIGHASH_SINGLE){if(te>=V.outputs.length)return Buffer$N.from(C,"hex");for(V.outputs.length=te+1,Ee=0;Ee<te;Ee++)V.outputs[Ee]=new a({satoshis:c.fromBuffer(Buffer$N.from(j,"hex")),script:e.empty()})}Q&t.SIGHASH_ANYONECANPAY&&(V.inputs=[V.inputs[te]]);var ae=new d().write(V.toBuffer()).writeInt32LE(Q).toBuffer(),ne=l.sha256sha256(ae);return ne=new u(ne).readReverse(),ne};function U(J,X,Q,te,se,pe){pe=pe||"ecdsa";let me=F(J,Q,te,se),Ee;switch(pe){case"ecdsa":Ee=m.sign(me,X,"little").set({nhashtype:Q});break;case"schnorr":Ee=T.sign(X.toString(),me);break;default:throw new Error("signingMethod not supported ",pe)}return Ee}function Z(J,X,Q,te,se,pe){I.checkArgument(!O.isUndefined(J),"Transaction Undefined"),I.checkArgument(!O.isUndefined(X)&&!O.isUndefined(X.nhashtype),"Signature Undefined"),pe=pe||"ecdsa";let me=F(J,X.nhashtype,te,se),Ee=!1;switch(pe){case"ecdsa":Ee=m.verify(me,X,Q,"little");break;case"schnorr":Ee=T.verify(Q,me,X);break;default:throw new Error("signingMethod not supported ",pe)}return Ee}return sighash_1={sighash:F,sign:U,verify:Z},sighash_1}var _$5=lodashExports,errors$1=errorsExports,$$4=preconditions,UNITS={BTC:[1e8,8],mBTC:[1e5,5],uBTC:[100,2],bits:[100,2],satoshis:[1,0]};function Unit$1(t,e){if(!(this instanceof Unit$1))return new Unit$1(t,e);if(_$5.isNumber(e)){if(e<=0)throw new errors$1.Unit.InvalidRate(e);t=t/e,e=Unit$1.BTC}this._value=this._from(t,e);var a=this,u=function(d){Object.defineProperty(a,d,{get:function(){return a.to(d)},enumerable:!0})};Object.keys(UNITS).forEach(u)}Object.keys(UNITS).forEach(function(t){Unit$1[t]=t}),Unit$1.fromObject=function t(e){return $$4.checkArgument(_$5.isObject(e),"Argument is expected to be an object"),new Unit$1(e.amount,e.code)},Unit$1.fromBTC=function(t){return new Unit$1(t,Unit$1.BTC)},Unit$1.fromMillis=Unit$1.fromMilis=function(t){return new Unit$1(t,Unit$1.mBTC)},Unit$1.fromMicros=Unit$1.fromBits=function(t){return new Unit$1(t,Unit$1.bits)},Unit$1.fromSatoshis=function(t){return new Unit$1(t,Unit$1.satoshis)},Unit$1.fromFiat=function(t,e){return new Unit$1(t,e)},Unit$1.prototype._from=function(t,e){if(!UNITS[e])throw new errors$1.Unit.UnknownCode(e);return parseInt((t*UNITS[e][0]).toFixed())},Unit$1.prototype.to=function(t){if(_$5.isNumber(t)){if(t<=0)throw new errors$1.Unit.InvalidRate(t);return parseFloat((this.BTC*t).toFixed(2))}if(!UNITS[t])throw new errors$1.Unit.UnknownCode(t);var e=this._value/UNITS[t][0];return parseFloat(e.toFixed(UNITS[t][1]))},Unit$1.prototype.toBTC=function(){return this.to(Unit$1.BTC)},Unit$1.prototype.toMillis=Unit$1.prototype.toMilis=function(){return this.to(Unit$1.mBTC)},Unit$1.prototype.toMicros=Unit$1.prototype.toBits=function(){return this.to(Unit$1.bits)},Unit$1.prototype.toSatoshis=function(){return this.to(Unit$1.satoshis)},Unit$1.prototype.atRate=function(t){return this.to(t)},Unit$1.prototype.toString=function(){return this.satoshis+" satoshis"},Unit$1.prototype.toObject=Unit$1.prototype.toJSON=function t(){return{amount:this.BTC,code:Unit$1.BTC}},Unit$1.prototype.inspect=function(){return"<Unit: "+this.toString()+">"};var unit=Unit$1,unspentoutput,hasRequiredUnspentoutput;function requireUnspentoutput(){if(hasRequiredUnspentoutput)return unspentoutput;hasRequiredUnspentoutput=1;var t=lodashExports,e=preconditions,a=js,u=requireScript(),d=requireAddress(),c=unit;function l(m){if(!(this instanceof l))return new l(m);e.checkArgument(t.isObject(m),"Must provide an object from where to extract data");var I=m.address?new d(m.address):void 0,O=m.txid?m.txid:m.txId;if(!O||!a.isHexaString(O)||O.length>64)throw new Error("Invalid TXID in object",m);var T=t.isUndefined(m.vout)?m.outputIndex:m.vout;if(!t.isNumber(T))throw new Error("Invalid outputIndex, received "+T);e.checkArgument(!t.isUndefined(m.scriptPubKey)||!t.isUndefined(m.script),"Must provide the scriptPubKey for that output!");var C=new u(m.scriptPubKey||m.script);e.checkArgument(!t.isUndefined(m.amount)||!t.isUndefined(m.satoshis),"Must provide an amount for the output");var j=t.isUndefined(m.amount)?m.satoshis:new c.fromBTC(m.amount).toSatoshis();e.checkArgument(t.isNumber(j),"Amount must be a number"),a.defineImmutable(this,{address:I,txId:O,outputIndex:T,script:C,satoshis:j})}return l.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"},l.prototype.toString=function(){return this.txId+":"+this.outputIndex},l.fromObject=function(m){return new l(m)},l.prototype.toObject=l.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:c.fromSatoshis(this.satoshis).toBTC()}},unspentoutput=l,unspentoutput}var transaction,hasRequiredTransaction$1;function requireTransaction$1(){if(hasRequiredTransaction$1)return transaction;hasRequiredTransaction$1=1;var t=lodashExports,e=preconditions,a=require$$1$4,u=Buffer$N.compare||requireBufferCompare(),d=errorsExports,c=bufferExports,l=js,m=bufferreader,I=bufferwriter,O=hashExports,T=signature$1,C=requireSighash(),j=requireSighashwitness(),F=requireAddress(),U=requireUnspentoutput(),Z=requireInput(),J=Z.PublicKeyHash,X=Z.PublicKey,Q=Z.MultiSigScriptHash,te=Z.MultiSig,se=requireOutput(),pe=requireScript(),me=requirePrivatekey(),Ee=bn$1;function V(w,P){if(!(this instanceof V))return new V(w);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,w){if(w instanceof V)return V.shallowCopy(w);if(l.isHexa(w))this.fromString(w);else if(c.isBuffer(w))this.fromBuffer(w);else if(t.isObject(w))this.fromObject(w,P);else throw new d.InvalidArgument("Must provide an object or string to deserialize a transaction")}else this._newTransaction()}var ae=2,ne=0,M=1e6;V.DUST_AMOUNT=546,V.FEE_SECURITY_MARGIN=150,V.MAX_MONEY=21e6*1e8,V.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,V.NLOCKTIME_MAX_VALUE=4294967295,V.FEE_PER_KB=1e5,V.CHANGE_OUTPUT_MAX_SIZE=62,V.MAXIMUM_EXTRA_SIZE=26,V.shallowCopy=function(w){var P=new V(w.toBuffer());return P};var v={configurable:!1,enumerable:!0,get:function(){return this._hash=new m(this._getHash()).readReverse().toString("hex"),this._hash}},S={configurable:!1,enumerable:!0,get:function(){return new m(this._getWitnessHash()).readReverse().toString("hex")}};Object.defineProperty(V.prototype,"witnessHash",S),Object.defineProperty(V.prototype,"hash",v),Object.defineProperty(V.prototype,"id",v);var y={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};return Object.defineProperty(V.prototype,"inputAmount",y),y.get=function(){return this._getOutputAmount()},Object.defineProperty(V.prototype,"outputAmount",y),Object.defineProperty(V.prototype,"size",{configurable:!1,enumerable:!1,get:function(){return this._calculateSize()}}),Object.defineProperty(V.prototype,"vsize",{configurable:!1,enumerable:!1,get:function(){return this._calculateVSize()}}),Object.defineProperty(V.prototype,"weight",{configurable:!1,enumerable:!1,get:function(){return this._calculateWeight()}}),V.prototype._getHash=function(){return O.sha256sha256(this.toBuffer(!0))},V.prototype._getWitnessHash=function(){return O.sha256sha256(this.toBuffer(!1))},V.prototype.serialize=function(w){return w===!0||w&&w.disableAll?this.uncheckedSerialize():this.checkedSerialize(w)},V.prototype.uncheckedSerialize=V.prototype.toString=function(){return this.toBuffer().toString("hex")},V.prototype.checkedSerialize=function(w){var P=this.getSerializationError(w);if(P)throw P.message+=" - For more information please see: https://github.com/bitpay/bitcore/blob/master/packages/bitcore-lib/docs/transaction.md#serialization-checks",P;return this.uncheckedSerialize()},V.prototype.invalidSatoshis=function(){for(var w=!1,P=0;P<this.outputs.length;P++)this.outputs[P].invalidSatoshis()&&(w=!0);return w},V.prototype.getSerializationError=function(w){if(w=w||{},this.invalidSatoshis())return new d.Transaction.InvalidSatoshis;var P=this._getUnspentValue(),L;return P<0?w.disableMoreOutputThanInput||(L=new d.Transaction.InvalidOutputAmountSum):L=this._hasFeeError(w,P),L||this._hasDustOutputs(w)||this._isMissingSignatures(w)},V.prototype._hasFeeError=function(w,P){if(this._fee!=null&&this._fee!==P)return new d.Transaction.FeeError.Different("Unspent value is "+P+" but specified fee is "+this._fee);if(!w.disableLargeFees){var L=Math.floor(V.FEE_SECURITY_MARGIN*this._estimateFee());if(P>L)return this._missingChange()?new d.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new d.Transaction.FeeError.TooLarge("expected less than "+L+" but got "+P)}if(!w.disableSmallFees){var N=Math.ceil(this._estimateFee()/V.FEE_SECURITY_MARGIN);if(P<N)return new d.Transaction.FeeError.TooSmall("expected more than "+N+" but got "+P)}},V.prototype._missingChange=function(){return!this._changeScript},V.prototype._hasDustOutputs=function(w){if(!w.disableDustOutputs){var P,L;for(P in this.outputs)if(L=this.outputs[P],L.satoshis<V.DUST_AMOUNT&&!L.script.isDataOut())return new d.Transaction.DustOutputs}},V.prototype._isMissingSignatures=function(w){if(!w.disableIsFullySigned&&!this.isFullySigned())return new d.Transaction.MissingSignatures},V.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"},V.prototype.toBuffer=function(w){var P=new I;return this.toBufferWriter(P,w).toBuffer()},V.prototype.hasWitnesses=function(){for(var w=0;w<this.inputs.length;w++)if(this.inputs[w].hasWitnesses())return!0;return!1},V.prototype.toBufferWriter=function(w,P){w.writeInt32LE(this.version);const L=this.hasWitnesses();L&&!P&&w.write(Buffer$N.from("0001","hex")),w.writeVarintNum(this.inputs?this.inputs.length:0);for(const N of this.inputs||[])N.toBufferWriter(w);w.writeVarintNum(this.outputs?this.outputs.length:0);for(const N of this.outputs||[])N.toBufferWriter(w);if(L&&!P)for(const N of this.inputs){const E=N.getWitnesses();w.writeVarintNum(E.length);for(let A=0;A<E.length;A++)w.writeVarintNum(E[A].length),w.write(E[A])}return w.writeUInt32LE(this.nLockTime),w},V.prototype.fromBuffer=function(w){var P=new m(w);return this.fromBufferReader(P)},V.prototype.fromBufferReader=function(w){e.checkArgument(!w.finished(),"No transaction data received"),this.version=w.readInt32LE();var P=w.readVarintNum(),L=!1;P===0&&w.buf[w.pos]!==0&&(w.pos+=1,L=!0,P=w.readVarintNum());for(var N=0;N<P;N++){var E=Z.fromBufferReader(w);this.inputs.push(E)}for(var A=w.readVarintNum(),D=0;D<A;D++)this.outputs.push(se.fromBufferReader(w));if(L)for(var H=0;H<P;H++){for(var Y=w.readVarintNum(),le=[],_e=0;_e<Y;_e++){var he=w.readVarintNum(),fe=w.read(he);le.push(fe)}this.inputs[H].setWitnesses(le)}return this.nLockTime=w.readUInt32LE(),this},V.prototype.toObject=V.prototype.toJSON=function(){var P=[];this.inputs.forEach(function(E){P.push(E.toObject())});var L=[];this.outputs.forEach(function(E){L.push(E.toObject())});var N={hash:this.hash,version:this.version,inputs:P,outputs:L,nLockTime:this.nLockTime};return this._changeScript&&(N.changeScript=this._changeScript.toString()),this._changeIndex!=null&&(N.changeIndex=this._changeIndex),this._fee!=null&&(N.fee=this._fee),N},V.prototype.fromObject=function(P,L){e.checkArgument(t.isObject(P)||P instanceof V);var N;P instanceof V?N=P.toObject():N=P;for(const D of N.inputs||[]){if(!D.output||!D.output.script){this.uncheckedAddInput(new Z(D));continue}var E=new pe(D.output.script),A;if((E.isScriptHashOut()||E.isWitnessScriptHashOut())&&D.publicKeys&&D.threshold)A=new Z.MultiSigScriptHash(D,D.publicKeys,D.threshold,D.signatures,L);else if(E.isPublicKeyHashOut()||E.isWitnessPublicKeyHashOut()||E.isScriptHashOut())A=new Z.PublicKeyHash(D);else if(E.isPublicKeyOut())A=new Z.PublicKey(D);else throw new d.Transaction.Input.UnsupportedScript(D.output.script);this.addInput(A)}for(const D of N.outputs||[])this.addOutput(new se(D));return N.changeIndex&&(this._changeIndex=N.changeIndex),N.changeScript&&(this._changeScript=new pe(N.changeScript)),N.fee&&(this._fee=N.fee),this.nLockTime=N.nLockTime,this.version=N.version,this._checkConsistency(P),this},V.prototype._checkConsistency=function(w){this._changeIndex!=null&&(e.checkState(this._changeScript,"Change script is expected."),e.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),e.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),w&&w.hash&&e.checkState(w.hash===this.hash,"Hash in object does not match transaction hash.")},V.prototype.lockUntilDate=function(w){if(e.checkArgument(w),!isNaN(w)&&w<V.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new d.Transaction.LockTimeTooEarly;t.isDate(w)&&(w=w.getTime()/1e3);for(var P=0;P<this.inputs.length;P++)this.inputs[P].sequenceNumber===Z.DEFAULT_SEQNUMBER&&(this.inputs[P].sequenceNumber=Z.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=w,this},V.prototype.lockUntilBlockHeight=function(w){if(e.checkArgument(!isNaN(w)),w>=V.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new d.Transaction.BlockHeightTooHigh;if(w<0)throw new d.Transaction.NLockTimeOutOfRange;for(var P=0;P<this.inputs.length;P++)this.inputs[P].sequenceNumber===Z.DEFAULT_SEQNUMBER&&(this.inputs[P].sequenceNumber=Z.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=w,this},V.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<V.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null},V.prototype.fromString=function(w){this.fromBuffer(a.Buffer.from(w,"hex"))},V.prototype._newTransaction=function(){this.version=ae,this.nLockTime=ne},V.prototype.from=function(w,P,L,N){if(Array.isArray(w)){for(const A of w)this.from(A,P,L,N);return this}return this.inputs.some(function(A){return A.prevTxId.toString("hex")===w.txId&&A.outputIndex===w.outputIndex})?this:(P&&L?this._fromMultisigUtxo(w,P,L,N):this._fromNonP2SH(w),this)},V.prototype.associateInputs=function(w,P,L,N){let E=[];for(let A of w){const D=this.inputs.findIndex(H=>H.prevTxId.toString("hex")===A.txId&&H.outputIndex===A.outputIndex);if(E.push(D),D>=0){const H=this.inputs[D].sequenceNumber;this.inputs[D]=this._getInputFrom(A,P,L,N),this.inputs[D].sequenceNumber=H}}return E},V.prototype._selectInputType=function(w,P,L){var N;return w=new U(w),P&&L?w.script.isMultisigOut()?N=te:(w.script.isScriptHashOut()||w.script.isWitnessScriptHashOut())&&(N=Q):w.script.isPublicKeyHashOut()||w.script.isWitnessPublicKeyHashOut()||w.script.isScriptHashOut()?N=J:w.script.isPublicKeyOut()?N=X:N=Z,N},V.prototype._getInputFrom=function(w,P,L,N){w=new U(w);const E=this._selectInputType(w,P,L),A={output:new se({script:w.script,satoshis:w.satoshis}),prevTxId:w.txId,outputIndex:w.outputIndex,sequenceNumber:w.sequenceNumber,script:pe.empty()};let D=P&&L?[P,L,!1,N]:[];return new E(A,...D)},V.prototype._fromNonP2SH=function(w){const P=this._getInputFrom(w);this.addInput(P)},V.prototype._fromMultisigUtxo=function(w,P,L,N){e.checkArgument(L<=P.length,"Number of required signatures must be greater than the number of public keys");const E=this._getInputFrom(w,P,L,N);this.addInput(E)},V.prototype.addInput=function(w,P,L){if(e.checkArgumentType(w,Z,"input"),!w.output&&(P==null||L==null))throw new d.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return!w.output&&P&&L!=null&&(P=P instanceof pe?P:new pe(P),e.checkArgumentType(L,"number","satoshis"),w.output=new se({script:P,satoshis:L})),this.uncheckedAddInput(w)},V.prototype.uncheckedAddInput=function(w){return e.checkArgumentType(w,Z,"input"),this.inputs.push(w),this._inputAmount=void 0,this._updateChangeOutput(),this},V.prototype.hasAllUtxoInfo=function(){return this.inputs.every(function(w){return!!w.output})},V.prototype.fee=function(w){return e.checkArgument(!isNaN(w),"amount must be a number"),this._fee=w,this._updateChangeOutput(),this},V.prototype.feePerKb=function(w){return e.checkArgument(!isNaN(w),"amount must be a number"),this._feePerKb=w,this._updateChangeOutput(),this},V.prototype.feePerByte=function(w){return e.checkArgument(!isNaN(w),"amount must be a number"),this._feePerByte=w,this._updateChangeOutput(),this},V.prototype.change=function(w){return e.checkArgument(w,"address is required"),this._changeScript=pe.fromAddress(w),this._updateChangeOutput(),this},V.prototype.getChangeOutput=function(){return this._changeIndex!=null?this.outputs[this._changeIndex]:null},V.prototype.to=function(w,P){if(Array.isArray(w)){for(const L of w)this.to(L.address,L.satoshis);return this}return e.checkArgument(l.isNaturalNumber(P),"Amount is expected to be a positive integer"),this.addOutput(new se({script:pe(new F(w)),satoshis:P})),this},V.prototype.addData=function(w){return this.addOutput(new se({script:pe.buildDataOut(w),satoshis:0})),this},V.prototype.addOutput=function(w){return e.checkArgumentType(w,se,"output"),this._addOutput(w),this._updateChangeOutput(),this},V.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this},V.prototype._addOutput=function(w){this.outputs.push(w),this._outputAmount=void 0},V.prototype._getOutputAmount=function(){if(this._outputAmount==null){var w=this;this._outputAmount=0;for(const P of this.outputs||[])w._outputAmount+=P.satoshis}return this._outputAmount},V.prototype._getInputAmount=function(){return this._inputAmount==null&&(this._inputAmount=t.sumBy(this.inputs,function(w){if(w.output==null)throw new d.Transaction.Input.MissingPreviousOutput;return w.output.satoshis})),this._inputAmount},V.prototype._updateChangeOutput=function(w){if(this._changeScript){w||this._clearSignatures(),this._changeIndex!=null&&this._removeOutput(this._changeIndex);var P=this._getUnspentValue(),L=this.getFee(),N=P-L;N>V.DUST_AMOUNT?(this._changeIndex=this.outputs.length,this._addOutput(new se({script:this._changeScript,satoshis:N}))):this._changeIndex=void 0}},V.prototype.getFee=function(){return this.isCoinbase()?0:this._fee!=null?this._fee:this._changeScript?this._estimateFee():this._getUnspentValue()},V.prototype._estimateFee=function(){const w=this._estimateSize(),P=this._getUnspentValue(),L=this._feePerByte||(this._feePerKb||V.FEE_PER_KB)/1e3;function N(D){return D*L}const E=Math.ceil(N(w)),A=Math.ceil(N(w)+N(this._estimateSizeOfChangeOutput()));return!this._changeScript||P<=A?E:A},V.prototype._estimateSizeOfChangeOutput=function(){if(!this._changeScript)return 0;const w=this._changeScript.toBuffer().length;return 8+I.varintBufNum(w).length+w},V.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},V.prototype._clearSignatures=function(){for(const w of this.inputs||[])w.clearSignatures()},V.prototype._estimateSize=function(){let w=4;this.hasWitnesses()&&(w+=.5),w+=I.varintBufNum(this.inputs.length).length;for(const P of this.inputs||[])w+=P._estimateSize();w+=I.varintBufNum(this.outputs.length).length;for(const P of this.outputs||[])w+=P.calculateSize();return w+=4,Math.ceil(w)},V.prototype._calculateSize=function(){return this.toBuffer().length},V.prototype._calculateVSize=function(w){const P=this._calculateWeight()/4;return w?P:Math.ceil(P)},V.prototype._calculateWeight=function(){return this.toBuffer(!0).length*3+this.toBuffer(!1).length},V.prototype._removeOutput=function(w){var P=this.outputs[w];this.outputs=t.without(this.outputs,P),this._outputAmount=void 0},V.prototype.removeOutput=function(w){this._removeOutput(w),this._updateChangeOutput()},V.prototype.sort=function(){return this.sortInputs(function(w){var P=Array.prototype.concat.apply([],w);let L=0;return P.forEach(N=>{N.i=L++}),P.sort(function(N,E){return u(N.prevTxId,E.prevTxId)||N.outputIndex-E.outputIndex||N.i-E.i}),P}),this.sortOutputs(function(w){var P=Array.prototype.concat.apply([],w);let L=0;return P.forEach(N=>{N.i=L++}),P.sort(function(N,E){return N.satoshis-E.satoshis||u(N.script.toBuffer(),E.script.toBuffer())||N.i-E.i}),P}),this},V.prototype.shuffleOutputs=function(){return this.sortOutputs(t.shuffle)},V.prototype.sortOutputs=function(w){var P=w(this.outputs);return this._newOutputOrder(P)},V.prototype.sortInputs=function(w){return this.inputs=w(this.inputs),this._clearSignatures(),this},V.prototype._newOutputOrder=function(w){var P=this.outputs.length!==w.length||t.difference(this.outputs,w).length!==0;if(P)throw new d.Transaction.InvalidSorting;if(this._changeIndex!=null){var L=this.outputs[this._changeIndex];this._changeIndex=w.indexOf(L)}return this.outputs=w,this},V.prototype.removeInput=function(w,P){var L;if(!P&&!isNaN(w)?L=w:L=this.inputs.findIndex(function(E){return E.prevTxId.toString("hex")===w&&E.outputIndex===P}),L<0||L>=this.inputs.length)throw new d.Transaction.InvalidIndex(L,this.inputs.length);var N=this.inputs[L];this.inputs=t.without(this.inputs,N),this._inputAmount=void 0,this._updateChangeOutput()},V.prototype.sign=function(w,P,L){if(e.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction."),Array.isArray(w)){for(const N of w)this.sign(N,P,L);return this}for(const N of this.getSignatures(w,P,L))this.applySignature(N,L);return this},V.prototype.getSignatures=function(w,P,L){w=new me(w),P=P||T.SIGHASH_ALL;var N=this,E=[],A=O.sha256ripemd160(w.publicKey.toBuffer());for(let D=0;D<this.inputs.length;D++){const H=this.inputs[D];for(const Y of H.getSignatures(N,w,D,P,A,L))E.push(Y)}return E},V.prototype.applySignature=function(w,P){return this.inputs[w.inputIndex].addSignature(this,w,P),this},V.prototype.isFullySigned=function(){for(const w of this.inputs||[])if(w.isFullySigned===Z.prototype.isFullySigned)throw new d.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs.every(function(w){return w.isFullySigned()})},V.prototype.isValidSignature=function(w,P){if(this.inputs[w.inputIndex].isValidSignature===Z.prototype.isValidSignature)throw new d.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[w.inputIndex].isValidSignature(this,w,P)},V.prototype.verifySignature=function(w,P,L,N,E,A,D){if(E==null&&(E=0),E===1){var H=N.toBuffer(),Y=new I;Y.writeVarintNum(H.length),Y.write(H);var le;A?(e.checkState(l.isNaturalNumber(A)),le=new I().writeUInt64LEBN(new Ee(A)).toBuffer()):le=this.inputs[L].getSatoshisBuffer();var _e=j.verify(this,w,P,L,Y.toBuffer(),le,D);return _e}return C.verify(this,w,P,L,N,D)},V.prototype.verify=function(){if(this.inputs.length===0)return"transaction txins empty";if(this.outputs.length===0)return"transaction txouts empty";for(var w=new Ee(0),P=0;P<this.outputs.length;P++){var L=this.outputs[P];if(L.invalidSatoshis())return"transaction txout "+P+" satoshis is invalid";if(L._satoshisBN.gt(new Ee(V.MAX_MONEY,10)))return"transaction txout "+P+" greater than MAX_MONEY";if(w=w.add(L._satoshisBN),w.gt(new Ee(V.MAX_MONEY)))return"transaction txout "+P+" total output greater than MAX_MONEY"}if(this.toBuffer().length>M)return"transaction over the maximum block size";var N={};for(P=0;P<this.inputs.length;P++){var E=this.inputs[P],A=E.prevTxId+":"+E.outputIndex;if(N[A]!=null)return"transaction input "+P+" duplicate input";N[A]=!0}var D=this.isCoinbase();if(D){var H=this.inputs[0]._scriptBuffer;if(H.length<2||H.length>100)return"coinbase transaction script size invalid"}else for(P=0;P<this.inputs.length;P++)if(this.inputs[P].isNull())return"transaction input "+P+" has null input";return!0},V.prototype.isCoinbase=function(){return this.inputs.length===1&&this.inputs[0].isNull()},V.prototype.isRBF=function(){for(var w=0;w<this.inputs.length;w++){var P=this.inputs[w];if(P.sequenceNumber<Z.MAXINT-1)return!0}return!1},V.prototype.enableRBF=function(){for(var w=0;w<this.inputs.length;w++){var P=this.inputs[w];P.sequenceNumber>=Z.MAXINT-1&&(P.sequenceNumber=Z.DEFAULT_RBF_SEQNUMBER)}return this},V.prototype.setVersion=function(w){return e.checkArgument(l.isNaturalNumber(w)&&w<=ae,"Wrong version number"),this.version=w,this},transaction=V,transaction}var hasRequiredTransaction;function requireTransaction(){return hasRequiredTransaction||(hasRequiredTransaction=1,transaction$1.exports=requireTransaction$1(),transaction$1.exports.Input=requireInput(),transaction$1.exports.Output=requireOutput(),transaction$1.exports.UnspentOutput=requireUnspentoutput(),transaction$1.exports.Signature=requireSignature(),transaction$1.exports.Sighash=requireSighash(),transaction$1.exports.SighashWitness=requireSighashwitness()),transaction$1.exports}var interpreter,hasRequiredInterpreter;function requireInterpreter(){if(hasRequiredInterpreter)return interpreter;hasRequiredInterpreter=1;var t=lodashExports,e=requireScript$1(),a=opcode,u=bn$1,d=hashExports,c=signature$1,l=requirePublickey(),m=function I(O){if(!(this instanceof I))return new I(O);O?(this.initialize(),this.set(O)):this.initialize()};return m.SIGVERSION_BASE=0,m.SIGVERSION_WITNESS_V0=1,m.SIGVERSION_TAPROOT=2,m.SIGVERSION_TAPSCRIPT=3,m.prototype.verifyWitnessProgram=function(I,O,T,C,j){var F=new e,U=[];if(I===0)if(O.length===32){if(T.length===0)return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY",!1;var Z=T[T.length-1];F=new e(Z);var J=d.sha256(Z);if(J.toString("hex")!==O.toString("hex"))return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1;U=T.slice(0,-1)}else if(O.length===20){if(T.length!==2)return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH",!1;F.add(a.OP_DUP),F.add(a.OP_HASH160),F.add(O),F.add(a.OP_EQUALVERIFY),F.add(a.OP_CHECKSIG),U=T}else return this.errstr="SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH",!1;else return j&m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM?(this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM",!1):!0;if(this.initialize(),this.set({script:F,stack:U,sigversion:m.SIGVERSION_WITNESS_V0,satoshis:C,flags:j}),!this.evaluate())return!1;if(this.stack.length!==1)return this.errstr="SCRIPT_ERR_EVAL_FALSE",!1;var X=this.stack[this.stack.length-1];return m.castToBool(X)?!0:(this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1)},m.prototype.verify=function(I,O,T,C,j,F,U){var Z=requireTransaction();t.isUndefined(T)&&(T=new Z),t.isUndefined(C)&&(C=0),t.isUndefined(j)&&(j=0),t.isUndefined(F)&&(F=null),t.isUndefined(U)&&(U=0),this.set({script:I,tx:T,nin:C,sigversion:m.SIGVERSION_BASE,satoshis:0,flags:j});var J;if(j&m.SCRIPT_VERIFY_SIGPUSHONLY&&!I.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;j&m.SCRIPT_VERIFY_P2SH&&(J=this.stack.slice());var X=this.stack;if(this.initialize(),this.set({script:O,stack:X,tx:T,nin:C,flags:j}),!this.evaluate())return!1;if(this.stack.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var Q=this.stack[this.stack.length-1];if(!m.castToBool(Q))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;var te=!1;if(j&m.SCRIPT_VERIFY_WITNESS){var se={};if(O.isWitnessProgram(se)&&(te=!0,I.toBuffer().length!==0||!this.verifyWitnessProgram(se.version,se.program,F,U,this.flags)))return!1}if(j&m.SCRIPT_VERIFY_P2SH&&O.isScriptHashOut()){if(!I.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(J.length===0)throw new Error("internal error - stack copy empty");var pe=J[J.length-1],me=e.fromBuffer(pe);if(J.pop(),this.initialize(),this.set({script:me,stack:J,tx:T,nin:C,flags:j}),!this.evaluate())return!1;if(J.length===0)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!m.castToBool(J[J.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1;if(j&m.SCRIPT_VERIFY_WITNESS){var Ee={};if(me.isWitnessProgram(Ee)){te=!0;var V=new e;if(V.add(me.toBuffer()),I.toHex()!==V.toHex())return this.errstr="SCRIPT_ERR_WITNESS_MALLEATED_P2SH",!1;if(!this.verifyWitnessProgram(Ee.version,Ee.program,F,U,this.flags))return!1;X=[X[0]]}}}if(this.flags&m.SCRIPT_VERIFY_CLEANSTACK){if(!(this.flags&m.SCRIPT_VERIFY_P2SH))throw"flags & SCRIPT_VERIFY_P2SH";if(J.length!=1)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return this.flags&m.SCRIPT_VERIFY_WITNESS&&!te&&F.length>0?(this.errstr="SCRIPT_ERR_WITNESS_UNEXPECTED",!1):!0},interpreter=m,m.prototype.initialize=function(I){this.stack=[],this.altstack=[],this.pc=0,this.satoshis=0,this.sigversion=m.SIGVERSION_BASE,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},m.prototype.set=function(I){this.script=I.script||this.script,this.tx=I.tx||this.tx,this.nin=typeof I.nin<"u"?I.nin:this.nin,this.stack=I.stack||this.stack,this.altstack=I.altack||this.altstack,this.pc=typeof I.pc<"u"?I.pc:this.pc,this.pbegincodehash=typeof I.pbegincodehash<"u"?I.pbegincodehash:this.pbegincodehash,this.sigversion=typeof I.sigversion<"u"?I.sigversion:this.sigversion,this.satoshis=typeof I.satoshis<"u"?I.satoshis:this.satoshis,this.nOpCount=typeof I.nOpCount<"u"?I.nOpCount:this.nOpCount,this.vfExec=I.vfExec||this.vfExec,this.errstr=I.errstr||this.errstr,this.flags=typeof I.flags<"u"?I.flags:this.flags},m.true=Buffer$N.from([1]),m.false=Buffer$N.from([]),m.MAX_SCRIPT_ELEMENT_SIZE=520,m.LOCKTIME_THRESHOLD=5e8,m.LOCKTIME_THRESHOLD_BN=new u(m.LOCKTIME_THRESHOLD),m.SCRIPT_VERIFY_NONE=0,m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM=4096,m.SCRIPT_VERIFY_P2SH=1,m.SCRIPT_VERIFY_STRICTENC=2,m.SCRIPT_VERIFY_DERSIG=4,m.SCRIPT_VERIFY_LOW_S=8,m.SCRIPT_VERIFY_NULLDUMMY=16,m.SCRIPT_VERIFY_SIGPUSHONLY=32,m.SCRIPT_VERIFY_MINIMALDATA=64,m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,m.SCRIPT_VERIFY_CLEANSTACK=256,m.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,m.SCRIPT_VERIFY_WITNESS=1024,m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=2048,m.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024,m.SCRIPT_VERIFY_MINIMALIF=8192,m.SCRIPT_VERIFY_NULLFAIL=16384,m.SCRIPT_VERIFY_WITNESS_PUBKEYTYPE=32768,m.SCRIPT_ENABLE_SIGHASH_FORKID=65536,m.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17,m.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18,m.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,m.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,m.SEQUENCE_LOCKTIME_MASK=65535,m.castToBool=function(I){for(var O=0;O<I.length;O++)if(I[O]!==0)return!(O===I.length-1&&I[O]===128);return!1},m.prototype.checkSignatureEncoding=function(I){var O;if(I.length==0)return!0;if(this.flags&(m.SCRIPT_VERIFY_DERSIG|m.SCRIPT_VERIFY_LOW_S|m.SCRIPT_VERIFY_STRICTENC)&&!c.isTxDER(I))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if(this.flags&m.SCRIPT_VERIFY_LOW_S){if(O=c.fromTxFormat(I),!O.hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if(this.flags&m.SCRIPT_VERIFY_STRICTENC&&(O=c.fromTxFormat(I),!O.hasDefinedHashtype()))return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;return!0},m.prototype.checkPubkeyEncoding=function(I){return this.flags&m.SCRIPT_VERIFY_STRICTENC&&!l.isValid(I)?(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1):this.flags&m.SCRIPT_VERIFY_WITNESS_PUBKEYTYPE&&this.sigversion==m.SIGVERSION_WITNESS_V0&&!l.fromBuffer(I).compressed?(this.errstr="SCRIPT_ERR_WITNESS_PUBKEYTYPE",!1):!0},m.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){var I=this.step();if(!I)return!1}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(O){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+O,!1}return this.vfExec.length>0?(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1):!0},m.prototype.checkLockTime=function(I){return!(!(this.tx.nLockTime<m.LOCKTIME_THRESHOLD&&I.lt(m.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=m.LOCKTIME_THRESHOLD&&I.gte(m.LOCKTIME_THRESHOLD_BN))||I.gt(new u(this.tx.nLockTime))||!this.tx.inputs[this.nin].isFinal())},m.prototype.checkSequence=function(I){var O=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2||O&SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var T=m.SEQUENCE_LOCKTIME_TYPE_FLAG|m.SEQUENCE_LOCKTIME_MASK,C=new u(O&T),j=I.and(T),F=new u(m.SEQUENCE_LOCKTIME_TYPE_FLAG);return!(!(C.lt(F)&&j.lt(F)||C.gte(F)&&j.gte(F))||j.gt(C))},m.prototype.step=function(){var I=(this.flags&m.SCRIPT_VERIFY_MINIMALDATA)!==0,O=this.vfExec.indexOf(!1)===-1,T,C,j,F,U,Z,J,X,Q,te,se,pe,me,Ee,V,ae,ne,M=this.script.chunks[this.pc];this.pc++;var v=M.opcodenum;if(t.isUndefined(v))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(M.buf&&M.buf.length>m.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(v>a.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(v===a.OP_CAT||v===a.OP_SUBSTR||v===a.OP_LEFT||v===a.OP_RIGHT||v===a.OP_INVERT||v===a.OP_AND||v===a.OP_OR||v===a.OP_XOR||v===a.OP_2MUL||v===a.OP_2DIV||v===a.OP_MUL||v===a.OP_DIV||v===a.OP_MOD||v===a.OP_LSHIFT||v===a.OP_RSHIFT)return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(O&&0<=v&&v<=a.OP_PUSHDATA4){if(I&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(!M.buf)this.stack.push(m.false);else{if(M.len!==M.buf.length)throw new Error("Length of push value not equal to length of data");this.stack.push(M.buf)}}else if(O||a.OP_IF<=v&&v<=a.OP_ENDIF)switch(v){case a.OP_1NEGATE:case a.OP_1:case a.OP_2:case a.OP_3:case a.OP_4:case a.OP_5:case a.OP_6:case a.OP_7:case a.OP_8:case a.OP_9:case a.OP_10:case a.OP_11:case a.OP_12:case a.OP_13:case a.OP_14:case a.OP_15:case a.OP_16:U=v-(a.OP_1-1),T=new u(U).toScriptNumBuffer(),this.stack.push(T);break;case a.OP_NOP:break;case a.OP_NOP2:case a.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&m.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var S=u.fromScriptNumBuffer(this.stack[this.stack.length-1],I,5);if(S.lt(new u(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(S))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case a.OP_NOP3:case a.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&m.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var y=u.fromScriptNumBuffer(this.stack[this.stack.length-1],I,5);if(y.lt(new u(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(y&m.SEQUENCE_LOCKTIME_DISABLE_FLAG)break;if(!this.checkSequence(y))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case a.OP_NOP1:case a.OP_NOP4:case a.OP_NOP5:case a.OP_NOP6:case a.OP_NOP7:case a.OP_NOP8:case a.OP_NOP9:case a.OP_NOP10:if(this.flags&m.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case a.OP_IF:case a.OP_NOTIF:{if(ae=!1,O){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(T=this.stack[this.stack.length-1],this.flags&m.SCRIPT_VERIFY_MINIMALIF){if(T=this.stack[this.stack.length-1],T.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(T.length==1&&T[0]!=1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1}ae=m.castToBool(T),v===a.OP_NOTIF&&(ae=!ae),this.stack.pop()}this.vfExec.push(ae)}break;case a.OP_ELSE:{if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1]}break;case a.OP_ENDIF:{if(this.vfExec.length===0)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop()}break;case a.OP_VERIFY:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(T=this.stack[this.stack.length-1],ae=m.castToBool(T),ae)this.stack.pop();else return this.errstr="SCRIPT_ERR_VERIFY",!1}break;case a.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case a.OP_TOALTSTACK:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop())}break;case a.OP_FROMALTSTACK:{if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop())}break;case a.OP_2DROP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop()}break;case a.OP_2DUP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;C=this.stack[this.stack.length-2],j=this.stack[this.stack.length-1],this.stack.push(C),this.stack.push(j)}break;case a.OP_3DUP:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;C=this.stack[this.stack.length-3],j=this.stack[this.stack.length-2];var w=this.stack[this.stack.length-1];this.stack.push(C),this.stack.push(j),this.stack.push(w)}break;case a.OP_2OVER:{if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;C=this.stack[this.stack.length-4],j=this.stack[this.stack.length-3],this.stack.push(C),this.stack.push(j)}break;case a.OP_2ROT:{if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;F=this.stack.splice(this.stack.length-6,2),this.stack.push(F[0]),this.stack.push(F[1])}break;case a.OP_2SWAP:{if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;F=this.stack.splice(this.stack.length-4,2),this.stack.push(F[0]),this.stack.push(F[1])}break;case a.OP_IFDUP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;T=this.stack[this.stack.length-1],ae=m.castToBool(T),ae&&this.stack.push(T)}break;case a.OP_DEPTH:T=new u(this.stack.length).toScriptNumBuffer(),this.stack.push(T);break;case a.OP_DROP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop()}break;case a.OP_DUP:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-1])}break;case a.OP_NIP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1)}break;case a.OP_OVER:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(this.stack[this.stack.length-2])}break;case a.OP_PICK:case a.OP_ROLL:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(T=this.stack[this.stack.length-1],X=u.fromScriptNumBuffer(T,I),U=X.toNumber(),this.stack.pop(),U<0||U>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;T=this.stack[this.stack.length-U-1],v===a.OP_ROLL&&this.stack.splice(this.stack.length-U-1,1),this.stack.push(T)}break;case a.OP_ROT:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;Z=this.stack[this.stack.length-3],J=this.stack[this.stack.length-2];var P=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=J,this.stack[this.stack.length-2]=P,this.stack[this.stack.length-1]=Z}break;case a.OP_SWAP:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;Z=this.stack[this.stack.length-2],J=this.stack[this.stack.length-1],this.stack[this.stack.length-2]=J,this.stack[this.stack.length-1]=Z}break;case a.OP_TUCK:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,this.stack[this.stack.length-1])}break;case a.OP_SIZE:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;X=new u(this.stack[this.stack.length-1].length),this.stack.push(X.toScriptNumBuffer())}break;case a.OP_EQUAL:case a.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;C=this.stack[this.stack.length-2],j=this.stack[this.stack.length-1];var L=C.toString("hex")===j.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(L?m.true:m.false),v===a.OP_EQUALVERIFY)if(L)this.stack.pop();else return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1}break;case a.OP_1ADD:case a.OP_1SUB:case a.OP_NEGATE:case a.OP_ABS:case a.OP_NOT:case a.OP_0NOTEQUAL:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(T=this.stack[this.stack.length-1],X=u.fromScriptNumBuffer(T,I),v){case a.OP_1ADD:X=X.add(u.One);break;case a.OP_1SUB:X=X.sub(u.One);break;case a.OP_NEGATE:X=X.neg();break;case a.OP_ABS:X.cmp(u.Zero)<0&&(X=X.neg());break;case a.OP_NOT:X=new u((X.cmp(u.Zero)===0)+0);break;case a.OP_0NOTEQUAL:X=new u((X.cmp(u.Zero)!==0)+0);break}this.stack.pop(),this.stack.push(X.toScriptNumBuffer())}break;case a.OP_ADD:case a.OP_SUB:case a.OP_BOOLAND:case a.OP_BOOLOR:case a.OP_NUMEQUAL:case a.OP_NUMEQUALVERIFY:case a.OP_NUMNOTEQUAL:case a.OP_LESSTHAN:case a.OP_GREATERTHAN:case a.OP_LESSTHANOREQUAL:case a.OP_GREATERTHANOREQUAL:case a.OP_MIN:case a.OP_MAX:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(Q=u.fromScriptNumBuffer(this.stack[this.stack.length-2],I),te=u.fromScriptNumBuffer(this.stack[this.stack.length-1],I),X=new u(0),v){case a.OP_ADD:X=Q.add(te);break;case a.OP_SUB:X=Q.sub(te);break;case a.OP_BOOLAND:X=new u((Q.cmp(u.Zero)!==0&&te.cmp(u.Zero)!==0)+0);break;case a.OP_BOOLOR:X=new u((Q.cmp(u.Zero)!==0||te.cmp(u.Zero)!==0)+0);break;case a.OP_NUMEQUAL:X=new u((Q.cmp(te)===0)+0);break;case a.OP_NUMEQUALVERIFY:X=new u((Q.cmp(te)===0)+0);break;case a.OP_NUMNOTEQUAL:X=new u((Q.cmp(te)!==0)+0);break;case a.OP_LESSTHAN:X=new u((Q.cmp(te)<0)+0);break;case a.OP_GREATERTHAN:X=new u((Q.cmp(te)>0)+0);break;case a.OP_LESSTHANOREQUAL:X=new u((Q.cmp(te)<=0)+0);break;case a.OP_GREATERTHANOREQUAL:X=new u((Q.cmp(te)>=0)+0);break;case a.OP_MIN:X=Q.cmp(te)<0?Q:te;break;case a.OP_MAX:X=Q.cmp(te)>0?Q:te;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(X.toScriptNumBuffer()),v===a.OP_NUMEQUALVERIFY)if(m.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case a.OP_WITHIN:{if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;Q=u.fromScriptNumBuffer(this.stack[this.stack.length-3],I),te=u.fromScriptNumBuffer(this.stack[this.stack.length-2],I);var N=u.fromScriptNumBuffer(this.stack[this.stack.length-1],I);ae=te.cmp(Q)<=0&&Q.cmp(N)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(ae?m.true:m.false)}break;case a.OP_RIPEMD160:case a.OP_SHA1:case a.OP_SHA256:case a.OP_HASH160:case a.OP_HASH256:{if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;T=this.stack[this.stack.length-1];var E;v===a.OP_RIPEMD160?E=d.ripemd160(T):v===a.OP_SHA1?E=d.sha1(T):v===a.OP_SHA256?E=d.sha256(T):v===a.OP_HASH160?E=d.sha256ripemd160(T):v===a.OP_HASH256&&(E=d.sha256sha256(T)),this.stack.pop(),this.stack.push(E)}break;case a.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case a.OP_CHECKSIG:case a.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(se=this.stack[this.stack.length-2],pe=this.stack[this.stack.length-1],!this.checkSignatureEncoding(se)||!this.checkPubkeyEncoding(pe))return!1;me=new e().set({chunks:this.script.chunks.slice(this.pbegincodehash)});var A=new e().add(se);me.findAndDelete(A);try{Ee=c.fromTxFormat(se),V=l.fromBuffer(pe,!1),ne=this.tx.verifySignature(Ee,V,this.nin,me,this.sigversion,this.satoshis)}catch{ne=!1}if(!ne&&this.flags&m.SCRIPT_VERIFY_NULLFAIL&&se.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(ne?m.true:m.false),v===a.OP_CHECKSIGVERIFY)if(ne)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case a.OP_CHECKMULTISIG:case a.OP_CHECKMULTISIGVERIFY:{var D=1;if(this.stack.length<D)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var H=u.fromScriptNumBuffer(this.stack[this.stack.length-D],I).toNumber();if(H<0||H>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=H,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var Y=++D;D+=H;var le=H+2;if(this.stack.length<D)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var _e=u.fromScriptNumBuffer(this.stack[this.stack.length-D],I).toNumber();if(_e<0||_e>H)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var he=++D;if(D+=_e,this.stack.length<D)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;me=new e().set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var fe=0;fe<_e;fe++)se=this.stack[this.stack.length-he-fe],me.findAndDelete(new e().add(se));for(ne=!0;ne&&_e>0;){if(se=this.stack[this.stack.length-he],pe=this.stack[this.stack.length-Y],!this.checkSignatureEncoding(se)||!this.checkPubkeyEncoding(pe))return!1;var ve;try{Ee=c.fromTxFormat(se),V=l.fromBuffer(pe,!1),ve=this.tx.verifySignature(Ee,V,this.nin,me,this.sigversion,this.satoshis)}catch{ve=!1}ve&&(he++,_e--),Y++,H--,_e>H&&(ne=!1)}for(;D-- >1;){if(!ne&&this.flags&m.SCRIPT_VERIFY_NULLFAIL&&!le&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;le>0&&le--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&m.SCRIPT_VERIFY_NULLDUMMY&&this.stack[this.stack.length-1].length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(ne?m.true:m.false),v===a.OP_CHECKMULTISIGVERIFY)if(ne)this.stack.pop();else return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0},interpreter}var hasRequiredScript;function requireScript(){return hasRequiredScript||(hasRequiredScript=1,script$1.exports=requireScript$1(),script$1.exports.Interpreter=requireInterpreter()),script$1.exports}var address,hasRequiredAddress;function requireAddress(){if(hasRequiredAddress)return address;hasRequiredAddress=1;var t=lodashExports,e=preconditions,a=errorsExports,u=base58check,d=bech32_1,c=networks_1,l=hashExports,m=js,I=requirePublickey();function O(C,j,F,U){if(!(this instanceof O))return new O(C,j,F);if(t.isArray(C)&&t.isNumber(j))return O.createMultisig(C,j,F,!1,U);if(C instanceof O)return C;if(e.checkArgument(C,"First argument is required, please include address data.","guide/address.html"),j&&!c.get(j))throw new TypeError('Second argument must be "livenet" or "testnet".');if(F&&F!==O.PayToPublicKeyHash&&F!==O.PayToScriptHash&&F!==O.PayToWitnessPublicKeyHash&&F!==O.PayToWitnessScriptHash&&F!==O.PayToTaproot)throw new TypeError('Third argument must be "pubkeyhash", "scripthash", "witnesspubkeyhash", "witnessscripthash", or "taproot".');var Z=this._classifyArguments(C,j,F);return Z.network=Z.network||c.get(j)||c.defaultNetwork,Z.type=Z.type||F||O.PayToPublicKeyHash,m.defineImmutable(this,{hashBuffer:Z.hashBuffer,network:Z.network,type:Z.type}),this}O.prototype._classifyArguments=function(C,j,F){if((C instanceof Buffer$N||C instanceof Uint8Array)&&(C.length===20||C.length===32))return O._transformHash(C,j,F);if((C instanceof Buffer$N||C instanceof Uint8Array)&&C.length>=21)return O._transformBuffer(C,j,F);if(C instanceof I)return O._transformPublicKey(C,j,F);if(C instanceof T)return O._transformScript(C,j);if(typeof C=="string")return O._transformString(C,j,F);if(t.isObject(C))return O._transformObject(C);throw new TypeError("First argument is an unrecognized data format.")},O.PayToPublicKeyHash="pubkeyhash",O.PayToScriptHash="scripthash",O.PayToWitnessPublicKeyHash="witnesspubkeyhash",O.PayToWitnessScriptHash="witnessscripthash",O.PayToTaproot="taproot",O._transformHash=function(C,j,F){var U={};if(!(C instanceof Buffer$N)&&!(C instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(C.length!==20&&C.length!==32)throw new TypeError("Address hashbuffers must be either 20 or 32 bytes.");return U.hashBuffer=C,U.network=c.get(j)||c.defaultNetwork,U.type=F,U},O._transformObject=function(C){return e.checkArgument(C.hash||C.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),e.checkArgument(C.type,"Must provide a `type` property"),{hashBuffer:C.hash?Buffer$N.from(C.hash,"hex"):C.hashBuffer,network:c.get(C.network)||c.defaultNetwork,type:C.type}},O._classifyFromVersion=function(C){var j={};if(C.length>21){var F=d.decode(C.toString("utf8"));if(F.version!==0&&F.version!==1)throw new TypeError("Only witness v0 and v1 addresses are supported.");if(F.version===0)if(F.data.length===20)j.type=O.PayToWitnessPublicKeyHash;else if(F.data.length===32)j.type=O.PayToWitnessScriptHash;else throw new TypeError("Witness data must be either 20 or 32 bytes.");else if(F.version===1)if(F.data.length===32)j.type=O.PayToTaproot;else throw new TypeError("Witness data must be 32 bytes for v1");j.network=c.get(F.prefix,"bech32prefix")}else{var U=c.get(C[0],"pubkeyhash"),Z=c.get(C[0],"scripthash");U?(j.network=U,j.type=O.PayToPublicKeyHash):Z&&(j.network=Z,j.type=O.PayToScriptHash)}return j},O._transformBuffer=function(C,j,F){var U={};if(!(C instanceof Buffer$N)&&!(C instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(C.length<21)throw new TypeError("Address buffer is incorrect length.");var Z=c.get(j),J=O._classifyFromVersion(C);if(j&&!Z)throw new TypeError("Unknown network");if(!J.network||Z&&Z.xpubkey!==J.network.xpubkey)throw new TypeError("Address has mismatched network type.");if(!J.type||F&&F!==J.type)throw new TypeError("Address has mismatched type.");return C.length>21?U.hashBuffer=d.decode(C.toString("utf8")).data:U.hashBuffer=C.slice(1),U.network=Z||J.network,U.type=J.type,U},O._transformPublicKey=function(C,j,F){var U={};if(!(C instanceof I))throw new TypeError("Address must be an instance of PublicKey.");if(F&&F!==O.PayToScriptHash&&F!==O.PayToWitnessPublicKeyHash&&F!==O.PayToPublicKeyHash&&F!==O.PayToTaproot)throw new TypeError("Type must be either pubkeyhash, witnesspubkeyhash, scripthash, or taproot to transform public key.");if(!C.compressed&&(F===O.PayToScriptHash||F===O.PayToWitnessPublicKeyHash))throw new TypeError("Witness addresses must use compressed public keys.");return F===O.PayToScriptHash?U.hashBuffer=l.sha256ripemd160(T.buildWitnessV0Out(C).toBuffer()):F===O.PayToTaproot?U.hashBuffer=l.sha256ripemd160(T.buildWitnessV1Out(C).toBuffer()):U.hashBuffer=l.sha256ripemd160(C.toBuffer()),U.type=F||O.PayToPublicKeyHash,U},O._transformScript=function(C,j){e.checkArgument(C instanceof T,"script must be a Script instance");var F=C.getAddressInfo(j);if(!F)throw new a.Script.CantDeriveAddress(C);return F},O.createMultisig=function(C,j,F,U,Z){if(F=F||C[0].network||c.defaultNetwork,Z&&Z!==O.PayToScriptHash&&Z!==O.PayToWitnessScriptHash)throw new TypeError("Type must be either scripthash or witnessscripthash to create multisig.");if(U||Z===O.PayToWitnessScriptHash){C=t.map(C,I);for(var J=0;J<C.length;J++)if(!C[J].compressed)throw new TypeError("Witness addresses must use compressed public keys.")}var X=T.buildMultisigOut(C,j);return U?O.payingTo(T.buildWitnessMultisigOutFromScript(X),F):O.payingTo(X,F,Z)},O._transformString=function(C,j,F){if(typeof C!="string")throw new TypeError("data parameter supplied is not a string.");if(C.length>100)throw new TypeError("address string is too long");if(j&&!c.get(j))throw new TypeError("Unknown network");C=C.trim();try{var Z=O._transformBuffer(Buffer$N.from(C,"utf8"),j,F);return Z}catch(J){if(F===O.PayToWitnessPublicKeyHash||F===O.PayToWitnessScriptHash||F===O.PayToTaproot)throw J}var U=u.decode(C),Z=O._transformBuffer(U,j,F);return Z},O.fromPublicKey=function(C,j,F){var U=O._transformPublicKey(C,j,F);return j=j||c.defaultNetwork,new O(U.hashBuffer,j,U.type)},O.fromPublicKeyHash=function(C,j){var F=O._transformHash(C);return new O(F.hashBuffer,j,O.PayToPublicKeyHash)},O.fromScriptHash=function(C,j,Z){e.checkArgument(C,"hash parameter is required");var U=O._transformHash(C);if(Z===O.PayToWitnessScriptHash&&C.length!==32)throw new TypeError("Address hashbuffer must be exactly 32 bytes for v0 witness script hash.");var Z=Z||O.PayToScriptHash;return new O(U.hashBuffer,j,Z)},O.payingTo=function(C,j,Z){e.checkArgument(C,"script is required"),e.checkArgument(C instanceof T,"script must be instance of Script");var U;Z===O.PayToWitnessScriptHash?U=l.sha256(C.toBuffer()):U=l.sha256ripemd160(C.toBuffer());var Z=Z||O.PayToScriptHash;return O.fromScriptHash(U,j,Z)},O.fromScript=function(C,j){e.checkArgument(C instanceof T,"script must be a Script instance");var F=O._transformScript(C,j);return new O(F.hashBuffer,j,F.type)},O.fromBuffer=function(C,j,F){var U=O._transformBuffer(C,j,F);return new O(U.hashBuffer,U.network,U.type)},O.fromString=function(C,j,F){var U=O._transformString(C,j,F);return new O(U.hashBuffer,U.network,U.type)},O.fromObject=function(j){e.checkState(m.isHexa(j.hash),'Unexpected hash property, "'+j.hash+'", expected to be hex.');var F=Buffer$N.from(j.hash,"hex");return new O(F,j.network,j.type)},O.getValidationError=function(C,j,F){var U;try{new O(C,j,F)}catch(Z){U=Z}return U},O.isValid=function(C,j,F){return!O.getValidationError(C,j,F)},O.prototype.isPayToPublicKeyHash=function(){return this.type===O.PayToPublicKeyHash},O.prototype.isPayToScriptHash=function(){return this.type===O.PayToScriptHash},O.prototype.isPayToWitnessPublicKeyHash=function(){return this.type===O.PayToWitnessPublicKeyHash},O.prototype.isPayToWitnessScriptHash=function(){return this.type===O.PayToWitnessScriptHash},O.prototype.isPayToTaproot=function(){return this.type===O.PayToTaproot},O.prototype.toBuffer=function(){if(this.isPayToWitnessPublicKeyHash()||this.isPayToWitnessScriptHash())return Buffer$N.from(this.toString(),"utf8");var C=Buffer$N.from([this.network[this.type]]);return Buffer$N.concat([C,this.hashBuffer])},O.prototype.toObject=O.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},O.prototype.toString=function(){if(this.isPayToWitnessPublicKeyHash()||this.isPayToWitnessScriptHash()||this.isPayToTaproot()){let C=this.network.bech32prefix,j=0,F=d.encodings.BECH32;return this.isPayToTaproot()&&(j=1,F=d.encodings.BECH32M),d.encode(C,j,this.hashBuffer,F)}return u.encode(this.toBuffer())},O.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"},address=O;var T=requireScript();return address}function Random(){}Random.getRandomBuffer=function(t){return process$1.browser?Random.getRandomBufferBrowser(t):Random.getRandomBufferNode(t)},Random.getRandomBufferNode=function(t){var e=requireCryptoBrowserify();return e.randomBytes(t)},Random.getRandomBufferBrowser=function(t){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");if(window.crypto&&window.crypto.getRandomValues)var e=window.crypto;else if(window.msCrypto&&window.msCrypto.getRandomValues)var e=window.msCrypto;else throw new Error("window.crypto.getRandomValues not available");var a=new Uint8Array(t);e.getRandomValues(a);var u=Buffer$N.from(a);return u},Random.getPseudoRandomBuffer=function(t){for(var e=4294967296,a=Buffer$N.alloc(t),u,d=0;d<=t;d++){var c=Math.floor(d/4),l=d-c*4;l===0?(u=Math.random()*e,a[d]=u&255):a[d]=(u=u>>>8)&255}return a};var random=Random,privatekey,hasRequiredPrivatekey;function requirePrivatekey(){if(hasRequiredPrivatekey)return privatekey;hasRequiredPrivatekey=1;var t=lodashExports,e=requireAddress(),a=base58check,u=bn$1,d=js,c=networks_1,l=point$1,m=requirePublickey(),I=random,O=preconditions;function T(C,j){if(!(this instanceof T))return new T(C,j);if(C instanceof T)return C;var F=this._classifyArguments(C,j);if(!F.bn||F.bn.cmp(new u(0))===0)throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!F.bn.lt(l.getN()))throw new TypeError("Number must be less than N");if(typeof F.network>"u")throw new TypeError('Must specify the network ("livenet" or "testnet")');return d.defineImmutable(this,{bn:F.bn,compressed:F.compressed,network:F.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}return T.prototype._classifyArguments=function(C,j){var F={compressed:!0,network:j?c.get(j):c.defaultNetwork};if(t.isUndefined(C)||t.isNull(C))F.bn=T._getRandomBN();else if(C instanceof u)F.bn=C;else if(C instanceof Buffer$N||C instanceof Uint8Array)F=T._transformBuffer(C,j);else if(C.bn&&C.network)F=T._transformObject(C);else if(!j&&c.get(C))F.bn=T._getRandomBN(),F.network=c.get(C);else if(typeof C=="string")d.isHexa(C)?F.bn=new u(Buffer$N.from(C,"hex")):F=T._transformWIF(C,j);else throw new TypeError("First argument is an unrecognized data type.");return F},T._getRandomBN=function(){var C,j;do{var F=I.getRandomBuffer(32);j=u.fromBuffer(F),C=j.lt(l.getN())}while(!C);return j},T._transformBuffer=function(C,j){var F={};if(C.length===32)return T._transformBNBuffer(C,j);if(F.network=c.get(C[0],"privatekey"),!F.network)throw new Error("Invalid network");if(j&&F.network!==c.get(j))throw new TypeError("Private key network mismatch");if(C.length===34&&C[33]===1)F.compressed=!0;else if(C.length===33)F.compressed=!1;else throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");return F.bn=u.fromBuffer(C.slice(1,33)),F},T._transformBNBuffer=function(C,j){var F={};return F.network=c.get(j)||c.defaultNetwork,F.bn=u.fromBuffer(C),F.compressed=!1,F},T._transformWIF=function(C,j){return T._transformBuffer(a.decode(C),j)},T.fromBuffer=function(C,j){return new T(C,j)},T._transformObject=function(C){var j=new u(C.bn,"hex"),F=c.get(C.network);return{bn:j,network:F,compressed:C.compressed}},T.fromString=T.fromWIF=function(C){return O.checkArgument(t.isString(C),"First argument is expected to be a string."),new T(C)},T.fromObject=function(C){return O.checkArgument(t.isObject(C),"First argument is expected to be an object."),new T(C)},T.fromRandom=function(C){var j=T._getRandomBN();return new T(j,C)},T.getValidationError=function(C,j){var F;try{new T(C,j)}catch(U){F=U}return F},T.isValid=function(C,j){return C?!T.getValidationError(C,j):!1},T.prototype.toString=function(){return this.toBuffer().toString("hex")},T.prototype.toWIF=function(){var C=this.network,j=this.compressed,F;return j?F=Buffer$N.concat([Buffer$N.from([C.privatekey]),this.bn.toBuffer({size:32}),Buffer$N.from([1])]):F=Buffer$N.concat([Buffer$N.from([C.privatekey]),this.bn.toBuffer({size:32})]),a.encode(F)},T.prototype.toBigNumber=function(){return this.bn},T.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})},T.prototype.toBufferNoPadding=function(){return this.bn.toBuffer()},T.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=m.fromPrivateKey(this)),this._pubkey},T.prototype.toAddress=function(C,j){var F=this.toPublicKey();return e.fromPublicKey(F,C||this.network,j)},T.prototype.toObject=T.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},T.prototype.inspect=function(){var C=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toString()+", network: "+this.network+C+">"},privatekey=T,privatekey}var publickey,hasRequiredPublickey;function requirePublickey(){if(hasRequiredPublickey)return publickey;hasRequiredPublickey=1;var t=bn$1,e=point$1,a=hashExports,u=js,d=networks_1,c=lodashExports,l=preconditions;function m(I,O){if(!(this instanceof m))return new m(I,O);if(l.checkArgument(I,"First argument is required, please include public key data."),I instanceof m)return I;O=O||{};var T=this._classifyArgs(I,O);return T.point.validate(),u.defineImmutable(this,{point:T.point,compressed:T.compressed,network:T.network||d.defaultNetwork}),this}return m.prototype._classifyArgs=function(I,O){var T={compressed:c.isUndefined(O.compressed)||O.compressed};if(I instanceof e)T.point=I;else if(I.x&&I.y)T=m._transformObject(I);else if(typeof I=="string")T=m._transformDER(Buffer$N.from(I,"hex"));else if(m._isBuffer(I))T=m._transformDER(I);else if(m._isPrivateKey(I))T=m._transformPrivateKey(I);else throw new TypeError("First argument is an unrecognized data format.");return T.network||(T.network=c.isUndefined(O.network)?void 0:d.get(O.network)),T},m._isPrivateKey=function(I){var O=requirePrivatekey();return I instanceof O},m._isBuffer=function(I){return I instanceof Buffer$N||I instanceof Uint8Array},m._transformPrivateKey=function(I){l.checkArgument(m._isPrivateKey(I),"Must be an instance of PrivateKey");var O={};return O.point=e.getG().mul(I.bn),O.compressed=I.compressed,O.network=I.network,O},m._transformDER=function(I,O){l.checkArgument(m._isBuffer(I),"Must be a hex buffer of DER encoded public key");var T={};O=c.isUndefined(O)?!0:O;var C,j,F,U;if(I[0]===4||!O&&(I[0]===6||I[0]===7)){if(F=I.slice(1,33),U=I.slice(33,65),F.length!==32||U.length!==32||I.length!==65)throw new TypeError("Length of x and y must be 32 bytes");C=new t(F),j=new t(U),T.point=new e(C,j),T.compressed=!1}else if(I[0]===3)F=I.slice(1),C=new t(F),T=m._transformX(!0,C),T.compressed=!0;else if(I[0]===2)F=I.slice(1),C=new t(F),T=m._transformX(!1,C),T.compressed=!0;else throw new TypeError("Invalid DER format public key");return T},m._transformX=function(I,O){l.checkArgument(typeof I=="boolean","Must specify whether y is odd or not (true or false)");var T={};return T.point=e.fromX(I,O),T},m._transformObject=function(I){var O=new t(I.x,"hex"),T=new t(I.y,"hex"),C=new e(O,T);return new m(C,{compressed:I.compressed})},m.fromPrivateKey=function(I){l.checkArgument(m._isPrivateKey(I),"Must be an instance of PrivateKey");var O=m._transformPrivateKey(I);return new m(O.point,{compressed:O.compressed,network:O.network})},m.fromDER=m.fromBuffer=function(I,O){l.checkArgument(m._isBuffer(I),"Must be a hex buffer of DER encoded public key");var T=m._transformDER(I,O);return new m(T.point,{compressed:T.compressed})},m.fromPoint=function(I,O){return l.checkArgument(I instanceof e,"First argument must be an instance of Point."),new m(I,{compressed:O})},m.fromString=function(I,O){var T=Buffer$N.from(I,O||"hex"),C=m._transformDER(T);return new m(C.point,{compressed:C.compressed})},m.fromX=function(I,O){var T=m._transformX(I,O);return new m(T.point,{compressed:T.compressed})},m.getValidationError=function(I){var O;try{new m(I)}catch(T){O=T}return O},m.isValid=function(I){return!m.getValidationError(I)},m.prototype.toObject=m.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},m.prototype.toBuffer=m.prototype.toDER=function(){var I=this.point.getX(),O=this.point.getY(),T=I.toBuffer({size:32}),C=O.toBuffer({size:32}),j;if(this.compressed){var F=C[C.length-1]%2;return F?j=Buffer$N.from([3]):j=Buffer$N.from([2]),Buffer$N.concat([j,T])}else return j=Buffer$N.from([4]),Buffer$N.concat([j,T,C])},m.prototype._getID=function(){return a.sha256ripemd160(this.toBuffer())},m.prototype.toAddress=function(I,O){var T=requireAddress();return T.fromPublicKey(this,I||this.network,O)},m.prototype.toString=function(){return this.toDER().toString("hex")},m.prototype.inspect=function(){return"<PublicKey: "+this.toString()+(this.compressed?"":", uncompressed")+">"},publickey=m,publickey}var ecdsa,hasRequiredEcdsa;function requireEcdsa(){if(hasRequiredEcdsa)return ecdsa;hasRequiredEcdsa=1;var t=bn$1,e=point$1,a=signature$1,u=requirePublickey(),d=random,c=hashExports,l=bufferExports,m=lodashExports,I=preconditions,O=function T(C){if(!(this instanceof T))return new T(C);C&&this.set(C)};return O.prototype.set=function(T){return this.hashbuf=T.hashbuf||this.hashbuf,this.endian=T.endian||this.endian,this.privkey=T.privkey||this.privkey,this.pubkey=T.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),this.sig=T.sig||this.sig,this.k=T.k||this.k,this.verified=T.verified||this.verified,this},O.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()},O.prototype.calci=function(){for(var T=0;T<4;T++){this.sig.i=T;var C;try{C=this.toPublicKey()}catch(j){console.error(j);continue}if(C.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")},O.fromString=function(T){var C=JSON.parse(T);return new O(C)},O.prototype.randomK=function(){var T=e.getN(),C;do C=t.fromBuffer(d.getRandomBuffer(32));while(!(C.lt(T)&&C.gt(t.Zero)));return this.k=C,this},O.prototype.deterministicK=function(T){m.isUndefined(T)&&(T=0);var C=Buffer$N.alloc(32);C.fill(1);var j=Buffer$N.alloc(32);j.fill(0);var F=this.privkey.bn.toBuffer({size:32}),U=this.endian==="little"?l.reverse(this.hashbuf):this.hashbuf;j=c.sha256hmac(Buffer$N.concat([C,Buffer$N.from([0]),F,U]),j),C=c.sha256hmac(C,j),j=c.sha256hmac(Buffer$N.concat([C,Buffer$N.from([1]),F,U]),j),C=c.sha256hmac(C,j),C=c.sha256hmac(C,j);for(var Z=t.fromBuffer(C),J=e.getN(),X=0;X<T||!(Z.lt(J)&&Z.gt(t.Zero));X++)j=c.sha256hmac(Buffer$N.concat([C,Buffer$N.from([0])]),j),C=c.sha256hmac(C,j),C=c.sha256hmac(C,j),Z=t.fromBuffer(C);return this.k=Z,this},O.prototype.toPublicKey=function(){var T=this.sig.i;I.checkArgument(T===0||T===1||T===2||T===3,new Error("i must be equal to 0, 1, 2, or 3"));var C=t.fromBuffer(this.hashbuf),j=this.sig.r,F=this.sig.s,U=T&1,Z=T>>1,J=e.getN(),X=e.getG(),Q=Z?j.add(J):j,te=e.fromX(U,Q),se=te.mul(J);if(!se.isInfinity())throw new Error("nR is not a valid curve point");var pe=C.neg().umod(J),me=j.invm(J),Ee=te.mul(F).add(X.mul(pe)).mul(me),V=u.fromPoint(Ee,this.sig.compressed);return V},O.prototype.sigError=function(){if(!l.isBuffer(this.hashbuf)||this.hashbuf.length!==32)return"hashbuf must be a 32 byte buffer";var T=this.sig.r,C=this.sig.s;if(!(T.gt(t.Zero)&&T.lt(e.getN()))||!(C.gt(t.Zero)&&C.lt(e.getN())))return"r and s not in range";var j=t.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),F=e.getN(),U=C.invm(F),Z=U.mul(j).umod(F),J=U.mul(T).umod(F),X=e.getG().mulAdd(Z,this.pubkey.point,J);return X.isInfinity()?"p is infinity":X.getX().umod(F).cmp(T)!==0?"Invalid signature":!1},O.toLowS=function(T){return T.gt(t.fromBuffer(Buffer$N.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(T=e.getN().sub(T)),T},O.prototype._findSignature=function(T,C){var j=e.getN(),F=e.getG(),U=0,Z,J,X,Q;do(!this.k||U>0)&&this.deterministicK(U),U++,Z=this.k,J=F.mul(Z),X=J.x.umod(j),Q=Z.invm(j).mul(C.add(T.mul(X))).umod(j);while(X.cmp(t.Zero)<=0||Q.cmp(t.Zero)<=0);return Q=O.toLowS(Q),{s:Q,r:X}},O.prototype.sign=function(){var T=this.hashbuf,C=this.privkey,j=C.bn;I.checkState(T&&C&&j,new Error("invalid parameters")),I.checkState(l.isBuffer(T)&&T.length===32,new Error("hashbuf must be a 32 byte buffer"));var F=t.fromBuffer(T,this.endian?{endian:this.endian}:void 0),U=this._findSignature(j,F);return U.compressed=this.pubkey.compressed,this.sig=new a(U),this},O.prototype.signRandomK=function(){return this.randomK(),this.sign()},O.prototype.toString=function(){var T={};return this.hashbuf&&(T.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(T.privkey=this.privkey.toString()),this.pubkey&&(T.pubkey=this.pubkey.toString()),this.sig&&(T.sig=this.sig.toString()),this.k&&(T.k=this.k.toString()),JSON.stringify(T)},O.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},O.sign=function(T,C,j){return O().set({hashbuf:T,endian:j,privkey:C}).sign().sig},O.verify=function(T,C,j,F){return O().set({hashbuf:T,endian:F,sig:C,pubkey:j}).verify().verified},ecdsa=O,ecdsa}var BufferWriter$4=bufferwriter,BufferReader$3=bufferreader,BN$2=bn$1,Varint=function t(e){if(!(this instanceof t))return new t(e);if(Buffer$N.isBuffer(e))this.buf=e;else if(typeof e=="number"){var a=e;this.fromNumber(a)}else if(e instanceof BN$2){var u=e;this.fromBN(u)}else if(e){var d=e;this.set(d)}};Varint.prototype.set=function(t){return this.buf=t.buf||this.buf,this},Varint.prototype.fromString=function(t){return this.set({buf:Buffer$N.from(t,"hex")}),this},Varint.prototype.toString=function(){return this.buf.toString("hex")},Varint.prototype.fromBuffer=function(t){return this.buf=t,this},Varint.prototype.fromBufferReader=function(t){return this.buf=t.readVarintBuf(),this},Varint.prototype.fromBN=function(t){return this.buf=BufferWriter$4().writeVarintBN(t).concat(),this},Varint.prototype.fromNumber=function(t){return this.buf=BufferWriter$4().writeVarintNum(t).concat(),this},Varint.prototype.toBuffer=function(){return this.buf},Varint.prototype.toBN=function(){return BufferReader$3(this.buf).readVarintBN()},Varint.prototype.toNumber=function(){return BufferReader$3(this.buf).readVarintNum()};var varint=Varint,block$1={exports:{}},_$4=lodashExports,BN$1=bn$1,BufferUtil$2=bufferExports,BufferReader$2=bufferreader,BufferWriter$3=bufferwriter,Hash$2=hashExports,$$3=preconditions,GENESIS_BITS=486604799,BlockHeader$2=function t(e){if(!(this instanceof t))return new t(e);var a=t._from(e);return this.version=a.version,this.prevHash=a.prevHash,this.merkleRoot=a.merkleRoot,this.time=a.time,this.timestamp=a.time,this.bits=a.bits,this.nonce=a.nonce,a.hash&&$$3.checkState(this.hash===a.hash,"Argument object hash property does not match block hash."),this};BlockHeader$2._from=function t(e){var a={};if(BufferUtil$2.isBuffer(e))a=BlockHeader$2._fromBufferReader(BufferReader$2(e));else if(_$4.isObject(e))a=BlockHeader$2._fromObject(e);else throw new TypeError("Unrecognized argument for BlockHeader");return a},BlockHeader$2._fromObject=function t(e){$$3.checkArgument(e,"data is required");var a=e.prevHash,u=e.merkleRoot;_$4.isString(e.prevHash)&&(a=BufferUtil$2.reverse(Buffer$N.from(e.prevHash,"hex"))),_$4.isString(e.merkleRoot)&&(u=BufferUtil$2.reverse(Buffer$N.from(e.merkleRoot,"hex")));var d={hash:e.hash,version:e.version,prevHash:a,merkleRoot:u,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce};return d},BlockHeader$2.fromObject=function t(e){var a=BlockHeader$2._fromObject(e);return new BlockHeader$2(a)},BlockHeader$2.fromRawBlock=function t(e){BufferUtil$2.isBuffer(e)||(e=Buffer$N.from(e,"binary"));var a=BufferReader$2(e);a.pos=BlockHeader$2.Constants.START_OF_HEADER;var u=BlockHeader$2._fromBufferReader(a);return new BlockHeader$2(u)},BlockHeader$2.fromBuffer=function t(e){var a=BlockHeader$2._fromBufferReader(BufferReader$2(e));return new BlockHeader$2(a)},BlockHeader$2.fromString=function t(e){var a=Buffer$N.from(e,"hex");return BlockHeader$2.fromBuffer(a)},BlockHeader$2._fromBufferReader=function t(e){var a={};return a.version=e.readInt32LE(),a.prevHash=e.read(32),a.merkleRoot=e.read(32),a.time=e.readUInt32LE(),a.bits=e.readUInt32LE(),a.nonce=e.readUInt32LE(),a},BlockHeader$2.fromBufferReader=function t(e){var a=BlockHeader$2._fromBufferReader(e);return new BlockHeader$2(a)},BlockHeader$2.prototype.toObject=BlockHeader$2.prototype.toJSON=function t(){return{hash:this.hash,version:this.version,prevHash:BufferUtil$2.reverse(this.prevHash).toString("hex"),merkleRoot:BufferUtil$2.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},BlockHeader$2.prototype.toBuffer=function t(){return this.toBufferWriter().concat()},BlockHeader$2.prototype.toString=function t(){return this.toBuffer().toString("hex")},BlockHeader$2.prototype.toBufferWriter=function t(e){return e||(e=new BufferWriter$3),e.writeInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},BlockHeader$2.prototype.getTargetDifficulty=function t(e){e=e||this.bits;for(var a=new BN$1(e&16777215),u=8*((e>>>24)-3);u-- >0;)a=a.mul(new BN$1(2));return a},BlockHeader$2.prototype.getDifficulty=function t(){var e=this.getTargetDifficulty(GENESIS_BITS).mul(new BN$1(Math.pow(10,8))),a=this.getTargetDifficulty(),u=e.div(a).toString(10),d=u.length-8;return u=u.slice(0,d)+"."+u.slice(d),parseFloat(u)},BlockHeader$2.prototype._getHash=function t(){var e=this.toBuffer();return Hash$2.sha256sha256(e)};var idProperty$1={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=BufferReader$2(this._getHash()).readReverse().toString("hex")),this._id},set:_$4.noop};Object.defineProperty(BlockHeader$2.prototype,"id",idProperty$1),Object.defineProperty(BlockHeader$2.prototype,"hash",idProperty$1),BlockHeader$2.prototype.validTimestamp=function t(){var e=Math.round(new Date().getTime()/1e3);return!(this.time>e+BlockHeader$2.Constants.MAX_TIME_OFFSET)},BlockHeader$2.prototype.validProofOfWork=function t(){var e=new BN$1(this.id,"hex"),a=this.getTargetDifficulty();return!(e.cmp(a)>0)},BlockHeader$2.prototype.inspect=function t(){return"<BlockHeader "+this.id+">"},BlockHeader$2.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:2*60*60,LARGEST_HASH:new BN$1("10000000000000000000000000000000000000000000000000000000000000000","hex")};var blockheader=BlockHeader$2,_$3=lodashExports,BlockHeader$1=blockheader,BN=bn$1,BufferUtil$1=bufferExports,BufferReader$1=bufferreader,BufferWriter$2=bufferwriter,Hash$1=hashExports,Transaction$2=requireTransaction(),$$2=preconditions;function Block(t){return this instanceof Block?(_$3.extend(this,Block._from(t)),this):new Block(t)}Block.MAX_BLOCK_SIZE=1e6,Block._from=function t(e){var a={};if(BufferUtil$1.isBuffer(e))a=Block._fromBufferReader(BufferReader$1(e));else if(_$3.isObject(e))a=Block._fromObject(e);else throw new TypeError("Unrecognized argument for Block");return a},Block._fromObject=function t(e){var a=[];e.transactions.forEach(function(d){d instanceof Transaction$2?a.push(d):a.push(Transaction$2().fromObject(d))});var u={header:BlockHeader$1.fromObject(e.header),transactions:a};return u},Block.fromObject=function t(e){var a=Block._fromObject(e);return new Block(a)},Block._fromBufferReader=function t(e){var a={};$$2.checkState(!e.finished(),"No block data received"),a.header=BlockHeader$1.fromBufferReader(e);var u=e.readVarintNum();a.transactions=[];for(var d=0;d<u;d++)a.transactions.push(Transaction$2().fromBufferReader(e));return a},Block.fromBufferReader=function t(e){$$2.checkArgument(e,"br is required");var a=Block._fromBufferReader(e);return new Block(a)},Block.fromBuffer=function t(e){return Block.fromBufferReader(new BufferReader$1(e))},Block.fromString=function t(e){var a=Buffer$N.from(e,"hex");return Block.fromBuffer(a)},Block.fromRawBlock=function t(e){BufferUtil$1.isBuffer(e)||(e=Buffer$N.from(e,"binary"));var a=BufferReader$1(e);a.pos=Block.Values.START_OF_BLOCK;var u=Block._fromBufferReader(a);return new Block(u)},Block.prototype.toObject=Block.prototype.toJSON=function t(){var e=[];return this.transactions.forEach(function(a){e.push(a.toObject())}),{header:this.header.toObject(),transactions:e}},Block.prototype.toBuffer=function t(){return this.toBufferWriter().concat()},Block.prototype.toString=function t(){return this.toBuffer().toString("hex")},Block.prototype.toBufferWriter=function t(e){e||(e=new BufferWriter$2),e.write(this.header.toBuffer()),e.writeVarintNum(this.transactions.length);for(var a=0;a<this.transactions.length;a++)this.transactions[a].toBufferWriter(e);return e},Block.prototype.getTransactionHashes=function t(){var e=[];if(this.transactions.length===0)return[Block.Values.NULL_HASH];for(var a=0;a<this.transactions.length;a++)e.push(this.transactions[a]._getHash());return e},Block.prototype.getMerkleTree=function t(){for(var e=this.getTransactionHashes(),a=0,u=this.transactions.length;u>1;u=Math.floor((u+1)/2)){for(var d=0;d<u;d+=2){var c=Math.min(d+1,u-1),l=Buffer$N.concat([e[a+d],e[a+c]]);e.push(Hash$1.sha256sha256(l))}a+=u}return e},Block.prototype.getMerkleRoot=function t(){var e=this.getMerkleTree();return e[e.length-1]},Block.prototype.validMerkleRoot=function t(){var e=new BN(this.header.merkleRoot.toString("hex"),"hex"),a=new BN(this.getMerkleRoot().toString("hex"),"hex");return e.cmp(a)===0},Block.prototype._getHash=function(){return this.header._getHash()};var idProperty={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:_$3.noop};Object.defineProperty(Block.prototype,"id",idProperty),Object.defineProperty(Block.prototype,"hash",idProperty),Block.prototype.inspect=function t(){return"<Block "+this.id+">"},Block.Values={START_OF_BLOCK:8,NULL_HASH:Buffer$N.from("0000000000000000000000000000000000000000000000000000000000000000","hex")};var block=Block,_$2=lodashExports,BlockHeader=blockheader,BufferUtil=bufferExports,BufferReader=bufferreader,BufferWriter$1=bufferwriter,Hash=hashExports,Transaction$1=requireTransaction(),errors=errorsExports,$$1=preconditions;function MerkleBlock(t){if(!(this instanceof MerkleBlock))return new MerkleBlock(t);var e={};if(BufferUtil.isBuffer(t))e=MerkleBlock._fromBufferReader(BufferReader(t));else if(_$2.isObject(t)){var a;t.header instanceof BlockHeader?a=t.header:a=BlockHeader.fromObject(t.header),e={header:a,numTransactions:t.numTransactions,hashes:t.hashes,flags:t.flags}}else throw new TypeError("Unrecognized argument for MerkleBlock");return _$2.extend(this,e),this._flagBitsUsed=0,this._hashesUsed=0,this}MerkleBlock.fromBuffer=function t(e){return MerkleBlock.fromBufferReader(BufferReader(e))},MerkleBlock.fromBufferReader=function t(e){return new MerkleBlock(MerkleBlock._fromBufferReader(e))},MerkleBlock.prototype.toBuffer=function t(){return this.toBufferWriter().concat()},MerkleBlock.prototype.toBufferWriter=function t(e){e||(e=new BufferWriter$1),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var a=0;a<this.hashes.length;a++)e.write(Buffer$N.from(this.hashes[a],"hex"));for(e.writeVarintNum(this.flags.length),a=0;a<this.flags.length;a++)e.writeUInt8(this.flags[a]);return e},MerkleBlock.prototype.toObject=MerkleBlock.prototype.toJSON=function t(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}},MerkleBlock.prototype.validMerkleTree=function t(){if($$1.checkState(_$2.isArray(this.flags),"MerkleBlock flags is not an array"),$$1.checkState(_$2.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions||this.flags.length*8<this.hashes.length)return!1;var e=this._calcTreeHeight(),a={hashesUsed:0,flagBitsUsed:0},u=this._traverseMerkleTree(e,0,a);return a.hashesUsed!==this.hashes.length?!1:BufferUtil.equals(u,this.header.merkleRoot)},MerkleBlock.prototype.filterdTxsHash=function t(){if($$1.checkState(_$2.isArray(this.flags),"MerkleBlock flags is not an array"),$$1.checkState(_$2.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new errors.MerkleBlock.InvalidMerkleTree;if(this.flags.length*8<this.hashes.length)throw new errors.MerkleBlock.InvalidMerkleTree;if(this.hashes.length===1)return[];var e=this._calcTreeHeight(),a={hashesUsed:0,flagBitsUsed:0},u=this._traverseMerkleTree(e,0,a,!0);if(a.hashesUsed!==this.hashes.length)throw new errors.MerkleBlock.InvalidMerkleTree;return u},MerkleBlock.prototype._traverseMerkleTree=function t(e,a,u,c){u=u||{},u.txs=u.txs||[],u.flagBitsUsed=u.flagBitsUsed||0,u.hashesUsed=u.hashesUsed||0;var c=c||!1;if(u.flagBitsUsed>this.flags.length*8)return null;var l=this.flags[u.flagBitsUsed>>3]>>>(u.flagBitsUsed++&7)&1;if(e===0||!l){if(u.hashesUsed>=this.hashes.length)return null;var m=this.hashes[u.hashesUsed++];return e===0&&l&&u.txs.push(m),Buffer$N.from(m,"hex")}else{var I=this._traverseMerkleTree(e-1,a*2,u),O=I;return a*2+1<this._calcTreeWidth(e-1)&&(O=this._traverseMerkleTree(e-1,a*2+1,u)),c?u.txs:Hash.sha256sha256(new Buffer$N.concat([I,O]))}},MerkleBlock.prototype._calcTreeWidth=function t(e){return this.numTransactions+(1<<e)-1>>e},MerkleBlock.prototype._calcTreeHeight=function t(){for(var e=0;this._calcTreeWidth(e)>1;)e++;return e},MerkleBlock.prototype.hasTransaction=function t(e){$$1.checkArgument(!_$2.isUndefined(e),"tx cannot be undefined"),$$1.checkArgument(e instanceof Transaction$1||typeof e=="string",'Invalid tx given, tx must be a "string" or "Transaction"');var a=e;e instanceof Transaction$1&&(a=BufferUtil.reverse(Buffer$N.from(e.id,"hex")).toString("hex"));var u=[],d=this._calcTreeHeight();return this._traverseMerkleTree(d,0,{txs:u}),u.indexOf(a)!==-1},MerkleBlock._fromBufferReader=function t(e){$$1.checkState(!e.finished(),"No merkleblock data received");var a={};a.header=BlockHeader.fromBufferReader(e),a.numTransactions=e.readUInt32LE();var u=e.readVarintNum();a.hashes=[];for(var d=0;d<u;d++)a.hashes.push(e.read(32).toString("hex"));var c=e.readVarintNum();for(a.flags=[],d=0;d<c;d++)a.flags.push(e.readUInt8());return a},MerkleBlock.fromObject=function t(e){return new MerkleBlock(e)};var merkleblock=MerkleBlock;block$1.exports=block,block$1.exports.BlockHeader=blockheader,block$1.exports.MerkleBlock=merkleblock;var blockExports=block$1.exports,hdpublickey,hasRequiredHdpublickey;function requireHdpublickey(){if(hasRequiredHdpublickey)return hdpublickey;hasRequiredHdpublickey=1;var t=lodashExports,e=preconditions,a=bn$1,u=base58,d=base58check,c=hashExports,l=requireHdprivatekey(),m=networks_1,I=point$1,O=requirePublickey(),T=errorsExports,C=T,j=T.HDPublicKey,F=requireAssert(),U=js,Z=bufferExports;function J(X){if(X instanceof J)return X;if(!(this instanceof J))return new J(X);if(X)if(t.isString(X)||Z.isBuffer(X)){var Q=J.getSerializedError(X);if(Q){if(Z.isBuffer(X)&&!J.getSerializedError(X.toString()))return this._buildFromSerialized(X.toString());if(Q instanceof j.ArgumentIsPrivateExtended)return new l(X).hdPublicKey;throw Q}else return this._buildFromSerialized(X)}else{if(t.isObject(X))return X instanceof l?this._buildFromPrivate(X):this._buildFromObject(X);throw new j.UnrecognizedArgument(X)}else throw new j.MustSupplyArgument}return J.isValidPath=function(X){if(t.isString(X)){var Q=l._getDerivationIndexes(X);return Q!==null&&t.every(Q,J.isValidPath)}return t.isNumber(X)?X>=0&&X<J.Hardened:!1},J.prototype.derive=function(X,Q){return this.deriveChild(X,Q)},J.prototype.deriveChild=function(X,Q){if(t.isNumber(X))return this._deriveWithNumber(X,Q);if(t.isString(X))return this._deriveFromString(X);throw new j.InvalidDerivationArgument(X)},J.prototype._deriveWithNumber=function(X,Q){if(X>=J.Hardened||Q)throw new j.InvalidIndexCantDeriveHardened;if(X<0)throw new j.InvalidPath(X);var te=Z.integerAsBuffer(X),se=Z.concat([this.publicKey.toBuffer(),te]),pe=c.sha512hmac(se,this._buffers.chainCode),me=a.fromBuffer(pe.slice(0,32),{size:32}),Ee=pe.slice(32,64),V;try{V=O.fromPoint(I.getG().mul(me).add(this.publicKey.point))}catch{return this._deriveWithNumber(X+1)}var ae=new J({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:X,chainCode:Ee,publicKey:V});return ae},J.prototype._deriveFromString=function(X){if(t.includes(X,"'"))throw new j.InvalidIndexCantDeriveHardened;if(!J.isValidPath(X))throw new j.InvalidPath(X);var Q=l._getDerivationIndexes(X),te=Q.reduce(function(se,pe){return se._deriveWithNumber(pe)},this);return te},J.isValidSerialized=function(X,Q){return t.isNull(J.getSerializedError(X,Q))},J.getSerializedError=function(X,Q){if(!(t.isString(X)||Z.isBuffer(X)))return new j.UnrecognizedArgument("expected buffer or string");if(!u.validCharacters(X))return new C.InvalidB58Char("(unknown)",X);try{X=d.decode(X)}catch{return new C.InvalidB58Checksum(X)}if(X.length!==J.DataSize)return new j.InvalidLength(X);if(!t.isUndefined(Q)){var te=J._validateNetwork(X,Q);if(te)return te}var se=Z.integerFromBuffer(X.slice(0,4));return se===m.livenet.xprivkey||se===m.testnet.xprivkey?new j.ArgumentIsPrivateExtended:null},J._validateNetwork=function(X,Q){var te=m.get(Q);if(!te)return new C.InvalidNetworkArgument(Q);var se=X.slice(J.VersionStart,J.VersionEnd);return Z.integerFromBuffer(se)!==te.xpubkey?new C.InvalidNetwork(se):null},J.prototype._buildFromPrivate=function(X){var Q=t.clone(X._buffers),te=I.getG().mul(a.fromBuffer(Q.privateKey));return Q.publicKey=I.pointToCompressed(te),Q.version=Z.integerAsBuffer(m.get(Z.integerFromBuffer(Q.version)).xpubkey),Q.privateKey=void 0,Q.checksum=void 0,Q.xprivkey=void 0,this._buildFromBuffers(Q)},J.prototype._buildFromObject=function(X){var Q={version:X.network?Z.integerAsBuffer(m.get(X.network).xpubkey):X.version,depth:t.isNumber(X.depth)?Z.integerAsSingleByteBuffer(X.depth):X.depth,parentFingerPrint:t.isNumber(X.parentFingerPrint)?Z.integerAsBuffer(X.parentFingerPrint):X.parentFingerPrint,childIndex:t.isNumber(X.childIndex)?Z.integerAsBuffer(X.childIndex):X.childIndex,chainCode:t.isString(X.chainCode)?Buffer$N.from(X.chainCode,"hex"):X.chainCode,publicKey:t.isString(X.publicKey)?Buffer$N.from(X.publicKey,"hex"):Z.isBuffer(X.publicKey)?X.publicKey:X.publicKey.toBuffer(),checksum:t.isNumber(X.checksum)?Z.integerAsBuffer(X.checksum):X.checksum};return this._buildFromBuffers(Q)},J.prototype._buildFromSerialized=function(X){var Q=d.decode(X),te={version:Q.slice(J.VersionStart,J.VersionEnd),depth:Q.slice(J.DepthStart,J.DepthEnd),parentFingerPrint:Q.slice(J.ParentFingerPrintStart,J.ParentFingerPrintEnd),childIndex:Q.slice(J.ChildIndexStart,J.ChildIndexEnd),chainCode:Q.slice(J.ChainCodeStart,J.ChainCodeEnd),publicKey:Q.slice(J.PublicKeyStart,J.PublicKeyEnd),checksum:Q.slice(J.ChecksumStart,J.ChecksumEnd),xpubkey:X};return this._buildFromBuffers(te)},J.prototype._buildFromBuffers=function(X){J._validateBufferArguments(X),U.defineImmutable(this,{_buffers:X});var Q=[X.version,X.depth,X.parentFingerPrint,X.childIndex,X.chainCode,X.publicKey],te=Z.concat(Q),se=d.checksum(te);if(!X.checksum||!X.checksum.length)X.checksum=se;else if(X.checksum.toString("hex")!==se.toString("hex"))throw new C.InvalidB58Checksum(te,se);var pe=m.get(Z.integerFromBuffer(X.version)),me;me=d.encode(Z.concat(Q)),X.xpubkey=Buffer$N.from(me);var Ee=new O(X.publicKey,{network:pe}),V=J.ParentFingerPrintSize,ae=c.sha256ripemd160(Ee.toBuffer()).slice(0,V);return U.defineImmutable(this,{xpubkey:me,network:pe,depth:Z.integerFromSingleByteBuffer(X.depth),publicKey:Ee,fingerPrint:ae}),this},J._validateBufferArguments=function(X){var Q=function(te,se){var pe=X[te];F(Z.isBuffer(pe),te+" argument is not a buffer, it's "+typeof pe),F(pe.length===se,te+" has not the expected size: found "+pe.length+", expected "+se)};Q("version",J.VersionSize),Q("depth",J.DepthSize),Q("parentFingerPrint",J.ParentFingerPrintSize),Q("childIndex",J.ChildIndexSize),Q("chainCode",J.ChainCodeSize),Q("publicKey",J.PublicKeySize),X.checksum&&X.checksum.length&&Q("checksum",J.CheckSumSize)},J.fromString=function(X){return e.checkArgument(t.isString(X),"No valid string was provided"),new J(X)},J.fromObject=function(X){return e.checkArgument(t.isObject(X),"No valid argument was provided"),new J(X)},J.prototype.toString=function(){return this.xpubkey},J.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"},J.prototype.toObject=J.prototype.toJSON=function(){return{network:m.get(Z.integerFromBuffer(this._buffers.version)).name,depth:Z.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:Z.integerFromBuffer(this.fingerPrint),parentFingerPrint:Z.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:Z.integerFromBuffer(this._buffers.childIndex),chainCode:Z.bufferToHex(this._buffers.chainCode),publicKey:this.publicKey.toString(),checksum:Z.integerFromBuffer(this._buffers.checksum),xpubkey:this.xpubkey}},J.fromBuffer=function(X){return new J(X)},J.prototype.toBuffer=function(){return Z.copy(this._buffers.xpubkey)},J.Hardened=2147483648,J.RootElementAlias=["m","M"],J.VersionSize=4,J.DepthSize=1,J.ParentFingerPrintSize=4,J.ChildIndexSize=4,J.ChainCodeSize=32,J.PublicKeySize=33,J.CheckSumSize=4,J.DataSize=78,J.SerializedByteSize=82,J.VersionStart=0,J.VersionEnd=J.VersionStart+J.VersionSize,J.DepthStart=J.VersionEnd,J.DepthEnd=J.DepthStart+J.DepthSize,J.ParentFingerPrintStart=J.DepthEnd,J.ParentFingerPrintEnd=J.ParentFingerPrintStart+J.ParentFingerPrintSize,J.ChildIndexStart=J.ParentFingerPrintEnd,J.ChildIndexEnd=J.ChildIndexStart+J.ChildIndexSize,J.ChainCodeStart=J.ChildIndexEnd,J.ChainCodeEnd=J.ChainCodeStart+J.ChainCodeSize,J.PublicKeyStart=J.ChainCodeEnd,J.PublicKeyEnd=J.PublicKeyStart+J.PublicKeySize,J.ChecksumStart=J.PublicKeyEnd,J.ChecksumEnd=J.ChecksumStart+J.CheckSumSize,F(J.PublicKeyEnd===J.DataSize),F(J.ChecksumEnd===J.SerializedByteSize),hdpublickey=J,hdpublickey}var hdprivatekey,hasRequiredHdprivatekey;function requireHdprivatekey(){if(hasRequiredHdprivatekey)return hdprivatekey;hasRequiredHdprivatekey=1;var t=requireAssert(),e=require$$1$4,a=lodashExports,u=preconditions,d=bn$1,c=base58,l=base58check,m=hashExports,I=networks_1,O=point$1,T=requirePrivatekey(),C=random,j=errorsExports,F=j.HDPrivateKey,U=bufferExports,Z=js,J=128,X=1/8,Q=512;function te(se){if(se instanceof te)return se;if(!(this instanceof te))return new te(se);if(!se)return this._generateRandomly();if(I.get(se))return this._generateRandomly(se);if(a.isString(se)||U.isBuffer(se))if(te.isValidSerialized(se))this._buildFromSerialized(se);else if(Z.isValidJSON(se))this._buildFromJSON(se);else if(U.isBuffer(se)&&te.isValidSerialized(se.toString()))this._buildFromSerialized(se.toString());else throw te.getSerializedError(se);else if(a.isObject(se))this._buildFromObject(se);else throw new F.UnrecognizedArgument(se)}return te.isValidPath=function(se,pe){if(a.isString(se)){var me=te._getDerivationIndexes(se);return me!==null&&a.every(me,te.isValidPath)}return a.isNumber(se)?(se<te.Hardened&&pe===!0&&(se+=te.Hardened),se>=0&&se<te.MaxIndex):!1},te._getDerivationIndexes=function(se){var pe=se.split("/");if(a.includes(te.RootElementAlias,se))return[];if(!a.includes(te.RootElementAlias,pe[0]))return null;var me=pe.slice(1).map(function(Ee){var V=Ee.slice(-1)==="'";if(V&&(Ee=Ee.slice(0,-1)),!Ee||Ee[0]==="-")return NaN;var ae=+Ee;return V&&(ae+=te.Hardened),ae});return a.some(me,isNaN)?null:me},te.prototype.derive=function(se,pe){return this.deriveNonCompliantChild(se,pe)},te.prototype.deriveChild=function(se,pe){if(a.isNumber(se))return this._deriveWithNumber(se,pe);if(a.isString(se))return this._deriveFromString(se);throw new F.InvalidDerivationArgument(se)},te.prototype.deriveNonCompliantChild=function(se,pe){if(a.isNumber(se))return this._deriveWithNumber(se,pe,!0);if(a.isString(se))return this._deriveFromString(se,!0);throw new F.InvalidDerivationArgument(se)},te.prototype._deriveWithNumber=function(se,pe,me){if(!te.isValidPath(se,pe))throw new F.InvalidPath(se);pe=se>=te.Hardened?!0:pe,se<te.Hardened&&pe===!0&&(se+=te.Hardened);var Ee=U.integerAsBuffer(se),V;if(pe&&me){var ae=this.privateKey.bn.toBuffer();V=U.concat([Buffer$N.from([0]),ae,Ee])}else if(pe){var ne=this.privateKey.bn.toBuffer({size:32});t(ne.length===32,"length of private key buffer is expected to be 32 bytes"),V=U.concat([Buffer$N.from([0]),ne,Ee])}else V=U.concat([this.publicKey.toBuffer(),Ee]);var M=m.sha512hmac(V,this._buffers.chainCode),v=d.fromBuffer(M.slice(0,32),{size:32}),S=M.slice(32,64),y=v.add(this.privateKey.toBigNumber()).umod(O.getN()).toBuffer({size:32});if(!T.isValid(y))return this._deriveWithNumber(se+1,null,me);var w=new te({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:se,chainCode:S,privateKey:y});return w},te.prototype._deriveFromString=function(se,pe){if(!te.isValidPath(se))throw new F.InvalidPath(se);var me=te._getDerivationIndexes(se),Ee=me.reduce(function(V,ae){return V._deriveWithNumber(ae,null,pe)},this);return Ee},te.isValidSerialized=function(se,pe){return!te.getSerializedError(se,pe)},te.getSerializedError=function(se,pe){if(!(a.isString(se)||U.isBuffer(se)))return new F.UnrecognizedArgument("Expected string or buffer");if(!c.validCharacters(se))return new j.InvalidB58Char("(unknown)",se);try{se=l.decode(se)}catch{return new j.InvalidB58Checksum(se)}if(se.length!==te.DataLength)return new F.InvalidLength(se);if(!a.isUndefined(pe)){var me=te._validateNetwork(se,pe);if(me)return me}return null},te._validateNetwork=function(se,pe){var me=I.get(pe);if(!me)return new j.InvalidNetworkArgument(pe);var Ee=se.slice(0,4);return U.integerFromBuffer(Ee)!==me.xprivkey?new j.InvalidNetwork(Ee):null},te.fromString=function(se){return u.checkArgument(a.isString(se),"No valid string was provided"),new te(se)},te.fromObject=function(se){return u.checkArgument(a.isObject(se),"No valid argument was provided"),new te(se)},te.prototype._buildFromJSON=function(se){return this._buildFromObject(JSON.parse(se))},te.prototype._buildFromObject=function(se){var pe={version:se.network?U.integerAsBuffer(I.get(se.network).xprivkey):se.version,depth:a.isNumber(se.depth)?U.integerAsSingleByteBuffer(se.depth):se.depth,parentFingerPrint:a.isNumber(se.parentFingerPrint)?U.integerAsBuffer(se.parentFingerPrint):se.parentFingerPrint,childIndex:a.isNumber(se.childIndex)?U.integerAsBuffer(se.childIndex):se.childIndex,chainCode:a.isString(se.chainCode)?Buffer$N.from(se.chainCode,"hex"):se.chainCode,privateKey:a.isString(se.privateKey)&&Z.isHexa(se.privateKey)?Buffer$N.from(se.privateKey,"hex"):se.privateKey,checksum:se.checksum?se.checksum.length?se.checksum:U.integerAsBuffer(se.checksum):void 0};return this._buildFromBuffers(pe)},te.prototype._buildFromSerialized=function(se){var pe=l.decode(se),me={version:pe.slice(te.VersionStart,te.VersionEnd),depth:pe.slice(te.DepthStart,te.DepthEnd),parentFingerPrint:pe.slice(te.ParentFingerPrintStart,te.ParentFingerPrintEnd),childIndex:pe.slice(te.ChildIndexStart,te.ChildIndexEnd),chainCode:pe.slice(te.ChainCodeStart,te.ChainCodeEnd),privateKey:pe.slice(te.PrivateKeyStart,te.PrivateKeyEnd),checksum:pe.slice(te.ChecksumStart,te.ChecksumEnd),xprivkey:se};return this._buildFromBuffers(me)},te.prototype._generateRandomly=function(se){return te.fromSeed(C.getRandomBuffer(64),se)},te.fromSeed=function(se,pe){if(Z.isHexaString(se)&&(se=Buffer$N.from(se,"hex")),!Buffer$N.isBuffer(se))throw new F.InvalidEntropyArgument(se);if(se.length<J*X)throw new F.InvalidEntropyArgument.NotEnoughEntropy(se);if(se.length>Q*X)throw new F.InvalidEntropyArgument.TooMuchEntropy(se);var me=m.sha512hmac(se,Buffer$N.from("Bitcoin seed"));return new te({network:I.get(pe)||I.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:me.slice(0,32),chainCode:me.slice(32,64)})},te.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var se=requireHdpublickey();this._hdPublicKey=new se(this)}},te.prototype._buildFromBuffers=function(se){te._validateBufferArguments(se),Z.defineImmutable(this,{_buffers:se});var pe=[se.version,se.depth,se.parentFingerPrint,se.childIndex,se.chainCode,U.emptyBuffer(1),se.privateKey],me=e.Buffer.concat(pe);if(!se.checksum||!se.checksum.length)se.checksum=l.checksum(me);else if(se.checksum.toString()!==l.checksum(me).toString())throw new j.InvalidB58Checksum(me);var Ee=I.get(U.integerFromBuffer(se.version)),V;V=l.encode(e.Buffer.concat(pe)),se.xprivkey=Buffer$N.from(V);var ae=new T(d.fromBuffer(se.privateKey),Ee),ne=ae.toPublicKey(),M=te.ParentFingerPrintSize,v=m.sha256ripemd160(ne.toBuffer()).slice(0,M);return Z.defineImmutable(this,{xprivkey:V,network:Ee,depth:U.integerFromSingleByteBuffer(se.depth),privateKey:ae,publicKey:ne,fingerPrint:v}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},te._validateBufferArguments=function(se){var pe=function(me,Ee){var V=se[me];t(U.isBuffer(V),me+" argument is not a buffer"),t(V.length===Ee,me+" has not the expected size: found "+V.length+", expected "+Ee)};pe("version",te.VersionSize),pe("depth",te.DepthSize),pe("parentFingerPrint",te.ParentFingerPrintSize),pe("childIndex",te.ChildIndexSize),pe("chainCode",te.ChainCodeSize),pe("privateKey",te.PrivateKeySize),se.checksum&&se.checksum.length&&pe("checksum",te.CheckSumSize)},te.prototype.toString=function(){return this.xprivkey},te.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"},te.prototype.toObject=te.prototype.toJSON=function(){return{network:I.get(U.integerFromBuffer(this._buffers.version),"xprivkey").name,depth:U.integerFromSingleByteBuffer(this._buffers.depth),fingerPrint:U.integerFromBuffer(this.fingerPrint),parentFingerPrint:U.integerFromBuffer(this._buffers.parentFingerPrint),childIndex:U.integerFromBuffer(this._buffers.childIndex),chainCode:U.bufferToHex(this._buffers.chainCode),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:U.integerFromBuffer(this._buffers.checksum),xprivkey:this.xprivkey}},te.fromBuffer=function(se){return new te(se.toString())},te.prototype.toBuffer=function(){return U.copy(this._buffers.xprivkey)},te.DefaultDepth=0,te.DefaultFingerprint=0,te.DefaultChildIndex=0,te.Hardened=2147483648,te.MaxIndex=2*te.Hardened,te.RootElementAlias=["m","M","m'","M'"],te.VersionSize=4,te.DepthSize=1,te.ParentFingerPrintSize=4,te.ChildIndexSize=4,te.ChainCodeSize=32,te.PrivateKeySize=32,te.CheckSumSize=4,te.DataLength=78,te.SerializedByteSize=82,te.VersionStart=0,te.VersionEnd=te.VersionStart+te.VersionSize,te.DepthStart=te.VersionEnd,te.DepthEnd=te.DepthStart+te.DepthSize,te.ParentFingerPrintStart=te.DepthEnd,te.ParentFingerPrintEnd=te.ParentFingerPrintStart+te.ParentFingerPrintSize,te.ChildIndexStart=te.ParentFingerPrintEnd,te.ChildIndexEnd=te.ChildIndexStart+te.ChildIndexSize,te.ChainCodeStart=te.ChildIndexEnd,te.ChainCodeEnd=te.ChainCodeStart+te.ChainCodeSize,te.PrivateKeyStart=te.ChainCodeEnd+1,te.PrivateKeyEnd=te.PrivateKeyStart+te.PrivateKeySize,te.ChecksumStart=te.PrivateKeyEnd,te.ChecksumEnd=te.ChecksumStart+te.CheckSumSize,t(te.ChecksumEnd===te.SerializedByteSize),hdprivatekey=te,hdprivatekey}var _$1=lodashExports,PrivateKey=requirePrivatekey(),PublicKey=requirePublickey(),Address$1=requireAddress(),BufferWriter=bufferwriter,ECDSA=requireEcdsa(),Signature=signature$1,sha256sha256=hashExports.sha256sha256,JSUtil=js,$=preconditions;function Message(t){return this instanceof Message?($.checkArgument(_$1.isString(t),"First argument should be a string"),this.message=t,this):new Message(t)}Message.MAGIC_BYTES=Buffer$N.from(`Bitcoin Signed Message:
130
+ `),Message.prototype.magicHash=function t(){var e=BufferWriter.varintBufNum(Message.MAGIC_BYTES.length),a=Buffer$N.from(this.message),u=BufferWriter.varintBufNum(a.length),d=Buffer$N.concat([e,Message.MAGIC_BYTES,u,a]),c=sha256sha256(d);return c},Message.prototype._sign=function t(e){$.checkArgument(e instanceof PrivateKey,"First argument should be an instance of PrivateKey");var a=this.magicHash(),u=new ECDSA;return u.hashbuf=a,u.privkey=e,u.pubkey=e.toPublicKey(),u.signRandomK(),u.calci(),u.sig},Message.prototype.sign=function t(e){var a=this._sign(e);return a.toCompact().toString("base64")},Message.prototype._verify=function t(e,a){$.checkArgument(e instanceof PublicKey,"First argument should be an instance of PublicKey"),$.checkArgument(a instanceof Signature,"Second argument should be an instance of Signature");var u=this.magicHash(),d=ECDSA.verify(u,a,e);return d||(this.error="The signature was invalid"),d},Message.prototype.verify=function t(e,a){$.checkArgument(e),$.checkArgument(a&&_$1.isString(a)),_$1.isString(e)&&(e=Address$1.fromString(e));var u=Signature.fromCompact(Buffer$N.from(a,"base64")),d=new ECDSA;d.hashbuf=this.magicHash(),d.sig=u;var c=d.toPublicKey(),l=Address$1.fromPublicKey(c,e.network);return e.toString()!==l.toString()?(this.error="The signature did not match the message digest",!1):this._verify(c,u)},Message.prototype.recoverPublicKey=function t(e,a){$.checkArgument(e),$.checkArgument(a&&_$1.isString(a)),_$1.isString(e)&&(e=Address$1.fromString(e));var u=Signature.fromCompact(Buffer$N.from(a,"base64")),d=new ECDSA;d.hashbuf=this.magicHash(),d.sig=u;var c=d.toPublicKey(),l=Address$1.fromPublicKey(c,e.network);return e.toString()!==l.toString()&&(this.error="The signature did not match the message digest"),c.toString()},Message.fromString=function(t){return new Message(t)},Message.fromJSON=function t(e){return JSUtil.isValidJSON(e)&&(e=JSON.parse(e)),new Message(e.message)},Message.prototype.toObject=function t(){return{message:this.message}},Message.prototype.toJSON=function t(){return JSON.stringify(this.toObject())},Message.prototype.toString=function(){return this.message},Message.prototype.inspect=function(){return"<Message: "+this.toString()+">"};var message=Message;requireScript();var punycode$1={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */punycode$1.exports,function(t,e){(function(a){var u=e&&!e.nodeType&&e,d=t&&!t.nodeType&&t,c=typeof commonjsGlobal=="object"&&commonjsGlobal;(c.global===c||c.window===c||c.self===c)&&(a=c);var l,m=2147483647,I=36,O=1,T=26,C=38,j=700,F=72,U=128,Z="-",J=/^xn--/,X=/[^\x20-\x7E]/,Q=/[\x2E\u3002\uFF0E\uFF61]/g,te={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},se=I-O,pe=Math.floor,me=String.fromCharCode,Ee;function V(A){throw new RangeError(te[A])}function ae(A,D){for(var H=A.length,Y=[];H--;)Y[H]=D(A[H]);return Y}function ne(A,D){var H=A.split("@"),Y="";H.length>1&&(Y=H[0]+"@",A=H[1]),A=A.replace(Q,".");var le=A.split("."),_e=ae(le,D).join(".");return Y+_e}function M(A){for(var D=[],H=0,Y=A.length,le,_e;H<Y;)le=A.charCodeAt(H++),le>=55296&&le<=56319&&H<Y?(_e=A.charCodeAt(H++),(_e&64512)==56320?D.push(((le&1023)<<10)+(_e&1023)+65536):(D.push(le),H--)):D.push(le);return D}function v(A){return ae(A,function(D){var H="";return D>65535&&(D-=65536,H+=me(D>>>10&1023|55296),D=56320|D&1023),H+=me(D),H}).join("")}function S(A){return A-48<10?A-22:A-65<26?A-65:A-97<26?A-97:I}function y(A,D){return A+22+75*(A<26)-((D!=0)<<5)}function w(A,D,H){var Y=0;for(A=H?pe(A/j):A>>1,A+=pe(A/D);A>se*T>>1;Y+=I)A=pe(A/se);return pe(Y+(se+1)*A/(A+C))}function P(A){var D=[],H=A.length,Y,le=0,_e=U,he=F,fe,ve,ge,Ie,ue,ce,Te,ke,He;for(fe=A.lastIndexOf(Z),fe<0&&(fe=0),ve=0;ve<fe;++ve)A.charCodeAt(ve)>=128&&V("not-basic"),D.push(A.charCodeAt(ve));for(ge=fe>0?fe+1:0;ge<H;){for(Ie=le,ue=1,ce=I;ge>=H&&V("invalid-input"),Te=S(A.charCodeAt(ge++)),(Te>=I||Te>pe((m-le)/ue))&&V("overflow"),le+=Te*ue,ke=ce<=he?O:ce>=he+T?T:ce-he,!(Te<ke);ce+=I)He=I-ke,ue>pe(m/He)&&V("overflow"),ue*=He;Y=D.length+1,he=w(le-Ie,Y,Ie==0),pe(le/Y)>m-_e&&V("overflow"),_e+=pe(le/Y),le%=Y,D.splice(le++,0,_e)}return v(D)}function L(A){var D,H,Y,le,_e,he,fe,ve,ge,Ie,ue,ce=[],Te,ke,He,Qe;for(A=M(A),Te=A.length,D=U,H=0,_e=F,he=0;he<Te;++he)ue=A[he],ue<128&&ce.push(me(ue));for(Y=le=ce.length,le&&ce.push(Z);Y<Te;){for(fe=m,he=0;he<Te;++he)ue=A[he],ue>=D&&ue<fe&&(fe=ue);for(ke=Y+1,fe-D>pe((m-H)/ke)&&V("overflow"),H+=(fe-D)*ke,D=fe,he=0;he<Te;++he)if(ue=A[he],ue<D&&++H>m&&V("overflow"),ue==D){for(ve=H,ge=I;Ie=ge<=_e?O:ge>=_e+T?T:ge-_e,!(ve<Ie);ge+=I)Qe=ve-Ie,He=I-Ie,ce.push(me(y(Ie+Qe%He,0))),ve=pe(Qe/He);ce.push(me(y(ve,0))),_e=w(H,ke,Y==le),H=0,++Y}++H,++D}return ce.join("")}function N(A){return ne(A,function(D){return J.test(D)?P(D.slice(4).toLowerCase()):D})}function E(A){return ne(A,function(D){return X.test(D)?"xn--"+L(D):D})}if(l={version:"1.4.1",ucs2:{decode:M,encode:v},decode:P,encode:L,toASCII:E,toUnicode:N},u&&d)if(t.exports==u)d.exports=l;else for(Ee in l)l.hasOwnProperty(Ee)&&(u[Ee]=l[Ee]);else a.punycode=l})(commonjsGlobal)}(punycode$1,punycode$1.exports);var punycodeExports=punycode$1.exports;const require$$0=getDefaultExportFromCjs$1(punycodeExports);function hasOwnProperty(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var decode$1=function(t,e,a,u){e=e||"&",a=a||"=";var d={};if(typeof t!="string"||t.length===0)return d;var c=/\+/g;t=t.split(e);var l=1e3;u&&typeof u.maxKeys=="number"&&(l=u.maxKeys);var m=t.length;l>0&&m>l&&(m=l);for(var I=0;I<m;++I){var O=t[I].replace(c,"%20"),T=O.indexOf(a),C,j,F,U;T>=0?(C=O.substr(0,T),j=O.substr(T+1)):(C=O,j=""),F=decodeURIComponent(C),U=decodeURIComponent(j),hasOwnProperty(d,F)?isArray$1(d[F])?d[F].push(U):d[F]=[d[F],U]:d[F]=U}return d},isArray$1=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"},stringifyPrimitive=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},encode$1=function(t,e,a,u){return e=e||"&",a=a||"=",t===null&&(t=void 0),typeof t=="object"?map(objectKeys(t),function(d){var c=encodeURIComponent(stringifyPrimitive(d))+a;return isArray(t[d])?map(t[d],function(l){return c+encodeURIComponent(stringifyPrimitive(l))}).join(e):c+encodeURIComponent(stringifyPrimitive(t[d]))}).join(e):u?encodeURIComponent(stringifyPrimitive(u))+a+encodeURIComponent(stringifyPrimitive(t)):""},isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function map(t,e){if(t.map)return t.map(e);for(var a=[],u=0;u<t.length;u++)a.push(e(t[u],u));return a}var objectKeys=Object.keys||function(t){var e=[];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.push(a);return e},stringify,parse$1,decode=parse$1=decode$1,encode=stringify=encode$1;function qsEscape(t){return encodeURIComponent(t)}function qsUnescape(t){return decodeURIComponent(t)}var api$1={decode,encode,parse:parse$1,stringify,escape:qsEscape,unescape:qsUnescape},util$1={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}},punycode=require$$0,util=util$1,parse=urlParse,resolve$1=urlResolve,resolveObject=urlResolveObject,format=urlFormat,Url_1=Url;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r",`
131
+ `," "],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=api$1;function urlParse(t,e,a){if(t&&util.isObject(t)&&t instanceof Url)return t;var u=new Url;return u.parse(t,e,a),u}Url.prototype.parse=function(t,e,a){if(!util.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var u=t.indexOf("?"),d=u!==-1&&u<t.indexOf("#")?"?":"#",c=t.split(d),l=/\\/g;c[0]=c[0].replace(l,"/"),t=c.join(d);var m=t;if(m=m.trim(),!a&&t.split("#").length===1){var I=simplePathPattern.exec(m);if(I)return this.path=m,this.href=m,this.pathname=I[1],I[2]?(this.search=I[2],e?this.query=querystring.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var O=protocolPattern.exec(m);if(O){O=O[0];var T=O.toLowerCase();this.protocol=T,m=m.substr(O.length)}if(a||O||m.match(/^\/\/[^@\/]+@[^@\/]+/)){var C=m.substr(0,2)==="//";C&&!(O&&hostlessProtocol[O])&&(m=m.substr(2),this.slashes=!0)}if(!hostlessProtocol[O]&&(C||O&&!slashedProtocol[O])){for(var j=-1,F=0;F<hostEndingChars.length;F++){var U=m.indexOf(hostEndingChars[F]);U!==-1&&(j===-1||U<j)&&(j=U)}var Z,J;j===-1?J=m.lastIndexOf("@"):J=m.lastIndexOf("@",j),J!==-1&&(Z=m.slice(0,J),m=m.slice(J+1),this.auth=decodeURIComponent(Z)),j=-1;for(var F=0;F<nonHostChars.length;F++){var U=m.indexOf(nonHostChars[F]);U!==-1&&(j===-1||U<j)&&(j=U)}j===-1&&(j=m.length),this.host=m.slice(0,j),m=m.slice(j),this.parseHost(),this.hostname=this.hostname||"";var X=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!X)for(var Q=this.hostname.split(/\./),F=0,te=Q.length;F<te;F++){var se=Q[F];if(se&&!se.match(hostnamePartPattern)){for(var pe="",me=0,Ee=se.length;me<Ee;me++)se.charCodeAt(me)>127?pe+="x":pe+=se[me];if(!pe.match(hostnamePartPattern)){var V=Q.slice(0,F),ae=Q.slice(F+1),ne=se.match(hostnamePartStart);ne&&(V.push(ne[1]),ae.unshift(ne[2])),ae.length&&(m="/"+ae.join(".")+m),this.hostname=V.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),X||(this.hostname=punycode.toASCII(this.hostname));var M=this.port?":"+this.port:"",v=this.hostname||"";this.host=v+M,this.href+=this.host,X&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),m[0]!=="/"&&(m="/"+m))}if(!unsafeProtocol[T])for(var F=0,te=autoEscape.length;F<te;F++){var S=autoEscape[F];if(m.indexOf(S)!==-1){var y=encodeURIComponent(S);y===S&&(y=escape(S)),m=m.split(S).join(y)}}var w=m.indexOf("#");w!==-1&&(this.hash=m.substr(w),m=m.slice(0,w));var P=m.indexOf("?");if(P!==-1?(this.search=m.substr(P),this.query=m.substr(P+1),e&&(this.query=querystring.parse(this.query)),m=m.slice(0,P)):e&&(this.search="",this.query={}),m&&(this.pathname=m),slashedProtocol[T]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var M=this.pathname||"",L=this.search||"";this.path=M+L}return this.href=this.format(),this};function urlFormat(t){return util.isString(t)&&(t=urlParse(t)),t instanceof Url?t.format():Url.prototype.format.call(t)}Url.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",a=this.pathname||"",u=this.hash||"",d=!1,c="";this.host?d=t+this.host:this.hostname&&(d=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(d+=":"+this.port)),this.query&&util.isObject(this.query)&&Object.keys(this.query).length&&(c=querystring.stringify(this.query));var l=this.search||c&&"?"+c||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||slashedProtocol[e])&&d!==!1?(d="//"+(d||""),a&&a.charAt(0)!=="/"&&(a="/"+a)):d||(d=""),u&&u.charAt(0)!=="#"&&(u="#"+u),l&&l.charAt(0)!=="?"&&(l="?"+l),a=a.replace(/[?#]/g,function(m){return encodeURIComponent(m)}),l=l.replace("#","%23"),e+d+a+l+u};function urlResolve(t,e){return urlParse(t,!1,!0).resolve(e)}Url.prototype.resolve=function(t){return this.resolveObject(urlParse(t,!1,!0)).format()};function urlResolveObject(t,e){return t?urlParse(t,!1,!0).resolveObject(e):e}Url.prototype.resolveObject=function(t){if(util.isString(t)){var e=new Url;e.parse(t,!1,!0),t=e}for(var a=new Url,u=Object.keys(this),d=0;d<u.length;d++){var c=u[d];a[c]=this[c]}if(a.hash=t.hash,t.href==="")return a.href=a.format(),a;if(t.slashes&&!t.protocol){for(var l=Object.keys(t),m=0;m<l.length;m++){var I=l[m];I!=="protocol"&&(a[I]=t[I])}return slashedProtocol[a.protocol]&&a.hostname&&!a.pathname&&(a.path=a.pathname="/"),a.href=a.format(),a}if(t.protocol&&t.protocol!==a.protocol){if(!slashedProtocol[t.protocol]){for(var O=Object.keys(t),T=0;T<O.length;T++){var C=O[T];a[C]=t[C]}return a.href=a.format(),a}if(a.protocol=t.protocol,!t.host&&!hostlessProtocol[t.protocol]){for(var te=(t.pathname||"").split("/");te.length&&!(t.host=te.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),te[0]!==""&&te.unshift(""),te.length<2&&te.unshift(""),a.pathname=te.join("/")}else a.pathname=t.pathname;if(a.search=t.search,a.query=t.query,a.host=t.host||"",a.auth=t.auth,a.hostname=t.hostname||t.host,a.port=t.port,a.pathname||a.search){var j=a.pathname||"",F=a.search||"";a.path=j+F}return a.slashes=a.slashes||t.slashes,a.href=a.format(),a}var U=a.pathname&&a.pathname.charAt(0)==="/",Z=t.host||t.pathname&&t.pathname.charAt(0)==="/",J=Z||U||a.host&&t.pathname,X=J,Q=a.pathname&&a.pathname.split("/")||[],te=t.pathname&&t.pathname.split("/")||[],se=a.protocol&&!slashedProtocol[a.protocol];if(se&&(a.hostname="",a.port=null,a.host&&(Q[0]===""?Q[0]=a.host:Q.unshift(a.host)),a.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(te[0]===""?te[0]=t.host:te.unshift(t.host)),t.host=null),J=J&&(te[0]===""||Q[0]==="")),Z)a.host=t.host||t.host===""?t.host:a.host,a.hostname=t.hostname||t.hostname===""?t.hostname:a.hostname,a.search=t.search,a.query=t.query,Q=te;else if(te.length)Q||(Q=[]),Q.pop(),Q=Q.concat(te),a.search=t.search,a.query=t.query;else if(!util.isNullOrUndefined(t.search)){if(se){a.hostname=a.host=Q.shift();var pe=a.host&&a.host.indexOf("@")>0?a.host.split("@"):!1;pe&&(a.auth=pe.shift(),a.host=a.hostname=pe.shift())}return a.search=t.search,a.query=t.query,(!util.isNull(a.pathname)||!util.isNull(a.search))&&(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a}if(!Q.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(var me=Q.slice(-1)[0],Ee=(a.host||t.host||Q.length>1)&&(me==="."||me==="..")||me==="",V=0,ae=Q.length;ae>=0;ae--)me=Q[ae],me==="."?Q.splice(ae,1):me===".."?(Q.splice(ae,1),V++):V&&(Q.splice(ae,1),V--);if(!J&&!X)for(;V--;V)Q.unshift("..");J&&Q[0]!==""&&(!Q[0]||Q[0].charAt(0)!=="/")&&Q.unshift(""),Ee&&Q.join("/").substr(-1)!=="/"&&Q.push("");var ne=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";if(se){a.hostname=a.host=ne?"":Q.length?Q.shift():"";var pe=a.host&&a.host.indexOf("@")>0?a.host.split("@"):!1;pe&&(a.auth=pe.shift(),a.host=a.hostname=pe.shift())}return J=J||a.host&&Q.length,J&&!ne&&Q.unshift(""),Q.length?a.pathname=Q.join("/"):(a.pathname=null,a.path=null),(!util.isNull(a.pathname)||!util.isNull(a.search))&&(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=t.auth||a.auth,a.slashes=a.slashes||t.slashes,a.href=a.format(),a},Url.prototype.parseHost=function(){var t=this.host,e=portPattern.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};function normalizeArray(t,e){for(var a=0,u=t.length-1;u>=0;u--){var d=t[u];d==="."?t.splice(u,1):d===".."?(t.splice(u,1),a++):a&&(t.splice(u,1),a--)}if(e)for(;a--;a)t.unshift("..");return t}function resolve(){for(var t="",e=!1,a=arguments.length-1;a>=-1&&!e;a--){var u=a>=0?arguments[a]:"/";if(typeof u!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!u)continue;t=u+"/"+t,e=u.charAt(0)==="/"}return t=normalizeArray(filter(t.split("/"),function(d){return!!d}),!e).join("/"),(e?"/":"")+t||"."}function filter(t,e){if(t.filter)return t.filter(e);for(var a=[],u=0;u<t.length;u++)e(t[u],u,t)&&a.push(t[u]);return a}var _globalThis=function(t){function e(){var u=this||self;return delete t.prototype.__magic__,u}if(typeof globalThis=="object")return globalThis;if(this)return e();t.defineProperty(t.prototype,"__magic__",{configurable:!0,get:e});var a=__magic__;return a}(Object),formatImport=format,parseImport=parse,resolveImport=resolve$1,UrlImport=Url_1,URL$2=_globalThis.URL,URLSearchParams$1=_globalThis.URLSearchParams,percentRegEx=/%/g,backslashRegEx=/\\/g,newlineRegEx=/\n/g,carriageReturnRegEx=/\r/g,tabRegEx=/\t/g,CHAR_FORWARD_SLASH=47;function isURLInstance(t){var e=t??null;return!!(e!==null&&(e!=null&&e.href)&&(e!=null&&e.origin))}function getPathFromURLPosix(t){if(t.hostname!=="")throw new TypeError('File URL host must be "localhost" or empty on browser');for(var e=t.pathname,a=0;a<e.length;a++)if(e[a]==="%"){var u=e.codePointAt(a+2)|32;if(e[a+1]==="2"&&u===102)throw new TypeError("File URL path must not include encoded / characters")}return decodeURIComponent(e)}function encodePathChars(t){return t.includes("%")&&(t=t.replace(percentRegEx,"%25")),t.includes("\\")&&(t=t.replace(backslashRegEx,"%5C")),t.includes(`
132
+ `)&&(t=t.replace(newlineRegEx,"%0A")),t.includes("\r")&&(t=t.replace(carriageReturnRegEx,"%0D")),t.includes(" ")&&(t=t.replace(tabRegEx,"%09")),t}var domainToASCII=function t(e){if(typeof e>"u")throw new TypeError('The "domain" argument must be specified');return new URL$2("http://"+e).hostname},domainToUnicode=function t(e){if(typeof e>"u")throw new TypeError('The "domain" argument must be specified');return new URL$2("http://"+e).hostname},pathToFileURL=function t(e){var a=new URL$2("file://"),u=resolve(e),d=e.charCodeAt(e.length-1);return d===CHAR_FORWARD_SLASH&&u[u.length-1]!=="/"&&(u+="/"),a.pathname=encodePathChars(u),a},fileURLToPath=function t(e){if(!isURLInstance(e)&&typeof e!="string")throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof e+" ("+e+")");var a=new URL$2(e);if(a.protocol!=="file:")throw new TypeError("The URL must be of scheme file");return getPathFromURLPosix(a)},formatImportWithOverloads=function t(e,a){var u,d,c;if(a===void 0&&(a={}),!(e instanceof URL$2))return formatImport(e);if(typeof a!="object"||a===null)throw new TypeError('The "options" argument must be of type object.');var l=(u=a.auth)!=null?u:!0,m=(d=a.fragment)!=null?d:!0,I=(c=a.search)!=null?c:!0,O=new URL$2(e.toString());return l||(O.username="",O.password=""),m||(O.hash=""),I||(O.search=""),O.toString()},api={format:formatImportWithOverloads,parse:parseImport,resolve:resolveImport,resolveObject,Url:UrlImport,URL:URL$2,URLSearchParams:URLSearchParams$1,domainToASCII,domainToUnicode,pathToFileURL,fileURLToPath};const url=Object.freeze(Object.defineProperty({__proto__:null,URL:URL$2,URLSearchParams:URLSearchParams$1,Url:UrlImport,default:api,domainToASCII,domainToUnicode,fileURLToPath,format:formatImportWithOverloads,parse:parseImport,pathToFileURL,resolve:resolveImport,resolveObject},Symbol.toStringTag,{value:"Module"})),require$$1=getAugmentedNamespace(url);var _=lodashExports,URL$1=require$$1,Address=requireAddress(),Unit=unit,URI=function(t,e){if(!(this instanceof URI))return new URI(t,e);if(this.extras={},this.knownParams=e||[],this.address=this.network=this.amount=this.message=null,typeof t=="string"){var a=URI.parse(t);a.amount&&(a.amount=this._parseAmount(a.amount)),this._fromObject(a)}else if(typeof t=="object")this._fromObject(t);else throw new TypeError("Unrecognized data format.")};URI.fromString=function t(e){if(typeof e!="string")throw new TypeError("Expected a string");return new URI(e)},URI.fromObject=function t(e){return new URI(e)},URI.isValid=function(t,e){try{new URI(t,e)}catch{return!1}return!0},URI.parse=function(t){var e=URL$1.parse(t,!0);if(e.protocol!=="bitcoin:")throw new TypeError("Invalid bitcoin URI");var a=/[^:]*:\/?\/?([^?]*)/.exec(t);return e.query.address=a&&a[1]||void 0,e.query},URI.Members=["address","amount","message","label","r"],URI.prototype._fromObject=function(t){if(!Address.isValid(t.address))throw new TypeError("Invalid bitcoin address");this.address=new Address(t.address),this.network=this.address.network,this.amount=t.amount;for(var e in t)if(!(e==="address"||e==="amount")){if(/^req-/.exec(e)&&this.knownParams.indexOf(e)===-1)throw Error("Unknown required argument "+e);var a=URI.Members.indexOf(e)>-1?this:this.extras;a[e]=t[e]}},URI.prototype._parseAmount=function(t){if(t=Number(t),isNaN(t))throw new TypeError("Invalid amount");return Unit.fromBTC(t).toSatoshis()},URI.prototype.toObject=URI.prototype.toJSON=function t(){for(var e={},a=0;a<URI.Members.length;a++){var u=URI.Members[a];this.hasOwnProperty(u)&&typeof this[u]<"u"&&(e[u]=this[u].toString())}return _.extend(e,this.extras),e},URI.prototype.toString=function(){var t={};return this.amount&&(t.amount=Unit.fromSatoshis(this.amount).toBTC()),this.message&&(t.message=this.message),this.label&&(t.label=this.label),this.r&&(t.r=this.r),_.extend(t,this.extras),URL$1.format({protocol:"bitcoin:",host:this.address,query:t})},URI.prototype.inspect=function(){return"<URI: "+this.toString()+">"};var uri=URI;(function(t){var e=t.exports;e.version="v"+require$$0$3.version,e.versionGuard=function(a){if(a!==void 0){var u="More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.";throw new Error(u)}},e.versionGuard(commonjsGlobal._bitcore),commonjsGlobal._bitcore=e.version,e.crypto={},e.crypto.BN=bn$1,e.crypto.ECDSA=requireEcdsa(),e.crypto.Hash=hashExports,e.crypto.Random=random,e.crypto.Point=point$1,e.crypto.Signature=signature$1,e.encoding={},e.encoding.Base58=base58,e.encoding.Base58Check=base58check,e.encoding.BufferReader=bufferreader,e.encoding.BufferWriter=bufferwriter,e.encoding.Varint=varint,e.util={},e.util.buffer=bufferExports,e.util.js=js,e.util.preconditions=preconditions,e.errors=errorsExports,e.Address=requireAddress(),e.Block=blockExports,e.MerkleBlock=merkleblock,e.BlockHeader=blockheader,e.HDPrivateKey=requireHdprivatekey(),e.HDPublicKey=requireHdpublickey(),e.Message=message,e.Networks=networks_1,e.Opcode=opcode,e.PrivateKey=requirePrivatekey(),e.PublicKey=requirePublickey(),e.Script=requireScript(),e.Transaction=requireTransaction(),e.URI=uri,e.Unit=unit,e.deps={},e.deps.bnjs=bnExports$1,e.deps.bs58=bs58$1,e.deps.Buffer=Buffer$N,e.deps.elliptic=elliptic,e.deps._=lodashExports,e.Transaction.sighash=requireSighash()})(bitcoreLib);var bitcoreLibExports=bitcoreLib.exports;class TransactionSigner{constructor(e,a){Tt(this,"rawData");Tt(this,"signedData");Tt(this,"provider");this.rawData=e,this.provider=a??Provider.instance}async sign(e){return this.rawData.bitcoreLib.sign(e),this.signedData=this.rawData.bitcoreLib.serialize(),this}async send(){var e;try{return(await axios({method:"POST",url:"https://blockstream.info/testnet/api/tx",data:this.signedData})).data}catch(a){throw new Error(JSON.stringify((e=a.response)==null?void 0:e.data))}}getRawData(){return this.rawData}getSignedData(){return this.signedData??""}}class Coin{constructor(e){Tt(this,"provider");this.provider=e??Provider.instance}getName(){return"Bitcoin"}getSymbol(){return"BTC"}getDecimals(){return 8}async getBalance(e){const a=this.provider.createEndpoint("address/"+e),u=await axios.get(a).then(c=>c.data),d=u.chain_stats.funded_txo_sum-u.chain_stats.spent_txo_sum;return fromSatoshi(d)}async transfer(e,a,u){if(u<0)throw new Error(ErrorTypeEnum.INVALID_AMOUNT);if(u>await this.getBalance(e))throw new Error(ErrorTypeEnum.INSUFFICIENT_BALANCE);if(e===a)throw new Error(ErrorTypeEnum.INVALID_ADDRESS);const d=[],c=new bitcoreLibExports.Transaction,l=new bitcoreLibExports.Address(e),m=toSatoshi(u),I=await axios.get(this.provider.createEndpoint("address/"+e+"/utxo")).then(O=>O.data);for(const O of I)d.push(new bitcoreLibExports.Transaction.UnspentOutput({txId:O.txid,satoshis:O.value,address:l,outputIndex:O.vout,script:bitcoreLibExports.Script.fromAddress(l)}));return c.from(d),c.change(e),c.to(a,m),new TransactionSigner({sender:e,receiver:a,amount:m,bitcoreLib:c})}}const index$2=Object.freeze(Object.defineProperty({__proto__:null,Coin},Symbol.toStringTag,{value:"Module"}));let counter=0;class Transaction{constructor(e,a){Tt(this,"id");Tt(this,"provider");Tt(this,"data",null);this.id=e,this.provider=a??Provider.instance}async getData(){var e;if(this.data!==null)return this.data;try{const a=(await axios.get(this.provider.createEndpoint("tx/"+this.id))).data;return(a==null?void 0:a.txid)!==this.id?this.data=null:this.data=a}catch(a){const u=a;if(String((e=u==null?void 0:u.response)==null?void 0:e.data).includes("Transaction not found")){if(counter>5)throw new Error(ErrorTypeEnum.TRANSACTION_NOT_FOUND);return counter++,await sleep(2e3),await this.getData()}throw new Error(ErrorTypeEnum.RPC_REQUEST_ERROR)}}async wait(e=4e3){return await new Promise((a,u)=>{const d=async()=>{try{const c=await this.getStatus();if(c===TransactionStatusEnum.CONFIRMED){a(TransactionStatusEnum.CONFIRMED);return}else if(c===TransactionStatusEnum.FAILED){u(TransactionStatusEnum.FAILED);return}setTimeout(d,e)}catch{u(TransactionStatusEnum.FAILED)}};d()})}getId(){return this.id}async getType(){return TransactionTypeEnum.COIN}getUrl(){return this.provider.explorer+"tx/"+this.id}async getSigner(){const e=await this.getData();return(e==null?void 0:e.vin[0].prevout.scriptpubkey_address)??""}async getFee(){const e=await this.getData();return fromSatoshi((e==null?void 0:e.fee)??0)}async getBlockNumber(){var a;const e=await this.getData();return((a=e==null?void 0:e.status)==null?void 0:a.block_height)??0}async getBlockTimestamp(){var a;const e=await this.getData();return((a=e==null?void 0:e.status)==null?void 0:a.block_time)??0}async getBlockConfirmationCount(){var u;const e=await this.getData();return e===null?0:(await axios.get(this.provider.createEndpoint("blocks/tip/height"))).data-((u=e==null?void 0:e.status)==null?void 0:u.block_height)}async getStatus(){var a;const e=await this.getData();return e===null?TransactionStatusEnum.PENDING:((a=e.status)==null?void 0:a.block_height)!==void 0?e.status.confirmed?TransactionStatusEnum.CONFIRMED:TransactionStatusEnum.FAILED:TransactionStatusEnum.PENDING}}class CoinTransaction extends Transaction{async getReceiver(){const e=await this.getData();return(e==null?void 0:e.vout[0].scriptpubkey_address)??""}async getSender(){return await this.getSigner()}async getAmount(){const e=await this.getData();return fromSatoshi((e==null?void 0:e.vout[0].value)??0)}async verifyTransfer(e,a,u){if(await this.getStatus()===TransactionStatusEnum.PENDING)return TransactionStatusEnum.PENDING;if(await this.getAmount()!==u)return TransactionStatusEnum.FAILED;if(e===AssetDirectionEnum.INCOMING){if((await this.getReceiver()).toLowerCase()!==a.toLowerCase())return TransactionStatusEnum.FAILED}else if((await this.getSender()).toLowerCase()!==a.toLowerCase())return TransactionStatusEnum.FAILED;return TransactionStatusEnum.CONFIRMED}}const index$1=Object.freeze(Object.defineProperty({__proto__:null,CoinTransaction,Transaction},Symbol.toStringTag,{value:"Module"}));class TransactionListener{constructor(e,a,u){Tt(this,"type");Tt(this,"provider");Tt(this,"status",!1);Tt(this,"callbacks",[]);Tt(this,"triggeredTransactions",[]);Tt(this,"filter");Tt(this,"webSocket");Tt(this,"dynamicStop",()=>{});this.type=e,this.filter=a??{},this.provider=u??Provider.instance}stop(){this.status&&(this.status=!1,this.dynamicStop())}start(){this.status||(this.status=!0,this[TransactionListenerProcessIndex[this.type]]())}getStatus(){return this.status}async on(e){if(this.webSocket===void 0)try{await checkWebSocket(this.provider.wsUrl),this.webSocket=new WebSocket$1(this.provider.wsUrl)}catch(a){throw new Error("WebSocket connection is not available"+(a instanceof Error?": "+a.message:""))}return this.start(),this.callbacks.push(e),!0}trigger(e){this.triggeredTransactions.includes(e.id)||(this.triggeredTransactions.push(e.id),this.callbacks.forEach(a=>{a(e)}))}isBlockCypherProcess(){return this.provider.isTestnet()||this.provider.blockCypherToken!==void 0}createMessage(e){let a;if(this.isBlockCypherProcess()){const u={event:"unconfirmed-tx",token:this.provider.blockCypherToken??this.provider.defaultBlockCypherToken};e!==void 0&&(u.address=e),a=JSON.stringify(u)}else a=JSON.stringify({op:"unconfirmed_sub"});return this.dynamicStop=()=>{this.isBlockCypherProcess()||this.webSocket.send(JSON.stringify({op:"unconfirmed_unsub"})),this.webSocket.close()},a}getValues(e){const a={txId:""};return this.isBlockCypherProcess()?(a.txId=e.hash,a.sender=e.inputs[0].addresses[0],a.receiver=e.outputs[0].addresses[0],a.amount=fromSatoshi(e.outputs[0].value)):(a.txId=e.x.hash,a.receiver=e.x.out[0].addr,a.sender=e.x.inputs[0].prev_out.addr,a.amount=fromSatoshi(e.x.out[0].value)),a}generalProcess(){const e=this.createMessage();this.webSocket.addEventListener("open",()=>{this.webSocket.send(e)}),this.webSocket.addEventListener("message",async a=>{var d;const u=this.getValues(JSON.parse(a.data));((d=this.filter)==null?void 0:d.signer)!==void 0&&u.sender!==this.filter.signer.toLowerCase()||this.trigger(new Transaction(u.txId))})}contractProcess(){throw new Error("This method is not implemented for Bitcoin.")}coinProcess(){const e=this.filter;if(e.signer!==void 0&&e.sender!==void 0&&e.signer!==e.sender)throw new Error("Sender and signer must be the same in coin transactions. Or only one of them can be defined.");const a=e.sender??e.signer,u=this.createMessage(e.receiver);this.webSocket.addEventListener("open",()=>{this.webSocket.send(u)}),this.webSocket.addEventListener("message",async d=>{var T,C;const c=JSON.parse(d.data),l={},m={};if(String(c.event).includes("events limit reached"))throw new Error("BlockCypher events limit reached.");const I=this.getValues(c);if(a!==void 0&&(l.sender=a.toLowerCase(),m.sender=(T=I.sender)==null?void 0:T.toLowerCase()),e.receiver!==void 0&&(l.receiver=e.receiver.toLowerCase(),m.receiver=(C=I.receiver)==null?void 0:C.toLowerCase()),!objectsEqual(l,m))return;const O=new CoinTransaction(I.txId);e.amount!==void 0&&I.amount!==e.amount||this.trigger(O)})}tokenProcess(){throw new Error("This method is not implemented for Bitcoin.")}nftProcess(){throw new Error("This method is not implemented for Bitcoin.")}}const index=Object.freeze(Object.defineProperty({__proto__:null,TransactionListener,TransactionSigner},Symbol.toStringTag,{value:"Module"})),adapters={},registerAdapter=t=>{if(Object.values(adapters).find(e=>e.id===t.id)!==void 0)throw new Error(`Adapter with id ${t.id} already exists`);adapters[t.id]=t},browser={Wallet,registerAdapter,adapters:Object.assign(adapters,adapterList)};exports.Provider=Provider,exports.assets=index$2,exports.browser=browser,exports.models=index$1,exports.services=index,exports.types=index$3,exports.utils=utils$n,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
133
+ //# sourceMappingURL=index.umd.js.map