@dodoex/wallet-web3 0.5.4 → 0.6.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 (84) hide show
  1. package/dist/__tslib-cf28c574.js +1 -0
  2. package/dist/{alchemy-provider-5870b6fa-7183581f.js → alchemy-provider-5870b6fa-e4fa48d3.js} +1 -1
  3. package/dist/{alchemy-websocket-provider-213da986-d5a91aac.js → alchemy-websocket-provider-213da986-dc2bcf5c.js} +1 -1
  4. package/dist/{blocto-0ec2fc36.js → blocto-2fb1d4e9.js} +1 -1
  5. package/dist/browser-3f7e560e.js +1 -0
  6. package/dist/{ccip-d1141d3a.js → ccip-3c08ea13.js} +1 -1
  7. package/dist/cjs/__tslib-c375fca0.cjs +1 -0
  8. package/dist/cjs/{alchemy-provider-5870b6fa-94b8a05d.cjs → alchemy-provider-5870b6fa-00140867.cjs} +1 -1
  9. package/dist/cjs/{alchemy-websocket-provider-213da986-cb2dca69.cjs → alchemy-websocket-provider-213da986-b2e3ea59.cjs} +1 -1
  10. package/dist/cjs/{blocto-c4470598.cjs → blocto-b086f036.cjs} +1 -1
  11. package/dist/cjs/browser-d0e333da.cjs +1 -0
  12. package/dist/cjs/{ccip-466d4e59.cjs → ccip-248539f9.cjs} +1 -1
  13. package/dist/cjs/{draggabilly-53856a31.cjs → draggabilly-f7eacd66.cjs} +1 -1
  14. package/dist/cjs/id-a6c483f9.cjs +1 -0
  15. package/dist/cjs/{index-9075d9c2.cjs → index-1a09310e.cjs} +1 -1
  16. package/dist/cjs/{index-6aa1755b.cjs → index-24e8d66c.cjs} +2 -2
  17. package/dist/cjs/index-2659a245.cjs +2 -0
  18. package/dist/cjs/{index-63b5eebb.cjs → index-54591c6b.cjs} +1 -1
  19. package/dist/cjs/{index-9d9946f3.cjs → index-83b277b8.cjs} +7 -7
  20. package/dist/cjs/index-908a0281.cjs +27 -0
  21. package/dist/cjs/index-97619c59.cjs +15 -0
  22. package/dist/cjs/{index-86ef4f22.cjs → index-9dd3dd7e.cjs} +1 -1
  23. package/dist/cjs/{index-c4c73f44.cjs → index-ace56b81.cjs} +1 -1
  24. package/dist/cjs/index-b64e1d7e.cjs +1 -0
  25. package/dist/cjs/{index-56fff369.cjs → index-d297664c.cjs} +1 -1
  26. package/dist/cjs/index-d965eac9.cjs +1 -0
  27. package/dist/cjs/index-e65f9734.cjs +15 -0
  28. package/dist/cjs/{index-76cccf0c.cjs → index-fd28b030.cjs} +1 -1
  29. package/dist/cjs/index.cjs +1 -1
  30. package/dist/cjs/index.es-e98c5ee4.cjs +9 -0
  31. package/dist/cjs/{interface-d5ec613a.cjs → interface-eb633eac.cjs} +1 -1
  32. package/dist/cjs/{lib-typedarrays-afe9c8e7.cjs → lib-typedarrays-f699b687.cjs} +1 -1
  33. package/dist/cjs/mm-install-modal_2.entry-4950a7e9.cjs +1 -0
  34. package/dist/cjs/{portis-9af3489b.cjs → portis-0c036243.cjs} +1 -1
  35. package/dist/cjs/rainbow-57ada25b.cjs +1 -0
  36. package/dist/cjs/{sha224-8f3f5508.cjs → sha224-267753d8.cjs} +1 -1
  37. package/dist/cjs/{sha256-6785be1d.cjs → sha256-d6829c39.cjs} +1 -1
  38. package/dist/cjs/{typed-data-a102eb38.cjs → typed-data-12a9baf4.cjs} +1 -1
  39. package/dist/cjs/{uAuth-22dae0a4.cjs → uAuth-0858f962.cjs} +1 -1
  40. package/dist/cjs/{walletConnect-d4368503.cjs → walletConnect-c55b3f29.cjs} +1 -1
  41. package/dist/cjs/{walletLink-1b5e5056.cjs → walletLink-961041df.cjs} +2 -2
  42. package/dist/{draggabilly-96bd4e8a.js → draggabilly-921a68cb.js} +1 -1
  43. package/dist/id-d72ad2e3.js +1 -0
  44. package/dist/index-022bd88c.js +27 -0
  45. package/dist/{index-9a72391b.js → index-18f1c3bb.js} +1 -1
  46. package/dist/index-21067fcb.js +15 -0
  47. package/dist/index-2dc796bb.js +2 -0
  48. package/dist/{index-d9690f1f.js → index-3b7c9150.js} +1 -1
  49. package/dist/{index-aa09ffe2.js → index-621d68a7.js} +1 -1
  50. package/dist/index-6b5aff68.js +1 -0
  51. package/dist/index-7b0eeb5c.js +1 -0
  52. package/dist/{index-0534a22e.js → index-82e4bb0d.js} +3 -3
  53. package/dist/{index-de489272.js → index-a98e886d.js} +5 -5
  54. package/dist/{index-ec77233b.js → index-d3e54bda.js} +1 -1
  55. package/dist/{index-29d50f5e.js → index-d815c390.js} +1 -1
  56. package/dist/{index-b27ec2be.js → index-e0e62601.js} +1 -1
  57. package/dist/{index-25f5dd77.js → index-ff4c01ce.js} +1 -1
  58. package/dist/index.es-e17cf755.js +9 -0
  59. package/dist/index.js +1 -1
  60. package/dist/{interface-501ba1ce.js → interface-b09eb8d7.js} +1 -1
  61. package/dist/lib-typedarrays-8b3801fe.js +1 -0
  62. package/dist/mm-install-modal_2.entry-e9e33358.js +1 -0
  63. package/dist/{portis-59e75b95.js → portis-57c88ff3.js} +1 -1
  64. package/dist/rainbow-c820ccae.js +1 -0
  65. package/dist/sha224-5ae0e997.js +1 -0
  66. package/dist/{sha256-cdb06d7c.js → sha256-260a708c.js} +1 -1
  67. package/dist/{typed-data-d46cb643.js → typed-data-7ba4540a.js} +1 -1
  68. package/dist/{uAuth-a93ad1ec.js → uAuth-253510eb.js} +1 -1
  69. package/dist/{walletConnect-23af88ec.js → walletConnect-fc6f0e52.js} +1 -1
  70. package/dist/{walletLink-782b101e.js → walletLink-d75a8dc8.js} +2 -2
  71. package/package.json +2 -2
  72. package/dist/cjs/id-07cfd31e.cjs +0 -1
  73. package/dist/cjs/index-af8c9c8e.cjs +0 -15
  74. package/dist/cjs/index-b82ccec9.cjs +0 -9
  75. package/dist/cjs/index.es-d9e722ea.cjs +0 -9
  76. package/dist/cjs/rainbow-4b5d0839.cjs +0 -1
  77. package/dist/cjs/v4-3e682452.cjs +0 -1
  78. package/dist/id-6dc2a6aa.js +0 -1
  79. package/dist/index-66392fdc.js +0 -9
  80. package/dist/index.es-d60f6859.js +0 -9
  81. package/dist/lib-typedarrays-5ac4ff04.js +0 -1
  82. package/dist/rainbow-2c04e9df.js +0 -1
  83. package/dist/sha224-b20bdf3b.js +0 -1
  84. package/dist/v4-95658a31.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-de489272.js";function i(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(e){if("default"!==e&&!(e in t)){var n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return i[e]}})}}))})),Object.freeze(t)}var e,n={exports:{}},o={exports:{}};function s(){return e||(e=1,t=o,function(i,e){t.exports?t.exports=e():i.getSize=e()}(window,(function(){function t(t){let i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}let i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];return function(e){if("string"==typeof e&&(e=document.querySelector(e)),!e||"object"!=typeof e||!e.nodeType)return;let n=getComputedStyle(e);if("none"==n.display)return function(){let t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return i.forEach((i=>{t[i]=0})),t}();let o={};o.width=e.offsetWidth,o.height=e.offsetHeight;let s=o.isBorderBox="border-box"==n.boxSizing;i.forEach((t=>{let i=n[t],e=parseFloat(i);o[t]=isNaN(e)?0:e}));let r=o.paddingLeft+o.paddingRight,h=o.paddingTop+o.paddingBottom,a=o.marginLeft+o.marginRight,d=o.marginTop+o.marginBottom,l=o.borderLeftWidth+o.borderRightWidth,c=o.borderTopWidth+o.borderBottomWidth,u=t(n.width);!1!==u&&(o.width=u+(s?0:r+l));let p=t(n.height);return!1!==p&&(o.height=p+(s?0:h+c)),o.innerWidth=o.width-(r+l),o.innerHeight=o.height-(h+c),o.outerWidth=o.width+a,o.outerHeight=o.height+d,o}}))),o.exports;var t}var r,h,a,d={exports:{}},l={exports:{}};function c(){return r||(r=1,i=l,e="undefined"!=typeof window?window:t,n=function(){function t(){}let i=t.prototype;return i.on=function(t,i){if(!t||!i)return this;let e=this._events=this._events||{},n=e[t]=e[t]||[];return n.includes(i)||n.push(i),this},i.once=function(t,i){if(!t||!i)return this;this.on(t,i);let e=this._onceEvents=this._onceEvents||{};return(e[t]=e[t]||{})[i]=!0,this},i.off=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;let n=e.indexOf(i);return-1!=n&&e.splice(n,1),this},i.emitEvent=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;e=e.slice(0),i=i||[];let n=this._onceEvents&&this._onceEvents[t];for(let o of e)n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i);return this},i.allOff=function(){return delete this._events,delete this._onceEvents,this},t},i.exports?i.exports=n():e.EvEmitter=n()),l.exports;var i,e,n}
1
+ import{c as t}from"./index-a98e886d.js";function i(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(e){if("default"!==e&&!(e in t)){var n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return i[e]}})}}))})),Object.freeze(t)}var e,n={exports:{}},o={exports:{}};function s(){return e||(e=1,t=o,function(i,e){t.exports?t.exports=e():i.getSize=e()}(window,(function(){function t(t){let i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}let i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];return function(e){if("string"==typeof e&&(e=document.querySelector(e)),!e||"object"!=typeof e||!e.nodeType)return;let n=getComputedStyle(e);if("none"==n.display)return function(){let t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return i.forEach((i=>{t[i]=0})),t}();let o={};o.width=e.offsetWidth,o.height=e.offsetHeight;let s=o.isBorderBox="border-box"==n.boxSizing;i.forEach((t=>{let i=n[t],e=parseFloat(i);o[t]=isNaN(e)?0:e}));let r=o.paddingLeft+o.paddingRight,h=o.paddingTop+o.paddingBottom,a=o.marginLeft+o.marginRight,d=o.marginTop+o.marginBottom,l=o.borderLeftWidth+o.borderRightWidth,c=o.borderTopWidth+o.borderBottomWidth,u=t(n.width);!1!==u&&(o.width=u+(s?0:r+l));let p=t(n.height);return!1!==p&&(o.height=p+(s?0:h+c)),o.innerWidth=o.width-(r+l),o.innerHeight=o.height-(h+c),o.outerWidth=o.width+a,o.outerHeight=o.height+d,o}}))),o.exports;var t}var r,h,a,d={exports:{}},l={exports:{}};function c(){return r||(r=1,i=l,e="undefined"!=typeof window?window:t,n=function(){function t(){}let i=t.prototype;return i.on=function(t,i){if(!t||!i)return this;let e=this._events=this._events||{},n=e[t]=e[t]||[];return n.includes(i)||n.push(i),this},i.once=function(t,i){if(!t||!i)return this;this.on(t,i);let e=this._onceEvents=this._onceEvents||{};return(e[t]=e[t]||{})[i]=!0,this},i.off=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;let n=e.indexOf(i);return-1!=n&&e.splice(n,1),this},i.emitEvent=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;e=e.slice(0),i=i||[];let n=this._onceEvents&&this._onceEvents[t];for(let o of e)n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i);return this},i.allOff=function(){return delete this._events,delete this._onceEvents,this},t},i.exports?i.exports=n():e.EvEmitter=n()),l.exports;var i,e,n}
2
2
  /*!
3
3
  * Unidragger v3.0.1
4
4
  * Draggable base class
@@ -0,0 +1 @@
1
+ import{k as r,t}from"./index-a98e886d.js";function a(a){return r(t(a))}export{a as i};
@@ -0,0 +1,27 @@
1
+ import{c as t,y as e}from"./index-a98e886d.js";function r(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(r){if("default"!==r&&!(r in t)){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}))})),Object.freeze(t)}var n={},o={};!function(t){function e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function r(t){if("boolean"!=typeof t)throw new Error(`boolean expected, not ${t}`)}function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function o(t,...r){if(!e(t))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(t.length))throw new Error("Uint8Array expected of length "+r+", got length="+t.length)}function s(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}
2
+ /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
3
+ Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCipher=t.Hash=t.nextTick=t.isLE=void 0,t.isBytes=e,t.abool=r,t.anumber=n,t.abytes=o,t.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");n(t.outputLen),n(t.blockLen)},t.aexists=function(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")},t.aoutput=function(t,e){o(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},t.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},t.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},t.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},t.createView=s,t.bytesToHex=a,t.hexToBytes=h,t.hexToNumber=l,t.bytesToNumberBE=function(t){return l(a(t))},t.numberToBytesBE=function(t,e){return h(t.toString(16).padStart(2*e,"0"))},t.utf8ToBytes=d,t.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},t.toBytes=function(t){if("string"==typeof t)t=d(t);else{if(!e(t))throw new Error("Uint8Array expected, got "+typeof t);t=g(t)}return t},t.overlapBytes=y,t.complexOverlapBytes=function(t,e){if(y(t,e)&&t.byteOffset<e.byteOffset)throw new Error("complex overlap of input and output is not supported")},t.concatBytes=function(...t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];o(n),e+=n.length}const r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const o=t[e];r.set(o,n),n+=o.length}return r},t.checkOpts=function(t,e){if(null==e||"object"!=typeof e)throw new Error("options must be defined");return Object.assign(t,e)},t.equalBytes=function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},t.getOutput=function(t,e,r=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!b(e))throw new Error("invalid output, must be aligned");return e},t.setBigUint64=p,t.u64Lengths=function(t,e,n){r(n);const o=new Uint8Array(16),i=s(o);return p(i,0,BigInt(e),n),p(i,8,BigInt(t),n),o},t.isAligned32=b,t.copyBytes=g,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];const i=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),c=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function a(t){if(o(t),i)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=c[t[r]];return e}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(t){return t>=u._0&&t<=u._9?t-u._0:t>=u.A&&t<=u.F?t-(u.A-10):t>=u.a&&t<=u.f?t-(u.a-10):void 0}function h(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(i)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,o=0;e<r;e++,o+=2){const r=f(t.charCodeAt(o)),s=f(t.charCodeAt(o+1));if(void 0===r||void 0===s){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}n[e]=16*r+s}return n}function l(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":"0x"+t)}function d(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function y(t,e){return t.buffer===e.buffer&&t.byteOffset<e.byteOffset+e.byteLength&&e.byteOffset<t.byteOffset+t.byteLength}t.nextTick=async()=>{};t.Hash=class{};function p(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),c=Number(r&s),a=n?4:0,u=n?0:4;t.setUint32(e+a,i,n),t.setUint32(e+u,c,n)}function b(t){return t.byteOffset%4==0}function g(t){return Uint8Array.from(t)}t.wrapCipher=(e,r)=>{function n(n,...s){if(o(n),!t.isLE)throw new Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){const t=s[0];if(!t)throw new Error("nonce / iv required");e.varSizeNonce?o(t):o(t,e.nonceLength)}const i=e.tagLength;i&&void 0!==s[1]&&o(s[1]);const c=r(n,...s),a=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");o(e)}};let u=!1;return{encrypt(t,e){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,o(t),a(c.encrypt.length,e),c.encrypt(t,e)},decrypt(t,e){if(o(t),i&&t.length<i)throw new Error("invalid ciphertext length: smaller than tagLength="+i);return a(c.decrypt.length,e),c.decrypt(t,e)}}}return Object.assign(n,e),n}}(o);var s={},i={};Object.defineProperty(i,"__esModule",{value:!0}),i.AEAD_TAG_LENGTH=i.XCHACHA20_NONCE_LENGTH=i.CURVE25519_PUBLIC_KEY_SIZE=i.ETH_PUBLIC_KEY_SIZE=i.UNCOMPRESSED_PUBLIC_KEY_SIZE=i.COMPRESSED_PUBLIC_KEY_SIZE=i.SECRET_KEY_LENGTH=void 0,i.SECRET_KEY_LENGTH=32,i.COMPRESSED_PUBLIC_KEY_SIZE=33,i.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,i.ETH_PUBLIC_KEY_SIZE=64,i.CURVE25519_PUBLIC_KEY_SIZE=32,i.XCHACHA20_NONCE_LENGTH=24,i.AEAD_TAG_LENGTH=16,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ephemeralKeySize=t.symmetricNonceLength=t.symmetricAlgorithm=t.isHkdfKeyCompressed=t.isEphemeralKeyCompressed=t.ellipticCurve=t.ECIES_CONFIG=t.Config=void 0;var e=i,r=function(){function t(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16}return Object.defineProperty(t.prototype,"ephemeralKeySize",{get:function(){var t={secp256k1:this.isEphemeralKeyCompressed?e.COMPRESSED_PUBLIC_KEY_SIZE:e.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:e.CURVE25519_PUBLIC_KEY_SIZE,ed25519:e.CURVE25519_PUBLIC_KEY_SIZE};
4
+ /* v8 ignore else -- @preserve */if(this.ellipticCurve in t)return t[this.ellipticCurve];throw new Error("Not implemented")},enumerable:!1,configurable:!0}),t}();t.Config=r,t.ECIES_CONFIG=new r;t.ellipticCurve=function(){return t.ECIES_CONFIG.ellipticCurve};t.isEphemeralKeyCompressed=function(){return t.ECIES_CONFIG.isEphemeralKeyCompressed};t.isHkdfKeyCompressed=function(){return t.ECIES_CONFIG.isHkdfKeyCompressed};t.symmetricAlgorithm=function(){return t.ECIES_CONFIG.symmetricAlgorithm};t.symmetricNonceLength=function(){return t.ECIES_CONFIG.symmetricNonceLength};t.ephemeralKeySize=function(){return t.ECIES_CONFIG.ephemeralKeySize}}(s);var c={},a={},u={},f={},h={},l={};Object.defineProperty(l,"__esModule",{value:!0}),l.crypto=void 0,l.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.gcm=t.ctr=t.cbc=t.utils=void 0,t.randomBytes=n,t.getWebcryptoSubtle=s,t.managedNonce=function(t){const{nonceLength:e}=t;return(0,r.anumber)(e),(o,...s)=>({encrypt(i,...c){const a=n(e),u=t(o,a,...s).encrypt(i,...c),f=(0,r.concatBytes)(a,u);return u.fill(0),f},decrypt(r,...n){const i=r.subarray(0,e),c=r.subarray(e);return t(o,i,...s).decrypt(c,...n)}})};const e=l,r=o;function n(t=32){if(e.crypto&&"function"==typeof e.crypto.getRandomValues)return e.crypto.getRandomValues(new Uint8Array(t));if(e.crypto&&"function"==typeof e.crypto.randomBytes)return Uint8Array.from(e.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function s(){if(e.crypto&&"object"==typeof e.crypto.subtle&&null!=e.crypto.subtle)return e.crypto.subtle;throw new Error("crypto.subtle must be defined")}t.utils={async encrypt(t,e,r,n){const o=s(),i=await o.importKey("raw",t,e,!0,["encrypt"]),c=await o.encrypt(r,i,n);return new Uint8Array(c)},async decrypt(t,e,r,n){const o=s(),i=await o.importKey("raw",t,e,!0,["decrypt"]),c=await o.decrypt(r,i,n);return new Uint8Array(c)}};const i={CBC:"AES-CBC",CTR:"AES-CTR",GCM:"AES-GCM"};function c(e){return(n,o,s)=>{(0,r.abytes)(n),(0,r.abytes)(o);const c={name:e,length:8*n.length},a=function(t,e,r){if(t===i.CBC)return{name:i.CBC,iv:e};if(t===i.CTR)return{name:i.CTR,counter:e,length:64};if(t===i.GCM)return r?{name:i.GCM,iv:e,additionalData:r}:{name:i.GCM,iv:e};throw new Error("unknown aes block mode")}(e,o,s);let u=!1;return{encrypt(e){if((0,r.abytes)(e),u)throw new Error("Cannot encrypt() twice with same key / nonce");return u=!0,t.utils.encrypt(n,c,a,e)},decrypt:e=>((0,r.abytes)(e),t.utils.decrypt(n,c,a,e))}}}t.cbc=c(i.CBC),t.ctr=c(i.CTR),t.gcm=(()=>c(i.GCM))()}(h);var d={},y={},p={},b={},g={};Object.defineProperty(g,"__esModule",{value:!0}),g.crypto=void 0,g.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){
5
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
6
+ Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=r,t.anumber=n,t.abytes=o,t.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");n(t.outputLen),n(t.blockLen)},t.aexists=function(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")},t.aoutput=function(t,e){o(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},t.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},t.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},t.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},t.createView=function(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)},t.rotr=function(t,e){return t<<32-e|t>>>e},t.rotl=function(t,e){return t<<e|t>>>32-e>>>0},t.byteSwap=s,t.byteSwap32=i,t.bytesToHex=function(t){if(o(t),c)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=a[t[r]];return e},t.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(c)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,o=0;e<r;e++,o+=2){const r=f(t.charCodeAt(o)),s=f(t.charCodeAt(o+1));if(void 0===r||void 0===s){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}n[e]=16*r+s}return n},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=h,t.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},t.toBytes=l,t.kdfInputToBytes=function(t){"string"==typeof t&&(t=h(t));return o(t),t},t.concatBytes=function(...t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];o(n),e+=n.length}const r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const o=t[e];r.set(o,n),n+=o.length}return r},t.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!=={}.toString.call(e))throw new Error("options should be object or undefined");return Object.assign(t,e)},t.createHasher=d,t.createOptHasher=y,t.createXOFer=p,t.randomBytes=function(t=32){if(e.crypto&&"function"==typeof e.crypto.getRandomValues)return e.crypto.getRandomValues(new Uint8Array(t));if(e.crypto&&"function"==typeof e.crypto.randomBytes)return Uint8Array.from(e.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")};const e=g;function r(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function o(t,...e){if(!r(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function s(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function i(t){for(let e=0;e<t.length;e++)t[e]=s(t[e]);return t}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?t=>t:t=>s(t),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?t=>t:i;const c=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),a=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(t){return t>=u._0&&t<=u._9?t-u._0:t>=u.A&&t<=u.F?t-(u.A-10):t>=u.a&&t<=u.f?t-(u.a-10):void 0}function h(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function l(t){return"string"==typeof t&&(t=h(t)),o(t),t}t.nextTick=async()=>{};function d(t){const e=e=>t().update(l(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function y(t){const e=(e,r)=>t(r).update(l(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}function p(t){const e=(e,r)=>t(r).update(l(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}t.Hash=class{},t.wrapConstructor=d,t.wrapConstructorWithOpts=y,t.wrapXOFConstructorWithOpts=p}(b),Object.defineProperty(p,"__esModule",{value:!0}),p.SHA512_IV=p.SHA384_IV=p.SHA224_IV=p.SHA256_IV=p.HashMD=void 0,p.setBigUint64=m,p.Chi=function(t,e,r){return t&e^~t&r},p.Maj=function(t,e,r){return t&e^t&r^e&r};const w=b;function m(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),c=Number(r&s),a=n?4:0,u=n?0:4;t.setUint32(e+a,i,n),t.setUint32(e+u,c,n)}p.HashMD=class extends w.Hash{constructor(t,e,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(t),this.view=(0,w.createView)(this.buffer)}update(t){(0,w.aexists)(this),t=(0,w.toBytes)(t),(0,w.abytes)(t);const{view:e,buffer:r,blockLen:n}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(t.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(e,0),this.pos=0);else{const e=(0,w.createView)(t);for(;n<=o-s;s+=n)this.process(e,s)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,w.aexists)(this),(0,w.aoutput)(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:o}=this;let{pos:s}=this;e[s++]=128,(0,w.clean)(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let t=s;t<n;t++)e[t]=0;m(r,n-8,BigInt(8*this.length),o),this.process(r,0);const i=(0,w.createView)(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=c/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<a;t++)i.setUint32(4*t,u[t],o)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:o,destroyed:s,pos:i}=this;return t.destroyed=s,t.finished=o,t.length=n,t.pos=i,n%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}},p.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),p.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),p.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),p.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var E={};Object.defineProperty(E,"__esModule",{value:!0}),E.toBig=E.shrSL=E.shrSH=E.rotrSL=E.rotrSH=E.rotrBL=E.rotrBH=E.rotr32L=E.rotr32H=E.rotlSL=E.rotlSH=E.rotlBL=E.rotlBH=E.add5L=E.add5H=E.add4L=E.add4H=E.add3L=E.add3H=void 0,E.add=N,E.fromBig=v,E.split=S;const B=BigInt(2**32-1),x=BigInt(32);function v(t,e=!1){return e?{h:Number(t&B),l:Number(t>>x&B)}:{h:0|Number(t>>x&B),l:0|Number(t&B)}}function S(t,e=!1){const r=t.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:i}=v(t[s],e);[n[s],o[s]]=[r,i]}return[n,o]}const A=(t,e)=>BigInt(t>>>0)<<x|BigInt(e>>>0);E.toBig=A;const _=(t,e,r)=>t>>>r;E.shrSH=_;const H=(t,e,r)=>t<<32-r|e>>>r;E.shrSL=H;const I=(t,e,r)=>t>>>r|e<<32-r;E.rotrSH=I;const O=(t,e,r)=>t<<32-r|e>>>r;E.rotrSL=O;const L=(t,e,r)=>t<<64-r|e>>>r-32;E.rotrBH=L;const C=(t,e,r)=>t>>>r-32|e<<64-r;E.rotrBL=C;const U=(t,e)=>e;E.rotr32H=U;const T=(t,e)=>t;E.rotr32L=T;const P=(t,e,r)=>t<<r|e>>>32-r;E.rotlSH=P;const V=(t,e,r)=>e<<r|t>>>32-r;E.rotlSL=V;const R=(t,e,r)=>e<<r-32|t>>>64-r;E.rotlBH=R;const F=(t,e,r)=>t<<r-32|e>>>64-r;function N(t,e,r,n){const o=(e>>>0)+(n>>>0);return{h:t+r+(o/2**32|0)|0,l:0|o}}E.rotlBL=F;const k=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);E.add3L=k;const K=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;E.add3H=K;const D=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);E.add4L=D;const j=(t,e,r,n,o)=>e+r+n+o+(t/2**32|0)|0;E.add4H=j;const M=(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0);E.add5L=M;const q=(t,e,r,n,o,s)=>e+r+n+o+s+(t/2**32|0)|0;E.add5H=q;const G={fromBig:v,split:S,toBig:A,shrSH:_,shrSL:H,rotrSH:I,rotrSL:O,rotrBH:L,rotrBL:C,rotr32H:U,rotr32L:T,rotlSH:P,rotlSL:V,rotlBH:R,rotlBL:F,add:N,add3L:k,add3H:K,add4L:D,add4H:j,add5H:q,add5L:M};E.default=G,Object.defineProperty(y,"__esModule",{value:!0}),y.sha512_224=y.sha512_256=y.sha384=y.sha512=y.sha224=y.sha256=y.SHA512_256=y.SHA512_224=y.SHA384=y.SHA512=y.SHA224=y.SHA256=void 0;const Z=p,z=E,Y=b,X=Uint32Array.from([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=new Uint32Array(64);class $ extends Z.HashMD{constructor(t=32){super(64,t,8,!1),this.A=0|Z.SHA256_IV[0],this.B=0|Z.SHA256_IV[1],this.C=0|Z.SHA256_IV[2],this.D=0|Z.SHA256_IV[3],this.E=0|Z.SHA256_IV[4],this.F=0|Z.SHA256_IV[5],this.G=0|Z.SHA256_IV[6],this.H=0|Z.SHA256_IV[7]}get(){const{A:t,B:e,C:r,D:n,E:o,F:s,G:i,H:c}=this;return[t,e,r,n,o,s,i,c]}set(t,e,r,n,o,s,i,c){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|c}process(t,e){for(let r=0;r<16;r++,e+=4)W[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=W[t-15],r=W[t-2],n=(0,Y.rotr)(e,7)^(0,Y.rotr)(e,18)^e>>>3,o=(0,Y.rotr)(r,17)^(0,Y.rotr)(r,19)^r>>>10;W[t]=o+W[t-7]+n+W[t-16]|0}let{A:r,B:n,C:o,D:s,E:i,F:c,G:a,H:u}=this;for(let t=0;t<64;t++){const e=u+((0,Y.rotr)(i,6)^(0,Y.rotr)(i,11)^(0,Y.rotr)(i,25))+(0,Z.Chi)(i,c,a)+X[t]+W[t]|0,f=((0,Y.rotr)(r,2)^(0,Y.rotr)(r,13)^(0,Y.rotr)(r,22))+(0,Z.Maj)(r,n,o)|0;u=a,a=c,c=i,i=s+e|0,s=o,o=n,n=r,r=e+f|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,i=i+this.E|0,c=c+this.F|0,a=a+this.G|0,u=u+this.H|0,this.set(r,n,o,s,i,c,a,u)}roundClean(){(0,Y.clean)(W)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,Y.clean)(this.buffer)}}y.SHA256=$;class J extends ${constructor(){super(28),this.A=0|Z.SHA224_IV[0],this.B=0|Z.SHA224_IV[1],this.C=0|Z.SHA224_IV[2],this.D=0|Z.SHA224_IV[3],this.E=0|Z.SHA224_IV[4],this.F=0|Z.SHA224_IV[5],this.G=0|Z.SHA224_IV[6],this.H=0|Z.SHA224_IV[7]}}y.SHA224=J;const Q=(()=>z.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((t=>BigInt(t)))))(),tt=(()=>Q[0])(),et=(()=>Q[1])(),rt=new Uint32Array(80),nt=new Uint32Array(80);class ot extends Z.HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=0|Z.SHA512_IV[0],this.Al=0|Z.SHA512_IV[1],this.Bh=0|Z.SHA512_IV[2],this.Bl=0|Z.SHA512_IV[3],this.Ch=0|Z.SHA512_IV[4],this.Cl=0|Z.SHA512_IV[5],this.Dh=0|Z.SHA512_IV[6],this.Dl=0|Z.SHA512_IV[7],this.Eh=0|Z.SHA512_IV[8],this.El=0|Z.SHA512_IV[9],this.Fh=0|Z.SHA512_IV[10],this.Fl=0|Z.SHA512_IV[11],this.Gh=0|Z.SHA512_IV[12],this.Gl=0|Z.SHA512_IV[13],this.Hh=0|Z.SHA512_IV[14],this.Hl=0|Z.SHA512_IV[15]}get(){const{Ah:t,Al:e,Bh:r,Bl:n,Ch:o,Cl:s,Dh:i,Dl:c,Eh:a,El:u,Fh:f,Fl:h,Gh:l,Gl:d,Hh:y,Hl:p}=this;return[t,e,r,n,o,s,i,c,a,u,f,h,l,d,y,p]}set(t,e,r,n,o,s,i,c,a,u,f,h,l,d,y,p){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|c,this.Eh=0|a,this.El=0|u,this.Fh=0|f,this.Fl=0|h,this.Gh=0|l,this.Gl=0|d,this.Hh=0|y,this.Hl=0|p}process(t,e){for(let r=0;r<16;r++,e+=4)rt[r]=t.getUint32(e),nt[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|rt[t-15],r=0|nt[t-15],n=z.rotrSH(e,r,1)^z.rotrSH(e,r,8)^z.shrSH(e,r,7),o=z.rotrSL(e,r,1)^z.rotrSL(e,r,8)^z.shrSL(e,r,7),s=0|rt[t-2],i=0|nt[t-2],c=z.rotrSH(s,i,19)^z.rotrBH(s,i,61)^z.shrSH(s,i,6),a=z.rotrSL(s,i,19)^z.rotrBL(s,i,61)^z.shrSL(s,i,6),u=z.add4L(o,a,nt[t-7],nt[t-16]),f=z.add4H(u,n,c,rt[t-7],rt[t-16]);rt[t]=0|f,nt[t]=0|u}let{Ah:r,Al:n,Bh:o,Bl:s,Ch:i,Cl:c,Dh:a,Dl:u,Eh:f,El:h,Fh:l,Fl:d,Gh:y,Gl:p,Hh:b,Hl:g}=this;for(let t=0;t<80;t++){const e=z.rotrSH(f,h,14)^z.rotrSH(f,h,18)^z.rotrBH(f,h,41),w=z.rotrSL(f,h,14)^z.rotrSL(f,h,18)^z.rotrBL(f,h,41),m=f&l^~f&y,E=h&d^~h&p,B=z.add5L(g,w,E,et[t],nt[t]),x=z.add5H(B,b,e,m,tt[t],rt[t]),v=0|B,S=z.rotrSH(r,n,28)^z.rotrBH(r,n,34)^z.rotrBH(r,n,39),A=z.rotrSL(r,n,28)^z.rotrBL(r,n,34)^z.rotrBL(r,n,39),_=r&o^r&i^o&i,H=n&s^n&c^s&c;b=0|y,g=0|p,y=0|l,p=0|d,l=0|f,d=0|h,({h:f,l:h}=z.add(0|a,0|u,0|x,0|v)),a=0|i,u=0|c,i=0|o,c=0|s,o=0|r,s=0|n;const I=z.add3L(v,A,H);r=z.add3H(I,x,S,_),n=0|I}({h:r,l:n}=z.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:s}=z.add(0|this.Bh,0|this.Bl,0|o,0|s)),({h:i,l:c}=z.add(0|this.Ch,0|this.Cl,0|i,0|c)),({h:a,l:u}=z.add(0|this.Dh,0|this.Dl,0|a,0|u)),({h:f,l:h}=z.add(0|this.Eh,0|this.El,0|f,0|h)),({h:l,l:d}=z.add(0|this.Fh,0|this.Fl,0|l,0|d)),({h:y,l:p}=z.add(0|this.Gh,0|this.Gl,0|y,0|p)),({h:b,l:g}=z.add(0|this.Hh,0|this.Hl,0|b,0|g)),this.set(r,n,o,s,i,c,a,u,f,h,l,d,y,p,b,g)}roundClean(){(0,Y.clean)(rt,nt)}destroy(){(0,Y.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}y.SHA512=ot;class st extends ot{constructor(){super(48),this.Ah=0|Z.SHA384_IV[0],this.Al=0|Z.SHA384_IV[1],this.Bh=0|Z.SHA384_IV[2],this.Bl=0|Z.SHA384_IV[3],this.Ch=0|Z.SHA384_IV[4],this.Cl=0|Z.SHA384_IV[5],this.Dh=0|Z.SHA384_IV[6],this.Dl=0|Z.SHA384_IV[7],this.Eh=0|Z.SHA384_IV[8],this.El=0|Z.SHA384_IV[9],this.Fh=0|Z.SHA384_IV[10],this.Fl=0|Z.SHA384_IV[11],this.Gh=0|Z.SHA384_IV[12],this.Gl=0|Z.SHA384_IV[13],this.Hh=0|Z.SHA384_IV[14],this.Hl=0|Z.SHA384_IV[15]}}y.SHA384=st;const it=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),ct=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class at extends ot{constructor(){super(28),this.Ah=0|it[0],this.Al=0|it[1],this.Bh=0|it[2],this.Bl=0|it[3],this.Ch=0|it[4],this.Cl=0|it[5],this.Dh=0|it[6],this.Dl=0|it[7],this.Eh=0|it[8],this.El=0|it[9],this.Fh=0|it[10],this.Fl=0|it[11],this.Gh=0|it[12],this.Gl=0|it[13],this.Hh=0|it[14],this.Hl=0|it[15]}}y.SHA512_224=at;class ut extends ot{constructor(){super(32),this.Ah=0|ct[0],this.Al=0|ct[1],this.Bh=0|ct[2],this.Bl=0|ct[3],this.Ch=0|ct[4],this.Cl=0|ct[5],this.Dh=0|ct[6],this.Dl=0|ct[7],this.Eh=0|ct[8],this.El=0|ct[9],this.Fh=0|ct[10],this.Fl=0|ct[11],this.Gh=0|ct[12],this.Gl=0|ct[13],this.Hh=0|ct[14],this.Hl=0|ct[15]}}y.SHA512_256=ut,y.sha256=(0,Y.createHasher)((()=>new $)),y.sha224=(0,Y.createHasher)((()=>new J)),y.sha512=(0,Y.createHasher)((()=>new ot)),y.sha384=(0,Y.createHasher)((()=>new st)),y.sha512_256=(0,Y.createHasher)((()=>new ut)),y.sha512_224=(0,Y.createHasher)((()=>new at));var ft={},ht={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=t.utf8ToBytes=t.randomBytes=t.isBytes=t.hexToBytes=t.concatBytes=t.bytesToUtf8=t.bytesToHex=t.anumber=t.abytes=void 0,t.abool=function(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)},t._abool2=function(t,e=""){if("boolean"!=typeof t){throw new Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t)}return t},t._abytes2=function(t,r,n=""){const o=(0,e.isBytes)(t),s=t?.length,i=void 0!==r;if(!o||i&&s!==r){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(i?` of length ${r}`:"")+", got "+(o?`length=${s}`:"type="+typeof t))}return t},t.numberToHexUnpadded=s,t.hexToNumber=i,t.bytesToNumberBE=function(t){return i((0,e.bytesToHex)(t))},t.bytesToNumberLE=function(t){return(0,e.abytes)(t),i((0,e.bytesToHex)(Uint8Array.from(t).reverse()))},t.numberToBytesBE=c,t.numberToBytesLE=function(t,e){return c(t,e).reverse()},t.numberToVarBytesBE=function(t){return(0,e.hexToBytes)(s(t))},t.ensureBytes=function(t,r,n){let o;if("string"==typeof r)try{o=(0,e.hexToBytes)(r)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!(0,e.isBytes)(r))throw new Error(t+" must be hex string or Uint8Array");o=Uint8Array.from(r)}const s=o.length;if("number"==typeof n&&s!==n)throw new Error(t+" of length "+n+" expected, got "+s);return o},t.equalBytes=function(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},t.copyBytes=function(t){return Uint8Array.from(t)},t.asciiToBytes=function(t){return Uint8Array.from(t,((e,r)=>{const n=e.charCodeAt(0);if(1!==e.length||n>127)throw new Error(`string contains non-ASCII character "${t[r]}" with code ${n} at position ${r}`);return n}))},t.inRange=u,t.aInRange=function(t,e,r,n){if(!u(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)},t.bitLen=function(t){let e;for(e=0;t>n;t>>=o,e+=1);return e},t.bitGet=function(t,e){return t>>BigInt(e)&o},t.bitSet=function(t,e,r){return t|(r?o:n)<<BigInt(e)},t.createHmacDrbg=function(t,r,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof r||r<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const o=t=>new Uint8Array(t),s=t=>Uint8Array.of(t);let i=o(t),c=o(t),a=0;const u=()=>{i.fill(1),c.fill(0),a=0},f=(...t)=>n(c,i,...t),h=(t=o(0))=>{c=f(s(0),t),i=f(),0!==t.length&&(c=f(s(1),t),i=f())},l=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<r;){i=f();const e=i.slice();n.push(e),t+=i.length}return(0,e.concatBytes)(...n)};return(t,e)=>{let r;for(u(),h(t);!(r=e(l()));)h();return u(),r}},t.validateObject=function(t,e,r={}){const n=(e,r,n)=>{const o=f[r];if("function"!=typeof o)throw new Error("invalid validator function");const s=t[e];if(!(n&&void 0===s||o(s,t)))throw new Error("param "+String(e)+" is invalid. Expected "+r+", got "+s)};for(const[t,r]of Object.entries(e))n(t,r,!1);for(const[t,e]of Object.entries(r))n(t,e,!0);return t},t.isHash=function(t){return"function"==typeof t&&Number.isSafeInteger(t.outputLen)},t._validateObject=function(t,e,r={}){if(!t||"object"!=typeof t)throw new Error("expected valid options object");function n(e,r,n){const o=t[e];if(n&&void 0===o)return;const s=typeof o;if(s!==r||null===o)throw new Error(`param "${e}" is invalid: expected ${r}, got ${s}`)}Object.entries(e).forEach((([t,e])=>n(t,e,!1))),Object.entries(r).forEach((([t,e])=>n(t,e,!0)))},t.memoized=function(t){const e=new WeakMap;return(r,...n)=>{const o=e.get(r);if(void 0!==o)return o;const s=t(r,...n);return e.set(r,s),s}};
7
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
8
+ const e=b;var r=b;Object.defineProperty(t,"abytes",{enumerable:!0,get:function(){return r.abytes}}),Object.defineProperty(t,"anumber",{enumerable:!0,get:function(){return r.anumber}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return r.bytesToHex}}),Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return r.bytesToUtf8}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return r.concatBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return r.hexToBytes}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return r.isBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return r.randomBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return r.utf8ToBytes}});const n=BigInt(0),o=BigInt(1);function s(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function i(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?n:BigInt("0x"+t)}function c(t,r){return(0,e.hexToBytes)(t.toString(16).padStart(2*r,"0"))}const a=t=>"bigint"==typeof t&&n<=t;function u(t,e,r){return a(t)&&a(e)&&a(r)&&e<=t&&t<r}t.bitMask=t=>(o<<BigInt(t))-o;const f={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||(0,e.isBytes)(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};t.notImplemented=()=>{throw new Error("not implemented")}}(ht);var lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.isNegativeLE=void 0,lt.mod=St,lt.pow=function(t,e,r){return Ut(Rt(r),t,e)},lt.pow2=function(t,e,r){let n=t;for(;e-- >yt;)n*=n,n%=r;return n},lt.invert=At,lt.tonelliShanks=Ot,lt.FpSqrt=Lt,lt.validateField=function(t){const e=Ct.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,dt._validateObject)(t,e),t},lt.FpPow=Ut,lt.FpInvertBatch=Tt,lt.FpDiv=function(t,e,r){return t.mul(e,"bigint"==typeof r?At(r,t.ORDER):t.inv(r))},lt.FpLegendre=Pt,lt.FpIsSquare=function(t,e){return 1===Pt(t,e)},lt.nLength=Vt,lt.Field=Rt,lt.FpSqrtOdd=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?r:t.neg(r)},lt.FpSqrtEven=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r},lt.hashToPrivateScalar=function(t,e,r=!1){t=(0,dt.ensureBytes)("privateHash",t);const n=t.length,o=Vt(e).nByteLength+8;if(o<24||n<o||n>1024)throw new Error("hashToPrivateScalar: expected "+o+"-1024 bytes of input, got "+n);const s=r?(0,dt.bytesToNumberLE)(t):(0,dt.bytesToNumberBE)(t);return St(s,e-pt)+pt},lt.getFieldBytesLength=Ft,lt.getMinHashLength=Nt,lt.mapHashToField=function(t,e,r=!1){const n=t.length,o=Ft(e),s=Nt(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const i=St(r?(0,dt.bytesToNumberLE)(t):(0,dt.bytesToNumberBE)(t),e-pt)+pt;return r?(0,dt.numberToBytesLE)(i,o):(0,dt.numberToBytesBE)(i,o)};
9
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
10
+ const dt=ht,yt=BigInt(0),pt=BigInt(1),bt=BigInt(2),gt=BigInt(3),wt=BigInt(4),mt=BigInt(5),Et=BigInt(7),Bt=BigInt(8),xt=BigInt(9),vt=BigInt(16);function St(t,e){const r=t%e;return r>=yt?r:e+r}function At(t,e){if(t===yt)throw new Error("invert: expected non-zero number");if(e<=yt)throw new Error("invert: expected positive modulus, got "+e);let r=St(t,e),n=e,o=yt,s=pt;for(;r!==yt;){const t=n%r,e=o-s*(n/r);n=r,r=t,o=s,s=e}if(n!==pt)throw new Error("invert: does not exist");return St(o,e)}function _t(t,e,r){if(!t.eql(t.sqr(e),r))throw new Error("Cannot find square root")}function Ht(t,e){const r=(t.ORDER+pt)/wt,n=t.pow(e,r);return _t(t,n,e),n}function It(t,e){const r=(t.ORDER-mt)/Bt,n=t.mul(e,bt),o=t.pow(n,r),s=t.mul(e,o),i=t.mul(t.mul(s,bt),o),c=t.mul(s,t.sub(i,t.ONE));return _t(t,c,e),c}function Ot(t){if(t<gt)throw new Error("sqrt is not defined for small field");let e=t-pt,r=0;for(;e%bt===yt;)e/=bt,r++;let n=bt;const o=Rt(t);for(;1===Pt(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return Ht;let s=o.pow(n,e);const i=(e+pt)/bt;return function(t,n){if(t.is0(n))return n;if(1!==Pt(t,n))throw new Error("Cannot find square root");let o=r,c=t.mul(t.ONE,s),a=t.pow(n,e),u=t.pow(n,i);for(;!t.eql(a,t.ONE);){if(t.is0(a))return t.ZERO;let e=1,r=t.sqr(a);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===o)throw new Error("Cannot find square root");const n=pt<<BigInt(o-e-1),s=t.pow(c,n);o=e,c=t.sqr(s),a=t.mul(a,c),u=t.mul(u,s)}return u}}function Lt(t){return t%wt===gt?Ht:t%Bt===mt?It:t%vt===xt?function(t){const e=Rt(t),r=Ot(t),n=r(e,e.neg(e.ONE)),o=r(e,n),s=r(e,e.neg(n)),i=(t+Et)/vt;return(t,e)=>{let r=t.pow(e,i),c=t.mul(r,n);const a=t.mul(r,o),u=t.mul(r,s),f=t.eql(t.sqr(c),e),h=t.eql(t.sqr(a),e);r=t.cmov(r,c,f),c=t.cmov(u,a,h);const l=t.eql(t.sqr(c),e),d=t.cmov(r,c,l);return _t(t,d,e),d}}(t):Ot(t)}lt.isNegativeLE=(t,e)=>(St(t,e)&pt)===pt;const Ct=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ut(t,e,r){if(r<yt)throw new Error("invalid exponent, negatives unsupported");if(r===yt)return t.ONE;if(r===pt)return e;let n=t.ONE,o=e;for(;r>yt;)r&pt&&(n=t.mul(n,o)),o=t.sqr(o),r>>=pt;return n}function Tt(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),o=e.reduce(((e,r,o)=>t.is0(r)?e:(n[o]=e,t.mul(e,r))),t.ONE),s=t.inv(o);return e.reduceRight(((e,r,o)=>t.is0(r)?e:(n[o]=t.mul(e,n[o]),t.mul(e,r))),s),n}function Pt(t,e){const r=(t.ORDER-pt)/bt,n=t.pow(e,r),o=t.eql(n,t.ONE),s=t.eql(n,t.ZERO),i=t.eql(n,t.neg(t.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function Vt(t,e){void 0!==e&&(0,dt.anumber)(e);const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Rt(t,e,r=!1,n={}){if(t<=yt)throw new Error("invalid field: expected ORDER > 0, got "+t);let o,s,i,c=!1;if("object"==typeof e&&null!=e){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const t=e;t.BITS&&(o=t.BITS),t.sqrt&&(s=t.sqrt),"boolean"==typeof t.isLE&&(r=t.isLE),"boolean"==typeof t.modFromBytes&&(c=t.modFromBytes),i=t.allowedLengths}else"number"==typeof e&&(o=e),n.sqrt&&(s=n.sqrt);const{nBitLength:a,nByteLength:u}=Vt(t,o);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const h=Object.freeze({ORDER:t,isLE:r,BITS:a,BYTES:u,MASK:(0,dt.bitMask)(a),ZERO:yt,ONE:pt,allowedLengths:i,create:e=>St(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return yt<=e&&e<t},is0:t=>t===yt,isValidNot0:t=>!h.is0(t)&&h.isValid(t),isOdd:t=>(t&pt)===pt,neg:e=>St(-e,t),eql:(t,e)=>t===e,sqr:e=>St(e*e,t),add:(e,r)=>St(e+r,t),sub:(e,r)=>St(e-r,t),mul:(e,r)=>St(e*r,t),pow:(t,e)=>Ut(h,t,e),div:(e,r)=>St(e*At(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>At(e,t),sqrt:s||(e=>(f||(f=Lt(t)),f(h,e))),toBytes:t=>r?(0,dt.numberToBytesLE)(t,u):(0,dt.numberToBytesBE)(t,u),fromBytes:(e,n=!0)=>{if(i){if(!i.includes(e.length)||e.length>u)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);const t=new Uint8Array(u);t.set(e,r?0:t.length-e.length),e=t}if(e.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+e.length);let o=r?(0,dt.bytesToNumberLE)(e):(0,dt.bytesToNumberBE)(e);if(c&&(o=St(o,t)),!n&&!h.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:t=>Tt(h,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(h)}function Ft(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Nt(t){const e=Ft(t);return e+Math.ceil(e/2)}Object.defineProperty(ft,"__esModule",{value:!0}),ft.wNAF=void 0,ft.negateCt=Mt,ft.normalizeZ=function(t,e){const r=(0,Kt.FpInvertBatch)(t.Fp,e.map((t=>t.Z)));return e.map(((e,n)=>t.fromAffine(e.toAffine(r[n]))))},ft.mulEndoUnsafe=function(t,e,r,n){let o=e,s=t.ZERO,i=t.ZERO;for(;r>Dt||n>Dt;)r&jt&&(s=s.add(o)),n&jt&&(i=i.add(o)),o=o.double(),r>>=jt,n>>=jt;return{p1:s,p2:i}},ft.pippenger=function(t,e,r,n){zt(r,t),Yt(n,e);const o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,c=(0,kt.bitLen)(BigInt(o));let a=1;c>12?a=c-3:c>4?a=c-2:c>0&&(a=2);const u=(0,kt.bitMask)(a),f=new Array(Number(u)+1).fill(i),h=Math.floor((e.BITS-1)/a)*a;let l=i;for(let t=h;t>=0;t-=a){f.fill(i);for(let e=0;e<s;e++){const o=n[e],s=Number(o>>BigInt(t)&u);f[s]=f[s].add(r[e])}let e=i;for(let t=f.length-1,r=i;t>0;t--)r=r.add(f[t]),e=e.add(r);if(l=l.add(e),0!==t)for(let t=0;t<a;t++)l=l.double()}return l},ft.precomputeMSMUnsafe=function(t,e,r,n){qt(n,e.BITS),zt(r,t);const o=t.ZERO,s=2**n-1,i=Math.ceil(e.BITS/n),c=(0,kt.bitMask)(n),a=r.map((t=>{const e=[];for(let r=0,n=t;r<s;r++)e.push(n),n=n.add(t);return e}));return t=>{if(Yt(t,e),t.length>r.length)throw new Error("array of scalars must be smaller than array of points");let s=o;for(let e=0;e<i;e++){if(s!==o)for(let t=0;t<n;t++)s=s.double();const r=BigInt(i*n-(e+1)*n);for(let e=0;e<t.length;e++){const n=t[e],o=Number(n>>r&c);o&&(s=s.add(a[e][o-1]))}}return s}},ft.validateBasic=function(t){return(0,Kt.validateField)(t.Fp),(0,kt.validateObject)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,Kt.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})},ft._createCurveFields=function(t,e,r={},n){void 0===n&&(n="edwards"===t);if(!e||"object"!=typeof e)throw new Error(`expected valid ${t} CURVE object`);for(const t of["p","n","h"]){const r=e[t];if(!("bigint"==typeof r&&r>Dt))throw new Error(`CURVE.${t} must be positive bigint`)}const o=Qt(e.p,r.Fp,n),s=Qt(e.n,r.Fn,n),i=["Gx","Gy","a","weierstrass"===t?"b":"d"];for(const t of i)if(!o.isValid(e[t]))throw new Error(`CURVE.${t} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:o,Fn:s}};
11
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
12
+ const kt=ht,Kt=lt,Dt=BigInt(0),jt=BigInt(1);function Mt(t,e){const r=e.negate();return t?r:e}function qt(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Gt(t,e){qt(t,e);const r=2**t;return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1),mask:(0,kt.bitMask)(t),maxNumber:r,shiftBy:BigInt(t)}}function Zt(t,e,r){const{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r;let c=Number(t&o),a=t>>i;c>n&&(c-=s,a+=jt);const u=e*n;return{nextN:a,offset:u+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:e%2!=0,offsetF:u}}function zt(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach(((t,r)=>{if(!(t instanceof e))throw new Error("invalid point at index "+r)}))}function Yt(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach(((t,r)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+r)}))}const Xt=new WeakMap,Wt=new WeakMap;function $t(t){return Wt.get(t)||1}function Jt(t){if(t!==Dt)throw new Error("invalid wNAF")}function Qt(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,Kt.validateField)(e),e}return(0,Kt.Field)(t,{isLE:r})}ft.wNAF=class{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,r=this.ZERO){let n=t;for(;e>Dt;)e&jt&&(r=r.add(n)),n=n.double(),e>>=jt;return r}precomputeWindow(t,e){const{windows:r,windowSize:n}=Gt(e,this.bits),o=[];let s=t,i=s;for(let t=0;t<r;t++){i=s,o.push(i);for(let t=1;t<n;t++)i=i.add(s),o.push(i);s=i.double()}return o}wNAF(t,e,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const s=Gt(t,this.bits);for(let t=0;t<s.windows;t++){const{nextN:i,offset:c,isZero:a,isNeg:u,isNegF:f,offsetF:h}=Zt(r,t,s);r=i,a?o=o.add(Mt(f,e[h])):n=n.add(Mt(u,e[c]))}return Jt(r),{p:n,f:o}}wNAFUnsafe(t,e,r,n=this.ZERO){const o=Gt(t,this.bits);for(let t=0;t<o.windows&&r!==Dt;t++){const{nextN:s,offset:i,isZero:c,isNeg:a}=Zt(r,t,o);if(r=s,!c){const t=e[i];n=n.add(a?t.negate():t)}}return Jt(r),n}getPrecomputes(t,e,r){let n=Xt.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&("function"==typeof r&&(n=r(n)),Xt.set(e,n))),n}cached(t,e,r){const n=$t(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)}unsafe(t,e,r,n){const o=$t(t);return 1===o?this._unsafeLadder(t,e,n):this.wNAFUnsafe(o,this.getPrecomputes(o,t,r),e,n)}createCache(t,e){qt(e,this.bits),Wt.set(t,e),Xt.delete(t)}hasCache(t){return 1!==$t(t)}};var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.PrimeEdwardsPoint=void 0,te.edwards=ae,te.eddsa=ue,te.twistedEdwards=function(t){const{CURVE:e,curveOpts:r,hash:n,eddsaOpts:o}=function(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp,n=(0,ne.Field)(e.n,t.nBitLength,!0),o={Fp:r,Fn:n,uvRatio:t.uvRatio},s={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:o,hash:t.hash,eddsaOpts:s}}(t),s=ue(ae(e,r),n,o);return function(t,e){const r=e.Point,n=Object.assign({},e,{ExtendedPoint:r,CURVE:t,nBitLength:r.Fn.BITS,nByteLength:r.Fn.BYTES});return n}(t,s)};
13
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
14
+ const ee=ht,re=ft,ne=lt,oe=BigInt(0),se=BigInt(1),ie=BigInt(2),ce=BigInt(8);function ae(t,e={}){const r=(0,re._createCurveFields)("edwards",t,e,e.FpFnLE),{Fp:n,Fn:o}=r;let s=r.CURVE;const{h:i}=s;(0,ee._validateObject)(e,{},{uvRatio:"function"});const c=ie<<BigInt(8*o.BYTES)-se,a=t=>n.create(t),u=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:n.sqrt(n.div(t,e))}}catch(t){return{isValid:!1,value:oe}}});if(!function(t,e,r,n){const o=t.sqr(r),s=t.sqr(n),i=t.add(t.mul(e.a,o),s),c=t.add(t.ONE,t.mul(e.d,t.mul(o,s)));return t.eql(i,c)}(n,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function f(t,e,r=!1){const n=r?se:oe;return(0,ee.aInRange)("coordinate "+t,e,n,c),e}function h(t){if(!(t instanceof y))throw new Error("ExtendedPoint expected")}const l=(0,ee.memoized)(((t,e)=>{const{X:r,Y:o,Z:s}=t,i=t.is0();null==e&&(e=i?ce:n.inv(s));const c=a(r*e),u=a(o*e),f=n.mul(s,e);if(i)return{x:oe,y:se};if(f!==se)throw new Error("invZ was invalid");return{x:c,y:u}})),d=(0,ee.memoized)((t=>{const{a:e,d:r}=s;if(t.is0())throw new Error("bad point: ZERO");const{X:n,Y:o,Z:i,T:c}=t,u=a(n*n),f=a(o*o),h=a(i*i),l=a(h*h),d=a(u*e);if(a(h*a(d+f))!==a(l+a(r*a(u*f))))throw new Error("bad point: equation left != right (1)");if(a(n*o)!==a(i*c))throw new Error("bad point: equation left != right (2)");return!0}));class y{constructor(t,e,r,n){this.X=f("x",t),this.Y=f("y",e),this.Z=f("z",r,!0),this.T=f("t",n),Object.freeze(this)}static CURVE(){return s}static fromAffine(t){if(t instanceof y)throw new Error("extended point not allowed");const{x:e,y:r}=t||{};return f("x",e),f("y",r),new y(e,r,se,a(e*r))}static fromBytes(t,e=!1){const r=n.BYTES,{a:o,d:i}=s;t=(0,ee.copyBytes)((0,ee._abytes2)(t,r,"point")),(0,ee._abool2)(e,"zip215");const f=(0,ee.copyBytes)(t),h=t[r-1];f[r-1]=-129&h;const l=(0,ee.bytesToNumberLE)(f),d=e?c:n.ORDER;(0,ee.aInRange)("point.y",l,oe,d);const p=a(l*l),b=a(p-se),g=a(i*p-o);let{isValid:w,value:m}=u(b,g);if(!w)throw new Error("bad point: invalid y coordinate");const E=(m&se)===se,B=0!=(128&h);if(!e&&m===oe&&B)throw new Error("bad point: x=0 and x_0=1");return B!==E&&(m=a(-m)),y.fromAffine({x:m,y:l})}static fromHex(t,e=!1){return y.fromBytes((0,ee.ensureBytes)("point",t),e)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return p.createCache(this,t),e||this.multiply(ie),this}assertValidity(){d(this)}equals(t){h(t);const{X:e,Y:r,Z:n}=this,{X:o,Y:s,Z:i}=t,c=a(e*i),u=a(o*n),f=a(r*i),l=a(s*n);return c===u&&f===l}is0(){return this.equals(y.ZERO)}negate(){return new y(a(-this.X),this.Y,this.Z,a(-this.T))}double(){const{a:t}=s,{X:e,Y:r,Z:n}=this,o=a(e*e),i=a(r*r),c=a(ie*a(n*n)),u=a(t*o),f=e+r,h=a(a(f*f)-o-i),l=u+i,d=l-c,p=u-i,b=a(h*d),g=a(l*p),w=a(h*p),m=a(d*l);return new y(b,g,m,w)}add(t){h(t);const{a:e,d:r}=s,{X:n,Y:o,Z:i,T:c}=this,{X:u,Y:f,Z:l,T:d}=t,p=a(n*u),b=a(o*f),g=a(c*r*d),w=a(i*l),m=a((n+o)*(u+f)-p-b),E=w-g,B=w+g,x=a(b-e*p),v=a(m*E),S=a(B*x),A=a(m*x),_=a(E*B);return new y(v,S,_,A)}subtract(t){return this.add(t.negate())}multiply(t){if(!o.isValidNot0(t))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:e,f:r}=p.cached(this,t,(t=>(0,re.normalizeZ)(y,t)));return(0,re.normalizeZ)(y,[e,r])[0]}multiplyUnsafe(t,e=y.ZERO){if(!o.isValid(t))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return t===oe?y.ZERO:this.is0()||t===se?this:p.unsafe(this,t,(t=>(0,re.normalizeZ)(y,t)),e)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}isTorsionFree(){return p.unsafe(this,s.n).is0()}toAffine(t){return l(this,t)}clearCofactor(){return i===se?this:this.multiplyUnsafe(i)}toBytes(){const{x:t,y:e}=this.toAffine(),r=n.toBytes(e);return r[r.length-1]|=t&se?128:0,r}toHex(){return(0,ee.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return(0,re.normalizeZ)(y,t)}static msm(t,e){return(0,re.pippenger)(y,o,t,e)}_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}y.BASE=new y(s.Gx,s.Gy,se,a(s.Gx*s.Gy)),y.ZERO=new y(oe,se,se,oe),y.Fp=n,y.Fn=o;const p=new re.wNAF(y,o.BITS);return y.BASE.precompute(8),y}function ue(t,e,r={}){if("function"!=typeof e)throw new Error('"hash" function param is required');(0,ee._validateObject)(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:n}=r,{BASE:o,Fp:s,Fn:i}=t,c=r.randomBytes||ee.randomBytes,a=r.adjustScalarBytes||(t=>t),u=r.domain||((t,e,r)=>{if((0,ee._abool2)(r,"phflag"),e.length||r)throw new Error("Contexts/pre-hash are not supported");return t});function f(t){return i.create((0,ee.bytesToNumberLE)(t))}function h(t){const{head:r,prefix:n,scalar:s}=function(t){const r=b.secretKey;t=(0,ee.ensureBytes)("private key",t,r);const n=(0,ee.ensureBytes)("hashed private key",e(t),2*r),o=a(n.slice(0,r));return{head:o,prefix:n.slice(r,2*r),scalar:f(o)}}(t),i=o.multiply(s),c=i.toBytes();return{head:r,prefix:n,scalar:s,point:i,pointBytes:c}}function l(t){return h(t).pointBytes}function d(t=Uint8Array.of(),...r){const o=(0,ee.concatBytes)(...r);return f(e(u(o,(0,ee.ensureBytes)("context",t),!!n)))}const y={zip215:!0};const p=s.BYTES,b={secretKey:p,publicKey:p,signature:2*p,seed:p};function g(t=c(b.seed)){return(0,ee._abytes2)(t,b.seed,"seed")}const w={getExtendedPublicKey:h,randomSecretKey:g,isValidSecretKey:function(t){return(0,ee.isBytes)(t)&&t.length===i.BYTES},isValidPublicKey:function(e,r){try{return!!t.fromBytes(e,r)}catch(t){return!1}},toMontgomery(e){const{y:r}=t.fromBytes(e),n=b.publicKey,o=32===n;if(!o&&57!==n)throw new Error("only defined for 25519 and 448");const i=o?s.div(se+r,se-r):s.div(r-se,r+se);return s.toBytes(i)},toMontgomerySecret(t){const r=b.secretKey;(0,ee._abytes2)(t,r);const n=e(t.subarray(0,r));return a(n).subarray(0,r)},randomPrivateKey:g,precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({keygen:function(t){const e=w.randomSecretKey(t);return{secretKey:e,publicKey:l(e)}},getPublicKey:l,sign:function(t,e,r={}){t=(0,ee.ensureBytes)("message",t),n&&(t=n(t));const{prefix:s,scalar:c,pointBytes:a}=h(e),u=d(r.context,s,t),f=o.multiply(u).toBytes(),l=d(r.context,f,a,t),y=i.create(u+l*c);if(!i.isValid(y))throw new Error("sign failed: invalid s");const p=(0,ee.concatBytes)(f,i.toBytes(y));return(0,ee._abytes2)(p,b.signature,"result")},verify:function(e,r,s,i=y){const{context:c,zip215:a}=i,u=b.signature;e=(0,ee.ensureBytes)("signature",e,u),r=(0,ee.ensureBytes)("message",r),s=(0,ee.ensureBytes)("publicKey",s,b.publicKey),void 0!==a&&(0,ee._abool2)(a,"zip215"),n&&(r=n(r));const f=u/2,h=e.subarray(0,f),l=(0,ee.bytesToNumberLE)(e.subarray(f,u));let p,g,w;try{p=t.fromBytes(s,a),g=t.fromBytes(h,a),w=o.multiplyUnsafe(l)}catch(t){return!1}if(!a&&p.isSmallOrder())return!1;const m=d(c,g.toBytes(),p.toBytes(),r);return g.add(p.multiplyUnsafe(m)).subtract(w).clearCofactor().is0()},utils:w,Point:t,lengths:b})}te.PrimeEdwardsPoint=class{constructor(t){this.ep=t}static fromBytes(t){(0,ee.notImplemented)()}static fromHex(t){(0,ee.notImplemented)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return(0,ee.bytesToHex)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}};var fe={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._DST_scalar=void 0,t.expand_message_xmd=a,t.expand_message_xof=u,t.hash_to_field=f,t.isogenyMap=function(t,e){const n=e.map((t=>Array.from(t).reverse()));return(e,o)=>{const[s,i,c,a]=n.map((r=>r.reduce(((r,n)=>t.add(t.mul(r,e),n))))),[u,f]=(0,r.FpInvertBatch)(t,[i,a],!0);return e=t.mul(s,u),o=t.mul(o,t.mul(c,f)),{x:e,y:o}}},t.createHasher=function(e,r,n){if("function"!=typeof r)throw new Error("mapToCurve() must be defined");function o(t){return e.fromAffine(r(t))}function s(t){const r=t.clearCofactor();return r.equals(e.ZERO)?e.ZERO:(r.assertValidity(),r)}return{defaults:n,hashToCurve(t,e){const r=f(t,2,Object.assign({},n,e)),i=o(r[0]),c=o(r[1]);return s(i.add(c))},encodeToCurve(t,e){const r=n.encodeDST?{DST:n.encodeDST}:{};return s(o(f(t,1,Object.assign({},n,r,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw new Error("expected array of bigints");for(const e of t)if("bigint"!=typeof e)throw new Error("expected array of bigints");return s(o(t))},hashToScalar(r,o){const s=e.Fn.ORDER;return f(r,1,Object.assign({},n,{p:s,m:1,DST:t._DST_scalar},o))[0][0]}}};const e=ht,r=lt,n=e.bytesToNumberBE;function o(t,e){if(i(t),i(e),t<0||t>=1<<8*e)throw new Error("invalid I2OSP input: "+t);const r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function s(t,e){const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function i(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function c(t){if(!(0,e.isBytes)(t)&&"string"!=typeof t)throw new Error("DST must be Uint8Array or string");return"string"==typeof t?(0,e.utf8ToBytes)(t):t}function a(t,r,n,a){(0,e.abytes)(t),i(n),(r=c(r)).length>255&&(r=a((0,e.concatBytes)((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-"),r)));const{outputLen:u,blockLen:f}=a,h=Math.ceil(n/u);if(n>65535||h>255)throw new Error("expand_message_xmd: invalid lenInBytes");const l=(0,e.concatBytes)(r,o(r.length,1)),d=o(0,f),y=o(n,2),p=new Array(h),b=a((0,e.concatBytes)(d,t,y,o(0,1),l));p[0]=a((0,e.concatBytes)(b,o(1,1),l));for(let t=1;t<=h;t++){const r=[s(b,p[t-1]),o(t+1,1),l];p[t]=a((0,e.concatBytes)(...r))}return(0,e.concatBytes)(...p).slice(0,n)}function u(t,r,n,s,a){if((0,e.abytes)(t),i(n),(r=c(r)).length>255){const t=Math.ceil(2*s/8);r=a.create({dkLen:t}).update((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(r).digest()}if(n>65535||r.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return a.create({dkLen:n}).update(t).update(o(n,2)).update(r).update(o(r.length,1)).digest()}function f(t,o,s){(0,e._validateObject)(s,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:c,k:f,m:h,hash:l,expand:d,DST:y}=s;if(!(0,e.isHash)(s.hash))throw new Error("expected valid hash");(0,e.abytes)(t),i(o);const p=c.toString(2).length,b=Math.ceil((p+f)/8),g=o*h*b;let w;if("xmd"===d)w=a(t,y,g,l);else if("xof"===d)w=u(t,y,g,f,l);else{if("_internal_pass"!==d)throw new Error('expand must be "xmd" or "xof"');w=t}const m=new Array(o);for(let t=0;t<o;t++){const e=new Array(h);for(let o=0;o<h;o++){const s=b*(o+t*h),i=w.subarray(s,s+b);e[o]=(0,r.mod)(n(i),c)}m[t]=e}return m}t._DST_scalar=(0,e.utf8ToBytes)("HashToScalar-")}(fe);var he={};Object.defineProperty(he,"__esModule",{value:!0}),he.montgomery=function(t){const e=function(t){return(0,le._validateObject)(t,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...t})}(t),{P:r,type:n,adjustScalarBytes:o,powPminus2:s,randomBytes:i}=e,c="x25519"===n;if(!c&&"x448"!==n)throw new Error("invalid type");const a=i||le.randomBytes,u=c?255:448,f=c?32:56,h=c?BigInt(9):BigInt(5),l=c?BigInt(121665):BigInt(39081),d=c?be**BigInt(254):be**BigInt(447),y=c?BigInt(8)*be**BigInt(251)-pe:BigInt(4)*be**BigInt(445)-pe,p=d+y+pe,b=t=>(0,de.mod)(t,r),g=w(h);function w(t){return(0,le.numberToBytesLE)(b(t),f)}function m(t,e){const n=function(t,e){(0,le.aInRange)("u",t,ye,r),(0,le.aInRange)("scalar",e,d,p);const n=e,o=t;let i=pe,c=ye,a=t,f=pe,h=ye;for(let t=BigInt(u-1);t>=ye;t--){const e=n>>t&pe;h^=e,({x_2:i,x_3:a}=B(h,i,a)),({x_2:c,x_3:f}=B(h,c,f)),h=e;const r=i+c,s=b(r*r),u=i-c,d=b(u*u),y=s-d,p=a+f,g=b((a-f)*r),w=b(p*u),m=g+w,E=g-w;a=b(m*m),f=b(o*b(E*E)),i=b(s*d),c=b(y*(s+b(l*y)))}({x_2:i,x_3:a}=B(h,i,a)),({x_2:c,x_3:f}=B(h,c,f));const y=s(c);return b(i*y)}(function(t){const e=(0,le.ensureBytes)("u coordinate",t,f);return c&&(e[31]&=127),b((0,le.bytesToNumberLE)(e))}(e),function(t){return(0,le.bytesToNumberLE)(o((0,le.ensureBytes)("scalar",t,f)))}(t));if(n===ye)throw new Error("invalid private or public key received");return w(n)}function E(t){return m(t,g)}function B(t,e,r){const n=b(t*(e-r));return{x_2:e=b(e-n),x_3:r=b(r+n)}}const x={secretKey:f,publicKey:f,seed:f},v=(t=a(f))=>((0,le.abytes)(t,x.seed),t);const S={randomSecretKey:v,randomPrivateKey:v};return{keygen:function(t){const e=v(t);return{secretKey:e,publicKey:E(e)}},getSharedSecret:(t,e)=>m(t,e),getPublicKey:t=>E(t),scalarMult:m,scalarMultBase:E,utils:S,GuBytes:g.slice(),lengths:x}};
15
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
16
+ const le=ht,de=lt,ye=BigInt(0),pe=BigInt(1),be=BigInt(2);!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash_to_ristretto255=t.hashToRistretto255=t.encodeToCurve=t.hashToCurve=t.RistrettoPoint=t.edwardsToMontgomery=t.ED25519_TORSION_SUBGROUP=t.ristretto255_hasher=t.ristretto255=t.ed25519_hasher=t.x25519=t.ed25519ph=t.ed25519ctx=t.ed25519=void 0,t.edwardsToMontgomeryPub=M,t.edwardsToMontgomeryPriv=function(e){return t.ed25519.utils.toMontgomerySecret((0,a.ensureBytes)("pub",e))};
17
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
18
+ const e=y,r=b,n=ft,o=te,s=fe,i=lt,c=he,a=ht,u=BigInt(0),f=BigInt(1),h=BigInt(2),l=BigInt(3),d=BigInt(5),p=BigInt(8),g=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),w=(()=>({p:g,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:p,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}))();function m(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),s=g,c=t*t%s*t%s,a=(0,i.pow2)(c,h,s)*c%s,u=(0,i.pow2)(a,f,s)*t%s,l=(0,i.pow2)(u,d,s)*u%s,y=(0,i.pow2)(l,e,s)*l%s,p=(0,i.pow2)(y,r,s)*y%s,b=(0,i.pow2)(p,n,s)*p%s,w=(0,i.pow2)(b,o,s)*b%s,m=(0,i.pow2)(w,o,s)*b%s,E=(0,i.pow2)(m,e,s)*l%s;return{pow_p_5_8:(0,i.pow2)(E,h,s)*t%s,b2:c}}function E(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const B=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function x(t,e){const r=g,n=(0,i.mod)(e*e*e,r),o=m(t*(0,i.mod)(n*n*e,r)).pow_p_5_8;let s=(0,i.mod)(t*n*o,r);const c=(0,i.mod)(e*s*s,r),a=s,u=(0,i.mod)(s*B,r),f=c===t,h=c===(0,i.mod)(-t,r),l=c===(0,i.mod)(-t*B,r);return f&&(s=a),(h||l)&&(s=u),(0,i.isNegativeLE)(s,r)&&(s=(0,i.mod)(-s,r)),{isValid:f||h,value:s}}const v=(()=>(0,i.Field)(w.p,{isLE:!0}))(),S=(()=>(0,i.Field)(w.n,{isLE:!0}))(),A=(()=>({...w,Fp:v,hash:e.sha512,adjustScalarBytes:E,uvRatio:x}))();function _(t,e,n){if(e.length>255)throw new Error("Context is too big");return(0,r.concatBytes)((0,r.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,e.length]),e,t)}t.ed25519=(0,o.twistedEdwards)(A),t.ed25519ctx=(0,o.twistedEdwards)({...A,domain:_}),t.ed25519ph=(0,o.twistedEdwards)(Object.assign({},A,{domain:_,prehash:e.sha512})),t.x25519=(()=>{const t=v.ORDER;return(0,c.montgomery)({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:r,b2:n}=m(e);return(0,i.mod)((0,i.pow2)(r,l,t)*n,t)},adjustScalarBytes:E})})();const H=(()=>(g+l)/p)(),I=(()=>v.pow(h,H))(),O=(()=>v.sqrt(v.neg(v.ONE)))();const L=(()=>(0,i.FpSqrtEven)(v,v.neg(BigInt(486664))))();function C(t){const{xMn:e,xMd:r,yMn:n,yMd:o}=function(t){const e=(g-d)/p,r=BigInt(486662);let n=v.sqr(t);n=v.mul(n,h);let o=v.add(n,v.ONE),s=v.neg(r),i=v.sqr(o),c=v.mul(i,o),a=v.mul(n,r);a=v.mul(a,s),a=v.add(a,i),a=v.mul(a,s);let u=v.sqr(c);i=v.sqr(u),u=v.mul(u,c),u=v.mul(u,a),i=v.mul(i,u);let l=v.pow(i,e);l=v.mul(l,u);let y=v.mul(l,O);i=v.sqr(l),i=v.mul(i,c);let b=v.eql(i,a),w=v.cmov(y,l,b),m=v.mul(s,n),E=v.mul(l,t);E=v.mul(E,I);let B=v.mul(E,O),x=v.mul(a,n);i=v.sqr(E),i=v.mul(i,c);let S=v.eql(i,x),A=v.cmov(B,E,S);i=v.sqr(w),i=v.mul(i,c);let _=v.eql(i,a),H=v.cmov(m,s,_),L=v.cmov(A,w,_),C=v.isOdd(L);return L=v.cmov(L,v.neg(L),_!==C),{xMn:H,xMd:o,yMn:L,yMd:f}}(t);let s=v.mul(e,o);s=v.mul(s,L);let c=v.mul(r,n),a=v.sub(e,r),u=v.add(e,r),l=v.mul(c,u),y=v.eql(l,v.ZERO);s=v.cmov(s,v.ZERO,y),c=v.cmov(c,v.ONE,y),a=v.cmov(a,v.ONE,y),u=v.cmov(u,v.ONE,y);const[b,w]=(0,i.FpInvertBatch)(v,[c,u],!0);return{x:v.mul(s,b),y:v.mul(a,w)}}t.ed25519_hasher=(0,s.createHasher)(t.ed25519.Point,(t=>C(t[0])),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:g,m:1,k:128,expand:"xmd",hash:e.sha512});const U=B,T=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),P=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),V=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),R=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),F=t=>x(f,t),N=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),k=e=>t.ed25519.Point.Fp.create((0,a.bytesToNumberLE)(e)&N);function K(e){const{d:r}=w,n=g,o=t=>v.create(t),s=o(U*e*e),c=o((s+f)*V);let a=BigInt(-1);const u=o((a-r*s)*o(s+r));let{isValid:h,value:l}=x(c,u),d=o(l*e);(0,i.isNegativeLE)(d,n)||(d=o(-d)),h||(l=d),h||(a=s);const y=o(a*(s-f)*R-u),p=l*l,b=o((l+l)*u),m=o(y*T),E=o(f-p),B=o(f+p);return new t.ed25519.Point(o(b*B),o(E*m),o(m*B),o(b*E))}function D(t){(0,r.abytes)(t,64);const e=K(k(t.subarray(0,32))),n=K(k(t.subarray(32,64)));return new j(e.add(n))}class j extends o.PrimeEdwardsPoint{constructor(t){super(t)}static fromAffine(e){return new j(t.ed25519.Point.fromAffine(e))}assertSame(t){if(!(t instanceof j))throw new Error("RistrettoPoint expected")}init(t){return new j(t)}static hashToCurve(t){return D((0,a.ensureBytes)("ristrettoHash",t,64))}static fromBytes(e){(0,r.abytes)(e,32);const{a:n,d:o}=w,s=g,c=t=>v.create(t),h=k(e);if(!(0,a.equalBytes)(v.toBytes(h),e)||(0,i.isNegativeLE)(h,s))throw new Error("invalid ristretto255 encoding 1");const l=c(h*h),d=c(f+n*l),y=c(f-n*l),p=c(d*d),b=c(y*y),m=c(n*o*p-b),{isValid:E,value:B}=F(c(m*b)),x=c(B*y),S=c(B*x*m);let A=c((h+h)*x);(0,i.isNegativeLE)(A,s)&&(A=c(-A));const _=c(d*S),H=c(A*_);if(!E||(0,i.isNegativeLE)(H,s)||_===u)throw new Error("invalid ristretto255 encoding 2");return new j(new t.ed25519.Point(A,_,f,H))}static fromHex(t){return j.fromBytes((0,a.ensureBytes)("ristrettoHex",t,32))}static msm(e,r){return(0,n.pippenger)(j,t.ed25519.Point.Fn,e,r)}toBytes(){let{X:t,Y:e,Z:r,T:n}=this.ep;const o=g,s=t=>v.create(t),c=s(s(r+e)*s(r-e)),a=s(t*e),u=s(a*a),{value:f}=F(s(c*u)),h=s(f*c),l=s(f*a),d=s(h*l*n);let y;if((0,i.isNegativeLE)(n*d,o)){let r=s(e*U),n=s(t*U);t=r,e=n,y=s(h*P)}else y=l;(0,i.isNegativeLE)(t*d,o)&&(e=s(-e));let p=s((r-e)*y);return(0,i.isNegativeLE)(p,o)&&(p=s(-p)),v.toBytes(p)}equals(t){this.assertSame(t);const{X:e,Y:r}=this.ep,{X:n,Y:o}=t.ep,s=t=>v.create(t),i=s(e*o)===s(r*n),c=s(r*o)===s(e*n);return i||c}is0(){return this.equals(j.ZERO)}}function M(e){return t.ed25519.utils.toMontgomery((0,a.ensureBytes)("pub",e))}j.BASE=(()=>new j(t.ed25519.Point.BASE))(),j.ZERO=(()=>new j(t.ed25519.Point.ZERO))(),j.Fp=(()=>v)(),j.Fn=(()=>S)(),t.ristretto255={Point:j},t.ristretto255_hasher={hashToCurve:(t,r)=>D((0,s.expand_message_xmd)(t,r?.DST||"ristretto255_XMD:SHA-512_R255MAP_RO_",64,e.sha512)),hashToScalar(t,r={DST:s._DST_scalar}){const n=(0,s.expand_message_xmd)(t,r.DST,64,e.sha512);return S.create((0,a.bytesToNumberLE)(n))}},t.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],t.edwardsToMontgomery=M,t.RistrettoPoint=j,t.hashToCurve=t.ed25519_hasher.hashToCurve,t.encodeToCurve=t.ed25519_hasher.encodeToCurve,t.hashToRistretto255=t.ristretto255_hasher.hashToCurve,t.hash_to_ristretto255=t.ristretto255_hasher.hashToCurve}(d);var ge={},we={},me={},Ee={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=b;class r extends e.Hash{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,(0,e.ahash)(t);const n=(0,e.toBytes)(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)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,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),(0,e.clean)(s)}update(t){return(0,e.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,e.aexists)(this),(0,e.abytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:o,blockLen:s,outputLen:i}=this;return t.finished=n,t.destroyed=o,t.blockLen=s,t.outputLen=i,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=r;t.hmac=(t,e,n)=>new r(t,e).update(n).digest(),t.hmac.create=(t,e)=>new r(t,e)}(Ee),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t._splitEndoScalar=c,t._normFnElement=g,t.weierstrassN=w,t.SWUFpSqrtRatio=E,t.mapToCurveSimpleSWU=function(t,e){(0,s.validateField)(t);const{A:r,B:n,Z:o}=e;if(!t.isValid(r)||!t.isValid(n)||!t.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");const i=E(t,o);if(!t.isOdd)throw new Error("Field does not have .isOdd()");return e=>{let c,a,u,f,h,l,d,y;c=t.sqr(e),c=t.mul(c,o),a=t.sqr(c),a=t.add(a,c),u=t.add(a,t.ONE),u=t.mul(u,n),f=t.cmov(o,t.neg(a),!t.eql(a,t.ZERO)),f=t.mul(f,r),a=t.sqr(u),l=t.sqr(f),h=t.mul(l,r),a=t.add(a,h),a=t.mul(a,u),l=t.mul(l,f),h=t.mul(l,n),a=t.add(a,h),d=t.mul(c,u);const{isValid:p,value:b}=i(a,l);y=t.mul(c,e),y=t.mul(y,b),d=t.cmov(d,u,p),y=t.cmov(y,b,p);const g=t.isOdd(e)===t.isOdd(y);y=t.cmov(t.neg(y),y,g);const w=(0,s.FpInvertBatch)(t,[f],!0)[0];return d=t.mul(d,w),{x:d,y:y}}},t.ecdh=x,t.ecdsa=v,t.weierstrassPoints=function(t){const{CURVE:e,curveOpts:r}=S(t),o=w(e,r);return function(t,e){const{Fp:r,Fn:o}=e;function s(t){return(0,n.inRange)(t,l,o.ORDER)}const i=A(r,t.a,t.b);return Object.assign({},{CURVE:t,Point:e,ProjectivePoint:e,normPrivateKeyToScalar:t=>g(o,t),weierstrassEquation:i,isWithinCurveOrder:s})}(t,o)},t._legacyHelperEquat=A,t.weierstrass=function(t){const{CURVE:e,curveOpts:r,hash:n,ecdsaOpts:o}=function(t){const{CURVE:e,curveOpts:r}=S(t),n={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:r,hash:t.hash,ecdsaOpts:n}}(t),i=v(w(e,r),n,o);return function(t,e){const r=e.Point;return Object.assign({},e,{ProjectivePoint:r,CURVE:Object.assign({},t,(0,s.nLength)(r.Fn.ORDER,r.Fn.BITS))})}(t,i)};
19
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
20
+ const e=Ee,r=b,n=ht,o=ft,s=lt,i=(t,e)=>(t+(t>=0?e:-e)/d)/e;function c(t,e,r){const[[o,s],[c,a]]=e,u=i(a*t,r),f=i(-s*t,r);let d=t-u*o-f*c,y=-u*s-f*a;const p=d<h,b=y<h;p&&(d=-d),b&&(y=-y);const g=(0,n.bitMask)(Math.ceil((0,n.bitLen)(r)/2))+l;if(d<h||d>=g||y<h||y>=g)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:p,k1:d,k2neg:b,k2:y}}function a(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function u(t,e){const r={};for(let n of Object.keys(e))r[n]=void 0===t[n]?e[n]:t[n];return(0,n._abool2)(r.lowS,"lowS"),(0,n._abool2)(r.prehash,"prehash"),void 0!==r.format&&a(r.format),r}class f extends Error{constructor(t=""){super(t)}}t.DERErr=f,t.DER={Err:f,_tlv:{encode:(e,r)=>{const{Err:o}=t.DER;if(e<0||e>256)throw new o("tlv.encode: wrong tag");if(1&r.length)throw new o("tlv.encode: unpadded data");const s=r.length/2,i=(0,n.numberToHexUnpadded)(s);if(i.length/2&128)throw new o("tlv.encode: long form length too big");const c=s>127?(0,n.numberToHexUnpadded)(i.length/2|128):"";return(0,n.numberToHexUnpadded)(e)+c+i+r},decode(e,r){const{Err:n}=t.DER;let o=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(r.length<2||r[o++]!==e)throw new n("tlv.decode: wrong tlv");const s=r[o++];let i=0;if(!!(128&s)){const t=127&s;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const e=r.subarray(o,o+t);if(e.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===e[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of e)i=i<<8|t;if(o+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=s;const c=r.subarray(o,o+i);if(c.length!==i)throw new n("tlv.decode: wrong value length");return{v:c,l:r.subarray(o+i)}}},_int:{encode(e){const{Err:r}=t.DER;if(e<h)throw new r("integer: negative integers are not allowed");let o=(0,n.numberToHexUnpadded)(e);if(8&Number.parseInt(o[0],16)&&(o="00"+o),1&o.length)throw new r("unexpected DER parsing assertion: unpadded hex");return o},decode(e){const{Err:r}=t.DER;if(128&e[0])throw new r("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new r("invalid signature integer: unnecessary leading zero");return(0,n.bytesToNumberBE)(e)}},toSig(e){const{Err:r,_int:o,_tlv:s}=t.DER,i=(0,n.ensureBytes)("signature",e),{v:c,l:a}=s.decode(48,i);if(a.length)throw new r("invalid signature: left bytes after parsing");const{v:u,l:f}=s.decode(2,c),{v:h,l:l}=s.decode(2,f);if(l.length)throw new r("invalid signature: left bytes after parsing");return{r:o.decode(u),s:o.decode(h)}},hexFromSig(e){const{_tlv:r,_int:n}=t.DER,o=r.encode(2,n.encode(e.r))+r.encode(2,n.encode(e.s));return r.encode(48,o)}};const h=BigInt(0),l=BigInt(1),d=BigInt(2),y=BigInt(3),p=BigInt(4);function g(t,e){const{BYTES:r}=t;let o;if("bigint"==typeof e)o=e;else{let s=(0,n.ensureBytes)("private key",e);try{o=t.fromBytes(s)}catch(t){throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof e}`)}}if(!t.isValidNot0(o))throw new Error("invalid private key: out of range [1..N-1]");return o}function w(t,e={}){const r=(0,o._createCurveFields)("weierstrass",t,e),{Fp:s,Fn:i}=r;let a=r.CURVE;const{h:u,n:f}=a;(0,n._validateObject)(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:d}=e;if(d&&(!s.is0(a.a)||"bigint"!=typeof d.beta||!Array.isArray(d.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const b=B(s,i);function w(){if(!s.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const E=e.toBytes||function(t,e,r){const{x:o,y:i}=e.toAffine(),c=s.toBytes(o);if((0,n._abool2)(r,"isCompressed"),r){w();const t=!s.isOdd(i);return(0,n.concatBytes)(m(t),c)}return(0,n.concatBytes)(Uint8Array.of(4),c,s.toBytes(i))},x=e.fromBytes||function(t){(0,n._abytes2)(t,void 0,"Point");const{publicKey:e,publicKeyUncompressed:r}=b,o=t.length,i=t[0],c=t.subarray(1);if(o!==e||2!==i&&3!==i){if(o===r&&4===i){const t=s.BYTES,e=s.fromBytes(c.subarray(0,t)),r=s.fromBytes(c.subarray(t,2*t));if(!S(e,r))throw new Error("bad point: is not on curve");return{x:e,y:r}}throw new Error(`bad point: got length ${o}, expected compressed=${e} or uncompressed=${r}`)}{const t=s.fromBytes(c);if(!s.isValid(t))throw new Error("bad point: is not on curve, wrong x");const e=v(t);let r;try{r=s.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("bad point: is not on curve, sqrt error"+e)}w();return 1==(1&i)!==s.isOdd(r)&&(r=s.neg(r)),{x:t,y:r}}};function v(t){const e=s.sqr(t),r=s.mul(e,t);return s.add(s.add(r,s.mul(t,a.a)),a.b)}function S(t,e){const r=s.sqr(e),n=v(t);return s.eql(r,n)}if(!S(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const A=s.mul(s.pow(a.a,y),p),_=s.mul(s.sqr(a.b),BigInt(27));if(s.is0(s.add(A,_)))throw new Error("bad curve params: a or b");function H(t,e,r=!1){if(!s.isValid(e)||r&&s.is0(e))throw new Error(`bad point coordinate ${t}`);return e}function I(t){if(!(t instanceof T))throw new Error("ProjectivePoint expected")}function O(t){if(!d||!d.basises)throw new Error("no endo");return c(t,d.basises,i.ORDER)}const L=(0,n.memoized)(((t,e)=>{const{X:r,Y:n,Z:o}=t;if(s.eql(o,s.ONE))return{x:r,y:n};const i=t.is0();null==e&&(e=i?s.ONE:s.inv(o));const c=s.mul(r,e),a=s.mul(n,e),u=s.mul(o,e);if(i)return{x:s.ZERO,y:s.ZERO};if(!s.eql(u,s.ONE))throw new Error("invZ was invalid");return{x:c,y:a}})),C=(0,n.memoized)((t=>{if(t.is0()){if(e.allowInfinityPoint&&!s.is0(t.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:n}=t.toAffine();if(!s.isValid(r)||!s.isValid(n))throw new Error("bad point: x or y not field elements");if(!S(r,n))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));function U(t,e,r,n,i){return r=new T(s.mul(r.X,t),r.Y,r.Z),e=(0,o.negateCt)(n,e),r=(0,o.negateCt)(i,r),e.add(r)}class T{constructor(t,e,r){this.X=H("x",t),this.Y=H("y",e,!0),this.Z=H("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(t){const{x:e,y:r}=t||{};if(!t||!s.isValid(e)||!s.isValid(r))throw new Error("invalid affine point");if(t instanceof T)throw new Error("projective point not allowed");return s.is0(e)&&s.is0(r)?T.ZERO:new T(e,r,s.ONE)}static fromBytes(t){const e=T.fromAffine(x((0,n._abytes2)(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return T.fromBytes((0,n.ensureBytes)("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return V.createCache(this,t),e||this.multiply(y),this}assertValidity(){C(this)}hasEvenY(){const{y:t}=this.toAffine();if(!s.isOdd)throw new Error("Field doesn't support isOdd");return!s.isOdd(t)}equals(t){I(t);const{X:e,Y:r,Z:n}=this,{X:o,Y:i,Z:c}=t,a=s.eql(s.mul(e,c),s.mul(o,n)),u=s.eql(s.mul(r,c),s.mul(i,n));return a&&u}negate(){return new T(this.X,s.neg(this.Y),this.Z)}double(){const{a:t,b:e}=a,r=s.mul(e,y),{X:n,Y:o,Z:i}=this;let c=s.ZERO,u=s.ZERO,f=s.ZERO,h=s.mul(n,n),l=s.mul(o,o),d=s.mul(i,i),p=s.mul(n,o);return p=s.add(p,p),f=s.mul(n,i),f=s.add(f,f),c=s.mul(t,f),u=s.mul(r,d),u=s.add(c,u),c=s.sub(l,u),u=s.add(l,u),u=s.mul(c,u),c=s.mul(p,c),f=s.mul(r,f),d=s.mul(t,d),p=s.sub(h,d),p=s.mul(t,p),p=s.add(p,f),f=s.add(h,h),h=s.add(f,h),h=s.add(h,d),h=s.mul(h,p),u=s.add(u,h),d=s.mul(o,i),d=s.add(d,d),h=s.mul(d,p),c=s.sub(c,h),f=s.mul(d,l),f=s.add(f,f),f=s.add(f,f),new T(c,u,f)}add(t){I(t);const{X:e,Y:r,Z:n}=this,{X:o,Y:i,Z:c}=t;let u=s.ZERO,f=s.ZERO,h=s.ZERO;const l=a.a,d=s.mul(a.b,y);let p=s.mul(e,o),b=s.mul(r,i),g=s.mul(n,c),w=s.add(e,r),m=s.add(o,i);w=s.mul(w,m),m=s.add(p,b),w=s.sub(w,m),m=s.add(e,n);let E=s.add(o,c);return m=s.mul(m,E),E=s.add(p,g),m=s.sub(m,E),E=s.add(r,n),u=s.add(i,c),E=s.mul(E,u),u=s.add(b,g),E=s.sub(E,u),h=s.mul(l,m),u=s.mul(d,g),h=s.add(u,h),u=s.sub(b,h),h=s.add(b,h),f=s.mul(u,h),b=s.add(p,p),b=s.add(b,p),g=s.mul(l,g),m=s.mul(d,m),b=s.add(b,g),g=s.sub(p,g),g=s.mul(l,g),m=s.add(m,g),p=s.mul(b,m),f=s.add(f,p),p=s.mul(E,m),u=s.mul(w,u),u=s.sub(u,p),p=s.mul(w,b),h=s.mul(E,h),h=s.add(h,p),new T(u,f,h)}subtract(t){return this.add(t.negate())}is0(){return this.equals(T.ZERO)}multiply(t){const{endo:r}=e;if(!i.isValidNot0(t))throw new Error("invalid scalar: out of range");let n,s;const c=t=>V.cached(this,t,(t=>(0,o.normalizeZ)(T,t)));if(r){const{k1neg:e,k1:o,k2neg:i,k2:a}=O(t),{p:u,f:f}=c(o),{p:h,f:l}=c(a);s=f.add(l),n=U(r.beta,u,h,e,i)}else{const{p:e,f:r}=c(t);n=e,s=r}return(0,o.normalizeZ)(T,[n,s])[0]}multiplyUnsafe(t){const{endo:r}=e,n=this;if(!i.isValid(t))throw new Error("invalid scalar: out of range");if(t===h||n.is0())return T.ZERO;if(t===l)return n;if(V.hasCache(this))return this.multiply(t);if(r){const{k1neg:e,k1:s,k2neg:i,k2:c}=O(t),{p1:a,p2:u}=(0,o.mulEndoUnsafe)(T,n,s,c);return U(r.beta,a,u,e,i)}return V.unsafe(n,t)}multiplyAndAddUnsafe(t,e,r){const n=this.multiplyUnsafe(e).add(t.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(t){return L(this,t)}isTorsionFree(){const{isTorsionFree:t}=e;return u===l||(t?t(T,this):V.unsafe(this,f).is0())}clearCofactor(){const{clearCofactor:t}=e;return u===l?this:t?t(T,this):this.multiplyUnsafe(u)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}toBytes(t=!0){return(0,n._abool2)(t,"isCompressed"),this.assertValidity(),E(T,this,t)}toHex(t=!0){return(0,n.bytesToHex)(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return(0,o.normalizeZ)(T,t)}static msm(t,e){return(0,o.pippenger)(T,i,t,e)}static fromPrivateKey(t){return T.BASE.multiply(g(i,t))}}T.BASE=new T(a.Gx,a.Gy,s.ONE),T.ZERO=new T(s.ZERO,s.ONE,s.ZERO),T.Fp=s,T.Fn=i;const P=i.BITS,V=new o.wNAF(T,e.endo?Math.ceil(P/2):P);return T.BASE.precompute(8),T}function m(t){return Uint8Array.of(t?2:3)}function E(t,e){const r=t.ORDER;let n=h;for(let t=r-l;t%d===h;t/=d)n+=l;const o=n,s=d<<o-l-l,i=s*d,c=(r-l)/i,a=(c-l)/d,u=i-l,f=s,b=t.pow(e,c),g=t.pow(e,(c+l)/d);let w=(e,r)=>{let n=b,s=t.pow(r,u),i=t.sqr(s);i=t.mul(i,r);let c=t.mul(e,i);c=t.pow(c,a),c=t.mul(c,s),s=t.mul(c,r),i=t.mul(c,e);let h=t.mul(i,s);c=t.pow(h,f);let y=t.eql(c,t.ONE);s=t.mul(i,g),c=t.mul(h,n),i=t.cmov(s,i,y),h=t.cmov(c,h,y);for(let e=o;e>l;e--){let r=e-d;r=d<<r-l;let o=t.pow(h,r);const c=t.eql(o,t.ONE);s=t.mul(i,n),n=t.mul(n,n),o=t.mul(h,n),i=t.cmov(s,i,c),h=t.cmov(o,h,c)}return{isValid:y,value:i}};if(t.ORDER%p===y){const r=(t.ORDER-y)/p,n=t.sqrt(t.neg(e));w=(e,o)=>{let s=t.sqr(o);const i=t.mul(e,o);s=t.mul(s,i);let c=t.pow(s,r);c=t.mul(c,i);const a=t.mul(c,n),u=t.mul(t.sqr(c),o),f=t.eql(u,e);return{isValid:f,value:t.cmov(a,c,f)}}}return w}function B(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function x(t,e={}){const{Fn:r}=t,o=e.randomBytes||n.randomBytes,i=Object.assign(B(t.Fp,r),{seed:(0,s.getMinHashLength)(r.ORDER)});function c(t){try{return!!g(r,t)}catch(t){return!1}}function a(t=o(i.seed)){return(0,s.mapHashToField)((0,n._abytes2)(t,i.seed,"seed"),r.ORDER)}function u(e,n=!0){return t.BASE.multiply(g(r,e)).toBytes(n)}function f(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;const{secretKey:o,publicKey:s,publicKeyUncompressed:c}=i;if(r.allowedLengths||o===s)return;const a=(0,n.ensureBytes)("key",e).length;return a===s||a===c}const h={isValidSecretKey:c,isValidPublicKey:function(e,r){const{publicKey:n,publicKeyUncompressed:o}=i;try{const s=e.length;return(!0!==r||s===n)&&((!1!==r||s===o)&&!!t.fromBytes(e))}catch(t){return!1}},randomSecretKey:a,isValidPrivateKey:c,randomPrivateKey:a,normPrivateKeyToScalar:t=>g(r,t),precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({getPublicKey:u,getSharedSecret:function(e,n,o=!0){if(!0===f(e))throw new Error("first arg must be private key");if(!1===f(n))throw new Error("second arg must be public key");const s=g(r,e);return t.fromHex(n).multiply(s).toBytes(o)},keygen:function(t){const e=a(t);return{secretKey:e,publicKey:u(e)}},Point:t,utils:h,lengths:i})}function v(o,s,i={}){(0,r.ahash)(s),(0,n._validateObject)(i,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const c=i.randomBytes||n.randomBytes,f=i.hmac||((t,...r)=>(0,e.hmac)(s,t,(0,n.concatBytes)(...r))),{Fp:y,Fn:p}=o,{ORDER:b,BITS:w}=p,{keygen:E,getPublicKey:B,getSharedSecret:v,utils:S,lengths:A}=x(o,i),_={prehash:!1,lowS:"boolean"==typeof i.lowS&&i.lowS,format:void 0,extraEntropy:!1},H="compact";function I(t){return t>b>>l}function O(t,e){if(!p.isValidNot0(e))throw new Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class L{constructor(t,e,r){this.r=O("r",t),this.s=O("s",e),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,r=H){let o;if(function(t,e){a(e);const r=A.signature,o="compact"===e?r:"recovered"===e?r+1:void 0;(0,n._abytes2)(t,o,`${e} signature`)}(e,r),"der"===r){const{r:r,s:o}=t.DER.toSig((0,n._abytes2)(e));return new L(r,o)}"recovered"===r&&(o=e[0],r="compact",e=e.subarray(1));const s=p.BYTES,i=e.subarray(0,s),c=e.subarray(s,2*s);return new L(p.fromBytes(i),p.fromBytes(c),o)}static fromHex(t,e){return this.fromBytes((0,n.hexToBytes)(t),e)}addRecoveryBit(t){return new L(this.r,this.s,t)}recoverPublicKey(t){const e=y.ORDER,{r:r,s:s,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(b*d<e&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const c=2===i||3===i?r+b:r;if(!y.isValid(c))throw new Error("recovery id 2 or 3 invalid");const a=y.toBytes(c),u=o.fromBytes((0,n.concatBytes)(m(0==(1&i)),a)),f=p.inv(c),h=U((0,n.ensureBytes)("msgHash",t)),l=p.create(-h*f),g=p.create(s*f),w=o.BASE.multiplyUnsafe(l).add(u.multiplyUnsafe(g));if(w.is0())throw new Error("point at infinify");return w.assertValidity(),w}hasHighS(){return I(this.s)}toBytes(e=H){if(a(e),"der"===e)return(0,n.hexToBytes)(t.DER.hexFromSig(this));const r=p.toBytes(this.r),o=p.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return(0,n.concatBytes)(Uint8Array.of(this.recovery),r,o)}return(0,n.concatBytes)(r,o)}toHex(t){return(0,n.bytesToHex)(this.toBytes(t))}assertValidity(){}static fromCompact(t){return L.fromBytes((0,n.ensureBytes)("sig",t),"compact")}static fromDER(t){return L.fromBytes((0,n.ensureBytes)("sig",t),"der")}normalizeS(){return this.hasHighS()?new L(this.r,p.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,n.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,n.bytesToHex)(this.toBytes("compact"))}}const C=i.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const e=(0,n.bytesToNumberBE)(t),r=8*t.length-w;return r>0?e>>BigInt(r):e},U=i.bits2int_modN||function(t){return p.create(C(t))},T=(0,n.bitMask)(w);function P(t){return(0,n.aInRange)("num < 2^"+w,t,h,T),p.toBytes(t)}function V(t,e){return(0,n._abytes2)(t,void 0,"message"),e?(0,n._abytes2)(s(t),void 0,"prehashed message"):t}return Object.freeze({keygen:E,getPublicKey:B,getSharedSecret:v,utils:S,lengths:A,Point:o,sign:function(t,e,r={}){t=(0,n.ensureBytes)("message",t);const{seed:i,k2sig:a}=function(t,e,r){if(["recovered","canonical"].some((t=>t in r)))throw new Error("sign() legacy options not supported");const{lowS:s,prehash:i,extraEntropy:a}=u(r,_);t=V(t,i);const f=U(t),d=g(p,e),y=[P(d),P(f)];if(null!=a&&!1!==a){const t=!0===a?c(A.secretKey):a;y.push((0,n.ensureBytes)("extraEntropy",t))}const b=(0,n.concatBytes)(...y),w=f;return{seed:b,k2sig:function(t){const e=C(t);if(!p.isValidNot0(e))return;const r=p.inv(e),n=o.BASE.multiply(e).toAffine(),i=p.create(n.x);if(i===h)return;const c=p.create(r*p.create(w+i*d));if(c===h)return;let a=(n.x===i?0:2)|Number(n.y&l),u=c;return s&&I(c)&&(u=p.neg(c),a^=1),new L(i,u,a)}}}(t,e,r);return(0,n.createHmacDrbg)(s.outputLen,p.BYTES,f)(i,a)},verify:function(e,r,s,i={}){const{lowS:c,prehash:a,format:f}=u(i,_);if(s=(0,n.ensureBytes)("publicKey",s),r=V((0,n.ensureBytes)("message",r),a),"strict"in i)throw new Error("options.strict was renamed to lowS");const h=void 0===f?function(e){let r;const o="string"==typeof e||(0,n.isBytes)(e),s=!o&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!o&&!s)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(s)r=new L(e.r,e.s);else if(o){try{r=L.fromBytes((0,n.ensureBytes)("sig",e),"der")}catch(e){if(!(e instanceof t.DER.Err))throw e}if(!r)try{r=L.fromBytes((0,n.ensureBytes)("sig",e),"compact")}catch(t){return!1}}return r||!1}(e):L.fromBytes((0,n.ensureBytes)("sig",e),f);if(!1===h)return!1;try{const t=o.fromBytes(s);if(c&&h.hasHighS())return!1;const{r:e,s:n}=h,i=U(r),a=p.inv(n),u=p.create(i*a),f=p.create(e*a),l=o.BASE.multiplyUnsafe(u).add(t.multiplyUnsafe(f));if(l.is0())return!1;return p.create(l.x)===e}catch(t){return!1}},recoverPublicKey:function(t,e,r={}){const{prehash:n}=u(r,_);return e=V(e,n),L.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:L,hash:s})}function S(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp;let n=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map((t=>Math.ceil(t/2))))):void 0;return{CURVE:e,curveOpts:{Fp:r,Fn:(0,s.Field)(e.n,{BITS:t.nBitLength,allowedLengths:n,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes}}}function A(t,e,r){return function(n){const o=t.sqr(n),s=t.mul(o,n);return t.add(t.add(s,t.mul(n,e)),r)}}}(me),Object.defineProperty(we,"__esModule",{value:!0}),we.getHash=function(t){return{hash:t}},we.createCurve=function(t,e){const r=e=>(0,Be.weierstrass)({...t,hash:e});return{...r(e),create:r}};
21
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
22
+ const Be=me;!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.secp256k1_hasher=t.schnorr=t.secp256k1=void 0;
23
+ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
24
+ const e=y,r=b,n=we,o=fe,s=lt,i=me,c=ht,a={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},u={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},f=BigInt(0),h=BigInt(1),l=BigInt(2);const d=(0,s.Field)(a.p,{sqrt:function(t){const e=a.p,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),c=BigInt(23),u=BigInt(44),f=BigInt(88),h=t*t*t%e,y=h*h*t%e,p=(0,s.pow2)(y,r,e)*y%e,b=(0,s.pow2)(p,r,e)*y%e,g=(0,s.pow2)(b,l,e)*h%e,w=(0,s.pow2)(g,o,e)*g%e,m=(0,s.pow2)(w,i,e)*w%e,E=(0,s.pow2)(m,u,e)*m%e,B=(0,s.pow2)(E,f,e)*E%e,x=(0,s.pow2)(B,u,e)*m%e,v=(0,s.pow2)(x,r,e)*y%e,S=(0,s.pow2)(v,c,e)*w%e,A=(0,s.pow2)(S,n,e)*h%e,_=(0,s.pow2)(A,l,e);if(!d.eql(d.sqr(_),t))throw new Error("Cannot find square root");return _}});t.secp256k1=(0,n.createCurve)({...a,Fp:d,lowS:!0,endo:u},e.sha256);const p={};function g(t,...r){let n=p[t];if(void 0===n){const r=(0,e.sha256)((0,c.utf8ToBytes)(t));n=(0,c.concatBytes)(r,r),p[t]=n}return(0,e.sha256)((0,c.concatBytes)(n,...r))}const w=t=>t.toBytes(!0).slice(1),m=(()=>t.secp256k1.Point)(),E=t=>t%l===f;function B(t){const{Fn:e,BASE:r}=m,n=(0,i._normFnElement)(e,t),o=r.multiply(n);return{scalar:E(o.y)?n:e.neg(n),bytes:w(o)}}function x(t){const e=d;if(!e.isValidNot0(t))throw new Error("invalid x: Fail if x ≥ p");const r=e.create(t*t),n=e.create(r*t+BigInt(7));let o=e.sqrt(n);E(o)||(o=e.neg(o));const s=m.fromAffine({x:t,y:o});return s.assertValidity(),s}const v=c.bytesToNumberBE;function S(...t){return m.Fn.create(v(g("BIP0340/challenge",...t)))}function A(t){return B(t).bytes}function _(t,e,n=(0,r.randomBytes)(32)){const{Fn:o}=m,s=(0,c.ensureBytes)("message",t),{bytes:i,scalar:a}=B(e),u=(0,c.ensureBytes)("auxRand",n,32),f=o.toBytes(a^v(g("BIP0340/aux",u))),h=g("BIP0340/nonce",f,i,s),{bytes:l,scalar:d}=B(h),y=S(l,i,s),p=new Uint8Array(64);if(p.set(l,0),p.set(o.toBytes(o.create(d+y*a)),32),!H(p,s,i))throw new Error("sign: Invalid signature produced");return p}function H(t,e,r){const{Fn:n,BASE:o}=m,s=(0,c.ensureBytes)("signature",t,64),i=(0,c.ensureBytes)("message",e),u=(0,c.ensureBytes)("publicKey",r,32);try{const t=x(v(u)),e=v(s.subarray(0,32));if(!(0,c.inRange)(e,h,a.p))return!1;const r=v(s.subarray(32,64));if(!(0,c.inRange)(r,h,a.n))return!1;const f=S(n.toBytes(e),w(t),i),l=o.multiplyUnsafe(r).add(t.multiplyUnsafe(n.neg(f))),{x:d,y:y}=l.toAffine();return!(l.is0()||!E(y)||d!==e)}catch(t){return!1}}t.schnorr=(()=>{const e=(t=(0,r.randomBytes)(48))=>(0,s.mapHashToField)(t,a.n);return t.secp256k1.utils.randomSecretKey,{keygen:function(t){const r=e(t);return{secretKey:r,publicKey:A(r)}},getPublicKey:A,sign:_,verify:H,Point:m,utils:{randomSecretKey:e,randomPrivateKey:e,taggedHash:g,lift_x:x,pointToBytes:w,numberToBytesBE:c.numberToBytesBE,bytesToNumberBE:c.bytesToNumberBE,mod:s.mod},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();const I=(()=>(0,o.isogenyMap)(d,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((t=>t.map((t=>BigInt(t)))))))(),O=(()=>(0,i.mapToCurveSimpleSWU)(d,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:d.create(BigInt("-11"))}))();t.secp256k1_hasher=(0,o.createHasher)(t.secp256k1.Point,(t=>{const{x:e,y:r}=O(d.create(t[0]));return I(e,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:d.ORDER,m:1,k:128,expand:"xmd",hash:e.sha256}),t.hashToCurve=t.secp256k1_hasher.hashToCurve,t.encodeToCurve=t.secp256k1_hasher.encodeToCurve}(ge);var xe={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeHex=t.remove0x=void 0;var e=o;t.remove0x=function(t){return t.startsWith("0x")||t.startsWith("0X")?t.slice(2):t};t.decodeHex=function(r){return(0,e.hexToBytes)((0,t.remove0x)(r))}}(xe),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hexToPublicKey=t.convertPublicKeyFormat=t.getSharedPoint=t.getPublicKey=t.isValidPrivateKey=t.getValidSecret=void 0;var e=h,r=d,n=ge,o=s,c=i,a=xe;t.getValidSecret=function(r){var n;do{n=(0,e.randomBytes)(c.SECRET_KEY_LENGTH)}while(!(0,t.isValidPrivateKey)(n,r));return n};t.isValidPrivateKey=function(t,e){return u(e,(function(e){return e.utils.isValidSecretKey(t)}),(function(){return!0}),(function(){return!0}))};t.getPublicKey=function(t,e){return u(e,(function(e){return e.getPublicKey(t)}),(function(e){return e.getPublicKey(t)}),(function(e){return e.getPublicKey(t)}))};t.getSharedPoint=function(t,e,r,n){return u(n,(function(n){return n.getSharedSecret(t,e,r)}),(function(r){return r.getSharedSecret(t,e)}),(function(r){return l(r,t,e)}))};t.convertPublicKeyFormat=function(t,e,r){return u(r,(function(r){return r.getSharedSecret(Uint8Array.from(Array(31).fill(0).concat([1])),t,e)}),(function(){return t}),(function(){return t}))};function u(t,e,s,i){var c=t||o.ECIES_CONFIG.ellipticCurve;
25
+ /* v8 ignore else -- @preserve */if("secp256k1"===c)return e(n.secp256k1);if("x25519"===c)return s(r.x25519);if("ed25519"===c)return i(r.ed25519);throw new Error("Not implemented")}t.hexToPublicKey=function(t,e){var r=(0,a.decodeHex)(t);return u(e,(function(){return f(r)}),(function(){return r}),(function(){return r}))};var f=function(t){if(t.length===c.ETH_PUBLIC_KEY_SIZE){var e=new Uint8Array(1+t.length);return e.set([4]),e.set(t,1),e}return t},l=function(t,e,r){var n=t.utils.getExtendedPublicKey(e).scalar;return t.Point.fromBytes(r).multiply(n).toBytes()}}(f);var ve={},Se={},Ae={},_e={},He={};Object.defineProperty(He,"__esModule",{value:!0}),He.crypto=void 0,He.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){
26
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
27
+ Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=r,t.anumber=n,t.abytes=o,t.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");n(t.outputLen),n(t.blockLen)},t.aexists=function(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")},t.aoutput=function(t,e){o(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},t.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},t.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},t.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},t.createView=function(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)},t.rotr=function(t,e){return t<<32-e|t>>>e},t.rotl=function(t,e){return t<<e|t>>>32-e>>>0},t.byteSwap=s,t.byteSwap32=i,t.bytesToHex=function(t){if(o(t),c)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=a[t[r]];return e},t.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(c)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let e=0,o=0;e<r;e++,o+=2){const r=f(t.charCodeAt(o)),s=f(t.charCodeAt(o+1));if(void 0===r||void 0===s){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}n[e]=16*r+s}return n},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=h,t.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},t.toBytes=l,t.kdfInputToBytes=function(t){"string"==typeof t&&(t=h(t));return o(t),t},t.concatBytes=function(...t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];o(n),e+=n.length}const r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const o=t[e];r.set(o,n),n+=o.length}return r},t.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!=={}.toString.call(e))throw new Error("options should be object or undefined");return Object.assign(t,e)},t.createHasher=d,t.createOptHasher=y,t.createXOFer=p,t.randomBytes=function(t=32){if(e.crypto&&"function"==typeof e.crypto.getRandomValues)return e.crypto.getRandomValues(new Uint8Array(t));if(e.crypto&&"function"==typeof e.crypto.randomBytes)return Uint8Array.from(e.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")};const e=He;function r(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function o(t,...e){if(!r(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function s(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function i(t){for(let e=0;e<t.length;e++)t[e]=s(t[e]);return t}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?t=>t:t=>s(t),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?t=>t:i;const c=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),a=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(t){return t>=u._0&&t<=u._9?t-u._0:t>=u.A&&t<=u.F?t-(u.A-10):t>=u.a&&t<=u.f?t-(u.a-10):void 0}function h(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function l(t){return"string"==typeof t&&(t=h(t)),o(t),t}t.nextTick=async()=>{};function d(t){const e=e=>t().update(l(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function y(t){const e=(e,r)=>t(r).update(l(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}function p(t){const e=(e,r)=>t(r).update(l(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}t.Hash=class{},t.wrapConstructor=d,t.wrapConstructorWithOpts=y,t.wrapXOFConstructorWithOpts=p}(_e),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=_e;class r extends e.Hash{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,(0,e.ahash)(t);const n=(0,e.toBytes)(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)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,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),(0,e.clean)(s)}update(t){return(0,e.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,e.aexists)(this),(0,e.abytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:o,blockLen:s,outputLen:i}=this;return t.finished=n,t.destroyed=o,t.blockLen=s,t.outputLen=i,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=r;t.hmac=(t,e,n)=>new r(t,e).update(n).digest(),t.hmac.create=(t,e)=>new r(t,e)}(Ae),Object.defineProperty(Se,"__esModule",{value:!0}),Se.hkdf=void 0,Se.extract=Le,Se.expand=Te;const Ie=Ae,Oe=_e;function Le(t,e,r){return(0,Oe.ahash)(t),void 0===r&&(r=new Uint8Array(t.outputLen)),(0,Ie.hmac)(t,(0,Oe.toBytes)(r),(0,Oe.toBytes)(e))}const Ce=Uint8Array.from([0]),Ue=Uint8Array.of();function Te(t,e,r,n=32){(0,Oe.ahash)(t),(0,Oe.anumber)(n);const o=t.outputLen;if(n>255*o)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(n/o);void 0===r&&(r=Ue);const i=new Uint8Array(s*o),c=Ie.hmac.create(t,e),a=c._cloneInto(),u=new Uint8Array(c.outputLen);for(let t=0;t<s;t++)Ce[0]=t+1,a.update(0===t?Ue:u).update(r).update(Ce).digestInto(u),i.set(u,o*t),c._cloneInto(a);return c.destroy(),a.destroy(),(0,Oe.clean)(u,Ce),i.slice(0,n)}Se.hkdf=(t,e,r,n,o)=>Te(t,Le(t,e,r),n,o);var Pe={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.SHA512_IV=Ve.SHA384_IV=Ve.SHA224_IV=Ve.SHA256_IV=Ve.HashMD=void 0,Ve.setBigUint64=Fe,Ve.Chi=function(t,e,r){return t&e^~t&r},Ve.Maj=function(t,e,r){return t&e^t&r^e&r};const Re=_e;function Fe(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),c=Number(r&s),a=n?4:0,u=n?0:4;t.setUint32(e+a,i,n),t.setUint32(e+u,c,n)}Ve.HashMD=class extends Re.Hash{constructor(t,e,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(t),this.view=(0,Re.createView)(this.buffer)}update(t){(0,Re.aexists)(this),t=(0,Re.toBytes)(t),(0,Re.abytes)(t);const{view:e,buffer:r,blockLen:n}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(t.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(e,0),this.pos=0);else{const e=(0,Re.createView)(t);for(;n<=o-s;s+=n)this.process(e,s)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,Re.aexists)(this),(0,Re.aoutput)(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:o}=this;let{pos:s}=this;e[s++]=128,(0,Re.clean)(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let t=s;t<n;t++)e[t]=0;Fe(r,n-8,BigInt(8*this.length),o),this.process(r,0);const i=(0,Re.createView)(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=c/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<a;t++)i.setUint32(4*t,u[t],o)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:o,destroyed:s,pos:i}=this;return t.destroyed=s,t.finished=o,t.length=n,t.pos=i,n%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}},Ve.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ve.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Ve.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Ve.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.toBig=Ne.shrSL=Ne.shrSH=Ne.rotrSL=Ne.rotrSH=Ne.rotrBL=Ne.rotrBH=Ne.rotr32L=Ne.rotr32H=Ne.rotlSL=Ne.rotlSH=Ne.rotlBL=Ne.rotlBH=Ne.add5L=Ne.add5H=Ne.add4L=Ne.add4H=Ne.add3L=Ne.add3H=void 0,Ne.add=rr,Ne.fromBig=De,Ne.split=je;const ke=BigInt(2**32-1),Ke=BigInt(32);function De(t,e=!1){return e?{h:Number(t&ke),l:Number(t>>Ke&ke)}:{h:0|Number(t>>Ke&ke),l:0|Number(t&ke)}}function je(t,e=!1){const r=t.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:i}=De(t[s],e);[n[s],o[s]]=[r,i]}return[n,o]}const Me=(t,e)=>BigInt(t>>>0)<<Ke|BigInt(e>>>0);Ne.toBig=Me;const qe=(t,e,r)=>t>>>r;Ne.shrSH=qe;const Ge=(t,e,r)=>t<<32-r|e>>>r;Ne.shrSL=Ge;const Ze=(t,e,r)=>t>>>r|e<<32-r;Ne.rotrSH=Ze;const ze=(t,e,r)=>t<<32-r|e>>>r;Ne.rotrSL=ze;const Ye=(t,e,r)=>t<<64-r|e>>>r-32;Ne.rotrBH=Ye;const Xe=(t,e,r)=>t>>>r-32|e<<64-r;Ne.rotrBL=Xe;const We=(t,e)=>e;Ne.rotr32H=We;const $e=(t,e)=>t;Ne.rotr32L=$e;const Je=(t,e,r)=>t<<r|e>>>32-r;Ne.rotlSH=Je;const Qe=(t,e,r)=>e<<r|t>>>32-r;Ne.rotlSL=Qe;const tr=(t,e,r)=>e<<r-32|t>>>64-r;Ne.rotlBH=tr;const er=(t,e,r)=>t<<r-32|e>>>64-r;function rr(t,e,r,n){const o=(e>>>0)+(n>>>0);return{h:t+r+(o/2**32|0)|0,l:0|o}}Ne.rotlBL=er;const nr=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);Ne.add3L=nr;const or=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;Ne.add3H=or;const sr=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);Ne.add4L=sr;const ir=(t,e,r,n,o)=>e+r+n+o+(t/2**32|0)|0;Ne.add4H=ir;const cr=(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0);Ne.add5L=cr;const ar=(t,e,r,n,o,s)=>e+r+n+o+s+(t/2**32|0)|0;Ne.add5H=ar;const ur={fromBig:De,split:je,toBig:Me,shrSH:qe,shrSL:Ge,rotrSH:Ze,rotrSL:ze,rotrBH:Ye,rotrBL:Xe,rotr32H:We,rotr32L:$e,rotlSH:Je,rotlSL:Qe,rotlBH:tr,rotlBL:er,add:rr,add3L:nr,add3H:or,add4L:sr,add4H:ir,add5H:ar,add5L:cr};Ne.default=ur,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.sha512_224=Pe.sha512_256=Pe.sha384=Pe.sha512=Pe.sha224=Pe.sha256=Pe.SHA512_256=Pe.SHA512_224=Pe.SHA384=Pe.SHA512=Pe.SHA224=Pe.SHA256=void 0;const fr=Ve,hr=Ne,lr=_e,dr=Uint32Array.from([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]),yr=new Uint32Array(64);class pr extends fr.HashMD{constructor(t=32){super(64,t,8,!1),this.A=0|fr.SHA256_IV[0],this.B=0|fr.SHA256_IV[1],this.C=0|fr.SHA256_IV[2],this.D=0|fr.SHA256_IV[3],this.E=0|fr.SHA256_IV[4],this.F=0|fr.SHA256_IV[5],this.G=0|fr.SHA256_IV[6],this.H=0|fr.SHA256_IV[7]}get(){const{A:t,B:e,C:r,D:n,E:o,F:s,G:i,H:c}=this;return[t,e,r,n,o,s,i,c]}set(t,e,r,n,o,s,i,c){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|c}process(t,e){for(let r=0;r<16;r++,e+=4)yr[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=yr[t-15],r=yr[t-2],n=(0,lr.rotr)(e,7)^(0,lr.rotr)(e,18)^e>>>3,o=(0,lr.rotr)(r,17)^(0,lr.rotr)(r,19)^r>>>10;yr[t]=o+yr[t-7]+n+yr[t-16]|0}let{A:r,B:n,C:o,D:s,E:i,F:c,G:a,H:u}=this;for(let t=0;t<64;t++){const e=u+((0,lr.rotr)(i,6)^(0,lr.rotr)(i,11)^(0,lr.rotr)(i,25))+(0,fr.Chi)(i,c,a)+dr[t]+yr[t]|0,f=((0,lr.rotr)(r,2)^(0,lr.rotr)(r,13)^(0,lr.rotr)(r,22))+(0,fr.Maj)(r,n,o)|0;u=a,a=c,c=i,i=s+e|0,s=o,o=n,n=r,r=e+f|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,s=s+this.D|0,i=i+this.E|0,c=c+this.F|0,a=a+this.G|0,u=u+this.H|0,this.set(r,n,o,s,i,c,a,u)}roundClean(){(0,lr.clean)(yr)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,lr.clean)(this.buffer)}}Pe.SHA256=pr;class br extends pr{constructor(){super(28),this.A=0|fr.SHA224_IV[0],this.B=0|fr.SHA224_IV[1],this.C=0|fr.SHA224_IV[2],this.D=0|fr.SHA224_IV[3],this.E=0|fr.SHA224_IV[4],this.F=0|fr.SHA224_IV[5],this.G=0|fr.SHA224_IV[6],this.H=0|fr.SHA224_IV[7]}}Pe.SHA224=br;const gr=(()=>hr.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((t=>BigInt(t)))))(),wr=(()=>gr[0])(),mr=(()=>gr[1])(),Er=new Uint32Array(80),Br=new Uint32Array(80);class xr extends fr.HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=0|fr.SHA512_IV[0],this.Al=0|fr.SHA512_IV[1],this.Bh=0|fr.SHA512_IV[2],this.Bl=0|fr.SHA512_IV[3],this.Ch=0|fr.SHA512_IV[4],this.Cl=0|fr.SHA512_IV[5],this.Dh=0|fr.SHA512_IV[6],this.Dl=0|fr.SHA512_IV[7],this.Eh=0|fr.SHA512_IV[8],this.El=0|fr.SHA512_IV[9],this.Fh=0|fr.SHA512_IV[10],this.Fl=0|fr.SHA512_IV[11],this.Gh=0|fr.SHA512_IV[12],this.Gl=0|fr.SHA512_IV[13],this.Hh=0|fr.SHA512_IV[14],this.Hl=0|fr.SHA512_IV[15]}get(){const{Ah:t,Al:e,Bh:r,Bl:n,Ch:o,Cl:s,Dh:i,Dl:c,Eh:a,El:u,Fh:f,Fl:h,Gh:l,Gl:d,Hh:y,Hl:p}=this;return[t,e,r,n,o,s,i,c,a,u,f,h,l,d,y,p]}set(t,e,r,n,o,s,i,c,a,u,f,h,l,d,y,p){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|c,this.Eh=0|a,this.El=0|u,this.Fh=0|f,this.Fl=0|h,this.Gh=0|l,this.Gl=0|d,this.Hh=0|y,this.Hl=0|p}process(t,e){for(let r=0;r<16;r++,e+=4)Er[r]=t.getUint32(e),Br[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Er[t-15],r=0|Br[t-15],n=hr.rotrSH(e,r,1)^hr.rotrSH(e,r,8)^hr.shrSH(e,r,7),o=hr.rotrSL(e,r,1)^hr.rotrSL(e,r,8)^hr.shrSL(e,r,7),s=0|Er[t-2],i=0|Br[t-2],c=hr.rotrSH(s,i,19)^hr.rotrBH(s,i,61)^hr.shrSH(s,i,6),a=hr.rotrSL(s,i,19)^hr.rotrBL(s,i,61)^hr.shrSL(s,i,6),u=hr.add4L(o,a,Br[t-7],Br[t-16]),f=hr.add4H(u,n,c,Er[t-7],Er[t-16]);Er[t]=0|f,Br[t]=0|u}let{Ah:r,Al:n,Bh:o,Bl:s,Ch:i,Cl:c,Dh:a,Dl:u,Eh:f,El:h,Fh:l,Fl:d,Gh:y,Gl:p,Hh:b,Hl:g}=this;for(let t=0;t<80;t++){const e=hr.rotrSH(f,h,14)^hr.rotrSH(f,h,18)^hr.rotrBH(f,h,41),w=hr.rotrSL(f,h,14)^hr.rotrSL(f,h,18)^hr.rotrBL(f,h,41),m=f&l^~f&y,E=h&d^~h&p,B=hr.add5L(g,w,E,mr[t],Br[t]),x=hr.add5H(B,b,e,m,wr[t],Er[t]),v=0|B,S=hr.rotrSH(r,n,28)^hr.rotrBH(r,n,34)^hr.rotrBH(r,n,39),A=hr.rotrSL(r,n,28)^hr.rotrBL(r,n,34)^hr.rotrBL(r,n,39),_=r&o^r&i^o&i,H=n&s^n&c^s&c;b=0|y,g=0|p,y=0|l,p=0|d,l=0|f,d=0|h,({h:f,l:h}=hr.add(0|a,0|u,0|x,0|v)),a=0|i,u=0|c,i=0|o,c=0|s,o=0|r,s=0|n;const I=hr.add3L(v,A,H);r=hr.add3H(I,x,S,_),n=0|I}({h:r,l:n}=hr.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:s}=hr.add(0|this.Bh,0|this.Bl,0|o,0|s)),({h:i,l:c}=hr.add(0|this.Ch,0|this.Cl,0|i,0|c)),({h:a,l:u}=hr.add(0|this.Dh,0|this.Dl,0|a,0|u)),({h:f,l:h}=hr.add(0|this.Eh,0|this.El,0|f,0|h)),({h:l,l:d}=hr.add(0|this.Fh,0|this.Fl,0|l,0|d)),({h:y,l:p}=hr.add(0|this.Gh,0|this.Gl,0|y,0|p)),({h:b,l:g}=hr.add(0|this.Hh,0|this.Hl,0|b,0|g)),this.set(r,n,o,s,i,c,a,u,f,h,l,d,y,p,b,g)}roundClean(){(0,lr.clean)(Er,Br)}destroy(){(0,lr.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Pe.SHA512=xr;class vr extends xr{constructor(){super(48),this.Ah=0|fr.SHA384_IV[0],this.Al=0|fr.SHA384_IV[1],this.Bh=0|fr.SHA384_IV[2],this.Bl=0|fr.SHA384_IV[3],this.Ch=0|fr.SHA384_IV[4],this.Cl=0|fr.SHA384_IV[5],this.Dh=0|fr.SHA384_IV[6],this.Dl=0|fr.SHA384_IV[7],this.Eh=0|fr.SHA384_IV[8],this.El=0|fr.SHA384_IV[9],this.Fh=0|fr.SHA384_IV[10],this.Fl=0|fr.SHA384_IV[11],this.Gh=0|fr.SHA384_IV[12],this.Gl=0|fr.SHA384_IV[13],this.Hh=0|fr.SHA384_IV[14],this.Hl=0|fr.SHA384_IV[15]}}Pe.SHA384=vr;const Sr=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Ar=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class _r extends xr{constructor(){super(28),this.Ah=0|Sr[0],this.Al=0|Sr[1],this.Bh=0|Sr[2],this.Bl=0|Sr[3],this.Ch=0|Sr[4],this.Cl=0|Sr[5],this.Dh=0|Sr[6],this.Dl=0|Sr[7],this.Eh=0|Sr[8],this.El=0|Sr[9],this.Fh=0|Sr[10],this.Fl=0|Sr[11],this.Gh=0|Sr[12],this.Gl=0|Sr[13],this.Hh=0|Sr[14],this.Hl=0|Sr[15]}}Pe.SHA512_224=_r;class Hr extends xr{constructor(){super(32),this.Ah=0|Ar[0],this.Al=0|Ar[1],this.Bh=0|Ar[2],this.Bl=0|Ar[3],this.Ch=0|Ar[4],this.Cl=0|Ar[5],this.Dh=0|Ar[6],this.Dl=0|Ar[7],this.Eh=0|Ar[8],this.El=0|Ar[9],this.Fh=0|Ar[10],this.Fl=0|Ar[11],this.Gh=0|Ar[12],this.Gl=0|Ar[13],this.Hh=0|Ar[14],this.Hl=0|Ar[15]}}Pe.SHA512_256=Hr,Pe.sha256=(0,lr.createHasher)((()=>new pr)),Pe.sha224=(0,lr.createHasher)((()=>new br)),Pe.sha512=(0,lr.createHasher)((()=>new xr)),Pe.sha384=(0,lr.createHasher)((()=>new vr)),Pe.sha512_256=(0,lr.createHasher)((()=>new Hr)),Pe.sha512_224=(0,lr.createHasher)((()=>new _r)),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getSharedKey=t.deriveKey=void 0;var e=o,r=Se,n=Pe;t.deriveKey=function(t,e,o){return(0,r.hkdf)(n.sha256,t,e,o,32)};t.getSharedKey=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(0,t.deriveKey)(e.concatBytes.apply(void 0,r))}}(ve);var Ir={},Or={},Lr={},Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.polyval=Cr.ghash=void 0,Cr._toGHASHKey=Fr;const Ur=o,Tr=16,Pr=new Uint8Array(16),Vr=(0,Ur.u32)(Pr),Rr=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255|0;function Fr(t){t.reverse();const e=1&t[15];let r=0;for(let e=0;e<t.length;e++){const n=t[e];t[e]=n>>>1|r,r=(1&n)<<7}return t[0]^=225&-e,t}class Nr{constructor(t,e){this.blockLen=Tr,this.outputLen=Tr,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,t=(0,Ur.toBytes)(t),(0,Ur.abytes)(t,16);const r=(0,Ur.createView)(t);let n=r.getUint32(0,!1),o=r.getUint32(4,!1),s=r.getUint32(8,!1),i=r.getUint32(12,!1);const c=[];for(let t=0;t<128;t++)c.push({s0:Rr(n),s1:Rr(o),s2:Rr(s),s3:Rr(i)}),({s0:n,s1:o,s2:s,s3:i}={s3:(f=s)<<31|(h=i)>>>1,s2:(u=o)<<31|f>>>1,s1:(a=n)<<31|u>>>1,s0:a>>>1^225<<24&-(1&h)});var a,u,f,h;const l=(d=e||1024)>65536?8:d>1024?4:2;var d;if(![1,2,4,8].includes(l))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=l;const y=128/l,p=this.windowSize=2**l,b=[];for(let t=0;t<y;t++)for(let e=0;e<p;e++){let r=0,n=0,o=0,s=0;for(let i=0;i<l;i++){if(!(e>>>l-i-1&1))continue;const{s0:a,s1:u,s2:f,s3:h}=c[l*t+i];r^=a,n^=u,o^=f,s^=h}b.push({s0:r,s1:n,s2:o,s3:s})}this.t=b}_updateBlock(t,e,r,n){t^=this.s0,e^=this.s1,r^=this.s2,n^=this.s3;const{W:o,t:s,windowSize:i}=this;let c=0,a=0,u=0,f=0;const h=(1<<o)-1;let l=0;for(const d of[t,e,r,n])for(let t=0;t<4;t++){const e=d>>>8*t&255;for(let t=8/o-1;t>=0;t--){const r=e>>>o*t&h,{s0:n,s1:d,s2:y,s3:p}=s[l*i+r];c^=n,a^=d,u^=y,f^=p,l+=1}}this.s0=c,this.s1=a,this.s2=u,this.s3=f}update(t){(0,Ur.aexists)(this),t=(0,Ur.toBytes)(t),(0,Ur.abytes)(t);const e=(0,Ur.u32)(t),r=Math.floor(t.length/Tr),n=t.length%Tr;for(let t=0;t<r;t++)this._updateBlock(e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]);return n&&(Pr.set(t.subarray(r*Tr)),this._updateBlock(Vr[0],Vr[1],Vr[2],Vr[3]),(0,Ur.clean)(Vr)),this}destroy(){const{t:t}=this;for(const e of t)e.s0=0,e.s1=0,e.s2=0,e.s3=0}digestInto(t){(0,Ur.aexists)(this),(0,Ur.aoutput)(t,this),this.finished=!0;const{s0:e,s1:r,s2:n,s3:o}=this,s=(0,Ur.u32)(t);return s[0]=e,s[1]=r,s[2]=n,s[3]=o,t}digest(){const t=new Uint8Array(Tr);return this.digestInto(t),this.destroy(),t}}class kr extends Nr{constructor(t,e){t=(0,Ur.toBytes)(t),(0,Ur.abytes)(t);const r=Fr((0,Ur.copyBytes)(t));super(r,e),(0,Ur.clean)(r)}update(t){t=(0,Ur.toBytes)(t),(0,Ur.aexists)(this);const e=(0,Ur.u32)(t),r=t.length%Tr,n=Math.floor(t.length/Tr);for(let t=0;t<n;t++)this._updateBlock(Rr(e[4*t+3]),Rr(e[4*t+2]),Rr(e[4*t+1]),Rr(e[4*t+0]));return r&&(Pr.set(t.subarray(n*Tr)),this._updateBlock(Rr(Vr[3]),Rr(Vr[2]),Rr(Vr[1]),Rr(Vr[0])),(0,Ur.clean)(Vr)),this}digestInto(t){(0,Ur.aexists)(this),(0,Ur.aoutput)(t,this),this.finished=!0;const{s0:e,s1:r,s2:n,s3:o}=this,s=(0,Ur.u32)(t);return s[0]=e,s[1]=r,s[2]=n,s[3]=o,t.reverse()}}function Kr(t){const e=(e,r)=>t(r,e.length).update((0,Ur.toBytes)(e)).digest(),r=t(new Uint8Array(16),0);return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=(e,r)=>t(e,r),e}Cr.ghash=Kr(((t,e)=>new Nr(t,e))),Cr.polyval=Kr(((t,e)=>new kr(t,e))),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.unsafe=t.aeskwp=t.aeskw=t.siv=t.gcmsiv=t.gcm=t.cfb=t.cbc=t.ecb=t.ctr=void 0;const e=Cr,r=o,n=16,s=4,i=new Uint8Array(n),c=283;function a(t){return t<<1^c&-(t>>7)}function u(t,e){let r=0;for(;e>0;e>>=1)r^=t&-(1&e),t=a(t);return r}const f=(()=>{const t=new Uint8Array(256);for(let e=0,r=1;e<256;e++,r^=a(r))t[e]=r;const e=new Uint8Array(256);e[0]=99;for(let r=0;r<255;r++){let n=t[255-r];n|=n<<8,e[t[r]]=255&(n^n>>4^n>>5^n>>6^n>>7^99)}return(0,r.clean)(t),e})(),h=f.map(((t,e)=>f.indexOf(e))),l=t=>t<<24|t>>>8,d=t=>t<<8|t>>>24,y=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function p(t,e){if(256!==t.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map(((r,n)=>e(t[n]))),n=r.map(d),o=n.map(d),s=o.map(d),i=new Uint32Array(65536),c=new Uint32Array(65536),a=new Uint16Array(65536);for(let e=0;e<256;e++)for(let u=0;u<256;u++){const f=256*e+u;i[f]=r[e]^n[u],c[f]=o[e]^s[u],a[f]=t[e]<<8|t[u]}return{sbox:t,sbox2:a,T0:r,T1:n,T2:o,T3:s,T01:i,T23:c}}const b=p(f,(t=>u(t,3)<<24|t<<16|t<<8|u(t,2))),g=p(h,(t=>u(t,11)<<24|u(t,13)<<16|u(t,9)<<8|u(t,14))),w=(()=>{const t=new Uint8Array(16);for(let e=0,r=1;e<16;e++,r=a(r))t[e]=r;return t})();function m(t){(0,r.abytes)(t);const e=t.length;if(![16,24,32].includes(e))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+e);const{sbox2:n}=b,o=[];(0,r.isAligned32)(t)||o.push(t=(0,r.copyBytes)(t));const s=(0,r.u32)(t),i=s.length,c=t=>x(n,t,t,t,t),a=new Uint32Array(e+28);a.set(s);for(let t=i;t<a.length;t++){let e=a[t-1];t%i==0?e=c(l(e))^w[t/i-1]:i>6&&t%i==4&&(e=c(e)),a[t]=a[t-i]^e}return(0,r.clean)(...o),a}function E(t){const e=m(t),n=e.slice(),o=e.length,{sbox2:s}=b,{T0:i,T1:c,T2:a,T3:u}=g;for(let t=0;t<o;t+=4)for(let r=0;r<4;r++)n[t+r]=e[o-t-4+r];(0,r.clean)(e);for(let t=4;t<o-4;t++){const e=n[t],r=x(s,e,e,e,e);n[t]=i[255&r]^c[r>>>8&255]^a[r>>>16&255]^u[r>>>24]}return n}function B(t,e,r,n,o,s){return t[r<<8&65280|n>>>8&255]^e[o>>>8&65280|s>>>24&255]}function x(t,e,r,n,o){return t[255&e|65280&r]|t[n>>>16&255|o>>>16&65280]<<16}function v(t,e,r,n,o){const{sbox2:s,T01:i,T23:c}=b;let a=0;e^=t[a++],r^=t[a++],n^=t[a++],o^=t[a++];const u=t.length/4-2;for(let s=0;s<u;s++){const s=t[a++]^B(i,c,e,r,n,o),u=t[a++]^B(i,c,r,n,o,e),f=t[a++]^B(i,c,n,o,e,r),h=t[a++]^B(i,c,o,e,r,n);e=s,r=u,n=f,o=h}return{s0:t[a++]^x(s,e,r,n,o),s1:t[a++]^x(s,r,n,o,e),s2:t[a++]^x(s,n,o,e,r),s3:t[a++]^x(s,o,e,r,n)}}function S(t,e,r,n,o){const{sbox2:s,T01:i,T23:c}=g;let a=0;e^=t[a++],r^=t[a++],n^=t[a++],o^=t[a++];const u=t.length/4-2;for(let s=0;s<u;s++){const s=t[a++]^B(i,c,e,o,n,r),u=t[a++]^B(i,c,r,e,o,n),f=t[a++]^B(i,c,n,r,e,o),h=t[a++]^B(i,c,o,n,r,e);e=s,r=u,n=f,o=h}return{s0:t[a++]^x(s,e,o,n,r),s1:t[a++]^x(s,r,e,o,n),s2:t[a++]^x(s,n,r,e,o),s3:t[a++]^x(s,o,n,r,e)}}function A(t,e,o,i){(0,r.abytes)(e,n),(0,r.abytes)(o);const c=o.length;i=(0,r.getOutput)(c,i),(0,r.complexOverlapBytes)(o,i);const a=e,u=(0,r.u32)(a);let{s0:f,s1:h,s2:l,s3:d}=v(t,u[0],u[1],u[2],u[3]);const y=(0,r.u32)(o),p=(0,r.u32)(i);for(let e=0;e+4<=y.length;e+=4){p[e+0]=y[e+0]^f,p[e+1]=y[e+1]^h,p[e+2]=y[e+2]^l,p[e+3]=y[e+3]^d;let r=1;for(let t=a.length-1;t>=0;t--)r=r+(255&a[t])|0,a[t]=255&r,r>>>=8;({s0:f,s1:h,s2:l,s3:d}=v(t,u[0],u[1],u[2],u[3]))}const b=n*Math.floor(y.length/s);if(b<c){const t=new Uint32Array([f,h,l,d]),e=(0,r.u8)(t);for(let t=b,r=0;t<c;t++,r++)i[t]=o[t]^e[r];(0,r.clean)(t)}return i}function _(t,e,o,i,c){(0,r.abytes)(o,n),(0,r.abytes)(i),c=(0,r.getOutput)(i.length,c);const a=o,u=(0,r.u32)(a),f=(0,r.createView)(a),h=(0,r.u32)(i),l=(0,r.u32)(c),d=e?0:12,y=i.length;let p=f.getUint32(d,e),{s0:b,s1:g,s2:w,s3:m}=v(t,u[0],u[1],u[2],u[3]);for(let r=0;r+4<=h.length;r+=4)l[r+0]=h[r+0]^b,l[r+1]=h[r+1]^g,l[r+2]=h[r+2]^w,l[r+3]=h[r+3]^m,p=p+1>>>0,f.setUint32(d,p,e),({s0:b,s1:g,s2:w,s3:m}=v(t,u[0],u[1],u[2],u[3]));const E=n*Math.floor(h.length/s);if(E<y){const t=new Uint32Array([b,g,w,m]),e=(0,r.u8)(t);for(let t=E,r=0;t<y;t++,r++)c[t]=i[t]^e[r];(0,r.clean)(t)}return c}function H(t){if((0,r.abytes)(t),t.length%n!=0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size "+n)}function I(t,e,o){(0,r.abytes)(t);let s=t.length;const i=s%n;if(!e&&0!==i)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,r.isAligned32)(t)||(t=(0,r.copyBytes)(t));const c=(0,r.u32)(t);if(e){let t=n-i;t||(t=n),s+=t}o=(0,r.getOutput)(s,o),(0,r.complexOverlapBytes)(t,o);return{b:c,o:(0,r.u32)(o),out:o}}function O(t,e){if(!e)return t;const r=t.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const n=t[r-1];if(n<=0||n>16)throw new Error("aes/pcks5: wrong padding");const o=t.subarray(0,-n);for(let e=0;e<n;e++)if(t[r-e-1]!==n)throw new Error("aes/pcks5: wrong padding");return o}function L(t){const e=new Uint8Array(16),o=(0,r.u32)(e);e.set(t);const s=n-t.length;for(let t=n-s;t<n;t++)e[t]=s;return o}function C(t,e,n,o,s){const i=s?s.length:0,c=t.create(n,o.length+i);s&&c.update(s);const a=(0,r.u64Lengths)(8*o.length,8*i,e);c.update(o),c.update(a);const u=c.digest();return(0,r.clean)(a),u}t.ctr=(0,r.wrapCipher)({blockSize:16,nonceLength:16},(function(t,e){function n(n,o){if((0,r.abytes)(n),void 0!==o&&((0,r.abytes)(o),!(0,r.isAligned32)(o)))throw new Error("unaligned destination");const s=m(t),i=(0,r.copyBytes)(e),c=[s,i];(0,r.isAligned32)(n)||c.push(n=(0,r.copyBytes)(n));const a=A(s,i,n,o);return(0,r.clean)(...c),a}return{encrypt:(t,e)=>n(t,e),decrypt:(t,e)=>n(t,e)}})),t.ecb=(0,r.wrapCipher)({blockSize:16},(function(t,e={}){const n=!e.disablePadding;return{encrypt(e,o){const{b:s,o:i,out:c}=I(e,n,o),a=m(t);let u=0;for(;u+4<=s.length;){const{s0:t,s1:e,s2:r,s3:n}=v(a,s[u+0],s[u+1],s[u+2],s[u+3]);i[u++]=t,i[u++]=e,i[u++]=r,i[u++]=n}if(n){const t=L(e.subarray(4*u)),{s0:r,s1:n,s2:o,s3:s}=v(a,t[0],t[1],t[2],t[3]);i[u++]=r,i[u++]=n,i[u++]=o,i[u++]=s}return(0,r.clean)(a),c},decrypt(e,o){H(e);const s=E(t);o=(0,r.getOutput)(e.length,o);const i=[s];(0,r.isAligned32)(e)||i.push(e=(0,r.copyBytes)(e)),(0,r.complexOverlapBytes)(e,o);const c=(0,r.u32)(e),a=(0,r.u32)(o);for(let t=0;t+4<=c.length;){const{s0:e,s1:r,s2:n,s3:o}=S(s,c[t+0],c[t+1],c[t+2],c[t+3]);a[t++]=e,a[t++]=r,a[t++]=n,a[t++]=o}return(0,r.clean)(...i),O(o,n)}}})),t.cbc=(0,r.wrapCipher)({blockSize:16,nonceLength:16},(function(t,e,n={}){const o=!n.disablePadding;return{encrypt(n,s){const i=m(t),{b:c,o:a,out:u}=I(n,o,s);let f=e;const h=[i];(0,r.isAligned32)(f)||h.push(f=(0,r.copyBytes)(f));const l=(0,r.u32)(f);let d=l[0],y=l[1],p=l[2],b=l[3],g=0;for(;g+4<=c.length;)d^=c[g+0],y^=c[g+1],p^=c[g+2],b^=c[g+3],({s0:d,s1:y,s2:p,s3:b}=v(i,d,y,p,b)),a[g++]=d,a[g++]=y,a[g++]=p,a[g++]=b;if(o){const t=L(n.subarray(4*g));d^=t[0],y^=t[1],p^=t[2],b^=t[3],({s0:d,s1:y,s2:p,s3:b}=v(i,d,y,p,b)),a[g++]=d,a[g++]=y,a[g++]=p,a[g++]=b}return(0,r.clean)(...h),u},decrypt(n,s){H(n);const i=E(t);let c=e;const a=[i];(0,r.isAligned32)(c)||a.push(c=(0,r.copyBytes)(c));const u=(0,r.u32)(c);s=(0,r.getOutput)(n.length,s),(0,r.isAligned32)(n)||a.push(n=(0,r.copyBytes)(n)),(0,r.complexOverlapBytes)(n,s);const f=(0,r.u32)(n),h=(0,r.u32)(s);let l=u[0],d=u[1],y=u[2],p=u[3];for(let t=0;t+4<=f.length;){const e=l,r=d,n=y,o=p;l=f[t+0],d=f[t+1],y=f[t+2],p=f[t+3];const{s0:s,s1:c,s2:a,s3:u}=S(i,l,d,y,p);h[t++]=s^e,h[t++]=c^r,h[t++]=a^n,h[t++]=u^o}return(0,r.clean)(...a),O(s,o)}}})),t.cfb=(0,r.wrapCipher)({blockSize:16,nonceLength:16},(function(t,e){function o(o,i,c){(0,r.abytes)(o);const a=o.length;if(c=(0,r.getOutput)(a,c),(0,r.overlapBytes)(o,c))throw new Error("overlapping src and dst not supported.");const u=m(t);let f=e;const h=[u];(0,r.isAligned32)(f)||h.push(f=(0,r.copyBytes)(f)),(0,r.isAligned32)(o)||h.push(o=(0,r.copyBytes)(o));const l=(0,r.u32)(o),d=(0,r.u32)(c),y=i?d:l,p=(0,r.u32)(f);let b=p[0],g=p[1],w=p[2],E=p[3];for(let t=0;t+4<=l.length;){const{s0:e,s1:r,s2:n,s3:o}=v(u,b,g,w,E);d[t+0]=l[t+0]^e,d[t+1]=l[t+1]^r,d[t+2]=l[t+2]^n,d[t+3]=l[t+3]^o,b=y[t++],g=y[t++],w=y[t++],E=y[t++]}const B=n*Math.floor(l.length/s);if(B<a){({s0:b,s1:g,s2:w,s3:E}=v(u,b,g,w,E));const t=(0,r.u8)(new Uint32Array([b,g,w,E]));for(let e=B,r=0;e<a;e++,r++)c[e]=o[e]^t[r];(0,r.clean)(t)}return(0,r.clean)(...h),c}return{encrypt:(t,e)=>o(t,!0,e),decrypt:(t,e)=>o(t,!1,e)}})),t.gcm=(0,r.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},(function(t,n,o){if(n.length<8)throw new Error("aes/gcm: invalid nonce length");function s(t,r,n){const s=C(e.ghash,!1,t,n,o);for(let t=0;t<r.length;t++)s[t]^=r[t];return s}function c(){const o=m(t),s=i.slice(),c=i.slice();if(_(o,!1,c,c,s),12===n.length)c.set(n);else{const t=i.slice(),o=(0,r.createView)(t);(0,r.setBigUint64)(o,8,BigInt(8*n.length),!1);const a=e.ghash.create(s).update(n).update(t);a.digestInto(c),a.destroy()}return{xk:o,authKey:s,counter:c,tagMask:_(o,!1,c,i)}}return{encrypt(t){const{xk:e,authKey:n,counter:o,tagMask:i}=c(),a=new Uint8Array(t.length+16),u=[e,n,o,i];(0,r.isAligned32)(t)||u.push(t=(0,r.copyBytes)(t)),_(e,!1,o,t,a.subarray(0,t.length));const f=s(n,i,a.subarray(0,a.length-16));return u.push(f),a.set(f,t.length),(0,r.clean)(...u),a},decrypt(t){const{xk:e,authKey:n,counter:o,tagMask:i}=c(),a=[e,n,i,o];(0,r.isAligned32)(t)||a.push(t=(0,r.copyBytes)(t));const u=t.subarray(0,-16),f=t.subarray(-16),h=s(n,i,u);if(a.push(h),!(0,r.equalBytes)(h,f))throw new Error("aes/gcm: invalid ghash tag");const l=_(e,!1,o,u);return(0,r.clean)(...a),l}}}));const U=(t,e,r)=>n=>{if(!Number.isSafeInteger(n)||e>n||n>r){throw new Error(t+": expected value in range "+("["+e+".."+r+"]")+", got "+n)}};function T(t){return t instanceof Uint32Array||ArrayBuffer.isView(t)&&"Uint32Array"===t.constructor.name}function P(t,e){if((0,r.abytes)(e,16),!T(t))throw new Error("_encryptBlock accepts result of expandKeyLE");const n=(0,r.u32)(e);let{s0:o,s1:s,s2:i,s3:c}=v(t,n[0],n[1],n[2],n[3]);return n[0]=o,n[1]=s,n[2]=i,n[3]=c,e}function V(t,e){if((0,r.abytes)(e,16),!T(t))throw new Error("_decryptBlock accepts result of expandKeyLE");const n=(0,r.u32)(e);let{s0:o,s1:s,s2:i,s3:c}=S(t,n[0],n[1],n[2],n[3]);return n[0]=o,n[1]=s,n[2]=i,n[3]=c,e}t.gcmsiv=(0,r.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16,varSizeNonce:!0},(function(t,n,o){const s=U("AAD",0,2**36),i=U("plaintext",0,2**36),c=U("nonce",12,12),a=U("ciphertext",16,2**36+16);function u(){const e=m(t),o=new Uint8Array(t.length),s=new Uint8Array(16),i=[e,o];let c=n;(0,r.isAligned32)(c)||i.push(c=(0,r.copyBytes)(c));const a=(0,r.u32)(c);let u=0,f=a[0],h=a[1],l=a[2],d=0;for(const t of[s,o].map(r.u32)){const n=(0,r.u32)(t);for(let t=0;t<n.length;t+=2){const{s0:r,s1:o}=v(e,u,f,h,l);n[t+0]=r,n[t+1]=o,u=++d}}const y={authKey:s,encKey:m(o)};return(0,r.clean)(...i),y}function f(t,s,i){const c=C(e.polyval,!0,s,i,o);for(let t=0;t<12;t++)c[t]^=n[t];c[15]&=127;const a=(0,r.u32)(c);let u=a[0],f=a[1],h=a[2],l=a[3];return({s0:u,s1:f,s2:h,s3:l}=v(t,u,f,h,l)),a[0]=u,a[1]=f,a[2]=h,a[3]=l,c}function h(t,e,n){let o=(0,r.copyBytes)(e);o[15]|=128;const s=_(t,!0,o,n);return(0,r.clean)(o),s}return(0,r.abytes)(t,16,24,32),c(n.length),void 0!==o&&s(o.length),{encrypt(t){i(t.length);const{encKey:e,authKey:n}=u(),o=f(e,n,t),s=[e,n,o];(0,r.isAligned32)(t)||s.push(t=(0,r.copyBytes)(t));const c=new Uint8Array(t.length+16);return c.set(o,t.length),c.set(h(e,o,t)),(0,r.clean)(...s),c},decrypt(t){a(t.length);const e=t.subarray(-16),{encKey:n,authKey:o}=u(),s=[n,o];(0,r.isAligned32)(t)||s.push(t=(0,r.copyBytes)(t));const i=h(n,e,t.subarray(0,-16)),c=f(n,o,i);if(s.push(c),!(0,r.equalBytes)(e,c))throw(0,r.clean)(...s),new Error("invalid polyval tag");return(0,r.clean)(...s),i}}})),t.siv=t.gcmsiv;const R={encrypt(t,e){if(e.length>=2**32)throw new Error("plaintext should be less than 4gb");const n=m(t);if(16===e.length)P(n,e);else{const t=(0,r.u32)(e);let o=t[0],s=t[1];for(let e=0,r=1;e<6;e++)for(let e=2;e<t.length;e+=2,r++){const{s0:i,s1:c,s2:a,s3:u}=v(n,o,s,t[e],t[e+1]);o=i,s=c^y(r),t[e]=a,t[e+1]=u}t[0]=o,t[1]=s}n.fill(0)},decrypt(t,e){if(e.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");const n=E(t),o=e.length/8-1;if(1===o)V(n,e);else{const t=(0,r.u32)(e);let s=t[0],i=t[1];for(let e=0,r=6*o;e<6;e++)for(let e=2*o;e>=1;e-=2,r--){i^=y(r);const{s0:o,s1:c,s2:a,s3:u}=S(n,s,i,t[e],t[e+1]);s=o,i=c,t[e]=a,t[e+1]=u}t[0]=s,t[1]=i}n.fill(0)}},F=new Uint8Array(8).fill(166);t.aeskw=(0,r.wrapCipher)({blockSize:8},(t=>({encrypt(e){if(!e.length||e.length%8!=0)throw new Error("invalid plaintext length");if(8===e.length)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const n=(0,r.concatBytes)(F,e);return R.encrypt(t,n),n},decrypt(e){if(e.length%8!=0||e.length<24)throw new Error("invalid ciphertext length");const n=(0,r.copyBytes)(e);if(R.decrypt(t,n),!(0,r.equalBytes)(n.subarray(0,8),F))throw new Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8)}})));const N=2790873510;t.aeskwp=(0,r.wrapCipher)({blockSize:8},(t=>({encrypt(e){if(!e.length)throw new Error("invalid plaintext length");const n=8*Math.ceil(e.length/8),o=new Uint8Array(8+n);o.set(e,8);const s=(0,r.u32)(o);return s[0]=N,s[1]=y(e.length),R.encrypt(t,o),o},decrypt(e){if(e.length<16)throw new Error("invalid ciphertext length");const n=(0,r.copyBytes)(e),o=(0,r.u32)(n);R.decrypt(t,n);const s=y(o[1])>>>0,i=8*Math.ceil(s/8);if(o[0]!==N||n.length-8!==i)throw new Error("integrity check failed");for(let t=s;t<i;t++)if(0!==n[8+t])throw new Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8,8+s)}}))),t.unsafe={expandKeyLE:m,expandKeyDecLE:E,encrypt:v,decrypt:S,encryptBlock:P,decryptBlock:V,ctrCounter:A,ctr32:_}}(Lr),Object.defineProperty(Or,"__esModule",{value:!0}),Or.aes256cbc=Or.aes256gcm=void 0;const Dr=Lr;Or.aes256gcm=(t,e,r)=>(0,Dr.gcm)(t,e,r);Or.aes256cbc=(t,e,r)=>(0,Dr.cbc)(t,e);var jr={},Mr={},qr={};Object.defineProperty(qr,"__esModule",{value:!0}),qr.rotl=function(t,e){return t<<e|t>>>32-e},qr.createCipher=function(t,e){const{allowShortKeys:r,extendNonceFn:n,counterLength:o,counterRight:s,rounds:i}=(0,Gr.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if("function"!=typeof t)throw new Error("core must be a function");return(0,Gr.anumber)(o),(0,Gr.anumber)(i),(0,Gr.abool)(s),(0,Gr.abool)(r),(e,c,a,u,f=0)=>{(0,Gr.abytes)(e),(0,Gr.abytes)(c),(0,Gr.abytes)(a);const h=a.length;if(void 0===u&&(u=new Uint8Array(h)),(0,Gr.abytes)(u),(0,Gr.anumber)(f),f<0||f>=tn)throw new Error("arx: counter overflow");if(u.length<h)throw new Error(`arx: output (${u.length}) is shorter than data (${h})`);const l=[];let d,y,p=e.length;if(32===p)l.push(d=(0,Gr.copyBytes)(e)),y=Wr;else{if(16!==p||!r)throw new Error(`arx: invalid 32-byte key, got length=${p}`);d=new Uint8Array(32),d.set(e),d.set(e,16),y=Xr,l.push(d)}$r(c)||l.push(c=(0,Gr.copyBytes)(c));const b=(0,Gr.u32)(d);if(n){if(24!==c.length)throw new Error("arx: extended nonce must be 24 bytes");n(y,b,(0,Gr.u32)(c.subarray(0,16)),b),c=c.subarray(16)}const g=16-o;if(g!==c.length)throw new Error(`arx: nonce must be ${g} or 16 bytes`);if(12!==g){const t=new Uint8Array(12);t.set(c,s?0:12-c.length),c=t,l.push(c)}const w=(0,Gr.u32)(c);return function(t,e,r,n,o,s,i,c){const a=o.length,u=new Uint8Array(Jr),f=(0,Gr.u32)(u),h=$r(o)&&$r(s),l=h?(0,Gr.u32)(o):en,d=h?(0,Gr.u32)(s):en;for(let y=0;y<a;i++){if(t(e,r,n,f,i,c),i>=tn)throw new Error("arx: counter overflow");const p=Math.min(Jr,a-y);if(h&&p===Jr){const t=y/4;if(y%4!=0)throw new Error("arx: invalid block position");for(let e,r=0;r<Qr;r++)e=t+r,d[e]=l[e]^f[r];y+=Jr}else{for(let t,e=0;e<p;e++)t=y+e,s[t]=o[t]^u[e];y+=p}}}(t,y,b,w,a,u,f,i),(0,Gr.clean)(...l),u}};const Gr=o,Zr=t=>Uint8Array.from(t.split("").map((t=>t.charCodeAt(0)))),zr=Zr("expand 16-byte k"),Yr=Zr("expand 32-byte k"),Xr=(0,Gr.u32)(zr),Wr=(0,Gr.u32)(Yr);function $r(t){return t.byteOffset%4==0}const Jr=64,Qr=16,tn=2**32-1,en=new Uint32Array;var rn={};Object.defineProperty(rn,"__esModule",{value:!0}),rn.poly1305=void 0,rn.wrapConstructorWithKey=cn;const nn=o,on=(t,e)=>255&t[e++]|(255&t[e++])<<8;class sn{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=(0,nn.toBytes)(t),(0,nn.abytes)(t,32);const e=on(t,0),r=on(t,2),n=on(t,4),o=on(t,6),s=on(t,8),i=on(t,10),c=on(t,12),a=on(t,14);this.r[0]=8191&e,this.r[1]=8191&(e>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|o<<9),this.r[4]=255&(o>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|i<<2),this.r[7]=8065&(i>>>11|c<<5),this.r[8]=8191&(c>>>8|a<<8),this.r[9]=a>>>5&127;for(let e=0;e<8;e++)this.pad[e]=on(t,16+2*e)}process(t,e,r=!1){const n=r?0:2048,{h:o,r:s}=this,i=s[0],c=s[1],a=s[2],u=s[3],f=s[4],h=s[5],l=s[6],d=s[7],y=s[8],p=s[9],b=on(t,e+0),g=on(t,e+2),w=on(t,e+4),m=on(t,e+6),E=on(t,e+8),B=on(t,e+10),x=on(t,e+12),v=on(t,e+14);let S=o[0]+(8191&b),A=o[1]+(8191&(b>>>13|g<<3)),_=o[2]+(8191&(g>>>10|w<<6)),H=o[3]+(8191&(w>>>7|m<<9)),I=o[4]+(8191&(m>>>4|E<<12)),O=o[5]+(E>>>1&8191),L=o[6]+(8191&(E>>>14|B<<2)),C=o[7]+(8191&(B>>>11|x<<5)),U=o[8]+(8191&(x>>>8|v<<8)),T=o[9]+(v>>>5|n),P=0,V=P+S*i+A*(5*p)+_*(5*y)+H*(5*d)+I*(5*l);P=V>>>13,V&=8191,V+=O*(5*h)+L*(5*f)+C*(5*u)+U*(5*a)+T*(5*c),P+=V>>>13,V&=8191;let R=P+S*c+A*i+_*(5*p)+H*(5*y)+I*(5*d);P=R>>>13,R&=8191,R+=O*(5*l)+L*(5*h)+C*(5*f)+U*(5*u)+T*(5*a),P+=R>>>13,R&=8191;let F=P+S*a+A*c+_*i+H*(5*p)+I*(5*y);P=F>>>13,F&=8191,F+=O*(5*d)+L*(5*l)+C*(5*h)+U*(5*f)+T*(5*u),P+=F>>>13,F&=8191;let N=P+S*u+A*a+_*c+H*i+I*(5*p);P=N>>>13,N&=8191,N+=O*(5*y)+L*(5*d)+C*(5*l)+U*(5*h)+T*(5*f),P+=N>>>13,N&=8191;let k=P+S*f+A*u+_*a+H*c+I*i;P=k>>>13,k&=8191,k+=O*(5*p)+L*(5*y)+C*(5*d)+U*(5*l)+T*(5*h),P+=k>>>13,k&=8191;let K=P+S*h+A*f+_*u+H*a+I*c;P=K>>>13,K&=8191,K+=O*i+L*(5*p)+C*(5*y)+U*(5*d)+T*(5*l),P+=K>>>13,K&=8191;let D=P+S*l+A*h+_*f+H*u+I*a;P=D>>>13,D&=8191,D+=O*c+L*i+C*(5*p)+U*(5*y)+T*(5*d),P+=D>>>13,D&=8191;let j=P+S*d+A*l+_*h+H*f+I*u;P=j>>>13,j&=8191,j+=O*a+L*c+C*i+U*(5*p)+T*(5*y),P+=j>>>13,j&=8191;let M=P+S*y+A*d+_*l+H*h+I*f;P=M>>>13,M&=8191,M+=O*u+L*a+C*c+U*i+T*(5*p),P+=M>>>13,M&=8191;let q=P+S*p+A*y+_*d+H*l+I*h;P=q>>>13,q&=8191,q+=O*f+L*u+C*a+U*c+T*i,P+=q>>>13,q&=8191,P=(P<<2)+P|0,P=P+V|0,V=8191&P,P>>>=13,R+=P,o[0]=V,o[1]=R,o[2]=F,o[3]=N,o[4]=k,o[5]=K,o[6]=D,o[7]=j,o[8]=M,o[9]=q}finalize(){const{h:t,pad:e}=this,r=new Uint16Array(10);let n=t[1]>>>13;t[1]&=8191;for(let e=2;e<10;e++)t[e]+=n,n=t[e]>>>13,t[e]&=8191;t[0]+=5*n,n=t[0]>>>13,t[0]&=8191,t[1]+=n,n=t[1]>>>13,t[1]&=8191,t[2]+=n,r[0]=t[0]+5,n=r[0]>>>13,r[0]&=8191;for(let e=1;e<10;e++)r[e]=t[e]+n,n=r[e]>>>13,r[e]&=8191;r[9]-=8192;let o=(1^n)-1;for(let t=0;t<10;t++)r[t]&=o;o=~o;for(let e=0;e<10;e++)t[e]=t[e]&o|r[e];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let s=t[0]+e[0];t[0]=65535&s;for(let r=1;r<8;r++)s=(t[r]+e[r]|0)+(s>>>16)|0,t[r]=65535&s;(0,nn.clean)(r)}update(t){(0,nn.aexists)(this),t=(0,nn.toBytes)(t),(0,nn.abytes)(t);const{buffer:e,blockLen:r}=this,n=t.length;for(let o=0;o<n;){const s=Math.min(r-this.pos,n-o);if(s!==r)e.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(e,0,!1),this.pos=0);else for(;r<=n-o;o+=r)this.process(t,o)}return this}destroy(){(0,nn.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(t){(0,nn.aexists)(this),(0,nn.aoutput)(t,this),this.finished=!0;const{buffer:e,h:r}=this;let{pos:n}=this;if(n){for(e[n++]=1;n<16;n++)e[n]=0;this.process(e,0,!0)}this.finalize();let o=0;for(let e=0;e<8;e++)t[o++]=r[e]>>>0,t[o++]=r[e]>>>8;return t}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}}function cn(t){const e=(e,r)=>t(r).update((0,nn.toBytes)(e)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}rn.poly1305=cn((t=>new sn(t))),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.xchacha20poly1305=t.chacha20poly1305=t._poly1305_aead=t.chacha12=t.chacha8=t.xchacha20=t.chacha20=t.chacha20orig=void 0,t.hchacha=i;const e=qr,r=rn,n=o;function s(t,r,n,o,s,i=20){let c=t[0],a=t[1],u=t[2],f=t[3],h=r[0],l=r[1],d=r[2],y=r[3],p=r[4],b=r[5],g=r[6],w=r[7],m=s,E=n[0],B=n[1],x=n[2],v=c,S=a,A=u,_=f,H=h,I=l,O=d,L=y,C=p,U=b,T=g,P=w,V=m,R=E,F=B,N=x;for(let t=0;t<i;t+=2)v=v+H|0,V=(0,e.rotl)(V^v,16),C=C+V|0,H=(0,e.rotl)(H^C,12),v=v+H|0,V=(0,e.rotl)(V^v,8),C=C+V|0,H=(0,e.rotl)(H^C,7),S=S+I|0,R=(0,e.rotl)(R^S,16),U=U+R|0,I=(0,e.rotl)(I^U,12),S=S+I|0,R=(0,e.rotl)(R^S,8),U=U+R|0,I=(0,e.rotl)(I^U,7),A=A+O|0,F=(0,e.rotl)(F^A,16),T=T+F|0,O=(0,e.rotl)(O^T,12),A=A+O|0,F=(0,e.rotl)(F^A,8),T=T+F|0,O=(0,e.rotl)(O^T,7),_=_+L|0,N=(0,e.rotl)(N^_,16),P=P+N|0,L=(0,e.rotl)(L^P,12),_=_+L|0,N=(0,e.rotl)(N^_,8),P=P+N|0,L=(0,e.rotl)(L^P,7),v=v+I|0,N=(0,e.rotl)(N^v,16),T=T+N|0,I=(0,e.rotl)(I^T,12),v=v+I|0,N=(0,e.rotl)(N^v,8),T=T+N|0,I=(0,e.rotl)(I^T,7),S=S+O|0,V=(0,e.rotl)(V^S,16),P=P+V|0,O=(0,e.rotl)(O^P,12),S=S+O|0,V=(0,e.rotl)(V^S,8),P=P+V|0,O=(0,e.rotl)(O^P,7),A=A+L|0,R=(0,e.rotl)(R^A,16),C=C+R|0,L=(0,e.rotl)(L^C,12),A=A+L|0,R=(0,e.rotl)(R^A,8),C=C+R|0,L=(0,e.rotl)(L^C,7),_=_+H|0,F=(0,e.rotl)(F^_,16),U=U+F|0,H=(0,e.rotl)(H^U,12),_=_+H|0,F=(0,e.rotl)(F^_,8),U=U+F|0,H=(0,e.rotl)(H^U,7);let k=0;o[k++]=c+v|0,o[k++]=a+S|0,o[k++]=u+A|0,o[k++]=f+_|0,o[k++]=h+H|0,o[k++]=l+I|0,o[k++]=d+O|0,o[k++]=y+L|0,o[k++]=p+C|0,o[k++]=b+U|0,o[k++]=g+T|0,o[k++]=w+P|0,o[k++]=m+V|0,o[k++]=E+R|0,o[k++]=B+F|0,o[k++]=x+N|0}function i(t,r,n,o){let s=t[0],i=t[1],c=t[2],a=t[3],u=r[0],f=r[1],h=r[2],l=r[3],d=r[4],y=r[5],p=r[6],b=r[7],g=n[0],w=n[1],m=n[2],E=n[3];for(let t=0;t<20;t+=2)s=s+u|0,g=(0,e.rotl)(g^s,16),d=d+g|0,u=(0,e.rotl)(u^d,12),s=s+u|0,g=(0,e.rotl)(g^s,8),d=d+g|0,u=(0,e.rotl)(u^d,7),i=i+f|0,w=(0,e.rotl)(w^i,16),y=y+w|0,f=(0,e.rotl)(f^y,12),i=i+f|0,w=(0,e.rotl)(w^i,8),y=y+w|0,f=(0,e.rotl)(f^y,7),c=c+h|0,m=(0,e.rotl)(m^c,16),p=p+m|0,h=(0,e.rotl)(h^p,12),c=c+h|0,m=(0,e.rotl)(m^c,8),p=p+m|0,h=(0,e.rotl)(h^p,7),a=a+l|0,E=(0,e.rotl)(E^a,16),b=b+E|0,l=(0,e.rotl)(l^b,12),a=a+l|0,E=(0,e.rotl)(E^a,8),b=b+E|0,l=(0,e.rotl)(l^b,7),s=s+f|0,E=(0,e.rotl)(E^s,16),p=p+E|0,f=(0,e.rotl)(f^p,12),s=s+f|0,E=(0,e.rotl)(E^s,8),p=p+E|0,f=(0,e.rotl)(f^p,7),i=i+h|0,g=(0,e.rotl)(g^i,16),b=b+g|0,h=(0,e.rotl)(h^b,12),i=i+h|0,g=(0,e.rotl)(g^i,8),b=b+g|0,h=(0,e.rotl)(h^b,7),c=c+l|0,w=(0,e.rotl)(w^c,16),d=d+w|0,l=(0,e.rotl)(l^d,12),c=c+l|0,w=(0,e.rotl)(w^c,8),d=d+w|0,l=(0,e.rotl)(l^d,7),a=a+u|0,m=(0,e.rotl)(m^a,16),y=y+m|0,u=(0,e.rotl)(u^y,12),a=a+u|0,m=(0,e.rotl)(m^a,8),y=y+m|0,u=(0,e.rotl)(u^y,7);let B=0;o[B++]=s,o[B++]=i,o[B++]=c,o[B++]=a,o[B++]=g,o[B++]=w,o[B++]=m,o[B++]=E}t.chacha20orig=(0,e.createCipher)(s,{counterRight:!1,counterLength:8,allowShortKeys:!0}),t.chacha20=(0,e.createCipher)(s,{counterRight:!1,counterLength:4,allowShortKeys:!1}),t.xchacha20=(0,e.createCipher)(s,{counterRight:!1,counterLength:8,extendNonceFn:i,allowShortKeys:!1}),t.chacha8=(0,e.createCipher)(s,{counterRight:!1,counterLength:4,rounds:8}),t.chacha12=(0,e.createCipher)(s,{counterRight:!1,counterLength:4,rounds:12});const c=new Uint8Array(16),a=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(c.subarray(r))},u=new Uint8Array(32);function f(t,e,o,s,i){const c=t(e,o,u),f=r.poly1305.create(c);i&&a(f,i),a(f,s);const h=(0,n.u64Lengths)(s.length,i?i.length:0,!0);f.update(h);const l=f.digest();return(0,n.clean)(c,h),l}t._poly1305_aead=t=>(e,r,o)=>{const s=16;return{encrypt(i,c){const a=i.length;(c=(0,n.getOutput)(a+s,c,!1)).set(i);const u=c.subarray(0,-16);t(e,r,u,u,1);const h=f(t,e,r,u,o);return c.set(h,a),(0,n.clean)(h),c},decrypt(i,c){c=(0,n.getOutput)(i.length-s,c,!1);const a=i.subarray(0,-16),u=i.subarray(-16),h=f(t,e,r,a,o);if(!(0,n.equalBytes)(u,h))throw new Error("invalid tag");return c.set(i.subarray(0,-16)),t(e,r,c,c,1),(0,n.clean)(h),c}}},t.chacha20poly1305=(0,n.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,t._poly1305_aead)(t.chacha20)),t.xchacha20poly1305=(0,n.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,t._poly1305_aead)(t.xchacha20))}(Mr),Object.defineProperty(jr,"__esModule",{value:!0}),jr.chacha20=jr.xchacha20=void 0;const an=Mr;jr.xchacha20=(t,e,r)=>(0,an.xchacha20poly1305)(t,e,r);var un,fn,hn;jr.chacha20=(t,e,r)=>(0,an.chacha20poly1305)(t,e,r),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.aesDecrypt=t.aesEncrypt=t.symDecrypt=t.symEncrypt=void 0;var e=Or,r=jr,n=o,c=h,a=s,u=i;t.symEncrypt=function(t,e,r){return f(l,a.ECIES_CONFIG.symmetricAlgorithm,a.ECIES_CONFIG.symmetricNonceLength,t,e,r)};function f(t,n,o,s,i,c){if("aes-256-gcm"===n)return t(e.aes256gcm,s,i,o,u.AEAD_TAG_LENGTH,c);if("xchacha20"===n)return t(r.xchacha20,s,i,u.XCHACHA20_NONCE_LENGTH,u.AEAD_TAG_LENGTH,c);if("aes-256-cbc"===n)return t(e.aes256cbc,s,i,16,0);throw new Error("Not implemented")}function l(t,e,r,o,s,i){var a=(0,c.randomBytes)(o),u=t(e,a,i).encrypt(r);if(0===s)return(0,n.concatBytes)(a,u);var f=u.length-s,h=u.subarray(0,f),l=u.subarray(f);return(0,n.concatBytes)(a,l,h)}function d(t,e,r,o,s,i){var c=r.subarray(0,o),a=t(e,Uint8Array.from(c),i),u=r.subarray(o);if(0===s)return a.decrypt(u);var f=u.subarray(0,s),h=u.subarray(s);return a.decrypt((0,n.concatBytes)(h,f))}t.symDecrypt=function(t,e,r){return f(d,a.ECIES_CONFIG.symmetricAlgorithm,a.ECIES_CONFIG.symmetricNonceLength,t,e,r)},t.aesEncrypt=t.symEncrypt,t.aesDecrypt=t.symDecrypt}(Ir),un=u,fn=t&&t.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),hn=t&&t.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||fn(e,t,r)},Object.defineProperty(un,"__esModule",{value:!0}),hn(f,un),hn(ve,un),hn(xe,un),hn(Ir,un);var ln={};Object.defineProperty(ln,"__esModule",{value:!0}),ln.PublicKey=void 0;var dn=o,yn=u,pn=function(){function t(t,e){var r=(0,yn.convertPublicKeyFormat)(t,!0,e),n=(0,yn.convertPublicKeyFormat)(t,!1,e);this.data=r,this.dataUncompressed=r.length!==n.length?n:null}return t.fromHex=function(e,r){return new t((0,yn.hexToPublicKey)(e,r),r)},Object.defineProperty(t.prototype,"_uncompressed",{get:function(){return null!==this.dataUncompressed?this.dataUncompressed:this.data},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uncompressed",{get:function(){return Buffer.from(this._uncompressed)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"compressed",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),t.prototype.toBytes=function(t){return void 0===t&&(t=!0),t?this.data:this._uncompressed},t.prototype.toHex=function(t){return void 0===t&&(t=!0),(0,dn.bytesToHex)(this.toBytes(t))},t.prototype.decapsulate=function(t,e){void 0===e&&(e=!1);var r=this.toBytes(e),n=t.multiply(this,e);return(0,yn.getSharedKey)(r,n)},t.prototype.equals=function(t){return(0,dn.equalBytes)(this.data,t.data)},t}();ln.PublicKey=pn,Object.defineProperty(a,"__esModule",{value:!0}),a.PrivateKey=void 0;var bn=o,gn=u,wn=ln,mn=function(){function t(t,e){if(this.curve=e,void 0===t)this.data=(0,gn.getValidSecret)(e);else{if(!(0,gn.isValidPrivateKey)(t,e))throw new Error("Invalid private key");this.data=t}this.publicKey=new wn.PublicKey((0,gn.getPublicKey)(this.data,e),e)}return t.fromHex=function(e,r){return new t((0,gn.decodeHex)(e),r)},Object.defineProperty(t.prototype,"secret",{get:function(){return Buffer.from(this.data)},enumerable:!1,configurable:!0}),t.prototype.toHex=function(){return(0,bn.bytesToHex)(this.data)},t.prototype.encapsulate=function(t,e){void 0===e&&(e=!1);var r=this.publicKey.toBytes(e),n=this.multiply(t,e);return(0,gn.getSharedKey)(r,n)},t.prototype.multiply=function(t,e){return void 0===e&&(e=!1),(0,gn.getSharedPoint)(this.data,t.toBytes(!0),e,this.curve)},t.prototype.equals=function(t){return(0,bn.equalBytes)(this.data,t.data)},t}();a.PrivateKey=mn,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.PrivateKey=void 0;var e=a;Object.defineProperty(t,"PrivateKey",{enumerable:!0,get:function(){return e.PrivateKey}});var r=ln;Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return r.PublicKey}})}(c),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.PublicKey=t.PrivateKey=t.ECIES_CONFIG=void 0,t.encrypt=function(t,o){return Buffer.from(function(t,r,o){var s=o.ellipticCurve,c=new n.PrivateKey(void 0,s),a=t instanceof Uint8Array?new n.PublicKey(t,s):n.PublicKey.fromHex(t,s),u=c.encapsulate(a,o.isHkdfKeyCompressed),f=c.publicKey.toBytes(o.isEphemeralKeyCompressed),h=(0,i.symEncrypt)(u,r);return(0,e.concatBytes)(f,h)}(t,o,r.ECIES_CONFIG))},t.decrypt=function(t,e){return Buffer.from(function(t,e,o){void 0===o&&(o=r.ECIES_CONFIG);var s=o.ellipticCurve,c=t instanceof Uint8Array?new n.PrivateKey(t,s):n.PrivateKey.fromHex(t,s),a=o.ephemeralKeySize,u=new n.PublicKey(e.subarray(0,a),s),f=e.subarray(a),h=u.decapsulate(c,o.isHkdfKeyCompressed);return(0,i.symDecrypt)(h,f)}(t,e))};var e=o,r=s,n=c,i=u;var a=s;Object.defineProperty(t,"ECIES_CONFIG",{enumerable:!0,get:function(){return a.ECIES_CONFIG}});var f=c;Object.defineProperty(t,"PrivateKey",{enumerable:!0,get:function(){return f.PrivateKey}}),Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return f.PublicKey}}),t.utils={aesEncrypt:i.aesEncrypt,aesDecrypt:i.aesDecrypt,symEncrypt:i.symEncrypt,symDecrypt:i.symDecrypt,decodeHex:i.decodeHex,getValidSecret:i.getValidSecret,remove0x:i.remove0x}}(n);var En=r({__proto__:null,default:e(n)},[n]);export{En as i};
@@ -1 +1 @@
1
- import{as as t,A as e}from"./index-de489272.js";export{at as getAlchemySigner}from"./index-de489272.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/address";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";async function r(e,r){const o=await t(e);return o.on("connect",r.connect),o.on("disconnect",r.disconnect),o.on("accountsChanged",r.accountsChanged),o.on("chainChanged",r.chainChanged),o.on("message",r.message),o}function o(){const t=e.getState().provider?.provider;if(t)return t.disconnect()}function n(t){return e.getState().provider?.smartAccountClient?.account?.signTypedDataWith6492?.(t)}export{r as default,o as disconnect,n as signTypedData};
1
+ import{aC as t,A as e}from"./index-a98e886d.js";export{aD as getAlchemySigner}from"./index-a98e886d.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/address";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";async function r(e,r){const o=await t(e);return o.on("connect",r.connect),o.on("disconnect",r.disconnect),o.on("accountsChanged",r.accountsChanged),o.on("chainChanged",r.chainChanged),o.on("message",r.message),o}function o(){const t=e.getState().provider?.provider;if(t)return t.disconnect()}function n(t){return e.getState().provider?.smartAccountClient?.account?.signTypedDataWith6492?.(t)}export{r as default,o as disconnect,n as signTypedData};