@taquito/taquito 21.0.3 → 21.0.4-beta.1
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.
- package/README.md +1 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito.es6.js +2 -2
- package/dist/taquito.min.js +1 -1
- package/dist/taquito.umd.js +2 -2
- package/package.json +9 -9
package/dist/taquito.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see taquito.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.taquito=t():e.taquito=t()}(self,(()=>(()=>{var e={8460:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function n(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=n,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){n(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}},6423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=o,t.Chi=function(e,t,r){return e&t^~e&r},t.Maj=function(e,t,r){return e&t^e&r^t&r};const n=r(8460),i=r(9074);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}class s extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);const{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a!==o)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:a}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);const u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.HashMD=s},6910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;const n=r(6423),i=r(9074),o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class c extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=a[e-15],r=a[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;a[e]=o+a[e-7]+n+a[e-16]|0}let{A:r,B:s,C:c,D:u,E:l,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+(0,n.Chi)(l,d,f)+o[e]+a[e]|0,p=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,s,c)|0;h=f,f=d,d=l,l=u+t|0,u=c,c=s,s=r,r=t+p|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,s,c,u,l,d,f,h)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=c;class u extends c{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)((()=>new c)),t.sha224=(0,i.wrapConstructor)((()=>new u))},9074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=o,t.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=o(e[t])},t.bytesToHex=function(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=c(e.charCodeAt(i)),o=c(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=u,t.toBytes=l,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,i.abytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(l(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(l(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(l(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const n=r(6910),i=r(8460);function o(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>o(e);const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const a={_0:48,_9:57,A:65,F:70,a:97,f:102};function c(e){return e>=a._0&&e<=a._9?e-a._0:e>=a.A&&e<=a.F?e-(a.A-10):e>=a.a&&e<=a.f?e-(a.a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function l(e){return"string"==typeof e&&(e=u(e)),(0,i.abytes)(e),e}t.nextTick=async()=>{};t.Hash=class{clone(){return this._cloneInto()}}},3447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6411);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e/4294967296>>>0,t,r),l(e>>>0,t,r+4),t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),d(e>>>0,t,r),d(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=u,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=d,t.writeInt32LE=d,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=f,t.writeInt64BE=f,t.writeUint64LE=h,t.writeInt64LE=h,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n},t.writeUintBE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},1703:(e,t,r)=>{"use strict";var n=r(3447),i=r(8767);t.cS=128,t.On=64,t.J4=64,t.Cc=16,t.wU=16,t.wm=Math.pow(2,32)-1,t.np=255,t._n=255;var o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function e(e,r){if(void 0===e&&(e=64),this.digestLength=e,this.blockSize=t.cS,this._state=new Int32Array(o),this._buffer=new Uint8Array(t.cS),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),e<1||e>t.On)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var i=0;r&&r.key&&(i=r.key.length);var s=1,a=1;r&&r.tree&&(s=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=e|i<<8|s<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=n.readUint32LE(r.salt,0),this._state[9]^=n.readUint32LE(r.salt,4),this._state[10]^=n.readUint32LE(r.salt,8),this._state[11]^=n.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=n.readUint32LE(r.personalization,0),this._state[13]^=n.readUint32LE(r.personalization,4),this._state[14]^=n.readUint32LE(r.personalization,8),this._state[15]^=n.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&i>0&&(this._paddedKey=new Uint8Array(t.cS),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=t.cS)}return e.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=t.cS):this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._finished=!1,this},e.prototype.validateConfig=function(e){if(e.key&&e.key.length>t.J4)throw new Error("blake2b: wrong key length");if(e.salt&&e.salt.length!==t.wU)throw new Error("blake2b: wrong salt length");if(e.personalization&&e.personalization.length!==t.Cc)throw new Error("blake2b: wrong personalization length");if(e.tree){if(e.tree.fanout<0||e.tree.fanout>t.np)throw new Error("blake2b: wrong tree fanout");if(e.tree.maxDepth<0||e.tree.maxDepth>t._n)throw new Error("blake2b: wrong tree depth");if(e.tree.leafSize<0||e.tree.leafSize>t.wm)throw new Error("blake2b: wrong leaf size");if(e.tree.innerDigestLength<0||e.tree.innerDigestLength>t.On)throw new Error("blake2b: wrong tree inner digest length")}},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var n=t.cS-this._bufferLength,i=0;if(0===r)return this;if(r>n){for(var o=0;o<n;o++)this._buffer[this._bufferLength+o]=e[i+o];this._processBlock(t.cS),i+=n,r-=n,this._bufferLength=0}for(;r>t.cS;){for(o=0;o<t.cS;o++)this._buffer[o]=e[i+o];this._processBlock(t.cS),i+=t.cS,r-=t.cS,this._bufferLength=0}for(o=0;o<r;o++)this._buffer[this._bufferLength+o]=e[i+o];return this._bufferLength+=r,this},e.prototype.finish=function(e){if(!this._finished){for(var r=this._bufferLength;r<t.cS;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var i=this._buffer.subarray(0,64);for(r=0;r<16;r++)n.writeUint32LE(this._state[r],i,4*r);return e.set(i.subarray(0,e.length)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.clean=function(){i.wipe(this._vtmp),i.wipe(this._mtmp),i.wipe(this._state),i.wipe(this._buffer),i.wipe(this._initialState),this._paddedKey&&i.wipe(this._paddedKey),this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._lastNode=!1,this._finished=!1},e.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._buffer.set(e.buffer),this._bufferLength=e.bufferLength,this._ctr.set(e.ctr),this._flag.set(e.flag),this._lastNode=e.lastNode,this._paddedKey&&i.wipe(this._paddedKey),this._paddedKey=e.paddedKey?new Uint8Array(e.paddedKey):void 0,this._initialState.set(e.initialState),this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),i.wipe(e.buffer),i.wipe(e.initialState),e.paddedKey&&i.wipe(e.paddedKey),e.bufferLength=0,i.wipe(e.ctr),i.wipe(e.flag),e.lastNode=!1},e.prototype._G=function(e,t,r,n,i,o,s,a,c,u,l,d,f){var h=e[t],p=e[o],b=e[r],m=e[s],g=e[n],v=e[a],y=e[i],_=e[c],E=65535&h,w=h>>>16,O=65535&p,A=p>>>16;w+=b>>>16,O+=65535&m,A+=m>>>16,O+=(w+=(E+=65535&b)>>>16)>>>16,E=65535&(h=65535&E|w<<16),w=h>>>16,O=65535&(p=65535&O|(A+=O>>>16)<<16),A=p>>>16,w+=u>>>16,O+=65535&l,A+=l>>>16,h=65535&(E+=65535&u)|(w+=E>>>16)<<16,E=_^=p=65535&(O+=w>>>16)|(A+=O>>>16)<<16,_=y^=h,y=E,E=65535&g,w=g>>>16,O=65535&v,A=v>>>16,w+=y>>>16,O+=65535&_,A+=_>>>16,E=(b^=g=65535&(E+=65535&y)|(w+=E>>>16)<<16)<<8|(m^=v=65535&(O+=w>>>16)|(A+=O>>>16)<<16)>>>24,b=m<<8|b>>>24,m=E,E=65535&h,w=h>>>16,O=65535&p,A=p>>>16,w+=b>>>16,O+=65535&m,A+=m>>>16,O+=(w+=(E+=65535&b)>>>16)>>>16,E=65535&(h=65535&E|w<<16),w=h>>>16,O=65535&(p=65535&O|(A+=O>>>16)<<16),A=p>>>16,w+=d>>>16,O+=65535&f,A+=f>>>16,E=(y^=h=65535&(E+=65535&d)|(w+=E>>>16)<<16)<<16|(_^=p=65535&(O+=w>>>16)|(A+=O>>>16)<<16)>>>16,y=_<<16|y>>>16,_=E,E=65535&g,w=g>>>16,O=65535&v,A=v>>>16,w+=y>>>16,O+=65535&_,A+=_>>>16,E=(m^=v=65535&(O+=(w+=(E+=65535&y)>>>16)>>>16)|(A+=O>>>16)<<16)<<1|(b^=g=65535&E|w<<16)>>>31,b=b<<1|m>>>31,m=E,e[t]=h,e[o]=p,e[r]=b,e[s]=m,e[n]=g,e[a]=v,e[i]=y,e[c]=_},e.prototype._incrementCounter=function(e){for(var t=0;t<3;t++){var r=this._ctr[t]+e;if(this._ctr[t]=r>>>0,this._ctr[t]===r)return;e=1}},e.prototype._processBlock=function(e){this._incrementCounter(e);var t=this._vtmp;t.set(this._state),t.set(o,16),t[24]^=this._ctr[0],t[25]^=this._ctr[1],t[26]^=this._ctr[2],t[27]^=this._ctr[3],t[28]^=this._flag[0],t[29]^=this._flag[1],t[30]^=this._flag[2],t[31]^=this._flag[3];for(var r=this._mtmp,i=0;i<32;i++)r[i]=n.readUint32LE(this._buffer,4*i);for(var a=0;a<12;a++)this._G(t,0,8,16,24,1,9,17,25,r[s[a][0]],r[s[a][0]+1],r[s[a][1]],r[s[a][1]+1]),this._G(t,2,10,18,26,3,11,19,27,r[s[a][2]],r[s[a][2]+1],r[s[a][3]],r[s[a][3]+1]),this._G(t,4,12,20,28,5,13,21,29,r[s[a][4]],r[s[a][4]+1],r[s[a][5]],r[s[a][5]+1]),this._G(t,6,14,22,30,7,15,23,31,r[s[a][6]],r[s[a][6]+1],r[s[a][7]],r[s[a][7]+1]),this._G(t,0,10,20,30,1,11,21,31,r[s[a][8]],r[s[a][8]+1],r[s[a][9]],r[s[a][9]+1]),this._G(t,2,12,22,24,3,13,23,25,r[s[a][10]],r[s[a][10]+1],r[s[a][11]],r[s[a][11]+1]),this._G(t,4,14,16,26,5,15,17,27,r[s[a][12]],r[s[a][12]+1],r[s[a][13]],r[s[a][13]+1]),this._G(t,6,8,18,28,7,9,19,29,r[s[a][14]],r[s[a][14]+1],r[s[a][15]],r[s[a][15]+1]);for(i=0;i<16;i++)this._state[i]^=t[i]^t[i+16]},e}();t.tW=function(e,r,n){void 0===r&&(r=t.On);var i=new a(r,n);i.update(e);var o=i.digest();return i.clean(),o}},7379:(e,t,r)=>{"use strict";t.MX=t.TP=t.wE=t.Ee=void 0;const n=r(7687),i=r(5121),o=r(8767);function s(e){const t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.Ee=64,t.wE=64,t.TP=32;new Uint8Array(32)[0]=9;const a=s(),c=s([1]),u=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function b(e){let t=1;for(let r=0;r<16;r++){let n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function m(e,t,r){const n=~(r-1);for(let r=0;r<16;r++){const i=n&(e[r]^t[r]);e[r]^=i,t[r]^=i}}function g(e,t){const r=s(),n=s();for(let e=0;e<16;e++)n[e]=t[e];b(n),b(n),b(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,m(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}function v(e,t){let r=0;for(let n=0;n<32;n++)r|=e[n]^t[n];return(1&r-1>>>8)-1}function y(e,t){const r=new Uint8Array(32),n=new Uint8Array(32);return g(r,e),g(n,t),v(r,n)}function _(e){const t=new Uint8Array(32);return g(t,e),1&t[0]}function E(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function w(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function O(e,t,r){let n,i,o=0,s=0,a=0,c=0,u=0,l=0,d=0,f=0,h=0,p=0,b=0,m=0,g=0,v=0,y=0,_=0,E=0,w=0,O=0,A=0,S=0,P=0,T=0,R=0,I=0,x=0,M=0,k=0,L=0,C=0,N=0,j=r[0],D=r[1],U=r[2],B=r[3],F=r[4],K=r[5],H=r[6],G=r[7],$=r[8],V=r[9],z=r[10],W=r[11],q=r[12],Z=r[13],Y=r[14],J=r[15];n=t[0],o+=n*j,s+=n*D,a+=n*U,c+=n*B,u+=n*F,l+=n*K,d+=n*H,f+=n*G,h+=n*$,p+=n*V,b+=n*z,m+=n*W,g+=n*q,v+=n*Z,y+=n*Y,_+=n*J,n=t[1],s+=n*j,a+=n*D,c+=n*U,u+=n*B,l+=n*F,d+=n*K,f+=n*H,h+=n*G,p+=n*$,b+=n*V,m+=n*z,g+=n*W,v+=n*q,y+=n*Z,_+=n*Y,E+=n*J,n=t[2],a+=n*j,c+=n*D,u+=n*U,l+=n*B,d+=n*F,f+=n*K,h+=n*H,p+=n*G,b+=n*$,m+=n*V,g+=n*z,v+=n*W,y+=n*q,_+=n*Z,E+=n*Y,w+=n*J,n=t[3],c+=n*j,u+=n*D,l+=n*U,d+=n*B,f+=n*F,h+=n*K,p+=n*H,b+=n*G,m+=n*$,g+=n*V,v+=n*z,y+=n*W,_+=n*q,E+=n*Z,w+=n*Y,O+=n*J,n=t[4],u+=n*j,l+=n*D,d+=n*U,f+=n*B,h+=n*F,p+=n*K,b+=n*H,m+=n*G,g+=n*$,v+=n*V,y+=n*z,_+=n*W,E+=n*q,w+=n*Z,O+=n*Y,A+=n*J,n=t[5],l+=n*j,d+=n*D,f+=n*U,h+=n*B,p+=n*F,b+=n*K,m+=n*H,g+=n*G,v+=n*$,y+=n*V,_+=n*z,E+=n*W,w+=n*q,O+=n*Z,A+=n*Y,S+=n*J,n=t[6],d+=n*j,f+=n*D,h+=n*U,p+=n*B,b+=n*F,m+=n*K,g+=n*H,v+=n*G,y+=n*$,_+=n*V,E+=n*z,w+=n*W,O+=n*q,A+=n*Z,S+=n*Y,P+=n*J,n=t[7],f+=n*j,h+=n*D,p+=n*U,b+=n*B,m+=n*F,g+=n*K,v+=n*H,y+=n*G,_+=n*$,E+=n*V,w+=n*z,O+=n*W,A+=n*q,S+=n*Z,P+=n*Y,T+=n*J,n=t[8],h+=n*j,p+=n*D,b+=n*U,m+=n*B,g+=n*F,v+=n*K,y+=n*H,_+=n*G,E+=n*$,w+=n*V,O+=n*z,A+=n*W,S+=n*q,P+=n*Z,T+=n*Y,R+=n*J,n=t[9],p+=n*j,b+=n*D,m+=n*U,g+=n*B,v+=n*F,y+=n*K,_+=n*H,E+=n*G,w+=n*$,O+=n*V,A+=n*z,S+=n*W,P+=n*q,T+=n*Z,R+=n*Y,I+=n*J,n=t[10],b+=n*j,m+=n*D,g+=n*U,v+=n*B,y+=n*F,_+=n*K,E+=n*H,w+=n*G,O+=n*$,A+=n*V,S+=n*z,P+=n*W,T+=n*q,R+=n*Z,I+=n*Y,x+=n*J,n=t[11],m+=n*j,g+=n*D,v+=n*U,y+=n*B,_+=n*F,E+=n*K,w+=n*H,O+=n*G,A+=n*$,S+=n*V,P+=n*z,T+=n*W,R+=n*q,I+=n*Z,x+=n*Y,M+=n*J,n=t[12],g+=n*j,v+=n*D,y+=n*U,_+=n*B,E+=n*F,w+=n*K,O+=n*H,A+=n*G,S+=n*$,P+=n*V,T+=n*z,R+=n*W,I+=n*q,x+=n*Z,M+=n*Y,k+=n*J,n=t[13],v+=n*j,y+=n*D,_+=n*U,E+=n*B,w+=n*F,O+=n*K,A+=n*H,S+=n*G,P+=n*$,T+=n*V,R+=n*z,I+=n*W,x+=n*q,M+=n*Z,k+=n*Y,L+=n*J,n=t[14],y+=n*j,_+=n*D,E+=n*U,w+=n*B,O+=n*F,A+=n*K,S+=n*H,P+=n*G,T+=n*$,R+=n*V,I+=n*z,x+=n*W,M+=n*q,k+=n*Z,L+=n*Y,C+=n*J,n=t[15],_+=n*j,E+=n*D,w+=n*U,O+=n*B,A+=n*F,S+=n*K,P+=n*H,T+=n*G,R+=n*$,I+=n*V,x+=n*z,M+=n*W,k+=n*q,L+=n*Z,C+=n*Y,N+=n*J,o+=38*E,s+=38*w,a+=38*O,c+=38*A,u+=38*S,l+=38*P,d+=38*T,f+=38*R,h+=38*I,p+=38*x,b+=38*M,m+=38*k,g+=38*L,v+=38*C,y+=38*N,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=h,e[9]=p,e[10]=b,e[11]=m,e[12]=g,e[13]=v,e[14]=y,e[15]=_}function A(e,t){O(e,t,t)}function S(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)A(r,r),2!==n&&4!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function P(e,t){const r=s(),n=s(),i=s(),o=s(),a=s(),c=s(),u=s(),d=s(),f=s();w(r,e[1],e[0]),w(f,t[1],t[0]),O(r,r,f),E(n,e[0],e[1]),E(f,t[0],t[1]),O(n,n,f),O(i,e[3],t[3]),O(i,i,l),O(o,e[2],t[2]),E(o,o,o),w(a,n,r),w(c,o,i),E(u,o,i),E(d,n,r),O(e[0],a,c),O(e[1],d,u),O(e[2],u,c),O(e[3],a,d)}function T(e,t,r){for(let n=0;n<4;n++)m(e[n],t[n],r)}function R(e,t){const r=s(),n=s(),i=s();S(i,t[2]),O(r,t[0],i),O(n,t[1],i),g(e,n),e[31]^=_(r)<<7}function I(e,t,r){p(e[0],a),p(e[1],c),p(e[2],c),p(e[3],a);for(let n=255;n>=0;--n){const i=r[n/8|0]>>(7&n)&1;T(e,t,i),P(t,e),P(e,e),T(e,t,i)}}function x(e,t){const r=[s(),s(),s(),s()];p(r[0],d),p(r[1],f),p(r[2],c),O(r[3],d,f),I(e,r,t)}function M(e){if(e.length!==t.TP)throw new Error(`ed25519: seed must be ${t.TP} bytes`);const r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const n=new Uint8Array(32),o=[s(),s(),s(),s()];x(o,r),R(n,o);const a=new Uint8Array(64);return a.set(e),a.set(n,32),{publicKey:n,secretKey:a}}const k=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function L(e,t){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*k[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*k[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*k[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function C(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;L(e,t)}function N(e,t){const r=s(),n=s(),i=s(),o=s(),l=s(),d=s(),f=s();return p(e[2],c),function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),A(i,e[1]),O(o,i,u),w(i,i,e[2]),E(o,e[2],o),A(l,o),A(d,l),O(f,d,l),O(r,f,i),O(r,r,o),function(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)A(r,r),1!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(r,r),O(r,r,i),O(r,r,o),O(r,r,o),O(e[0],r,o),A(n,e[0]),O(n,n,o),y(n,i)&&O(e[0],e[0],h),A(n,e[0]),O(n,n,o),y(n,i)?-1:(_(e[0])===t[31]>>7&&w(e[0],a,e[0]),O(e[3],e[0],e[1]),0)}t.MX=function(e,r,n){const o=new Uint8Array(32),a=[s(),s(),s(),s()],c=[s(),s(),s(),s()];if(n.length!==t.Ee)throw new Error(`ed25519: signature must be ${t.Ee} bytes`);if(N(c,e))return!1;const u=new i.SHA512;u.update(n.subarray(0,32)),u.update(e),u.update(r);const l=u.digest();return C(l),I(a,c,l),x(c,n.subarray(32)),P(a,c),R(o,a),!v(n,o)}},6411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},7687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const n=r(7841),i=r(3447),o=r(8767);function s(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const r=s(4,e),n=(0,i.readUint32LE)(r);return(0,o.wipe)(r),n};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let i="";const c=r.length,u=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/u),n);for(let n=0;n<t.length&&e>0;n++){const o=t[n];o<u&&(i+=r.charAt(o%c),e--)}(0,o.wipe)(t)}return i}t.randomString=c,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return c(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}},4262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}},1052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const n=r(8767);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(5423);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,n.wipe)(t),r}}},7841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const n=r(4262),i=r(1052);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},5121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3447),i=r(8767);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<s-8;c++)this._buffer[c]=0;n.writeUint32BE(i,this._buffer,s-8),n.writeUint32BE(o,this._buffer,s-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(c=0;c<this.digestLength/8;c++)n.writeUint32BE(this._stateHi[c],e,8*c),n.writeUint32BE(this._stateLo[c],e,8*c+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,o,a,c){for(var u,l,d,f,h,p,b,m,g=r[0],v=r[1],y=r[2],_=r[3],E=r[4],w=r[5],O=r[6],A=r[7],S=i[0],P=i[1],T=i[2],R=i[3],I=i[4],x=i[5],M=i[6],k=i[7];c>=128;){for(var L=0;L<16;L++){var C=8*L+a;e[L]=n.readUint32BE(o,C),t[L]=n.readUint32BE(o,C+4)}for(L=0;L<80;L++){var N,j,D=g,U=v,B=y,F=_,K=E,H=w,G=O,$=S,V=P,z=T,W=R,q=I,Z=x,Y=M;if(h=65535&(l=k),p=l>>>16,b=65535&(u=A),m=u>>>16,h+=65535&(l=(I>>>14|E<<18)^(I>>>18|E<<14)^(E>>>9|I<<23)),p+=l>>>16,b+=65535&(u=(E>>>14|I<<18)^(E>>>18|I<<14)^(I>>>9|E<<23)),m+=u>>>16,h+=65535&(l=I&x^~I&M),p+=l>>>16,b+=65535&(u=E&w^~E&O),m+=u>>>16,u=s[2*L],h+=65535&(l=s[2*L+1]),p+=l>>>16,b+=65535&u,m+=u>>>16,u=e[L%16],p+=(l=t[L%16])>>>16,b+=65535&u,m+=u>>>16,b+=(p+=(h+=65535&l)>>>16)>>>16,h=65535&(l=f=65535&h|p<<16),p=l>>>16,b=65535&(u=d=65535&b|(m+=b>>>16)<<16),m=u>>>16,h+=65535&(l=(S>>>28|g<<4)^(g>>>2|S<<30)^(g>>>7|S<<25)),p+=l>>>16,b+=65535&(u=(g>>>28|S<<4)^(S>>>2|g<<30)^(S>>>7|g<<25)),m+=u>>>16,p+=(l=S&P^S&T^P&T)>>>16,b+=65535&(u=g&v^g&y^v&y),m+=u>>>16,N=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,j=65535&h|p<<16,h=65535&(l=W),p=l>>>16,b=65535&(u=F),m=u>>>16,p+=(l=f)>>>16,b+=65535&(u=d),m+=u>>>16,v=D,y=U,_=B,E=F=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,w=K,O=H,A=G,g=N,P=$,T=V,R=z,I=W=65535&h|p<<16,x=q,M=Z,k=Y,S=j,L%16==15)for(C=0;C<16;C++)u=e[C],h=65535&(l=t[C]),p=l>>>16,b=65535&u,m=u>>>16,u=e[(C+9)%16],h+=65535&(l=t[(C+9)%16]),p+=l>>>16,b+=65535&u,m+=u>>>16,d=e[(C+1)%16],h+=65535&(l=((f=t[(C+1)%16])>>>1|d<<31)^(f>>>8|d<<24)^(f>>>7|d<<25)),p+=l>>>16,b+=65535&(u=(d>>>1|f<<31)^(d>>>8|f<<24)^d>>>7),m+=u>>>16,d=e[(C+14)%16],p+=(l=((f=t[(C+14)%16])>>>19|d<<13)^(d>>>29|f<<3)^(f>>>6|d<<26))>>>16,b+=65535&(u=(d>>>19|f<<13)^(f>>>29|d<<3)^d>>>6),m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,e[C]=65535&b|m<<16,t[C]=65535&h|p<<16}h=65535&(l=S),p=l>>>16,b=65535&(u=g),m=u>>>16,u=r[0],p+=(l=i[0])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[0]=g=65535&b|m<<16,i[0]=S=65535&h|p<<16,h=65535&(l=P),p=l>>>16,b=65535&(u=v),m=u>>>16,u=r[1],p+=(l=i[1])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[1]=v=65535&b|m<<16,i[1]=P=65535&h|p<<16,h=65535&(l=T),p=l>>>16,b=65535&(u=y),m=u>>>16,u=r[2],p+=(l=i[2])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[2]=y=65535&b|m<<16,i[2]=T=65535&h|p<<16,h=65535&(l=R),p=l>>>16,b=65535&(u=_),m=u>>>16,u=r[3],p+=(l=i[3])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[3]=_=65535&b|m<<16,i[3]=R=65535&h|p<<16,h=65535&(l=I),p=l>>>16,b=65535&(u=E),m=u>>>16,u=r[4],p+=(l=i[4])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[4]=E=65535&b|m<<16,i[4]=I=65535&h|p<<16,h=65535&(l=x),p=l>>>16,b=65535&(u=w),m=u>>>16,u=r[5],p+=(l=i[5])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[5]=w=65535&b|m<<16,i[5]=x=65535&h|p<<16,h=65535&(l=M),p=l>>>16,b=65535&(u=O),m=u>>>16,u=r[6],p+=(l=i[6])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[6]=O=65535&b|m<<16,i[6]=M=65535&h|p<<16,h=65535&(l=k),p=l>>>16,b=65535&(u=A),m=u>>>16,u=r[7],p+=(l=i[7])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[7]=A=65535&b|m<<16,i[7]=k=65535&h|p<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},8767:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},7403:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*c+1>>>0,u=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=s*u[f]>>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,r++}for(var h=o-i;h!==o&&0===u[h];)h++;for(var p=new Uint8Array(n+(o-h)),b=n;h!==o;)p[b++]=u[h++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var d=t[i],f=0,h=c-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*l[h]>>>0,l[h]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");n=f,i++}for(var p=c-n;p!==c&&0===l[p];)p++;for(var b=a.repeat(r);p<c;++p)b+=e.charAt(l[p]);return b},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),l=0,d=c>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5553:function(e,t,r){var n;!function(){"use strict";var i,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,a=Math.floor,c="[BigNumber Error] ",u=c+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,f=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,b=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function g(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function y(e,t,r,n){if(e<t||e>r||e!==a(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var r,n,i,O,A,S,P,T,R,I,x=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),k=20,L=4,C=-7,N=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,s,c,l,h,p,b,m,g=this;if(!(g instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>D?g.c=g.e=null:e.e<j?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,h=e;h>=10;h/=10,l++);return void(l>D?g.c=g.e=null:(g.e=l,g.c=[e]))}m=String(e)}else{if(!o.test(m=String(e)))return i(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(l=m.indexOf("."))>-1&&(m=m.replace(".","")),(h=m.search(/e/i))>0?(l<0&&(l=h),l+=+m.slice(h+1),m=m.substring(0,h)):l<0&&(l=m.length)}else{if(y(t,2,H.length,"Base"),10==t&&G)return q(g=new $(e),k+g.e+1,L);if(m=String(e),p="number"==typeof e){if(0*e!=0)return i(g,m,p,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,$.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=H.slice(0,t),l=h=0,b=m.length;h<b;h++)if(r.indexOf(s=m.charAt(h))<0){if("."==s){if(h>l){l=b;continue}}else if(!c&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){c=!0,h=-1,l=0;continue}return i(g,String(e),p,t)}p=!1,(l=(m=n(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):l=m.length}for(h=0;48===m.charCodeAt(h);h++);for(b=m.length;48===m.charCodeAt(--b););if(m=m.slice(h,++b)){if(b-=h,p&&$.DEBUG&&b>15&&(e>f||e!==a(e)))throw Error(u+g.s*e);if((l=l-h-1)>D)g.c=g.e=null;else if(l<j)g.c=[g.e=0];else{if(g.e=l,g.c=[],h=(l+1)%d,l<0&&(h+=d),h<b){for(h&&g.c.push(+m.slice(0,h)),b-=d;h<b;)g.c.push(+m.slice(h,h+=d));h=d-(m=m.slice(h)).length}else h-=b;for(;h--;m+="0");g.c.push(+m)}}else g.c=[g.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=L:y(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=g(e.c),c=1==n||2==n&&(s<=C||s>=N)?E(c,s):w(c,s,"0");else if(o=(e=q(new $(e),t,r)).e,a=(c=g(e.c)).length,1==n||2==n&&(t<=o||o<=C)){for(;a<t;c+="0",a++);c=E(c,o)}else if(t-=s,c=w(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,o=new $(e[0]);i<e.length;i++)(!(n=new $(e[i])).s||(r=v(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function W(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function q(e,t,r,n){var i,o,c,u,f,p,b,m=e.c,g=h;if(m){e:{for(i=1,u=m[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=d,c=t,f=m[p=0],b=a(f/g[i-c-1]%10);else if((p=s((o+1)/d))>=m.length){if(!n)break e;for(;m.length<=p;m.push(0));f=b=0,i=1,c=(o%=d)-d+1}else{for(f=u=m[p],i=1;u>=10;u/=10,i++);b=(c=(o%=d)-d+i)<0?0:a(f/g[i-c-1]%10)}if(n=n||t<0||null!=m[p+1]||(c<0?f:f%g[i-c-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(o>0?c>0?f/g[i-c]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==o?(m.length=p,u=1,p--):(m.length=p+1,u=g[d-o],m[p]=c>0?a(f/g[i-c]%g[c])*u:0),n)for(;;){if(0==p){for(o=1,c=m[0];c>=10;c/=10,o++);for(c=m[0]+=u,u=1;c>=10;c/=10,u++);o!=u&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[p]+=u,m[p]!=l)break;m[p--]=0,u=1}for(o=m.length;0===m[--o];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=g(e.c),t=r<=C||r>=N?E(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(r=e[t],0,b,t),k=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(r=e[t],0,8,t),L=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(y(r[0],-b,0,t),y(r[1],0,b,t),C=r[0],N=r[1]):(y(r,-b,b,t),C=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)y(r[0],-b,-1,t),y(r[1],1,b,t),j=r[0],D=r[1];else{if(y(r,-b,b,t),!r)throw Error(c+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(c+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(y(r=e[t],0,b,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:k,ROUNDING_MODE:L,EXPONENTIAL_AT:[C,N],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-b&&i<=b&&i===a(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==a(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(O=9007199254740992,A=Math.random()*O&2097151?function(){return a(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,u=0,l=[],f=new $(M);if(null==e?e=k:y(e,0,b),i=s(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(o=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(l.push(o%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(o=281474976710656*(31&t[u])+1099511627776*t[u+1]+4294967296*t[u+2]+16777216*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(l.push(o%1e14),u+=7);u=i/7}if(!U)for(;u<i;)(o=A())<9e15&&(l[u++]=o%1e14);for(i=l[--u],e%=d,i&&e&&(o=h[d-e],l[u]=a(i/o)*o);0===l[u];l.pop(),u--);if(u<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=d);for(u=1,o=l[0];o>=10;o/=10,u++);u<d&&(n-=d-u)}return f.e=n,f.c=l,f}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,d,f,h,p,b,m=n.indexOf("."),v=k,y=L;for(m>=0&&(d=F,F=0,n=n.replace(".",""),h=(b=new $(i)).pow(n.length-m),F=d,b.c=t(w(g(h.c),h.e,"0"),10,o,e),b.e=b.c.length),l=d=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--d];p.pop());if(!p[0])return c.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,b,v,y,o)).c,f=h.r,l=h.e),m=p[u=l+v+1],d=o/2,f=f||u<0||null!=p[u+1],f=y<4?(null!=m||f)&&(0==y||y==(h.s<0?3:2)):m>d||m==d&&(4==y||f||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=f?w(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,f)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(m=0,n="";m<=d;n+=c.charAt(p[m++]));n=w(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%p,l=t/p|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%p)+(n=l*o+(s=e[c]/p|0)*u)%p*p+a)/r|0)+(n/p|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,c){var u,f,h,p,b,g,v,y,_,E,w,O,A,S,P,T,R,I=n.s==i.s?1:-1,x=n.c,M=i.c;if(!(x&&x[0]&&M&&M[0]))return new $(n.s&&i.s&&(x?!M||x[0]!=M[0]:M)?x&&0==x[0]||!M?0*I:I/0:NaN);for(_=(y=new $(I)).c=[],I=o+(f=n.e-i.e)+1,c||(c=l,f=m(n.e/d)-m(i.e/d),I=I/d|0),h=0;M[h]==(x[h]||0);h++);if(M[h]>(x[h]||0)&&f--,I<0)_.push(1),p=!0;else{for(S=x.length,T=M.length,h=0,I+=2,(b=a(c/(M[0]+1)))>1&&(M=e(M,b,c),x=e(x,b,c),T=M.length,S=x.length),A=T,w=(E=x.slice(0,T)).length;w<T;E[w++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=c/2&&P++;do{if(b=0,(u=t(M,E,T,w))<0){if(O=E[0],T!=w&&(O=O*c+(E[1]||0)),(b=a(O/P))>1)for(b>=c&&(b=c-1),v=(g=e(M,b,c)).length,w=E.length;1==t(g,E,v,w);)b--,r(g,T<v?R:M,v,c),v=g.length,u=1;else 0==b&&(u=b=1),v=(g=M.slice()).length;if(v<w&&(g=[0].concat(g)),r(E,g,w,c),w=E.length,-1==u)for(;t(M,E,T,w)<1;)b++,r(E,T<w?R:M,w,c),w=E.length}else 0===u&&(b++,E=[0]);_[h++]=b,E[0]?E[w++]=x[A]||0:(E=[x[A]],w=1)}while((A++<S||null!=E[0])&&I--);p=null!=E[0],_[0]||_.splice(0,1)}if(c==l){for(h=1,I=_[0];I>=10;I/=10,h++);q(y,o+(y.e=h+f*d-1)+1,s,p)}else y.e=f,y.r=+p;return y}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(I,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(S,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},x.absoluteValue=x.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return v(this,new $(e,t))},x.decimalPlaces=x.dp=function(e,t){var r,n,i,o=this;if(null!=e)return y(e,0,b),null==t?t=L:y(t,0,8),q(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-m(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},x.dividedBy=x.div=function(e,t){return r(this,new $(e,t),k,L)},x.dividedToIntegerBy=x.idiv=function(e,t){return r(this,new $(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var r,n,i,o,u,l,f,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),u=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),u?e.s*(2-_(e)):+Z(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||u&&p.c[1]>=24e7:p.c[0]<8e13||u&&p.c[0]<=9999975e7)))return o=p.s<0&&_(e)?-0:0,p.e>-1&&(o=1/o),new $(l?1/o:o);F&&(o=s(F/d+2))}for(u?(r=new $(.5),l&&(e.s=1),f=_(e)):f=(i=Math.abs(+Z(e)))%2,h=new $(M);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=a(i/2)))break;f=i%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=_(e);else{if(0===(i=+Z(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(l&&(h=M.div(h)),t?h.mod(t):o?q(h,F,L,undefined):h)},x.integerValue=function(e){var t=new $(this);return null==e?e=L:y(e,0,8),q(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===v(this,new $(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return v(this,new $(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=v(this,new $(e,t)))||0===t},x.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return v(this,new $(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=v(this,new $(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var c=s.e/d,u=e.e/d,f=s.c,h=e.c;if(!c||!u){if(!f||!h)return f?(e.s=-t,e):new $(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new $(f[0]?s:3==L?-0:0)}if(c=m(c),u=m(u),f=f.slice(),a=c-u){for((o=a<0)?(a=-a,i=f):(u=c,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--u);return f[0]?W(e,f,u):(e.s=3==L?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},x.multipliedBy=x.times=function(e,t){var r,n,i,o,s,a,c,u,f,h,b,g,v,y,_,E=this,w=E.c,O=(e=new $(e,t)).c;if(!(w&&O&&w[0]&&O[0]))return!E.s||!e.s||w&&!w[0]&&!O||O&&!O[0]&&!w?e.c=e.e=e.s=null:(e.s*=E.s,w&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(E.e/d)+m(e.e/d),e.s*=E.s,(c=w.length)<(h=O.length)&&(v=w,w=O,O=v,i=c,c=h,h=i),i=c+h,v=[];i--;v.push(0));for(y=l,_=p,i=h;--i>=0;){for(r=0,b=O[i]%_,g=O[i]/_|0,o=i+(s=c);o>i;)r=((u=b*(u=w[--s]%_)+(a=g*u+(f=w[s]/_|0)*b)%_*_+v[o]+r)/y|0)+(a/_|0)+g*f,v[o--]=u%y;v[o]=r}return r?++n:v.splice(0,1),W(e,v,n)},x.negated=function(){var e=new $(this);return e.s=-e.s||null,e},x.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,s=e.e/d,a=n.c,c=e.c;if(!o||!s){if(!a||!c)return new $(i/0);if(!a[0]||!c[0])return c[0]?e:new $(a[0]?n:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/l|0,a[t]=l===a[t]?0:a[t]%l;return i&&(a=[i].concat(a),++s),W(e,a,s)},x.precision=x.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return y(e,1,b),null==t?t=L:y(t,0,8),q(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},x.shiftedBy=function(e){return y(e,-9007199254740991,f),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=k+4,d=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=g(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=m((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=d.times(o.plus(r(s,o,l,1))),g(o.c).slice(0,c)===(t=g(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,n.e+k+2,1),e=!n.times(n).eq(s));break}if(!i&&(q(o,o.e+k+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return q(n,n.e+k+1,L,e)},x.toExponential=function(e,t){return null!=e&&(y(e,0,b),e++),V(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(y(e,0,b),e=e+this.e+1),V(this,e,t)},x.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",d=s[0],f=s[1],h=i.s<0,p=h?d.slice(1):d,b=p.length;if(u&&(o=a,a=u,u=o,b-=o),a>0&&b>0){for(o=b%a||a,d=p.substr(0,o);o<b;o+=a)d+=l+p.substr(o,a);u>0&&(d+=l+p.slice(o)),h&&(d="-"+d)}n=f?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):d}return(r.prefix||"")+n+(r.suffix||"")},x.toFraction=function(e){var t,n,i,o,s,a,u,l,f,p,b,m,v=this,y=v.c;if(null!=e&&(!(u=new $(e)).isInteger()&&(u.c||1!==u.s)||u.lt(M)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Z(u));if(!y)return new $(v);for(t=new $(M),f=n=new $(M),i=l=new $(M),m=g(y),s=t.e=m.length-v.e-1,t.c[0]=h[(a=s%d)<0?d+a:a],e=!e||u.comparedTo(t)>0?s>0?t:f:u,a=D,D=1/0,u=new $(m),l.c[0]=0;p=r(u,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,f=l.plus(p.times(o=f)),l=o,t=u.minus(p.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=v.s,b=r(f,i,s*=2,L).minus(v).abs().comparedTo(r(l,n,s,L).minus(v).abs())<1?[f,i]:[l,n],D=a,b},x.toNumber=function(){return+Z(this)},x.toPrecision=function(e,t){return null!=e&&y(e,1,b),V(this,e,t,2)},x.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=C||o>=N?E(g(r.c),o):w(g(r.c),o,"0"):10===e&&G?t=w(g((r=q(new $(r),k+o+1,L)).c),r.e,"0"):(y(e,2,H.length,"Base"),t=n(w(g(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return Z(this)},x._isBigNumber=!0,null!=t&&$.set(t),$}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},1049:(e,t,r)=>{const n=r(2694);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,s,a){const c=d[s],u=d[s+1],f=d[a],h=d[a+1];i(l,e,t),o(l,e,c,u);let p=l[n]^l[e],b=l[n+1]^l[e+1];l[n]=b,l[n+1]=p,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=p>>>24^b<<8,l[t+1]=b>>>24^p<<8,i(l,e,t),o(l,e,f,h),p=l[n]^l[e],b=l[n+1]^l[e+1],l[n]=p>>>16^b<<16,l[n+1]=b>>>16^p<<16,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=b>>>31^p<<1,l[t+1]=p>>>31^b<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),d=new Uint32Array(32);function f(e,t){let r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=c[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)d[r]=s(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}const h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};h.fill(0),h[0]=e,t&&(h[1]=t.length),h[2]=1,h[3]=1,r&&h.set(r,32),n&&h.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^s(h,4*e);return t&&(b(i,t),i.c=128),i}function b(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;f(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function g(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));const s=p(r,t,i,o);return b(s,e),m(s)}e.exports={blake2b:g,blake2bHex:function(e,t,r,i,o){const s=g(e,t,r,i,o);return n.toHex(s)},blake2bInit:p,blake2bUpdate:b,blake2bFinal:m}},4202:(e,t,r)=>{const n=r(2694);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,i,o){u[e]=u[e]+u[t]+i,u[n]=s(u[n]^u[e],16),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],12),u[e]=u[e]+u[t]+o,u[n]=s(u[n]^u[e],8),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],7)}function s(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function d(e,t){let r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)o(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),o(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),o(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),o(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),o(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),o(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),o(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),o(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function f(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function b(e,t,r){r=r||32,e=n.normalizeInput(e);const i=f(r,t);return h(i,e),p(i)}e.exports={blake2s:b,blake2sHex:function(e,t,r){const i=b(e,t,r);return n.toHex(i)},blake2sInit:f,blake2sUpdate:h,blake2sFinal:p}},9620:(e,t,r)=>{const n=r(1049),i=r(4202);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},2694:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase(),i+=" ",i+=t(r[o+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[o+1]).toUpperCase(),i+=t(r[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const o=(new Date).getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){const r=e(i),o=(new Date).getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}}},2823:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8379).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:l[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,b=h>>>13,m=0|s[2],g=8191&m,v=m>>>13,y=0|s[3],_=8191&y,E=y>>>13,w=0|s[4],O=8191&w,A=w>>>13,S=0|s[5],P=8191&S,T=S>>>13,R=0|s[6],I=8191&R,x=R>>>13,M=0|s[7],k=8191&M,L=M>>>13,C=0|s[8],N=8191&C,j=C>>>13,D=0|s[9],U=8191&D,B=D>>>13,F=0|a[0],K=8191&F,H=F>>>13,G=0|a[1],$=8191&G,V=G>>>13,z=0|a[2],W=8191&z,q=z>>>13,Z=0|a[3],Y=8191&Z,J=Z>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(d,K))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,K)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,H))+Math.imul(b,K)|0,o=Math.imul(b,H);var ge=(u+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,$)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,H))+Math.imul(v,K)|0,o=Math.imul(v,H),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,V)|0;var ve=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,W)|0))<<13)|0;u=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,K),i=(i=Math.imul(_,H))+Math.imul(E,K)|0,o=Math.imul(E,H),n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,q)|0;var ye=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,H))+Math.imul(A,K)|0,o=Math.imul(A,H),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0;var _e=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,H))+Math.imul(T,K)|0,o=Math.imul(T,H),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var Ee=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,H))+Math.imul(x,K)|0,o=Math.imul(x,H),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var we=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,K),i=(i=Math.imul(k,H))+Math.imul(L,K)|0,o=Math.imul(L,H),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0;var Oe=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,K),i=(i=Math.imul(N,H))+Math.imul(j,K)|0,o=Math.imul(j,H),n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Ae=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,H))+Math.imul(B,K)|0,o=Math.imul(B,H),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Se=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,V))+Math.imul(B,$)|0,o=Math.imul(B,V),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Pe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,fe)|0;var Te=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(B,Y)|0,o=Math.imul(B,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,fe)|0;var Re=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(P,de)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,fe)|0;var Ie=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(B,re)|0,o=Math.imul(B,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,se)|0,n=n+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var xe=(u+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(B,oe)|0,o=Math.imul(B,se),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(j,ce)|0,o=o+Math.imul(j,ue)|0,n=n+Math.imul(k,de)|0,i=(i=i+Math.imul(k,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Me=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(B,ce)|0,o=Math.imul(B,ue),n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(j,de)|0,o=o+Math.imul(j,fe)|0;var ke=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,de),i=(i=Math.imul(U,fe))+Math.imul(B,de)|0,o=Math.imul(B,fe);var Le=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ce=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,be))+Math.imul(B,pe)|0))<<13)|0;return u=((o=Math.imul(B,be))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=Ee,c[6]=we,c[7]=Oe,c[8]=Ae,c[9]=Se,c[10]=Pe,c[11]=Te,c[12]=Re,c[13]=Ie,c[14]=xe,c[15]=Me,c[16]=ke,c[17]=Le,c[18]=Ce,0!==u&&(c[19]=u,r.length++),r};function b(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):b(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=c,f=u,h=0;h<s;h++){var p=r[l+h],b=n[l+h],m=r[l+h+s],g=n[l+h+s],v=d*m-f*g;g=d*g+f*m,m=v,r[l+h]=p+m,n[l+h]=b+g,r[l+h+s]=p-m,n[l+h+s]=b-g,h!==a&&(v=c*d-u*f,f=c*f+u*d,d=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;!(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;!(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;!(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;!(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(E,v),i(w,v),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var b=h,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var g=this.pow(d,new o(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},O.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},O.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},i(A,O),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7048:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3553);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},9216:(e,t,r)=>{const n=r(7403);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},7639:(e,t,r)=>{"use strict";var n=r(9216);e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),i=e(r),o=r.length+4,s=new Uint8Array(o);return s.set(r,0),s.set(i.subarray(0,4),r.length),n.encode(s,o)},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},9848:(e,t,r)=>{"use strict";var{sha256:n}=r(9688),i=r(7639);e.exports=i((function(e){return n(n(e))}))},3360:(e,t,r)=>{"use strict";var n=t;n.version=r(183).rE,n.utils=r(1874),n.rand=r(7048),n.curve=r(7131),n.curves=r(6443),n.ec=r(5064),n.eddsa=r(4807)},5174:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874),o=i.getNAF,s=i.getJSF,a=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,c,u=[];for(s=0;s<n.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+n[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=i;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?f=f.mixedAdd(r.points[s]):c===-h&&(f=f.mixedAdd(r.points[s].neg()));d=d.add(f)}return d.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=s[u];a(0!==d),c="affine"===e.type?d>0?c.mixedAdd(i[d-1>>1]):c.mixedAdd(i[-d-1>>1].neg()):d>0?c.add(i[d-1>>1]):c.add(i[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,d[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,m=a;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=s(r[b],r[m]);for(h=Math.max(y[0].length,h),f[b]=new Array(h),f[m]=new Array(h),c=0;c<h;c++){var _=0|y[0][c],E=0|y[1][c];f[b][c]=v[3*(_+1)+(E+1)],f[m][c]=0,d[b]=g}}else f[b]=o(r[b],l[b],this._bitLength),f[m]=o(r[m],l[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var w=this.jpoint(null,null,null),O=this._wnafT4;for(a=h;a>=0;a--){for(var A=0;a>=0;){var S=!0;for(c=0;c<n;c++)O[c]=0|f[c][a],0!==O[c]&&(S=!1);if(!S)break;A++,a--}if(a>=0&&A++,w=w.dblp(A),a<0)break;for(c=0;c<n;c++){var P=O[c];0!==P&&(P>0?u=d[c][P-1>>1]:P<0&&(u=d[c][-P-1>>1].neg()),w="affine"===u.type?w.mixedAdd(u):w.add(u))}}for(a=0;a<n;a++)d[a]=null;return i?w:w.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1547:(e,t,r)=>{"use strict";var n=r(1874),i=r(2823),o=r(5615),s=r(5174),a=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,l)},u.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),d=o.redMul(c),f=s.redMul(a);return this.curve.point(u,l,f,d)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},7131:(e,t,r)=>{"use strict";var n=t;n.base=r(5174),n.short=r(277),n.mont=r(3245),n.edwards=r(1547)},3245:(e,t,r)=>{"use strict";var n=r(2823),i=r(5615),o=r(5174),s=r(1874);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},277:(e,t,r)=>{"use strict";var n=r(1874),i=r(2823),o=r(5615),s=r(5174),a=n.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),l=m.sub(y.mul(p));var _=g.sub(y.mul(b));if(!n&&u.cmp(d)<0)t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++v)break;c=u,h=f,f=u,m=p,p=l,g=b,b=_}s=u.neg(),a=l;var E=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(E)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var v=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=b,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},6443:(e,t,r)=>{"use strict";var n,i=t,o=r(9499),s=r(7131),a=r(1874).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(3986)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},5064:(e,t,r)=>{"use strict";var n=r(2823),i=r(4742),o=r(1874),s=r(6443),a=r(7048),c=o.assert,u=r(7531),l=r(7782);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new u(this,e)},d.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},d.prototype._truncateToN=function(e,t,r){var i;if(n.isBN(e)||"number"==typeof e)i=(e=new n(e,16)).byteLength();else if("object"==typeof e)i=e.length,e=new n(e,16);else{var o=e.toString();i=o.length+1>>>1,e=new n(o,16)}"number"!=typeof r&&(r=8*i);var s=r-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){if("object"==typeof r&&(o=r,r=null),o||(o={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){c("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),c(e.length>>>0===e.length);for(var s=0;s<e.length;s++)c((255&e[s])===e[s])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,o.msgBitLength),c(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),u=t.getPrivate().toArray("be",a),d=e.toArray("be",a);c(new n(d).eq(e),"Can not sign message");for(var f=new i({hash:this.hash,entropy:u,nonce:d,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),p=0;;p++){var b=o.k?o.k(p):new n(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=b.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var _=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),_^=1),new l({r:v,s:y,recoveryParam:_})}}}}}},d.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),d=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,d=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),b=u.mul(h).umod(o);return this.g.mulAdd(p,a,b)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},7531:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},7782:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;if(128&e[r.place])return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;if(128&e[r.place])return!1;var d=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(u),this.s=new n(d),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},4807:(e,t,r)=>{"use strict";var n=r(9499),i=r(6443),o=r(1874),s=o.assert,a=o.parseBytes,c=r(4672),u=r(8401);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(e,t,r){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},4672:(e,t,r)=>{"use strict";var n=r(1874),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},8401:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(o(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},3986:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},1874:(e,t,r)=>{"use strict";var n=t,i=r(2823),o=r(7784),s=r(9042);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,s=e.clone();for(n=0;n<i.length;n++){var a,c=s.andln(o-1);s.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,s.isubn(a)):a=0,i[n]=a,s.iushrn(1)}return i},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c:0,r[0].push(s),a=1&u?3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u:0,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},6075:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,c=Object.keys(t).sort(i&&i(t));for(s="",r=0;r<c.length;r++){var u=c[r],l=e(t[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return o.splice(a,1),"{"+s+"}"}}(e)}},9499:(e,t,r)=>{var n=t;n.utils=r(461),n.common=r(2191),n.sha=r(5746),n.ripemd=r(4169),n.hmac=r(1825),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},2191:(e,t,r)=>{"use strict";var n=r(461),i=r(7784);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},1825:(e,t,r)=>{"use strict";var n=r(461),i=r(7784);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},4169:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function f(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],v=r,y=n,_=i,E=u,w=l,O=0;O<80;O++){var A=s(o(c(r,d(O,n,i,u),e[p[O]+t],f(O)),m[O]),l);r=l,l=u,u=o(i,10),i=n,n=A,A=s(o(c(v,d(79-O,y,_,E),e[b[O]+t],h(O)),g[O]),w),v=w,w=E,E=o(_,10),_=y,y=A}A=a(this.h[1],i,E),this.h[1]=a(this.h[2],u,w),this.h[2]=a(this.h[3],l,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],n,_),this.h[0]=A},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5746:(e,t,r)=>{"use strict";t.sha1=r(2986),t.sha224=r(5393),t.sha256=r(536),t.sha384=r(2348),t.sha512=r(2157)},2986:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=r(600),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,l),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],f=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=c(s(i,5),u(p,o,l,f),h,r[n],d[p]);h=f,f=l,l=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],h)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5393:(e,t,r)=>{"use strict";var n=r(461),i=r(536);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},536:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=r(600),s=r(7784),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,d=o.maj32,f=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],_=this.h[6],E=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var w=u(E,h(v),l(v,y,_),this.k[n],r[n]),O=a(f(i),d(i,o,m));E=_,_=y,y=v,v=a(g,w),g=m,m=o,o=i,i=a(w,O)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],E)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},2348:(e,t,r)=>{"use strict";var n=r(461),i=r(2157);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},2157:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=r(7784),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,d=n.sum64_hi,f=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function E(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function w(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function O(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(y,g),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=x(r[n-4],r[n-3]),o=M(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=R(r[n-30],r[n-29]),u=I(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=h(i,o,s,a,c,u,l,d),r[n+1]=p(i,o,s,a,c,u,l,d)}},y.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],p=this.h[7],g=this.h[8],v=this.h[9],y=this.h[10],R=this.h[11],I=this.h[12],x=this.h[13],M=this.h[14],k=this.h[15];o(this.k.length===r.length);for(var L=0;L<r.length;L+=2){var C=M,N=k,j=P(g,v),D=T(g,v),U=_(g,v,y,R,I),B=E(g,v,y,R,I,x),F=this.k[L],K=this.k[L+1],H=r[L],G=r[L+1],$=b(C,N,j,D,U,B,F,K,H,G),V=m(C,N,j,D,U,B,F,K,H,G);C=A(n,i),N=S(n,i),j=w(n,i,s,a,c),D=O(n,i,s,a,c,u);var z=d(C,N,j,D),W=f(C,N,j,D);M=I,k=x,I=y,x=R,y=g,R=v,g=d(h,p,$,V),v=f(p,p,$,V),h=c,p=u,c=s,u=a,s=n,a=i,n=d($,V,z,W),i=f($,V,z,W)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,c,u),l(this.h,6,h,p),l(this.h,8,g,v),l(this.h,10,y,R),l(this.h,12,I,x),l(this.h,14,M,k)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},600:(e,t,r)=>{"use strict";var n=r(461).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},461:(e,t,r)=>{"use strict";var n=r(7784),i=r(5615);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=c(i.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+i+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},4742:(e,t,r)=>{"use strict";var n=r(9499),i=r(9042),o=r(7784);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},9318:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*b}},5615:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7784:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},9042:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},8813:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(4662);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(8918);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(3327);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var c=r(3110);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return c.animationFrames}});var u=r(2483);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return u.Subject}});var l=r(1637);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var d=r(1242);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return d.ReplaySubject}});var f=r(95);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return f.AsyncSubject}});var h=r(3692);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return h.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return h.asapScheduler}});var p=r(7961);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var b=r(2886);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return b.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return b.queueScheduler}});var m=r(3862);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(182);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var v=r(8986);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return v.Scheduler}});var y=r(8014);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return y.Subscription}});var _=r(5);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var E=r(7800);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return E.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return E.NotificationKind}});var w=r(2706);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return w.pipe}});var O=r(1342);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return O.noop}});var A=r(6640);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return A.identity}});var S=r(1751);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return S.isObservable}});var P=r(6894);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return P.lastValueFrom}});var T=r(9060);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var R=r(7057);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return R.ArgumentOutOfRangeError}});var I=r(5204);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return I.EmptyError}});var x=r(1759);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return x.NotFoundError}});var M=r(9686);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return M.ObjectUnsubscribedError}});var k=r(1505);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return k.SequenceError}});var L=r(1554);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return L.TimeoutError}});var C=r(5788);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return C.UnsubscriptionError}});var N=r(2713);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return N.bindCallback}});var j=r(8561);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return j.bindNodeCallback}});var D=r(3247);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return D.combineLatest}});var U=r(3865);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return U.concat}});var B=r(7579);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return B.connectable}});var F=r(9353);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return F.defer}});var K=r(8616);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return K.empty}});var H=r(9105);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return H.forkJoin}});var G=r(4917);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return G.from}});var $=r(5337);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return $.fromEvent}});var V=r(347);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return V.fromEventPattern}});var z=r(7610);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return z.generate}});var W=r(4209);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return W.iif}});var q=r(6472);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return q.interval}});var Z=r(2833);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Z.merge}});var Y=r(8655);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return Y.never}});var J=r(1004);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var X=r(6102);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return X.onErrorResumeNext}});var Q=r(7740);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(1699);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(5584);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(9376);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(1103);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(4092);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(7853);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(7286);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(1656);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ce=r(8616);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ce.EMPTY}});var ue=r(8655);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ue.NEVER}}),i(r(6038),t);var le=r(3413);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var de=r(3146);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return de.audit}});var fe=r(3231);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return fe.auditTime}});var he=r(8015);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return he.buffer}});var pe=r(5572);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var be=r(7210);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return be.bufferTime}});var me=r(8995);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(8831);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ve=r(8118);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ve.catchError}});var ye=r(6625);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return ye.combineAll}});var _e=r(6728);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var Ee=r(8239);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return Ee.combineLatestWith}});var we=r(8158);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return we.concatAll}});var Oe=r(9135);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Oe.concatMap}});var Ae=r(9938);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Ae.concatMapTo}});var Se=r(9669);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Se.concatWith}});var Pe=r(1483);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Pe.connect}});var Te=r(1038);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return Te.count}});var Re=r(6842);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Re.debounce}});var Ie=r(8079);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Ie.debounceTime}});var xe=r(378);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return xe.defaultIfEmpty}});var Me=r(914);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Me.delay}});var ke=r(8766);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return ke.delayWhen}});var Le=r(7441);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return Le.dematerialize}});var Ce=r(5365);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ce.distinct}});var Ne=r(8937);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return Ne.distinctUntilChanged}});var je=r(9612);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return je.distinctUntilKeyChanged}});var De=r(4520);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return De.elementAt}});var Ue=r(1776);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Ue.endWith}});var Be=r(5510);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Be.every}});var Fe=r(1551);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Fe.exhaust}});var Ke=r(2752);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return Ke.exhaustAll}});var He=r(4753);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return He.exhaustMap}});var Ge=r(7661);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return Ge.expand}});var $e=r(783);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return $e.filter}});var Ve=r(3555);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return Ve.finalize}});var ze=r(7714);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return ze.find}});var We=r(9756);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return We.findIndex}});var qe=r(8275);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return qe.first}});var Ze=r(7815);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ze.groupBy}});var Ye=r(490);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Ye.ignoreElements}});var Je=r(9356);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Xe=r(8669);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Xe.last}});var Qe=r(5471);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(3218);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(2360);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(1415);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(7302);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(6902);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(983);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(6586);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(4408);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ct=r(8253);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ct.mergeWith}});var ut=r(2669);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ut.min}});var lt=r(9247);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var dt=r(5184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return dt.observeOn}});var ft=r(1226);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ft.onErrorResumeNextWith}});var ht=r(1518);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ht.pairwise}});var pt=r(4912);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var bt=r(766);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return bt.publish}});var mt=r(7220);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(6106);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var vt=r(8157);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return vt.publishReplay}});var yt=r(5600);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return yt.raceWith}});var _t=r(9139);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var Et=r(8522);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return Et.repeat}});var wt=r(6566);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return wt.repeatWhen}});var Ot=r(7835);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Ot.retry}});var At=r(9843);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return At.retryWhen}});var St=r(7561);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return St.refCount}});var Pt=r(1731);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Pt.sample}});var Tt=r(6086);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Tt.sampleTime}});var Rt=r(8624);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Rt.scan}});var It=r(582);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return It.sequenceEqual}});var xt=r(8977);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return xt.share}});var Mt=r(3133);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Mt.shareReplay}});var kt=r(3001);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return kt.single}});var Lt=r(3982);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Lt.skip}});var Ct=r(9098);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Ct.skipLast}});var Nt=r(7372);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Nt.skipUntil}});var jt=r(4721);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return jt.skipWhile}});var Dt=r(269);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Dt.startWith}});var Ut=r(8960);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ut.subscribeOn}});var Bt=r(8774);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Bt.switchAll}});var Ft=r(3879);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Ft.switchMap}});var Kt=r(3274);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Kt.switchMapTo}});var Ht=r(8712);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ht.switchScan}});var Gt=r(846);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Gt.take}});var $t=r(8330);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return $t.takeLast}});var Vt=r(4780);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Vt.takeUntil}});var zt=r(2129);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return zt.takeWhile}});var Wt=r(3964);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return Wt.tap}});var qt=r(8941);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return qt.throttle}});var Zt=r(7640);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Zt.throttleTime}});var Yt=r(4869);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Yt.throwIfEmpty}});var Jt=r(489);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Xt=r(1554);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Xt.timeout}});var Qt=r(4862);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(6505);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(2343);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(5477);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(6746);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(8208);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(6637);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(1141);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(5442);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var cr=r(187);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return cr.zipAll}});var ur=r(8538);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return ur.zipWith}})},95:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(2483).Subject);t.AsyncSubject=o},1637:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(2483).Subject);t.BehaviorSubject=o},7800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n=r(8616),i=r(1004),o=r(1103),s=r(1018);!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(t.NotificationKind||(t.NotificationKind={}));var a=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return s.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,s=e.error,a="N"===t?i.of(r):"E"===t?o.throwError((function(){return s})):"C"===t?n.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=a,t.observeNotification=c},9052:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},4662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(5),i=r(8014),o=r(3327),s=r(2706),a=r(3413),c=r(1018),u=r(9223),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&c.isFunction(e.next)&&c.isFunction(e.error)&&c.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return u.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=d(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=d(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function d(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},1242:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(2483),s=r(9568),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},8986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(9568),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},2483:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(4662),a=r(8014),c=r(9686),u=r(7479),l=r(9223),d=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new c.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next()){s.value.next(e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,u.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(s.Observable);t.Subject=d;var f=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(d);t.AnonymousSubject=f},5:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(1018),s=r(8014),a=r(3413),c=r(7315),u=r(1342),l=r(9052),d=r(9155),f=r(9223),h=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?y(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?y(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?y(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=h;var p=Function.prototype.bind;function b(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){v(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){v(e)}else v(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){v(e)}},e}(),g=function(e){function t(t,r,n){var i,s,c=e.call(this)||this;o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:c&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return c.unsubscribe()},i={next:t.next&&b(t.next,s),error:t.error&&b(t.error,s),complete:t.complete&&b(t.complete,s)}):i=t;return c.destination=new m(i),c}return i(t,e),t}(h);function v(e){a.config.useDeprecatedSynchronousErrorHandling?f.captureError(e):c.reportUnhandledError(e)}function y(e,t){var r=a.config.onStoppedNotification;r&&d.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:u.noop,error:function(e){throw e},complete:u.noop}},8014:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(1018),a=r(5788),c=r(7479),u=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,c,u;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=n(d),h=f.next();!h.done;h=f.next()){h.value.remove(this)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else d.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){u=e instanceof a.UnsubscriptionError?e.errors:[e]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var m=n(b),g=m.next();!g.done;g=m.next()){var v=g.value;try{l(v)}catch(e){u=null!=u?u:[],e instanceof a.UnsubscriptionError?u=o(o([],i(u)),i(e.errors)):u.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(c=m.return)&&c.call(m)}finally{if(r)throw r.error}}}if(u)throw new a.UnsubscriptionError(u)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&c.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&c.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=u,t.EMPTY_SUBSCRIPTION=u.EMPTY,t.isSubscription=function(e){return e instanceof u||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3413:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},9060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(5204),i=r(5);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},6894:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(5204);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},8918:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(4662),s=r(8014),a=r(7561),c=r(3111),u=r(7843),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,u.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(c.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},2713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(1439);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},1439:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(8613),s=r(4662),a=r(8960),c=r(1251),u=r(5184),l=r(95);t.bindCallbackInternals=function e(t,r,d,f){if(d){if(!o.isScheduler(d))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,f).apply(this,n).pipe(c.mapOneOrManyArgs(d))};f=d}return f?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(f),u.observeOn(f))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var c=new l.AsyncSubject,u=!0;return new s.Observable((function(s){var a=c.subscribe(s);if(u){u=!1;var l=!1,d=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void c.error(n)}c.next(1<e.length?e:e[0]),d=!0,l&&c.complete()}])),d&&c.complete(),l=!0}return a}))}}},8561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(1439);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},3247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(4662),i=r(7360),o=r(4917),s=r(6640),a=r(1251),c=r(1107),u=r(6013),l=r(3111),d=r(7110);function f(e,t,r){return void 0===r&&(r=s.identity),function(n){h(t,(function(){for(var i=e.length,s=new Array(i),a=i,c=i,u=function(i){h(t,(function(){var u=o.from(e[i],t),d=!1;u.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,d||(d=!0,c--),c||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},d=0;d<i;d++)u(d)}),n)}}function h(e,t,r){e?d.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popResultSelector(e),d=i.argsArgArrayOrObject(e),h=d.args,p=d.keys;if(0===h.length)return o.from([],r);var b=new n.Observable(f(h,r,p?function(e){return u.createObject(p,e)}:s.identity));return l?b.pipe(a.mapOneOrManyArgs(l)):b},t.combineLatestInit=f},3865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(8158),i=r(1107),o=r(4917);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},7579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(2483),i=r(4662),o=r(9353),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,c=void 0===a||a,u=n(),l=new i.Observable((function(e){return u.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(u),c&&r.add((function(){return u=n()}))),r},l}},9353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(4662),i=r(9445);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},3110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(4662),i=r(4746),o=r(9507);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},8616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(4662);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},9105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(4662),i=r(7360),o=r(9445),s=r(1107),a=r(3111),c=r(1251),u=r(6013);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),d=l.args,f=l.keys,h=new n.Observable((function(e){var t=d.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(d[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(f?u.createObject(f,r):r),e.complete())})))},c=0;c<t;c++)s(c);else e.complete()}));return r?h.pipe(c.mapOneOrManyArgs(r)):h}},4917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(1656),i=r(9445);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},5337:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(9445),o=r(4662),s=r(983),a=r(8046),c=r(1018),u=r(1251),l=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function h(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,b){if(c.isFunction(p)&&(b=p,p=void 0),b)return e(t,r,p).pipe(u.mapOneOrManyArgs(b));var m=n(function(e){return c.isFunction(e.addEventListener)&&c.isFunction(e.removeEventListener)}(t)?d.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return c.isFunction(e.addListener)&&c.isFunction(e.removeListener)}(t)?l.map(h(t,r)):function(e){return c.isFunction(e.on)&&c.isFunction(e.off)}(t)?f.map(h(t,r)):[],2),g=m[0],v=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return v(t)}}))}},347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(4662),i=r(1018),o=r(1251);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},6824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(4662);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},7610:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(6640),o=r(8613),s=r(9353),a=r(8808);t.generate=function(e,t,r,c,u){var l,d,f,h;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=h,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,f(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(h=(l=e).initialState,t=l.condition,r=l.iterate,d=l.resultSelector,f=void 0===d?i.identity:d,u=l.scheduler):(h=e,!c||o.isScheduler(c)?(f=i.identity,u=c):f=c),s.defer(u?function(){return a.scheduleIterable(p(),u)}:p)}},4209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(9353);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},9445:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(8046),c=r(7629),u=r(4662),l=r(1116),d=r(1358),f=r(7614),h=r(6368),p=r(9137),b=r(1018),m=r(7315),g=r(3327);function v(e){return new u.Observable((function(t){var r=e[g.observable]();if(b.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function y(e){return new u.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new u.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function E(e){return new u.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function w(e){return new u.Observable((function(t){(function(e,t){var r,s,a,c;return n(this,void 0,void 0,(function(){var n,u;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=i.sent(),a={error:u},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(c=r.return)?[4,c.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function O(e){return w(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof u.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return v(e);if(a.isArrayLike(e))return y(e);if(c.isPromise(e))return _(e);if(d.isAsyncIterable(e))return w(e);if(h.isIterable(e))return E(e);if(p.isReadableStreamLike(e))return O(e)}throw f.createInvalidObservableTypeError(e)},t.fromInteropObservable=v,t.fromArrayLike=y,t.fromPromise=_,t.fromIterable=E,t.fromAsyncIterable=w,t.fromReadableStreamLike=O},6472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(7961),i=r(4092);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},2833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(7302),i=r(9445),o=r(8616),s=r(1107),a=r(4917);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),c=s.popNumber(e,1/0),u=e;return u.length?1===u.length?i.innerFrom(u[0]):n.mergeAll(c)(a.from(u,r)):o.EMPTY}},8655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(4662),i=r(1342);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},1004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(1107),i=r(4917);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},6102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(4662),i=r(8535),o=r(3111),s=r(1342),a=r(9445);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var c=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(c),c.add(n)}else e.complete()};n()}))}},7740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(4917);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},1699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(245),i=r(783),o=r(9445);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},5584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(4662),i=r(9445),o=r(8535),s=r(3111);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},9376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(4662),i=r(8616);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},1103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(4662),i=r(1018);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},4092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(4662),i=r(7961),o=r(8613),s=r(1074);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},7853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(4662),i=r(9445),o=r(8616);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},7286:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(4662),s=r(9445),a=r(8535),c=r(8616),u=r(3111),l=r(1107);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),d=a.argsOrArgArray(e);return d.length?new o.Observable((function(e){var t=d.map((function(){return[]})),o=d.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(d[a]).subscribe(u.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var c=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(c))):c),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},c=0;!e.closed&&c<d.length;c++)a(c);return function(){t=o=null}})):c.EMPTY}},3111:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(5);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},3146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(7843),i=r(9445),o=r(3111);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,c=!1,u=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}c&&r.complete()},l=function(){a=null,c&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,u,l))}),(function(){c=!0,(!n||!a||a.closed)&&r.complete()})))}))}},3231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(7961),i=r(3146),o=r(4092);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},8015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(7843),i=r(1342),o=r(3111),s=r(9445);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},5572:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(7843),o=r(3111),s=r(7479);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],c=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,u,l,d,f=null;c++%t==0&&a.push([]);try{for(var h=n(a),p=h.next();!p.done;p=h.next()){(g=p.value).push(r),e<=g.length&&(f=null!=f?f:[]).push(g)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(o)throw o.error}}if(f)try{for(var b=n(f),m=b.next();!m.done;m=b.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(d=b.return)&&d.call(b)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7210:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(8014),o=r(7843),s=r(3111),a=r(7479),c=r(7961),u=r(1107),l=r(7110);t.bufferTime=function(e){for(var t,r,d=[],f=1;f<arguments.length;f++)d[f-1]=arguments[f];var h=null!==(t=u.popScheduler(d))&&void 0!==t?t:c.asyncScheduler,p=null!==(r=d[0])&&void 0!==r?r:null,b=d[1]||1/0;return o.operate((function(t,r){var o=[],c=!1,u=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),c&&d()},d=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,h,(function(){return u(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,d,p,!0):c=!0,d();var f=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var c=a.value,l=c.buffer;l.push(e),b<=l.length&&u(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==f||f.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(f)}))}},8995:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(8014),o=r(7843),s=r(9445),a=r(3111),c=r(1342),u=r(7479);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){u.arrRemove(l,r),o.next(r),n.unsubscribe()}),c.noop)))}),c.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next()){o.value.push(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},8831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(7843),i=r(1342),o=r(3111),s=r(9445);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,c=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,c,i.noop))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},8118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(9445),i=r(3111),o=r(7843);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,c=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):c=!0}))),c&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},6625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(6728);t.combineAll=n.combineLatestAll},2551:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(3247),s=r(7843),a=r(8535),c=r(1251),u=r(2706),l=r(1107);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var d=l.popResultSelector(t);return d?u.pipe(e.apply(void 0,i([],n(t))),c.mapOneOrManyArgs(d)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},6728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(3247),i=r(3638);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},8239:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(2551);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},7601:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(7843),s=r(8158),a=r(1107),c=r(4917);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(c.from(i([t],n(e)),r)).subscribe(o)}))}},8158:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(7302);t.concatAll=function(){return n.mergeAll(1)}},9135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(983),i=r(1018);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},9938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(9135),i=r(1018);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},9669:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(7601);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},1483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(2483),i=r(9445),o=r(7843),s=r(6824),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},1038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(9139);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},6842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(7843),i=r(1342),o=r(3111),s=r(9445);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,c=null,u=function(){if(null==c||c.unsubscribe(),c=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==c||c.unsubscribe(),n=!0,a=t,c=o.createOperatorSubscriber(r,u,i.noop),s.innerFrom(e(t)).subscribe(c)}),(function(){u(),r.complete()}),void 0,(function(){a=c=null})))}))}},8079:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(7961),i=r(7843),o=r(3111);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,c=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function u(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);c()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(u,e),n.add(i))}),(function(){c(),n.complete()}),void 0,(function(){s=i=null})))}))}},378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(7843),i=r(3111);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},914:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(7961),i=r(8766),o=r(4092);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},8766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(3865),i=r(846),o=r(490),s=r(3218),a=r(983),c=r(9445);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return c.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},7441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(7800),i=r(7843),o=r(3111);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},5365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(7843),i=r(3111),o=r(1342),s=r(9445);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},8937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(6640),i=r(7843),o=r(3111);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},9612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(8937);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},4520:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(7057),i=r(783),o=r(4869),s=r(378),a=r(846);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(c){return c.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},1776:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(3865),s=r(1004);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},5510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(7843),i=r(3111);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},1551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(2752);t.exhaust=n.exhaustAll},2752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(4753),i=r(6640);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},4753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(5471),i=r(9445),o=r(7843),s=r(3111);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},7661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(7843),i=r(1983);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(7843),i=r(3111);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},3555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(7843);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},7714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(7843),i=r(3111);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},9756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(7843),i=r(7714);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},8275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(5204),i=r(783),o=r(846),s=r(378),a=r(4869),c=r(6640);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},6902:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(983);t.flatMap=n.mergeMap},7815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(4662),i=r(9445),o=r(2483),s=r(7843),a=r(3111);t.groupBy=function(e,t,r,c){return s.operate((function(s,u){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,c=t.connector):l=t;var d=new Map,f=function(e){d.forEach(e),e(u)},h=function(e){return f((function(t){return t.error(e)}))},p=0,b=!1,m=new a.OperatorSubscriber(u,(function(t){try{var s=e(t),f=d.get(s);if(!f){d.set(s,f=c?c():new o.Subject);var g=(y=s,_=f,(E=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&b&&m.unsubscribe()}}))).key=y,E);if(u.next(g),r){var v=a.createOperatorSubscriber(f,(function(){f.complete(),null==v||v.unsubscribe()}),void 0,void 0,(function(){return d.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(v))}}f.next(l?l(t):t)}catch(e){h(e)}var y,_,E}),(function(){return f((function(e){return e.complete()}))}),h,(function(){return d.clear()}),(function(){return b=!0,0===p}));s.subscribe(m)}))}},490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(7843),i=r(3111),o=r(1342);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},9356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(7843),i=r(3111);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},3638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(6640),i=r(1251),o=r(2706),s=r(983),a=r(2343);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},8669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(5204),i=r(783),o=r(8330),s=r(4869),a=r(378),c=r(6640);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},5471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(7843),i=r(3111);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},3218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(5471);t.mapTo=function(e){return n.map((function(){return e}))}},2360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(7800),i=r(7843),o=r(3111);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},1415:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(9139),i=r(1018);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},361:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(7843),s=r(8535),a=r(7302),c=r(1107),u=r(4917);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(u.from(i([t],n(e)),r)).subscribe(o)}))}},7302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(983),i=r(6640);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},1983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(9445),i=r(7110),o=r(3111);t.mergeInternals=function(e,t,r,s,a,c,u,l){var d=[],f=0,h=0,p=!1,b=function(){!p||d.length||f||t.complete()},m=function(e){return f<s?g(e):d.push(e)},g=function(e){c&&t.next(e),f++;var l=!1;n.innerFrom(r(e,h++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),c?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{f--;for(var e=function(){var e=d.shift();u?i.executeSchedule(t,u,(function(){return g(e)})):g(e)};d.length&&f<s;)e();b()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,b()}))),function(){null==l||l()}}},983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(5471),i=r(9445),o=r(7843),s=r(1983),a=r(1018);t.mergeMap=function e(t,r,c){return void 0===c&&(c=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),c):("number"==typeof r&&(c=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,c)})))}},6586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(983),i=r(1018);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},4408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(7843),i=r(1983);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},8253:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(361);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},2669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(9139),i=r(1018);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},9247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(8918),i=r(1018),o=r(1483);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},5184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(7110),i=r(7843),o=r(3111);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},1226:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(8535),s=r(6102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},1518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(7843),i=r(3111);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},2171:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(245),i=r(783);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},4912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(5471);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(2483),i=r(9247),o=r(1483);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},7220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(1637),i=r(8918);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},6106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(95),i=r(8918);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},8157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(1242),i=r(9247),o=r(1018);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},4440:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(8535),s=r(5600);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},5600:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(5584),s=r(7843),a=r(6640);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},9139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(6384),i=r(7843);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},7561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(7843),i=r(3111);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},8522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(8616),i=r(7843),o=r(3111),s=r(9445),a=r(4092);t.repeat=function(e){var t,r,c=1/0;return null!=e&&("object"==typeof e?(t=e.count,c=void 0===t?1/0:t,r=e.delay):c=e),c<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,u=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),c=o.createOperatorSubscriber(t,(function(){c.unsubscribe(),l()}));e.subscribe(c)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<c?n?u():r=!0:t.complete()}))),r&&u()};l()}))}},6566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(9445),i=r(2483),o=r(7843),s=r(3111);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=!1,l=!1,d=function(){return l&&u&&(r.complete(),!0)},f=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!d()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?f():c=!0}),(function(){u=!0,d()})))),a).next()}))),c&&(o.unsubscribe(),o=null,c=!1,f())};f()}))}},7835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(7843),i=r(3111),o=r(6640),s=r(4092),a=r(9445);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,c=void 0===r?1/0:r,u=t.delay,l=t.resetOnSuccess,d=void 0!==l&&l;return c<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){d&&(n=0),t.next(e)}),void 0,(function(e){if(n++<c){var d=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=u){var f="number"==typeof u?s.timer(u):a.innerFrom(u(e,n)),h=i.createOperatorSubscriber(t,(function(){h.unsubscribe(),d()}),(function(){t.complete()}));f.subscribe(h)}else d()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},9843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(9445),i=r(2483),o=r(7843),s=r(3111);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?u():c=!0})))),a&&a.next(t)}))),c&&(o.unsubscribe(),o=null,c=!1,u())};u()}))}},1731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(9445),i=r(7843),o=r(1342),s=r(3111);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},6086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(7961),i=r(1731),o=r(6472);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},8624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(7843),i=r(6384);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},6384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(3111);t.scanInternals=function(e,t,r,i,o){return function(s,a){var c=r,u=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;u=c?e(u,t,r):(c=!0,t),i&&a.next(u)}),o&&function(){c&&a.next(u),a.complete()}))}}},582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(7843),i=r(3111),o=r(9445);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},c=function(e){n.next(e),n.complete()},u=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?c(!1):e.buffer.push(n):!t(n,i.shift())&&c(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&c(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(u(s,a)),o.innerFrom(e).subscribe(u(a,s))}))}},8977:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(9445),s=r(2483),a=r(5),c=r(7843);function u(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var c=new a.SafeSubscriber({next:function(){c.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(c)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,h=void 0===f||f;return function(e){var t,n,s,l=0,f=!1,p=!1,b=function(){null==n||n.unsubscribe(),n=void 0},m=function(){b(),t=s=void 0,f=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return c.operate((function(e,c){l++,p||f||b();var v=s=null!=s?s:r();c.add((function(){0!==--l||p||f||(n=u(g,h))})),v.subscribe(c),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){p=!0,b(),n=u(m,i,e),v.error(e)},complete:function(){f=!0,b(),n=u(m,d),v.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},3133:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(1242),i=r(8977);t.shareReplay=function(e,t,r){var o,s,a,c,u=!1;return e&&"object"==typeof e?(o=e.bufferSize,c=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,u=void 0!==(a=e.refCount)&&a,r=e.scheduler):c=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(c,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},3001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(5204),i=r(1505),o=r(1759),s=r(7843),a=r(3111);t.single=function(e){return s.operate((function(t,r){var s,c=!1,u=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){u=!0,e&&!e(n,l++,t)||(c&&r.error(new i.SequenceError("Too many matching values")),c=!0,s=n)}),(function(){c?(r.next(s),r.complete()):r.error(u?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},3982:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(783);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},9098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(6640),i=r(7843),o=r(3111);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},7372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(7843),i=r(3111),o=r(9445),s=r(1342);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},4721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(7843),i=r(3111);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(3865),i=r(1107),o=r(7843);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},8960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(7843);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},8774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(3879),i=r(6640);t.switchAll=function(){return n.switchMap(i.identity)}},3879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(9445),i=r(7843),o=r(3111);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,c=!1,u=function(){return c&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var c=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,c++):e)}),(function(){s=null,u()})))}),(function(){c=!0,u()})))}))}},3274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(3879),i=r(1018);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},8712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(3879),i=r(7843);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(8616),i=r(7843),o=r(3111);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},8330:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(8616),o=r(7843),s=r(3111);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},4780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(7843),i=r(3111),o=r(9445),s=r(1342);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},2129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(7843),i=r(3111);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},3964:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(1018),i=r(7843),o=r(3111),s=r(6640);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},8941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(7843),i=r(3111),o=r(9445);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,c=void 0===a||a,u=s.trailing,l=void 0!==u&&u,d=!1,f=null,h=null,p=!1,b=function(){null==h||h.unsubscribe(),h=null,l&&(v(),p&&n.complete())},m=function(){h=null,p&&n.complete()},g=function(t){return h=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,b,m))},v=function(){if(d){d=!1;var e=f;f=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){d=!0,f=e,(!h||h.closed)&&(c?v():g(e))}),(function(){p=!0,(!(l&&d&&h)||h.closed)&&n.complete()})))}))}},7640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(7961),i=r(8941),o=r(4092);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},4869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(5204),i=r(7843),o=r(3111);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(7961),i=r(7843),o=r(3111);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},1554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(7961),i=r(1074),o=r(7843),s=r(9445),a=r(5568),c=r(3111),u=r(7110);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,d=r.each,f=r.with,h=void 0===f?l:f,p=r.scheduler,b=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==d)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=u.executeSchedule(t,b,(function(){try{r.unsubscribe(),s.innerFrom(h({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(c.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),d>0&&l(d)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-b.now():d)}))}},4862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(7961),i=r(1074),o=r(1554);t.timeoutWith=function(e,t,r){var s,a,c;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(c=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:c})}},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(9568),i=r(5471);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(9139),i=r(7843),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},5477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(2483),i=r(7843),o=r(3111),s=r(1342),a=r(9445);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var c=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),c)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,c)),function(){null==i||i.unsubscribe(),i=null}}))}},6746:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(2483),o=r(7843),s=r(3111);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],c=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,u;try{for(var l=n(a),d=l.next();!d.done;d=l.next()){d.value.next(t)}}catch(e){s={error:e}}finally{try{d&&!d.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}var f=c-e+1;if(f>=0&&f%r==0&&a.shift().complete(),++c%r==0){var h=new i.Subject;a.push(h),o.next(h.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(2483),i=r(7961),o=r(8014),s=r(7843),a=r(3111),c=r(7479),u=r(1107),l=r(7110);t.windowTime=function(e){for(var t,r,d=[],f=1;f<arguments.length;f++)d[f-1]=arguments[f];var h=null!==(t=u.popScheduler(d))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=d[0])&&void 0!==r?r:null,b=d[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),c.arrRemove(i,e),s&&d()},d=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,h,(function(){return u(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,d,p,!0):s=!0,d();var f=function(e){return i.slice().forEach(e)},m=function(e){f((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){f((function(t){t.window.next(e),b<=++t.seen&&u(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},6637:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(2483),o=r(8014),s=r(7843),a=r(9445),c=r(3111),u=r(1342),l=r(7479);t.windowToggle=function(e,t){return s.operate((function(r,s){var d=[],f=function(e){for(;0<d.length;)d.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(c.createOperatorSubscriber(s,(function(e){var r=new i.Subject;d.push(r);var n,h=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void f(e)}s.next(r.asObservable()),h.add(n.subscribe(c.createOperatorSubscriber(s,(function(){l.arrRemove(d,r),r.complete(),h.unsubscribe()}),u.noop,f)))}),u.noop)),r.subscribe(c.createOperatorSubscriber(s,(function(e){var t,r,i=d.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<d.length;)d.shift().complete();s.complete()}),f,(function(){for(;0<d.length;)d.shift().unsubscribe()})))}))}},1141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(2483),i=r(7843),o=r(3111),s=r(9445);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,c=function(e){i.error(e),r.error(e)},u=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void c(e)}t.subscribe(a=o.createOperatorSubscriber(r,u,u,c))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),c,(function(){null==a||a.unsubscribe(),i=null})))}))}},5442:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(7843),s=r(3111),a=r(9445),c=r(6640),u=r(1342),l=r(1107);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,d=new Array(l),f=e.map((function(){return!1})),h=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){d[t]=e,h||f[t]||(f[t]=!0,(h=f.every(c.identity))&&(f=null))}),u.noop))},b=0;b<l;b++)p(b);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(h){var t=i([e],n(d));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},5918:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(7286),s=r(7843);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(7286),i=r(3638);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},8538:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(5918);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},6985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(4662);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(4662),i=r(7110);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},8808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(4662),i=r(1964),o=r(1018),s=r(7110);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},9567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(9445),i=r(5184),o=r(8960);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},9589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(9445),i=r(5184),o=r(8960);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},4953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(854),i=r(9137);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},1656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(9567),i=r(9589),o=r(6985),s=r(8808),a=r(854),c=r(1116),u=r(7629),l=r(8046),d=r(6368),f=r(1358),h=r(7614),p=r(9137),b=r(4953);t.scheduled=function(e,t){if(null!=e){if(c.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(u.isPromise(e))return i.schedulePromise(e,t);if(f.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(d.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return b.scheduleReadableStreamLike(e,t)}throw h.createInvalidObservableTypeError(e)}},4671:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(8014).Subscription);t.Action=o},2628:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(5267),s=r(9507),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},3229:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(5648).AsyncScheduler);t.AnimationFrameScheduler=o},5006:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(5267),s=r(6293),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},827:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(5648).AsyncScheduler);t.AsapScheduler=o},5267:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(4671),s=r(5649),a=r(7479),c=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=c},5648:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(8986),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},4212:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(5267).AsyncAction);t.QueueAction=o},1293:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(5648).AsyncScheduler);t.QueueScheduler=o},182:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(5267),s=r(8014),a=function(e){function t(t,r){void 0===t&&(t=c),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(5648).AsyncScheduler);t.VirtualTimeScheduler=a;var c=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=c},3862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(2628),i=r(3229);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},9507:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(8014);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},3692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(5006),i=r(827);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},7961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(5267),i=r(5648);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},9568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},6293:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(7245),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},5649:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},4746:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},2886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(4212),i=r(1293);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},9155:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},1964:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},3327:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},6038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(5568);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},5204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(5568);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},1759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(5568);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},9686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(5568);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},1505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(5568);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},5788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(5568);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},1107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(1018),i=r(8613);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},7360:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},8535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},7479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},5568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},6013:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(3413),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7110:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},6640:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},8046:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},1358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(1018);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},1018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},1116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(3327),i=r(1018);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},6368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(1964),i=r(1018);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},1751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(4662),i=r(1018);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},7629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(1018);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},9137:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(u,l):d(s[0][2],r)}catch(e){d(s[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function d(e,t){e(t),s.shift(),s.length&&c(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(1018);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},8613:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(1018);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},7843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(1018);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1251:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(5471),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},1342:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},2706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(6640);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(3413),i=r(9155);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},7614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},9419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(3146);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(3231);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(8015);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(5572);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(7210);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var c=r(8995);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return c.bufferToggle}});var u=r(8831);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return u.bufferWhen}});var l=r(8118);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var d=r(6625);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return d.combineAll}});var f=r(6728);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return f.combineLatestAll}});var h=r(2551);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return h.combineLatest}});var p=r(8239);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var b=r(7601);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return b.concat}});var m=r(8158);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(9135);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var v=r(9938);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return v.concatMapTo}});var y=r(9669);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return y.concatWith}});var _=r(1483);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var E=r(1038);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return E.count}});var w=r(6842);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return w.debounce}});var O=r(8079);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return O.debounceTime}});var A=r(378);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return A.defaultIfEmpty}});var S=r(914);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return S.delay}});var P=r(8766);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return P.delayWhen}});var T=r(7441);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return T.dematerialize}});var R=r(5365);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return R.distinct}});var I=r(8937);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return I.distinctUntilChanged}});var x=r(9612);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return x.distinctUntilKeyChanged}});var M=r(4520);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return M.elementAt}});var k=r(1776);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return k.endWith}});var L=r(5510);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return L.every}});var C=r(1551);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return C.exhaust}});var N=r(2752);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return N.exhaustAll}});var j=r(4753);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return j.exhaustMap}});var D=r(7661);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return D.expand}});var U=r(783);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return U.filter}});var B=r(3555);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return B.finalize}});var F=r(7714);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return F.find}});var K=r(9756);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return K.findIndex}});var H=r(8275);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return H.first}});var G=r(7815);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return G.groupBy}});var $=r(490);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return $.ignoreElements}});var V=r(9356);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return V.isEmpty}});var z=r(8669);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return z.last}});var W=r(5471);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return W.map}});var q=r(3218);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return q.mapTo}});var Z=r(2360);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return Z.materialize}});var Y=r(1415);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return Y.max}});var J=r(361);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var X=r(7302);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return X.mergeAll}});var Q=r(6902);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(983);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(6586);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(4408);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(8253);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(2669);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(9247);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(5184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(1226);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ce=r(1518);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ce.pairwise}});var ue=r(2171);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ue.partition}});var le=r(4912);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var de=r(766);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return de.publish}});var fe=r(7220);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return fe.publishBehavior}});var he=r(6106);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return he.publishLast}});var pe=r(8157);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var be=r(4440);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return be.race}});var me=r(5600);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(9139);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ve=r(8522);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ve.repeat}});var ye=r(6566);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return ye.repeatWhen}});var _e=r(7835);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var Ee=r(9843);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return Ee.retryWhen}});var we=r(7561);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return we.refCount}});var Oe=r(1731);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Oe.sample}});var Ae=r(6086);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Ae.sampleTime}});var Se=r(8624);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Se.scan}});var Pe=r(582);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Pe.sequenceEqual}});var Te=r(8977);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Te.share}});var Re=r(3133);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Re.shareReplay}});var Ie=r(3001);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Ie.single}});var xe=r(3982);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return xe.skip}});var Me=r(9098);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Me.skipLast}});var ke=r(7372);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return ke.skipUntil}});var Le=r(4721);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return Le.skipWhile}});var Ce=r(269);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ce.startWith}});var Ne=r(8960);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ne.subscribeOn}});var je=r(8774);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return je.switchAll}});var De=r(3879);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return De.switchMap}});var Ue=r(3274);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Ue.switchMapTo}});var Be=r(8712);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Be.switchScan}});var Fe=r(846);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Fe.take}});var Ke=r(8330);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return Ke.takeLast}});var He=r(4780);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return He.takeUntil}});var Ge=r(2129);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Ge.takeWhile}});var $e=r(3964);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $e.tap}});var Ve=r(8941);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Ve.throttle}});var ze=r(7640);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return ze.throttleTime}});var We=r(4869);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return We.throwIfEmpty}});var qe=r(489);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return qe.timeInterval}});var Ze=r(1554);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ze.timeout}});var Ye=r(4862);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Ye.timeoutWith}});var Je=r(6505);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Xe=r(2343);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Xe.toArray}});var Qe=r(5477);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(6746);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(8208);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(6637);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(1141);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(5442);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(5918);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(187);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(8538);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},2100:e=>{e.exports=function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}},6571:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>T,InvalidAddressError:()=>l,InvalidAmountError:()=>p,InvalidBlockHashError:()=>h,InvalidChainIdError:()=>O,InvalidContractAddressError:()=>w,InvalidDerivationPathError:()=>b,InvalidFinalizeUnstakeAmountError:()=>f,InvalidHexStringError:()=>m,InvalidKeyError:()=>y,InvalidKeyHashError:()=>A,InvalidMessageError:()=>g,InvalidOperationHashError:()=>S,InvalidOperationKindError:()=>P,InvalidPublicKeyError:()=>_,InvalidSignatureError:()=>E,InvalidStakingAddressError:()=>d,InvalidViewParameterError:()=>v,NetworkError:()=>c,ParameterValidationError:()=>i,PermissionDeniedError:()=>u,ProhibitedActionError:()=>R,PublicKeyNotFoundError:()=>I,RpcError:()=>o,TaquitoError:()=>n,TezosToolkitConfigError:()=>s,UnsupportedActionError:()=>a});class n extends Error{}class i extends n{}class o extends n{}class s extends n{}class a extends n{}class c extends n{}class u extends n{}class l extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidAddressError",this.message=`Invalid address "${e}"`,this.message+=t?` ${t}.`:"."}}class d extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidStakingAddressError",this.message=`Invalid staking address "${e}", you can only set destination as your own address`}}class f extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidFinalizeUnstakeAmountError",this.message="The amount can only be 0 when finalizing an unstake"}}class h extends i{constructor(e,t){super(),this.blockHash=e,this.errorDetail=t,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${e}"`,this.message+=t?` ${t}.`:"."}}class p extends i{constructor(e){super(),this.amount=e,this.name="InvalidAmountError",this.message=`Invalid amount "${e}"`}}class b extends i{constructor(e,t){super(),this.derivationPath=e,this.errorDetail=t,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${e}"`,this.message+=t?` ${t}.`:"."}}class m extends i{constructor(e,t){super(),this.hexString=e,this.errorDetail=t,this.name="InvalidHexStringError",this.message=`Invalid hex string "${e}"`,this.message+=t?` ${t}.`:"."}}class g extends i{constructor(e,t){super(),this.msg=e,this.errorDetail=t,this.name="InvalidMessageError",this.message=`Invalid message "${e}"`,this.message+=t?` ${t}.`:"."}}class v extends i{constructor(e,t,r,n){super(),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}.`}}class y extends i{constructor(e){super(),this.errorDetail=e,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=e?` ${e}.`:"."}}class _ extends i{constructor(e,t){super(),this.publicKey=e,this.errorDetail=t,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${e}"`,this.message+=t?` ${t}.`:"."}}class E extends i{constructor(e,t){super(),this.signature=e,this.errorDetail=t,this.name="InvalidSignatureError",this.message=`Invalid signature "${e}"`,this.message+=t?` ${t}.`:"."}}class w extends i{constructor(e,t){super(),this.contractAddress=e,this.errorDetail=t,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${e}"`,this.message+=t?` ${t}.`:"."}}class O extends i{constructor(e,t){super(),this.chainId=e,this.errorDetail=t,this.name="InvalidChainIdError",this.message=`Invalid chain id "${e}"`,this.message+=t?` ${t}.`:"."}}class A extends i{constructor(e,t){super(),this.keyHash=e,this.errorDetail=t,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${e}"`,this.message+=t?` ${t}.`:"."}}class S extends i{constructor(e,t){super(),this.operationHash=e,this.errorDetail=t,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${e}"`,this.message+=t?` ${t}.`:"."}}class P extends i{constructor(e,t){super(),this.operationKind=e,this.errorDetail=t,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${e}"`,this.message+=t?` ${t}.`:"."}}class T extends a{constructor(e){super(),this.message=e,this.name="DeprecationError"}}class R extends a{constructor(e){super(),this.message=e,this.name="ProhibitedActionError"}}class I extends n{constructor(e,t){super(),this.pkh=e,this.cause=t,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${e}" in either wallet or contract API.`}}},2211:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HttpBackend:()=>f,HttpRequestFailed:()=>s,HttpResponseError:()=>a,HttpTimeoutError:()=>c,STATUS_CODE:()=>n,VERSION:()=>u});var n,i=r(6571);function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class s extends i.NetworkError{constructor(e,t,r){super(),this.method=e,this.url=t,this.cause=r,this.name="HttpRequestFailed",this.message=`${e} ${t} ${String(r)}`}}class a extends i.NetworkError{constructor(e,t,r,n,i){super(),this.message=e,this.status=t,this.statusText=r,this.body=n,this.url=i,this.name="HttpResponseError"}}class c extends i.NetworkError{constructor(e,t){super(),this.timeout=e,this.url=t,this.name="HttpTimeoutError",this.message=`HTTP request timeout of ${e}ms exceeded`}}!function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(n||(n={}));const u={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"};var l;let d=null===globalThis||void 0===globalThis?void 0:globalThis.fetch;"undefined"!=typeof process&&!!(null===(l=null===process||void 0===process?void 0:process.versions)||void 0===l?void 0:l.node)&&(d=r(1879));class f{constructor(e=3e4){this.timeout=e}serialize(e){if(!e)return"";const t=[];for(const r in e)if(e.hasOwnProperty(r)&&void 0!==e[r]){const n="function"==typeof e[r].toJSON?e[r].toJSON():e[r];if(null===n){t.push(encodeURIComponent(r));continue}if(Array.isArray(n)){n.forEach((e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}));continue}t.push(encodeURIComponent(r)+"="+encodeURIComponent(n))}const r=t.join("&");return r?`?${r}`:""}createRequest(e,t){return o(this,arguments,void 0,(function*({url:e,method:t,timeout:r=this.timeout,query:n,headers:i={},json:o=!0},u){const l=e+this.serialize(n);i["Content-Type"]||(i["Content-Type"]="application/json");const f=new AbortController,h=setTimeout((()=>f.abort()),r);try{const e=yield d(l,{keepalive:!1,method:t,headers:i,body:JSON.stringify(u),signal:f.signal});if(void 0===e)throw new Error("Response is undefined");if(e.status>=400){const t=yield e.text();throw new a(`Http error response: (${e.status}) ${t}`,e.status,e.statusText,t,l)}return o?e.json():e.text()}catch(e){throw e instanceof Error&&"AbortError"===e.name?new c(r,l):e instanceof a?e:new s(String(t),l,e)}finally{clearTimeout(h)}}))}}},1879:(e,t,r)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,n.fetch&&(t.default=n.fetch.bind(n)),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response},9971:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CODEC:()=>c,LocalForger:()=>Be,ProtocolsHash:()=>Ne,Uint8ArrayConsumer:()=>R,VERSION:()=>je,decoders:()=>Me,encoders:()=>ke,getCodec:()=>Ue,localForger:()=>Fe,opMapping:()=>u,opMappingReverse:()=>l});var n=r(6209),i=r(6571),o=r(6483);const s=e=>e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),""),a=(e,t=8)=>e.toString(16).padStart(t,"0");var c;!function(e){e.SECRET="secret",e.RAW="raw",e.TZ1="tz1",e.BRANCH="branch",e.ZARITH="zarith",e.PUBLIC_KEY="public_key",e.PKH="pkh",e.PKH_ARR="pkhArr",e.DELEGATE="delegate",e.SCRIPT="script",e.BALLOT_STATEMENT="ballotStmt",e.PROPOSAL="proposal",e.PROPOSAL_ARR="proposalArr",e.INT32="int32",e.INT16="int16",e.PARAMETERS="parameters",e.ADDRESS="address",e.SMART_CONTRACT_ADDRESS="smart_contract_address",e.SMART_ROLLUP_ADDRESS="smart_rollup_address",e.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",e.VALUE="value",e.PADDED_BYTES="padded_bytes",e.SMART_ROLLUP_MESSAGE="smart_rollup_message",e.MANAGER="manager",e.BLOCK_PAYLOAD_HASH="blockPayloadHash",e.ENTRYPOINT="entrypoint",e.OPERATION="operation",e.OP_ACTIVATE_ACCOUNT="activate_account",e.OP_DELEGATION="delegation",e.OP_TRANSACTION="transaction",e.OP_ORIGINATION="origination",e.OP_BALLOT="ballot",e.OP_FAILING_NOOP="failing_noop",e.OP_ATTESTATION="attestation",e.OP_ATTESTATION_WITH_DAL="attestation_with_dal",e.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",e.OP_REVEAL="reveal",e.OP_PROPOSALS="proposals",e.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",e.OP_TRANSFER_TICKET="transfer_ticket",e.BURN_LIMIT="burn_limit",e.OP_INCREASE_PAID_STORAGE="increase_paid_storage",e.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",e.OP_DRAIN_DELEGATE="drain_delegate",e.DEPOSITS_LIMIT="deposits_limit",e.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",e.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.PVM_KIND="pvm_kind",e.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",e.OP_DAL_PUBLISH_COMMITMENT="dal_publish_commitment",e.SLOT_HEADER="slot_header"}(c||(c={}));const u={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT","9d":"Ticket"},l=(()=>{const e={};return Object.keys(u).forEach((t=>{e[u[t]]=t})),e})(),d={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"attestation",23:"attestation_with_dal",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",230:"dal_publish_commitment",17:"failing_noop"},f=(()=>{const e={};return Object.keys(d).forEach((t=>{const r="string"==typeof t?parseInt(t,10):t;e[d[r]]=a(r,2)})),e})(),h={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit","06":"stake","07":"unstake","08":"finalize_unstake","09":"set_delegate_parameters"},p=(()=>{const e={};return Object.keys(h).forEach((t=>{e[h[t]]=t})),e})();class b extends i.ParameterValidationError{constructor(e,t){super(),this.operation=e,this.errorDetail=t,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",t&&(this.message+=` ${t}.`)}}class m extends i.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${e.length}", maximum length is "31".`}}class g extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${e}" expecting one of the following: "yay", "nay", "pass".`}}class v extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${e}", cannot be decoded.`}}class y extends i.ParameterValidationError{constructor(e){super(),this.value=e,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${e}", unalbe to encode.`}}class _ extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationDecodingError"}}class E extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationEncodingError"}}class w extends i.ParameterValidationError{constructor(e){super(),this.op=e,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${e}", can submit an issue on our github for feature request.`}}class O extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${e}" expecting either "arith" or "wasm_2_0_0".`}}class A extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${e}", cannot be decoded.`}}class S extends i.ParameterValidationError{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${e}"`,t&&(this.message+=` ${t}.`)}}class P extends i.ParameterValidationError{constructor(e,t){super(),this.hash=e,this.errorDetail=t,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${e}"`,t&&(this.message+=` ${t}.`)}}class T extends i.ParameterValidationError{constructor(e,t){super(),this.commitment=e,this.errorDetail=t,this.name="InvalidDalCommitmentError",this.message=`Invalid dal commitment "${e}"`,t&&(this.message+=` ${t}.`)}}class R{static fromHexString(e){const t=e.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(t)){const e=new Uint8Array((t.match(/([a-z]|\d){2}/g)||[]).map((e=>parseInt(e,16))));return new R(e)}throw new i.InvalidHexStringError(t)}constructor(e,t=0){this.arr=e,this.offset=t}consume(e){const t=this.arr.subarray(this.offset,this.offset+e);return this.offset+=e,t}get(e){return this.arr[this.offset+e]}length(){return this.arr.length-this.offset}slice(e,t){return new R(this.arr.slice(e,t))}}const I=e=>{if(Array.isArray(e)){const t=e.map((e=>I(e))).join(""),r=t.length/2;return`02${a(r)}${t}`}if((e=>"prim"in e)(e))return U(e);if((e=>"bytes"in e&&"string"==typeof e.bytes)(e))return k(e);if((e=>"string"in e&&"string"==typeof e.string)(e))return C(e);if((e=>"int"in e&&"string"==typeof e.int)(e))return j(e);throw new y(JSON.stringify(e))},x=e=>{const t=e.consume(1);switch(t[0]){case 10:return L(e);case 1:return N(e);case 0:return D(e);case 2:{const t=new R(M(e)),r=[];for(;t.length()>0;)r.push(x(t));return r}default:return B(e,t)}},M=(e,t=4)=>{const r=e.consume(t),n=parseInt(Buffer.from(r).toString("hex"),16);return e.consume(n)},k=e=>{if(!/^([A-Fa-f0-9]{2})*$/.test(e.bytes))throw new i.InvalidHexStringError(e.bytes);const t=e.bytes.length/2;return`0a${a(t)}${e.bytes}`},L=e=>{const t=M(e);return{bytes:Buffer.from(t).toString("hex")}},C=e=>{const t=Buffer.from(e.string,"utf8").toString("hex"),r=t.length/2;return`01${a(r)}${t}`},N=e=>{const t=M(e);return{string:Buffer.from(t).toString("utf8")}},j=({int:e})=>{const t=new o.g(e,10),r="-"===t.toString(2)[0]?"1":"0",n=t.toString(2).replace(/-/g,""),i=n.length<=6?6:(n.length-6)%7?n.length+7-(n.length-6)%7:n.length,s=n.padStart(i,"0").match(/\d{6,7}/g).reverse();s[0]=r+s[0];return`00${s.map(((e,t)=>parseInt((t===s.length-1?"0":"1")+e,2).toString(16).padStart(2,"0"))).join("")}`},D=e=>{let t=e.consume(1)[0];const r=[];for(;128&t;)r.push(t),t=e.consume(1)[0];r.push(t);const n=!!(64&r[0]);r[0]=127&r[0];const i=r.map(((e,t)=>e.toString(2).slice(0===t?-6:-7).padStart(0===t?6:7,"0"))).reverse();let s=new o.g(i.join(""),2);return n&&(s=s.times(-1)),{int:s.toFixed()}},U=e=>{const t=+Array.isArray(e.annots),r=Array.isArray(e.args)?e.args.length:0,n=a(Math.min(2*r+t+3,9),2),i=l[e.prim];let o=(e.args||[]).map((e=>I(e))).join("");const s=Array.isArray(e.annots)?H(e.annots):"";return"LAMBDA"!==e.prim&&"LAMBDA_REC"!==e.prim||!r||(o=a(o.length/2)+o+a(0)),("pair"===e.prim||"Pair"===e.prim)&&r>2&&(o=""===s?a(o.length/2)+o+a(0):a(o.length/2)+o),"view"===e.prim&&e.args&&(o=a(o.length/2)+o+a(0)),`${n}${i}${o}${s}`},B=(e,t)=>{const r=(t[0]-3)%2==1;let n=Math.floor((t[0]-3)/2);const i=e.consume(1)[0].toString(16).padStart(2,"0"),o={prim:u[i]};if("LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),"view"===u[i])return 0!=n?F(e,o):o;let s,a;("pair"===u[i]||"Pair"===u[i])&&n>2&&(s=K(e),n=0,a=G(e));const c=new Array(n).fill(0).map((()=>x(e)));return"LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),s?o.args=s:c.length&&(o.args=c),a&&""!==a[0]?o.annots=a:r&&(o.annots=G(e)),o},F=(e,t)=>(e.consume(4),t.args=new Array(4).fill(0).map((()=>x(e))),e.consume(4),t),K=e=>{const t=new R(M(e)),r=[];for(;t.length()>0;)r.push(x(t));return r},H=e=>{const t=e.map((e=>Buffer.from(e,"utf8").toString("hex"))).join("20"),r=t.length/2;return`${a(r)}${t}`},G=e=>{const t=e.consume(4),r=parseInt(Buffer.from(t).toString("hex"),16),n=e.consume(r);return Buffer.from(n).toString("hex").split("20").map((e=>Buffer.from(e,"hex").toString("utf8")))},$=e=>t=>(0,n.buf2hex)(Buffer.from((0,n.b58cdecode)(t,n.prefix[e]))),V=e=>t=>{const r=t.consume(n.prefixLength[e]);return(0,n.b58cencode)(r,n.prefix[e])},z=V(n.Prefix.TZ1),W=V(n.Prefix.B),q=e=>{const t=e.consume(1);return 0===t[0]?V(n.Prefix.TZ1)(e):1===t[0]?V(n.Prefix.TZ2)(e):2===t[0]?V(n.Prefix.TZ3)(e):void 0},Z=$(n.Prefix.B),Y=$(n.Prefix.TZ1),J=e=>e?"ff":"00",X=e=>$(n.Prefix.P)(e),Q=e=>V(n.Prefix.P)(e),ee=e=>255===e.consume(1)[0],te=e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:return"00"+$(n.Prefix.TZ1)(e);case n.Prefix.TZ2:return"01"+$(n.Prefix.TZ2)(e);case n.Prefix.TZ3:return"02"+$(n.Prefix.TZ3)(e);case n.Prefix.TZ4:return"03"+$(n.Prefix.TZ4)(e);default:throw new n.InvalidKeyHashError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one for the following "${n.Prefix.TZ1}", "${n.Prefix.TZ2}", "${n.Prefix.TZ3}" or "${n.Prefix.TZ4}".`)}},re=e=>{const t=[];let r=new o.A(e,10);if(r.isNaN())throw new TypeError(`Invalid zarith number ${e}`);for(;;){if(r.lt(128)){r.lt(16)&&t.push("0"),t.push(r.toString(16));break}{let e=r.mod(128);r=r.minus(e),r=r.dividedBy(128),e=e.plus(128),t.push(e.toString(16))}}return t.join("")},ne=e=>{let t=0;for(;t<e.length()&&128&e.get(t);)t+=1;let r=new o.A(0);for(let n=t;n>=0;n-=1){const t=127&e.get(n);r=r.multipliedBy(128),r=r.plus(t)}return e.consume(t+1),new o.A(r).toString()},ie=$(n.Prefix.VH),oe=V(n.Prefix.VH),se=e=>{const t=V(n.Prefix.SH)(e);if(t.substring(0,2)!==n.Prefix.SH)throw new T(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SH}'`);return t},ae={branch:c.BRANCH,contents:[c.OPERATION]},ce={pkh:c.TZ1,secret:c.SECRET},ue={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,public_key:c.PUBLIC_KEY},le={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,delegate:c.DELEGATE},de={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.ADDRESS,parameters:c.PARAMETERS},fe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,balance:c.ZARITH,delegate:c.DELEGATE,script:c.SCRIPT},he={source:c.PKH,period:c.INT32,proposal:c.PROPOSAL,ballot:c.BALLOT_STATEMENT},pe={slot:c.INT16,level:c.INT32,round:c.INT32,block_payload_hash:c.BLOCK_PAYLOAD_HASH},be={slot:c.INT16,level:c.INT32,round:c.INT32,block_payload_hash:c.BLOCK_PAYLOAD_HASH,dal_attestation:c.ZARITH},me={level:c.INT32,nonce:c.RAW},ge={source:c.PKH,period:c.INT32,proposals:c.PROPOSAL_ARR},ve={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,value:c.VALUE},ye={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,ticket_contents:c.VALUE,ticket_ty:c.VALUE,ticket_ticketer:c.ADDRESS,ticket_amount:c.ZARITH,destination:c.ADDRESS,entrypoint:c.ENTRYPOINT},_e={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.SMART_CONTRACT_ADDRESS},Ee={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pk:c.PUBLIC_KEY},we={consensus_key:c.PKH,delegate:c.PKH,destination:c.PKH},Oe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,limit:c.DEPOSITS_LIMIT},Ae={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pvm_kind:c.PVM_KIND,kernel:c.PADDED_BYTES,parameters_ty:c.VALUE,whitelist:c.PKH_ARR},Se={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,message:c.SMART_ROLLUP_MESSAGE},Pe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,rollup:c.SMART_ROLLUP_ADDRESS,cemented_commitment:c.SMART_ROLLUP_COMMITMENT_HASH,output_proof:c.PADDED_BYTES},Te={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,slot_header:c.SLOT_HEADER},Re={arbitrary:c.PADDED_BYTES},Ie=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(r&&Array.isArray(o)){const t=e[o[0]],s=r[i];if(!Array.isArray(s))throw new E(`Invalid operation value "${JSON.stringify(s)}" of key "${i}, expected value to be Array.`);return n+s.reduce(((e,r)=>e+t(r)),"")}return n+(0,e[o])(r[i])}),""),xe=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(Array.isArray(o)){const t=e[o[0]],s=[],a=r.length();for(;r.length()>0;)if(s.push(t(r)),a===r.length())throw new _("Unable to decode value");return Object.assign(Object.assign({},n),{[i]:s})}{const t=(0,e[o])(r);return void 0!==t?Object.assign(Object.assign({},n),{[i]:t}):Object.assign({},n)}}),{}),Me={[c.SECRET]:e=>s(e.consume(20)),[c.RAW]:e=>s(e.consume(32)),[c.TZ1]:z,[c.BRANCH]:W,[c.ZARITH]:ne,[c.PUBLIC_KEY]:e=>{switch(e.consume(1)[0]){case 0:return V(n.Prefix.EDPK)(e);case 1:return V(n.Prefix.SPPK)(e);case 2:return V(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))}},[c.PKH]:q,[c.PKH_ARR]:e=>{if(!ee(e))return;const t=[];for(e.consume(4);e.length()>0;)t.push(q(e));return t},[c.DELEGATE]:e=>{if(ee(e))return q(e)},[c.INT32]:e=>{const t=e.consume(4);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.SCRIPT]:e=>{const t=M(e),r=M(e);return{code:x(new R(t)),storage:x(new R(r))}},[c.BALLOT_STATEMENT]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new v(t[0].toString())}},[c.PROPOSAL]:Q,[c.PROPOSAL_ARR]:e=>{const t=[];for(e.consume(4);e.length()>0;)t.push(Q(e));return t},[c.PARAMETERS]:e=>{if(0!==e.consume(1)[0]){const t=(e=>{const t=a(e.consume(1)[0],2);if(t in h)return h[t];{const t=M(e,1),r=Buffer.from(t).toString("utf8");if(r.length>31)throw new m(r);return r}})(e),r=M(e);return{entrypoint:t,value:x(new R(r))}}},[c.ADDRESS]:e=>{switch(e.consume(1)[0]){case 0:return q(e);case 1:{const t=V(n.Prefix.KT1)(e);return e.consume(1),t}default:throw new i.InvalidAddressError(e.toString(),": Unable to decode.")}},[c.SMART_ROLLUP_ADDRESS]:e=>{const t=V(n.Prefix.SR1)(e);if(t.substring(0,3)!==n.Prefix.SR1)throw new S(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return t},[c.SMART_CONTRACT_ADDRESS]:e=>{if(1===e.consume(1)[0]){const t=V(n.Prefix.KT1)(e);return e.consume(1),t}throw new i.InvalidContractAddressError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{const t=V(n.Prefix.SRC1)(e);if(t.substring(0,4)!==n.Prefix.SRC1)throw new P(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`);return t},[c.VALUE]:e=>{const t=M(e);return x(new R(t))},[c.INT16]:e=>{const t=e.consume(2);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.BLOCK_PAYLOAD_HASH]:oe,[c.ENTRYPOINT]:e=>{const t=M(e);return Buffer.from(t).toString("utf8")},[c.BURN_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return ne(e)},[c.DEPOSITS_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return ne(e)},[c.PVM_KIND]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"arith";case 1:return"wasm_2_0_0";case 2:return"riscv";default:throw new A(t[0].toString())}},[c.PADDED_BYTES]:e=>{const t=M(e);return Buffer.from(t).toString("hex")},[c.SMART_ROLLUP_MESSAGE]:e=>{const t=M(e);return((e,t=4)=>{const r=[];let n=e;for(;n.length();){const e=n.consume(t),i=parseInt(Buffer.from(e).toString("hex"),16);r.push(n.consume(i)),n=n.slice(i+t)}return r})(new R(t)).map((e=>Buffer.from(e).toString("hex")))},[c.SLOT_HEADER]:e=>{const t=e.consume(1);return{slot_index:Number(t[0].toString(10)),commitment:se(e),commitment_proof:s(e.consume(96))}}};Me[c.OPERATION]=(e=>t=>{const r=t.consume(1),n=d[r[0]];if(void 0===n)throw new w(r[0].toString());const i=e[n](t);if("object"!=typeof i)throw new _("Invalid operation, cannot be decoded.");return Object.assign({kind:n},i)})(Me),Me[c.OP_ACTIVATE_ACCOUNT]=e=>xe(Me)(ce)(e),Me[c.OP_FAILING_NOOP]=e=>xe(Me)(Re)(e),Me[c.OP_DELEGATION]=e=>xe(Me)(le)(e),Me[c.OP_TRANSACTION]=e=>xe(Me)(de)(e),Me[c.OP_ORIGINATION]=e=>xe(Me)(fe)(e),Me[c.OP_BALLOT]=e=>xe(Me)(he)(e),Me[c.OP_ATTESTATION]=e=>xe(Me)(pe)(e),Me[c.OP_ATTESTATION_WITH_DAL]=e=>xe(Me)(be)(e),Me[c.OP_SEED_NONCE_REVELATION]=e=>xe(Me)(me)(e),Me[c.OP_PROPOSALS]=e=>xe(Me)(ge)(e),Me[c.OP_REVEAL]=e=>xe(Me)(ue)(e),Me[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>xe(Me)(ve)(e),Me[c.OP_TRANSFER_TICKET]=e=>xe(Me)(ye)(e),Me[c.OP_INCREASE_PAID_STORAGE]=e=>xe(Me)(_e)(e),Me[c.OP_UPDATE_CONSENSUS_KEY]=e=>xe(Me)(Ee)(e),Me[c.OP_DRAIN_DELEGATE]=e=>xe(Me)(we)(e),Me[c.OP_SMART_ROLLUP_ORIGINATE]=e=>xe(Me)(Ae)(e),Me[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>xe(Me)(Se)(e),Me[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>xe(Me)(Pe)(e),Me[c.OP_DAL_PUBLISH_COMMITMENT]=e=>xe(Me)(Te)(e),Me[c.MANAGER]=xe(Me)(ae),Me[c.OP_SET_DEPOSITS_LIMIT]=e=>xe(Me)(Oe)(e);const ke={[c.SECRET]:e=>e,[c.RAW]:e=>e,[c.TZ1]:Y,[c.BRANCH]:Z,[c.ZARITH]:re,[c.PUBLIC_KEY]:e=>{switch(e.substring(0,4)){case n.Prefix.EDPK:return"00"+$(n.Prefix.EDPK)(e);case n.Prefix.SPPK:return"01"+$(n.Prefix.SPPK)(e);case n.Prefix.P2PK:return"02"+$(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following '${n.Prefix.EDPK}', '${n.Prefix.SPPK}', '${n.Prefix.P2PK}' or '${n.Prefix.BLPK}'.`)}},[c.PKH]:te,[c.PKH_ARR]:e=>{if(!e)return J(!1);if(0===e.length)return J(!0)+a(0);const t=e.reduce(((e,t)=>e+te(t)),"");return J(!0)+a(t.length/2)+t},[c.DELEGATE]:e=>e?J(!0)+te(e):J(!1),[c.SCRIPT]:e=>{const t=I(e.code),r=I(e.storage);return`${a(t.length/2,8)}${t}${a(r.length/2,8)}${r}`},[c.BALLOT_STATEMENT]:e=>{switch(e){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new g(e)}},[c.PROPOSAL]:X,[c.PROPOSAL_ARR]:e=>a(32*e.length)+e.map((e=>X(e))).join(""),[c.INT32]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<4;e++){const n=8*(4-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.PARAMETERS]:e=>{if(!e||"default"===e.entrypoint&&"prim"in e.value&&"Unit"===e.value.prim)return"00";const t=(e=>{if(e in p)return`${p[e]}`;if(e.length>31)throw new m(e);return`ff${I({string:e}).slice(8)}`})(e.entrypoint),r=I(e.value);return`ff${t}${a(r.length/2)}${r}`},[c.ADDRESS]:e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:case n.Prefix.TZ2:case n.Prefix.TZ3:case n.Prefix.TZ4:return"00"+te(e);case n.Prefix.KT1:return"01"+$(n.Prefix.KT1)(e)+"00";default:throw new i.InvalidAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${n.Prefix.TZ1}', ${n.Prefix.TZ2}', '${n.Prefix.TZ3}', '${n.Prefix.TZ4}' or '${n.Prefix.KT1}'.`)}},[c.SMART_ROLLUP_ADDRESS]:e=>{if(e.substring(0,3)!==n.Prefix.SR1)throw new S(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return $(n.Prefix.SR1)(e)},[c.SMART_CONTRACT_ADDRESS]:e=>{if(e.substring(0,3)===n.Prefix.KT1)return"01"+$(n.Prefix.KT1)(e)+"00";throw new i.InvalidContractAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.KT1}'.`)},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{if(e.substring(0,4)===n.Prefix.SRC1)return $(n.Prefix.SRC1)(e);throw new P(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`)},[c.VALUE]:e=>{const t=I(e);return`${a(t.length/2)}${t}`},[c.INT16]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<2;e++){const n=8*(2-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.BLOCK_PAYLOAD_HASH]:ie,[c.ENTRYPOINT]:e=>`${I({string:e}).slice(2)}`,[c.BURN_LIMIT]:e=>e?`ff${re(e)}`:"00",[c.DEPOSITS_LIMIT]:e=>e?`ff${re(e)}`:"00",[c.PVM_KIND]:e=>{switch(e){case"arith":return"00";case"wasm_2_0_0":return"01";case"riscv":return"02";default:throw new O(e)}},[c.PADDED_BYTES]:(e,t=8)=>`${a(e.length/2,t)}${e}`,[c.SMART_ROLLUP_MESSAGE]:e=>{const t=e.reduce(((e,t)=>e+`${a(t.length/2)}${t}`),"");return`${a(t.length/2)}${t}`},[c.SLOT_HEADER]:e=>a(e.slot_index,2)+(e=>{if(e.substring(0,2)===n.Prefix.SH)return $(n.Prefix.SH)(e);throw new T(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SH}'`)})(e.commitment)+e.commitment_proof};ke[c.OPERATION]=(e=>t=>{if(!(t.kind in e)||!(t.kind in f))throw new i.InvalidOperationKindError(t.kind);return f[t.kind]+e[t.kind](t)})(ke),ke[c.OP_ACTIVATE_ACCOUNT]=e=>Ie(ke)(ce)(e),ke[c.OP_DELEGATION]=e=>Ie(ke)(le)(e),ke[c.OP_TRANSACTION]=e=>Ie(ke)(de)(e),ke[c.OP_ORIGINATION]=e=>Ie(ke)(fe)(e),ke[c.OP_BALLOT]=e=>Ie(ke)(he)(e),ke[c.OP_ATTESTATION]=e=>Ie(ke)(pe)(e),ke[c.OP_ATTESTATION_WITH_DAL]=e=>Ie(ke)(be)(e),ke[c.OP_SEED_NONCE_REVELATION]=e=>Ie(ke)(me)(e),ke[c.OP_PROPOSALS]=e=>Ie(ke)(ge)(e),ke[c.OP_REVEAL]=e=>Ie(ke)(ue)(e),ke[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>Ie(ke)(ve)(e),ke[c.OP_TRANSFER_TICKET]=e=>Ie(ke)(ye)(e),ke[c.OP_INCREASE_PAID_STORAGE]=e=>Ie(ke)(_e)(e),ke[c.OP_UPDATE_CONSENSUS_KEY]=e=>Ie(ke)(Ee)(e),ke[c.OP_DRAIN_DELEGATE]=e=>Ie(ke)(we)(e),ke[c.OP_SMART_ROLLUP_ORIGINATE]=e=>Ie(ke)(Ae)(e),ke[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>Ie(ke)(Se)(e),ke[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>Ie(ke)(Pe)(e),ke[c.OP_DAL_PUBLISH_COMMITMENT]=e=>Ie(ke)(Te)(e),ke[c.MANAGER]=Ie(ke)(ae),ke[c.OP_SET_DEPOSITS_LIMIT]=e=>Ie(ke)(Oe)(e),ke[c.OP_FAILING_NOOP]=e=>Ie(ke)(Re)(e);const Le={activate_account:ce,reveal:ue,delegation:le,transaction:de,origination:fe,ballot:he,attestation:pe,attestation_with_dal:be,seed_nonce_revelation:me,proposals:ge,register_global_constant:ve,transfer_ticket:ye,increase_paid_storage:_e,update_consensus_key:Ee,drain_delegate:we,set_deposits_limit:Oe,smart_rollup_originate:Ae,smart_rollup_add_messages:Se,smart_rollup_execute_outbox_message:Pe,dal_publish_commitment:Te,failing_noop:Re},Ce=e=>{const t=e.kind,r=Object.keys(e),n=(i="kind",r.filter((e=>e!==i)));var i;const o=Object.keys(Le[t]);return s=n,o.filter((e=>!s.includes(e)));var s};var Ne;!function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",e.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",e.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",e.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(Ne||(Ne={}));const je={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"},De=Ne.PsQuebecn;function Ue(e,t){return{encoder:ke[e],decoder:t=>{const r=R.fromHexString(t);return Me[e](r)}}}class Be{constructor(e=De){this.protocolHash=e,this.codec=Ue(c.MANAGER,this.protocolHash)}forge(e){const t=(0,n.validateBlock)(e.branch);if(t!==n.ValidationResult.VALID)throw new i.InvalidBlockHashError(e.branch,(0,n.invalidDetail)(t));for(const t of e.contents){if(r=t.kind,!Object.keys(Le).includes(r))throw new i.InvalidOperationKindError(t.kind);const e=Ce(t);if(1===e.length){if("delegation"===t.kind&&"delegate"===e[0])continue;if("origination"===t.kind&&"delegate"===e[0])continue;if("transaction"===t.kind&&"parameters"===e[0])continue;if("set_deposits_limit"===t.kind&&"limit"===e[0])continue;if("smart_rollup_originate"===t.kind&&"whitelist"===e[0])continue;throw new b(t,`missing properties "${e.join(", ")}"`)}if(e.length>1)throw new b(t,`missing properties "${e.join(", ")}"`)}var r;const o=this.codec.encoder(e).toLowerCase();return Promise.resolve(o)}parse(e){return Promise.resolve(this.codec.decoder(e))}}const Fe=new Be},5899:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Contract:()=>nr,DefaultProtocol:()=>b,JSONParseError:()=>j,MacroError:()=>y,MichelineParseError:()=>N,MichelsonError:()=>ue,MichelsonInstructionError:()=>Nt,MichelsonTypeError:()=>de,MichelsonValidationError:()=>ke,Parser:()=>K,ProtoGreaterOrEqual:()=>g,ProtoInferiorTo:()=>v,Protocol:()=>p,VERSION:()=>cr,assertContractValid:()=>Zt,assertDataListIfAny:()=>ot,assertDataValid:()=>Yt,assertMichelsonBigMapStorableType:()=>We,assertMichelsonComparableType:()=>He,assertMichelsonContract:()=>Qe,assertMichelsonData:()=>Xe,assertMichelsonInstruction:()=>Ke,assertMichelsonPackableType:()=>Ge,assertMichelsonPassableType:()=>ze,assertMichelsonPushableType:()=>$e,assertMichelsonStorableType:()=>Ve,assertMichelsonType:()=>Ye,assertTypeAnnotationsValid:()=>Ft,assertTypesEqual:()=>Xt,assertViewNameValid:()=>Ze,contractEntryPoint:()=>Wt,contractEntryPoints:()=>qt,contractSection:()=>$t,contractViews:()=>Vt,decodeAddressBytes:()=>kt,decodePublicKeyBytes:()=>Ct,decodePublicKeyHashBytes:()=>Lt,dummyContract:()=>ir,emitMicheline:()=>z,formatError:()=>ar,formatStack:()=>or,functionType:()=>Jt,instructionIDs:()=>Ie,isContractValid:()=>er,isDataValid:()=>tr,isInstruction:()=>it,isMichelsonCode:()=>rt,isMichelsonData:()=>tt,isMichelsonError:()=>le,isMichelsonScript:()=>et,isMichelsonType:()=>nt,isTypeAnnotationsValid:()=>Qt,isTypeEqual:()=>rr,packData:()=>Pt,packDataBytes:()=>Tt,refContract:()=>h,sourceReference:()=>i,traceDumpFunc:()=>sr,unpackData:()=>xt,unpackDataBytes:()=>Mt});var n=r(6571);const i=Symbol("source_reference");class o extends n.TaquitoError{constructor(e,t,r){super(),this.src=e,this.idx=t,this.message=r,this.name="ScanError"}}var s;!function(e){e[e.Comment=0]="Comment",e[e.Number=1]="Number",e[e.String=2]="String",e[e.Bytes=3]="Bytes",e[e.Ident=4]="Ident"}(s||(s={}));const a=new RegExp("\\s"),c=new RegExp("[:@%_A-Za-z]"),u=new RegExp("[@%_\\.A-Za-z0-9]"),l=new RegExp("[0-9]"),d=new RegExp("[0-9a-fA-F]");function*f(e,t=!1){let r=0;for(;r<e.length;){for(;r<e.length&&a.test(e[r]);)r++;if(r===e.length)return;const n=e[r],i=r;if(c.test(n)){for(r++;r<e.length&&u.test(e[r]);)r++;yield{t:s.Ident,v:e.slice(i,r),first:i,last:r}}else if(e.length-r>1&&"0x"===e.substring(r,r+2)){for(r+=2;r<e.length&&d.test(e[r]);)r++;if(r-i&1)throw new o(e,r,"Bytes literal length is expected to be power of two");yield{t:s.Bytes,v:e.slice(i,r),first:i,last:r}}else if(l.test(n)||"-"===n){"-"===n&&r++;const t=r;for(;r<e.length&&l.test(e[r]);)r++;if(t===r)throw new o(e,r,"Number literal is too short");yield{t:s.Number,v:e.slice(i,r),first:i,last:r}}else if('"'===n){r++;let t=!1;for(;r<e.length&&(t||'"'!==e[r]);r++)t=!t&&"\\"===e[r];if(r===e.length)throw new o(e,r,"Unterminated string literal");r++,yield{t:s.String,v:e.slice(i,r),first:i,last:r}}else if("#"===n){for(r++;r<e.length&&"\n"!==e[r];)r++;t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else if(e.length-r>1&&"/*"===e.substring(r,r+2)){for(r+=2;r<e.length&&!(e.length-r>1&&"*/"===e.substring(r,r+2));)r++;if(r===e.length)throw new o(e,r,"Unterminated C style comment");r+=2,t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else{if("("!==n&&")"!==n&&"{"!==n&&"}"!==n&&";"!==n)throw new o(e,r,`Invalid character at offset ${r}: \`${n}'`);r++,yield{t:n,v:n,first:i,last:r}}}}const h=Symbol("ref_contract");var p;!function(e){e.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",e.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",e.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",e.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",e.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",e.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",e.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(p||(p={}));const b=p.PsQuebecn,m={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW:15,PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc:16,PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1:16,PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf:17,ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH:19,PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ:20,PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi:20,PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg:21,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:22};function g(e,t){return m[e]>=m[t]}function v(e,t){return m[e]<m[t]}class y extends n.TaquitoError{constructor(e,t){super(),this.prim=e,this.message=t,this.name="MacroError"}}function _(e,t){var r,n;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new y(e,`macro ${e.prim} expects ${t} arguments, was given ${null===(n=e.args)||void 0===n?void 0:n.length}`)}function E(e){if(void 0===e.annots)return!0;throw new y(e,`unexpected annotation on macro ${e.prim}: ${e.annots}`)}function w(e,t){if("int"in t)return!0;throw new y(e,`macro ${e.prim} expects int argument`)}function O(e,t,r,n){let i=0,o=0;const s=[null,null];let a;if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);let c,u=t[i++];switch(u){case"P":{const{r:s,n:c,an:u}=O(e,t.slice(i),r.slice(o),n);a=s,i+=c,o+=u;break}case"A":o!==r.length&&(s[0]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);switch(u=t[i++],u){case"P":{const{r:s,n:a,an:u}=O(e,t.slice(i),r.slice(o),n);c=s.map((([e,t])=>[e+1,t])),i+=a,o+=u;break}case"I":o!==r.length&&(s[1]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}return{r:n(a,c,[0,s]),n:i,an:o}}function A(e,t,r,n){const i=t[0];switch(i){case"A":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},A(e,t.slice(1),[],n)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...r]}]:n.a;case"D":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},A(e,t.slice(1),[],n)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...r]}]:n.d;default:throw new y(e,`${e.prim}: unexpected character: ${i}`)}}function S(e,t){let r=e.length;for(;r>0&&e[r-1]===t;)r--;return e.slice(0,r)}function P(e){const t=[],r=[];if(void 0!==e)for(const n of e)(0!==n.length&&"%"===n[0]?t:r).push(n);return{fields:t,rest:r}}function T({prim:e,annots:t,args:r}){return Object.assign(Object.assign({prim:e},t&&{annots:t}),r&&{args:r})}const R=/^P[PAI]{3,}R$/,I=/^UNP[PAI]{2,}R$/,x=/^C[AD]{2,}R$/,M=/^SET_C[AD]+R$/,k=/^MAP_C[AD]+R$/,L=/^DI{2,}P$/,C=/^DU+P$/;class N extends n.TaquitoError{constructor(e,t){super(),this.token=e,this.message=t,this.name="MichelineParseError"}}class j extends n.TaquitoError{constructor(e,t){super(),this.node=e,this.message=t,this.name="JSONParseError"}}const D=new N(null,"Unexpected EOF");function U(e){return e.t===s.Ident&&("@"===e.v[0]||"%"===e.v[0]||":"===e.v[0])}const B=new RegExp("^-?[0-9]+$"),F=new RegExp("^([0-9a-fA-F]{2})*$");class K{constructor(e){this.opt=e}expand(e){var t,r,n;if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.expandGlobalConstant)&&"constant"===e.prim){const t=function(e,t){return void 0!==e.args&&1===e.args.length&&"string"in e.args[0]&&e.args[0].string in t?t[e.args[0].string]:e}(e,this.opt.expandGlobalConstant);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{globalConstant:e})),t}if(void 0===(null===(r=this.opt)||void 0===r?void 0:r.expandMacros)||(null===(n=this.opt)||void 0===n?void 0:n.expandMacros)){const t=function(e,t){const r=(null==t?void 0:t.protocol)||b;function n(e){return void 0!==e?[{prim:"RENAME",annots:e}]:[]}switch(e.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(_(e,0))return[{prim:"COMPARE"},T({prim:e.prim.slice(3),annots:e.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(_(e,2))return[{prim:e.prim.slice(2)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(_(e,2))return[{prim:"COMPARE"},{prim:e.prim.slice(5)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"FAIL":if(_(e,0)&&E(e))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(_(e,0)&&E(e))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(_(e,0)&&E(e))return[{prim:e.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(_(e,0)&&E(e))return[[{prim:"COMPARE"},{prim:e.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(_(e,0)&&E(e))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(_(e,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"ASSERT_LEFT":if(_(e,0))return[{prim:"IF_LEFT",args:[n(e.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(_(e,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"IF_SOME":if(_(e,2))return[T({prim:"IF_NONE",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"IF_RIGHT":if(_(e,2))return[T({prim:"IF_LEFT",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"CAR":case"CDR":if(void 0===e.args)return e;if(_(e,1)&&w(e,e.args[0])){const t=parseInt(e.args[0].int,10);return T({prim:"GET",args:[{int:"CAR"===e.prim?String(2*t+1):String(2*t)}],annots:e.annots})}}if(R.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots),{r:n}=O(e,e.prim.slice(1),t,((e,t,r)=>[...e||[],...t||[],r]));return n.map((([e,t],i)=>{const o=[...S(t,null).map((e=>null===e?"%":e)),...0===e&&i===n.length-1?r:[]],s=T({prim:"PAIR",annots:0!==o.length?o:void 0});return 0===e?s:{prim:"DIP",args:1===e?[[s]]:[{int:String(e)},[s]]}}))}if(I.test(e.prim)){if(v(r,p.PtEdo2Zk)&&_(e,0)){const{r:t}=O(e,e.prim.slice(3),e.annots||[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e,t])=>{const r=[{prim:"DUP"},T({prim:"CAR",annots:null!==t[0]?[t[0]]:void 0}),{prim:"DIP",args:[[T({prim:"CDR",annots:null!==t[1]?[t[1]]:void 0})]]}];return 0===e?r:{prim:"DIP",args:1===e?[[r]]:[{int:String(e)},[r]]}}))}if("UNPAIR"===e.prim)return e;if(_(e,0)){const{r:t}=O(e,e.prim.slice(3),[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e])=>{const t=T({prim:"UNPAIR"});return 0===e?t:{prim:"DIP",args:1===e?[[t]]:[{int:String(e)},[t]]}}))}}if(x.test(e.prim)&&_(e,0)){const t=[...e.prim.slice(1,e.prim.length-1)];return t.map(((r,n)=>{const i=n===t.length-1?e.annots:void 0;switch(r){case"A":return T({prim:"CAR",annots:i});case"D":return T({prim:"CDR",annots:i});default:throw new y(e,`unexpected character: ${r}`)}}))}if(M.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const n=0!==t.length?{a:[{prim:"DUP"},{prim:"CAR",annots:t},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[t[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:t},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",t[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return A(e,e.prim.slice(5,e.prim.length-1),r,n)}if(k.test(e.prim)&&_(e,1)){const{fields:t}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const r={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[T({prim:"CAR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[0!==t.length?t[0]:"%","%@"]}],d:[{prim:"DUP"},T({prim:"CDR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",0!==t.length?t[0]:"%"]}]};return A(e,e.prim.slice(5,e.prim.length-1),[],r)}if(L.test(e.prim)&&_(e,1)){let t=0;for(;"I"===e.prim[1+t];)t++;return T({prim:"DIP",args:[{int:String(t)},e.args[0]]})}if(C.test(e.prim)){let t=0;for(;"U"===e.prim[1+t];)t++;if(v(r,p.PtEdo2Zk)){if(1===t){if(void 0===e.args)return e;_(e,1)&&w(e,e.args[0])&&(t=parseInt(e.args[0].int,10))}else _(e,0);return 1===t?[T({prim:"DUP",annots:e.annots})]:2===t?[{prim:"DIP",args:[[T({prim:"DUP",annots:e.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(t-1)},[T({prim:"DUP",annots:e.annots})]]},{prim:"DIG",args:[{int:String(t)}]}]}if(1===t)return e;if(_(e,0))return T({prim:"DUP",args:[{int:String(t)}],annots:e.annots})}return e}(e,this.opt);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{macro:e})),t}return e}parseListExpr(e,t){var r;const n={first:t.first,last:t.last},o="("===t.t;let a;if(o){if(a=e.next(),a.done)throw D;n.last=a.value.last}else a={value:t};if(a.value.t!==s.Ident)throw new N(a.value,`not an identifier: ${a.value.v}`);const c={prim:a.value.v,[i]:n};for(;;){const t=e.next();if(t.done){if(o)throw D;break}if(")"===t.value.t){if(!o)throw new N(t.value,"unexpected closing bracket");n.last=t.value.last;break}if(U(t.value))c.annots=c.annots||[],c.annots.push(t.value.v),n.last=t.value.last;else{c.args=c.args||[];const o=this.parseExpr(e,t.value);n.last=(null===(r=o[i])||void 0===r?void 0:r.last)||n.last,c.args.push(o)}}return this.expand(c)}parseArgs(e,t){var r;const n={first:t.first,last:t.last},o={prim:t.v,[i]:n};for(;;){const t=e.next();if(t.done||"}"===t.value.t||";"===t.value.t)return[o,t];if(U(t.value))n.last=t.value.last,o.annots=o.annots||[],o.annots.push(t.value.v);else{const s=this.parseExpr(e,t.value);n.last=(null===(r=s[i])||void 0===r?void 0:r.last)||n.last,o.args=o.args||[],o.args.push(s)}}}parseSequenceExpr(e,t){var r,n;const o={first:t.first,last:t.last},a=[];a[i]=o;const c="{"===t.t;let u="{"===t.t?null:{value:t};for(;;){if(null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done){if(c)throw D;return a}if("}"===u.value.t){if(c)return a;throw new N(u.value,"unexpected closing bracket")}if(u.value.t===s.Ident){const[t,n]=this.parseArgs(e,u.value);o.last=(null===(r=t[i])||void 0===r?void 0:r.last)||o.last,a.push(this.expand(t)),u=n}else{const t=this.parseExpr(e,u.value);o.last=(null===(n=t[i])||void 0===n?void 0:n.last)||o.last,a.push(t),u=null}null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done||";"!==u.value.t||(u=null)}}parseExpr(e,t){switch(t.t){case s.Ident:return this.expand({prim:t.v,[i]:{first:t.first,last:t.last}});case s.Number:return{int:t.v,[i]:{first:t.first,last:t.last}};case s.String:return{string:JSON.parse(t.v),[i]:{first:t.first,last:t.last}};case s.Bytes:return{bytes:t.v.slice(2),[i]:{first:t.first,last:t.last}};case"{":return this.parseSequenceExpr(e,t);default:return this.parseListExpr(e,t)}}parseSequence(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=f(e),r=t.next();return r.done?null:this.parseSequenceExpr(t,r.value)}parseList(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=f(e),r=t.next();return r.done?null:this.parseListExpr(t,r.value)}parseMichelineExpression(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=f(e),r=t.next();return r.done?null:this.parseExpr(t,r.value)}parseScript(e){return this.parseSequence(e)}parseData(e){return this.parseList(e)}parseJSON(e){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);if(Array.isArray(e)){const t=[];for(const r of e){if(null===r||"object"!=typeof r)throw new j(r,`unexpected sequence element: ${r}`);t.push(this.parseJSON(r))}return t}if("prim"in e){const t=e;if("string"==typeof t.prim&&(void 0===t.annots||Array.isArray(t.annots))&&(void 0===t.args||Array.isArray(t.args))){const e={prim:t.prim};if(void 0!==t.annots){for(const e of t.annots)if("string"!=typeof e)throw new j(e,`string expected: ${e}`);e.annots=t.annots}if(void 0!==t.args){e.args=[];for(const r of t.args){if(null===r||"object"!=typeof r)throw new j(r,`unexpected argument: ${r}`);e.args.push(this.parseJSON(r))}}return this.expand(e)}throw new j(e,`malformed prim expression: ${e}`)}if("string"in e){if("string"==typeof e.string)return{string:e.string};throw new j(e,`malformed string literal: ${e}`)}if("int"in e){if("string"==typeof e.int&&B.test(e.int))return{int:e.int};throw new j(e,`malformed int literal: ${e}`)}if("bytes"in e){if("string"==typeof e.bytes&&F.test(e.bytes))return{bytes:e.bytes};throw new j(e,`malformed bytes literal: ${e}`)}throw new j(e,`unexpected object: ${e}`)}}class H{constructor(e,t=0){this.opt=e,this.lev=t}indent(e=0){var t;let r="";if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.indent))for(let t=this.lev+e;t>0;t--)r+=this.opt.indent;return r}get lf(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||""}get lfsp(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||" "}down(e){return new H(this.opt,this.lev+e)}}function G(e){return"prim"in e&&(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length)}function $(e){if(void 0!==e.args)for(const t of e.args)if(Array.isArray(t)||G(t))return!0;return!1}function V(e,t,r){var n;const o=null===(n=e[i])||void 0===n?void 0:n.macro;if(r&&o)return V(o,t,r);if(Array.isArray(e))return function(e,t,r){let n="{"+t.lf,i=e.length;for(const o of e){if(n+=t.indent(1),"prim"in o){if(n+=o.prim,void 0!==o.annots)for(const e of o.annots)n+=" "+e;if(void 0!==o.args){const e=$(o);for(const i of o.args)n+=e?t.lfsp+t.indent(2)+V(i,t.down(2),r):" "+V(i,t,r)}}else n+=V(o,t.down(1),r);n+=i>1?";"+t.lfsp:t.lf,i--}return n+t.indent()+"}"}(e,t,r);if("string"in e)return JSON.stringify(e.string);if("int"in e)return e.int;if("bytes"in e)return"0x"+e.bytes;{if(!(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length))return e.prim;let n="("+e.prim;if(void 0!==e.annots)for(const t of e.annots)n+=" "+t;if(void 0!==e.args){const i=$(e);for(const o of e.args)n+=i?t.lfsp+t.indent(1)+V(o,t.down(1),r):" "+V(o,t,r)}return n+")"}}function z(e,t,r=!1){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);return V(e,new H(t),r)}const W=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],q=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Z extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="Base58DecodingError"}}function Y(e){const t=(e.length+9)%64,r=0===t?0:64-t;if(e.length>268435455)throw new n.InvalidMessageError("",`: Invalid length ${e.length} is too big -- SHA-256.`);const i=e.length<<3,o=[...e,128,...new Array(r).fill(0),0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i];function s(e,t){return e>>>t|e<<32-t}const a=[...W],c=new Array(64),u=new Array(8);for(let e=0;e<o.length;e+=64){let t=e,r=0;for(;r<16;)c[r]=o[t]<<24|o[t+1]<<16|o[t+2]<<8|o[t+3],t+=4,r++;for(;r<64;){const e=s(c[r-15],7)^s(c[r-15],18)^c[r-15]>>>3,t=s(c[r-2],17)^s(c[r-2],19)^c[r-2]>>>10;c[r]=(0|t)+c[r-7]+e+c[r-16]|0,r++}for(let e=0;e<8;e++)u[e]=a[e];for(let e=0;e<64;e++){const t=s(u[0],2)^s(u[0],13)^s(u[0],22),r=s(u[4],6)^s(u[4],11)^s(u[4],25),n=u[7]+r+(u[4]&u[5]^~u[4]&u[6])+q[e]+c[e]|0,i=t+(u[0]&u[1]^u[0]&u[2]^u[1]&u[2])|0;u[7]=u[6],u[6]=u[5],u[5]=u[4],u[4]=u[3]+n|0,u[3]=u[2],u[2]=u[1],u[1]=u[0],u[0]=n+i|0}for(let e=0;e<8;e++)a[e]=a[e]+u[e]|0}const l=[];for(const e of a)l.push(e>>24&255),l.push(e>>16&255),l.push(e>>8&255),l.push(255&e);return l}const J=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],X=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function Q(e,t){const r=e.charCodeAt(t)-49;if(r>=J.length||-1===J[r])throw new Z(`Unexpected character at position ${t}: ${e[t]}`);return J[r]}function ee(e){const t=function(e){const t=[];let r=0;for(;r<e.length&&0===Q(e,r);)r++;let n=r;for(;r<e.length;){let n=Q(e,r++),i=0;for(;0!==n||i<t.length;){const e=58*(t[i]||0)+n;t[i++]=e%256,n=Math.floor(e/256)}}for(;n-- >0;)t.push(0);return t.reverse()}(e);if(t.length<4)throw new Z(`Data is too short ${t.length}`);const r=t.slice(0,t.length-4),n=t.slice(t.length-4),i=Y(Y(r));if(n[0]!==i[0]||n[1]!==i[1]||n[2]!==i[2]||n[3]!==i[3])throw new Z("Invalid checksum");return r}function te(e){const t=Y(Y(e));return function(e){const t=[];let r=0;for(;r<e.length&&0===e[r];)r++;let n=r;for(;r<e.length;){let n=e[r++],i=0;for(;0!==n||i<t.length;){const e=256*(t[i]||0)+n;t[i++]=e%58,n=Math.floor(e/58)}}for(;n-- >0;)t.push(0);return t.reverse(),String.fromCharCode(...t.map((e=>X[e]+49)))}([...e,...t.slice(0,4)])}class re extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidMichelsonError"}}class ne extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidTypeExpressionError"}}class ie extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidDataExpressionError"}}class oe extends n.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="InvalidEntrypointError",this.message=`Contract has no entrypoint named: "${e}"`}}class se extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="TezosIdEncodeError"}}class ae extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="LongIntegerError"}}class ce extends n.TaquitoError{constructor(e){super(),this.hexByte=e,this.name="HexParseError",this.message=`Unable to parse hex byte "${e}"`}}class ue extends n.TaquitoError{constructor(e,t){super(),this.val=e,this.message=t,this.name="MichelsonError"}}function le(e){return e instanceof ue}class de extends ue{constructor(e,t,r){super(e,t),this.val=e,this.message=t,this.name="MichelsonTypeError",void 0!==r&&(this.data=r)}}class fe{append(e){let t=0;for(;0!==e||t<this.buf.length;){const r=10*(this.buf[t]||0)+e;this.buf[t++]=r%256,e=Math.floor(r/256)}}constructor(e){if(this.neg=!1,this.buf=[],void 0!==e)if("string"==typeof e)for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(0===t&&45===r)this.neg=!0;else{if(r<48||r>57)throw new ae(`unexpected character in integer constant "${e[t]}"`);this.append(r-48)}}else e<0?(this.neg=!0,this.append(-e)):this.append(e)}cmp(e){if(this.neg!==e.neg)return(e.neg?1:0)-(this.neg?1:0);{let t=0;if(this.buf.length!==e.buf.length)t=this.buf.length<e.buf.length?-1:1;else if(0!==this.buf.length){let r=e.buf.length-1;for(;r>=0&&this.buf[r]===e.buf[r];)r--;t=r<0?0:this.buf[r]<e.buf[r]?-1:1}return this.neg?0===t?0:-t:t}}get sign(){return 0===this.buf.length?0:this.neg?-1:1}}function he(e){const t=[];for(let r=0;r<e.length;r+=2){const n=parseInt(e.slice(r,r+2),16);if(Number.isNaN(n))return null;t.push(n)}return t}function pe(e){try{return new fe(e),!0}catch(e){return!1}}function be(e){try{return new fe(e).sign>=0}catch(e){return!1}}const me=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function ge(e,t){if(Array.isArray(e))return{};let r,n,i;if(void 0!==e.annots)for(const o of e.annots)if(0!==o.length){if(!me.test(o)||!(null==t?void 0:t.specialVar)&&("@%"===o||"@%%"===o)||!(null==t?void 0:t.specialFields)&&"%@"===o)throw new ue(e,`${e.prim}: unexpected annotation: ${o}`);switch(o[0]){case"%":((null==t?void 0:t.emptyFields)||o.length>1)&&(r=r||[],r.push(o));break;case":":o.length>1&&(n=n||[],n.push(o));break;case"@":((null==t?void 0:t.emptyVar)||o.length>1)&&(i=i||[],i.push(o))}}return{f:r,t:n,v:i}}const ve={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]]};function ye(e,...t){const r=ee(e);for(const e of t){const[t,n]=ve[e];if(r.length===t+n.length){let t=0;for(;t<n.length&&r[t]===n[t];)t++;if(t===n.length)return[e,r.slice(n.length)]}}return null}function _e(e,t){const[r,n]=ve[e];if(t.length!==r)throw new se(`Incorrect data length for ${e}: ${t.length}`);return te([...n,...t])}function Ee(e,t){const r=t,n=Array.isArray(r)?r:r.args;if(2===n.length){return"pair"===e?{prim:"pair",args:n}:{prim:"Pair",args:n}}return Object.assign(Object.assign({},Array.isArray(r)?{prim:e}:r),{args:[n[0],{prim:e,args:n.slice(1)}]})}function we(e){return Array.isArray(e)||"pair"===e.prim}function Oe(e){return Array.isArray(e)||"prim"in e&&"Pair"===e.prim}const Ae=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function Se(e){if("string"in e){if(be(e.string))return new Date(parseInt(e.string,10));if(Ae.test(e.string)){const t=new Date(e.string);if(!Number.isNaN(t.valueOf))return t}}else if(pe(e.int))return new Date(parseInt(e.int,10));return null}function Pe(e){return e.map((e=>(e>>4&15).toString(16)+(15&e).toString(16))).join("")}const Te=31,Re={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TICKET_DEPRECATED:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0,BYTES:!0,NAT:!0},Ie=Object.assign({},Re,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LAMBDA_REC:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),xe={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},Me=Object.assign({},xe,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_transaction_deprecated:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class ke extends ue{constructor(e,t){super(e,t),this.val=e,this.message=t,this.name="MichelsonValidationError"}}function Le(e){return"prim"in e}function Ce(e){if(Le(e))return!0;throw new ke(e,"prim expression expected")}function Ne(e){if(Array.isArray(e))return!0;throw new ke(e,"sequence expression expected")}function je(e){if(function(e){return Array.isArray(e)||"prim"in e}(e))return!0;throw new ke(e,"prim or sequence expression expected")}function De(e){if("-"===e.int[0])throw new ke(e,"natural number expected")}function Ue(e){if("int"in e)return!0;throw new ke(e,"int literal expected")}function Be(e){if("string"in e)return!0;throw new ke(e,"string literal expected")}function Fe(e,t){var r;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new ke(e,`${t} arguments expected`)}function Ke(e){var t,r;if(Array.isArray(e)){for(const t of e){if(!Array.isArray(t)&&!Le(t))throw new ke(e,"sequence or prim expected");Ke(t)}return!0}if(Ce(e)){if(Object.prototype.hasOwnProperty.call(Re,e.prim))return Fe(e,0),!0;switch(e.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":void 0!==e.args&&Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":Fe(e,1)&&Ye(e.args[0]);break;case"UNPACK":Fe(e,1)&&Ge(e.args[0]);break;case"CONTRACT":Fe(e,1)&&ze(e.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":Fe(e,2)&&(Ne(e.args[0])&&Ke(e.args[0]),Ne(e.args[1])&&Ke(e.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":Fe(e,1)&&Ke(e.args[0]);break;case"CREATE_CONTRACT":Fe(e,1)&&Qe(e.args[0]);break;case"DIP":if(2===(null===(t=e.args)||void 0===t?void 0:t.length))Ue(e.args[0])&&De(e.args[0]),Ne(e.args[1])&&Ke(e.args[1]);else{if(1!==(null===(r=e.args)||void 0===r?void 0:r.length))throw new ke(e,"1 or 2 arguments expected");Ne(e.args[0])&&Ke(e.args[0])}break;case"PUSH":Fe(e,2)&&($e(e.args[0]),Xe(e.args[1]));break;case"EMPTY_SET":Fe(e,1)&&He(e.args[0]);break;case"EMPTY_MAP":Fe(e,2)&&(He(e.args[0]),Ye(e.args[1]));break;case"EMPTY_BIG_MAP":Fe(e,2)&&(He(e.args[0]),We(e.args[1]));break;case"LAMBDA_REC":case"LAMBDA":Fe(e,3)&&(Ye(e.args[0]),Ye(e.args[1]),Ne(e.args[2])&&Ke(e.args[2]));break;case"VIEW":Fe(e,2)&&(Be(e.args[0])&&Ze(e.args[0]),Ye(e.args[1])&&$e(e.args[1]));break;case"EMIT":e.args&&e.args.length>0?Fe(e,1):Fe(e,0);break;default:throw new ke(e,"instruction expected")}}return!0}function He(e){if(je(e))if(Array.isArray(e)||"pair"===e.prim||"or"===e.prim||"option"===e.prim)Je(e,(e=>He(e)));else if(!Object.prototype.hasOwnProperty.call(xe,e.prim))throw new ke(e,`${e.prim}: type is not comparable`);return!0}function Ge(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim)throw new ke(e,`${e.prim}: type can't be used inside PACK/UNPACK instructions`);Je(e,(e=>Ge(e)))}return!0}function $e(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim||"contract"===e.prim)throw new ke(e,`${e.prim}: type can't be pushed`);Je(e,(e=>$e(e)))}return!0}function Ve(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim||"contract"===e.prim)throw new ke(e,`${e.prim}: type can't be used as part of a storage`);Je(e,(e=>Ve(e)))}return!0}function ze(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim)throw new ke(e,`${e.prim}: type can't be used as part of a parameter`);Je(e,(e=>ze(e)))}return!0}function We(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim)throw new ke(e,`${e.prim}: type can't be used inside a big_map`);Je(e,(e=>We(e)))}return!0}const qe=new RegExp("^[a-zA-Z0-9_.%@]*$");function Ze(e){if(e.string.length>Te)throw new ke(e,`view name too long: ${e.string}`);if(!qe.test(e.string))throw new ke(e,`invalid character(s) in view name: ${e.string}`)}function Ye(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim))throw new ke(e,"type expected");Je(e,(e=>Ye(e)))}return!0}function Je(e,t){if(Array.isArray(e)||"pair"===e.prim){const r=Array.isArray(e)?e:e.args;if(void 0===r||r.length<2)throw new ke(e,"at least 2 arguments expected");return r.forEach((e=>{je(e)&&t(e)})),!0}switch(e.prim){case"option":case"list":Fe(e,1)&&je(e.args[0])&&t(e.args[0]);break;case"contract":Fe(e,1)&&ze(e.args[0]);break;case"or":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(t(e.args[0]),t(e.args[1]));break;case"lambda":Fe(e,2)&&(Ye(e.args[0]),Ye(e.args[1]));break;case"set":Fe(e,1)&&He(e.args[0]);break;case"map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),t(e.args[1]));break;case"big_map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),We(e.args[1]),t(e.args[1]));break;case"ticket":Fe(e,1)&&je(e.args[0])&&He(e.args[0]);break;case"sapling_state":case"sapling_transaction":Fe(e,1)&&Ue(e.args[0]);break;default:Fe(e,0)}return!0}function Xe(e){if("int"in e||"string"in e||"bytes"in e)return!0;if(Array.isArray(e)){let t=0;for(const r of e)Le(r)&&"Elt"===r.prim?(Fe(r,2)&&(Xe(r.args[0]),Xe(r.args[1])),t++):Xe(r);if(0!==t&&t!==e.length)throw new ke(e,"data entries and map elements can't be intermixed");return!0}if(!Le(e))throw new ke(e,"data entry expected");switch(e.prim){case"Unit":case"True":case"False":case"None":Fe(e,0);break;case"Pair":if(void 0===e.args||e.args.length<2)throw new ke(e,"at least 2 arguments expected");for(const t of e.args)Xe(t);break;case"Left":case"Right":case"Some":Fe(e,1)&&Xe(e.args[0]);break;case"Lambda_rec":e.args&&Ke(e.args);break;case"Ticket":Fe(e,4)&&(!function(e){if("string"in e||"bytes"in e)return!0;throw new ke(e,"string or bytes literal expected")}(e.args[0]),Ye(e.args[1]),Xe(e.args[2]),Ue(e.args[3]));break;default:if(!Object.prototype.hasOwnProperty.call(Ie,e.prim))throw new ke(e,"data entry or instruction expected");Ke(e)}return!0}function Qe(e){if(Ne(e)){const t={},r={};for(const n of e)if(Ce(n)){if("view"!==n.prim){if(n.prim in t)throw new ke(e,`duplicate contract section: ${n.prim}`);t[n.prim]=!0}switch(n.prim){case"code":Fe(n,1)&&Ne(n.args[0])&&Ke(n.args[0]);break;case"parameter":if(Fe(n,1)&&ze(n.args[0]),n.annots)throw new ke(n,"Annotation must be part of the parameter type");break;case"storage":Fe(n,1)&&Ve(n.args[0]);break;case"view":if(Fe(n,4)){if(Be(n.args[0])){const t=n.args[0];if(t.string in r)throw new ke(e,`duplicate view name: ${t.string}`);r[t.string]=!0,Ze(t)}$e(n.args[1]),$e(n.args[2]),Ne(n.args[3])&&Ke(n.args[3])}break;default:throw new ke(e,`unexpected contract section: ${n.prim}`)}}}return!0}function et(e){try{return Qe(e),!0}catch(e){return!1}}function tt(e){try{return Xe(e),!0}catch(e){return!1}}function rt(e){try{return Ke(e),!0}catch(e){return!1}}function nt(e){try{return Ye(e),!0}catch(e){return!1}}function it(e){return Object.prototype.hasOwnProperty.call(Ie,e.prim)}function ot(e){if(!Array.isArray(e))return!1;for(const t of e)if("prim"in t){if(it(t))throw new ue(e,`Instruction outside of a lambda: ${JSON.stringify(e)}`);if("Elt"===t.prim)throw new ue(e,`Elt item outside of a map literal: ${JSON.stringify(e)}`)}return!0}"function"==typeof SuppressedError&&SuppressedError;const st=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction_deprecated","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET_DEPRECATED","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","tx_rollup_l2_address","MIN_BLOCK_TIME","sapling_transaction","EMIT","Lambda_rec","LAMBDA_REC","TICKET","BYTES","NAT","Ticket"],at=Object.assign({},...st.map(((e,t)=>({[e]:t}))));var ct;!function(e){e[e.Int=0]="Int",e[e.String=1]="String",e[e.Sequence=2]="Sequence",e[e.Prim0=3]="Prim0",e[e.Prim0Annot=4]="Prim0Annot",e[e.Prim1=5]="Prim1",e[e.Prim1Annot=6]="Prim1Annot",e[e.Prim2=7]="Prim2",e[e.Prim2Annot=8]="Prim2Annot",e[e.Prim=9]="Prim",e[e.Bytes=10]="Bytes"}(ct||(ct={}));class ut{constructor(){this.buffer=[]}get length(){return this.buffer.length}writeBytes(e){this.buffer.push(...e.map((e=>255&e)))}writeUint8(e){const t=0|e;this.buffer.push(255&t)}writeUint16(e){const t=0|e;this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeUint32(e){const t=0|e;this.buffer.push(t>>24&255),this.buffer.push(t>>16&255),this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeInt8(e){this.writeUint8(e)}writeInt16(e){this.writeUint16(e)}writeInt32(e){this.writeUint32(e)}}const lt=new Error("bounds out of range");class dt{constructor(e,t=0,r=e.length){this.buffer=e,this.idx=t,this.cap=r}get length(){return this.cap-this.idx}readBytes(e){if(this.cap-this.idx<e)throw lt;const t=this.buffer.slice(this.idx,this.idx+e);return this.idx+=e,t}reader(e){if(this.cap-this.idx<e)throw lt;const t=new dt(this.buffer,this.idx,this.idx+e);return this.idx+=e,t}copy(){return new dt(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readUint32(){if(this.cap-this.idx<4)throw lt;return(this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readInt8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])<<16>>16}readInt32(){if(this.cap-this.idx<4)throw lt;return this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++]}}var ft,ht,pt;function bt(e){let t;const r=e.readUint8();switch(r){case ht.ED25519:t="ED25519PublicKeyHash";break;case ht.SECP256K1:t="SECP256K1PublicKeyHash";break;case ht.P256:t="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${r}`)}return{type:t,hash:e.readBytes(20)}}function mt(e){let t;const r=e.readUint8();switch(r){case ft.Implicit:t=bt(e);break;case ft.Originated:t={type:"ContractHash",hash:e.readBytes(20)},e.readBytes(1);break;default:throw new Error(`unknown address tag: ${r}`)}if(0!==e.length){const r=new TextDecoder;t.entryPoint=r.decode(new Uint8Array(e.readBytes(e.length)))}return t}function gt(e,t){let r;switch(e.type){case"ED25519PublicKeyHash":r=ht.ED25519;break;case"SECP256K1PublicKeyHash":r=ht.SECP256K1;break;case"P256PublicKeyHash":r=ht.P256;break;default:throw new Error(`unexpected address type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.hash))}function vt(e){let t,r;const n=e.readUint8();switch(n){case pt.ED25519:r="ED25519PublicKey",t=32;break;case pt.SECP256K1:r="SECP256K1PublicKey",t=33;break;case pt.P256:r="P256PublicKey",t=33;break;default:throw new Error(`unknown public key tag: ${n}`)}return{type:r,publicKey:e.readBytes(t)}}function yt(e,t,r){var n,i;const[o,s]=r(e);if(Array.isArray(o)){const e=new ut;for(const t of o){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}return t.writeUint8(ct.Sequence),t.writeUint32(e.length),void t.writeBytes(e.buffer)}if("string"in o){const e=(new TextEncoder).encode(o.string);return t.writeUint8(ct.String),t.writeUint32(e.length),void t.writeBytes(Array.from(e))}if("int"in o){t.writeUint8(ct.Int);let e=BigInt(o.int);const r=e<0;r&&(e=-e);let n=0;do{const i=0===n?BigInt(6):BigInt(7);let o=e&(BigInt(1)<<i)-BigInt(1);e>>=i,e&&(o|=BigInt(128)),0===n&&r&&(o|=BigInt(64)),t.writeUint8(Number(o)),n++}while(e);return}if("bytes"in o){const e=function(e){const t=[];for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2),i=parseInt(n,16);if(Number.isNaN(i))throw new ce(n);t.push(i)}return t}(o.bytes);return t.writeUint8(ct.Bytes),t.writeUint32(e.length),void t.writeBytes(e)}const a=at[o.prim];if(void 0===a)throw new TypeError(`Can't encode primary: ${o.prim}`);const c=((null===(n=o.args)||void 0===n?void 0:n.length)||0)<3?ct.Prim0+2*((null===(i=o.args)||void 0===i?void 0:i.length)||0)+(void 0===o.annots||0===o.annots.length?0:1):ct.Prim;if(t.writeUint8(c),t.writeUint8(a),void 0!==o.args)if(o.args.length<3)for(const e of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(e,t,r.value)}else{const e=new ut;for(const t of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}t.writeUint32(e.length),t.writeBytes(e.buffer)}if(void 0!==o.annots&&0!==o.annots.length){const e=(new TextEncoder).encode(o.annots.join(" "));t.writeUint32(e.length),t.writeBytes(Array.from(e))}else void 0!==o.args&&o.args.length>=3&&t.writeUint32(0)}function _t(e,t){function*r(){for(;;)yield It}const[n,i]=t,o=e.readUint8();switch(o){case ct.Int:{const t=[];let r;do{r=e.readInt8(),t.push(r)}while(128&r);let n=BigInt(0),o=!1;for(let e=t.length-1;e>=0;e--){const r=0===e?BigInt(6):BigInt(7),i=BigInt(t[e]);n<<=r,n|=i&(BigInt(1)<<r)-BigInt(1),0===e&&(o=!!(i&BigInt(64)))}return o&&(n=-n),i({int:String(n)})}case ct.String:{const t=e.readUint32(),r=e.readBytes(t);return i({string:(new TextDecoder).decode(new Uint8Array(r))})}case ct.Bytes:{const t=e.readUint32(),r=e.readBytes(t);return i({bytes:Pe(Array.from(r))})}case ct.Sequence:{const t=e.readUint32();let o=[],s=e.copy(),a=r();for(let r=0;r<2;r++){const r=s.reader(t);for(o=[];r.length>0;){const e=a.next();if(e.done)throw new Error("REPORT ME: iterator is done");o.push(_t(r,e.value))}a=n(o),s=e}return i(o)}default:{if(o>9)throw new Error(`Unknown tag: ${o}`);const t=e.readUint8();if(t>=st.length)throw new Error(`Unknown primitive tag: ${t}`);const s=st[t],a=o-3>>1;let c={prim:s},u=r(),l=e.copy();for(let t=0;t<2;t++){if(c={prim:s},a<3)for(let e=0;e<a;e++){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args=c.args||[],c.args.push(_t(l,e.value))}else{c.args=c.args||[];const e=l.readUint32(),t=l.reader(e);for(;t.length>0;){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args.push(_t(t,e.value))}}u=n(c),l=e}if(1==(o-3&1)||3===a){const t=e.readUint32();if(0!==t){const r=e.readBytes(t),n=new TextDecoder;c.annots=n.decode(new Uint8Array(r)).split(" ")}}return i(c)}}}!function(e){e[e.Implicit=0]="Implicit",e[e.Originated=1]="Originated"}(ft||(ft={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(ht||(ht={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(pt||(pt={}));const Et=e=>"prim"in e&&("Left"===e.prim||"Right"===e.prim),wt=e=>"prim"in e&&("Some"===e.prim||"None"===e.prim),Ot=e=>{if(we(e))return t=>{if(!Oe(t))throw new de(e,`pair expected: ${JSON.stringify(t)}`,t);ot(t);const r=Ee("pair",e);return[Ee("Pair",t),function*(){for(const e of r.args)yield Ot(e)}()]};switch(e.prim){case"or":return t=>{if(!Et(t))throw new de(e,`or expected: ${JSON.stringify(t)}`,t);return[t,function*(){yield Ot(e.args["Left"===t.prim?0:1])}()]};case"option":return t=>{if(!wt(t))throw new de(e,`option expected: ${JSON.stringify(t)}`,t);return[t,function*(){"Some"===t.prim&&(yield Ot(e.args[0]))}()]};case"list":case"set":return t=>{if(!Array.isArray(t))throw new de(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield Ot(e.args[0])}()]};case"map":return t=>{if(!Array.isArray(t))throw new de(e,`map expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new de(e,`map element expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const t of e.args)yield Ot(t)}()]}}()]};case"chain_id":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`chain id expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ChainID");if(null===n)throw new de(e,`chain id base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"signature":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`signature expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature");if(null===n)throw new de(e,`signature base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"key_hash":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`key hash expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash");if(null===n)throw new de(e,`key hash base58 expected: ${t.string}`,t);const i=new ut;gt({type:n[0],hash:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"key":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`public key expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey");if(null===n)throw new de(e,`public key base58 expected: ${t.string}`,t);const i=new ut;!function(e,t){let r;switch(e.type){case"ED25519PublicKey":r=pt.ED25519;break;case"SECP256K1PublicKey":r=pt.SECP256K1;break;case"P256PublicKey":r=pt.P256;break;default:throw new Error(`unexpected public key type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.publicKey))}({type:n[0],publicKey:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"address":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`address expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=t.string.split("%"),i=ye(n[0],"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash");if(null===i)throw new de(e,`address base58 expected: ${t.string}`,t);const o=new ut;!function(e,t){if("ContractHash"===e.type?(t.writeUint8(ft.Originated),t.writeBytes(Array.from(e.hash)),t.writeUint8(0)):(t.writeUint8(ft.Implicit),gt(e,t)),void 0!==e.entryPoint&&""!==e.entryPoint&&"default"!==e.entryPoint){const r=(new TextEncoder).encode(e.entryPoint);t.writeBytes(Array.from(r))}}({type:i[0],hash:i[1],entryPoint:n.length>1?n[1]:void 0},o),r={bytes:Pe(o.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"timestamp":return t=>{if(!("string"in t)&&!("int"in t))throw new de(e,`timestamp expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=Se(t);if(null===n)throw new de(e,`can't parse date: ${t.string}`,t);r={int:String(Math.floor(n.getTime()/1e3))}}else r=t;return[r,[][Symbol.iterator]()]};default:return St}},At=e=>"prim"in e&&"PUSH"===e.prim,St=e=>At(e)?(Ke(e),[e,function*(){yield St,yield Ot(e.args[0])}()]):[e,function*(){for(;;)yield St}()];function Pt(e,t){const r=new ut;return r.writeUint8(5),yt(e,r,void 0!==t?Ot(t):St),r.buffer}function Tt(e,t){return{bytes:Pe(Pt(e,t))}}const Rt=e=>{if(we(e))return[t=>{if(!Oe(t))throw new de(e,`pair expected: ${JSON.stringify(t)}`,t);const r=Ee("pair",e);return function*(){for(const e of r.args)yield Rt(e)}()},e=>e];switch(e.prim){case"or":return[t=>{if(!Et(t))throw new de(e,`or expected: ${JSON.stringify(t)}`,t);return function*(){yield Rt(e.args["Left"===t.prim?0:1])}()},e=>e];case"option":return[t=>{if(!wt(t))throw new de(e,`option expected: ${JSON.stringify(t)}`,t);return function*(){"Some"===t.prim&&(yield Rt(e.args[0]))}()},e=>e];case"list":case"set":return[t=>{if(!Array.isArray(t))throw new de(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield Rt(e.args[0])}()},e=>e];case"map":return[t=>{if(!Array.isArray(t))throw new de(e,`map expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield[t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new de(e,`map element expected: ${JSON.stringify(t)}`,t);return function*(){for(const t of e.args)yield Rt(t)}()},e=>e]}()},e=>e];case"chain_id":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`chain id expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("ChainID",r)}}];case"signature":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`signature expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("GenericSignature",r)}}];case"key_hash":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`key hash expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);const n=bt(new dt(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`public key expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);const n=vt(new dt(new Uint8Array(r)));return{string:_e(n.type,n.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);const n=mt(new dt(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),t=>{if(!("int"in t)&&!("string"in t))throw new de(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;return{string:new Date(1e3*parseInt(t.int,10)).toISOString().slice(0,19)+"Z"}}];default:return It}},It=[e=>At(e)?(Ke(e),function*(){yield It,yield Rt(e.args[0])}()):function*(){for(;;)yield It}(),e=>e];function xt(e,t){const r=new dt(e);if(5!==r.readUint8())throw new Error("incorrect packed data magic number");const n=_t(r,void 0!==t?Rt(t):It);if(Xe(n))return n;throw new Error}function Mt(e,t){const r=he(e.bytes);if(null===r)throw new Error(`can't parse bytes: "${e.bytes}"`);return xt(r,t)}function kt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return mt(new dt(new Uint8Array(t)))}function Lt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return bt(new dt(new Uint8Array(t)))}function Ct(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return vt(new dt(new Uint8Array(t)))}class Nt extends ue{constructor(e,t,r){super(e,r),this.val=e,this.stackState=t,this.message=r,this.name="MichelsonInstructionError"}}function jt(e){return Array.isArray(e)?"pair":e.prim}function Dt(e){return"prim"in e?e.args:e}function Ut(e,t,r=!1){if(jt(e)!==jt(t))throw new de(e,`types mismatch: ${jt(e)} != ${jt(t)}`,void 0);const n=[ge(e),ge(t)];if(n[0].t&&n[1].t&&n[0].t[0]!==n[1].t[0])throw new de(e,`${jt(e)}: type names mismatch: ${n[0].t[0]} != ${n[1].t[0]}`,void 0);if(r&&n[0].f&&n[1].f&&n[0].f[0]!==n[1].f[0])throw new de(e,`${jt(e)}: field names mismatch: ${n[0].f[0]} != ${n[1].f}`,void 0);if(we(e)){const r=Ee("pair",e),n=Ee("pair",t);return Ut(r.args[0],n.args[0],!0),void Ut(r.args[1],n.args[1],!0)}switch(e.prim){case"option":case"list":case"contract":case"set":case"ticket":Ut(e.args[0],t.args[0]);break;case"or":Ut(e.args[0],t.args[0],!0),Ut(e.args[1],t.args[1],!0);break;case"lambda":case"map":case"big_map":Ut(e.args[0],t.args[0]),Ut(e.args[1],t.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(e.args[0].int,10)!==parseInt(t.args[0].int,10))throw new de(e,`${jt(e)}: type argument mismatch: ${e.args[0].int} != ${t.args[0].int}`,void 0)}}function Bt(e,t){if(e.length!==t.length)throw new de(e,`stack length mismatch: ${e.length} != ${t.length}`,void 0);for(let r=0;r<e.length;r++)Ut(e[r],t[r])}function Ft(e,t=!1){var r,n,i;if(!Array.isArray(e)){const o=ge(e);if(((null===(r=o.t)||void 0===r?void 0:r.length)||0)>1)throw new de(e,`${e.prim}: at most one type annotation allowed: ${e.annots}`,void 0);if(t){if(((null===(n=o.f)||void 0===n?void 0:n.length)||0)>1)throw new de(e,`${e.prim}: at most one field annotation allowed: ${e.annots}`,void 0)}else if(((null===(i=o.f)||void 0===i?void 0:i.length)||0)>0)throw new de(e,`${e.prim}: field annotations aren't allowed: ${e.annots}`,void 0)}if(we(e)){const t=Dt(e);for(const e of t)Ft(e,!0)}else switch(e.prim){case"option":case"list":case"contract":case"set":Ft(e.args[0]);break;case"or":for(const t of e.args)Ft(t,!0);break;case"lambda":case"map":case"big_map":Ft(e.args[0]),Ft(e.args[1])}}function Kt(e){if(!Array.isArray(e))return!1;for(const t of e)if(!(Array.isArray(t)&&Kt(t)||"prim"in t&&it(t)))return!1;return!0}function Ht(e,t,r){if(we(t)){if(Oe(e)){ot(e);const n=Ee("Pair",e),i=Ee("pair",t);return Ht(n.args[0],i.args[0],r),void Ht(n.args[1],i.args[1],r)}throw new de(t,`pair expected: ${JSON.stringify(e)}`,e)}switch(t.prim){case"int":if("int"in e&&pe(e.int))return;throw new de(t,`integer value expected: ${JSON.stringify(e)}`,e);case"nat":case"mutez":if("int"in e&&be(e.int))return;throw new de(t,`natural value expected: ${JSON.stringify(e)}`,e);case"string":if("string"in e)return;throw new de(t,`string value expected: ${JSON.stringify(e)}`,e);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in e&&null!==he(e.bytes))return;throw new de(t,`bytes value expected: ${JSON.stringify(e)}`,e);case"bool":if("prim"in e&&("True"===e.prim||"False"===e.prim))return;throw new de(t,`boolean value expected: ${JSON.stringify(e)}`,e);case"key_hash":if("string"in e&&null!==ye(e.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash"))return;if("bytes"in e)try{return void Lt(e)}catch(e){}throw new de(t,`key hash expected: ${JSON.stringify(e)}`,e);case"timestamp":if(("string"in e||"int"in e)&&null!==Se(e))return;throw new de(t,`timestamp expected: ${JSON.stringify(e)}`,e);case"address":if("string"in e){let t=e.string;const r=e.string.indexOf("%");if(r>=0&&(t=e.string.slice(0,r)),null!==ye(t,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","RollupAddress"))return}else if("bytes"in e)try{return void kt(e)}catch(e){}throw new de(t,`address expected: ${JSON.stringify(e)}`,e);case"key":if("string"in e&&null!==ye(e.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey"))return;if("bytes"in e)try{return void Ct(e)}catch(e){}throw new de(t,`public key expected: ${JSON.stringify(e)}`,e);case"unit":if("prim"in e&&"Unit"===e.prim)return;throw new de(t,`unit value expected: ${JSON.stringify(e)}`,e);case"signature":if("bytes"in e||"string"in e&&null!==ye(e.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature"))return;throw new de(t,`signature expected: ${JSON.stringify(e)}`,e);case"chain_id":if("bytes"in e||"string"in e){if(null!==("string"in e?ee(e.string):he(e.bytes)))return}throw new de(t,`chain id expected: ${JSON.stringify(e)}`,e);case"option":if("prim"in e){if("None"===e.prim)return;if("Some"===e.prim)return void Ht(e.args[0],t.args[0],r)}throw new de(t,`option expected: ${JSON.stringify(e)}`,e);case"list":case"set":if(ot(e)){for(const n of e)Ht(n,t.args[0],r);return}throw new de(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"or":if("prim"in e){if("Left"===e.prim)return void Ht(e.args[0],t.args[0],r);if("Right"===e.prim)return void Ht(e.args[0],t.args[1],r)}throw new de(t,`union (or) expected: ${JSON.stringify(e)}`,e);case"lambda":if(Kt(e)){const n=Gt(e,[t.args[0]],r);if("failed"in n)throw new de(t,`function is failed with error type: ${n.failed}`,e);if(1!==n.length)throw new de(t,"function must return a value",e);return void Ut(t.args[1],n[0])}throw new de(t,`function expected: ${JSON.stringify(e)}`,e);case"map":case"big_map":if(Array.isArray(e)){for(const n of e){if(!("prim"in n)||"Elt"!==n.prim)throw new de(t,`map elements expected: ${JSON.stringify(e)}`,e);Ht(n.args[0],t.args[0],r),Ht(n.args[1],t.args[1],r)}return}throw new de(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"bls12_381_fr":if("int"in e&&pe(e.int)||"bytes"in e&&null!==he(e.bytes))return;throw new de(t,`BLS12-381 element expected: ${JSON.stringify(e)}`,e);case"sapling_state":if(Array.isArray(e))return;throw new de(t,`sapling state expected: ${JSON.stringify(e)}`,e);case"ticket":if("prim"in e&&"Ticket"===e.prim)return Ht(e.args[0],{prim:"address"},r),Xt(e.args[1],t.args[0]),Ht(e.args[2],t.args[0],r),void Ht(e.args[3],{prim:"nat"},r);if(Oe(e))return void Ht(e,{prim:"pair",args:[{prim:"address"},t.args[0],{prim:"nat"}]},r);throw new de(t,`ticket expected: ${JSON.stringify(e)}`,e);default:throw new de(t,`type ${jt(t)} don't have Michelson literal representation`,e)}}function Gt(e,t,r){const n=(null==r?void 0:r.protocol)||b;if(Array.isArray(e))return function(e,t,r){let n=t,i=t,o=0;for(const t of e){const e=Gt(t,i,r);if(n=e,"failed"in e)break;i=e,o++}if("failed"in n&&0==n.level&&(!("prim"in n.failed)||"never"!==n.failed.prim)&&o!==e.length-1)throw new Nt(e,n,"FAIL must appear in a tail position");if(void 0!==(null==r?void 0:r.traceCallback)){const i={op:e,in:t,out:n};r.traceCallback(i)}return"failed"in n?{failed:n.failed,level:n.level+1}:n}(e,t,r);const i=e;function o(e,...r){if(t.length<r.length+e)throw new Nt(i,t,`${i.prim}: stack must have at least ${r.length} element(s)`);let n=e;for(const e of r){if(null!==e&&0!==e.length){let r=0;for(;r<e.length&&e[r]!==jt(t[n]);)r++;if(r===e.length)throw new Nt(i,t,`${i.prim}: stack type mismatch: [${n}] expected to be ${e}, got ${jt(t[n])} instead`)}n++}return t.slice(e,r.length+e)}function s(e){return(...r)=>{try{return e(...r)}catch(e){throw e instanceof ue?new Nt(i,t,e.message):e}}}function a(e){return r=>{try{return e(r)}catch(e){throw e instanceof ue?new Nt(i,t,e.message):e}}}const c=s(ge),u=s(Bt),l=s(Ut),d=a(He),f=a(Ge),m=a(Ve),g=a($e),y=a(We);function _(e,r){const n=c(i,Object.assign(Object.assign({},r),{emptyFields:void 0!==e.f&&e.f>1,emptyVar:void 0!==e.v&&e.v>1})),o=(e,r,n)=>{if(e&&e.length>(r||0))throw new Nt(i,t,`${i.prim}: at most ${r||0} ${n} annotations allowed`)};return o(n.f,e.f,"field"),o(n.t,e.t,"type"),o(n.v,e.v,"variable"),n}function E(e,t){const r=e,n=Array.isArray(r)?{prim:"pair",args:r}:r,i=c(n),o=void 0!==t.v||void 0!==t.t||void 0!==t.f?[...(null===t.v?i.v:t.v)||[],...(null===t.t?i.t:t.t)||[],...(null===t.f?i.f:t.f)||[]]:void 0,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(n,["annots"]);return Object.assign(Object.assign({},s),o&&0!==o.length&&{annots:o})}function w(e,t){const r=_({v:1});return E(e,{v:void 0!==r.v?r.v:void 0!==t?[t]:null,t:null})}function O(e,r,n,o,s){var a,u,l,d;const f=null===(a=c(r).f)||void 0===a?void 0:a[0],h=null===(u=n.f)||void 0===u?void 0:u[o];if(void 0!==h&&"%"!==h&&void 0!==f&&h!==f)throw new Nt(i,t,`${i.prim}: field names doesn't match: ${h} !== ${f}`);const p=null===(l=n.v)||void 0===l?void 0:l[o],b=null===(d=c(e).v)||void 0===d?void 0:d[0];return E(r,{t:null,v:p?"@%"===p?f?["@"+f.slice(1)]:void 0:"@%%"===p?b?["@"+b.slice(1)+"."+(f?f.slice(1):s)]:f?["@"+f.slice(1)]:void 0:[p]:null})}function A(e,r,n=r){const o=Ee("pair",e);if(1===n)return[o.args[0]];if(2===n)return o.args;const s=o.args[1];if(we(s))return[o.args[0],...A(s,r,n-1)];throw new Nt(i,t,`${i.prim}: at least ${r} fields are expected`)}function S(e,r,n=r){if(0===n)return e;const o=Ee("pair",e);if(1===n)return o.args[0];const s=o.args[1];if(we(s))return S(s,r,n-2);if(2===n)return s;throw new Nt(i,t,`${i.prim}: at least ${r+1} fields are expected`)}function P(e,r,n,o=n){if(0===o)return r;const s=Ee("pair",e);if(1===o)return Object.assign(Object.assign({},s),{args:[r,s.args[1]]});const a=s.args[1];if(we(a))return Object.assign(Object.assign({},s),{args:[s.args[0],P(a,r,n,o-2)]});if(2===o)return Object.assign(Object.assign({},s),{args:[s.args[0],r]});throw new Nt(i,t,`${i.prim}: at least ${n+1} fields are expected`)}const T=(e,t)=>["@"+(e.v?e.v[0].slice(1)+".":"")+t];function R(e,t){return"failed"in e||"failed"in t?"failed"in e?t:e:(u(e,t),e)}const I=(e=>{var i,s,a,b,I;switch(e.prim){case"DUP":{const r=e.args?parseInt(e.args[0].int,10):1;if(0===r)throw new Nt(e,t,"DUP 0 is forbidden");const n=o(r-1,null)[0];if("ticket"===jt(n))throw new Nt(e,t,"ticket can't be DUPed");return[n,...t]}case"SWAP":{const e=o(0,null,null);return _({}),[e[1],e[0],...t.slice(2)]}case"SOME":return[E({prim:"option",args:[o(0,null)[0]]},_({t:1,v:1})),...t.slice(1)];case"UNIT":return[E({prim:"unit"},_({v:1,t:1})),...t];case"PAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Nt(e,t,`PAIR ${r} is forbidden`);const n=o(0,...new Array(r).fill(null)),i=_({f:r,t:1,v:1},{specialFields:!0}),s=e=>{const t=e.lastIndexOf(".");return e.slice(t>0?t+1:1)},a=n.map(((e,t)=>{var r;const n=c(e);return E(e,{v:null,t:null,f:i.f&&i.f.length>t&&"%"!==i.f[t]?"%@"===i.f[t]?n.v?["%"+s((null===(r=n.v)||void 0===r?void 0:r[0])||"")]:void 0:[i.f[t]]:void 0})}));return[E({prim:"pair",args:a},{t:i.t,v:i.v}),...t.slice(r)]}case"UNPAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Nt(e,t,`UNPAIR ${r} is forbidden`);const n=o(0,["pair"])[0],i=_({f:2,v:2},{specialVar:!0});return[...A(n,r).map(((e,t)=>O(n,e,i,t,0===t?"car":"cdr"))),...t.slice(1)]}case"CAR":case"CDR":{const r=Ee("pair",o(0,["pair"])[0]);return[O(r,r.args["CAR"===e.prim?0:1],_({f:1,v:1},{specialVar:!0}),0,e.prim.toLocaleLowerCase()),...t.slice(1)]}case"CONS":{const e=o(0,null,["list"]);return l(e[0],e[1].args[0]),[w({prim:"list",args:[e[1].args[0]]}),...t.slice(2)]}case"SIZE":return o(0,["string","list","set","map","bytes"]),[w({prim:"nat"}),...t.slice(1)];case"MEM":{const e=o(0,null,["set","map","big_map"]);return d(e[0]),l(e[0],e[1].args[0]),[w({prim:"bool"}),...t.slice(2)]}case"GET":if(e.args){const r=parseInt(e.args[0].int,10);return[w(S(o(0,["pair"])[0],r)),...t.slice(1)]}{const e=o(0,null,["map","big_map"]);return d(e[0]),l(e[0],e[1].args[0]),[w({prim:"option",args:[e[1].args[1]]}),...t.slice(2)]}case"UPDATE":if(e.args){const r=parseInt(e.args[0].int,10),n=o(0,null,["pair"]);return[w(P(n[1],n[0],r)),...t.slice(2)]}{const e=o(0,null,["bool","option"]);if(d(e[0]),"bool"===e[1].prim){const r=o(2,["set"]);return l(e[0],r[0].args[0]),[w({prim:"set",args:[E(e[0],{t:null})]}),...t.slice(3)]}const r=o(2,["map","big_map"]);return l(e[0],r[0].args[0]),"map"===r[0].prim?[w({prim:"map",args:[E(e[0],{t:null}),E(e[1].args[0],{t:null})]}),...t.slice(3)]:(y(e[1].args[0]),[w({prim:"big_map",args:[E(e[0],{t:null}),E(e[1].args[0],{t:null})]}),...t.slice(3)])}case"GET_AND_UPDATE":{const e=_({v:2}),r=o(0,null,["option"],["map","big_map"]);d(r[0]),l(r[0],r[2].args[0]),l(r[1].args[0],r[2].args[1]);const n=null===(i=e.v)||void 0===i?void 0:i.map((e=>"@"!==e?[e]:void 0));return"map"===r[2].prim?[E({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),E({prim:"map",args:[E(r[0],{t:null}),E(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)]:(y(r[1].args[0]),[E({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),E({prim:"big_map",args:[E(r[0],{t:null}),E(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)])}case"EXEC":{const e=o(0,null,["lambda"]);return l(e[0],e[1].args[0]),[w(e[1].args[1]),...t.slice(2)]}case"APPLY":{const r=o(0,null,["lambda"]);if(m(r[0]),g(r[0]),!we(r[1].args[0]))throw new Nt(e,t,`${e.prim}: function's argument must be a pair: ${jt(r[1].args[0])}`);const n=r[1].args[0];return l(r[0],Dt(n)[0]),[w({prim:"lambda",args:[Dt(n)[1],r[1].args[1]]}),...t.slice(2)]}case"FAILWITH":{const e=o(0,null)[0];return v(n,p.PtEdo2Zk)||f(e),{failed:e,level:0}}case"NEVER":return o(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[w(o(0,null)[0]),...t.slice(1)];case"CONCAT":{const r=o(0,["string","list","bytes"]);if("list"===r[0].prim){if("string"!==jt(r[0].args[0])&&"bytes"!==jt(r[0].args[0]))throw new Nt(e,t,`${e.prim}: can't concatenate list of ${jt(r[0].args[0])}'s`);return[w(r[0].args[0]),...t.slice(1)]}const n=o(1,["string","bytes"]);if(r[0].prim!==n[0].prim)throw new Nt(e,t,`${e.prim}: can't concatenate ${r[0].prim} with ${n[0].prim}`);return[w(n[0]),...t.slice(2)]}case"SLICE":return[w({prim:"option",args:[o(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...t.slice(3)];case"PACK":{const e=o(0,null)[0];return f(e),[w({prim:"bytes"},"@packed"),...t.slice(1)]}case"ADD":{const r=o(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[w({prim:"int"}),...t.slice(2)];if("int"===r[0].prim&&"timestamp"===r[1].prim||"timestamp"===r[0].prim&&"int"===r[1].prim)return[w({prim:"timestamp"}),...t.slice(2)];if(("int"===r[0].prim||"nat"===r[0].prim||"mutez"===r[0].prim||"bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&r[0].prim===r[1].prim)return[w(r[0]),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't add ${r[0].prim} to ${r[1].prim}`)}case"SUB":{const r=v(n,p.PsiThaCa)?o(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):o(0,["nat","int","timestamp"],["nat","int","timestamp"]);if(("nat"===r[0].prim||"int"===r[0].prim)&&("nat"===r[1].prim||"int"===r[1].prim)||"timestamp"===r[0].prim&&"timestamp"===r[1].prim)return[w({prim:"int"}),...t.slice(2)];if("timestamp"===r[0].prim&&"int"===r[1].prim)return[w({prim:"timestamp"}),...t.slice(2)];if("mutez"===r[0].prim&&"mutez"===r[1].prim)return[w({prim:"mutez"}),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't subtract ${r[0].prim} from ${r[1].prim}`)}case"SUB_MUTEZ":return o(0,["mutez"],["mutez"]),[w({prim:"option",args:[{prim:"mutez"}]}),...t.slice(2)];case"MUL":{const r=o(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[w({prim:"int"}),...t.slice(2)];if("nat"===r[0].prim&&"mutez"===r[1].prim||"mutez"===r[0].prim&&"nat"===r[1].prim)return[w({prim:"mutez"}),...t.slice(2)];if(("bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[0].prim||"int"===r[0].prim)&&r[0].prim===r[1].prim)return[w(r[0]),...t.slice(2)];if(("nat"===r[0].prim||"int"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[1].prim||"int"===r[1].prim)&&"bls12_381_fr"===r[0].prim)return[w({prim:"bls12_381_fr"}),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't multiply ${r[0].prim} by ${r[1].prim}`)}case"EDIV":{const r=(e,t)=>({prim:"option",args:[{prim:"pair",args:[{prim:e},{prim:t}]}]}),n=o(0,["nat","int","mutez"],["nat","int","mutez"]);if("nat"===n[0].prim&&"nat"===n[1].prim)return[w(r("nat","nat")),...t.slice(2)];if(!("nat"!==n[0].prim&&"int"!==n[0].prim||"nat"!==n[1].prim&&"int"!==n[1].prim))return[w(r("int","nat")),...t.slice(2)];if("mutez"===n[0].prim&&"nat"===n[1].prim)return[w(r("mutez","mutez")),...t.slice(2)];if("mutez"===n[0].prim&&"mutez"===n[1].prim)return[w(r("nat","mutez")),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't euclideally divide ${n[0].prim} by ${n[1].prim}`)}case"ABS":return o(0,["int"]),[w({prim:"nat"}),...t.slice(1)];case"ISNAT":return o(0,["int"]),[w({prim:"option",args:[{prim:"nat"}]}),...t.slice(1)];case"INT":return o(0,["nat","bls12_381_fr","bytes"]),[w({prim:"int"}),...t.slice(1)];case"BYTES":return o(0,["nat","int"]),[w({prim:"bytes"}),...t.slice(1)];case"NAT":return o(0,["bytes"]),[w({prim:"nat"}),...t.slice(1)];case"NEG":{const e=o(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return"nat"===e.prim||"int"===e.prim?[w({prim:"int"}),...t.slice(1)]:[w(e),...t.slice(1)]}case"LSL":case"LSR":return o(0,["nat","bytes"],["nat","bytes"]),[w({prim:"nat"}),...t.slice(2)];case"OR":case"XOR":{const r=o(0,["nat","bytes","bool"],["nat","bytes","bool"]);if(r[0].prim!==r[1].prim)throw new Nt(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[w(r[1]),...t.slice(2)]}case"AND":{const r=o(0,["nat","bytes","bool","int"],["nat","bytes","bool"]);if(("int"!==r[0].prim||"nat"!==r[1].prim)&&r[0].prim!==r[1].prim)throw new Nt(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[w(r[1]),...t.slice(2)]}case"NOT":return"bool"===o(0,["nat","bytes","bool","int"])[0].prim?[w({prim:"bool"}),...t.slice(1)]:[w({prim:"int"}),...t.slice(1)];case"COMPARE":{const e=o(0,null,null);return d(e[0]),d(e[1]),[w({prim:"int"}),...t.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return o(0,["int"]),[w({prim:"bool"}),...t.slice(1)];case"SELF":{if(void 0===(null==r?void 0:r.contract))throw new Nt(e,t,`${e.prim}: contract required`);const n=_({f:1,v:1}),i=Wt(r.contract,null===(s=n.f)||void 0===s?void 0:s[0]);if(null===i)throw new Nt(e,t,`${e.prim}: contract has no entrypoint ${i}`);return[E({prim:"contract",args:[i]},{v:n.v?n.v:["@self"]}),...t]}case"TRANSFER_TOKENS":{const e=o(0,null,["mutez"],["contract"]);return l(e[0],e[2].args[0]),[w({prim:"operation"}),...t.slice(3)]}case"SET_DELEGATE":{const r=o(0,["option"])[0];if("key_hash"!==jt(r.args[0]))throw new Nt(e,t,`${e.prim}: key hash expected: ${jt(r.args[0])}`);return[w({prim:"operation"}),...t.slice(1)]}case"IMPLICIT_ACCOUNT":return o(0,["key_hash"]),[w({prim:"contract",args:[{prim:"unit"}]}),...t.slice(1)];case"NOW":return[w({prim:"timestamp"},"@now"),...t];case"AMOUNT":return[w({prim:"mutez"},"@amount"),...t];case"BALANCE":return[w({prim:"mutez"},"@balance"),...t];case"CHECK_SIGNATURE":return o(0,["key"],["signature"],["bytes"]),[w({prim:"bool"}),...t.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return o(0,["bytes"]),[w({prim:"bytes"}),...t.slice(1)];case"HASH_KEY":return o(0,["key"]),[w({prim:"key_hash"}),...t.slice(1)];case"SOURCE":return[w({prim:"address"},"@source"),...t];case"SENDER":return[w({prim:"address"},"@sender"),...t];case"ADDRESS":{const e=o(0,["contract"])[0],r=_({v:1});return[E({prim:"address",[h]:e},{v:r.v?r.v:T(c(e),"address")}),...t.slice(1)]}case"SELF_ADDRESS":{const e={prim:"address"};return void 0!==(null==r?void 0:r.contract)&&(e[h]={prim:"contract",args:[$t(r.contract,"parameter").args[0]]}),[w(e,"@address"),...t]}case"CHAIN_ID":return[w({prim:"chain_id"}),...t];case"DROP":{_({});const r=void 0!==e.args?parseInt(e.args[0].int,10):1;return o(r-1,null),t.slice(r)}case"DIG":{_({});const r=parseInt(e.args[0].int,10);return[o(r,null)[0],...t.slice(0,r),...t.slice(r+1)]}case"DUG":{_({});const r=parseInt(e.args[0].int,10);return[...t.slice(1,r+1),o(0,null)[0],...t.slice(r+1)]}case"NONE":return Ft(e.args[0]),[E({prim:"option",args:[e.args[0]]},_({t:1,v:1})),...t];case"LEFT":case"RIGHT":{const r=o(0,null)[0],n=_({f:2,t:1,v:1},{specialFields:!0}),i=c(r),s=[E(r,{t:null,v:null,f:n.f&&n.f.length>0&&"%"!==n.f[0]?"%@"===n.f[0]?i.v?["%"+i.v[0].slice(1)]:void 0:n.f:void 0}),E(e.args[0],{t:null,f:n.f&&n.f.length>1&&"%"!==n.f[1]?n.f:void 0})];return[E({prim:"or",args:"LEFT"===e.prim?s:[s[1],s[0]]},{t:n.t,v:n.v}),...t.slice(1)]}case"NIL":return Ft(e.args[0]),[E({prim:"list",args:[e.args[0]]},_({t:1,v:1})),...t];case"UNPACK":return o(0,["bytes"]),Ft(e.args[0]),[w({prim:"option",args:[e.args[0]]},"@unpacked"),...t.slice(1)];case"CONTRACT":{const r=o(0,["address"])[0];Ft(e.args[0]);const n=_({v:1,f:1}),i=r[h];if(void 0!==i){const r=Wt(i,null===(a=n.f)||void 0===a?void 0:a[0]);if(null===r)throw new Nt(e,t,`${e.prim}: contract has no entrypoint ${r}`);l(r,e.args[0])}return[E({prim:"option",args:[{prim:"contract",args:[e.args[0]]}]},{v:n.v?n.v:T(c(r),"contract")}),...t.slice(1)]}case"CAST":{_({});const r=o(0,null)[0];return Ft(e.args[0]),l(e.args[0],r),[e.args[0],...t.slice(1)]}case"IF_NONE":{_({});const n=o(0,["option"])[0],i=t.slice(1);return R(Gt(e.args[0],i,r),Gt(e.args[1],[E(n.args[0],{t:null,v:T(c(n),"some")}),...i],r))}case"IF_LEFT":{_({});const n=o(0,["or"])[0],i=c(n),s=c(n.args[0]),a=c(n.args[1]),u=t.slice(1);return R(Gt(e.args[0],[E(n.args[0],{t:null,v:T(i,s.f?s.f[0].slice(1):"left")}),...u],r),Gt(e.args[1],[E(n.args[1],{t:null,v:T(i,a.f?a.f[0].slice(1):"right")}),...u],r))}case"IF_CONS":{_({});const n=o(0,["list"])[0],i=c(n),s=t.slice(1);return R(Gt(e.args[0],[E(n.args[0],{t:null,v:T(i,"hd")}),E(n,{t:null,v:T(i,"tl")}),...s],r),Gt(e.args[1],s,r))}case"IF":{_({}),o(0,["bool"]);const n=t.slice(1);return R(Gt(e.args[0],n,r),Gt(e.args[1],n,r))}case"MAP":{const n=o(0,["list","map","option"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[E(s,{t:null,v:T(c(n),"elt")}),...i],r);if("failed"in a){if(!("prim"in a.failed)||"never"!==a.failed.prim)throw new Nt(e,t,`${e.prim}: FAIL is not allowed in MAP`);return{failed:a.failed,level:a.level+1}}if(a.length<1)throw new Nt(e,t,`${e.prim}: function must return a value`);return u(a.slice(1),i),"list"===n.prim?[w({prim:"list",args:[a[0]]}),...i]:"map"===n.prim?[w({prim:"map",args:[n.args[0],a[0]]}),...i]:[w({prim:"option",args:[a[0]]}),...i]}case"ITER":{_({});const n=o(0,["set","list","map"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[E(s,{t:null,v:T(c(n),"elt")}),...i],r);return"failed"in a?{failed:a.failed,level:a.level+1}:(u(a,i),i)}case"LOOP":{_({}),o(0,["bool"]);const n=t.slice(1),i=Gt(e.args[0],n,r);return"failed"in i?{failed:i.failed,level:i.level+1}:(u(i,[{prim:"bool"},...n]),n)}case"LOOP_LEFT":{_({});const n=o(0,["or"])[0],i=t.slice(1),s=Gt(e.args[0],[E(n.args[0],{t:null,v:T(c(n),"left")}),...i],r);return"failed"in s?{failed:s.failed,level:s.level+1}:(u(s,[n,...i]),[E(n.args[1],{t:null,v:_({v:1}).v}),...i])}case"DIP":{_({});const n=2===e.args.length?parseInt(e.args[0].int,10):1;o(n-1,null);const i=t.slice(0,n),s=t.slice(n),a=2===e.args.length?Gt(e.args[1],s,r):Gt(e.args[0],s,r);return"failed"in a?{failed:a.failed,level:a.level+1}:[...i,...a]}case"CREATE_CONTRACT":{const r=_({v:2}),n=o(0,["option"],["mutez"],null);if("key_hash"!==jt(n[0].args[0]))throw new Nt(e,t,`${e.prim}: key hash expected: ${jt(n[0].args[0])}`);m(n[2])&&(Zt(e.args[0]),Ut($t(e.args[0],"storage").args[0],n[2]));const i=null===(b=r.v)||void 0===b?void 0:b.map((e=>"@"!==e?[e]:void 0));return[E({prim:"operation"},{v:null==i?void 0:i[0]}),E({prim:"address",[h]:{prim:"contract",args:[$t(e.args[0],"parameter").args[0]]}},{v:null==i?void 0:i[1]}),...t.slice(3)]}case"PUSH":return Ft(e.args[0]),Ht(e.args[1],e.args[0],Object.assign(Object.assign({},r),{contract:void 0})),[w(e.args[0]),...t];case"EMPTY_SET":return Ft(e.args[0]),d(e.args[0]),[E({prim:"set",args:e.args},_({t:1,v:1})),...t];case"EMPTY_MAP":return Ft(e.args[0]),d(e.args[0]),Ft(e.args[1]),[E({prim:"map",args:e.args},_({t:1,v:1})),...t];case"EMPTY_BIG_MAP":return Ft(e.args[0]),d(e.args[0]),Ft(e.args[1]),y(e.args[0]),[E({prim:"big_map",args:e.args},_({t:1,v:1})),...t];case"LAMBDA_REC":case"LAMBDA":{Ft(e.args[0]),Ft(e.args[1]);const n=[e.args[0]];"LAMBDA_REC"===e.prim&&n.push({prim:"lambda",args:[e.args[0],e.args[1]]});const i=Gt(e.args[2],n,Object.assign(Object.assign({},r),{contract:void 0}));if("failed"in i)return{failed:i.failed,level:i.level+1};if(1!==i.length)throw new Nt(e,t,`${e.prim}: function must return a value`);return l(e.args[1],i[0]),[w({prim:"lambda",args:[e.args[0],e.args[1]]}),...t]}case"LEVEL":return[w({prim:"nat"},"@level"),...t];case"TOTAL_VOTING_POWER":case"MIN_BLOCK_TIME":return[w({prim:"nat"}),...t];case"VOTING_POWER":return o(0,["key_hash"]),[w({prim:"nat"}),...t.slice(1)];case"TICKET":{const e=o(0,null,["nat"])[0];return d(e),v(n,p.PtLimaPtL)?[E({prim:"ticket",args:[e]},_({t:1,v:1})),...t.slice(2)]:[w({prim:"option",args:[E({prim:"ticket",args:[e]},_({t:1,v:1}))]}),...t.slice(2)]}case"JOIN_TICKETS":{const r=Ee("pair",o(0,["pair"])[0]);if("ticket"!==jt(r.args[0]))throw new Nt(e,t,`${e.prim}: ticket expected: ${jt(r.args[0])}`);return l(r.args[0],r.args[1]),[w({prim:"option",args:[E(r.args[0],{t:null})]}),...t.slice(1)]}case"SPLIT_TICKET":{const r=o(0,["ticket"],["pair"]),n=Ee("pair",r[1]);if("nat"!==jt(n.args[0]))throw new Nt(e,t,`${e.prim}: nat expected: ${jt(n.args[0])}`);return l(n.args[0],n.args[1]),[w({prim:"option",args:[{prim:"pair",args:[E(r[0],{t:null}),E(r[0],{t:null})]}]}),...t.slice(2)]}case"READ_TICKET":{const e=_({v:2}),r=o(0,["ticket"])[0],n=null===(I=e.v)||void 0===I?void 0:I.map((e=>"@"!==e?[e]:void 0));return[E({prim:"pair",args:[{prim:"address"},E(r.args[0],{t:null}),{prim:"nat"}]},{v:null==n?void 0:n[0]}),E(r,{v:null==n?void 0:n[1],t:null}),...t.slice(1)]}case"PAIRING_CHECK":{const r=o(0,["list"])[0].args[0];if(!we(r))throw new Nt(e,t,`${e.prim}: pair expected: ${jt(r)}`);const n=Ee("pair",r);if("bls12_381_g1"!==jt(n.args[0]))throw new Nt(e,t,`${e.prim}: bls12_381_g1 expected: ${jt(n.args[0])}`);if("bls12_381_g2"!==jt(n.args[1]))throw new Nt(e,t,`${e.prim}: bls12_381_g2 expected: ${jt(n.args[1])}`);return[w({prim:"bool"}),...t.slice(1)]}case"SAPLING_EMPTY_STATE":return[E({prim:"sapling_state",args:[e.args[0]]},_({v:1,t:1})),...t];case"SAPLING_VERIFY_UPDATE":{const r=o(0,["sapling_transaction"],["sapling_state"]);if(parseInt(r[0].args[0].int,10)!==parseInt(r[1].args[0].int,10))throw new Nt(e,t,`${e.prim}: sapling memo size mismatch: ${r[0].args[0].int} != ${r[1].args[0].int}`);return v(n,p.PtJakarta)?[w({prim:"option",args:[{prim:"pair",args:[{prim:"int"},E(r[1],{t:null})]}]}),...t.slice(2)]:[w({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},E(r[1],{t:null})]}]}]}),...t.slice(2)]}case"OPEN_CHEST":return o(0,["chest_key"],["chest"],["nat"]),[w({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...t.slice(3)];case"VIEW":{const r=o(0,null,["address"]);return g(r[0]),[w({prim:"option",args:[e.args[1]]}),...t.slice(2)]}case"EMIT":{const r=_({f:1,t:1});if(e.args){const n=o(0,null);return l(n[0],e.args[0]),[E({prim:"operation"},r),...t.slice(1)]}return[E({prim:"operation"},r),...t.slice(1)]}default:throw new ue(e,`unexpected instruction: ${e.prim}`)}})(i);if(void 0!==(null==r?void 0:r.traceCallback)){const e={op:i,in:t,out:I};r.traceCallback(e)}return I}function $t(e,t){for(const r of e)if(r.prim===t)return r;throw new ue(e,`missing contract section: ${t}`)}function Vt(e){const t={};for(const r of e)"view"===r.prim&&(t[r.args[0].string]=r);return t}function zt(e){if(Array.isArray(e))for(const t of e)if("prim"in t&&("parameter"===t.prim||"storage"===t.prim||"code"===t.prim))return!0;return!1}function Wt(e,t){t=t||"%default";const r=qt(e).find((e=>e[0]===t));return void 0!==r?r[1]:"%default"===t?zt(e)?$t(e,"parameter").args[0]:e:null}function qt(e){if(zt(e)){const t=$t(e,"parameter"),r=qt(t.args[0]),n=ge(t);return n.f?[[n.f[0],t.args[0]],...r]:r}if(t=e,Array.isArray(t)||"or"===t.prim){const t=Dt(e),r=e=>{const r=ge(t[e]);if("or"===jt(t[e])){const n=qt(t[e]);return r.f?[[r.f[0],t[e]],...n]:n}return r.f?[[r.f[0],t[e]]]:[]};return[...r(0),...r(1)]}var t;return[]}function Zt(e,t){const r=(r,n,i,o)=>{Ft(r,!0),Ft(n);const s=Gt(o,[{prim:"pair",args:[Object.assign(Object.assign({},r),{annots:["@parameter"]}),Object.assign(Object.assign({},n),{annots:["@storage"]})]}],Object.assign(Object.assign({},t),{contract:e}));if("failed"in s)return s;try{Bt(s,[i])}catch(e){throw e instanceof ue?new Nt(o,s,e.message):e}return s},n=$t(e,"parameter").args[0],i=$t(e,"storage").args[0],o=r(n,i,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},i]},$t(e,"code").args[0]);for(const t of Object.values(Vt(e)))r(t.args[1],i,t.args[2],t.args[3]);return o}function Yt(e,t,r){Ft(t),Ht(e,t,r||null)}function Jt(e,t,r){for(const e of t)Ft(e);if(void 0!==(null==r?void 0:r.contract))for(const e of["parameter","storage"]){Ft($t(r.contract,e).args[0])}return Gt(e,t,r||null)}function Xt(e,t,r=!1){if(Array.isArray(e)){for(const t of e)Ft(t);for(const e of t)Ft(e)}else Ft(e),Ft(t);Ut(e,t,r)}function Qt(e,t=!1){try{return Ft(e,t),!0}catch(e){return!1}}function er(e,t){try{return Zt(e,t)}catch(e){return null}}function tr(e,t,r){try{return Yt(e,t,r),!0}catch(e){return!1}}function rr(e,t,r=!1){try{return Xt(e,t,r),!0}catch(e){return!1}}class nr{constructor(e,t){this.contract=e,this.ctx=Object.assign({contract:e},t),this.output=Zt(e,this.ctx)}static parse(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new re("empty Michelson");if(Qe(n))return new nr(n,t)}static parseTypeExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ne("empty type expression");if(Ye(n))return Ft(n),n}static parseDataExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ie("empty data expression");if(Xe(n))return n;throw void 0}section(e){return $t(this.contract,e)}entryPoints(){return qt(this.contract)}entryPoint(e){return Wt(this.contract,e)}assertDataValid(e,t){Yt(e,t,this.ctx)}isDataValid(e,t){return tr(e,t,this.ctx)}assertParameterValid(e,t){const r=this.entryPoint(e||void 0);if(null===r)throw new oe(null==e?void 0:e.toString());this.assertDataValid(t,r)}isParameterValid(e,t){try{return this.assertParameterValid(e,t),!0}catch(e){return!1}}functionType(e,t){return Jt(e,t,this.ctx)}}const ir=new nr([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);function or(e){return"failed"in e?`[FAILED: ${z(e.failed)}]`:e.map(((e,t)=>{const r=ge(e);return`[${t}${r.v?"/"+r.v[0]:""}]: ${z(e)}`})).join("\n")}function sr(e,t){return r=>{var n;if(Array.isArray(r)&&!e)return;const o=null===(n=r.op[i])||void 0===n?void 0:n.macro,s=`${o?"Macro":"Op"}: ${o?z(o,void 0,!0)+" / ":""}${z(r.op)}\nInput:\n${or(r.in)}\nOutput:\n${or(r.out)}\n`;t(s)}}function ar(e){var t;if(e instanceof Nt){const r=null===(t=e.val[i])||void 0===t?void 0:t.macro;return`${r?"Macro":"Op"}: ${r?z(r,void 0,!0)+" / ":""}${z(e.val)}\nStack:\n${or(e.stackState)}\n`}if(e instanceof de){return`Type: ${Array.isArray(e.val)?"["+e.val.map(((e,t)=>`[${t}]: ${z(e)}`)).join("; ")+"]":z(e.val)}\n${e.data?`Data: ${z(e.data)}\n`:""}\n`}return`Value: ${z(e.val)}`}const cr={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"}},1157:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressValidationError:()=>T,BigMapEncodingError:()=>Fe,BigMapValidationError:()=>m,BytesValidationError:()=>U,ChainIDValidationError:()=>te,ContractValidationError:()=>k,EncodeTicketError:()=>ne,EventSchema:()=>Ye,IntValidationError:()=>H,InvalidBigMapDiffError:()=>Be,InvalidBigMapSchemaError:()=>Ue,InvalidMapTypeError:()=>u,InvalidRpcResponseError:()=>De,InvalidScriptError:()=>je,KeyHashValidationError:()=>W,KeyValidationError:()=>V,ListValidationError:()=>C,MapTypecheckError:()=>d,MapValidationError:()=>I,MichelsonMap:()=>f,MissingArgumentError:()=>He,MutezValidationError:()=>j,NatValidationError:()=>A,OrValidationError:()=>v,ParameterEncodingError:()=>Ne,ParameterSchema:()=>qe,SaplingStateValue:()=>Qe,Schema:()=>We,SetValidationError:()=>Q,SignatureValidationError:()=>Z,StorageEncodingError:()=>Ke,Token:()=>p,TokenArgumentValidationError:()=>_,TokenComparisonError:()=>E,UnitValue:()=>Xe,VERSION:()=>Je,ViewSchema:()=>Ze,deepEqual:()=>ze});var n,i=r(6075),o=r.n(i),s=r(6571),a=r(6483),c=r(6209);class u extends s.TaquitoError{constructor(e,t){super(),this.mapType=e,this.reason=t,this.message=`The map type '${JSON.stringify(e)}' is invalid. Reason: ${t}.`,this.name="InvalidMapTypeError"}}const l=Symbol.for("taquito-michelson-map-type-symbol");class d extends s.TaquitoError{constructor(e,t,r,n){super(),this.value=e,this.type=t,this.reason=n,this.name="MapTypecheckError",this.message=`The ${r} provided: ${JSON.stringify(e)} is not compatible with the expected michelson type: ${JSON.stringify(t)}. Reason: ${JSON.stringify(n)}.`,this.name="MapTypecheckError"}}class f{static isMichelsonMap(e){return e&&!0===e[l]}constructor(e){this.valueMap=new Map,this.keyMap=new Map,this[n]=!0,e&&this.setType(e)}setType(e){!function(e){if(!("prim"in e))throw new u(e,"Missing 'prim' field");if(!["map","big_map"].includes(e.prim))throw new u(e,"The prim field should be 'map' or 'big_map'");if(!("args"in e))throw new u(e,"Missing 'args' field");if(!Array.isArray(e.args))throw new u(e,"The 'args' field should be an array");if(2!==e.args.length)throw new u(e,"The 'args' field should have 2 elements")}(e),this.keySchema=new We(e.args[0]),this.valueSchema=new We(e.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(e,t){const r=new f(t);return Object.keys(e).forEach((t=>{r.set(t,e[t])})),r}typecheckKey(e){this.keySchema&&this.keySchema.Typecheck(e)}typecheckValue(e){this.valueSchema&&this.valueSchema.Typecheck(e)}assertTypecheckValue(e){try{this.typecheckValue(e)}catch(t){throw new d(e,this.valueSchema,"value",t)}}assertTypecheckKey(e){try{this.typecheckKey(e)}catch(t){throw new d(e,this.keySchema,"key",t)}}serializeDeterministically(e){return o()(e)}*keys(){for(const[e]of this.entries())yield e}*values(){for(const[,e]of this.entries())yield e}*entries(){for(const e of this.valueMap.keys())yield[this.keyMap.get(e),this.valueMap.get(e)]}get(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.valueMap.get(t)}set(e,t){this.assertTypecheckKey(e),this.assertTypecheckValue(t);const r=this.serializeDeterministically(e);this.keyMap.set(r,e),this.valueMap.set(r,t)}delete(e){this.assertTypecheckKey(e),this.keyMap.delete(this.serializeDeterministically(e)),this.valueMap.delete(this.serializeDeterministically(e))}has(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.keyMap.has(t)&&this.valueMap.has(t)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(e){for(const[t,r]of this.entries())e(r,t,this)}}n=l;class h extends s.TaquitoError{constructor(e,t,r){super(),this.value=e,this.token=t,this.name="TokenValidationError";const n=this.token.annot(),i=n?`[${n}] `:"";this.message=`${i}${r}`}}class p{static get fieldNumberingStrategy(){return p._fieldNumberingStrategy}static set fieldNumberingStrategy(e){p._fieldNumberingStrategy=e}constructor(e,t,r,n){this.val=e,this.idx=t,this.fac=r,this.parentTokenType=n,this.createToken=this.fac}typeWithoutAnnotations(){const e=t=>{if("object"==typeof t){if(Array.isArray(t)){return t.map((t=>e(t)))}const r=t;return r.args?{prim:r.prim,args:r.args.map((t=>e(t)))}:{prim:r.prim}}return t};return(t=this.val).args?{prim:t.prim,args:t.args.map((t=>e(t)))}:{prim:t.prim};var t}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}p._fieldNumberingStrategy="Latest";class b extends p{compare(e,t){return e===t?0:e<t?-1:1}}class m extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BigMapValidationError"}}class g extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:g.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}validate(e){if(!f.isMichelsonMap(e))throw new m(e,this,`Value ${JSON.stringify(e)} is not a MichelsonMap`)}objLitToMichelsonMap(e){return e instanceof f?e:"object"==typeof e?0===Object.keys(e).length?new f:f.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[g.prim]?t[g.prim](r,this.val):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}Execute(e,t){if(t&&t[g.prim])return t[g.prim](e,this.val);if(Array.isArray(e)){const t=new f(this.val);return e.forEach((e=>{t.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1]))})),t}if("int"in e)return e.int;throw new m(e,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(e)}`)}findAndReturnTokens(e,t){return g.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}g.prim="big_map";class v extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="OrValidationError"}}class y extends b{constructor(e,t,r,n){super(e,t,r,n),this.val=e,this.idx=t,this.fac=r,this.parentTokenType=n}Encode(e){const t=e[e.length-1],r=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.getIdxForChildren()+n,"Or");if(String(r.annot())!==String(t)||r instanceof y){if(String(i.annot())!==String(t)||i instanceof y){if(r instanceof y){const t=r.Encode(e);if(t)return{prim:"Left",args:[t]}}if(i instanceof y){const t=i.Encode(e);if(t)return{prim:"Right",args:[t]}}return null}return e.pop(),{prim:"Right",args:[i.Encode(e)]}}return e.pop(),{prim:"Left",args:[r.Encode(e)]}}ExtractSignature(){const e=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let t=1;e instanceof y&&(t=Object.keys(e.ExtractSchema()).length);const r=this.createToken(this.val.args[1],this.getIdxForChildren()+t,"Or"),n=[];if(e instanceof y)n.push(...e.ExtractSignature());else for(const t of e.ExtractSignature())n.push([e.annot(),...t]);if(r instanceof y)n.push(...r.ExtractSignature());else for(const e of r.ExtractSignature())n.push([r.annot(),...e]);return n}EncodeObject(e,t){this.validateJavascriptObject(e);const r=Object.keys(e)[0],n=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let i=1;n instanceof y&&(i=Object.keys(n.ExtractSchema()).length);const o=this.createToken(this.val.args[1],this.getIdxForChildren()+i,"Or");if(String(n.annot())!==String(r)||n instanceof y){if(String(o.annot())!==String(r)||o instanceof y){if(n instanceof y){const r=n.EncodeObject(e,t);if(r)return{prim:"Left",args:[r]}}if(o instanceof y){const r=o.EncodeObject(e,t);if(r)return{prim:"Right",args:[r]}}return null}return{prim:"Right",args:[o.EncodeObject(e[r],t)]}}return{prim:"Left",args:[n.EncodeObject(e[r],t)]}}validateJavascriptObject(e){if("object"!=typeof e||Array.isArray(e)||null===e||1!==Object.keys(e).length)throw new v(e,this,`EncodeObject expects an object with a single key but got: ${JSON.stringify(e)}`)}Execute(e,t){const r=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.getIdxForChildren()+n,"Or");if("Right"===e.prim)return i instanceof y?i.Execute(e.args[0],t):{[i.annot()]:i.Execute(e.args[0],t)};if("Left"===e.prim)return r instanceof y?r.Execute(e.args[0],t):{[r.annot()]:r.Execute(e.args[0],t)};throw new v(e,this,`Was expecting Left or Right prim but got: ${JSON.stringify(e.prim)}`)}traversal(e,t,r){const n=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let i,o=1;n instanceof y?(i=e(n),o=Object.keys(n.ExtractSchema()).length):i={[n.annot()]:e(n)};const s=this.createToken(this.val.args[1],this.getIdxForChildren()+o,"Or");let a;a=s instanceof y?t(s):{[s.annot()]:t(s)};return r(i,a)}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}generateSchema(){return{__michelsonType:y.prim,schema:this.traversal((e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}}findToken(e){const t=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.getIdxForChildren()+r,"Or");if(String(t.annot())===String(e)&&!(t instanceof y)&&t instanceof b)return t;if(String(n.annot())===String(e)&&!(n instanceof y)&&n instanceof b)return n;if(t instanceof y){const r=t.findToken(e);if(r)return r}if(n instanceof y){const t=n.findToken(e);if(t)return t}return null}compare(e,t){const r=Object.keys(e)[0];if(r!==Object.keys(t)[0]){return JSON.stringify(this.EncodeObject(e))<JSON.stringify(this.EncodeObject(t))?-1:1}{const n=this.findToken(r);if(n instanceof b)return n.compare(e[r],t[r])}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return y.prim===e&&t.push(this),this.traversal((r=>r.findAndReturnTokens(e,t)),(r=>r.findAndReturnTokens(e,t)),((e,t)=>Object.assign(Object.assign({},e),t))),t}getIdxForChildren(){return"Legacy"===p.fieldNumberingStrategy||"Or"===this.parentTokenType?this.idx:0}}y.prim="or";class _ extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="TokenArgumentValidationError"}}class E extends s.TaquitoError{constructor(e,t){super(),this.val1=e,this.val2=t,this.name="TokenComparisonError",this.message=`Tokens ${JSON.stringify(e)} and ${JSON.stringify(t)} are not comparable`}}function w(e,t=O.prim){if(Array.isArray(e))return w({prim:t,args:e},t);if(void 0===e.args)throw new _(`The value ${JSON.stringify(e)} is an invalid PairToken with no arguments, a pair must have two or more arguments.`);return e.args.length>2?[e.args[0],{prim:t,args:e.args.slice(1)}]:[e.args[0],e.args[1]]}class O extends b{constructor(e,t,r,n){super(Array.isArray(e)?{prim:O.prim,args:e}:e.prim?e:{prim:O.prim,args:e},t,r,n)}args(){return w(this.val)}tokens(){let e=0;return this.args().map((t=>{const r=this.createToken(t,this.getIdxForChildren()+e,"Pair");return r instanceof O?e+=Object.keys(r.ExtractSchema()).length:e++,r}))}Encode(e){return{prim:"Pair",args:this.tokens().map((t=>t.Encode(e)))}}ExtractSignature(){const e=this.args(),t=this.createToken(e[0],this.getIdxForChildren(),"Pair");let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(e[1],this.getIdxForChildren()+r,"Pair"),i=[];for(const e of t.ExtractSignature())for(const t of n.ExtractSignature())i.push([...e,...t]);return i}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}ToKey(e){return this.Execute(e)}EncodeObject(e,t){const[r,n]=this.tokens();let i,o;return i=r instanceof O&&!r.hasAnnotations()?e:e[r.annot()],o=n instanceof O&&!n.hasAnnotations()?e:e[n.annot()],{prim:"Pair",args:[r.EncodeObject(i,t),n.EncodeObject(o,t)]}}traversal(e,t){const r=this.args(),n=this.createToken(r[0],this.getIdxForChildren(),"Pair");let i,o=1;n instanceof O&&!n.hasAnnotations()?(i=e(n),n instanceof O&&(o=Object.keys(n.ExtractSchema()).length)):i={[n.annot()]:e(n)};const s=this.createToken(r[1],this.getIdxForChildren()+o,"Pair");let a;a=s instanceof O&&!s.hasAnnotations()?t(s):{[s.annot()]:t(s)};return Object.assign(Object.assign({},i),a)}Execute(e,t){const r=w(e,"Pair");return this.traversal((e=>e.Execute(r[0],t)),(e=>e.Execute(r[1],t)))}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()))}generateSchema(){return{__michelsonType:O.prim,schema:this.traversal((e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()))}}compare(e,t){const[r,n]=this.tokens(),i=(e,t)=>e instanceof O&&!e.hasAnnotations()?t:t[e.annot()];if(r instanceof b&&n instanceof b){const o=r.compare(i(r,e),i(r,t));return 0===o?n.compare(i(n,e),i(n,t)):o}throw new E(e,t)}findAndReturnTokens(e,t){return O.prim===e&&t.push(this),this.tokens().map((r=>r.findAndReturnTokens(e,t))),t}getIdxForChildren(){return"Legacy"===p.fieldNumberingStrategy||"Pair"===this.parentTokenType?this.idx:0}}O.prim="pair";class A extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NatValidationError"}}class S extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.A(e[Object.keys(e)[0]])}Encode(e){const t=e.pop();return this.validate(t),{int:new a.A(t).toFixed()}}validate(e){const t=new a.A(e);if(t.isNaN())throw new A(e,this,`Value is not a number: ${JSON.stringify(e)}`);if(t.isNegative())throw new A(e,this,`Value cannot be negative: ${JSON.stringify(e)}`)}EncodeObject(e,t){return this.validate(e),t&&t[S.prim]?t[S.prim](e):{int:new a.A(e).toFixed()}}ExtractSchema(){return S.prim}generateSchema(){return{__michelsonType:S.prim,schema:S.prim}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:S.prim}}}ToKey({int:e}){return new a.A(e)}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return S.prim===e&&t.push(this),t}}S.prim="nat";class P extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return P.prim}generateSchema(){return{__michelsonType:P.prim,schema:P.prim}}Encode(e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[P.prim]?t[P.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:P.prim}}}findAndReturnTokens(e,t){return P.prim===e&&t.push(this),t}}P.prim="string";class T extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="AddressValidationError"}}class R extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:(0,c.b58decode)(e)},type:{prim:"bytes"}}}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new T(e,this,`Address is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[R.prim]?t[R.prim](e):{string:e}}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new T(e,this,`cannot be missing both string and bytes: ${JSON.stringify(e)}`);return(0,c.encodeAddress)(e.bytes)}ExtractSchema(){return R.prim}generateSchema(){return{__michelsonType:R.prim,schema:R.prim}}ToKey({bytes:e,string:t}){if(t)return t;if(!e)throw new T({bytes:e,string:t},this,`cannot be missing both string and bytes ${JSON.stringify({string:t,bytes:e})}`);return(0,c.encodeAddress)(e)}compare(e,t){const r=e=>e.startsWith("tz"),n=r(e),i=r(t);return n&&!i?-1:i&&!n?1:super.compare(e,t)}findAndReturnTokens(e,t){return R.prim===e&&t.push(this),t}}R.prim="address";class I extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MapValidationError"}}class x extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!f.isMichelsonMap(e))throw new I(e,this,`Value ${JSON.stringify(e)} is not a valid MichelsonMap`)}Execute(e,t){const r=new f(this.val);return e.forEach((e=>{r.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1],t))})),r}objLitToMichelsonMap(e){return e instanceof f?e:"object"==typeof e?0===Object.keys(e).length?new f:f.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[x.prim]?t[x.prim](r):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:x.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(e,t){return x.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}x.prim="map";class M extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return"true"===String(e.prim).toLowerCase()}Encode(e){return{prim:e.pop()?"True":"False"}}EncodeObject(e,t){return t&&t[M.prim]?t[M.prim](e):{prim:e?"True":"False"}}ExtractSchema(){return M.prim}generateSchema(){return{__michelsonType:M.prim,schema:M.prim}}ToBigMapKey(e){return{key:this.EncodeObject(e),type:{prim:M.prim}}}ToKey(e){return this.EncodeObject(e)}compare(e,t){return e&&t||!e&&!t?0:e?1:-1}findAndReturnTokens(e,t){return M.prim===e&&t.push(this),t}}M.prim="bool";class k extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ContractValidationError"}}class L extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new k(e,this,`Value ${JSON.stringify(e)} is not a valid contract address.`);return null}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new k(e,this,`Value ${JSON.stringify(e)} is not a valid contract address. must contain bytes or string.`);return(0,c.encodeAddress)(e.bytes)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[L.prim]?t[L.prim](e):{string:e}}ExtractSchema(){return L.prim}generateSchema(){const e=this.createToken(this.val.args[0],0);return{__michelsonType:L.prim,schema:{parameter:this.val.args[0]?e.generateSchema():{}}}}findAndReturnTokens(e,t){return L.prim===e&&t.push(this),t}}L.prim="contract";class C extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ListValidationError"}}class N extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}validate(e){if(!Array.isArray(e))throw new C(e,this,`Value ${JSON.stringify(e)} is not a valid array`)}Encode(e){const t=e.pop();this.validate(t);const r=this.createToken(this.val.args[0],0);return t.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}Execute(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),e.reduce(((e,n)=>[...e,r.Execute(n,t)]),[])}EncodeObject(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),t&&t[N.prim]?t[N.prim](e):e.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}ExtractSchema(){return{[N.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:N.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(e,t){return N.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),t}}N.prim="list";class j extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MutezValidationError"}}class D extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.A(e[Object.keys(e)[0]])}ExtractSchema(){return D.prim}generateSchema(){return{__michelsonType:D.prim,schema:D.prim}}validate(e){if(new a.A(e).isNaN())throw new j(e,this,`Value is not a number: ${e}`)}Encode(e){const t=e.pop();return this.validate(t),{int:String(t).toString()}}EncodeObject(e,t){return this.validate(e),t&&t[D.prim]?t[D.prim](e):{int:String(e).toString()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:D.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return D.prim===e&&t.push(this),t}}D.prim="mutez";class U extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BytesValidationError"}}class B extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:e},type:{prim:B.prim}}}validate(e){if("string"!=typeof e||!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new U(e,this,`Invalid bytes: ${e}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=(0,c.stripHexPrefix)(this.convertUint8ArrayToHexString(t)),this.validate(t),{bytes:String(t).toString()}}EncodeObject(e,t){return"string"==typeof(e=this.convertUint8ArrayToHexString(e))&&(e=(0,c.stripHexPrefix)(e)),this.validate(e),t&&t[B.prim]?t[B.prim](e):{bytes:String(e).toString()}}Execute(e){return e.bytes}ExtractSchema(){return B.prim}generateSchema(){return{__michelsonType:B.prim,schema:B.prim}}ToKey({bytes:e,string:t}){return t||e}findAndReturnTokens(e,t){return B.prim===e&&t.push(this),t}}B.prim="bytes";class F extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(e){const t=e;return null==t?{prim:"None"}:!Array.isArray(t)||void 0!==t[t.length-1]&&null!==t[t.length-1]?{prim:"Some",args:[this.schema().Encode(e)]}:(t.pop(),{prim:"None"})}EncodeObject(e,t){let r=e;return null==r?{prim:"None"}:(r="object"==typeof r&&"Some"in r?r.Some:r,{prim:"Some",args:[this.schema().EncodeObject(r,t)]})}Execute(e,t){return"None"===e.prim?null:{Some:this.schema().Execute(e.args[0],t)}}ExtractSchema(){return{Some:this.schema().ExtractSchema()}}generateSchema(){return{__michelsonType:F.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature()]}get KeySchema(){return this.schema()}compare(e,t){return e?t?this.KeySchema.compare(e,t):1:-1}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return F.prim===e&&t.push(this),this.subToken().findAndReturnTokens(e,t),t}}F.prim="option";class K extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string&&/^\d+$/.test(e.string)?new Date(1e3*Number(e.string)).toISOString():e.string?new Date(e.string).toISOString():e.int?new Date(1e3*Number(e.int)).toISOString():void 0}Encode(e){const t=e.pop();return"number"==typeof t?{int:String(t)}:{string:t}}EncodeObject(e,t){return t&&t[K.prim]?t[K.prim](e):"number"==typeof e?{int:String(e)}:{string:e}}ExtractSchema(){return K.prim}generateSchema(){return{__michelsonType:K.prim,schema:K.prim}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:K.prim}}}findAndReturnTokens(e,t){return K.prim===e&&t.push(this),t}}K.prim="timestamp";class H extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="IntValidationError"}}class G extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.A(e[Object.keys(e)[0]])}ExtractSchema(){return G.prim}generateSchema(){return{__michelsonType:G.prim,schema:G.prim}}validate(e){if(new a.A(e).isNaN())throw new H(e,this,`Value is not a number: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{int:new a.A(t).toFixed()}}EncodeObject(e,t){return this.validate(e),t&&t[G.prim]?t[G.prim](e):{int:new a.A(e).toFixed()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:G.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return G.prim===e&&t.push(this),t}}G.prim="int";class $ extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){return e.pop(),{prim:"Unit"}}EncodeObject(e,t){return t&&t[$.prim]?t[$.prim](e):{prim:"Unit"}}Execute(e){return Xe}ExtractSchema(){return $.prim}generateSchema(){return{__michelsonType:$.prim,schema:$.prim}}compare(e,t){return 0}ToKey(e){return Xe}ToBigMapKey(e){return{key:{prim:"Unit"},type:{prim:$.prim}}}findAndReturnTokens(e,t){return $.prim===e&&t.push(this),t}}$.prim="unit";class V extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyValidationError"}}class z extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKey)(e.bytes)}validate(e){if((0,c.validatePublicKey)(e)!==c.ValidationResult.VALID)throw new V(e,this,"Key is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[z.prim]?t[z.prim](e):{string:e}}ExtractSchema(){return z.prim}generateSchema(){return{__michelsonType:z.prim,schema:z.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:z.prim}}}compare(e,t){const r=this.getPrefix(e),n=this.getPrefix(t);if(r===c.Prefix.EDPK&&n!==c.Prefix.EDPK)return-1;if(r===c.Prefix.SPPK&&n!==c.Prefix.SPPK)return n===c.Prefix.EDPK?1:-1;if(r===c.Prefix.P2PK){if(n!==c.Prefix.P2PK)return 1;const r=this.getP256PublicKeyComparableBytes(e),i=this.getP256PublicKeyComparableBytes(t);return Buffer.compare(r,i)}return super.compare(e,t)}getPrefix(e){return e.substring(0,4)}getP256PublicKeyComparableBytes(e){return(0,c.b58cdecode)(e,c.prefix[c.Prefix.P2PK]).slice(1)}findAndReturnTokens(e,t){return z.prim===e&&t.push(this),t}}z.prim="key";class W extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyHashValidationError"}}class q extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKeyHash)(e.bytes)}validate(e){if((0,c.validateKeyHash)(e)!==c.ValidationResult.VALID)throw new W(e,this,`KeyHash is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[q.prim]?t[q.prim](e):{string:e}}ExtractSchema(){return q.prim}generateSchema(){return{__michelsonType:q.prim,schema:q.prim}}ToKey({string:e,bytes:t}){return e||(0,c.encodeKeyHash)(t)}ToBigMapKey(e){return{key:{string:e},type:{prim:q.prim}}}findAndReturnTokens(e,t){return q.prim===e&&t.push(this),t}}q.prim="key_hash";class Z extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SignatureValidationError"}}class Y extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:e.bytes}validate(e){if((0,c.validateSignature)(e)!==c.ValidationResult.VALID)throw new Z(e,this,"Signature is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[Y.prim]?t[Y.prim](e):{string:e}}ExtractSchema(){return Y.prim}generateSchema(){return{__michelsonType:Y.prim,schema:Y.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:Y.prim}}}findAndReturnTokens(e,t){return Y.prim===e&&t.push(this),t}}Y.prim="signature";class J extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(e){return e.string?e.string:e}Encode(e){return e.pop()}EncodeObject(e,t){return t&&t[J.prim]?t[J.prim](e):e}ExtractSchema(){return{[J.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:J.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(e,t){return J.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(e,t),t}}J.prim="lambda";class X extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string}Encode(...e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[X.prim]?t[X.prim](e):{string:e}}ExtractSchema(){return X.prim}generateSchema(){return{__michelsonType:X.prim,schema:X.prim}}findAndReturnTokens(e,t){return X.prim===e&&t.push(this),t}}X.prim="operation";class Q extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SetValidationError"}}class ee extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!Array.isArray(e))throw new Q(e,this,`Value ${JSON.stringify(e)} is not an array`)}Encode(e){const t=e.pop();return this.validate(t),t.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}Execute(e,t){return e.reduce(((e,r)=>[...e,this.KeySchema.Execute(r,t)]),[])}EncodeObject(e,t){return this.validate(e),t&&t[ee.prim]?t[ee.prim](e):e.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}ExtractSchema(){return ee.prim}generateSchema(){return{__michelsonType:ee.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(e,t){return ee.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),t}}ee.prim="set";class te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChainIDValidationError"}}class re extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateChain)(e)!==c.ValidationResult.VALID)throw new te(e,this,`Value ${JSON.stringify(e)} is not a valid ChainID`)}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return re.prim}generateSchema(){return{__michelsonType:re.prim,schema:re.prim}}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[re.prim]?t[re.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:re.prim}}}findAndReturnTokens(e,t){return re.prim===e&&t.push(this),t}}re.prim="chain_id";class ne extends s.TaquitoError{constructor(){super(),this.name="TicketEncodeError",this.message="Tickets cannot be sent to the blockchain; they are created on-chain"}}const ie={prim:"contract"},oe={prim:"int"};class se extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new ne}EncodeObject(e,t){if(t&&t[se.prim])return t[se.prim](e,this.val);throw new ne}Execute(e,t){if(t&&t[se.prim])return t[se.prim](e,this.val);const r=this.createToken(ie,this.idx),n=this.valueToken,i=this.createToken(oe,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:L.prim,value:this.valueToken.ExtractSchema(),amount:G.prim}}generateSchema(){return{__michelsonType:se.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:L.prim,schema:L.prim},amount:{__michelsonType:G.prim,schema:G.prim}}}}findAndReturnTokens(e,t){return se.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}se.prim="ticket";class ae extends s.TaquitoError{constructor(){super(),this.name="TicketDeprecatedEncodeError",this.message="Ticket_deprecated cannot be sent to the blockchain; they are created on-chain"}}const ce={prim:"contract"},ue={prim:"int"};class le extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new ae}EncodeObject(e,t){if(t&&t[le.prim])return t[le.prim](e,this.val);throw new ae}Execute(e,t){if(t&&t[le.prim])return t[le.prim](e,this.val);const r=this.createToken(ce,this.idx),n=this.valueToken,i=this.createToken(ue,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:L.prim,value:this.valueToken.ExtractSchema(),amount:G.prim}}generateSchema(){return{__michelsonType:le.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:L.prim,schema:L.prim},amount:{__michelsonType:G.prim,schema:G.prim}}}}findAndReturnTokens(e,t){return le.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}le.prim="ticket_deprecated";class de extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NeverTokenError"}}class fe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){const t=e.pop();throw new de(t,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(t)}.`)}EncodeObject(e,t){if(t&&t[fe.prim])return t[fe.prim](e);throw new de(e,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(e)}.`)}Execute(e){throw new de(e,this,`There is no literal value for the type never. Trying to execute ${JSON.stringify(e)}.`)}ExtractSchema(){return fe.prim}generateSchema(){return{__michelsonType:fe.prim,schema:fe.prim}}findAndReturnTokens(e,t){return fe.prim===e&&t.push(this),t}}fe.prim="never";class he extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingStateValidationError"}}class pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}isValid(e){return"object"==typeof e&&0===Object.keys(e).length}Execute(e,t){if(t&&t[pe.prim])return t[pe.prim](e,this.val);if("int"in e)return e.int;throw new he(e,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();if(this.isValid(t))return[];throw new he(t,this,`Invalid sapling_state. Received: ${JSON.stringify(t)} while expecting: {}`)}EncodeObject(e,t){if(t&&t[pe.prim])return t[pe.prim](e);if(this.isValid(e))return[];throw new he(e,this,`Invalid sapling_state. Received: ${JSON.stringify(e)} while expecting: {}`)}ExtractSchema(){return{[pe.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:pe.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return pe.prim===e&&t.push(this),t}}pe.prim="sapling_state";class be extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionValidationError"}}class me extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new be(e,this,`There is no literal value for the sapling_transaction type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new be(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[me.prim]?t[me.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[me.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:me.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return me.prim===e&&t.push(this),t}}me.prim="sapling_transaction";class ge extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionDeprecatedValidationError"}}class ve extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new ge(e,this,`There is no literal value for the sapling_transaction_deprecated type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new ge(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[ve.prim]?t[ve.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[ve.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:ve.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return ve.prim===e&&t.push(this),t}}ve.prim="sapling_transaction_deprecated";class ye extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381frValidationError"}}class _e extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new ye(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return"number"==typeof t?{int:t.toString()}:(t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t})}EncodeObject(e,t){return t&&t[_e.prim]?t[_e.prim](e):"number"==typeof e?{int:e.toString()}:(e=this.convertUint8ArrayToHexString(e),this.validate(e),{bytes:e})}Execute(e){return e.bytes}ExtractSchema(){return _e.prim}generateSchema(){return{__michelsonType:_e.prim,schema:_e.prim}}findAndReturnTokens(e,t){return _e.prim===e&&t.push(this),t}}_e.prim="bls12_381_fr";class Ee extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g1ValidationError"}}class we extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Ee(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[we.prim]?t[we.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return we.prim}generateSchema(){return{__michelsonType:we.prim,schema:we.prim}}findAndReturnTokens(e,t){return we.prim===e&&t.push(this),t}}we.prim="bls12_381_g1";class Oe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g2ValidationError"}}class Ae extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Oe(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Ae.prim]?t[Ae.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Ae.prim}generateSchema(){return{__michelsonType:Ae.prim,schema:Ae.prim}}findAndReturnTokens(e,t){return Ae.prim===e&&t.push(this),t}}Ae.prim="bls12_381_g2";class Se extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestValidationError"}}class Pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Se(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Pe.prim]?t[Pe.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Pe.prim}generateSchema(){return{__michelsonType:Pe.prim,schema:Pe.prim}}findAndReturnTokens(e,t){return Pe.prim===e&&t.push(this),t}}Pe.prim="chest";class Te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestKeyValidationError"}}class Re extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Te(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Re.prim]?t[Re.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Re.prim}generateSchema(){return{__michelsonType:Re.prim,schema:Re.prim}}findAndReturnTokens(e,t){return Re.prim===e&&t.push(this),t}}Re.prim="chest_key";class Ie extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantEncodingError"}}class xe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantDecodingError"}}class Me extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e,t){if(t&&t[Me.prim])return t[Me.prim](e,this.val);throw new xe(e,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(e){throw new Ie(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(e,t){if(t&&t[Me.prim])return t[Me.prim](e);throw new Ie(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return Me.prim}generateSchema(){return{__michelsonType:Me.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(e,t){return Me.prim===e&&t.push(this),t}}Me.prim="constant";const ke=[O,S,P,g,R,x,M,y,L,N,D,B,F,K,G,$,z,q,Y,J,X,ee,re,se,le,fe,pe,me,ve,_e,we,Ae,Pe,Re,Me];class Le extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.data=t,this.name="Invalid token error"}}function Ce(e,t,r){if(Array.isArray(e))return new O(e,t,Ce,r);const n=ke.find((t=>t.prim===e.prim));if(!n)throw new Le(`Malformed data: ${JSON.stringify(e)}. Expected a value with a valid prim property`,e);return new n(e,t,Ce,r)}class Ne extends s.InvalidViewParameterError{constructor(e,t,r,n){super(e,t,r,n),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="ParameterEncodingError",this.message=`Could not encode parameter ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}`}}class je extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidScriptError";let r="Invalid on-chain view found in the following script.";t&&(r+=` Reason: ${t}.`),r+=`Script: ${JSON.stringify(e)}`,this.message=r}}class De extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidRpcResponseError";let r="Invalid RPC response passed as argument(s).";t&&(r+=` Reason: ${t}.`),r+=` Received: ${JSON.stringify(e)}`,this.message=r}}class Ue extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="InvalidBigMapSchemaError"}}class Be extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.value=t,this.name="InvalidBigMapDiffError"}}class Fe extends s.TaquitoError{constructor(e,t,r,n){super(),this.details=t,this.schema=r,this.value=n,this.name="BigMapEncodingError",this.message=`Unable to encode the big map ${e}. Schema is: ${JSON.stringify(r)}. The ${e} is: ${JSON.stringify(n)}. Error details: ${t}`}}class Ke extends s.TaquitoError{constructor(e,t,r,n,i){super(),this.details=t,this.schema=r,this.value=n,this.semantics=i,this.name="StorageEncodingError",this.message=`Unable to encode ${e}. The schema is: ${JSON.stringify(r)}, the value is: ${JSON.stringify(n)}.${i?`And the semantic is: ${JSON.stringify(i)}`:""}. Error details: ${t}`}}class He extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="MissingArgumentError"}}var Ge;const $e=Symbol.for("taquito-schema-type-symbol");function Ve(e,t=O.prim){var r,n;if(Array.isArray(e))return Ve({prim:t,args:e},t);const i=e;return i.prim===t&&i.args&&i.args.length>2?Object.assign(Object.assign({},i),{args:[null===(r=i.args)||void 0===r?void 0:r[0],{prim:t,args:null===(n=i.args)||void 0===n?void 0:n.slice(1)}]}):i}function ze(e,t){if(void 0===e||void 0===t)return e===t;const r=Ve(e),n=Ve(t);return r.prim===n.prim&&(void 0===r.args&&void 0===n.args||void 0!==r.args&&void 0!==n.args&&r.args.length===n.args.length&&r.args.every(((e,t)=>{var r,i;return ze(e,null!==(i=null===(r=n.args)||void 0===r?void 0:r[t])&&void 0!==i?i:{})})))&&(void 0===r.annots&&void 0===n.annots||void 0!==r.annots&&void 0!==n.annots&&r.annots.length===n.annots.length&&r.annots.every(((e,t)=>{var r;return e===(null===(r=n.annots)||void 0===r?void 0:r[t])})))}class We{static isSchema(e){return e&&!0===e[$e]}static fromRPCResponse(e){if(!e)throw new De(e,"the RPC response is empty");if(!e.script)throw new De(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new De(e,"The response.script.code should be an array");let t=e.script.code;for(;1===t.length&&Array.isArray(t[0]);)t=t[0];const r=t.find((e=>"prim"in e&&"storage"===e.prim));if(!r||!Array.isArray(r.args))throw new De(e,'The response.script.code has an element of type {prim: "storage"}, but its args is not an array');return new We(r.args[0])}isExpressionExtended(e){return"prim"in e&&Array.isArray(e.args)}constructor(e){if(this.val=e,this[Ge]=!0,this.root=Ce(e,0),this.root instanceof g)this.bigMap=this.root;else if(this.isExpressionExtended(e)&&"pair"===e.prim){const t=e.args[0];this.isExpressionExtended(t)&&"big_map"===t.prim&&(this.bigMap=new g(t,0,Ce))}}removeTopLevelAnnotation(e){return(this.root instanceof O||this.root instanceof y)&&this.root.hasAnnotations()&&"object"==typeof e&&1===Object.keys(e).length?e[Object.keys(e)[0]]:e}Execute(e,t){const r=this.root.Execute(e,t);return this.removeTopLevelAnnotation(r)}Typecheck(e){this.root instanceof g&&Number.isInteger(Number(e))||this.root instanceof se&&e.ticketer&&e.value&&e.amount||this.root instanceof le&&e.ticketer&&e.value&&e.amount||this.root instanceof x&&this.root.ValueSchema instanceof g||this.root.EncodeObject(e)}ExecuteOnBigMapDiff(e,t){if(!this.bigMap)throw new Ue("Big map schema is undefined");if(!Array.isArray(e))throw new Be(`Big map diff must be an array, got: ${JSON.stringify(e)}`,e);const r=e.map((({key:e,value:t})=>({args:[e,t]})));return this.bigMap.Execute(r,t)}ExecuteOnBigMapValue(e,t){if(!this.bigMap)throw new Ue("Big map schema is undefined");return this.bigMap.ValueSchema.Execute(e,t)}EncodeBigMapKey(e){if(!this.bigMap)throw new Ue("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(e)}catch(t){throw new Fe("key",t,this.bigMap.KeySchema,e)}}Encode(e,t){try{return this.root.EncodeObject(e,t)}catch(r){if(r instanceof h)throw r;throw new Ke("storage object",r,this.root,e,t)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(e,t){if(!this.bigMap)throw new Ue("Big map schema is undefined");const r=e.reduce(((e,t)=>Object.assign(Object.assign({},e),this.ExecuteOnBigMapDiff(t.contents[0].metadata.operation_result.big_map_diff))),{});return Object.assign(Object.assign({},this.Execute(t)),{[this.bigMap.annot()]:r})}FindFirstInTopLevelPair(e,t){return this.findValue(this.root.val,e,t)}findValue(e,t,r){if(ze(r,e))return t;if(Array.isArray(e)||"pair"===e.prim){const n=Ve(e),i=Ve(t,"Pair");if(void 0===n.args||void 0===i.args)throw new He("Tokens have no arguments");if(n.args[0])return this.findValue(n.args[0],i.args[0],r)||this.findValue(n.args[1],i.args[1],r)}}findToken(e){return this.root.findAndReturnTokens(e,[])}}Ge=$e;class qe{static fromRPCResponse(e){if(!e)throw new De(e,"the RPC response is empty");if(!e.script)throw new De(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new De(e,"The response.script.code should be an array");const t=e.script.code.find((e=>"prim"in e&&"parameter"===e.prim));if(!t)throw new De(e,'The response.script.code should have an element of type {prim: "parameter"}');if(!Array.isArray(t.args))throw new De(e,'The response.script.code has an element of type {prim: "parameter"}, but its args is not an array');return new qe(t.args[0])}get isMultipleEntryPoint(){return this.root instanceof y||this.root instanceof F&&this.root.subToken()instanceof y}get hasAnnotation(){return!this.isMultipleEntryPoint||"0"!==Object.keys(this.ExtractSchema())[0]}constructor(e){this.root=Ce(e,0)}Execute(e,t){return this.root.Execute(e,t)}Encode(...e){try{return this.root.Encode(e.reverse())}catch(t){if(t instanceof h)throw t;throw new Ne("Unable to encode parameter",this.root,e,t)}}EncodeObject(e,t){try{return this.root.EncodeObject(e,t)}catch(t){if(t instanceof h)throw t;throw new Ne("Unable to encode parameter object",this.root,e,t)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class Ze{static fromRPCResponse(e){const t=[],r=e&&e.script&&Array.isArray(e.script.code)&&e.script.code.filter((e=>"view"===e.prim));return r&&r.forEach((e=>{t.push(new Ze(e.args))})),t}constructor(e){if(!e)throw new je(e,"the args are not defined");if(4!==e.length)throw new je(e,"there should be exactly 4 arguments");if(!("string"in e[0])||!e[0].string)throw new je(e,"The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }");this.viewName=e[0].string,this.viewArgsType=e[1],this.viewReturnType=e[2],this.instructions=e[3],this.rootArgsType=Ce(this.viewArgsType,0),this.rootReturnType=Ce(this.viewReturnType,0)}encodeViewArgs(e){try{return this.rootArgsType.EncodeObject(e)}catch(t){throw new Ne(this.viewName,void 0,e,t)}}decodeViewResult(e,t){return this.rootReturnType.Execute(e,t)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}class Ye{constructor(e,t){this.tag=e,this.type=t}static fromMichelineValue(e){var t,r;return new Ye(null===(t=e.annots)||void 0===t?void 0:t[0],null===(r=e.args)||void 0===r?void 0:r[0])}static fromRPCResponse(e){const t=[];return e.script.code.forEach((e=>{"prim"in e&&"code"===e.prim&&"args"in e&&e.args&&t.push(...Ye.extractEventsRecursively(e.args))})),Ye.removeDuplicates(t)}static removeDuplicates(e){const t=[];return e.forEach((e=>{-1===t.findIndex((t=>t.tag===e.tag&&ze(t.type,e.type)))&&t.push(e)})),t}static extractEventsRecursively(e){return Array.isArray(e)?e.flatMap((e=>Ye.extractEventsRecursively(e))):"prim"in e?"EMIT"===e.prim?[Ye.fromMichelineValue(e)]:"args"in e&&e.args?e.args.flatMap((e=>Ye.extractEventsRecursively(e))):[]:[]}}const Je={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"},Xe=Symbol(),Qe={}},9925:(e,t,r)=>{"use strict";r.r(t),r.d(t,{METADATA_BALANCE_UPDATES_CATEGORY:()=>b,OPERATION_METADATA:()=>p,OpKind:()=>O,PvmKind:()=>m,RpcClient:()=>S,RpcClientCache:()=>h,SmartRollupInputProofKind:()=>v,SmartRollupRefutationOptions:()=>g,SmartRollupRefuteGameEndedPlayerOutcomes:()=>E,SmartRollupRefuteGameEndedReason:()=>w,SmartRollupRefuteGameStatusOptions:()=>_,SmartRollupRefuteRevealProofKind:()=>y,VERSION:()=>A,castToBigNumber:()=>f,defaultChain:()=>u,defaultRPCOptions:()=>l});var n=r(2211),i=r(6483),o=r(6209),s=r(6571);function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function c(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const u="main",l={block:"head"};var d;function f(e,t){const r=Array.isArray(e);void 0===t&&(t=Object.keys(e));const n=r?[]:{};return t.forEach((t=>{const r=e[t];let o;if(void 0!==r){if(Array.isArray(r))return o=f(r),void(n[t]=o);o=new i.A(r),n[t]=o}})),n}!function(e){e.GET_BAKING_RIGHTS="getBakingRights",e.GET_BALLOTS="getBallots",e.GET_BALLOT_LIST="getBallotList",e.GET_BIG_MAP_KEY="getBigMapKey",e.GET_BIG_MAP_EXPR="getBigMapExpr",e.GET_BLOCK_HASH="getBlockHash",e.GET_BLOCK="getBlock",e.GET_BLOCK_HEADER="getBlockHeader",e.GET_BLOCK_METADATA="getBlockMetadata",e.GET_BALANCE="getBalance",e.GET_SPENDABLE="getSpendable",e.GET_BALANCE_AND_FROZEN_BONDS="getBalanceAndFrozenBonds",e.GET_SPENDABLE_AND_FROZEN_BONDS="getSpendableAndFrozenBonds",e.GET_FULL_BALANCE="getFullBalance",e.GET_STAKED_BALANCE="getStakedBalance",e.GET_UNSTAKED_FINALIZABLE_BALANCE="getUnstakedFinalizableBalance",e.GET_UNSTAKED_FROZEN_BALANCE="getUnstakedFrozenBalance",e.GET_UNSTAKE_REQUESTS="getUnstakeRequests",e.GET_CHAIN_ID="getChainId",e.GET_CONSTANTS="getConstants",e.GET_CONTRACT="getContract",e.GET_CURRENT_PERIOD="getCurrentPeriod",e.GET_CURRENT_PROPOSAL="getCurrentProposal",e.GET_CURRENT_QUORUM="getCurrentQuorum",e.GET_DELEGATE="getDelegate",e.GET_ALL_DELEGATES="getAllDelegates",e.GET_DELEGATES="getDelegates",e.GET_VOTING_INFO="getVotingInfo",e.GET_ATTESTATION_RIGHTS="getAttestationRights",e.GET_ENTRYPOINTS="getEntrypoints",e.GET_LIVE_BLOCKS="getLiveBlocks",e.GET_MANAGER_KEY="getManagerKey",e.GET_NORMALIZED_SCRIPT="getNormalizedScript",e.GET_PROPOSALS="getProposals",e.GET_PROTOCOLS="getProtocols",e.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",e.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",e.GET_SCRIPT="getScript",e.GET_STORAGE="getStorage",e.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",e.GET_VOTES_LISTINGS="getVotesListings",e.PACK_DATA="packData",e.GET_STORAGE_USED_SPACE="getStorageUsedSpace",e.GET_STORAGE_PAID_SPACE="getStoragePaidSpace",e.GET_TICKET_BALANCE="getTicketBalance",e.GET_ALL_TICKET_BALANCES="getAllTicketBalances",e.GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE="getAdaptiveIssuanceLaunchCycle",e.GET_PENDING_OPERATIONS="getPendingOperations"}(d||(d={}));class h{constructor(e,t=1e3){this.rpcClient=e,this.ttl=t,this._cache={}}getAllCachedData(){return this._cache}deleteAllCachedData(){for(const e in this._cache)delete this._cache[e]}formatCacheKey(e,t,r,n){let i="";return r.forEach((e=>{i="object"==typeof e?i+JSON.stringify(e)+"/":i+e+"/"})),n?`${e}/${t}/${i}${JSON.stringify(n)}/`:`${e}/${t}/${i}`}has(e){return e in this._cache}get(e){return this._cache[e].response}put(e,t){const r=setTimeout((()=>this.remove(e)),this.ttl);Object.assign(this._cache,{[e]:{handle:r,response:t}})}remove(e){e in this._cache&&delete this._cache[e]}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK_HASH,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHash({block:e});return this.put(t,r),r}}))}getLiveBlocks(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_LIVE_BLOCKS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getLiveBlocks({block:e});return this.put(t,r),r}}))}getBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBalance(e,{block:t});return this.put(r,n),n}}))}getSpendable(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SPENDABLE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSpendable(e,{block:t});return this.put(r,n),n}}))}getBalanceAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALANCE_AND_FROZEN_BONDS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBalanceAndFrozenBonds(e,{block:t});return this.put(r,n),n}}))}getSpendableAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SPENDABLE_AND_FROZEN_BONDS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSpendableAndFrozenBonds(e,{block:t});return this.put(r,n),n}}))}getFullBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_FULL_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getFullBalance(e,{block:t});return this.put(r,n),n}}))}getStakedBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STAKED_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStakedBalance(e,{block:t});return this.put(r,n),n}}))}getUnstakedFinalizableBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_UNSTAKED_FINALIZABLE_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getUnstakedFinalizableBalance(e,{block:t});return this.put(r,n),n}}))}getUnstakedFrozenBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_UNSTAKED_FROZEN_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getUnstakedFrozenBalance(e,{block:t});return this.put(r,n),n}}))}getUnstakeRequests(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_UNSTAKE_REQUESTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getUnstakeRequests(e,{block:t});return this.put(r,n),n}}))}getStorage(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STORAGE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorage(e,{block:t});return this.put(r,n),n}}))}getScript(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SCRIPT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getScript(e,{block:t});return this.put(r,n),n}}))}getNormalizedScript(e){return c(this,arguments,void 0,(function*(e,t={unparsing_mode:"Readable"},{block:r}=l){this.validateContract(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_NORMALIZED_SCRIPT,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getNormalizedScript(e,t,{block:r});return this.put(n,i),i}}))}getContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getContract(e,{block:t});return this.put(r,n),n}}))}getManagerKey(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_MANAGER_KEY,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getManagerKey(e,{block:t});return this.put(r,n),n}}))}getDelegate(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_DELEGATE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegate(e,{block:t});return this.put(r,n),n}}))}getBigMapKey(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){this.validateAddress(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BIG_MAP_KEY,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapKey(e,t,{block:r});return this.put(n,i),i}}))}getBigMapExpr(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BIG_MAP_EXPR,[r,e,t]);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapExpr(e,t,{block:r});return this.put(n,i),i}}))}getAllDelegates(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ALL_DELEGATES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAllDelegates(e,{block:t});return this.put(r,n),n}}))}getDelegates(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_DELEGATES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegates(e,{block:t});return this.put(r,n),n}}))}getVotingInfo(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_VOTING_INFO,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getVotingInfo(e,{block:t});return this.put(r,n),n}}))}getConstants(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CONSTANTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getConstants({block:e});return this.put(t,r),r}}))}getBlock(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlock({block:e});return this.put(t,r),r}}))}getBlockHeader(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK_HEADER,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHeader({block:e});return this.put(t,r),r}}))}getBlockMetadata(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK_METADATA,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockMetadata({block:e});return this.put(t,r),r}}))}getBakingRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BAKING_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBakingRights(e,{block:t});return this.put(r,n),n}}))}getAttestationRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ATTESTATION_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAttestationRights(e,{block:t});return this.put(r,n),n}}))}getBallotList(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALLOT_LIST,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallotList({block:e});return this.put(t,r),r}}))}getBallots(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALLOTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallots({block:e});return this.put(t,r),r}}))}getCurrentProposal(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CURRENT_PROPOSAL,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentProposal({block:e});return this.put(t,r),r}}))}getCurrentQuorum(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CURRENT_QUORUM,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentQuorum({block:e});return this.put(t,r),r}}))}getVotesListings(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_VOTES_LISTINGS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getVotesListings({block:e});return this.put(t,r),r}}))}getProposals(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_PROPOSALS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProposals({block:e});return this.put(t,r),r}}))}forgeOperations(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.forgeOperations(e,{block:t})}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.rpcClient.injectOperation(e)}))}preapplyOperations(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.preapplyOperations(e,{block:t})}))}getEntrypoints(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ENTRYPOINTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getEntrypoints(e,{block:t});return this.put(r,n),n}}))}runOperation(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.runOperation(e,{block:t})}))}simulateOperation(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.simulateOperation(e,{block:t})}))}runCode(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.runCode(e,{block:t})}))}runScriptView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.rpcClient.runScriptView(Object.assign({unparsing_mode:r},n),{block:i})}))}runView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.rpcClient.runView(Object.assign({unparsing_mode:r},n),{block:i})}))}getChainId(){return c(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CHAIN_ID,[]);if(this.has(e))return this.get(e);{const t=this.rpcClient.getChainId();return this.put(e,t),t}}))}packData(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.PACK_DATA,[t],e);if(this.has(r))return this.get(r);{const n=this.rpcClient.packData(e,{block:t});return this.put(r,n),n}}))}getRpcUrl(){return this.rpcClient.getRpcUrl()}getCurrentPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CURRENT_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentPeriod({block:e});return this.put(t,r),r}}))}getSuccessorPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SUCCESSOR_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getSuccessorPeriod({block:e});return this.put(t,r),r}}))}getSaplingDiffById(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SAPLING_DIFF_BY_ID,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffById(e,{block:t});return this.put(r,n),n}}))}getSaplingDiffByContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SAPLING_DIFF_BY_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffByContract(e,{block:t});return this.put(r,n),n}}))}getProtocols(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_PROTOCOLS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProtocols({block:e});return this.put(t,r),r}}))}getStorageUsedSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STORAGE_USED_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorageUsedSpace(e,{block:t});return this.put(r,n),n}}))}getStoragePaidSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STORAGE_PAID_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStoragePaidSpace(e,{block:t});return this.put(r,n),n}}))}getTicketBalance(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_TICKET_BALANCE,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getTicketBalance(e,t,{block:r});return this.put(n,i),i}}))}getAllTicketBalances(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ALL_TICKET_BALANCES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAllTicketBalances(e,{block:t});return this.put(r,n),n}}))}getAdaptiveIssuanceLaunchCycle(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getAdaptiveIssuanceLaunchCycle({block:e});return this.put(t,r),r}}))}getPendingOperations(){return c(this,arguments,void 0,(function*(e={}){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_PENDING_OPERATIONS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getPendingOperations(e);return this.put(t,r),r}}))}}var p,b,m,g,v,y,_,E,w,O;!function(e){e.TOO_LARGE="too large"}(p||(p={})),function(e){e.BAKING_BONUSES="baking bonuses",e.BAKING_REWARDS="baking rewards",e.BLOCK_FEES="block fees",e.BONDS="bonds",e.BOOTSTRAP="bootstrap",e.BURNED="burned",e.COMMITMENT="commitment",e.DELEGATE_DENOMINATOR="delegate_denominator",e.DELEGATOR_NUMERATOR="delegator_numerator",e.DEPOSITS="deposits",e.ENDORSING_REWARDS="endorsing rewards",e.INVOICE="invoice",e.LOST_ENDORSING_REWARDS="lost endorsing rewards",e.LOST_ATTESTING_REWARDS="lost attesting rewards",e.MINTED="minted",e.NONCE_REVELATION_REWARDS="nonce revelation rewards",e.PUNISHMENTS="punishments",e.SMART_ROLLUP_REFUTATION_PUNISHMENTS="smart_rollup_refutation_punishments",e.SMART_ROLLUP_REFUTATION_REWARDS="smart_rollup_refutation_rewards",e.STORAGE_FEES="storage fees",e.SUBSIDY="subsidy",e.UNSTAKED_DEPOSITS="unstaked_deposits",e.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",e.FEES="fees",e.LEGACY_DEPOSITS="legacy_deposits",e.LEGACY_FEES="legacy_fees",e.LEGACY_REWARDS="legacy_rewards",e.REWARDS="rewards"}(b||(b={})),function(e){e.WASM2="wasm_2_0_0",e.ARITH="arith",e.RISCV="riscv"}(m||(m={})),function(e){e.START="start",e.MOVE="move"}(g||(g={})),function(e){e.INBOX_PROOF="inbox_proof",e.REVEAL_PROOF="reveal_proof",e.FIRST_INPUT="first_input"}(v||(v={})),function(e){e.RAW_DATA_PROOF="raw_data_proof",e.METADATA_PROOF="metadata_proof",e.DAL_PAGE_PROOF="dal_page_proof",e.DAL_PARAMETERS_PROOF="dal_parameters_proof"}(y||(y={})),function(e){e.ONGOING="ongoing",e.ENDED="ended"}(_||(_={})),function(e){e.LOSER="loser",e.DRAW="draw"}(E||(E={})),function(e){e.CONFLICT_RESOLVED="conflict_resolved",e.TIMEOUT="timeout"}(w||(w={})),function(e){e.ORIGINATION="origination",e.DELEGATION="delegation",e.REVEAL="reveal",e.TRANSACTION="transaction",e.ACTIVATION="activate_account",e.ATTESTATION="attestation",e.ENDORSEMENT="endorsement",e.PREATTESTATION="preattestation",e.PREENDORSEMENT="preendorsement",e.SET_DEPOSITS_LIMIT="set_deposits_limit",e.DOUBLE_PREATTESTATION_EVIDENCE="double_preattestation_evidence",e.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",e.ATTESTATION_WITH_DAL="attestation_with_dal",e.ENDORSEMENT_WITH_DAL="endorsement_with_dal",e.SEED_NONCE_REVELATION="seed_nonce_revelation",e.DOUBLE_ATTESTATION_EVIDENCE="double_attestation_evidence",e.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",e.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",e.PROPOSALS="proposals",e.BALLOT="ballot",e.FAILING_NOOP="failing_noop",e.REGISTER_GLOBAL_CONSTANT="register_global_constant",e.TRANSFER_TICKET="transfer_ticket",e.INCREASE_PAID_STORAGE="increase_paid_storage",e.UPDATE_CONSENSUS_KEY="update_consensus_key",e.DRAIN_DELEGATE="drain_delegate",e.VDF_REVELATION="vdf_revelation",e.EVENT="event",e.TICKET_UPDATES="ticket_updates",e.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",e.SMART_ROLLUP_PUBLISH="smart_rollup_publish",e.SMART_ROLLUP_CEMENT="smart_rollup_cement",e.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",e.SMART_ROLLUP_REFUTE="smart_rollup_refute",e.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout",e.DAL_PUBLISH_COMMITMENT="dal_publish_commitment"}(O||(O={}));const A={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"};class S{constructor(e,t=u,r=new n.HttpBackend){this.url=e,this.chain=t,this.httpBackend=r}createURL(e){let t=this.url;for(;t.endsWith("/");)t=t.slice(0,-1);return`${t}${e}`}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/hash`),method:"GET"})}))}getLiveBlocks(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/live_blocks`),method:"GET"})}))}getBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/balance`),method:"GET"});return new i.A(r)}))}getSpendable(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/spendable`),method:"GET"});return new i.A(r)}))}getBalanceAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/balance_and_frozen_bonds`),method:"GET"});return new i.A(r)}))}getSpendableAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/spendable_and_frozen_bonds`),method:"GET"});return new i.A(r)}))}getFullBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/full_balance`),method:"GET"});return new i.A(r)}))}getStakedBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/staked_balance`),method:"GET"});return new i.A(r)}))}getUnstakedFinalizableBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/unstaked_finalizable_balance`),method:"GET"});return new i.A(r)}))}getUnstakedFrozenBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/unstaked_frozen_balance`),method:"GET"});return new i.A(r)}))}getUnstakeRequests(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/unstake_requests`),method:"GET"});return null===r?null:{finalizable:r.finalizable.map((e=>{var{amount:t}=e,r=a(e,["amount"]);const n=f({amount:t},["amount"]);return Object.assign(Object.assign({},r),{amount:n.amount})})),unfinalizable:{delegate:r.unfinalizable.delegate,requests:r.unfinalizable.requests.map((({amount:e,cycle:t})=>({cycle:t,amount:f({amount:e},["amount"]).amount})))}}}))}getStorage(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage`),method:"GET"})}))}getScript(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/script`),method:"GET"})}))}getNormalizedScript(e){return c(this,arguments,void 0,(function*(e,t={unparsing_mode:"Readable"},{block:r}=l){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/script/normalized`),method:"POST"},t)}))}getContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}`),method:"GET"});return Object.assign(Object.assign({},r),{balance:new i.A(r.balance)})}))}getManagerKey(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/manager_key`),method:"GET"})}))}getDelegate(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){let r;this.validateAddress(e);try{r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/delegate`),method:"GET"})}catch(e){if(!(e instanceof n.HttpResponseError&&e.status===n.STATUS_CODE.NOT_FOUND))throw e;r=null}return r}))}getBigMapKey(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/big_map_get`),method:"POST"},t)}))}getBigMapExpr(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/big_maps/${e}/${t}`),method:"GET"})}))}getAllDelegates(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates`),method:"GET",query:e})}))}getDelegates(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}`),method:"GET"}),n=f(r,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power","total_delegated_stake","staking_denominator"]);return Object.assign(Object.assign(Object.assign({},r),n),{frozen_balance_by_cycle:r.frozen_balance_by_cycle?r.frozen_balance_by_cycle.map((e=>{var{deposit:t,deposits:r,fees:n,rewards:i}=e,o=a(e,["deposit","deposits","fees","rewards"]);const s=f({deposit:t,deposits:r,fees:n,rewards:i},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},o),{deposit:s.deposit,deposits:s.deposits,fees:s.fees,rewards:s.rewards})})):void 0})}))}getVotingInfo(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateAddress(e),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}/voting_info`),method:"GET"})}))}getConstants(){return c(this,arguments,void 0,(function*({block:e}=l){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/constants`),method:"GET"}),r=f(t,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount","minimal_stake"]);return Object.assign(Object.assign({},t),r)}))}getBlock(){return c(this,arguments,void 0,(function*({block:e,version:t}=l){const r={url:this.createURL(`/chains/${this.chain}/blocks/${e}`),method:"GET"};return void 0!==t&&(r.query={version:t}),yield this.httpBackend.createRequest(r)}))}getBlockHeader(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/header`),method:"GET"})}))}getBlockMetadata(){return c(this,arguments,void 0,(function*({block:e,version:t}=l){const r={url:this.createURL(`/chains/${this.chain}/blocks/${e}/metadata`),method:"GET"};return void 0!==t&&(r.query={version:t}),yield this.httpBackend.createRequest(r)}))}getBakingRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/baking_rights`),method:"GET",query:e})}))}getAttestationRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/attestation_rights`),method:"GET",query:e})}))}getBallotList(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballot_list`),method:"GET"})}))}getBallots(){return c(this,arguments,void 0,(function*({block:e}=l){return f(yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballots`),method:"GET"}),["yay","nay","pass"])}))}getCurrentProposal(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_proposal`),method:"GET"})}))}getCurrentQuorum(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_quorum`),method:"GET"})}))}getVotesListings(){return c(this,arguments,void 0,(function*({block:e}=l){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/listings`),method:"GET"});return t.map((e=>(e.voting_power&&(e.voting_power=new i.A(e.voting_power)),e))),t}))}getProposals(){return c(this,arguments,void 0,(function*({block:e}=l){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/proposals`),method:"GET"});return t.map((e=>e[1]=new i.A(e[1]))),t}))}forgeOperations(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/forge/operations`),method:"POST"},e)}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},e)}))}preapplyOperations(e){return c(this,arguments,void 0,(function*(e,{block:t,version:r}=l){const n={url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/preapply/operations`),method:"POST"};return void 0!==r&&(n.query={version:r}),yield this.httpBackend.createRequest(n,e)}))}getEntrypoints(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/entrypoints`),method:"GET"})}))}runOperation(e){return c(this,arguments,void 0,(function*(e,{block:t,version:r}=l){const n={url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_operation`),method:"POST"};return void 0!==r&&(n.query={version:r}),yield this.httpBackend.createRequest(n,e)}))}simulateOperation(e){return c(this,arguments,void 0,(function*(e,{block:t,version:r}=l){const n={url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/simulate_operation`),method:"POST"};return void 0!==r&&(n.query={version:r}),yield this.httpBackend.createRequest(n,e)}))}runCode(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_code`),method:"POST"},e)}))}runScriptView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${i}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}runView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${i}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}getChainId(){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})}))}packData(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/pack_data`),method:"POST"},e),{gas:n}=r,o=a(r,["gas"]);let s=n;const c=new i.A(n||"");return c.isNaN()||(s=c),Object.assign({gas:s},o)}))}getRpcUrl(){return this.url}getCurrentPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_period`),method:"GET"})}))}getSuccessorPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/successor_period`),method:"GET"})}))}getSaplingDiffById(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/sapling/${e}/get_diff`),method:"GET"})}))}getSaplingDiffByContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/single_sapling_get_diff`),method:"GET"})}))}getProtocols(){return c(this,arguments,void 0,(function*({block:e}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/protocols`),method:"GET"})}))}getStorageUsedSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/used_space`),method:"GET"})}))}getStoragePaidSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/paid_space`),method:"GET"})}))}getTicketBalance(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/ticket_balance`),method:"POST"},t)}))}getAllTicketBalances(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/all_ticket_balances`),method:"GET"})}))}getAdaptiveIssuanceLaunchCycle(){return c(this,arguments,void 0,(function*({block:e}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/adaptive_issuance_launch_cycle`),method:"GET"})}))}getPendingOperations(){return c(this,arguments,void 0,(function*(e={}){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/mempool/pending_operations`),method:"GET",query:e})}))}}},6209:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>d.DeprecationError,InvalidAddressError:()=>d.InvalidAddressError,InvalidBlockHashError:()=>d.InvalidBlockHashError,InvalidChainIdError:()=>d.InvalidChainIdError,InvalidContractAddressError:()=>d.InvalidContractAddressError,InvalidHexStringError:()=>d.InvalidHexStringError,InvalidKeyError:()=>d.InvalidKeyError,InvalidKeyHashError:()=>d.InvalidKeyHashError,InvalidMessageError:()=>d.InvalidMessageError,InvalidOperationHashError:()=>d.InvalidOperationHashError,InvalidOperationKindError:()=>d.InvalidOperationKindError,InvalidProtocolHashError:()=>w,InvalidPublicKeyError:()=>d.InvalidPublicKeyError,InvalidSignatureError:()=>d.InvalidSignatureError,Prefix:()=>n,ProhibitedActionError:()=>d.ProhibitedActionError,VERSION:()=>W,ValidationResult:()=>A,ValueConversionError:()=>O,b58cdecode:()=>te,b58cencode:()=>ee,b58decode:()=>re,b58decodeL2Address:()=>ne,buf2hex:()=>fe,bytes2Char:()=>me,bytesToString:()=>ge,char2Bytes:()=>pe,encodeAddress:()=>oe,encodeExpr:()=>X,encodeKey:()=>ae,encodeKeyHash:()=>ce,encodeL2Address:()=>se,encodeOpHash:()=>Q,encodePubKey:()=>ie,format:()=>J,getPkhfromPk:()=>he,hex2Bytes:()=>ve,hex2buf:()=>ue,invalidDetail:()=>V,isValidPrefix:()=>S,mergebuf:()=>le,mic2arr:()=>de,num2PaddedHex:()=>Ee,numToHexBuffer:()=>_e,prefix:()=>g,prefixLength:()=>v,stringToBytes:()=>be,stripHexPrefix:()=>we,toHexBuf:()=>ye,validateAddress:()=>N,validateBlock:()=>G,validateChain:()=>j,validateContractAddress:()=>D,validateKeyHash:()=>U,validateOperation:()=>K,validatePkAndExtractPrefix:()=>_,validateProtocol:()=>H,validatePublicKey:()=>F,validateSignature:()=>B,validateSmartRollupAddress:()=>z,validateSpendingKey:()=>$,verifySignature:()=>y});var n,i=r(5765),o=r(7379),s=r(1703),a=r(9620),c=r.n(a),u=r(9848),l=r.n(u),d=r(6571),f=r(6483),h=r(3360),p=r.n(h),b=r(2100),m=r.n(b);!function(e){e.TZ1="tz1",e.TZ2="tz2",e.TZ3="tz3",e.TZ4="tz4",e.KT="KT",e.KT1="KT1",e.EDSK2="edsk2",e.SPSK="spsk",e.P2SK="p2sk",e.EDPK="edpk",e.SPPK="sppk",e.P2PK="p2pk",e.BLPK="BLpk",e.EDESK="edesk",e.SPESK="spesk",e.P2ESK="p2esk",e.EDSK="edsk",e.EDSIG="edsig",e.SPSIG="spsig",e.P2SIG="p2sig",e.SIG="sig",e.NET="Net",e.NCE="nce",e.B="B",e.O="o",e.LO="Lo",e.LLO="LLo",e.P="P",e.CO="Co",e.ID="id",e.EXPR="expr",e.TZ="TZ",e.VH="vh",e.SASK="sask",e.ZET1="zet1",e.SR1="sr1",e.SRC1="src1",e.SH="sh"}(n||(n={}));const g={[n.TZ1]:new Uint8Array([6,161,159]),[n.TZ2]:new Uint8Array([6,161,161]),[n.TZ3]:new Uint8Array([6,161,164]),[n.TZ4]:new Uint8Array([6,161,166]),[n.KT]:new Uint8Array([2,90,121]),[n.KT1]:new Uint8Array([2,90,121]),[n.EDSK]:new Uint8Array([43,246,78,7]),[n.EDSK2]:new Uint8Array([13,15,58,7]),[n.SPSK]:new Uint8Array([17,162,224,201]),[n.P2SK]:new Uint8Array([16,81,238,189]),[n.EDPK]:new Uint8Array([13,15,37,217]),[n.SPPK]:new Uint8Array([3,254,226,86]),[n.P2PK]:new Uint8Array([3,178,139,127]),[n.BLPK]:new Uint8Array([6,149,135,204]),[n.EDESK]:new Uint8Array([7,90,60,179,41]),[n.SPESK]:new Uint8Array([9,237,241,174,150]),[n.P2ESK]:new Uint8Array([9,48,57,115,171]),[n.EDSIG]:new Uint8Array([9,245,205,134,18]),[n.SPSIG]:new Uint8Array([13,115,101,19,63]),[n.P2SIG]:new Uint8Array([54,240,44,52]),[n.SIG]:new Uint8Array([4,130,43]),[n.NET]:new Uint8Array([87,82,0]),[n.NCE]:new Uint8Array([69,220,169]),[n.B]:new Uint8Array([1,52]),[n.O]:new Uint8Array([5,116]),[n.LO]:new Uint8Array([133,233]),[n.LLO]:new Uint8Array([29,159,109]),[n.P]:new Uint8Array([2,170]),[n.CO]:new Uint8Array([79,179]),[n.ID]:new Uint8Array([153,103]),[n.EXPR]:new Uint8Array([13,44,64,27]),[n.TZ]:new Uint8Array([2,90,121]),[n.VH]:new Uint8Array([1,106,242]),[n.SASK]:new Uint8Array([11,237,20,92]),[n.ZET1]:new Uint8Array([18,71,40,223]),[n.SR1]:new Uint8Array([6,124,117]),[n.SRC1]:new Uint8Array([17,165,134,138]),[n.SH]:new Uint8Array([2,116,180])},v={[n.TZ1]:20,[n.TZ2]:20,[n.TZ3]:20,[n.TZ4]:20,[n.KT]:20,[n.KT1]:20,[n.EDPK]:32,[n.SPPK]:33,[n.P2PK]:33,[n.BLPK]:48,[n.EDSIG]:64,[n.SPSIG]:64,[n.P2SIG]:64,[n.SIG]:64,[n.NET]:4,[n.B]:32,[n.P]:32,[n.O]:32,[n.VH]:32,[n.SASK]:169,[n.ZET1]:43,[n.SR1]:20,[n.SRC1]:32,[n.SH]:48};function y(e,t,r,i){const a=_(t),c=function(e){const t=e.startsWith("sig")?e.substring(0,3):e.substring(0,5),r=B(e);if(r!==A.VALID)throw new d.InvalidSignatureError(e,V(r));return t}(r),u=te(t,g[a]),l=te(r,g[c]);let f=ue(function(e){if(""===e)throw new d.InvalidMessageError(e,"can't be empty");return e}(e));void 0!==i&&(f=le(i,f));const h=(0,s.tW)(f,32);return a===n.EDPK?function(e,t,r){try{return(0,o.MX)(r,t,e)}catch(e){return!1}}(l,h,u):a===n.SPPK?function(e,t,r){const n=new(p().ec)("secp256k1").keyFromPublic(r);return E(e,t,n)}(l,h,u):a===n.P2PK&&function(e,t,r){const n=new(p().ec)("p256").keyFromPublic(r);return E(e,t,n)}(l,h,u)}function _(e){if(""===e)throw new d.InvalidPublicKeyError(e,"can't be empty");const t=e.substring(0,4),r=F(e);if(r!==A.VALID)throw new d.InvalidPublicKeyError(e,V(r));return t}function E(e,t,r){const n=fe(m()(e)).match(/([a-f\d]{64})/gi);if(n)try{const[e,i]=n;return r.verify(t,{r:e,s:i})}catch(e){return!1}return!1}class w extends d.ParameterValidationError{constructor(e,t){super(),this.protocolHash=e,this.errorDetails=t,this.name="InvalidProtocolHashError",this.name="InvalidProtocolHashError",this.message=`The protocol hash '${e}' is invalid`,t&&(this.message+=`: ${t}`)}}class O extends d.UnsupportedActionError{constructor(e,t){super(),this.value=e,this.desiredType=t,this.name="ValueConversionError",this.message=`Unable to convert ${e} to a ${t}`}}var A;function S(e){return"string"==typeof e&&e in g}function P(e,t){const r=new RegExp(`^(${t.join("|")})`).exec(e);if(!r||0===r.length)return A.NO_PREFIX_MATCHED;const n=r[0];if(!S(n))return A.NO_PREFIX_MATCHED;e.includes("%")&&(e=e.split("%")[0]);if(!/^(KT1\w{33})$/.test(e)&&"KT1"===n)return A.INVALID_CHECKSUM;let i=l().decodeUnsafe(e);return i?(i=i.slice(g[n].length),i.length!==v[n]?A.INVALID_LENGTH:A.VALID):A.INVALID_CHECKSUM}!function(e){e[e.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",e[e.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",e[e.INVALID_LENGTH=2]="INVALID_LENGTH",e[e.VALID=3]="VALID"}(A||(A={}));const T=[n.TZ1,n.TZ2,n.TZ3,n.TZ4],R=[n.KT1],I=[n.EDSIG,n.P2SIG,n.SPSIG,n.SIG],x=[n.EDPK,n.SPPK,n.P2PK,n.BLPK],M=[n.O],k=[n.P],L=[n.B],C=[n.SR1];function N(e){return P(e,[...T,...R,...C])}function j(e){return P(e,[n.NET])}function D(e){return P(e,R)}function U(e){return P(e,T)}function B(e){return P(e,I)}function F(e){return P(e,x)}function K(e){return P(e,M)}function H(e){return P(e,k)}function G(e){return P(e,L)}function $(e){return P(e,[n.SASK])}function V(e){switch(e){case A.NO_PREFIX_MATCHED:return"with unsupported prefix";case A.INVALID_CHECKSUM:return"failed checksum";case A.INVALID_LENGTH:return"with incorrect length";default:return""}}function z(e){return P(e,[...C])}const W={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"},q=6,Z=3;function Y(e){switch(e){case"tz":return q;case"mtz":return Z;default:return 0}}function J(e="mutez",t="mutez",r){const n=new f.A(r);return n.isNaN()?r:n.multipliedBy(Math.pow(10,Y(e))).dividedBy(Math.pow(10,Y(t)))}function X(e){return ee(c().blake2b(ue(e),void 0,32),g.expr)}function Q(e){return ee(c().blake2b(ue(e),void 0,32),g.o)}function ee(e,t){const r="string"==typeof e?Uint8Array.from(i.hp.from(e,"hex")):e,n=new Uint8Array(t.length+r.length);return n.set(t),n.set(r,t.length),l().encode(i.hp.from(n.buffer))}const te=(e,t)=>l().decode(e).slice(t.length);function re(e){const t=l().decode(e),r={[g.tz1.toString()]:"0000",[g.tz2.toString()]:"0001",[g.tz3.toString()]:"0002"}[new Uint8Array(t.slice(0,3)).toString()];if(r){return r+fe(t.slice(3))}return"01"+fe(t.slice(3,42))+"00"}function ne(e){const t=l().decode(e);return fe(t.slice(3,42))}function ie(e){if("00"===e.substring(0,2)){const t={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ee(e.substring(4),t[e.substring(0,4)])}return ee(e.substring(2,42),g.KT)}function oe(e){if("0x"===e.substring(0,2)&&(e=e.slice(2)),"00"===e.substring(0,2)){const t={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ee(e.substring(4),t[e.substring(0,4)])}return ee(e.substring(2,42),g.KT)}function se(e){return ee(e,g.tz4)}function ae(e){if("0"===e[0]){const t={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return ee(e.substring(2),t[e.substring(0,2)])}}function ce(e){if("0"===e[0]){const t={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return ee(e.substring(2),t[e.substring(0,2)])}}const ue=e=>{if(e.length%2!=0)throw new d.InvalidHexStringError(e,": Expecting even number of characters");const t=we(e);if(!t.match(/^([\da-f]{2})*$/gi))throw new d.InvalidHexStringError(e,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const r=new Uint8Array(t.length/2);let n=0;for(let i=0;i<t.length;i+=2){const o=parseInt(t.slice(i,i+2),16);if(Number.isNaN(o))throw new O(e,"Uint8Array");r[n++]=o}return r},le=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r},de=function e(t){let r=[];if(Object.prototype.hasOwnProperty.call(t,"prim"))"Pair"===t.prim?(r.push(e(t.args[0])),r=r.concat(e(t.args[1]))):"Elt"===t.prim?r={key:e(t.args[0]),val:e(t.args[1])}:"True"===t.prim?r=!0:"False"===t.prim&&(r=!1);else if(Array.isArray(t)){const n=t.length;for(let i=0;i<n;i++){const n=e(t[i]);void 0!==n.key?(Array.isArray(r)&&(r={keys:[],vals:[]}),r.keys.push(n.key),r.vals.push(n.val)):r.push(n)}}else r=Object.prototype.hasOwnProperty.call(t,"string")?t.string:Object.prototype.hasOwnProperty.call(t,"int")?parseInt(t.int,10):t;return r},fe=e=>{const t=[];return e.forEach((e=>{const r=`00${e.toString(16)}`.slice(-2);t.push(r)})),t.join("")},he=e=>{let t,r;const i=_(e),o=te(e,g[i]);switch(i){case n.EDPK:t=g[n.TZ1],r=v[n.TZ1];break;case n.SPPK:t=g[n.TZ2],r=v[n.TZ2];break;case n.P2PK:t=g[n.TZ3],r=v[n.TZ3];break;case n.BLPK:t=g[n.TZ4],r=v[n.TZ4]}return ee((0,s.tW)(o,r),t)};function pe(e){return i.hp.from(e,"utf8").toString("hex")}function be(e){return i.hp.from(e,"utf8").toString("hex")}function me(e){return i.hp.from(ue(e)).toString("utf8")}function ge(e){return i.hp.from(ue(e)).toString("utf8")}function ve(e){const t=we(e);if(!t.match(/^(0x)?([\da-f]{2})*$/gi))throw new d.InvalidHexStringError(e,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return i.hp.from(t,"hex")}function ye(e,t=8){return i.hp.from(Ee(e,t),"hex")}function _e(e,t=8){return i.hp.from(Ee(e,t),"hex")}function Ee(e,t=8){if(new f.A(e).isPositive()){const r=Math.ceil(t/4),n=e.toString(16);let i=n.length>=r?n.length:r;return i=i%2==0?i:i+1,function(e,t){const r="0";if(e.length>=t)return e;{const n=t-e.length;return r.repeat(n)+e}}(n,i)}return new f.A(2).pow(t).minus(new f.A(e).abs()).toString(16)}function we(e){return e.startsWith("0x")?e.slice(2):e}},5765:(e,t,r)=>{"use strict";const n=r(7991),i=r(9318),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function b(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function E(e,t,r,n){return q(z(t,e.length-r),e,r,n)}function w(e,t,r,n){return q(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function O(e,t,r,n){return q(W(t),e,r,n)}function A(e,t,r,n){return q(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function x(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function F(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function K(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=K(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=K(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},5025:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCBatchProvider=t.OperationBatch=t.BATCH_KINDS=void 0;const i=r(2654),o=r(7669),s=r(9925),a=r(6209),c=r(6571),u=r(5605),l=r(3682);t.BATCH_KINDS=[s.OpKind.ACTIVATION,s.OpKind.ORIGINATION,s.OpKind.TRANSACTION,s.OpKind.DELEGATION];class d extends u.Provider{constructor(e,t){super(e),this.estimator=t,this.operations=[],this.prepare=new l.PrepareProvider(this.context)}withTransfer(e){const t=(0,a.validateAddress)(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSACTION},e)),this}withTransferTicket(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSFER_TICKET},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=(0,a.validateAddress)(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));const n=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,(0,a.invalidDetail)(n));return this.operations.push(Object.assign({kind:s.OpKind.DELEGATION},e)),this}withActivation({pkh:e,secret:t}){const r=(0,a.validateKeyHash)(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidKeyHashError(e,(0,a.invalidDetail)(r));return this.operations.push({kind:s.OpKind.ACTIVATION,pkh:e,secret:t}),this}withOrigination(e){return this.operations.push(Object.assign({kind:s.OpKind.ORIGINATION},e)),this}withRegisterGlobalConstant(e){return this.operations.push(Object.assign({kind:s.OpKind.REGISTER_GLOBAL_CONSTANT},e)),this}withIncreasePaidStorage(e){return this.operations.push(Object.assign({kind:s.OpKind.INCREASE_PAID_STORAGE},e)),this}withSmartRollupAddMessages(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ADD_MESSAGES},e)),this}withSmartRollupOriginate(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ORIGINATE},e)),this}withSmartRollupExecuteOutboxMessage(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE},e)),this}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case s.OpKind.TRANSACTION:return(0,i.createTransferOperation)(Object.assign({},e));case s.OpKind.ORIGINATION:return(0,i.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case s.OpKind.DELEGATION:return(0,i.createSetDelegateOperation)(Object.assign({},e));case s.OpKind.REGISTER_GLOBAL_CONSTANT:return(0,i.createRegisterGlobalConstantOperation)(Object.assign({},e));case s.OpKind.INCREASE_PAID_STORAGE:return(0,i.createIncreasePaidStorageOperation)(Object.assign({},e));case s.OpKind.TRANSFER_TICKET:return(0,i.createTransferTicketOperation)(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:return(0,i.createSmartRollupAddMessagesOperation)(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ORIGINATE:return(0,i.createSmartRollupOriginateOperation)(Object.assign({},e));case s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return(0,i.createSmartRollupExecuteOutboxMessageOperation)(Object.assign({},e));default:throw new c.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case s.OpKind.TRANSACTION:this.withTransfer(t);break;case s.OpKind.ORIGINATION:this.withOrigination(t);break;case s.OpKind.DELEGATION:this.withDelegation(t);break;case s.OpKind.ACTIVATION:this.withActivation(t);break;case s.OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(t);break;case s.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;case s.OpKind.TRANSFER_TICKET:this.withTransferTicket(t);break;case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:this.withSmartRollupAddMessages(t);break;case s.OpKind.SMART_ROLLUP_ORIGINATE:this.withSmartRollupOriginate(t);break;case s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:this.withSmartRollupExecuteOutboxMessage(t);break;default:throw new c.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=e&&e.source||t,n=yield this.estimator.batch(this.operations);n.length!==this.operations.length&&n.shift();const i=yield this.prepare.batch(this.operations,n),s=yield this.forge(i),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(s);return new o.BatchOperation(a,i.opOb.contents,r,u,l,c)}))}}t.OperationBatch=d;t.RPCBatchProvider=class{constructor(e,t){this.context=e,this.estimator=t}batch(e){const t=new d(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}},5283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRevealFeeInternal=t.getRevealFee=t.getRevealGasLimit=t.ChainIds=t.protocols=t.Protocols=t.COST_PER_BYTE=t.ORIGINATION_SIZE=t.REVEAL_STORAGE_LIMIT=t.DEFAULT_STORAGE_LIMIT=t.DEFAULT_FEE=t.DEFAULT_GAS_LIMIT=void 0,t.DEFAULT_GAS_LIMIT={DELEGATION:10600,ORIGINATION:10600,TRANSFER:10600,REVEAL_TZ1:1e3,REVEAL_TZ2:1e3,REVEAL_TZ3:2e3,REVEAL_TZ4:2e3},t.DEFAULT_FEE={DELEGATION:1257,ORIGINATION:1e4,TRANSFER:1e4,REVEAL:374},t.DEFAULT_STORAGE_LIMIT={DELEGATION:0,ORIGINATION:257,TRANSFER:257,REVEAL:0};const r=169,n=155,i=445,o=1674,s=276,a=276,c=305,u=477;var l,d;t.REVEAL_STORAGE_LIMIT=0,t.ORIGINATION_SIZE=257,t.COST_PER_BYTE=250,function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",e.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",e.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",e.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(l||(t.Protocols=l={})),t.protocols={"004":[l.Pt24m4xi],"005":[l.PsBABY5H,l.PsBabyM1],"006":[l.PsCARTHA],"007":[l.PsDELPH1],"008":[l.PtEdo2Zk],"009":[l.PsFLorena],"010":[l.PtGRANADs],"011":[l.PtHangz2],"012":[l.PsiThaCa,l.Psithaca2],"013":[l.PtJakart2],"014":[l.PtKathman],"015":[l.PtLimaPtL],"016":[l.PtMumbai2],"017":[l.PtNairobi],"019":[l.ProxfordY],"020":[l.PtParisBx,l.PsParisCZ],"021":[l.PsQuebecn],"022":[l.ProtoALpha]},function(e){e.MAINNET="NetXdQprcVkpaWU",e.CARTHAGENET="NetXjD3HPJJjmcd",e.DELPHINET="NetXm8tYqnMWky1",e.EDONET="NetXSgo1ZT2DRUG",e.FLORENCENET="NetXxkAx4woPLyu",e.GRANADANET="NetXz969SFaFn8k",e.HANGZHOUNET="NetXZSsxBpMQeAT",e.ITHACANET="NetXbhmtAbMukLc",e.ITHACANET2="NetXnHfVqm9iesp",e.JAKARTANET2="NetXLH1uAxK7CCh",e.KATHMANDUNET="NetXazhm4yetmff",e.LIMANET="NetXizpkH94bocH",e.MUMBAINET="NetXQw6nWSnrJ5t",e.MUMBAINET2="NetXgbcrNtXD2yA",e.NAIROBINET="NetXyuzvDo2Ugzb",e.OXFORDNET2="NetXxWsskGahzQB",e.PARISBNET="NetXo8SqH1c38SS",e.PARISCNET="NetXXWAHLEvre9b",e.PsQuebecn="NetXuTeGinLEqxp"}(d||(t.ChainIds=d={}));t.getRevealGasLimit=e=>Math.round(37*f(e)/10);const f=e=>{switch(e.substring(0,3)){case"tz1":return r;case"tz2":return n;case"tz3":return i;case"tz4":return o;default:throw new Error(`Cannot estimate reveal gas limit for ${e}`)}};t.getRevealFee=e=>Math.round(12*(0,t.getRevealFeeInternal)(e)/10);t.getRevealFeeInternal=e=>{switch(e.substring(0,3)){case"tz1":return s;case"tz2":return a;case"tz3":return c;case"tz4":return u;default:throw new Error(`Cannot estimate reveal fee for ${e}`)}}},7021:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.defaultConfigConfirmation=void 0;const i=r(9925),o=r(2245),s=r(6425),a=r(808),c=r(8907),u=r(4019),l=r(3995),d=r(5025),f=r(1170),h=r(8541),p=r(577),b=r(8813),m=r(8320),g=r(4631),v=r(8648),y=r(6343),_=r(7583);t.defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class E{constructor(e,r=new s.NoopSigner,n,E=new b.BehaviorSubject(Object.assign({},t.defaultConfigConfirmation)),w,O,A,S,P,T,R,I){this._rpc=e,this._signer=r,this._proto=n,this._config=E,this.providerDecorator=[],this.tz=new c.RpcTzProvider(this),this.estimate=new u.RPCEstimateProvider(this),this.contract=new l.RpcContractProvider(this,this.estimate),this.prepare=new _.PrepareProvider(this),this.batch=new d.RPCBatchProvider(this,this.estimate),this.wallet=new f.Wallet(this),this.withExtensions=()=>{let e=this.clone();return this.providerDecorator.forEach((t=>{e=t(e)})),e},"string"==typeof this._rpc?this._rpcClient=new i.RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=w||new y.TaquitoLocalForger(this),this._injector=O||new o.RpcInjector(this),this.operationFactory=new a.OperationFactory(this),this._walletProvider=S||new f.LegacyWalletProvider(this),this._parser=P||new h.MichelCodecParser(this),this._packer=A||new p.RpcPacker(this),this._globalConstantsProvider=T||new m.NoopGlobalConstantsProvider,this._readProvider=R||new g.RpcReadAdapter(this._rpcClient),this._stream=I||new v.PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(e){this._config.next(Object.assign({},e))}setPartialConfig(e){this._config.next(Object.assign(Object.assign({},this._config.getValue()),e))}get rpc(){return this._rpcClient}set rpc(e){this._rpcClient=e}get injector(){return this._injector}set injector(e){this._injector=e}get forger(){return this._forger}set forger(e){this._forger=e}get signer(){return this._signer}set signer(e){this._signer=e}get walletProvider(){return this._walletProvider}set walletProvider(e){this._walletProvider=e}set proto(e){this._proto=e}get proto(){return this._proto}get parser(){return this._parser}set parser(e){this._parser=e}get packer(){return this._packer}set packer(e){this._packer=e}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(e){this._globalConstantsProvider=e}get readProvider(){return this._readProvider}set readProvider(e){this._readProvider=e}get stream(){return this._stream}set stream(e){this._stream=e}isAnyProtocolActive(){return n(this,arguments,void 0,(function*(e=[]){if(this._proto)return e.includes(this._proto);{const t=yield this.readProvider.getNextProtocol("head");return e.includes(t)}}))}isAnySignerConfigured(){return!(this.signer instanceof s.NoopSigner)}clone(){return new E(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(e){this.providerDecorator.push(e)}}t.Context=E},9676:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BigMapAbstraction=void 0;const i=r(2211);t.BigMapAbstraction=class{constructor(e,t,r){this.id=e,this.schema=t,this.provider=r}get(e,t){return n(this,void 0,void 0,(function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),e,this.schema,t)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getMultipleValues(e,t){return n(this,arguments,void 0,(function*(e,t,r=5){return this.provider.getBigMapKeysByID(this.id.toString(),e,this.schema,t,r)}))}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}},3369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=function(e,t){return(r,n)=>t(e(r,n),n)}},1844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodFactory=void 0;const n=r(2291),i=r(1991),o=r(3085);t.ContractMethodFactory=class{constructor(e,t){this.provider=e,this.contractAddress=t}createContractMethodFlatParams(e,t,r,n=!0,o=!1){return new i.ContractMethod(this.provider,this.contractAddress,e,t,r,n,o)}createContractMethodObjectParam(e,t,r,i=!0,o=!1){return new n.ContractMethodObject(this.provider,this.contractAddress,e,t,r,i,o)}createContractViewObjectParam(e,t,r,n,i){return new o.OnChainView(e,t,this.contractAddress,r,n,i)}}},1991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethod=void 0;const n=r(1170),i=r(9339),o=r(9026);t.ContractMethod=class{constructor(e,t,r,n,i,o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}validateArgs(e,t,r){const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new o.InvalidParameterError(r,n,e)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(!this.isAnonymous){const e=this.parameterSchema.ExtractSignatures();return 1==e.length?e[0]:e}{const e=this.parameterSchema.ExtractSignatures().find((e=>e[0]===this.name));if(e)return e.shift(),e}}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}},4749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodObject=void 0;const n=r(1170),i=r(9339);t.ContractMethodObject=class{constructor(e,t,r,n,i="unit",o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}},3085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OnChainView=void 0;const i=r(6209),o=r(9026),s=r(6571);t.OnChainView=class{constructor(e,t,r,n,i,o="Unit"){this._rpc=e,this._readProvider=t,this._contractAddress=r,this._smartContractViewSchema=n,this._contractStorageType=i,this._args=o}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(e){return n(this,void 0,void 0,(function*(){this.verifyContextExecution(e);const t=yield this._readProvider.getChainId(),r=this.transformArgsToMichelson(),n={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:r,chain_id:t,source:e.viewCaller};return e.source&&(n.payer=e.source),this.executeViewAndDecodeResult(n)}))}verifyContextExecution(e){if(e.source&&(0,i.validateAddress)(e.source)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${e.source}.`);if(!e.viewCaller||(0,i.validateAddress)(e.viewCaller)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${e.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(e){throw new s.InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,e)}}adaptViewCodeToContext(e,t,r){const n={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:r}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:t}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return e.forEach(((i,o)=>{i.prim in n&&(e[o]=Object(n)[i.prim]),i.args&&0!==i.args.length?this.adaptViewCodeToContext(i.args,t,r):Array.isArray(i)&&this.adaptViewCodeToContext(i,t,r)})),e}executeViewAndDecodeResult(e){return n(this,void 0,void 0,(function*(){let t;try{t=(yield this._rpc.runScriptView(e)).data}catch(e){const t=(0,o.validateAndExtractFailwith)(e);throw t?new o.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(t)}`,this._smartContractViewSchema.viewName,t,e):e}return this._smartContractViewSchema.decodeViewResult(t)}))}}},9339:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractAbstraction=t.ContractView=t.DEFAULT_SMART_CONTRACT_METHOD_NAME=void 0;const i=r(1157),o=r(6209),s=r(1844),a=r(9026),c=r(6571);t.DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class u{constructor(e,t,r,n,i,o,s){this.currentContract=e,this.name=t,this.callbackParametersSchema=r,this.parameterSchema=n,this.args=i,this.rpc=o,this.readProvider=s}read(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateChain)(null!=e?e:"");if((0,o.validateContractAddress)(null!=e?e:"")==o.ValidationResult.VALID)throw new c.DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(e&&t!==o.ValidationResult.VALID)throw new c.InvalidChainIdError(e,(0,o.invalidDetail)(t));const r=this.parameterSchema.Encode(...this.args),n=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:r,chain_id:e||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(n.data)}))}}t.ContractView=u;t.ContractAbstraction=class{constructor(e,t,r,n,o,a,c){this.address=e,this.script=t,this.storageProvider=n,this.entrypoints=o,this.rpc=a,this.readProvider=c,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new s.ContractMethodFactory(r,e),this.schema=i.Schema.fromRPCResponse({script:this.script}),this.parameterSchema=i.ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=i.ViewSchema.fromRPCResponse({script:this.script}),0!==this.viewSchema.length&&this._initializeOnChainViews(this,a,this.readProvider,this.viewSchema),this.eventSchema=i.EventSchema.fromRPCResponse({script:this.script}),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(e,r,n,o){const s=this.parameterSchema,c=Object.keys(r);if(s.isMultipleEntryPoint){c.forEach((t=>{const s=new i.ParameterSchema(r[t]);if(this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r)},(e=>{let t=!1;if("prim"in e&&"pair"===e.prim&&e.args){const r=e.args[e.args.length-1];"prim"in r&&"contract"===r.prim&&(t=!0)}return t})(r[t])){const s=function(...s){const c=r[t].args[0],l=new i.ParameterSchema(c),d=r[t].args[1].args[0],f=new i.ParameterSchema(d);return((e,t,r)=>{const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new a.InvalidParameterError(r,n,e)})(s,l,t),new u(e,t,f,l,s,n,o)};this.views[t]=s}}));Object.keys(s.ExtractSchema()).filter((e=>-1===Object.keys(r).indexOf(e))).forEach((t=>{this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r,!1,!0)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r,!1,!0)}}))}else{const r=this.parameterSchema;this.methods[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...n){return e.contractMethodFactory.createContractMethodFlatParams(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)},this.methodsObject[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(n){return e.contractMethodFactory.createContractMethodObjectParam(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)}}}_initializeOnChainViews(e,t,r,n){const i=this.schema.val;n.forEach((n=>{this.contractViews[n.viewName]=function(o){return e.contractMethodFactory.createContractViewObjectParam(t,r,n,i,o)}}))}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(e){return this.storageProvider.getBigMapKey(this.address,e,this.schema)}}},9026:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidBalanceError=t.OriginationParameterError=t.RevealOperationError=t.InvalidViewSimulationContext=t.validateAndExtractFailwith=t.ViewSimulationError=t.InvalidInitParameter=t.InvalidCodeParameter=t.InvalidDelegationSource=t.InvalidParameterError=void 0;const n=r(6571);class i extends n.ParameterValidationError{constructor(e,t,r){super(),this.smartContractMethodName=e,this.sigs=t,this.invalidParams=r,this.name="InvalidParameterError",this.message=`${e} Received ${r.length} arguments while expecting one of the following signatures (${JSON.stringify(t)})`}}t.InvalidParameterError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.source=e,this.name="InvalidDelegationSource",this.message=`Since Babylon delegation source can no longer be a contract address ${e}. Please use the smart contract abstraction to set your delegate.`}}t.InvalidDelegationSource=o;class s extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidCodeParameter"}}t.InvalidCodeParameter=s;class a extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidInitParameter"}}t.InvalidInitParameter=a;class c extends n.RpcError{constructor(e,t,r,n){super(),this.message=e,this.viewName=t,this.failWith=r,this.cause=n,this.name="ViewSimulationError"}}t.ViewSimulationError=c;t.validateAndExtractFailwith=e=>{if(u(e.body)){const t=JSON.parse(e.body);if(Array.isArray(t)&&"with"in t[t.length-1])return t[t.length-1].with}};const u=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};class l extends n.ParameterValidationError{constructor(e){super(),this.info=e,this.name="InvalidViewSimulationContext",this.message=`${e} Please configure the context of the view execution in the executeView method.`}}t.InvalidViewSimulationContext=l;class d extends n.RpcError{constructor(e){super(),this.message=e,this.name="RevealOperationError"}}t.RevealOperationError=d;class f extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name}}t.OriginationParameterError=f;class h extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidBalanceError"}}t.InvalidBalanceError=h},2445:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.smartContractAbstractionSemantic=t.compose=void 0,i(r(9339),t),i(r(9026),t),i(r(1966),t),i(r(1752),t),i(r(2654),t),i(r(6200),t);var o=r(3369);Object.defineProperty(t,"compose",{enumerable:!0,get:function(){return o.compose}}),i(r(4749),t),i(r(1991),t),i(r(2291),t),i(r(3e3),t);var s=r(9281);Object.defineProperty(t,"smartContractAbstractionSemantic",{enumerable:!0,get:function(){return s.smartContractAbstractionSemantic}})},1966:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MANAGER_LAMBDA=void 0;t.MANAGER_LAMBDA={setDelegate:e=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],removeDelegate:()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],transferToContract:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:e}]},{prim:"CONTRACT",args:[{prim:"unit"}]},{prim:"IF_NONE",args:[[{prim:"UNIT"},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}]}},2654:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createSmartRollupExecuteOutboxMessageOperation=t.createSmartRollupOriginateOperation=t.createSmartRollupAddMessagesOperation=t.createUpdateConsensusKeyOperation=t.createProposalsOperation=t.createBallotOperation=t.createDrainDelegateOperation=t.createIncreasePaidStorageOperation=t.createTransferTicketOperation=t.createRegisterGlobalConstantOperation=t.createRevealOperation=t.createRegisterDelegateOperation=t.createSetDelegateOperation=t.createTransferOperation=t.createOriginationOperation=t.createActivationOperation=void 0;const i=r(1157),o=r(9925),s=r(5283),a=r(6209),c=r(9026);t.createActivationOperation=e=>n(void 0,[e],void 0,(function*({pkh:e,secret:t}){return{kind:o.OpKind.ACTIVATION,pkh:e,secret:t}}));t.createOriginationOperation=e=>n(void 0,[e],void 0,(function*({code:e,init:t,balance:r="0",delegate:n,storage:s,fee:u,gasLimit:l,storageLimit:d,mutez:f=!1}){if(void 0!==s&&void 0!==t)throw new c.OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(e))throw new c.InvalidCodeParameter("Wrong code parameter type, expected an array",e);let h;if(void 0!==s){const t=e.find((e=>"prim"in e&&"storage"===e.prim));if(void 0===(null==t?void 0:t.args))throw new c.InvalidCodeParameter("The storage section is missing from the script",e);h=new i.Schema(t.args[0]).Encode(s)}else{if(void 0===t||"object"!=typeof t)throw new c.InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",t);h=t}const p={code:e,storage:h};if(isNaN(Number(r)))throw new c.InvalidBalanceError(`Invalid Balance "${r}", cannot be converted to a number`);const b={kind:o.OpKind.ORIGINATION,fee:u,gas_limit:l,storage_limit:d,balance:f?r.toString():(0,a.format)("tz","mutez",r).toString(),script:p};return n&&(b.delegate=n),b}));t.createTransferOperation=e=>n(void 0,[e],void 0,(function*({to:e,amount:t,parameter:r,fee:n,gasLimit:i,storageLimit:s,mutez:c=!1}){return{kind:o.OpKind.TRANSACTION,fee:n,gas_limit:i,storage_limit:s,amount:c?t.toString():(0,a.format)("tz","mutez",t).toString(),destination:e,parameters:r}}));t.createSetDelegateOperation=e=>n(void 0,[e],void 0,(function*({delegate:e,source:t,fee:r,gasLimit:n,storageLimit:i}){return{kind:o.OpKind.DELEGATION,source:t,fee:r,gas_limit:n,storage_limit:i,delegate:e}}));t.createRegisterDelegateOperation=(e,t)=>n(void 0,[e,t],void 0,(function*({fee:e,gasLimit:t,storageLimit:r},n){return{kind:o.OpKind.DELEGATION,fee:e,gas_limit:t,storage_limit:r,delegate:n}}));t.createRevealOperation=(e,t,r)=>n(void 0,[e,t,r],void 0,(function*({fee:e,gasLimit:t,storageLimit:r},n,i){return{kind:o.OpKind.REVEAL,fee:e,public_key:i,source:n,gas_limit:null!=t?t:(0,s.getRevealGasLimit)(n),storage_limit:r}}));t.createRegisterGlobalConstantOperation=e=>n(void 0,[e],void 0,(function*({value:e,source:t,fee:r,gasLimit:n,storageLimit:i}){return{kind:o.OpKind.REGISTER_GLOBAL_CONSTANT,value:e,fee:r,gas_limit:n,storage_limit:i,source:t}}));t.createTransferTicketOperation=e=>n(void 0,[e],void 0,(function*({ticketContents:e,ticketTy:t,ticketTicketer:r,ticketAmount:n,destination:i,entrypoint:s,source:a,fee:c,gasLimit:u,storageLimit:l}){return{kind:o.OpKind.TRANSFER_TICKET,fee:c,gas_limit:u,storage_limit:l,source:a,ticket_contents:e,ticket_ty:t,ticket_ticketer:r,ticket_amount:n,destination:i,entrypoint:s}}));t.createIncreasePaidStorageOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,amount:i,destination:s}){return{kind:o.OpKind.INCREASE_PAID_STORAGE,source:e,fee:t,gas_limit:r,storage_limit:n,amount:i,destination:s}}));t.createDrainDelegateOperation=e=>n(void 0,[e],void 0,(function*({consensus_key:e,delegate:t,destination:r}){return{kind:o.OpKind.DRAIN_DELEGATE,consensus_key:e,delegate:t,destination:r}}));t.createBallotOperation=e=>n(void 0,[e],void 0,(function*({source:e,proposal:t,ballot:r}){return{kind:o.OpKind.BALLOT,source:e,proposal:t,ballot:r}}));t.createProposalsOperation=e=>n(void 0,[e],void 0,(function*({source:e,proposals:t}){return{kind:o.OpKind.PROPOSALS,source:e,proposals:t}}));t.createUpdateConsensusKeyOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,pk:i}){return{kind:o.OpKind.UPDATE_CONSENSUS_KEY,source:e,fee:t,gas_limit:r,storage_limit:n,pk:i}}));t.createSmartRollupAddMessagesOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,message:i}){return{kind:o.OpKind.SMART_ROLLUP_ADD_MESSAGES,source:e,fee:t,gas_limit:r,storage_limit:n,message:i}}));t.createSmartRollupOriginateOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,pvmKind:i,kernel:s,parametersType:a}){return{kind:o.OpKind.SMART_ROLLUP_ORIGINATE,source:e,fee:t,gas_limit:r,storage_limit:n,pvm_kind:i,kernel:s,parameters_ty:a}}));t.createSmartRollupExecuteOutboxMessageOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,rollup:i,cementedCommitment:s,outputProof:a}){return{kind:o.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE,source:e,fee:t,gas_limit:r,storage_limit:n,rollup:i,cemented_commitment:s,output_proof:a}}))},3995:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcContractProvider=void 0;const i=r(2211),o=r(1157),s=r(9925),a=r(6209),c=r(6571),u=r(5025),l=r(4410),d=r(2526),f=r(6759),h=r(4368),p=r(2741),b=r(9339),m=r(9026),g=r(9281),v=r(4371),y=r(1660),_=r(659),E=r(8835),w=r(5574),O=r(2552),A=r(3118),S=r(408),P=r(5185),T=r(5605),R=r(3682);class I extends T.Provider{constructor(e,t){super(e),this.estimator=t,this.contractProviderTypeSymbol=Symbol.for("taquito-contract-provider-type-symbol"),this.prepare=new R.PrepareProvider(this.context)}getStorage(e,t){return n(this,void 0,void 0,(function*(){const r=(0,a.validateContractAddress)(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,(0,a.invalidDetail)(r));const n=yield this.context.readProvider.getScript(e,"head");let i;return t||(t=n),i=o.Schema.isSchema(t)?t:o.Schema.fromRPCResponse({script:t}),i.Execute(n.storage,(0,g.smartContractAbstractionSemantic)(this))}))}getBigMapKey(e,t,r){return n(this,void 0,void 0,(function*(){const n=(0,a.validateContractAddress)(e);if(n!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,(0,a.invalidDetail)(n));let i;r||(r=(yield this.rpc.getContract(e)).script),i=o.Schema.isSchema(r)?r:o.Schema.fromRPCResponse({script:r});const s=i.EncodeBigMapKey(t),u=yield this.rpc.getBigMapKey(e,s);return i.ExecuteOnBigMapValue(u)}))}getBigMapKeyByID(e,t,r,i){return n(this,void 0,void 0,(function*(){const{key:n,type:o}=r.EncodeBigMapKey(t),{packed:s}=yield this.context.packer.packData({data:n,type:o}),c=(0,a.encodeExpr)(s),u=i?yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},i):yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},"head");return r.ExecuteOnBigMapValue(u,(0,g.smartContractAbstractionSemantic)(this))}))}getBigMapKeysByID(e,t,r,i){return n(this,arguments,void 0,(function*(e,t,r,n,i=5){const s=yield this.getBlockForRequest(t,n),a=new o.MichelsonMap;let c=0,u=[];for(;c<t.length;){const n=t.slice(c,c+i).map((t=>this.getBigMapValueOrUndefined(t,e,r,s)));u=[...u,...yield Promise.all(n)],c+=i}for(let e=0;e<u.length;e++)a.set(t[e],u[e]);return a}))}getBlockForRequest(e,t){return n(this,void 0,void 0,(function*(){return 1===e.length||void 0!==t?t:yield this.context.readProvider.getBlockLevel("head")}))}getBigMapValueOrUndefined(e,t,r,o){return n(this,void 0,void 0,(function*(){try{return yield this.getBigMapKeyByID(t,e,r,o)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getSaplingDiffByID(e,t){return n(this,void 0,void 0,(function*(){return t?yield this.context.readProvider.getSaplingDiffById({id:e.toString()},t):yield this.context.readProvider.getSaplingDiffById({id:e.toString()},"head")}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.originate.bind(this.estimator)),r=yield this.prepare.originate(Object.assign(Object.assign({},e),t)),n=r.opOb.contents.find((e=>e.kind===s.OpKind.ORIGINATION)),i=yield this.forge(r),{hash:o,context:a,forgedBytes:c,opResponse:u}=yield this.signAndInject(i);return new d.OriginationOperation(o,n,c,u,a,this)}))}setDelegate(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));const n=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,(0,a.invalidDetail)(n));if(/kt1/i.test(e.source))throw new m.InvalidDelegationSource(e.source);const i=yield this.signer.publicKeyHash(),o=e.source||i,u=yield this.estimate(e,this.estimator.setDelegate.bind(this.estimator)),d=yield this.prepare.delegation(Object.assign(Object.assign({},e),u)),f=d.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),h=yield this.forge(d),{hash:p,context:b,forgedBytes:g,opResponse:v}=yield this.signAndInject(h);return new l.DelegateOperation(p,f,o,g,v,b)}))}registerDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.registerDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),n=yield this.prepare.registerDelegate(Object.assign(Object.assign({},e),t)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:d}=yield this.signAndInject(o);return new l.DelegateOperation(a,i,r,u,d,c)}))}transfer(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(e.to);if(r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,(0,a.invalidDetail)(r));const n=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(n));if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const i=yield this.signer.publicKeyHash(),o=yield this.estimate(e,this.estimator.transfer.bind(this.estimator)),u=e.source||i,l=yield this.prepare.transaction(Object.assign(Object.assign({},e),o)),d=l.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),f=yield this.forge(l),{hash:h,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(f);return new p.TransactionOperation(h,d,u,m,g,b)}))}stake(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));if(e.to||(e.to=e.source),e.to&&e.to!==e.source)throw new c.InvalidStakingAddressError(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const n=yield this.signer.publicKeyHash(),i=yield this.estimate(e,this.estimator.stake.bind(this.estimator)),o=e.source||n,u=yield this.prepare.stake(Object.assign(Object.assign({},e),i)),l=u.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:b,opResponse:m}=yield this.signAndInject(d);return new p.TransactionOperation(f,l,o,b,m,h)}))}unstake(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));if(e.to||(e.to=e.source),e.to&&e.to!==e.source)throw new c.InvalidStakingAddressError(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const n=yield this.signer.publicKeyHash(),i=yield this.estimate(e,this.estimator.unstake.bind(this.estimator)),o=e.source||n,u=yield this.prepare.unstake(Object.assign(Object.assign({},e),i)),l=u.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:b,opResponse:m}=yield this.signAndInject(d);return new p.TransactionOperation(f,l,o,b,m,h)}))}finalizeUnstake(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));if(e.to||(e.to=e.source),e.to&&e.to!==e.source)throw new c.InvalidStakingAddressError(e.to);if(e.amount||(e.amount=0),void 0!==e.amount&&e.amount>0)throw new c.InvalidFinalizeUnstakeAmountError("Amount must be 0 to finalize unstake.");const n=yield this.signer.publicKeyHash(),i=yield this.estimate(e,this.estimator.finalizeUnstake.bind(this.estimator)),o=e.source||n,u=yield this.prepare.finalizeUnstake(Object.assign(Object.assign({},e),i)),l=u.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:b,opResponse:m}=yield this.signAndInject(d);return new p.TransactionOperation(f,l,o,b,m,h)}))}transferTicket(e){return n(this,void 0,void 0,(function*(){var t,r;const n=(0,a.validateAddress)(e.destination);if(n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,(0,a.invalidDetail)(n));const i=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(i));const o=yield this.signer.publicKeyHash(),u=null!==(r=e.source)&&void 0!==r?r:o,l=yield this.estimate(e,this.estimator.transferTicket.bind(this.estimator)),d=yield this.prepare.transferTicket(Object.assign(Object.assign({},e),l)),f=d.opOb.contents.find((e=>e.kind===s.OpKind.TRANSFER_TICKET)),h=yield this.forge(d),{hash:p,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(h);return new v.TransferTicketOperation(p,f,u,m,g,b)}))}reveal(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimator.reveal(e);if(r){const i=yield this.estimate(e,(()=>n(this,void 0,void 0,(function*(){return r})))),o=yield this.prepare.reveal(Object.assign(Object.assign({},e),i)),a=o.opOb.contents.find((e=>e.kind===s.OpKind.REVEAL)),c=yield this.forge(o),{hash:u,context:l,forgedBytes:d,opResponse:f}=yield this.signAndInject(c);return new h.RevealOperation(u,a,t,d,f,l)}throw new m.RevealOperationError(`The publicKeyHash '${t}' has already been revealed.`)}))}registerGlobalConstant(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.registerGlobalConstant.bind(this.estimator)),n=yield this.prepare.registerGlobalConstant(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.REGISTER_GLOBAL_CONSTANT)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new f.RegisterGlobalConstantOperation(a,i,t,u,l,c)}))}increasePaidStorage(e){return n(this,void 0,void 0,(function*(){if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.increasePaidStorage.bind(this.estimator)),n=yield this.prepare.increasePaidStorage(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.INCREASE_PAID_STORAGE)),o=yield this.forge(n),{hash:a,context:u,forgedBytes:l,opResponse:d}=yield this.signAndInject(o);return new y.IncreasePaidStorageOperation(a,i,t,l,d,u)}))}drainDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.drainDelegate(e),r=t.opOb.contents.find((e=>e.kind===s.OpKind.DRAIN_DELEGATE)),n=yield this.forge(t),{hash:i,context:o,forgedBytes:a,opResponse:c}=yield this.signAndInject(n);return new E.DrainDelegateOperation(i,r,a,c,o)}))}ballot(e){return n(this,void 0,void 0,(function*(){var t,r;const n=yield this.signer.publicKeyHash(),i=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.ballot(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.BALLOT)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(d);return new _.BallotOperation(f,l,n,p,b,h)}))}proposals(e){return n(this,void 0,void 0,(function*(){var t,r;const n=yield this.signer.publicKeyHash(),i=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.proposals(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.PROPOSALS)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(d);return new w.ProposalsOperation(f,l,n,p,b,h)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.updateConsensusKey.bind(this.estimator)),n=yield this.prepare.updateConsensusKey(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.UPDATE_CONSENSUS_KEY)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new O.UpdateConsensusKeyOperation(a,i,t,u,l,c)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupAddMessages.bind(this.estimator)),n=yield this.prepare.smartRollupAddMessages(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ADD_MESSAGES)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new A.SmartRollupAddMessagesOperation(a,i,t,u,l,c)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupOriginate.bind(this.estimator)),n=yield this.prepare.smartRollupOriginate(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ORIGINATE)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new S.SmartRollupOriginateOperation(a,i,t,u,l,c)}))}smartRollupExecuteOutboxMessage(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupExecuteOutboxMessage.bind(this.estimator)),n=yield this.prepare.smartRollupExecuteOutboxMessage(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new P.SmartRollupExecuteOutboxMessageOperation(a,i,t,u,l,c)}))}failingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]}),{prefixSig:i}=yield this.signer.sign(n,new Uint8Array([3]));return{signature:i,bytes:n,signedContent:{branch:r,contents:[{kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}at(e){return n(this,arguments,void 0,(function*(e,t=e=>e){const r=(0,a.validateContractAddress)(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,(0,a.invalidDetail)(r));const n=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,o=yield i.getScript(e,"head"),s=yield i.getEntrypoints(e);return t(new b.ContractAbstraction(e,o,this,this,s,n,i),this.context)}))}batch(e){const t=new u.OperationBatch(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}t.RpcContractProvider=I},3e3:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SaplingStateAbstraction=void 0;t.SaplingStateAbstraction=class{constructor(e,t){this.id=e,this.provider=t}getSaplingDiff(e){return r(this,void 0,void 0,(function*(){return this.provider.getSaplingDiffByID(this.id.toString(),e)}))}getId(){return this.id.toString()}}},9281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smartContractAbstractionSemantic=void 0;const n=r(1157),i=r(9676),o=r(5553),s=r(3e3);t.smartContractAbstractionSemantic=e=>({big_map:(t,r)=>{if(t&&"int"in t&&void 0!==t.int){const s=new n.Schema(r);return new i.BigMapAbstraction(new o.default(t.int),s,e)}return{}},sapling_state:t=>t&&"int"in t&&void 0!==t.int?new s.SaplingStateAbstraction(new o.default(t.int),e):{}})},6200:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_LAMBDA=void 0;t.VIEW_LAMBDA={code:[{prim:"parameter",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},{prim:"unit"}]}]}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"UNIT"},{prim:"EXEC"}]]}],storage:"Unit"}},4359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RPCResponseError=t.ConfirmationTimeoutError=t.InvalidConfirmationCountError=void 0;const n=r(6571);class i extends n.ParameterValidationError{constructor(e){super(),this.invalidConfirmations=e,this.name="InvalidConfirmationCountError",this.message=`Invalid confirmation count ${e} expecting at least 1`}}t.InvalidConfirmationCountError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ConfirmationTimeoutError"}}t.ConfirmationTimeoutError=o;class s extends n.RpcError{constructor(e,t){super(),this.message=e,this.cause=t,this.name="RPCResponseError"}}t.RPCResponseError=s},8710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealEstimateError=void 0;const n=r(6571);class i extends n.TaquitoError{constructor(){super(),this.name="RevealEstimateError",this.message="Public key is unknown, unable to estimate the reveal operation in Wallet API."}}t.RevealEstimateError=i},1263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3771:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Estimate=void 0;const r=100;class n{constructor(e,t,r,n,i=100){this._milligasLimit=e,this._storageLimit=t,this.opSize=r,this.minimalFeePerStorageByteMutez=n,this.baseFeeMutez=i}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){return Math.max(Number(this._storageLimit),0)}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3)}get operationFeeMutez(){return.1*this.gasLimit+1*Number(this.opSize)}roundUp(e){return Math.ceil(Number(e))}get minimalFeeMutez(){return this.roundUp(this.operationFeeMutez+r)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+120)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),r)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(e){let t,r=0,i=0,o=0,s=0;return e.forEach((e=>{r+=e.milligasLimit,i+=e.storageLimit,o+=e.opSize,s=Math.max(e.minimalFeePerStorageByteMutez,s),e.baseFeeMutez&&(t=t?t+e.baseFeeMutez:e.baseFeeMutez)})),new n(r,i,o,s,t)}static createArrayEstimateInstancesFromProperties(e){return e.map((e=>new n(e.milligasLimit,e.storageLimit,e.opSize,e.minimalFeePerStorageByteMutez,e.baseFeeMutez)))}}t.Estimate=n},5681:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3771),t),i(r(1263),t),i(r(4019),t),i(r(8710),t)},4019:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCEstimateProvider=void 0;const o=r(286),s=r(6568),a=r(3771),c=r(6209),u=r(8710),l=r(5605),d=r(7583),f=r(6571);class h extends l.Provider{constructor(){super(...arguments),this.OP_SIZE_REVEAL=324,this.MILLIGAS_BUFFER=1e5,this.STORAGE_BUFFER=20,this.prepare=new d.PrepareProvider(this.context)}getKeys(){return n(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{publicKeyHash:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}getEstimationPropertiesFromOperationContent(e,t,r,n){const i=(0,o.flattenOperationResult)({contents:[e]});let a=0,c=0;return i.forEach((e=>{a+=Number(e.consumed_milligas)||0,c+="allocated_destination_contract"in e?n:0,c+="originated_contracts"in e&&Array.isArray(e.originated_contracts)?e.originated_contracts.length*n:0,c+="storage_size"in e&&"global_address"in e&&Number(e.storage_size)||0,c+="paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0,c+="genesis_commitment_hash"in e&&Number(e.size)||0})),(0,s.isOpWithFee)(e)?{milligasLimit:(0,s.isOpWithGasBuffer)(e)?a+Number(this.MILLIGAS_BUFFER):a,storageLimit:c>0?c+this.STORAGE_BUFFER:0,opSize:t,minimalFeePerStorageByteMutez:r.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:t,minimalFeePerStorageByteMutez:r.toNumber(),baseFeeMutez:0}}calculateEstimates(e,t){return n(this,void 0,void 0,(function*(){const{opbytes:r,opOb:{branch:n,contents:i}}=yield this.forge(e),s={operation:{branch:n,contents:i,signature:"edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg"},chain_id:yield this.context.readProvider.getChainId()},{opResponse:a}=yield this.simulate(s),{cost_per_byte:c,origination_size:u}=t,l=[...(0,o.flattenErrors)(a,"backtracked"),...(0,o.flattenErrors)(a)];if(l.length)throw new o.TezosOperationError(l,"Error occurred during estimation",a.contents);let d=1;return Array.isArray(e.opOb.contents)&&e.opOb.contents.length>1&&(d="reveal"===a.contents[0].kind?e.opOb.contents.length-1:e.opOb.contents.length),a.contents.map((e=>this.getEstimationPropertiesFromOperationContent(e,"reveal"===e.kind?this.OP_SIZE_REVEAL/2:(r.length+130)/2/d,c,null!=u?u:257)))}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.originate(e),r=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.calculateEstimates(t,r);return"reveal"===t.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}transfer(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(s.to);if(u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.to,(0,c.invalidDetail)(u));const l=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&l!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(l));if(s.amount<0)throw new f.InvalidAmountError(s.amount.toString());const d=yield this.prepare.transaction(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),h=yield this.context.readProvider.getProtocolConstants("head"),p=yield this.calculateEstimates(d,h);return"reveal"===d.opOb.contents[0].kind&&(p.shift(),p[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(p)}))}stake(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));if(s.to||(s.to=s.source),s.to&&s.to!==s.source)throw new f.InvalidStakingAddressError(s.to);if(s.amount<0)throw new f.InvalidAmountError(s.amount.toString());const l=yield this.prepare.stake(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.calculateEstimates(l,d);return"reveal"===l.opOb.contents[0].kind&&(h.shift(),h[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(h)}))}unstake(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));if(s.to||(s.to=s.source),s.to&&s.to!==s.source)throw new f.InvalidStakingAddressError(s.to);if(s.amount<0)throw new f.InvalidAmountError(s.amount.toString());const l=yield this.prepare.unstake(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.calculateEstimates(l,d);return"reveal"===l.opOb.contents[0].kind&&(h.shift(),h[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(h)}))}finalizeUnstake(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));if(s.to||(s.to=s.source),s.to&&s.to!==s.source)throw new f.InvalidStakingAddressError(s.to);if(s.amount||(s.amount=0),void 0!==s.amount&&0!==s.amount)throw new Error("Amount must be 0 for finalize_unstake operation");const l=yield this.prepare.finalizeUnstake(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.calculateEstimates(l,d);return"reveal"===l.opOb.contents[0].kind&&(h.shift(),h[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(h)}))}transferTicket(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(s.destination);if(u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.destination,(0,c.invalidDetail)(u));const l=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&l!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(l));const d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.prepare.transferTicket(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),p=yield this.calculateEstimates(h,d);return"reveal"===h.opOb.contents[0].kind&&(p.shift(),p[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(p)}))}setDelegate(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,gasLimit:n,storageLimit:o}=e,s=i(e,["fee","gasLimit","storageLimit"]);const u=(0,c.validateAddress)(s.source);if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));const l=(0,c.validateAddress)(null!==(t=s.delegate)&&void 0!==t?t:"");if(s.delegate&&l!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.delegate,(0,c.invalidDetail)(l));const d=yield this.prepare.delegation(Object.assign({fee:r,storageLimit:o,gasLimit:n},s)),h=yield this.context.readProvider.getProtocolConstants("head"),p=yield this.calculateEstimates(d,h);return"reveal"===d.opOb.contents[0].kind&&(p.shift(),p[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(p)}))}batch(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.batch(e),n=yield this.calculateEstimates(r,t);return a.Estimate.createArrayEstimateInstancesFromProperties(n)}))}registerDelegate(e,t){return n(this,void 0,void 0,(function*(){var{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const c=(yield this.getKeys()).publicKeyHash,u=yield this.context.readProvider.getProtocolConstants("head"),l=t||c,d=yield this.prepare.registerDelegate(Object.assign({fee:r,storageLimit:n,gasLimit:o},s),l),f=yield this.calculateEstimates(d,u);return"reveal"===d.opOb.contents[0].kind&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(f)}))}reveal(e){return n(this,void 0,void 0,(function*(){const{publicKeyHash:t,publicKey:r}=yield this.getKeys();if(!r)throw new u.RevealEstimateError;if(yield this.isAccountRevealRequired(t)){const t=yield this.context.readProvider.getProtocolConstants("head"),r=e?yield this.prepare.reveal(e):yield this.prepare.reveal({}),n=yield this.calculateEstimates(r,t);return a.Estimate.createEstimateInstanceFromProperties(n)}}))}registerGlobalConstant(e){return n(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:n}=e,o=i(e,["fee","storageLimit","gasLimit"]);const s=yield this.prepare.registerGlobalConstant(Object.assign({fee:t,storageLimit:r,gasLimit:n},o)),c=yield this.context.readProvider.getProtocolConstants("head"),u=yield this.calculateEstimates(s,c);return"reveal"===s.opOb.contents[0].kind&&(u.shift(),u[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(u)}))}increasePaidStorage(e){return n(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:n}=e,o=i(e,["fee","storageLimit","gasLimit"]);if(o.amount<0)throw new f.InvalidAmountError(o.amount.toString());const s=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.prepare.increasePaidStorage(Object.assign({fee:t,storageLimit:r,gasLimit:n},o)),u=yield this.calculateEstimates(c,s);return"reveal"===c.opOb.contents[0].kind&&(u.shift(),u[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(u)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.updateConsensusKey(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupAddMessages(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupOriginate(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupExecuteOutboxMessage(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupExecuteOutboxMessage(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}contractCall(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.contractCall(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}}t.RPCEstimateProvider=h},3215:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeForger=void 0;const i=r(8681);t.CompositeForger=class{constructor(e){if(this.forgers=e,0===e.length)throw new i.UnspecifiedForgerError}forge(e){return n(this,arguments,void 0,(function*({branch:e,contents:t}){const r=yield Promise.all(this.forgers.map((r=>r.forge({branch:e,contents:t}))));if(0===r.length)throw new i.UnspecifiedForgerError;let n=r.pop();for(;r.length;){const e=r.pop();if(e!==n)throw new i.ForgingMismatchError([n,e]);n=e}return n}))}}},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnspecifiedForgerError=t.ForgingMismatchError=void 0;const n=r(6571);class i extends n.TaquitoError{constructor(e){super(),this.results=e,this.name="ForgingMismatchError",this.message="Forging mismatch error"}}t.ForgingMismatchError=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnspecifiedForgerError",this.message="No forger has been configured. Please configure new CompositeForger([rpcForger, localForger]) with your TezosToolkit instance."}}t.UnspecifiedForgerError=o},9719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcForger=void 0;t.RpcForger=class{constructor(e){this.context=e}forge({branch:e,contents:t}){return this.context.rpc.forgeOperations({branch:e,contents:t})}}},6343:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TaquitoLocalForger=void 0;const i=r(9971);t.TaquitoLocalForger=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}forge(e){return n(this,arguments,void 0,(function*({branch:e,contents:t}){return new i.LocalForger(yield this.getNextProto()).forge({branch:e,contents:t})}))}}},7771:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGlobalConstantsProvider=void 0;const i=r(9185);t.DefaultGlobalConstantsProvider=class{constructor(){this._globalConstantsLibrary={}}loadGlobalConstant(e){for(const t in e)Object.assign(this._globalConstantsLibrary,{[t]:e[t]})}getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){const t=this._globalConstantsLibrary[e];if(!t)throw new i.GlobalConstantNotFound(e);return t}))}}},9185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredGlobalConstantsProviderError=t.GlobalConstantNotFound=void 0;const n=r(6571);class i extends n.TaquitoError{constructor(e){super(),this.hash=e,this.name="GlobalConstantNotFound",this.message=`Please load the value associated with the constant ${e} using the loadGlobalConstant method of the DefaultGlobalConstantsProvider.`}}t.GlobalConstantNotFound=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredGlobalConstantsProviderError",this.message="No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."}}t.UnconfiguredGlobalConstantsProviderError=o},7157:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8320:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopGlobalConstantsProvider=void 0;const i=r(9185);t.NoopGlobalConstantsProvider=class{getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredGlobalConstantsProviderError}))}}},5299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatErrorMessage=function(e,t){const r=JSON.parse(e.body);if(r[0]&&r[0].kind&&r[0].msg){const i=JSON.stringify({kind:r[0].kind,id:r[0].id,msg:r[0].msg.replace(t,"")});return new n.HttpResponseError(`Http error response: (${e.status}) ${i}`,e.status,e.statusText,i,e.url)}return e};const n=r(2211)},9164:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2245:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcInjector=void 0;const i=r(5299),o=r(2211);t.RpcInjector=class{constructor(e){this.context=e}inject(e){return n(this,void 0,void 0,(function*(){let t;try{t=yield this.context.rpc.injectOperation(e)}catch(e){const t=". You may want to use --replace to provide adequate fee and replace it";throw e instanceof o.HttpResponseError&&e.message.includes(t)?(0,i.formatErrorMessage)(e,t):e}return t}))}}},659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BallotOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"ballot"===e.kind));return e||void 0}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}t.BallotOperation=i},7669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BatchOperation=void 0;const n=r(5553),i=r(5025),o=r(286),s=r(1859),a=r(6568);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}getOriginatedContractAddresses(){const e=this.results.filter((e=>"origination"===e.kind));let t=[];for(const r of e)r.metadata.operation_result.originated_contracts&&(t=[...t,...r.metadata.operation_result.originated_contracts]);return t}get status(){return this.results.filter((e=>-1!==i.BATCH_KINDS.indexOf(e.kind))).map((e=>{if((0,a.hasMetadataWithResult)(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp((0,o.flattenOperationResult)({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp((0,o.flattenOperationResult)({contents:this.results}),"paid_storage_size_diff"))}get errors(){return(0,o.flattenErrors)({contents:this.results})}}t.BatchOperation=c},4410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateOperation=void 0;const n=r(5553),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"delegation"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.DelegateOperation=o},8835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DrainDelegateOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i){super(e,r,n,i),this.params=t}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"drain_delegate"===e.kind)),t=e&&e.metadata&&e.metadata.balance_updates;return t||void 0}get consensusKey(){return this.params.consensus_key}get delegate(){return this.params.delegate}get destination(){return this.params.destination}}t.DrainDelegateOperation=i},286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidEstimateValueError=t.OriginationOperationError=t.flattenErrors=t.flattenOperationResult=t.TezosPreapplyFailureError=t.TezosOperationError=void 0;const n=r(6571),i=r(6568);class o extends n.RpcError{constructor(e,t,r){super(),this.errors=e,this.errorDetails=t,this.operationsWithResults=r,this.name="TezosOperationError",this.lastError=e[e.length-1],this.message=`(${this.kind}) ${this.id}`,"with"in this.lastError&&(this.lastError.with.string?this.message=this.lastError.with.string:this.lastError.with.int?this.message=this.lastError.with.int:this.message=JSON.stringify(this.lastError.with))}get id(){return this.lastError.id}get kind(){return this.lastError.kind}}t.TezosOperationError=o;class s extends Error{constructor(e){super(),this.result=e,this.name="TezosPreapplyFailureError",this.message="Preapply returned an unexpected result"}}t.TezosPreapplyFailureError=s;t.flattenOperationResult=e=>{const t=Array.isArray(e)?e:[e],r=[];for(let e=0;e<t.length;e++)for(let n=0;n<t[e].contents.length;n++){const o=t[e].contents[n];(0,i.hasMetadataWithResult)(o)&&"fee"in o&&(r.push(Object.assign({fee:o.fee},o.metadata.operation_result)),Array.isArray(o.metadata.internal_operation_results)&&o.metadata.internal_operation_results.forEach((e=>r.push(e.result))))}return r};t.flattenErrors=(e,t="failed")=>{const r=Array.isArray(e)?e:[e];let n=[];for(let e=0;e<r.length;e++)for(let o=0;o<r[e].contents.length;o++){const s=r[e].contents[o];if((0,i.hasMetadata)(s)&&((0,i.hasMetadataWithResult)(s)&&s.metadata.operation_result.status===t&&(n=n.concat(s.metadata.operation_result.errors||[])),(0,i.hasMetadataWithInternalOperationResult)(s)&&Array.isArray(s.metadata.internal_operation_results)))for(const e of s.metadata.internal_operation_results)"result"in e&&e.result.status===t&&(n=n.concat(e.result.errors||[]))}return n};class a extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="OriginationOperationError"}}t.OriginationOperationError=a;class c extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidEstimateValueError"}}t.InvalidEstimateValueError=c},1660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"increase_paid_storage"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}t.IncreasePaidStorageOperation=i},105:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.RevealOperation=t.ProposalsOperation=t.DrainDelegateOperation=t.BallotOperation=t.SmartRollupOriginateOperation=t.SmartRollupAddMessagesOperation=t.UpdateConsensusKeyOperation=t.TransferTicketOperation=t.IncreasePaidStorageOperation=t.RegisterGlobalConstantOperation=t.TransactionOperation=t.DelegateOperation=t.OriginationOperation=t.BatchOperation=t.InvalidEstimateValueError=t.TezosPreapplyFailureError=t.TezosOperationError=void 0,i(r(6568),t);var o=r(286);Object.defineProperty(t,"TezosOperationError",{enumerable:!0,get:function(){return o.TezosOperationError}}),Object.defineProperty(t,"TezosPreapplyFailureError",{enumerable:!0,get:function(){return o.TezosPreapplyFailureError}}),Object.defineProperty(t,"InvalidEstimateValueError",{enumerable:!0,get:function(){return o.InvalidEstimateValueError}});var s=r(7669);Object.defineProperty(t,"BatchOperation",{enumerable:!0,get:function(){return s.BatchOperation}});var a=r(2526);Object.defineProperty(t,"OriginationOperation",{enumerable:!0,get:function(){return a.OriginationOperation}});var c=r(4410);Object.defineProperty(t,"DelegateOperation",{enumerable:!0,get:function(){return c.DelegateOperation}});var u=r(2741);Object.defineProperty(t,"TransactionOperation",{enumerable:!0,get:function(){return u.TransactionOperation}});var l=r(6759);Object.defineProperty(t,"RegisterGlobalConstantOperation",{enumerable:!0,get:function(){return l.RegisterGlobalConstantOperation}});var d=r(1660);Object.defineProperty(t,"IncreasePaidStorageOperation",{enumerable:!0,get:function(){return d.IncreasePaidStorageOperation}});var f=r(4371);Object.defineProperty(t,"TransferTicketOperation",{enumerable:!0,get:function(){return f.TransferTicketOperation}});var h=r(2552);Object.defineProperty(t,"UpdateConsensusKeyOperation",{enumerable:!0,get:function(){return h.UpdateConsensusKeyOperation}});var p=r(3118);Object.defineProperty(t,"SmartRollupAddMessagesOperation",{enumerable:!0,get:function(){return p.SmartRollupAddMessagesOperation}});var b=r(408);Object.defineProperty(t,"SmartRollupOriginateOperation",{enumerable:!0,get:function(){return b.SmartRollupOriginateOperation}});var m=r(659);Object.defineProperty(t,"BallotOperation",{enumerable:!0,get:function(){return m.BallotOperation}});var g=r(8835);Object.defineProperty(t,"DrainDelegateOperation",{enumerable:!0,get:function(){return g.DrainDelegateOperation}});var v=r(5574);Object.defineProperty(t,"ProposalsOperation",{enumerable:!0,get:function(){return v.ProposalsOperation}});var y=r(4368);Object.defineProperty(t,"RevealOperation",{enumerable:!0,get:function(){return y.RevealOperation}});var _=r(1859);Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return _.Operation}})},1859:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=void 0;const i=r(8813),o=r(9419),s=r(6568),a=r(6209),c=r(9940),u=r(4359),l=r(6571);t.Operation=class{get includedInBlock(){return this._foundAt}constructor(e,t,r,n){if(this.hash=e,this.raw=t,this.results=r,this.context=n,this._pollingConfig$=new i.ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe((0,o.switchMap)((e=>new i.BehaviorSubject(e).pipe((0,o.timeout)({each:1e3*e.timeout,with:()=>(0,i.throwError)((()=>new u.ConfirmationTimeoutError("Confirmation polling timed out")))})))),(0,o.switchMap)((()=>(0,i.defer)((()=>(0,c.createObservableFromSubscription)(this.context.stream.subscribeBlock("head")))).pipe((0,o.switchMap)((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return(0,i.range)(n+1,e.header.level-n-1).pipe((0,o.concatMap)((e=>this.context.readProvider.getBlock(e))),(0,o.endWith)(e))})),(0,o.tap)((e=>this.lastHead=e))))),(0,o.shareReplay)({refCount:!0})),this.confirmed$=this.currentHead$.pipe((0,o.map)((e=>{for(let t=3;t>=0;t--)e.operations[t].forEach((t=>{t.hash===this.hash&&(this._foundAt=e.header.level)}));if(e.header.level-this._foundAt>=0)return this._foundAt})),(0,o.filter)((e=>void 0!==e)),(0,o.first)(),(0,o.shareReplay)()),this._foundAt=Number.POSITIVE_INFINITY,(0,a.validateOperation)(this.hash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.hash);this.confirmed$.pipe((0,o.first)(),(0,o.catchError)((()=>(0,i.of)(i.EMPTY)))).subscribe()}get revealOperation(){return Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind))}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map((e=>(0,s.hasMetadataWithResult)(e)?e.metadata.operation_result.status:"unknown"))[0]||"unknown"}confirmation(e,t){return n(this,void 0,void 0,(function*(){if(void 0!==e&&e<1)throw new u.InvalidConfirmationCountError(e);const{defaultConfirmationCount:r,confirmationPollingTimeoutSecond:n}=this.context.config;this._pollingConfig$.next({timeout:t||n});const i=void 0!==e?e:r;return new Promise(((e,t)=>{this.confirmed$.pipe((0,o.switchMap)((()=>this.currentHead$)),(0,o.filter)((e=>e.header.level-this._foundAt>=i-1)),(0,o.first)()).subscribe({error:e=>t(e),complete:()=>e(this._foundAt+(i-1))})}))}))}}},2526:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationOperation=void 0;const i=r(5553),o=r(286),s=r(1859),a=r(6568);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,r,n,i),this.params=t,this.contractProvider=o;const s=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(s)&&(this.contractAddress=s[0])}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"origination"===e.kind)),t=e&&(0,a.hasMetadataWithResult)(e)&&e.metadata.operation_result;return t||void 0}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get storageDiff(){const e=this.operationResults&&this.operationResults.paid_storage_size_diff;return e||void 0}get storageSize(){const e=this.operationResults&&this.operationResults.storage_size;return e||void 0}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}contract(e,t){return n(this,void 0,void 0,(function*(){if(!this.contractAddress)throw new o.OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(e,t),this.contractProvider.at(this.contractAddress)}))}}t.OriginationOperation=c},5574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProposalsOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"proposals"===e.kind));return e||void 0}get proposals(){return this.params.proposals}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}}t.ProposalsOperation=i},6759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterGlobalConstantOperation=void 0;const n=r(5553),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"register_global_constant"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get registeredExpression(){return this.params.value}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.RegisterGlobalConstantOperation=o},4368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealOperation=void 0;const n=r(5553),i=r(286),o=r(1859);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get publicKey(){return this.params.public_key}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"storage_size"))}get errors(){return(0,i.flattenErrors)({contents:this.operationResults})}}t.RevealOperation=s},3118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupAddMessagesOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"smart_rollup_add_messages"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get message(){return this.params.message}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupAddMessagesOperation=i},5185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupExecuteOutboxMessageOperation=void 0;const n=r(9925),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get rollup(){return this.params.rollup}get cementedCommitment(){return this.params.cemented_commitment}get outputProof(){return this.params.output_proof}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupExecuteOutboxMessageOperation=o},408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupOriginateOperation=void 0;const n=r(9925),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.SMART_ROLLUP_ORIGINATE)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get pvmKind(){return this.params.pvm_kind}get kernel(){return this.params.kernel}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupOriginateOperation=o},2741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOperation=void 0;const n=r(5553),i=r(286),o=r(1859);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"transaction"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get amount(){return new n.default(this.params.amount)}get destination(){return this.params.destination}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"storage_size"))}get errors(){return(0,i.flattenErrors)({contents:this.operationResults})}}t.TransactionOperation=s},4371:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTicketOperation=void 0;const n=r(9925),i=r(5553),o=r(105);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.TRANSFER_TICKET)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.TransferTicketOperation=s},6568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasMetadataWithInternalOperationResult=t.hasMetadataWithResult=t.hasMetadata=t.isSourceOp=t.isOpRequireReveal=t.isOpWithFee=t.isOpWithGasBuffer=t.isKind=t.findWithKind=t.attachKind=t.OpKind=void 0;const n=r(9925);var i=r(9925);Object.defineProperty(t,"OpKind",{enumerable:!0,get:function(){return i.OpKind}});t.attachKind=(e,t)=>Object.assign(Object.assign({},e),{kind:t});t.findWithKind=(e,r)=>{if(Array.isArray(e)){const n=e.find((e=>e.kind===r));if(n&&(0,t.isKind)(n,r))return n}};t.isKind=(e,t)=>e.kind===t;t.isOpWithGasBuffer=e=>!(e.kind!==n.OpKind.TRANSACTION||!e.parameters)||-1!==["origination","register_global_constant","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(e.kind);t.isOpWithFee=e=>-1!==["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate","smart_rollup_execute_outbox_message"].indexOf(e.kind);t.isOpRequireReveal=e=>-1!==["transaction","delegation","origination","register_global_constant","increase_paid_storage","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate","smart_rollup_execute_outbox_message"].indexOf(e.kind);t.isSourceOp=e=>-1!==["transaction","delegation","origination","reveal","ballot"].indexOf(e.kind);t.hasMetadata=e=>"metadata"in e;t.hasMetadataWithResult=e=>(0,t.hasMetadata)(e)&&"operation_result"in e.metadata;t.hasMetadataWithInternalOperationResult=e=>(0,t.hasMetadata)(e)&&"internal_operation_results"in e.metadata},2552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateConsensusKeyOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"update_consensus_key"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get pk(){return this.params.pk}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.UpdateConsensusKeyOperation=i},458:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4377:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecPacker=void 0;const i=r(5899);t.MichelCodecPacker=class{packData(e){return n(this,void 0,void 0,(function*(){const{bytes:t}=(0,i.packDataBytes)(e.data,e.type);return{packed:t}}))}}},577:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcPacker=void 0;t.RpcPacker=class{constructor(e){this.context=e}packData(e){return r(this,void 0,void 0,(function*(){return this.context.rpc.packData(e)}))}}},3971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8541:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecParser=void 0;const i=r(5899),o=r(9026),s=r(1157);t.MichelCodecParser=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}parseScript(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseScript(e)}))}parseMichelineExpression(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseMichelineExpression(e)}))}parseJSON(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseJSON(e)}))}prepareCodeOrigination(e){return n(this,void 0,void 0,(function*(){const t=e;if(t.code=yield this.formatCodeParam(e.code),e.init)t.init=yield this.formatInitParam(e.init);else if(e.storage){const r=t.code.find((e=>"prim"in e&&"storage"===e.prim));if(!(null==r?void 0:r.args))throw new o.InvalidCodeParameter("The storage section is missing from the script",e.code);const n=new s.Schema(r.args[0]),a=yield this.findGlobalConstantsHashAndValue(n);if(0!==Object.keys(a).length){const n=new i.Parser({expandGlobalConstant:a}).parseJSON(r.args[0]),o=new s.Schema(n);t.init=o.Encode(e.storage)}else t.init=n.Encode(e.storage);delete t.storage}return t}))}formatCodeParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseScript(e);if(null===r)throw new o.InvalidCodeParameter("Unable to parse",e);t=r}else{const r=yield this.parseJSON(e),n=["parameter","storage","code"];t=r.sort(((e,t)=>n.indexOf(e.prim)-n.indexOf(t.prim)))}return t}))}formatInitParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseMichelineExpression(e);if(null===r)throw new o.InvalidInitParameter("Invalid init parameter",e);t=r}else t=yield this.parseJSON(e);return t}))}findGlobalConstantsHashAndValue(e){return n(this,void 0,void 0,(function*(){const t=e.findToken("constant"),r={};if(0!==t.length)for(const e of t){const t=e.tokenVal.args;if(t){const e=t[0];if(e.string){const t=e.string,n=yield this.context.globalConstantsProvider.getGlobalConstantByHash(t);Object.assign(r,{[t]:n})}}}return r}))}}},6424:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopParser=void 0;t.NoopParser=class{prepareCodeOrigination(e){return r(this,void 0,void 0,(function*(){return e}))}}},3682:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(261),t),i(r(7583),t)},261:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7583:function(e,t,r){"use strict";var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},s=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.PrepareProvider=void 0;const c=r(9925),u=r(6568),l=r(5283),d=r(4359),f=r(6571),h=r(2445),p=r(5605),b=r(5553),m=(e,t)=>{var r,n,i;return{fee:null!==(r=e.fee)&&void 0!==r?r:t.fee,gasLimit:null!==(n=e.gasLimit)&&void 0!==n?n:t.gasLimit,storageLimit:null!==(i=e.storageLimit)&&void 0!==i?i:t.storageLimit}};class g extends p.Provider{constructor(e){super(e),this.context=e,n.set(this,void 0),o(this,n,{},"f")}getBlockHash(e){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getBlockHash(null!=e?e:"head~2")}))}getProtocolHash(){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getNextProtocol("head")}))}getHeadCounter(e){return i(this,void 0,void 0,(function*(){var t;return null!==(t=this.context.readProvider.getCounter(e,"head"))&&void 0!==t?t:"0"}))}adjustGasForBatchOperation(e,t,r){return b.default.min(t,e.div(r+1))}getOperationLimits(e,t){return i(this,void 0,void 0,(function*(){const{hard_gas_limit_per_operation:r,hard_gas_limit_per_block:n,hard_storage_limit_per_operation:i}=e;return{fee:0,gasLimit:t?Math.floor(this.adjustGasForBatchOperation(n,r,t).toNumber()):r.toNumber(),storageLimit:i.toNumber()}}))}getFee(e,t,r){(!s(this,n,"f")[t]||s(this,n,"f")[t]<r)&&(s(this,n,"f")[t]=r);return{counter:`${++s(this,n,"f")[t]}`,fee:void 0===e.fee?"0":`${e.fee}`,gas_limit:void 0===e.gas_limit?"0":`${e.gas_limit}`,storage_limit:void 0===e.storage_limit?"0":`${e.storage_limit}`}}getSource(e,t,r){return{source:void 0===e.source?r||t:e.source}}addRevealOperationIfNeeded(e,t){return i(this,void 0,void 0,(function*(){if((0,u.isOpRequireReveal)(e)){const r=[e],{publicKey:n,pkh:i}=yield this.getKeys();if(yield this.isAccountRevealRequired(t)){if(!n)throw new f.PublicKeyNotFoundError(i);return r.unshift(yield(0,h.createRevealOperation)({fee:(0,l.getRevealFee)(i),storageLimit:l.REVEAL_STORAGE_LIMIT,gasLimit:(0,l.getRevealGasLimit)(i)},t,n)),r}}return e}))}getKeys(){return i(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{pkh:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}convertIntoArray(e){return Array.isArray(e)?[...e]:[e]}constructOpContents(e,t,r,n,i){return e.map((e=>{switch(e.kind){case c.OpKind.ACTIVATION:case c.OpKind.DRAIN_DELEGATE:return Object.assign({},e);case c.OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{balance:void 0!==e.balance?`${e.balance}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSACTION:{const i=Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:void 0!==e.amount?`${e.amount}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));if(i.source.toLowerCase().startsWith("kt1"))throw new f.DeprecationError(`KT1 addresses are not supported as source since ${l.Protocols.PsBabyM1}`);return i}case c.OpKind.REVEAL:case c.OpKind.DELEGATION:case c.OpKind.REGISTER_GLOBAL_CONSTANT:case c.OpKind.UPDATE_CONSENSUS_KEY:case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:case c.OpKind.SMART_ROLLUP_ORIGINATE:case c.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return Object.assign(Object.assign(Object.assign({},e),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ticket_amount:`${e.ticket_amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:`${e.amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.BALLOT:case c.OpKind.PROPOSALS:if(void 0===i)throw new d.RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},e),{period:null==i?void 0:i.voting_period.index});default:throw new f.InvalidOperationKindError(e.kind)}}))}activate(e){return i(this,arguments,void 0,(function*({pkh:e,secret:t}){const r=yield(0,h.createActivationOperation)({pkh:e,secret:t}),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{},"f");const c=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:s,contents:this.constructOpContents(i,c,e),protocol:a},counter:c}}))}reveal(e){return i(this,arguments,void 0,(function*({fee:e,gasLimit:t,storageLimit:r}){const{pkh:i,publicKey:s}=yield this.getKeys();if(!s)throw new f.PublicKeyNotFoundError(i);const a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getOperationLimits(a),u=m({fee:e,storageLimit:r,gasLimit:t},c),l=yield(0,h.createRevealOperation)({fee:u.fee,gasLimit:u.gasLimit,storageLimit:u.storageLimit},i,s),d=this.convertIntoArray(l),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{},"f");const g=parseInt(yield this.getHeadCounter(i),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,i),protocol:b},counter:g}}))}originate(e,t){return i(this,void 0,void 0,(function*(){var{fee:r,storageLimit:i,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);const{pkh:u}=yield this.getKeys(),l=yield this.context.readProvider.getProtocolConstants("head"),d=yield this.getOperationLimits(l),f=yield(0,h.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},c),m({fee:r,storageLimit:i,gasLimit:s},d)))),p=yield this.addRevealOperationIfNeeded(f,u),b=this.convertIntoArray(p),g=yield this.getBlockHash(),v=yield this.getProtocolHash();o(this,n,{},"f");const y=parseInt(yield this.getHeadCounter(u),10);return{opOb:{branch:g,contents:this.constructOpContents(b,y,u,t),protocol:v},counter:y}}))}transaction(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}stake(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({},s),{to:c}),m({fee:t,storageLimit:r,gasLimit:i},l)),{parameter:{entrypoint:"stake",value:{prim:"Unit"}}})),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}unstake(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({},s),{to:c}),m({fee:t,storageLimit:r,gasLimit:i},l)),{parameter:{entrypoint:"unstake",value:{prim:"Unit"}}})),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}finalizeUnstake(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({},s),{to:c,amount:0}),m({fee:t,storageLimit:r,gasLimit:i},l)),{parameter:{entrypoint:"finalize_unstake",value:{prim:"Unit"}}})),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}delegation(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSetDelegateOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}registerDelegate(e,t){return i(this,arguments,void 0,(function*({fee:e,storageLimit:t,gasLimit:r},i){const{pkh:s}=yield this.getKeys(),a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getOperationLimits(a),u=m({fee:e,storageLimit:t,gasLimit:r},c),l=yield(0,h.createRegisterDelegateOperation)({fee:u.fee,storageLimit:u.storageLimit,gasLimit:u.gasLimit},s),d=yield this.addRevealOperationIfNeeded(l,s),f=this.convertIntoArray(d),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{},"f");const g=parseInt(yield this.getHeadCounter(s),10);return{opOb:{branch:p,contents:this.constructOpContents(f,g,s,i),protocol:b},counter:g}}))}registerGlobalConstant(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createRegisterGlobalConstantOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}updateConsensusKey(e,t){return i(this,void 0,void 0,(function*(){var{fee:r,storageLimit:i,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);const{pkh:u}=yield this.getKeys(),l=yield this.context.readProvider.getProtocolConstants("head"),d=yield this.getOperationLimits(l),f=yield(0,h.createUpdateConsensusKeyOperation)(Object.assign(Object.assign({},c),m({fee:r,storageLimit:i,gasLimit:s},d))),p=yield this.addRevealOperationIfNeeded(f,u),b=this.convertIntoArray(p),g=yield this.getBlockHash(),v=yield this.getProtocolHash();o(this,n,{},"f");const y=parseInt(yield this.getHeadCounter(u),10);return{opOb:{branch:g,contents:this.constructOpContents(b,y,u,t),protocol:v},counter:y}}))}increasePaidStorage(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createIncreasePaidStorageOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}ballot(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield(0,h.createBallotOperation)(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{},"f");const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new d.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}proposals(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield(0,h.createProposalsOperation)(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{},"f");const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new d.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}drainDelegate(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r}=yield this.getKeys(),i=yield(0,h.createDrainDelegateOperation)(Object.assign({},e)),s=this.convertIntoArray(i),a=yield this.getBlockHash(),c=yield this.getProtocolHash();o(this,n,{},"f");const u=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:a,contents:this.constructOpContents(s,u,r,t),protocol:c},counter:u}}))}transferTicket(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferTicketOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}smartRollupAddMessages(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSmartRollupAddMessagesOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}smartRollupOriginate(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSmartRollupOriginateOperation)(Object.assign(Object.assign({},m({fee:t,storageLimit:r,gasLimit:i},l)),s)),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}smartRollupExecuteOutboxMessage(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSmartRollupExecuteOutboxMessageOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}batch(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r,publicKey:i}=yield this.getKeys(),s=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getOperationLimits(s,e.length),c=yield this.isRevealOpNeeded(e,r),d=[];if(t)for(const r of e)if((0,u.isOpWithFee)(r)){const e=t.shift(),n=m(r,{fee:e.suggestedFeeMutez,storageLimit:e.storageLimit,gasLimit:e.gasLimit});d.push(yield this.getRPCOp(Object.assign(Object.assign({},r),n)))}else d.push(Object.assign({},r));else for(const t of e)if((0,u.isOpWithFee)(t)){const e=m(t,a);d.push(yield this.getRPCOp(Object.assign(Object.assign({},t),e)))}else d.push(Object.assign({},t));if(c){if(!i)throw new f.PublicKeyNotFoundError(r);d.unshift(yield(0,h.createRevealOperation)({fee:(0,l.getRevealFee)(r),storageLimit:l.REVEAL_STORAGE_LIMIT,gasLimit:(0,l.getRevealGasLimit)(r)},r,i))}const p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{},"f");const g=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,r),protocol:b},counter:g}}))}contractCall(e){return i(this,void 0,void 0,(function*(){var t,r,i;const s=yield this.getBlockHash(),a=yield this.getProtocolHash(),{pkh:u}=yield this.getKeys();o(this,n,{},"f");const l=parseInt(yield this.getHeadCounter(u),10),d=e.toTransferParams(),f=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.getOperationLimits(f),p=m({fee:d.fee,storageLimit:d.storageLimit,gasLimit:d.gasLimit},h),b={kind:c.OpKind.TRANSACTION,fee:null!==(t=d.fee)&&void 0!==t?t:p.fee,gas_limit:null!==(r=d.gasLimit)&&void 0!==r?r:p.gasLimit,storage_limit:null!==(i=d.storageLimit)&&void 0!==i?i:p.storageLimit,amount:String(d.amount),destination:d.to,parameters:d.parameter},g=yield this.addRevealOperationIfNeeded(b,u),v=this.convertIntoArray(g);return{opOb:{branch:s,contents:this.constructOpContents(v,l,u),protocol:a},counter:l}}))}toPreapply(e){return i(this,void 0,void 0,(function*(){const{opOb:{contents:t,branch:r,protocol:n}}=e,i=this.toForge(e),o=yield this.context.forger.forge(i);return[{contents:t,branch:r,protocol:n,signature:(yield this.context.signer.sign(o,new Uint8Array([3]))).prefixSig}]}))}toForge({opOb:{contents:e,branch:t}}){return{branch:t,contents:e}}}t.PrepareProvider=g,n=new WeakMap},5605:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const o=r(6568),s=r(286),a=r(2654),c=r(9925),u=r(6209);t.Provider=class{get rpc(){return this.context.rpc}get signer(){return this.context.signer}constructor(e){this.context=e}forge(e){return n(this,arguments,void 0,(function*({opOb:{branch:e,contents:t,protocol:r},counter:n}){return{opbytes:yield this.context.forger.forge({branch:e,contents:t}),opOb:{branch:e,contents:t,protocol:r},counter:n}}))}estimate(e,t){return n(this,void 0,void 0,(function*(){var{fee:r,gasLimit:n,storageLimit:o}=e,a=i(e,["fee","gasLimit","storageLimit"]);let c=r,u=n,l=o;if(c&&c%1!=0)throw new s.InvalidEstimateValueError(`Fee value must not be a decimal: ${c}`);if(u&&u%1!=0)throw new s.InvalidEstimateValueError(`Gas Limit value must not be a decimal: ${u}`);if(l&&l%1!=0)throw new s.InvalidEstimateValueError(`Storage Limit value must not be a decimal: ${l}`);if(void 0===r||void 0===n||void 0===o){const e=yield t(Object.assign({fee:r,gasLimit:n,storageLimit:o},a));null!=c||(c=e.suggestedFeeMutez),null!=u||(u=e.gasLimit),null!=l||(l=e.storageLimit)}return{fee:c,gasLimit:u,storageLimit:l}}))}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case c.OpKind.TRANSACTION:return(0,a.createTransferOperation)(Object.assign({},e));case c.OpKind.ORIGINATION:return(0,a.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case c.OpKind.DELEGATION:return(0,a.createSetDelegateOperation)(Object.assign({},e));case c.OpKind.REGISTER_GLOBAL_CONSTANT:return(0,a.createRegisterGlobalConstantOperation)(Object.assign({},e));case c.OpKind.INCREASE_PAID_STORAGE:return(0,a.createIncreasePaidStorageOperation)(Object.assign({},e));case c.OpKind.TRANSFER_TICKET:return(0,a.createTransferTicketOperation)(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:return(0,a.createSmartRollupAddMessagesOperation)(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ORIGINATE:return(0,a.createSmartRollupOriginateOperation)(Object.assign({},e));case c.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return(0,a.createSmartRollupExecuteOutboxMessageOperation)(Object.assign({},e));default:throw new u.InvalidOperationKindError(e.kind)}}))}runOperation(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.runOperation(e),op:e,context:this.context.clone()}}))}simulate(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.simulateOperation(e),op:e,context:this.context.clone()}}))}isRevealOpNeeded(e,t){return n(this,void 0,void 0,(function*(){return!(!(yield this.isAccountRevealRequired(t))||!this.isRevealRequiredForOpType(e))}))}isAccountRevealRequired(e){return n(this,void 0,void 0,(function*(){return!(yield this.context.readProvider.isAccountRevealed(e,"head"))}))}isRevealRequiredForOpType(e){let t=!1;for(const r of e)(0,o.isOpRequireReveal)(r)&&(t=!0);return t}signAndInject(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.sign(e.opbytes,new Uint8Array([3]));e.opbytes=t.sbytes,e.opOb.signature=t.prefixSig;const r=[],n=yield this.rpc.preapplyOperations([e.opOb]);if(!Array.isArray(n))throw new s.TezosPreapplyFailureError(n);for(let e=0;e<n.length;e++)for(let t=0;t<n[e].contents.length;t++)r.push(n[e].contents[t]);const i=(0,s.flattenErrors)(n);if(i.length)throw new s.TezosOperationError(i,"Error occurred during validation simulation of operation",r);return{hash:yield this.context.injector.inject(e.opbytes),forgedBytes:e,opResponse:r,context:this.context.clone()}}))}}},4631:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcReadAdapter=void 0;t.RpcReadAdapter=class{constructor(e){this.rpc=e}getBalance(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBalance(e,{block:String(t)})}))}getSpendable(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSpendable(e,{block:String(t)})}))}getDelegate(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getDelegate(e,{block:String(t)})}))}getNextProtocol(e){return r(this,void 0,void 0,(function*(){return(yield this.rpc.getProtocols({block:String(e)})).next_protocol}))}getProtocolConstants(e){return r(this,void 0,void 0,(function*(){const{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,smart_rollup_origination_size:a}=yield this.rpc.getConstants({block:String(e)});return{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,smart_rollup_origination_size:a}}))}getScript(e,t){return r(this,void 0,void 0,(function*(){const{script:r}=yield this.rpc.getContract(e,{block:String(t)});return r}))}getStorage(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getStorage(e,{block:String(t)})}))}getBlockHash(e){return r(this,void 0,void 0,(function*(){const{hash:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBlockLevel(e){return r(this,void 0,void 0,(function*(){const{level:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getCounter(e,t){return r(this,void 0,void 0,(function*(){const{counter:r}=yield this.rpc.getContract(e,{block:String(t)});return r||"0"}))}getBlockTimestamp(e){return r(this,void 0,void 0,(function*(){const{timestamp:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBigMapValue(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBigMapExpr(e.id,e.expr,{block:String(t)})}))}getSaplingDiffById(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffById(e.id,{block:String(t)})}))}getSaplingDiffByContract(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffByContract(e,{block:String(t)})}))}getEntrypoints(e){return r(this,void 0,void 0,(function*(){return this.rpc.getEntrypoints(e)}))}getChainId(){return r(this,void 0,void 0,(function*(){return this.rpc.getChainId()}))}isAccountRevealed(e,t){return r(this,void 0,void 0,(function*(){const r=yield this.rpc.getManagerKey(e,{block:String(t)});return r&&"object"==typeof r?!!r.key:!!r}))}getBlock(e){return r(this,void 0,void 0,(function*(){return this.rpc.getBlock({block:String(e)})}))}getLiveBlocks(e){return this.rpc.getLiveBlocks({block:String(e)})}getAdaptiveIssuanceLaunchCycle(e){return this.rpc.getAdaptiveIssuanceLaunchCycle({block:String(e)})}}},1102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredSignerError=void 0;const n=r(6571);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredSignerError",this.message="No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."}}t.UnconfiguredSignerError=i},2029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6425:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopSigner=void 0;const i=r(1102);t.NoopSigner=class{publicKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}publicKeyHash(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}secretKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}sign(e,t){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}}},9940:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObservableFromSubscription=function(e){return new n.Observable((t=>(e.on("data",(e=>{t.next(e)})),e.on("error",(e=>{t.error(e)})),e.on("close",(()=>{t.complete()})),()=>{e.close()})))};const n=r(8813)},4938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidFilterExpressionError=t.UnsupportedEventError=void 0;const n=r(6571);class i extends n.ParameterValidationError{constructor(e){super(),this.type=e,this.name="UnsupportedEventError",this.message=`Unsupported event type "${e}" expecting one of the "data", "error", or "close".`}}t.UnsupportedEventError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.invalidExpression=e,this.name="InvalidFilterExpressionError",this.message="Invalid filter expression expecting the object to contain either and/or property"}}t.InvalidFilterExpressionError=o},8706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateFilter=t.evaluateExpression=t.evaluateOpFilter=t.eventFilter=void 0;const n=r(4938);t.eventFilter=(e,t,r,n)=>"event"===e.kind&&((!r||e.tag===r)&&((!t||e.source===t)&&(!n||"applied"===e.result.status)));t.evaluateOpFilter=(e,t)=>"opHash"in t?((e,t)=>e.hash===t.opHash)(e,t):"source"in t?((e,t)=>{switch(e.kind){case"attestation":return"metadata"in e&&e.metadata.delegate===t.source;case"activate_account":return"metadata"in e&&e.pkh===t.source;default:return"source"in e&&e.source===t.source}})(e,t):"kind"in t?((e,t)=>"kind"in e&&e.kind===t.kind)(e,t):"destination"in t&&((e,t)=>{switch(e.kind){case"delegation":return e.delegate===t.destination;case"origination":if("metadata"in e&&"operation_result"in e.metadata&&"originated_contracts"in e.metadata.operation_result&&Array.isArray(e.metadata.operation_result.originated_contracts))return e.metadata.operation_result.originated_contracts.some((e=>e===t.destination));break;case"transaction":return e.destination===t.destination;default:return!1}})(e,t);t.evaluateExpression=(e,r)=>{if(Array.isArray(r.and))return r.and.every((r=>(0,t.evaluateFilter)(e,r)));if(Array.isArray(r.or))return r.or.some((r=>(0,t.evaluateFilter)(e,r)));throw new n.InvalidFilterExpressionError(r)};t.evaluateFilter=(e,r)=>{const n=[];return Array.isArray(r)?n.push(...r):n.push(r),n.every((r=>"and"in r||"or"in r?(0,t.evaluateExpression)(e,r):(0,t.evaluateOpFilter)(e,r)))}},2422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableSubscription=t.UnsupportedEventError=void 0;const n=r(8813),i=r(9419),o=r(4938);var s=r(4938);Object.defineProperty(t,"UnsupportedEventError",{enumerable:!0,get:function(){return s.UnsupportedEventError}});t.ObservableSubscription=class{constructor(e,t=!1,r=(0,i.retry)()){this.shouldRetry=t,this.operatorFunction=r,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new n.Subject,e.pipe((0,i.takeUntil)(this.completed$),(0,i.tap)((e=>{this.call(this.messageListeners,e)}),(e=>{this.call(this.errorListeners,e)}),(()=>{this.call(this.closeListeners)})),this.shouldRetry?r:(0,i.tap)(),(0,i.catchError)((()=>n.NEVER))).subscribe()}call(e,t){for(const r of e)try{r(t)}catch(e){console.error(e)}}remove(e,t){const r=e.indexOf(t);-1!==r&&e.splice(r,1)}on(e,t){switch(e){case"data":this.messageListeners.push(t);break;case"error":this.errorListeners.push(t);break;case"close":this.closeListeners.push(t);break;default:throw new o.UnsupportedEventError(e)}}off(e,t){switch(e){case"data":this.remove(this.messageListeners,t);break;case"error":this.remove(this.errorListeners,t);break;case"close":this.remove(this.closeListeners,t);break;default:throw new o.UnsupportedEventError(e)}}close(){this.completed$.next()}}},8648:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingSubscribeProvider=t.defaultConfigStreamer=void 0;const i=r(8813),o=r(9419),s=r(8706),a=r(4040),c=r(5553);t.defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:(0,o.retry)()};t.PollingSubscribeProvider=class{constructor(e,r={}){this.context=e,this._config$=new i.BehaviorSubject(Object.assign(Object.assign({},t.defaultConfigStreamer),r)),this.timer$=this._config$.pipe((0,o.pluck)("pollingIntervalMilliseconds"),(0,o.switchMap)((e=>e?(0,i.timer)(0,e):(0,i.from)(this.getConfirmationPollingInterval()).pipe((0,o.switchMap)((e=>(0,i.timer)(0,e))))))),this.newBlock$=this.timer$.pipe((0,o.switchMap)((()=>(e=>(0,i.from)(e.rpc.getBlock()).pipe((0,o.first)()))(this.context))),(0,o.distinctUntilKeyChanged)("hash"),(0,o.publish)(),(0,o.refCount)())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return n(this,void 0,void 0,(function*(){if(!this.config.pollingIntervalMilliseconds){const e=5e3,t=1e3;try{const r=yield this.context.readProvider.getProtocolConstants("head"),n=(r.minimal_block_delay?r.minimal_block_delay.multipliedBy(1e3):new c.default(e)).dividedBy(3);this.config.pollingIntervalMilliseconds=0===n.toNumber()?t:n.toNumber()}catch(t){return e}}return this.config.pollingIntervalMilliseconds}))}subscribeBlock(e){return new a.ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(e){return new a.ObservableSubscription(this.newBlock$.pipe((0,o.pluck)("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(e){return new a.ObservableSubscription(this.newBlock$.pipe((e=>(0,o.concatMap)((t=>new i.Observable((r=>{for(const n of t.operations)for(const t of n)for(const n of t.contents)(0,s.evaluateFilter)(Object.assign({hash:t.hash},n),e)&&r.next(Object.assign({hash:t.hash},n));r.complete()})))))(e)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(e){return new a.ObservableSubscription(this.newBlock$.pipe((t=e,(0,o.concatMap)((e=>new i.Observable((r=>{for(const n of e.operations)for(const i of n)for(const n of i.contents){const o=n.metadata.internal_operation_results;if(o)for(const n of o)(0,s.eventFilter)(n,null==t?void 0:t.address,null==t?void 0:t.tag,null==t?void 0:t.excludeFailedOperations)&&r.next(Object.assign({opHash:i.hash,blockHash:e.hash,level:e.header.level},n))}r.complete()})))))),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction);var t}}},4779:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.TezosToolkit=t.TaquitoLocalForger=t.RpcReadAdapter=t.ObservableSubscription=t.PollingSubscribeProvider=t.OperationBatch=t.RpcForger=t.CompositeForger=t.UnitValue=t.MichelsonMap=t.Token=void 0;const o=r(9925),s=r(7021),a=r(6209),c=r(8320),u=r(577),l=r(4631),d=r(6425),f=r(8648),h=r(4982),p=r(1170),b=r(6343),m=r(8541),g=r(2245),v=r(1157);var y=r(1157);Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return y.Token}}),Object.defineProperty(t,"MichelsonMap",{enumerable:!0,get:function(){return y.MichelsonMap}}),Object.defineProperty(t,"UnitValue",{enumerable:!0,get:function(){return y.UnitValue}}),i(r(5283),t),i(r(7021),t),i(r(2445),t),i(r(9676),t);var _=r(3215);Object.defineProperty(t,"CompositeForger",{enumerable:!0,get:function(){return _.CompositeForger}});var E=r(9719);Object.defineProperty(t,"RpcForger",{enumerable:!0,get:function(){return E.RpcForger}}),i(r(105),t);var w=r(5025);Object.defineProperty(t,"OperationBatch",{enumerable:!0,get:function(){return w.OperationBatch}}),i(r(2029),t),i(r(2422),t);var O=r(8648);Object.defineProperty(t,"PollingSubscribeProvider",{enumerable:!0,get:function(){return O.PollingSubscribeProvider}});var A=r(4040);Object.defineProperty(t,"ObservableSubscription",{enumerable:!0,get:function(){return A.ObservableSubscription}}),i(r(1174),t),i(r(1170),t),i(r(9164),t),i(r(2245),t),i(r(3971),t),i(r(8541),t),i(r(6424),t),i(r(458),t),i(r(4377),t),i(r(577),t),i(r(7771),t),i(r(9185),t),i(r(7157),t);var S=r(4631);Object.defineProperty(t,"RpcReadAdapter",{enumerable:!0,get:function(){return S.RpcReadAdapter}}),i(r(5681),t);var P=r(6343);Object.defineProperty(t,"TaquitoLocalForger",{enumerable:!0,get:function(){return P.TaquitoLocalForger}}),i(r(3682),t);t.TezosToolkit=class{constructor(e){this._rpc=e,this._options={},this.format=a.format,"string"==typeof this._rpc?this._rpcClient=new o.RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new s.Context(e),this._wallet=new p.Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:e,stream:t,signer:r,protocol:n,config:i,forger:o,wallet:s,packer:a,globalConstantsProvider:c,readProvider:u,parserProvider:l,injectorProvider:d}){this.setRpcProvider(e),this.setStreamProvider(t),this.setSignerProvider(r),this.setForgerProvider(o),this.setWalletProvider(s),this.setPackerProvider(a),this.setGlobalConstantsProvider(c),this.setReadProvider(u),this.setParserProvider(l),this.setInjectorProvider(d),this._context.proto=n,i&&this._context.setPartialConfig(i)}setSignerProvider(e){this._options.signer||void 0!==e?void 0!==e&&(this._context.signer=e,this._options.signer=e):(this._context.signer=new d.NoopSigner,this._options.signer=e)}setRpcProvider(e){"string"==typeof e?this._rpcClient=new o.RpcClient(e):void 0===e||(this._rpcClient=e),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(e){if(void 0!==e)this._options.forger=e,this._context.forger=e;else if(void 0===this._options.forger){const e=this.getFactory(b.TaquitoLocalForger)();this._options.forger=e,this._context.forger=e}}setStreamProvider(e){if("string"==typeof e){const t=new f.PollingSubscribeProvider(new s.Context(new o.RpcClient(e)));this._options.stream=t,this._context.stream=t}else if(void 0!==e)this._options.stream=e,this._context.stream=e;else if(void 0===this._options.stream){const e=this.getFactory(f.PollingSubscribeProvider)();this._options.stream=e,this._context.stream=e}}setWalletProvider(e){if(this._options.wallet||void 0!==e)void 0!==e&&(this._options.wallet=e,this._context.walletProvider=e);else{const e=this.getFactory(p.LegacyWalletProvider)();this._options.wallet=e,this._context.walletProvider=e}}setPackerProvider(e){if(this._options.packer||void 0!==e)void 0!==e&&(this._context.packer=e,this._options.packer=e);else{const e=this.getFactory(u.RpcPacker)();this._context.packer=e,this._options.packer=e}}setGlobalConstantsProvider(e){if(this._options.globalConstantsProvider||void 0!==e)void 0!==e&&(this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e);else{const e=new c.NoopGlobalConstantsProvider;this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e}}setReadProvider(e){const t=e||new l.RpcReadAdapter(this._context.rpc);this._options.readProvider=t,this._context.readProvider=t}setParserProvider(e){if(this._options.parserProvider||void 0!==e)void 0!==e&&(this._context.parser=e,this._options.parserProvider=e);else{const e=new m.MichelCodecParser(this._context);this._context.parser=e,this._options.parserProvider=e}}setInjectorProvider(e){if(this._options.injectorProvider||void 0!==e)void 0!==e&&(this._context.injector=e,this._options.injectorProvider=e);else{const e=new g.RpcInjector(this._context);this._context.injector=e,this._options.injectorProvider=e}}setFieldNumberingStrategy(e){v.Token.fieldNumberingStrategy=e}get tz(){return this._context.tz}get contract(){return this._context.contract}get prepare(){return this._context.prepare}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(e){Array.isArray(e)?e.forEach((e=>e.configureContext(this._context))):e.configureContext(this._context)}getFactory(e){return(...t)=>new e(this._context,...t)}getVersionInfo(){return h.VERSION}}},1174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8907:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcTzProvider=void 0;const i=r(1859),o=r(6209),s=r(6571),a=r(5605),c=r(3682);class u extends a.Provider{constructor(e){super(e),this.prepare=new c.PrepareProvider(this.context)}getBalance(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t));return this.context.readProvider.getBalance(e,"head")}))}getSpendable(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t));return this.context.readProvider.getSpendable(e,"head")}))}getDelegate(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t));return this.context.readProvider.getDelegate(e,"head")}))}activate(e,t){return n(this,void 0,void 0,(function*(){const r=(0,o.validateKeyHash)(e);if(r!==o.ValidationResult.VALID)throw new o.InvalidKeyHashError(e,(0,o.invalidDetail)(r));const n=yield this.prepare.activate({pkh:e,secret:t}),s=yield this.forge(n),a=`${s.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new i.Operation(yield this.rpc.injectOperation(a),Object.assign(Object.assign({},s),{opbytes:a}),[],this.context.clone())}))}}t.RpcTzProvider=u},4982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION={commitHash:"37c8a05360ab00dc3b5d1fbc691d0ac571051a32",version:"21.0.3"}},2538:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BatchWalletOperation=void 0;const i=r(9925),o=r(5025),s=r(6568),a=r(3871),c=r(2599);class u extends a.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t,this.getOriginatedContractAddresses=()=>n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e){const t=e.filter((e=>"origination"===e.kind));let r=[];for(const e of t)e.metadata.operation_result.originated_contracts&&(r=[...r,...e.metadata.operation_result.originated_contracts]);return r}throw new c.ObservableError("Unable to fetch operation results")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new c.ObservableError("Unable to fetch operation results")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.operationResults();if(e)return e.filter((e=>-1!==o.BATCH_KINDS.indexOf(e.kind))).map((e=>{if((0,s.hasMetadataWithResult)(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown";throw new c.ObservableError("Unable to fetch operation results")}))}}t.BatchWalletOperation=u},9734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationWalletOperation=void 0;const i=r(9925),o=r(3871),s=r(2599);class a extends o.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}delegationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.DELEGATION));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.delegationOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.DelegationWalletOperation=a},2599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableError=t.ConfirmationUndefinedError=void 0;const n=r(6571);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="ConfirmationUndefinedError",this.message="Default confirmation count can not be undefined"}}t.ConfirmationUndefinedError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ObservableError"}}t.ObservableError=o},6583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageWalletOperation=void 0;const i=r(3871),o=r(9925),s=r(2599);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}increasePaidStorageOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.INCREASE_PAID_STORAGE));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.increasePaidStorageOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.IncreasePaidStorageWalletOperation=a},1170:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1593),t),i(r(3871),t),i(r(122),t),i(r(77),t),i(r(9734),t),i(r(9432),t),i(r(6117),t),i(r(4723),t)},6117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4723:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LegacyWalletProvider=void 0;const i=r(6568);t.LegacyWalletProvider=class{constructor(e){this.context=e}getPKH(){return n(this,void 0,void 0,(function*(){return this.context.signer.publicKeyHash()}))}getPK(){return n(this,void 0,void 0,(function*(){return this.context.signer.publicKey()}))}mapTransferParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapStakeParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapUnstakeParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapFinalizeUnstakeParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapOriginateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.ORIGINATION)}))}mapDelegateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.DELEGATION)}))}mapIncreasePaidStorageWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.INCREASE_PAID_STORAGE)}))}mapTransferTicketParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSFER_TICKET)}))}sendOperations(e){return n(this,void 0,void 0,(function*(){return(yield this.context.batch.batch(e).send()).hash}))}sign(e,t){return n(this,void 0,void 0,(function*(){const{prefixSig:r}=yield this.context.signer.sign(e,t);return r}))}}},808:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OperationFactory=t.createNewPollingBasedHeadObservable=void 0,t.timeoutAfter=b;const i=r(8813),o=r(9419),s=r(9940),a=r(2538),c=r(9734),u=r(6583),l=r(3871),d=r(77),f=r(122),h=r(9432),p=r(4359);function b(e){return function(t){return new i.BehaviorSubject(null).pipe((0,o.timeout)({each:e,with:()=>(0,i.throwError)((()=>new p.ConfirmationTimeoutError("Confirmation polling timed out")))}),(0,o.mergeMap)((()=>t)))}}t.createNewPollingBasedHeadObservable=(e,t,r)=>e.pipe(b(1e3*t.config.confirmationPollingTimeoutSecond),(0,o.share)({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}));t.OperationFactory=class{constructor(e){this.context=e,this.sharedHeadObs=(0,i.defer)((()=>(0,s.createObservableFromSubscription)(this.context.stream.subscribeBlock("head"))))}createNewHeadObservable(){return n(this,void 0,void 0,(function*(){return(0,t.createNewPollingBasedHeadObservable)(this.sharedHeadObs,this.context)}))}createPastBlockWalker(e,t=1){return(0,i.from)(this.context.readProvider.getBlock(e)).pipe((0,o.switchMap)((e=>1===t?(0,i.of)(e):(0,i.range)(e.header.level,t-1).pipe((0,o.startWith)(e),(0,o.concatMap)((e=>n(this,void 0,void 0,(function*(){return this.context.readProvider.getBlock("number"==typeof e?e:e.header.level)}))))))))}createHeadObservableFromConfig(e){return n(this,arguments,void 0,(function*({blockIdentifier:e}){const t=[];return e&&t.push(this.createPastBlockWalker(e)),t.push(yield this.createNewHeadObservable()),(0,i.concat)(...t)}))}createOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new l.WalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createBatchOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new a.BatchWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createTransactionOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new f.TransactionWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createTransferTicketOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new h.TransferTicketWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createDelegationOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new c.DelegationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createOriginationOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new d.OriginationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createIncreasePaidStorageOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new u.IncreasePaidStorageWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}}},3871:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletOperation=void 0;const i=r(8813),o=r(9419),s=r(6854),a=r(6209),c=r(4359),u=r(2599),l=r(6571);t.WalletOperation=class{operationResults(){return n(this,void 0,void 0,(function*(){return this._operationResult.pipe((0,o.first)()).toPromise()}))}receipt(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new u.ObservableError("Unable to get operation results");return(0,s.receiptFromOperation)(e)}))}constructor(e,t,r){if(this.opHash=e,this.context=t,this._newHead$=r,this._operationResult=new i.ReplaySubject(1),this._includedInBlock=new i.ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe((0,o.switchMap)((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return(0,i.range)(n+1,e.header.level-n-1).pipe((0,o.concatMap)((e=>this.context.readProvider.getBlock(e))),(0,o.endWith)(e))})),(0,o.tap)((e=>this.lastHead=e)),(0,o.share)({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),this.confirmed$=this.newHead$.pipe((0,o.map)((e=>{for(const t of e.operations)for(const r of t)if(r.hash===this.opHash)return this._included=!0,this._includedInBlock.next(e),this._operationResult.next(r.contents),e})),(0,o.filter)((e=>void 0!==e)),(0,o.first)(),(0,o.share)({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),(0,a.validateOperation)(this.opHash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.opHash);this.confirmed$.pipe((0,o.first)(),(0,o.catchError)((()=>(0,i.of)(void 0)))).subscribe()}getCurrentConfirmation(){return n(this,void 0,void 0,(function*(){return this._included?(0,i.combineLatest)([this._includedInBlock,(0,i.from)(this.context.readProvider.getBlock("head"))]).pipe((0,o.map)((([e,t])=>t.header.level-e.header.level+1)),(0,o.first)()).toPromise():0}))}isInCurrentBranch(){return n(this,arguments,void 0,(function*(e="head"){if(!this._included)return!0;const t=yield this.context.readProvider.getBlockLevel(e),r=yield this._includedInBlock.pipe((0,o.first)()).toPromise();if(!r)throw new u.ObservableError("Inclusion block is undefined");const n=t-r.header.level;if(n<=0)return!0;const i=Math.min(r.header.level+n,r.header.level+60);return new Set(yield this.context.readProvider.getLiveBlocks(i)).has(r.hash)}))}confirmationObservable(e){if(void 0!==e&&e<1)throw new c.InvalidConfirmationCountError(e);const{defaultConfirmationCount:t}=this.context.config,r=void 0!==e?e:t;if(void 0===r)throw new u.ConfirmationUndefinedError;return(0,i.combineLatest)([this._includedInBlock,this.newHead$]).pipe((0,o.distinctUntilChanged)((([,e],[,t])=>e.hash===t.hash)),(0,o.map)((([e,t])=>({block:t,expectedConfirmation:r,currentConfirmation:t.header.level-e.header.level+1,completed:t.header.level-e.header.level>=r-1,isInCurrentBranch:()=>this.isInCurrentBranch(t.hash)}))),(0,o.takeWhile)((({completed:e})=>!e),!0))}confirmation(e){return this.confirmationObservable(e).toPromise()}}},77:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationWalletOperation=void 0;const i=r(9925),o=r(6568),s=r(3871),a=r(2599);class c extends s.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}originationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return(0,o.findWithKind)(e,i.OpKind.ORIGINATION);throw new a.ObservableError("Unable to fetch operation result")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return(0,o.findWithKind)(e,i.OpKind.REVEAL);throw new a.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.originationOperation();return e?e.metadata.operation_result.status:"unknown"}))}contract(){return n(this,void 0,void 0,(function*(){const e=yield this.originationOperation(),t=((null==e?void 0:e.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(t)}))}}t.OriginationWalletOperation=c},6854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.receiptFromOperation=void 0;const n=r(5553),i=r(5283),o=r(286);t.receiptFromOperation=(e,{ALLOCATION_BURN:t,ORIGINATION_BURN:r}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP});const s=(0,o.flattenOperationResult)({contents:e});let a=new n.default(0),c=new n.default(0),u=new n.default(0),l=new n.default(0),d=new n.default(0),f=new n.default(0);return s.forEach((e=>{u=u.plus(e.fee||0),l=l.plus(Array.isArray(e.originated_contracts)?e.originated_contracts.length*r:0),d=d.plus("allocated_destination_contract"in e?t:0),a=a.plus(e.consumed_milligas||0),f=f.plus("paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0)})),c=c.plus(d).plus(l).plus(f),{totalFee:u,totalMilliGas:a,totalGas:a.dividedBy(1e3),totalStorage:c,totalAllocationBurn:d,totalOriginationBurn:l,totalPaidStorageDiff:f,totalStorageBurn:new n.default(c.multipliedBy(i.COST_PER_BYTE))}}},122:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWalletOperation=void 0;const i=r(3871),o=r(9925),s=r(2599);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.REVEAL))}))}transactionOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.TRANSACTION))}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.transactionOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.TransactionWalletOperation=a},9432:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTicketWalletOperation=void 0;const i=r(3871),o=r(9925),s=r(2599);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.REVEAL))}))}transferTicketOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.TRANSFER_TICKET))}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.transferTicketOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.TransferTicketWalletOperation=a},1593:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.WalletOperationBatch=void 0;const i=r(2445),o=r(6568),s=r(6571),a=r(6209);class c{constructor(e,t){this.walletProvider=e,this.context=t,this.operations=[]}withTransfer(e){const t=(0,a.validateAddress)(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:o.OpKind.TRANSACTION},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,(0,a.invalidDetail)(r));return this.operations.push(Object.assign({kind:o.OpKind.DELEGATION},e)),this}withOrigination(e){return this.operations.push(Object.assign({kind:o.OpKind.ORIGINATION},e)),this}withIncreasePaidStorage(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:o.OpKind.INCREASE_PAID_STORAGE},e)),this}withTransferTicket(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:o.OpKind.TRANSFER_TICKET},e)),this}mapOperation(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case o.OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},e))}))));case o.OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.INCREASE_PAID_STORAGE:return this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));default:throw new s.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case o.OpKind.TRANSACTION:this.withTransfer(t);break;case o.OpKind.ORIGINATION:this.withOrigination(t);break;case o.OpKind.DELEGATION:this.withDelegation(t);break;case o.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;default:throw new s.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(){return n(this,void 0,void 0,(function*(){const e=[];for(const t of this.operations)e.push(yield this.mapOperation(t));const t=yield this.walletProvider.sendOperations(e);return this.context.operationFactory.createBatchOperation(t)}))}}t.WalletOperationBatch=c;t.Wallet=class{constructor(e){this.context=e,this.walletCommand=e=>({send:e})}get walletProvider(){return this.context.walletProvider}pkh(){return n(this,arguments,void 0,(function*({forceRefetch:e}={}){return this._pkh&&!e||(this._pkh=yield this.walletProvider.getPKH()),this._pkh}))}pk(){return n(this,arguments,void 0,(function*({forceRefetch:e}={}){return this._pk&&!e||(this._pk=yield this.walletProvider.getPK()),this._pk}))}originate(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapOriginateParamsToWalletParams((()=>this.context.parser.prepareCodeOrigination(Object.assign({},e)))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createOriginationOperation(r)}))))}setDelegate(e){var t;const r=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,(0,a.invalidDetail)(r));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createDelegationOperation(r)}))))}signFailingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]});return{signature:yield this.walletProvider.sign(n,Uint8Array.from([3])),bytes:n,signedContent:{branch:r,contents:[{kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}registerDelegate(){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return{delegate:yield this.pkh()}})))),t=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createDelegationOperation(t)}))))}transfer(e){const t=(0,a.validateAddress)(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,(0,a.invalidDetail)(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransactionOperation(r)}))))}transferTicket(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapTransferTicketParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransferTicketOperation(r)}))))}stake(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapStakeParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){const t=yield this.pkh();if(e.to||(e.to=t),e.to!==t)throw new s.InvalidStakingAddressError(e.to);return e.parameter={entrypoint:"stake",value:{prim:"Unit"}},e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransactionOperation(r)}))))}unstake(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapUnstakeParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){const t=yield this.pkh();if(e.to||(e.to=t),e.to!==t)throw new s.InvalidStakingAddressError(e.to);return e.parameter={entrypoint:"unstake",value:{prim:"Unit"}},e})))),r=yield this.walletProvider.sendOperations([t]);return yield this.context.operationFactory.createTransactionOperation(r)}))))}finalizeUnstake(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapFinalizeUnstakeParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){const t=yield this.pkh();if(e.to||(e.to=t),e.to!==t)throw new s.InvalidStakingAddressError(e.to);if(e.amount||(e.amount=0),0!==e.amount)throw new s.InvalidFinalizeUnstakeAmountError("Amount must be 0 to finalize unstake.");return e.parameter={entrypoint:"finalize_unstake",value:{prim:"Unit"}},e})))),r=yield this.walletProvider.sendOperations([t]);return yield this.context.operationFactory.createTransactionOperation(r)}))))}increasePaidStorage(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createIncreasePaidStorageOperation(r)}))))}batch(e){const t=new c(this.walletProvider,this.context);return Array.isArray(e)&&t.with(e),t}at(e){return n(this,arguments,void 0,(function*(e,t=e=>e){const r=(0,a.validateContractAddress)(e);if(r!==a.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,a.invalidDetail)(r));const n=this.context.withExtensions().rpc,o=this.context.withExtensions().readProvider,c=yield o.getScript(e,"head"),u=yield o.getEntrypoints(e);return t(new i.ContractAbstraction(e,c,this,this.context.contract,u,n,o),this.context)}))}getPK(){return n(this,void 0,void 0,(function*(){return yield this.pk()}))}}},5423:()=>{},8379:()=>{},3553:()=>{},6483:(e,t,r)=>{"use strict";r.d(t,{A:()=>w,g:()=>E});var n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,l=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=u-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==o(e))throw Error(s+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function v(e){var t=e.c.length-1;return p(e.e/u)==t&&e.c[t]%2!=0}function y(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var E=function e(t){var r,E,w,O,A,S,P,T,R,I,x=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),k=20,L=4,C=-7,N=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,i,s,c,d,f,h,p,b=this;if(!(b instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>D?b.c=b.e=null:e.e<j?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,d=e;d>=10;d/=10,c++);return void(c>D?b.c=b.e=null:(b.e=c,b.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return w(b,p,f);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(d=p.search(/e/i))>0?(c<0&&(c=d),c+=+p.slice(d+1),p=p.substring(0,d)):c<0&&(c=p.length)}else{if(g(t,2,H.length,"Base"),10==t&&G)return q(b=new $(e),k+b.e+1,L);if(p=String(e),f="number"==typeof e){if(0*e!=0)return w(b,p,f,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,$.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=H.slice(0,t),c=d=0,h=p.length;d<h;d++)if(r.indexOf(i=p.charAt(d))<0){if("."==i){if(d>c){c=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,d=-1,c=0;continue}return w(b,String(e),f,t)}f=!1,(c=(p=E(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(d=0;48===p.charCodeAt(d);d++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(d,++h)){if(h-=d,f&&$.DEBUG&&h>15&&(e>l||e!==o(e)))throw Error(a+b.s*e);if((c=c-d-1)>D)b.c=b.e=null;else if(c<j)b.c=[b.e=0];else{if(b.e=c,b.c=[],d=(c+1)%u,c<0&&(d+=u),d<h){for(d&&b.c.push(+p.slice(0,d)),h-=u;d<h;)b.c.push(+p.slice(d,d+=u));d=u-(p=p.slice(d)).length}else d-=h;for(;d--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=L:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=b(e.c),c=1==n||2==n&&(s<=C||s>=N)?y(c,s):_(c,s,"0");else if(o=(e=q(new $(e),t,r)).e,a=(c=b(e.c)).length,1==n||2==n&&(t<=o||o<=C)){for(;a<t;c+="0",a++);c=y(c,o)}else if(t-=s,c=_(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,o=new $(e[0]);i<e.length;i++)(!(n=new $(e[i])).s||(r=m(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function W(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*u-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function q(e,t,r,n){var s,a,l,f,h,p,b,m=e.c,g=d;if(m){e:{for(s=1,f=m[0];f>=10;f/=10,s++);if((a=t-s)<0)a+=u,l=t,h=m[p=0],b=o(h/g[s-l-1]%10);else if((p=i((a+1)/u))>=m.length){if(!n)break e;for(;m.length<=p;m.push(0));h=b=0,s=1,l=(a%=u)-u+1}else{for(h=f=m[p],s=1;f>=10;f/=10,s++);b=(l=(a%=u)-u+s)<0?0:o(h/g[s-l-1]%10)}if(n=n||t<0||null!=m[p+1]||(l<0?h:h%g[s-l-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(a>0?l>0?h/g[s-l]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(u-t%u)%u],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=p,f=1,p--):(m.length=p+1,f=g[u-a],m[p]=l>0?o(h/g[s-l]%g[l])*f:0),n)for(;;){if(0==p){for(a=1,l=m[0];l>=10;l/=10,a++);for(l=m[0]+=f,f=1;l>=10;l/=10,f++);a!=f&&(e.e++,m[0]==c&&(m[0]=1));break}if(m[p]+=f,m[p]!=c)break;m[p--]=0,f=1}for(a=m.length;0===m[--a];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=C||r>=N?y(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(s+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),k=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),L=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),C=r[0],N=r[1]):(g(r,-h,h,t),C=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),j=r[0],D=r[1];else{if(g(r,-h,h,t),!r)throw Error(s+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(s+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(s+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,h,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(s+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(s+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:k,ROUNDING_MODE:L,EXPONENTIAL_AT:[C,N],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-h&&i<=h&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=c||r!==o(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(s+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(O=9007199254740992,A=Math.random()*O&2097151?function(){return o(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,c,l=0,f=[],p=new $(M);if(null==e?e=k:g(e,0,h),a=i(e/u),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)(c=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(c%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(s+"crypto unavailable");for(t=crypto.randomBytes(a*=7);l<a;)(c=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(f.push(c%1e14),l+=7);l=a/7}if(!U)for(;l<a;)(c=A())<9e15&&(f[l++]=c%1e14);for(a=f[--l],e%=u,a&&e&&(c=d[u-e],f[l]=o(a/c)*c);0===f[l];f.pop(),l--);if(l<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=u);for(l=1,c=f[0];c>=10;c/=10,l++);l<u&&(n-=u-l)}return p.e=n,p.c=f,p}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},E=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,d,f,h,p,m,g=n.indexOf("."),v=k,y=L;for(g>=0&&(d=F,F=0,n=n.replace(".",""),h=(m=new $(i)).pow(n.length-g),F=d,m.c=t(_(b(h.c),h.e,"0"),10,o,e),m.e=m.c.length),l=d=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--d];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,m,v,y,o)).c,f=h.r,l=h.e),g=p[u=l+v+1],d=o/2,f=f||u<0||null!=p[u+1],f=y<4?(null!=g||f)&&(0==y||y==(h.s<0?3:2)):g>d||g==d&&(4==y||f||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=f?_(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,f)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(g=0,n="";g<=d;n+=c.charAt(p[g++]));n=_(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%f,l=t/f|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%f)+(n=l*o+(s=e[c]/f|0)*u)%f*f+a)/r|0)+(n/f|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,s,a,l){var d,f,h,b,m,g,v,y,_,E,w,O,A,S,P,T,R,I=n.s==i.s?1:-1,x=n.c,M=i.c;if(!(x&&x[0]&&M&&M[0]))return new $(n.s&&i.s&&(x?!M||x[0]!=M[0]:M)?x&&0==x[0]||!M?0*I:I/0:NaN);for(_=(y=new $(I)).c=[],I=s+(f=n.e-i.e)+1,l||(l=c,f=p(n.e/u)-p(i.e/u),I=I/u|0),h=0;M[h]==(x[h]||0);h++);if(M[h]>(x[h]||0)&&f--,I<0)_.push(1),b=!0;else{for(S=x.length,T=M.length,h=0,I+=2,(m=o(l/(M[0]+1)))>1&&(M=e(M,m,l),x=e(x,m,l),T=M.length,S=x.length),A=T,w=(E=x.slice(0,T)).length;w<T;E[w++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=l/2&&P++;do{if(m=0,(d=t(M,E,T,w))<0){if(O=E[0],T!=w&&(O=O*l+(E[1]||0)),(m=o(O/P))>1)for(m>=l&&(m=l-1),v=(g=e(M,m,l)).length,w=E.length;1==t(g,E,v,w);)m--,r(g,T<v?R:M,v,l),v=g.length,d=1;else 0==m&&(d=m=1),v=(g=M.slice()).length;if(v<w&&(g=[0].concat(g)),r(E,g,w,l),w=E.length,-1==d)for(;t(M,E,T,w)<1;)m++,r(E,T<w?R:M,w,l),w=E.length}else 0===d&&(m++,E=[0]);_[h++]=m,E[0]?E[w++]=x[A]||0:(E=[x[A]],w=1)}while((A++<S||null!=E[0])&&I--);b=null!=E[0],_[0]||_.splice(0,1)}if(l==c){for(h=1,I=_[0];I>=10;I/=10,h++);q(y,s+(y.e=h+f*u-1)+1,a,b)}else y.e=f,y.r=+b;return y}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,w=function(e,t,r,n){var i,o=r?t:t.replace(I,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(S,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(s+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},x.absoluteValue=x.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return m(this,new $(e,t))},x.decimalPlaces=x.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=L:g(t,0,8),q(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/u))*u,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},x.dividedBy=x.div=function(e,t){return r(this,new $(e,t),k,L)},x.dividedToIntegerBy=x.idiv=function(e,t){return r(this,new $(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var r,n,a,c,l,d,f,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(s+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),l?e.s*(2-v(e)):+Z(e))),t?h.mod(t):h;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!d&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return c=p.s<0&&v(e)?-0:0,p.e>-1&&(c=1/c),new $(d?1/c:c);F&&(c=i(F/u+2))}for(l?(r=new $(.5),d&&(e.s=1),f=v(e)):f=(a=Math.abs(+Z(e)))%2,h=new $(M);;){if(f){if(!(h=h.times(p)).c)break;c?h.c.length>c&&(h.c.length=c):n&&(h=h.mod(t))}if(a){if(0===(a=o(a/2)))break;f=a%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=v(e);else{if(0===(a=+Z(e)))break;f=a%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):n&&(p=p.mod(t))}return n?h:(d&&(h=M.div(h)),t?h.mod(t):c?q(h,F,L,undefined):h)},x.integerValue=function(e){var t=new $(this);return null==e?e=L:g(e,0,8),q(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===m(this,new $(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return m(this,new $(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=m(this,new $(e,t)))||0===t},x.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return m(this,new $(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=m(this,new $(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var l=s.e/u,d=e.e/u,f=s.c,h=e.c;if(!l||!d){if(!f||!h)return f?(e.s=-t,e):new $(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new $(f[0]?s:3==L?-0:0)}if(l=p(l),d=p(d),f=f.slice(),a=l-d){for((o=a<0)?(a=-a,i=f):(d=l,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=c-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=c}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--d);return f[0]?W(e,f,d):(e.s=3==L?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},x.multipliedBy=x.times=function(e,t){var r,n,i,o,s,a,l,d,h,b,m,g,v,y,_,E=this,w=E.c,O=(e=new $(e,t)).c;if(!(w&&O&&w[0]&&O[0]))return!E.s||!e.s||w&&!w[0]&&!O||O&&!O[0]&&!w?e.c=e.e=e.s=null:(e.s*=E.s,w&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(E.e/u)+p(e.e/u),e.s*=E.s,(l=w.length)<(b=O.length)&&(v=w,w=O,O=v,i=l,l=b,b=i),i=l+b,v=[];i--;v.push(0));for(y=c,_=f,i=b;--i>=0;){for(r=0,m=O[i]%_,g=O[i]/_|0,o=i+(s=l);o>i;)r=((d=m*(d=w[--s]%_)+(a=g*d+(h=w[s]/_|0)*m)%_*_+v[o]+r)/y|0)+(a/_|0)+g*h,v[o--]=d%y;v[o]=r}return r?++n:v.splice(0,1),W(e,v,n)},x.negated=function(){var e=new $(this);return e.s=-e.s||null,e},x.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/u,s=e.e/u,a=n.c,l=e.c;if(!o||!s){if(!a||!l)return new $(i/0);if(!a[0]||!l[0])return l[0]?e:new $(a[0]?n:0*i)}if(o=p(o),s=p(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=l):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=l.length)<0&&(r=l,l=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+l[t]+i)/c|0,a[t]=c===a[t]?0:a[t]%c;return i&&(a=[i].concat(a),++s),W(e,a,s)},x.precision=x.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,h),null==t?t=L:g(t,0,8),q(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*u+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},x.shiftedBy=function(e){return g(e,-9007199254740991,l),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=k+4,d=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=b(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=p((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=d.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,c)===(t=b(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,n.e+k+2,1),e=!n.times(n).eq(s));break}if(!i&&(q(o,o.e+k+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return q(n,n.e+k+1,L,e)},x.toExponential=function(e,t){return null!=e&&(g(e,0,h),e++),V(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(g(e,0,h),e=e+this.e+1),V(this,e,t)},x.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(s+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",d=a[0],f=a[1],h=i.s<0,p=h?d.slice(1):d,b=p.length;if(u&&(o=c,c=u,u=o,b-=o),c>0&&b>0){for(o=b%c||c,d=p.substr(0,o);o<b;o+=c)d+=l+p.substr(o,c);u>0&&(d+=l+p.slice(o)),h&&(d="-"+d)}n=f?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):d}return(r.prefix||"")+n+(r.suffix||"")},x.toFraction=function(e){var t,n,i,o,a,c,l,f,h,p,m,g,v=this,y=v.c;if(null!=e&&(!(l=new $(e)).isInteger()&&(l.c||1!==l.s)||l.lt(M)))throw Error(s+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+Z(l));if(!y)return new $(v);for(t=new $(M),h=n=new $(M),i=f=new $(M),g=b(y),a=t.e=g.length-v.e-1,t.c[0]=d[(c=a%u)<0?u+c:c],e=!e||l.comparedTo(t)>0?a>0?t:h:l,c=D,D=1/0,l=new $(g),f.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,h=f.plus(p.times(o=h)),f=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(h)),n=n.plus(o.times(i)),f.s=h.s=v.s,m=r(h,i,a*=2,L).minus(v).abs().comparedTo(r(f,n,a,L).minus(v).abs())<1?[h,i]:[f,n],D=c,m},x.toNumber=function(){return+Z(this)},x.toPrecision=function(e,t){return null!=e&&g(e,1,h),V(this,e,t,2)},x.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=C||i>=N?y(b(r.c),i):_(b(r.c),i,"0"):10===e&&G?t=_(b((r=q(new $(r),k+i+1,L)).c),r.e,"0"):(g(e,2,H.length,"Base"),t=E(_(b(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return Z(this)},x._isBigNumber=!0,x[Symbol.toStringTag]="BigNumber",x[Symbol.for("nodejs.util.inspect.custom")]=x.valueOf,null!=t&&$.set(t),$}();const w=E},183:e=>{"use strict";e.exports={rE:"6.6.1"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(4779)})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.taquito=t():e.taquito=t()}(self,(()=>(()=>{var e={8460:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function n(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=n,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){n(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}},6423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=o,t.Chi=function(e,t,r){return e&t^~e&r},t.Maj=function(e,t,r){return e&t^e&r^t&r};const n=r(8460),i=r(9074);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}class s extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);const{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a!==o)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:a}=this;let{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);const u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.HashMD=s},6910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;const n=r(6423),i=r(9074),o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);class c extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=a[e-15],r=a[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;a[e]=o+a[e-7]+n+a[e-16]|0}let{A:r,B:s,C:c,D:u,E:l,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+(0,n.Chi)(l,d,f)+o[e]+a[e]|0,p=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,s,c)|0;h=f,f=d,d=l,l=u+t|0,u=c,c=s,s=r,r=t+p|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,s,c,u,l,d,f,h)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=c;class u extends c{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)((()=>new c)),t.sha224=(0,i.wrapConstructor)((()=>new u))},9074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=o,t.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=o(e[t])},t.bytesToHex=function(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=c(e.charCodeAt(i)),o=c(e.charCodeAt(i+1));if(void 0===r||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+o}return n},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=u,t.toBytes=l,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,i.abytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(l(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(l(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(l(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const n=r(6910),i=r(8460);function o(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>o(e);const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const a={_0:48,_9:57,A:65,F:70,a:97,f:102};function c(e){return e>=a._0&&e<=a._9?e-a._0:e>=a.A&&e<=a.F?e-(a.A-10):e>=a.a&&e<=a.f?e-(a.a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function l(e){return"string"==typeof e&&(e=u(e)),(0,i.abytes)(e),e}t.nextTick=async()=>{};t.Hash=class{clone(){return this._cloneInto()}}},3447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6411);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e/4294967296>>>0,t,r),l(e>>>0,t,r+4),t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),d(e>>>0,t,r),d(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=c,t.readUint32LE=u,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=d,t.writeInt32LE=d,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=f,t.writeInt64BE=f,t.writeUint64LE=h,t.writeInt64LE=h,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n},t.writeUintBE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},1703:(e,t,r)=>{"use strict";var n=r(3447),i=r(8767);t.cS=128,t.On=64,t.J4=64,t.Cc=16,t.wU=16,t.wm=Math.pow(2,32)-1,t.np=255,t._n=255;var o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=[[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6],[22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8],[14,18,6,2,26,24,22,28,4,12,10,20,8,0,30,16],[18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,26],[4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18],[24,10,2,30,28,26,8,20,0,14,12,6,18,4,16,22],[26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20],[12,30,28,18,22,6,0,16,24,4,26,14,2,8,20,10],[20,4,16,8,14,12,2,10,30,22,18,28,6,24,26,0],[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30],[28,20,8,16,18,30,26,12,2,24,0,4,22,14,10,6]],a=function(){function e(e,r){if(void 0===e&&(e=64),this.digestLength=e,this.blockSize=t.cS,this._state=new Int32Array(o),this._buffer=new Uint8Array(t.cS),this._bufferLength=0,this._ctr=new Uint32Array(4),this._flag=new Uint32Array(4),this._lastNode=!1,this._finished=!1,this._vtmp=new Uint32Array(32),this._mtmp=new Uint32Array(32),e<1||e>t.On)throw new Error("blake2b: wrong digest length");r&&this.validateConfig(r);var i=0;r&&r.key&&(i=r.key.length);var s=1,a=1;r&&r.tree&&(s=r.tree.fanout,a=r.tree.maxDepth),this._state[0]^=e|i<<8|s<<16|a<<24,r&&r.tree&&(this._state[1]^=r.tree.leafSize,this._state[2]^=r.tree.nodeOffsetLowBits,this._state[3]^=r.tree.nodeOffsetHighBits,this._state[4]^=r.tree.nodeDepth|r.tree.innerDigestLength<<8,this._lastNode=r.tree.lastNode),r&&r.salt&&(this._state[8]^=n.readUint32LE(r.salt,0),this._state[9]^=n.readUint32LE(r.salt,4),this._state[10]^=n.readUint32LE(r.salt,8),this._state[11]^=n.readUint32LE(r.salt,12)),r&&r.personalization&&(this._state[12]^=n.readUint32LE(r.personalization,0),this._state[13]^=n.readUint32LE(r.personalization,4),this._state[14]^=n.readUint32LE(r.personalization,8),this._state[15]^=n.readUint32LE(r.personalization,12)),this._initialState=new Uint32Array(this._state),r&&r.key&&i>0&&(this._paddedKey=new Uint8Array(t.cS),this._paddedKey.set(r.key),this._buffer.set(this._paddedKey),this._bufferLength=t.cS)}return e.prototype.reset=function(){return this._state.set(this._initialState),this._paddedKey?(this._buffer.set(this._paddedKey),this._bufferLength=t.cS):this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._finished=!1,this},e.prototype.validateConfig=function(e){if(e.key&&e.key.length>t.J4)throw new Error("blake2b: wrong key length");if(e.salt&&e.salt.length!==t.wU)throw new Error("blake2b: wrong salt length");if(e.personalization&&e.personalization.length!==t.Cc)throw new Error("blake2b: wrong personalization length");if(e.tree){if(e.tree.fanout<0||e.tree.fanout>t.np)throw new Error("blake2b: wrong tree fanout");if(e.tree.maxDepth<0||e.tree.maxDepth>t._n)throw new Error("blake2b: wrong tree depth");if(e.tree.leafSize<0||e.tree.leafSize>t.wm)throw new Error("blake2b: wrong leaf size");if(e.tree.innerDigestLength<0||e.tree.innerDigestLength>t.On)throw new Error("blake2b: wrong tree inner digest length")}},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("blake2b: can't update because hash was finished.");var n=t.cS-this._bufferLength,i=0;if(0===r)return this;if(r>n){for(var o=0;o<n;o++)this._buffer[this._bufferLength+o]=e[i+o];this._processBlock(t.cS),i+=n,r-=n,this._bufferLength=0}for(;r>t.cS;){for(o=0;o<t.cS;o++)this._buffer[o]=e[i+o];this._processBlock(t.cS),i+=t.cS,r-=t.cS,this._bufferLength=0}for(o=0;o<r;o++)this._buffer[this._bufferLength+o]=e[i+o];return this._bufferLength+=r,this},e.prototype.finish=function(e){if(!this._finished){for(var r=this._bufferLength;r<t.cS;r++)this._buffer[r]=0;this._flag[0]=4294967295,this._flag[1]=4294967295,this._lastNode&&(this._flag[2]=4294967295,this._flag[3]=4294967295),this._processBlock(this._bufferLength),this._finished=!0}var i=this._buffer.subarray(0,64);for(r=0;r<16;r++)n.writeUint32LE(this._state[r],i,4*r);return e.set(i.subarray(0,e.length)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.clean=function(){i.wipe(this._vtmp),i.wipe(this._mtmp),i.wipe(this._state),i.wipe(this._buffer),i.wipe(this._initialState),this._paddedKey&&i.wipe(this._paddedKey),this._bufferLength=0,i.wipe(this._ctr),i.wipe(this._flag),this._lastNode=!1,this._finished=!1},e.prototype.saveState=function(){if(this._finished)throw new Error("blake2b: cannot save finished state");return{state:new Uint32Array(this._state),buffer:new Uint8Array(this._buffer),bufferLength:this._bufferLength,ctr:new Uint32Array(this._ctr),flag:new Uint32Array(this._flag),lastNode:this._lastNode,paddedKey:this._paddedKey?new Uint8Array(this._paddedKey):void 0,initialState:new Uint32Array(this._initialState)}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._buffer.set(e.buffer),this._bufferLength=e.bufferLength,this._ctr.set(e.ctr),this._flag.set(e.flag),this._lastNode=e.lastNode,this._paddedKey&&i.wipe(this._paddedKey),this._paddedKey=e.paddedKey?new Uint8Array(e.paddedKey):void 0,this._initialState.set(e.initialState),this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),i.wipe(e.buffer),i.wipe(e.initialState),e.paddedKey&&i.wipe(e.paddedKey),e.bufferLength=0,i.wipe(e.ctr),i.wipe(e.flag),e.lastNode=!1},e.prototype._G=function(e,t,r,n,i,o,s,a,c,u,l,d,f){var h=e[t],p=e[o],b=e[r],m=e[s],g=e[n],v=e[a],y=e[i],_=e[c],E=65535&h,w=h>>>16,O=65535&p,A=p>>>16;w+=b>>>16,O+=65535&m,A+=m>>>16,O+=(w+=(E+=65535&b)>>>16)>>>16,E=65535&(h=65535&E|w<<16),w=h>>>16,O=65535&(p=65535&O|(A+=O>>>16)<<16),A=p>>>16,w+=u>>>16,O+=65535&l,A+=l>>>16,h=65535&(E+=65535&u)|(w+=E>>>16)<<16,E=_^=p=65535&(O+=w>>>16)|(A+=O>>>16)<<16,_=y^=h,y=E,E=65535&g,w=g>>>16,O=65535&v,A=v>>>16,w+=y>>>16,O+=65535&_,A+=_>>>16,E=(b^=g=65535&(E+=65535&y)|(w+=E>>>16)<<16)<<8|(m^=v=65535&(O+=w>>>16)|(A+=O>>>16)<<16)>>>24,b=m<<8|b>>>24,m=E,E=65535&h,w=h>>>16,O=65535&p,A=p>>>16,w+=b>>>16,O+=65535&m,A+=m>>>16,O+=(w+=(E+=65535&b)>>>16)>>>16,E=65535&(h=65535&E|w<<16),w=h>>>16,O=65535&(p=65535&O|(A+=O>>>16)<<16),A=p>>>16,w+=d>>>16,O+=65535&f,A+=f>>>16,E=(y^=h=65535&(E+=65535&d)|(w+=E>>>16)<<16)<<16|(_^=p=65535&(O+=w>>>16)|(A+=O>>>16)<<16)>>>16,y=_<<16|y>>>16,_=E,E=65535&g,w=g>>>16,O=65535&v,A=v>>>16,w+=y>>>16,O+=65535&_,A+=_>>>16,E=(m^=v=65535&(O+=(w+=(E+=65535&y)>>>16)>>>16)|(A+=O>>>16)<<16)<<1|(b^=g=65535&E|w<<16)>>>31,b=b<<1|m>>>31,m=E,e[t]=h,e[o]=p,e[r]=b,e[s]=m,e[n]=g,e[a]=v,e[i]=y,e[c]=_},e.prototype._incrementCounter=function(e){for(var t=0;t<3;t++){var r=this._ctr[t]+e;if(this._ctr[t]=r>>>0,this._ctr[t]===r)return;e=1}},e.prototype._processBlock=function(e){this._incrementCounter(e);var t=this._vtmp;t.set(this._state),t.set(o,16),t[24]^=this._ctr[0],t[25]^=this._ctr[1],t[26]^=this._ctr[2],t[27]^=this._ctr[3],t[28]^=this._flag[0],t[29]^=this._flag[1],t[30]^=this._flag[2],t[31]^=this._flag[3];for(var r=this._mtmp,i=0;i<32;i++)r[i]=n.readUint32LE(this._buffer,4*i);for(var a=0;a<12;a++)this._G(t,0,8,16,24,1,9,17,25,r[s[a][0]],r[s[a][0]+1],r[s[a][1]],r[s[a][1]+1]),this._G(t,2,10,18,26,3,11,19,27,r[s[a][2]],r[s[a][2]+1],r[s[a][3]],r[s[a][3]+1]),this._G(t,4,12,20,28,5,13,21,29,r[s[a][4]],r[s[a][4]+1],r[s[a][5]],r[s[a][5]+1]),this._G(t,6,14,22,30,7,15,23,31,r[s[a][6]],r[s[a][6]+1],r[s[a][7]],r[s[a][7]+1]),this._G(t,0,10,20,30,1,11,21,31,r[s[a][8]],r[s[a][8]+1],r[s[a][9]],r[s[a][9]+1]),this._G(t,2,12,22,24,3,13,23,25,r[s[a][10]],r[s[a][10]+1],r[s[a][11]],r[s[a][11]+1]),this._G(t,4,14,16,26,5,15,17,27,r[s[a][12]],r[s[a][12]+1],r[s[a][13]],r[s[a][13]+1]),this._G(t,6,8,18,28,7,9,19,29,r[s[a][14]],r[s[a][14]+1],r[s[a][15]],r[s[a][15]+1]);for(i=0;i<16;i++)this._state[i]^=t[i]^t[i+16]},e}();t.tW=function(e,r,n){void 0===r&&(r=t.On);var i=new a(r,n);i.update(e);var o=i.digest();return i.clean(),o}},7379:(e,t,r)=>{"use strict";t.MX=t.TP=t.wE=t.Ee=void 0;const n=r(7687),i=r(5121),o=r(8767);function s(e){const t=new Float64Array(16);if(e)for(let r=0;r<e.length;r++)t[r]=e[r];return t}t.Ee=64,t.wE=64,t.TP=32;new Uint8Array(32)[0]=9;const a=s(),c=s([1]),u=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t){for(let r=0;r<16;r++)e[r]=0|t[r]}function b(e){let t=1;for(let r=0;r<16;r++){let n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function m(e,t,r){const n=~(r-1);for(let r=0;r<16;r++){const i=n&(e[r]^t[r]);e[r]^=i,t[r]^=i}}function g(e,t){const r=s(),n=s();for(let e=0;e<16;e++)n[e]=t[e];b(n),b(n),b(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);const e=r[15]>>16&1;r[14]&=65535,m(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}function v(e,t){let r=0;for(let n=0;n<32;n++)r|=e[n]^t[n];return(1&r-1>>>8)-1}function y(e,t){const r=new Uint8Array(32),n=new Uint8Array(32);return g(r,e),g(n,t),v(r,n)}function _(e){const t=new Uint8Array(32);return g(t,e),1&t[0]}function E(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function w(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function O(e,t,r){let n,i,o=0,s=0,a=0,c=0,u=0,l=0,d=0,f=0,h=0,p=0,b=0,m=0,g=0,v=0,y=0,_=0,E=0,w=0,O=0,A=0,S=0,P=0,T=0,R=0,I=0,x=0,M=0,k=0,L=0,C=0,N=0,j=r[0],D=r[1],U=r[2],B=r[3],F=r[4],K=r[5],H=r[6],G=r[7],$=r[8],V=r[9],z=r[10],W=r[11],q=r[12],Z=r[13],Y=r[14],J=r[15];n=t[0],o+=n*j,s+=n*D,a+=n*U,c+=n*B,u+=n*F,l+=n*K,d+=n*H,f+=n*G,h+=n*$,p+=n*V,b+=n*z,m+=n*W,g+=n*q,v+=n*Z,y+=n*Y,_+=n*J,n=t[1],s+=n*j,a+=n*D,c+=n*U,u+=n*B,l+=n*F,d+=n*K,f+=n*H,h+=n*G,p+=n*$,b+=n*V,m+=n*z,g+=n*W,v+=n*q,y+=n*Z,_+=n*Y,E+=n*J,n=t[2],a+=n*j,c+=n*D,u+=n*U,l+=n*B,d+=n*F,f+=n*K,h+=n*H,p+=n*G,b+=n*$,m+=n*V,g+=n*z,v+=n*W,y+=n*q,_+=n*Z,E+=n*Y,w+=n*J,n=t[3],c+=n*j,u+=n*D,l+=n*U,d+=n*B,f+=n*F,h+=n*K,p+=n*H,b+=n*G,m+=n*$,g+=n*V,v+=n*z,y+=n*W,_+=n*q,E+=n*Z,w+=n*Y,O+=n*J,n=t[4],u+=n*j,l+=n*D,d+=n*U,f+=n*B,h+=n*F,p+=n*K,b+=n*H,m+=n*G,g+=n*$,v+=n*V,y+=n*z,_+=n*W,E+=n*q,w+=n*Z,O+=n*Y,A+=n*J,n=t[5],l+=n*j,d+=n*D,f+=n*U,h+=n*B,p+=n*F,b+=n*K,m+=n*H,g+=n*G,v+=n*$,y+=n*V,_+=n*z,E+=n*W,w+=n*q,O+=n*Z,A+=n*Y,S+=n*J,n=t[6],d+=n*j,f+=n*D,h+=n*U,p+=n*B,b+=n*F,m+=n*K,g+=n*H,v+=n*G,y+=n*$,_+=n*V,E+=n*z,w+=n*W,O+=n*q,A+=n*Z,S+=n*Y,P+=n*J,n=t[7],f+=n*j,h+=n*D,p+=n*U,b+=n*B,m+=n*F,g+=n*K,v+=n*H,y+=n*G,_+=n*$,E+=n*V,w+=n*z,O+=n*W,A+=n*q,S+=n*Z,P+=n*Y,T+=n*J,n=t[8],h+=n*j,p+=n*D,b+=n*U,m+=n*B,g+=n*F,v+=n*K,y+=n*H,_+=n*G,E+=n*$,w+=n*V,O+=n*z,A+=n*W,S+=n*q,P+=n*Z,T+=n*Y,R+=n*J,n=t[9],p+=n*j,b+=n*D,m+=n*U,g+=n*B,v+=n*F,y+=n*K,_+=n*H,E+=n*G,w+=n*$,O+=n*V,A+=n*z,S+=n*W,P+=n*q,T+=n*Z,R+=n*Y,I+=n*J,n=t[10],b+=n*j,m+=n*D,g+=n*U,v+=n*B,y+=n*F,_+=n*K,E+=n*H,w+=n*G,O+=n*$,A+=n*V,S+=n*z,P+=n*W,T+=n*q,R+=n*Z,I+=n*Y,x+=n*J,n=t[11],m+=n*j,g+=n*D,v+=n*U,y+=n*B,_+=n*F,E+=n*K,w+=n*H,O+=n*G,A+=n*$,S+=n*V,P+=n*z,T+=n*W,R+=n*q,I+=n*Z,x+=n*Y,M+=n*J,n=t[12],g+=n*j,v+=n*D,y+=n*U,_+=n*B,E+=n*F,w+=n*K,O+=n*H,A+=n*G,S+=n*$,P+=n*V,T+=n*z,R+=n*W,I+=n*q,x+=n*Z,M+=n*Y,k+=n*J,n=t[13],v+=n*j,y+=n*D,_+=n*U,E+=n*B,w+=n*F,O+=n*K,A+=n*H,S+=n*G,P+=n*$,T+=n*V,R+=n*z,I+=n*W,x+=n*q,M+=n*Z,k+=n*Y,L+=n*J,n=t[14],y+=n*j,_+=n*D,E+=n*U,w+=n*B,O+=n*F,A+=n*K,S+=n*H,P+=n*G,T+=n*$,R+=n*V,I+=n*z,x+=n*W,M+=n*q,k+=n*Z,L+=n*Y,C+=n*J,n=t[15],_+=n*j,E+=n*D,w+=n*U,O+=n*B,A+=n*F,S+=n*K,P+=n*H,T+=n*G,R+=n*$,I+=n*V,x+=n*z,M+=n*W,k+=n*q,L+=n*Z,C+=n*Y,N+=n*J,o+=38*E,s+=38*w,a+=38*O,c+=38*A,u+=38*S,l+=38*P,d+=38*T,f+=38*R,h+=38*I,p+=38*x,b+=38*M,m+=38*k,g+=38*L,v+=38*C,y+=38*N,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-65536*i,n=s+i+65535,i=Math.floor(n/65536),s=n-65536*i,n=a+i+65535,i=Math.floor(n/65536),a=n-65536*i,n=c+i+65535,i=Math.floor(n/65536),c=n-65536*i,n=u+i+65535,i=Math.floor(n/65536),u=n-65536*i,n=l+i+65535,i=Math.floor(n/65536),l=n-65536*i,n=d+i+65535,i=Math.floor(n/65536),d=n-65536*i,n=f+i+65535,i=Math.floor(n/65536),f=n-65536*i,n=h+i+65535,i=Math.floor(n/65536),h=n-65536*i,n=p+i+65535,i=Math.floor(n/65536),p=n-65536*i,n=b+i+65535,i=Math.floor(n/65536),b=n-65536*i,n=m+i+65535,i=Math.floor(n/65536),m=n-65536*i,n=g+i+65535,i=Math.floor(n/65536),g=n-65536*i,n=v+i+65535,i=Math.floor(n/65536),v=n-65536*i,n=y+i+65535,i=Math.floor(n/65536),y=n-65536*i,n=_+i+65535,i=Math.floor(n/65536),_=n-65536*i,o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=h,e[9]=p,e[10]=b,e[11]=m,e[12]=g,e[13]=v,e[14]=y,e[15]=_}function A(e,t){O(e,t,t)}function S(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)A(r,r),2!==n&&4!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function P(e,t){const r=s(),n=s(),i=s(),o=s(),a=s(),c=s(),u=s(),d=s(),f=s();w(r,e[1],e[0]),w(f,t[1],t[0]),O(r,r,f),E(n,e[0],e[1]),E(f,t[0],t[1]),O(n,n,f),O(i,e[3],t[3]),O(i,i,l),O(o,e[2],t[2]),E(o,o,o),w(a,n,r),w(c,o,i),E(u,o,i),E(d,n,r),O(e[0],a,c),O(e[1],d,u),O(e[2],u,c),O(e[3],a,d)}function T(e,t,r){for(let n=0;n<4;n++)m(e[n],t[n],r)}function R(e,t){const r=s(),n=s(),i=s();S(i,t[2]),O(r,t[0],i),O(n,t[1],i),g(e,n),e[31]^=_(r)<<7}function I(e,t,r){p(e[0],a),p(e[1],c),p(e[2],c),p(e[3],a);for(let n=255;n>=0;--n){const i=r[n/8|0]>>(7&n)&1;T(e,t,i),P(t,e),P(e,e),T(e,t,i)}}function x(e,t){const r=[s(),s(),s(),s()];p(r[0],d),p(r[1],f),p(r[2],c),O(r[3],d,f),I(e,r,t)}function M(e){if(e.length!==t.TP)throw new Error(`ed25519: seed must be ${t.TP} bytes`);const r=(0,i.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;const n=new Uint8Array(32),o=[s(),s(),s(),s()];x(o,r),R(n,o);const a=new Uint8Array(64);return a.set(e),a.set(n,32),{publicKey:n,secretKey:a}}const k=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function L(e,t){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*k[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*k[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*k[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function C(e){const t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;L(e,t)}function N(e,t){const r=s(),n=s(),i=s(),o=s(),l=s(),d=s(),f=s();return p(e[2],c),function(e,t){for(let r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),A(i,e[1]),O(o,i,u),w(i,i,e[2]),E(o,e[2],o),A(l,o),A(d,l),O(f,d,l),O(r,f,i),O(r,r,o),function(e,t){const r=s();let n;for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)A(r,r),1!==n&&O(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(r,r),O(r,r,i),O(r,r,o),O(r,r,o),O(e[0],r,o),A(n,e[0]),O(n,n,o),y(n,i)&&O(e[0],e[0],h),A(n,e[0]),O(n,n,o),y(n,i)?-1:(_(e[0])===t[31]>>7&&w(e[0],a,e[0]),O(e[3],e[0],e[1]),0)}t.MX=function(e,r,n){const o=new Uint8Array(32),a=[s(),s(),s(),s()],c=[s(),s(),s(),s()];if(n.length!==t.Ee)throw new Error(`ed25519: signature must be ${t.Ee} bytes`);if(N(c,e))return!1;const u=new i.SHA512;u.update(n.subarray(0,32)),u.update(e),u.update(r);const l=u.digest();return C(l),I(a,c,l),x(c,n.subarray(32)),P(a,c),R(o,a),!v(n,o)}},6411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},7687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const n=r(7841),i=r(3447),o=r(8767);function s(e,r=t.defaultRandomSource){return r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e=t.defaultRandomSource){const r=s(4,e),n=(0,i.readUint32LE)(r);return(0,o.wipe)(r),n};const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,r=a,n=t.defaultRandomSource){if(r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");let i="";const c=r.length,u=256-256%c;for(;e>0;){const t=s(Math.ceil(256*e/u),n);for(let n=0;n<t.length&&e>0;n++){const o=t[n];o<u&&(i+=r.charAt(o%c),e--)}(0,o.wipe)(t)}return i}t.randomString=c,t.randomStringForEntropy=function(e,r=a,n=t.defaultRandomSource){return c(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}},4262:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;t.BrowserRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}},1052:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;const n=r(8767);t.NodeRandomSource=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{const e=r(5423);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const r=new Uint8Array(e);for(let e=0;e<r.length;e++)r[e]=t[e];return(0,n.wipe)(t),r}}},7841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;const n=r(4262),i=r(1052);t.SystemRandomSource=class{constructor(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}},5121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3447),i=r(8767);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%128<112?128:256;this._buffer[r]=128;for(var c=r+1;c<s-8;c++)this._buffer[c]=0;n.writeUint32BE(i,this._buffer,s-8),n.writeUint32BE(o,this._buffer,s-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,s),this._finished=!0}for(c=0;c<this.digestLength/8;c++)n.writeUint32BE(this._stateHi[c],e,8*c),n.writeUint32BE(this._stateLo[c],e,8*c+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,o,a,c){for(var u,l,d,f,h,p,b,m,g=r[0],v=r[1],y=r[2],_=r[3],E=r[4],w=r[5],O=r[6],A=r[7],S=i[0],P=i[1],T=i[2],R=i[3],I=i[4],x=i[5],M=i[6],k=i[7];c>=128;){for(var L=0;L<16;L++){var C=8*L+a;e[L]=n.readUint32BE(o,C),t[L]=n.readUint32BE(o,C+4)}for(L=0;L<80;L++){var N,j,D=g,U=v,B=y,F=_,K=E,H=w,G=O,$=S,V=P,z=T,W=R,q=I,Z=x,Y=M;if(h=65535&(l=k),p=l>>>16,b=65535&(u=A),m=u>>>16,h+=65535&(l=(I>>>14|E<<18)^(I>>>18|E<<14)^(E>>>9|I<<23)),p+=l>>>16,b+=65535&(u=(E>>>14|I<<18)^(E>>>18|I<<14)^(I>>>9|E<<23)),m+=u>>>16,h+=65535&(l=I&x^~I&M),p+=l>>>16,b+=65535&(u=E&w^~E&O),m+=u>>>16,u=s[2*L],h+=65535&(l=s[2*L+1]),p+=l>>>16,b+=65535&u,m+=u>>>16,u=e[L%16],p+=(l=t[L%16])>>>16,b+=65535&u,m+=u>>>16,b+=(p+=(h+=65535&l)>>>16)>>>16,h=65535&(l=f=65535&h|p<<16),p=l>>>16,b=65535&(u=d=65535&b|(m+=b>>>16)<<16),m=u>>>16,h+=65535&(l=(S>>>28|g<<4)^(g>>>2|S<<30)^(g>>>7|S<<25)),p+=l>>>16,b+=65535&(u=(g>>>28|S<<4)^(S>>>2|g<<30)^(S>>>7|g<<25)),m+=u>>>16,p+=(l=S&P^S&T^P&T)>>>16,b+=65535&(u=g&v^g&y^v&y),m+=u>>>16,N=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,j=65535&h|p<<16,h=65535&(l=W),p=l>>>16,b=65535&(u=F),m=u>>>16,p+=(l=f)>>>16,b+=65535&(u=d),m+=u>>>16,v=D,y=U,_=B,E=F=65535&(b+=(p+=(h+=65535&l)>>>16)>>>16)|(m+=b>>>16)<<16,w=K,O=H,A=G,g=N,P=$,T=V,R=z,I=W=65535&h|p<<16,x=q,M=Z,k=Y,S=j,L%16==15)for(C=0;C<16;C++)u=e[C],h=65535&(l=t[C]),p=l>>>16,b=65535&u,m=u>>>16,u=e[(C+9)%16],h+=65535&(l=t[(C+9)%16]),p+=l>>>16,b+=65535&u,m+=u>>>16,d=e[(C+1)%16],h+=65535&(l=((f=t[(C+1)%16])>>>1|d<<31)^(f>>>8|d<<24)^(f>>>7|d<<25)),p+=l>>>16,b+=65535&(u=(d>>>1|f<<31)^(d>>>8|f<<24)^d>>>7),m+=u>>>16,d=e[(C+14)%16],p+=(l=((f=t[(C+14)%16])>>>19|d<<13)^(d>>>29|f<<3)^(f>>>6|d<<26))>>>16,b+=65535&(u=(d>>>19|f<<13)^(f>>>29|d<<3)^d>>>6),m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,e[C]=65535&b|m<<16,t[C]=65535&h|p<<16}h=65535&(l=S),p=l>>>16,b=65535&(u=g),m=u>>>16,u=r[0],p+=(l=i[0])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[0]=g=65535&b|m<<16,i[0]=S=65535&h|p<<16,h=65535&(l=P),p=l>>>16,b=65535&(u=v),m=u>>>16,u=r[1],p+=(l=i[1])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[1]=v=65535&b|m<<16,i[1]=P=65535&h|p<<16,h=65535&(l=T),p=l>>>16,b=65535&(u=y),m=u>>>16,u=r[2],p+=(l=i[2])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[2]=y=65535&b|m<<16,i[2]=T=65535&h|p<<16,h=65535&(l=R),p=l>>>16,b=65535&(u=_),m=u>>>16,u=r[3],p+=(l=i[3])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[3]=_=65535&b|m<<16,i[3]=R=65535&h|p<<16,h=65535&(l=I),p=l>>>16,b=65535&(u=E),m=u>>>16,u=r[4],p+=(l=i[4])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[4]=E=65535&b|m<<16,i[4]=I=65535&h|p<<16,h=65535&(l=x),p=l>>>16,b=65535&(u=w),m=u>>>16,u=r[5],p+=(l=i[5])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[5]=w=65535&b|m<<16,i[5]=x=65535&h|p<<16,h=65535&(l=M),p=l>>>16,b=65535&(u=O),m=u>>>16,u=r[6],p+=(l=i[6])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[6]=O=65535&b|m<<16,i[6]=M=65535&h|p<<16,h=65535&(l=k),p=l>>>16,b=65535&(u=A),m=u>>>16,u=r[7],p+=(l=i[7])>>>16,b+=65535&u,m+=u>>>16,m+=(b+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,r[7]=A=65535&b|m<<16,i[7]=k=65535&h|p<<16,a+=128,c-=128}return a}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},8767:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},7403:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*c+1>>>0,u=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=s*u[f]>>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,r++}for(var h=o-i;h!==o&&0===u[h];)h++;for(var p=new Uint8Array(n+(o-h)),b=n;h!==o;)p[b++]=u[h++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var d=t[i],f=0,h=c-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*l[h]>>>0,l[h]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");n=f,i++}for(var p=c-n;p!==c&&0===l[p];)p++;for(var b=a.repeat(r);p<c;++p)b+=e.charAt(l[p]);return b},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),l=0,d=c>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5553:function(e,t,r){var n;!function(){"use strict";var i,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,a=Math.floor,c="[BigNumber Error] ",u=c+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,f=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,b=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function g(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function y(e,t,r,n){if(e<t||e>r||e!==a(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var r,n,i,O,A,S,P,T,R,I,x=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),k=20,L=4,C=-7,N=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,s,c,l,h,p,b,m,g=this;if(!(g instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>D?g.c=g.e=null:e.e<j?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,h=e;h>=10;h/=10,l++);return void(l>D?g.c=g.e=null:(g.e=l,g.c=[e]))}m=String(e)}else{if(!o.test(m=String(e)))return i(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(l=m.indexOf("."))>-1&&(m=m.replace(".","")),(h=m.search(/e/i))>0?(l<0&&(l=h),l+=+m.slice(h+1),m=m.substring(0,h)):l<0&&(l=m.length)}else{if(y(t,2,H.length,"Base"),10==t&&G)return q(g=new $(e),k+g.e+1,L);if(m=String(e),p="number"==typeof e){if(0*e!=0)return i(g,m,p,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,$.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=H.slice(0,t),l=h=0,b=m.length;h<b;h++)if(r.indexOf(s=m.charAt(h))<0){if("."==s){if(h>l){l=b;continue}}else if(!c&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){c=!0,h=-1,l=0;continue}return i(g,String(e),p,t)}p=!1,(l=(m=n(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):l=m.length}for(h=0;48===m.charCodeAt(h);h++);for(b=m.length;48===m.charCodeAt(--b););if(m=m.slice(h,++b)){if(b-=h,p&&$.DEBUG&&b>15&&(e>f||e!==a(e)))throw Error(u+g.s*e);if((l=l-h-1)>D)g.c=g.e=null;else if(l<j)g.c=[g.e=0];else{if(g.e=l,g.c=[],h=(l+1)%d,l<0&&(h+=d),h<b){for(h&&g.c.push(+m.slice(0,h)),b-=d;h<b;)g.c.push(+m.slice(h,h+=d));h=d-(m=m.slice(h)).length}else h-=b;for(;h--;m+="0");g.c.push(+m)}}else g.c=[g.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=L:y(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=g(e.c),c=1==n||2==n&&(s<=C||s>=N)?E(c,s):w(c,s,"0");else if(o=(e=q(new $(e),t,r)).e,a=(c=g(e.c)).length,1==n||2==n&&(t<=o||o<=C)){for(;a<t;c+="0",a++);c=E(c,o)}else if(t-=s,c=w(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,o=new $(e[0]);i<e.length;i++)(!(n=new $(e[i])).s||(r=v(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function W(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function q(e,t,r,n){var i,o,c,u,f,p,b,m=e.c,g=h;if(m){e:{for(i=1,u=m[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=d,c=t,f=m[p=0],b=a(f/g[i-c-1]%10);else if((p=s((o+1)/d))>=m.length){if(!n)break e;for(;m.length<=p;m.push(0));f=b=0,i=1,c=(o%=d)-d+1}else{for(f=u=m[p],i=1;u>=10;u/=10,i++);b=(c=(o%=d)-d+i)<0?0:a(f/g[i-c-1]%10)}if(n=n||t<0||null!=m[p+1]||(c<0?f:f%g[i-c-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(o>0?c>0?f/g[i-c]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==o?(m.length=p,u=1,p--):(m.length=p+1,u=g[d-o],m[p]=c>0?a(f/g[i-c]%g[c])*u:0),n)for(;;){if(0==p){for(o=1,c=m[0];c>=10;c/=10,o++);for(c=m[0]+=u,u=1;c>=10;c/=10,u++);o!=u&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[p]+=u,m[p]!=l)break;m[p--]=0,u=1}for(o=m.length;0===m[--o];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=g(e.c),t=r<=C||r>=N?E(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(r=e[t],0,b,t),k=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(r=e[t],0,8,t),L=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(y(r[0],-b,0,t),y(r[1],0,b,t),C=r[0],N=r[1]):(y(r,-b,b,t),C=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)y(r[0],-b,-1,t),y(r[1],1,b,t),j=r[0],D=r[1];else{if(y(r,-b,b,t),!r)throw Error(c+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(c+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(y(r=e[t],0,b,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:k,ROUNDING_MODE:L,EXPONENTIAL_AT:[C,N],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-b&&i<=b&&i===a(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==a(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(O=9007199254740992,A=Math.random()*O&2097151?function(){return a(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,u=0,l=[],f=new $(M);if(null==e?e=k:y(e,0,b),i=s(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(o=131072*t[u]+(t[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(l.push(o%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u<i;)(o=281474976710656*(31&t[u])+1099511627776*t[u+1]+4294967296*t[u+2]+16777216*t[u+3]+(t[u+4]<<16)+(t[u+5]<<8)+t[u+6])>=9e15?crypto.randomBytes(7).copy(t,u):(l.push(o%1e14),u+=7);u=i/7}if(!U)for(;u<i;)(o=A())<9e15&&(l[u++]=o%1e14);for(i=l[--u],e%=d,i&&e&&(o=h[d-e],l[u]=a(i/o)*o);0===l[u];l.pop(),u--);if(u<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=d);for(u=1,o=l[0];o>=10;o/=10,u++);u<d&&(n-=d-u)}return f.e=n,f.c=l,f}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,d,f,h,p,b,m=n.indexOf("."),v=k,y=L;for(m>=0&&(d=F,F=0,n=n.replace(".",""),h=(b=new $(i)).pow(n.length-m),F=d,b.c=t(w(g(h.c),h.e,"0"),10,o,e),b.e=b.c.length),l=d=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--d];p.pop());if(!p[0])return c.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,b,v,y,o)).c,f=h.r,l=h.e),m=p[u=l+v+1],d=o/2,f=f||u<0||null!=p[u+1],f=y<4?(null!=m||f)&&(0==y||y==(h.s<0?3:2)):m>d||m==d&&(4==y||f||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=f?w(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,f)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(m=0,n="";m<=d;n+=c.charAt(p[m++]));n=w(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%p,l=t/p|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%p)+(n=l*o+(s=e[c]/p|0)*u)%p*p+a)/r|0)+(n/p|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,c){var u,f,h,p,b,g,v,y,_,E,w,O,A,S,P,T,R,I=n.s==i.s?1:-1,x=n.c,M=i.c;if(!(x&&x[0]&&M&&M[0]))return new $(n.s&&i.s&&(x?!M||x[0]!=M[0]:M)?x&&0==x[0]||!M?0*I:I/0:NaN);for(_=(y=new $(I)).c=[],I=o+(f=n.e-i.e)+1,c||(c=l,f=m(n.e/d)-m(i.e/d),I=I/d|0),h=0;M[h]==(x[h]||0);h++);if(M[h]>(x[h]||0)&&f--,I<0)_.push(1),p=!0;else{for(S=x.length,T=M.length,h=0,I+=2,(b=a(c/(M[0]+1)))>1&&(M=e(M,b,c),x=e(x,b,c),T=M.length,S=x.length),A=T,w=(E=x.slice(0,T)).length;w<T;E[w++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=c/2&&P++;do{if(b=0,(u=t(M,E,T,w))<0){if(O=E[0],T!=w&&(O=O*c+(E[1]||0)),(b=a(O/P))>1)for(b>=c&&(b=c-1),v=(g=e(M,b,c)).length,w=E.length;1==t(g,E,v,w);)b--,r(g,T<v?R:M,v,c),v=g.length,u=1;else 0==b&&(u=b=1),v=(g=M.slice()).length;if(v<w&&(g=[0].concat(g)),r(E,g,w,c),w=E.length,-1==u)for(;t(M,E,T,w)<1;)b++,r(E,T<w?R:M,w,c),w=E.length}else 0===u&&(b++,E=[0]);_[h++]=b,E[0]?E[w++]=x[A]||0:(E=[x[A]],w=1)}while((A++<S||null!=E[0])&&I--);p=null!=E[0],_[0]||_.splice(0,1)}if(c==l){for(h=1,I=_[0];I>=10;I/=10,h++);q(y,o+(y.e=h+f*d-1)+1,s,p)}else y.e=f,y.r=+p;return y}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(I,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(S,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},x.absoluteValue=x.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return v(this,new $(e,t))},x.decimalPlaces=x.dp=function(e,t){var r,n,i,o=this;if(null!=e)return y(e,0,b),null==t?t=L:y(t,0,8),q(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-m(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},x.dividedBy=x.div=function(e,t){return r(this,new $(e,t),k,L)},x.dividedToIntegerBy=x.idiv=function(e,t){return r(this,new $(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var r,n,i,o,u,l,f,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),u=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),u?e.s*(2-_(e)):+Z(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||u&&p.c[1]>=24e7:p.c[0]<8e13||u&&p.c[0]<=9999975e7)))return o=p.s<0&&_(e)?-0:0,p.e>-1&&(o=1/o),new $(l?1/o:o);F&&(o=s(F/d+2))}for(u?(r=new $(.5),l&&(e.s=1),f=_(e)):f=(i=Math.abs(+Z(e)))%2,h=new $(M);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=a(i/2)))break;f=i%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=_(e);else{if(0===(i=+Z(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(l&&(h=M.div(h)),t?h.mod(t):o?q(h,F,L,undefined):h)},x.integerValue=function(e){var t=new $(this);return null==e?e=L:y(e,0,8),q(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===v(this,new $(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return v(this,new $(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=v(this,new $(e,t)))||0===t},x.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return v(this,new $(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=v(this,new $(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var c=s.e/d,u=e.e/d,f=s.c,h=e.c;if(!c||!u){if(!f||!h)return f?(e.s=-t,e):new $(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new $(f[0]?s:3==L?-0:0)}if(c=m(c),u=m(u),f=f.slice(),a=c-u){for((o=a<0)?(a=-a,i=f):(u=c,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--u);return f[0]?W(e,f,u):(e.s=3==L?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},x.multipliedBy=x.times=function(e,t){var r,n,i,o,s,a,c,u,f,h,b,g,v,y,_,E=this,w=E.c,O=(e=new $(e,t)).c;if(!(w&&O&&w[0]&&O[0]))return!E.s||!e.s||w&&!w[0]&&!O||O&&!O[0]&&!w?e.c=e.e=e.s=null:(e.s*=E.s,w&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(E.e/d)+m(e.e/d),e.s*=E.s,(c=w.length)<(h=O.length)&&(v=w,w=O,O=v,i=c,c=h,h=i),i=c+h,v=[];i--;v.push(0));for(y=l,_=p,i=h;--i>=0;){for(r=0,b=O[i]%_,g=O[i]/_|0,o=i+(s=c);o>i;)r=((u=b*(u=w[--s]%_)+(a=g*u+(f=w[s]/_|0)*b)%_*_+v[o]+r)/y|0)+(a/_|0)+g*f,v[o--]=u%y;v[o]=r}return r?++n:v.splice(0,1),W(e,v,n)},x.negated=function(){var e=new $(this);return e.s=-e.s||null,e},x.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,s=e.e/d,a=n.c,c=e.c;if(!o||!s){if(!a||!c)return new $(i/0);if(!a[0]||!c[0])return c[0]?e:new $(a[0]?n:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/l|0,a[t]=l===a[t]?0:a[t]%l;return i&&(a=[i].concat(a),++s),W(e,a,s)},x.precision=x.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return y(e,1,b),null==t?t=L:y(t,0,8),q(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},x.shiftedBy=function(e){return y(e,-9007199254740991,f),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=k+4,d=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=g(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=m((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=d.times(o.plus(r(s,o,l,1))),g(o.c).slice(0,c)===(t=g(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,n.e+k+2,1),e=!n.times(n).eq(s));break}if(!i&&(q(o,o.e+k+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return q(n,n.e+k+1,L,e)},x.toExponential=function(e,t){return null!=e&&(y(e,0,b),e++),V(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(y(e,0,b),e=e+this.e+1),V(this,e,t)},x.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",d=s[0],f=s[1],h=i.s<0,p=h?d.slice(1):d,b=p.length;if(u&&(o=a,a=u,u=o,b-=o),a>0&&b>0){for(o=b%a||a,d=p.substr(0,o);o<b;o+=a)d+=l+p.substr(o,a);u>0&&(d+=l+p.slice(o)),h&&(d="-"+d)}n=f?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):d}return(r.prefix||"")+n+(r.suffix||"")},x.toFraction=function(e){var t,n,i,o,s,a,u,l,f,p,b,m,v=this,y=v.c;if(null!=e&&(!(u=new $(e)).isInteger()&&(u.c||1!==u.s)||u.lt(M)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Z(u));if(!y)return new $(v);for(t=new $(M),f=n=new $(M),i=l=new $(M),m=g(y),s=t.e=m.length-v.e-1,t.c[0]=h[(a=s%d)<0?d+a:a],e=!e||u.comparedTo(t)>0?s>0?t:f:u,a=D,D=1/0,u=new $(m),l.c[0]=0;p=r(u,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,f=l.plus(p.times(o=f)),l=o,t=u.minus(p.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=v.s,b=r(f,i,s*=2,L).minus(v).abs().comparedTo(r(l,n,s,L).minus(v).abs())<1?[f,i]:[l,n],D=a,b},x.toNumber=function(){return+Z(this)},x.toPrecision=function(e,t){return null!=e&&y(e,1,b),V(this,e,t,2)},x.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=C||o>=N?E(g(r.c),o):w(g(r.c),o,"0"):10===e&&G?t=w(g((r=q(new $(r),k+o+1,L)).c),r.e,"0"):(y(e,2,H.length,"Base"),t=n(w(g(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return Z(this)},x._isBigNumber=!0,null!=t&&$.set(t),$}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},1049:(e,t,r)=>{const n=r(2694);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,s,a){const c=d[s],u=d[s+1],f=d[a],h=d[a+1];i(l,e,t),o(l,e,c,u);let p=l[n]^l[e],b=l[n+1]^l[e+1];l[n]=b,l[n+1]=p,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=p>>>24^b<<8,l[t+1]=b>>>24^p<<8,i(l,e,t),o(l,e,f,h),p=l[n]^l[e],b=l[n+1]^l[e+1],l[n]=p>>>16^b<<16,l[n+1]=b>>>16^p<<16,i(l,r,n),p=l[t]^l[r],b=l[t+1]^l[r+1],l[t]=b>>>31^p<<1,l[t+1]=p>>>31^b<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),d=new Uint32Array(32);function f(e,t){let r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=c[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)d[r]=s(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}const h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};h.fill(0),h[0]=e,t&&(h[1]=t.length),h[2]=1,h[3]=1,r&&h.set(r,32),n&&h.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^s(h,4*e);return t&&(b(i,t),i.c=128),i}function b(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;f(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function g(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));const s=p(r,t,i,o);return b(s,e),m(s)}e.exports={blake2b:g,blake2bHex:function(e,t,r,i,o){const s=g(e,t,r,i,o);return n.toHex(s)},blake2bInit:p,blake2bUpdate:b,blake2bFinal:m}},4202:(e,t,r)=>{const n=r(2694);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,i,o){u[e]=u[e]+u[t]+i,u[n]=s(u[n]^u[e],16),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],12),u[e]=u[e]+u[t]+o,u[n]=s(u[n]^u[e],8),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],7)}function s(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),l=new Uint32Array(16);function d(e,t){let r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/4294967296,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)o(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),o(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),o(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),o(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),o(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),o(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),o(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),o(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function f(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function b(e,t,r){r=r||32,e=n.normalizeInput(e);const i=f(r,t);return h(i,e),p(i)}e.exports={blake2s:b,blake2sHex:function(e,t,r){const i=b(e,t,r);return n.toHex(i)},blake2sInit:f,blake2sUpdate:h,blake2sFinal:p}},9620:(e,t,r)=>{const n=r(1049),i=r(4202);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},2694:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase(),i+=" ",i+=t(r[o+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[o+1]).toUpperCase(),i+=t(r[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const o=(new Date).getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){const r=e(i),o=(new Date).getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(s/1e3)*100)/100+" MB PER SECOND")}}}},2823:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8379).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:l[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,b=h>>>13,m=0|s[2],g=8191&m,v=m>>>13,y=0|s[3],_=8191&y,E=y>>>13,w=0|s[4],O=8191&w,A=w>>>13,S=0|s[5],P=8191&S,T=S>>>13,R=0|s[6],I=8191&R,x=R>>>13,M=0|s[7],k=8191&M,L=M>>>13,C=0|s[8],N=8191&C,j=C>>>13,D=0|s[9],U=8191&D,B=D>>>13,F=0|a[0],K=8191&F,H=F>>>13,G=0|a[1],$=8191&G,V=G>>>13,z=0|a[2],W=8191&z,q=z>>>13,Z=0|a[3],Y=8191&Z,J=Z>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(d,K))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(f,K)|0))<<13)|0;u=((o=Math.imul(f,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,H))+Math.imul(b,K)|0,o=Math.imul(b,H);var ge=(u+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,$)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,H))+Math.imul(v,K)|0,o=Math.imul(v,H),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,V)|0;var ve=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,W)|0))<<13)|0;u=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,K),i=(i=Math.imul(_,H))+Math.imul(E,K)|0,o=Math.imul(E,H),n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,q)|0;var ye=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(O,K),i=(i=Math.imul(O,H))+Math.imul(A,K)|0,o=Math.imul(A,H),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,q)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0;var _e=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,H))+Math.imul(T,K)|0,o=Math.imul(T,H),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var Ee=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,H))+Math.imul(x,K)|0,o=Math.imul(x,H),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var we=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,K),i=(i=Math.imul(k,H))+Math.imul(L,K)|0,o=Math.imul(L,H),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0;var Oe=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,K),i=(i=Math.imul(N,H))+Math.imul(j,K)|0,o=Math.imul(j,H),n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Ae=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,H))+Math.imul(B,K)|0,o=Math.imul(B,H),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var Se=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,V))+Math.imul(B,$)|0,o=Math.imul(B,V),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Pe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,q))+Math.imul(B,W)|0,o=Math.imul(B,q),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,fe)|0;var Te=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(B,Y)|0,o=Math.imul(B,J),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,fe)|0;var Re=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,be)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(P,de)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(T,de)|0,o=o+Math.imul(T,fe)|0;var Ie=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(B,re)|0,o=Math.imul(B,ne),n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,se)|0,n=n+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var xe=(u+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,be)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(B,oe)|0,o=Math.imul(B,se),n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(j,ce)|0,o=o+Math.imul(j,ue)|0,n=n+Math.imul(k,de)|0,i=(i=i+Math.imul(k,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Me=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,ue))+Math.imul(B,ce)|0,o=Math.imul(B,ue),n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(j,de)|0,o=o+Math.imul(j,fe)|0;var ke=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,de),i=(i=Math.imul(U,fe))+Math.imul(B,de)|0,o=Math.imul(B,fe);var Le=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,be)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Ce=(u+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,be))+Math.imul(B,pe)|0))<<13)|0;return u=((o=Math.imul(B,be))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=Ee,c[6]=we,c[7]=Oe,c[8]=Ae,c[9]=Se,c[10]=Pe,c[11]=Te,c[12]=Re,c[13]=Ie,c[14]=xe,c[15]=Me,c[16]=ke,c[17]=Le,c[18]=Ce,0!==u&&(c[19]=u,r.length++),r};function b(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):b(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=c,f=u,h=0;h<s;h++){var p=r[l+h],b=n[l+h],m=r[l+h+s],g=n[l+h+s],v=d*m-f*g;g=d*g+f*m,m=v,r[l+h]=p+m,n[l+h]=b+g,r[l+h+s]=p-m,n[l+h+s]=b-g,h!==a&&(v=c*d-u*f,f=c*f+u*d,d=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;!(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;!(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;!(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;!(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(E,v),i(w,v),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var b=h,m=0;0!==b.cmp(a);m++)b=b.redSqr();n(m<p);var g=this.pow(d,new o(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},O.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},O.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},i(A,O),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7048:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(3553);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},9216:(e,t,r)=>{const n=r(7403);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},7639:(e,t,r)=>{"use strict";var n=r(9216);e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),i=e(r),o=r.length+4,s=new Uint8Array(o);return s.set(r,0),s.set(i.subarray(0,4),r.length),n.encode(s,o)},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},9848:(e,t,r)=>{"use strict";var{sha256:n}=r(9688),i=r(7639);e.exports=i((function(e){return n(n(e))}))},3360:(e,t,r)=>{"use strict";var n=t;n.version=r(183).rE,n.utils=r(1874),n.rand=r(7048),n.curve=r(7131),n.curves=r(6443),n.ec=r(5064),n.eddsa=r(4807)},5174:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874),o=i.getNAF,s=i.getJSF,a=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,c,u=[];for(s=0;s<n.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+n[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=i;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?f=f.mixedAdd(r.points[s]):c===-h&&(f=f.mixedAdd(r.points[s].neg()));d=d.add(f)}return d.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=s[u];a(0!==d),c="affine"===e.type?d>0?c.mixedAdd(i[d-1>>1]):c.mixedAdd(i[-d-1>>1].neg()):d>0?c.add(i[d-1>>1]):c.add(i[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,d[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,m=a;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=s(r[b],r[m]);for(h=Math.max(y[0].length,h),f[b]=new Array(h),f[m]=new Array(h),c=0;c<h;c++){var _=0|y[0][c],E=0|y[1][c];f[b][c]=v[3*(_+1)+(E+1)],f[m][c]=0,d[b]=g}}else f[b]=o(r[b],l[b],this._bitLength),f[m]=o(r[m],l[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var w=this.jpoint(null,null,null),O=this._wnafT4;for(a=h;a>=0;a--){for(var A=0;a>=0;){var S=!0;for(c=0;c<n;c++)O[c]=0|f[c][a],0!==O[c]&&(S=!1);if(!S)break;A++,a--}if(a>=0&&A++,w=w.dblp(A),a<0)break;for(c=0;c<n;c++){var P=O[c];0!==P&&(P>0?u=d[c][P-1>>1]:P<0&&(u=d[c][-P-1>>1].neg()),w="affine"===u.type?w.mixedAdd(u):w.add(u))}}for(a=0;a<n;a++)d[a]=null;return i?w:w.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1547:(e,t,r)=>{"use strict";var n=r(1874),i=r(2823),o=r(5615),s=r(5174),a=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,l)},u.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),d=o.redMul(c),f=s.redMul(a);return this.curve.point(u,l,f,d)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},7131:(e,t,r)=>{"use strict";var n=t;n.base=r(5174),n.short=r(277),n.mont=r(3245),n.edwards=r(1547)},3245:(e,t,r)=>{"use strict";var n=r(2823),i=r(5615),o=r(5174),s=r(1874);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},277:(e,t,r)=>{"use strict";var n=r(1874),i=r(2823),o=r(5615),s=r(5174),a=n.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),l=m.sub(y.mul(p));var _=g.sub(y.mul(b));if(!n&&u.cmp(d)<0)t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++v)break;c=u,h=f,f=u,m=p,p=l,g=b,b=_}s=u.neg(),a=l;var E=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(E)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var v=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=b,a=v,u=g}return this.curve.jpoint(o,u.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},6443:(e,t,r)=>{"use strict";var n,i=t,o=r(9499),s=r(7131),a=r(1874).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(3986)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},5064:(e,t,r)=>{"use strict";var n=r(2823),i=r(4742),o=r(1874),s=r(6443),a=r(7048),c=o.assert,u=r(7531),l=r(7782);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new u(this,e)},d.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},d.prototype._truncateToN=function(e,t,r){var i;if(n.isBN(e)||"number"==typeof e)i=(e=new n(e,16)).byteLength();else if("object"==typeof e)i=e.length,e=new n(e,16);else{var o=e.toString();i=o.length+1>>>1,e=new n(o,16)}"number"!=typeof r&&(r=8*i);var s=r-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){if("object"==typeof r&&(o=r,r=null),o||(o={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){c("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),c(e.length>>>0===e.length);for(var s=0;s<e.length;s++)c((255&e[s])===e[s])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,o.msgBitLength),c(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),u=t.getPrivate().toArray("be",a),d=e.toArray("be",a);c(new n(d).eq(e),"Can not sign message");for(var f=new i({hash:this.hash,entropy:u,nonce:d,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),p=0;;p++){var b=o.k?o.k(p):new n(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=b.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var _=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),_^=1),new l({r:v,s:y,recoveryParam:_})}}}}}},d.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(e).umod(this.n),d=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,d=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),b=u.mul(h).umod(o);return this.g.mulAdd(p,a,b)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},7531:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},7782:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;if(128&e[r.place])return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;if(128&e[r.place])return!1;var d=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(u),this.s=new n(d),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},4807:(e,t,r)=>{"use strict";var n=r(9499),i=r(6443),o=r(1874),s=o.assert,a=o.parseBytes,c=r(4672),u=r(8401);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(e,t,r){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},4672:(e,t,r)=>{"use strict";var n=r(1874),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},8401:(e,t,r)=>{"use strict";var n=r(2823),i=r(1874),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(o(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},3986:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},1874:(e,t,r)=>{"use strict";var n=t,i=r(2823),o=r(7784),s=r(9042);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,s=e.clone();for(n=0;n<i.length;n++){var a,c=s.andln(o-1);s.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,s.isubn(a)):a=0,i[n]=a,s.iushrn(1)}return i},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=1&c?3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c:0,r[0].push(s),a=1&u?3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u:0,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},6075:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,c=Object.keys(t).sort(i&&i(t));for(s="",r=0;r<c.length;r++){var u=c[r],l=e(t[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return o.splice(a,1),"{"+s+"}"}}(e)}},9499:(e,t,r)=>{var n=t;n.utils=r(461),n.common=r(2191),n.sha=r(5746),n.ripemd=r(4169),n.hmac=r(1825),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},2191:(e,t,r)=>{"use strict";var n=r(461),i=r(7784);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},1825:(e,t,r)=>{"use strict";var n=r(461),i=r(7784);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},4169:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function f(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],v=r,y=n,_=i,E=u,w=l,O=0;O<80;O++){var A=s(o(c(r,d(O,n,i,u),e[p[O]+t],f(O)),m[O]),l);r=l,l=u,u=o(i,10),i=n,n=A,A=s(o(c(v,d(79-O,y,_,E),e[b[O]+t],h(O)),g[O]),w),v=w,w=E,E=o(_,10),_=y,y=A}A=a(this.h[1],i,E),this.h[1]=a(this.h[2],u,w),this.h[2]=a(this.h[3],l,v),this.h[3]=a(this.h[4],r,y),this.h[4]=a(this.h[0],n,_),this.h[0]=A},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5746:(e,t,r)=>{"use strict";t.sha1=r(2986),t.sha224=r(5393),t.sha256=r(536),t.sha384=r(2348),t.sha512=r(2157)},2986:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=r(600),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,l),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],f=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=c(s(i,5),u(p,o,l,f),h,r[n],d[p]);h=f,f=l,l=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],h)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5393:(e,t,r)=>{"use strict";var n=r(461),i=r(536);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},536:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=r(600),s=r(7784),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,d=o.maj32,f=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],_=this.h[6],E=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var w=u(E,h(v),l(v,y,_),this.k[n],r[n]),O=a(f(i),d(i,o,m));E=_,_=y,y=v,v=a(g,w),g=m,m=o,o=i,i=a(w,O)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],m),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],E)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},2348:(e,t,r)=>{"use strict";var n=r(461),i=r(2157);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},2157:(e,t,r)=>{"use strict";var n=r(461),i=r(2191),o=r(7784),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,d=n.sum64_hi,f=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function E(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function w(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function O(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(y,g),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=x(r[n-4],r[n-3]),o=M(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=R(r[n-30],r[n-29]),u=I(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=h(i,o,s,a,c,u,l,d),r[n+1]=p(i,o,s,a,c,u,l,d)}},y.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],p=this.h[7],g=this.h[8],v=this.h[9],y=this.h[10],R=this.h[11],I=this.h[12],x=this.h[13],M=this.h[14],k=this.h[15];o(this.k.length===r.length);for(var L=0;L<r.length;L+=2){var C=M,N=k,j=P(g,v),D=T(g,v),U=_(g,v,y,R,I),B=E(g,v,y,R,I,x),F=this.k[L],K=this.k[L+1],H=r[L],G=r[L+1],$=b(C,N,j,D,U,B,F,K,H,G),V=m(C,N,j,D,U,B,F,K,H,G);C=A(n,i),N=S(n,i),j=w(n,i,s,a,c),D=O(n,i,s,a,c,u);var z=d(C,N,j,D),W=f(C,N,j,D);M=I,k=x,I=y,x=R,y=g,R=v,g=d(h,p,$,V),v=f(p,p,$,V),h=c,p=u,c=s,u=a,s=n,a=i,n=d($,V,z,W),i=f($,V,z,W)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,c,u),l(this.h,6,h,p),l(this.h,8,g,v),l(this.h,10,y,R),l(this.h,12,I,x),l(this.h,14,M,k)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},600:(e,t,r)=>{"use strict";var n=r(461).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},461:(e,t,r)=>{"use strict";var n=r(7784),i=r(5615);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=c(i.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+i+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},4742:(e,t,r)=>{"use strict";var n=r(9499),i=r(9042),o=r(7784);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},9318:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*b}},5615:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7784:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},9042:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},8813:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.interval=t.iif=t.generate=t.fromEventPattern=t.fromEvent=t.from=t.forkJoin=t.empty=t.defer=t.connectable=t.concat=t.combineLatest=t.bindNodeCallback=t.bindCallback=t.UnsubscriptionError=t.TimeoutError=t.SequenceError=t.ObjectUnsubscribedError=t.NotFoundError=t.EmptyError=t.ArgumentOutOfRangeError=t.firstValueFrom=t.lastValueFrom=t.isObservable=t.identity=t.noop=t.pipe=t.NotificationKind=t.Notification=t.Subscriber=t.Subscription=t.Scheduler=t.VirtualAction=t.VirtualTimeScheduler=t.animationFrameScheduler=t.animationFrame=t.queueScheduler=t.queue=t.asyncScheduler=t.async=t.asapScheduler=t.asap=t.AsyncSubject=t.ReplaySubject=t.BehaviorSubject=t.Subject=t.animationFrames=t.observable=t.ConnectableObservable=t.Observable=void 0,t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.combineLatestWith=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=t.config=t.NEVER=t.EMPTY=t.scheduled=t.zip=t.using=t.timer=t.throwError=t.range=t.race=t.partition=t.pairs=t.onErrorResumeNext=t.of=t.never=t.merge=void 0,t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.pairwise=t.onErrorResumeNextWith=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=t.mergeAll=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=void 0,t.zipWith=t.zipAll=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=void 0;var o=r(4662);Object.defineProperty(t,"Observable",{enumerable:!0,get:function(){return o.Observable}});var s=r(8918);Object.defineProperty(t,"ConnectableObservable",{enumerable:!0,get:function(){return s.ConnectableObservable}});var a=r(3327);Object.defineProperty(t,"observable",{enumerable:!0,get:function(){return a.observable}});var c=r(3110);Object.defineProperty(t,"animationFrames",{enumerable:!0,get:function(){return c.animationFrames}});var u=r(2483);Object.defineProperty(t,"Subject",{enumerable:!0,get:function(){return u.Subject}});var l=r(1637);Object.defineProperty(t,"BehaviorSubject",{enumerable:!0,get:function(){return l.BehaviorSubject}});var d=r(1242);Object.defineProperty(t,"ReplaySubject",{enumerable:!0,get:function(){return d.ReplaySubject}});var f=r(95);Object.defineProperty(t,"AsyncSubject",{enumerable:!0,get:function(){return f.AsyncSubject}});var h=r(3692);Object.defineProperty(t,"asap",{enumerable:!0,get:function(){return h.asap}}),Object.defineProperty(t,"asapScheduler",{enumerable:!0,get:function(){return h.asapScheduler}});var p=r(7961);Object.defineProperty(t,"async",{enumerable:!0,get:function(){return p.async}}),Object.defineProperty(t,"asyncScheduler",{enumerable:!0,get:function(){return p.asyncScheduler}});var b=r(2886);Object.defineProperty(t,"queue",{enumerable:!0,get:function(){return b.queue}}),Object.defineProperty(t,"queueScheduler",{enumerable:!0,get:function(){return b.queueScheduler}});var m=r(3862);Object.defineProperty(t,"animationFrame",{enumerable:!0,get:function(){return m.animationFrame}}),Object.defineProperty(t,"animationFrameScheduler",{enumerable:!0,get:function(){return m.animationFrameScheduler}});var g=r(182);Object.defineProperty(t,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g.VirtualTimeScheduler}}),Object.defineProperty(t,"VirtualAction",{enumerable:!0,get:function(){return g.VirtualAction}});var v=r(8986);Object.defineProperty(t,"Scheduler",{enumerable:!0,get:function(){return v.Scheduler}});var y=r(8014);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return y.Subscription}});var _=r(5);Object.defineProperty(t,"Subscriber",{enumerable:!0,get:function(){return _.Subscriber}});var E=r(7800);Object.defineProperty(t,"Notification",{enumerable:!0,get:function(){return E.Notification}}),Object.defineProperty(t,"NotificationKind",{enumerable:!0,get:function(){return E.NotificationKind}});var w=r(2706);Object.defineProperty(t,"pipe",{enumerable:!0,get:function(){return w.pipe}});var O=r(1342);Object.defineProperty(t,"noop",{enumerable:!0,get:function(){return O.noop}});var A=r(6640);Object.defineProperty(t,"identity",{enumerable:!0,get:function(){return A.identity}});var S=r(1751);Object.defineProperty(t,"isObservable",{enumerable:!0,get:function(){return S.isObservable}});var P=r(6894);Object.defineProperty(t,"lastValueFrom",{enumerable:!0,get:function(){return P.lastValueFrom}});var T=r(9060);Object.defineProperty(t,"firstValueFrom",{enumerable:!0,get:function(){return T.firstValueFrom}});var R=r(7057);Object.defineProperty(t,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return R.ArgumentOutOfRangeError}});var I=r(5204);Object.defineProperty(t,"EmptyError",{enumerable:!0,get:function(){return I.EmptyError}});var x=r(1759);Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return x.NotFoundError}});var M=r(9686);Object.defineProperty(t,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return M.ObjectUnsubscribedError}});var k=r(1505);Object.defineProperty(t,"SequenceError",{enumerable:!0,get:function(){return k.SequenceError}});var L=r(1554);Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return L.TimeoutError}});var C=r(5788);Object.defineProperty(t,"UnsubscriptionError",{enumerable:!0,get:function(){return C.UnsubscriptionError}});var N=r(2713);Object.defineProperty(t,"bindCallback",{enumerable:!0,get:function(){return N.bindCallback}});var j=r(8561);Object.defineProperty(t,"bindNodeCallback",{enumerable:!0,get:function(){return j.bindNodeCallback}});var D=r(3247);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return D.combineLatest}});var U=r(3865);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return U.concat}});var B=r(7579);Object.defineProperty(t,"connectable",{enumerable:!0,get:function(){return B.connectable}});var F=r(9353);Object.defineProperty(t,"defer",{enumerable:!0,get:function(){return F.defer}});var K=r(8616);Object.defineProperty(t,"empty",{enumerable:!0,get:function(){return K.empty}});var H=r(9105);Object.defineProperty(t,"forkJoin",{enumerable:!0,get:function(){return H.forkJoin}});var G=r(4917);Object.defineProperty(t,"from",{enumerable:!0,get:function(){return G.from}});var $=r(5337);Object.defineProperty(t,"fromEvent",{enumerable:!0,get:function(){return $.fromEvent}});var V=r(347);Object.defineProperty(t,"fromEventPattern",{enumerable:!0,get:function(){return V.fromEventPattern}});var z=r(7610);Object.defineProperty(t,"generate",{enumerable:!0,get:function(){return z.generate}});var W=r(4209);Object.defineProperty(t,"iif",{enumerable:!0,get:function(){return W.iif}});var q=r(6472);Object.defineProperty(t,"interval",{enumerable:!0,get:function(){return q.interval}});var Z=r(2833);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return Z.merge}});var Y=r(8655);Object.defineProperty(t,"never",{enumerable:!0,get:function(){return Y.never}});var J=r(1004);Object.defineProperty(t,"of",{enumerable:!0,get:function(){return J.of}});var X=r(6102);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return X.onErrorResumeNext}});var Q=r(7740);Object.defineProperty(t,"pairs",{enumerable:!0,get:function(){return Q.pairs}});var ee=r(1699);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ee.partition}});var te=r(5584);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return te.race}});var re=r(9376);Object.defineProperty(t,"range",{enumerable:!0,get:function(){return re.range}});var ne=r(1103);Object.defineProperty(t,"throwError",{enumerable:!0,get:function(){return ne.throwError}});var ie=r(4092);Object.defineProperty(t,"timer",{enumerable:!0,get:function(){return ie.timer}});var oe=r(7853);Object.defineProperty(t,"using",{enumerable:!0,get:function(){return oe.using}});var se=r(7286);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return se.zip}});var ae=r(1656);Object.defineProperty(t,"scheduled",{enumerable:!0,get:function(){return ae.scheduled}});var ce=r(8616);Object.defineProperty(t,"EMPTY",{enumerable:!0,get:function(){return ce.EMPTY}});var ue=r(8655);Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return ue.NEVER}}),i(r(6038),t);var le=r(3413);Object.defineProperty(t,"config",{enumerable:!0,get:function(){return le.config}});var de=r(3146);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return de.audit}});var fe=r(3231);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return fe.auditTime}});var he=r(8015);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return he.buffer}});var pe=r(5572);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}});var be=r(7210);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return be.bufferTime}});var me=r(8995);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return me.bufferToggle}});var ge=r(8831);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return ge.bufferWhen}});var ve=r(8118);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return ve.catchError}});var ye=r(6625);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return ye.combineAll}});var _e=r(6728);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return _e.combineLatestAll}});var Ee=r(8239);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return Ee.combineLatestWith}});var we=r(8158);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return we.concatAll}});var Oe=r(9135);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return Oe.concatMap}});var Ae=r(9938);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return Ae.concatMapTo}});var Se=r(9669);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return Se.concatWith}});var Pe=r(1483);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return Pe.connect}});var Te=r(1038);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return Te.count}});var Re=r(6842);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return Re.debounce}});var Ie=r(8079);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return Ie.debounceTime}});var xe=r(378);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return xe.defaultIfEmpty}});var Me=r(914);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return Me.delay}});var ke=r(8766);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return ke.delayWhen}});var Le=r(7441);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return Le.dematerialize}});var Ce=r(5365);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return Ce.distinct}});var Ne=r(8937);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return Ne.distinctUntilChanged}});var je=r(9612);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return je.distinctUntilKeyChanged}});var De=r(4520);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return De.elementAt}});var Ue=r(1776);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return Ue.endWith}});var Be=r(5510);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return Be.every}});var Fe=r(1551);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return Fe.exhaust}});var Ke=r(2752);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return Ke.exhaustAll}});var He=r(4753);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return He.exhaustMap}});var Ge=r(7661);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return Ge.expand}});var $e=r(783);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return $e.filter}});var Ve=r(3555);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return Ve.finalize}});var ze=r(7714);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return ze.find}});var We=r(9756);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return We.findIndex}});var qe=r(8275);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return qe.first}});var Ze=r(7815);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return Ze.groupBy}});var Ye=r(490);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return Ye.ignoreElements}});var Je=r(9356);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return Je.isEmpty}});var Xe=r(8669);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return Xe.last}});var Qe=r(5471);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return Qe.map}});var et=r(3218);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return et.mapTo}});var tt=r(2360);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return tt.materialize}});var rt=r(1415);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return rt.max}});var nt=r(7302);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return nt.mergeAll}});var it=r(6902);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return it.flatMap}});var ot=r(983);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ot.mergeMap}});var st=r(6586);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return st.mergeMapTo}});var at=r(4408);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return at.mergeScan}});var ct=r(8253);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ct.mergeWith}});var ut=r(2669);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ut.min}});var lt=r(9247);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return lt.multicast}});var dt=r(5184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return dt.observeOn}});var ft=r(1226);Object.defineProperty(t,"onErrorResumeNextWith",{enumerable:!0,get:function(){return ft.onErrorResumeNextWith}});var ht=r(1518);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ht.pairwise}});var pt=r(4912);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return pt.pluck}});var bt=r(766);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return bt.publish}});var mt=r(7220);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return mt.publishBehavior}});var gt=r(6106);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return gt.publishLast}});var vt=r(8157);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return vt.publishReplay}});var yt=r(5600);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return yt.raceWith}});var _t=r(9139);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return _t.reduce}});var Et=r(8522);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return Et.repeat}});var wt=r(6566);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return wt.repeatWhen}});var Ot=r(7835);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return Ot.retry}});var At=r(9843);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return At.retryWhen}});var St=r(7561);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return St.refCount}});var Pt=r(1731);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Pt.sample}});var Tt=r(6086);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Tt.sampleTime}});var Rt=r(8624);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Rt.scan}});var It=r(582);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return It.sequenceEqual}});var xt=r(8977);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return xt.share}});var Mt=r(3133);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Mt.shareReplay}});var kt=r(3001);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return kt.single}});var Lt=r(3982);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return Lt.skip}});var Ct=r(9098);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Ct.skipLast}});var Nt=r(7372);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return Nt.skipUntil}});var jt=r(4721);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return jt.skipWhile}});var Dt=r(269);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Dt.startWith}});var Ut=r(8960);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ut.subscribeOn}});var Bt=r(8774);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return Bt.switchAll}});var Ft=r(3879);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return Ft.switchMap}});var Kt=r(3274);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Kt.switchMapTo}});var Ht=r(8712);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Ht.switchScan}});var Gt=r(846);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Gt.take}});var $t=r(8330);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return $t.takeLast}});var Vt=r(4780);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return Vt.takeUntil}});var zt=r(2129);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return zt.takeWhile}});var Wt=r(3964);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return Wt.tap}});var qt=r(8941);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return qt.throttle}});var Zt=r(7640);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return Zt.throttleTime}});var Yt=r(4869);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return Yt.throwIfEmpty}});var Jt=r(489);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return Jt.timeInterval}});var Xt=r(1554);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Xt.timeout}});var Qt=r(4862);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Qt.timeoutWith}});var er=r(6505);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return er.timestamp}});var tr=r(2343);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return tr.toArray}});var rr=r(5477);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return rr.window}});var nr=r(6746);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return nr.windowCount}});var ir=r(8208);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return ir.windowTime}});var or=r(6637);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return or.windowToggle}});var sr=r(1141);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return sr.windowWhen}});var ar=r(5442);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return ar.withLatestFrom}});var cr=r(187);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return cr.zipAll}});var ur=r(8538);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return ur.zipWith}})},95:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncSubject=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return i(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))},t}(r(2483).Subject);t.AsyncSubject=o},1637:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;var o=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(r(2483).Subject);t.BehaviorSubject=o},7800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeNotification=t.Notification=t.NotificationKind=void 0;var n=r(8616),i=r(1004),o=r(1103),s=r(1018);!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(t.NotificationKind||(t.NotificationKind={}));var a=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return c(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return s.isFunction(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,s=e.error,a="N"===t?i.of(r):"E"===t?o.throwError((function(){return s})):"C"===t?n.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();function c(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}t.Notification=a,t.observeNotification=c},9052:(e,t)=>{"use strict";function r(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=r("C",void 0,void 0),t.errorNotification=function(e){return r("E",void 0,e)},t.nextNotification=function(e){return r("N",e,void 0)},t.createNotification=r},4662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var n=r(5),i=r(8014),o=r(3327),s=r(2706),a=r(3413),c=r(1018),u=r(9223),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var o,s=this,a=(o=e)&&o instanceof n.Subscriber||function(e){return e&&c.isFunction(e.next)&&c.isFunction(e.error)&&c.isFunction(e.complete)}(o)&&i.isSubscription(o)?e:new n.SafeSubscriber(e,t,r);return u.errorContext((function(){var e=s,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?s._subscribe(a):s._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=d(t))((function(t,i){var o=new n.SafeSubscriber({next:function(t){try{e(t)}catch(e){i(e),o.unsubscribe()}},error:i,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=d(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function d(e){var t;return null!==(t=null!=e?e:a.config.Promise)&&void 0!==t?t:Promise}t.Observable=l},1242:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ReplaySubject=void 0;var o=r(2483),s=r(9568),a=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return i(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},t}(o.Subject);t.ReplaySubject=a},8986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=void 0;var n=r(9568),i=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=n.dateTimestampProvider.now,e}();t.Scheduler=i},2483:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0;var s=r(4662),a=r(8014),c=r(9686),u=r(7479),l=r(9223),d=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new c.ObjectUnsubscribedError},t.prototype.next=function(e){var t=this;l.errorContext((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=o(t.currentObservers),s=i.next();!s.done;s=i.next()){s.value.next(e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;l.errorContext((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;l.errorContext((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?a.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new a.Subscription((function(){t.currentObservers=null,u.arrRemove(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new s.Observable;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(s.Observable);t.Subject=d;var f=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:a.EMPTY_SUBSCRIPTION},t}(d);t.AnonymousSubject=f},5:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_OBSERVER=t.SafeSubscriber=t.Subscriber=void 0;var o=r(1018),s=r(8014),a=r(3413),c=r(7315),u=r(1342),l=r(9052),d=r(9155),f=r(9223),h=function(e){function r(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s.isSubscription(r)&&r.add(n)):n.destination=t.EMPTY_OBSERVER,n}return i(r,e),r.create=function(e,t,r){return new g(e,t,r)},r.prototype.next=function(e){this.isStopped?y(l.nextNotification(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?y(l.errorNotification(e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?y(l.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(s.Subscription);t.Subscriber=h;var p=Function.prototype.bind;function b(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){v(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){v(e)}else v(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){v(e)}},e}(),g=function(e){function t(t,r,n){var i,s,c=e.call(this)||this;o.isFunction(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:c&&a.config.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return c.unsubscribe()},i={next:t.next&&b(t.next,s),error:t.error&&b(t.error,s),complete:t.complete&&b(t.complete,s)}):i=t;return c.destination=new m(i),c}return i(t,e),t}(h);function v(e){a.config.useDeprecatedSynchronousErrorHandling?f.captureError(e):c.reportUnhandledError(e)}function y(e,t){var r=a.config.onStoppedNotification;r&&d.timeoutProvider.setTimeout((function(){return r(e,t)}))}t.SafeSubscriber=g,t.EMPTY_OBSERVER={closed:!0,next:u.noop,error:function(e){throw e},complete:u.noop}},8014:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.isSubscription=t.EMPTY_SUBSCRIPTION=t.Subscription=void 0;var s=r(1018),a=r(5788),c=r(7479),u=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,c,u;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var f=n(d),h=f.next();!h.done;h=f.next()){h.value.remove(this)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}else d.remove(this);var p=this.initialTeardown;if(s.isFunction(p))try{p()}catch(e){u=e instanceof a.UnsubscriptionError?e.errors:[e]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var m=n(b),g=m.next();!g.done;g=m.next()){var v=g.value;try{l(v)}catch(e){u=null!=u?u:[],e instanceof a.UnsubscriptionError?u=o(o([],i(u)),i(e.errors)):u.push(e)}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(c=m.return)&&c.call(m)}finally{if(r)throw r.error}}}if(u)throw new a.UnsubscriptionError(u)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&c.arrRemove(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&c.arrRemove(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function l(e){s.isFunction(e)?e():e.unsubscribe()}t.Subscription=u,t.EMPTY_SUBSCRIPTION=u.EMPTY,t.isSubscription=function(e){return e instanceof u||e&&"closed"in e&&s.isFunction(e.remove)&&s.isFunction(e.add)&&s.isFunction(e.unsubscribe)}},3413:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},9060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.firstValueFrom=void 0;var n=r(5204),i=r(5);t.firstValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(o,s){var a=new i.SafeSubscriber({next:function(e){o(e),a.unsubscribe()},error:s,complete:function(){r?o(t.defaultValue):s(new n.EmptyError)}});e.subscribe(a)}))}},6894:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastValueFrom=void 0;var n=r(5204);t.lastValueFrom=function(e,t){var r="object"==typeof t;return new Promise((function(i,o){var s,a=!1;e.subscribe({next:function(e){s=e,a=!0},error:o,complete:function(){a?i(s):r?i(t.defaultValue):o(new n.EmptyError)}})}))}},8918:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectableObservable=void 0;var o=r(4662),s=r(8014),a=r(7561),c=r(3111),u=r(7843),l=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,u.hasLift(t)&&(n.lift=t.lift),n}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new s.Subscription;var r=this.getSubject();t.add(this.source.subscribe(c.createOperatorSubscriber(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=s.Subscription.EMPTY)}return t},t.prototype.refCount=function(){return a.refCount()(this)},t}(o.Observable);t.ConnectableObservable=l},2713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallback=void 0;var n=r(1439);t.bindCallback=function(e,t,r){return n.bindCallbackInternals(!1,e,t,r)}},1439:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.bindCallbackInternals=void 0;var o=r(8613),s=r(4662),a=r(8960),c=r(1251),u=r(5184),l=r(95);t.bindCallbackInternals=function e(t,r,d,f){if(d){if(!o.isScheduler(d))return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r,f).apply(this,n).pipe(c.mapOneOrManyArgs(d))};f=d}return f?function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return e(t,r).apply(this,n).pipe(a.subscribeOn(f),u.observeOn(f))}:function(){for(var e=this,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var c=new l.AsyncSubject,u=!0;return new s.Observable((function(s){var a=c.subscribe(s);if(u){u=!1;var l=!1,d=!1;r.apply(e,i(i([],n(o)),[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t){var n=e.shift();if(null!=n)return void c.error(n)}c.next(1<e.length?e:e[0]),d=!0,l&&c.complete()}])),d&&c.complete(),l=!0}return a}))}}},8561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindNodeCallback=void 0;var n=r(1439);t.bindNodeCallback=function(e,t,r){return n.bindCallbackInternals(!0,e,t,r)}},3247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestInit=t.combineLatest=void 0;var n=r(4662),i=r(7360),o=r(4917),s=r(6640),a=r(1251),c=r(1107),u=r(6013),l=r(3111),d=r(7110);function f(e,t,r){return void 0===r&&(r=s.identity),function(n){h(t,(function(){for(var i=e.length,s=new Array(i),a=i,c=i,u=function(i){h(t,(function(){var u=o.from(e[i],t),d=!1;u.subscribe(l.createOperatorSubscriber(n,(function(e){s[i]=e,d||(d=!0,c--),c||n.next(r(s.slice()))}),(function(){--a||n.complete()})))}),n)},d=0;d<i;d++)u(d)}),n)}}function h(e,t,r){e?d.executeSchedule(r,e,t):t()}t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popResultSelector(e),d=i.argsArgArrayOrObject(e),h=d.args,p=d.keys;if(0===h.length)return o.from([],r);var b=new n.Observable(f(h,r,p?function(e){return u.createObject(p,e)}:s.identity));return l?b.pipe(a.mapOneOrManyArgs(l)):b},t.combineLatestInit=f},3865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var n=r(8158),i=r(1107),o=r(4917);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.concatAll()(o.from(e,i.popScheduler(e)))}},7579:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectable=void 0;var n=r(2483),i=r(4662),o=r(9353),s={connector:function(){return new n.Subject},resetOnDisconnect:!0};t.connectable=function(e,t){void 0===t&&(t=s);var r=null,n=t.connector,a=t.resetOnDisconnect,c=void 0===a||a,u=n(),l=new i.Observable((function(e){return u.subscribe(e)}));return l.connect=function(){return r&&!r.closed||(r=o.defer((function(){return e})).subscribe(u),c&&r.add((function(){return u=n()}))),r},l}},9353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defer=void 0;var n=r(4662),i=r(9445);t.defer=function(e){return new n.Observable((function(t){i.innerFrom(e()).subscribe(t)}))}},3110:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0;var n=r(4662),i=r(4746),o=r(9507);function s(e){return new n.Observable((function(t){var r=e||i.performanceTimestampProvider,n=r.now(),s=0,a=function(){t.closed||(s=o.animationFrameProvider.requestAnimationFrame((function(i){s=0;var o=r.now();t.next({timestamp:e?o:i,elapsed:o-n}),a()})))};return a(),function(){s&&o.animationFrameProvider.cancelAnimationFrame(s)}}))}t.animationFrames=function(e){return e?s(e):a};var a=s()},8616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var n=r(4662);t.EMPTY=new n.Observable((function(e){return e.complete()})),t.empty=function(e){return e?function(e){return new n.Observable((function(t){return e.schedule((function(){return t.complete()}))}))}(e):t.EMPTY}},9105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forkJoin=void 0;var n=r(4662),i=r(7360),o=r(9445),s=r(1107),a=r(3111),c=r(1251),u=r(6013);t.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popResultSelector(e),l=i.argsArgArrayOrObject(e),d=l.args,f=l.keys,h=new n.Observable((function(e){var t=d.length;if(t)for(var r=new Array(t),n=t,i=t,s=function(t){var s=!1;o.innerFrom(d[t]).subscribe(a.createOperatorSubscriber(e,(function(e){s||(s=!0,i--),r[t]=e}),(function(){return n--}),void 0,(function(){n&&s||(i||e.next(f?u.createObject(f,r):r),e.complete())})))},c=0;c<t;c++)s(c);else e.complete()}));return r?h.pipe(c.mapOneOrManyArgs(r)):h}},4917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.from=void 0;var n=r(1656),i=r(9445);t.from=function(e,t){return t?n.scheduled(e,t):i.innerFrom(e)}},5337:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(t,"__esModule",{value:!0}),t.fromEvent=void 0;var i=r(9445),o=r(4662),s=r(983),a=r(8046),c=r(1018),u=r(1251),l=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function h(e,t){return function(r){return function(n){return e[r](t,n)}}}t.fromEvent=function e(t,r,p,b){if(c.isFunction(p)&&(b=p,p=void 0),b)return e(t,r,p).pipe(u.mapOneOrManyArgs(b));var m=n(function(e){return c.isFunction(e.addEventListener)&&c.isFunction(e.removeEventListener)}(t)?d.map((function(e){return function(n){return t[e](r,n,p)}})):function(e){return c.isFunction(e.addListener)&&c.isFunction(e.removeListener)}(t)?l.map(h(t,r)):function(e){return c.isFunction(e.on)&&c.isFunction(e.off)}(t)?f.map(h(t,r)):[],2),g=m[0],v=m[1];if(!g&&a.isArrayLike(t))return s.mergeMap((function(t){return e(t,r,p)}))(i.innerFrom(t));if(!g)throw new TypeError("Invalid event target");return new o.Observable((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return g(t),function(){return v(t)}}))}},347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromEventPattern=void 0;var n=r(4662),i=r(1018),o=r(1251);t.fromEventPattern=function e(t,r,s){return s?e(t,r).pipe(o.mapOneOrManyArgs(s)):new n.Observable((function(e){var n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)},o=t(n);return i.isFunction(r)?function(){return r(n,o)}:void 0}))}},6824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSubscribable=void 0;var n=r(4662);t.fromSubscribable=function(e){return new n.Observable((function(t){return e.subscribe(t)}))}},7610:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.generate=void 0;var i=r(6640),o=r(8613),s=r(9353),a=r(8808);t.generate=function(e,t,r,c,u){var l,d,f,h;function p(){var e;return n(this,(function(n){switch(n.label){case 0:e=h,n.label=1;case 1:return t&&!t(e)?[3,4]:[4,f(e)];case 2:n.sent(),n.label=3;case 3:return e=r(e),[3,1];case 4:return[2]}}))}return 1===arguments.length?(h=(l=e).initialState,t=l.condition,r=l.iterate,d=l.resultSelector,f=void 0===d?i.identity:d,u=l.scheduler):(h=e,!c||o.isScheduler(c)?(f=i.identity,u=c):f=c),s.defer(u?function(){return a.scheduleIterable(p(),u)}:p)}},4209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iif=void 0;var n=r(9353);t.iif=function(e,t,r){return n.defer((function(){return e()?t:r}))}},9445:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof s?s(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.fromReadableStreamLike=t.fromAsyncIterable=t.fromIterable=t.fromPromise=t.fromArrayLike=t.fromInteropObservable=t.innerFrom=void 0;var a=r(8046),c=r(7629),u=r(4662),l=r(1116),d=r(1358),f=r(7614),h=r(6368),p=r(9137),b=r(1018),m=r(7315),g=r(3327);function v(e){return new u.Observable((function(t){var r=e[g.observable]();if(b.isFunction(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function y(e){return new u.Observable((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function _(e){return new u.Observable((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,m.reportUnhandledError)}))}function E(e){return new u.Observable((function(t){var r,n;try{for(var i=s(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function w(e){return new u.Observable((function(t){(function(e,t){var r,s,a,c;return n(this,void 0,void 0,(function(){var n,u;return i(this,(function(i){switch(i.label){case 0:i.trys.push([0,5,6,11]),r=o(e),i.label=1;case 1:return[4,r.next()];case 2:if((s=i.sent()).done)return[3,4];if(n=s.value,t.next(n),t.closed)return[2];i.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=i.sent(),a={error:u},[3,11];case 6:return i.trys.push([6,,9,10]),s&&!s.done&&(c=r.return)?[4,c.call(r)]:[3,8];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function O(e){return w(p.readableStreamLikeToAsyncGenerator(e))}t.innerFrom=function(e){if(e instanceof u.Observable)return e;if(null!=e){if(l.isInteropObservable(e))return v(e);if(a.isArrayLike(e))return y(e);if(c.isPromise(e))return _(e);if(d.isAsyncIterable(e))return w(e);if(h.isIterable(e))return E(e);if(p.isReadableStreamLike(e))return O(e)}throw f.createInvalidObservableTypeError(e)},t.fromInteropObservable=v,t.fromArrayLike=y,t.fromPromise=_,t.fromIterable=E,t.fromAsyncIterable=w,t.fromReadableStreamLike=O},6472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.interval=void 0;var n=r(7961),i=r(4092);t.interval=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=n.asyncScheduler),e<0&&(e=0),i.timer(e,e,t)}},2833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var n=r(7302),i=r(9445),o=r(8616),s=r(1107),a=r(4917);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=s.popScheduler(e),c=s.popNumber(e,1/0),u=e;return u.length?1===u.length?i.innerFrom(u[0]):n.mergeAll(c)(a.from(u,r)):o.EMPTY}},8655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.never=t.NEVER=void 0;var n=r(4662),i=r(1342);t.NEVER=new n.Observable(i.noop),t.never=function(){return t.NEVER}},1004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.of=void 0;var n=r(1107),i=r(4917);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.popScheduler(e);return i.from(e,r)}},6102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=void 0;var n=r(4662),i=r(8535),o=r(3111),s=r(1342),a=r(9445);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.argsOrArgArray(e);return new n.Observable((function(e){var t=0,n=function(){if(t<r.length){var i=void 0;try{i=a.innerFrom(r[t++])}catch(e){return void n()}var c=new o.OperatorSubscriber(e,void 0,s.noop,s.noop);i.subscribe(c),c.add(n)}else e.complete()};n()}))}},7740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairs=void 0;var n=r(4917);t.pairs=function(e,t){return n.from(Object.entries(e),t)}},1699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(245),i=r(783),o=r(9445);t.partition=function(e,t,r){return[i.filter(t,r)(o.innerFrom(e)),i.filter(n.not(t,r))(o.innerFrom(e))]}},5584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.raceInit=t.race=void 0;var n=r(4662),i=r(9445),o=r(8535),s=r(3111);function a(e){return function(t){for(var r=[],n=function(n){r.push(i.innerFrom(e[n]).subscribe(s.createOperatorSubscriber(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},o=0;r&&!t.closed&&o<e.length;o++)n(o)}}t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=o.argsOrArgArray(e)).length?i.innerFrom(e[0]):new n.Observable(a(e))},t.raceInit=a},9376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0;var n=r(4662),i=r(8616);t.range=function(e,t,r){if(null==t&&(t=e,e=0),t<=0)return i.EMPTY;var o=t+e;return new n.Observable(r?function(t){var n=e;return r.schedule((function(){n<o?(t.next(n++),this.schedule()):t.complete()}))}:function(t){for(var r=e;r<o&&!t.closed;)t.next(r++);t.complete()})}},1103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;var n=r(4662),i=r(1018);t.throwError=function(e,t){var r=i.isFunction(e)?e:function(){return e},o=function(e){return e.error(r())};return new n.Observable(t?function(e){return t.schedule(o,0,e)}:o)}},4092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timer=void 0;var n=r(4662),i=r(7961),o=r(8613),s=r(1074);t.timer=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=i.async);var a=-1;return null!=t&&(o.isScheduler(t)?r=t:a=t),new n.Observable((function(t){var n=s.isValidDate(e)?+e-r.now():e;n<0&&(n=0);var i=0;return r.schedule((function(){t.closed||(t.next(i++),0<=a?this.schedule(void 0,a):t.complete())}),n)}))}},7853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.using=void 0;var n=r(4662),i=r(9445),o=r(8616);t.using=function(e,t){return new n.Observable((function(r){var n=e(),s=t(n);return(s?i.innerFrom(s):o.EMPTY).subscribe(r),function(){n&&n.unsubscribe()}}))}},7286:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(4662),s=r(9445),a=r(8535),c=r(8616),u=r(3111),l=r(1107);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e),d=a.argsOrArgArray(e);return d.length?new o.Observable((function(e){var t=d.map((function(){return[]})),o=d.map((function(){return!1}));e.add((function(){t=o=null}));for(var a=function(a){s.innerFrom(d[a]).subscribe(u.createOperatorSubscriber(e,(function(s){if(t[a].push(s),t.every((function(e){return e.length}))){var c=t.map((function(e){return e.shift()}));e.next(r?r.apply(void 0,i([],n(c))):c),t.some((function(e,t){return!e.length&&o[t]}))&&e.complete()}}),(function(){o[a]=!0,!t[a].length&&e.complete()})))},c=0;!e.closed&&c<d.length;c++)a(c);return function(){t=o=null}})):c.EMPTY}},3111:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorSubscriber=t.createOperatorSubscriber=void 0;var o=r(5);t.createOperatorSubscriber=function(e,t,r,n,i){return new s(e,t,r,n,i)};var s=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return i(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(o.Subscriber);t.OperatorSubscriber=s},3146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.audit=void 0;var n=r(7843),i=r(9445),o=r(3111);t.audit=function(e){return n.operate((function(t,r){var n=!1,s=null,a=null,c=!1,u=function(){if(null==a||a.unsubscribe(),a=null,n){n=!1;var e=s;s=null,r.next(e)}c&&r.complete()},l=function(){a=null,c&&r.complete()};t.subscribe(o.createOperatorSubscriber(r,(function(t){n=!0,s=t,a||i.innerFrom(e(t)).subscribe(a=o.createOperatorSubscriber(r,u,l))}),(function(){c=!0,(!n||!a||a.closed)&&r.complete()})))}))}},3231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auditTime=void 0;var n=r(7961),i=r(3146),o=r(4092);t.auditTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.audit((function(){return o.timer(e,t)}))}},8015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=void 0;var n=r(7843),i=r(1342),o=r(3111),s=r(9445);t.buffer=function(e){return n.operate((function(t,r){var n=[];return t.subscribe(o.createOperatorSubscriber(r,(function(e){return n.push(e)}),(function(){r.next(n),r.complete()}))),s.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){var e=n;n=[],r.next(e)}),i.noop)),function(){n=null}}))}},5572:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferCount=void 0;var i=r(7843),o=r(3111),s=r(7479);t.bufferCount=function(e,t){return void 0===t&&(t=null),t=null!=t?t:e,i.operate((function(r,i){var a=[],c=0;r.subscribe(o.createOperatorSubscriber(i,(function(r){var o,u,l,d,f=null;c++%t==0&&a.push([]);try{for(var h=n(a),p=h.next();!p.done;p=h.next()){(g=p.value).push(r),e<=g.length&&(f=null!=f?f:[]).push(g)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(u=h.return)&&u.call(h)}finally{if(o)throw o.error}}if(f)try{for(var b=n(f),m=b.next();!m.done;m=b.next()){var g=m.value;s.arrRemove(a,g),i.next(g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(d=b.return)&&d.call(b)}finally{if(l)throw l.error}}}),(function(){var e,t;try{for(var r=n(a),o=r.next();!o.done;o=r.next()){var s=o.value;i.next(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.complete()}),void 0,(function(){a=null})))}))}},7210:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferTime=void 0;var i=r(8014),o=r(7843),s=r(3111),a=r(7479),c=r(7961),u=r(1107),l=r(7110);t.bufferTime=function(e){for(var t,r,d=[],f=1;f<arguments.length;f++)d[f-1]=arguments[f];var h=null!==(t=u.popScheduler(d))&&void 0!==t?t:c.asyncScheduler,p=null!==(r=d[0])&&void 0!==r?r:null,b=d[1]||1/0;return o.operate((function(t,r){var o=[],c=!1,u=function(e){var t=e.buffer;e.subs.unsubscribe(),a.arrRemove(o,e),r.next(t),c&&d()},d=function(){if(o){var t=new i.Subscription;r.add(t);var n={buffer:[],subs:t};o.push(n),l.executeSchedule(t,h,(function(){return u(n)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,d,p,!0):c=!0,d();var f=s.createOperatorSubscriber(r,(function(e){var t,r,i=o.slice();try{for(var s=n(i),a=s.next();!a.done;a=s.next()){var c=a.value,l=c.buffer;l.push(e),b<=l.length&&u(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}),(function(){for(;null==o?void 0:o.length;)r.next(o.shift().buffer);null==f||f.unsubscribe(),r.complete(),r.unsubscribe()}),void 0,(function(){return o=null}));t.subscribe(f)}))}},8995:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToggle=void 0;var i=r(8014),o=r(7843),s=r(9445),a=r(3111),c=r(1342),u=r(7479);t.bufferToggle=function(e,t){return o.operate((function(r,o){var l=[];s.innerFrom(e).subscribe(a.createOperatorSubscriber(o,(function(e){var r=[];l.push(r);var n=new i.Subscription;n.add(s.innerFrom(t(e)).subscribe(a.createOperatorSubscriber(o,(function(){u.arrRemove(l,r),o.next(r),n.unsubscribe()}),c.noop)))}),c.noop)),r.subscribe(a.createOperatorSubscriber(o,(function(e){var t,r;try{for(var i=n(l),o=i.next();!o.done;o=i.next()){o.value.push(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}),(function(){for(;l.length>0;)o.next(l.shift());o.complete()})))}))}},8831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferWhen=void 0;var n=r(7843),i=r(1342),o=r(3111),s=r(9445);t.bufferWhen=function(e){return n.operate((function(t,r){var n=null,a=null,c=function(){null==a||a.unsubscribe();var t=n;n=[],t&&r.next(t),s.innerFrom(e()).subscribe(a=o.createOperatorSubscriber(r,c,i.noop))};c(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==n?void 0:n.push(e)}),(function(){n&&r.next(n),r.complete()}),void 0,(function(){return n=a=null})))}))}},8118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.catchError=void 0;var n=r(9445),i=r(3111),o=r(7843);t.catchError=function e(t){return o.operate((function(r,o){var s,a=null,c=!1;a=r.subscribe(i.createOperatorSubscriber(o,void 0,void 0,(function(i){s=n.innerFrom(t(i,e(t)(r))),a?(a.unsubscribe(),a=null,s.subscribe(o)):c=!0}))),c&&(a.unsubscribe(),a=null,s.subscribe(o))}))}},6625:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineAll=void 0;var n=r(6728);t.combineAll=n.combineLatestAll},2551:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatest=void 0;var o=r(3247),s=r(7843),a=r(8535),c=r(1251),u=r(2706),l=r(1107);t.combineLatest=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var d=l.popResultSelector(t);return d?u.pipe(e.apply(void 0,i([],n(t))),c.mapOneOrManyArgs(d)):s.operate((function(e,r){o.combineLatestInit(i([e],n(a.argsOrArgArray(t))))(r)}))}},6728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestAll=void 0;var n=r(3247),i=r(3638);t.combineLatestAll=function(e){return i.joinAllInternals(n.combineLatest,e)}},8239:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.combineLatestWith=void 0;var o=r(2551);t.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.combineLatest.apply(void 0,i([],n(e)))}},7601:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concat=void 0;var o=r(7843),s=r(8158),a=r(1107),c=r(4917);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.popScheduler(e);return o.operate((function(t,o){s.concatAll()(c.from(i([t],n(e)),r)).subscribe(o)}))}},8158:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAll=void 0;var n=r(7302);t.concatAll=function(){return n.mergeAll(1)}},9135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMap=void 0;var n=r(983),i=r(1018);t.concatMap=function(e,t){return i.isFunction(t)?n.mergeMap(e,t,1):n.mergeMap(e,1)}},9938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatMapTo=void 0;var n=r(9135),i=r(1018);t.concatMapTo=function(e,t){return i.isFunction(t)?n.concatMap((function(){return e}),t):n.concatMap((function(){return e}))}},9669:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.concatWith=void 0;var o=r(7601);t.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.concat.apply(void 0,i([],n(e)))}},1483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;var n=r(2483),i=r(9445),o=r(7843),s=r(6824),a={connector:function(){return new n.Subject}};t.connect=function(e,t){void 0===t&&(t=a);var r=t.connector;return o.operate((function(t,n){var o=r();i.innerFrom(e(s.fromSubscribable(o))).subscribe(n),n.add(t.subscribe(o))}))}},1038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.count=void 0;var n=r(9139);t.count=function(e){return n.reduce((function(t,r,n){return!e||e(r,n)?t+1:t}),0)}},6842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=void 0;var n=r(7843),i=r(1342),o=r(3111),s=r(9445);t.debounce=function(e){return n.operate((function(t,r){var n=!1,a=null,c=null,u=function(){if(null==c||c.unsubscribe(),c=null,n){n=!1;var e=a;a=null,r.next(e)}};t.subscribe(o.createOperatorSubscriber(r,(function(t){null==c||c.unsubscribe(),n=!0,a=t,c=o.createOperatorSubscriber(r,u,i.noop),s.innerFrom(e(t)).subscribe(c)}),(function(){u(),r.complete()}),void 0,(function(){a=c=null})))}))}},8079:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounceTime=void 0;var n=r(7961),i=r(7843),o=r(3111);t.debounceTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.operate((function(r,n){var i=null,s=null,a=null,c=function(){if(i){i.unsubscribe(),i=null;var e=s;s=null,n.next(e)}};function u(){var r=a+e,o=t.now();if(o<r)return i=this.schedule(void 0,r-o),void n.add(i);c()}r.subscribe(o.createOperatorSubscriber(n,(function(r){s=r,a=t.now(),i||(i=t.schedule(u,e),n.add(i))}),(function(){c(),n.complete()}),void 0,(function(){s=i=null})))}))}},378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultIfEmpty=void 0;var n=r(7843),i=r(3111);t.defaultIfEmpty=function(e){return n.operate((function(t,r){var n=!1;t.subscribe(i.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}},914:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0;var n=r(7961),i=r(8766),o=r(4092);t.delay=function(e,t){void 0===t&&(t=n.asyncScheduler);var r=o.timer(e,t);return i.delayWhen((function(){return r}))}},8766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayWhen=void 0;var n=r(3865),i=r(846),o=r(490),s=r(3218),a=r(983),c=r(9445);t.delayWhen=function e(t,r){return r?function(s){return n.concat(r.pipe(i.take(1),o.ignoreElements()),s.pipe(e(t)))}:a.mergeMap((function(e,r){return c.innerFrom(t(e,r)).pipe(i.take(1),s.mapTo(e))}))}},7441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dematerialize=void 0;var n=r(7800),i=r(7843),o=r(3111);t.dematerialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){return n.observeNotification(e,t)})))}))}},5365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinct=void 0;var n=r(7843),i=r(3111),o=r(1342),s=r(9445);t.distinct=function(e,t){return n.operate((function(r,n){var a=new Set;r.subscribe(i.createOperatorSubscriber(n,(function(t){var r=e?e(t):t;a.has(r)||(a.add(r),n.next(t))}))),t&&s.innerFrom(t).subscribe(i.createOperatorSubscriber(n,(function(){return a.clear()}),o.noop))}))}},8937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilChanged=void 0;var n=r(6640),i=r(7843),o=r(3111);function s(e,t){return e===t}t.distinctUntilChanged=function(e,t){return void 0===t&&(t=n.identity),e=null!=e?e:s,i.operate((function(r,n){var i,s=!0;r.subscribe(o.createOperatorSubscriber(n,(function(r){var o=t(r);!s&&e(i,o)||(s=!1,i=o,n.next(r))})))}))}},9612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.distinctUntilKeyChanged=void 0;var n=r(8937);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))}},4520:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementAt=void 0;var n=r(7057),i=r(783),o=r(4869),s=r(378),a=r(846);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(c){return c.pipe(i.filter((function(t,r){return r===e})),a.take(1),r?s.defaultIfEmpty(t):o.throwIfEmpty((function(){return new n.ArgumentOutOfRangeError})))}}},1776:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.endWith=void 0;var o=r(3865),s=r(1004);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return o.concat(t,s.of.apply(void 0,i([],n(e))))}}},5510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.every=void 0;var n=r(7843),i=r(3111);t.every=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(i){e.call(t,i,o++,r)||(n.next(!1),n.complete())}),(function(){n.next(!0),n.complete()})))}))}},1551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaust=void 0;var n=r(2752);t.exhaust=n.exhaustAll},2752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustAll=void 0;var n=r(4753),i=r(6640);t.exhaustAll=function(){return n.exhaustMap(i.identity)}},4753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exhaustMap=void 0;var n=r(5471),i=r(9445),o=r(7843),s=r(3111);t.exhaustMap=function e(t,r){return r?function(o){return o.pipe(e((function(e,o){return i.innerFrom(t(e,o)).pipe(n.map((function(t,n){return r(e,t,o,n)})))})))}:o.operate((function(e,r){var n=0,o=null,a=!1;e.subscribe(s.createOperatorSubscriber(r,(function(e){o||(o=s.createOperatorSubscriber(r,void 0,(function(){o=null,a&&r.complete()})),i.innerFrom(t(e,n++)).subscribe(o))}),(function(){a=!0,!o&&r.complete()})))}))}},7661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expand=void 0;var n=r(7843),i=r(1983);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=(t||0)<1?1/0:t,n.operate((function(n,o){return i.mergeInternals(n,o,e,t,void 0,!0,r)}))}},783:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filter=void 0;var n=r(7843),i=r(3111);t.filter=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){return e.call(t,r,o++)&&n.next(r)})))}))}},3555:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.finalize=void 0;var n=r(7843);t.finalize=function(e){return n.operate((function(t,r){try{t.subscribe(r)}finally{r.add(e)}}))}},7714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFind=t.find=void 0;var n=r(7843),i=r(3111);function o(e,t,r){var n="index"===r;return function(r,o){var s=0;r.subscribe(i.createOperatorSubscriber(o,(function(i){var a=s++;e.call(t,i,a,r)&&(o.next(n?a:i),o.complete())}),(function(){o.next(n?-1:void 0),o.complete()})))}}t.find=function(e,t){return n.operate(o(e,t,"value"))},t.createFind=o},9756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findIndex=void 0;var n=r(7843),i=r(7714);t.findIndex=function(e,t){return n.operate(i.createFind(e,t,"index"))}},8275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.first=void 0;var n=r(5204),i=r(783),o=r(846),s=r(378),a=r(4869),c=r(6640);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.take(1),r?s.defaultIfEmpty(t):a.throwIfEmpty((function(){return new n.EmptyError})))}}},6902:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var n=r(983);t.flatMap=n.mergeMap},7815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=void 0;var n=r(4662),i=r(9445),o=r(2483),s=r(7843),a=r(3111);t.groupBy=function(e,t,r,c){return s.operate((function(s,u){var l;t&&"function"!=typeof t?(r=t.duration,l=t.element,c=t.connector):l=t;var d=new Map,f=function(e){d.forEach(e),e(u)},h=function(e){return f((function(t){return t.error(e)}))},p=0,b=!1,m=new a.OperatorSubscriber(u,(function(t){try{var s=e(t),f=d.get(s);if(!f){d.set(s,f=c?c():new o.Subject);var g=(y=s,_=f,(E=new n.Observable((function(e){p++;var t=_.subscribe(e);return function(){t.unsubscribe(),0==--p&&b&&m.unsubscribe()}}))).key=y,E);if(u.next(g),r){var v=a.createOperatorSubscriber(f,(function(){f.complete(),null==v||v.unsubscribe()}),void 0,void 0,(function(){return d.delete(s)}));m.add(i.innerFrom(r(g)).subscribe(v))}}f.next(l?l(t):t)}catch(e){h(e)}var y,_,E}),(function(){return f((function(e){return e.complete()}))}),h,(function(){return d.clear()}),(function(){return b=!0,0===p}));s.subscribe(m)}))}},490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreElements=void 0;var n=r(7843),i=r(3111),o=r(1342);t.ignoreElements=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,o.noop))}))}},9356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=void 0;var n=r(7843),i=r(3111);t.isEmpty=function(){return n.operate((function(e,t){e.subscribe(i.createOperatorSubscriber(t,(function(){t.next(!1),t.complete()}),(function(){t.next(!0),t.complete()})))}))}},3638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinAllInternals=void 0;var n=r(6640),i=r(1251),o=r(2706),s=r(983),a=r(2343);t.joinAllInternals=function(e,t){return o.pipe(a.toArray(),s.mergeMap((function(t){return e(t)})),t?i.mapOneOrManyArgs(t):n.identity)}},8669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.last=void 0;var n=r(5204),i=r(783),o=r(8330),s=r(4869),a=r(378),c=r(6640);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter((function(t,r){return e(t,r,u)})):c.identity,o.takeLast(1),r?a.defaultIfEmpty(t):s.throwIfEmpty((function(){return new n.EmptyError})))}}},5471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=void 0;var n=r(7843),i=r(3111);t.map=function(e,t){return n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){n.next(e.call(t,r,o++))})))}))}},3218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapTo=void 0;var n=r(5471);t.mapTo=function(e){return n.map((function(){return e}))}},2360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materialize=void 0;var n=r(7800),i=r(7843),o=r(3111);t.materialize=function(){return i.operate((function(e,t){e.subscribe(o.createOperatorSubscriber(t,(function(e){t.next(n.Notification.createNext(e))}),(function(){t.next(n.Notification.createComplete()),t.complete()}),(function(e){t.next(n.Notification.createError(e)),t.complete()})))}))}},1415:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.max=void 0;var n=r(9139),i=r(1018);t.max=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},361:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;var o=r(7843),s=r(8535),a=r(7302),c=r(1107),u=r(4917);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=c.popScheduler(e),l=c.popNumber(e,1/0);return e=s.argsOrArgArray(e),o.operate((function(t,o){a.mergeAll(l)(u.from(i([t],n(e)),r)).subscribe(o)}))}},7302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=void 0;var n=r(983),i=r(6640);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},1983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeInternals=void 0;var n=r(9445),i=r(7110),o=r(3111);t.mergeInternals=function(e,t,r,s,a,c,u,l){var d=[],f=0,h=0,p=!1,b=function(){!p||d.length||f||t.complete()},m=function(e){return f<s?g(e):d.push(e)},g=function(e){c&&t.next(e),f++;var l=!1;n.innerFrom(r(e,h++)).subscribe(o.createOperatorSubscriber(t,(function(e){null==a||a(e),c?m(e):t.next(e)}),(function(){l=!0}),void 0,(function(){if(l)try{f--;for(var e=function(){var e=d.shift();u?i.executeSchedule(t,u,(function(){return g(e)})):g(e)};d.length&&f<s;)e();b()}catch(e){t.error(e)}})))};return e.subscribe(o.createOperatorSubscriber(t,m,(function(){p=!0,b()}))),function(){null==l||l()}}},983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMap=void 0;var n=r(5471),i=r(9445),o=r(7843),s=r(1983),a=r(1018);t.mergeMap=function e(t,r,c){return void 0===c&&(c=1/0),a.isFunction(r)?e((function(e,o){return n.map((function(t,n){return r(e,t,o,n)}))(i.innerFrom(t(e,o)))}),c):("number"==typeof r&&(c=r),o.operate((function(e,r){return s.mergeInternals(e,r,t,c)})))}},6586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMapTo=void 0;var n=r(983),i=r(1018);t.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),i.isFunction(t)?n.mergeMap((function(){return e}),t,r):("number"==typeof t&&(r=t),n.mergeMap((function(){return e}),r))}},4408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeScan=void 0;var n=r(7843),i=r(1983);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),n.operate((function(n,o){var s=t;return i.mergeInternals(n,o,(function(t,r){return e(s,t,r)}),r,(function(e){s=e}),!1,void 0,(function(){return s=null}))}))}},8253:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mergeWith=void 0;var o=r(361);t.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.merge.apply(void 0,i([],n(e)))}},2669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.min=void 0;var n=r(9139),i=r(1018);t.min=function(e){return n.reduce(i.isFunction(e)?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t})}},9247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multicast=void 0;var n=r(8918),i=r(1018),o=r(1483);t.multicast=function(e,t){var r=i.isFunction(e)?e:function(){return e};return i.isFunction(t)?o.connect(t,{connector:r}):function(e){return new n.ConnectableObservable(e,r)}}},5184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observeOn=void 0;var n=r(7110),i=r(7843),o=r(3111);t.observeOn=function(e,t){return void 0===t&&(t=0),i.operate((function(r,i){r.subscribe(o.createOperatorSubscriber(i,(function(r){return n.executeSchedule(i,e,(function(){return i.next(r)}),t)}),(function(){return n.executeSchedule(i,e,(function(){return i.complete()}),t)}),(function(r){return n.executeSchedule(i,e,(function(){return i.error(r)}),t)})))}))}},1226:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.onErrorResumeNext=t.onErrorResumeNextWith=void 0;var o=r(8535),s=r(6102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.argsOrArgArray(e);return function(e){return s.onErrorResumeNext.apply(void 0,i([e],n(r)))}}t.onErrorResumeNextWith=a,t.onErrorResumeNext=a},1518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pairwise=void 0;var n=r(7843),i=r(3111);t.pairwise=function(){return n.operate((function(e,t){var r,n=!1;e.subscribe(i.createOperatorSubscriber(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))}))}},2171:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.partition=void 0;var n=r(245),i=r(783);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},4912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pluck=void 0;var n=r(5471);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return n.map((function(t){for(var n=t,i=0;i<r;i++){var o=null==n?void 0:n[e[i]];if(void 0===o)return;n=o}return n}))}},766:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publish=void 0;var n=r(2483),i=r(9247),o=r(1483);t.publish=function(e){return e?function(t){return o.connect(e)(t)}:function(e){return i.multicast(new n.Subject)(e)}}},7220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishBehavior=void 0;var n=r(1637),i=r(8918);t.publishBehavior=function(e){return function(t){var r=new n.BehaviorSubject(e);return new i.ConnectableObservable(t,(function(){return r}))}}},6106:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishLast=void 0;var n=r(95),i=r(8918);t.publishLast=function(){return function(e){var t=new n.AsyncSubject;return new i.ConnectableObservable(e,(function(){return t}))}}},8157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.publishReplay=void 0;var n=r(1242),i=r(9247),o=r(1018);t.publishReplay=function(e,t,r,s){r&&!o.isFunction(r)&&(s=r);var a=o.isFunction(r)?r:void 0;return function(r){return i.multicast(new n.ReplaySubject(e,t,s),a)(r)}}},4440:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.race=void 0;var o=r(8535),s=r(5600);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.raceWith.apply(void 0,i([],n(o.argsOrArgArray(e))))}},5600:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.raceWith=void 0;var o=r(5584),s=r(7843),a=r(6640);t.raceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length?s.operate((function(t,r){o.raceInit(i([t],n(e)))(r)})):a.identity}},9139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reduce=void 0;var n=r(6384),i=r(7843);t.reduce=function(e,t){return i.operate(n.scanInternals(e,t,arguments.length>=2,!1,!0))}},7561:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refCount=void 0;var n=r(7843),i=r(3111);t.refCount=function(){return n.operate((function(e,t){var r=null;e._refCount++;var n=i.createOperatorSubscriber(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}},8522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeat=void 0;var n=r(8616),i=r(7843),o=r(3111),s=r(9445),a=r(4092);t.repeat=function(e){var t,r,c=1/0;return null!=e&&("object"==typeof e?(t=e.count,c=void 0===t?1/0:t,r=e.delay):c=e),c<=0?function(){return n.EMPTY}:i.operate((function(e,t){var n,i=0,u=function(){if(null==n||n.unsubscribe(),n=null,null!=r){var e="number"==typeof r?a.timer(r):s.innerFrom(r(i)),c=o.createOperatorSubscriber(t,(function(){c.unsubscribe(),l()}));e.subscribe(c)}else l()},l=function(){var r=!1;n=e.subscribe(o.createOperatorSubscriber(t,void 0,(function(){++i<c?n?u():r=!0:t.complete()}))),r&&u()};l()}))}},6566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repeatWhen=void 0;var n=r(9445),i=r(2483),o=r(7843),s=r(3111);t.repeatWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=!1,l=!1,d=function(){return l&&u&&(r.complete(),!0)},f=function(){l=!1,o=t.subscribe(s.createOperatorSubscriber(r,void 0,(function(){l=!0,!d()&&(a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){o?f():c=!0}),(function(){u=!0,d()})))),a).next()}))),c&&(o.unsubscribe(),o=null,c=!1,f())};f()}))}},7835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retry=void 0;var n=r(7843),i=r(3111),o=r(6640),s=r(4092),a=r(9445);t.retry=function(e){var t;void 0===e&&(e=1/0);var r=(t=e&&"object"==typeof e?e:{count:e}).count,c=void 0===r?1/0:r,u=t.delay,l=t.resetOnSuccess,d=void 0!==l&&l;return c<=0?o.identity:n.operate((function(e,t){var r,n=0,o=function(){var l=!1;r=e.subscribe(i.createOperatorSubscriber(t,(function(e){d&&(n=0),t.next(e)}),void 0,(function(e){if(n++<c){var d=function(){r?(r.unsubscribe(),r=null,o()):l=!0};if(null!=u){var f="number"==typeof u?s.timer(u):a.innerFrom(u(e,n)),h=i.createOperatorSubscriber(t,(function(){h.unsubscribe(),d()}),(function(){t.complete()}));f.subscribe(h)}else d()}else t.error(e)}))),l&&(r.unsubscribe(),r=null,o())};o()}))}},9843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryWhen=void 0;var n=r(9445),i=r(2483),o=r(7843),s=r(3111);t.retryWhen=function(e){return o.operate((function(t,r){var o,a,c=!1,u=function(){o=t.subscribe(s.createOperatorSubscriber(r,void 0,void 0,(function(t){a||(a=new i.Subject,n.innerFrom(e(a)).subscribe(s.createOperatorSubscriber(r,(function(){return o?u():c=!0})))),a&&a.next(t)}))),c&&(o.unsubscribe(),o=null,c=!1,u())};u()}))}},1731:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sample=void 0;var n=r(9445),i=r(7843),o=r(1342),s=r(3111);t.sample=function(e){return i.operate((function(t,r){var i=!1,a=null;t.subscribe(s.createOperatorSubscriber(r,(function(e){i=!0,a=e}))),n.innerFrom(e).subscribe(s.createOperatorSubscriber(r,(function(){if(i){i=!1;var e=a;a=null,r.next(e)}}),o.noop))}))}},6086:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sampleTime=void 0;var n=r(7961),i=r(1731),o=r(6472);t.sampleTime=function(e,t){return void 0===t&&(t=n.asyncScheduler),i.sample(o.interval(e,t))}},8624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scan=void 0;var n=r(7843),i=r(6384);t.scan=function(e,t){return n.operate(i.scanInternals(e,t,arguments.length>=2,!0))}},6384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanInternals=void 0;var n=r(3111);t.scanInternals=function(e,t,r,i,o){return function(s,a){var c=r,u=t,l=0;s.subscribe(n.createOperatorSubscriber(a,(function(t){var r=l++;u=c?e(u,t,r):(c=!0,t),i&&a.next(u)}),o&&function(){c&&a.next(u),a.complete()}))}}},582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sequenceEqual=void 0;var n=r(7843),i=r(3111),o=r(9445);t.sequenceEqual=function(e,t){return void 0===t&&(t=function(e,t){return e===t}),n.operate((function(r,n){var s={buffer:[],complete:!1},a={buffer:[],complete:!1},c=function(e){n.next(e),n.complete()},u=function(e,r){var o=i.createOperatorSubscriber(n,(function(n){var i=r.buffer,o=r.complete;0===i.length?o?c(!1):e.buffer.push(n):!t(n,i.shift())&&c(!1)}),(function(){e.complete=!0;var t=r.complete,n=r.buffer;t&&c(0===n.length),null==o||o.unsubscribe()}));return o};r.subscribe(u(s,a)),o.innerFrom(e).subscribe(u(a,s))}))}},8977:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.share=void 0;var o=r(9445),s=r(2483),a=r(5),c=r(7843);function u(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0!==t){if(!1!==t){var c=new a.SafeSubscriber({next:function(){c.unsubscribe(),e()}});return o.innerFrom(t.apply(void 0,i([],n(r)))).subscribe(c)}}else e()}t.share=function(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.Subject}:t,n=e.resetOnError,i=void 0===n||n,l=e.resetOnComplete,d=void 0===l||l,f=e.resetOnRefCountZero,h=void 0===f||f;return function(e){var t,n,s,l=0,f=!1,p=!1,b=function(){null==n||n.unsubscribe(),n=void 0},m=function(){b(),t=s=void 0,f=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return c.operate((function(e,c){l++,p||f||b();var v=s=null!=s?s:r();c.add((function(){0!==--l||p||f||(n=u(g,h))})),v.subscribe(c),!t&&l>0&&(t=new a.SafeSubscriber({next:function(e){return v.next(e)},error:function(e){p=!0,b(),n=u(m,i,e),v.error(e)},complete:function(){f=!0,b(),n=u(m,d),v.complete()}}),o.innerFrom(e).subscribe(t))}))(e)}}},3133:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shareReplay=void 0;var n=r(1242),i=r(8977);t.shareReplay=function(e,t,r){var o,s,a,c,u=!1;return e&&"object"==typeof e?(o=e.bufferSize,c=void 0===o?1/0:o,s=e.windowTime,t=void 0===s?1/0:s,u=void 0!==(a=e.refCount)&&a,r=e.scheduler):c=null!=e?e:1/0,i.share({connector:function(){return new n.ReplaySubject(c,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}},3001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.single=void 0;var n=r(5204),i=r(1505),o=r(1759),s=r(7843),a=r(3111);t.single=function(e){return s.operate((function(t,r){var s,c=!1,u=!1,l=0;t.subscribe(a.createOperatorSubscriber(r,(function(n){u=!0,e&&!e(n,l++,t)||(c&&r.error(new i.SequenceError("Too many matching values")),c=!0,s=n)}),(function(){c?(r.next(s),r.complete()):r.error(u?new o.NotFoundError("No matching values"):new n.EmptyError)})))}))}},3982:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skip=void 0;var n=r(783);t.skip=function(e){return n.filter((function(t,r){return e<=r}))}},9098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipLast=void 0;var n=r(6640),i=r(7843),o=r(3111);t.skipLast=function(e){return e<=0?n.identity:i.operate((function(t,r){var n=new Array(e),i=0;return t.subscribe(o.createOperatorSubscriber(r,(function(t){var o=i++;if(o<e)n[o]=t;else{var s=o%e,a=n[s];n[s]=t,r.next(a)}}))),function(){n=null}}))}},7372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipUntil=void 0;var n=r(7843),i=r(3111),o=r(9445),s=r(1342);t.skipUntil=function(e){return n.operate((function(t,r){var n=!1,a=i.createOperatorSubscriber(r,(function(){null==a||a.unsubscribe(),n=!0}),s.noop);o.innerFrom(e).subscribe(a),t.subscribe(i.createOperatorSubscriber(r,(function(e){return n&&r.next(e)})))}))}},4721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.skipWhile=void 0;var n=r(7843),i=r(3111);t.skipWhile=function(e){return n.operate((function(t,r){var n=!1,o=0;t.subscribe(i.createOperatorSubscriber(r,(function(t){return(n||(n=!e(t,o++)))&&r.next(t)})))}))}},269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startWith=void 0;var n=r(3865),i=r(1107),o=r(7843);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=i.popScheduler(e);return o.operate((function(t,i){(r?n.concat(e,t,r):n.concat(e,t)).subscribe(i)}))}},8960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeOn=void 0;var n=r(7843);t.subscribeOn=function(e,t){return void 0===t&&(t=0),n.operate((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}},8774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchAll=void 0;var n=r(3879),i=r(6640);t.switchAll=function(){return n.switchMap(i.identity)}},3879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMap=void 0;var n=r(9445),i=r(7843),o=r(3111);t.switchMap=function(e,t){return i.operate((function(r,i){var s=null,a=0,c=!1,u=function(){return c&&!s&&i.complete()};r.subscribe(o.createOperatorSubscriber(i,(function(r){null==s||s.unsubscribe();var c=0,l=a++;n.innerFrom(e(r,l)).subscribe(s=o.createOperatorSubscriber(i,(function(e){return i.next(t?t(r,e,l,c++):e)}),(function(){s=null,u()})))}),(function(){c=!0,u()})))}))}},3274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var n=r(3879),i=r(1018);t.switchMapTo=function(e,t){return i.isFunction(t)?n.switchMap((function(){return e}),t):n.switchMap((function(){return e}))}},8712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchScan=void 0;var n=r(3879),i=r(7843);t.switchScan=function(e,t){return i.operate((function(r,i){var o=t;return n.switchMap((function(t,r){return e(o,t,r)}),(function(e,t){return o=t,t}))(r).subscribe(i),function(){o=null}}))}},846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.take=void 0;var n=r(8616),i=r(7843),o=r(3111);t.take=function(e){return e<=0?function(){return n.EMPTY}:i.operate((function(t,r){var n=0;t.subscribe(o.createOperatorSubscriber(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}},8330:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.takeLast=void 0;var i=r(8616),o=r(7843),s=r(3111);t.takeLast=function(e){return e<=0?function(){return i.EMPTY}:o.operate((function(t,r){var i=[];t.subscribe(s.createOperatorSubscriber(r,(function(t){i.push(t),e<i.length&&i.shift()}),(function(){var e,t;try{for(var o=n(i),s=o.next();!s.done;s=o.next()){var a=s.value;r.next(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}r.complete()}),void 0,(function(){i=null})))}))}},4780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeUntil=void 0;var n=r(7843),i=r(3111),o=r(9445),s=r(1342);t.takeUntil=function(e){return n.operate((function(t,r){o.innerFrom(e).subscribe(i.createOperatorSubscriber(r,(function(){return r.complete()}),s.noop)),!r.closed&&t.subscribe(r)}))}},2129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0;var n=r(7843),i=r(3111);t.takeWhile=function(e,t){return void 0===t&&(t=!1),n.operate((function(r,n){var o=0;r.subscribe(i.createOperatorSubscriber(n,(function(r){var i=e(r,o++);(i||t)&&n.next(r),!i&&n.complete()})))}))}},3964:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tap=void 0;var n=r(1018),i=r(7843),o=r(3111),s=r(6640);t.tap=function(e,t,r){var a=n.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return a?i.operate((function(e,t){var r;null===(r=a.subscribe)||void 0===r||r.call(a);var n=!0;e.subscribe(o.createOperatorSubscriber(t,(function(e){var r;null===(r=a.next)||void 0===r||r.call(a,e),t.next(e)}),(function(){var e;n=!1,null===(e=a.complete)||void 0===e||e.call(a),t.complete()}),(function(e){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,e),t.error(e)}),(function(){var e,t;n&&(null===(e=a.unsubscribe)||void 0===e||e.call(a)),null===(t=a.finalize)||void 0===t||t.call(a)})))})):s.identity}},8941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=void 0;var n=r(7843),i=r(3111),o=r(9445);t.throttle=function(e,t){return n.operate((function(r,n){var s=null!=t?t:{},a=s.leading,c=void 0===a||a,u=s.trailing,l=void 0!==u&&u,d=!1,f=null,h=null,p=!1,b=function(){null==h||h.unsubscribe(),h=null,l&&(v(),p&&n.complete())},m=function(){h=null,p&&n.complete()},g=function(t){return h=o.innerFrom(e(t)).subscribe(i.createOperatorSubscriber(n,b,m))},v=function(){if(d){d=!1;var e=f;f=null,n.next(e),!p&&g(e)}};r.subscribe(i.createOperatorSubscriber(n,(function(e){d=!0,f=e,(!h||h.closed)&&(c?v():g(e))}),(function(){p=!0,(!(l&&d&&h)||h.closed)&&n.complete()})))}))}},7640:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throttleTime=void 0;var n=r(7961),i=r(8941),o=r(4092);t.throttleTime=function(e,t,r){void 0===t&&(t=n.asyncScheduler);var s=o.timer(e,t);return i.throttle((function(){return s}),r)}},4869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfEmpty=void 0;var n=r(5204),i=r(7843),o=r(3111);function s(){return new n.EmptyError}t.throwIfEmpty=function(e){return void 0===e&&(e=s),i.operate((function(t,r){var n=!1;t.subscribe(o.createOperatorSubscriber(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}},489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeInterval=t.timeInterval=void 0;var n=r(7961),i=r(7843),o=r(3111);t.timeInterval=function(e){return void 0===e&&(e=n.asyncScheduler),i.operate((function(t,r){var n=e.now();t.subscribe(o.createOperatorSubscriber(r,(function(t){var i=e.now(),o=i-n;n=i,r.next(new s(t,o))})))}))};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},1554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeout=t.TimeoutError=void 0;var n=r(7961),i=r(1074),o=r(7843),s=r(9445),a=r(5568),c=r(3111),u=r(7110);function l(e){throw new t.TimeoutError(e)}t.TimeoutError=a.createErrorClass((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}})),t.timeout=function(e,t){var r=i.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e,a=r.first,d=r.each,f=r.with,h=void 0===f?l:f,p=r.scheduler,b=void 0===p?null!=t?t:n.asyncScheduler:p,m=r.meta,g=void 0===m?null:m;if(null==a&&null==d)throw new TypeError("No timeout provided.");return o.operate((function(e,t){var r,n,i=null,o=0,l=function(e){n=u.executeSchedule(t,b,(function(){try{r.unsubscribe(),s.innerFrom(h({meta:g,lastValue:i,seen:o})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(c.createOperatorSubscriber(t,(function(e){null==n||n.unsubscribe(),o++,t.next(i=e),d>0&&l(d)}),void 0,void 0,(function(){(null==n?void 0:n.closed)||null==n||n.unsubscribe(),i=null}))),!o&&l(null!=a?"number"==typeof a?a:+a-b.now():d)}))}},4862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutWith=void 0;var n=r(7961),i=r(1074),o=r(1554);t.timeoutWith=function(e,t,r){var s,a,c;if(r=null!=r?r:n.async,i.isValidDate(e)?s=e:"number"==typeof e&&(a=e),!t)throw new TypeError("No observable provided to switch to");if(c=function(){return t},null==s&&null==a)throw new TypeError("No timeout provided.");return o.timeout({first:s,each:a,scheduler:r,with:c})}},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timestamp=void 0;var n=r(9568),i=r(5471);t.timestamp=function(e){return void 0===e&&(e=n.dateTimestampProvider),i.map((function(t){return{value:t,timestamp:e.now()}}))}},2343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=void 0;var n=r(9139),i=r(7843),o=function(e,t){return e.push(t),e};t.toArray=function(){return i.operate((function(e,t){n.reduce(o,[])(e).subscribe(t)}))}},5477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.window=void 0;var n=r(2483),i=r(7843),o=r(3111),s=r(1342),a=r(9445);t.window=function(e){return i.operate((function(t,r){var i=new n.Subject;r.next(i.asObservable());var c=function(e){i.error(e),r.error(e)};return t.subscribe(o.createOperatorSubscriber(r,(function(e){return null==i?void 0:i.next(e)}),(function(){i.complete(),r.complete()}),c)),a.innerFrom(e).subscribe(o.createOperatorSubscriber(r,(function(){i.complete(),r.next(i=new n.Subject)}),s.noop,c)),function(){null==i||i.unsubscribe(),i=null}}))}},6746:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowCount=void 0;var i=r(2483),o=r(7843),s=r(3111);t.windowCount=function(e,t){void 0===t&&(t=0);var r=t>0?t:e;return o.operate((function(t,o){var a=[new i.Subject],c=0;o.next(a[0].asObservable()),t.subscribe(s.createOperatorSubscriber(o,(function(t){var s,u;try{for(var l=n(a),d=l.next();!d.done;d=l.next()){d.value.next(t)}}catch(e){s={error:e}}finally{try{d&&!d.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}var f=c-e+1;if(f>=0&&f%r==0&&a.shift().complete(),++c%r==0){var h=new i.Subject;a.push(h),o.next(h.asObservable())}}),(function(){for(;a.length>0;)a.shift().complete();o.complete()}),(function(e){for(;a.length>0;)a.shift().error(e);o.error(e)}),(function(){a=null})))}))}},8208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowTime=void 0;var n=r(2483),i=r(7961),o=r(8014),s=r(7843),a=r(3111),c=r(7479),u=r(1107),l=r(7110);t.windowTime=function(e){for(var t,r,d=[],f=1;f<arguments.length;f++)d[f-1]=arguments[f];var h=null!==(t=u.popScheduler(d))&&void 0!==t?t:i.asyncScheduler,p=null!==(r=d[0])&&void 0!==r?r:null,b=d[1]||1/0;return s.operate((function(t,r){var i=[],s=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),c.arrRemove(i,e),s&&d()},d=function(){if(i){var t=new o.Subscription;r.add(t);var s=new n.Subject,a={window:s,subs:t,seen:0};i.push(a),r.next(s.asObservable()),l.executeSchedule(t,h,(function(){return u(a)}),e)}};null!==p&&p>=0?l.executeSchedule(r,h,d,p,!0):s=!0,d();var f=function(e){return i.slice().forEach(e)},m=function(e){f((function(t){var r=t.window;return e(r)})),e(r),r.unsubscribe()};return t.subscribe(a.createOperatorSubscriber(r,(function(e){f((function(t){t.window.next(e),b<=++t.seen&&u(t)}))}),(function(){return m((function(e){return e.complete()}))}),(function(e){return m((function(t){return t.error(e)}))}))),function(){i=null}}))}},6637:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.windowToggle=void 0;var i=r(2483),o=r(8014),s=r(7843),a=r(9445),c=r(3111),u=r(1342),l=r(7479);t.windowToggle=function(e,t){return s.operate((function(r,s){var d=[],f=function(e){for(;0<d.length;)d.shift().error(e);s.error(e)};a.innerFrom(e).subscribe(c.createOperatorSubscriber(s,(function(e){var r=new i.Subject;d.push(r);var n,h=new o.Subscription;try{n=a.innerFrom(t(e))}catch(e){return void f(e)}s.next(r.asObservable()),h.add(n.subscribe(c.createOperatorSubscriber(s,(function(){l.arrRemove(d,r),r.complete(),h.unsubscribe()}),u.noop,f)))}),u.noop)),r.subscribe(c.createOperatorSubscriber(s,(function(e){var t,r,i=d.slice();try{for(var o=n(i),s=o.next();!s.done;s=o.next()){s.value.next(e)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}),(function(){for(;0<d.length;)d.shift().complete();s.complete()}),f,(function(){for(;0<d.length;)d.shift().unsubscribe()})))}))}},1141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.windowWhen=void 0;var n=r(2483),i=r(7843),o=r(3111),s=r(9445);t.windowWhen=function(e){return i.operate((function(t,r){var i,a,c=function(e){i.error(e),r.error(e)},u=function(){var t;null==a||a.unsubscribe(),null==i||i.complete(),i=new n.Subject,r.next(i.asObservable());try{t=s.innerFrom(e())}catch(e){return void c(e)}t.subscribe(a=o.createOperatorSubscriber(r,u,u,c))};u(),t.subscribe(o.createOperatorSubscriber(r,(function(e){return i.next(e)}),(function(){i.complete(),r.complete()}),c,(function(){null==a||a.unsubscribe(),i=null})))}))}},5442:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.withLatestFrom=void 0;var o=r(7843),s=r(3111),a=r(9445),c=r(6640),u=r(1342),l=r(1107);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l.popResultSelector(e);return o.operate((function(t,o){for(var l=e.length,d=new Array(l),f=e.map((function(){return!1})),h=!1,p=function(t){a.innerFrom(e[t]).subscribe(s.createOperatorSubscriber(o,(function(e){d[t]=e,h||f[t]||(f[t]=!0,(h=f.every(c.identity))&&(f=null))}),u.noop))},b=0;b<l;b++)p(b);t.subscribe(s.createOperatorSubscriber(o,(function(e){if(h){var t=i([e],n(d));o.next(r?r.apply(void 0,i([],n(t))):t)}})))}))}},5918:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zip=void 0;var o=r(7286),s=r(7843);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s.operate((function(t,r){o.zip.apply(void 0,i([t],n(e))).subscribe(r)}))}},187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zipAll=void 0;var n=r(7286),i=r(3638);t.zipAll=function(e){return i.joinAllInternals(n.zip,e)}},8538:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.zipWith=void 0;var o=r(5918);t.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.zip.apply(void 0,i([],n(e)))}},6985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleArray=void 0;var n=r(4662);t.scheduleArray=function(e,t){return new n.Observable((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}},854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAsyncIterable=void 0;var n=r(4662),i=r(7110);t.scheduleAsyncIterable=function(e,t){if(!e)throw new Error("Iterable cannot be null");return new n.Observable((function(r){i.executeSchedule(r,t,(function(){var n=e[Symbol.asyncIterator]();i.executeSchedule(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}},8808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleIterable=void 0;var n=r(4662),i=r(1964),o=r(1018),s=r(7110);t.scheduleIterable=function(e,t){return new n.Observable((function(r){var n;return s.executeSchedule(r,t,(function(){n=e[i.iterator](),s.executeSchedule(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return o.isFunction(null==n?void 0:n.return)&&n.return()}}))}},9567:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleObservable=void 0;var n=r(9445),i=r(5184),o=r(8960);t.scheduleObservable=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},9589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.schedulePromise=void 0;var n=r(9445),i=r(5184),o=r(8960);t.schedulePromise=function(e,t){return n.innerFrom(e).pipe(o.subscribeOn(t),i.observeOn(t))}},4953:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleReadableStreamLike=void 0;var n=r(854),i=r(9137);t.scheduleReadableStreamLike=function(e,t){return n.scheduleAsyncIterable(i.readableStreamLikeToAsyncGenerator(e),t)}},1656:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scheduled=void 0;var n=r(9567),i=r(9589),o=r(6985),s=r(8808),a=r(854),c=r(1116),u=r(7629),l=r(8046),d=r(6368),f=r(1358),h=r(7614),p=r(9137),b=r(4953);t.scheduled=function(e,t){if(null!=e){if(c.isInteropObservable(e))return n.scheduleObservable(e,t);if(l.isArrayLike(e))return o.scheduleArray(e,t);if(u.isPromise(e))return i.schedulePromise(e,t);if(f.isAsyncIterable(e))return a.scheduleAsyncIterable(e,t);if(d.isIterable(e))return s.scheduleIterable(e,t);if(p.isReadableStreamLike(e))return b.scheduleReadableStreamLike(e,t)}throw h.createInvalidObservableTypeError(e)}},4671:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0;var o=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(8014).Subscription);t.Action=o},2628:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameAction=void 0;var o=r(5267),s=r(9507),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.animationFrameProvider.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},t}(o.AsyncAction);t.AnimationFrameAction=a},3229:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnimationFrameScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(5648).AsyncScheduler);t.AnimationFrameScheduler=o},5006:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapAction=void 0;var o=r(5267),s=r(6293),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=s.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(s.immediateProvider.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(o.AsyncAction);t.AsapAction=a},827:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(r(5648).AsyncScheduler);t.AsapScheduler=o},5267:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=void 0;var o=r(4671),s=r(5649),a=r(7479),c=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.intervalProvider.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.intervalProvider.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,a.arrRemove(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(o.Action);t.AsyncAction=c},5648:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncScheduler=void 0;var o=r(8986),s=function(e){function t(t,r){void 0===r&&(r=o.Scheduler.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return i(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(o.Scheduler);t.AsyncScheduler=s},4212:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=void 0;var o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(r(5267).AsyncAction);t.QueueAction=o},1293:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(5648).AsyncScheduler);t.QueueScheduler=o},182:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualAction=t.VirtualTimeScheduler=void 0;var o=r(5267),s=r(8014),a=function(e){function t(t,r){void 0===t&&(t=c),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return i(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(r(5648).AsyncScheduler);t.VirtualTimeScheduler=a;var c=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return i(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return s.Subscription.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(o.AsyncAction);t.VirtualAction=c},3862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var n=r(2628),i=r(3229);t.animationFrameScheduler=new i.AnimationFrameScheduler(n.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler},9507:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrameProvider=void 0;var o=r(8014);t.animationFrameProvider={schedule:function(e){var r=requestAnimationFrame,n=cancelAnimationFrame,i=t.animationFrameProvider.delegate;i&&(r=i.requestAnimationFrame,n=i.cancelAnimationFrame);var s=r((function(t){n=void 0,e(t)}));return new o.Subscription((function(){return null==n?void 0:n(s)}))},requestAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.requestAnimationFrame)||requestAnimationFrame).apply(void 0,i([],n(e)))},cancelAnimationFrame:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.animationFrameProvider.delegate;return((null==o?void 0:o.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,i([],n(e)))},delegate:void 0}},3692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var n=r(5006),i=r(827);t.asapScheduler=new i.AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},7961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var n=r(5267),i=r(5648);t.asyncScheduler=new i.AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},9568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}},6293:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.immediateProvider=void 0;var o=r(7245),s=o.Immediate.setImmediate,a=o.Immediate.clearImmediate;t.immediateProvider={setImmediate:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=t.immediateProvider.delegate;return((null==o?void 0:o.setImmediate)||s).apply(void 0,i([],n(e)))},clearImmediate:function(e){var r=t.immediateProvider.delegate;return((null==r?void 0:r.clearImmediate)||a)(e)},delegate:void 0}},5649:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.intervalProvider=void 0,t.intervalProvider={setInterval:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.intervalProvider.delegate;return(null==a?void 0:a.setInterval)?a.setInterval.apply(a,n([e,i],r(o))):setInterval.apply(void 0,n([e,i],r(o)))},clearInterval:function(e){var r=t.intervalProvider.delegate;return((null==r?void 0:r.clearInterval)||clearInterval)(e)},delegate:void 0}},4746:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performanceTimestampProvider=void 0,t.performanceTimestampProvider={now:function(){return(t.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}},2886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var n=r(4212),i=r(1293);t.queueScheduler=new i.QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},9155:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},n=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.timeoutProvider=void 0,t.timeoutProvider={setTimeout:function(e,i){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a=t.timeoutProvider.delegate;return(null==a?void 0:a.setTimeout)?a.setTimeout.apply(a,n([e,i],r(o))):setTimeout.apply(void 0,n([e,i],r(o)))},clearTimeout:function(e){var r=t.timeoutProvider.delegate;return((null==r?void 0:r.clearTimeout)||clearTimeout)(e)},delegate:void 0}},1964:(e,t)=>{"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.iterator=t.getSymbolIterator=void 0,t.getSymbolIterator=r,t.iterator=r()},3327:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable=void 0,t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},6038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=void 0;var n=r(5568);t.ArgumentOutOfRangeError=n.createErrorClass((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}))},5204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=void 0;var n=r(5568);t.EmptyError=n.createErrorClass((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},7245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestTools=t.Immediate=void 0;var r,n=1,i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=n++;return i[t]=!0,r||(r=Promise.resolve()),r.then((function(){return o(t)&&e()})),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},1759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotFoundError=void 0;var n=r(5568);t.NotFoundError=n.createErrorClass((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}}))},9686:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=void 0;var n=r(5568);t.ObjectUnsubscribedError=n.createErrorClass((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}))},1505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequenceError=void 0;var n=r(5568);t.SequenceError=n.createErrorClass((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}))},5788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=void 0;var n=r(5568);t.UnsubscriptionError=n.createErrorClass((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}))},1107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.popNumber=t.popScheduler=t.popResultSelector=void 0;var n=r(1018),i=r(8613);function o(e){return e[e.length-1]}t.popResultSelector=function(e){return n.isFunction(o(e))?e.pop():void 0},t.popScheduler=function(e){return i.isScheduler(o(e))?e.pop():void 0},t.popNumber=function(e,t){return"number"==typeof o(e)?e.pop():t}},7360:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsArgArrayOrObject=void 0;var r=Array.isArray,n=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;t.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((a=t)&&"object"==typeof a&&n(a)===i){var s=o(t);return{args:s.map((function(e){return t[e]})),keys:s}}}var a;return{args:e,keys:null}}},8535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.argsOrArgArray=void 0;var r=Array.isArray;t.argsOrArgArray=function(e){return 1===e.length&&r(e[0])?e[0]:e}},7479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrRemove=void 0,t.arrRemove=function(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},5568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorClass=void 0,t.createErrorClass=function(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},6013:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObject=void 0,t.createObject=function(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.captureError=t.errorContext=void 0;var n=r(3413),i=null;t.errorContext=function(e){if(n.config.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()},t.captureError=function(e){n.config.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7110:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeSchedule=void 0,t.executeSchedule=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}},6640:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=void 0,t.identity=function(e){return e}},8046:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=void 0,t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},1358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=void 0;var n=r(1018);t.isAsyncIterable=function(e){return Symbol.asyncIterator&&n.isFunction(null==e?void 0:e[Symbol.asyncIterator])}},1074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidDate=void 0,t.isValidDate=function(e){return e instanceof Date&&!isNaN(e)}},1018:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e}},1116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInteropObservable=void 0;var n=r(3327),i=r(1018);t.isInteropObservable=function(e){return i.isFunction(e[n.observable])}},6368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterable=void 0;var n=r(1964),i=r(1018);t.isIterable=function(e){return i.isFunction(null==e?void 0:e[n.iterator])}},1751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObservable=void 0;var n=r(4662),i=r(1018);t.isObservable=function(e){return!!e&&(e instanceof n.Observable||i.isFunction(e.lift)&&i.isFunction(e.subscribe))}},7629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=void 0;var n=r(1018);t.isPromise=function(e){return n.isFunction(null==e?void 0:e.then)}},9137:function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},i=this&&this.__await||function(e){return this instanceof i?(this.v=e,this):new i(e)},o=this&&this.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof i?Promise.resolve(r.value.v).then(u,l):d(s[0][2],r)}catch(e){d(s[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function d(e,t){e(t),s.shift(),s.length&&c(s[0][0],s[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.isReadableStreamLike=t.readableStreamLikeToAsyncGenerator=void 0;var s=r(1018);t.readableStreamLikeToAsyncGenerator=function(e){return o(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,i(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,i(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,i(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))},t.isReadableStreamLike=function(e){return s.isFunction(null==e?void 0:e.getReader)}},8613:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=void 0;var n=r(1018);t.isScheduler=function(e){return e&&n.isFunction(e.schedule)}},7843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operate=t.hasLift=void 0;var n=r(1018);function i(e){return n.isFunction(null==e?void 0:e.lift)}t.hasLift=i,t.operate=function(e){return function(t){if(i(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},1251:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.mapOneOrManyArgs=void 0;var o=r(5471),s=Array.isArray;t.mapOneOrManyArgs=function(e){return o.map((function(t){return function(e,t){return s(t)?e.apply(void 0,i([],n(t))):e(t)}(e,t)}))}},1342:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){}},245:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=void 0,t.not=function(e,t){return function(r,n){return!e.call(t,r,n)}}},2706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pipeFromArray=t.pipe=void 0;var n=r(6640);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnhandledError=void 0;var n=r(3413),i=r(9155);t.reportUnhandledError=function(e){i.timeoutProvider.setTimeout((function(){var t=n.config.onUnhandledError;if(!t)throw e;t(e)}))}},7614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createInvalidObservableTypeError=void 0,t.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},9419:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0;var n=r(3146);Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return n.audit}});var i=r(3231);Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return i.auditTime}});var o=r(8015);Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return o.buffer}});var s=r(5572);Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return s.bufferCount}});var a=r(7210);Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return a.bufferTime}});var c=r(8995);Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return c.bufferToggle}});var u=r(8831);Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return u.bufferWhen}});var l=r(8118);Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return l.catchError}});var d=r(6625);Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return d.combineAll}});var f=r(6728);Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return f.combineLatestAll}});var h=r(2551);Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return h.combineLatest}});var p=r(8239);Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return p.combineLatestWith}});var b=r(7601);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return b.concat}});var m=r(8158);Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return m.concatAll}});var g=r(9135);Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return g.concatMap}});var v=r(9938);Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return v.concatMapTo}});var y=r(9669);Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return y.concatWith}});var _=r(1483);Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return _.connect}});var E=r(1038);Object.defineProperty(t,"count",{enumerable:!0,get:function(){return E.count}});var w=r(6842);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return w.debounce}});var O=r(8079);Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return O.debounceTime}});var A=r(378);Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return A.defaultIfEmpty}});var S=r(914);Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return S.delay}});var P=r(8766);Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return P.delayWhen}});var T=r(7441);Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return T.dematerialize}});var R=r(5365);Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return R.distinct}});var I=r(8937);Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return I.distinctUntilChanged}});var x=r(9612);Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return x.distinctUntilKeyChanged}});var M=r(4520);Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return M.elementAt}});var k=r(1776);Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return k.endWith}});var L=r(5510);Object.defineProperty(t,"every",{enumerable:!0,get:function(){return L.every}});var C=r(1551);Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return C.exhaust}});var N=r(2752);Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return N.exhaustAll}});var j=r(4753);Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return j.exhaustMap}});var D=r(7661);Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return D.expand}});var U=r(783);Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return U.filter}});var B=r(3555);Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return B.finalize}});var F=r(7714);Object.defineProperty(t,"find",{enumerable:!0,get:function(){return F.find}});var K=r(9756);Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return K.findIndex}});var H=r(8275);Object.defineProperty(t,"first",{enumerable:!0,get:function(){return H.first}});var G=r(7815);Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return G.groupBy}});var $=r(490);Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return $.ignoreElements}});var V=r(9356);Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return V.isEmpty}});var z=r(8669);Object.defineProperty(t,"last",{enumerable:!0,get:function(){return z.last}});var W=r(5471);Object.defineProperty(t,"map",{enumerable:!0,get:function(){return W.map}});var q=r(3218);Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return q.mapTo}});var Z=r(2360);Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return Z.materialize}});var Y=r(1415);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return Y.max}});var J=r(361);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return J.merge}});var X=r(7302);Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return X.mergeAll}});var Q=r(6902);Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return Q.flatMap}});var ee=r(983);Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return ee.mergeMap}});var te=r(6586);Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return te.mergeMapTo}});var re=r(4408);Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return re.mergeScan}});var ne=r(8253);Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return ne.mergeWith}});var ie=r(2669);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ie.min}});var oe=r(9247);Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return oe.multicast}});var se=r(5184);Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return se.observeOn}});var ae=r(1226);Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return ae.onErrorResumeNext}});var ce=r(1518);Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return ce.pairwise}});var ue=r(2171);Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return ue.partition}});var le=r(4912);Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return le.pluck}});var de=r(766);Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return de.publish}});var fe=r(7220);Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return fe.publishBehavior}});var he=r(6106);Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return he.publishLast}});var pe=r(8157);Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return pe.publishReplay}});var be=r(4440);Object.defineProperty(t,"race",{enumerable:!0,get:function(){return be.race}});var me=r(5600);Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return me.raceWith}});var ge=r(9139);Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return ge.reduce}});var ve=r(8522);Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return ve.repeat}});var ye=r(6566);Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return ye.repeatWhen}});var _e=r(7835);Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return _e.retry}});var Ee=r(9843);Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return Ee.retryWhen}});var we=r(7561);Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return we.refCount}});var Oe=r(1731);Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return Oe.sample}});var Ae=r(6086);Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return Ae.sampleTime}});var Se=r(8624);Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return Se.scan}});var Pe=r(582);Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return Pe.sequenceEqual}});var Te=r(8977);Object.defineProperty(t,"share",{enumerable:!0,get:function(){return Te.share}});var Re=r(3133);Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return Re.shareReplay}});var Ie=r(3001);Object.defineProperty(t,"single",{enumerable:!0,get:function(){return Ie.single}});var xe=r(3982);Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return xe.skip}});var Me=r(9098);Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return Me.skipLast}});var ke=r(7372);Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return ke.skipUntil}});var Le=r(4721);Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return Le.skipWhile}});var Ce=r(269);Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return Ce.startWith}});var Ne=r(8960);Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return Ne.subscribeOn}});var je=r(8774);Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return je.switchAll}});var De=r(3879);Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return De.switchMap}});var Ue=r(3274);Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return Ue.switchMapTo}});var Be=r(8712);Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return Be.switchScan}});var Fe=r(846);Object.defineProperty(t,"take",{enumerable:!0,get:function(){return Fe.take}});var Ke=r(8330);Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return Ke.takeLast}});var He=r(4780);Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return He.takeUntil}});var Ge=r(2129);Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return Ge.takeWhile}});var $e=r(3964);Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return $e.tap}});var Ve=r(8941);Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return Ve.throttle}});var ze=r(7640);Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return ze.throttleTime}});var We=r(4869);Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return We.throwIfEmpty}});var qe=r(489);Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return qe.timeInterval}});var Ze=r(1554);Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return Ze.timeout}});var Ye=r(4862);Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return Ye.timeoutWith}});var Je=r(6505);Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return Je.timestamp}});var Xe=r(2343);Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return Xe.toArray}});var Qe=r(5477);Object.defineProperty(t,"window",{enumerable:!0,get:function(){return Qe.window}});var et=r(6746);Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return et.windowCount}});var tt=r(8208);Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return tt.windowTime}});var rt=r(6637);Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return rt.windowToggle}});var nt=r(1141);Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return nt.windowWhen}});var it=r(5442);Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return it.withLatestFrom}});var ot=r(5918);Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return ot.zip}});var st=r(187);Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return st.zipAll}});var at=r(8538);Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return at.zipWith}})},2100:e=>{e.exports=function(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)}},6571:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>T,InvalidAddressError:()=>l,InvalidAmountError:()=>p,InvalidBlockHashError:()=>h,InvalidChainIdError:()=>O,InvalidContractAddressError:()=>w,InvalidDerivationPathError:()=>b,InvalidFinalizeUnstakeAmountError:()=>f,InvalidHexStringError:()=>m,InvalidKeyError:()=>y,InvalidKeyHashError:()=>A,InvalidMessageError:()=>g,InvalidOperationHashError:()=>S,InvalidOperationKindError:()=>P,InvalidPublicKeyError:()=>_,InvalidSignatureError:()=>E,InvalidStakingAddressError:()=>d,InvalidViewParameterError:()=>v,NetworkError:()=>c,ParameterValidationError:()=>i,PermissionDeniedError:()=>u,ProhibitedActionError:()=>R,PublicKeyNotFoundError:()=>I,RpcError:()=>o,TaquitoError:()=>n,TezosToolkitConfigError:()=>s,UnsupportedActionError:()=>a});class n extends Error{}class i extends n{}class o extends n{}class s extends n{}class a extends n{}class c extends n{}class u extends n{}class l extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidAddressError",this.message=`Invalid address "${e}"`,this.message+=t?` ${t}.`:"."}}class d extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidStakingAddressError",this.message=`Invalid staking address "${e}", you can only set destination as your own address`}}class f extends i{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidFinalizeUnstakeAmountError",this.message="The amount can only be 0 when finalizing an unstake"}}class h extends i{constructor(e,t){super(),this.blockHash=e,this.errorDetail=t,this.name="InvalidBlockHashError",this.message=`Invalid block hash "${e}"`,this.message+=t?` ${t}.`:"."}}class p extends i{constructor(e){super(),this.amount=e,this.name="InvalidAmountError",this.message=`Invalid amount "${e}"`}}class b extends i{constructor(e,t){super(),this.derivationPath=e,this.errorDetail=t,this.name="InvalidDerivationPathError",this.message=`Invalid derivation path "${e}"`,this.message+=t?` ${t}.`:"."}}class m extends i{constructor(e,t){super(),this.hexString=e,this.errorDetail=t,this.name="InvalidHexStringError",this.message=`Invalid hex string "${e}"`,this.message+=t?` ${t}.`:"."}}class g extends i{constructor(e,t){super(),this.msg=e,this.errorDetail=t,this.name="InvalidMessageError",this.message=`Invalid message "${e}"`,this.message+=t?` ${t}.`:"."}}class v extends i{constructor(e,t,r,n){super(),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="InvalidViewParameterError",this.message=`Invalid view arguments ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}.`}}class y extends i{constructor(e){super(),this.errorDetail=e,this.name="InvalidKeyError",this.message="Invalid private key",this.message+=e?` ${e}.`:"."}}class _ extends i{constructor(e,t){super(),this.publicKey=e,this.errorDetail=t,this.name="InvalidPublicKeyError",this.message=`Invalid public key "${e}"`,this.message+=t?` ${t}.`:"."}}class E extends i{constructor(e,t){super(),this.signature=e,this.errorDetail=t,this.name="InvalidSignatureError",this.message=`Invalid signature "${e}"`,this.message+=t?` ${t}.`:"."}}class w extends i{constructor(e,t){super(),this.contractAddress=e,this.errorDetail=t,this.name="InvalidContractAddressError",this.message=`Invalid contract address "${e}"`,this.message+=t?` ${t}.`:"."}}class O extends i{constructor(e,t){super(),this.chainId=e,this.errorDetail=t,this.name="InvalidChainIdError",this.message=`Invalid chain id "${e}"`,this.message+=t?` ${t}.`:"."}}class A extends i{constructor(e,t){super(),this.keyHash=e,this.errorDetail=t,this.name="InvalidKeyHashError",this.message=`Invalid public key hash "${e}"`,this.message+=t?` ${t}.`:"."}}class S extends i{constructor(e,t){super(),this.operationHash=e,this.errorDetail=t,this.name="InvalidOperationHashError",this.message=`Invalid operation hash "${e}"`,this.message+=t?` ${t}.`:"."}}class P extends i{constructor(e,t){super(),this.operationKind=e,this.errorDetail=t,this.name="InvalidOperationKindError",this.message=`Invalid operation kind "${e}"`,this.message+=t?` ${t}.`:"."}}class T extends a{constructor(e){super(),this.message=e,this.name="DeprecationError"}}class R extends a{constructor(e){super(),this.message=e,this.name="ProhibitedActionError"}}class I extends n{constructor(e,t){super(),this.pkh=e,this.cause=t,this.name="PublicKeyNotFoundError",this.message=`Public key not found of this address "${e}" in either wallet or contract API.`}}},2211:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HttpBackend:()=>f,HttpRequestFailed:()=>s,HttpResponseError:()=>a,HttpTimeoutError:()=>c,STATUS_CODE:()=>n,VERSION:()=>u});var n,i=r(6571);function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class s extends i.NetworkError{constructor(e,t,r){super(),this.method=e,this.url=t,this.cause=r,this.name="HttpRequestFailed",this.message=`${e} ${t} ${String(r)}`}}class a extends i.NetworkError{constructor(e,t,r,n,i){super(),this.message=e,this.status=t,this.statusText=r,this.body=n,this.url=i,this.name="HttpResponseError"}}class c extends i.NetworkError{constructor(e,t){super(),this.timeout=e,this.url=t,this.name="HttpTimeoutError",this.message=`HTTP request timeout of ${e}ms exceeded`}}!function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(n||(n={}));const u={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"};var l;let d=null===globalThis||void 0===globalThis?void 0:globalThis.fetch;"undefined"!=typeof process&&!!(null===(l=null===process||void 0===process?void 0:process.versions)||void 0===l?void 0:l.node)&&(d=r(1879));class f{constructor(e=3e4){this.timeout=e}serialize(e){if(!e)return"";const t=[];for(const r in e)if(e.hasOwnProperty(r)&&void 0!==e[r]){const n="function"==typeof e[r].toJSON?e[r].toJSON():e[r];if(null===n){t.push(encodeURIComponent(r));continue}if(Array.isArray(n)){n.forEach((e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}));continue}t.push(encodeURIComponent(r)+"="+encodeURIComponent(n))}const r=t.join("&");return r?`?${r}`:""}createRequest(e,t){return o(this,arguments,void 0,(function*({url:e,method:t,timeout:r=this.timeout,query:n,headers:i={},json:o=!0},u){const l=e+this.serialize(n);i["Content-Type"]||(i["Content-Type"]="application/json");const f=new AbortController,h=setTimeout((()=>f.abort()),r);try{const e=yield d(l,{keepalive:!1,method:t,headers:i,body:JSON.stringify(u),signal:f.signal});if(void 0===e)throw new Error("Response is undefined");if(e.status>=400){const t=yield e.text();throw new a(`Http error response: (${e.status}) ${t}`,e.status,e.statusText,t,l)}return o?e.json():e.text()}catch(e){throw e instanceof Error&&"AbortError"===e.name?new c(r,l):e instanceof a?e:new s(String(t),l,e)}finally{clearTimeout(h)}}))}}},1879:(e,t,r)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,n.fetch&&(t.default=n.fetch.bind(n)),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response},9971:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CODEC:()=>c,LocalForger:()=>Be,ProtocolsHash:()=>Ne,Uint8ArrayConsumer:()=>R,VERSION:()=>je,decoders:()=>Me,encoders:()=>ke,getCodec:()=>Ue,localForger:()=>Fe,opMapping:()=>u,opMappingReverse:()=>l});var n=r(6209),i=r(6571),o=r(6483);const s=e=>e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),""),a=(e,t=8)=>e.toString(16).padStart(t,"0");var c;!function(e){e.SECRET="secret",e.RAW="raw",e.TZ1="tz1",e.BRANCH="branch",e.ZARITH="zarith",e.PUBLIC_KEY="public_key",e.PKH="pkh",e.PKH_ARR="pkhArr",e.DELEGATE="delegate",e.SCRIPT="script",e.BALLOT_STATEMENT="ballotStmt",e.PROPOSAL="proposal",e.PROPOSAL_ARR="proposalArr",e.INT32="int32",e.INT16="int16",e.PARAMETERS="parameters",e.ADDRESS="address",e.SMART_CONTRACT_ADDRESS="smart_contract_address",e.SMART_ROLLUP_ADDRESS="smart_rollup_address",e.SMART_ROLLUP_COMMITMENT_HASH="smart_rollup_commitment_hash",e.VALUE="value",e.PADDED_BYTES="padded_bytes",e.SMART_ROLLUP_MESSAGE="smart_rollup_message",e.MANAGER="manager",e.BLOCK_PAYLOAD_HASH="blockPayloadHash",e.ENTRYPOINT="entrypoint",e.OPERATION="operation",e.OP_ACTIVATE_ACCOUNT="activate_account",e.OP_DELEGATION="delegation",e.OP_TRANSACTION="transaction",e.OP_ORIGINATION="origination",e.OP_BALLOT="ballot",e.OP_FAILING_NOOP="failing_noop",e.OP_ATTESTATION="attestation",e.OP_ATTESTATION_WITH_DAL="attestation_with_dal",e.OP_SEED_NONCE_REVELATION="seed_nonce_revelation",e.OP_REVEAL="reveal",e.OP_PROPOSALS="proposals",e.OP_REGISTER_GLOBAL_CONSTANT="register_global_constant",e.OP_TRANSFER_TICKET="transfer_ticket",e.BURN_LIMIT="burn_limit",e.OP_INCREASE_PAID_STORAGE="increase_paid_storage",e.OP_UPDATE_CONSENSUS_KEY="update_consensus_key",e.OP_DRAIN_DELEGATE="drain_delegate",e.DEPOSITS_LIMIT="deposits_limit",e.OP_SET_DEPOSITS_LIMIT="set_deposits_limit",e.OP_SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.PVM_KIND="pvm_kind",e.OP_SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",e.OP_DAL_PUBLISH_COMMITMENT="dal_publish_commitment",e.SLOT_HEADER="slot_header"}(c||(c={}));const u={"00":"parameter","01":"storage","02":"code","03":"False","04":"Elt","05":"Left","06":"None","07":"Pair","08":"Right","09":"Some","0a":"True","0b":"Unit","0c":"PACK","0d":"UNPACK","0e":"BLAKE2B","0f":"SHA256",10:"SHA512",11:"ABS",12:"ADD",13:"AMOUNT",14:"AND",15:"BALANCE",16:"CAR",17:"CDR",18:"CHECK_SIGNATURE",19:"COMPARE","1a":"CONCAT","1b":"CONS","1c":"CREATE_ACCOUNT","1d":"CREATE_CONTRACT","1e":"IMPLICIT_ACCOUNT","1f":"DIP",20:"DROP",21:"DUP",22:"EDIV",23:"EMPTY_MAP",24:"EMPTY_SET",25:"EQ",26:"EXEC",27:"FAILWITH",28:"GE",29:"GET","2a":"GT","2b":"HASH_KEY","2c":"IF","2d":"IF_CONS","2e":"IF_LEFT","2f":"IF_NONE",30:"INT",31:"LAMBDA",32:"LE",33:"LEFT",34:"LOOP",35:"LSL",36:"LSR",37:"LT",38:"MAP",39:"MEM","3a":"MUL","3b":"NEG","3c":"NEQ","3d":"NIL","3e":"NONE","3f":"NOT",40:"NOW",41:"OR",42:"PAIR",43:"PUSH",44:"RIGHT",45:"SIZE",46:"SOME",47:"SOURCE",48:"SENDER",49:"SELF","4a":"STEPS_TO_QUOTA","4b":"SUB","4c":"SWAP","4d":"TRANSFER_TOKENS","4e":"SET_DELEGATE","4f":"UNIT",50:"UPDATE",51:"XOR",52:"ITER",53:"LOOP_LEFT",54:"ADDRESS",55:"CONTRACT",56:"ISNAT",57:"CAST",58:"RENAME",59:"bool","5a":"contract","5b":"int","5c":"key","5d":"key_hash","5e":"lambda","5f":"list",60:"map",61:"big_map",62:"nat",63:"option",64:"or",65:"pair",66:"set",67:"signature",68:"string",69:"bytes","6a":"mutez","6b":"timestamp","6c":"unit","6d":"operation","6e":"address","6f":"SLICE",70:"DIG",71:"DUG",72:"EMPTY_BIG_MAP",73:"APPLY",74:"chain_id",75:"CHAIN_ID",76:"LEVEL",77:"SELF_ADDRESS",78:"never",79:"NEVER","7a":"UNPAIR","7b":"VOTING_POWER","7c":"TOTAL_VOTING_POWER","7d":"KECCAK","7e":"SHA3","7f":"PAIRING_CHECK",80:"bls12_381_g1",81:"bls12_381_g2",82:"bls12_381_fr",83:"sapling_state",84:"sapling_transaction_deprecated",85:"SAPLING_EMPTY_STATE",86:"SAPLING_VERIFY_UPDATE",87:"ticket",88:"TICKET_DEPRECATED",89:"READ_TICKET","8a":"SPLIT_TICKET","8b":"JOIN_TICKETS","8c":"GET_AND_UPDATE","8d":"chest","8e":"chest_key","8f":"OPEN_CHEST",90:"VIEW",91:"view",92:"constant",93:"SUB_MUTEZ",94:"tx_rollup_l2_address",95:"MIN_BLOCK_TIME",96:"sapling_transaction",97:"EMIT",98:"Lambda_rec",99:"LAMBDA_REC","9a":"TICKET","9b":"BYTES","9c":"NAT","9d":"Ticket"},l=(()=>{const e={};return Object.keys(u).forEach((t=>{e[u[t]]=t})),e})(),d={4:"activate_account",107:"reveal",110:"delegation",108:"transaction",109:"origination",6:"ballot",21:"attestation",23:"attestation_with_dal",1:"seed_nonce_revelation",5:"proposals",111:"register_global_constant",158:"transfer_ticket",112:"set_deposits_limit",113:"increase_paid_storage",114:"update_consensus_key",9:"drain_delegate",200:"smart_rollup_originate",201:"smart_rollup_add_messages",206:"smart_rollup_execute_outbox_message",230:"dal_publish_commitment",17:"failing_noop"},f=(()=>{const e={};return Object.keys(d).forEach((t=>{const r="string"==typeof t?parseInt(t,10):t;e[d[r]]=a(r,2)})),e})(),h={"00":"default","01":"root","02":"do","03":"set_delegate","04":"remove_delegate","05":"deposit","06":"stake","07":"unstake","08":"finalize_unstake","09":"set_delegate_parameters"},p=(()=>{const e={};return Object.keys(h).forEach((t=>{e[h[t]]=t})),e})();class b extends i.ParameterValidationError{constructor(e,t){super(),this.operation=e,this.errorDetail=t,this.name="InvalidOperationSchemaError",this.message="Invalid operation content recevied",t&&(this.message+=` ${t}.`)}}class m extends i.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="OversizedEntryPointError",this.message=`Invalid entrypoint length "${e.length}", maximum length is "31".`}}class g extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="InvalidBallotValueError",this.message=`Invalid ballot value "${e}" expecting one of the following: "yay", "nay", "pass".`}}class v extends i.ParameterValidationError{constructor(e){super(),this.ballotValue=e,this.name="DecodeBallotValueError",this.message=`Invalid ballot value "${e}", cannot be decoded.`}}class y extends i.ParameterValidationError{constructor(e){super(),this.value=e,this.name="UnexpectedMichelsonValueError",this.message=`Invalid Michelson value "${e}", unalbe to encode.`}}class _ extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationDecodingError"}}class E extends i.ParameterValidationError{constructor(e){super(),this.message=e,this.name="OperationEncodingError"}}class w extends i.ParameterValidationError{constructor(e){super(),this.op=e,this.name="UnsupportedOperationError",this.message=`Unsupported operation "${e}", can submit an issue on our github for feature request.`}}class O extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="UnsupportedPvmKindError",this.message=`Invalid Pvm kind "${e}" expecting either "arith" or "wasm_2_0_0".`}}class A extends i.ParameterValidationError{constructor(e){super(),this.pvm=e,this.name="DecodePvmKindError",this.message=`Invalid Pvm kind "${e}", cannot be decoded.`}}class S extends i.ParameterValidationError{constructor(e,t){super(),this.address=e,this.errorDetail=t,this.name="InvalidSmartRollupAddress",this.message=`Invalid smart rollup address "${e}"`,t&&(this.message+=` ${t}.`)}}class P extends i.ParameterValidationError{constructor(e,t){super(),this.hash=e,this.errorDetail=t,this.name="InvalidSmartRollupCommitmentHashError",this.message=`Invalid smart rollup commitment hash "${e}"`,t&&(this.message+=` ${t}.`)}}class T extends i.ParameterValidationError{constructor(e,t){super(),this.commitment=e,this.errorDetail=t,this.name="InvalidDalCommitmentError",this.message=`Invalid dal commitment "${e}"`,t&&(this.message+=` ${t}.`)}}class R{static fromHexString(e){const t=e.toLowerCase();if(/^(([a-f]|\d){2})*$/.test(t)){const e=new Uint8Array((t.match(/([a-z]|\d){2}/g)||[]).map((e=>parseInt(e,16))));return new R(e)}throw new i.InvalidHexStringError(t)}constructor(e,t=0){this.arr=e,this.offset=t}consume(e){const t=this.arr.subarray(this.offset,this.offset+e);return this.offset+=e,t}get(e){return this.arr[this.offset+e]}length(){return this.arr.length-this.offset}slice(e,t){return new R(this.arr.slice(e,t))}}const I=e=>{if(Array.isArray(e)){const t=e.map((e=>I(e))).join(""),r=t.length/2;return`02${a(r)}${t}`}if((e=>"prim"in e)(e))return U(e);if((e=>"bytes"in e&&"string"==typeof e.bytes)(e))return k(e);if((e=>"string"in e&&"string"==typeof e.string)(e))return C(e);if((e=>"int"in e&&"string"==typeof e.int)(e))return j(e);throw new y(JSON.stringify(e))},x=e=>{const t=e.consume(1);switch(t[0]){case 10:return L(e);case 1:return N(e);case 0:return D(e);case 2:{const t=new R(M(e)),r=[];for(;t.length()>0;)r.push(x(t));return r}default:return B(e,t)}},M=(e,t=4)=>{const r=e.consume(t),n=parseInt(Buffer.from(r).toString("hex"),16);return e.consume(n)},k=e=>{if(!/^([A-Fa-f0-9]{2})*$/.test(e.bytes))throw new i.InvalidHexStringError(e.bytes);const t=e.bytes.length/2;return`0a${a(t)}${e.bytes}`},L=e=>{const t=M(e);return{bytes:Buffer.from(t).toString("hex")}},C=e=>{const t=Buffer.from(e.string,"utf8").toString("hex"),r=t.length/2;return`01${a(r)}${t}`},N=e=>{const t=M(e);return{string:Buffer.from(t).toString("utf8")}},j=({int:e})=>{const t=new o.g(e,10),r="-"===t.toString(2)[0]?"1":"0",n=t.toString(2).replace(/-/g,""),i=n.length<=6?6:(n.length-6)%7?n.length+7-(n.length-6)%7:n.length,s=n.padStart(i,"0").match(/\d{6,7}/g).reverse();s[0]=r+s[0];return`00${s.map(((e,t)=>parseInt((t===s.length-1?"0":"1")+e,2).toString(16).padStart(2,"0"))).join("")}`},D=e=>{let t=e.consume(1)[0];const r=[];for(;128&t;)r.push(t),t=e.consume(1)[0];r.push(t);const n=!!(64&r[0]);r[0]=127&r[0];const i=r.map(((e,t)=>e.toString(2).slice(0===t?-6:-7).padStart(0===t?6:7,"0"))).reverse();let s=new o.g(i.join(""),2);return n&&(s=s.times(-1)),{int:s.toFixed()}},U=e=>{const t=+Array.isArray(e.annots),r=Array.isArray(e.args)?e.args.length:0,n=a(Math.min(2*r+t+3,9),2),i=l[e.prim];let o=(e.args||[]).map((e=>I(e))).join("");const s=Array.isArray(e.annots)?H(e.annots):"";return"LAMBDA"!==e.prim&&"LAMBDA_REC"!==e.prim||!r||(o=a(o.length/2)+o+a(0)),("pair"===e.prim||"Pair"===e.prim)&&r>2&&(o=""===s?a(o.length/2)+o+a(0):a(o.length/2)+o),"view"===e.prim&&e.args&&(o=a(o.length/2)+o+a(0)),`${n}${i}${o}${s}`},B=(e,t)=>{const r=(t[0]-3)%2==1;let n=Math.floor((t[0]-3)/2);const i=e.consume(1)[0].toString(16).padStart(2,"0"),o={prim:u[i]};if("LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),"view"===u[i])return 0!=n?F(e,o):o;let s,a;("pair"===u[i]||"Pair"===u[i])&&n>2&&(s=K(e),n=0,a=G(e));const c=new Array(n).fill(0).map((()=>x(e)));return"LAMBDA"!==u[i]&&"LAMBDA_REC"!==u[i]||e.consume(4),s?o.args=s:c.length&&(o.args=c),a&&""!==a[0]?o.annots=a:r&&(o.annots=G(e)),o},F=(e,t)=>(e.consume(4),t.args=new Array(4).fill(0).map((()=>x(e))),e.consume(4),t),K=e=>{const t=new R(M(e)),r=[];for(;t.length()>0;)r.push(x(t));return r},H=e=>{const t=e.map((e=>Buffer.from(e,"utf8").toString("hex"))).join("20"),r=t.length/2;return`${a(r)}${t}`},G=e=>{const t=e.consume(4),r=parseInt(Buffer.from(t).toString("hex"),16),n=e.consume(r);return Buffer.from(n).toString("hex").split("20").map((e=>Buffer.from(e,"hex").toString("utf8")))},$=e=>t=>(0,n.buf2hex)(Buffer.from((0,n.b58cdecode)(t,n.prefix[e]))),V=e=>t=>{const r=t.consume(n.prefixLength[e]);return(0,n.b58cencode)(r,n.prefix[e])},z=V(n.Prefix.TZ1),W=V(n.Prefix.B),q=e=>{const t=e.consume(1);return 0===t[0]?V(n.Prefix.TZ1)(e):1===t[0]?V(n.Prefix.TZ2)(e):2===t[0]?V(n.Prefix.TZ3)(e):void 0},Z=$(n.Prefix.B),Y=$(n.Prefix.TZ1),J=e=>e?"ff":"00",X=e=>$(n.Prefix.P)(e),Q=e=>V(n.Prefix.P)(e),ee=e=>255===e.consume(1)[0],te=e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:return"00"+$(n.Prefix.TZ1)(e);case n.Prefix.TZ2:return"01"+$(n.Prefix.TZ2)(e);case n.Prefix.TZ3:return"02"+$(n.Prefix.TZ3)(e);case n.Prefix.TZ4:return"03"+$(n.Prefix.TZ4)(e);default:throw new n.InvalidKeyHashError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one for the following "${n.Prefix.TZ1}", "${n.Prefix.TZ2}", "${n.Prefix.TZ3}" or "${n.Prefix.TZ4}".`)}},re=e=>{const t=[];let r=new o.A(e,10);if(r.isNaN())throw new TypeError(`Invalid zarith number ${e}`);for(;;){if(r.lt(128)){r.lt(16)&&t.push("0"),t.push(r.toString(16));break}{let e=r.mod(128);r=r.minus(e),r=r.dividedBy(128),e=e.plus(128),t.push(e.toString(16))}}return t.join("")},ne=e=>{let t=0;for(;t<e.length()&&128&e.get(t);)t+=1;let r=new o.A(0);for(let n=t;n>=0;n-=1){const t=127&e.get(n);r=r.multipliedBy(128),r=r.plus(t)}return e.consume(t+1),new o.A(r).toString()},ie=$(n.Prefix.VH),oe=V(n.Prefix.VH),se=e=>{const t=V(n.Prefix.SH)(e);if(t.substring(0,2)!==n.Prefix.SH)throw new T(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SH}'`);return t},ae={branch:c.BRANCH,contents:[c.OPERATION]},ce={pkh:c.TZ1,secret:c.SECRET},ue={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,public_key:c.PUBLIC_KEY},le={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,delegate:c.DELEGATE},de={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.ADDRESS,parameters:c.PARAMETERS},fe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,balance:c.ZARITH,delegate:c.DELEGATE,script:c.SCRIPT},he={source:c.PKH,period:c.INT32,proposal:c.PROPOSAL,ballot:c.BALLOT_STATEMENT},pe={slot:c.INT16,level:c.INT32,round:c.INT32,block_payload_hash:c.BLOCK_PAYLOAD_HASH},be={slot:c.INT16,level:c.INT32,round:c.INT32,block_payload_hash:c.BLOCK_PAYLOAD_HASH,dal_attestation:c.ZARITH},me={level:c.INT32,nonce:c.RAW},ge={source:c.PKH,period:c.INT32,proposals:c.PROPOSAL_ARR},ve={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,value:c.VALUE},ye={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,ticket_contents:c.VALUE,ticket_ty:c.VALUE,ticket_ticketer:c.ADDRESS,ticket_amount:c.ZARITH,destination:c.ADDRESS,entrypoint:c.ENTRYPOINT},_e={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,amount:c.ZARITH,destination:c.SMART_CONTRACT_ADDRESS},Ee={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pk:c.PUBLIC_KEY},we={consensus_key:c.PKH,delegate:c.PKH,destination:c.PKH},Oe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,limit:c.DEPOSITS_LIMIT},Ae={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,pvm_kind:c.PVM_KIND,kernel:c.PADDED_BYTES,parameters_ty:c.VALUE,whitelist:c.PKH_ARR},Se={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,message:c.SMART_ROLLUP_MESSAGE},Pe={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,rollup:c.SMART_ROLLUP_ADDRESS,cemented_commitment:c.SMART_ROLLUP_COMMITMENT_HASH,output_proof:c.PADDED_BYTES},Te={source:c.PKH,fee:c.ZARITH,counter:c.ZARITH,gas_limit:c.ZARITH,storage_limit:c.ZARITH,slot_header:c.SLOT_HEADER},Re={arbitrary:c.PADDED_BYTES},Ie=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(r&&Array.isArray(o)){const t=e[o[0]],s=r[i];if(!Array.isArray(s))throw new E(`Invalid operation value "${JSON.stringify(s)}" of key "${i}, expected value to be Array.`);return n+s.reduce(((e,r)=>e+t(r)),"")}return n+(0,e[o])(r[i])}),""),xe=e=>t=>r=>Object.keys(t).reduce(((n,i)=>{const o=t[i];if(Array.isArray(o)){const t=e[o[0]],s=[],a=r.length();for(;r.length()>0;)if(s.push(t(r)),a===r.length())throw new _("Unable to decode value");return Object.assign(Object.assign({},n),{[i]:s})}{const t=(0,e[o])(r);return void 0!==t?Object.assign(Object.assign({},n),{[i]:t}):Object.assign({},n)}}),{}),Me={[c.SECRET]:e=>s(e.consume(20)),[c.RAW]:e=>s(e.consume(32)),[c.TZ1]:z,[c.BRANCH]:W,[c.ZARITH]:ne,[c.PUBLIC_KEY]:e=>{switch(e.consume(1)[0]){case 0:return V(n.Prefix.EDPK)(e);case 1:return V(n.Prefix.SPPK)(e);case 2:return V(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))}},[c.PKH]:q,[c.PKH_ARR]:e=>{if(!ee(e))return;const t=[];for(e.consume(4);e.length()>0;)t.push(q(e));return t},[c.DELEGATE]:e=>{if(ee(e))return q(e)},[c.INT32]:e=>{const t=e.consume(4);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.SCRIPT]:e=>{const t=M(e),r=M(e);return{code:x(new R(t)),storage:x(new R(r))}},[c.BALLOT_STATEMENT]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"yay";case 1:return"nay";case 2:return"pass";default:throw new v(t[0].toString())}},[c.PROPOSAL]:Q,[c.PROPOSAL_ARR]:e=>{const t=[];for(e.consume(4);e.length()>0;)t.push(Q(e));return t},[c.PARAMETERS]:e=>{if(0!==e.consume(1)[0]){const t=(e=>{const t=a(e.consume(1)[0],2);if(t in h)return h[t];{const t=M(e,1),r=Buffer.from(t).toString("utf8");if(r.length>31)throw new m(r);return r}})(e),r=M(e);return{entrypoint:t,value:x(new R(r))}}},[c.ADDRESS]:e=>{switch(e.consume(1)[0]){case 0:return q(e);case 1:{const t=V(n.Prefix.KT1)(e);return e.consume(1),t}default:throw new i.InvalidAddressError(e.toString(),": Unable to decode.")}},[c.SMART_ROLLUP_ADDRESS]:e=>{const t=V(n.Prefix.SR1)(e);if(t.substring(0,3)!==n.Prefix.SR1)throw new S(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return t},[c.SMART_CONTRACT_ADDRESS]:e=>{if(1===e.consume(1)[0]){const t=V(n.Prefix.KT1)(e);return e.consume(1),t}throw new i.InvalidContractAddressError(e.toString(),(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED))},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{const t=V(n.Prefix.SRC1)(e);if(t.substring(0,4)!==n.Prefix.SRC1)throw new P(t,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`);return t},[c.VALUE]:e=>{const t=M(e);return x(new R(t))},[c.INT16]:e=>{const t=e.consume(2);let r=0;for(let e=0;e<t.length;e++)r|=t[e]<<8*(t.length-(e+1));return r},[c.BLOCK_PAYLOAD_HASH]:oe,[c.ENTRYPOINT]:e=>{const t=M(e);return Buffer.from(t).toString("utf8")},[c.BURN_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return ne(e)},[c.DEPOSITS_LIMIT]:e=>{const t=e.consume(1);if("00"!==Buffer.from(t).toString("hex"))return ne(e)},[c.PVM_KIND]:e=>{const t=e.consume(1);switch(t[0]){case 0:return"arith";case 1:return"wasm_2_0_0";case 2:return"riscv";default:throw new A(t[0].toString())}},[c.PADDED_BYTES]:e=>{const t=M(e);return Buffer.from(t).toString("hex")},[c.SMART_ROLLUP_MESSAGE]:e=>{const t=M(e);return((e,t=4)=>{const r=[];let n=e;for(;n.length();){const e=n.consume(t),i=parseInt(Buffer.from(e).toString("hex"),16);r.push(n.consume(i)),n=n.slice(i+t)}return r})(new R(t)).map((e=>Buffer.from(e).toString("hex")))},[c.SLOT_HEADER]:e=>{const t=e.consume(1);return{slot_index:Number(t[0].toString(10)),commitment:se(e),commitment_proof:s(e.consume(96))}}};Me[c.OPERATION]=(e=>t=>{const r=t.consume(1),n=d[r[0]];if(void 0===n)throw new w(r[0].toString());const i=e[n](t);if("object"!=typeof i)throw new _("Invalid operation, cannot be decoded.");return Object.assign({kind:n},i)})(Me),Me[c.OP_ACTIVATE_ACCOUNT]=e=>xe(Me)(ce)(e),Me[c.OP_FAILING_NOOP]=e=>xe(Me)(Re)(e),Me[c.OP_DELEGATION]=e=>xe(Me)(le)(e),Me[c.OP_TRANSACTION]=e=>xe(Me)(de)(e),Me[c.OP_ORIGINATION]=e=>xe(Me)(fe)(e),Me[c.OP_BALLOT]=e=>xe(Me)(he)(e),Me[c.OP_ATTESTATION]=e=>xe(Me)(pe)(e),Me[c.OP_ATTESTATION_WITH_DAL]=e=>xe(Me)(be)(e),Me[c.OP_SEED_NONCE_REVELATION]=e=>xe(Me)(me)(e),Me[c.OP_PROPOSALS]=e=>xe(Me)(ge)(e),Me[c.OP_REVEAL]=e=>xe(Me)(ue)(e),Me[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>xe(Me)(ve)(e),Me[c.OP_TRANSFER_TICKET]=e=>xe(Me)(ye)(e),Me[c.OP_INCREASE_PAID_STORAGE]=e=>xe(Me)(_e)(e),Me[c.OP_UPDATE_CONSENSUS_KEY]=e=>xe(Me)(Ee)(e),Me[c.OP_DRAIN_DELEGATE]=e=>xe(Me)(we)(e),Me[c.OP_SMART_ROLLUP_ORIGINATE]=e=>xe(Me)(Ae)(e),Me[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>xe(Me)(Se)(e),Me[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>xe(Me)(Pe)(e),Me[c.OP_DAL_PUBLISH_COMMITMENT]=e=>xe(Me)(Te)(e),Me[c.MANAGER]=xe(Me)(ae),Me[c.OP_SET_DEPOSITS_LIMIT]=e=>xe(Me)(Oe)(e);const ke={[c.SECRET]:e=>e,[c.RAW]:e=>e,[c.TZ1]:Y,[c.BRANCH]:Z,[c.ZARITH]:re,[c.PUBLIC_KEY]:e=>{switch(e.substring(0,4)){case n.Prefix.EDPK:return"00"+$(n.Prefix.EDPK)(e);case n.Prefix.SPPK:return"01"+$(n.Prefix.SPPK)(e);case n.Prefix.P2PK:return"02"+$(n.Prefix.P2PK)(e);default:throw new n.InvalidPublicKeyError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following '${n.Prefix.EDPK}', '${n.Prefix.SPPK}', '${n.Prefix.P2PK}' or '${n.Prefix.BLPK}'.`)}},[c.PKH]:te,[c.PKH_ARR]:e=>{if(!e)return J(!1);if(0===e.length)return J(!0)+a(0);const t=e.reduce(((e,t)=>e+te(t)),"");return J(!0)+a(t.length/2)+t},[c.DELEGATE]:e=>e?J(!0)+te(e):J(!1),[c.SCRIPT]:e=>{const t=I(e.code),r=I(e.storage);return`${a(t.length/2,8)}${t}${a(r.length/2,8)}${r}`},[c.BALLOT_STATEMENT]:e=>{switch(e){case"yay":return"00";case"nay":return"01";case"pass":return"02";default:throw new g(e)}},[c.PROPOSAL]:X,[c.PROPOSAL_ARR]:e=>a(32*e.length)+e.map((e=>X(e))).join(""),[c.INT32]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<4;e++){const n=8*(4-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.PARAMETERS]:e=>{if(!e||"default"===e.entrypoint&&"prim"in e.value&&"Unit"===e.value.prim)return"00";const t=(e=>{if(e in p)return`${p[e]}`;if(e.length>31)throw new m(e);return`ff${I({string:e}).slice(8)}`})(e.entrypoint),r=I(e.value);return`ff${t}${a(r.length/2)}${r}`},[c.ADDRESS]:e=>{switch(e.substring(0,3)){case n.Prefix.TZ1:case n.Prefix.TZ2:case n.Prefix.TZ3:case n.Prefix.TZ4:return"00"+te(e);case n.Prefix.KT1:return"01"+$(n.Prefix.KT1)(e)+"00";default:throw new i.InvalidAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting one of the following prefix '${n.Prefix.TZ1}', ${n.Prefix.TZ2}', '${n.Prefix.TZ3}', '${n.Prefix.TZ4}' or '${n.Prefix.KT1}'.`)}},[c.SMART_ROLLUP_ADDRESS]:e=>{if(e.substring(0,3)!==n.Prefix.SR1)throw new S(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SR1}'.`);return $(n.Prefix.SR1)(e)},[c.SMART_CONTRACT_ADDRESS]:e=>{if(e.substring(0,3)===n.Prefix.KT1)return"01"+$(n.Prefix.KT1)(e)+"00";throw new i.InvalidContractAddressError(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.KT1}'.`)},[c.SMART_ROLLUP_COMMITMENT_HASH]:e=>{if(e.substring(0,4)===n.Prefix.SRC1)return $(n.Prefix.SRC1)(e);throw new P(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SRC1}'`)},[c.VALUE]:e=>{const t=I(e);return`${a(t.length/2)}${t}`},[c.INT16]:e=>{const t=parseInt(String(e),10),r=[];for(let e=0;e<2;e++){const n=8*(2-(e+1));r.push((t&255<<n)>>n)}return Buffer.from(r).toString("hex")},[c.BLOCK_PAYLOAD_HASH]:ie,[c.ENTRYPOINT]:e=>`${I({string:e}).slice(2)}`,[c.BURN_LIMIT]:e=>e?`ff${re(e)}`:"00",[c.DEPOSITS_LIMIT]:e=>e?`ff${re(e)}`:"00",[c.PVM_KIND]:e=>{switch(e){case"arith":return"00";case"wasm_2_0_0":return"01";case"riscv":return"02";default:throw new O(e)}},[c.PADDED_BYTES]:(e,t=8)=>`${a(e.length/2,t)}${e}`,[c.SMART_ROLLUP_MESSAGE]:e=>{const t=e.reduce(((e,t)=>e+`${a(t.length/2)}${t}`),"");return`${a(t.length/2)}${t}`},[c.SLOT_HEADER]:e=>a(e.slot_index,2)+(e=>{if(e.substring(0,2)===n.Prefix.SH)return $(n.Prefix.SH)(e);throw new T(e,(0,n.invalidDetail)(n.ValidationResult.NO_PREFIX_MATCHED)+` expecting prefix '${n.Prefix.SH}'`)})(e.commitment)+e.commitment_proof};ke[c.OPERATION]=(e=>t=>{if(!(t.kind in e)||!(t.kind in f))throw new i.InvalidOperationKindError(t.kind);return f[t.kind]+e[t.kind](t)})(ke),ke[c.OP_ACTIVATE_ACCOUNT]=e=>Ie(ke)(ce)(e),ke[c.OP_DELEGATION]=e=>Ie(ke)(le)(e),ke[c.OP_TRANSACTION]=e=>Ie(ke)(de)(e),ke[c.OP_ORIGINATION]=e=>Ie(ke)(fe)(e),ke[c.OP_BALLOT]=e=>Ie(ke)(he)(e),ke[c.OP_ATTESTATION]=e=>Ie(ke)(pe)(e),ke[c.OP_ATTESTATION_WITH_DAL]=e=>Ie(ke)(be)(e),ke[c.OP_SEED_NONCE_REVELATION]=e=>Ie(ke)(me)(e),ke[c.OP_PROPOSALS]=e=>Ie(ke)(ge)(e),ke[c.OP_REVEAL]=e=>Ie(ke)(ue)(e),ke[c.OP_REGISTER_GLOBAL_CONSTANT]=e=>Ie(ke)(ve)(e),ke[c.OP_TRANSFER_TICKET]=e=>Ie(ke)(ye)(e),ke[c.OP_INCREASE_PAID_STORAGE]=e=>Ie(ke)(_e)(e),ke[c.OP_UPDATE_CONSENSUS_KEY]=e=>Ie(ke)(Ee)(e),ke[c.OP_DRAIN_DELEGATE]=e=>Ie(ke)(we)(e),ke[c.OP_SMART_ROLLUP_ORIGINATE]=e=>Ie(ke)(Ae)(e),ke[c.OP_SMART_ROLLUP_ADD_MESSAGES]=e=>Ie(ke)(Se)(e),ke[c.OP_SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE]=e=>Ie(ke)(Pe)(e),ke[c.OP_DAL_PUBLISH_COMMITMENT]=e=>Ie(ke)(Te)(e),ke[c.MANAGER]=Ie(ke)(ae),ke[c.OP_SET_DEPOSITS_LIMIT]=e=>Ie(ke)(Oe)(e),ke[c.OP_FAILING_NOOP]=e=>Ie(ke)(Re)(e);const Le={activate_account:ce,reveal:ue,delegation:le,transaction:de,origination:fe,ballot:he,attestation:pe,attestation_with_dal:be,seed_nonce_revelation:me,proposals:ge,register_global_constant:ve,transfer_ticket:ye,increase_paid_storage:_e,update_consensus_key:Ee,drain_delegate:we,set_deposits_limit:Oe,smart_rollup_originate:Ae,smart_rollup_add_messages:Se,smart_rollup_execute_outbox_message:Pe,dal_publish_commitment:Te,failing_noop:Re},Ce=e=>{const t=e.kind,r=Object.keys(e),n=(i="kind",r.filter((e=>e!==i)));var i;const o=Object.keys(Le[t]);return s=n,o.filter((e=>!s.includes(e)));var s};var Ne;!function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",e.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",e.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",e.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(Ne||(Ne={}));const je={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"},De=Ne.PsQuebecn;function Ue(e,t){return{encoder:ke[e],decoder:t=>{const r=R.fromHexString(t);return Me[e](r)}}}class Be{constructor(e=De){this.protocolHash=e,this.codec=Ue(c.MANAGER,this.protocolHash)}forge(e){const t=(0,n.validateBlock)(e.branch);if(t!==n.ValidationResult.VALID)throw new i.InvalidBlockHashError(e.branch,(0,n.invalidDetail)(t));for(const t of e.contents){if(r=t.kind,!Object.keys(Le).includes(r))throw new i.InvalidOperationKindError(t.kind);const e=Ce(t);if(1===e.length){if("delegation"===t.kind&&"delegate"===e[0])continue;if("origination"===t.kind&&"delegate"===e[0])continue;if("transaction"===t.kind&&"parameters"===e[0])continue;if("set_deposits_limit"===t.kind&&"limit"===e[0])continue;if("smart_rollup_originate"===t.kind&&"whitelist"===e[0])continue;throw new b(t,`missing properties "${e.join(", ")}"`)}if(e.length>1)throw new b(t,`missing properties "${e.join(", ")}"`)}var r;const o=this.codec.encoder(e).toLowerCase();return Promise.resolve(o)}parse(e){return Promise.resolve(this.codec.decoder(e))}}const Fe=new Be},5899:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Contract:()=>nr,DefaultProtocol:()=>b,JSONParseError:()=>j,MacroError:()=>y,MichelineParseError:()=>N,MichelsonError:()=>ue,MichelsonInstructionError:()=>Nt,MichelsonTypeError:()=>de,MichelsonValidationError:()=>ke,Parser:()=>K,ProtoGreaterOrEqual:()=>g,ProtoInferiorTo:()=>v,Protocol:()=>p,VERSION:()=>cr,assertContractValid:()=>Zt,assertDataListIfAny:()=>ot,assertDataValid:()=>Yt,assertMichelsonBigMapStorableType:()=>We,assertMichelsonComparableType:()=>He,assertMichelsonContract:()=>Qe,assertMichelsonData:()=>Xe,assertMichelsonInstruction:()=>Ke,assertMichelsonPackableType:()=>Ge,assertMichelsonPassableType:()=>ze,assertMichelsonPushableType:()=>$e,assertMichelsonStorableType:()=>Ve,assertMichelsonType:()=>Ye,assertTypeAnnotationsValid:()=>Ft,assertTypesEqual:()=>Xt,assertViewNameValid:()=>Ze,contractEntryPoint:()=>Wt,contractEntryPoints:()=>qt,contractSection:()=>$t,contractViews:()=>Vt,decodeAddressBytes:()=>kt,decodePublicKeyBytes:()=>Ct,decodePublicKeyHashBytes:()=>Lt,dummyContract:()=>ir,emitMicheline:()=>z,formatError:()=>ar,formatStack:()=>or,functionType:()=>Jt,instructionIDs:()=>Ie,isContractValid:()=>er,isDataValid:()=>tr,isInstruction:()=>it,isMichelsonCode:()=>rt,isMichelsonData:()=>tt,isMichelsonError:()=>le,isMichelsonScript:()=>et,isMichelsonType:()=>nt,isTypeAnnotationsValid:()=>Qt,isTypeEqual:()=>rr,packData:()=>Pt,packDataBytes:()=>Tt,refContract:()=>h,sourceReference:()=>i,traceDumpFunc:()=>sr,unpackData:()=>xt,unpackDataBytes:()=>Mt});var n=r(6571);const i=Symbol("source_reference");class o extends n.TaquitoError{constructor(e,t,r){super(),this.src=e,this.idx=t,this.message=r,this.name="ScanError"}}var s;!function(e){e[e.Comment=0]="Comment",e[e.Number=1]="Number",e[e.String=2]="String",e[e.Bytes=3]="Bytes",e[e.Ident=4]="Ident"}(s||(s={}));const a=new RegExp("\\s"),c=new RegExp("[:@%_A-Za-z]"),u=new RegExp("[@%_\\.A-Za-z0-9]"),l=new RegExp("[0-9]"),d=new RegExp("[0-9a-fA-F]");function*f(e,t=!1){let r=0;for(;r<e.length;){for(;r<e.length&&a.test(e[r]);)r++;if(r===e.length)return;const n=e[r],i=r;if(c.test(n)){for(r++;r<e.length&&u.test(e[r]);)r++;yield{t:s.Ident,v:e.slice(i,r),first:i,last:r}}else if(e.length-r>1&&"0x"===e.substring(r,r+2)){for(r+=2;r<e.length&&d.test(e[r]);)r++;if(r-i&1)throw new o(e,r,"Bytes literal length is expected to be power of two");yield{t:s.Bytes,v:e.slice(i,r),first:i,last:r}}else if(l.test(n)||"-"===n){"-"===n&&r++;const t=r;for(;r<e.length&&l.test(e[r]);)r++;if(t===r)throw new o(e,r,"Number literal is too short");yield{t:s.Number,v:e.slice(i,r),first:i,last:r}}else if('"'===n){r++;let t=!1;for(;r<e.length&&(t||'"'!==e[r]);r++)t=!t&&"\\"===e[r];if(r===e.length)throw new o(e,r,"Unterminated string literal");r++,yield{t:s.String,v:e.slice(i,r),first:i,last:r}}else if("#"===n){for(r++;r<e.length&&"\n"!==e[r];)r++;t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else if(e.length-r>1&&"/*"===e.substring(r,r+2)){for(r+=2;r<e.length&&!(e.length-r>1&&"*/"===e.substring(r,r+2));)r++;if(r===e.length)throw new o(e,r,"Unterminated C style comment");r+=2,t&&(yield{t:s.Comment,v:e.slice(i,r),first:i,last:r})}else{if("("!==n&&")"!==n&&"{"!==n&&"}"!==n&&";"!==n)throw new o(e,r,`Invalid character at offset ${r}: \`${n}'`);r++,yield{t:n,v:n,first:i,last:r}}}}const h=Symbol("ref_contract");var p;!function(e){e.Ps9mPmXa="Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P",e.PtCJ7pwo="PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY",e.PsYLVpVv="PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",e.PsddFKi3="PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdoTez="PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangzH="PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakarta="PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",e.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",e.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",e.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(p||(p={}));const b=p.PsQuebecn,m={Ps9mPmXaRzmzk35gbAYNCAw6UXdE2qoABTHbN2oEEc1qM7CwT9P:0,PtCJ7pwoxe8JasnHY8YonnLYjcVHmhiARPJvqcC6VfHT5s8k8sY:1,PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt:2,PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP:3,Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd:4,PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU:5,PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS:5,PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb:6,PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo:7,PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq:8,PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA:8,PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i:9,PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV:10,PtHangzHogokSuiMHemCuowEavgYTP8J5qQ9fQS793MHYFpCY3r:11,PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx:11,PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP:12,Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A:12,PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw:13,PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY:13,PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg:14,PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW:15,PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc:16,PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1:16,PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf:17,ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH:19,PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ:20,PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi:20,PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg:21,ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK:22};function g(e,t){return m[e]>=m[t]}function v(e,t){return m[e]<m[t]}class y extends n.TaquitoError{constructor(e,t){super(),this.prim=e,this.message=t,this.name="MacroError"}}function _(e,t){var r,n;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new y(e,`macro ${e.prim} expects ${t} arguments, was given ${null===(n=e.args)||void 0===n?void 0:n.length}`)}function E(e){if(void 0===e.annots)return!0;throw new y(e,`unexpected annotation on macro ${e.prim}: ${e.annots}`)}function w(e,t){if("int"in t)return!0;throw new y(e,`macro ${e.prim} expects int argument`)}function O(e,t,r,n){let i=0,o=0;const s=[null,null];let a;if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);let c,u=t[i++];switch(u){case"P":{const{r:s,n:c,an:u}=O(e,t.slice(i),r.slice(o),n);a=s,i+=c,o+=u;break}case"A":o!==r.length&&(s[0]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}if(i===t.length)throw new y(e,`unexpected end: ${e.prim}`);switch(u=t[i++],u){case"P":{const{r:s,n:a,an:u}=O(e,t.slice(i),r.slice(o),n);c=s.map((([e,t])=>[e+1,t])),i+=a,o+=u;break}case"I":o!==r.length&&(s[1]=r[o++]);break;default:throw new y(e,`${e.prim}: unexpected character: ${u}`)}return{r:n(a,c,[0,s]),n:i,an:o}}function A(e,t,r,n){const i=t[0];switch(i){case"A":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CAR",annots:["@%%"]},A(e,t.slice(1),[],n)]]},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%@","%@",...r]}]:n.a;case"D":return t.length>1?[{prim:"DUP"},{prim:"DIP",args:[[{prim:"CDR",annots:["@%%"]},A(e,t.slice(1),[],n)]]},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%@",...r]}]:n.d;default:throw new y(e,`${e.prim}: unexpected character: ${i}`)}}function S(e,t){let r=e.length;for(;r>0&&e[r-1]===t;)r--;return e.slice(0,r)}function P(e){const t=[],r=[];if(void 0!==e)for(const n of e)(0!==n.length&&"%"===n[0]?t:r).push(n);return{fields:t,rest:r}}function T({prim:e,annots:t,args:r}){return Object.assign(Object.assign({prim:e},t&&{annots:t}),r&&{args:r})}const R=/^P[PAI]{3,}R$/,I=/^UNP[PAI]{2,}R$/,x=/^C[AD]{2,}R$/,M=/^SET_C[AD]+R$/,k=/^MAP_C[AD]+R$/,L=/^DI{2,}P$/,C=/^DU+P$/;class N extends n.TaquitoError{constructor(e,t){super(),this.token=e,this.message=t,this.name="MichelineParseError"}}class j extends n.TaquitoError{constructor(e,t){super(),this.node=e,this.message=t,this.name="JSONParseError"}}const D=new N(null,"Unexpected EOF");function U(e){return e.t===s.Ident&&("@"===e.v[0]||"%"===e.v[0]||":"===e.v[0])}const B=new RegExp("^-?[0-9]+$"),F=new RegExp("^([0-9a-fA-F]{2})*$");class K{constructor(e){this.opt=e}expand(e){var t,r,n;if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.expandGlobalConstant)&&"constant"===e.prim){const t=function(e,t){return void 0!==e.args&&1===e.args.length&&"string"in e.args[0]&&e.args[0].string in t?t[e.args[0].string]:e}(e,this.opt.expandGlobalConstant);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{globalConstant:e})),t}if(void 0===(null===(r=this.opt)||void 0===r?void 0:r.expandMacros)||(null===(n=this.opt)||void 0===n?void 0:n.expandMacros)){const t=function(e,t){const r=(null==t?void 0:t.protocol)||b;function n(e){return void 0!==e?[{prim:"RENAME",annots:e}]:[]}switch(e.prim){case"CMPEQ":case"CMPNEQ":case"CMPLT":case"CMPGT":case"CMPLE":case"CMPGE":if(_(e,0))return[{prim:"COMPARE"},T({prim:e.prim.slice(3),annots:e.annots})];break;case"IFEQ":case"IFNEQ":case"IFLT":case"IFGT":case"IFLE":case"IFGE":if(_(e,2))return[{prim:e.prim.slice(2)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"IFCMPEQ":case"IFCMPNEQ":case"IFCMPLT":case"IFCMPGT":case"IFCMPLE":case"IFCMPGE":if(_(e,2))return[{prim:"COMPARE"},{prim:e.prim.slice(5)},T({prim:"IF",annots:e.annots,args:e.args})];break;case"FAIL":if(_(e,0)&&E(e))return[{prim:"UNIT"},{prim:"FAILWITH"}];break;case"ASSERT":if(_(e,0)&&E(e))return[{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_EQ":case"ASSERT_NEQ":case"ASSERT_LT":case"ASSERT_GT":case"ASSERT_LE":case"ASSERT_GE":if(_(e,0)&&E(e))return[{prim:e.prim.slice(7)},{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_CMPEQ":case"ASSERT_CMPNEQ":case"ASSERT_CMPLT":case"ASSERT_CMPGT":case"ASSERT_CMPLE":case"ASSERT_CMPGE":if(_(e,0)&&E(e))return[[{prim:"COMPARE"},{prim:e.prim.slice(10)}],{prim:"IF",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_NONE":if(_(e,0)&&E(e))return[{prim:"IF_NONE",args:[[],[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_SOME":if(_(e,0))return[{prim:"IF_NONE",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"ASSERT_LEFT":if(_(e,0))return[{prim:"IF_LEFT",args:[n(e.annots),[[{prim:"UNIT"},{prim:"FAILWITH"}]]]}];break;case"ASSERT_RIGHT":if(_(e,0))return[{prim:"IF_LEFT",args:[[[{prim:"UNIT"},{prim:"FAILWITH"}]],n(e.annots)]}];break;case"IF_SOME":if(_(e,2))return[T({prim:"IF_NONE",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"IF_RIGHT":if(_(e,2))return[T({prim:"IF_LEFT",annots:e.annots,args:[e.args[1],e.args[0]]})];break;case"CAR":case"CDR":if(void 0===e.args)return e;if(_(e,1)&&w(e,e.args[0])){const t=parseInt(e.args[0].int,10);return T({prim:"GET",args:[{int:"CAR"===e.prim?String(2*t+1):String(2*t)}],annots:e.annots})}}if(R.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots),{r:n}=O(e,e.prim.slice(1),t,((e,t,r)=>[...e||[],...t||[],r]));return n.map((([e,t],i)=>{const o=[...S(t,null).map((e=>null===e?"%":e)),...0===e&&i===n.length-1?r:[]],s=T({prim:"PAIR",annots:0!==o.length?o:void 0});return 0===e?s:{prim:"DIP",args:1===e?[[s]]:[{int:String(e)},[s]]}}))}if(I.test(e.prim)){if(v(r,p.PtEdo2Zk)&&_(e,0)){const{r:t}=O(e,e.prim.slice(3),e.annots||[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e,t])=>{const r=[{prim:"DUP"},T({prim:"CAR",annots:null!==t[0]?[t[0]]:void 0}),{prim:"DIP",args:[[T({prim:"CDR",annots:null!==t[1]?[t[1]]:void 0})]]}];return 0===e?r:{prim:"DIP",args:1===e?[[r]]:[{int:String(e)},[r]]}}))}if("UNPAIR"===e.prim)return e;if(_(e,0)){const{r:t}=O(e,e.prim.slice(3),[],((e,t,r)=>[r,...t||[],...e||[]]));return t.map((([e])=>{const t=T({prim:"UNPAIR"});return 0===e?t:{prim:"DIP",args:1===e?[[t]]:[{int:String(e)},[t]]}}))}}if(x.test(e.prim)&&_(e,0)){const t=[...e.prim.slice(1,e.prim.length-1)];return t.map(((r,n)=>{const i=n===t.length-1?e.annots:void 0;switch(r){case"A":return T({prim:"CAR",annots:i});case"D":return T({prim:"CDR",annots:i});default:throw new y(e,`unexpected character: ${r}`)}}))}if(M.test(e.prim)&&_(e,0)){const{fields:t,rest:r}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const n=0!==t.length?{a:[{prim:"DUP"},{prim:"CAR",annots:t},{prim:"DROP"},{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:[t[0],"%@"]}],d:[{prim:"DUP"},{prim:"CDR",annots:t},{prim:"DROP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",t[0]]}]}:{a:[{prim:"CDR",annots:["@%%"]},{prim:"SWAP"},{prim:"PAIR",annots:["%","%@"]}],d:[{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@","%"]}]};return A(e,e.prim.slice(5,e.prim.length-1),r,n)}if(k.test(e.prim)&&_(e,1)){const{fields:t}=P(e.annots);if(t.length>1)throw new y(e,`unexpected annotation on macro ${e.prim}: ${t}`);const r={a:[{prim:"DUP"},{prim:"CDR",annots:["@%%"]},{prim:"DIP",args:[[T({prim:"CAR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0]]]},{prim:"SWAP"},{prim:"PAIR",annots:[0!==t.length?t[0]:"%","%@"]}],d:[{prim:"DUP"},T({prim:"CDR",annots:0!==t.length?["@"+t[0].slice(1)]:void 0}),e.args[0],{prim:"SWAP"},{prim:"CAR",annots:["@%%"]},{prim:"PAIR",annots:["%@",0!==t.length?t[0]:"%"]}]};return A(e,e.prim.slice(5,e.prim.length-1),[],r)}if(L.test(e.prim)&&_(e,1)){let t=0;for(;"I"===e.prim[1+t];)t++;return T({prim:"DIP",args:[{int:String(t)},e.args[0]]})}if(C.test(e.prim)){let t=0;for(;"U"===e.prim[1+t];)t++;if(v(r,p.PtEdo2Zk)){if(1===t){if(void 0===e.args)return e;_(e,1)&&w(e,e.args[0])&&(t=parseInt(e.args[0].int,10))}else _(e,0);return 1===t?[T({prim:"DUP",annots:e.annots})]:2===t?[{prim:"DIP",args:[[T({prim:"DUP",annots:e.annots})]]},{prim:"SWAP"}]:[{prim:"DIP",args:[{int:String(t-1)},[T({prim:"DUP",annots:e.annots})]]},{prim:"DIG",args:[{int:String(t)}]}]}if(1===t)return e;if(_(e,0))return T({prim:"DUP",args:[{int:String(t)}],annots:e.annots})}return e}(e,this.opt);return t!==e&&(t[i]=Object.assign(Object.assign({},e[i]||{first:0,last:0}),{macro:e})),t}return e}parseListExpr(e,t){var r;const n={first:t.first,last:t.last},o="("===t.t;let a;if(o){if(a=e.next(),a.done)throw D;n.last=a.value.last}else a={value:t};if(a.value.t!==s.Ident)throw new N(a.value,`not an identifier: ${a.value.v}`);const c={prim:a.value.v,[i]:n};for(;;){const t=e.next();if(t.done){if(o)throw D;break}if(")"===t.value.t){if(!o)throw new N(t.value,"unexpected closing bracket");n.last=t.value.last;break}if(U(t.value))c.annots=c.annots||[],c.annots.push(t.value.v),n.last=t.value.last;else{c.args=c.args||[];const o=this.parseExpr(e,t.value);n.last=(null===(r=o[i])||void 0===r?void 0:r.last)||n.last,c.args.push(o)}}return this.expand(c)}parseArgs(e,t){var r;const n={first:t.first,last:t.last},o={prim:t.v,[i]:n};for(;;){const t=e.next();if(t.done||"}"===t.value.t||";"===t.value.t)return[o,t];if(U(t.value))n.last=t.value.last,o.annots=o.annots||[],o.annots.push(t.value.v);else{const s=this.parseExpr(e,t.value);n.last=(null===(r=s[i])||void 0===r?void 0:r.last)||n.last,o.args=o.args||[],o.args.push(s)}}}parseSequenceExpr(e,t){var r,n;const o={first:t.first,last:t.last},a=[];a[i]=o;const c="{"===t.t;let u="{"===t.t?null:{value:t};for(;;){if(null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done){if(c)throw D;return a}if("}"===u.value.t){if(c)return a;throw new N(u.value,"unexpected closing bracket")}if(u.value.t===s.Ident){const[t,n]=this.parseArgs(e,u.value);o.last=(null===(r=t[i])||void 0===r?void 0:r.last)||o.last,a.push(this.expand(t)),u=n}else{const t=this.parseExpr(e,u.value);o.last=(null===(n=t[i])||void 0===n?void 0:n.last)||o.last,a.push(t),u=null}null===u&&(u=e.next(),u.done||(o.last=u.value.last)),u.done||";"!==u.value.t||(u=null)}}parseExpr(e,t){switch(t.t){case s.Ident:return this.expand({prim:t.v,[i]:{first:t.first,last:t.last}});case s.Number:return{int:t.v,[i]:{first:t.first,last:t.last}};case s.String:return{string:JSON.parse(t.v),[i]:{first:t.first,last:t.last}};case s.Bytes:return{bytes:t.v.slice(2),[i]:{first:t.first,last:t.last}};case"{":return this.parseSequenceExpr(e,t);default:return this.parseListExpr(e,t)}}parseSequence(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=f(e),r=t.next();return r.done?null:this.parseSequenceExpr(t,r.value)}parseList(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=f(e),r=t.next();return r.done?null:this.parseListExpr(t,r.value)}parseMichelineExpression(e){if("string"!=typeof e)throw new TypeError(`string type was expected, got ${typeof e} instead`);const t=f(e),r=t.next();return r.done?null:this.parseExpr(t,r.value)}parseScript(e){return this.parseSequence(e)}parseData(e){return this.parseList(e)}parseJSON(e){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);if(Array.isArray(e)){const t=[];for(const r of e){if(null===r||"object"!=typeof r)throw new j(r,`unexpected sequence element: ${r}`);t.push(this.parseJSON(r))}return t}if("prim"in e){const t=e;if("string"==typeof t.prim&&(void 0===t.annots||Array.isArray(t.annots))&&(void 0===t.args||Array.isArray(t.args))){const e={prim:t.prim};if(void 0!==t.annots){for(const e of t.annots)if("string"!=typeof e)throw new j(e,`string expected: ${e}`);e.annots=t.annots}if(void 0!==t.args){e.args=[];for(const r of t.args){if(null===r||"object"!=typeof r)throw new j(r,`unexpected argument: ${r}`);e.args.push(this.parseJSON(r))}}return this.expand(e)}throw new j(e,`malformed prim expression: ${e}`)}if("string"in e){if("string"==typeof e.string)return{string:e.string};throw new j(e,`malformed string literal: ${e}`)}if("int"in e){if("string"==typeof e.int&&B.test(e.int))return{int:e.int};throw new j(e,`malformed int literal: ${e}`)}if("bytes"in e){if("string"==typeof e.bytes&&F.test(e.bytes))return{bytes:e.bytes};throw new j(e,`malformed bytes literal: ${e}`)}throw new j(e,`unexpected object: ${e}`)}}class H{constructor(e,t=0){this.opt=e,this.lev=t}indent(e=0){var t;let r="";if(void 0!==(null===(t=this.opt)||void 0===t?void 0:t.indent))for(let t=this.lev+e;t>0;t--)r+=this.opt.indent;return r}get lf(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||""}get lfsp(){var e;return(null===(e=this.opt)||void 0===e?void 0:e.newline)||" "}down(e){return new H(this.opt,this.lev+e)}}function G(e){return"prim"in e&&(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length)}function $(e){if(void 0!==e.args)for(const t of e.args)if(Array.isArray(t)||G(t))return!0;return!1}function V(e,t,r){var n;const o=null===(n=e[i])||void 0===n?void 0:n.macro;if(r&&o)return V(o,t,r);if(Array.isArray(e))return function(e,t,r){let n="{"+t.lf,i=e.length;for(const o of e){if(n+=t.indent(1),"prim"in o){if(n+=o.prim,void 0!==o.annots)for(const e of o.annots)n+=" "+e;if(void 0!==o.args){const e=$(o);for(const i of o.args)n+=e?t.lfsp+t.indent(2)+V(i,t.down(2),r):" "+V(i,t,r)}}else n+=V(o,t.down(1),r);n+=i>1?";"+t.lfsp:t.lf,i--}return n+t.indent()+"}"}(e,t,r);if("string"in e)return JSON.stringify(e.string);if("int"in e)return e.int;if("bytes"in e)return"0x"+e.bytes;{if(!(void 0!==e.annots&&0!==e.annots.length||void 0!==e.args&&0!==e.args.length))return e.prim;let n="("+e.prim;if(void 0!==e.annots)for(const t of e.annots)n+=" "+t;if(void 0!==e.args){const i=$(e);for(const o of e.args)n+=i?t.lfsp+t.indent(1)+V(o,t.down(1),r):" "+V(o,t,r)}return n+")"}}function z(e,t,r=!1){if("object"!=typeof e)throw new TypeError(`object type was expected, got ${typeof e} instead`);return V(e,new H(t),r)}const W=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],q=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998];class Z extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="Base58DecodingError"}}function Y(e){const t=(e.length+9)%64,r=0===t?0:64-t;if(e.length>268435455)throw new n.InvalidMessageError("",`: Invalid length ${e.length} is too big -- SHA-256.`);const i=e.length<<3,o=[...e,128,...new Array(r).fill(0),0,0,0,0,i>>24&255,i>>16&255,i>>8&255,255&i];function s(e,t){return e>>>t|e<<32-t}const a=[...W],c=new Array(64),u=new Array(8);for(let e=0;e<o.length;e+=64){let t=e,r=0;for(;r<16;)c[r]=o[t]<<24|o[t+1]<<16|o[t+2]<<8|o[t+3],t+=4,r++;for(;r<64;){const e=s(c[r-15],7)^s(c[r-15],18)^c[r-15]>>>3,t=s(c[r-2],17)^s(c[r-2],19)^c[r-2]>>>10;c[r]=(0|t)+c[r-7]+e+c[r-16]|0,r++}for(let e=0;e<8;e++)u[e]=a[e];for(let e=0;e<64;e++){const t=s(u[0],2)^s(u[0],13)^s(u[0],22),r=s(u[4],6)^s(u[4],11)^s(u[4],25),n=u[7]+r+(u[4]&u[5]^~u[4]&u[6])+q[e]+c[e]|0,i=t+(u[0]&u[1]^u[0]&u[2]^u[1]&u[2])|0;u[7]=u[6],u[6]=u[5],u[5]=u[4],u[4]=u[3]+n|0,u[3]=u[2],u[2]=u[1],u[1]=u[0],u[0]=n+i|0}for(let e=0;e<8;e++)a[e]=a[e]+u[e]|0}const l=[];for(const e of a)l.push(e>>24&255),l.push(e>>16&255),l.push(e>>8&255),l.push(255&e);return l}const J=[0,1,2,3,4,5,6,7,8,-1,-1,-1,-1,-1,-1,-1,9,10,11,12,13,14,15,16,-1,17,18,19,20,21,-1,22,23,24,25,26,27,28,29,30,31,32,-1,-1,-1,-1,-1,-1,33,34,35,36,37,38,39,40,41,42,43,-1,44,45,46,47,48,49,50,51,52,53,54,55,56,57],X=[0,1,2,3,4,5,6,7,8,16,17,18,19,20,21,22,23,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73];function Q(e,t){const r=e.charCodeAt(t)-49;if(r>=J.length||-1===J[r])throw new Z(`Unexpected character at position ${t}: ${e[t]}`);return J[r]}function ee(e){const t=function(e){const t=[];let r=0;for(;r<e.length&&0===Q(e,r);)r++;let n=r;for(;r<e.length;){let n=Q(e,r++),i=0;for(;0!==n||i<t.length;){const e=58*(t[i]||0)+n;t[i++]=e%256,n=Math.floor(e/256)}}for(;n-- >0;)t.push(0);return t.reverse()}(e);if(t.length<4)throw new Z(`Data is too short ${t.length}`);const r=t.slice(0,t.length-4),n=t.slice(t.length-4),i=Y(Y(r));if(n[0]!==i[0]||n[1]!==i[1]||n[2]!==i[2]||n[3]!==i[3])throw new Z("Invalid checksum");return r}function te(e){const t=Y(Y(e));return function(e){const t=[];let r=0;for(;r<e.length&&0===e[r];)r++;let n=r;for(;r<e.length;){let n=e[r++],i=0;for(;0!==n||i<t.length;){const e=256*(t[i]||0)+n;t[i++]=e%58,n=Math.floor(e/58)}}for(;n-- >0;)t.push(0);return t.reverse(),String.fromCharCode(...t.map((e=>X[e]+49)))}([...e,...t.slice(0,4)])}class re extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidMichelsonError"}}class ne extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidTypeExpressionError"}}class ie extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidDataExpressionError"}}class oe extends n.ParameterValidationError{constructor(e){super(),this.entrypoint=e,this.name="InvalidEntrypointError",this.message=`Contract has no entrypoint named: "${e}"`}}class se extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="TezosIdEncodeError"}}class ae extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="LongIntegerError"}}class ce extends n.TaquitoError{constructor(e){super(),this.hexByte=e,this.name="HexParseError",this.message=`Unable to parse hex byte "${e}"`}}class ue extends n.TaquitoError{constructor(e,t){super(),this.val=e,this.message=t,this.name="MichelsonError"}}function le(e){return e instanceof ue}class de extends ue{constructor(e,t,r){super(e,t),this.val=e,this.message=t,this.name="MichelsonTypeError",void 0!==r&&(this.data=r)}}class fe{append(e){let t=0;for(;0!==e||t<this.buf.length;){const r=10*(this.buf[t]||0)+e;this.buf[t++]=r%256,e=Math.floor(r/256)}}constructor(e){if(this.neg=!1,this.buf=[],void 0!==e)if("string"==typeof e)for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(0===t&&45===r)this.neg=!0;else{if(r<48||r>57)throw new ae(`unexpected character in integer constant "${e[t]}"`);this.append(r-48)}}else e<0?(this.neg=!0,this.append(-e)):this.append(e)}cmp(e){if(this.neg!==e.neg)return(e.neg?1:0)-(this.neg?1:0);{let t=0;if(this.buf.length!==e.buf.length)t=this.buf.length<e.buf.length?-1:1;else if(0!==this.buf.length){let r=e.buf.length-1;for(;r>=0&&this.buf[r]===e.buf[r];)r--;t=r<0?0:this.buf[r]<e.buf[r]?-1:1}return this.neg?0===t?0:-t:t}}get sign(){return 0===this.buf.length?0:this.neg?-1:1}}function he(e){const t=[];for(let r=0;r<e.length;r+=2){const n=parseInt(e.slice(r,r+2),16);if(Number.isNaN(n))return null;t.push(n)}return t}function pe(e){try{return new fe(e),!0}catch(e){return!1}}function be(e){try{return new fe(e).sign>=0}catch(e){return!1}}const me=/^(@%|@%%|%@|[@:%]([_0-9a-zA-Z][_0-9a-zA-Z.%@]*)?)$/;function ge(e,t){if(Array.isArray(e))return{};let r,n,i;if(void 0!==e.annots)for(const o of e.annots)if(0!==o.length){if(!me.test(o)||!(null==t?void 0:t.specialVar)&&("@%"===o||"@%%"===o)||!(null==t?void 0:t.specialFields)&&"%@"===o)throw new ue(e,`${e.prim}: unexpected annotation: ${o}`);switch(o[0]){case"%":((null==t?void 0:t.emptyFields)||o.length>1)&&(r=r||[],r.push(o));break;case":":o.length>1&&(n=n||[],n.push(o));break;case"@":((null==t?void 0:t.emptyVar)||o.length>1)&&(i=i||[],i.push(o))}}return{f:r,t:n,v:i}}const ve={BlockHash:[32,[1,52]],OperationHash:[32,[5,116]],OperationListHash:[32,[133,233]],OperationListListHash:[32,[29,159,109]],ProtocolHash:[32,[2,170]],ContextHash:[32,[79,199]],ED25519PublicKeyHash:[20,[6,161,159]],SECP256K1PublicKeyHash:[20,[6,161,161]],P256PublicKeyHash:[20,[6,161,164]],ContractHash:[20,[2,90,121]],CryptoboxPublicKeyHash:[16,[153,103]],ED25519Seed:[32,[13,15,58,7]],ED25519PublicKey:[32,[13,15,37,217]],SECP256K1SecretKey:[32,[17,162,224,201]],P256SecretKey:[32,[16,81,238,189]],ED25519EncryptedSeed:[56,[7,90,60,179,41]],SECP256K1EncryptedSecretKey:[56,[9,237,241,174,150]],P256EncryptedSecretKey:[56,[9,48,57,115,171]],SECP256K1PublicKey:[33,[3,254,226,86]],P256PublicKey:[33,[3,178,139,127]],SECP256K1Scalar:[33,[38,248,136]],SECP256K1Element:[33,[5,92,0]],ED25519SecretKey:[64,[43,246,78,7]],ED25519Signature:[64,[9,245,205,134,18]],SECP256K1Signature:[64,[13,115,101,19,63]],P256Signature:[64,[54,240,44,52]],GenericSignature:[64,[4,130,43]],ChainID:[4,[87,82,0]],RollupAddress:[20,[1,128,120,31]]};function ye(e,...t){const r=ee(e);for(const e of t){const[t,n]=ve[e];if(r.length===t+n.length){let t=0;for(;t<n.length&&r[t]===n[t];)t++;if(t===n.length)return[e,r.slice(n.length)]}}return null}function _e(e,t){const[r,n]=ve[e];if(t.length!==r)throw new se(`Incorrect data length for ${e}: ${t.length}`);return te([...n,...t])}function Ee(e,t){const r=t,n=Array.isArray(r)?r:r.args;if(2===n.length){return"pair"===e?{prim:"pair",args:n}:{prim:"Pair",args:n}}return Object.assign(Object.assign({},Array.isArray(r)?{prim:e}:r),{args:[n[0],{prim:e,args:n.slice(1)}]})}function we(e){return Array.isArray(e)||"pair"===e.prim}function Oe(e){return Array.isArray(e)||"prim"in e&&"Pair"===e.prim}const Ae=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])[T ]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):([0-5][0-9]))$/;function Se(e){if("string"in e){if(be(e.string))return new Date(parseInt(e.string,10));if(Ae.test(e.string)){const t=new Date(e.string);if(!Number.isNaN(t.valueOf))return t}}else if(pe(e.int))return new Date(parseInt(e.int,10));return null}function Pe(e){return e.map((e=>(e>>4&15).toString(16)+(15&e).toString(16))).join("")}const Te=31,Re={ABS:!0,ADD:!0,ADDRESS:!0,AMOUNT:!0,AND:!0,APPLY:!0,BALANCE:!0,BLAKE2B:!0,CAR:!0,CDR:!0,CHAIN_ID:!0,CHECK_SIGNATURE:!0,COMPARE:!0,CONCAT:!0,CONS:!0,EDIV:!0,EQ:!0,EXEC:!0,FAILWITH:!0,GE:!0,GET_AND_UPDATE:!0,GT:!0,HASH_KEY:!0,IMPLICIT_ACCOUNT:!0,INT:!0,ISNAT:!0,JOIN_TICKETS:!0,KECCAK:!0,LE:!0,LEVEL:!0,LSL:!0,LSR:!0,LT:!0,MEM:!0,MUL:!0,NEG:!0,NEQ:!0,NEVER:!0,NOT:!0,NOW:!0,OR:!0,PACK:!0,PAIRING_CHECK:!0,READ_TICKET:!0,SAPLING_VERIFY_UPDATE:!0,SELF:!0,SELF_ADDRESS:!0,SENDER:!0,SET_DELEGATE:!0,SHA256:!0,SHA3:!0,SHA512:!0,SIZE:!0,SLICE:!0,SOME:!0,SOURCE:!0,SPLIT_TICKET:!0,SUB:!0,SWAP:!0,TICKET:!0,TICKET_DEPRECATED:!0,TOTAL_VOTING_POWER:!0,TRANSFER_TOKENS:!0,UNIT:!0,VOTING_POWER:!0,XOR:!0,RENAME:!0,OPEN_CHEST:!0,SUB_MUTEZ:!0,MIN_BLOCK_TIME:!0,BYTES:!0,NAT:!0},Ie=Object.assign({},Re,{CONTRACT:!0,CREATE_CONTRACT:!0,DIG:!0,DIP:!0,DROP:!0,DUG:!0,DUP:!0,EMIT:!0,EMPTY_BIG_MAP:!0,EMPTY_MAP:!0,EMPTY_SET:!0,GET:!0,IF:!0,IF_CONS:!0,IF_LEFT:!0,IF_NONE:!0,ITER:!0,LAMBDA:!0,LAMBDA_REC:!0,LEFT:!0,LOOP:!0,LOOP_LEFT:!0,MAP:!0,NIL:!0,NONE:!0,PAIR:!0,PUSH:!0,RIGHT:!0,SAPLING_EMPTY_STATE:!0,UNPACK:!0,UNPAIR:!0,UPDATE:!0,CAST:!0,VIEW:!0}),xe={unit:!0,never:!0,bool:!0,int:!0,nat:!0,string:!0,chain_id:!0,bytes:!0,mutez:!0,key_hash:!0,key:!0,signature:!0,timestamp:!0,address:!0,tx_rollup_l2_address:!0},Me=Object.assign({},xe,{or:!0,pair:!0,set:!0,big_map:!0,contract:!0,lambda:!0,list:!0,map:!0,operation:!0,option:!0,bls12_381_g1:!0,bls12_381_g2:!0,bls12_381_fr:!0,sapling_transaction:!0,sapling_transaction_deprecated:!0,sapling_state:!0,ticket:!0,chest_key:!0,chest:!0});class ke extends ue{constructor(e,t){super(e,t),this.val=e,this.message=t,this.name="MichelsonValidationError"}}function Le(e){return"prim"in e}function Ce(e){if(Le(e))return!0;throw new ke(e,"prim expression expected")}function Ne(e){if(Array.isArray(e))return!0;throw new ke(e,"sequence expression expected")}function je(e){if(function(e){return Array.isArray(e)||"prim"in e}(e))return!0;throw new ke(e,"prim or sequence expression expected")}function De(e){if("-"===e.int[0])throw new ke(e,"natural number expected")}function Ue(e){if("int"in e)return!0;throw new ke(e,"int literal expected")}function Be(e){if("string"in e)return!0;throw new ke(e,"string literal expected")}function Fe(e,t){var r;if(0===t&&void 0===e.args||(null===(r=e.args)||void 0===r?void 0:r.length)===t)return!0;throw new ke(e,`${t} arguments expected`)}function Ke(e){var t,r;if(Array.isArray(e)){for(const t of e){if(!Array.isArray(t)&&!Le(t))throw new ke(e,"sequence or prim expected");Ke(t)}return!0}if(Ce(e)){if(Object.prototype.hasOwnProperty.call(Re,e.prim))return Fe(e,0),!0;switch(e.prim){case"DROP":case"PAIR":case"UNPAIR":case"DUP":case"UPDATE":case"GET":void 0!==e.args&&Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"DIG":case"DUG":case"SAPLING_EMPTY_STATE":Fe(e,1)&&Ue(e.args[0])&&De(e.args[0]);break;case"NONE":case"LEFT":case"RIGHT":case"NIL":case"CAST":Fe(e,1)&&Ye(e.args[0]);break;case"UNPACK":Fe(e,1)&&Ge(e.args[0]);break;case"CONTRACT":Fe(e,1)&&ze(e.args[0]);break;case"IF_NONE":case"IF_LEFT":case"IF_CONS":case"IF":Fe(e,2)&&(Ne(e.args[0])&&Ke(e.args[0]),Ne(e.args[1])&&Ke(e.args[1]));break;case"MAP":case"ITER":case"LOOP":case"LOOP_LEFT":Fe(e,1)&&Ke(e.args[0]);break;case"CREATE_CONTRACT":Fe(e,1)&&Qe(e.args[0]);break;case"DIP":if(2===(null===(t=e.args)||void 0===t?void 0:t.length))Ue(e.args[0])&&De(e.args[0]),Ne(e.args[1])&&Ke(e.args[1]);else{if(1!==(null===(r=e.args)||void 0===r?void 0:r.length))throw new ke(e,"1 or 2 arguments expected");Ne(e.args[0])&&Ke(e.args[0])}break;case"PUSH":Fe(e,2)&&($e(e.args[0]),Xe(e.args[1]));break;case"EMPTY_SET":Fe(e,1)&&He(e.args[0]);break;case"EMPTY_MAP":Fe(e,2)&&(He(e.args[0]),Ye(e.args[1]));break;case"EMPTY_BIG_MAP":Fe(e,2)&&(He(e.args[0]),We(e.args[1]));break;case"LAMBDA_REC":case"LAMBDA":Fe(e,3)&&(Ye(e.args[0]),Ye(e.args[1]),Ne(e.args[2])&&Ke(e.args[2]));break;case"VIEW":Fe(e,2)&&(Be(e.args[0])&&Ze(e.args[0]),Ye(e.args[1])&&$e(e.args[1]));break;case"EMIT":e.args&&e.args.length>0?Fe(e,1):Fe(e,0);break;default:throw new ke(e,"instruction expected")}}return!0}function He(e){if(je(e))if(Array.isArray(e)||"pair"===e.prim||"or"===e.prim||"option"===e.prim)Je(e,(e=>He(e)));else if(!Object.prototype.hasOwnProperty.call(xe,e.prim))throw new ke(e,`${e.prim}: type is not comparable`);return!0}function Ge(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim)throw new ke(e,`${e.prim}: type can't be used inside PACK/UNPACK instructions`);Je(e,(e=>Ge(e)))}return!0}function $e(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim||"ticket"===e.prim||"contract"===e.prim)throw new ke(e,`${e.prim}: type can't be pushed`);Je(e,(e=>$e(e)))}return!0}function Ve(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim||"contract"===e.prim)throw new ke(e,`${e.prim}: type can't be used as part of a storage`);Je(e,(e=>Ve(e)))}return!0}function ze(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"operation"===e.prim)throw new ke(e,`${e.prim}: type can't be used as part of a parameter`);Je(e,(e=>ze(e)))}return!0}function We(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim)||"big_map"===e.prim||"operation"===e.prim||"sapling_state"===e.prim)throw new ke(e,`${e.prim}: type can't be used inside a big_map`);Je(e,(e=>We(e)))}return!0}const qe=new RegExp("^[a-zA-Z0-9_.%@]*$");function Ze(e){if(e.string.length>Te)throw new ke(e,`view name too long: ${e.string}`);if(!qe.test(e.string))throw new ke(e,`invalid character(s) in view name: ${e.string}`)}function Ye(e){if(je(e)&&Le(e)){if(!Object.prototype.hasOwnProperty.call(Me,e.prim))throw new ke(e,"type expected");Je(e,(e=>Ye(e)))}return!0}function Je(e,t){if(Array.isArray(e)||"pair"===e.prim){const r=Array.isArray(e)?e:e.args;if(void 0===r||r.length<2)throw new ke(e,"at least 2 arguments expected");return r.forEach((e=>{je(e)&&t(e)})),!0}switch(e.prim){case"option":case"list":Fe(e,1)&&je(e.args[0])&&t(e.args[0]);break;case"contract":Fe(e,1)&&ze(e.args[0]);break;case"or":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(t(e.args[0]),t(e.args[1]));break;case"lambda":Fe(e,2)&&(Ye(e.args[0]),Ye(e.args[1]));break;case"set":Fe(e,1)&&He(e.args[0]);break;case"map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),t(e.args[1]));break;case"big_map":Fe(e,2)&&je(e.args[0])&&je(e.args[1])&&(He(e.args[0]),We(e.args[1]),t(e.args[1]));break;case"ticket":Fe(e,1)&&je(e.args[0])&&He(e.args[0]);break;case"sapling_state":case"sapling_transaction":Fe(e,1)&&Ue(e.args[0]);break;default:Fe(e,0)}return!0}function Xe(e){if("int"in e||"string"in e||"bytes"in e)return!0;if(Array.isArray(e)){let t=0;for(const r of e)Le(r)&&"Elt"===r.prim?(Fe(r,2)&&(Xe(r.args[0]),Xe(r.args[1])),t++):Xe(r);if(0!==t&&t!==e.length)throw new ke(e,"data entries and map elements can't be intermixed");return!0}if(!Le(e))throw new ke(e,"data entry expected");switch(e.prim){case"Unit":case"True":case"False":case"None":Fe(e,0);break;case"Pair":if(void 0===e.args||e.args.length<2)throw new ke(e,"at least 2 arguments expected");for(const t of e.args)Xe(t);break;case"Left":case"Right":case"Some":Fe(e,1)&&Xe(e.args[0]);break;case"Lambda_rec":e.args&&Ke(e.args);break;case"Ticket":Fe(e,4)&&(!function(e){if("string"in e||"bytes"in e)return!0;throw new ke(e,"string or bytes literal expected")}(e.args[0]),Ye(e.args[1]),Xe(e.args[2]),Ue(e.args[3]));break;default:if(!Object.prototype.hasOwnProperty.call(Ie,e.prim))throw new ke(e,"data entry or instruction expected");Ke(e)}return!0}function Qe(e){if(Ne(e)){const t={},r={};for(const n of e)if(Ce(n)){if("view"!==n.prim){if(n.prim in t)throw new ke(e,`duplicate contract section: ${n.prim}`);t[n.prim]=!0}switch(n.prim){case"code":Fe(n,1)&&Ne(n.args[0])&&Ke(n.args[0]);break;case"parameter":if(Fe(n,1)&&ze(n.args[0]),n.annots)throw new ke(n,"Annotation must be part of the parameter type");break;case"storage":Fe(n,1)&&Ve(n.args[0]);break;case"view":if(Fe(n,4)){if(Be(n.args[0])){const t=n.args[0];if(t.string in r)throw new ke(e,`duplicate view name: ${t.string}`);r[t.string]=!0,Ze(t)}$e(n.args[1]),$e(n.args[2]),Ne(n.args[3])&&Ke(n.args[3])}break;default:throw new ke(e,`unexpected contract section: ${n.prim}`)}}}return!0}function et(e){try{return Qe(e),!0}catch(e){return!1}}function tt(e){try{return Xe(e),!0}catch(e){return!1}}function rt(e){try{return Ke(e),!0}catch(e){return!1}}function nt(e){try{return Ye(e),!0}catch(e){return!1}}function it(e){return Object.prototype.hasOwnProperty.call(Ie,e.prim)}function ot(e){if(!Array.isArray(e))return!1;for(const t of e)if("prim"in t){if(it(t))throw new ue(e,`Instruction outside of a lambda: ${JSON.stringify(e)}`);if("Elt"===t.prim)throw new ue(e,`Elt item outside of a map literal: ${JSON.stringify(e)}`)}return!0}"function"==typeof SuppressedError&&SuppressedError;const st=["parameter","storage","code","False","Elt","Left","None","Pair","Right","Some","True","Unit","PACK","UNPACK","BLAKE2B","SHA256","SHA512","ABS","ADD","AMOUNT","AND","BALANCE","CAR","CDR","CHECK_SIGNATURE","COMPARE","CONCAT","CONS","CREATE_ACCOUNT","CREATE_CONTRACT","IMPLICIT_ACCOUNT","DIP","DROP","DUP","EDIV","EMPTY_MAP","EMPTY_SET","EQ","EXEC","FAILWITH","GE","GET","GT","HASH_KEY","IF","IF_CONS","IF_LEFT","IF_NONE","INT","LAMBDA","LE","LEFT","LOOP","LSL","LSR","LT","MAP","MEM","MUL","NEG","NEQ","NIL","NONE","NOT","NOW","OR","PAIR","PUSH","RIGHT","SIZE","SOME","SOURCE","SENDER","SELF","STEPS_TO_QUOTA","SUB","SWAP","TRANSFER_TOKENS","SET_DELEGATE","UNIT","UPDATE","XOR","ITER","LOOP_LEFT","ADDRESS","CONTRACT","ISNAT","CAST","RENAME","bool","contract","int","key","key_hash","lambda","list","map","big_map","nat","option","or","pair","set","signature","string","bytes","mutez","timestamp","unit","operation","address","SLICE","DIG","DUG","EMPTY_BIG_MAP","APPLY","chain_id","CHAIN_ID","LEVEL","SELF_ADDRESS","never","NEVER","UNPAIR","VOTING_POWER","TOTAL_VOTING_POWER","KECCAK","SHA3","PAIRING_CHECK","bls12_381_g1","bls12_381_g2","bls12_381_fr","sapling_state","sapling_transaction_deprecated","SAPLING_EMPTY_STATE","SAPLING_VERIFY_UPDATE","ticket","TICKET_DEPRECATED","READ_TICKET","SPLIT_TICKET","JOIN_TICKETS","GET_AND_UPDATE","chest","chest_key","OPEN_CHEST","VIEW","view","constant","SUB_MUTEZ","tx_rollup_l2_address","MIN_BLOCK_TIME","sapling_transaction","EMIT","Lambda_rec","LAMBDA_REC","TICKET","BYTES","NAT","Ticket"],at=Object.assign({},...st.map(((e,t)=>({[e]:t}))));var ct;!function(e){e[e.Int=0]="Int",e[e.String=1]="String",e[e.Sequence=2]="Sequence",e[e.Prim0=3]="Prim0",e[e.Prim0Annot=4]="Prim0Annot",e[e.Prim1=5]="Prim1",e[e.Prim1Annot=6]="Prim1Annot",e[e.Prim2=7]="Prim2",e[e.Prim2Annot=8]="Prim2Annot",e[e.Prim=9]="Prim",e[e.Bytes=10]="Bytes"}(ct||(ct={}));class ut{constructor(){this.buffer=[]}get length(){return this.buffer.length}writeBytes(e){this.buffer.push(...e.map((e=>255&e)))}writeUint8(e){const t=0|e;this.buffer.push(255&t)}writeUint16(e){const t=0|e;this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeUint32(e){const t=0|e;this.buffer.push(t>>24&255),this.buffer.push(t>>16&255),this.buffer.push(t>>8&255),this.buffer.push(255&t)}writeInt8(e){this.writeUint8(e)}writeInt16(e){this.writeUint16(e)}writeInt32(e){this.writeUint32(e)}}const lt=new Error("bounds out of range");class dt{constructor(e,t=0,r=e.length){this.buffer=e,this.idx=t,this.cap=r}get length(){return this.cap-this.idx}readBytes(e){if(this.cap-this.idx<e)throw lt;const t=this.buffer.slice(this.idx,this.idx+e);return this.idx+=e,t}reader(e){if(this.cap-this.idx<e)throw lt;const t=new dt(this.buffer,this.idx,this.idx+e);return this.idx+=e,t}copy(){return new dt(this.buffer,this.idx,this.cap)}readUint8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]>>>0}readUint16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readUint32(){if(this.cap-this.idx<4)throw lt;return(this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++])>>>0}readInt8(){if(this.cap-this.idx<1)throw lt;return this.buffer[this.idx++]<<24>>24}readInt16(){if(this.cap-this.idx<2)throw lt;return(this.buffer[this.idx++]<<8|this.buffer[this.idx++])<<16>>16}readInt32(){if(this.cap-this.idx<4)throw lt;return this.buffer[this.idx++]<<24|this.buffer[this.idx++]<<16|this.buffer[this.idx++]<<8|this.buffer[this.idx++]}}var ft,ht,pt;function bt(e){let t;const r=e.readUint8();switch(r){case ht.ED25519:t="ED25519PublicKeyHash";break;case ht.SECP256K1:t="SECP256K1PublicKeyHash";break;case ht.P256:t="P256PublicKeyHash";break;default:throw new Error(`unknown public key hash tag: ${r}`)}return{type:t,hash:e.readBytes(20)}}function mt(e){let t;const r=e.readUint8();switch(r){case ft.Implicit:t=bt(e);break;case ft.Originated:t={type:"ContractHash",hash:e.readBytes(20)},e.readBytes(1);break;default:throw new Error(`unknown address tag: ${r}`)}if(0!==e.length){const r=new TextDecoder;t.entryPoint=r.decode(new Uint8Array(e.readBytes(e.length)))}return t}function gt(e,t){let r;switch(e.type){case"ED25519PublicKeyHash":r=ht.ED25519;break;case"SECP256K1PublicKeyHash":r=ht.SECP256K1;break;case"P256PublicKeyHash":r=ht.P256;break;default:throw new Error(`unexpected address type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.hash))}function vt(e){let t,r;const n=e.readUint8();switch(n){case pt.ED25519:r="ED25519PublicKey",t=32;break;case pt.SECP256K1:r="SECP256K1PublicKey",t=33;break;case pt.P256:r="P256PublicKey",t=33;break;default:throw new Error(`unknown public key tag: ${n}`)}return{type:r,publicKey:e.readBytes(t)}}function yt(e,t,r){var n,i;const[o,s]=r(e);if(Array.isArray(o)){const e=new ut;for(const t of o){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}return t.writeUint8(ct.Sequence),t.writeUint32(e.length),void t.writeBytes(e.buffer)}if("string"in o){const e=(new TextEncoder).encode(o.string);return t.writeUint8(ct.String),t.writeUint32(e.length),void t.writeBytes(Array.from(e))}if("int"in o){t.writeUint8(ct.Int);let e=BigInt(o.int);const r=e<0;r&&(e=-e);let n=0;do{const i=0===n?BigInt(6):BigInt(7);let o=e&(BigInt(1)<<i)-BigInt(1);e>>=i,e&&(o|=BigInt(128)),0===n&&r&&(o|=BigInt(64)),t.writeUint8(Number(o)),n++}while(e);return}if("bytes"in o){const e=function(e){const t=[];for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2),i=parseInt(n,16);if(Number.isNaN(i))throw new ce(n);t.push(i)}return t}(o.bytes);return t.writeUint8(ct.Bytes),t.writeUint32(e.length),void t.writeBytes(e)}const a=at[o.prim];if(void 0===a)throw new TypeError(`Can't encode primary: ${o.prim}`);const c=((null===(n=o.args)||void 0===n?void 0:n.length)||0)<3?ct.Prim0+2*((null===(i=o.args)||void 0===i?void 0:i.length)||0)+(void 0===o.annots||0===o.annots.length?0:1):ct.Prim;if(t.writeUint8(c),t.writeUint8(a),void 0!==o.args)if(o.args.length<3)for(const e of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(e,t,r.value)}else{const e=new ut;for(const t of o.args){const r=s.next();if(r.done)throw new Error("REPORT ME: iterator is done");yt(t,e,r.value)}t.writeUint32(e.length),t.writeBytes(e.buffer)}if(void 0!==o.annots&&0!==o.annots.length){const e=(new TextEncoder).encode(o.annots.join(" "));t.writeUint32(e.length),t.writeBytes(Array.from(e))}else void 0!==o.args&&o.args.length>=3&&t.writeUint32(0)}function _t(e,t){function*r(){for(;;)yield It}const[n,i]=t,o=e.readUint8();switch(o){case ct.Int:{const t=[];let r;do{r=e.readInt8(),t.push(r)}while(128&r);let n=BigInt(0),o=!1;for(let e=t.length-1;e>=0;e--){const r=0===e?BigInt(6):BigInt(7),i=BigInt(t[e]);n<<=r,n|=i&(BigInt(1)<<r)-BigInt(1),0===e&&(o=!!(i&BigInt(64)))}return o&&(n=-n),i({int:String(n)})}case ct.String:{const t=e.readUint32(),r=e.readBytes(t);return i({string:(new TextDecoder).decode(new Uint8Array(r))})}case ct.Bytes:{const t=e.readUint32(),r=e.readBytes(t);return i({bytes:Pe(Array.from(r))})}case ct.Sequence:{const t=e.readUint32();let o=[],s=e.copy(),a=r();for(let r=0;r<2;r++){const r=s.reader(t);for(o=[];r.length>0;){const e=a.next();if(e.done)throw new Error("REPORT ME: iterator is done");o.push(_t(r,e.value))}a=n(o),s=e}return i(o)}default:{if(o>9)throw new Error(`Unknown tag: ${o}`);const t=e.readUint8();if(t>=st.length)throw new Error(`Unknown primitive tag: ${t}`);const s=st[t],a=o-3>>1;let c={prim:s},u=r(),l=e.copy();for(let t=0;t<2;t++){if(c={prim:s},a<3)for(let e=0;e<a;e++){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args=c.args||[],c.args.push(_t(l,e.value))}else{c.args=c.args||[];const e=l.readUint32(),t=l.reader(e);for(;t.length>0;){const e=u.next();if(e.done)throw new Error("REPORT ME: iterator is done");c.args.push(_t(t,e.value))}}u=n(c),l=e}if(1==(o-3&1)||3===a){const t=e.readUint32();if(0!==t){const r=e.readBytes(t),n=new TextDecoder;c.annots=n.decode(new Uint8Array(r)).split(" ")}}return i(c)}}}!function(e){e[e.Implicit=0]="Implicit",e[e.Originated=1]="Originated"}(ft||(ft={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(ht||(ht={})),function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.P256=2]="P256"}(pt||(pt={}));const Et=e=>"prim"in e&&("Left"===e.prim||"Right"===e.prim),wt=e=>"prim"in e&&("Some"===e.prim||"None"===e.prim),Ot=e=>{if(we(e))return t=>{if(!Oe(t))throw new de(e,`pair expected: ${JSON.stringify(t)}`,t);ot(t);const r=Ee("pair",e);return[Ee("Pair",t),function*(){for(const e of r.args)yield Ot(e)}()]};switch(e.prim){case"or":return t=>{if(!Et(t))throw new de(e,`or expected: ${JSON.stringify(t)}`,t);return[t,function*(){yield Ot(e.args["Left"===t.prim?0:1])}()]};case"option":return t=>{if(!wt(t))throw new de(e,`option expected: ${JSON.stringify(t)}`,t);return[t,function*(){"Some"===t.prim&&(yield Ot(e.args[0]))}()]};case"list":case"set":return t=>{if(!Array.isArray(t))throw new de(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield Ot(e.args[0])}()]};case"map":return t=>{if(!Array.isArray(t))throw new de(e,`map expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const r of t)yield t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new de(e,`map element expected: ${JSON.stringify(t)}`,t);return[t,function*(){for(const t of e.args)yield Ot(t)}()]}}()]};case"chain_id":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`chain id expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ChainID");if(null===n)throw new de(e,`chain id base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"signature":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`signature expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature");if(null===n)throw new de(e,`signature base58 expected: ${t.string}`,t);r={bytes:Pe(n[1])}}else r=t;return[r,[][Symbol.iterator]()]};case"key_hash":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`key hash expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash");if(null===n)throw new de(e,`key hash base58 expected: ${t.string}`,t);const i=new ut;gt({type:n[0],hash:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"key":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`public key expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=ye(t.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey");if(null===n)throw new de(e,`public key base58 expected: ${t.string}`,t);const i=new ut;!function(e,t){let r;switch(e.type){case"ED25519PublicKey":r=pt.ED25519;break;case"SECP256K1PublicKey":r=pt.SECP256K1;break;case"P256PublicKey":r=pt.P256;break;default:throw new Error(`unexpected public key type: ${e.type}`)}t.writeUint8(r),t.writeBytes(Array.from(e.publicKey))}({type:n[0],publicKey:n[1]},i),r={bytes:Pe(i.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"address":return t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`address expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=t.string.split("%"),i=ye(n[0],"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash");if(null===i)throw new de(e,`address base58 expected: ${t.string}`,t);const o=new ut;!function(e,t){if("ContractHash"===e.type?(t.writeUint8(ft.Originated),t.writeBytes(Array.from(e.hash)),t.writeUint8(0)):(t.writeUint8(ft.Implicit),gt(e,t)),void 0!==e.entryPoint&&""!==e.entryPoint&&"default"!==e.entryPoint){const r=(new TextEncoder).encode(e.entryPoint);t.writeBytes(Array.from(r))}}({type:i[0],hash:i[1],entryPoint:n.length>1?n[1]:void 0},o),r={bytes:Pe(o.buffer)}}else r=t;return[r,[][Symbol.iterator]()]};case"timestamp":return t=>{if(!("string"in t)&&!("int"in t))throw new de(e,`timestamp expected: ${JSON.stringify(t)}`,t);let r;if("string"in t){const n=Se(t);if(null===n)throw new de(e,`can't parse date: ${t.string}`,t);r={int:String(Math.floor(n.getTime()/1e3))}}else r=t;return[r,[][Symbol.iterator]()]};default:return St}},At=e=>"prim"in e&&"PUSH"===e.prim,St=e=>At(e)?(Ke(e),[e,function*(){yield St,yield Ot(e.args[0])}()]):[e,function*(){for(;;)yield St}()];function Pt(e,t){const r=new ut;return r.writeUint8(5),yt(e,r,void 0!==t?Ot(t):St),r.buffer}function Tt(e,t){return{bytes:Pe(Pt(e,t))}}const Rt=e=>{if(we(e))return[t=>{if(!Oe(t))throw new de(e,`pair expected: ${JSON.stringify(t)}`,t);const r=Ee("pair",e);return function*(){for(const e of r.args)yield Rt(e)}()},e=>e];switch(e.prim){case"or":return[t=>{if(!Et(t))throw new de(e,`or expected: ${JSON.stringify(t)}`,t);return function*(){yield Rt(e.args["Left"===t.prim?0:1])}()},e=>e];case"option":return[t=>{if(!wt(t))throw new de(e,`option expected: ${JSON.stringify(t)}`,t);return function*(){"Some"===t.prim&&(yield Rt(e.args[0]))}()},e=>e];case"list":case"set":return[t=>{if(!Array.isArray(t))throw new de(e,`${e.prim} expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield Rt(e.args[0])}()},e=>e];case"map":return[t=>{if(!Array.isArray(t))throw new de(e,`map expected: ${JSON.stringify(t)}`,t);return function*(){for(;;)yield[t=>{if(!("prim"in t)||"Elt"!==t.prim)throw new de(e,`map element expected: ${JSON.stringify(t)}`,t);return function*(){for(const t of e.args)yield Rt(t)}()},e=>e]}()},e=>e];case"chain_id":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`chain id expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("ChainID",r)}}];case"signature":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`signature expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);return{string:_e("GenericSignature",r)}}];case"key_hash":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`key hash expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);const n=bt(new dt(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"key":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`public key expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);const n=vt(new dt(new Uint8Array(r)));return{string:_e(n.type,n.publicKey)}}];case"address":return[()=>[][Symbol.iterator](),t=>{if(!("bytes"in t)&&!("string"in t))throw new de(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;const r=he(t.bytes);if(null===r)throw new de(e,`can't parse bytes: ${t.bytes}`,t);const n=mt(new dt(new Uint8Array(r)));return{string:_e(n.type,n.hash)+(n.entryPoint?"%"+n.entryPoint:"")}}];case"timestamp":return[()=>[][Symbol.iterator](),t=>{if(!("int"in t)&&!("string"in t))throw new de(e,`address expected: ${JSON.stringify(t)}`,t);if("string"in t)return t;return{string:new Date(1e3*parseInt(t.int,10)).toISOString().slice(0,19)+"Z"}}];default:return It}},It=[e=>At(e)?(Ke(e),function*(){yield It,yield Rt(e.args[0])}()):function*(){for(;;)yield It}(),e=>e];function xt(e,t){const r=new dt(e);if(5!==r.readUint8())throw new Error("incorrect packed data magic number");const n=_t(r,void 0!==t?Rt(t):It);if(Xe(n))return n;throw new Error}function Mt(e,t){const r=he(e.bytes);if(null===r)throw new Error(`can't parse bytes: "${e.bytes}"`);return xt(r,t)}function kt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return mt(new dt(new Uint8Array(t)))}function Lt(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return bt(new dt(new Uint8Array(t)))}function Ct(e){const t=he(e.bytes);if(null===t)throw new Error(`can't parse bytes: "${e.bytes}"`);return vt(new dt(new Uint8Array(t)))}class Nt extends ue{constructor(e,t,r){super(e,r),this.val=e,this.stackState=t,this.message=r,this.name="MichelsonInstructionError"}}function jt(e){return Array.isArray(e)?"pair":e.prim}function Dt(e){return"prim"in e?e.args:e}function Ut(e,t,r=!1){if(jt(e)!==jt(t))throw new de(e,`types mismatch: ${jt(e)} != ${jt(t)}`,void 0);const n=[ge(e),ge(t)];if(n[0].t&&n[1].t&&n[0].t[0]!==n[1].t[0])throw new de(e,`${jt(e)}: type names mismatch: ${n[0].t[0]} != ${n[1].t[0]}`,void 0);if(r&&n[0].f&&n[1].f&&n[0].f[0]!==n[1].f[0])throw new de(e,`${jt(e)}: field names mismatch: ${n[0].f[0]} != ${n[1].f}`,void 0);if(we(e)){const r=Ee("pair",e),n=Ee("pair",t);return Ut(r.args[0],n.args[0],!0),void Ut(r.args[1],n.args[1],!0)}switch(e.prim){case"option":case"list":case"contract":case"set":case"ticket":Ut(e.args[0],t.args[0]);break;case"or":Ut(e.args[0],t.args[0],!0),Ut(e.args[1],t.args[1],!0);break;case"lambda":case"map":case"big_map":Ut(e.args[0],t.args[0]),Ut(e.args[1],t.args[1]);break;case"sapling_state":case"sapling_transaction":if(parseInt(e.args[0].int,10)!==parseInt(t.args[0].int,10))throw new de(e,`${jt(e)}: type argument mismatch: ${e.args[0].int} != ${t.args[0].int}`,void 0)}}function Bt(e,t){if(e.length!==t.length)throw new de(e,`stack length mismatch: ${e.length} != ${t.length}`,void 0);for(let r=0;r<e.length;r++)Ut(e[r],t[r])}function Ft(e,t=!1){var r,n,i;if(!Array.isArray(e)){const o=ge(e);if(((null===(r=o.t)||void 0===r?void 0:r.length)||0)>1)throw new de(e,`${e.prim}: at most one type annotation allowed: ${e.annots}`,void 0);if(t){if(((null===(n=o.f)||void 0===n?void 0:n.length)||0)>1)throw new de(e,`${e.prim}: at most one field annotation allowed: ${e.annots}`,void 0)}else if(((null===(i=o.f)||void 0===i?void 0:i.length)||0)>0)throw new de(e,`${e.prim}: field annotations aren't allowed: ${e.annots}`,void 0)}if(we(e)){const t=Dt(e);for(const e of t)Ft(e,!0)}else switch(e.prim){case"option":case"list":case"contract":case"set":Ft(e.args[0]);break;case"or":for(const t of e.args)Ft(t,!0);break;case"lambda":case"map":case"big_map":Ft(e.args[0]),Ft(e.args[1])}}function Kt(e){if(!Array.isArray(e))return!1;for(const t of e)if(!(Array.isArray(t)&&Kt(t)||"prim"in t&&it(t)))return!1;return!0}function Ht(e,t,r){if(we(t)){if(Oe(e)){ot(e);const n=Ee("Pair",e),i=Ee("pair",t);return Ht(n.args[0],i.args[0],r),void Ht(n.args[1],i.args[1],r)}throw new de(t,`pair expected: ${JSON.stringify(e)}`,e)}switch(t.prim){case"int":if("int"in e&&pe(e.int))return;throw new de(t,`integer value expected: ${JSON.stringify(e)}`,e);case"nat":case"mutez":if("int"in e&&be(e.int))return;throw new de(t,`natural value expected: ${JSON.stringify(e)}`,e);case"string":if("string"in e)return;throw new de(t,`string value expected: ${JSON.stringify(e)}`,e);case"bytes":case"bls12_381_g1":case"bls12_381_g2":if("bytes"in e&&null!==he(e.bytes))return;throw new de(t,`bytes value expected: ${JSON.stringify(e)}`,e);case"bool":if("prim"in e&&("True"===e.prim||"False"===e.prim))return;throw new de(t,`boolean value expected: ${JSON.stringify(e)}`,e);case"key_hash":if("string"in e&&null!==ye(e.string,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash"))return;if("bytes"in e)try{return void Lt(e)}catch(e){}throw new de(t,`key hash expected: ${JSON.stringify(e)}`,e);case"timestamp":if(("string"in e||"int"in e)&&null!==Se(e))return;throw new de(t,`timestamp expected: ${JSON.stringify(e)}`,e);case"address":if("string"in e){let t=e.string;const r=e.string.indexOf("%");if(r>=0&&(t=e.string.slice(0,r)),null!==ye(t,"ED25519PublicKeyHash","SECP256K1PublicKeyHash","P256PublicKeyHash","ContractHash","RollupAddress"))return}else if("bytes"in e)try{return void kt(e)}catch(e){}throw new de(t,`address expected: ${JSON.stringify(e)}`,e);case"key":if("string"in e&&null!==ye(e.string,"ED25519PublicKey","SECP256K1PublicKey","P256PublicKey"))return;if("bytes"in e)try{return void Ct(e)}catch(e){}throw new de(t,`public key expected: ${JSON.stringify(e)}`,e);case"unit":if("prim"in e&&"Unit"===e.prim)return;throw new de(t,`unit value expected: ${JSON.stringify(e)}`,e);case"signature":if("bytes"in e||"string"in e&&null!==ye(e.string,"ED25519Signature","SECP256K1Signature","P256Signature","GenericSignature"))return;throw new de(t,`signature expected: ${JSON.stringify(e)}`,e);case"chain_id":if("bytes"in e||"string"in e){if(null!==("string"in e?ee(e.string):he(e.bytes)))return}throw new de(t,`chain id expected: ${JSON.stringify(e)}`,e);case"option":if("prim"in e){if("None"===e.prim)return;if("Some"===e.prim)return void Ht(e.args[0],t.args[0],r)}throw new de(t,`option expected: ${JSON.stringify(e)}`,e);case"list":case"set":if(ot(e)){for(const n of e)Ht(n,t.args[0],r);return}throw new de(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"or":if("prim"in e){if("Left"===e.prim)return void Ht(e.args[0],t.args[0],r);if("Right"===e.prim)return void Ht(e.args[0],t.args[1],r)}throw new de(t,`union (or) expected: ${JSON.stringify(e)}`,e);case"lambda":if(Kt(e)){const n=Gt(e,[t.args[0]],r);if("failed"in n)throw new de(t,`function is failed with error type: ${n.failed}`,e);if(1!==n.length)throw new de(t,"function must return a value",e);return void Ut(t.args[1],n[0])}throw new de(t,`function expected: ${JSON.stringify(e)}`,e);case"map":case"big_map":if(Array.isArray(e)){for(const n of e){if(!("prim"in n)||"Elt"!==n.prim)throw new de(t,`map elements expected: ${JSON.stringify(e)}`,e);Ht(n.args[0],t.args[0],r),Ht(n.args[1],t.args[1],r)}return}throw new de(t,`${t.prim} expected: ${JSON.stringify(e)}`,e);case"bls12_381_fr":if("int"in e&&pe(e.int)||"bytes"in e&&null!==he(e.bytes))return;throw new de(t,`BLS12-381 element expected: ${JSON.stringify(e)}`,e);case"sapling_state":if(Array.isArray(e))return;throw new de(t,`sapling state expected: ${JSON.stringify(e)}`,e);case"ticket":if("prim"in e&&"Ticket"===e.prim)return Ht(e.args[0],{prim:"address"},r),Xt(e.args[1],t.args[0]),Ht(e.args[2],t.args[0],r),void Ht(e.args[3],{prim:"nat"},r);if(Oe(e))return void Ht(e,{prim:"pair",args:[{prim:"address"},t.args[0],{prim:"nat"}]},r);throw new de(t,`ticket expected: ${JSON.stringify(e)}`,e);default:throw new de(t,`type ${jt(t)} don't have Michelson literal representation`,e)}}function Gt(e,t,r){const n=(null==r?void 0:r.protocol)||b;if(Array.isArray(e))return function(e,t,r){let n=t,i=t,o=0;for(const t of e){const e=Gt(t,i,r);if(n=e,"failed"in e)break;i=e,o++}if("failed"in n&&0==n.level&&(!("prim"in n.failed)||"never"!==n.failed.prim)&&o!==e.length-1)throw new Nt(e,n,"FAIL must appear in a tail position");if(void 0!==(null==r?void 0:r.traceCallback)){const i={op:e,in:t,out:n};r.traceCallback(i)}return"failed"in n?{failed:n.failed,level:n.level+1}:n}(e,t,r);const i=e;function o(e,...r){if(t.length<r.length+e)throw new Nt(i,t,`${i.prim}: stack must have at least ${r.length} element(s)`);let n=e;for(const e of r){if(null!==e&&0!==e.length){let r=0;for(;r<e.length&&e[r]!==jt(t[n]);)r++;if(r===e.length)throw new Nt(i,t,`${i.prim}: stack type mismatch: [${n}] expected to be ${e}, got ${jt(t[n])} instead`)}n++}return t.slice(e,r.length+e)}function s(e){return(...r)=>{try{return e(...r)}catch(e){throw e instanceof ue?new Nt(i,t,e.message):e}}}function a(e){return r=>{try{return e(r)}catch(e){throw e instanceof ue?new Nt(i,t,e.message):e}}}const c=s(ge),u=s(Bt),l=s(Ut),d=a(He),f=a(Ge),m=a(Ve),g=a($e),y=a(We);function _(e,r){const n=c(i,Object.assign(Object.assign({},r),{emptyFields:void 0!==e.f&&e.f>1,emptyVar:void 0!==e.v&&e.v>1})),o=(e,r,n)=>{if(e&&e.length>(r||0))throw new Nt(i,t,`${i.prim}: at most ${r||0} ${n} annotations allowed`)};return o(n.f,e.f,"field"),o(n.t,e.t,"type"),o(n.v,e.v,"variable"),n}function E(e,t){const r=e,n=Array.isArray(r)?{prim:"pair",args:r}:r,i=c(n),o=void 0!==t.v||void 0!==t.t||void 0!==t.f?[...(null===t.v?i.v:t.v)||[],...(null===t.t?i.t:t.t)||[],...(null===t.f?i.f:t.f)||[]]:void 0,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(n,["annots"]);return Object.assign(Object.assign({},s),o&&0!==o.length&&{annots:o})}function w(e,t){const r=_({v:1});return E(e,{v:void 0!==r.v?r.v:void 0!==t?[t]:null,t:null})}function O(e,r,n,o,s){var a,u,l,d;const f=null===(a=c(r).f)||void 0===a?void 0:a[0],h=null===(u=n.f)||void 0===u?void 0:u[o];if(void 0!==h&&"%"!==h&&void 0!==f&&h!==f)throw new Nt(i,t,`${i.prim}: field names doesn't match: ${h} !== ${f}`);const p=null===(l=n.v)||void 0===l?void 0:l[o],b=null===(d=c(e).v)||void 0===d?void 0:d[0];return E(r,{t:null,v:p?"@%"===p?f?["@"+f.slice(1)]:void 0:"@%%"===p?b?["@"+b.slice(1)+"."+(f?f.slice(1):s)]:f?["@"+f.slice(1)]:void 0:[p]:null})}function A(e,r,n=r){const o=Ee("pair",e);if(1===n)return[o.args[0]];if(2===n)return o.args;const s=o.args[1];if(we(s))return[o.args[0],...A(s,r,n-1)];throw new Nt(i,t,`${i.prim}: at least ${r} fields are expected`)}function S(e,r,n=r){if(0===n)return e;const o=Ee("pair",e);if(1===n)return o.args[0];const s=o.args[1];if(we(s))return S(s,r,n-2);if(2===n)return s;throw new Nt(i,t,`${i.prim}: at least ${r+1} fields are expected`)}function P(e,r,n,o=n){if(0===o)return r;const s=Ee("pair",e);if(1===o)return Object.assign(Object.assign({},s),{args:[r,s.args[1]]});const a=s.args[1];if(we(a))return Object.assign(Object.assign({},s),{args:[s.args[0],P(a,r,n,o-2)]});if(2===o)return Object.assign(Object.assign({},s),{args:[s.args[0],r]});throw new Nt(i,t,`${i.prim}: at least ${n+1} fields are expected`)}const T=(e,t)=>["@"+(e.v?e.v[0].slice(1)+".":"")+t];function R(e,t){return"failed"in e||"failed"in t?"failed"in e?t:e:(u(e,t),e)}const I=(e=>{var i,s,a,b,I;switch(e.prim){case"DUP":{const r=e.args?parseInt(e.args[0].int,10):1;if(0===r)throw new Nt(e,t,"DUP 0 is forbidden");const n=o(r-1,null)[0];if("ticket"===jt(n))throw new Nt(e,t,"ticket can't be DUPed");return[n,...t]}case"SWAP":{const e=o(0,null,null);return _({}),[e[1],e[0],...t.slice(2)]}case"SOME":return[E({prim:"option",args:[o(0,null)[0]]},_({t:1,v:1})),...t.slice(1)];case"UNIT":return[E({prim:"unit"},_({v:1,t:1})),...t];case"PAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Nt(e,t,`PAIR ${r} is forbidden`);const n=o(0,...new Array(r).fill(null)),i=_({f:r,t:1,v:1},{specialFields:!0}),s=e=>{const t=e.lastIndexOf(".");return e.slice(t>0?t+1:1)},a=n.map(((e,t)=>{var r;const n=c(e);return E(e,{v:null,t:null,f:i.f&&i.f.length>t&&"%"!==i.f[t]?"%@"===i.f[t]?n.v?["%"+s((null===(r=n.v)||void 0===r?void 0:r[0])||"")]:void 0:[i.f[t]]:void 0})}));return[E({prim:"pair",args:a},{t:i.t,v:i.v}),...t.slice(r)]}case"UNPAIR":{const r=e.args?parseInt(e.args[0].int,10):2;if(r<2)throw new Nt(e,t,`UNPAIR ${r} is forbidden`);const n=o(0,["pair"])[0],i=_({f:2,v:2},{specialVar:!0});return[...A(n,r).map(((e,t)=>O(n,e,i,t,0===t?"car":"cdr"))),...t.slice(1)]}case"CAR":case"CDR":{const r=Ee("pair",o(0,["pair"])[0]);return[O(r,r.args["CAR"===e.prim?0:1],_({f:1,v:1},{specialVar:!0}),0,e.prim.toLocaleLowerCase()),...t.slice(1)]}case"CONS":{const e=o(0,null,["list"]);return l(e[0],e[1].args[0]),[w({prim:"list",args:[e[1].args[0]]}),...t.slice(2)]}case"SIZE":return o(0,["string","list","set","map","bytes"]),[w({prim:"nat"}),...t.slice(1)];case"MEM":{const e=o(0,null,["set","map","big_map"]);return d(e[0]),l(e[0],e[1].args[0]),[w({prim:"bool"}),...t.slice(2)]}case"GET":if(e.args){const r=parseInt(e.args[0].int,10);return[w(S(o(0,["pair"])[0],r)),...t.slice(1)]}{const e=o(0,null,["map","big_map"]);return d(e[0]),l(e[0],e[1].args[0]),[w({prim:"option",args:[e[1].args[1]]}),...t.slice(2)]}case"UPDATE":if(e.args){const r=parseInt(e.args[0].int,10),n=o(0,null,["pair"]);return[w(P(n[1],n[0],r)),...t.slice(2)]}{const e=o(0,null,["bool","option"]);if(d(e[0]),"bool"===e[1].prim){const r=o(2,["set"]);return l(e[0],r[0].args[0]),[w({prim:"set",args:[E(e[0],{t:null})]}),...t.slice(3)]}const r=o(2,["map","big_map"]);return l(e[0],r[0].args[0]),"map"===r[0].prim?[w({prim:"map",args:[E(e[0],{t:null}),E(e[1].args[0],{t:null})]}),...t.slice(3)]:(y(e[1].args[0]),[w({prim:"big_map",args:[E(e[0],{t:null}),E(e[1].args[0],{t:null})]}),...t.slice(3)])}case"GET_AND_UPDATE":{const e=_({v:2}),r=o(0,null,["option"],["map","big_map"]);d(r[0]),l(r[0],r[2].args[0]),l(r[1].args[0],r[2].args[1]);const n=null===(i=e.v)||void 0===i?void 0:i.map((e=>"@"!==e?[e]:void 0));return"map"===r[2].prim?[E({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),E({prim:"map",args:[E(r[0],{t:null}),E(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)]:(y(r[1].args[0]),[E({prim:"option",args:[r[2].args[1]]},{v:null==n?void 0:n[0]}),E({prim:"big_map",args:[E(r[0],{t:null}),E(r[1].args[0],{t:null})]},{v:null==n?void 0:n[1]}),...t.slice(3)])}case"EXEC":{const e=o(0,null,["lambda"]);return l(e[0],e[1].args[0]),[w(e[1].args[1]),...t.slice(2)]}case"APPLY":{const r=o(0,null,["lambda"]);if(m(r[0]),g(r[0]),!we(r[1].args[0]))throw new Nt(e,t,`${e.prim}: function's argument must be a pair: ${jt(r[1].args[0])}`);const n=r[1].args[0];return l(r[0],Dt(n)[0]),[w({prim:"lambda",args:[Dt(n)[1],r[1].args[1]]}),...t.slice(2)]}case"FAILWITH":{const e=o(0,null)[0];return v(n,p.PtEdo2Zk)||f(e),{failed:e,level:0}}case"NEVER":return o(0,["never"]),{failed:{prim:"never"},level:0};case"RENAME":return[w(o(0,null)[0]),...t.slice(1)];case"CONCAT":{const r=o(0,["string","list","bytes"]);if("list"===r[0].prim){if("string"!==jt(r[0].args[0])&&"bytes"!==jt(r[0].args[0]))throw new Nt(e,t,`${e.prim}: can't concatenate list of ${jt(r[0].args[0])}'s`);return[w(r[0].args[0]),...t.slice(1)]}const n=o(1,["string","bytes"]);if(r[0].prim!==n[0].prim)throw new Nt(e,t,`${e.prim}: can't concatenate ${r[0].prim} with ${n[0].prim}`);return[w(n[0]),...t.slice(2)]}case"SLICE":return[w({prim:"option",args:[o(0,["nat"],["nat"],["string","bytes"])[2]]},"@slice"),...t.slice(3)];case"PACK":{const e=o(0,null)[0];return f(e),[w({prim:"bytes"},"@packed"),...t.slice(1)]}case"ADD":{const r=o(0,["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","timestamp","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[w({prim:"int"}),...t.slice(2)];if("int"===r[0].prim&&"timestamp"===r[1].prim||"timestamp"===r[0].prim&&"int"===r[1].prim)return[w({prim:"timestamp"}),...t.slice(2)];if(("int"===r[0].prim||"nat"===r[0].prim||"mutez"===r[0].prim||"bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&r[0].prim===r[1].prim)return[w(r[0]),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't add ${r[0].prim} to ${r[1].prim}`)}case"SUB":{const r=v(n,p.PsiThaCa)?o(0,["nat","int","timestamp","mutez"],["nat","int","timestamp","mutez"]):o(0,["nat","int","timestamp"],["nat","int","timestamp"]);if(("nat"===r[0].prim||"int"===r[0].prim)&&("nat"===r[1].prim||"int"===r[1].prim)||"timestamp"===r[0].prim&&"timestamp"===r[1].prim)return[w({prim:"int"}),...t.slice(2)];if("timestamp"===r[0].prim&&"int"===r[1].prim)return[w({prim:"timestamp"}),...t.slice(2)];if("mutez"===r[0].prim&&"mutez"===r[1].prim)return[w({prim:"mutez"}),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't subtract ${r[0].prim} from ${r[1].prim}`)}case"SUB_MUTEZ":return o(0,["mutez"],["mutez"]),[w({prim:"option",args:[{prim:"mutez"}]}),...t.slice(2)];case"MUL":{const r=o(0,["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"],["nat","int","mutez","bls12_381_g1","bls12_381_g2","bls12_381_fr"]);if("nat"===r[0].prim&&"int"===r[1].prim||"int"===r[0].prim&&"nat"===r[1].prim)return[w({prim:"int"}),...t.slice(2)];if("nat"===r[0].prim&&"mutez"===r[1].prim||"mutez"===r[0].prim&&"nat"===r[1].prim)return[w({prim:"mutez"}),...t.slice(2)];if(("bls12_381_g1"===r[0].prim||"bls12_381_g2"===r[0].prim||"bls12_381_fr"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[0].prim||"int"===r[0].prim)&&r[0].prim===r[1].prim)return[w(r[0]),...t.slice(2)];if(("nat"===r[0].prim||"int"===r[0].prim)&&"bls12_381_fr"===r[1].prim||("nat"===r[1].prim||"int"===r[1].prim)&&"bls12_381_fr"===r[0].prim)return[w({prim:"bls12_381_fr"}),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't multiply ${r[0].prim} by ${r[1].prim}`)}case"EDIV":{const r=(e,t)=>({prim:"option",args:[{prim:"pair",args:[{prim:e},{prim:t}]}]}),n=o(0,["nat","int","mutez"],["nat","int","mutez"]);if("nat"===n[0].prim&&"nat"===n[1].prim)return[w(r("nat","nat")),...t.slice(2)];if(!("nat"!==n[0].prim&&"int"!==n[0].prim||"nat"!==n[1].prim&&"int"!==n[1].prim))return[w(r("int","nat")),...t.slice(2)];if("mutez"===n[0].prim&&"nat"===n[1].prim)return[w(r("mutez","mutez")),...t.slice(2)];if("mutez"===n[0].prim&&"mutez"===n[1].prim)return[w(r("nat","mutez")),...t.slice(2)];throw new Nt(e,t,`${e.prim}: can't euclideally divide ${n[0].prim} by ${n[1].prim}`)}case"ABS":return o(0,["int"]),[w({prim:"nat"}),...t.slice(1)];case"ISNAT":return o(0,["int"]),[w({prim:"option",args:[{prim:"nat"}]}),...t.slice(1)];case"INT":return o(0,["nat","bls12_381_fr","bytes"]),[w({prim:"int"}),...t.slice(1)];case"BYTES":return o(0,["nat","int"]),[w({prim:"bytes"}),...t.slice(1)];case"NAT":return o(0,["bytes"]),[w({prim:"nat"}),...t.slice(1)];case"NEG":{const e=o(0,["nat","int","bls12_381_g1","bls12_381_g2","bls12_381_fr"])[0];return"nat"===e.prim||"int"===e.prim?[w({prim:"int"}),...t.slice(1)]:[w(e),...t.slice(1)]}case"LSL":case"LSR":return o(0,["nat","bytes"],["nat","bytes"]),[w({prim:"nat"}),...t.slice(2)];case"OR":case"XOR":{const r=o(0,["nat","bytes","bool"],["nat","bytes","bool"]);if(r[0].prim!==r[1].prim)throw new Nt(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[w(r[1]),...t.slice(2)]}case"AND":{const r=o(0,["nat","bytes","bool","int"],["nat","bytes","bool"]);if(("int"!==r[0].prim||"nat"!==r[1].prim)&&r[0].prim!==r[1].prim)throw new Nt(e,t,`${e.prim}: both arguments must be of the same type: ${r[0].prim}, ${r[1].prim}`);return[w(r[1]),...t.slice(2)]}case"NOT":return"bool"===o(0,["nat","bytes","bool","int"])[0].prim?[w({prim:"bool"}),...t.slice(1)]:[w({prim:"int"}),...t.slice(1)];case"COMPARE":{const e=o(0,null,null);return d(e[0]),d(e[1]),[w({prim:"int"}),...t.slice(2)]}case"EQ":case"NEQ":case"LT":case"GT":case"LE":case"GE":return o(0,["int"]),[w({prim:"bool"}),...t.slice(1)];case"SELF":{if(void 0===(null==r?void 0:r.contract))throw new Nt(e,t,`${e.prim}: contract required`);const n=_({f:1,v:1}),i=Wt(r.contract,null===(s=n.f)||void 0===s?void 0:s[0]);if(null===i)throw new Nt(e,t,`${e.prim}: contract has no entrypoint ${i}`);return[E({prim:"contract",args:[i]},{v:n.v?n.v:["@self"]}),...t]}case"TRANSFER_TOKENS":{const e=o(0,null,["mutez"],["contract"]);return l(e[0],e[2].args[0]),[w({prim:"operation"}),...t.slice(3)]}case"SET_DELEGATE":{const r=o(0,["option"])[0];if("key_hash"!==jt(r.args[0]))throw new Nt(e,t,`${e.prim}: key hash expected: ${jt(r.args[0])}`);return[w({prim:"operation"}),...t.slice(1)]}case"IMPLICIT_ACCOUNT":return o(0,["key_hash"]),[w({prim:"contract",args:[{prim:"unit"}]}),...t.slice(1)];case"NOW":return[w({prim:"timestamp"},"@now"),...t];case"AMOUNT":return[w({prim:"mutez"},"@amount"),...t];case"BALANCE":return[w({prim:"mutez"},"@balance"),...t];case"CHECK_SIGNATURE":return o(0,["key"],["signature"],["bytes"]),[w({prim:"bool"}),...t.slice(3)];case"BLAKE2B":case"SHA256":case"SHA512":case"KECCAK":case"SHA3":return o(0,["bytes"]),[w({prim:"bytes"}),...t.slice(1)];case"HASH_KEY":return o(0,["key"]),[w({prim:"key_hash"}),...t.slice(1)];case"SOURCE":return[w({prim:"address"},"@source"),...t];case"SENDER":return[w({prim:"address"},"@sender"),...t];case"ADDRESS":{const e=o(0,["contract"])[0],r=_({v:1});return[E({prim:"address",[h]:e},{v:r.v?r.v:T(c(e),"address")}),...t.slice(1)]}case"SELF_ADDRESS":{const e={prim:"address"};return void 0!==(null==r?void 0:r.contract)&&(e[h]={prim:"contract",args:[$t(r.contract,"parameter").args[0]]}),[w(e,"@address"),...t]}case"CHAIN_ID":return[w({prim:"chain_id"}),...t];case"DROP":{_({});const r=void 0!==e.args?parseInt(e.args[0].int,10):1;return o(r-1,null),t.slice(r)}case"DIG":{_({});const r=parseInt(e.args[0].int,10);return[o(r,null)[0],...t.slice(0,r),...t.slice(r+1)]}case"DUG":{_({});const r=parseInt(e.args[0].int,10);return[...t.slice(1,r+1),o(0,null)[0],...t.slice(r+1)]}case"NONE":return Ft(e.args[0]),[E({prim:"option",args:[e.args[0]]},_({t:1,v:1})),...t];case"LEFT":case"RIGHT":{const r=o(0,null)[0],n=_({f:2,t:1,v:1},{specialFields:!0}),i=c(r),s=[E(r,{t:null,v:null,f:n.f&&n.f.length>0&&"%"!==n.f[0]?"%@"===n.f[0]?i.v?["%"+i.v[0].slice(1)]:void 0:n.f:void 0}),E(e.args[0],{t:null,f:n.f&&n.f.length>1&&"%"!==n.f[1]?n.f:void 0})];return[E({prim:"or",args:"LEFT"===e.prim?s:[s[1],s[0]]},{t:n.t,v:n.v}),...t.slice(1)]}case"NIL":return Ft(e.args[0]),[E({prim:"list",args:[e.args[0]]},_({t:1,v:1})),...t];case"UNPACK":return o(0,["bytes"]),Ft(e.args[0]),[w({prim:"option",args:[e.args[0]]},"@unpacked"),...t.slice(1)];case"CONTRACT":{const r=o(0,["address"])[0];Ft(e.args[0]);const n=_({v:1,f:1}),i=r[h];if(void 0!==i){const r=Wt(i,null===(a=n.f)||void 0===a?void 0:a[0]);if(null===r)throw new Nt(e,t,`${e.prim}: contract has no entrypoint ${r}`);l(r,e.args[0])}return[E({prim:"option",args:[{prim:"contract",args:[e.args[0]]}]},{v:n.v?n.v:T(c(r),"contract")}),...t.slice(1)]}case"CAST":{_({});const r=o(0,null)[0];return Ft(e.args[0]),l(e.args[0],r),[e.args[0],...t.slice(1)]}case"IF_NONE":{_({});const n=o(0,["option"])[0],i=t.slice(1);return R(Gt(e.args[0],i,r),Gt(e.args[1],[E(n.args[0],{t:null,v:T(c(n),"some")}),...i],r))}case"IF_LEFT":{_({});const n=o(0,["or"])[0],i=c(n),s=c(n.args[0]),a=c(n.args[1]),u=t.slice(1);return R(Gt(e.args[0],[E(n.args[0],{t:null,v:T(i,s.f?s.f[0].slice(1):"left")}),...u],r),Gt(e.args[1],[E(n.args[1],{t:null,v:T(i,a.f?a.f[0].slice(1):"right")}),...u],r))}case"IF_CONS":{_({});const n=o(0,["list"])[0],i=c(n),s=t.slice(1);return R(Gt(e.args[0],[E(n.args[0],{t:null,v:T(i,"hd")}),E(n,{t:null,v:T(i,"tl")}),...s],r),Gt(e.args[1],s,r))}case"IF":{_({}),o(0,["bool"]);const n=t.slice(1);return R(Gt(e.args[0],n,r),Gt(e.args[1],n,r))}case"MAP":{const n=o(0,["list","map","option"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[E(s,{t:null,v:T(c(n),"elt")}),...i],r);if("failed"in a){if(!("prim"in a.failed)||"never"!==a.failed.prim)throw new Nt(e,t,`${e.prim}: FAIL is not allowed in MAP`);return{failed:a.failed,level:a.level+1}}if(a.length<1)throw new Nt(e,t,`${e.prim}: function must return a value`);return u(a.slice(1),i),"list"===n.prim?[w({prim:"list",args:[a[0]]}),...i]:"map"===n.prim?[w({prim:"map",args:[n.args[0],a[0]]}),...i]:[w({prim:"option",args:[a[0]]}),...i]}case"ITER":{_({});const n=o(0,["set","list","map"])[0],i=t.slice(1),s="map"===n.prim?{prim:"pair",args:n.args}:n.args[0],a=Gt(e.args[0],[E(s,{t:null,v:T(c(n),"elt")}),...i],r);return"failed"in a?{failed:a.failed,level:a.level+1}:(u(a,i),i)}case"LOOP":{_({}),o(0,["bool"]);const n=t.slice(1),i=Gt(e.args[0],n,r);return"failed"in i?{failed:i.failed,level:i.level+1}:(u(i,[{prim:"bool"},...n]),n)}case"LOOP_LEFT":{_({});const n=o(0,["or"])[0],i=t.slice(1),s=Gt(e.args[0],[E(n.args[0],{t:null,v:T(c(n),"left")}),...i],r);return"failed"in s?{failed:s.failed,level:s.level+1}:(u(s,[n,...i]),[E(n.args[1],{t:null,v:_({v:1}).v}),...i])}case"DIP":{_({});const n=2===e.args.length?parseInt(e.args[0].int,10):1;o(n-1,null);const i=t.slice(0,n),s=t.slice(n),a=2===e.args.length?Gt(e.args[1],s,r):Gt(e.args[0],s,r);return"failed"in a?{failed:a.failed,level:a.level+1}:[...i,...a]}case"CREATE_CONTRACT":{const r=_({v:2}),n=o(0,["option"],["mutez"],null);if("key_hash"!==jt(n[0].args[0]))throw new Nt(e,t,`${e.prim}: key hash expected: ${jt(n[0].args[0])}`);m(n[2])&&(Zt(e.args[0]),Ut($t(e.args[0],"storage").args[0],n[2]));const i=null===(b=r.v)||void 0===b?void 0:b.map((e=>"@"!==e?[e]:void 0));return[E({prim:"operation"},{v:null==i?void 0:i[0]}),E({prim:"address",[h]:{prim:"contract",args:[$t(e.args[0],"parameter").args[0]]}},{v:null==i?void 0:i[1]}),...t.slice(3)]}case"PUSH":return Ft(e.args[0]),Ht(e.args[1],e.args[0],Object.assign(Object.assign({},r),{contract:void 0})),[w(e.args[0]),...t];case"EMPTY_SET":return Ft(e.args[0]),d(e.args[0]),[E({prim:"set",args:e.args},_({t:1,v:1})),...t];case"EMPTY_MAP":return Ft(e.args[0]),d(e.args[0]),Ft(e.args[1]),[E({prim:"map",args:e.args},_({t:1,v:1})),...t];case"EMPTY_BIG_MAP":return Ft(e.args[0]),d(e.args[0]),Ft(e.args[1]),y(e.args[0]),[E({prim:"big_map",args:e.args},_({t:1,v:1})),...t];case"LAMBDA_REC":case"LAMBDA":{Ft(e.args[0]),Ft(e.args[1]);const n=[e.args[0]];"LAMBDA_REC"===e.prim&&n.push({prim:"lambda",args:[e.args[0],e.args[1]]});const i=Gt(e.args[2],n,Object.assign(Object.assign({},r),{contract:void 0}));if("failed"in i)return{failed:i.failed,level:i.level+1};if(1!==i.length)throw new Nt(e,t,`${e.prim}: function must return a value`);return l(e.args[1],i[0]),[w({prim:"lambda",args:[e.args[0],e.args[1]]}),...t]}case"LEVEL":return[w({prim:"nat"},"@level"),...t];case"TOTAL_VOTING_POWER":case"MIN_BLOCK_TIME":return[w({prim:"nat"}),...t];case"VOTING_POWER":return o(0,["key_hash"]),[w({prim:"nat"}),...t.slice(1)];case"TICKET":{const e=o(0,null,["nat"])[0];return d(e),v(n,p.PtLimaPtL)?[E({prim:"ticket",args:[e]},_({t:1,v:1})),...t.slice(2)]:[w({prim:"option",args:[E({prim:"ticket",args:[e]},_({t:1,v:1}))]}),...t.slice(2)]}case"JOIN_TICKETS":{const r=Ee("pair",o(0,["pair"])[0]);if("ticket"!==jt(r.args[0]))throw new Nt(e,t,`${e.prim}: ticket expected: ${jt(r.args[0])}`);return l(r.args[0],r.args[1]),[w({prim:"option",args:[E(r.args[0],{t:null})]}),...t.slice(1)]}case"SPLIT_TICKET":{const r=o(0,["ticket"],["pair"]),n=Ee("pair",r[1]);if("nat"!==jt(n.args[0]))throw new Nt(e,t,`${e.prim}: nat expected: ${jt(n.args[0])}`);return l(n.args[0],n.args[1]),[w({prim:"option",args:[{prim:"pair",args:[E(r[0],{t:null}),E(r[0],{t:null})]}]}),...t.slice(2)]}case"READ_TICKET":{const e=_({v:2}),r=o(0,["ticket"])[0],n=null===(I=e.v)||void 0===I?void 0:I.map((e=>"@"!==e?[e]:void 0));return[E({prim:"pair",args:[{prim:"address"},E(r.args[0],{t:null}),{prim:"nat"}]},{v:null==n?void 0:n[0]}),E(r,{v:null==n?void 0:n[1],t:null}),...t.slice(1)]}case"PAIRING_CHECK":{const r=o(0,["list"])[0].args[0];if(!we(r))throw new Nt(e,t,`${e.prim}: pair expected: ${jt(r)}`);const n=Ee("pair",r);if("bls12_381_g1"!==jt(n.args[0]))throw new Nt(e,t,`${e.prim}: bls12_381_g1 expected: ${jt(n.args[0])}`);if("bls12_381_g2"!==jt(n.args[1]))throw new Nt(e,t,`${e.prim}: bls12_381_g2 expected: ${jt(n.args[1])}`);return[w({prim:"bool"}),...t.slice(1)]}case"SAPLING_EMPTY_STATE":return[E({prim:"sapling_state",args:[e.args[0]]},_({v:1,t:1})),...t];case"SAPLING_VERIFY_UPDATE":{const r=o(0,["sapling_transaction"],["sapling_state"]);if(parseInt(r[0].args[0].int,10)!==parseInt(r[1].args[0].int,10))throw new Nt(e,t,`${e.prim}: sapling memo size mismatch: ${r[0].args[0].int} != ${r[1].args[0].int}`);return v(n,p.PtJakarta)?[w({prim:"option",args:[{prim:"pair",args:[{prim:"int"},E(r[1],{t:null})]}]}),...t.slice(2)]:[w({prim:"option",args:[{prim:"pair",args:[{prim:"bytes"},{prim:"pair",args:[{prim:"int"},E(r[1],{t:null})]}]}]}),...t.slice(2)]}case"OPEN_CHEST":return o(0,["chest_key"],["chest"],["nat"]),[w({prim:"or",args:[{prim:"bytes"},{prim:"bool"}]}),...t.slice(3)];case"VIEW":{const r=o(0,null,["address"]);return g(r[0]),[w({prim:"option",args:[e.args[1]]}),...t.slice(2)]}case"EMIT":{const r=_({f:1,t:1});if(e.args){const n=o(0,null);return l(n[0],e.args[0]),[E({prim:"operation"},r),...t.slice(1)]}return[E({prim:"operation"},r),...t.slice(1)]}default:throw new ue(e,`unexpected instruction: ${e.prim}`)}})(i);if(void 0!==(null==r?void 0:r.traceCallback)){const e={op:i,in:t,out:I};r.traceCallback(e)}return I}function $t(e,t){for(const r of e)if(r.prim===t)return r;throw new ue(e,`missing contract section: ${t}`)}function Vt(e){const t={};for(const r of e)"view"===r.prim&&(t[r.args[0].string]=r);return t}function zt(e){if(Array.isArray(e))for(const t of e)if("prim"in t&&("parameter"===t.prim||"storage"===t.prim||"code"===t.prim))return!0;return!1}function Wt(e,t){t=t||"%default";const r=qt(e).find((e=>e[0]===t));return void 0!==r?r[1]:"%default"===t?zt(e)?$t(e,"parameter").args[0]:e:null}function qt(e){if(zt(e)){const t=$t(e,"parameter"),r=qt(t.args[0]),n=ge(t);return n.f?[[n.f[0],t.args[0]],...r]:r}if(t=e,Array.isArray(t)||"or"===t.prim){const t=Dt(e),r=e=>{const r=ge(t[e]);if("or"===jt(t[e])){const n=qt(t[e]);return r.f?[[r.f[0],t[e]],...n]:n}return r.f?[[r.f[0],t[e]]]:[]};return[...r(0),...r(1)]}var t;return[]}function Zt(e,t){const r=(r,n,i,o)=>{Ft(r,!0),Ft(n);const s=Gt(o,[{prim:"pair",args:[Object.assign(Object.assign({},r),{annots:["@parameter"]}),Object.assign(Object.assign({},n),{annots:["@storage"]})]}],Object.assign(Object.assign({},t),{contract:e}));if("failed"in s)return s;try{Bt(s,[i])}catch(e){throw e instanceof ue?new Nt(o,s,e.message):e}return s},n=$t(e,"parameter").args[0],i=$t(e,"storage").args[0],o=r(n,i,{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},i]},$t(e,"code").args[0]);for(const t of Object.values(Vt(e)))r(t.args[1],i,t.args[2],t.args[3]);return o}function Yt(e,t,r){Ft(t),Ht(e,t,r||null)}function Jt(e,t,r){for(const e of t)Ft(e);if(void 0!==(null==r?void 0:r.contract))for(const e of["parameter","storage"]){Ft($t(r.contract,e).args[0])}return Gt(e,t,r||null)}function Xt(e,t,r=!1){if(Array.isArray(e)){for(const t of e)Ft(t);for(const e of t)Ft(e)}else Ft(e),Ft(t);Ut(e,t,r)}function Qt(e,t=!1){try{return Ft(e,t),!0}catch(e){return!1}}function er(e,t){try{return Zt(e,t)}catch(e){return null}}function tr(e,t,r){try{return Yt(e,t,r),!0}catch(e){return!1}}function rr(e,t,r=!1){try{return Xt(e,t,r),!0}catch(e){return!1}}class nr{constructor(e,t){this.contract=e,this.ctx=Object.assign({contract:e},t),this.output=Zt(e,this.ctx)}static parse(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new re("empty Michelson");if(Qe(n))return new nr(n,t)}static parseTypeExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ne("empty type expression");if(Ye(n))return Ft(n),n}static parseDataExpression(e,t){const r=new K(t),n="string"==typeof e?r.parseScript(e):r.parseJSON(e);if(null===n)throw new ie("empty data expression");if(Xe(n))return n;throw void 0}section(e){return $t(this.contract,e)}entryPoints(){return qt(this.contract)}entryPoint(e){return Wt(this.contract,e)}assertDataValid(e,t){Yt(e,t,this.ctx)}isDataValid(e,t){return tr(e,t,this.ctx)}assertParameterValid(e,t){const r=this.entryPoint(e||void 0);if(null===r)throw new oe(null==e?void 0:e.toString());this.assertDataValid(t,r)}isParameterValid(e,t){try{return this.assertParameterValid(e,t),!0}catch(e){return!1}}functionType(e,t){return Jt(e,t,this.ctx)}}const ir=new nr([{prim:"parameter",args:[{prim:"unit"}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PAIR"}]]}]);function or(e){return"failed"in e?`[FAILED: ${z(e.failed)}]`:e.map(((e,t)=>{const r=ge(e);return`[${t}${r.v?"/"+r.v[0]:""}]: ${z(e)}`})).join("\n")}function sr(e,t){return r=>{var n;if(Array.isArray(r)&&!e)return;const o=null===(n=r.op[i])||void 0===n?void 0:n.macro,s=`${o?"Macro":"Op"}: ${o?z(o,void 0,!0)+" / ":""}${z(r.op)}\nInput:\n${or(r.in)}\nOutput:\n${or(r.out)}\n`;t(s)}}function ar(e){var t;if(e instanceof Nt){const r=null===(t=e.val[i])||void 0===t?void 0:t.macro;return`${r?"Macro":"Op"}: ${r?z(r,void 0,!0)+" / ":""}${z(e.val)}\nStack:\n${or(e.stackState)}\n`}if(e instanceof de){return`Type: ${Array.isArray(e.val)?"["+e.val.map(((e,t)=>`[${t}]: ${z(e)}`)).join("; ")+"]":z(e.val)}\n${e.data?`Data: ${z(e.data)}\n`:""}\n`}return`Value: ${z(e.val)}`}const cr={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"}},1157:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AddressValidationError:()=>T,BigMapEncodingError:()=>Fe,BigMapValidationError:()=>m,BytesValidationError:()=>U,ChainIDValidationError:()=>te,ContractValidationError:()=>k,EncodeTicketError:()=>ne,EventSchema:()=>Ye,IntValidationError:()=>H,InvalidBigMapDiffError:()=>Be,InvalidBigMapSchemaError:()=>Ue,InvalidMapTypeError:()=>u,InvalidRpcResponseError:()=>De,InvalidScriptError:()=>je,KeyHashValidationError:()=>W,KeyValidationError:()=>V,ListValidationError:()=>C,MapTypecheckError:()=>d,MapValidationError:()=>I,MichelsonMap:()=>f,MissingArgumentError:()=>He,MutezValidationError:()=>j,NatValidationError:()=>A,OrValidationError:()=>v,ParameterEncodingError:()=>Ne,ParameterSchema:()=>qe,SaplingStateValue:()=>Qe,Schema:()=>We,SetValidationError:()=>Q,SignatureValidationError:()=>Z,StorageEncodingError:()=>Ke,Token:()=>p,TokenArgumentValidationError:()=>_,TokenComparisonError:()=>E,UnitValue:()=>Xe,VERSION:()=>Je,ViewSchema:()=>Ze,deepEqual:()=>ze});var n,i=r(6075),o=r.n(i),s=r(6571),a=r(6483),c=r(6209);class u extends s.TaquitoError{constructor(e,t){super(),this.mapType=e,this.reason=t,this.message=`The map type '${JSON.stringify(e)}' is invalid. Reason: ${t}.`,this.name="InvalidMapTypeError"}}const l=Symbol.for("taquito-michelson-map-type-symbol");class d extends s.TaquitoError{constructor(e,t,r,n){super(),this.value=e,this.type=t,this.reason=n,this.name="MapTypecheckError",this.message=`The ${r} provided: ${JSON.stringify(e)} is not compatible with the expected michelson type: ${JSON.stringify(t)}. Reason: ${JSON.stringify(n)}.`,this.name="MapTypecheckError"}}class f{static isMichelsonMap(e){return e&&!0===e[l]}constructor(e){this.valueMap=new Map,this.keyMap=new Map,this[n]=!0,e&&this.setType(e)}setType(e){!function(e){if(!("prim"in e))throw new u(e,"Missing 'prim' field");if(!["map","big_map"].includes(e.prim))throw new u(e,"The prim field should be 'map' or 'big_map'");if(!("args"in e))throw new u(e,"Missing 'args' field");if(!Array.isArray(e.args))throw new u(e,"The 'args' field should be an array");if(2!==e.args.length)throw new u(e,"The 'args' field should have 2 elements")}(e),this.keySchema=new We(e.args[0]),this.valueSchema=new We(e.args[1])}removeType(){this.keySchema=void 0,this.valueSchema=void 0}static fromLiteral(e,t){const r=new f(t);return Object.keys(e).forEach((t=>{r.set(t,e[t])})),r}typecheckKey(e){this.keySchema&&this.keySchema.Typecheck(e)}typecheckValue(e){this.valueSchema&&this.valueSchema.Typecheck(e)}assertTypecheckValue(e){try{this.typecheckValue(e)}catch(t){throw new d(e,this.valueSchema,"value",t)}}assertTypecheckKey(e){try{this.typecheckKey(e)}catch(t){throw new d(e,this.keySchema,"key",t)}}serializeDeterministically(e){return o()(e)}*keys(){for(const[e]of this.entries())yield e}*values(){for(const[,e]of this.entries())yield e}*entries(){for(const e of this.valueMap.keys())yield[this.keyMap.get(e),this.valueMap.get(e)]}get(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.valueMap.get(t)}set(e,t){this.assertTypecheckKey(e),this.assertTypecheckValue(t);const r=this.serializeDeterministically(e);this.keyMap.set(r,e),this.valueMap.set(r,t)}delete(e){this.assertTypecheckKey(e),this.keyMap.delete(this.serializeDeterministically(e)),this.valueMap.delete(this.serializeDeterministically(e))}has(e){this.assertTypecheckKey(e);const t=this.serializeDeterministically(e);return this.keyMap.has(t)&&this.valueMap.has(t)}clear(){this.keyMap.clear(),this.valueMap.clear()}get size(){return this.keyMap.size}forEach(e){for(const[t,r]of this.entries())e(r,t,this)}}n=l;class h extends s.TaquitoError{constructor(e,t,r){super(),this.value=e,this.token=t,this.name="TokenValidationError";const n=this.token.annot(),i=n?`[${n}] `:"";this.message=`${i}${r}`}}class p{static get fieldNumberingStrategy(){return p._fieldNumberingStrategy}static set fieldNumberingStrategy(e){p._fieldNumberingStrategy=e}constructor(e,t,r,n){this.val=e,this.idx=t,this.fac=r,this.parentTokenType=n,this.createToken=this.fac}typeWithoutAnnotations(){const e=t=>{if("object"==typeof t){if(Array.isArray(t)){return t.map((t=>e(t)))}const r=t;return r.args?{prim:r.prim,args:r.args.map((t=>e(t)))}:{prim:r.prim}}return t};return(t=this.val).args?{prim:t.prim,args:t.args.map((t=>e(t)))}:{prim:t.prim};var t}annot(){return(Array.isArray(this.val.annots)&&this.val.annots.length>0?this.val.annots[0]:String(this.idx)).replace(/(%|:)(_Liq_entry_)?/,"")}hasAnnotations(){return Array.isArray(this.val.annots)&&this.val.annots.length}get tokenVal(){return this.val}ExtractSignature(){return[[this.ExtractSchema()]]}}p._fieldNumberingStrategy="Latest";class b extends p{compare(e,t){return e===t?0:e<t?-1:1}}class m extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BigMapValidationError"}}class g extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}ExtractSchema(){return{big_map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:g.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}validate(e){if(!f.isMichelsonMap(e))throw new m(e,this,`Value ${JSON.stringify(e)} is not a MichelsonMap`)}objLitToMichelsonMap(e){return e instanceof f?e:"object"==typeof e?0===Object.keys(e).length?new f:f.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[g.prim]?t[g.prim](r,this.val):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}Execute(e,t){if(t&&t[g.prim])return t[g.prim](e,this.val);if(Array.isArray(e)){const t=new f(this.val);return e.forEach((e=>{t.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1]))})),t}if("int"in e)return e.int;throw new m(e,this,`Big map is expecting either an array (Athens) or an object with an int property (Babylon). Got ${JSON.stringify(e)}`)}findAndReturnTokens(e,t){return g.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}g.prim="big_map";class v extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="OrValidationError"}}class y extends b{constructor(e,t,r,n){super(e,t,r,n),this.val=e,this.idx=t,this.fac=r,this.parentTokenType=n}Encode(e){const t=e[e.length-1],r=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.getIdxForChildren()+n,"Or");if(String(r.annot())!==String(t)||r instanceof y){if(String(i.annot())!==String(t)||i instanceof y){if(r instanceof y){const t=r.Encode(e);if(t)return{prim:"Left",args:[t]}}if(i instanceof y){const t=i.Encode(e);if(t)return{prim:"Right",args:[t]}}return null}return e.pop(),{prim:"Right",args:[i.Encode(e)]}}return e.pop(),{prim:"Left",args:[r.Encode(e)]}}ExtractSignature(){const e=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let t=1;e instanceof y&&(t=Object.keys(e.ExtractSchema()).length);const r=this.createToken(this.val.args[1],this.getIdxForChildren()+t,"Or"),n=[];if(e instanceof y)n.push(...e.ExtractSignature());else for(const t of e.ExtractSignature())n.push([e.annot(),...t]);if(r instanceof y)n.push(...r.ExtractSignature());else for(const e of r.ExtractSignature())n.push([r.annot(),...e]);return n}EncodeObject(e,t){this.validateJavascriptObject(e);const r=Object.keys(e)[0],n=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let i=1;n instanceof y&&(i=Object.keys(n.ExtractSchema()).length);const o=this.createToken(this.val.args[1],this.getIdxForChildren()+i,"Or");if(String(n.annot())!==String(r)||n instanceof y){if(String(o.annot())!==String(r)||o instanceof y){if(n instanceof y){const r=n.EncodeObject(e,t);if(r)return{prim:"Left",args:[r]}}if(o instanceof y){const r=o.EncodeObject(e,t);if(r)return{prim:"Right",args:[r]}}return null}return{prim:"Right",args:[o.EncodeObject(e[r],t)]}}return{prim:"Left",args:[n.EncodeObject(e[r],t)]}}validateJavascriptObject(e){if("object"!=typeof e||Array.isArray(e)||null===e||1!==Object.keys(e).length)throw new v(e,this,`EncodeObject expects an object with a single key but got: ${JSON.stringify(e)}`)}Execute(e,t){const r=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let n=1;r instanceof y&&(n=Object.keys(r.ExtractSchema()).length);const i=this.createToken(this.val.args[1],this.getIdxForChildren()+n,"Or");if("Right"===e.prim)return i instanceof y?i.Execute(e.args[0],t):{[i.annot()]:i.Execute(e.args[0],t)};if("Left"===e.prim)return r instanceof y?r.Execute(e.args[0],t):{[r.annot()]:r.Execute(e.args[0],t)};throw new v(e,this,`Was expecting Left or Right prim but got: ${JSON.stringify(e.prim)}`)}traversal(e,t,r){const n=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let i,o=1;n instanceof y?(i=e(n),o=Object.keys(n.ExtractSchema()).length):i={[n.annot()]:e(n)};const s=this.createToken(this.val.args[1],this.getIdxForChildren()+o,"Or");let a;a=s instanceof y?t(s):{[s.annot()]:t(s)};return r(i,a)}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}generateSchema(){return{__michelsonType:y.prim,schema:this.traversal((e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof y?e.generateSchema().schema:e.generateSchema()),((e,t)=>Object.assign(Object.assign({},e),t)))}}findToken(e){const t=this.createToken(this.val.args[0],this.getIdxForChildren(),"Or");let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(this.val.args[1],this.getIdxForChildren()+r,"Or");if(String(t.annot())===String(e)&&!(t instanceof y)&&t instanceof b)return t;if(String(n.annot())===String(e)&&!(n instanceof y)&&n instanceof b)return n;if(t instanceof y){const r=t.findToken(e);if(r)return r}if(n instanceof y){const t=n.findToken(e);if(t)return t}return null}compare(e,t){const r=Object.keys(e)[0];if(r!==Object.keys(t)[0]){return JSON.stringify(this.EncodeObject(e))<JSON.stringify(this.EncodeObject(t))?-1:1}{const n=this.findToken(r);if(n instanceof b)return n.compare(e[r],t[r])}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return y.prim===e&&t.push(this),this.traversal((r=>r.findAndReturnTokens(e,t)),(r=>r.findAndReturnTokens(e,t)),((e,t)=>Object.assign(Object.assign({},e),t))),t}getIdxForChildren(){return"Legacy"===p.fieldNumberingStrategy||"Or"===this.parentTokenType?this.idx:0}}y.prim="or";class _ extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="TokenArgumentValidationError"}}class E extends s.TaquitoError{constructor(e,t){super(),this.val1=e,this.val2=t,this.name="TokenComparisonError",this.message=`Tokens ${JSON.stringify(e)} and ${JSON.stringify(t)} are not comparable`}}function w(e,t=O.prim){if(Array.isArray(e))return w({prim:t,args:e},t);if(void 0===e.args)throw new _(`The value ${JSON.stringify(e)} is an invalid PairToken with no arguments, a pair must have two or more arguments.`);return e.args.length>2?[e.args[0],{prim:t,args:e.args.slice(1)}]:[e.args[0],e.args[1]]}class O extends b{constructor(e,t,r,n){super(Array.isArray(e)?{prim:O.prim,args:e}:e.prim?e:{prim:O.prim,args:e},t,r,n)}args(){return w(this.val)}tokens(){let e=0;return this.args().map((t=>{const r=this.createToken(t,this.getIdxForChildren()+e,"Pair");return r instanceof O?e+=Object.keys(r.ExtractSchema()).length:e++,r}))}Encode(e){return{prim:"Pair",args:this.tokens().map((t=>t.Encode(e)))}}ExtractSignature(){const e=this.args(),t=this.createToken(e[0],this.getIdxForChildren(),"Pair");let r=1;t instanceof y&&(r=Object.keys(t.ExtractSchema()).length);const n=this.createToken(e[1],this.getIdxForChildren()+r,"Pair"),i=[];for(const e of t.ExtractSignature())for(const t of n.ExtractSignature())i.push([...e,...t]);return i}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}ToKey(e){return this.Execute(e)}EncodeObject(e,t){const[r,n]=this.tokens();let i,o;return i=r instanceof O&&!r.hasAnnotations()?e:e[r.annot()],o=n instanceof O&&!n.hasAnnotations()?e:e[n.annot()],{prim:"Pair",args:[r.EncodeObject(i,t),n.EncodeObject(o,t)]}}traversal(e,t){const r=this.args(),n=this.createToken(r[0],this.getIdxForChildren(),"Pair");let i,o=1;n instanceof O&&!n.hasAnnotations()?(i=e(n),n instanceof O&&(o=Object.keys(n.ExtractSchema()).length)):i={[n.annot()]:e(n)};const s=this.createToken(r[1],this.getIdxForChildren()+o,"Pair");let a;a=s instanceof O&&!s.hasAnnotations()?t(s):{[s.annot()]:t(s)};return Object.assign(Object.assign({},i),a)}Execute(e,t){const r=w(e,"Pair");return this.traversal((e=>e.Execute(r[0],t)),(e=>e.Execute(r[1],t)))}ExtractSchema(){return this.traversal((e=>e.ExtractSchema()),(e=>e.ExtractSchema()))}generateSchema(){return{__michelsonType:O.prim,schema:this.traversal((e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()),(e=>e instanceof O&&!e.hasAnnotations()?e.generateSchema().schema:e.generateSchema()))}}compare(e,t){const[r,n]=this.tokens(),i=(e,t)=>e instanceof O&&!e.hasAnnotations()?t:t[e.annot()];if(r instanceof b&&n instanceof b){const o=r.compare(i(r,e),i(r,t));return 0===o?n.compare(i(n,e),i(n,t)):o}throw new E(e,t)}findAndReturnTokens(e,t){return O.prim===e&&t.push(this),this.tokens().map((r=>r.findAndReturnTokens(e,t))),t}getIdxForChildren(){return"Legacy"===p.fieldNumberingStrategy||"Pair"===this.parentTokenType?this.idx:0}}O.prim="pair";class A extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NatValidationError"}}class S extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.A(e[Object.keys(e)[0]])}Encode(e){const t=e.pop();return this.validate(t),{int:new a.A(t).toFixed()}}validate(e){const t=new a.A(e);if(t.isNaN())throw new A(e,this,`Value is not a number: ${JSON.stringify(e)}`);if(t.isNegative())throw new A(e,this,`Value cannot be negative: ${JSON.stringify(e)}`)}EncodeObject(e,t){return this.validate(e),t&&t[S.prim]?t[S.prim](e):{int:new a.A(e).toFixed()}}ExtractSchema(){return S.prim}generateSchema(){return{__michelsonType:S.prim,schema:S.prim}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:S.prim}}}ToKey({int:e}){return new a.A(e)}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return S.prim===e&&t.push(this),t}}S.prim="nat";class P extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return P.prim}generateSchema(){return{__michelsonType:P.prim,schema:P.prim}}Encode(e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[P.prim]?t[P.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:P.prim}}}findAndReturnTokens(e,t){return P.prim===e&&t.push(this),t}}P.prim="string";class T extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="AddressValidationError"}}class R extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:(0,c.b58decode)(e)},type:{prim:"bytes"}}}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new T(e,this,`Address is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[R.prim]?t[R.prim](e):{string:e}}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new T(e,this,`cannot be missing both string and bytes: ${JSON.stringify(e)}`);return(0,c.encodeAddress)(e.bytes)}ExtractSchema(){return R.prim}generateSchema(){return{__michelsonType:R.prim,schema:R.prim}}ToKey({bytes:e,string:t}){if(t)return t;if(!e)throw new T({bytes:e,string:t},this,`cannot be missing both string and bytes ${JSON.stringify({string:t,bytes:e})}`);return(0,c.encodeAddress)(e)}compare(e,t){const r=e=>e.startsWith("tz"),n=r(e),i=r(t);return n&&!i?-1:i&&!n?1:super.compare(e,t)}findAndReturnTokens(e,t){return R.prim===e&&t.push(this),t}}R.prim="address";class I extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MapValidationError"}}class x extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get ValueSchema(){return this.createToken(this.val.args[1],0)}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!f.isMichelsonMap(e))throw new I(e,this,`Value ${JSON.stringify(e)} is not a valid MichelsonMap`)}Execute(e,t){const r=new f(this.val);return e.forEach((e=>{r.set(this.KeySchema.ToKey(e.args[0]),this.ValueSchema.Execute(e.args[1],t))})),r}objLitToMichelsonMap(e){return e instanceof f?e:"object"==typeof e?0===Object.keys(e).length?new f:f.fromLiteral(e):e}Encode(e){const t=this.objLitToMichelsonMap(e.pop());return this.validate(t),Array.from(t.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(t.get(e))]})))}EncodeObject(e,t){const r=this.objLitToMichelsonMap(e);return this.validate(r),t&&t[x.prim]?t[x.prim](r):Array.from(r.keys()).sort(((e,t)=>this.KeySchema.compare(e,t))).map((e=>({prim:"Elt",args:[this.KeySchema.EncodeObject(e),this.ValueSchema.EncodeObject(r.get(e))]})))}ExtractSchema(){return{map:{key:this.KeySchema.ExtractSchema(),value:this.ValueSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:x.prim,schema:{key:this.KeySchema.generateSchema(),value:this.ValueSchema.generateSchema()}}}findAndReturnTokens(e,t){return x.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),this.ValueSchema.findAndReturnTokens(e,t),t}}x.prim="map";class M extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return"true"===String(e.prim).toLowerCase()}Encode(e){return{prim:e.pop()?"True":"False"}}EncodeObject(e,t){return t&&t[M.prim]?t[M.prim](e):{prim:e?"True":"False"}}ExtractSchema(){return M.prim}generateSchema(){return{__michelsonType:M.prim,schema:M.prim}}ToBigMapKey(e){return{key:this.EncodeObject(e),type:{prim:M.prim}}}ToKey(e){return this.EncodeObject(e)}compare(e,t){return e&&t||!e&&!t?0:e?1:-1}findAndReturnTokens(e,t){return M.prim===e&&t.push(this),t}}M.prim="bool";class k extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ContractValidationError"}}class L extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateAddress)(e)!==c.ValidationResult.VALID)throw new k(e,this,`Value ${JSON.stringify(e)} is not a valid contract address.`);return null}Execute(e){if(e.string)return e.string;if(!e.bytes)throw new k(e,this,`Value ${JSON.stringify(e)} is not a valid contract address. must contain bytes or string.`);return(0,c.encodeAddress)(e.bytes)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[L.prim]?t[L.prim](e):{string:e}}ExtractSchema(){return L.prim}generateSchema(){const e=this.createToken(this.val.args[0],0);return{__michelsonType:L.prim,schema:{parameter:this.val.args[0]?e.generateSchema():{}}}}findAndReturnTokens(e,t){return L.prim===e&&t.push(this),t}}L.prim="contract";class C extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ListValidationError"}}class N extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueSchema(){return this.createToken(this.val.args[0],this.idx)}validate(e){if(!Array.isArray(e))throw new C(e,this,`Value ${JSON.stringify(e)} is not a valid array`)}Encode(e){const t=e.pop();this.validate(t);const r=this.createToken(this.val.args[0],0);return t.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}Execute(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),e.reduce(((e,n)=>[...e,r.Execute(n,t)]),[])}EncodeObject(e,t){const r=this.createToken(this.val.args[0],0);return this.validate(e),t&&t[N.prim]?t[N.prim](e):e.reduce(((e,t)=>[...e,r.EncodeObject(t)]),[])}ExtractSchema(){return{[N.prim]:this.valueSchema.ExtractSchema()}}generateSchema(){return{__michelsonType:N.prim,schema:this.valueSchema.generateSchema()}}findAndReturnTokens(e,t){return N.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),t}}N.prim="list";class j extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="MutezValidationError"}}class D extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.A(e[Object.keys(e)[0]])}ExtractSchema(){return D.prim}generateSchema(){return{__michelsonType:D.prim,schema:D.prim}}validate(e){if(new a.A(e).isNaN())throw new j(e,this,`Value is not a number: ${e}`)}Encode(e){const t=e.pop();return this.validate(t),{int:String(t).toString()}}EncodeObject(e,t){return this.validate(e),t&&t[D.prim]?t[D.prim](e):{int:String(e).toString()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:D.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return D.prim===e&&t.push(this),t}}D.prim="mutez";class U extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="BytesValidationError"}}class B extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}ToBigMapKey(e){return{key:{bytes:e},type:{prim:B.prim}}}validate(e){if("string"!=typeof e||!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new U(e,this,`Invalid bytes: ${e}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=(0,c.stripHexPrefix)(this.convertUint8ArrayToHexString(t)),this.validate(t),{bytes:String(t).toString()}}EncodeObject(e,t){return"string"==typeof(e=this.convertUint8ArrayToHexString(e))&&(e=(0,c.stripHexPrefix)(e)),this.validate(e),t&&t[B.prim]?t[B.prim](e):{bytes:String(e).toString()}}Execute(e){return e.bytes}ExtractSchema(){return B.prim}generateSchema(){return{__michelsonType:B.prim,schema:B.prim}}ToKey({bytes:e,string:t}){return t||e}findAndReturnTokens(e,t){return B.prim===e&&t.push(this),t}}B.prim="bytes";class F extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}subToken(){return this.createToken(this.val.args[0],this.idx)}schema(){return this.createToken(this.val.args[0],0)}annot(){return Array.isArray(this.val.annots)?super.annot():this.createToken(this.val.args[0],this.idx).annot()}Encode(e){const t=e;return null==t?{prim:"None"}:!Array.isArray(t)||void 0!==t[t.length-1]&&null!==t[t.length-1]?{prim:"Some",args:[this.schema().Encode(e)]}:(t.pop(),{prim:"None"})}EncodeObject(e,t){let r=e;return null==r?{prim:"None"}:(r="object"==typeof r&&"Some"in r?r.Some:r,{prim:"Some",args:[this.schema().EncodeObject(r,t)]})}Execute(e,t){return"None"===e.prim?null:{Some:this.schema().Execute(e.args[0],t)}}ExtractSchema(){return{Some:this.schema().ExtractSchema()}}generateSchema(){return{__michelsonType:F.prim,schema:this.schema().generateSchema()}}ExtractSignature(){return[...this.schema().ExtractSignature()]}get KeySchema(){return this.schema()}compare(e,t){return e?t?this.KeySchema.compare(e,t):1:-1}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:this.EncodeObject(e),type:this.typeWithoutAnnotations()}}findAndReturnTokens(e,t){return F.prim===e&&t.push(this),this.subToken().findAndReturnTokens(e,t),t}}F.prim="option";class K extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string&&/^\d+$/.test(e.string)?new Date(1e3*Number(e.string)).toISOString():e.string?new Date(e.string).toISOString():e.int?new Date(1e3*Number(e.int)).toISOString():void 0}Encode(e){const t=e.pop();return"number"==typeof t?{int:String(t)}:{string:t}}EncodeObject(e,t){return t&&t[K.prim]?t[K.prim](e):"number"==typeof e?{int:String(e)}:{string:e}}ExtractSchema(){return K.prim}generateSchema(){return{__michelsonType:K.prim,schema:K.prim}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:K.prim}}}findAndReturnTokens(e,t){return K.prim===e&&t.push(this),t}}K.prim="timestamp";class H extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="IntValidationError"}}class G extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return new a.A(e[Object.keys(e)[0]])}ExtractSchema(){return G.prim}generateSchema(){return{__michelsonType:G.prim,schema:G.prim}}validate(e){if(new a.A(e).isNaN())throw new H(e,this,`Value is not a number: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{int:new a.A(t).toFixed()}}EncodeObject(e,t){return this.validate(e),t&&t[G.prim]?t[G.prim](e):{int:new a.A(e).toFixed()}}ToBigMapKey(e){return{key:{int:String(e)},type:{prim:G.prim}}}ToKey({int:e}){return e}compare(e,t){const r=Number(e),n=Number(t);return r===n?0:r<n?-1:1}findAndReturnTokens(e,t){return G.prim===e&&t.push(this),t}}G.prim="int";class $ extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){return e.pop(),{prim:"Unit"}}EncodeObject(e,t){return t&&t[$.prim]?t[$.prim](e):{prim:"Unit"}}Execute(e){return Xe}ExtractSchema(){return $.prim}generateSchema(){return{__michelsonType:$.prim,schema:$.prim}}compare(e,t){return 0}ToKey(e){return Xe}ToBigMapKey(e){return{key:{prim:"Unit"},type:{prim:$.prim}}}findAndReturnTokens(e,t){return $.prim===e&&t.push(this),t}}$.prim="unit";class V extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyValidationError"}}class z extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKey)(e.bytes)}validate(e){if((0,c.validatePublicKey)(e)!==c.ValidationResult.VALID)throw new V(e,this,"Key is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[z.prim]?t[z.prim](e):{string:e}}ExtractSchema(){return z.prim}generateSchema(){return{__michelsonType:z.prim,schema:z.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:z.prim}}}compare(e,t){const r=this.getPrefix(e),n=this.getPrefix(t);if(r===c.Prefix.EDPK&&n!==c.Prefix.EDPK)return-1;if(r===c.Prefix.SPPK&&n!==c.Prefix.SPPK)return n===c.Prefix.EDPK?1:-1;if(r===c.Prefix.P2PK){if(n!==c.Prefix.P2PK)return 1;const r=this.getP256PublicKeyComparableBytes(e),i=this.getP256PublicKeyComparableBytes(t);return Buffer.compare(r,i)}return super.compare(e,t)}getPrefix(e){return e.substring(0,4)}getP256PublicKeyComparableBytes(e){return(0,c.b58cdecode)(e,c.prefix[c.Prefix.P2PK]).slice(1)}findAndReturnTokens(e,t){return z.prim===e&&t.push(this),t}}z.prim="key";class W extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="KeyHashValidationError"}}class q extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:(0,c.encodeKeyHash)(e.bytes)}validate(e){if((0,c.validateKeyHash)(e)!==c.ValidationResult.VALID)throw new W(e,this,`KeyHash is not valid: ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[q.prim]?t[q.prim](e):{string:e}}ExtractSchema(){return q.prim}generateSchema(){return{__michelsonType:q.prim,schema:q.prim}}ToKey({string:e,bytes:t}){return e||(0,c.encodeKeyHash)(t)}ToBigMapKey(e){return{key:{string:e},type:{prim:q.prim}}}findAndReturnTokens(e,t){return q.prim===e&&t.push(this),t}}q.prim="key_hash";class Z extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SignatureValidationError"}}class Y extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string?e.string:e.bytes}validate(e){if((0,c.validateSignature)(e)!==c.ValidationResult.VALID)throw new Z(e,this,"Signature is not valid")}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[Y.prim]?t[Y.prim](e):{string:e}}ExtractSchema(){return Y.prim}generateSchema(){return{__michelsonType:Y.prim,schema:Y.prim}}ToKey(e){return this.Execute(e)}ToBigMapKey(e){return{key:{string:e},type:{prim:Y.prim}}}findAndReturnTokens(e,t){return Y.prim===e&&t.push(this),t}}Y.prim="signature";class J extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get paramSchema(){return this.createToken(this.val.args[0],this.idx)}get returnSchema(){return this.createToken(this.val.args[1],this.idx+1)}Execute(e){return e.string?e.string:e}Encode(e){return e.pop()}EncodeObject(e,t){return t&&t[J.prim]?t[J.prim](e):e}ExtractSchema(){return{[J.prim]:{parameters:this.paramSchema.ExtractSchema(),returns:this.returnSchema.ExtractSchema()}}}generateSchema(){return{__michelsonType:J.prim,schema:{parameters:this.paramSchema.generateSchema(),returns:this.returnSchema.generateSchema()}}}findAndReturnTokens(e,t){return J.prim===e&&t.push(this),this.createToken(this.val.args[0],this.idx).findAndReturnTokens(e,t),this.createToken(this.val.args[1],this.idx).findAndReturnTokens(e,t),t}}J.prim="lambda";class X extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){return e.string}Encode(...e){return{string:e.pop()}}EncodeObject(e,t){return t&&t[X.prim]?t[X.prim](e):{string:e}}ExtractSchema(){return X.prim}generateSchema(){return{__michelsonType:X.prim,schema:X.prim}}findAndReturnTokens(e,t){return X.prim===e&&t.push(this),t}}X.prim="operation";class Q extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SetValidationError"}}class ee extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get KeySchema(){return this.createToken(this.val.args[0],0)}validate(e){if(!Array.isArray(e))throw new Q(e,this,`Value ${JSON.stringify(e)} is not an array`)}Encode(e){const t=e.pop();return this.validate(t),t.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}Execute(e,t){return e.reduce(((e,r)=>[...e,this.KeySchema.Execute(r,t)]),[])}EncodeObject(e,t){return this.validate(e),t&&t[ee.prim]?t[ee.prim](e):e.sort(((e,t)=>this.KeySchema.compare(e,t))).reduce(((e,t)=>[...e,this.KeySchema.EncodeObject(t)]),[])}ExtractSchema(){return ee.prim}generateSchema(){return{__michelsonType:ee.prim,schema:this.KeySchema.generateSchema()}}findAndReturnTokens(e,t){return ee.prim===e&&t.push(this),this.KeySchema.findAndReturnTokens(e,t),t}}ee.prim="set";class te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChainIDValidationError"}}class re extends b{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if((0,c.validateChain)(e)!==c.ValidationResult.VALID)throw new te(e,this,`Value ${JSON.stringify(e)} is not a valid ChainID`)}Execute(e){return e[Object.keys(e)[0]]}ExtractSchema(){return re.prim}generateSchema(){return{__michelsonType:re.prim,schema:re.prim}}Encode(e){const t=e.pop();return this.validate(t),{string:t}}EncodeObject(e,t){return this.validate(e),t&&t[re.prim]?t[re.prim](e):{string:e}}ToKey({string:e}){return e}ToBigMapKey(e){return{key:{string:e},type:{prim:re.prim}}}findAndReturnTokens(e,t){return re.prim===e&&t.push(this),t}}re.prim="chain_id";class ne extends s.TaquitoError{constructor(){super(),this.name="TicketEncodeError",this.message="Tickets cannot be sent to the blockchain; they are created on-chain"}}const ie={prim:"contract"},oe={prim:"int"};class se extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new ne}EncodeObject(e,t){if(t&&t[se.prim])return t[se.prim](e,this.val);throw new ne}Execute(e,t){if(t&&t[se.prim])return t[se.prim](e,this.val);const r=this.createToken(ie,this.idx),n=this.valueToken,i=this.createToken(oe,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:L.prim,value:this.valueToken.ExtractSchema(),amount:G.prim}}generateSchema(){return{__michelsonType:se.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:L.prim,schema:L.prim},amount:{__michelsonType:G.prim,schema:G.prim}}}}findAndReturnTokens(e,t){return se.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}se.prim="ticket";class ae extends s.TaquitoError{constructor(){super(),this.name="TicketDeprecatedEncodeError",this.message="Ticket_deprecated cannot be sent to the blockchain; they are created on-chain"}}const ce={prim:"contract"},ue={prim:"int"};class le extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}get valueToken(){return this.createToken(this.val.args[0],this.idx)}Encode(e){throw new ae}EncodeObject(e,t){if(t&&t[le.prim])return t[le.prim](e,this.val);throw new ae}Execute(e,t){if(t&&t[le.prim])return t[le.prim](e,this.val);const r=this.createToken(ce,this.idx),n=this.valueToken,i=this.createToken(ue,this.idx);return void 0===e.args[2]&&void 0!==e.args[1].args?{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1].args[0],t),amount:i.Execute(e.args[1].args[1],t)}:{ticketer:r.Execute(e.args[0],t),value:n.Execute(e.args[1],t),amount:i.Execute(e.args[2],t)}}ExtractSchema(){return{ticketer:L.prim,value:this.valueToken.ExtractSchema(),amount:G.prim}}generateSchema(){return{__michelsonType:le.prim,schema:{value:this.valueToken.generateSchema(),ticketer:{__michelsonType:L.prim,schema:L.prim},amount:{__michelsonType:G.prim,schema:G.prim}}}}findAndReturnTokens(e,t){return le.prim===e&&t.push(this),this.valueToken.findAndReturnTokens(e,t),t}}le.prim="ticket_deprecated";class de extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="NeverTokenError"}}class fe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Encode(e){const t=e.pop();throw new de(t,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(t)}.`)}EncodeObject(e,t){if(t&&t[fe.prim])return t[fe.prim](e);throw new de(e,this,`Assigning a value to the type never is forbidden. Trying to assign ${JSON.stringify(e)}.`)}Execute(e){throw new de(e,this,`There is no literal value for the type never. Trying to execute ${JSON.stringify(e)}.`)}ExtractSchema(){return fe.prim}generateSchema(){return{__michelsonType:fe.prim,schema:fe.prim}}findAndReturnTokens(e,t){return fe.prim===e&&t.push(this),t}}fe.prim="never";class he extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingStateValidationError"}}class pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}isValid(e){return"object"==typeof e&&0===Object.keys(e).length}Execute(e,t){if(t&&t[pe.prim])return t[pe.prim](e,this.val);if("int"in e)return e.int;throw new he(e,this,`Sapling state is expecting an object with an int property. Got ${JSON.stringify(e)}`)}Encode(e){const t=e.pop();if(this.isValid(t))return[];throw new he(t,this,`Invalid sapling_state. Received: ${JSON.stringify(t)} while expecting: {}`)}EncodeObject(e,t){if(t&&t[pe.prim])return t[pe.prim](e);if(this.isValid(e))return[];throw new he(e,this,`Invalid sapling_state. Received: ${JSON.stringify(e)} while expecting: {}`)}ExtractSchema(){return{[pe.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:pe.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return pe.prim===e&&t.push(this),t}}pe.prim="sapling_state";class be extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionValidationError"}}class me extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new be(e,this,`There is no literal value for the sapling_transaction type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new be(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[me.prim]?t[me.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[me.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:me.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return me.prim===e&&t.push(this),t}}me.prim="sapling_transaction";class ge extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="SaplingTransactionDeprecatedValidationError"}}class ve extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e){throw new ge(e,this,`There is no literal value for the sapling_transaction_deprecated type. Got: ${JSON.stringify(e)}.`)}validateBytes(e){const t=/^(0x|0X)?([0-9a-fA-F]*$)/.exec(e);if(t&&t[2].length%2==0)return t[2];throw new ge(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.validateBytes(this.convertUint8ArrayToHexString(t)),{bytes:String(t).toString()}}EncodeObject(e,t){return e=this.validateBytes(this.convertUint8ArrayToHexString(e)),t&&t[ve.prim]?t[ve.prim](e):{bytes:String(e).toString()}}ExtractSchema(){return{[ve.prim]:{"memo-size":Number(this.val.args[0].int)}}}generateSchema(){return{__michelsonType:ve.prim,schema:{memoSize:this.val.args[0].int}}}findAndReturnTokens(e,t){return ve.prim===e&&t.push(this),t}}ve.prim="sapling_transaction_deprecated";class ye extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381frValidationError"}}class _e extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new ye(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return"number"==typeof t?{int:t.toString()}:(t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t})}EncodeObject(e,t){return t&&t[_e.prim]?t[_e.prim](e):"number"==typeof e?{int:e.toString()}:(e=this.convertUint8ArrayToHexString(e),this.validate(e),{bytes:e})}Execute(e){return e.bytes}ExtractSchema(){return _e.prim}generateSchema(){return{__michelsonType:_e.prim,schema:_e.prim}}findAndReturnTokens(e,t){return _e.prim===e&&t.push(this),t}}_e.prim="bls12_381_fr";class Ee extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g1ValidationError"}}class we extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Ee(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[we.prim]?t[we.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return we.prim}generateSchema(){return{__michelsonType:we.prim,schema:we.prim}}findAndReturnTokens(e,t){return we.prim===e&&t.push(this),t}}we.prim="bls12_381_g1";class Oe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="Bls12381g2ValidationError"}}class Ae extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Oe(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Ae.prim]?t[Ae.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Ae.prim}generateSchema(){return{__michelsonType:Ae.prim,schema:Ae.prim}}findAndReturnTokens(e,t){return Ae.prim===e&&t.push(this),t}}Ae.prim="bls12_381_g2";class Se extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestValidationError"}}class Pe extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Se(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Pe.prim]?t[Pe.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Pe.prim}generateSchema(){return{__michelsonType:Pe.prim,schema:Pe.prim}}findAndReturnTokens(e,t){return Pe.prim===e&&t.push(this),t}}Pe.prim="chest";class Te extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="ChestKeyValidationError"}}class Re extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}validate(e){if(!/^[0-9a-fA-F]*$/.test(e)||e.length%2!=0)throw new Te(e,this,`Invalid bytes: ${JSON.stringify(e)}`)}convertUint8ArrayToHexString(e){return e.constructor===Uint8Array?Buffer.from(e).toString("hex"):e}Encode(e){let t=e.pop();return t=this.convertUint8ArrayToHexString(t),this.validate(t),{bytes:t}}EncodeObject(e,t){return e=this.convertUint8ArrayToHexString(e),this.validate(e),t&&t[Re.prim]?t[Re.prim](e):{bytes:e}}Execute(e){return e.bytes}ExtractSchema(){return Re.prim}generateSchema(){return{__michelsonType:Re.prim,schema:Re.prim}}findAndReturnTokens(e,t){return Re.prim===e&&t.push(this),t}}Re.prim="chest_key";class Ie extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantEncodingError"}}class xe extends h{constructor(e,t,r){super(e,t,r),this.value=e,this.token=t,this.name="GlobalConstantDecodingError"}}class Me extends p{constructor(e,t,r){super(e,t,r),this.val=e,this.idx=t,this.fac=r}Execute(e,t){if(t&&t[Me.prim])return t[Me.prim](e,this.val);throw new xe(e,this,`Unable to decode a value represented by a global constants. Please provide an expanded script to the Michelson-Encoder or semantics for the decoding. The following global constant hash was encountered: ${this.val.args[0].string}.`)}Encode(e){throw new Ie(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}EncodeObject(e,t){if(t&&t[Me.prim])return t[Me.prim](e);throw new Ie(e,this,`Unable to encode a script containing global constants. Please provide an expanded script to the Michelson-Encoder. The following global constant hash was encountered: ${this.val.args[0].string}.`)}ExtractSchema(){return Me.prim}generateSchema(){return{__michelsonType:Me.prim,schema:{hash:this.val.args[0].string}}}findAndReturnTokens(e,t){return Me.prim===e&&t.push(this),t}}Me.prim="constant";const ke=[O,S,P,g,R,x,M,y,L,N,D,B,F,K,G,$,z,q,Y,J,X,ee,re,se,le,fe,pe,me,ve,_e,we,Ae,Pe,Re,Me];class Le extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.data=t,this.name="Invalid token error"}}function Ce(e,t,r){if(Array.isArray(e))return new O(e,t,Ce,r);const n=ke.find((t=>t.prim===e.prim));if(!n)throw new Le(`Malformed data: ${JSON.stringify(e)}. Expected a value with a valid prim property`,e);return new n(e,t,Ce,r)}class Ne extends s.InvalidViewParameterError{constructor(e,t,r,n){super(e,t,r,n),this.viewName=e,this.sigs=t,this.args=r,this.cause=n,this.name="ParameterEncodingError",this.message=`Could not encode parameter ${JSON.stringify(r)} received for name "${e}" expecting one of the following signatures ${JSON.stringify(t)}`}}class je extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidScriptError";let r="Invalid on-chain view found in the following script.";t&&(r+=` Reason: ${t}.`),r+=`Script: ${JSON.stringify(e)}`,this.message=r}}class De extends s.TaquitoError{constructor(e,t){super(),this.script=e,this.reason=t,this.name="InvalidRpcResponseError";let r="Invalid RPC response passed as argument(s).";t&&(r+=` Reason: ${t}.`),r+=` Received: ${JSON.stringify(e)}`,this.message=r}}class Ue extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="InvalidBigMapSchemaError"}}class Be extends s.TaquitoError{constructor(e,t){super(e),this.message=e,this.value=t,this.name="InvalidBigMapDiffError"}}class Fe extends s.TaquitoError{constructor(e,t,r,n){super(),this.details=t,this.schema=r,this.value=n,this.name="BigMapEncodingError",this.message=`Unable to encode the big map ${e}. Schema is: ${JSON.stringify(r)}. The ${e} is: ${JSON.stringify(n)}. Error details: ${t}`}}class Ke extends s.TaquitoError{constructor(e,t,r,n,i){super(),this.details=t,this.schema=r,this.value=n,this.semantics=i,this.name="StorageEncodingError",this.message=`Unable to encode ${e}. The schema is: ${JSON.stringify(r)}, the value is: ${JSON.stringify(n)}.${i?`And the semantic is: ${JSON.stringify(i)}`:""}. Error details: ${t}`}}class He extends s.TaquitoError{constructor(e){super(e),this.message=e,this.name="MissingArgumentError"}}var Ge;const $e=Symbol.for("taquito-schema-type-symbol");function Ve(e,t=O.prim){var r,n;if(Array.isArray(e))return Ve({prim:t,args:e},t);const i=e;return i.prim===t&&i.args&&i.args.length>2?Object.assign(Object.assign({},i),{args:[null===(r=i.args)||void 0===r?void 0:r[0],{prim:t,args:null===(n=i.args)||void 0===n?void 0:n.slice(1)}]}):i}function ze(e,t){if(void 0===e||void 0===t)return e===t;const r=Ve(e),n=Ve(t);return r.prim===n.prim&&(void 0===r.args&&void 0===n.args||void 0!==r.args&&void 0!==n.args&&r.args.length===n.args.length&&r.args.every(((e,t)=>{var r,i;return ze(e,null!==(i=null===(r=n.args)||void 0===r?void 0:r[t])&&void 0!==i?i:{})})))&&(void 0===r.annots&&void 0===n.annots||void 0!==r.annots&&void 0!==n.annots&&r.annots.length===n.annots.length&&r.annots.every(((e,t)=>{var r;return e===(null===(r=n.annots)||void 0===r?void 0:r[t])})))}class We{static isSchema(e){return e&&!0===e[$e]}static fromRPCResponse(e){if(!e)throw new De(e,"the RPC response is empty");if(!e.script)throw new De(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new De(e,"The response.script.code should be an array");let t=e.script.code;for(;1===t.length&&Array.isArray(t[0]);)t=t[0];const r=t.find((e=>"prim"in e&&"storage"===e.prim));if(!r||!Array.isArray(r.args))throw new De(e,'The response.script.code has an element of type {prim: "storage"}, but its args is not an array');return new We(r.args[0])}isExpressionExtended(e){return"prim"in e&&Array.isArray(e.args)}constructor(e){if(this.val=e,this[Ge]=!0,this.root=Ce(e,0),this.root instanceof g)this.bigMap=this.root;else if(this.isExpressionExtended(e)&&"pair"===e.prim){const t=e.args[0];this.isExpressionExtended(t)&&"big_map"===t.prim&&(this.bigMap=new g(t,0,Ce))}}removeTopLevelAnnotation(e){return(this.root instanceof O||this.root instanceof y)&&this.root.hasAnnotations()&&"object"==typeof e&&1===Object.keys(e).length?e[Object.keys(e)[0]]:e}Execute(e,t){const r=this.root.Execute(e,t);return this.removeTopLevelAnnotation(r)}Typecheck(e){this.root instanceof g&&Number.isInteger(Number(e))||this.root instanceof se&&e.ticketer&&e.value&&e.amount||this.root instanceof le&&e.ticketer&&e.value&&e.amount||this.root instanceof x&&this.root.ValueSchema instanceof g||this.root.EncodeObject(e)}ExecuteOnBigMapDiff(e,t){if(!this.bigMap)throw new Ue("Big map schema is undefined");if(!Array.isArray(e))throw new Be(`Big map diff must be an array, got: ${JSON.stringify(e)}`,e);const r=e.map((({key:e,value:t})=>({args:[e,t]})));return this.bigMap.Execute(r,t)}ExecuteOnBigMapValue(e,t){if(!this.bigMap)throw new Ue("Big map schema is undefined");return this.bigMap.ValueSchema.Execute(e,t)}EncodeBigMapKey(e){if(!this.bigMap)throw new Ue("Big map schema is undefined");try{return this.bigMap.KeySchema.ToBigMapKey(e)}catch(t){throw new Fe("key",t,this.bigMap.KeySchema,e)}}Encode(e,t){try{return this.root.EncodeObject(e,t)}catch(r){if(r instanceof h)throw r;throw new Ke("storage object",r,this.root,e,t)}}ExtractSchema(){return this.removeTopLevelAnnotation(this.root.ExtractSchema())}generateSchema(){return this.removeTopLevelAnnotation(this.root.generateSchema())}ComputeState(e,t){if(!this.bigMap)throw new Ue("Big map schema is undefined");const r=e.reduce(((e,t)=>Object.assign(Object.assign({},e),this.ExecuteOnBigMapDiff(t.contents[0].metadata.operation_result.big_map_diff))),{});return Object.assign(Object.assign({},this.Execute(t)),{[this.bigMap.annot()]:r})}FindFirstInTopLevelPair(e,t){return this.findValue(this.root.val,e,t)}findValue(e,t,r){if(ze(r,e))return t;if(Array.isArray(e)||"pair"===e.prim){const n=Ve(e),i=Ve(t,"Pair");if(void 0===n.args||void 0===i.args)throw new He("Tokens have no arguments");if(n.args[0])return this.findValue(n.args[0],i.args[0],r)||this.findValue(n.args[1],i.args[1],r)}}findToken(e){return this.root.findAndReturnTokens(e,[])}}Ge=$e;class qe{static fromRPCResponse(e){if(!e)throw new De(e,"the RPC response is empty");if(!e.script)throw new De(e,"the RPC response has no script");if(!Array.isArray(e.script.code))throw new De(e,"The response.script.code should be an array");const t=e.script.code.find((e=>"prim"in e&&"parameter"===e.prim));if(!t)throw new De(e,'The response.script.code should have an element of type {prim: "parameter"}');if(!Array.isArray(t.args))throw new De(e,'The response.script.code has an element of type {prim: "parameter"}, but its args is not an array');return new qe(t.args[0])}get isMultipleEntryPoint(){return this.root instanceof y||this.root instanceof F&&this.root.subToken()instanceof y}get hasAnnotation(){return!this.isMultipleEntryPoint||"0"!==Object.keys(this.ExtractSchema())[0]}constructor(e){this.root=Ce(e,0)}Execute(e,t){return this.root.Execute(e,t)}Encode(...e){try{return this.root.Encode(e.reverse())}catch(t){if(t instanceof h)throw t;throw new Ne("Unable to encode parameter",this.root,e,t)}}EncodeObject(e,t){try{return this.root.EncodeObject(e,t)}catch(t){if(t instanceof h)throw t;throw new Ne("Unable to encode parameter object",this.root,e,t)}}ExtractSchema(){return this.root.ExtractSchema()}generateSchema(){return this.root.generateSchema()}ExtractSignatures(){return this.root.ExtractSignature()}}class Ze{static fromRPCResponse(e){const t=[],r=e&&e.script&&Array.isArray(e.script.code)&&e.script.code.filter((e=>"view"===e.prim));return r&&r.forEach((e=>{t.push(new Ze(e.args))})),t}constructor(e){if(!e)throw new je(e,"the args are not defined");if(4!==e.length)throw new je(e,"there should be exactly 4 arguments");if(!("string"in e[0])||!e[0].string)throw new je(e,"The first argument should be a string, representing the view name. It should be in the form: { string: 'viewName' }");this.viewName=e[0].string,this.viewArgsType=e[1],this.viewReturnType=e[2],this.instructions=e[3],this.rootArgsType=Ce(this.viewArgsType,0),this.rootReturnType=Ce(this.viewReturnType,0)}encodeViewArgs(e){try{return this.rootArgsType.EncodeObject(e)}catch(t){throw new Ne(this.viewName,void 0,e,t)}}decodeViewResult(e,t){return this.rootReturnType.Execute(e,t)}extractArgsSchema(){return this.rootArgsType.ExtractSchema()}extractResultSchema(){return this.rootReturnType.ExtractSchema()}}class Ye{constructor(e,t){this.tag=e,this.type=t}static fromMichelineValue(e){var t,r;return new Ye(null===(t=e.annots)||void 0===t?void 0:t[0],null===(r=e.args)||void 0===r?void 0:r[0])}static fromRPCResponse(e){const t=[];return e.script.code.forEach((e=>{"prim"in e&&"code"===e.prim&&"args"in e&&e.args&&t.push(...Ye.extractEventsRecursively(e.args))})),Ye.removeDuplicates(t)}static removeDuplicates(e){const t=[];return e.forEach((e=>{-1===t.findIndex((t=>t.tag===e.tag&&ze(t.type,e.type)))&&t.push(e)})),t}static extractEventsRecursively(e){return Array.isArray(e)?e.flatMap((e=>Ye.extractEventsRecursively(e))):"prim"in e?"EMIT"===e.prim?[Ye.fromMichelineValue(e)]:"args"in e&&e.args?e.args.flatMap((e=>Ye.extractEventsRecursively(e))):[]:[]}}const Je={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"},Xe=Symbol(),Qe={}},9925:(e,t,r)=>{"use strict";r.r(t),r.d(t,{METADATA_BALANCE_UPDATES_CATEGORY:()=>b,OPERATION_METADATA:()=>p,OpKind:()=>O,PvmKind:()=>m,RpcClient:()=>S,RpcClientCache:()=>h,SmartRollupInputProofKind:()=>v,SmartRollupRefutationOptions:()=>g,SmartRollupRefuteGameEndedPlayerOutcomes:()=>E,SmartRollupRefuteGameEndedReason:()=>w,SmartRollupRefuteGameStatusOptions:()=>_,SmartRollupRefuteRevealProofKind:()=>y,VERSION:()=>A,castToBigNumber:()=>f,defaultChain:()=>u,defaultRPCOptions:()=>l});var n=r(2211),i=r(6483),o=r(6209),s=r(6571);function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function c(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const u="main",l={block:"head"};var d;function f(e,t){const r=Array.isArray(e);void 0===t&&(t=Object.keys(e));const n=r?[]:{};return t.forEach((t=>{const r=e[t];let o;if(void 0!==r){if(Array.isArray(r))return o=f(r),void(n[t]=o);o=new i.A(r),n[t]=o}})),n}!function(e){e.GET_BAKING_RIGHTS="getBakingRights",e.GET_BALLOTS="getBallots",e.GET_BALLOT_LIST="getBallotList",e.GET_BIG_MAP_KEY="getBigMapKey",e.GET_BIG_MAP_EXPR="getBigMapExpr",e.GET_BLOCK_HASH="getBlockHash",e.GET_BLOCK="getBlock",e.GET_BLOCK_HEADER="getBlockHeader",e.GET_BLOCK_METADATA="getBlockMetadata",e.GET_BALANCE="getBalance",e.GET_SPENDABLE="getSpendable",e.GET_BALANCE_AND_FROZEN_BONDS="getBalanceAndFrozenBonds",e.GET_SPENDABLE_AND_FROZEN_BONDS="getSpendableAndFrozenBonds",e.GET_FULL_BALANCE="getFullBalance",e.GET_STAKED_BALANCE="getStakedBalance",e.GET_UNSTAKED_FINALIZABLE_BALANCE="getUnstakedFinalizableBalance",e.GET_UNSTAKED_FROZEN_BALANCE="getUnstakedFrozenBalance",e.GET_UNSTAKE_REQUESTS="getUnstakeRequests",e.GET_CHAIN_ID="getChainId",e.GET_CONSTANTS="getConstants",e.GET_CONTRACT="getContract",e.GET_CURRENT_PERIOD="getCurrentPeriod",e.GET_CURRENT_PROPOSAL="getCurrentProposal",e.GET_CURRENT_QUORUM="getCurrentQuorum",e.GET_DELEGATE="getDelegate",e.GET_ALL_DELEGATES="getAllDelegates",e.GET_DELEGATES="getDelegates",e.GET_VOTING_INFO="getVotingInfo",e.GET_ATTESTATION_RIGHTS="getAttestationRights",e.GET_ENTRYPOINTS="getEntrypoints",e.GET_LIVE_BLOCKS="getLiveBlocks",e.GET_MANAGER_KEY="getManagerKey",e.GET_NORMALIZED_SCRIPT="getNormalizedScript",e.GET_PROPOSALS="getProposals",e.GET_PROTOCOLS="getProtocols",e.GET_SAPLING_DIFF_BY_CONTRACT="getSaplingDiffByContract",e.GET_SAPLING_DIFF_BY_ID="getSaplingDiffById",e.GET_SCRIPT="getScript",e.GET_STORAGE="getStorage",e.GET_SUCCESSOR_PERIOD="getSuccessorPeriod",e.GET_VOTES_LISTINGS="getVotesListings",e.PACK_DATA="packData",e.GET_STORAGE_USED_SPACE="getStorageUsedSpace",e.GET_STORAGE_PAID_SPACE="getStoragePaidSpace",e.GET_TICKET_BALANCE="getTicketBalance",e.GET_ALL_TICKET_BALANCES="getAllTicketBalances",e.GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE="getAdaptiveIssuanceLaunchCycle",e.GET_PENDING_OPERATIONS="getPendingOperations"}(d||(d={}));class h{constructor(e,t=1e3){this.rpcClient=e,this.ttl=t,this._cache={}}getAllCachedData(){return this._cache}deleteAllCachedData(){for(const e in this._cache)delete this._cache[e]}formatCacheKey(e,t,r,n){let i="";return r.forEach((e=>{i="object"==typeof e?i+JSON.stringify(e)+"/":i+e+"/"})),n?`${e}/${t}/${i}${JSON.stringify(n)}/`:`${e}/${t}/${i}`}has(e){return e in this._cache}get(e){return this._cache[e].response}put(e,t){const r=setTimeout((()=>this.remove(e)),this.ttl);Object.assign(this._cache,{[e]:{handle:r,response:t}})}remove(e){e in this._cache&&delete this._cache[e]}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK_HASH,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHash({block:e});return this.put(t,r),r}}))}getLiveBlocks(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_LIVE_BLOCKS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getLiveBlocks({block:e});return this.put(t,r),r}}))}getBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBalance(e,{block:t});return this.put(r,n),n}}))}getSpendable(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SPENDABLE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSpendable(e,{block:t});return this.put(r,n),n}}))}getBalanceAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALANCE_AND_FROZEN_BONDS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBalanceAndFrozenBonds(e,{block:t});return this.put(r,n),n}}))}getSpendableAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SPENDABLE_AND_FROZEN_BONDS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSpendableAndFrozenBonds(e,{block:t});return this.put(r,n),n}}))}getFullBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_FULL_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getFullBalance(e,{block:t});return this.put(r,n),n}}))}getStakedBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STAKED_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStakedBalance(e,{block:t});return this.put(r,n),n}}))}getUnstakedFinalizableBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_UNSTAKED_FINALIZABLE_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getUnstakedFinalizableBalance(e,{block:t});return this.put(r,n),n}}))}getUnstakedFrozenBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_UNSTAKED_FROZEN_BALANCE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getUnstakedFrozenBalance(e,{block:t});return this.put(r,n),n}}))}getUnstakeRequests(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_UNSTAKE_REQUESTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getUnstakeRequests(e,{block:t});return this.put(r,n),n}}))}getStorage(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STORAGE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorage(e,{block:t});return this.put(r,n),n}}))}getScript(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SCRIPT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getScript(e,{block:t});return this.put(r,n),n}}))}getNormalizedScript(e){return c(this,arguments,void 0,(function*(e,t={unparsing_mode:"Readable"},{block:r}=l){this.validateContract(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_NORMALIZED_SCRIPT,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getNormalizedScript(e,t,{block:r});return this.put(n,i),i}}))}getContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getContract(e,{block:t});return this.put(r,n),n}}))}getManagerKey(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_MANAGER_KEY,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getManagerKey(e,{block:t});return this.put(r,n),n}}))}getDelegate(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_DELEGATE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegate(e,{block:t});return this.put(r,n),n}}))}getBigMapKey(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){this.validateAddress(e);const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BIG_MAP_KEY,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapKey(e,t,{block:r});return this.put(n,i),i}}))}getBigMapExpr(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BIG_MAP_EXPR,[r,e,t]);if(this.has(n))return this.get(n);{const i=this.rpcClient.getBigMapExpr(e,t,{block:r});return this.put(n,i),i}}))}getAllDelegates(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ALL_DELEGATES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAllDelegates(e,{block:t});return this.put(r,n),n}}))}getDelegates(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_DELEGATES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getDelegates(e,{block:t});return this.put(r,n),n}}))}getVotingInfo(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_VOTING_INFO,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getVotingInfo(e,{block:t});return this.put(r,n),n}}))}getConstants(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CONSTANTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getConstants({block:e});return this.put(t,r),r}}))}getBlock(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlock({block:e});return this.put(t,r),r}}))}getBlockHeader(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK_HEADER,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockHeader({block:e});return this.put(t,r),r}}))}getBlockMetadata(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BLOCK_METADATA,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBlockMetadata({block:e});return this.put(t,r),r}}))}getBakingRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BAKING_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getBakingRights(e,{block:t});return this.put(r,n),n}}))}getAttestationRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ATTESTATION_RIGHTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAttestationRights(e,{block:t});return this.put(r,n),n}}))}getBallotList(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALLOT_LIST,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallotList({block:e});return this.put(t,r),r}}))}getBallots(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_BALLOTS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getBallots({block:e});return this.put(t,r),r}}))}getCurrentProposal(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CURRENT_PROPOSAL,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentProposal({block:e});return this.put(t,r),r}}))}getCurrentQuorum(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CURRENT_QUORUM,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentQuorum({block:e});return this.put(t,r),r}}))}getVotesListings(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_VOTES_LISTINGS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getVotesListings({block:e});return this.put(t,r),r}}))}getProposals(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_PROPOSALS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProposals({block:e});return this.put(t,r),r}}))}forgeOperations(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.forgeOperations(e,{block:t})}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.rpcClient.injectOperation(e)}))}preapplyOperations(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.preapplyOperations(e,{block:t})}))}getEntrypoints(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ENTRYPOINTS,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getEntrypoints(e,{block:t});return this.put(r,n),n}}))}runOperation(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.runOperation(e,{block:t})}))}simulateOperation(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.simulateOperation(e,{block:t})}))}runCode(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.rpcClient.runCode(e,{block:t})}))}runScriptView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.rpcClient.runScriptView(Object.assign({unparsing_mode:r},n),{block:i})}))}runView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.rpcClient.runView(Object.assign({unparsing_mode:r},n),{block:i})}))}getChainId(){return c(this,void 0,void 0,(function*(){const e=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CHAIN_ID,[]);if(this.has(e))return this.get(e);{const t=this.rpcClient.getChainId();return this.put(e,t),t}}))}packData(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.PACK_DATA,[t],e);if(this.has(r))return this.get(r);{const n=this.rpcClient.packData(e,{block:t});return this.put(r,n),n}}))}getRpcUrl(){return this.rpcClient.getRpcUrl()}getCurrentPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_CURRENT_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getCurrentPeriod({block:e});return this.put(t,r),r}}))}getSuccessorPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SUCCESSOR_PERIOD,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getSuccessorPeriod({block:e});return this.put(t,r),r}}))}getSaplingDiffById(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SAPLING_DIFF_BY_ID,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffById(e,{block:t});return this.put(r,n),n}}))}getSaplingDiffByContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_SAPLING_DIFF_BY_CONTRACT,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getSaplingDiffByContract(e,{block:t});return this.put(r,n),n}}))}getProtocols(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_PROTOCOLS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getProtocols({block:e});return this.put(t,r),r}}))}getStorageUsedSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STORAGE_USED_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStorageUsedSpace(e,{block:t});return this.put(r,n),n}}))}getStoragePaidSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_STORAGE_PAID_SPACE,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getStoragePaidSpace(e,{block:t});return this.put(r,n),n}}))}getTicketBalance(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){const n=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_TICKET_BALANCE,[r,e],t);if(this.has(n))return this.get(n);{const i=this.rpcClient.getTicketBalance(e,t,{block:r});return this.put(n,i),i}}))}getAllTicketBalances(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ALL_TICKET_BALANCES,[t,e]);if(this.has(r))return this.get(r);{const n=this.rpcClient.getAllTicketBalances(e,{block:t});return this.put(r,n),n}}))}getAdaptiveIssuanceLaunchCycle(){return c(this,arguments,void 0,(function*({block:e}=l){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_ADAPTIVE_ISSUANCE_LAUNCH_CYCLE,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getAdaptiveIssuanceLaunchCycle({block:e});return this.put(t,r),r}}))}getPendingOperations(){return c(this,arguments,void 0,(function*(e={}){const t=this.formatCacheKey(this.rpcClient.getRpcUrl(),d.GET_PENDING_OPERATIONS,[e]);if(this.has(t))return this.get(t);{const r=this.rpcClient.getPendingOperations(e);return this.put(t,r),r}}))}}var p,b,m,g,v,y,_,E,w,O;!function(e){e.TOO_LARGE="too large"}(p||(p={})),function(e){e.BAKING_BONUSES="baking bonuses",e.BAKING_REWARDS="baking rewards",e.BLOCK_FEES="block fees",e.BONDS="bonds",e.BOOTSTRAP="bootstrap",e.BURNED="burned",e.COMMITMENT="commitment",e.DELEGATE_DENOMINATOR="delegate_denominator",e.DELEGATOR_NUMERATOR="delegator_numerator",e.DEPOSITS="deposits",e.ENDORSING_REWARDS="endorsing rewards",e.INVOICE="invoice",e.LOST_ENDORSING_REWARDS="lost endorsing rewards",e.LOST_ATTESTING_REWARDS="lost attesting rewards",e.MINTED="minted",e.NONCE_REVELATION_REWARDS="nonce revelation rewards",e.PUNISHMENTS="punishments",e.SMART_ROLLUP_REFUTATION_PUNISHMENTS="smart_rollup_refutation_punishments",e.SMART_ROLLUP_REFUTATION_REWARDS="smart_rollup_refutation_rewards",e.STORAGE_FEES="storage fees",e.SUBSIDY="subsidy",e.UNSTAKED_DEPOSITS="unstaked_deposits",e.DOUBLE_SIGNING_EVIDENCE_REWARDS="double signing evidence rewards",e.FEES="fees",e.LEGACY_DEPOSITS="legacy_deposits",e.LEGACY_FEES="legacy_fees",e.LEGACY_REWARDS="legacy_rewards",e.REWARDS="rewards"}(b||(b={})),function(e){e.WASM2="wasm_2_0_0",e.ARITH="arith",e.RISCV="riscv"}(m||(m={})),function(e){e.START="start",e.MOVE="move"}(g||(g={})),function(e){e.INBOX_PROOF="inbox_proof",e.REVEAL_PROOF="reveal_proof",e.FIRST_INPUT="first_input"}(v||(v={})),function(e){e.RAW_DATA_PROOF="raw_data_proof",e.METADATA_PROOF="metadata_proof",e.DAL_PAGE_PROOF="dal_page_proof",e.DAL_PARAMETERS_PROOF="dal_parameters_proof"}(y||(y={})),function(e){e.ONGOING="ongoing",e.ENDED="ended"}(_||(_={})),function(e){e.LOSER="loser",e.DRAW="draw"}(E||(E={})),function(e){e.CONFLICT_RESOLVED="conflict_resolved",e.TIMEOUT="timeout"}(w||(w={})),function(e){e.ORIGINATION="origination",e.DELEGATION="delegation",e.REVEAL="reveal",e.TRANSACTION="transaction",e.ACTIVATION="activate_account",e.ATTESTATION="attestation",e.ENDORSEMENT="endorsement",e.PREATTESTATION="preattestation",e.PREENDORSEMENT="preendorsement",e.SET_DEPOSITS_LIMIT="set_deposits_limit",e.DOUBLE_PREATTESTATION_EVIDENCE="double_preattestation_evidence",e.DOUBLE_PREENDORSEMENT_EVIDENCE="double_preendorsement_evidence",e.ATTESTATION_WITH_DAL="attestation_with_dal",e.ENDORSEMENT_WITH_DAL="endorsement_with_dal",e.SEED_NONCE_REVELATION="seed_nonce_revelation",e.DOUBLE_ATTESTATION_EVIDENCE="double_attestation_evidence",e.DOUBLE_ENDORSEMENT_EVIDENCE="double_endorsement_evidence",e.DOUBLE_BAKING_EVIDENCE="double_baking_evidence",e.PROPOSALS="proposals",e.BALLOT="ballot",e.FAILING_NOOP="failing_noop",e.REGISTER_GLOBAL_CONSTANT="register_global_constant",e.TRANSFER_TICKET="transfer_ticket",e.INCREASE_PAID_STORAGE="increase_paid_storage",e.UPDATE_CONSENSUS_KEY="update_consensus_key",e.DRAIN_DELEGATE="drain_delegate",e.VDF_REVELATION="vdf_revelation",e.EVENT="event",e.TICKET_UPDATES="ticket_updates",e.SMART_ROLLUP_ORIGINATE="smart_rollup_originate",e.SMART_ROLLUP_ADD_MESSAGES="smart_rollup_add_messages",e.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE="smart_rollup_execute_outbox_message",e.SMART_ROLLUP_PUBLISH="smart_rollup_publish",e.SMART_ROLLUP_CEMENT="smart_rollup_cement",e.SMART_ROLLUP_RECOVER_BOND="smart_rollup_recover_bond",e.SMART_ROLLUP_REFUTE="smart_rollup_refute",e.SMART_ROLLUP_TIMEOUT="smart_rollup_timeout",e.DAL_PUBLISH_COMMITMENT="dal_publish_commitment"}(O||(O={}));const A={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"};class S{constructor(e,t=u,r=new n.HttpBackend){this.url=e,this.chain=t,this.httpBackend=r}createURL(e){let t=this.url;for(;t.endsWith("/");)t=t.slice(0,-1);return`${t}${e}`}validateAddress(e){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t))}validateContract(e){const t=(0,o.validateContractAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,o.invalidDetail)(t))}getBlockHash(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/hash`),method:"GET"})}))}getLiveBlocks(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/live_blocks`),method:"GET"})}))}getBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/balance`),method:"GET"});return new i.A(r)}))}getSpendable(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/spendable`),method:"GET"});return new i.A(r)}))}getBalanceAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/balance_and_frozen_bonds`),method:"GET"});return new i.A(r)}))}getSpendableAndFrozenBonds(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/spendable_and_frozen_bonds`),method:"GET"});return new i.A(r)}))}getFullBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/full_balance`),method:"GET"});return new i.A(r)}))}getStakedBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/staked_balance`),method:"GET"});return new i.A(r)}))}getUnstakedFinalizableBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/unstaked_finalizable_balance`),method:"GET"});return new i.A(r)}))}getUnstakedFrozenBalance(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/unstaked_frozen_balance`),method:"GET"});return new i.A(r)}))}getUnstakeRequests(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/unstake_requests`),method:"GET"});return null===r?null:{finalizable:r.finalizable.map((e=>{var{amount:t}=e,r=a(e,["amount"]);const n=f({amount:t},["amount"]);return Object.assign(Object.assign({},r),{amount:n.amount})})),unfinalizable:{delegate:r.unfinalizable.delegate,requests:r.unfinalizable.requests.map((({amount:e,cycle:t})=>({cycle:t,amount:f({amount:e},["amount"]).amount})))}}}))}getStorage(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage`),method:"GET"})}))}getScript(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/script`),method:"GET"})}))}getNormalizedScript(e){return c(this,arguments,void 0,(function*(e,t={unparsing_mode:"Readable"},{block:r}=l){return this.validateContract(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/script/normalized`),method:"POST"},t)}))}getContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}`),method:"GET"});return Object.assign(Object.assign({},r),{balance:new i.A(r.balance)})}))}getManagerKey(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/manager_key`),method:"GET"})}))}getDelegate(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){let r;this.validateAddress(e);try{r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/delegate`),method:"GET"})}catch(e){if(!(e instanceof n.HttpResponseError&&e.status===n.STATUS_CODE.NOT_FOUND))throw e;r=null}return r}))}getBigMapKey(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){return this.validateAddress(e),this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/big_map_get`),method:"POST"},t)}))}getBigMapExpr(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/big_maps/${e}/${t}`),method:"GET"})}))}getAllDelegates(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates`),method:"GET",query:e})}))}getDelegates(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateAddress(e);const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}`),method:"GET"}),n=f(r,["balance","full_balance","current_frozen_deposits","frozen_deposits","frozen_balance","frozen_deposits_limit","staking_balance","delegated_balance","voting_power","total_delegated_stake","staking_denominator"]);return Object.assign(Object.assign(Object.assign({},r),n),{frozen_balance_by_cycle:r.frozen_balance_by_cycle?r.frozen_balance_by_cycle.map((e=>{var{deposit:t,deposits:r,fees:n,rewards:i}=e,o=a(e,["deposit","deposits","fees","rewards"]);const s=f({deposit:t,deposits:r,fees:n,rewards:i},["deposit","deposits","fees","rewards"]);return Object.assign(Object.assign({},o),{deposit:s.deposit,deposits:s.deposits,fees:s.fees,rewards:s.rewards})})):void 0})}))}getVotingInfo(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.validateAddress(e),yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/delegates/${e}/voting_info`),method:"GET"})}))}getConstants(){return c(this,arguments,void 0,(function*({block:e}=l){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/constants`),method:"GET"}),r=f(t,["time_between_blocks","hard_gas_limit_per_operation","hard_gas_limit_per_block","proof_of_work_threshold","tokens_per_roll","seed_nonce_revelation_tip","block_security_deposit","endorsement_security_deposit","block_reward","endorsement_reward","cost_per_byte","hard_storage_limit_per_operation","test_chain_duration","baking_reward_per_endorsement","delay_per_missing_endorsement","minimal_block_delay","liquidity_baking_subsidy","cache_layout","baking_reward_fixed_portion","baking_reward_bonus_per_slot","endorsing_reward_per_slot","double_baking_punishment","delay_increment_per_round","tx_rollup_commitment_bond","vdf_difficulty","sc_rollup_stake_amount","minimal_stake"]);return Object.assign(Object.assign({},t),r)}))}getBlock(){return c(this,arguments,void 0,(function*({block:e,version:t}=l){const r={url:this.createURL(`/chains/${this.chain}/blocks/${e}`),method:"GET"};return void 0!==t&&(r.query={version:t}),yield this.httpBackend.createRequest(r)}))}getBlockHeader(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/header`),method:"GET"})}))}getBlockMetadata(){return c(this,arguments,void 0,(function*({block:e,version:t}=l){const r={url:this.createURL(`/chains/${this.chain}/blocks/${e}/metadata`),method:"GET"};return void 0!==t&&(r.query={version:t}),yield this.httpBackend.createRequest(r)}))}getBakingRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/baking_rights`),method:"GET",query:e})}))}getAttestationRights(){return c(this,arguments,void 0,(function*(e={},{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/attestation_rights`),method:"GET",query:e})}))}getBallotList(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballot_list`),method:"GET"})}))}getBallots(){return c(this,arguments,void 0,(function*({block:e}=l){return f(yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/ballots`),method:"GET"}),["yay","nay","pass"])}))}getCurrentProposal(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_proposal`),method:"GET"})}))}getCurrentQuorum(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_quorum`),method:"GET"})}))}getVotesListings(){return c(this,arguments,void 0,(function*({block:e}=l){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/listings`),method:"GET"});return t.map((e=>(e.voting_power&&(e.voting_power=new i.A(e.voting_power)),e))),t}))}getProposals(){return c(this,arguments,void 0,(function*({block:e}=l){const t=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/proposals`),method:"GET"});return t.map((e=>e[1]=new i.A(e[1]))),t}))}forgeOperations(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/forge/operations`),method:"POST"},e)}))}injectOperation(e){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL("/injection/operation"),method:"POST"},e)}))}preapplyOperations(e){return c(this,arguments,void 0,(function*(e,{block:t,version:r}=l){const n={url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/preapply/operations`),method:"POST"};return void 0!==r&&(n.query={version:r}),yield this.httpBackend.createRequest(n,e)}))}getEntrypoints(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){this.validateContract(e);return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/entrypoints`),method:"GET"})}))}runOperation(e){return c(this,arguments,void 0,(function*(e,{block:t,version:r}=l){const n={url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_operation`),method:"POST"};return void 0!==r&&(n.query={version:r}),yield this.httpBackend.createRequest(n,e)}))}simulateOperation(e){return c(this,arguments,void 0,(function*(e,{block:t,version:r}=l){const n={url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/simulate_operation`),method:"POST"};return void 0!==r&&(n.query={version:r}),yield this.httpBackend.createRequest(n,e)}))}runCode(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/run_code`),method:"POST"},e)}))}runScriptView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${i}/helpers/scripts/run_script_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}runView(e,t){return c(this,void 0,void 0,(function*(){var{unparsing_mode:r="Readable"}=e,n=a(e,["unparsing_mode"]),i=(void 0===t?l:t).block;return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${i}/helpers/scripts/run_view`),method:"POST"},Object.assign({unparsing_mode:r},n))}))}getChainId(){return c(this,void 0,void 0,(function*(){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/chain_id`),method:"GET"})}))}packData(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){const r=yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/helpers/scripts/pack_data`),method:"POST"},e),{gas:n}=r,o=a(r,["gas"]);let s=n;const c=new i.A(n||"");return c.isNaN()||(s=c),Object.assign({gas:s},o)}))}getRpcUrl(){return this.url}getCurrentPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/current_period`),method:"GET"})}))}getSuccessorPeriod(){return c(this,arguments,void 0,(function*({block:e}=l){return yield this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/votes/successor_period`),method:"GET"})}))}getSaplingDiffById(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/sapling/${e}/get_diff`),method:"GET"})}))}getSaplingDiffByContract(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/single_sapling_get_diff`),method:"GET"})}))}getProtocols(){return c(this,arguments,void 0,(function*({block:e}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/protocols`),method:"GET"})}))}getStorageUsedSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/used_space`),method:"GET"})}))}getStoragePaidSpace(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/storage/paid_space`),method:"GET"})}))}getTicketBalance(e,t){return c(this,arguments,void 0,(function*(e,t,{block:r}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${r}/context/contracts/${e}/ticket_balance`),method:"POST"},t)}))}getAllTicketBalances(e){return c(this,arguments,void 0,(function*(e,{block:t}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${t}/context/contracts/${e}/all_ticket_balances`),method:"GET"})}))}getAdaptiveIssuanceLaunchCycle(){return c(this,arguments,void 0,(function*({block:e}=l){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/blocks/${e}/context/adaptive_issuance_launch_cycle`),method:"GET"})}))}getPendingOperations(){return c(this,arguments,void 0,(function*(e={}){return this.httpBackend.createRequest({url:this.createURL(`/chains/${this.chain}/mempool/pending_operations`),method:"GET",query:e})}))}}},6209:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DeprecationError:()=>d.DeprecationError,InvalidAddressError:()=>d.InvalidAddressError,InvalidBlockHashError:()=>d.InvalidBlockHashError,InvalidChainIdError:()=>d.InvalidChainIdError,InvalidContractAddressError:()=>d.InvalidContractAddressError,InvalidHexStringError:()=>d.InvalidHexStringError,InvalidKeyError:()=>d.InvalidKeyError,InvalidKeyHashError:()=>d.InvalidKeyHashError,InvalidMessageError:()=>d.InvalidMessageError,InvalidOperationHashError:()=>d.InvalidOperationHashError,InvalidOperationKindError:()=>d.InvalidOperationKindError,InvalidProtocolHashError:()=>w,InvalidPublicKeyError:()=>d.InvalidPublicKeyError,InvalidSignatureError:()=>d.InvalidSignatureError,Prefix:()=>n,ProhibitedActionError:()=>d.ProhibitedActionError,VERSION:()=>W,ValidationResult:()=>A,ValueConversionError:()=>O,b58cdecode:()=>te,b58cencode:()=>ee,b58decode:()=>re,b58decodeL2Address:()=>ne,buf2hex:()=>fe,bytes2Char:()=>me,bytesToString:()=>ge,char2Bytes:()=>pe,encodeAddress:()=>oe,encodeExpr:()=>X,encodeKey:()=>ae,encodeKeyHash:()=>ce,encodeL2Address:()=>se,encodeOpHash:()=>Q,encodePubKey:()=>ie,format:()=>J,getPkhfromPk:()=>he,hex2Bytes:()=>ve,hex2buf:()=>ue,invalidDetail:()=>V,isValidPrefix:()=>S,mergebuf:()=>le,mic2arr:()=>de,num2PaddedHex:()=>Ee,numToHexBuffer:()=>_e,prefix:()=>g,prefixLength:()=>v,stringToBytes:()=>be,stripHexPrefix:()=>we,toHexBuf:()=>ye,validateAddress:()=>N,validateBlock:()=>G,validateChain:()=>j,validateContractAddress:()=>D,validateKeyHash:()=>U,validateOperation:()=>K,validatePkAndExtractPrefix:()=>_,validateProtocol:()=>H,validatePublicKey:()=>F,validateSignature:()=>B,validateSmartRollupAddress:()=>z,validateSpendingKey:()=>$,verifySignature:()=>y});var n,i=r(5765),o=r(7379),s=r(1703),a=r(9620),c=r.n(a),u=r(9848),l=r.n(u),d=r(6571),f=r(6483),h=r(3360),p=r.n(h),b=r(2100),m=r.n(b);!function(e){e.TZ1="tz1",e.TZ2="tz2",e.TZ3="tz3",e.TZ4="tz4",e.KT="KT",e.KT1="KT1",e.EDSK2="edsk2",e.SPSK="spsk",e.P2SK="p2sk",e.EDPK="edpk",e.SPPK="sppk",e.P2PK="p2pk",e.BLPK="BLpk",e.EDESK="edesk",e.SPESK="spesk",e.P2ESK="p2esk",e.EDSK="edsk",e.EDSIG="edsig",e.SPSIG="spsig",e.P2SIG="p2sig",e.SIG="sig",e.NET="Net",e.NCE="nce",e.B="B",e.O="o",e.LO="Lo",e.LLO="LLo",e.P="P",e.CO="Co",e.ID="id",e.EXPR="expr",e.TZ="TZ",e.VH="vh",e.SASK="sask",e.ZET1="zet1",e.SR1="sr1",e.SRC1="src1",e.SH="sh"}(n||(n={}));const g={[n.TZ1]:new Uint8Array([6,161,159]),[n.TZ2]:new Uint8Array([6,161,161]),[n.TZ3]:new Uint8Array([6,161,164]),[n.TZ4]:new Uint8Array([6,161,166]),[n.KT]:new Uint8Array([2,90,121]),[n.KT1]:new Uint8Array([2,90,121]),[n.EDSK]:new Uint8Array([43,246,78,7]),[n.EDSK2]:new Uint8Array([13,15,58,7]),[n.SPSK]:new Uint8Array([17,162,224,201]),[n.P2SK]:new Uint8Array([16,81,238,189]),[n.EDPK]:new Uint8Array([13,15,37,217]),[n.SPPK]:new Uint8Array([3,254,226,86]),[n.P2PK]:new Uint8Array([3,178,139,127]),[n.BLPK]:new Uint8Array([6,149,135,204]),[n.EDESK]:new Uint8Array([7,90,60,179,41]),[n.SPESK]:new Uint8Array([9,237,241,174,150]),[n.P2ESK]:new Uint8Array([9,48,57,115,171]),[n.EDSIG]:new Uint8Array([9,245,205,134,18]),[n.SPSIG]:new Uint8Array([13,115,101,19,63]),[n.P2SIG]:new Uint8Array([54,240,44,52]),[n.SIG]:new Uint8Array([4,130,43]),[n.NET]:new Uint8Array([87,82,0]),[n.NCE]:new Uint8Array([69,220,169]),[n.B]:new Uint8Array([1,52]),[n.O]:new Uint8Array([5,116]),[n.LO]:new Uint8Array([133,233]),[n.LLO]:new Uint8Array([29,159,109]),[n.P]:new Uint8Array([2,170]),[n.CO]:new Uint8Array([79,179]),[n.ID]:new Uint8Array([153,103]),[n.EXPR]:new Uint8Array([13,44,64,27]),[n.TZ]:new Uint8Array([2,90,121]),[n.VH]:new Uint8Array([1,106,242]),[n.SASK]:new Uint8Array([11,237,20,92]),[n.ZET1]:new Uint8Array([18,71,40,223]),[n.SR1]:new Uint8Array([6,124,117]),[n.SRC1]:new Uint8Array([17,165,134,138]),[n.SH]:new Uint8Array([2,116,180])},v={[n.TZ1]:20,[n.TZ2]:20,[n.TZ3]:20,[n.TZ4]:20,[n.KT]:20,[n.KT1]:20,[n.EDPK]:32,[n.SPPK]:33,[n.P2PK]:33,[n.BLPK]:48,[n.EDSIG]:64,[n.SPSIG]:64,[n.P2SIG]:64,[n.SIG]:64,[n.NET]:4,[n.B]:32,[n.P]:32,[n.O]:32,[n.VH]:32,[n.SASK]:169,[n.ZET1]:43,[n.SR1]:20,[n.SRC1]:32,[n.SH]:48};function y(e,t,r,i){const a=_(t),c=function(e){const t=e.startsWith("sig")?e.substring(0,3):e.substring(0,5),r=B(e);if(r!==A.VALID)throw new d.InvalidSignatureError(e,V(r));return t}(r),u=te(t,g[a]),l=te(r,g[c]);let f=ue(function(e){if(""===e)throw new d.InvalidMessageError(e,"can't be empty");return e}(e));void 0!==i&&(f=le(i,f));const h=(0,s.tW)(f,32);return a===n.EDPK?function(e,t,r){try{return(0,o.MX)(r,t,e)}catch(e){return!1}}(l,h,u):a===n.SPPK?function(e,t,r){const n=new(p().ec)("secp256k1").keyFromPublic(r);return E(e,t,n)}(l,h,u):a===n.P2PK&&function(e,t,r){const n=new(p().ec)("p256").keyFromPublic(r);return E(e,t,n)}(l,h,u)}function _(e){if(""===e)throw new d.InvalidPublicKeyError(e,"can't be empty");const t=e.substring(0,4),r=F(e);if(r!==A.VALID)throw new d.InvalidPublicKeyError(e,V(r));return t}function E(e,t,r){const n=fe(m()(e)).match(/([a-f\d]{64})/gi);if(n)try{const[e,i]=n;return r.verify(t,{r:e,s:i})}catch(e){return!1}return!1}class w extends d.ParameterValidationError{constructor(e,t){super(),this.protocolHash=e,this.errorDetails=t,this.name="InvalidProtocolHashError",this.name="InvalidProtocolHashError",this.message=`The protocol hash '${e}' is invalid`,t&&(this.message+=`: ${t}`)}}class O extends d.UnsupportedActionError{constructor(e,t){super(),this.value=e,this.desiredType=t,this.name="ValueConversionError",this.message=`Unable to convert ${e} to a ${t}`}}var A;function S(e){return"string"==typeof e&&e in g}function P(e,t){const r=new RegExp(`^(${t.join("|")})`).exec(e);if(!r||0===r.length)return A.NO_PREFIX_MATCHED;const n=r[0];if(!S(n))return A.NO_PREFIX_MATCHED;e.includes("%")&&(e=e.split("%")[0]);if(!/^(KT1\w{33})$/.test(e)&&"KT1"===n)return A.INVALID_CHECKSUM;let i=l().decodeUnsafe(e);return i?(i=i.slice(g[n].length),i.length!==v[n]?A.INVALID_LENGTH:A.VALID):A.INVALID_CHECKSUM}!function(e){e[e.NO_PREFIX_MATCHED=0]="NO_PREFIX_MATCHED",e[e.INVALID_CHECKSUM=1]="INVALID_CHECKSUM",e[e.INVALID_LENGTH=2]="INVALID_LENGTH",e[e.VALID=3]="VALID"}(A||(A={}));const T=[n.TZ1,n.TZ2,n.TZ3,n.TZ4],R=[n.KT1],I=[n.EDSIG,n.P2SIG,n.SPSIG,n.SIG],x=[n.EDPK,n.SPPK,n.P2PK,n.BLPK],M=[n.O],k=[n.P],L=[n.B],C=[n.SR1];function N(e){return P(e,[...T,...R,...C])}function j(e){return P(e,[n.NET])}function D(e){return P(e,R)}function U(e){return P(e,T)}function B(e){return P(e,I)}function F(e){return P(e,x)}function K(e){return P(e,M)}function H(e){return P(e,k)}function G(e){return P(e,L)}function $(e){return P(e,[n.SASK])}function V(e){switch(e){case A.NO_PREFIX_MATCHED:return"with unsupported prefix";case A.INVALID_CHECKSUM:return"failed checksum";case A.INVALID_LENGTH:return"with incorrect length";default:return""}}function z(e){return P(e,[...C])}const W={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"},q=6,Z=3;function Y(e){switch(e){case"tz":return q;case"mtz":return Z;default:return 0}}function J(e="mutez",t="mutez",r){const n=new f.A(r);return n.isNaN()?r:n.multipliedBy(Math.pow(10,Y(e))).dividedBy(Math.pow(10,Y(t)))}function X(e){return ee(c().blake2b(ue(e),void 0,32),g.expr)}function Q(e){return ee(c().blake2b(ue(e),void 0,32),g.o)}function ee(e,t){const r="string"==typeof e?Uint8Array.from(i.hp.from(e,"hex")):e,n=new Uint8Array(t.length+r.length);return n.set(t),n.set(r,t.length),l().encode(i.hp.from(n.buffer))}const te=(e,t)=>l().decode(e).slice(t.length);function re(e){const t=l().decode(e),r={[g.tz1.toString()]:"0000",[g.tz2.toString()]:"0001",[g.tz3.toString()]:"0002"}[new Uint8Array(t.slice(0,3)).toString()];if(r){return r+fe(t.slice(3))}return"01"+fe(t.slice(3,42))+"00"}function ne(e){const t=l().decode(e);return fe(t.slice(3,42))}function ie(e){if("00"===e.substring(0,2)){const t={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ee(e.substring(4),t[e.substring(0,4)])}return ee(e.substring(2,42),g.KT)}function oe(e){if("0x"===e.substring(0,2)&&(e=e.slice(2)),"00"===e.substring(0,2)){const t={"0000":g.tz1,"0001":g.tz2,"0002":g.tz3};return ee(e.substring(4),t[e.substring(0,4)])}return ee(e.substring(2,42),g.KT)}function se(e){return ee(e,g.tz4)}function ae(e){if("0"===e[0]){const t={"00":new Uint8Array([13,15,37,217]),"01":new Uint8Array([3,254,226,86]),"02":new Uint8Array([3,178,139,127])};return ee(e.substring(2),t[e.substring(0,2)])}}function ce(e){if("0"===e[0]){const t={"00":new Uint8Array([6,161,159]),"01":new Uint8Array([6,161,161]),"02":new Uint8Array([6,161,164])};return ee(e.substring(2),t[e.substring(0,2)])}}const ue=e=>{if(e.length%2!=0)throw new d.InvalidHexStringError(e,": Expecting even number of characters");const t=we(e);if(!t.match(/^([\da-f]{2})*$/gi))throw new d.InvalidHexStringError(e,": Only characters 0-9, a-f and A-F are expected. Optionally, it can be prefixed with '0x'");const r=new Uint8Array(t.length/2);let n=0;for(let i=0;i<t.length;i+=2){const o=parseInt(t.slice(i,i+2),16);if(Number.isNaN(o))throw new O(e,"Uint8Array");r[n++]=o}return r},le=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r},de=function e(t){let r=[];if(Object.prototype.hasOwnProperty.call(t,"prim"))"Pair"===t.prim?(r.push(e(t.args[0])),r=r.concat(e(t.args[1]))):"Elt"===t.prim?r={key:e(t.args[0]),val:e(t.args[1])}:"True"===t.prim?r=!0:"False"===t.prim&&(r=!1);else if(Array.isArray(t)){const n=t.length;for(let i=0;i<n;i++){const n=e(t[i]);void 0!==n.key?(Array.isArray(r)&&(r={keys:[],vals:[]}),r.keys.push(n.key),r.vals.push(n.val)):r.push(n)}}else r=Object.prototype.hasOwnProperty.call(t,"string")?t.string:Object.prototype.hasOwnProperty.call(t,"int")?parseInt(t.int,10):t;return r},fe=e=>{const t=[];return e.forEach((e=>{const r=`00${e.toString(16)}`.slice(-2);t.push(r)})),t.join("")},he=e=>{let t,r;const i=_(e),o=te(e,g[i]);switch(i){case n.EDPK:t=g[n.TZ1],r=v[n.TZ1];break;case n.SPPK:t=g[n.TZ2],r=v[n.TZ2];break;case n.P2PK:t=g[n.TZ3],r=v[n.TZ3];break;case n.BLPK:t=g[n.TZ4],r=v[n.TZ4]}return ee((0,s.tW)(o,r),t)};function pe(e){return i.hp.from(e,"utf8").toString("hex")}function be(e){return i.hp.from(e,"utf8").toString("hex")}function me(e){return i.hp.from(ue(e)).toString("utf8")}function ge(e){return i.hp.from(ue(e)).toString("utf8")}function ve(e){const t=we(e);if(!t.match(/^(0x)?([\da-f]{2})*$/gi))throw new d.InvalidHexStringError(e,": Expecting even number of characters: 0-9, a-z, A-Z, optionally prefixed with 0x");return i.hp.from(t,"hex")}function ye(e,t=8){return i.hp.from(Ee(e,t),"hex")}function _e(e,t=8){return i.hp.from(Ee(e,t),"hex")}function Ee(e,t=8){if(new f.A(e).isPositive()){const r=Math.ceil(t/4),n=e.toString(16);let i=n.length>=r?n.length:r;return i=i%2==0?i:i+1,function(e,t){const r="0";if(e.length>=t)return e;{const n=t-e.length;return r.repeat(n)+e}}(n,i)}return new f.A(2).pow(t).minus(new f.A(e).abs()).toString(16)}function we(e){return e.startsWith("0x")?e.slice(2):e}},5765:(e,t,r)=>{"use strict";const n=r(7991),i=r(9318),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function b(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function E(e,t,r,n){return q(z(t,e.length-r),e,r,n)}function w(e,t,r,n){return q(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function O(e,t,r,n){return q(W(t),e,r,n)}function A(e,t,r,n){return q(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function x(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=J[e[n]];return i}function M(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function C(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,o){return t=+t,r>>>=0,o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function F(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function K(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=K(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=K(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},5025:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCBatchProvider=t.OperationBatch=t.BATCH_KINDS=void 0;const i=r(2654),o=r(7669),s=r(9925),a=r(6209),c=r(6571),u=r(5605),l=r(3682);t.BATCH_KINDS=[s.OpKind.ACTIVATION,s.OpKind.ORIGINATION,s.OpKind.TRANSACTION,s.OpKind.DELEGATION];class d extends u.Provider{constructor(e,t){super(e),this.estimator=t,this.operations=[],this.prepare=new l.PrepareProvider(this.context)}withTransfer(e){const t=(0,a.validateAddress)(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSACTION},e)),this}withTransferTicket(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:s.OpKind.TRANSFER_TICKET},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=(0,a.validateAddress)(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));const n=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,(0,a.invalidDetail)(n));return this.operations.push(Object.assign({kind:s.OpKind.DELEGATION},e)),this}withActivation({pkh:e,secret:t}){const r=(0,a.validateKeyHash)(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidKeyHashError(e,(0,a.invalidDetail)(r));return this.operations.push({kind:s.OpKind.ACTIVATION,pkh:e,secret:t}),this}withOrigination(e){return this.operations.push(Object.assign({kind:s.OpKind.ORIGINATION},e)),this}withRegisterGlobalConstant(e){return this.operations.push(Object.assign({kind:s.OpKind.REGISTER_GLOBAL_CONSTANT},e)),this}withIncreasePaidStorage(e){return this.operations.push(Object.assign({kind:s.OpKind.INCREASE_PAID_STORAGE},e)),this}withSmartRollupAddMessages(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ADD_MESSAGES},e)),this}withSmartRollupOriginate(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_ORIGINATE},e)),this}withSmartRollupExecuteOutboxMessage(e){return this.operations.push(Object.assign({kind:s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE},e)),this}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case s.OpKind.TRANSACTION:return(0,i.createTransferOperation)(Object.assign({},e));case s.OpKind.ORIGINATION:return(0,i.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case s.OpKind.DELEGATION:return(0,i.createSetDelegateOperation)(Object.assign({},e));case s.OpKind.REGISTER_GLOBAL_CONSTANT:return(0,i.createRegisterGlobalConstantOperation)(Object.assign({},e));case s.OpKind.INCREASE_PAID_STORAGE:return(0,i.createIncreasePaidStorageOperation)(Object.assign({},e));case s.OpKind.TRANSFER_TICKET:return(0,i.createTransferTicketOperation)(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:return(0,i.createSmartRollupAddMessagesOperation)(Object.assign({},e));case s.OpKind.SMART_ROLLUP_ORIGINATE:return(0,i.createSmartRollupOriginateOperation)(Object.assign({},e));case s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return(0,i.createSmartRollupExecuteOutboxMessageOperation)(Object.assign({},e));default:throw new c.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case s.OpKind.TRANSACTION:this.withTransfer(t);break;case s.OpKind.ORIGINATION:this.withOrigination(t);break;case s.OpKind.DELEGATION:this.withDelegation(t);break;case s.OpKind.ACTIVATION:this.withActivation(t);break;case s.OpKind.REGISTER_GLOBAL_CONSTANT:this.withRegisterGlobalConstant(t);break;case s.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;case s.OpKind.TRANSFER_TICKET:this.withTransferTicket(t);break;case s.OpKind.SMART_ROLLUP_ADD_MESSAGES:this.withSmartRollupAddMessages(t);break;case s.OpKind.SMART_ROLLUP_ORIGINATE:this.withSmartRollupOriginate(t);break;case s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:this.withSmartRollupExecuteOutboxMessage(t);break;default:throw new c.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=e&&e.source||t,n=yield this.estimator.batch(this.operations);n.length!==this.operations.length&&n.shift();const i=yield this.prepare.batch(this.operations,n),s=yield this.forge(i),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(s);return new o.BatchOperation(a,i.opOb.contents,r,u,l,c)}))}}t.OperationBatch=d;t.RPCBatchProvider=class{constructor(e,t){this.context=e,this.estimator=t}batch(e){const t=new d(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}},5283:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRevealFeeInternal=t.getRevealFee=t.getRevealGasLimit=t.ChainIds=t.protocols=t.Protocols=t.COST_PER_BYTE=t.ORIGINATION_SIZE=t.REVEAL_STORAGE_LIMIT=t.DEFAULT_STORAGE_LIMIT=t.DEFAULT_FEE=t.DEFAULT_GAS_LIMIT=void 0,t.DEFAULT_GAS_LIMIT={DELEGATION:10600,ORIGINATION:10600,TRANSFER:10600,REVEAL_TZ1:1e3,REVEAL_TZ2:1e3,REVEAL_TZ3:2e3,REVEAL_TZ4:2e3},t.DEFAULT_FEE={DELEGATION:1257,ORIGINATION:1e4,TRANSFER:1e4,REVEAL:374},t.DEFAULT_STORAGE_LIMIT={DELEGATION:0,ORIGINATION:257,TRANSFER:257,REVEAL:0};const r=169,n=155,i=445,o=1674,s=276,a=276,c=305,u=477;var l,d;t.REVEAL_STORAGE_LIMIT=0,t.ORIGINATION_SIZE=257,t.COST_PER_BYTE=250,function(e){e.Pt24m4xi="Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",e.PsBABY5H="PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",e.PsBabyM1="PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS",e.PsCARTHA="PsCARTHAGazKbHtnKfLzQg3kms52kSRpgnDY982a9oYsSXRLQEb",e.PsDELPH1="PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo",e.PtEdo2Zk="PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA",e.PsFLorena="PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",e.PtGRANADs="PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV",e.PtHangz2="PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx",e.PsiThaCa="PsiThaCaT47Zboaw71QWScM8sXeMM7bbQFncK9FLqYc6EKdpjVP",e.Psithaca2="Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A",e.PtJakart2="PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",e.PtKathman="PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg",e.PtLimaPtL="PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW",e.PtMumbaii="PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc",e.PtMumbai2="PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1",e.PtNairobi="PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf",e.ProxfordY="ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH",e.PtParisBx="PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",e.PsParisCZ="PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",e.PsQuebecn="PsQuebecnLByd3JwTiGadoG4nGWi3HYiLXUjkibeFV8dCFeVMUg",e.ProtoALpha="ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"}(l||(t.Protocols=l={})),t.protocols={"004":[l.Pt24m4xi],"005":[l.PsBABY5H,l.PsBabyM1],"006":[l.PsCARTHA],"007":[l.PsDELPH1],"008":[l.PtEdo2Zk],"009":[l.PsFLorena],"010":[l.PtGRANADs],"011":[l.PtHangz2],"012":[l.PsiThaCa,l.Psithaca2],"013":[l.PtJakart2],"014":[l.PtKathman],"015":[l.PtLimaPtL],"016":[l.PtMumbai2],"017":[l.PtNairobi],"019":[l.ProxfordY],"020":[l.PtParisBx,l.PsParisCZ],"021":[l.PsQuebecn],"022":[l.ProtoALpha]},function(e){e.MAINNET="NetXdQprcVkpaWU",e.CARTHAGENET="NetXjD3HPJJjmcd",e.DELPHINET="NetXm8tYqnMWky1",e.EDONET="NetXSgo1ZT2DRUG",e.FLORENCENET="NetXxkAx4woPLyu",e.GRANADANET="NetXz969SFaFn8k",e.HANGZHOUNET="NetXZSsxBpMQeAT",e.ITHACANET="NetXbhmtAbMukLc",e.ITHACANET2="NetXnHfVqm9iesp",e.JAKARTANET2="NetXLH1uAxK7CCh",e.KATHMANDUNET="NetXazhm4yetmff",e.LIMANET="NetXizpkH94bocH",e.MUMBAINET="NetXQw6nWSnrJ5t",e.MUMBAINET2="NetXgbcrNtXD2yA",e.NAIROBINET="NetXyuzvDo2Ugzb",e.OXFORDNET2="NetXxWsskGahzQB",e.PARISBNET="NetXo8SqH1c38SS",e.PARISCNET="NetXXWAHLEvre9b",e.PsQuebecn="NetXuTeGinLEqxp"}(d||(t.ChainIds=d={}));t.getRevealGasLimit=e=>Math.round(37*f(e)/10);const f=e=>{switch(e.substring(0,3)){case"tz1":return r;case"tz2":return n;case"tz3":return i;case"tz4":return o;default:throw new Error(`Cannot estimate reveal gas limit for ${e}`)}};t.getRevealFee=e=>Math.round(12*(0,t.getRevealFeeInternal)(e)/10);t.getRevealFeeInternal=e=>{switch(e.substring(0,3)){case"tz1":return s;case"tz2":return a;case"tz3":return c;case"tz4":return u;default:throw new Error(`Cannot estimate reveal fee for ${e}`)}}},7021:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.defaultConfigConfirmation=void 0;const i=r(9925),o=r(2245),s=r(6425),a=r(808),c=r(8907),u=r(4019),l=r(3995),d=r(5025),f=r(1170),h=r(8541),p=r(577),b=r(8813),m=r(8320),g=r(4631),v=r(8648),y=r(6343),_=r(7583);t.defaultConfigConfirmation={defaultConfirmationCount:1,confirmationPollingTimeoutSecond:180};class E{constructor(e,r=new s.NoopSigner,n,E=new b.BehaviorSubject(Object.assign({},t.defaultConfigConfirmation)),w,O,A,S,P,T,R,I){this._rpc=e,this._signer=r,this._proto=n,this._config=E,this.providerDecorator=[],this.tz=new c.RpcTzProvider(this),this.estimate=new u.RPCEstimateProvider(this),this.contract=new l.RpcContractProvider(this,this.estimate),this.prepare=new _.PrepareProvider(this),this.batch=new d.RPCBatchProvider(this,this.estimate),this.wallet=new f.Wallet(this),this.withExtensions=()=>{let e=this.clone();return this.providerDecorator.forEach((t=>{e=t(e)})),e},"string"==typeof this._rpc?this._rpcClient=new i.RpcClient(this._rpc):this._rpcClient=this._rpc,this._forger=w||new y.TaquitoLocalForger(this),this._injector=O||new o.RpcInjector(this),this.operationFactory=new a.OperationFactory(this),this._walletProvider=S||new f.LegacyWalletProvider(this),this._parser=P||new h.MichelCodecParser(this),this._packer=A||new p.RpcPacker(this),this._globalConstantsProvider=T||new m.NoopGlobalConstantsProvider,this._readProvider=R||new g.RpcReadAdapter(this._rpcClient),this._stream=I||new v.PollingSubscribeProvider(this)}get config(){return this._config.getValue()}set config(e){this._config.next(Object.assign({},e))}setPartialConfig(e){this._config.next(Object.assign(Object.assign({},this._config.getValue()),e))}get rpc(){return this._rpcClient}set rpc(e){this._rpcClient=e}get injector(){return this._injector}set injector(e){this._injector=e}get forger(){return this._forger}set forger(e){this._forger=e}get signer(){return this._signer}set signer(e){this._signer=e}get walletProvider(){return this._walletProvider}set walletProvider(e){this._walletProvider=e}set proto(e){this._proto=e}get proto(){return this._proto}get parser(){return this._parser}set parser(e){this._parser=e}get packer(){return this._packer}set packer(e){this._packer=e}get globalConstantsProvider(){return this._globalConstantsProvider}set globalConstantsProvider(e){this._globalConstantsProvider=e}get readProvider(){return this._readProvider}set readProvider(e){this._readProvider=e}get stream(){return this._stream}set stream(e){this._stream=e}isAnyProtocolActive(){return n(this,arguments,void 0,(function*(e=[]){if(this._proto)return e.includes(this._proto);{const t=yield this.readProvider.getNextProtocol("head");return e.includes(t)}}))}isAnySignerConfigured(){return!(this.signer instanceof s.NoopSigner)}clone(){return new E(this.rpc,this.signer,this.proto,this._config,this.forger,this._injector,this.packer,this._walletProvider,this._parser,this._globalConstantsProvider,this._readProvider,this._stream)}registerProviderDecorator(e){this.providerDecorator.push(e)}}t.Context=E},9676:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BigMapAbstraction=void 0;const i=r(2211);t.BigMapAbstraction=class{constructor(e,t,r){this.id=e,this.schema=t,this.provider=r}get(e,t){return n(this,void 0,void 0,(function*(){try{return yield this.provider.getBigMapKeyByID(this.id.toString(),e,this.schema,t)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getMultipleValues(e,t){return n(this,arguments,void 0,(function*(e,t,r=5){return this.provider.getBigMapKeysByID(this.id.toString(),e,this.schema,t,r)}))}toJSON(){return this.id.toString()}toString(){return this.id.toString()}}},3369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=function(e,t){return(r,n)=>t(e(r,n),n)}},1844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodFactory=void 0;const n=r(2291),i=r(1991),o=r(3085);t.ContractMethodFactory=class{constructor(e,t){this.provider=e,this.contractAddress=t}createContractMethodFlatParams(e,t,r,n=!0,o=!1){return new i.ContractMethod(this.provider,this.contractAddress,e,t,r,n,o)}createContractMethodObjectParam(e,t,r,i=!0,o=!1){return new n.ContractMethodObject(this.provider,this.contractAddress,e,t,r,i,o)}createContractViewObjectParam(e,t,r,n,i){return new o.OnChainView(e,t,this.contractAddress,r,n,i)}}},1991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethod=void 0;const n=r(1170),i=r(9339),o=r(9026);t.ContractMethod=class{constructor(e,t,r,n,i,o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}validateArgs(e,t,r){const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new o.InvalidParameterError(r,n,e)}get schema(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}getSignature(){if(!this.isAnonymous){const e=this.parameterSchema.ExtractSignatures();return 1==e.length?e[0]:e}{const e=this.parameterSchema.ExtractSignatures().find((e=>e[0]===this.name));if(e)return e.shift(),e}}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.Encode(this.name,...this.args):this.parameterSchema.Encode(...this.args)}}}}},4749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractMethodObject=void 0;const n=r(1170),i=r(9339);t.ContractMethodObject=class{constructor(e,t,r,n,i="unit",o=!0,s=!1){this.provider=e,this.address=t,this.parameterSchema=r,this.name=n,this.args=i,this.isMultipleEntrypoint=o,this.isAnonymous=s}getSignature(){return this.isAnonymous?this.parameterSchema.ExtractSchema()[this.name]:this.parameterSchema.ExtractSchema()}send(e={}){return this.provider instanceof n.Wallet?this.provider.transfer(this.toTransferParams(e)).send():this.provider.transfer(this.toTransferParams(e))}toTransferParams({fee:e,gasLimit:t,storageLimit:r,source:n,amount:o=0,mutez:s=!1}={}){return{to:this.address,amount:o,fee:e,mutez:s,source:n,gasLimit:t,storageLimit:r,parameter:{entrypoint:this.isMultipleEntrypoint?this.name:i.DEFAULT_SMART_CONTRACT_METHOD_NAME,value:this.isAnonymous?this.parameterSchema.EncodeObject({[this.name]:this.args}):this.parameterSchema.EncodeObject(this.args)}}}}},3085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OnChainView=void 0;const i=r(6209),o=r(9026),s=r(6571);t.OnChainView=class{constructor(e,t,r,n,i,o="Unit"){this._rpc=e,this._readProvider=t,this._contractAddress=r,this._smartContractViewSchema=n,this._contractStorageType=i,this._args=o}getSignature(){return{parameter:this._smartContractViewSchema.extractArgsSchema(),result:this._smartContractViewSchema.extractResultSchema()}}executeView(e){return n(this,void 0,void 0,(function*(){this.verifyContextExecution(e);const t=yield this._readProvider.getChainId(),r=this.transformArgsToMichelson(),n={contract:this._contractAddress,view:this._smartContractViewSchema.viewName,input:r,chain_id:t,source:e.viewCaller};return e.source&&(n.payer=e.source),this.executeViewAndDecodeResult(n)}))}verifyContextExecution(e){if(e.source&&(0,i.validateAddress)(e.source)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The source account who initialized the view execution is invalid: ${e.source}.`);if(!e.viewCaller||(0,i.validateAddress)(e.viewCaller)!==i.ValidationResult.VALID)throw new o.InvalidViewSimulationContext(`The contract which is the caller of view is invalid: ${e.viewCaller}.`)}transformArgsToMichelson(){try{return this._smartContractViewSchema.encodeViewArgs(this._args)}catch(e){throw new s.InvalidViewParameterError(this._smartContractViewSchema.viewName,this.getSignature(),this._args,e)}}adaptViewCodeToContext(e,t,r){const n={BALANCE:[{prim:"PUSH",args:[{prim:"mutez"},{int:r}]}],SENDER:[{prim:"PUSH",args:[{prim:"address"},{string:t}]}],SELF_ADDRESS:[{prim:"PUSH",args:[{prim:"address"},{string:this._contractAddress}]}],AMOUNT:[{prim:"PUSH",args:[{prim:"mutez"},{int:"0"}]}]};return e.forEach(((i,o)=>{i.prim in n&&(e[o]=Object(n)[i.prim]),i.args&&0!==i.args.length?this.adaptViewCodeToContext(i.args,t,r):Array.isArray(i)&&this.adaptViewCodeToContext(i,t,r)})),e}executeViewAndDecodeResult(e){return n(this,void 0,void 0,(function*(){let t;try{t=(yield this._rpc.runScriptView(e)).data}catch(e){const t=(0,o.validateAndExtractFailwith)(e);throw t?new o.ViewSimulationError(`The simulation of the on-chain view named ${this._smartContractViewSchema.viewName} failed with: ${JSON.stringify(t)}`,this._smartContractViewSchema.viewName,t,e):e}return this._smartContractViewSchema.decodeViewResult(t)}))}}},9339:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractAbstraction=t.ContractView=t.DEFAULT_SMART_CONTRACT_METHOD_NAME=void 0;const i=r(1157),o=r(6209),s=r(1844),a=r(9026),c=r(6571);t.DEFAULT_SMART_CONTRACT_METHOD_NAME="default";class u{constructor(e,t,r,n,i,o,s){this.currentContract=e,this.name=t,this.callbackParametersSchema=r,this.parameterSchema=n,this.args=i,this.rpc=o,this.readProvider=s}read(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateChain)(null!=e?e:"");if((0,o.validateContractAddress)(null!=e?e:"")==o.ValidationResult.VALID)throw new c.DeprecationError("Since version 12, the lambda view no longer depends on a lambda contract. The read method no longer accepts a contract address as a parameter.");if(e&&t!==o.ValidationResult.VALID)throw new c.InvalidChainIdError(e,(0,o.invalidDetail)(t));const r=this.parameterSchema.Encode(...this.args),n=yield this.rpc.runView({contract:this.currentContract.address,entrypoint:this.name,input:r,chain_id:e||(yield this.readProvider.getChainId())});return this.callbackParametersSchema.Execute(n.data)}))}}t.ContractView=u;t.ContractAbstraction=class{constructor(e,t,r,n,o,a,c){this.address=e,this.script=t,this.storageProvider=n,this.entrypoints=o,this.rpc=a,this.readProvider=c,this.methods={},this.methodsObject={},this.views={},this.contractViews={},this.contractMethodFactory=new s.ContractMethodFactory(r,e),this.schema=i.Schema.fromRPCResponse({script:this.script}),this.parameterSchema=i.ParameterSchema.fromRPCResponse({script:this.script}),this.viewSchema=i.ViewSchema.fromRPCResponse({script:this.script}),0!==this.viewSchema.length&&this._initializeOnChainViews(this,a,this.readProvider,this.viewSchema),this.eventSchema=i.EventSchema.fromRPCResponse({script:this.script}),this._initializeMethods(this,this.entrypoints.entrypoints,this.rpc,this.readProvider)}_initializeMethods(e,r,n,o){const s=this.parameterSchema,c=Object.keys(r);if(s.isMultipleEntryPoint){c.forEach((t=>{const s=new i.ParameterSchema(r[t]);if(this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r)},(e=>{let t=!1;if("prim"in e&&"pair"===e.prim&&e.args){const r=e.args[e.args.length-1];"prim"in r&&"contract"===r.prim&&(t=!0)}return t})(r[t])){const s=function(...s){const c=r[t].args[0],l=new i.ParameterSchema(c),d=r[t].args[1].args[0],f=new i.ParameterSchema(d);return((e,t,r)=>{const n=t.ExtractSignatures();if(!n.find((t=>t.length===e.length)))throw new a.InvalidParameterError(r,n,e)})(s,l,t),new u(e,t,f,l,s,n,o)};this.views[t]=s}}));Object.keys(s.ExtractSchema()).filter((e=>-1===Object.keys(r).indexOf(e))).forEach((t=>{this.methods[t]=function(...r){return e.contractMethodFactory.createContractMethodFlatParams(s,t,r,!1,!0)},this.methodsObject[t]=function(r){return e.contractMethodFactory.createContractMethodObjectParam(s,t,r,!1,!0)}}))}else{const r=this.parameterSchema;this.methods[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(...n){return e.contractMethodFactory.createContractMethodFlatParams(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)},this.methodsObject[t.DEFAULT_SMART_CONTRACT_METHOD_NAME]=function(n){return e.contractMethodFactory.createContractMethodObjectParam(r,t.DEFAULT_SMART_CONTRACT_METHOD_NAME,n,!1)}}}_initializeOnChainViews(e,t,r,n){const i=this.schema.val;n.forEach((n=>{this.contractViews[n.viewName]=function(o){return e.contractMethodFactory.createContractViewObjectParam(t,r,n,i,o)}}))}storage(){return this.storageProvider.getStorage(this.address,this.schema)}bigMap(e){return this.storageProvider.getBigMapKey(this.address,e,this.schema)}}},9026:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidBalanceError=t.OriginationParameterError=t.RevealOperationError=t.InvalidViewSimulationContext=t.validateAndExtractFailwith=t.ViewSimulationError=t.InvalidInitParameter=t.InvalidCodeParameter=t.InvalidDelegationSource=t.InvalidParameterError=void 0;const n=r(6571);class i extends n.ParameterValidationError{constructor(e,t,r){super(),this.smartContractMethodName=e,this.sigs=t,this.invalidParams=r,this.name="InvalidParameterError",this.message=`${e} Received ${r.length} arguments while expecting one of the following signatures (${JSON.stringify(t)})`}}t.InvalidParameterError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.source=e,this.name="InvalidDelegationSource",this.message=`Since Babylon delegation source can no longer be a contract address ${e}. Please use the smart contract abstraction to set your delegate.`}}t.InvalidDelegationSource=o;class s extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidCodeParameter"}}t.InvalidCodeParameter=s;class a extends n.ParameterValidationError{constructor(e,t){super(),this.message=e,this.data=t,this.name="InvalidInitParameter"}}t.InvalidInitParameter=a;class c extends n.RpcError{constructor(e,t,r,n){super(),this.message=e,this.viewName=t,this.failWith=r,this.cause=n,this.name="ViewSimulationError"}}t.ViewSimulationError=c;t.validateAndExtractFailwith=e=>{if(u(e.body)){const t=JSON.parse(e.body);if(Array.isArray(t)&&"with"in t[t.length-1])return t[t.length-1].with}};const u=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};class l extends n.ParameterValidationError{constructor(e){super(),this.info=e,this.name="InvalidViewSimulationContext",this.message=`${e} Please configure the context of the view execution in the executeView method.`}}t.InvalidViewSimulationContext=l;class d extends n.RpcError{constructor(e){super(),this.message=e,this.name="RevealOperationError"}}t.RevealOperationError=d;class f extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name}}t.OriginationParameterError=f;class h extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidBalanceError"}}t.InvalidBalanceError=h},2445:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.smartContractAbstractionSemantic=t.compose=void 0,i(r(9339),t),i(r(9026),t),i(r(1966),t),i(r(1752),t),i(r(2654),t),i(r(6200),t);var o=r(3369);Object.defineProperty(t,"compose",{enumerable:!0,get:function(){return o.compose}}),i(r(4749),t),i(r(1991),t),i(r(2291),t),i(r(3e3),t);var s=r(9281);Object.defineProperty(t,"smartContractAbstractionSemantic",{enumerable:!0,get:function(){return s.smartContractAbstractionSemantic}})},1966:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MANAGER_LAMBDA=void 0;t.MANAGER_LAMBDA={setDelegate:e=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"SOME"},{prim:"SET_DELEGATE"},{prim:"CONS"}],removeDelegate:()=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"NONE",args:[{prim:"key_hash"}]},{prim:"SET_DELEGATE"},{prim:"CONS"}],transferImplicit:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"key_hash"},{string:e}]},{prim:"IMPLICIT_ACCOUNT"},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}],transferToContract:(e,t)=>[{prim:"DROP"},{prim:"NIL",args:[{prim:"operation"}]},{prim:"PUSH",args:[{prim:"address"},{string:e}]},{prim:"CONTRACT",args:[{prim:"unit"}]},{prim:"IF_NONE",args:[[{prim:"UNIT"},{prim:"FAILWITH"}],[]]},{prim:"PUSH",args:[{prim:"mutez"},{int:`${t}`}]},{prim:"UNIT"},{prim:"TRANSFER_TOKENS"},{prim:"CONS"}]}},2654:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.createSmartRollupExecuteOutboxMessageOperation=t.createSmartRollupOriginateOperation=t.createSmartRollupAddMessagesOperation=t.createUpdateConsensusKeyOperation=t.createProposalsOperation=t.createBallotOperation=t.createDrainDelegateOperation=t.createIncreasePaidStorageOperation=t.createTransferTicketOperation=t.createRegisterGlobalConstantOperation=t.createRevealOperation=t.createRegisterDelegateOperation=t.createSetDelegateOperation=t.createTransferOperation=t.createOriginationOperation=t.createActivationOperation=void 0;const i=r(1157),o=r(9925),s=r(5283),a=r(6209),c=r(9026);t.createActivationOperation=e=>n(void 0,[e],void 0,(function*({pkh:e,secret:t}){return{kind:o.OpKind.ACTIVATION,pkh:e,secret:t}}));t.createOriginationOperation=e=>n(void 0,[e],void 0,(function*({code:e,init:t,balance:r="0",delegate:n,storage:s,fee:u,gasLimit:l,storageLimit:d,mutez:f=!1}){if(void 0!==s&&void 0!==t)throw new c.OriginationParameterError("Storage and Init cannot be set a the same time. Please either use storage or init but not both.");if(!Array.isArray(e))throw new c.InvalidCodeParameter("Wrong code parameter type, expected an array",e);let h;if(void 0!==s){const t=e.find((e=>"prim"in e&&"storage"===e.prim));if(void 0===(null==t?void 0:t.args))throw new c.InvalidCodeParameter("The storage section is missing from the script",e);h=new i.Schema(t.args[0]).Encode(s)}else{if(void 0===t||"object"!=typeof t)throw new c.InvalidInitParameter("Wrong init parameter type, expected JSON Michelson",t);h=t}const p={code:e,storage:h};if(isNaN(Number(r)))throw new c.InvalidBalanceError(`Invalid Balance "${r}", cannot be converted to a number`);const b={kind:o.OpKind.ORIGINATION,fee:u,gas_limit:l,storage_limit:d,balance:f?r.toString():(0,a.format)("tz","mutez",r).toString(),script:p};return n&&(b.delegate=n),b}));t.createTransferOperation=e=>n(void 0,[e],void 0,(function*({to:e,amount:t,parameter:r,fee:n,gasLimit:i,storageLimit:s,mutez:c=!1}){return{kind:o.OpKind.TRANSACTION,fee:n,gas_limit:i,storage_limit:s,amount:c?t.toString():(0,a.format)("tz","mutez",t).toString(),destination:e,parameters:r}}));t.createSetDelegateOperation=e=>n(void 0,[e],void 0,(function*({delegate:e,source:t,fee:r,gasLimit:n,storageLimit:i}){return{kind:o.OpKind.DELEGATION,source:t,fee:r,gas_limit:n,storage_limit:i,delegate:e}}));t.createRegisterDelegateOperation=(e,t)=>n(void 0,[e,t],void 0,(function*({fee:e,gasLimit:t,storageLimit:r},n){return{kind:o.OpKind.DELEGATION,fee:e,gas_limit:t,storage_limit:r,delegate:n}}));t.createRevealOperation=(e,t,r)=>n(void 0,[e,t,r],void 0,(function*({fee:e,gasLimit:t,storageLimit:r},n,i){return{kind:o.OpKind.REVEAL,fee:e,public_key:i,source:n,gas_limit:null!=t?t:(0,s.getRevealGasLimit)(n),storage_limit:r}}));t.createRegisterGlobalConstantOperation=e=>n(void 0,[e],void 0,(function*({value:e,source:t,fee:r,gasLimit:n,storageLimit:i}){return{kind:o.OpKind.REGISTER_GLOBAL_CONSTANT,value:e,fee:r,gas_limit:n,storage_limit:i,source:t}}));t.createTransferTicketOperation=e=>n(void 0,[e],void 0,(function*({ticketContents:e,ticketTy:t,ticketTicketer:r,ticketAmount:n,destination:i,entrypoint:s,source:a,fee:c,gasLimit:u,storageLimit:l}){return{kind:o.OpKind.TRANSFER_TICKET,fee:c,gas_limit:u,storage_limit:l,source:a,ticket_contents:e,ticket_ty:t,ticket_ticketer:r,ticket_amount:n,destination:i,entrypoint:s}}));t.createIncreasePaidStorageOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,amount:i,destination:s}){return{kind:o.OpKind.INCREASE_PAID_STORAGE,source:e,fee:t,gas_limit:r,storage_limit:n,amount:i,destination:s}}));t.createDrainDelegateOperation=e=>n(void 0,[e],void 0,(function*({consensus_key:e,delegate:t,destination:r}){return{kind:o.OpKind.DRAIN_DELEGATE,consensus_key:e,delegate:t,destination:r}}));t.createBallotOperation=e=>n(void 0,[e],void 0,(function*({source:e,proposal:t,ballot:r}){return{kind:o.OpKind.BALLOT,source:e,proposal:t,ballot:r}}));t.createProposalsOperation=e=>n(void 0,[e],void 0,(function*({source:e,proposals:t}){return{kind:o.OpKind.PROPOSALS,source:e,proposals:t}}));t.createUpdateConsensusKeyOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,pk:i}){return{kind:o.OpKind.UPDATE_CONSENSUS_KEY,source:e,fee:t,gas_limit:r,storage_limit:n,pk:i}}));t.createSmartRollupAddMessagesOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,message:i}){return{kind:o.OpKind.SMART_ROLLUP_ADD_MESSAGES,source:e,fee:t,gas_limit:r,storage_limit:n,message:i}}));t.createSmartRollupOriginateOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,pvmKind:i,kernel:s,parametersType:a}){return{kind:o.OpKind.SMART_ROLLUP_ORIGINATE,source:e,fee:t,gas_limit:r,storage_limit:n,pvm_kind:i,kernel:s,parameters_ty:a}}));t.createSmartRollupExecuteOutboxMessageOperation=e=>n(void 0,[e],void 0,(function*({source:e,fee:t,gasLimit:r,storageLimit:n,rollup:i,cementedCommitment:s,outputProof:a}){return{kind:o.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE,source:e,fee:t,gas_limit:r,storage_limit:n,rollup:i,cemented_commitment:s,output_proof:a}}))},3995:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcContractProvider=void 0;const i=r(2211),o=r(1157),s=r(9925),a=r(6209),c=r(6571),u=r(5025),l=r(4410),d=r(2526),f=r(6759),h=r(4368),p=r(2741),b=r(9339),m=r(9026),g=r(9281),v=r(4371),y=r(1660),_=r(659),E=r(8835),w=r(5574),O=r(2552),A=r(3118),S=r(408),P=r(5185),T=r(5605),R=r(3682);class I extends T.Provider{constructor(e,t){super(e),this.estimator=t,this.contractProviderTypeSymbol=Symbol.for("taquito-contract-provider-type-symbol"),this.prepare=new R.PrepareProvider(this.context)}getStorage(e,t){return n(this,void 0,void 0,(function*(){const r=(0,a.validateContractAddress)(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,(0,a.invalidDetail)(r));const n=yield this.context.readProvider.getScript(e,"head");let i;return t||(t=n),i=o.Schema.isSchema(t)?t:o.Schema.fromRPCResponse({script:t}),i.Execute(n.storage,(0,g.smartContractAbstractionSemantic)(this))}))}getBigMapKey(e,t,r){return n(this,void 0,void 0,(function*(){const n=(0,a.validateContractAddress)(e);if(n!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,(0,a.invalidDetail)(n));let i;r||(r=(yield this.rpc.getContract(e)).script),i=o.Schema.isSchema(r)?r:o.Schema.fromRPCResponse({script:r});const s=i.EncodeBigMapKey(t),u=yield this.rpc.getBigMapKey(e,s);return i.ExecuteOnBigMapValue(u)}))}getBigMapKeyByID(e,t,r,i){return n(this,void 0,void 0,(function*(){const{key:n,type:o}=r.EncodeBigMapKey(t),{packed:s}=yield this.context.packer.packData({data:n,type:o}),c=(0,a.encodeExpr)(s),u=i?yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},i):yield this.context.readProvider.getBigMapValue({id:e.toString(),expr:c},"head");return r.ExecuteOnBigMapValue(u,(0,g.smartContractAbstractionSemantic)(this))}))}getBigMapKeysByID(e,t,r,i){return n(this,arguments,void 0,(function*(e,t,r,n,i=5){const s=yield this.getBlockForRequest(t,n),a=new o.MichelsonMap;let c=0,u=[];for(;c<t.length;){const n=t.slice(c,c+i).map((t=>this.getBigMapValueOrUndefined(t,e,r,s)));u=[...u,...yield Promise.all(n)],c+=i}for(let e=0;e<u.length;e++)a.set(t[e],u[e]);return a}))}getBlockForRequest(e,t){return n(this,void 0,void 0,(function*(){return 1===e.length||void 0!==t?t:yield this.context.readProvider.getBlockLevel("head")}))}getBigMapValueOrUndefined(e,t,r,o){return n(this,void 0,void 0,(function*(){try{return yield this.getBigMapKeyByID(t,e,r,o)}catch(e){if(e instanceof i.HttpResponseError&&e.status===i.STATUS_CODE.NOT_FOUND)return;throw e}}))}getSaplingDiffByID(e,t){return n(this,void 0,void 0,(function*(){return t?yield this.context.readProvider.getSaplingDiffById({id:e.toString()},t):yield this.context.readProvider.getSaplingDiffById({id:e.toString()},"head")}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.originate.bind(this.estimator)),r=yield this.prepare.originate(Object.assign(Object.assign({},e),t)),n=r.opOb.contents.find((e=>e.kind===s.OpKind.ORIGINATION)),i=yield this.forge(r),{hash:o,context:a,forgedBytes:c,opResponse:u}=yield this.signAndInject(i);return new d.OriginationOperation(o,n,c,u,a,this)}))}setDelegate(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(e.source);if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));const n=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.delegate,(0,a.invalidDetail)(n));if(/kt1/i.test(e.source))throw new m.InvalidDelegationSource(e.source);const i=yield this.signer.publicKeyHash(),o=e.source||i,u=yield this.estimate(e,this.estimator.setDelegate.bind(this.estimator)),d=yield this.prepare.delegation(Object.assign(Object.assign({},e),u)),f=d.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),h=yield this.forge(d),{hash:p,context:b,forgedBytes:g,opResponse:v}=yield this.signAndInject(h);return new l.DelegateOperation(p,f,o,g,v,b)}))}registerDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.estimate(e,this.estimator.registerDelegate.bind(this.estimator)),r=yield this.signer.publicKeyHash(),n=yield this.prepare.registerDelegate(Object.assign(Object.assign({},e),t)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.DELEGATION)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:d}=yield this.signAndInject(o);return new l.DelegateOperation(a,i,r,u,d,c)}))}transfer(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(e.to);if(r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.to,(0,a.invalidDetail)(r));const n=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(n));if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const i=yield this.signer.publicKeyHash(),o=yield this.estimate(e,this.estimator.transfer.bind(this.estimator)),u=e.source||i,l=yield this.prepare.transaction(Object.assign(Object.assign({},e),o)),d=l.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),f=yield this.forge(l),{hash:h,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(f);return new p.TransactionOperation(h,d,u,m,g,b)}))}stake(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));if(e.to||(e.to=e.source),e.to&&e.to!==e.source)throw new c.InvalidStakingAddressError(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const n=yield this.signer.publicKeyHash(),i=yield this.estimate(e,this.estimator.stake.bind(this.estimator)),o=e.source||n,u=yield this.prepare.stake(Object.assign(Object.assign({},e),i)),l=u.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:b,opResponse:m}=yield this.signAndInject(d);return new p.TransactionOperation(f,l,o,b,m,h)}))}unstake(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));if(e.to||(e.to=e.source),e.to&&e.to!==e.source)throw new c.InvalidStakingAddressError(e.to);if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const n=yield this.signer.publicKeyHash(),i=yield this.estimate(e,this.estimator.unstake.bind(this.estimator)),o=e.source||n,u=yield this.prepare.unstake(Object.assign(Object.assign({},e),i)),l=u.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:b,opResponse:m}=yield this.signAndInject(d);return new p.TransactionOperation(f,l,o,b,m,h)}))}finalizeUnstake(e){return n(this,void 0,void 0,(function*(){var t;const r=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&r!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(r));if(e.to||(e.to=e.source),e.to&&e.to!==e.source)throw new c.InvalidStakingAddressError(e.to);if(e.amount||(e.amount=0),void 0!==e.amount&&e.amount>0)throw new c.InvalidFinalizeUnstakeAmountError("Amount must be 0 to finalize unstake.");const n=yield this.signer.publicKeyHash(),i=yield this.estimate(e,this.estimator.finalizeUnstake.bind(this.estimator)),o=e.source||n,u=yield this.prepare.finalizeUnstake(Object.assign(Object.assign({},e),i)),l=u.opOb.contents.find((e=>e.kind===s.OpKind.TRANSACTION)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:b,opResponse:m}=yield this.signAndInject(d);return new p.TransactionOperation(f,l,o,b,m,h)}))}transferTicket(e){return n(this,void 0,void 0,(function*(){var t,r;const n=(0,a.validateAddress)(e.destination);if(n!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.destination,(0,a.invalidDetail)(n));const i=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(i));const o=yield this.signer.publicKeyHash(),u=null!==(r=e.source)&&void 0!==r?r:o,l=yield this.estimate(e,this.estimator.transferTicket.bind(this.estimator)),d=yield this.prepare.transferTicket(Object.assign(Object.assign({},e),l)),f=d.opOb.contents.find((e=>e.kind===s.OpKind.TRANSFER_TICKET)),h=yield this.forge(d),{hash:p,context:b,forgedBytes:m,opResponse:g}=yield this.signAndInject(h);return new v.TransferTicketOperation(p,f,u,m,g,b)}))}reveal(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimator.reveal(e);if(r){const i=yield this.estimate(e,(()=>n(this,void 0,void 0,(function*(){return r})))),o=yield this.prepare.reveal(Object.assign(Object.assign({},e),i)),a=o.opOb.contents.find((e=>e.kind===s.OpKind.REVEAL)),c=yield this.forge(o),{hash:u,context:l,forgedBytes:d,opResponse:f}=yield this.signAndInject(c);return new h.RevealOperation(u,a,t,d,f,l)}throw new m.RevealOperationError(`The publicKeyHash '${t}' has already been revealed.`)}))}registerGlobalConstant(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.registerGlobalConstant.bind(this.estimator)),n=yield this.prepare.registerGlobalConstant(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.REGISTER_GLOBAL_CONSTANT)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new f.RegisterGlobalConstantOperation(a,i,t,u,l,c)}))}increasePaidStorage(e){return n(this,void 0,void 0,(function*(){if(e.amount<0)throw new c.InvalidAmountError(e.amount.toString());const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.increasePaidStorage.bind(this.estimator)),n=yield this.prepare.increasePaidStorage(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.INCREASE_PAID_STORAGE)),o=yield this.forge(n),{hash:a,context:u,forgedBytes:l,opResponse:d}=yield this.signAndInject(o);return new y.IncreasePaidStorageOperation(a,i,t,l,d,u)}))}drainDelegate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.drainDelegate(e),r=t.opOb.contents.find((e=>e.kind===s.OpKind.DRAIN_DELEGATE)),n=yield this.forge(t),{hash:i,context:o,forgedBytes:a,opResponse:c}=yield this.signAndInject(n);return new E.DrainDelegateOperation(i,r,a,c,o)}))}ballot(e){return n(this,void 0,void 0,(function*(){var t,r;const n=yield this.signer.publicKeyHash(),i=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.ballot(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.BALLOT)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(d);return new _.BallotOperation(f,l,n,p,b,h)}))}proposals(e){return n(this,void 0,void 0,(function*(){var t,r;const n=yield this.signer.publicKeyHash(),i=(0,a.validateAddress)(null!==(t=e.source)&&void 0!==t?t:"");if(e.source&&i!==a.ValidationResult.VALID)throw new c.InvalidAddressError(e.source,(0,a.invalidDetail)(i));const o=null!==(r=e.source)&&void 0!==r?r:n,u=yield this.prepare.proposals(Object.assign(Object.assign({},e),{source:o})),l=u.opOb.contents.find((e=>e.kind===s.OpKind.PROPOSALS)),d=yield this.forge(u),{hash:f,context:h,forgedBytes:p,opResponse:b}=yield this.signAndInject(d);return new w.ProposalsOperation(f,l,n,p,b,h)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.updateConsensusKey.bind(this.estimator)),n=yield this.prepare.updateConsensusKey(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.UPDATE_CONSENSUS_KEY)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new O.UpdateConsensusKeyOperation(a,i,t,u,l,c)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupAddMessages.bind(this.estimator)),n=yield this.prepare.smartRollupAddMessages(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ADD_MESSAGES)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new A.SmartRollupAddMessagesOperation(a,i,t,u,l,c)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupOriginate.bind(this.estimator)),n=yield this.prepare.smartRollupOriginate(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_ORIGINATE)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new S.SmartRollupOriginateOperation(a,i,t,u,l,c)}))}smartRollupExecuteOutboxMessage(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.publicKeyHash(),r=yield this.estimate(e,this.estimator.smartRollupExecuteOutboxMessage.bind(this.estimator)),n=yield this.prepare.smartRollupExecuteOutboxMessage(Object.assign(Object.assign({},e),r)),i=n.opOb.contents.find((e=>e.kind===s.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE)),o=yield this.forge(n),{hash:a,context:c,forgedBytes:u,opResponse:l}=yield this.signAndInject(o);return new P.SmartRollupExecuteOutboxMessageOperation(a,i,t,u,l,c)}))}failingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]}),{prefixSig:i}=yield this.signer.sign(n,new Uint8Array([3]));return{signature:i,bytes:n,signedContent:{branch:r,contents:[{kind:s.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}at(e){return n(this,arguments,void 0,(function*(e,t=e=>e){const r=(0,a.validateContractAddress)(e);if(r!==a.ValidationResult.VALID)throw new c.InvalidContractAddressError(e,(0,a.invalidDetail)(r));const n=this.context.withExtensions().rpc,i=this.context.withExtensions().readProvider,o=yield i.getScript(e,"head"),s=yield i.getEntrypoints(e);return t(new b.ContractAbstraction(e,o,this,this,s,n,i),this.context)}))}batch(e){const t=new u.OperationBatch(this.context,this.estimator);return Array.isArray(e)&&t.with(e),t}}t.RpcContractProvider=I},3e3:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SaplingStateAbstraction=void 0;t.SaplingStateAbstraction=class{constructor(e,t){this.id=e,this.provider=t}getSaplingDiff(e){return r(this,void 0,void 0,(function*(){return this.provider.getSaplingDiffByID(this.id.toString(),e)}))}getId(){return this.id.toString()}}},9281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smartContractAbstractionSemantic=void 0;const n=r(1157),i=r(9676),o=r(5553),s=r(3e3);t.smartContractAbstractionSemantic=e=>({big_map:(t,r)=>{if(t&&"int"in t&&void 0!==t.int){const s=new n.Schema(r);return new i.BigMapAbstraction(new o.default(t.int),s,e)}return{}},sapling_state:t=>t&&"int"in t&&void 0!==t.int?new s.SaplingStateAbstraction(new o.default(t.int),e):{}})},6200:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_LAMBDA=void 0;t.VIEW_LAMBDA={code:[{prim:"parameter",args:[{prim:"lambda",args:[{prim:"unit"},{prim:"pair",args:[{prim:"list",args:[{prim:"operation"}]},{prim:"unit"}]}]}]},{prim:"storage",args:[{prim:"unit"}]},{prim:"code",args:[[{prim:"CAR"},{prim:"UNIT"},{prim:"EXEC"}]]}],storage:"Unit"}},4359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RPCResponseError=t.ConfirmationTimeoutError=t.InvalidConfirmationCountError=void 0;const n=r(6571);class i extends n.ParameterValidationError{constructor(e){super(),this.invalidConfirmations=e,this.name="InvalidConfirmationCountError",this.message=`Invalid confirmation count ${e} expecting at least 1`}}t.InvalidConfirmationCountError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ConfirmationTimeoutError"}}t.ConfirmationTimeoutError=o;class s extends n.RpcError{constructor(e,t){super(),this.message=e,this.cause=t,this.name="RPCResponseError"}}t.RPCResponseError=s},8710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealEstimateError=void 0;const n=r(6571);class i extends n.TaquitoError{constructor(){super(),this.name="RevealEstimateError",this.message="Public key is unknown, unable to estimate the reveal operation in Wallet API."}}t.RevealEstimateError=i},1263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3771:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Estimate=void 0;const r=100;class n{constructor(e,t,r,n,i=100){this._milligasLimit=e,this._storageLimit=t,this.opSize=r,this.minimalFeePerStorageByteMutez=n,this.baseFeeMutez=i}get burnFeeMutez(){return this.roundUp(Number(this.storageLimit)*Number(this.minimalFeePerStorageByteMutez))}get storageLimit(){return Math.max(Number(this._storageLimit),0)}get gasLimit(){return this.roundUp(Number(this._milligasLimit)/1e3)}get operationFeeMutez(){return.1*this.gasLimit+1*Number(this.opSize)}roundUp(e){return Math.ceil(Number(e))}get minimalFeeMutez(){return this.roundUp(this.operationFeeMutez+r)}get suggestedFeeMutez(){return this.roundUp(this.operationFeeMutez+120)}get usingBaseFeeMutez(){return Math.max(Number(this.baseFeeMutez),r)+this.roundUp(this.operationFeeMutez)}get totalCost(){return this.minimalFeeMutez+this.burnFeeMutez}get consumedMilligas(){return Number(this._milligasLimit)}static createEstimateInstanceFromProperties(e){let t,r=0,i=0,o=0,s=0;return e.forEach((e=>{r+=e.milligasLimit,i+=e.storageLimit,o+=e.opSize,s=Math.max(e.minimalFeePerStorageByteMutez,s),e.baseFeeMutez&&(t=t?t+e.baseFeeMutez:e.baseFeeMutez)})),new n(r,i,o,s,t)}static createArrayEstimateInstancesFromProperties(e){return e.map((e=>new n(e.milligasLimit,e.storageLimit,e.opSize,e.minimalFeePerStorageByteMutez,e.baseFeeMutez)))}}t.Estimate=n},5681:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3771),t),i(r(1263),t),i(r(4019),t),i(r(8710),t)},4019:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.RPCEstimateProvider=void 0;const o=r(286),s=r(6568),a=r(3771),c=r(6209),u=r(8710),l=r(5605),d=r(7583),f=r(6571);class h extends l.Provider{constructor(){super(...arguments),this.OP_SIZE_REVEAL=324,this.MILLIGAS_BUFFER=1e5,this.STORAGE_BUFFER=20,this.prepare=new d.PrepareProvider(this.context)}getKeys(){return n(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{publicKeyHash:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}getEstimationPropertiesFromOperationContent(e,t,r,n){const i=(0,o.flattenOperationResult)({contents:[e]});let a=0,c=0;return i.forEach((e=>{a+=Number(e.consumed_milligas)||0,c+="allocated_destination_contract"in e?n:0,c+="originated_contracts"in e&&Array.isArray(e.originated_contracts)?e.originated_contracts.length*n:0,c+="storage_size"in e&&"global_address"in e&&Number(e.storage_size)||0,c+="paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0,c+="genesis_commitment_hash"in e&&Number(e.size)||0})),(0,s.isOpWithFee)(e)?{milligasLimit:(0,s.isOpWithGasBuffer)(e)?a+Number(this.MILLIGAS_BUFFER):a,storageLimit:c>0?c+this.STORAGE_BUFFER:0,opSize:t,minimalFeePerStorageByteMutez:r.toNumber()}:{milligasLimit:0,storageLimit:0,opSize:t,minimalFeePerStorageByteMutez:r.toNumber(),baseFeeMutez:0}}calculateEstimates(e,t){return n(this,void 0,void 0,(function*(){const{opbytes:r,opOb:{branch:n,contents:i}}=yield this.forge(e),s={operation:{branch:n,contents:i,signature:"edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg"},chain_id:yield this.context.readProvider.getChainId()},{opResponse:a}=yield this.simulate(s),{cost_per_byte:c,origination_size:u}=t,l=[...(0,o.flattenErrors)(a,"backtracked"),...(0,o.flattenErrors)(a)];if(l.length)throw new o.TezosOperationError(l,"Error occurred during estimation",a.contents);let d=1;return Array.isArray(e.opOb.contents)&&e.opOb.contents.length>1&&(d="reveal"===a.contents[0].kind?e.opOb.contents.length-1:e.opOb.contents.length),a.contents.map((e=>this.getEstimationPropertiesFromOperationContent(e,"reveal"===e.kind?this.OP_SIZE_REVEAL/2:(r.length+130)/2/d,c,null!=u?u:257)))}))}originate(e){return n(this,void 0,void 0,(function*(){const t=yield this.prepare.originate(e),r=yield this.context.readProvider.getProtocolConstants("head"),n=yield this.calculateEstimates(t,r);return"reveal"===t.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}transfer(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(s.to);if(u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.to,(0,c.invalidDetail)(u));const l=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&l!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(l));if(s.amount<0)throw new f.InvalidAmountError(s.amount.toString());const d=yield this.prepare.transaction(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),h=yield this.context.readProvider.getProtocolConstants("head"),p=yield this.calculateEstimates(d,h);return"reveal"===d.opOb.contents[0].kind&&(p.shift(),p[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(p)}))}stake(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));if(s.to||(s.to=s.source),s.to&&s.to!==s.source)throw new f.InvalidStakingAddressError(s.to);if(s.amount<0)throw new f.InvalidAmountError(s.amount.toString());const l=yield this.prepare.stake(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.calculateEstimates(l,d);return"reveal"===l.opOb.contents[0].kind&&(h.shift(),h[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(h)}))}unstake(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));if(s.to||(s.to=s.source),s.to&&s.to!==s.source)throw new f.InvalidStakingAddressError(s.to);if(s.amount<0)throw new f.InvalidAmountError(s.amount.toString());const l=yield this.prepare.unstake(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.calculateEstimates(l,d);return"reveal"===l.opOb.contents[0].kind&&(h.shift(),h[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(h)}))}finalizeUnstake(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));if(s.to||(s.to=s.source),s.to&&s.to!==s.source)throw new f.InvalidStakingAddressError(s.to);if(s.amount||(s.amount=0),void 0!==s.amount&&0!==s.amount)throw new Error("Amount must be 0 for finalize_unstake operation");const l=yield this.prepare.finalizeUnstake(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.calculateEstimates(l,d);return"reveal"===l.opOb.contents[0].kind&&(h.shift(),h[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(h)}))}transferTicket(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const u=(0,c.validateAddress)(s.destination);if(u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.destination,(0,c.invalidDetail)(u));const l=(0,c.validateAddress)(null!==(t=s.source)&&void 0!==t?t:"");if(s.source&&l!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(l));const d=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.prepare.transferTicket(Object.assign({fee:r,storageLimit:n,gasLimit:o},s)),p=yield this.calculateEstimates(h,d);return"reveal"===h.opOb.contents[0].kind&&(p.shift(),p[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(p)}))}setDelegate(e){return n(this,void 0,void 0,(function*(){var t,{fee:r,gasLimit:n,storageLimit:o}=e,s=i(e,["fee","gasLimit","storageLimit"]);const u=(0,c.validateAddress)(s.source);if(s.source&&u!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.source,(0,c.invalidDetail)(u));const l=(0,c.validateAddress)(null!==(t=s.delegate)&&void 0!==t?t:"");if(s.delegate&&l!==c.ValidationResult.VALID)throw new f.InvalidAddressError(s.delegate,(0,c.invalidDetail)(l));const d=yield this.prepare.delegation(Object.assign({fee:r,storageLimit:o,gasLimit:n},s)),h=yield this.context.readProvider.getProtocolConstants("head"),p=yield this.calculateEstimates(d,h);return"reveal"===d.opOb.contents[0].kind&&(p.shift(),p[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(p)}))}batch(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.batch(e),n=yield this.calculateEstimates(r,t);return a.Estimate.createArrayEstimateInstancesFromProperties(n)}))}registerDelegate(e,t){return n(this,void 0,void 0,(function*(){var{fee:r,storageLimit:n,gasLimit:o}=e,s=i(e,["fee","storageLimit","gasLimit"]);const c=(yield this.getKeys()).publicKeyHash,u=yield this.context.readProvider.getProtocolConstants("head"),l=t||c,d=yield this.prepare.registerDelegate(Object.assign({fee:r,storageLimit:n,gasLimit:o},s),l),f=yield this.calculateEstimates(d,u);return"reveal"===d.opOb.contents[0].kind&&(f.shift(),f[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(f)}))}reveal(e){return n(this,void 0,void 0,(function*(){const{publicKeyHash:t,publicKey:r}=yield this.getKeys();if(!r)throw new u.RevealEstimateError;if(yield this.isAccountRevealRequired(t)){const t=yield this.context.readProvider.getProtocolConstants("head"),r=e?yield this.prepare.reveal(e):yield this.prepare.reveal({}),n=yield this.calculateEstimates(r,t);return a.Estimate.createEstimateInstanceFromProperties(n)}}))}registerGlobalConstant(e){return n(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:n}=e,o=i(e,["fee","storageLimit","gasLimit"]);const s=yield this.prepare.registerGlobalConstant(Object.assign({fee:t,storageLimit:r,gasLimit:n},o)),c=yield this.context.readProvider.getProtocolConstants("head"),u=yield this.calculateEstimates(s,c);return"reveal"===s.opOb.contents[0].kind&&(u.shift(),u[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(u)}))}increasePaidStorage(e){return n(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:n}=e,o=i(e,["fee","storageLimit","gasLimit"]);if(o.amount<0)throw new f.InvalidAmountError(o.amount.toString());const s=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.prepare.increasePaidStorage(Object.assign({fee:t,storageLimit:r,gasLimit:n},o)),u=yield this.calculateEstimates(c,s);return"reveal"===c.opOb.contents[0].kind&&(u.shift(),u[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(u)}))}updateConsensusKey(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.updateConsensusKey(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupAddMessages(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupAddMessages(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupOriginate(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupOriginate(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}smartRollupExecuteOutboxMessage(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.smartRollupExecuteOutboxMessage(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&n.shift(),a.Estimate.createEstimateInstanceFromProperties(n)}))}contractCall(e){return n(this,void 0,void 0,(function*(){const t=yield this.context.readProvider.getProtocolConstants("head"),r=yield this.prepare.contractCall(e),n=yield this.calculateEstimates(r,t);return"reveal"===r.opOb.contents[0].kind&&(n.shift(),n[0].opSize-=this.OP_SIZE_REVEAL/2),a.Estimate.createEstimateInstanceFromProperties(n)}))}}t.RPCEstimateProvider=h},3215:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeForger=void 0;const i=r(8681);t.CompositeForger=class{constructor(e){if(this.forgers=e,0===e.length)throw new i.UnspecifiedForgerError}forge(e){return n(this,arguments,void 0,(function*({branch:e,contents:t}){const r=yield Promise.all(this.forgers.map((r=>r.forge({branch:e,contents:t}))));if(0===r.length)throw new i.UnspecifiedForgerError;let n=r.pop();for(;r.length;){const e=r.pop();if(e!==n)throw new i.ForgingMismatchError([n,e]);n=e}return n}))}}},8681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnspecifiedForgerError=t.ForgingMismatchError=void 0;const n=r(6571);class i extends n.TaquitoError{constructor(e){super(),this.results=e,this.name="ForgingMismatchError",this.message="Forging mismatch error"}}t.ForgingMismatchError=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnspecifiedForgerError",this.message="No forger has been configured. Please configure new CompositeForger([rpcForger, localForger]) with your TezosToolkit instance."}}t.UnspecifiedForgerError=o},9719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcForger=void 0;t.RpcForger=class{constructor(e){this.context=e}forge({branch:e,contents:t}){return this.context.rpc.forgeOperations({branch:e,contents:t})}}},6343:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TaquitoLocalForger=void 0;const i=r(9971);t.TaquitoLocalForger=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}forge(e){return n(this,arguments,void 0,(function*({branch:e,contents:t}){return new i.LocalForger(yield this.getNextProto()).forge({branch:e,contents:t})}))}}},7771:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGlobalConstantsProvider=void 0;const i=r(9185);t.DefaultGlobalConstantsProvider=class{constructor(){this._globalConstantsLibrary={}}loadGlobalConstant(e){for(const t in e)Object.assign(this._globalConstantsLibrary,{[t]:e[t]})}getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){const t=this._globalConstantsLibrary[e];if(!t)throw new i.GlobalConstantNotFound(e);return t}))}}},9185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredGlobalConstantsProviderError=t.GlobalConstantNotFound=void 0;const n=r(6571);class i extends n.TaquitoError{constructor(e){super(),this.hash=e,this.name="GlobalConstantNotFound",this.message=`Please load the value associated with the constant ${e} using the loadGlobalConstant method of the DefaultGlobalConstantsProvider.`}}t.GlobalConstantNotFound=i;class o extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredGlobalConstantsProviderError",this.message="No global constants provider has been configured. Please configure one by calling setGlobalConstantsProvider({globalConstantsProvider}) on your TezosToolkit instance."}}t.UnconfiguredGlobalConstantsProviderError=o},7157:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8320:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopGlobalConstantsProvider=void 0;const i=r(9185);t.NoopGlobalConstantsProvider=class{getGlobalConstantByHash(e){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredGlobalConstantsProviderError}))}}},5299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatErrorMessage=function(e,t){const r=JSON.parse(e.body);if(r[0]&&r[0].kind&&r[0].msg){const i=JSON.stringify({kind:r[0].kind,id:r[0].id,msg:r[0].msg.replace(t,"")});return new n.HttpResponseError(`Http error response: (${e.status}) ${i}`,e.status,e.statusText,i,e.url)}return e};const n=r(2211)},9164:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2245:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcInjector=void 0;const i=r(5299),o=r(2211);t.RpcInjector=class{constructor(e){this.context=e}inject(e){return n(this,void 0,void 0,(function*(){let t;try{t=yield this.context.rpc.injectOperation(e)}catch(e){const t=". You may want to use --replace to provide adequate fee and replace it";throw e instanceof o.HttpResponseError&&e.message.includes(t)?(0,i.formatErrorMessage)(e,t):e}return t}))}}},659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BallotOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"ballot"===e.kind));return e||void 0}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}get proposal(){return this.params.proposal}get ballot(){return this.params.ballot}}t.BallotOperation=i},7669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BatchOperation=void 0;const n=r(5553),i=r(5025),o=r(286),s=r(1859),a=r(6568);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}getOriginatedContractAddresses(){const e=this.results.filter((e=>"origination"===e.kind));let t=[];for(const r of e)r.metadata.operation_result.originated_contracts&&(t=[...t,...r.metadata.operation_result.originated_contracts]);return t}get status(){return this.results.filter((e=>-1!==i.BATCH_KINDS.indexOf(e.kind))).map((e=>{if((0,a.hasMetadataWithResult)(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown"}get fee(){return this.sumProp(this.params,"fee")}get gasLimit(){return this.sumProp(this.params,"gas_limit")}get storageLimit(){return this.sumProp(this.params,"storage_limit")}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp((0,o.flattenOperationResult)({contents:this.results}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp((0,o.flattenOperationResult)({contents:this.results}),"paid_storage_size_diff"))}get errors(){return(0,o.flattenErrors)({contents:this.results})}}t.BatchOperation=c},4410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateOperation=void 0;const n=r(5553),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"delegation"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get delegate(){return this.params.delegate}get isRegisterOperation(){return this.delegate===this.source}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.DelegateOperation=o},8835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DrainDelegateOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i){super(e,r,n,i),this.params=t}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"drain_delegate"===e.kind)),t=e&&e.metadata&&e.metadata.balance_updates;return t||void 0}get consensusKey(){return this.params.consensus_key}get delegate(){return this.params.delegate}get destination(){return this.params.destination}}t.DrainDelegateOperation=i},286:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidEstimateValueError=t.OriginationOperationError=t.flattenErrors=t.flattenOperationResult=t.TezosPreapplyFailureError=t.TezosOperationError=void 0;const n=r(6571),i=r(6568);class o extends n.RpcError{constructor(e,t,r){super(),this.errors=e,this.errorDetails=t,this.operationsWithResults=r,this.name="TezosOperationError",this.lastError=e[e.length-1],this.message=`(${this.kind}) ${this.id}`,"with"in this.lastError&&(this.lastError.with.string?this.message=this.lastError.with.string:this.lastError.with.int?this.message=this.lastError.with.int:this.message=JSON.stringify(this.lastError.with))}get id(){return this.lastError.id}get kind(){return this.lastError.kind}}t.TezosOperationError=o;class s extends Error{constructor(e){super(),this.result=e,this.name="TezosPreapplyFailureError",this.message="Preapply returned an unexpected result"}}t.TezosPreapplyFailureError=s;t.flattenOperationResult=e=>{const t=Array.isArray(e)?e:[e],r=[];for(let e=0;e<t.length;e++)for(let n=0;n<t[e].contents.length;n++){const o=t[e].contents[n];(0,i.hasMetadataWithResult)(o)&&"fee"in o&&(r.push(Object.assign({fee:o.fee},o.metadata.operation_result)),Array.isArray(o.metadata.internal_operation_results)&&o.metadata.internal_operation_results.forEach((e=>r.push(e.result))))}return r};t.flattenErrors=(e,t="failed")=>{const r=Array.isArray(e)?e:[e];let n=[];for(let e=0;e<r.length;e++)for(let o=0;o<r[e].contents.length;o++){const s=r[e].contents[o];if((0,i.hasMetadata)(s)&&((0,i.hasMetadataWithResult)(s)&&s.metadata.operation_result.status===t&&(n=n.concat(s.metadata.operation_result.errors||[])),(0,i.hasMetadataWithInternalOperationResult)(s)&&Array.isArray(s.metadata.internal_operation_results)))for(const e of s.metadata.internal_operation_results)"result"in e&&e.result.status===t&&(n=n.concat(e.result.errors||[]))}return n};class a extends n.TaquitoError{constructor(e){super(),this.message=e,this.name="OriginationOperationError"}}t.OriginationOperationError=a;class c extends n.ParameterValidationError{constructor(e){super(),this.message=e,this.name="InvalidEstimateValueError"}}t.InvalidEstimateValueError=c},1660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"increase_paid_storage"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get amount(){return this.params.amount}get destination(){return this.params.destination}}t.IncreasePaidStorageOperation=i},105:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.RevealOperation=t.ProposalsOperation=t.DrainDelegateOperation=t.BallotOperation=t.SmartRollupOriginateOperation=t.SmartRollupAddMessagesOperation=t.UpdateConsensusKeyOperation=t.TransferTicketOperation=t.IncreasePaidStorageOperation=t.RegisterGlobalConstantOperation=t.TransactionOperation=t.DelegateOperation=t.OriginationOperation=t.BatchOperation=t.InvalidEstimateValueError=t.TezosPreapplyFailureError=t.TezosOperationError=void 0,i(r(6568),t);var o=r(286);Object.defineProperty(t,"TezosOperationError",{enumerable:!0,get:function(){return o.TezosOperationError}}),Object.defineProperty(t,"TezosPreapplyFailureError",{enumerable:!0,get:function(){return o.TezosPreapplyFailureError}}),Object.defineProperty(t,"InvalidEstimateValueError",{enumerable:!0,get:function(){return o.InvalidEstimateValueError}});var s=r(7669);Object.defineProperty(t,"BatchOperation",{enumerable:!0,get:function(){return s.BatchOperation}});var a=r(2526);Object.defineProperty(t,"OriginationOperation",{enumerable:!0,get:function(){return a.OriginationOperation}});var c=r(4410);Object.defineProperty(t,"DelegateOperation",{enumerable:!0,get:function(){return c.DelegateOperation}});var u=r(2741);Object.defineProperty(t,"TransactionOperation",{enumerable:!0,get:function(){return u.TransactionOperation}});var l=r(6759);Object.defineProperty(t,"RegisterGlobalConstantOperation",{enumerable:!0,get:function(){return l.RegisterGlobalConstantOperation}});var d=r(1660);Object.defineProperty(t,"IncreasePaidStorageOperation",{enumerable:!0,get:function(){return d.IncreasePaidStorageOperation}});var f=r(4371);Object.defineProperty(t,"TransferTicketOperation",{enumerable:!0,get:function(){return f.TransferTicketOperation}});var h=r(2552);Object.defineProperty(t,"UpdateConsensusKeyOperation",{enumerable:!0,get:function(){return h.UpdateConsensusKeyOperation}});var p=r(3118);Object.defineProperty(t,"SmartRollupAddMessagesOperation",{enumerable:!0,get:function(){return p.SmartRollupAddMessagesOperation}});var b=r(408);Object.defineProperty(t,"SmartRollupOriginateOperation",{enumerable:!0,get:function(){return b.SmartRollupOriginateOperation}});var m=r(659);Object.defineProperty(t,"BallotOperation",{enumerable:!0,get:function(){return m.BallotOperation}});var g=r(8835);Object.defineProperty(t,"DrainDelegateOperation",{enumerable:!0,get:function(){return g.DrainDelegateOperation}});var v=r(5574);Object.defineProperty(t,"ProposalsOperation",{enumerable:!0,get:function(){return v.ProposalsOperation}});var y=r(4368);Object.defineProperty(t,"RevealOperation",{enumerable:!0,get:function(){return y.RevealOperation}});var _=r(1859);Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return _.Operation}})},1859:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=void 0;const i=r(8813),o=r(9419),s=r(6568),a=r(6209),c=r(9940),u=r(4359),l=r(6571);t.Operation=class{get includedInBlock(){return this._foundAt}constructor(e,t,r,n){if(this.hash=e,this.raw=t,this.results=r,this.context=n,this._pollingConfig$=new i.ReplaySubject(1),this.currentHead$=this._pollingConfig$.pipe((0,o.switchMap)((e=>new i.BehaviorSubject(e).pipe((0,o.timeout)({each:1e3*e.timeout,with:()=>(0,i.throwError)((()=>new u.ConfirmationTimeoutError("Confirmation polling timed out")))})))),(0,o.switchMap)((()=>(0,i.defer)((()=>(0,c.createObservableFromSubscription)(this.context.stream.subscribeBlock("head")))).pipe((0,o.switchMap)((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return(0,i.range)(n+1,e.header.level-n-1).pipe((0,o.concatMap)((e=>this.context.readProvider.getBlock(e))),(0,o.endWith)(e))})),(0,o.tap)((e=>this.lastHead=e))))),(0,o.shareReplay)({refCount:!0})),this.confirmed$=this.currentHead$.pipe((0,o.map)((e=>{for(let t=3;t>=0;t--)e.operations[t].forEach((t=>{t.hash===this.hash&&(this._foundAt=e.header.level)}));if(e.header.level-this._foundAt>=0)return this._foundAt})),(0,o.filter)((e=>void 0!==e)),(0,o.first)(),(0,o.shareReplay)()),this._foundAt=Number.POSITIVE_INFINITY,(0,a.validateOperation)(this.hash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.hash);this.confirmed$.pipe((0,o.first)(),(0,o.catchError)((()=>(0,i.of)(i.EMPTY)))).subscribe()}get revealOperation(){return Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind))}get revealStatus(){return this.revealOperation?this.revealOperation.metadata.operation_result.status:"unknown"}get status(){return this.results.map((e=>(0,s.hasMetadataWithResult)(e)?e.metadata.operation_result.status:"unknown"))[0]||"unknown"}confirmation(e,t){return n(this,void 0,void 0,(function*(){if(void 0!==e&&e<1)throw new u.InvalidConfirmationCountError(e);const{defaultConfirmationCount:r,confirmationPollingTimeoutSecond:n}=this.context.config;this._pollingConfig$.next({timeout:t||n});const i=void 0!==e?e:r;return new Promise(((e,t)=>{this.confirmed$.pipe((0,o.switchMap)((()=>this.currentHead$)),(0,o.filter)((e=>e.header.level-this._foundAt>=i-1)),(0,o.first)()).subscribe({error:e=>t(e),complete:()=>e(this._foundAt+(i-1))})}))}))}}},2526:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationOperation=void 0;const i=r(5553),o=r(286),s=r(1859),a=r(6568);class c extends s.Operation{constructor(e,t,r,n,i,o){super(e,r,n,i),this.params=t,this.contractProvider=o;const s=this.operationResults&&this.operationResults.originated_contracts;Array.isArray(s)&&(this.contractAddress=s[0])}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"origination"===e.kind)),t=e&&(0,a.hasMetadataWithResult)(e)&&e.metadata.operation_result;return t||void 0}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get storageDiff(){const e=this.operationResults&&this.operationResults.paid_storage_size_diff;return e||void 0}get storageSize(){const e=this.operationResults&&this.operationResults.storage_size;return e||void 0}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}contract(e,t){return n(this,void 0,void 0,(function*(){if(!this.contractAddress)throw new o.OriginationOperationError("No contract was originated in this operation");return yield this.confirmation(e,t),this.contractProvider.at(this.contractAddress)}))}}t.OriginationOperation=c},5574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProposalsOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"proposals"===e.kind));return e||void 0}get proposals(){return this.params.proposals}get period(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.period}}t.ProposalsOperation=i},6759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterGlobalConstantOperation=void 0;const n=r(5553),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r,this.globalConstantHash=this.operationResults&&this.operationResults.global_address}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"register_global_constant"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get registeredExpression(){return this.params.value}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),this.consumedMilliGas?new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.RegisterGlobalConstantOperation=o},4368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RevealOperation=void 0;const n=r(5553),i=r(286),o=r(1859);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"reveal"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get publicKey(){return this.params.public_key}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.BigNumber.ROUND_UP}),new n.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"storage_size"))}get errors(){return(0,i.flattenErrors)({contents:this.operationResults})}}t.RevealOperation=s},3118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupAddMessagesOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"smart_rollup_add_messages"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get message(){return this.params.message}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupAddMessagesOperation=i},5185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupExecuteOutboxMessageOperation=void 0;const n=r(9925),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get rollup(){return this.params.rollup}get cementedCommitment(){return this.params.cemented_commitment}get outputProof(){return this.params.output_proof}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupExecuteOutboxMessageOperation=o},408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmartRollupOriginateOperation=void 0;const n=r(9925),i=r(1859);class o extends i.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.SMART_ROLLUP_ORIGINATE)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get pvmKind(){return this.params.pvm_kind}get kernel(){return this.params.kernel}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.SmartRollupOriginateOperation=o},2741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOperation=void 0;const n=r(5553),i=r(286),o=r(1859);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"transaction"===e.kind));return e?[e]:[]}get status(){const e=this.operationResults[0];return e?e.metadata.operation_result.status:"unknown"}get amount(){return new n.default(this.params.amount)}get destination(){return this.params.destination}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}sumProp(e,t){return e.reduce(((e,r)=>t in r?Number(r[t])+e:e),0)}get consumedGas(){return n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP}),new n.default(this.consumedMilliGas).dividedBy(1e3).toString()}get consumedMilliGas(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"consumed_milligas"))}get storageDiff(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"paid_storage_size_diff"))}get storageSize(){return String(this.sumProp((0,i.flattenOperationResult)({contents:this.operationResults}),"storage_size"))}get errors(){return(0,i.flattenErrors)({contents:this.operationResults})}}t.TransactionOperation=s},4371:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTicketOperation=void 0;const n=r(9925),i=r(5553),o=r(105);class s extends o.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>e.kind===n.OpKind.TRANSFER_TICKET)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get consumedGas(){return i.BigNumber.config({DECIMAL_PLACES:0,ROUNDING_MODE:i.BigNumber.ROUND_UP}),this.consumedMilliGas?new i.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString():void 0}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}}t.TransferTicketOperation=s},6568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasMetadataWithInternalOperationResult=t.hasMetadataWithResult=t.hasMetadata=t.isSourceOp=t.isOpRequireReveal=t.isOpWithFee=t.isOpWithGasBuffer=t.isKind=t.findWithKind=t.attachKind=t.OpKind=void 0;const n=r(9925);var i=r(9925);Object.defineProperty(t,"OpKind",{enumerable:!0,get:function(){return i.OpKind}});t.attachKind=(e,t)=>Object.assign(Object.assign({},e),{kind:t});t.findWithKind=(e,r)=>{if(Array.isArray(e)){const n=e.find((e=>e.kind===r));if(n&&(0,t.isKind)(n,r))return n}};t.isKind=(e,t)=>e.kind===t;t.isOpWithGasBuffer=e=>!(e.kind!==n.OpKind.TRANSACTION||!e.parameters)||-1!==["origination","register_global_constant","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate"].indexOf(e.kind);t.isOpWithFee=e=>-1!==["transaction","delegation","origination","reveal","register_global_constant","increase_paid_storage","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate","smart_rollup_execute_outbox_message"].indexOf(e.kind);t.isOpRequireReveal=e=>-1!==["transaction","delegation","origination","register_global_constant","increase_paid_storage","transfer_ticket","update_consensus_key","smart_rollup_add_messages","smart_rollup_originate","smart_rollup_execute_outbox_message"].indexOf(e.kind);t.isSourceOp=e=>-1!==["transaction","delegation","origination","reveal","ballot"].indexOf(e.kind);t.hasMetadata=e=>"metadata"in e;t.hasMetadataWithResult=e=>(0,t.hasMetadata)(e)&&"operation_result"in e.metadata;t.hasMetadataWithInternalOperationResult=e=>(0,t.hasMetadata)(e)&&"internal_operation_results"in e.metadata},2552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateConsensusKeyOperation=void 0;const n=r(1859);class i extends n.Operation{constructor(e,t,r,n,i,o){super(e,n,i,o),this.params=t,this.source=r}get operationResults(){const e=Array.isArray(this.results)&&this.results.find((e=>"update_consensus_key"===e.kind)),t=e&&e.metadata&&e.metadata.operation_result;return t||void 0}get status(){var e,t;return null!==(t=null===(e=this.operationResults)||void 0===e?void 0:e.status)&&void 0!==t?t:"unknown"}get fee(){return Number(this.params.fee)}get gasLimit(){return Number(this.params.gas_limit)}get storageLimit(){return Number(this.params.storage_limit)}get pk(){return this.params.pk}get consumedMilliGas(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.consumed_milligas}get errors(){var e;return null===(e=this.operationResults)||void 0===e?void 0:e.errors}}t.UpdateConsensusKeyOperation=i},458:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4377:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecPacker=void 0;const i=r(5899);t.MichelCodecPacker=class{packData(e){return n(this,void 0,void 0,(function*(){const{bytes:t}=(0,i.packDataBytes)(e.data,e.type);return{packed:t}}))}}},577:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcPacker=void 0;t.RpcPacker=class{constructor(e){this.context=e}packData(e){return r(this,void 0,void 0,(function*(){return this.context.rpc.packData(e)}))}}},3971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8541:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MichelCodecParser=void 0;const i=r(5899),o=r(9026),s=r(1157);t.MichelCodecParser=class{constructor(e){this.context=e}getNextProto(){return n(this,void 0,void 0,(function*(){if(!this.context.proto){const e=yield this.context.readProvider.getNextProtocol("head");this.context.proto=e}return this.context.proto}))}parseScript(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseScript(e)}))}parseMichelineExpression(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseMichelineExpression(e)}))}parseJSON(e){return n(this,void 0,void 0,(function*(){return new i.Parser({protocol:yield this.getNextProto()}).parseJSON(e)}))}prepareCodeOrigination(e){return n(this,void 0,void 0,(function*(){const t=e;if(t.code=yield this.formatCodeParam(e.code),e.init)t.init=yield this.formatInitParam(e.init);else if(e.storage){const r=t.code.find((e=>"prim"in e&&"storage"===e.prim));if(!(null==r?void 0:r.args))throw new o.InvalidCodeParameter("The storage section is missing from the script",e.code);const n=new s.Schema(r.args[0]),a=yield this.findGlobalConstantsHashAndValue(n);if(0!==Object.keys(a).length){const n=new i.Parser({expandGlobalConstant:a}).parseJSON(r.args[0]),o=new s.Schema(n);t.init=o.Encode(e.storage)}else t.init=n.Encode(e.storage);delete t.storage}return t}))}formatCodeParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseScript(e);if(null===r)throw new o.InvalidCodeParameter("Unable to parse",e);t=r}else{const r=yield this.parseJSON(e),n=["parameter","storage","code"];t=r.sort(((e,t)=>n.indexOf(e.prim)-n.indexOf(t.prim)))}return t}))}formatInitParam(e){return n(this,void 0,void 0,(function*(){let t;if("string"==typeof e){const r=yield this.parseMichelineExpression(e);if(null===r)throw new o.InvalidInitParameter("Invalid init parameter",e);t=r}else t=yield this.parseJSON(e);return t}))}findGlobalConstantsHashAndValue(e){return n(this,void 0,void 0,(function*(){const t=e.findToken("constant"),r={};if(0!==t.length)for(const e of t){const t=e.tokenVal.args;if(t){const e=t[0];if(e.string){const t=e.string,n=yield this.context.globalConstantsProvider.getGlobalConstantByHash(t);Object.assign(r,{[t]:n})}}}return r}))}}},6424:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopParser=void 0;t.NoopParser=class{prepareCodeOrigination(e){return r(this,void 0,void 0,(function*(){return e}))}}},3682:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(261),t),i(r(7583),t)},261:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7583:function(e,t,r){"use strict";var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},s=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.PrepareProvider=void 0;const c=r(9925),u=r(6568),l=r(5283),d=r(4359),f=r(6571),h=r(2445),p=r(5605),b=r(5553),m=(e,t)=>{var r,n,i;return{fee:null!==(r=e.fee)&&void 0!==r?r:t.fee,gasLimit:null!==(n=e.gasLimit)&&void 0!==n?n:t.gasLimit,storageLimit:null!==(i=e.storageLimit)&&void 0!==i?i:t.storageLimit}};class g extends p.Provider{constructor(e){super(e),this.context=e,n.set(this,void 0),o(this,n,{},"f")}getBlockHash(e){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getBlockHash(null!=e?e:"head~2")}))}getProtocolHash(){return i(this,void 0,void 0,(function*(){return this.context.readProvider.getNextProtocol("head")}))}getHeadCounter(e){return i(this,void 0,void 0,(function*(){var t;return null!==(t=this.context.readProvider.getCounter(e,"head"))&&void 0!==t?t:"0"}))}adjustGasForBatchOperation(e,t,r){return b.default.min(t,e.div(r+1))}getOperationLimits(e,t){return i(this,void 0,void 0,(function*(){const{hard_gas_limit_per_operation:r,hard_gas_limit_per_block:n,hard_storage_limit_per_operation:i}=e;return{fee:0,gasLimit:t?Math.floor(this.adjustGasForBatchOperation(n,r,t).toNumber()):r.toNumber(),storageLimit:i.toNumber()}}))}getFee(e,t,r){(!s(this,n,"f")[t]||s(this,n,"f")[t]<r)&&(s(this,n,"f")[t]=r);return{counter:`${++s(this,n,"f")[t]}`,fee:void 0===e.fee?"0":`${e.fee}`,gas_limit:void 0===e.gas_limit?"0":`${e.gas_limit}`,storage_limit:void 0===e.storage_limit?"0":`${e.storage_limit}`}}getSource(e,t,r){return{source:void 0===e.source?r||t:e.source}}addRevealOperationIfNeeded(e,t){return i(this,void 0,void 0,(function*(){if((0,u.isOpRequireReveal)(e)){const r=[e],{publicKey:n,pkh:i}=yield this.getKeys();if(yield this.isAccountRevealRequired(t)){if(!n)throw new f.PublicKeyNotFoundError(i);return r.unshift(yield(0,h.createRevealOperation)({fee:(0,l.getRevealFee)(i),storageLimit:l.REVEAL_STORAGE_LIMIT,gasLimit:(0,l.getRevealGasLimit)(i)},t,n)),r}}return e}))}getKeys(){return i(this,void 0,void 0,(function*(){const e=this.context.isAnySignerConfigured();return{pkh:e?yield this.signer.publicKeyHash():yield this.context.walletProvider.getPKH(),publicKey:e?yield this.signer.publicKey():void 0}}))}convertIntoArray(e){return Array.isArray(e)?[...e]:[e]}constructOpContents(e,t,r,n,i){return e.map((e=>{switch(e.kind){case c.OpKind.ACTIVATION:case c.OpKind.DRAIN_DELEGATE:return Object.assign({},e);case c.OpKind.ORIGINATION:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{balance:void 0!==e.balance?`${e.balance}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSACTION:{const i=Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:void 0!==e.amount?`${e.amount}`:"0"}),this.getSource(e,r,n)),this.getFee(e,r,t));if(i.source.toLowerCase().startsWith("kt1"))throw new f.DeprecationError(`KT1 addresses are not supported as source since ${l.Protocols.PsBabyM1}`);return i}case c.OpKind.REVEAL:case c.OpKind.DELEGATION:case c.OpKind.REGISTER_GLOBAL_CONSTANT:case c.OpKind.UPDATE_CONSENSUS_KEY:case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:case c.OpKind.SMART_ROLLUP_ORIGINATE:case c.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return Object.assign(Object.assign(Object.assign({},e),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.TRANSFER_TICKET:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ticket_amount:`${e.ticket_amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.INCREASE_PAID_STORAGE:return Object.assign(Object.assign(Object.assign(Object.assign({},e),{amount:`${e.amount}`}),this.getSource(e,r,n)),this.getFee(e,r,t));case c.OpKind.BALLOT:case c.OpKind.PROPOSALS:if(void 0===i)throw new d.RPCResponseError("Failed to get the current voting period index");return Object.assign(Object.assign({},e),{period:null==i?void 0:i.voting_period.index});default:throw new f.InvalidOperationKindError(e.kind)}}))}activate(e){return i(this,arguments,void 0,(function*({pkh:e,secret:t}){const r=yield(0,h.createActivationOperation)({pkh:e,secret:t}),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{},"f");const c=parseInt(yield this.getHeadCounter(e),10);return{opOb:{branch:s,contents:this.constructOpContents(i,c,e),protocol:a},counter:c}}))}reveal(e){return i(this,arguments,void 0,(function*({fee:e,gasLimit:t,storageLimit:r}){const{pkh:i,publicKey:s}=yield this.getKeys();if(!s)throw new f.PublicKeyNotFoundError(i);const a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getOperationLimits(a),u=m({fee:e,storageLimit:r,gasLimit:t},c),l=yield(0,h.createRevealOperation)({fee:u.fee,gasLimit:u.gasLimit,storageLimit:u.storageLimit},i,s),d=this.convertIntoArray(l),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{},"f");const g=parseInt(yield this.getHeadCounter(i),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,i),protocol:b},counter:g}}))}originate(e,t){return i(this,void 0,void 0,(function*(){var{fee:r,storageLimit:i,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);const{pkh:u}=yield this.getKeys(),l=yield this.context.readProvider.getProtocolConstants("head"),d=yield this.getOperationLimits(l),f=yield(0,h.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign(Object.assign({},c),m({fee:r,storageLimit:i,gasLimit:s},d)))),p=yield this.addRevealOperationIfNeeded(f,u),b=this.convertIntoArray(p),g=yield this.getBlockHash(),v=yield this.getProtocolHash();o(this,n,{},"f");const y=parseInt(yield this.getHeadCounter(u),10);return{opOb:{branch:g,contents:this.constructOpContents(b,y,u,t),protocol:v},counter:y}}))}transaction(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}stake(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({},s),{to:c}),m({fee:t,storageLimit:r,gasLimit:i},l)),{parameter:{entrypoint:"stake",value:{prim:"Unit"}}})),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}unstake(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({},s),{to:c}),m({fee:t,storageLimit:r,gasLimit:i},l)),{parameter:{entrypoint:"unstake",value:{prim:"Unit"}}})),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}finalizeUnstake(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferOperation)(Object.assign(Object.assign(Object.assign(Object.assign({},s),{to:c,amount:0}),m({fee:t,storageLimit:r,gasLimit:i},l)),{parameter:{entrypoint:"finalize_unstake",value:{prim:"Unit"}}})),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}delegation(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSetDelegateOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}registerDelegate(e,t){return i(this,arguments,void 0,(function*({fee:e,storageLimit:t,gasLimit:r},i){const{pkh:s}=yield this.getKeys(),a=yield this.context.readProvider.getProtocolConstants("head"),c=yield this.getOperationLimits(a),u=m({fee:e,storageLimit:t,gasLimit:r},c),l=yield(0,h.createRegisterDelegateOperation)({fee:u.fee,storageLimit:u.storageLimit,gasLimit:u.gasLimit},s),d=yield this.addRevealOperationIfNeeded(l,s),f=this.convertIntoArray(d),p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{},"f");const g=parseInt(yield this.getHeadCounter(s),10);return{opOb:{branch:p,contents:this.constructOpContents(f,g,s,i),protocol:b},counter:g}}))}registerGlobalConstant(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createRegisterGlobalConstantOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}updateConsensusKey(e,t){return i(this,void 0,void 0,(function*(){var{fee:r,storageLimit:i,gasLimit:s}=e,c=a(e,["fee","storageLimit","gasLimit"]);const{pkh:u}=yield this.getKeys(),l=yield this.context.readProvider.getProtocolConstants("head"),d=yield this.getOperationLimits(l),f=yield(0,h.createUpdateConsensusKeyOperation)(Object.assign(Object.assign({},c),m({fee:r,storageLimit:i,gasLimit:s},d))),p=yield this.addRevealOperationIfNeeded(f,u),b=this.convertIntoArray(p),g=yield this.getBlockHash(),v=yield this.getProtocolHash();o(this,n,{},"f");const y=parseInt(yield this.getHeadCounter(u),10);return{opOb:{branch:g,contents:this.constructOpContents(b,y,u,t),protocol:v},counter:y}}))}increasePaidStorage(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createIncreasePaidStorageOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}ballot(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield(0,h.createBallotOperation)(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{},"f");const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new d.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}proposals(e){return i(this,void 0,void 0,(function*(){const{pkh:t}=yield this.getKeys(),r=yield(0,h.createProposalsOperation)(Object.assign({},e)),i=this.convertIntoArray(r),s=yield this.getBlockHash(),a=yield this.getProtocolHash();o(this,n,{},"f");const c=parseInt(yield this.getHeadCounter(t),10);let u;try{u=yield this.rpc.getCurrentPeriod()}catch(e){throw new d.RPCResponseError("Failed to get the current voting period index")}return{opOb:{branch:s,contents:this.constructOpContents(i,c,t,void 0,u),protocol:a},counter:c}}))}drainDelegate(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r}=yield this.getKeys(),i=yield(0,h.createDrainDelegateOperation)(Object.assign({},e)),s=this.convertIntoArray(i),a=yield this.getBlockHash(),c=yield this.getProtocolHash();o(this,n,{},"f");const u=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:a,contents:this.constructOpContents(s,u,r,t),protocol:c},counter:u}}))}transferTicket(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createTransferTicketOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}smartRollupAddMessages(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSmartRollupAddMessagesOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}smartRollupOriginate(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSmartRollupOriginateOperation)(Object.assign(Object.assign({},m({fee:t,storageLimit:r,gasLimit:i},l)),s)),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}smartRollupExecuteOutboxMessage(e){return i(this,void 0,void 0,(function*(){var{fee:t,storageLimit:r,gasLimit:i}=e,s=a(e,["fee","storageLimit","gasLimit"]);const{pkh:c}=yield this.getKeys(),u=yield this.context.readProvider.getProtocolConstants("head"),l=yield this.getOperationLimits(u),d=yield(0,h.createSmartRollupExecuteOutboxMessageOperation)(Object.assign(Object.assign({},s),m({fee:t,storageLimit:r,gasLimit:i},l))),f=yield this.addRevealOperationIfNeeded(d,c),p=this.convertIntoArray(f),b=yield this.getBlockHash(),g=yield this.getProtocolHash();o(this,n,{},"f");const v=parseInt(yield this.getHeadCounter(c),10);return{opOb:{branch:b,contents:this.constructOpContents(p,v,c,s.source),protocol:g},counter:v}}))}batch(e,t){return i(this,void 0,void 0,(function*(){const{pkh:r,publicKey:i}=yield this.getKeys(),s=yield this.context.readProvider.getProtocolConstants("head"),a=yield this.getOperationLimits(s,e.length),c=yield this.isRevealOpNeeded(e,r),d=[];if(t)for(const r of e)if((0,u.isOpWithFee)(r)){const e=t.shift(),n=m(r,{fee:e.suggestedFeeMutez,storageLimit:e.storageLimit,gasLimit:e.gasLimit});d.push(yield this.getRPCOp(Object.assign(Object.assign({},r),n)))}else d.push(Object.assign({},r));else for(const t of e)if((0,u.isOpWithFee)(t)){const e=m(t,a);d.push(yield this.getRPCOp(Object.assign(Object.assign({},t),e)))}else d.push(Object.assign({},t));if(c){if(!i)throw new f.PublicKeyNotFoundError(r);d.unshift(yield(0,h.createRevealOperation)({fee:(0,l.getRevealFee)(r),storageLimit:l.REVEAL_STORAGE_LIMIT,gasLimit:(0,l.getRevealGasLimit)(r)},r,i))}const p=yield this.getBlockHash(),b=yield this.getProtocolHash();o(this,n,{},"f");const g=parseInt(yield this.getHeadCounter(r),10);return{opOb:{branch:p,contents:this.constructOpContents(d,g,r),protocol:b},counter:g}}))}contractCall(e){return i(this,void 0,void 0,(function*(){var t,r,i;const s=yield this.getBlockHash(),a=yield this.getProtocolHash(),{pkh:u}=yield this.getKeys();o(this,n,{},"f");const l=parseInt(yield this.getHeadCounter(u),10),d=e.toTransferParams(),f=yield this.context.readProvider.getProtocolConstants("head"),h=yield this.getOperationLimits(f),p=m({fee:d.fee,storageLimit:d.storageLimit,gasLimit:d.gasLimit},h),b={kind:c.OpKind.TRANSACTION,fee:null!==(t=d.fee)&&void 0!==t?t:p.fee,gas_limit:null!==(r=d.gasLimit)&&void 0!==r?r:p.gasLimit,storage_limit:null!==(i=d.storageLimit)&&void 0!==i?i:p.storageLimit,amount:String(d.amount),destination:d.to,parameters:d.parameter},g=yield this.addRevealOperationIfNeeded(b,u),v=this.convertIntoArray(g);return{opOb:{branch:s,contents:this.constructOpContents(v,l,u),protocol:a},counter:l}}))}toPreapply(e){return i(this,void 0,void 0,(function*(){const{opOb:{contents:t,branch:r,protocol:n}}=e,i=this.toForge(e),o=yield this.context.forger.forge(i);return[{contents:t,branch:r,protocol:n,signature:(yield this.context.signer.sign(o,new Uint8Array([3]))).prefixSig}]}))}toForge({opOb:{contents:e,branch:t}}){return{branch:t,contents:e}}}t.PrepareProvider=g,n=new WeakMap},5605:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;const o=r(6568),s=r(286),a=r(2654),c=r(9925),u=r(6209);t.Provider=class{get rpc(){return this.context.rpc}get signer(){return this.context.signer}constructor(e){this.context=e}forge(e){return n(this,arguments,void 0,(function*({opOb:{branch:e,contents:t,protocol:r},counter:n}){return{opbytes:yield this.context.forger.forge({branch:e,contents:t}),opOb:{branch:e,contents:t,protocol:r},counter:n}}))}estimate(e,t){return n(this,void 0,void 0,(function*(){var{fee:r,gasLimit:n,storageLimit:o}=e,a=i(e,["fee","gasLimit","storageLimit"]);let c=r,u=n,l=o;if(c&&c%1!=0)throw new s.InvalidEstimateValueError(`Fee value must not be a decimal: ${c}`);if(u&&u%1!=0)throw new s.InvalidEstimateValueError(`Gas Limit value must not be a decimal: ${u}`);if(l&&l%1!=0)throw new s.InvalidEstimateValueError(`Storage Limit value must not be a decimal: ${l}`);if(void 0===r||void 0===n||void 0===o){const e=yield t(Object.assign({fee:r,gasLimit:n,storageLimit:o},a));null!=c||(c=e.suggestedFeeMutez),null!=u||(u=e.gasLimit),null!=l||(l=e.storageLimit)}return{fee:c,gasLimit:u,storageLimit:l}}))}getRPCOp(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case c.OpKind.TRANSACTION:return(0,a.createTransferOperation)(Object.assign({},e));case c.OpKind.ORIGINATION:return(0,a.createOriginationOperation)(yield this.context.parser.prepareCodeOrigination(Object.assign({},e)));case c.OpKind.DELEGATION:return(0,a.createSetDelegateOperation)(Object.assign({},e));case c.OpKind.REGISTER_GLOBAL_CONSTANT:return(0,a.createRegisterGlobalConstantOperation)(Object.assign({},e));case c.OpKind.INCREASE_PAID_STORAGE:return(0,a.createIncreasePaidStorageOperation)(Object.assign({},e));case c.OpKind.TRANSFER_TICKET:return(0,a.createTransferTicketOperation)(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ADD_MESSAGES:return(0,a.createSmartRollupAddMessagesOperation)(Object.assign({},e));case c.OpKind.SMART_ROLLUP_ORIGINATE:return(0,a.createSmartRollupOriginateOperation)(Object.assign({},e));case c.OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE:return(0,a.createSmartRollupExecuteOutboxMessageOperation)(Object.assign({},e));default:throw new u.InvalidOperationKindError(e.kind)}}))}runOperation(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.runOperation(e),op:e,context:this.context.clone()}}))}simulate(e){return n(this,void 0,void 0,(function*(){return{opResponse:yield this.rpc.simulateOperation(e),op:e,context:this.context.clone()}}))}isRevealOpNeeded(e,t){return n(this,void 0,void 0,(function*(){return!(!(yield this.isAccountRevealRequired(t))||!this.isRevealRequiredForOpType(e))}))}isAccountRevealRequired(e){return n(this,void 0,void 0,(function*(){return!(yield this.context.readProvider.isAccountRevealed(e,"head"))}))}isRevealRequiredForOpType(e){let t=!1;for(const r of e)(0,o.isOpRequireReveal)(r)&&(t=!0);return t}signAndInject(e){return n(this,void 0,void 0,(function*(){const t=yield this.signer.sign(e.opbytes,new Uint8Array([3]));e.opbytes=t.sbytes,e.opOb.signature=t.prefixSig;const r=[],n=yield this.rpc.preapplyOperations([e.opOb]);if(!Array.isArray(n))throw new s.TezosPreapplyFailureError(n);for(let e=0;e<n.length;e++)for(let t=0;t<n[e].contents.length;t++)r.push(n[e].contents[t]);const i=(0,s.flattenErrors)(n);if(i.length)throw new s.TezosOperationError(i,"Error occurred during validation simulation of operation",r);return{hash:yield this.context.injector.inject(e.opbytes),forgedBytes:e,opResponse:r,context:this.context.clone()}}))}}},4631:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcReadAdapter=void 0;t.RpcReadAdapter=class{constructor(e){this.rpc=e}getBalance(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBalance(e,{block:String(t)})}))}getSpendable(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSpendable(e,{block:String(t)})}))}getDelegate(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getDelegate(e,{block:String(t)})}))}getNextProtocol(e){return r(this,void 0,void 0,(function*(){return(yield this.rpc.getProtocols({block:String(e)})).next_protocol}))}getProtocolConstants(e){return r(this,void 0,void 0,(function*(){const{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,smart_rollup_origination_size:a}=yield this.rpc.getConstants({block:String(e)});return{time_between_blocks:t,minimal_block_delay:r,hard_gas_limit_per_operation:n,hard_gas_limit_per_block:i,hard_storage_limit_per_operation:o,cost_per_byte:s,smart_rollup_origination_size:a}}))}getScript(e,t){return r(this,void 0,void 0,(function*(){const{script:r}=yield this.rpc.getContract(e,{block:String(t)});return r}))}getStorage(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getStorage(e,{block:String(t)})}))}getBlockHash(e){return r(this,void 0,void 0,(function*(){const{hash:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBlockLevel(e){return r(this,void 0,void 0,(function*(){const{level:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getCounter(e,t){return r(this,void 0,void 0,(function*(){const{counter:r}=yield this.rpc.getContract(e,{block:String(t)});return r||"0"}))}getBlockTimestamp(e){return r(this,void 0,void 0,(function*(){const{timestamp:t}=yield this.rpc.getBlockHeader({block:String(e)});return t}))}getBigMapValue(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getBigMapExpr(e.id,e.expr,{block:String(t)})}))}getSaplingDiffById(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffById(e.id,{block:String(t)})}))}getSaplingDiffByContract(e,t){return r(this,void 0,void 0,(function*(){return this.rpc.getSaplingDiffByContract(e,{block:String(t)})}))}getEntrypoints(e){return r(this,void 0,void 0,(function*(){return this.rpc.getEntrypoints(e)}))}getChainId(){return r(this,void 0,void 0,(function*(){return this.rpc.getChainId()}))}isAccountRevealed(e,t){return r(this,void 0,void 0,(function*(){const r=yield this.rpc.getManagerKey(e,{block:String(t)});return r&&"object"==typeof r?!!r.key:!!r}))}getBlock(e){return r(this,void 0,void 0,(function*(){return this.rpc.getBlock({block:String(e)})}))}getLiveBlocks(e){return this.rpc.getLiveBlocks({block:String(e)})}getAdaptiveIssuanceLaunchCycle(e){return this.rpc.getAdaptiveIssuanceLaunchCycle({block:String(e)})}}},1102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnconfiguredSignerError=void 0;const n=r(6571);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="UnconfiguredSignerError",this.message="No signer has been configured. Please configure one by calling setProvider({signer}) on your TezosToolkit instance."}}t.UnconfiguredSignerError=i},2029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6425:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NoopSigner=void 0;const i=r(1102);t.NoopSigner=class{publicKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}publicKeyHash(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}secretKey(){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}sign(e,t){return n(this,void 0,void 0,(function*(){throw new i.UnconfiguredSignerError}))}}},9940:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObservableFromSubscription=function(e){return new n.Observable((t=>(e.on("data",(e=>{t.next(e)})),e.on("error",(e=>{t.error(e)})),e.on("close",(()=>{t.complete()})),()=>{e.close()})))};const n=r(8813)},4938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidFilterExpressionError=t.UnsupportedEventError=void 0;const n=r(6571);class i extends n.ParameterValidationError{constructor(e){super(),this.type=e,this.name="UnsupportedEventError",this.message=`Unsupported event type "${e}" expecting one of the "data", "error", or "close".`}}t.UnsupportedEventError=i;class o extends n.ParameterValidationError{constructor(e){super(),this.invalidExpression=e,this.name="InvalidFilterExpressionError",this.message="Invalid filter expression expecting the object to contain either and/or property"}}t.InvalidFilterExpressionError=o},8706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateFilter=t.evaluateExpression=t.evaluateOpFilter=t.eventFilter=void 0;const n=r(4938);t.eventFilter=(e,t,r,n)=>"event"===e.kind&&((!r||e.tag===r)&&((!t||e.source===t)&&(!n||"applied"===e.result.status)));t.evaluateOpFilter=(e,t)=>"opHash"in t?((e,t)=>e.hash===t.opHash)(e,t):"source"in t?((e,t)=>{switch(e.kind){case"attestation":return"metadata"in e&&e.metadata.delegate===t.source;case"activate_account":return"metadata"in e&&e.pkh===t.source;default:return"source"in e&&e.source===t.source}})(e,t):"kind"in t?((e,t)=>"kind"in e&&e.kind===t.kind)(e,t):"destination"in t&&((e,t)=>{switch(e.kind){case"delegation":return e.delegate===t.destination;case"origination":if("metadata"in e&&"operation_result"in e.metadata&&"originated_contracts"in e.metadata.operation_result&&Array.isArray(e.metadata.operation_result.originated_contracts))return e.metadata.operation_result.originated_contracts.some((e=>e===t.destination));break;case"transaction":return e.destination===t.destination;default:return!1}})(e,t);t.evaluateExpression=(e,r)=>{if(Array.isArray(r.and))return r.and.every((r=>(0,t.evaluateFilter)(e,r)));if(Array.isArray(r.or))return r.or.some((r=>(0,t.evaluateFilter)(e,r)));throw new n.InvalidFilterExpressionError(r)};t.evaluateFilter=(e,r)=>{const n=[];return Array.isArray(r)?n.push(...r):n.push(r),n.every((r=>"and"in r||"or"in r?(0,t.evaluateExpression)(e,r):(0,t.evaluateOpFilter)(e,r)))}},2422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableSubscription=t.UnsupportedEventError=void 0;const n=r(8813),i=r(9419),o=r(4938);var s=r(4938);Object.defineProperty(t,"UnsupportedEventError",{enumerable:!0,get:function(){return s.UnsupportedEventError}});t.ObservableSubscription=class{constructor(e,t=!1,r=(0,i.retry)()){this.shouldRetry=t,this.operatorFunction=r,this.errorListeners=[],this.messageListeners=[],this.closeListeners=[],this.completed$=new n.Subject,e.pipe((0,i.takeUntil)(this.completed$),(0,i.tap)((e=>{this.call(this.messageListeners,e)}),(e=>{this.call(this.errorListeners,e)}),(()=>{this.call(this.closeListeners)})),this.shouldRetry?r:(0,i.tap)(),(0,i.catchError)((()=>n.NEVER))).subscribe()}call(e,t){for(const r of e)try{r(t)}catch(e){console.error(e)}}remove(e,t){const r=e.indexOf(t);-1!==r&&e.splice(r,1)}on(e,t){switch(e){case"data":this.messageListeners.push(t);break;case"error":this.errorListeners.push(t);break;case"close":this.closeListeners.push(t);break;default:throw new o.UnsupportedEventError(e)}}off(e,t){switch(e){case"data":this.remove(this.messageListeners,t);break;case"error":this.remove(this.errorListeners,t);break;case"close":this.remove(this.closeListeners,t);break;default:throw new o.UnsupportedEventError(e)}}close(){this.completed$.next()}}},8648:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingSubscribeProvider=t.defaultConfigStreamer=void 0;const i=r(8813),o=r(9419),s=r(8706),a=r(4040),c=r(5553);t.defaultConfigStreamer={shouldObservableSubscriptionRetry:!1,observableSubscriptionRetryFunction:(0,o.retry)()};t.PollingSubscribeProvider=class{constructor(e,r={}){this.context=e,this._config$=new i.BehaviorSubject(Object.assign(Object.assign({},t.defaultConfigStreamer),r)),this.timer$=this._config$.pipe((0,o.pluck)("pollingIntervalMilliseconds"),(0,o.switchMap)((e=>e?(0,i.timer)(0,e):(0,i.from)(this.getConfirmationPollingInterval()).pipe((0,o.switchMap)((e=>(0,i.timer)(0,e))))))),this.newBlock$=this.timer$.pipe((0,o.switchMap)((()=>(e=>(0,i.from)(e.rpc.getBlock()).pipe((0,o.first)()))(this.context))),(0,o.distinctUntilKeyChanged)("hash"),(0,o.publish)(),(0,o.refCount)())}get config(){return this._config$.getValue()}getConfirmationPollingInterval(){return n(this,void 0,void 0,(function*(){if(!this.config.pollingIntervalMilliseconds){const e=5e3,t=1e3;try{const r=yield this.context.readProvider.getProtocolConstants("head"),n=(r.minimal_block_delay?r.minimal_block_delay.multipliedBy(1e3):new c.default(e)).dividedBy(3);this.config.pollingIntervalMilliseconds=0===n.toNumber()?t:n.toNumber()}catch(t){return e}}return this.config.pollingIntervalMilliseconds}))}subscribeBlock(e){return new a.ObservableSubscription(this.newBlock$,this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribe(e){return new a.ObservableSubscription(this.newBlock$.pipe((0,o.pluck)("hash")),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeOperation(e){return new a.ObservableSubscription(this.newBlock$.pipe((e=>(0,o.concatMap)((t=>new i.Observable((r=>{for(const n of t.operations)for(const t of n)for(const n of t.contents)(0,s.evaluateFilter)(Object.assign({hash:t.hash},n),e)&&r.next(Object.assign({hash:t.hash},n));r.complete()})))))(e)),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction)}subscribeEvent(e){return new a.ObservableSubscription(this.newBlock$.pipe((t=e,(0,o.concatMap)((e=>new i.Observable((r=>{for(const n of e.operations)for(const i of n)for(const n of i.contents){const o=n.metadata.internal_operation_results;if(o)for(const n of o)(0,s.eventFilter)(n,null==t?void 0:t.address,null==t?void 0:t.tag,null==t?void 0:t.excludeFailedOperations)&&r.next(Object.assign({opHash:i.hash,blockHash:e.hash,level:e.header.level},n))}r.complete()})))))),this.config.shouldObservableSubscriptionRetry,this.config.observableSubscriptionRetryFunction);var t}}},4779:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.TezosToolkit=t.TaquitoLocalForger=t.RpcReadAdapter=t.ObservableSubscription=t.PollingSubscribeProvider=t.OperationBatch=t.RpcForger=t.CompositeForger=t.UnitValue=t.MichelsonMap=t.Token=void 0;const o=r(9925),s=r(7021),a=r(6209),c=r(8320),u=r(577),l=r(4631),d=r(6425),f=r(8648),h=r(4982),p=r(1170),b=r(6343),m=r(8541),g=r(2245),v=r(1157);var y=r(1157);Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return y.Token}}),Object.defineProperty(t,"MichelsonMap",{enumerable:!0,get:function(){return y.MichelsonMap}}),Object.defineProperty(t,"UnitValue",{enumerable:!0,get:function(){return y.UnitValue}}),i(r(5283),t),i(r(7021),t),i(r(2445),t),i(r(9676),t);var _=r(3215);Object.defineProperty(t,"CompositeForger",{enumerable:!0,get:function(){return _.CompositeForger}});var E=r(9719);Object.defineProperty(t,"RpcForger",{enumerable:!0,get:function(){return E.RpcForger}}),i(r(105),t);var w=r(5025);Object.defineProperty(t,"OperationBatch",{enumerable:!0,get:function(){return w.OperationBatch}}),i(r(2029),t),i(r(2422),t);var O=r(8648);Object.defineProperty(t,"PollingSubscribeProvider",{enumerable:!0,get:function(){return O.PollingSubscribeProvider}});var A=r(4040);Object.defineProperty(t,"ObservableSubscription",{enumerable:!0,get:function(){return A.ObservableSubscription}}),i(r(1174),t),i(r(1170),t),i(r(9164),t),i(r(2245),t),i(r(3971),t),i(r(8541),t),i(r(6424),t),i(r(458),t),i(r(4377),t),i(r(577),t),i(r(7771),t),i(r(9185),t),i(r(7157),t);var S=r(4631);Object.defineProperty(t,"RpcReadAdapter",{enumerable:!0,get:function(){return S.RpcReadAdapter}}),i(r(5681),t);var P=r(6343);Object.defineProperty(t,"TaquitoLocalForger",{enumerable:!0,get:function(){return P.TaquitoLocalForger}}),i(r(3682),t);t.TezosToolkit=class{constructor(e){this._rpc=e,this._options={},this.format=a.format,"string"==typeof this._rpc?this._rpcClient=new o.RpcClient(this._rpc):this._rpcClient=this._rpc,this._context=new s.Context(e),this._wallet=new p.Wallet(this._context),this.setProvider({rpc:this._rpcClient}),this.batch=this._context.batch.batch.bind(this._context.batch)}setProvider({rpc:e,stream:t,signer:r,protocol:n,config:i,forger:o,wallet:s,packer:a,globalConstantsProvider:c,readProvider:u,parserProvider:l,injectorProvider:d}){this.setRpcProvider(e),this.setStreamProvider(t),this.setSignerProvider(r),this.setForgerProvider(o),this.setWalletProvider(s),this.setPackerProvider(a),this.setGlobalConstantsProvider(c),this.setReadProvider(u),this.setParserProvider(l),this.setInjectorProvider(d),this._context.proto=n,i&&this._context.setPartialConfig(i)}setSignerProvider(e){this._options.signer||void 0!==e?void 0!==e&&(this._context.signer=e,this._options.signer=e):(this._context.signer=new d.NoopSigner,this._options.signer=e)}setRpcProvider(e){"string"==typeof e?this._rpcClient=new o.RpcClient(e):void 0===e||(this._rpcClient=e),this._options.rpc=this._rpcClient,this._context.rpc=this._rpcClient}setForgerProvider(e){if(void 0!==e)this._options.forger=e,this._context.forger=e;else if(void 0===this._options.forger){const e=this.getFactory(b.TaquitoLocalForger)();this._options.forger=e,this._context.forger=e}}setStreamProvider(e){if("string"==typeof e){const t=new f.PollingSubscribeProvider(new s.Context(new o.RpcClient(e)));this._options.stream=t,this._context.stream=t}else if(void 0!==e)this._options.stream=e,this._context.stream=e;else if(void 0===this._options.stream){const e=this.getFactory(f.PollingSubscribeProvider)();this._options.stream=e,this._context.stream=e}}setWalletProvider(e){if(this._options.wallet||void 0!==e)void 0!==e&&(this._options.wallet=e,this._context.walletProvider=e);else{const e=this.getFactory(p.LegacyWalletProvider)();this._options.wallet=e,this._context.walletProvider=e}}setPackerProvider(e){if(this._options.packer||void 0!==e)void 0!==e&&(this._context.packer=e,this._options.packer=e);else{const e=this.getFactory(u.RpcPacker)();this._context.packer=e,this._options.packer=e}}setGlobalConstantsProvider(e){if(this._options.globalConstantsProvider||void 0!==e)void 0!==e&&(this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e);else{const e=new c.NoopGlobalConstantsProvider;this._context.globalConstantsProvider=e,this._options.globalConstantsProvider=e}}setReadProvider(e){const t=e||new l.RpcReadAdapter(this._context.rpc);this._options.readProvider=t,this._context.readProvider=t}setParserProvider(e){if(this._options.parserProvider||void 0!==e)void 0!==e&&(this._context.parser=e,this._options.parserProvider=e);else{const e=new m.MichelCodecParser(this._context);this._context.parser=e,this._options.parserProvider=e}}setInjectorProvider(e){if(this._options.injectorProvider||void 0!==e)void 0!==e&&(this._context.injector=e,this._options.injectorProvider=e);else{const e=new g.RpcInjector(this._context);this._context.injector=e,this._options.injectorProvider=e}}setFieldNumberingStrategy(e){v.Token.fieldNumberingStrategy=e}get tz(){return this._context.tz}get contract(){return this._context.contract}get prepare(){return this._context.prepare}get wallet(){return this._wallet}get operation(){return this._context.operationFactory}get estimate(){return this._context.estimate}get stream(){return this._context.stream}get rpc(){return this._context.rpc}get signer(){return this._context.signer}get globalConstants(){return this._context.globalConstantsProvider}addExtension(e){Array.isArray(e)?e.forEach((e=>e.configureContext(this._context))):e.configureContext(this._context)}getFactory(e){return(...t)=>new e(this._context,...t)}getVersionInfo(){return h.VERSION}}},1174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8907:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcTzProvider=void 0;const i=r(1859),o=r(6209),s=r(6571),a=r(5605),c=r(3682);class u extends a.Provider{constructor(e){super(e),this.prepare=new c.PrepareProvider(this.context)}getBalance(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t));return this.context.readProvider.getBalance(e,"head")}))}getSpendable(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t));return this.context.readProvider.getSpendable(e,"head")}))}getDelegate(e){return n(this,void 0,void 0,(function*(){const t=(0,o.validateAddress)(e);if(t!==o.ValidationResult.VALID)throw new s.InvalidAddressError(e,(0,o.invalidDetail)(t));return this.context.readProvider.getDelegate(e,"head")}))}activate(e,t){return n(this,void 0,void 0,(function*(){const r=(0,o.validateKeyHash)(e);if(r!==o.ValidationResult.VALID)throw new o.InvalidKeyHashError(e,(0,o.invalidDetail)(r));const n=yield this.prepare.activate({pkh:e,secret:t}),s=yield this.forge(n),a=`${s.opbytes}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`;return new i.Operation(yield this.rpc.injectOperation(a),Object.assign(Object.assign({},s),{opbytes:a}),[],this.context.clone())}))}}t.RpcTzProvider=u},4982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION={commitHash:"fc1deedd999e20a066dafd5f5a1e0a6e0186fec4",version:"21.0.4-beta.1"}},2538:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BatchWalletOperation=void 0;const i=r(9925),o=r(5025),s=r(6568),a=r(3871),c=r(2599);class u extends a.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t,this.getOriginatedContractAddresses=()=>n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e){const t=e.filter((e=>"origination"===e.kind));let r=[];for(const e of t)e.metadata.operation_result.originated_contracts&&(r=[...r,...e.metadata.operation_result.originated_contracts]);return r}throw new c.ObservableError("Unable to fetch operation results")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new c.ObservableError("Unable to fetch operation results")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.operationResults();if(e)return e.filter((e=>-1!==o.BATCH_KINDS.indexOf(e.kind))).map((e=>{if((0,s.hasMetadataWithResult)(e)){return e.metadata.operation_result.status}return"unknown"}))[0]||"unknown";throw new c.ObservableError("Unable to fetch operation results")}))}}t.BatchWalletOperation=u},9734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationWalletOperation=void 0;const i=r(9925),o=r(3871),s=r(2599);class a extends o.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}delegationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===i.OpKind.DELEGATION));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.delegationOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.DelegationWalletOperation=a},2599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableError=t.ConfirmationUndefinedError=void 0;const n=r(6571);class i extends n.TezosToolkitConfigError{constructor(){super(),this.name="ConfirmationUndefinedError",this.message="Default confirmation count can not be undefined"}}t.ConfirmationUndefinedError=i;class o extends n.NetworkError{constructor(e){super(),this.message=e,this.name="ObservableError"}}t.ObservableError=o},6583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IncreasePaidStorageWalletOperation=void 0;const i=r(3871),o=r(9925),s=r(2599);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.REVEAL));throw new s.ObservableError("Unable to fetch operation result")}))}increasePaidStorageOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return e.find((e=>e.kind===o.OpKind.INCREASE_PAID_STORAGE));throw new s.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.increasePaidStorageOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.IncreasePaidStorageWalletOperation=a},1170:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1593),t),i(r(3871),t),i(r(122),t),i(r(77),t),i(r(9734),t),i(r(9432),t),i(r(6117),t),i(r(4723),t)},6117:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4723:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LegacyWalletProvider=void 0;const i=r(6568);t.LegacyWalletProvider=class{constructor(e){this.context=e}getPKH(){return n(this,void 0,void 0,(function*(){return this.context.signer.publicKeyHash()}))}getPK(){return n(this,void 0,void 0,(function*(){return this.context.signer.publicKey()}))}mapTransferParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapStakeParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapUnstakeParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapFinalizeUnstakeParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSACTION)}))}mapOriginateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.ORIGINATION)}))}mapDelegateParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.DELEGATION)}))}mapIncreasePaidStorageWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.INCREASE_PAID_STORAGE)}))}mapTransferTicketParamsToWalletParams(e){return n(this,void 0,void 0,(function*(){return(0,i.attachKind)(yield e(),i.OpKind.TRANSFER_TICKET)}))}sendOperations(e){return n(this,void 0,void 0,(function*(){return(yield this.context.batch.batch(e).send()).hash}))}sign(e,t){return n(this,void 0,void 0,(function*(){const{prefixSig:r}=yield this.context.signer.sign(e,t);return r}))}}},808:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OperationFactory=t.createNewPollingBasedHeadObservable=void 0,t.timeoutAfter=b;const i=r(8813),o=r(9419),s=r(9940),a=r(2538),c=r(9734),u=r(6583),l=r(3871),d=r(77),f=r(122),h=r(9432),p=r(4359);function b(e){return function(t){return new i.BehaviorSubject(null).pipe((0,o.timeout)({each:e,with:()=>(0,i.throwError)((()=>new p.ConfirmationTimeoutError("Confirmation polling timed out")))}),(0,o.mergeMap)((()=>t)))}}t.createNewPollingBasedHeadObservable=(e,t,r)=>e.pipe(b(1e3*t.config.confirmationPollingTimeoutSecond),(0,o.share)({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}));t.OperationFactory=class{constructor(e){this.context=e,this.sharedHeadObs=(0,i.defer)((()=>(0,s.createObservableFromSubscription)(this.context.stream.subscribeBlock("head"))))}createNewHeadObservable(){return n(this,void 0,void 0,(function*(){return(0,t.createNewPollingBasedHeadObservable)(this.sharedHeadObs,this.context)}))}createPastBlockWalker(e,t=1){return(0,i.from)(this.context.readProvider.getBlock(e)).pipe((0,o.switchMap)((e=>1===t?(0,i.of)(e):(0,i.range)(e.header.level,t-1).pipe((0,o.startWith)(e),(0,o.concatMap)((e=>n(this,void 0,void 0,(function*(){return this.context.readProvider.getBlock("number"==typeof e?e:e.header.level)}))))))))}createHeadObservableFromConfig(e){return n(this,arguments,void 0,(function*({blockIdentifier:e}){const t=[];return e&&t.push(this.createPastBlockWalker(e)),t.push(yield this.createNewHeadObservable()),(0,i.concat)(...t)}))}createOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new l.WalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createBatchOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new a.BatchWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createTransactionOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new f.TransactionWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createTransferTicketOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new h.TransferTicketWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createDelegationOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new c.DelegationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createOriginationOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new d.OriginationWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}createIncreasePaidStorageOperation(e){return n(this,arguments,void 0,(function*(e,t={}){return new u.IncreasePaidStorageWalletOperation(e,this.context.clone(),yield this.createHeadObservableFromConfig(t))}))}}},3871:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletOperation=void 0;const i=r(8813),o=r(9419),s=r(6854),a=r(6209),c=r(4359),u=r(2599),l=r(6571);t.WalletOperation=class{operationResults(){return n(this,void 0,void 0,(function*(){return this._operationResult.pipe((0,o.first)()).toPromise()}))}receipt(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new u.ObservableError("Unable to get operation results");return(0,s.receiptFromOperation)(e)}))}constructor(e,t,r){if(this.opHash=e,this.context=t,this._newHead$=r,this._operationResult=new i.ReplaySubject(1),this._includedInBlock=new i.ReplaySubject(1),this._included=!1,this.newHead$=this._newHead$.pipe((0,o.switchMap)((e=>{var t,r;const n=null!==(r=null===(t=this.lastHead)||void 0===t?void 0:t.header.level)&&void 0!==r?r:e.header.level-1;return(0,i.range)(n+1,e.header.level-n-1).pipe((0,o.concatMap)((e=>this.context.readProvider.getBlock(e))),(0,o.endWith)(e))})),(0,o.tap)((e=>this.lastHead=e)),(0,o.share)({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),this.confirmed$=this.newHead$.pipe((0,o.map)((e=>{for(const t of e.operations)for(const r of t)if(r.hash===this.opHash)return this._included=!0,this._includedInBlock.next(e),this._operationResult.next(r.contents),e})),(0,o.filter)((e=>void 0!==e)),(0,o.first)(),(0,o.share)({connector:()=>new i.ReplaySubject(1),resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1})),(0,a.validateOperation)(this.opHash)!==a.ValidationResult.VALID)throw new l.InvalidOperationHashError(this.opHash);this.confirmed$.pipe((0,o.first)(),(0,o.catchError)((()=>(0,i.of)(void 0)))).subscribe()}getCurrentConfirmation(){return n(this,void 0,void 0,(function*(){return this._included?(0,i.combineLatest)([this._includedInBlock,(0,i.from)(this.context.readProvider.getBlock("head"))]).pipe((0,o.map)((([e,t])=>t.header.level-e.header.level+1)),(0,o.first)()).toPromise():0}))}isInCurrentBranch(){return n(this,arguments,void 0,(function*(e="head"){if(!this._included)return!0;const t=yield this.context.readProvider.getBlockLevel(e),r=yield this._includedInBlock.pipe((0,o.first)()).toPromise();if(!r)throw new u.ObservableError("Inclusion block is undefined");const n=t-r.header.level;if(n<=0)return!0;const i=Math.min(r.header.level+n,r.header.level+60);return new Set(yield this.context.readProvider.getLiveBlocks(i)).has(r.hash)}))}confirmationObservable(e){if(void 0!==e&&e<1)throw new c.InvalidConfirmationCountError(e);const{defaultConfirmationCount:t}=this.context.config,r=void 0!==e?e:t;if(void 0===r)throw new u.ConfirmationUndefinedError;return(0,i.combineLatest)([this._includedInBlock,this.newHead$]).pipe((0,o.distinctUntilChanged)((([,e],[,t])=>e.hash===t.hash)),(0,o.map)((([e,t])=>({block:t,expectedConfirmation:r,currentConfirmation:t.header.level-e.header.level+1,completed:t.header.level-e.header.level>=r-1,isInCurrentBranch:()=>this.isInCurrentBranch(t.hash)}))),(0,o.takeWhile)((({completed:e})=>!e),!0))}confirmation(e){return this.confirmationObservable(e).toPromise()}}},77:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.OriginationWalletOperation=void 0;const i=r(9925),o=r(6568),s=r(3871),a=r(2599);class c extends s.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}originationOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return(0,o.findWithKind)(e,i.OpKind.ORIGINATION);throw new a.ObservableError("Unable to fetch operation result")}))}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(e)return(0,o.findWithKind)(e,i.OpKind.REVEAL);throw new a.ObservableError("Unable to fetch operation result")}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.originationOperation();return e?e.metadata.operation_result.status:"unknown"}))}contract(){return n(this,void 0,void 0,(function*(){const e=yield this.originationOperation(),t=((null==e?void 0:e.metadata.operation_result.originated_contracts)||[])[0];return this.context.wallet.at(t)}))}}t.OriginationWalletOperation=c},6854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.receiptFromOperation=void 0;const n=r(5553),i=r(5283),o=r(286);t.receiptFromOperation=(e,{ALLOCATION_BURN:t,ORIGINATION_BURN:r}={ALLOCATION_BURN:257,ORIGINATION_BURN:257})=>{n.default.config({DECIMAL_PLACES:0,ROUNDING_MODE:n.default.ROUND_UP});const s=(0,o.flattenOperationResult)({contents:e});let a=new n.default(0),c=new n.default(0),u=new n.default(0),l=new n.default(0),d=new n.default(0),f=new n.default(0);return s.forEach((e=>{u=u.plus(e.fee||0),l=l.plus(Array.isArray(e.originated_contracts)?e.originated_contracts.length*r:0),d=d.plus("allocated_destination_contract"in e?t:0),a=a.plus(e.consumed_milligas||0),f=f.plus("paid_storage_size_diff"in e&&Number(e.paid_storage_size_diff)||0)})),c=c.plus(d).plus(l).plus(f),{totalFee:u,totalMilliGas:a,totalGas:a.dividedBy(1e3),totalStorage:c,totalAllocationBurn:d,totalOriginationBurn:l,totalPaidStorageDiff:f,totalStorageBurn:new n.default(c.multipliedBy(i.COST_PER_BYTE))}}},122:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWalletOperation=void 0;const i=r(3871),o=r(9925),s=r(2599);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.REVEAL))}))}transactionOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.TRANSACTION))}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.transactionOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.TransactionWalletOperation=a},9432:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTicketWalletOperation=void 0;const i=r(3871),o=r(9925),s=r(2599);class a extends i.WalletOperation{constructor(e,t,r){super(e,t,r),this.opHash=e,this.context=t}revealOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.REVEAL))}))}transferTicketOperation(){return n(this,void 0,void 0,(function*(){const e=yield this.operationResults();if(!e)throw new s.ObservableError("operationResult returned undefined");return e.find((e=>e.kind===o.OpKind.TRANSFER_TICKET))}))}status(){return n(this,void 0,void 0,(function*(){if(!this._included)return"pending";const e=yield this.transferTicketOperation();return e?e.metadata.operation_result.status:"unknown"}))}}t.TransferTicketWalletOperation=a},1593:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.WalletOperationBatch=void 0;const i=r(2445),o=r(6568),s=r(6571),a=r(6209);class c{constructor(e,t){this.walletProvider=e,this.context=t,this.operations=[]}withTransfer(e){const t=(0,a.validateAddress)(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:o.OpKind.TRANSACTION},e)),this}withContractCall(e,t={}){return this.withTransfer(e.toTransferParams(t))}withDelegation(e){var t;const r=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,(0,a.invalidDetail)(r));return this.operations.push(Object.assign({kind:o.OpKind.DELEGATION},e)),this}withOrigination(e){return this.operations.push(Object.assign({kind:o.OpKind.ORIGINATION},e)),this}withIncreasePaidStorage(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:o.OpKind.INCREASE_PAID_STORAGE},e)),this}withTransferTicket(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.operations.push(Object.assign({kind:o.OpKind.TRANSFER_TICKET},e)),this}mapOperation(e){return n(this,void 0,void 0,(function*(){switch(e.kind){case o.OpKind.TRANSACTION:return this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.ORIGINATION:return this.walletProvider.mapOriginateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return this.context.parser.prepareCodeOrigination(Object.assign({},e))}))));case o.OpKind.DELEGATION:return this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));case o.OpKind.INCREASE_PAID_STORAGE:return this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e}))));default:throw new s.InvalidOperationKindError(JSON.stringify(e.kind))}}))}with(e){for(const t of e)switch(t.kind){case o.OpKind.TRANSACTION:this.withTransfer(t);break;case o.OpKind.ORIGINATION:this.withOrigination(t);break;case o.OpKind.DELEGATION:this.withDelegation(t);break;case o.OpKind.INCREASE_PAID_STORAGE:this.withIncreasePaidStorage(t);break;default:throw new s.InvalidOperationKindError(JSON.stringify(t.kind))}return this}send(){return n(this,void 0,void 0,(function*(){const e=[];for(const t of this.operations)e.push(yield this.mapOperation(t));const t=yield this.walletProvider.sendOperations(e);return this.context.operationFactory.createBatchOperation(t)}))}}t.WalletOperationBatch=c;t.Wallet=class{constructor(e){this.context=e,this.walletCommand=e=>({send:e})}get walletProvider(){return this.context.walletProvider}pkh(){return n(this,arguments,void 0,(function*({forceRefetch:e}={}){return this._pkh&&!e||(this._pkh=yield this.walletProvider.getPKH()),this._pkh}))}pk(){return n(this,arguments,void 0,(function*({forceRefetch:e}={}){return this._pk&&!e||(this._pk=yield this.walletProvider.getPK()),this._pk}))}originate(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapOriginateParamsToWalletParams((()=>this.context.parser.prepareCodeOrigination(Object.assign({},e)))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createOriginationOperation(r)}))))}setDelegate(e){var t;const r=(0,a.validateAddress)(null!==(t=e.delegate)&&void 0!==t?t:"");if(e.delegate&&r!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.delegate,(0,a.invalidDetail)(r));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createDelegationOperation(r)}))))}signFailingNoop(e){return n(this,void 0,void 0,(function*(){const t={kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary},r=yield this.context.readProvider.getBlockHash(e.basedOnBlock),n=yield this.context.forger.forge({branch:r,contents:[t]});return{signature:yield this.walletProvider.sign(n,Uint8Array.from([3])),bytes:n,signedContent:{branch:r,contents:[{kind:o.OpKind.FAILING_NOOP,arbitrary:e.arbitrary}]}}}))}registerDelegate(){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const e=yield this.walletProvider.mapDelegateParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return{delegate:yield this.pkh()}})))),t=yield this.walletProvider.sendOperations([e]);return this.context.operationFactory.createDelegationOperation(t)}))))}transfer(e){const t=(0,a.validateAddress)(e.to);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.to,(0,a.invalidDetail)(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapTransferParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransactionOperation(r)}))))}transferTicket(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapTransferTicketParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransferTicketOperation(r)}))))}stake(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapStakeParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){const t=yield this.pkh();if(e.to||(e.to=t),e.to!==t)throw new s.InvalidStakingAddressError(e.to);return e.parameter={entrypoint:"stake",value:{prim:"Unit"}},e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createTransactionOperation(r)}))))}unstake(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapUnstakeParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){const t=yield this.pkh();if(e.to||(e.to=t),e.to!==t)throw new s.InvalidStakingAddressError(e.to);return e.parameter={entrypoint:"unstake",value:{prim:"Unit"}},e})))),r=yield this.walletProvider.sendOperations([t]);return yield this.context.operationFactory.createTransactionOperation(r)}))))}finalizeUnstake(e){return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapFinalizeUnstakeParamsToWalletParams((()=>n(this,void 0,void 0,(function*(){const t=yield this.pkh();if(e.to||(e.to=t),e.to!==t)throw new s.InvalidStakingAddressError(e.to);if(e.amount||(e.amount=0),0!==e.amount)throw new s.InvalidFinalizeUnstakeAmountError("Amount must be 0 to finalize unstake.");return e.parameter={entrypoint:"finalize_unstake",value:{prim:"Unit"}},e})))),r=yield this.walletProvider.sendOperations([t]);return yield this.context.operationFactory.createTransactionOperation(r)}))))}increasePaidStorage(e){const t=(0,a.validateAddress)(e.destination);if(t!==a.ValidationResult.VALID)throw new s.InvalidAddressError(e.destination,(0,a.invalidDetail)(t));return this.walletCommand((()=>n(this,void 0,void 0,(function*(){const t=yield this.walletProvider.mapIncreasePaidStorageWalletParams((()=>n(this,void 0,void 0,(function*(){return e})))),r=yield this.walletProvider.sendOperations([t]);return this.context.operationFactory.createIncreasePaidStorageOperation(r)}))))}batch(e){const t=new c(this.walletProvider,this.context);return Array.isArray(e)&&t.with(e),t}at(e){return n(this,arguments,void 0,(function*(e,t=e=>e){const r=(0,a.validateContractAddress)(e);if(r!==a.ValidationResult.VALID)throw new s.InvalidContractAddressError(e,(0,a.invalidDetail)(r));const n=this.context.withExtensions().rpc,o=this.context.withExtensions().readProvider,c=yield o.getScript(e,"head"),u=yield o.getEntrypoints(e);return t(new i.ContractAbstraction(e,c,this,this.context.contract,u,n,o),this.context)}))}getPK(){return n(this,void 0,void 0,(function*(){return yield this.pk()}))}}},5423:()=>{},8379:()=>{},3553:()=>{},6483:(e,t,r)=>{"use strict";r.d(t,{A:()=>w,g:()=>E});var n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,l=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=u-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==o(e))throw Error(s+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function v(e){var t=e.c.length-1;return p(e.e/u)==t&&e.c[t]%2!=0}function y(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var E=function e(t){var r,E,w,O,A,S,P,T,R,I,x=$.prototype={constructor:$,toString:null,valueOf:null},M=new $(1),k=20,L=4,C=-7,N=21,j=-1e7,D=1e7,U=!1,B=1,F=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function $(e,t){var r,i,s,c,d,f,h,p,b=this;if(!(b instanceof $))return new $(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>D?b.c=b.e=null:e.e<j?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,d=e;d>=10;d/=10,c++);return void(c>D?b.c=b.e=null:(b.e=c,b.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return w(b,p,f);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(d=p.search(/e/i))>0?(c<0&&(c=d),c+=+p.slice(d+1),p=p.substring(0,d)):c<0&&(c=p.length)}else{if(g(t,2,H.length,"Base"),10==t&&G)return q(b=new $(e),k+b.e+1,L);if(p=String(e),f="number"==typeof e){if(0*e!=0)return w(b,p,f,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,$.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=H.slice(0,t),c=d=0,h=p.length;d<h;d++)if(r.indexOf(i=p.charAt(d))<0){if("."==i){if(d>c){c=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,d=-1,c=0;continue}return w(b,String(e),f,t)}f=!1,(c=(p=E(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(d=0;48===p.charCodeAt(d);d++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(d,++h)){if(h-=d,f&&$.DEBUG&&h>15&&(e>l||e!==o(e)))throw Error(a+b.s*e);if((c=c-d-1)>D)b.c=b.e=null;else if(c<j)b.c=[b.e=0];else{if(b.e=c,b.c=[],d=(c+1)%u,c<0&&(d+=u),d<h){for(d&&b.c.push(+p.slice(0,d)),h-=u;d<h;)b.c.push(+p.slice(d,d+=u));d=u-(p=p.slice(d)).length}else d-=h;for(;d--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function V(e,t,r,n){var i,o,s,a,c;if(null==r?r=L:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=b(e.c),c=1==n||2==n&&(s<=C||s>=N)?y(c,s):_(c,s,"0");else if(o=(e=q(new $(e),t,r)).e,a=(c=b(e.c)).length,1==n||2==n&&(t<=o||o<=C)){for(;a<t;c+="0",a++);c=y(c,o)}else if(t-=s,c=_(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,o=new $(e[0]);i<e.length;i++)(!(n=new $(e[i])).s||(r=m(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function W(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*u-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function q(e,t,r,n){var s,a,l,f,h,p,b,m=e.c,g=d;if(m){e:{for(s=1,f=m[0];f>=10;f/=10,s++);if((a=t-s)<0)a+=u,l=t,h=m[p=0],b=o(h/g[s-l-1]%10);else if((p=i((a+1)/u))>=m.length){if(!n)break e;for(;m.length<=p;m.push(0));h=b=0,s=1,l=(a%=u)-u+1}else{for(h=f=m[p],s=1;f>=10;f/=10,s++);b=(l=(a%=u)-u+s)<0?0:o(h/g[s-l-1]%10)}if(n=n||t<0||null!=m[p+1]||(l<0?h:h%g[s-l-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(a>0?l>0?h/g[s-l]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(u-t%u)%u],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=p,f=1,p--):(m.length=p+1,f=g[u-a],m[p]=l>0?o(h/g[s-l]%g[l])*f:0),n)for(;;){if(0==p){for(a=1,l=m[0];l>=10;l/=10,a++);for(l=m[0]+=f,f=1;l>=10;l/=10,f++);a!=f&&(e.e++,m[0]==c&&(m[0]=1));break}if(m[p]+=f,m[p]!=c)break;m[p--]=0,f=1}for(a=m.length;0===m[--a];m.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=C||r>=N?y(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(s+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),k=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),L=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),C=r[0],N=r[1]):(g(r,-h,h,t),C=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),j=r[0],D=r[1];else{if(g(r,-h,h,t),!r)throw Error(s+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(s+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(s+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,h,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(s+t+" not an object: "+r);K=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(s+t+" invalid: "+r);G="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:k,ROUNDING_MODE:L,EXPONENTIAL_AT:[C,N],RANGE:[j,D],CRYPTO:U,MODULO_MODE:B,POW_PRECISION:F,FORMAT:K,ALPHABET:H}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-h&&i<=h&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=c||r!==o(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(s+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return z(arguments,-1)},$.minimum=$.min=function(){return z(arguments,1)},$.random=(O=9007199254740992,A=Math.random()*O&2097151?function(){return o(Math.random()*O)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,c,l=0,f=[],p=new $(M);if(null==e?e=k:g(e,0,h),a=i(e/u),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)(c=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(f.push(c%1e14),l+=2);l=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(s+"crypto unavailable");for(t=crypto.randomBytes(a*=7);l<a;)(c=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(f.push(c%1e14),l+=7);l=a/7}if(!U)for(;l<a;)(c=A())<9e15&&(f[l++]=c%1e14);for(a=f[--l],e%=u,a&&e&&(c=d[u-e],f[l]=o(a/c)*c);0===f[l];f.pop(),l--);if(l<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=u);for(l=1,c=f[0];c>=10;c/=10,l++);l<u&&(n-=u-l)}return p.e=n,p.c=f,p}),$.sum=function(){for(var e=1,t=arguments,r=new $(t[0]);e<t.length;)r=r.plus(t[e++]);return r},E=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,d,f,h,p,m,g=n.indexOf("."),v=k,y=L;for(g>=0&&(d=F,F=0,n=n.replace(".",""),h=(m=new $(i)).pow(n.length-g),F=d,m.c=t(_(b(h.c),h.e,"0"),10,o,e),m.e=m.c.length),l=d=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--d];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,m,v,y,o)).c,f=h.r,l=h.e),g=p[u=l+v+1],d=o/2,f=f||u<0||null!=p[u+1],f=y<4?(null!=g||f)&&(0==y||y==(h.s<0?3:2)):g>d||g==d&&(4==y||f||6==y&&1&p[u-1]||y==(h.s<0?8:7)),u<1||!p[0])n=f?_(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(p.length=u,f)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(g=0,n="";g<=d;n+=c.charAt(p[g++]));n=_(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%f,l=t/f|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%f)+(n=l*o+(s=e[c]/f|0)*u)%f*f+a)/r|0)+(n/f|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,s,a,l){var d,f,h,b,m,g,v,y,_,E,w,O,A,S,P,T,R,I=n.s==i.s?1:-1,x=n.c,M=i.c;if(!(x&&x[0]&&M&&M[0]))return new $(n.s&&i.s&&(x?!M||x[0]!=M[0]:M)?x&&0==x[0]||!M?0*I:I/0:NaN);for(_=(y=new $(I)).c=[],I=s+(f=n.e-i.e)+1,l||(l=c,f=p(n.e/u)-p(i.e/u),I=I/u|0),h=0;M[h]==(x[h]||0);h++);if(M[h]>(x[h]||0)&&f--,I<0)_.push(1),b=!0;else{for(S=x.length,T=M.length,h=0,I+=2,(m=o(l/(M[0]+1)))>1&&(M=e(M,m,l),x=e(x,m,l),T=M.length,S=x.length),A=T,w=(E=x.slice(0,T)).length;w<T;E[w++]=0);R=M.slice(),R=[0].concat(R),P=M[0],M[1]>=l/2&&P++;do{if(m=0,(d=t(M,E,T,w))<0){if(O=E[0],T!=w&&(O=O*l+(E[1]||0)),(m=o(O/P))>1)for(m>=l&&(m=l-1),v=(g=e(M,m,l)).length,w=E.length;1==t(g,E,v,w);)m--,r(g,T<v?R:M,v,l),v=g.length,d=1;else 0==m&&(d=m=1),v=(g=M.slice()).length;if(v<w&&(g=[0].concat(g)),r(E,g,w,l),w=E.length,-1==d)for(;t(M,E,T,w)<1;)m++,r(E,T<w?R:M,w,l),w=E.length}else 0===d&&(m++,E=[0]);_[h++]=m,E[0]?E[w++]=x[A]||0:(E=[x[A]],w=1)}while((A++<S||null!=E[0])&&I--);b=null!=E[0],_[0]||_.splice(0,1)}if(l==c){for(h=1,I=_[0];I>=10;I/=10,h++);q(y,s+(y.e=h+f*u-1)+1,a,b)}else y.e=f,y.r=+b;return y}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,T=/^\.([^.]+)$/,R=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,w=function(e,t,r,n){var i,o=r?t:t.replace(I,"");if(R.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(S,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(P,"$1").replace(T,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(s+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},x.absoluteValue=x.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return m(this,new $(e,t))},x.decimalPlaces=x.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=L:g(t,0,8),q(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/u))*u,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},x.dividedBy=x.div=function(e,t){return r(this,new $(e,t),k,L)},x.dividedToIntegerBy=x.idiv=function(e,t){return r(this,new $(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var r,n,a,c,l,d,f,h,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(s+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new $(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new $(Math.pow(+Z(p),l?e.s*(2-v(e)):+Z(e))),t?h.mod(t):h;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!d&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return c=p.s<0&&v(e)?-0:0,p.e>-1&&(c=1/c),new $(d?1/c:c);F&&(c=i(F/u+2))}for(l?(r=new $(.5),d&&(e.s=1),f=v(e)):f=(a=Math.abs(+Z(e)))%2,h=new $(M);;){if(f){if(!(h=h.times(p)).c)break;c?h.c.length>c&&(h.c.length=c):n&&(h=h.mod(t))}if(a){if(0===(a=o(a/2)))break;f=a%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=v(e);else{if(0===(a=+Z(e)))break;f=a%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):n&&(p=p.mod(t))}return n?h:(d&&(h=M.div(h)),t?h.mod(t):c?q(h,F,L,undefined):h)},x.integerValue=function(e){var t=new $(this);return null==e?e=L:g(e,0,8),q(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===m(this,new $(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return m(this,new $(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=m(this,new $(e,t)))||0===t},x.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return m(this,new $(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=m(this,new $(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var l=s.e/u,d=e.e/u,f=s.c,h=e.c;if(!l||!d){if(!f||!h)return f?(e.s=-t,e):new $(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new $(f[0]?s:3==L?-0:0)}if(l=p(l),d=p(d),f=f.slice(),a=l-d){for((o=a<0)?(a=-a,i=f):(d=l,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(f[t]!=h[t]){o=f[t]<h[t];break}if(o&&(i=f,f=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=c-1;n>a;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=c}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--d);return f[0]?W(e,f,d):(e.s=3==L?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var n,i,o=this;return e=new $(e,t),!o.c||!e.s||e.c&&!e.c[0]?new $(NaN):!e.c||o.c&&!o.c[0]?new $(o):(9==B?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,B),(e=o.minus(n.times(e))).c[0]||1!=B||(e.s=o.s),e)},x.multipliedBy=x.times=function(e,t){var r,n,i,o,s,a,l,d,h,b,m,g,v,y,_,E=this,w=E.c,O=(e=new $(e,t)).c;if(!(w&&O&&w[0]&&O[0]))return!E.s||!e.s||w&&!w[0]&&!O||O&&!O[0]&&!w?e.c=e.e=e.s=null:(e.s*=E.s,w&&O?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(E.e/u)+p(e.e/u),e.s*=E.s,(l=w.length)<(b=O.length)&&(v=w,w=O,O=v,i=l,l=b,b=i),i=l+b,v=[];i--;v.push(0));for(y=c,_=f,i=b;--i>=0;){for(r=0,m=O[i]%_,g=O[i]/_|0,o=i+(s=l);o>i;)r=((d=m*(d=w[--s]%_)+(a=g*d+(h=w[s]/_|0)*m)%_*_+v[o]+r)/y|0)+(a/_|0)+g*h,v[o--]=d%y;v[o]=r}return r?++n:v.splice(0,1),W(e,v,n)},x.negated=function(){var e=new $(this);return e.s=-e.s||null,e},x.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/u,s=e.e/u,a=n.c,l=e.c;if(!o||!s){if(!a||!l)return new $(i/0);if(!a[0]||!l[0])return l[0]?e:new $(a[0]?n:0*i)}if(o=p(o),s=p(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=l):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=l.length)<0&&(r=l,l=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+l[t]+i)/c|0,a[t]=c===a[t]?0:a[t]%c;return i&&(a=[i].concat(a),++s),W(e,a,s)},x.precision=x.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,h),null==t?t=L:g(t,0,8),q(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*u+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},x.shiftedBy=function(e){return g(e,-9007199254740991,l),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=k+4,d=new $("0.5");if(1!==c||!a||!a[0])return new $(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+Z(s)))||c==1/0?(((t=b(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=p((u+1)/2)-(u<0||u%2),n=new $(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new $(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=d.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,c)===(t=b(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,n.e+k+2,1),e=!n.times(n).eq(s));break}if(!i&&(q(o,o.e+k+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return q(n,n.e+k+1,L,e)},x.toExponential=function(e,t){return null!=e&&(g(e,0,h),e++),V(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(g(e,0,h),e=e+this.e+1),V(this,e,t)},x.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=K;else if("object"!=typeof r)throw Error(s+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",d=a[0],f=a[1],h=i.s<0,p=h?d.slice(1):d,b=p.length;if(u&&(o=c,c=u,u=o,b-=o),c>0&&b>0){for(o=b%c||c,d=p.substr(0,o);o<b;o+=c)d+=l+p.substr(o,c);u>0&&(d+=l+p.slice(o)),h&&(d="-"+d)}n=f?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):d}return(r.prefix||"")+n+(r.suffix||"")},x.toFraction=function(e){var t,n,i,o,a,c,l,f,h,p,m,g,v=this,y=v.c;if(null!=e&&(!(l=new $(e)).isInteger()&&(l.c||1!==l.s)||l.lt(M)))throw Error(s+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+Z(l));if(!y)return new $(v);for(t=new $(M),h=n=new $(M),i=f=new $(M),g=b(y),a=t.e=g.length-v.e-1,t.c[0]=d[(c=a%u)<0?u+c:c],e=!e||l.comparedTo(t)>0?a>0?t:h:l,c=D,D=1/0,l=new $(g),f.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,h=f.plus(p.times(o=h)),f=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(h)),n=n.plus(o.times(i)),f.s=h.s=v.s,m=r(h,i,a*=2,L).minus(v).abs().comparedTo(r(f,n,a,L).minus(v).abs())<1?[h,i]:[f,n],D=c,m},x.toNumber=function(){return+Z(this)},x.toPrecision=function(e,t){return null!=e&&g(e,1,h),V(this,e,t,2)},x.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=C||i>=N?y(b(r.c),i):_(b(r.c),i,"0"):10===e&&G?t=_(b((r=q(new $(r),k+i+1,L)).c),r.e,"0"):(g(e,2,H.length,"Base"),t=E(_(b(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return Z(this)},x._isBigNumber=!0,x[Symbol.toStringTag]="BigNumber",x[Symbol.for("nodejs.util.inspect.custom")]=x.valueOf,null!=t&&$.set(t),$}();const w=E},183:e=>{"use strict";e.exports={rE:"6.6.1"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(4779)})()));
|