koilib 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see koinos.min.js.LICENSE.txt */
2
- (()=>{var __webpack_modules__={8820: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 f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var 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 f=t[e.charCodeAt(r)];if(255===f)return;for(var l=0,h=o-1;(0!==f||l<i)&&-1!==h;h--,l++)f+=s*u[h]>>>0,u[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===u[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=u[d++];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,f=new Uint8Array(c);i!==o;){for(var l=t[i],h=0,d=c-1;(0!==l||h<n)&&-1!==d;d--,h++)l+=256*f[d]>>>0,f[d]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");n=h,i++}for(var p=c-n;p!==c&&0===f[p];)p++;for(var y=a.repeat(r);p<c;++p)y+=e.charAt(f[p]);return y},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(8089);class i extends n.Hash{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");const{view:t,buffer:r,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");const s=(e=(0,n.toBytes)(e)).length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a!==i)r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,n.createView)(e);for(;i<=s-o;o+=i)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(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)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);const a=(0,n.createView)(e);this.get().forEach(((e,t)=>a.setUint32(4*t,e,o)))}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.SHA2=i},4421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(7505),i=r(8089),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((e,t)=>t)),a=s.map((e=>(9*e+5)%16));let c=[s],u=[a];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map((e=>o[e])));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),l=c.map(((e,t)=>e.map((e=>f[t][e])))),h=u.map(((e,t)=>e.map((e=>f[t][e])))),d=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(e,t)=>e<<t|e>>>32-t;function m(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const g=new Uint32Array(16);class v extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,s=0|this.h2,a=s,f=0|this.h3,v=f,b=0|this.h4,w=b;for(let e=0;e<5;e++){const t=4-e,_=d[e],A=p[e],O=c[e],E=u[e],k=l[e],S=h[e];for(let t=0;t<16;t++){const n=y(r+m(e,i,s,f)+g[O[t]]+_,k[t])+b|0;r=b,b=f,f=0|y(s,10),s=i,i=n}for(let e=0;e<16;e++){const r=y(n+m(t,o,a,v)+g[E[e]]+A,S[e])+w|0;n=w,w=v,v=0|y(a,10),a=o,o=r}}this.set(this.h1+s+v|0,this.h2+f+w|0,this.h3+b+n|0,this.h4+r+o|0,this.h0+i+a|0)}roundClean(){g.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=v,t.ripemd160=(0,i.wrapConstructor)((()=>new v))},3061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(7505),i=r(8089),o=(e,t,r)=>e&t^e&r^t&r,s=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]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[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)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[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;c[e]=o+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:f,F:l,G:h,H:d}=this;for(let e=0;e<64;e++){const t=d+((0,i.rotr)(f,6)^(0,i.rotr)(f,11)^(0,i.rotr)(f,25))+((p=f)&l^~p&h)+s[e]+c[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;d=h,h=l,l=f,f=u+t|0,u=a,a=n,n=r,r=t+y|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,f=f+this.E|0,l=l+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(r,n,a,u,f,l,h,d)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)((()=>new u))},8089:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.assertHash=t.assertBytes=t.assertBool=t.assertNumber=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4421);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}function a(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}t.bytesToHex=function(e){let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o))throw new Error("Invalid byte sequence");t[r]=o}return t},t.nextTick=(()=>{const t="function"==typeof e.require&&e.require.bind(e);try{if(t){const{setImmediate:e}=t("timers");return()=>new Promise((t=>e(t)))}}catch(e){}return()=>new Promise((e=>setTimeout(e,0)))})(),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=o,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),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.assertNumber=a,t.assertBool=function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},t.assertBytes=function(e,...t){if(!(e instanceof Uint8Array)||t.length&&!t.includes(e.length))throw new TypeError(`Expected ${t} bytes, not ${typeof e} with length=${e.length}`)},t.assertHash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");a(e.outputLen),a(e.blockLen)},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(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(s(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.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},9656:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const i=n(r(9159)),o=BigInt(0),s=BigInt(1),a=BigInt(2),c=BigInt(3),u=BigInt(8),f=a**BigInt(256),l={a:o,b:BigInt(7),P:f-a**BigInt(32)-BigInt(977),n:f-BigInt("432420386565659656852420866394968145599"),h:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function h(e){const{a:t,b:r}=l,n=N(e*e),i=N(n*e);return N(i+t*e+r)}t.CURVE=l;const d=l.a===o;class p{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof m))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new p(e.x,e.y,s)}static toAffineBatch(e){const t=function(e,t=l.P){const r=e.length,n=new Array(r);let i=s;for(let s=0;s<r;s++)e[s]!==o&&(n[s]=i,i=N(i*e[s],t));i=R(i,t);for(let s=r-1;s>=0;s--){if(e[s]===o)continue;const r=N(i*e[s],t);e[s]=N(i*n[s],t),i=r}return e}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return p.toAffineBatch(e).map(p.fromAffine)}equals(e){const t=this,r=e,n=N(t.z*t.z),i=N(t.z*n),o=N(r.z*r.z),s=N(r.z*o);return N(t.x*o)===N(n*r.x)&&N(t.y*s)===N(i*r.y)}negate(){return new p(this.x,N(-this.y),this.z)}double(){const e=this.x,t=this.y,r=this.z,n=N(e**a),i=N(t**a),o=N(i**a),s=N(a*(N(N((e+i)**a))-n-o)),f=N(c*n),l=N(f**a),h=N(l-a*s),d=N(f*(s-h)-u*o),y=N(a*t*r);return new p(h,d,y)}add(e){if(!(e instanceof p))throw new TypeError("JacobianPoint#add: expected JacobianPoint");const t=this.x,r=this.y,n=this.z,i=e.x,s=e.y,c=e.z;if(i===o||s===o)return this;if(t===o||r===o)return e;const u=N(n**a),f=N(c**a),l=N(t*f),h=N(i*u),d=N(r*c*f),y=N(N(s*n)*u),m=N(h-l),g=N(y-d);if(m===o)return g===o?this.double():p.ZERO;const v=N(m**a),b=N(m*v),w=N(l*v),_=N(g**a-b-a*w),A=N(g*(w-_)-d*b),O=N(n*c*m);return new p(_,A,O)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){let t=T(e);if(!d){let e=p.ZERO,r=this;for(;t>o;)t&s&&(e=e.add(r)),r=r.double(),t>>=s;return e}let{k1neg:r,k1:n,k2neg:i,k2:a}=D(t),c=p.ZERO,u=p.ZERO,f=this;for(;n>o||a>o;)n&s&&(c=c.add(f)),a&s&&(u=u.add(f)),f=f.double(),n>>=s,a>>=s;return r&&(c=c.negate()),i&&(u=u.negate()),u=new p(N(u.x*l.beta),u.y,u.z),c.add(u)}precomputeWindow(e){const t=d?128/e+1:256/e+1,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(p.BASE)&&(t=m.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&y.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=p.normalizeZ(n),y.set(t,n)));let i=p.ZERO,o=p.ZERO;const a=d?128/r+1:256/r+1,c=2**(r-1),u=BigInt(2**r-1),f=2**r,l=BigInt(r);for(let t=0;t<a;t++){const r=t*c;let a=Number(e&u);if(e>>=l,a>c&&(a-=f,e+=s),0===a){let e=n[r];t%2&&(e=e.negate()),o=o.add(e)}else{let e=n[r+Math.abs(a)-1];a<0&&(e=e.negate()),i=i.add(e)}}return{p:i,f:o}}multiply(e,t){let r,n,i=T(e);if(d){let{k1neg:e,k1:o,k2neg:s,k2:a}=D(i),{p:c,f:u}=this.wNAF(o,t),{p:f,f:h}=this.wNAF(a,t);e&&(c=c.negate()),s&&(f=f.negate()),f=new p(N(f.x*l.beta),f.y,f.z),r=c.add(f),n=u.add(h)}else{let{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return p.normalizeZ([r,n])[0]}toAffine(e=R(this.z)){const t=e**a,r=N(this.x*t),n=N(this.y*t*e);return new m(r,n)}}p.BASE=new p(l.Gx,l.Gy,s),p.ZERO=new p(o,s,o);const y=new WeakMap;class m{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=B(t?e:e.slice(1));let n=function(e){const{P:t}=l,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),f=e*e*e%t,h=f*f*e%t,d=I(h,c)*h%t,p=I(d,c)*h%t,y=I(p,a)*f%t,m=I(y,n)*y%t,g=I(m,i)*m%t,v=I(g,s)*g%t,b=I(v,u)*v%t,w=I(b,s)*g%t,_=I(w,c)*h%t,A=I(_,o)*m%t,O=I(A,r)*f%t;return I(O,a)}(h(r));const i=(n&s)===s;t?i&&(n=N(-n)):1==(1&e[0])!==i&&(n=N(-n));const o=new m(r,n);return o.assertValidity(),o}static fromUncompressedHex(e){const t=B(e.slice(1,33)),r=B(e.slice(33)),n=new m(t,r);return n.assertValidity(),n}static fromHex(e){const t=j(e),r=t[0];if(32===t.length||33===t.length&&(2===r||3===r))return this.fromCompressedHex(t);if(65===t.length&&4===r)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${t.length}`)}static fromPrivateKey(e){return m.BASE.multiply(L(e))}static fromSignature(e,t,r){let n=e instanceof Uint8Array?B(e):S(e);const i=M(t),{r:o,s}=i;if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");const a=2+(1&r),c=m.fromHex(`0${a}${O(o)}`),u=p.fromAffine(c).multiplyUnsafe(s),f=p.BASE.multiply(n),h=R(o,l.n),d=u.subtract(f).multiplyUnsafe(h).toAffine();return d.assertValidity(),d}toRawBytes(e=!1){return x(this.toHex(e))}toHex(e=!1){const t=O(this.x);return e?`${this.y&s?"03":"02"}${t}`:`04${t}${O(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!z(t)||!z(r))throw new Error(e);const n=N(r*r);if(N(n-h(t))!==o)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new m(this.x,N(-this.y))}double(){return p.fromAffine(this).double().toAffine()}add(e){return p.fromAffine(this).add(p.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return p.fromAffine(this).multiply(e,this).toAffine()}}function g(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function v(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${A(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:B(r),left:e.subarray(t+2)}}t.Point=m,m.BASE=new m(l.Gx,l.Gy),m.ZERO=new m(o,o);class b{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?A(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new b(S(n.slice(0,64)),S(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${A(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=v(e.subarray(2)),{data:n,left:i}=v(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${A(i)}`);return{r:t,s:n}}(t?e:x(e));return new b(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!$(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!$(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=l.n>>s;return this.s>e}normalizeS(){return this.hasHighS()?new b(this.r,l.n-this.s):this}toDERRawBytes(e=!1){return x(this.toDERHex(e))}toDERHex(e=!1){const t=g(k(this.s));if(e)return t;const r=g(k(this.r)),n=k(r.length/2),i=k(t.length/2);return`30${k(r.length/2+t.length/2+4)}02${n}${r}02${i}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return x(this.toCompactHex())}toCompactHex(){return O(this.r)+O(this.s)}}function w(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),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.Signature=b;const _=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function A(e){let t="";for(let r=0;r<e.length;r++)t+=_[e[r]];return t}function O(e){if(e>f)throw new Error("pad64: invalid number");return e.toString(16).padStart(64,"0")}function E(e){return x(O(e))}function k(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function S(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function x(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o))throw new Error("Invalid byte sequence");t[r]=o}return t}function j(e){return e instanceof Uint8Array?e:x(e)}function B(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return S(A(e))}function T(e){if("number"==typeof e&&e>0&&Number.isSafeInteger(e))return BigInt(e);if("bigint"==typeof e&&$(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function N(e,t=l.P){const r=e%t;return r>=0?r:t+r}function I(e,t){const{P:r}=l;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function R(e,t=l.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=N(e,t),n=t,i=o,a=s,c=s,u=o;for(;r!==o;){const e=n/r,t=n%r,o=i-c*e,s=a-u*e;n=r,r=t,i=c,a=u,c=o,u=s}if(n!==s)throw new Error("invert: does not exist");return N(i,t)}const P=(e,t)=>(e+t/a)/t,U=a**BigInt(128);function D(e){const{n:t}=l,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-s*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=P(o*e,t),c=P(-n*e,t);let u=N(e-a*r-c*i,t),f=N(-a*n-c*o,t);const h=u>U,d=f>U;if(h&&(u=t-u),d&&(f=t-f),u>U||f>U)throw new Error("splitScalarEndo: Endomorphism failed");return{k1neg:h,k1:u,k2neg:d,k2:f}}class C{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...e){return t.utils.hmacSha256(this.k,...e)}hmacSync(...e){if("function"!=typeof t.utils.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const r=t.utils.hmacSha256Sync(this.k,...e);if(r instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return r}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function $(e){return o<e&&e<l.n}function z(e){return 0n<e&&e<l.P}function H(e,t,r){const n=B(e);if(!$(n))return;const{n:i}=l,a=m.BASE.multiply(n),c=N(a.x,i);if(c===o)return;const u=N(R(n,i)*N(t+r*c,i),i);if(u===o)return;const f=new b(c,u);return{sig:f,recovery:(a.x===f.r?0:2)|Number(a.y&s)}}function L(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=S(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=B(e)}if(!$(t))throw new Error("Expected private key: 0 < key < n");return t}function J(e){return e instanceof m?(e.assertValidity(),e):m.fromHex(e)}function M(e){if(e instanceof b)return e.assertValidity(),e;try{return b.fromDER(e)}catch(t){return b.fromCompact(e)}}function F(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof m}function K(e){return B(e.length>32?e.slice(0,32):e)}function q(e){const t=K(e),r=N(t,l.n);return V(r<o?t:r)}function V(e){if("bigint"!=typeof e)throw new Error("Expected bigint");return x(O(e))}function G(e,r,n){if(null==e)throw new Error(`sign: expected valid msgHash, not "${e}"`);const i=j(e),o=L(r),s=[V(o),q(i)];if(null!=n){!0===n&&(n=t.utils.randomBytes(32));const e=E(B(j(n)));if(32!==e.length)throw new Error("secp256k1: Expected 32 bytes of extra data");s.push(e)}return{seed:w(...s),m:K(i),d:o}}function W(e,t){let{sig:r,recovery:n}=e;const{canonical:i,der:o,recovered:s}=Object.assign({canonical:!0,der:!0},t);i&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=o?r.toDERRawBytes():r.toCompactRawBytes();return s?[a,n]:a}t.getPublicKey=function(e,t=!1){return m.fromPrivateKey(e).toRawBytes(t)},t.recoverPublicKey=function(e,t,r){return m.fromSignature(e,t,r).toRawBytes()},t.getSharedSecret=function(e,t,r=!1){if(F(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!F(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=J(t);return n.assertValidity(),n.multiply(L(e)).toRawBytes(r)},t.sign=async function(e,t,r={}){const{seed:n,m:i,d:o}=G(e,t,r.extraEntropy);let s;const a=new C;for(await a.reseed(n);!(s=H(await a.generate(),i,o));)await a.reseed();return W(s,r)},t.signSync=function(e,t,r={}){const{seed:n,m:i,d:o}=G(e,t,r.extraEntropy);let s;const a=new C;for(a.reseedSync(n);!(s=H(a.generateSync(),i,o));)a.reseedSync();return W(s,r)};const Z={strict:!0};async function X(e,...r){const n=new Uint8Array(e.split("").map((e=>e.charCodeAt(0)))),i=await t.utils.sha256(n);return B(await t.utils.sha256(w(i,i,...r)))}async function Q(e,t,r){const n=E(e);return N(await X("BIP0340/challenge",n,t.toRawX(),r),l.n)}function Y(e){return N(e.y,a)===o}t.verify=function(e,t,r,n=Z){let i;try{i=M(e)}catch(e){return!1}const{r:s,s:a}=i;if(n.strict&&i.hasHighS())return!1;const c=function(e){"string"!=typeof e&&(e=A(e));let t=S(e||"0");const r=e.length/2*8-256;return r>0&&(t>>=BigInt(r)),t>=l.n&&(t-=l.n),t}(t);if(c===o)return!1;let u;try{u=p.fromAffine(J(r))}catch(e){return!1}const{n:f}=l,h=R(a,f),d=N(c*h,f),y=N(s*h,f),m=p.BASE.multiply(d),g=u.multiplyUnsafe(y);return N(m.add(g).toAffine().x,f)===s};class ee{constructor(e,t){if(this.r=e,this.s=t,!z(e)||!$(t))throw new Error("Invalid signature")}static fromHex(e){const t=j(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=B(t.slice(0,32)),n=B(t.slice(32,64));return new ee(r,n)}toHex(){return O(this.r)+O(this.s)}toRawBytes(){return x(this.toHex())}}async function te(e,t,r){const n=e instanceof ee?e:ee.fromHex(e),i=j(t),o=J(r),s=await Q(n.r,o,i),a=m.fromPrivateKey(n.s),c=o.multiply(s),u=a.subtract(c);return!(u.equals(m.BASE)||!Y(u)||u.x!==n.r)}t.schnorr={Signature:ee,getPublicKey:function(e){return m.fromPrivateKey(e).toRawX()},sign:async function(e,r,n=t.utils.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);const{n:i}=l,s=j(e),a=L(r),c=j(n);if(32!==c.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const u=m.fromPrivateKey(a),f=Y(u)?a:i-a,h=f^await X("BIP0340/aux",c),d=N(await X("BIP0340/nonce",E(h),u.toRawX(),s),i);if(d===o)throw new Error("sign: Creation of signature failed. k is zero");const p=m.fromPrivateKey(d),y=Y(p)?d:i-d,g=await Q(p.x,u,s),v=new ee(p.x,N(y+g*f,i));if(!await te(v.toRawBytes(),s,u.toRawX()))throw new Error("sign: Invalid signature produced");return v.toRawBytes()},verify:te},m.BASE._setWindowSize(8);const re={node:i.default,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0};t.utils={isValidPrivateKey(e){try{return L(e),!0}catch(e){return!1}},randomBytes:(e=32)=>{if(re.web)return re.web.getRandomValues(new Uint8Array(e));if(re.node){const{randomBytes:t}=re.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>{let e=8;for(;e--;){const e=t.utils.randomBytes(32),r=B(e);if($(r)&&r!==s)return e}throw new Error("Valid private key was not found in 8 iterations. PRNG is broken")},bytesToHex:A,sha256:async e=>{if(re.web){const t=await re.web.subtle.digest("SHA-256",e.buffer);return new Uint8Array(t)}if(re.node){const{createHash:t}=re.node;return Uint8Array.from(t("sha256").update(e).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(re.web){const r=await re.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=w(...t),i=await re.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(re.node){const{createHmac:r}=re.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(e=8,t=m.BASE){const r=t===m.BASE?t:new m(t.x,t.y);return r._setWindowSize(e),r.multiply(c),r}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,s){r[n]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,s=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:s[a++]=n[u>>2],i=(3&u)<<4,c=1;break;case 1:s[a++]=n[i|u>>4],i=(15&u)<<2,c=2;break;case 2:s[a++]=n[i|u>>6],s[a++]=n[63&u],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=n[i],s[a++]=61,1===c&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=i[u]))throw Error(s);switch(a){case 0:n=u,a=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,a=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,a=3;break;case 3:t[r++]=(3&n)<<6|u,a=0}}if(1===a)throw Error(s);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!=typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u<s.length;)a[u]=s[u],c[u]=e[s[u++]];return a[u]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var f=new Array(arguments.length-1),l=0;l<f.length;)f[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=f[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),l!==f.length)throw Error("parameter count mismatch");return n.push(e),i}function o(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=o;var n=r(4537),i=r(7199)("fs");function o(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,i,o+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function s(e,t,r,n,i){var o=e(n,i+t),s=e(n,i+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return e(r);s+r>n&&(o=e(n),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],s=0;t<r;)(n=e[t++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},r.write=function(e,t,r){for(var n,i,o=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},556:(e,t,r)=>{"use strict";const{encodeText:n}=r(2413);e.exports=class{constructor(e,t,r,i){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=i,this.codec=r(i)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}},5077:(e,t,r)=>{"use strict";const n=r(8820),i=r(556),{rfc4648:o}=r(6727),{decodeText:s,encodeText:a}=r(2413),c=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],u=c.reduce(((e,t)=>(e[t[0]]=new i(t[0],t[1],t[2],t[3]),e)),{}),f=c.reduce(((e,t)=>(e[t[1]]=u[t[0]],e)),{});e.exports={names:u,codes:f}},6957:(e,t,r)=>{"use strict";const n=r(5077),{encodeText:i,decodeText:o,concat:s}=r(2413);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(o(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=i(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(e){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),a(e[0])};const c=Object.freeze(n.names),u=Object.freeze(n.codes);t.names=c,t.codes=u},6727:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,c=0;for(let t=0;t<i;++t){const i=n[e[t]];if(void 0===i)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|i,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o})(r,t,e)})}},2413:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}}},4492:(e,t,r)=>{"use strict";e.exports=r(8836)},3996:(e,t,r)=>{"use strict";var n=t,i=r(7025),o=r(9935);function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var o=t.resolvedType.values,s=Object.keys(o),a=0;a<s.length;++a)t.repeated&&o[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",o[s[a]])("m%s=%j",n,o[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var a=t[n].resolve(),c=o.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,n,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,n,c+"[i]")("}")("}")):(a.resolvedType instanceof i||r("if(d%s!=null){",c),s(r,a,n,c),a.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?s:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",o.safeProp(n[u].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),u=0;u<s.length;++u)r("d%s={}",o.safeProp(s[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var f=c[u],l=o.safeProp(f.name);if(f.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",l,f.resolvedType.valuesById[f.typeDefault],f.typeDefault);else if(f.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",f.typeDefault.low,f.typeDefault.high,f.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,f.typeDefault.toString(),f.typeDefault.toNumber());else if(f.bytes){var h="["+Array.prototype.slice.call(f.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,f.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,f.typeDefault)}r("}")}var d=!1;for(u=0;u<t.length;++u){f=t[u];var p=e._fieldsArray.indexOf(f);l=o.safeProp(f.name),f.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),a(r,f,p,l+"[ks2[j]]")("}")):f.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(r,f,p,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,f.name),a(r,f,p,l),f.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(f.partOf.name),f.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof n?"int32":a.type,u="m"+o.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[a.keyType]?t("k=%j",i.defaults[a.keyType]):t("k=null"),void 0!==i.defaults[c]?t("value=%j",i.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===i.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===i.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===i.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var f=e._fieldsArray[r];f.required&&t("if(!m.hasOwnProperty(%j))",f.name)("throw util.ProtocolError(%j,{instance:m})",s(f))}return t("return m")};var n=r(7025),i=r(7063),o=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(o.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),f=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof n?"int32":u.type,h=i.basic[l];t="m"+o.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",f,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[l]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,f,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,f,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return r("return w")};var n=r(7025),i=r(7063),o=r(9935);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var i=r(9313),o=r(9935);function s(e,t,r,i,o){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var i,o=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,i,o,u,f){if(a.isObject(i)?(f=o,u=i,i=o=void 0):a.isObject(o)&&(f=u,u=o,o=void 0),n.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!a.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=f}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new u(o,e,t,r,{default:n}))}},u._configure=function(e){i=e}},8836:(e,t,r)=>{"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=i,i()},6039:(e,t,r)=>{"use strict";e.exports=s;var n=r(3548);((s.prototype=Object.create(n.prototype)).constructor=s).className="MapField";var i=r(7063),o=r(9935);function s(e,t,r,i,s,a){if(n.call(this,e,t,i,void 0,void 0,s,a),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new s(i,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=o;var n=r(3243);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(9935);function o(e,t,r,o,s,a,c,u,f){if(i.isObject(s)?(c=s,s=a=void 0):i.isObject(a)&&(c=a,a=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=o,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=f}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=l;var n=r(3243);((l.prototype=Object.create(n.prototype)).constructor=l).className="Namespace";var i,o,s,a=r(3548),c=r(7598),u=r(9935);function f(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=f,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",f(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(r[n],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof i||e instanceof s||e instanceof o||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},l.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof l&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof l&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,r){i=e,o=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(9935);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var s=o[e];i.setProperty(s,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var a={};a[e]=t,n.push(a)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="OneOf";var i=r(3548),o=r(9935);function s(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},1408:(e,t,r)=>{"use strict";e.exports=c;var n,i=r(9693),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,f="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new n(e):f(e)})(e)}:f};function h(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=l(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=o;var n=r(1408);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},9424:(e,t,r)=>{"use strict";e.exports=l;var n=r(9313);((l.prototype=Object.create(n.prototype)).constructor=l).className="Root";var i,o,s,a=r(3548),c=r(7025),u=r(7598),f=r(9935);function l(e){n.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=f.path.resolve,l.prototype.fetch=f.fetch,l.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return f.asPromise(e,i,t,r);var a=n===h;function c(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function l(e,t){try{if(f.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),f.isString(t)){o.filename=e;var n,s=o(t,i,r),l=0;if(s.imports)for(;l<s.imports.length;++l)(n=u(s.imports[l])||i.resolvePath(e,s.imports[l]))&&d(n);if(s.weakImports)for(l=0;l<s.weakImports.length;++l)(n=u(s.weakImports[l])||i.resolvePath(e,s.weakImports[l]))&&d(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||p||c(null,i)}function d(e,t){if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in s)a?l(e,s[e]):(++p,setTimeout((function(){--p,l(e,s[e])})));else if(a){var r;try{r=f.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,r)}else++p,i.fetch(e,(function(r,o){--p,n&&(r?t?p||c(null,i):c(r):l(e,o))}))}var p=0;f.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=i.resolvePath("",t[m]))&&d(y);if(a)return i;p||c(null,i)},l.prototype.loadSync=function(e,t){if(!f.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function p(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||p(0,e)||this.deferred.push(e);else if(e instanceof c)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof i)for(var t=0;t<this.deferred.length;)p(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,r){i=e,o=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var n=r(9313);((a.prototype=Object.create(n.prototype)).constructor=a).className="Service";var i=r(4429),o=r(9935),s=r(5994);function a(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var n,i=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=o.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[c]=o.codegen(["r","c"],o.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},7645:(e,t,r)=>{"use strict";e.exports=v;var n=r(9313);((v.prototype=Object.create(n.prototype)).constructor=v).className="Type";var i=r(7025),o=r(7598),s=r(3548),a=r(6039),c=r(7513),u=r(8368),f=r(1408),l=r(1173),h=r(9935),d=r(4928),p=r(5305),y=r(4497),m=r(3996),g=r(1667);function v(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),v.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),f=0;f<u.length;++f)r.add((void 0!==t.fields[u[f]].keyType?a.fromJSON:s.fromJSON)(u[f],t.fields[u[f]]));if(t.oneofs)for(u=Object.keys(t.oneofs),f=0;f<u.length;++f)r.add(o.fromJSON(u[f],t.oneofs[u[f]]));if(t.nested)for(u=Object.keys(t.nested),f=0;f<u.length;++f){var l=t.nested[u[f]];r.add((void 0!==l.id?s.fromJSON:void 0!==l.fields?v.fromJSON:void 0!==l.values?i.fromJSON:void 0!==l.methods?c.fromJSON:n.fromJSON)(u[f],l))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):n.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return n.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:l,types:t,util:h}),this.decode=p(this)({Reader:f,types:t,util:h}),this.verify=y(this)({types:t,util:h}),this.fromObject=m.fromObject(this)({types:t,util:h}),this.toObject=m.toObject(this)({types:t,util:h});var n=g[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof f||(e=f.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){h.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var n=t,i=r(9935),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=s([0,0,0,1,1],7),n.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var n,i,o=e.exports=r(9693),s=r(5054);o.codegen=r(5124),o.fetch=r(9054),o.path=r(8626),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var a=/\\/g,c=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var f=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(7025));var t=new i("Enum"+f++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",o(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",u),s(t,c,n,u+"[i]")("}");else{if(c.partOf){var f=i.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",f)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",f)}s(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(7025),i=r(9935);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var n=t,i=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=l;var n,i=r(9693),o=i.LongBits,s=i.base64,a=i.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function f(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(l.create=function(){return new n})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var g=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=h(),n._configure()}},3155:(e,t,r)=>{"use strict";e.exports=o;var n=r(1173);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},9822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;const n=r(7187),i=r(8593);class o{constructor(e){var t;e.id&&(this.id=(0,i.decodeBase58)(e.id)),this.signer=e.signer,this.provider=e.provider||(null===(t=e.signer)||void 0===t?void 0:t.provider),this.abi=e.abi,this.bytecode=e.bytecode,e.serializer?this.serializer=e.serializer:e.abi&&e.abi.types&&(this.serializer=new n.Serializer(e.abi.types)),this.options={rc_limit:1e8,sendTransaction:!0,sendAbis:!0,...e.options},this.functions={},this.signer&&this.provider&&this.abi&&this.abi.methods&&this.serializer&&Object.keys(this.abi.methods).forEach((e=>{this.functions[e]=async(t={},r)=>{if(!this.provider)throw new Error("provider not found");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.abi.methods[e])throw new Error(`Method ${e} not defined in the ABI`);const n={...this.options,...r},{readOnly:o,output:s,defaultOutput:a,preformatInput:c,preformatOutput:u}=this.abi.methods[e];let f;f="function"==typeof c?c(t):t;const l=await this.encodeOperation({name:e,args:f});if(o){if(!s)throw new Error(`No output defined for ${e}`);const{result:t}=await this.provider.readContract({contract_id:(0,i.encodeBase58)(l.call_contract.contract_id),entry_point:l.call_contract.entry_point,args:(0,i.encodeBase64)(l.call_contract.args)});let r=a;return t&&(r=await this.serializer.deserialize(t,s)),"function"==typeof u&&(r=u(r)),{operation:l,result:r}}if(!(null==n?void 0:n.sendTransaction))return{operation:l};if(!this.signer)throw new Error("signer not found");const h=await this.signer.encodeTransaction({...n,operations:[l]}),d={};return(null==n?void 0:n.sendAbis)&&(d[(0,i.encodeBase58)(this.id)]=this.abi),{operation:l,transaction:await this.signer.sendTransaction(h,d)}}}))}static computeContractId(e){return(0,i.decodeBase58)(e)}getId(){if(!this.id)throw new Error("id is not defined");return(0,i.encodeBase58)(this.id)}async deploy(e){if(!this.signer)throw new Error("signer not found");if(!this.bytecode)throw new Error("bytecode not found");const t={...this.options,...e},r={upload_contract:{contract_id:o.computeContractId(this.signer.getAddress()),bytecode:this.bytecode}};if(!(null==t?void 0:t.sendTransaction))return{operation:r};const n=await this.signer.encodeTransaction({...t,operations:[r]});return{operation:r,transaction:await this.signer.sendTransaction(n)}}async encodeOperation(e){if(!this.abi||!this.abi.methods||!this.abi.methods[e.name])throw new Error(`Operation ${e.name} unknown`);if(!this.serializer)throw new Error("Serializer is not defined");if(!this.id)throw new Error("Contract id is not defined");const t=this.abi.methods[e.name];let r=new Uint8Array(0);if(t.input){if(!e.args)throw new Error(`No arguments defined for type '${t.input}'`);r=await this.serializer.serialize(e.args,t.input)}return{call_contract:{contract_id:this.id,entry_point:t.entryPoint,args:r}}}async decodeOperation(e){if(!this.id)throw new Error("Contract id is not defined");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.serializer)throw new Error("Serializer is not defined");if(!e.call_contract)throw new Error("Operation is not CallContractOperation");if((0,i.encodeBase58)(e.call_contract.contract_id)!==(0,i.encodeBase58)(this.id))throw new Error(`Invalid contract id. Expected: ${(0,i.encodeBase58)(this.id)}. Received: ${(0,i.encodeBase58)(e.call_contract.contract_id)}`);for(let t=0;t<Object.keys(this.abi.methods).length;t+=1){const r=Object.keys(this.abi.methods)[t],n=this.abi.methods[r];if(e.call_contract.entry_point===n.entryPoint)return n.input?{name:r,args:await this.serializer.deserialize(e.call_contract.args,n.input)}:{name:r}}throw new Error(`Unknown method id ${e.call_contract.entry_point}`)}}t.Contract=o,t.default=o},5635:(e,t)=>{"use strict";async function r(e){return new Promise((t=>setTimeout(t,e)))}Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;class n{constructor(e){Array.isArray(e)?this.rpcNodes=e:this.rpcNodes=[e],this.currentNodeId=0,this.onError=()=>!1}async call(e,t){for(;;)try{const r={id:Math.round(1e3*Math.random()),jsonrpc:"2.0",method:e,params:t},n=this.rpcNodes[this.currentNodeId],i=await fetch(n,{method:"POST",body:JSON.stringify(r)}),o=await i.json();if(o.error&&o.error.message){const r=new Error(o.error.message);throw r.request={method:e,params:t},r}return o.result}catch(e){const t=this.rpcNodes[this.currentNodeId];this.currentNodeId=(this.currentNodeId+1)%this.rpcNodes.length;const r=this.rpcNodes[this.currentNodeId];if(this.onError(e,t,r))throw e}}async getNonce(e){const{nonce:t}=await this.call("chain.get_account_nonce",{account:e});return t?Number(t):0}async getAccountRc(e){const{rc:t}=await this.call("chain.get_account_rc",{account:e});return t||"0"}async getTransactionsById(e){return this.call("transaction_store.get_transactions_by_id",{transaction_ids:e})}async getBlocksById(e){return this.call("block_store.get_blocks_by_id",{block_id:e,return_block:!0,return_receipt:!1})}async getHeadInfo(){return this.call("chain.get_head_info",{})}async getBlocks(e,t=1,r){let n=r;return n||(n=(await this.getHeadInfo()).head_topology.id),(await this.call("block_store.get_blocks_by_height",{head_block_id:n,ancestor_start_height:e,num_blocks:t,return_block:!0,return_receipt:!1})).block_items}async getBlock(e){return(await this.getBlocks(e,1))[0]}async wait(e,t="byBlock",n=3e4){const i=Date.now();if("byTransactionId"===t){for(;Date.now()<i+n;){await r(1e3);const{transactions:t}=await this.getTransactionsById([e]);if(t&&t[0]&&t[0].containing_blocks)return t[0].containing_blocks[0]}throw new Error(`Transaction not mined after ${n} ms`)}const o=async(t,r,n)=>{const i=await this.getBlocks(t,r,n);let o=0;i.forEach((t=>{t&&t.block&&t.block_id&&t.block.transactions&&t.block.transactions.find((t=>t.id===e))&&(o=Number(t.block_height))}));const s=i[i.length-1].block_id;return[o,s]};let s=0,a=0,c="";for(;Date.now()<i+n;){await r(1e3);const{head_topology:e}=await this.getHeadInfo();if(0===s&&(s=Number(e.height),a=s),Number(e.height)===s-1&&c&&c!==e.id){const[t,r]=await o(a,Number(e.height)-a+1,e.id);if(t)return t;c=r,s=Number(e.height)+1}if(s>Number(e.height))continue;const[t,n]=await o(s,1,e.id);if(t)return t;c||(c=n),s+=1}throw new Error(`Transaction not mined after ${n} ms. Blocks checked from ${a} to ${s}`)}async sendTransaction(e){return this.call("chain.submit_transaction",{transaction:e})}async readContract(e){return this.call("chain.read_contract",e)}}t.Provider=n,t.default=n},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serializer=void 0;const n=r(4492),i=r(8593),o="(koinos_bytes_type)";class s{constructor(e,t){this.bytesConversion=!0,this.types=e,this.root=n.Root.fromJSON(this.types),(null==t?void 0:t.defaultTypeName)&&(this.defaultType=this.root.lookupType(t.defaultTypeName)),t&&void 0!==t.bytesConversion&&(this.bytesConversion=t.bytesConversion)}async serialize(e,t){const r=this.defaultType||this.root.lookupType(t);let n={};this.bytesConversion?Object.keys(r.fields).forEach((t=>{const{options:s,name:a,type:c}=r.fields[t];var u;if("bytes"===c)if(s&&s[o])switch(s[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":n[a]=(0,i.decodeBase58)(e[a]);break;case"BASE64":n[a]=(0,i.decodeBase64)(e[a]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":n[a]=(0,i.toUint8Array)(e[a].replace("0x",""));break;default:throw new Error(`unknown koinos_byte_type ${s[o]}`)}else n[a]=(0,i.decodeBase64)(e[a]);else n[a]="string"==typeof(u=e[a])||"number"==typeof u?u:JSON.parse(JSON.stringify(u))})):n=e;const s=r.create(n);return r.encode(s).finish()}async deserialize(e,t){const r="string"==typeof e?(0,i.decodeBase64)(e):e,n=this.defaultType||this.root.lookupType(t),s=n.decode(r),a=n.toObject(s,{longs:String});return this.bytesConversion?(Object.keys(n.fields).forEach((e=>{const{options:t,name:r,type:s}=n.fields[e];if("bytes"===s)if(t&&t[o])switch(t[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":a[r]=(0,i.encodeBase58)(a[r]);break;case"BASE64":a[r]=(0,i.encodeBase64)(a[r]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":a[r]=`0x${(0,i.toHexString)(a[r])}`;break;default:throw new Error(`unknown koinos_byte_type ${t[o]}`)}else a[r]=(0,i.encodeBase64)(a[r])})),a):a}}t.Serializer=s,t.default=s},6991: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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;const a=r(3061),c=o(r(9656)),u=s(r(6139)),f=r(8593),l=r(7187);class h{constructor(e){this.compressed=void 0===e.compressed||e.compressed,this.privateKey=e.privateKey,this.provider=e.provider,e.serializer?this.serializer=e.serializer:this.serializer=new l.Serializer(u.default,{defaultTypeName:"active_transaction_data",bytesConversion:!1}),e.privateKey,this.publicKey=c.getPublicKey(e.privateKey,this.compressed),this.address=(0,f.bitcoinAddress)(this.publicKey)}static fromWif(e){const t="5"!==e[0],r=(0,f.bitcoinDecode)(e);return new h({privateKey:(0,f.toHexString)(r),compressed:t})}static fromSeed(e,t){const r=(0,a.sha256)(e);return new h({privateKey:r,compressed:t})}getAddress(e=!0){if("string"==typeof this.privateKey){const t=c.getPublicKey(this.privateKey,e);return(0,f.bitcoinAddress)(t)}const t=c.getPublicKey(this.privateKey,e);return(0,f.bitcoinAddress)(t)}getPrivateKey(e="hex",t){let r;r=this.privateKey instanceof Uint8Array?(0,f.toHexString)(this.privateKey):"string"==typeof this.privateKey?this.privateKey:BigInt(this.privateKey).toString(16).padStart(64,"0");const n=void 0===t?this.compressed:t;switch(e){case"hex":return r;case"wif":return(0,f.bitcoinEncode)((0,f.toUint8Array)(r),"private",n);default:throw new Error(`Invalid format ${e}`)}}async signTransaction(e){if(!e.active)throw new Error("Active data is not defined");const t=(0,a.sha256)((0,f.decodeBase64)(e.active)),[r,n]=await c.sign(t,this.privateKey,{recovered:!0,canonical:!0,der:!1}),i=new Uint8Array(65);i.set([n+31],0),i.set(r,1),e.signature_data=(0,f.encodeBase64)(i);const o=`0x1220${(0,f.toHexString)(t)}`;return e.id=o,e}async sendTransaction(e,t){if(e.signature_data&&e.id||await this.signTransaction(e),!this.provider)throw new Error("provider is undefined");return await this.provider.sendTransaction(e),{...e,wait:async(t="byBlock",r=3e4)=>{if(!this.provider)throw new Error("provider is undefined");return this.provider.wait(e.id,t,r)}}}static async recoverPublicKey(e,t){if(!e.active)throw new Error("active is not defined");if(!e.signature_data)throw new Error("signature_data is not defined");let r=e.signature_data;t&&"function"==typeof t.transformSignature&&(r=await t.transformSignature(e.signature_data));let n=!0;t&&void 0!==t.compressed&&(n=t.compressed);const i=(0,a.sha256)((0,f.decodeBase64)(e.active)),o=(0,f.toHexString)((0,f.decodeBase64)(r)),s=Number(`0x${o.slice(0,2)}`)-31,u=o.slice(2,66),l=o.slice(66),h=BigInt(`0x${u}`),d=BigInt(`0x${l}`),p=new c.Signature(h,d),y=c.recoverPublicKey((0,f.toHexString)(i),p.toHex(),s);if(!y)throw new Error("Public key cannot be recovered");return n?c.Point.fromHex(y).toHex(!0):(0,f.toHexString)(y)}static async recoverAddress(e,t){const r=await h.recoverPublicKey(e,t);return(0,f.bitcoinAddress)((0,f.toUint8Array)(r))}async encodeTransaction(e){let{nonce:t}=e;if(void 0===e.nonce){if(!this.provider)throw new Error("Cannot get the nonce because provider is undefined. To skip this call set a nonce in the parameters");t=await this.provider.getNonce(this.getAddress())}const r={rc_limit:void 0===e.rc_limit?1e8:e.rc_limit,nonce:t,operations:e.operations?e.operations:[]},n=await this.serializer.serialize(r);return{active:(0,f.encodeBase64)(n)}}async decodeTransaction(e){if(!e.active)throw new Error("Active data is not defined");return this.serializer.deserialize(e.active)}}t.Signer=h,t.default=h},5738: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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(8593)),a=r(9822),c=r(6991),u=r(5635),f=r(7187);window.utils=s,window.Contract=a.Contract,window.Signer=c.Signer,window.Provider=u.Provider,window.Serializer=f.Serializer},8593: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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolTypes=t.Krc20Abi=t.parseUnits=t.formatUnits=t.bitcoinAddress=t.bitcoinDecode=t.bitcoinEncode=t.decodeBase64=t.encodeBase64=t.decodeBase58=t.encodeBase58=t.toHexString=t.toUint8Array=void 0;const a=o(r(6957)),c=r(3061),u=r(830),f=s(r(7177)),l=s(r(6139));function h(e){return(new TextDecoder).decode(a.encode("z",e)).slice(1)}function d(e){return a.decode(`z${e}`)}function p(e,t,r=!1){let n,i,o;"public"===t?(n=new Uint8Array(25),i=new Uint8Array(21),n[0]=0,i[0]=0,o=21):(r?(n=new Uint8Array(38),i=new Uint8Array(34),o=34,n[33]=1,i[33]=1):(n=new Uint8Array(37),i=new Uint8Array(33),o=33),n[0]=128,i[0]=128),i.set(e,1);const s=(0,c.sha256)(i),a=(0,c.sha256)(s),u=new Uint8Array(4);return u.set(a.slice(0,4)),n.set(e,1),n.set(u,o),h(n)}t.toUint8Array=function(e){const t=e.match(/[\dA-F]{2}/gi);if(!t)throw new Error("Invalid hex");return new Uint8Array(t.map((e=>parseInt(e,16))))},t.toHexString=function(e){return Array.from(e).map((e=>`0${Number(e).toString(16)}`.slice(-2))).join("")},t.encodeBase58=h,t.decodeBase58=d,t.encodeBase64=function(e){return(new TextDecoder).decode(a.encode("U",e)).slice(1)},t.decodeBase64=function(e){return a.decode(`U${e}`)},t.bitcoinEncode=p,t.bitcoinDecode=function(e){const t=d(e),r=new Uint8Array(32),n=new Uint8Array(4);return r.set(t.slice(1,33)),"5"!==e[0]?n.set(t.slice(34,38)):n.set(t.slice(33,37)),r},t.bitcoinAddress=function(e){const t=(0,c.sha256)(e);return p((0,u.ripemd160)(t),"public")},t.formatUnits=function(e,t){let r="string"==typeof e?e:BigInt(e).toString();const n="-"===r[0]?"-":"";return r=r.replace("-","").padStart(t+1,"0"),`${n}${r.substring(0,r.length-t).replace(/^0+(?=\d)/,"")}.${r.substring(r.length-t)}`.replace(/(\.0+)?(0+)$/,"")},t.parseUnits=function(e,t){const r="-"===e[0]?"-":"";let[n,i]=e.replace("-","").replace(",",".").split(".");return i||(i=""),i=i.padEnd(t,"0"),`${r}${`${n}${i}`.replace(/^0+(?=\d)/,"")}`},t.Krc20Abi={methods:{name:{entryPoint:1995063959,input:"name_arguments",output:"name_result",readOnly:!0},symbol:{entryPoint:2121878308,input:"symbol_arguments",output:"symbol_result",readOnly:!0},decimals:{entryPoint:1507595726,input:"decimals_arguments",output:"decimals_result",readOnly:!0},totalSupply:{entryPoint:3475931666,input:"total_supply_arguments",output:"total_supply_result",readOnly:!0},balanceOf:{entryPoint:358715976,input:"balance_of_arguments",output:"balance_of_result",readOnly:!0,defaultOutput:{value:"0"}},transfer:{entryPoint:1659871890,input:"transfer_arguments",output:"transfer_result"},mint:{entryPoint:3271044060,input:"mint_arguments",output:"mint_result"}},types:f.default},t.ProtocolTypes=l.default},9159:()=>{},7177:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{"value":{"type":"bool","id":1}}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{"value":{"type":"bool","id":1}}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}')},6139:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"protocol":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/protocol"},"nested":{"contract_call_bundle":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2}}},"system_call_target":{"oneofs":{"target":{"oneof":["thunk_id","system_call_bundle"]}},"fields":{"thunk_id":{"type":"uint32","id":1},"system_call_bundle":{"type":"contract_call_bundle","id":2}}},"upload_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"bytecode":{"type":"bytes","id":2}}},"call_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2},"args":{"type":"bytes","id":3}}},"set_system_call_operation":{"fields":{"call_id":{"type":"uint32","id":1},"target":{"type":"system_call_target","id":2}}},"operation":{"oneofs":{"op":{"oneof":["upload_contract","call_contract","set_system_call"]}},"fields":{"upload_contract":{"type":"upload_contract_operation","id":1},"call_contract":{"type":"call_contract_operation","id":2},"set_system_call":{"type":"set_system_call_operation","id":3}}},"active_transaction_data":{"fields":{"rc_limit":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"nonce":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"operations":{"rule":"repeated","type":"operation","id":3}}},"passive_transaction_data":{"fields":{}},"transaction":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"TRANSACTION_ID"}},"active":{"type":"bytes","id":2},"passive":{"type":"bytes","id":3},"signature_data":{"type":"bytes","id":4}}},"active_block_data":{"fields":{"transaction_merkle_root":{"type":"bytes","id":1},"passive_data_merkle_root":{"type":"bytes","id":2},"signer":{"type":"bytes","id":3}}},"passive_block_data":{"fields":{}},"block_header":{"fields":{"previous":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"height":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"timestamp":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"block":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"header":{"type":"block_header","id":2},"active":{"type":"bytes","id":3},"passive":{"type":"bytes","id":4},"signature_data":{"type":"bytes","id":5},"transactions":{"rule":"repeated","type":"transaction","id":6}}},"block_receipt":{"fields":{}}}}}}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(5738)})();
2
+ (()=>{var __webpack_modules__={8820: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 f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var 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 f=t[e.charCodeAt(r)];if(255===f)return;for(var l=0,h=o-1;(0!==f||l<i)&&-1!==h;h--,l++)f+=s*u[h]>>>0,u[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===u[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=u[d++];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,f=new Uint8Array(c);i!==o;){for(var l=t[i],h=0,d=c-1;(0!==l||h<n)&&-1!==d;d--,h++)l+=256*f[d]>>>0,f[d]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");n=h,i++}for(var p=c-n;p!==c&&0===f[p];)p++;for(var y=a.repeat(r);p<c;++p)y+=e.charAt(f[p]);return y},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(8089);class i extends n.Hash{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");const{view:t,buffer:r,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");const s=(e=(0,n.toBytes)(e)).length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a!==i)r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,n.createView)(e);for(;i<=s-o;o+=i)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(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)}(r,i-8,BigInt(8*this.length),o),this.process(r,0);const a=(0,n.createView)(e);this.get().forEach(((e,t)=>a.setUint32(4*t,e,o)))}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.SHA2=i},4421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(7505),i=r(8089),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((e,t)=>t)),a=s.map((e=>(9*e+5)%16));let c=[s],u=[a];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map((e=>o[e])));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),l=c.map(((e,t)=>e.map((e=>f[t][e])))),h=u.map(((e,t)=>e.map((e=>f[t][e])))),d=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(e,t)=>e<<t|e>>>32-t;function m(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const g=new Uint32Array(16);class v extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,s=0|this.h2,a=s,f=0|this.h3,v=f,b=0|this.h4,w=b;for(let e=0;e<5;e++){const t=4-e,_=d[e],A=p[e],O=c[e],k=u[e],E=l[e],S=h[e];for(let t=0;t<16;t++){const n=y(r+m(e,i,s,f)+g[O[t]]+_,E[t])+b|0;r=b,b=f,f=0|y(s,10),s=i,i=n}for(let e=0;e<16;e++){const r=y(n+m(t,o,a,v)+g[k[e]]+A,S[e])+w|0;n=w,w=v,v=0|y(a,10),a=o,o=r}}this.set(this.h1+s+v|0,this.h2+f+w|0,this.h3+b+n|0,this.h4+r+o|0,this.h0+i+a|0)}roundClean(){g.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=v,t.ripemd160=(0,i.wrapConstructor)((()=>new v))},3061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(7505),i=r(8089),o=(e,t,r)=>e&t^e&r^t&r,s=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]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[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)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[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;c[e]=o+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:f,F:l,G:h,H:d}=this;for(let e=0;e<64;e++){const t=d+((0,i.rotr)(f,6)^(0,i.rotr)(f,11)^(0,i.rotr)(f,25))+((p=f)&l^~p&h)+s[e]+c[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;d=h,h=l,l=f,f=u+t|0,u=a,a=n,n=r,r=t+y|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,f=f+this.E|0,l=l+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(r,n,a,u,f,l,h,d)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)((()=>new u))},8089:(e,t,r)=>{"use strict";e=r.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.assertHash=t.assertBytes=t.assertBool=t.assertNumber=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4421);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}function a(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}t.bytesToHex=function(e){let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o))throw new Error("Invalid byte sequence");t[r]=o}return t},t.nextTick=(()=>{const t="function"==typeof e.require&&e.require.bind(e);try{if(t){const{setImmediate:e}=t("timers");return()=>new Promise((t=>e(t)))}}catch(e){}return()=>new Promise((e=>setTimeout(e,0)))})(),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=o,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),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.assertNumber=a,t.assertBool=function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},t.assertBytes=function(e,...t){if(!(e instanceof Uint8Array)||t.length&&!t.includes(e.length))throw new TypeError(`Expected ${t} bytes, not ${typeof e} with length=${e.length}`)},t.assertHash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");a(e.outputLen),a(e.blockLen)},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(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(s(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.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},9656:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const i=n(r(9159)),o=BigInt(0),s=BigInt(1),a=BigInt(2),c=BigInt(3),u=BigInt(8),f=a**BigInt(256),l={a:o,b:BigInt(7),P:f-a**BigInt(32)-BigInt(977),n:f-BigInt("432420386565659656852420866394968145599"),h:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function h(e){const{a:t,b:r}=l,n=N(e*e),i=N(n*e);return N(i+t*e+r)}t.CURVE=l;const d=l.a===o;class p{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof m))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new p(e.x,e.y,s)}static toAffineBatch(e){const t=function(e,t=l.P){const r=e.length,n=new Array(r);let i=s;for(let s=0;s<r;s++)e[s]!==o&&(n[s]=i,i=N(i*e[s],t));i=R(i,t);for(let s=r-1;s>=0;s--){if(e[s]===o)continue;const r=N(i*e[s],t);e[s]=N(i*n[s],t),i=r}return e}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return p.toAffineBatch(e).map(p.fromAffine)}equals(e){const t=this,r=e,n=N(t.z*t.z),i=N(t.z*n),o=N(r.z*r.z),s=N(r.z*o);return N(t.x*o)===N(n*r.x)&&N(t.y*s)===N(i*r.y)}negate(){return new p(this.x,N(-this.y),this.z)}double(){const e=this.x,t=this.y,r=this.z,n=N(e**a),i=N(t**a),o=N(i**a),s=N(a*(N(N((e+i)**a))-n-o)),f=N(c*n),l=N(f**a),h=N(l-a*s),d=N(f*(s-h)-u*o),y=N(a*t*r);return new p(h,d,y)}add(e){if(!(e instanceof p))throw new TypeError("JacobianPoint#add: expected JacobianPoint");const t=this.x,r=this.y,n=this.z,i=e.x,s=e.y,c=e.z;if(i===o||s===o)return this;if(t===o||r===o)return e;const u=N(n**a),f=N(c**a),l=N(t*f),h=N(i*u),d=N(r*c*f),y=N(N(s*n)*u),m=N(h-l),g=N(y-d);if(m===o)return g===o?this.double():p.ZERO;const v=N(m**a),b=N(m*v),w=N(l*v),_=N(g**a-b-a*w),A=N(g*(w-_)-d*b),O=N(n*c*m);return new p(_,A,O)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){let t=T(e);if(!d){let e=p.ZERO,r=this;for(;t>o;)t&s&&(e=e.add(r)),r=r.double(),t>>=s;return e}let{k1neg:r,k1:n,k2neg:i,k2:a}=C(t),c=p.ZERO,u=p.ZERO,f=this;for(;n>o||a>o;)n&s&&(c=c.add(f)),a&s&&(u=u.add(f)),f=f.double(),n>>=s,a>>=s;return r&&(c=c.negate()),i&&(u=u.negate()),u=new p(N(u.x*l.beta),u.y,u.z),c.add(u)}precomputeWindow(e){const t=d?128/e+1:256/e+1,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(p.BASE)&&(t=m.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&y.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=p.normalizeZ(n),y.set(t,n)));let i=p.ZERO,o=p.ZERO;const a=d?128/r+1:256/r+1,c=2**(r-1),u=BigInt(2**r-1),f=2**r,l=BigInt(r);for(let t=0;t<a;t++){const r=t*c;let a=Number(e&u);if(e>>=l,a>c&&(a-=f,e+=s),0===a){let e=n[r];t%2&&(e=e.negate()),o=o.add(e)}else{let e=n[r+Math.abs(a)-1];a<0&&(e=e.negate()),i=i.add(e)}}return{p:i,f:o}}multiply(e,t){let r,n,i=T(e);if(d){let{k1neg:e,k1:o,k2neg:s,k2:a}=C(i),{p:c,f:u}=this.wNAF(o,t),{p:f,f:h}=this.wNAF(a,t);e&&(c=c.negate()),s&&(f=f.negate()),f=new p(N(f.x*l.beta),f.y,f.z),r=c.add(f),n=u.add(h)}else{let{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return p.normalizeZ([r,n])[0]}toAffine(e=R(this.z)){const t=e**a,r=N(this.x*t),n=N(this.y*t*e);return new m(r,n)}}p.BASE=new p(l.Gx,l.Gy,s),p.ZERO=new p(o,s,o);const y=new WeakMap;class m{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=B(t?e:e.slice(1));let n=function(e){const{P:t}=l,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),f=e*e*e%t,h=f*f*e%t,d=I(h,c)*h%t,p=I(d,c)*h%t,y=I(p,a)*f%t,m=I(y,n)*y%t,g=I(m,i)*m%t,v=I(g,s)*g%t,b=I(v,u)*v%t,w=I(b,s)*g%t,_=I(w,c)*h%t,A=I(_,o)*m%t,O=I(A,r)*f%t;return I(O,a)}(h(r));const i=(n&s)===s;t?i&&(n=N(-n)):1==(1&e[0])!==i&&(n=N(-n));const o=new m(r,n);return o.assertValidity(),o}static fromUncompressedHex(e){const t=B(e.slice(1,33)),r=B(e.slice(33)),n=new m(t,r);return n.assertValidity(),n}static fromHex(e){const t=j(e),r=t[0];if(32===t.length||33===t.length&&(2===r||3===r))return this.fromCompressedHex(t);if(65===t.length&&4===r)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${t.length}`)}static fromPrivateKey(e){return m.BASE.multiply(L(e))}static fromSignature(e,t,r){let n=e instanceof Uint8Array?B(e):S(e);const i=M(t),{r:o,s}=i;if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");const a=2+(1&r),c=m.fromHex(`0${a}${O(o)}`),u=p.fromAffine(c).multiplyUnsafe(s),f=p.BASE.multiply(n),h=R(o,l.n),d=u.subtract(f).multiplyUnsafe(h).toAffine();return d.assertValidity(),d}toRawBytes(e=!1){return x(this.toHex(e))}toHex(e=!1){const t=O(this.x);return e?`${this.y&s?"03":"02"}${t}`:`04${t}${O(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!z(t)||!z(r))throw new Error(e);const n=N(r*r);if(N(n-h(t))!==o)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new m(this.x,N(-this.y))}double(){return p.fromAffine(this).double().toAffine()}add(e){return p.fromAffine(this).add(p.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return p.fromAffine(this).multiply(e,this).toAffine()}}function g(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function v(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${A(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:B(r),left:e.subarray(t+2)}}t.Point=m,m.BASE=new m(l.Gx,l.Gy),m.ZERO=new m(o,o);class b{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?A(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new b(S(n.slice(0,64)),S(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${A(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=v(e.subarray(2)),{data:n,left:i}=v(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${A(i)}`);return{r:t,s:n}}(t?e:x(e));return new b(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!$(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!$(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=l.n>>s;return this.s>e}normalizeS(){return this.hasHighS()?new b(this.r,l.n-this.s):this}toDERRawBytes(e=!1){return x(this.toDERHex(e))}toDERHex(e=!1){const t=g(E(this.s));if(e)return t;const r=g(E(this.r)),n=E(r.length/2),i=E(t.length/2);return`30${E(r.length/2+t.length/2+4)}02${n}${r}02${i}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return x(this.toCompactHex())}toCompactHex(){return O(this.r)+O(this.s)}}function w(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),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.Signature=b;const _=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function A(e){let t="";for(let r=0;r<e.length;r++)t+=_[e[r]];return t}function O(e){if(e>f)throw new Error("pad64: invalid number");return e.toString(16).padStart(64,"0")}function k(e){return x(O(e))}function E(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function S(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function x(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o))throw new Error("Invalid byte sequence");t[r]=o}return t}function j(e){return e instanceof Uint8Array?e:x(e)}function B(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return S(A(e))}function T(e){if("number"==typeof e&&e>0&&Number.isSafeInteger(e))return BigInt(e);if("bigint"==typeof e&&$(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function N(e,t=l.P){const r=e%t;return r>=0?r:t+r}function I(e,t){const{P:r}=l;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function R(e,t=l.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=N(e,t),n=t,i=o,a=s,c=s,u=o;for(;r!==o;){const e=n/r,t=n%r,o=i-c*e,s=a-u*e;n=r,r=t,i=c,a=u,c=o,u=s}if(n!==s)throw new Error("invert: does not exist");return N(i,t)}const P=(e,t)=>(e+t/a)/t,U=a**BigInt(128);function C(e){const{n:t}=l,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-s*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=P(o*e,t),c=P(-n*e,t);let u=N(e-a*r-c*i,t),f=N(-a*n-c*o,t);const h=u>U,d=f>U;if(h&&(u=t-u),d&&(f=t-f),u>U||f>U)throw new Error("splitScalarEndo: Endomorphism failed");return{k1neg:h,k1:u,k2neg:d,k2:f}}class D{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...e){return t.utils.hmacSha256(this.k,...e)}hmacSync(...e){if("function"!=typeof t.utils.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const r=t.utils.hmacSha256Sync(this.k,...e);if(r instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return r}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function $(e){return o<e&&e<l.n}function z(e){return 0n<e&&e<l.P}function H(e,t,r){const n=B(e);if(!$(n))return;const{n:i}=l,a=m.BASE.multiply(n),c=N(a.x,i);if(c===o)return;const u=N(R(n,i)*N(t+r*c,i),i);if(u===o)return;const f=new b(c,u);return{sig:f,recovery:(a.x===f.r?0:2)|Number(a.y&s)}}function L(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=S(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=B(e)}if(!$(t))throw new Error("Expected private key: 0 < key < n");return t}function J(e){return e instanceof m?(e.assertValidity(),e):m.fromHex(e)}function M(e){if(e instanceof b)return e.assertValidity(),e;try{return b.fromDER(e)}catch(t){return b.fromCompact(e)}}function F(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof m}function K(e){return B(e.length>32?e.slice(0,32):e)}function q(e){const t=K(e),r=N(t,l.n);return V(r<o?t:r)}function V(e){if("bigint"!=typeof e)throw new Error("Expected bigint");return x(O(e))}function G(e,r,n){if(null==e)throw new Error(`sign: expected valid msgHash, not "${e}"`);const i=j(e),o=L(r),s=[V(o),q(i)];if(null!=n){!0===n&&(n=t.utils.randomBytes(32));const e=k(B(j(n)));if(32!==e.length)throw new Error("secp256k1: Expected 32 bytes of extra data");s.push(e)}return{seed:w(...s),m:K(i),d:o}}function W(e,t){let{sig:r,recovery:n}=e;const{canonical:i,der:o,recovered:s}=Object.assign({canonical:!0,der:!0},t);i&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=o?r.toDERRawBytes():r.toCompactRawBytes();return s?[a,n]:a}t.getPublicKey=function(e,t=!1){return m.fromPrivateKey(e).toRawBytes(t)},t.recoverPublicKey=function(e,t,r){return m.fromSignature(e,t,r).toRawBytes()},t.getSharedSecret=function(e,t,r=!1){if(F(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!F(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=J(t);return n.assertValidity(),n.multiply(L(e)).toRawBytes(r)},t.sign=async function(e,t,r={}){const{seed:n,m:i,d:o}=G(e,t,r.extraEntropy);let s;const a=new D;for(await a.reseed(n);!(s=H(await a.generate(),i,o));)await a.reseed();return W(s,r)},t.signSync=function(e,t,r={}){const{seed:n,m:i,d:o}=G(e,t,r.extraEntropy);let s;const a=new D;for(a.reseedSync(n);!(s=H(a.generateSync(),i,o));)a.reseedSync();return W(s,r)};const Z={strict:!0};async function X(e,...r){const n=new Uint8Array(e.split("").map((e=>e.charCodeAt(0)))),i=await t.utils.sha256(n);return B(await t.utils.sha256(w(i,i,...r)))}async function Q(e,t,r){const n=k(e);return N(await X("BIP0340/challenge",n,t.toRawX(),r),l.n)}function Y(e){return N(e.y,a)===o}t.verify=function(e,t,r,n=Z){let i;try{i=M(e)}catch(e){return!1}const{r:s,s:a}=i;if(n.strict&&i.hasHighS())return!1;const c=function(e){"string"!=typeof e&&(e=A(e));let t=S(e||"0");const r=e.length/2*8-256;return r>0&&(t>>=BigInt(r)),t>=l.n&&(t-=l.n),t}(t);if(c===o)return!1;let u;try{u=p.fromAffine(J(r))}catch(e){return!1}const{n:f}=l,h=R(a,f),d=N(c*h,f),y=N(s*h,f),m=p.BASE.multiply(d),g=u.multiplyUnsafe(y);return N(m.add(g).toAffine().x,f)===s};class ee{constructor(e,t){if(this.r=e,this.s=t,!z(e)||!$(t))throw new Error("Invalid signature")}static fromHex(e){const t=j(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=B(t.slice(0,32)),n=B(t.slice(32,64));return new ee(r,n)}toHex(){return O(this.r)+O(this.s)}toRawBytes(){return x(this.toHex())}}async function te(e,t,r){const n=e instanceof ee?e:ee.fromHex(e),i=j(t),o=J(r),s=await Q(n.r,o,i),a=m.fromPrivateKey(n.s),c=o.multiply(s),u=a.subtract(c);return!(u.equals(m.BASE)||!Y(u)||u.x!==n.r)}t.schnorr={Signature:ee,getPublicKey:function(e){return m.fromPrivateKey(e).toRawX()},sign:async function(e,r,n=t.utils.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);const{n:i}=l,s=j(e),a=L(r),c=j(n);if(32!==c.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const u=m.fromPrivateKey(a),f=Y(u)?a:i-a,h=f^await X("BIP0340/aux",c),d=N(await X("BIP0340/nonce",k(h),u.toRawX(),s),i);if(d===o)throw new Error("sign: Creation of signature failed. k is zero");const p=m.fromPrivateKey(d),y=Y(p)?d:i-d,g=await Q(p.x,u,s),v=new ee(p.x,N(y+g*f,i));if(!await te(v.toRawBytes(),s,u.toRawX()))throw new Error("sign: Invalid signature produced");return v.toRawBytes()},verify:te},m.BASE._setWindowSize(8);const re={node:i.default,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0};t.utils={isValidPrivateKey(e){try{return L(e),!0}catch(e){return!1}},randomBytes:(e=32)=>{if(re.web)return re.web.getRandomValues(new Uint8Array(e));if(re.node){const{randomBytes:t}=re.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>{let e=8;for(;e--;){const e=t.utils.randomBytes(32),r=B(e);if($(r)&&r!==s)return e}throw new Error("Valid private key was not found in 8 iterations. PRNG is broken")},bytesToHex:A,sha256:async e=>{if(re.web){const t=await re.web.subtle.digest("SHA-256",e.buffer);return new Uint8Array(t)}if(re.node){const{createHash:t}=re.node;return Uint8Array.from(t("sha256").update(e).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(re.web){const r=await re.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=w(...t),i=await re.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(re.node){const{createHmac:r}=re.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(e=8,t=m.BASE){const r=t===m.BASE?t:new m(t.x,t.y);return r._setWindowSize(e),r.multiply(c),r}}},4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,s){r[n]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,s=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:s[a++]=n[u>>2],i=(3&u)<<4,c=1;break;case 1:s[a++]=n[i|u>>4],i=(15&u)<<2,c=2;break;case 2:s[a++]=n[i|u>>6],s[a++]=n[63&u],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=n[i],s[a++]=61,1===c&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=i[u]))throw Error(s);switch(a){case 0:n=u,a=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,a=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,a=3;break;case 3:t[r++]=(3&n)<<6|u,a=0}}if(1===a)throw Error(s);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!=typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u<s.length;)a[u]=s[u],c[u]=e[s[u++]];return a[u]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var f=new Array(arguments.length-1),l=0;l<f.length;)f[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=f[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),l!==f.length)throw Error("parameter count mismatch");return n.push(e),i}function o(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=o;var n=r(4537),i=r(7199)("fs");function o(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=n*Math.pow(2,-c))>>>0,i,o+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function s(e,t,r,n,i){var o=e(n,i+t),s=e(n,i+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return e(r);s+r>n&&(o=e(n),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],s=0;t<r;)(n=e[t++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},r.write=function(e,t,r){for(var n,i,o=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},556:(e,t,r)=>{"use strict";const{encodeText:n}=r(2413);e.exports=class{constructor(e,t,r,i){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=i,this.codec=r(i)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}}},5077:(e,t,r)=>{"use strict";const n=r(8820),i=r(556),{rfc4648:o}=r(6727),{decodeText:s,encodeText:a}=r(2413),c=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],u=c.reduce(((e,t)=>(e[t[0]]=new i(t[0],t[1],t[2],t[3]),e)),{}),f=c.reduce(((e,t)=>(e[t[1]]=u[t[0]],e)),{});e.exports={names:u,codes:f}},6957:(e,t,r)=>{"use strict";const n=r(5077),{encodeText:i,decodeText:o,concat:s}=r(2413);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error(`Unsupported encoding: ${e}`)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(o(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=i(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(e){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),a(e[0])};const c=Object.freeze(n.names),u=Object.freeze(n.codes);t.names=c,t.codes=u},6727:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,c=0;for(let t=0;t<i;++t){const i=n[e[t]];if(void 0===i)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|i,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o})(r,t,e)})}},2413:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}}},4492:(e,t,r)=>{"use strict";e.exports=r(8836)},3996:(e,t,r)=>{"use strict";var n=t,i=r(7025),o=r(9935);function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var o=t.resolvedType.values,s=Object.keys(o),a=0;a<s.length;++a)t.repeated&&o[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",o[s[a]])("m%s=%j",n,o[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function a(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var a=t[n].resolve(),c=o.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,n,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,n,c+"[i]")("}")("}")):(a.resolvedType instanceof i||r("if(d%s!=null){",c),s(r,a,n,c),a.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],s=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?s:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",o.safeProp(n[u].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),u=0;u<s.length;++u)r("d%s={}",o.safeProp(s[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var f=c[u],l=o.safeProp(f.name);if(f.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",l,f.resolvedType.valuesById[f.typeDefault],f.typeDefault);else if(f.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",f.typeDefault.low,f.typeDefault.high,f.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,f.typeDefault.toString(),f.typeDefault.toNumber());else if(f.bytes){var h="["+Array.prototype.slice.call(f.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,f.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,f.typeDefault)}r("}")}var d=!1;for(u=0;u<t.length;++u){f=t[u];var p=e._fieldsArray.indexOf(f);l=o.safeProp(f.name),f.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),a(r,f,p,l+"[ks2[j]]")("}")):f.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(r,f,p,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,f.name),a(r,f,p,l),f.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(f.partOf.name),f.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof n?"int32":a.type,u="m"+o.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[a.keyType]?t("k=%j",i.defaults[a.keyType]):t("k=null"),void 0!==i.defaults[c]?t("value=%j",i.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===i.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===i.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===i.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var f=e._fieldsArray[r];f.required&&t("if(!m.hasOwnProperty(%j))",f.name)("throw util.ProtocolError(%j,{instance:m})",s(f))}return t("return m")};var n=r(7025),i=r(7063),o=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(o.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),f=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof n?"int32":u.type,h=i.basic[l];t="m"+o.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",f,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[l]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,f,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,f,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return r("return w")};var n=r(7025),i=r(7063),o=r(9935);function s(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="Enum";var i=r(9313),o=r(9935);function s(e,t,r,i,o){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=u;var n=r(3243);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var i,o=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,i,o,u,f){if(a.isObject(i)?(f=o,u=i,i=o=void 0):a.isObject(o)&&(f=u,u=o,o=void 0),n.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!c.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!a.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=f}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new u(o,e,t,r,{default:n}))}},u._configure=function(e){i=e}},8836:(e,t,r)=>{"use strict";var n=e.exports=r(9482);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(4928),n.decoder=r(5305),n.verifier=r(4497),n.converter=r(3996),n.ReflectionObject=r(3243),n.Namespace=r(9313),n.Root=r(9424),n.Enum=r(7025),n.Type=r(7645),n.Field=r(3548),n.OneOf=r(7598),n.MapField=r(6039),n.Service=r(7513),n.Method=r(4429),n.Message=r(8368),n.wrappers=r(1667),n.types=r(7063),n.util=r(9935),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},9482:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(1173),n.BufferWriter=r(3155),n.Reader=r(1408),n.BufferReader=r(593),n.util=r(9693),n.rpc=r(5994),n.roots=r(5054),n.configure=i,i()},6039:(e,t,r)=>{"use strict";e.exports=s;var n=r(3548);((s.prototype=Object.create(n.prototype)).constructor=s).className="MapField";var i=r(7063),o=r(9935);function s(e,t,r,i,s,a){if(n.call(this,e,t,i,void 0,void 0,s,a),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new s(i,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=o;var n=r(3243);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(9935);function o(e,t,r,o,s,a,c,u,f){if(i.isObject(s)?(c=s,s=a=void 0):i.isObject(a)&&(c=a,a=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=o,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=f}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=l;var n=r(3243);((l.prototype=Object.create(n.prototype)).constructor=l).className="Namespace";var i,o,s,a=r(3548),c=r(7598),u=r(9935);function f(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function l(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=f,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",f(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(r[n],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof i||e instanceof s||e instanceof o||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},l.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(n))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof l&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof l&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,r){i=e,o=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(9935);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var s=o[e];i.setProperty(s,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var a={};a[e]=t,n.push(a)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var n=r(3243);((s.prototype=Object.create(n.prototype)).constructor=s).className="OneOf";var i=r(3548),o=r(9935);function s(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},1408:(e,t,r)=>{"use strict";e.exports=c;var n,i=r(9693),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,f="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return i.Buffer?function(e){return(c.create=function(e){return i.Buffer.isBuffer(e)?new n(e):f(e)})(e)}:f};function h(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){n=e,c.create=l(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=o;var n=r(1408);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},9424:(e,t,r)=>{"use strict";e.exports=l;var n=r(9313);((l.prototype=Object.create(n.prototype)).constructor=l).className="Root";var i,o,s,a=r(3548),c=r(7025),u=r(7598),f=r(9935);function l(e){n.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=f.path.resolve,l.prototype.fetch=f.fetch,l.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return f.asPromise(e,i,t,r);var a=n===h;function c(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function l(e,t){try{if(f.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),f.isString(t)){o.filename=e;var n,s=o(t,i,r),l=0;if(s.imports)for(;l<s.imports.length;++l)(n=u(s.imports[l])||i.resolvePath(e,s.imports[l]))&&d(n);if(s.weakImports)for(l=0;l<s.weakImports.length;++l)(n=u(s.weakImports[l])||i.resolvePath(e,s.weakImports[l]))&&d(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||p||c(null,i)}function d(e,t){if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in s)a?l(e,s[e]):(++p,setTimeout((function(){--p,l(e,s[e])})));else if(a){var r;try{r=f.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,r)}else++p,i.fetch(e,(function(r,o){--p,n&&(r?t?p||c(null,i):c(r):l(e,o))}))}var p=0;f.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=i.resolvePath("",t[m]))&&d(y);if(a)return i;p||c(null,i)},l.prototype.loadSync=function(e,t){if(!f.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function p(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||p(0,e)||this.deferred.push(e);else if(e instanceof c)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof i)for(var t=0;t<this.deferred.length;)p(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,r){i=e,o=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var n=r(9313);((a.prototype=Object.create(n.prototype)).constructor=a).className="Service";var i=r(4429),o=r(9935),s=r(5994);function a(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var n,i=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=o.lcFirst((n=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[c]=o.codegen(["r","c"],o.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},7645:(e,t,r)=>{"use strict";e.exports=v;var n=r(9313);((v.prototype=Object.create(n.prototype)).constructor=v).className="Type";var i=r(7025),o=r(7598),s=r(3548),a=r(6039),c=r(7513),u=r(8368),f=r(1408),l=r(1173),h=r(9935),d=r(4928),p=r(5305),y=r(4497),m=r(3996),g=r(1667);function v(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),v.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),f=0;f<u.length;++f)r.add((void 0!==t.fields[u[f]].keyType?a.fromJSON:s.fromJSON)(u[f],t.fields[u[f]]));if(t.oneofs)for(u=Object.keys(t.oneofs),f=0;f<u.length;++f)r.add(o.fromJSON(u[f],t.oneofs[u[f]]));if(t.nested)for(u=Object.keys(t.nested),f=0;f<u.length;++f){var l=t.nested[u[f]];r.add((void 0!==l.id?s.fromJSON:void 0!==l.fields?v.fromJSON:void 0!==l.values?i.fromJSON:void 0!==l.methods?c.fromJSON:n.fromJSON)(u[f],l))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):n.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return n.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:l,types:t,util:h}),this.decode=p(this)({Reader:f,types:t,util:h}),this.verify=y(this)({types:t,util:h}),this.fromObject=m.fromObject(this)({types:t,util:h}),this.toObject=m.toObject(this)({types:t,util:h});var n=g[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof f||(e=f.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){h.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var n=t,i=r(9935),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=s([0,0,0,1,1],7),n.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var n,i,o=e.exports=r(9693),s=r(5054);o.codegen=r(5124),o.fetch=r(9054),o.path=r(8626),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var a=/\\/g,c=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(7645));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var f=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(7025));var t=new i("Enum"+f++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=i;var n=r(9693);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(4537),n.base64=r(7419),n.EventEmitter=r(9211),n.float=r(945),n.inquire=r(7199),n.utf8=r(4997),n.pool=r(6662),n.LongBits=r(1945),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",o(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",u),s(t,c,n,u+"[i]")("}");else{if(c.partOf){var f=i.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",f)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",f)}s(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(7025),i=r(9935);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var n=t,i=r(8368);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=n,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=l;var n,i=r(9693),o=i.LongBits,s=i.base64,a=i.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function f(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(l.create=function(){return new n})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var g=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=h(),n._configure()}},3155:(e,t,r)=>{"use strict";e.exports=o;var n=r(1173);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(9693);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},9822:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;const n=r(7187),i=r(8593);class o{constructor(e){var t;e.id&&(this.id=(0,i.decodeBase58)(e.id)),this.signer=e.signer,this.provider=e.provider||(null===(t=e.signer)||void 0===t?void 0:t.provider),this.abi=e.abi,this.bytecode=e.bytecode,e.serializer?this.serializer=e.serializer:e.abi&&e.abi.types&&(this.serializer=new n.Serializer(e.abi.types)),this.options={rc_limit:1e8,sendTransaction:!0,sendAbis:!0,...e.options},this.functions={},this.signer&&this.provider&&this.abi&&this.abi.methods&&this.serializer&&Object.keys(this.abi.methods).forEach((e=>{this.functions[e]=async(t={},r)=>{if(!this.provider)throw new Error("provider not found");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.abi.methods[e])throw new Error(`Method ${e} not defined in the ABI`);const n={...this.options,...r},{readOnly:o,output:s,defaultOutput:a,preformatInput:c,preformatOutput:u}=this.abi.methods[e];let f;f="function"==typeof c?c(t):t;const l=await this.encodeOperation({name:e,args:f});if(o){if(!s)throw new Error(`No output defined for ${e}`);const{result:t}=await this.provider.readContract({contract_id:(0,i.encodeBase58)(l.call_contract.contract_id),entry_point:l.call_contract.entry_point,args:(0,i.encodeBase64)(l.call_contract.args)});let r=a;return t&&(r=await this.serializer.deserialize(t,s)),"function"==typeof u&&(r=u(r)),{operation:l,result:r}}if(!(null==n?void 0:n.sendTransaction))return{operation:l};if(!this.signer)throw new Error("signer not found");const h=await this.signer.encodeTransaction({...n,operations:[l]}),d={};return(null==n?void 0:n.sendAbis)&&(d[(0,i.encodeBase58)(this.id)]=this.abi),{operation:l,transaction:await this.signer.sendTransaction(h,d)}}}))}static computeContractId(e){return(0,i.decodeBase58)(e)}getId(){if(!this.id)throw new Error("id is not defined");return(0,i.encodeBase58)(this.id)}async deploy(e){if(!this.signer)throw new Error("signer not found");if(!this.bytecode)throw new Error("bytecode not found");const t={...this.options,...e},r={upload_contract:{contract_id:o.computeContractId(this.signer.getAddress()),bytecode:this.bytecode}};if(!(null==t?void 0:t.sendTransaction))return{operation:r};const n=await this.signer.encodeTransaction({...t,operations:[r]});return{operation:r,transaction:await this.signer.sendTransaction(n)}}async encodeOperation(e){if(!this.abi||!this.abi.methods||!this.abi.methods[e.name])throw new Error(`Operation ${e.name} unknown`);if(!this.serializer)throw new Error("Serializer is not defined");if(!this.id)throw new Error("Contract id is not defined");const t=this.abi.methods[e.name];let r=new Uint8Array(0);if(t.input){if(!e.args)throw new Error(`No arguments defined for type '${t.input}'`);r=await this.serializer.serialize(e.args,t.input)}return{call_contract:{contract_id:this.id,entry_point:t.entryPoint,args:r}}}async decodeOperation(e){if(!this.id)throw new Error("Contract id is not defined");if(!this.abi||!this.abi.methods)throw new Error("Methods are not defined");if(!this.serializer)throw new Error("Serializer is not defined");if(!e.call_contract)throw new Error("Operation is not CallContractOperation");if((0,i.encodeBase58)(e.call_contract.contract_id)!==(0,i.encodeBase58)(this.id))throw new Error(`Invalid contract id. Expected: ${(0,i.encodeBase58)(this.id)}. Received: ${(0,i.encodeBase58)(e.call_contract.contract_id)}`);for(let t=0;t<Object.keys(this.abi.methods).length;t+=1){const r=Object.keys(this.abi.methods)[t],n=this.abi.methods[r];if(e.call_contract.entry_point===n.entryPoint)return n.input?{name:r,args:await this.serializer.deserialize(e.call_contract.args,n.input)}:{name:r}}throw new Error(`Unknown method id ${e.call_contract.entry_point}`)}}t.Contract=o,t.default=o},5635:(e,t)=>{"use strict";async function r(e){return new Promise((t=>setTimeout(t,e)))}Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;class n{constructor(e){Array.isArray(e)?this.rpcNodes=e:this.rpcNodes=[e],this.currentNodeId=0,this.onError=()=>!1}async call(e,t){for(;;)try{const r={id:Math.round(1e3*Math.random()),jsonrpc:"2.0",method:e,params:t},n=this.rpcNodes[this.currentNodeId],i=await fetch(n,{method:"POST",body:JSON.stringify(r)}),o=await i.json();if(o.error&&o.error.message){const r=new Error(o.error.message);throw r.request={method:e,params:t},r}return o.result}catch(e){const t=this.rpcNodes[this.currentNodeId];this.currentNodeId=(this.currentNodeId+1)%this.rpcNodes.length;const r=this.rpcNodes[this.currentNodeId];if(this.onError(e,t,r))throw e}}async getNonce(e){const{nonce:t}=await this.call("chain.get_account_nonce",{account:e});return t?Number(t):0}async getAccountRc(e){const{rc:t}=await this.call("chain.get_account_rc",{account:e});return t||"0"}async getTransactionsById(e){return this.call("transaction_store.get_transactions_by_id",{transaction_ids:e})}async getBlocksById(e){return this.call("block_store.get_blocks_by_id",{block_id:e,return_block:!0,return_receipt:!1})}async getHeadInfo(){return this.call("chain.get_head_info",{})}async getBlocks(e,t=1,r){let n=r;return n||(n=(await this.getHeadInfo()).head_topology.id),(await this.call("block_store.get_blocks_by_height",{head_block_id:n,ancestor_start_height:e,num_blocks:t,return_block:!0,return_receipt:!1})).block_items}async getBlock(e){return(await this.getBlocks(e,1))[0]}async wait(e,t="byBlock",n=3e4){const i=Date.now();if("byTransactionId"===t){for(;Date.now()<i+n;){await r(1e3);const{transactions:t}=await this.getTransactionsById([e]);if(t&&t[0]&&t[0].containing_blocks)return t[0].containing_blocks[0]}throw new Error(`Transaction not mined after ${n} ms`)}const o=async(t,r,n)=>{const i=await this.getBlocks(t,r,n);let o=0;i.forEach((t=>{t&&t.block&&t.block_id&&t.block.transactions&&t.block.transactions.find((t=>t.id===e))&&(o=Number(t.block_height))}));const s=i[i.length-1].block_id;return[o,s]};let s=0,a=0,c="";for(;Date.now()<i+n;){await r(1e3);const{head_topology:e}=await this.getHeadInfo();if(0===s&&(s=Number(e.height),a=s),Number(e.height)===s-1&&c&&c!==e.id){const[t,r]=await o(a,Number(e.height)-a+1,e.id);if(t)return t;c=r,s=Number(e.height)+1}if(s>Number(e.height))continue;const[t,n]=await o(s,1,e.id);if(t)return t;c||(c=n),s+=1}throw new Error(`Transaction not mined after ${n} ms. Blocks checked from ${a} to ${s}`)}async sendTransaction(e){return this.call("chain.submit_transaction",{transaction:e})}async readContract(e){return this.call("chain.read_contract",e)}}t.Provider=n,t.default=n},7187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serializer=void 0;const n=r(4492),i=r(8593),o="(koinos_bytes_type)";class s{constructor(e,t){this.bytesConversion=!0,this.types=e,this.root=n.Root.fromJSON(this.types),(null==t?void 0:t.defaultTypeName)&&(this.defaultType=this.root.lookupType(t.defaultTypeName)),t&&void 0!==t.bytesConversion&&(this.bytesConversion=t.bytesConversion)}async serialize(e,t,r){const n=this.defaultType||this.root.lookupType(t);let s={};(void 0===(null==r?void 0:r.bytesConversion)?this.bytesConversion:r.bytesConversion)?Object.keys(n.fields).forEach((t=>{const{options:r,name:a,type:c}=n.fields[t];var u;if("bytes"===c)if(r&&r[o])switch(r[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":s[a]=(0,i.decodeBase58)(e[a]);break;case"BASE64":s[a]=(0,i.decodeBase64)(e[a]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":s[a]=(0,i.toUint8Array)(e[a].replace("0x",""));break;default:throw new Error(`unknown koinos_byte_type ${r[o]}`)}else s[a]=(0,i.decodeBase64)(e[a]);else s[a]="string"==typeof(u=e[a])||"number"==typeof u?u:JSON.parse(JSON.stringify(u))})):s=e;const a=n.create(s);return n.encode(a).finish()}async deserialize(e,t,r){const n="string"==typeof e?(0,i.decodeBase64)(e):e,s=this.defaultType||this.root.lookupType(t),a=s.decode(n),c=s.toObject(a,{longs:String});return(void 0===(null==r?void 0:r.bytesConversion)?this.bytesConversion:r.bytesConversion)?(Object.keys(s.fields).forEach((e=>{const{options:t,name:r,type:n}=s.fields[e];if("bytes"===n)if(t&&t[o])switch(t[o]){case"BASE58":case"CONTRACT_ID":case"ADDRESS":c[r]=(0,i.encodeBase58)(c[r]);break;case"BASE64":c[r]=(0,i.encodeBase64)(c[r]);break;case"HEX":case"BLOCK_ID":case"TRANSACTION_ID":c[r]=`0x${(0,i.toHexString)(c[r])}`;break;default:throw new Error(`unknown koinos_byte_type ${t[o]}`)}else c[r]=(0,i.encodeBase64)(c[r])})),c):c}}t.Serializer=s,t.default=s},6991: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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;const a=r(3061),c=o(r(9656)),u=s(r(6139)),f=r(8593),l=r(7187);class h{constructor(e){this.compressed=void 0===e.compressed||e.compressed,this.privateKey=e.privateKey,this.provider=e.provider,e.serializer?this.serializer=e.serializer:this.serializer=new l.Serializer(u.default,{bytesConversion:!1}),e.privateKey,this.publicKey=c.getPublicKey(e.privateKey,this.compressed),this.address=(0,f.bitcoinAddress)(this.publicKey)}static fromWif(e){const t="5"!==e[0],r=(0,f.bitcoinDecode)(e);return new h({privateKey:(0,f.toHexString)(r),compressed:t})}static fromSeed(e,t){const r=(0,a.sha256)(e);return new h({privateKey:r,compressed:t})}getAddress(e=!0){if("string"==typeof this.privateKey){const t=c.getPublicKey(this.privateKey,e);return(0,f.bitcoinAddress)(t)}const t=c.getPublicKey(this.privateKey,e);return(0,f.bitcoinAddress)(t)}getPrivateKey(e="hex",t){let r;r=this.privateKey instanceof Uint8Array?(0,f.toHexString)(this.privateKey):"string"==typeof this.privateKey?this.privateKey:BigInt(this.privateKey).toString(16).padStart(64,"0");const n=void 0===t?this.compressed:t;switch(e){case"hex":return r;case"wif":return(0,f.bitcoinEncode)((0,f.toUint8Array)(r),"private",n);default:throw new Error(`Invalid format ${e}`)}}async signHash(e){const[t,r]=await c.sign(e,this.privateKey,{recovered:!0,canonical:!0,der:!1}),n=new Uint8Array(65);return n.set([r+31],0),n.set(t,1),(0,f.encodeBase64)(n)}async signTransaction(e){if(!e.active)throw new Error("Active data is not defined");const t=(0,a.sha256)((0,f.decodeBase64)(e.active));return e.signature_data=await this.signHash(t),e.id=`0x1220${(0,f.toHexString)(t)}`,e}async signBlock(e){const t=(0,f.decodeBase64)(e.active),r=await this.serializer.serialize(e.header,"block_header",{bytesConversion:!0}),n=new Uint8Array(r.length+t.length);n.set(r,0),n.set(t,r.length);const i=(0,a.sha256)(n);return e.signature_data=await this.signHash(i),e.id=`0x1220${(0,f.toHexString)(i)}`,e}async sendTransaction(e,t){if(e.signature_data&&e.id||await this.signTransaction(e),!this.provider)throw new Error("provider is undefined");return await this.provider.sendTransaction(e),{...e,wait:async(t="byBlock",r=3e4)=>{if(!this.provider)throw new Error("provider is undefined");return this.provider.wait(e.id,t,r)}}}async recoverPublicKey(e,t){if(!e.active)throw new Error("active is not defined");if(!e.signature_data)throw new Error("signature_data is not defined");let r=e.signature_data;t&&"function"==typeof t.transformSignature&&(r=await t.transformSignature(e.signature_data));let n=!0;t&&void 0!==t.compressed&&(n=t.compressed);const i=e;let o;const s=(0,f.decodeBase64)(i.active);if(i.header){const e=await this.serializer.serialize(i.header,"block_header",{bytesConversion:!0}),t=new Uint8Array(e.length+s.length);t.set(e,0),t.set(s,e.length),o=(0,a.sha256)(t)}else o=(0,a.sha256)(s);const u=(0,f.toHexString)((0,f.decodeBase64)(r)),l=Number(`0x${u.slice(0,2)}`)-31,h=u.slice(2,66),d=u.slice(66),p=BigInt(`0x${h}`),y=BigInt(`0x${d}`),m=new c.Signature(p,y),g=c.recoverPublicKey((0,f.toHexString)(o),m.toHex(),l);if(!g)throw new Error("Public key cannot be recovered");return n?c.Point.fromHex(g).toHex(!0):(0,f.toHexString)(g)}async recoverAddress(e,t){const r=await this.recoverPublicKey(e,t);return(0,f.bitcoinAddress)((0,f.toUint8Array)(r))}async encodeTransaction(e){let{nonce:t}=e;if(void 0===e.nonce){if(!this.provider)throw new Error("Cannot get the nonce because provider is undefined. To skip this call set a nonce in the parameters");t=await this.provider.getNonce(this.getAddress())}const r={rc_limit:void 0===e.rc_limit?1e8:e.rc_limit,nonce:t,operations:e.operations?e.operations:[]},n=await this.serializer.serialize(r,"active_transaction_data");return{active:(0,f.encodeBase64)(n)}}async decodeTransaction(e){if(!e.active)throw new Error("Active data is not defined");return this.serializer.deserialize(e.active,"active_transaction_data")}}t.Signer=h,t.default=h},5738: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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(8593)),a=r(9822),c=r(6991),u=r(5635),f=r(7187);window.utils=s,window.Contract=a.Contract,window.Signer=c.Signer,window.Provider=u.Provider,window.Serializer=f.Serializer},8593: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.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolTypes=t.Krc20Abi=t.parseUnits=t.formatUnits=t.bitcoinAddress=t.bitcoinDecode=t.bitcoinEncode=t.decodeBase64=t.encodeBase64=t.decodeBase58=t.encodeBase58=t.toHexString=t.toUint8Array=void 0;const a=o(r(6957)),c=r(3061),u=r(830),f=s(r(7177)),l=s(r(6139));function h(e){return(new TextDecoder).decode(a.encode("z",e)).slice(1)}function d(e){return a.decode(`z${e}`)}function p(e,t,r=!1){let n,i,o;"public"===t?(n=new Uint8Array(25),i=new Uint8Array(21),n[0]=0,i[0]=0,o=21):(r?(n=new Uint8Array(38),i=new Uint8Array(34),o=34,n[33]=1,i[33]=1):(n=new Uint8Array(37),i=new Uint8Array(33),o=33),n[0]=128,i[0]=128),i.set(e,1);const s=(0,c.sha256)(i),a=(0,c.sha256)(s),u=new Uint8Array(4);return u.set(a.slice(0,4)),n.set(e,1),n.set(u,o),h(n)}t.toUint8Array=function(e){const t=e.match(/[\dA-F]{2}/gi);if(!t)throw new Error("Invalid hex");return new Uint8Array(t.map((e=>parseInt(e,16))))},t.toHexString=function(e){return Array.from(e).map((e=>`0${Number(e).toString(16)}`.slice(-2))).join("")},t.encodeBase58=h,t.decodeBase58=d,t.encodeBase64=function(e){return(new TextDecoder).decode(a.encode("U",e)).slice(1)},t.decodeBase64=function(e){return a.decode(`U${e}`)},t.bitcoinEncode=p,t.bitcoinDecode=function(e){const t=d(e),r=new Uint8Array(32),n=new Uint8Array(4);return r.set(t.slice(1,33)),"5"!==e[0]?n.set(t.slice(34,38)):n.set(t.slice(33,37)),r},t.bitcoinAddress=function(e){const t=(0,c.sha256)(e);return p((0,u.ripemd160)(t),"public")},t.formatUnits=function(e,t){let r="string"==typeof e?e:BigInt(e).toString();const n="-"===r[0]?"-":"";return r=r.replace("-","").padStart(t+1,"0"),`${n}${r.substring(0,r.length-t).replace(/^0+(?=\d)/,"")}.${r.substring(r.length-t)}`.replace(/(\.0+)?(0+)$/,"")},t.parseUnits=function(e,t){const r="-"===e[0]?"-":"";let[n,i]=e.replace("-","").replace(",",".").split(".");return i||(i=""),i=i.padEnd(t,"0"),`${r}${`${n}${i}`.replace(/^0+(?=\d)/,"")}`},t.Krc20Abi={methods:{name:{entryPoint:1995063959,input:"name_arguments",output:"name_result",readOnly:!0},symbol:{entryPoint:2121878308,input:"symbol_arguments",output:"symbol_result",readOnly:!0},decimals:{entryPoint:1507595726,input:"decimals_arguments",output:"decimals_result",readOnly:!0},totalSupply:{entryPoint:3475931666,input:"total_supply_arguments",output:"total_supply_result",readOnly:!0},balanceOf:{entryPoint:358715976,input:"balance_of_arguments",output:"balance_of_result",readOnly:!0,defaultOutput:{value:"0"}},transfer:{entryPoint:1659871890,input:"transfer_arguments",output:"transfer_result"},mint:{entryPoint:3271044060,input:"mint_arguments",output:"mint_result"}},types:f.default},t.ProtocolTypes=l.default},9159:()=>{},7177:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{"value":{"type":"bool","id":1}}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{"value":{"type":"bool","id":1}}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}')},6139:e=>{"use strict";e.exports=JSON.parse('{"nested":{"koinos":{"nested":{"protocol":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/protocol"},"nested":{"contract_call_bundle":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2}}},"system_call_target":{"oneofs":{"target":{"oneof":["thunk_id","system_call_bundle"]}},"fields":{"thunk_id":{"type":"uint32","id":1},"system_call_bundle":{"type":"contract_call_bundle","id":2}}},"upload_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"bytecode":{"type":"bytes","id":2}}},"call_contract_operation":{"fields":{"contract_id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"CONTRACT_ID"}},"entry_point":{"type":"uint32","id":2},"args":{"type":"bytes","id":3}}},"set_system_call_operation":{"fields":{"call_id":{"type":"uint32","id":1},"target":{"type":"system_call_target","id":2}}},"operation":{"oneofs":{"op":{"oneof":["upload_contract","call_contract","set_system_call"]}},"fields":{"upload_contract":{"type":"upload_contract_operation","id":1},"call_contract":{"type":"call_contract_operation","id":2},"set_system_call":{"type":"set_system_call_operation","id":3}}},"active_transaction_data":{"fields":{"rc_limit":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"nonce":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"operations":{"rule":"repeated","type":"operation","id":3}}},"passive_transaction_data":{"fields":{}},"transaction":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"TRANSACTION_ID"}},"active":{"type":"bytes","id":2},"passive":{"type":"bytes","id":3},"signature_data":{"type":"bytes","id":4}}},"active_block_data":{"fields":{"transaction_merkle_root":{"type":"bytes","id":1},"passive_data_merkle_root":{"type":"bytes","id":2},"signer":{"type":"bytes","id":3}}},"passive_block_data":{"fields":{}},"block_header":{"fields":{"previous":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"height":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"timestamp":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"block":{"fields":{"id":{"type":"bytes","id":1,"options":{"(koinos_bytes_type)":"BLOCK_ID"}},"header":{"type":"block_header","id":2},"active":{"type":"bytes","id":3},"passive":{"type":"bytes","id":4},"signature_data":{"type":"bytes","id":5},"transactions":{"rule":"repeated","type":"transaction","id":6}}},"block_receipt":{"fields":{}}}}}}}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(5738)})();