(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7207],{62412:function(t,e,r){"use strict";e._O=e.Jq=e.KB=e.u8=e.cv=void 0,e.Ik=e.A9=e.n_=e.gM=void 0;let n=r(15313);function i(t){if(!(t instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function o(t){return i(t),n.Buffer.from(t.buffer,t.byteOffset,t.length)}class s{constructor(t,e){if(!Number.isInteger(t))throw TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(t){let e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}class c extends s{isCount(){throw Error("ExternalLayout is abstract")}}class u extends c{constructor(t,e=0,r){if(!(t instanceof s))throw TypeError("layout must be a Layout");if(!Number.isInteger(e))throw TypeError("offset must be integer or undefined");super(t.span,r||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof l||this.layout instanceof h}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,r=0){return this.layout.encode(t,e,r+this.offset)}}class l extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntLE(t,r,this.span),this.span}}class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,r=0){return o(e).writeUIntBE(t,r,this.span),this.span}}function f(t){let e=Math.floor(t/4294967296);return{hi32:e,lo32:t-4294967296*e}}function d(t,e){return 4294967296*t+e}class y extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return d(r.readUInt32LE(e+4),n)}encode(t,e,r=0){let n=f(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}class p extends s{constructor(t){super(8,t)}decode(t,e=0){let r=o(t),n=r.readUInt32LE(e);return d(r.readInt32LE(e+4),n)}encode(t,e,r=0){let n=f(t),i=o(e);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}class M extends s{constructor(t,e,r){if(!(t instanceof s))throw TypeError("elementLayout must be a Layout");if(!(e instanceof c&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;e instanceof c||!(0<t.span)||(n=e*t.span),super(n,r),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof c&&(n=n.decode(t,e)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(t,e+r),++i}return r}decode(t,e=0){let r=[],n=0,i=this.count;for(i instanceof c&&(i=i.decode(t,e));n<i;)r.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),n+=1;return r}encode(t,e,r=0){let n=this.elementLayout,i=t.reduce((t,i)=>t+n.encode(i,e,r+t),0);return this.count instanceof c&&this.count.encode(t.length,e,r),i}}class w extends s{constructor(t,e,r){if(!(Array.isArray(t)&&t.reduce((t,e)=>t&&e instanceof s,!0)))throw TypeError("fields must be array of Layout instances");for(let n of("boolean"==typeof e&&void 0===r&&(r=e,e=void 0),t))if(0>n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=t.reduce((t,e)=>t+e.getSpan(),0)}catch(t){}super(n,e),this.fields=t,this.decodePrefixes=!!r}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let i=n.getSpan(t,e);return e+=i,r+i},0)}catch(t){throw RangeError("indeterminate span")}return r}decode(t,e=0){i(t);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(t,e)),e+=n.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return r}encode(t,e,r=0){let n=r,i=0,o=0;for(let n of this.fields){let s=n.span;if(o=0<s?s:0,void 0!==n.property){let i=t[n.property];void 0!==i&&(o=n.encode(i,e,r),0>s&&(s=n.getSpan(e,r)))}i=r,r+=s}return i+o-n}fromArray(t){let e=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<t.length&&(e[r.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw TypeError("property must be string");let e=0;for(let r of this.fields){if(r.property===t)return e;0>r.span?e=-1:0<=e&&(e+=r.span)}}}class g{constructor(t){this.property=t}decode(t,e){throw Error("UnionDiscriminator is abstract")}encode(t,e,r){throw Error("UnionDiscriminator is abstract")}}class j extends g{constructor(t,e){if(!(t instanceof c&&t.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,r){return this.layout.encode(t,e,r)}}class m extends s{constructor(t,e,r){let n;if(t instanceof l||t instanceof h)n=new j(new u(t));else if(t instanceof c&&t.isCount())n=new j(t);else if(t instanceof g)n=t;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===e&&(e=null),!(null===e||e instanceof s))throw TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let i=-1;e&&0<=(i=e.span)&&(t instanceof l||t instanceof h)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=t instanceof l||t instanceof h,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;let r=this.getVariant(t,e);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;let e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(let e in this.registry){let r=this.registry[e];if(r.property&&Object.prototype.hasOwnProperty.call(t,r.property))return r}throw Error("unable to infer src variant")}decode(t,e=0){let r;let n=this.discriminator,i=n.decode(t,e),o=this.registry[i];if(void 0===o){let o=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),(r=this.makeDestinationObject())[n.property]=i,r[o.property]=o.decode(t,e+s)}else r=o.decode(t,e);return r}encode(t,e,r=0){let n=this.getSourceVariant(t);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,o=0;return this.usesPrefixDiscriminator&&(o=n.layout.span),n.encode(t[n.property],e,r),o+i.encode(t[i.property],e,r+o)}return n.encode(t,e,r)}addVariant(t,e,r){let n=new L(this,t,e,r);return this.registry[t]=n,n}getVariant(t,e=0){let r;return t instanceof Uint8Array?r=this.discriminator.decode(t,e):r=t,this.registry[r]}}class L extends s{constructor(t,e,r,n){if(!(t instanceof m))throw TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof s))throw TypeError("layout must be a Layout");if(null!==t.defaultLayout&&0<=r.span&&r.span>t.defaultLayout.span)throw Error("variant span exceeds span of containing union");if("string"!=typeof n)throw TypeError("variant must have a String property")}let i=t.span;0>t.span&&0<=(i=r?r.span:0)&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span),super(i,n),this.union=t,this.variant=e,this.layout=r||null}getSpan(t,e=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(t,e+r)),r+n}decode(t,e=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(t,e+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(t,e,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,r);let i=n;if(this.layout&&(this.layout.encode(t[this.property],e,r+n),i+=this.layout.getSpan(e,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function N(t){return 0>t&&(t+=4294967296),t}class I extends s{constructor(t,e,r){if(!(t instanceof l||t instanceof h))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===r&&(r=e,e=!1),4<t.span)throw RangeError("word cannot exceed 32 bits");super(t.span,r),this.word=t,this.msb=!!e,this.fields=[];let n=0;this._packedSetValue=function(t){return n=N(t),this},this._packedGetValue=function(){return n}}decode(t,e=0){let r=this.makeDestinationObject(),n=this.word.decode(t,e);for(let e of(this._packedSetValue(n),this.fields))void 0!==e.property&&(r[e.property]=e.decode(t));return r}encode(t,e,r=0){let n=this.word.decode(e,r);for(let e of(this._packedSetValue(n),this.fields))if(void 0!==e.property){let r=t[e.property];void 0!==r&&e.encode(r)}return this.word.encode(this._packedGetValue(),e,r)}addField(t,e){let r=new b(this,t,e);return this.fields.push(r),r}addBoolean(t){let e=new x(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw TypeError("property must be string");for(let e of this.fields)if(e.property===t)return e}}class b{constructor(t,e,r){if(!(t instanceof I))throw TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw TypeError("bits must be positive integer");let n=8*t.span,i=t.fields.reduce((t,e)=>t+e.bits,0);if(e+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=n-i-e),this.wordMask=N(this.valueMask<<this.start),this.property=r}decode(t,e){return N(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==N(t&this.valueMask))throw TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let e=this.container._packedGetValue(),r=N(t<<this.start);this.container._packedSetValue(N(e&~this.wordMask)|r)}}class x extends b{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t=+t),super.encode(t)}}class E extends s{constructor(t,e){if(!(t instanceof c&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;t instanceof c||(r=t),super(r,e),this.length=t}getSpan(t,e){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),r}decode(t,e=0){let r=this.span;return 0>r&&(r=this.length.decode(t,e)),o(t).slice(e,e+r)}encode(t,e,r){let n=this.length;if(this.length instanceof c&&(n=t.length),!(t instanceof Uint8Array&&n===t.length))throw TypeError(a("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>e.length)throw RangeError("encoding overruns Uint8Array");let i=o(t);return o(e).write(i.toString("hex"),r,n,"hex"),this.length instanceof c&&this.length.encode(n,e,r),n}}e.cv=(t,e,r)=>new u(t,e,r),e.u8=t=>new l(1,t),e.KB=t=>new l(2,t),e.Jq=t=>new l(4,t),e._O=t=>new y(t),e.gM=t=>new p(t),e.n_=(t,e,r)=>new w(t,e,r),e.A9=(t,e,r)=>new M(t,e,r),e.Ik=(t,e)=>new E(t,e)},30375:function(t,e,r){"use strict";var n=r(21607).Buffer;t.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw TypeError(o+" is ambiguous");e[s]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function h(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===c;)i++,r++;for(var s=(t.length-r)*u+1>>>0,l=new Uint8Array(s);r<t.length;){var h=e[t.charCodeAt(r)];if(255===h)return;for(var f=0,d=s-1;(0!==h||f<o)&&-1!==d;d--,f++)h+=a*l[d]>>>0,l[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");o=f,r++}for(var y=s-o;y!==s&&0===l[y];)y++;var p=n.allocUnsafe(i+(s-y));p.fill(0,0,i);for(var M=i;y!==s;)p[M++]=l[y++];return p}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var u=(s-o)*l+1>>>0,h=new Uint8Array(u);o!==s;){for(var f=e[o],d=0,y=u-1;(0!==f||d<i)&&-1!==y;y--,d++)f+=256*h[y]>>>0,h[y]=f%a>>>0,f=f/a>>>0;if(0!==f)throw Error("Non-zero carry");i=d,o++}for(var p=u-i;p!==u&&0===h[p];)p++;for(var M=c.repeat(r);p<u;++p)M+=t.charAt(h[p]);return M},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw Error("Non-base"+a+" character")}}}},69841:function(t){"use strict";t.exports=function(t){if(t.length>=255)throw TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw TypeError(i+" is ambiguous");e[o]=n}var s=t.length,a=t.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function l(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var r=0,n=0,i=0;t[r]===a;)n++,r++;for(var o=(t.length-r)*c+1>>>0,u=new Uint8Array(o);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var h=0,f=o-1;(0!==l||h<i)&&-1!==f;f--,h++)l+=s*u[f]>>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw Error("Non-zero carry");i=h,r++}for(var d=o-i;d!==o&&0===u[d];)d++;for(var y=new Uint8Array(n+(o-d)),p=n;d!==o;)y[p++]=u[d++];return y}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var h=e[i],f=0,d=c-1;(0!==h||f<n)&&-1!==d;d--,f++)h+=256*l[d]>>>0,l[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw Error("Non-zero carry");n=f,i++}for(var y=c-n;y!==c&&0===l[y];)y++;for(var p=a.repeat(r);y<c;++y)p+=t.charAt(l[y]);return p},decodeUnsafe:l,decode:function(t){var e=l(t);if(e)return e;throw Error("Non-base"+s+" character")}}}},26447:function(t,e,r){"use strict";var n=r(15313).Buffer;e.oU=function(t){{let e=n.from(t);e.reverse();let r=e.toString("hex");return 0===r.length?BigInt(0):BigInt(`0x${r}`)}},e.k$=function(t,e){{let r=t.toString(16),i=n.from(r.padStart(2*e,"0").slice(0,2*e),"hex");return i.reverse(),i}}},32334:function(t,e,r){"use strict";var n=r(15313).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;let u=c(r(98394)),l=c(r(91945)),h=a(r(52511)),f=new("function"!=typeof TextDecoder?h.TextDecoder:TextDecoder)("utf-8",{fatal:!0});e.baseEncode=function(t){return"string"==typeof t&&(t=n.from(t,"utf8")),l.default.encode(n.from(t))},e.baseDecode=function(t){return n.from(l.default.decode(t))};class d extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}e.BorshError=d;class y{constructor(){this.buf=n.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.concat([this.buf,n.alloc(1024)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(n.from(new u.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(n.from(new u.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(n.from(new u.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(n.from(new u.default(t).toArray("le",64)))}writeBuffer(t){this.buf=n.concat([n.from(this.buf.subarray(0,this.length)),t,n.alloc(1024)]),this.length+=t.length}writeString(t){this.maybeResize();let e=n.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(n.from(t))}writeArray(t,e){for(let r of(this.maybeResize(),this.writeU32(t.length),t))this.maybeResize(),e(r)}toArray(){return this.buf.subarray(0,this.length)}}function p(t,e,r){let n=r.value;r.value=function(...t){try{return n.apply(this,t)}catch(t){if(t instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t.code)>=0)throw new d("Reached the end of buffer when deserializing");throw t}}}e.BinaryWriter=y;class M{constructor(t){this.buf=t,this.offset=0}readU8(){let t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){let t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){let t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){let t=this.readBuffer(8);return new u.default(t,"le")}readU128(){let t=this.readBuffer(16);return new u.default(t,"le")}readU256(){let t=this.readBuffer(32);return new u.default(t,"le")}readU512(){let t=this.readBuffer(64);return new u.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new d(`Expected buffer length ${t} isn't within bounds`);let e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){let t=this.readU32(),e=this.readBuffer(t);try{return f.decode(e)}catch(t){throw new d(`Error decoding UTF-8 string: ${t}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){let e=this.readU32(),r=[];for(let n=0;n<e;++n)r.push(t());return r}}function w(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,n,i){try{if("string"==typeof n)i[`write${w(n)}`](r);else if(n instanceof Array){if("number"==typeof n[0]){if(r.length!==n[0])throw new d(`Expecting byte array of length ${n[0]}, but got ${r.length} bytes`);i.writeFixedArray(r)}else if(2===n.length&&"number"==typeof n[1]){if(r.length!==n[1])throw new d(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let e=0;e<n[1];e++)g(t,null,r[e],n[0],i)}else i.writeArray(r,r=>{g(t,e,r,n[0],i)})}else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),g(t,e,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,o)=>{g(t,e,o,n.key,i),g(t,e,r,n.value,i)});break;default:throw new d(`FieldType ${n} unrecognized`)}else j(t,r,i)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function j(t,e,r){if("function"==typeof e.borshSerialize){e.borshSerialize(r);return}let n=t.get(e.constructor);if(!n)throw new d(`Class ${e.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{g(t,n,e[n],i,r)});else if("enum"===n.kind){let i=e[n.field];for(let o=0;o<n.values.length;++o){let[s,a]=n.values[o];if(s===i){r.writeU8(o),g(t,s,e[s],a,r);break}}}else throw new d(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}function m(t,e,r,n){try{if("string"==typeof r)return n[`read${w(r)}`]();if(r instanceof Array){if("number"==typeof r[0])return n.readFixedArray(r[0]);if("number"!=typeof r[1])return n.readArray(()=>m(t,e,r[0],n));{let e=[];for(let i=0;i<r[1];i++)e.push(m(t,null,r[0],n));return e}}if("option"===r.kind){if(n.readU8())return m(t,e,r.type,n);return}if("map"===r.kind){let i=new Map,o=n.readU32();for(let s=0;s<o;s++){let o=m(t,e,r.key,n),s=m(t,e,r.value,n);i.set(o,s)}return i}return L(t,r,n)}catch(t){throw t instanceof d&&t.addToFieldPath(e),t}}function L(t,e,r){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(r);let n=t.get(e);if(!n)throw new d(`Class ${e.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,o]of t.get(e).fields)n[i]=m(t,i,o,r);return new e(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new d(`Enum index: ${i} is out of range`);let[o,s]=n.values[i],a=m(t,o,s,r);return new e({[o]:a})}throw new d(`Unexpected schema kind: ${n.kind} for ${e.constructor.name}`)}s([p],M.prototype,"readU8",null),s([p],M.prototype,"readU16",null),s([p],M.prototype,"readU32",null),s([p],M.prototype,"readU64",null),s([p],M.prototype,"readU128",null),s([p],M.prototype,"readU256",null),s([p],M.prototype,"readU512",null),s([p],M.prototype,"readString",null),s([p],M.prototype,"readFixedArray",null),s([p],M.prototype,"readArray",null),e.BinaryReader=M,e.serialize=function(t,e,r=y){let n=new r;return j(t,e,n),n.toArray()},e.deserialize=function(t,e,r,n=M){let i=new n(r),o=L(t,e,i);if(i.offset<r.length)throw new d(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return o},e.deserializeUnchecked=function(t,e,r,n=M){return L(t,e,new n(r))}},91945:function(t,e,r){var n=r(30375);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},80400:function(t,e,r){let n=r(69841);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},21883:function(t){"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var c,u,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,i),!0;case 5:return l.fn.call(l.context,e,n,i,o),!0;case 6:return l.fn.call(l.context,e,n,i,o,s),!0}for(u=1,c=Array(h-1);u<h;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var f,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),h){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,i);break;default:if(!c)for(f=1,c=Array(h-1);f<h;f++)c[f-1]=arguments[f];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==e||i&&!a[c].once||n&&a[c].context!==n)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},35341:function(t,e,r){"use strict";let n=r(1205).v4,i=r(44544),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return n()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};t.exports=o,o.prototype.request=function(t,e,r,n){let o;let s=this,a=null,c=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&c)throw TypeError("JSON-RPC 1.0 does not support batching");let u=!c&&t&&"object"==typeof t&&"function"==typeof e;if(c||u)n=e,a=t;else{"function"==typeof r&&(n=r,r=void 0);let o="function"==typeof n;try{a=i(t,e,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(t){if(o)return n(t);throw t}if(!o)return a}try{o=JSON.stringify(a,this.options.replacer)}catch(t){return n(t)}return this.callServer(o,function(t,e){s._parseResponse(t,e,n)}),a},o.prototype._parseResponse=function(t,e,r){let n;if(t){r(t);return}if(!e)return r();try{n=JSON.parse(e,this.options.reviver)}catch(t){return r(t)}if(3===r.length){if(!Array.isArray(n))return r(null,n.error,n.result);{let t=function(t){return void 0!==t.error};return r(null,n.filter(t),n.filter(function(e){return!t(e)}))}}r(null,n)}},44544:function(t,e,r){"use strict";let n=r(1205).v4;t.exports=function(t,e,r,i){if("string"!=typeof t)throw TypeError(t+" must be a string");let o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw TypeError(o+" must be 1 or 2");let s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw TypeError(e+" must be an object, array or omitted");s.params=e}if(void 0===r){let t="function"==typeof i.generator?i.generator:function(){return n()};s.id=t(s,i)}else 2===o&&null===r?i.notificationIdNull&&(s.id=null):s.id=r;return s}},52511:function(t,e){"use strict";function r(t,e,r){return e<=t&&t<=r}function n(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function i(t){this.tokens=[].slice.call(t)}function o(t,e){if(t)throw TypeError("Decoder error");return e||65533}i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(;t.length;)this.tokens.push(t.shift());else this.tokens.push(t)}};var s="utf-8";function a(t,e){if(!(this instanceof a))return new a(t,e);if((t=void 0!==t?String(t).toLowerCase():s)!==s)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(t,e){if(!(this instanceof c))return new c(t,e);if((t=void 0!==t?String(t).toLowerCase():s)!==s)throw Error("Encoding not supported. Only utf-8 is supported");e=n(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function u(t){var e=t.fatal,n=0,i=0,s=0,a=128,c=191;this.handler=function(t,u){if(-1===u&&0!==s)return s=0,o(e);if(-1===u)return -1;if(0===s){if(r(u,0,127))return u;if(r(u,194,223))s=1,n=u-192;else if(r(u,224,239))224===u&&(a=160),237===u&&(c=159),s=2,n=u-224;else{if(!r(u,240,244))return o(e);240===u&&(a=144),244===u&&(c=143),s=3,n=u-240}return n<<=6*s,null}if(!r(u,a,c))return n=s=i=0,a=128,c=191,t.prepend(u),o(e);if(a=128,c=191,i+=1,n+=u-128<<6*(s-i),i!==s)return null;var l=n;return n=s=i=0,l}}function l(t){t.fatal,this.handler=function(t,e){if(-1===e)return -1;if(r(e,0,127))return e;r(e,128,2047)?(n=1,i=192):r(e,2048,65535)?(n=2,i=224):r(e,65536,1114111)&&(n=3,i=240);for(var n,i,o=[(e>>6*n)+i];n>0;){var s=e>>6*(n-1);o.push(128|63&s),n-=1}return o}}a.prototype={decode:function(t,e){r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=n(e),this._streaming||(this._decoder=new u({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!e.stream;for(var r,o,s=new i(r),a=[];!s.endOfStream()&&-1!==(o=this._decoder.handler(s,s.read()));)null!==o&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));if(!this._streaming){do{if(-1===(o=this._decoder.handler(s,s.read())))break;if(null===o)continue;Array.isArray(o)?a.push.apply(a,o):a.push(o)}while(!s.endOfStream());this._decoder=null}return!a.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0),function(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(1023&n)+56320))}return e}(a)}},c.prototype={encode:function(t,e){t=t?String(t):"",e=n(e),this._streaming||(this._encoder=new l(this._options)),this._streaming=!!e.stream;for(var r,o=[],s=new i(function(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319){if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=1023&o,c=1023&s;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}}n+=1}return i}(t));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?o.push.apply(o,r):o.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?o.push.apply(o,r):o.push(r);this._encoder=null}return new Uint8Array(o)}},e.TextEncoder=c,e.TextDecoder=a},1205:function(t,e,r){"use strict";r.d(e,{v4:function(){return u}});for(var n,i=new Uint8Array(16),o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase();if(!("string"==typeof r&&o.test(r)))throw TypeError("Stringified UUID is invalid");return r},u=function(t,e,r){var o=(t=t||{}).random||(t.rng||function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){r=r||0;for(var s=0;s<16;++s)e[r+s]=o[s];return e}return c(o)}},97738:function(t,e,r){"use strict";r.d(e,{UN:function(){return A}});var n=r(65439),i=r(25714),o=r(37058);let[s,a]=i.ZP.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.VR{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:h,Gh:f,Gl:d,Hh:y,Hl:p}=this;return[t,e,r,n,i,o,s,a,c,u,l,h,f,d,y,p]}set(t,e,r,n,i,o,s,a,c,u,l,h,f,d,y,p){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|h,this.Gh=0|f,this.Gl=0|d,this.Hh=0|y,this.Hl=0|p}process(t,e){for(let r=0;r<16;r++,e+=4)c[r]=t.getUint32(e),u[r]=t.getUint32(e+=4);for(let t=16;t<80;t++){let e=0|c[t-15],r=0|u[t-15],n=i.ZP.rotrSH(e,r,1)^i.ZP.rotrSH(e,r,8)^i.ZP.shrSH(e,r,7),o=i.ZP.rotrSL(e,r,1)^i.ZP.rotrSL(e,r,8)^i.ZP.shrSL(e,r,7),s=0|c[t-2],a=0|u[t-2],l=i.ZP.rotrSH(s,a,19)^i.ZP.rotrBH(s,a,61)^i.ZP.shrSH(s,a,6),h=i.ZP.rotrSL(s,a,19)^i.ZP.rotrBL(s,a,61)^i.ZP.shrSL(s,a,6),f=i.ZP.add4L(o,h,u[t-7],u[t-16]),d=i.ZP.add4H(f,n,l,c[t-7],c[t-16]);c[t]=0|d,u[t]=0|f}let{Ah:r,Al:n,Bh:o,Bl:l,Ch:h,Cl:f,Dh:d,Dl:y,Eh:p,El:M,Fh:w,Fl:g,Gh:j,Gl:m,Hh:L,Hl:N}=this;for(let t=0;t<80;t++){let e=i.ZP.rotrSH(p,M,14)^i.ZP.rotrSH(p,M,18)^i.ZP.rotrBH(p,M,41),I=i.ZP.rotrSL(p,M,14)^i.ZP.rotrSL(p,M,18)^i.ZP.rotrBL(p,M,41),b=p&w^~p&j,x=M&g^~M&m,E=i.ZP.add5L(N,I,x,a[t],u[t]),T=i.ZP.add5H(E,L,e,b,s[t],c[t]),v=0|E,A=i.ZP.rotrSH(r,n,28)^i.ZP.rotrBH(r,n,34)^i.ZP.rotrBH(r,n,39),D=i.ZP.rotrSL(r,n,28)^i.ZP.rotrBL(r,n,34)^i.ZP.rotrBL(r,n,39),S=r&o^r&h^o&h,z=n&l^n&f^l&f;L=0|j,N=0|m,j=0|w,m=0|g,w=0|p,g=0|M,({h:p,l:M}=i.ZP.add(0|d,0|y,0|T,0|v)),d=0|h,y=0|f,h=0|o,f=0|l,o=0|r,l=0|n;let O=i.ZP.add3L(v,D,z);r=i.ZP.add3H(O,T,A,S),n=0|O}({h:r,l:n}=i.ZP.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:l}=i.ZP.add(0|this.Bh,0|this.Bl,0|o,0|l)),({h:h,l:f}=i.ZP.add(0|this.Ch,0|this.Cl,0|h,0|f)),({h:d,l:y}=i.ZP.add(0|this.Dh,0|this.Dl,0|d,0|y)),({h:p,l:M}=i.ZP.add(0|this.Eh,0|this.El,0|p,0|M)),({h:w,l:g}=i.ZP.add(0|this.Fh,0|this.Fl,0|w,0|g)),({h:j,l:m}=i.ZP.add(0|this.Gh,0|this.Gl,0|j,0|m)),({h:L,l:N}=i.ZP.add(0|this.Hh,0|this.Hl,0|L,0|N)),this.set(r,n,o,l,h,f,d,y,p,M,w,g,j,m,L,N)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let h=(0,o.hE)(()=>new l);var f=r(62328),d=r(81776),y=r(553);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let p=BigInt(0),M=BigInt(1),w=BigInt(2),g=BigInt(8),j={zip215:!0},m=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),L=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),N=BigInt(0),I=BigInt(1),b=BigInt(2);BigInt(3);let x=BigInt(5),E=BigInt(8);function T(t,e){let r=(0,d.wQ)(e*e*e,m),n=function(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=t*t%m*t%m,s=(0,d.oA)(o,b,m)*o%m,a=(0,d.oA)(s,I,m)*t%m,c=(0,d.oA)(a,x,m)*a%m,u=(0,d.oA)(c,e,m)*c%m,l=(0,d.oA)(u,r,m)*u%m,h=(0,d.oA)(l,n,m)*l%m,f=(0,d.oA)(h,i,m)*h%m,y=(0,d.oA)(f,i,m)*h%m,p=(0,d.oA)(y,e,m)*c%m;return{pow_p_5_8:(0,d.oA)(p,b,m)*t%m,b2:o}}(t*(0,d.wQ)(r*r*e,m)).pow_p_5_8,i=(0,d.wQ)(t*r*n,m),o=(0,d.wQ)(e*i*i,m),s=i,a=(0,d.wQ)(i*L,m),c=o===t,u=o===(0,d.wQ)(-t,m),l=o===(0,d.wQ)(-t*L,m);return c&&(i=s),(u||l)&&(i=a),(0,d.Tu)(i,m)&&(i=(0,d.wQ)(-i,m)),{isValid:c||u,value:i}}let v=(0,d.gN)(m,void 0,!0),A=function(t){let e=function(t){let e=(0,f.Kd)(t);return y.FF(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}(t),{Fp:r,n:n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=e,u=w<<BigInt(8*a)-M,l=r.create,h=(0,d.gN)(e.n,e.nBitLength),m=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:r.sqrt(t*r.inv(e))}}catch(t){return{isValid:!1,value:p}}}),L=e.adjustScalarBytes||(t=>t),N=e.domain||((t,e,r)=>{if((0,y.uw)("phflag",r),e.length||r)throw Error("Contexts/pre-hash are not supported");return t});function I(t,e){y.Fy("coordinate "+t,e,p,u)}function b(t){if(!(t instanceof T))throw Error("ExtendedPoint expected")}let x=(0,y.H9)((t,e)=>{let{ex:n,ey:i,ez:o}=t,s=t.is0();null==e&&(e=s?g:r.inv(o));let a=l(n*e),c=l(i*e),u=l(o*e);if(s)return{x:p,y:M};if(u!==M)throw Error("invZ was invalid");return{x:a,y:c}}),E=(0,y.H9)(t=>{let{a:r,d:n}=e;if(t.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:s,et:a}=t,c=l(i*i),u=l(o*o),h=l(s*s),f=l(h*h),d=l(c*r);if(l(h*l(d+u))!==l(f+l(n*l(c*u))))throw Error("bad point: equation left != right (1)");if(l(i*o)!==l(s*a))throw Error("bad point: equation left != right (2)");return!0});class T{constructor(t,e,r,n){this.ex=t,this.ey=e,this.ez=r,this.et=n,I("x",t),I("y",e),I("z",r),I("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(t){if(t instanceof T)throw Error("extended point not allowed");let{x:e,y:r}=t||{};return I("x",e),I("y",r),new T(e,r,M,l(e*r))}static normalizeZ(t){let e=r.invertBatch(t.map(t=>t.ez));return t.map((t,r)=>t.toAffine(e[r])).map(T.fromAffine)}static msm(t,e){return(0,f.D1)(T,h,t,e)}_setWindowSize(t){D.setWindowSize(this,t)}assertValidity(){E(this)}equals(t){b(t);let{ex:e,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=t,a=l(e*s),c=l(i*n),u=l(r*s),h=l(o*n);return a===c&&u===h}is0(){return this.equals(T.ZERO)}negate(){return new T(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:t}=e,{ex:r,ey:n,ez:i}=this,o=l(r*r),s=l(n*n),a=l(w*l(i*i)),c=l(t*o),u=r+n,h=l(l(u*u)-o-s),f=c+s,d=f-a,y=c-s,p=l(h*d),M=l(f*y),g=l(h*y);return new T(p,M,l(d*f),g)}add(t){b(t);let{a:r,d:n}=e,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:h,et:f}=t;if(r===BigInt(-1)){let t=l((o-i)*(u+c)),e=l((o+i)*(u-c)),r=l(e-t);if(r===p)return this.double();let n=l(s*w*f),d=l(a*w*h),y=d+n,M=e+t,g=d-n,j=l(y*r),m=l(M*g),L=l(y*g);return new T(j,m,l(r*M),L)}let d=l(i*c),y=l(o*u),M=l(a*n*f),g=l(s*h),j=l((i+o)*(c+u)-d-y),m=g-M,L=g+M,N=l(y-r*d),I=l(j*m),x=l(L*N),E=l(j*N);return new T(I,x,l(m*L),E)}subtract(t){return this.add(t.negate())}wNAF(t){return D.wNAFCached(this,t,T.normalizeZ)}multiply(t){y.Fy("scalar",t,M,n);let{p:e,f:r}=this.wNAF(t);return T.normalizeZ([e,r])[0]}multiplyUnsafe(t){return(y.Fy("scalar",t,p,n),t===p)?A:this.equals(A)||t===M?this:this.equals(v)?this.wNAF(t).p:D.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return D.unsafeLadder(this,n).is0()}toAffine(t){return x(this,t)}clearCofactor(){let{h:t}=e;return t===M?this:this.multiplyUnsafe(t)}static fromHex(t,n=!1){let{d:i,a:o}=e,s=r.BYTES;t=(0,y.ql)("pointHex",t,s),(0,y.uw)("zip215",n);let a=t.slice(),c=t[s-1];a[s-1]=-129&c;let h=y.ty(a),f=n?u:r.ORDER;y.Fy("pointHex.y",h,p,f);let d=l(h*h),{isValid:w,value:g}=m(l(d-M),l(i*d-o));if(!w)throw Error("Point.fromHex: invalid y coordinate");let j=(g&M)===M,L=(128&c)!=0;if(!n&&g===p&&L)throw Error("Point.fromHex: x=0 and x_0=1");return L!==j&&(g=l(-g)),T.fromAffine({x:g,y:h})}static fromPrivateKey(t){return z(t).point}toRawBytes(){let{x:t,y:e}=this.toAffine(),n=y.S5(e,r.BYTES);return n[n.length-1]|=t&M?128:0,n}toHex(){return y.ci(this.toRawBytes())}}T.BASE=new T(e.Gx,e.Gy,M,l(e.Gx*e.Gy)),T.ZERO=new T(p,M,M,p);let{BASE:v,ZERO:A}=T,D=(0,f.Mx)(T,8*a);function S(t){var e;return e=y.ty(t),(0,d.wQ)(e,n)}function z(t){t=(0,y.ql)("private key",t,a);let e=(0,y.ql)("hashed private key",o(t),2*a),r=L(e.slice(0,a)),n=e.slice(a,2*a),i=S(r),s=v.multiply(i),c=s.toRawBytes();return{head:r,prefix:n,scalar:i,point:s,pointBytes:c}}function O(t=new Uint8Array,...e){return S(o(N(y.eV(...e),(0,y.ql)("context",t),!!i)))}return v._setWindowSize(8),{CURVE:e,getPublicKey:function(t){return z(t).pointBytes},sign:function(t,e,o={}){var s;t=(0,y.ql)("message",t),i&&(t=i(t));let{prefix:c,scalar:u,pointBytes:l}=z(e),h=O(o.context,c,t),f=v.multiply(h).toRawBytes(),M=(s=h+O(o.context,f,l,t)*u,(0,d.wQ)(s,n));y.Fy("signature.s",M,p,n);let w=y.eV(f,y.S5(M,r.BYTES));return(0,y.ql)("result",w,2*a)},verify:function(t,e,n,o=j){let s,a,c;let{context:u,zip215:l}=o,h=r.BYTES;t=(0,y.ql)("signature",t,2*h),e=(0,y.ql)("message",e),void 0!==l&&(0,y.uw)("zip215",l),i&&(e=i(e));let f=y.ty(t.slice(h,2*h));try{s=T.fromHex(n,l),a=T.fromHex(t.slice(0,h),l),c=v.multiplyUnsafe(f)}catch(t){return!1}if(!l&&s.isSmallOrder())return!1;let d=O(u,a.toRawBytes(),s.toRawBytes(),e);return a.add(s.multiplyUnsafe(d)).subtract(c).clearCofactor().equals(T.ZERO)},ExtendedPoint:T,utils:{getExtendedPublicKey:z,randomPrivateKey:()=>s(r.BYTES),precompute:(t=8,e=T.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}}({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:v,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:E,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:h,randomBytes:o.O6,adjustScalarBytes:function(t){return t[0]&=248,t[31]&=127,t[31]|=64,t},uvRatio:T});function D(t){if(!(t instanceof k))throw Error("RistrettoPoint expected")}let S=t=>T(I,t),z=t=>A.CURVE.Fp.create(null&bytesToNumberLE(t));function O(t){let{d:e}=A.CURVE,r=A.CURVE.Fp.ORDER,n=A.CURVE.Fp.create,i=n(null*t*t),o=n((i+I)*null),s=BigInt(-1),a=n((s-e*i)*n(i+e)),{isValid:c,value:u}=T(o,a),l=n(u*t);isNegativeLE(l,r)||(l=n(-l)),c||(u=l),c||(s=i);let h=n(s*(i-I)*null-a),f=u*u,d=n((u+u)*a),y=n(null*h),p=n(I-f),M=n(I+f);return new A.ExtendedPoint(n(d*M),n(p*y),n(y*M),n(d*p))}class k{constructor(t){this.ep=t}static fromAffine(t){return new k(A.ExtendedPoint.fromAffine(t))}static hashToCurve(t){let e=O(z((t=ensureBytes("ristrettoHash",t,64)).slice(0,32))),r=O(z(t.slice(32,64)));return new k(e.add(r))}static fromHex(t){t=ensureBytes("ristrettoHex",t,32);let{a:e,d:r}=A.CURVE,n=A.CURVE.Fp.ORDER,i=A.CURVE.Fp.create,o="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",s=z(t);if(!equalBytes(numberToBytesLE(s,32),t)||isNegativeLE(s,n))throw Error(o);let a=i(s*s),c=i(I+e*a),u=i(I-e*a),l=i(c*c),h=i(u*u),f=i(e*r*l-h),{isValid:d,value:y}=S(i(f*h)),p=i(y*u),M=i(y*p*f),w=i((s+s)*p);isNegativeLE(w,n)&&(w=i(-w));let g=i(c*M),j=i(w*g);if(!d||isNegativeLE(j,n)||g===N)throw Error(o);return new k(new A.ExtendedPoint(w,g,I,j))}toRawBytes(){let t,{ex:e,ey:r,ez:n,et:i}=this.ep,o=A.CURVE.Fp.ORDER,s=A.CURVE.Fp.create,a=s(s(n+r)*s(n-r)),c=s(e*r),u=s(c*c),{value:l}=S(s(a*u)),h=s(l*a),f=s(l*c),d=s(h*f*i);if(isNegativeLE(i*d,o)){let n=s(null*r),i=s(null*e);e=n,r=i,t=s(null*h)}else t=f;isNegativeLE(e*d,o)&&(r=s(-r));let y=s((n-r)*t);return isNegativeLE(y,o)&&(y=s(-y)),numberToBytesLE(y,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(t){D(t);let{ex:e,ey:r}=this.ep,{ex:n,ey:i}=t.ep,o=A.CURVE.Fp.create,s=o(e*i)===o(r*n),a=o(r*i)===o(e*n);return s||a}add(t){return D(t),new k(this.ep.add(t.ep))}subtract(t){return D(t),new k(this.ep.subtract(t.ep))}multiply(t){return new k(this.ep.multiply(t))}multiplyUnsafe(t){return new k(this.ep.multiplyUnsafe(t))}double(){return new k(this.ep.double())}negate(){return new k(this.ep.negate())}}},74083:function(t,e,r){"use strict";r.d(e,{H:function(){return u},i1:function(){return i},mI:function(){return a},su:function(){return c}});var n,i,o=r(21883),s=r(99889);(n=i||(i={})).Installed="Installed",n.NotDetected="NotDetected",n.Loadable="Loadable",n.Unsupported="Unsupported";class a extends o{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(t,e,r={}){let n=this.publicKey;if(!n)throw new s.oS;return t.feePayer=t.feePayer||n,t.recentBlockhash=t.recentBlockhash||(await e.getLatestBlockhash({commitment:r.preflightCommitment,minContextSlot:r.minContextSlot})).blockhash,t}}function c(t){if("undefined"==typeof window||"undefined"==typeof document)return;let e=[];function r(){if(t())for(let t of e)t()}let n=setInterval(r,1e3);e.push(()=>clearInterval(n)),"loading"===document.readyState&&(document.addEventListener("DOMContentLoaded",r,{once:!0}),e.push(()=>document.removeEventListener("DOMContentLoaded",r))),"complete"!==document.readyState&&(window.addEventListener("load",r,{once:!0}),e.push(()=>window.removeEventListener("load",r))),r()}function u(){if(!navigator)return!1;let t=navigator.userAgent.toLowerCase(),e=t.includes("iphone")||t.includes("ipad"),r=t.includes("safari");return e&&r}},99889:function(t,e,r){"use strict";r.d(e,{$w:function(){return a},IW:function(){return d},Nx:function(){return h},OZ:function(){return i},PY:function(){return y},UG:function(){return u},W8:function(){return o},at:function(){return c},cO:function(){return l},fk:function(){return p},lj:function(){return n},oS:function(){return f},p6:function(){return s}});class n extends Error{constructor(t,e){super(t),this.error=e}}class i extends n{constructor(){super(...arguments),this.name="WalletNotReadyError"}}class o extends n{constructor(){super(...arguments),this.name="WalletLoadError"}}class s extends n{constructor(){super(...arguments),this.name="WalletConfigError"}}class a extends n{constructor(){super(...arguments),this.name="WalletConnectionError"}}class c extends n{constructor(){super(...arguments),this.name="WalletDisconnectedError"}}class u extends n{constructor(){super(...arguments),this.name="WalletDisconnectionError"}}class l extends n{constructor(){super(...arguments),this.name="WalletAccountError"}}class h extends n{constructor(){super(...arguments),this.name="WalletPublicKeyError"}}class f extends n{constructor(){super(...arguments),this.name="WalletNotConnectedError"}}class d extends n{constructor(){super(...arguments),this.name="WalletSendTransactionError"}}class y extends n{constructor(){super(...arguments),this.name="WalletSignTransactionError"}}class p extends n{constructor(){super(...arguments),this.name="WalletSignMessageError"}}},43022:function(t,e,r){"use strict";r.d(e,{eC:function(){return a}});var n=r(74083),i=r(99889),o=r(72390);class s extends n.mI{async sendTransaction(t,e,r={}){let n=!0;try{if((0,o.W)(t)){if(!this.supportedTransactionVersions)throw new i.IW("Sending versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(t.version))throw new i.IW(`Sending transaction version ${t.version} isn't supported by this wallet`);try{let n=(t=await this.signTransaction(t)).serialize();return await e.sendRawTransaction(n,r)}catch(t){if(t instanceof i.PY)throw n=!1,t;throw new i.IW(t?.message,t)}}else try{let{signers:n,...i}=r;t=await this.prepareTransaction(t,e,i),n?.length&&t.partialSign(...n);let o=(t=await this.signTransaction(t)).serialize();return await e.sendRawTransaction(o,i)}catch(t){if(t instanceof i.PY)throw n=!1,t;throw new i.IW(t?.message,t)}}catch(t){throw n&&this.emit("error",t),t}}async signAllTransactions(t){for(let e of t)if((0,o.W)(e)){if(!this.supportedTransactionVersions)throw new i.PY("Signing versioned transactions isn't supported by this wallet");if(!this.supportedTransactionVersions.has(e.version))throw new i.PY(`Signing transaction version ${e.version} isn't supported by this wallet`)}let e=[];for(let r of t)e.push(await this.signTransaction(r));return e}}class a extends s{}},39712:function(t,e,r){"use strict";r.d(e,{N:function(){return a}});var n=r(47498),i=r(15189),o=r(19737),s=r(23533);function a(t){return o.V in t.features&&s.k in t.features&&(n.G in t.features||i.R in t.features)}},72390:function(t,e,r){"use strict";function n(t){return"version"in t}r.d(e,{W:function(){return n}})},93390:function(t,e,r){"use strict";r.d(e,{A:function(){return a}});var n=r(43022),i=r(74083),o=r(99889),s=r(51859);class a extends n.eC{constructor(t={}){super(),this.name="HuobiWallet",this.url="https://www.huobiwallet.io",this.icon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjI0IiBoZWlnaHQ9IjIyNCIgdmlld0JveD0iMCAwIDIyNCAyMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAwTDIyNCAwVjIyNEgwTDAgMFoiIGZpbGw9IiMyMTU3RTIiLz4KPHBhdGggZD0iTTEzMS4wNTkgODEuMTc3MUMxMzEuMDU5IDU3Ljc1MzEgMTE5LjQ1OCAzNy42MzE1IDExMC42MjUgMzEuMDcyOEMxMTAuNjI1IDMxLjA3MjggMTA5Ljk1MyAzMC43MD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Y29sb3I9IndoaXRlIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQxX2xpbmVhcl8xMTAxXzEyNSIgeDE9IjE1Ny44NjEiIHkxPSIyMDMuMTc3IiB4Mj0iMTg5LjAxNCIgeTI9IjE0MC4wMjIiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0Y3RjZGRiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IndoaXRlIi8+CjwvbGluZWFyR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg==",this.supportedTransactionVersions=null,this._readyState="undefined"==typeof window||"undefined"==typeof document?i.i1.Unsupported:i.i1.NotDetected,this._disconnected=()=>{let t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new o.at),this.emit("disconnect"))},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==i.i1.Unsupported&&(0,i.su)(()=>!!window.huobiWallet?.isHuobiWallet&&(this._readyState=i.i1.Installed,this.emit("readyStateChange",this._readyState),!0))}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){return!!this._wallet?.isConnected}get readyState(){return this._readyState}async connect(){try{let t;if(this.connected||this.connecting)return;if(this._readyState!==i.i1.Installed)throw new o.OZ;this._connecting=!0;let e=window.huobiWallet;try{await e.connect()}catch(t){throw new o.$w(t?.message,t)}if(!e.publicKey)throw new o.cO;try{t=new s.nh(e.publicKey.toBytes())}catch(t){throw new o.Nx(t?.message,t)}e.on("disconnect",this._disconnected),this._wallet=e,this._publicKey=t,this.emit("connect",t)}catch(t){throw this.emit("error",t),t}finally{this._connecting=!1}}async disconnect(){let t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("disconnect"))}async signTransaction(t){try{let e=this._wallet;if(!e)throw new o.oS;try{return await e.signTransaction(t)||t}catch(t){throw new o.PY(t?.message,t)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(t){try{let e=this._wallet;if(!e)throw new o.oS;try{return await e.signAllTransactions(t)||t}catch(t){throw new o.PY(t?.message,t)}}catch(t){throw this.emit("error",t),t}}async signMessage(t){try{let e=this._wallet;if(!e)throw new o.oS;try{let{signature:r}=await e.signMessage(t);return r}catch(t){throw new o.fk(t?.message,t)}}catch(t){throw this.emit("error",t),t}}}},36369:function(t,e,r){"use strict";r.d(e,{e:function(){return C}});var n,i,o,s,a,c,u,l,h,f,d,y,p,M,w,g=r(43022),j=r(74083),m=r(99889),L=r(72390),N=r(51859),I=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class x extends Event{constructor(t){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),n.set(this,void 0),I(this,n,t,"f")}get detail(){return b(this,n,"f")}get type(){return"wallet-standard:register-wallet"}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}}n=new WeakMap;var E=r(47498),T=r(15189),v=r(56365),A=r(19737),D=r(97253),S=r(23533),z=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},O=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class k{constructor(){i.add(this),o.set(this,{}),s.set(this,"1.0.0"),a.set(this,"MetaMask"),c.set(this,"data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjMxIiB2aWV3Qm94PSIwIDAgMzEgMzEiIHdpZHRoPSIzMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGxpbmVhckdyYWRpZW50IGlkPSJhIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjIwLjI1IiB4Mj0iMjYuNTcxIiB5MT0iMjcuMTczIiB5Mj0iMTkuODU4Ij48c3RvcCBvZmZzZXQ9Ii4wOCIgc3RvcC1jb2xvcj0iIzk5NDVmZiIvPjxzdG9wIG9mZnNldD0iLjMiIHN0b3AtY29sb3I9IiM4NzUyZjMiLz48c3RvcCBvZmZzZXQ9Ii41IiBzdG9wLWNvbG9yPSIjNTQ5N2Q1Ii8+PHN0b3Agb2Zmc2V0PSIuNiIgc3RvcC1jb2xvcj0iIzQzYjRjYSIvPjxzdG9wIG9mZnNldD0iLjcyIiBzdG9wLWNvbG9yPSIjMjhlMGI5Ii8+PHN0b3Agb2Zmc2V0PSIuOTciIHN0b3AtY29sb3I9IiMxOWZiOWIiLz48L2xpbmVhckdyYWRpZW50PjxnIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iLjA5NCI+PHBhdGggZD0ibTI2LjEwOSAzLjY0My05LjM2OSA2Ljk1OSAxLjczMy00LjEwNSA3LjYzNy0yLjg1M3oiIGZpbGw9IiNlMjc2MWIiIHN0cm9rZT0iI2UyNzYxYiIvPjxnIGZpbG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DQ3LS4wMzkuMDc2cy0uMDAxLjA1OC4wMS4wODQuMDMxLjA0OS4wNTYuMDY1LjA1NC4wMjQuMDgzLjAyNHoiIGZpbGw9InVybCgjYSkiLz48L3N2Zz4="),u.set(this,null),l.set(this,(t,e)=>(z(this,o,"f")[t]?.push(e)||(z(this,o,"f")[t]=[e]),()=>z(this,i,"m",f).call(this,t,e))),d.set(this,async()=>{if(!z(this,u,"f")){let t;try{t=(await r.e(2682).then(r.bind(r,82682))).default}catch(t){throw Error("Unable to load Solflare MetaMask SDK")}O(this,u,new t,"f"),z(this,u,"f").on("standard_change",t=>z(this,i,"m",h).call(this,"change",t))}return this.accounts.length||await z(this,u,"f").connect(),{accounts:this.accounts}}),y.set(this,async()=>{z(this,u,"f")&&await z(this,u,"f").disconnect()}),p.set(this,async(...t)=>{if(!z(this,u,"f"))throw new m.oS;return await z(this,u,"f").standardSignAndSendTransaction(...t)}),M.set(this,async(...t)=>{if(!z(this,u,"f"))throw new m.oS;return await z(this,u,"f").standardSignTransaction(...t)}),w.set(this,async(...t)=>{if(!z(this,u,"f"))throw new m.oS;return await z(this,u,"f").standardSignMessage(...t)})}get version(){return z(this,s,"f")}get name(){return z(this,a,"f")}get icon(){return z(this,c,"f")}get chains(){return["solana:mainnet","solana:devnet","solana:testnet"]}get features(){return{[A.V]:{version:"1.0.0",connect:z(this,d,"f")},[D.R]:{version:"1.0.0",disconnect:z(this,y,"f")},[S.k]:{version:"1.0.0",on:z(this,l,"f")},[E.G]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:z(this,p,"f")},[T.R]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:z(this,M,"f")},[v.g]:{version:"1.0.0",signMessage:z(this,w,"f")}}}get accounts(){return z(this,u,"f")?z(this,u,"f").standardAccounts:[]}}o=new WeakMap,s=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap,d=new WeakMap,y=new WeakMap,p=new WeakMap,M=new WeakMap,w=new WeakMap,i=new WeakSet,h=function(t,...e){z(this,o,"f")[t]?.forEach(t=>t.apply(null,e))},f=function(t,e){z(this,o,"f")[t]=z(this,o,"f")[t]?.filter(t=>e!==t)};let U=!1;async function _(){let t="solflare-detect-metamask";function e(){window.postMessage({target:"metamask-contentscript",data:{name:"metamask-provider",data:{id:t,jsonrpc:"2.0",method:"wallet_getSnaps"}}},window.location.origin)}function r(n){let i=n.data;i?.target==="metamask-inpage"&&i.data?.name==="metamask-provider"&&(i.data.data?.id===t?(window.removeEventListener("message",r),!i.data.data.error&&(U||(function(t){let e=({register:e})=>e(t);try{window.dispatchEvent(new x(e))}catch(t){console.error("wallet-standard:register-wallet event could not be dispatched\n",t)}try{window.addEventListener("wallet-standard:app-ready",({detail:t})=>e(t))}catch(t){console.error("wallet-standard:app-ready event listener could not be added\n",t)}}(new k),U=!0))):e())}window.addEventListener("message",r),window.setTimeout(()=>window.removeEventListener("message",r),5e3),e()}class C extends g.eC{constructor(t={}){super(),this.name="Solflare",this.url="https://solflare.com",this.icon="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjUwIiB2aWV3Qm94PSIwIDAgNTAgNTAiIHdpZHRoPSI1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGxpbmVhckdyYWRpZW50IGlkPSJhIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmMxMGIiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmYjNmMmUiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0iYiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSI2LjQ3ODM1IiB4Mj0iMzQuOTEwNyIgeGxpbms6aHJlZj0iI2EiIHkxPSI3LjkyIiB5Mj0iMzM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TQ3LjY3OTczLS45NTQ3Yy41MjUgMCAuOTUwNy40MjEuOTUwNy45NDAzcy0uNDI1Ny45NDAyLS45NTA3Ljk0MDItLjk1MDctLjQyMDktLjk1MDctLjk0MDIuNDI1Ny0uOTQwMy45NTA3LS45NDAzem0tMjQuNjI5Ni0yMi40Nzk3Yy41MjUgMCAuOTUwNi40MjA5NzMuOTUwNi45NDAyNyAwIC41MTkzLS40MjU2Ljk0MDI3LS45NTA2Ljk0MDI3LS41MjUxIDAtLjk1MDctLjQyMDk3LS45NTA3LS45NDAyNyAwLS41MTkyOTcuNDI1Ni0uOTQwMjcuOTUwNy0uOTQwMjd6IiBmaWxsPSJ1cmwoI2IpIi8+PHBhdGggZD0ibTI0LjU3MSAzMi43NzkyYzQuOTU5NiAwIDguOTgwMi0zLjk3NjUgOC45ODAyLTguODgxOSAwLTQuOTA1My00LjAyMDYtOC44ODE5LTguOTgwMi04Ljg4MTlzLTguOTgwMiAzLjk3NjYtOC45ODAyIDguODgxOWMwIDQuOTA1NCA0LjAyMDYgOC44ODE5IDguOTgwMiA4Ljg4MTl6IiBmaWxsPSJ1cmwoI2MpIi8+PC9zdmc+",this.supportedTransactionVersions=new Set(["legacy",0]),this._readyState="undefined"==typeof window||"undefined"==typeof document?j.i1.Unsupported:j.i1.Loadable,this._disconnected=()=>{let t=this._wallet;t&&(t.off("disconnect",this._disconnected),this._wallet=null,this._publicKey=null,this.emit("error",new m.at),this.emit("disconnect"))},this._accountChanged=t=>{if(!t)return;let e=this._publicKey;if(e){try{t=new N.nh(t.toBytes())}catch(t){this.emit("error",new m.Nx(t?.message,t));return}e.equals(t)||(this._publicKey=t,this.emit("connect",t))}},this._connecting=!1,this._publicKey=null,this._wallet=null,this._config=t,this._readyState!==j.i1.Unsupported&&((0,j.su)(()=>(!!window.solflare?.isSolflare||!!window.SolflareApp)&&(this._readyState=j.i1.Installed,this.emit("readyStateChange",this._readyState),!0)),_())}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get connected(){return!!this._wallet?.connected}get readyState(){return this._readyState}async autoConnect(){this.readyState===j.i1.Loadable&&(0,j.H)()||await this.connect()}async connect(){try{let t,e,n;if(this.connected||this.connecting)return;if(this._readyState!==j.i1.Loadable&&this._readyState!==j.i1.Installed)throw new m.OZ;if(this.readyState===j.i1.Loadable&&(0,j.H)()){let t=encodeURIComponent(window.location.href),e=encodeURIComponent(window.location.origin);window.location.href=`https://solflare.com/ul/v1/browse/${t}?ref=${e}`;return}try{t=(await r.e(9378).then(r.bind(r,69378))).default}catch(t){throw new m.W8(t?.message,t)}try{e=new t({network:this._config.network})}catch(t){throw new m.p6(t?.message,t)}if(this._connecting=!0,!e.connected)try{await e.connect()}catch(t){throw new m.$w(t?.message,t)}if(!e.publicKey)throw new m.$w;try{n=new N.nh(e.publicKey.toBytes())}catch(t){throw new m.Nx(t?.message,t)}e.on("disconnect",this._disconnected),e.on("accountChanged",this._accountChanged),this._wallet=e,this._publicKey=n,this.emit("connect",n)}catch(t){throw this.emit("error",t),t}finally{this._connecting=!1}}async disconnect(){let t=this._wallet;if(t){t.off("disconnect",this._disconnected),t.off("accountChanged",this._accountChanged),this._wallet=null,this._publicKey=null;try{await t.disconnect()}catch(t){this.emit("error",new m.UG(t?.message,t))}}this.emit("disconnect")}async sendTransaction(t,e,r={}){try{let n=this._wallet;if(!n)throw new m.oS;try{let{signers:i,...o}=r;return(0,L.W)(t)?i?.length&&t.sign(i):(t=await this.prepareTransaction(t,e,o),i?.length&&t.partialSign(...i)),o.preflightCommitment=o.preflightCommitment||e.commitment,await n.signAndSendTransaction(t,o)}catch(t){if(t instanceof m.lj)throw t;throw new m.IW(t?.message,t)}}catch(t){throw this.emit("error",t),t}}async signTransaction(t){try{let e=this._wallet;if(!e)throw new m.oS;try{return await e.signTransaction(t)||t}catch(t){throw new m.PY(t?.message,t)}}catch(t){throw this.emit("error",t),t}}async signAllTransactions(t){try{let e=this._wallet;if(!e)throw new m.oS;try{return await e.signAllTransactions(t)||t}catch(t){throw new m.PY(t?.message,t)}}catch(t){throw this.emit("error",t),t}}async signMessage(t){try{let e=this._wallet;if(!e)throw new m.oS;try{return await e.signMessage(t,"utf8")}catch(t){throw new m.fk(t?.message,t)}}catch(t){throw this.emit("error",t),t}}}},47498:function(t,e,r){"use strict";r.d(e,{G:function(){return n}});let n="solana:signAndSendTransaction"},56365:function(t,e,r){"use strict";r.d(e,{g:function(){return n}});let n="solana:signMessage"},15189:function(t,e,r){"use strict";r.d(e,{R:function(){return n}});let n="solana:signTransaction"},90793:function(t,e,r){"use strict";function n(t){switch(t){case"processed":case"confirmed":case"finalized":case void 0:return t;case"recent":return"processed";case"single":case"singleGossip":return"confirmed";case"max":case"root":return"finalized";default:return}}r.d(e,{V:function(){return n}})},6139:function(t,e,r){"use strict";let n;r.d(e,{M:function(){return u}});var i,o=function(t,e,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},s=function(t,e,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};let a=new Set,c={};function u(){if(n||(n=Object.freeze({register:l,get:h,on:f}),"undefined"==typeof window))return n;let t=Object.freeze({register:l});try{window.addEventListener("wallet-standard:register-wallet",({detail:e})=>e(t))}catch(t){console.error("wallet-standard:register-wallet event listener could not be added\n",t)}try{window.dispatchEvent(new y(t))}catch(t){console.error("wallet-standard:app-ready event could not be dispatched\n",t)}return n}function l(...t){return(t=t.filter(t=>!a.has(t))).length?(t.forEach(t=>a.add(t)),c.register?.forEach(e=>d(()=>e(...t))),function(){t.forEach(t=>a.delete(t)),c.unregister?.forEach(e=>d(()=>e(...t)))}):()=>{}}function h(){return[...a]}function f(t,e){return c[t]?.push(e)||(c[t]=[e]),function(){c[t]=c[t]?.filter(t=>e!==t)}}function d(t){try{t()}catch(t){console.error(t)}}class y extends Event{constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),i.set(this,void 0),o(this,i,t,"f")}get detail(){return s(this,i,"f")}get type(){return"wallet-standard:app-ready"}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}}i=new WeakMap},19737:function(t,e,r){"use strict";r.d(e,{V:function(){return n}});let n="standard:connect"},97253:function(t,e,r){"use strict";r.d(e,{R:function(){return n}});let n="standard:disconnect"},23533:function(t,e,r){"use strict";r.d(e,{k:function(){return n}});let n="standard:events"},52206:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});var n=function(t){if(t.length>=255)throw TypeError("Alphabet too long");let e=new Uint8Array(256);for(let t=0;t<e.length;t++)e[t]=255;for(let r=0;r<t.length;r++){let n=t.charAt(r),i=n.charCodeAt(0);if(255!==e[i])throw TypeError(n+" is ambiguous");e[i]=r}let r=t.length,n=t.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(t){if("string"!=typeof t)throw TypeError("Expected String");if(0===t.length)return new Uint8Array;let o=0,s=0,a=0;for(;t[o]===n;)s++,o++;let c=(t.length-o)*i+1>>>0,u=new Uint8Array(c);for(;t[o];){let n=e[t.charCodeAt(o)];if(255===n)return;let i=0;for(let t=c-1;(0!==n||i<a)&&-1!==t;t--,i++)n+=r*u[t]>>>0,u[t]=n%256>>>0,n=n/256>>>0;if(0!==n)throw Error("Non-zero carry");a=i,o++}let l=c-a;for(;l!==c&&0===u[l];)l++;let h=new Uint8Array(s+(c-l)),f=s;for(;l!==c;)h[f++]=u[l++];return h}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===e.length)return"";let i=0,s=0,a=0,c=e.length;for(;a!==c&&0===e[a];)a++,i++;let u=(c-a)*o+1>>>0,l=new Uint8Array(u);for(;a!==c;){let t=e[a],n=0;for(let e=u-1;(0!==t||n<s)&&-1!==e;e--,n++)t+=256*l[e]>>>0,l[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw Error("Non-zero carry");s=n,a++}let h=u-s;for(;h!==u&&0===l[h];)h++;let f=n.repeat(i);for(;h<u;++h)f+=t.charAt(l[h]);return f},decodeUnsafe:s,decode:function(t){let e=s(t);if(e)return e;throw Error("Non-base"+r+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},36529:function(t,e,r){"use strict";r.d(e,{Ey:function(){return c},XY:function(){return s}});var n=r(15313),i=r(95569),o=class extends i.v{socket;constructor(t,e,r){super(),this.socket=new window.WebSocket(t,r),this.socket.onopen=()=>this.emit("open"),this.socket.onmessage=t=>this.emit("message",t.data),this.socket.onerror=t=>this.emit("error",t),this.socket.onclose=t=>{this.emit("close",t.code,t.reason)}}send(t,e,r){let n=r||e;try{this.socket.send(t),n()}catch(t){n(t)}}close(t,e){this.socket.close(t,e)}addEventListener(t,e,r){this.socket.addEventListener(t,e,r)}};function s(t,e){return new o(t,e)}var a=class{encode(t){return JSON.stringify(t)}decode(t){return JSON.parse(t)}},c=class extends i.v{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(t,e="ws://localhost:8080",{autoconnect:r=!0,reconnect:n=!0,reconnect_interval:i=1e3,max_reconnects:o=5,...s}={},c,u){super(),this.webSocketFactory=t,this.queue={},this.rpc_id=0,this.address=e,this.autoconnect=r,this.ready=!1,this.reconnect=n,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=o,this.rest_options=s,this.current_reconnects=0,this.generate_request_id=c||(()=>++this.rpc_id),u?this.dataPack=u:this.dataPack=new a,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(t,e,r,n){return n||"object"!=typeof r||(n=r,r=null),new Promise((i,o)=>{if(!this.ready)return o(Error("socket not ready"));let s=this.generate_request_id(t,e);this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e||void 0,id:s}),n,t=>{if(t)return o(t);this.queue[s]={promise:[i,o]},r&&(this.queue[s].timeout=setTimeout(()=>{delete this.queue[s],o(Error("reply timeout"))},r))})})}async login(t){let e=await this.call("rpc.login",t);if(!e)throw Error("authentication failed");return e}async listMethods(){return await this.call("__listMethods")}notify(t,e){return new Promise((r,n)=>{if(!this.ready)return n(Error("socket not ready"));this.socket.send(this.dataPack.encode({jsonrpc:"2.0",method:t,params:e}),t=>{if(t)return n(t);r()})})}async subscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.on",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed subscribing to an event '"+t+"' with: "+e[t]);return e}async unsubscribe(t){"string"==typeof t&&(t=[t]);let e=await this.call("rpc.off",t);if("string"==typeof t&&"ok"!==e[t])throw Error("Failed unsubscribing from an event with: "+e);return e}close(t,e){this.socket.close(t||1e3,e)}setAutoReconnect(t){this.reconnect=t}setReconnectInterval(t){this.reconnect_interval=t}setMaxReconnects(t){this.max_reconnects=t}_connect(t,e){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:t})=>{t instanceof ArrayBuffer&&(t=n.Buffer.from(t).toString());try{t=this.dataPack.decode(t)}catch(t){return}if(t.notification&&this.listeners(t.notification).length){if(!Object.keys(t.params).length)return this.emit(t.notification);let e=[t.notification];if(t.params.constructor===Object)e.push(t.params);else for(let r=0;r<t.params.length;r++)e.push(t.params[r]);return Promise.resolve().then(()=>{this.emit.apply(this,e)})}if(!this.queue[t.id])return t.method?Promise.resolve().then(()=>{this.emit(t.method,t?.params)}):void 0;"error"in t=="result"in t&&this.queue[t.id].promise[1](Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[t.id].timeout&&clearTimeout(this.queue[t.id].timeout),t.error?this.queue[t.id].promise[1](t.error):this.queue[t.id].promise[0](t.result),delete this.queue[t.id]}),this.socket.addEventListener("error",t=>this.emit("error",t)),this.socket.addEventListener("close",({code:r,reason:n})=>{this.ready&&setTimeout(()=>this.emit("close",r,n),0),this.ready=!1,this.socket=void 0,1e3!==r&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||0===this.max_reconnects)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(t,e),this.reconnect_interval)))})}}},56089:function(t,e,r){"use strict";r.d(e,{AG:function(){return g},G0:function(){return x},IM:function(){return L},IX:function(){return y},O7:function(){return p},Rx:function(){return j},Ue:function(){return l},Yj:function(){return d},Z_:function(){return N},_4:function(){return E},bc:function(){return I},dt:function(){return b},eE:function(){return M},i0:function(){return w},jt:function(){return m},oQ:function(){return T}});class n extends TypeError{constructor(t,e){let r;let{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function i(t){return"object"==typeof t&&null!=t}function o(t){return i(t)&&!Array.isArray(t)}function s(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function*a(t,e,r,n){var o;for(let a of(i(o=t)&&"function"==typeof o[Symbol.iterator]||(t=[t]),t)){let t=function(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});let{path:i,branch:o}=e,{type:a}=r,{refinement:c,message:u=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${s(n)}\``}=t;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:o,...t,message:u}}(a,e,r,n);t&&(yield t)}}function*c(t,e,r={}){let{path:n=[],branch:o=[t],coerce:s=!1,mask:a=!1}=r,u={path:n,branch:o,mask:a};s&&(t=e.coercer(t,u));let l="valid";for(let n of e.validator(t,u))n.explanation=r.message,l="not_valid",yield[n,void 0];for(let[h,f,d]of e.entries(t,u))for(let e of c(f,d,{path:void 0===h?n:[...n,h],branch:void 0===h?o:[...o,f],coerce:s,mask:a,message:r.message}))e[0]?(l=null!=e[0].refinement?"not_refined":"not_valid",yield[e[0],void 0]):s&&(f=e[1],void 0===h?t=f:t instanceof Map?t.set(h,f):t instanceof Set?t.add(f):i(t)&&(void 0!==f||h in t)&&(t[h]=f));if("not_valid"!==l)for(let n of e.refiner(t,u))n.explanation=r.message,l="not_refined",yield[n,void 0];"valid"===l&&(yield[void 0,t])}class u{constructor(t){let{type:e,schema:r,validator:n,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,n?this.validator=(t,e)=>a(n(t,e),e,this,t):this.validator=()=>[],i?this.refiner=(t,e)=>a(i(t,e),e,this,t):this.refiner=()=>[]}assert(t,e){return function(t,e,r){let n=h(t,e,{message:r});if(n[0])throw n[0]}(t,this,e)}create(t,e){return l(t,this,e)}is(t){return!h(t,this)[0]}mask(t,e){return function(t,e,r){let n=h(t,e,{coerce:!0,mask:!0,message:r});if(!n[0])return n[1];throw n[0]}(t,this,e)}validate(t,e={}){return h(t,this,e)}}function l(t,e,r){let n=h(t,e,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function h(t,e,r={}){let i=c(t,e,r),o=function(t){let{done:e,value:r}=t.next();return e?void 0:r}(i);return o[0]?[new n(o[0],function*(){for(let t of i)t[0]&&(yield t[0])}),void 0]:[void 0,o[1]]}function f(t,e){return new u({type:t,schema:null,validator:e})}function d(){return f("any",()=>!0)}function y(t){return new u({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(let[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${s(t)}`})}function p(){return f("boolean",t=>"boolean"==typeof t)}function M(t){return f("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${s(e)}`)}function w(t){let e=s(t),r=typeof t;return new u({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${s(r)}`})}function g(t){return new u({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})}function j(){return f("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${s(t)}`)}function m(t){return new u({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function L(t,e){return new u({type:"record",schema:null,*entries(r){if(i(r))for(let n in r){let i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>o(t)||`Expected an object, but received: ${s(t)}`,coercer:t=>o(t)?{...t}:t})}function N(){return f("string",t=>"string"==typeof t||`Expected a string, but received: ${s(t)}`)}function I(t){let e=f("never",()=>!1);return new u({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${s(t)}`,coercer:t=>Array.isArray(t)?t.slice():t})}function b(t){let e=Object.keys(t);return new u({type:"type",schema:t,*entries(r){if(i(r))for(let n of e)yield[n,r[n],t[n]]},validator:t=>o(t)||`Expected an object, but received: ${s(t)}`,coercer:t=>o(t)?{...t}:t})}function x(t){let e=t.map(t=>t.type).join(" | ");return new u({type:"union",schema:null,coercer(e,r){for(let n of t){let[t,i]=n.validate(e,{coerce:!0,mask:r.mask});if(!t)return i}return e},validator(r,n){let i=[];for(let e of t){let[...t]=c(r,e,n),[o]=t;if(!o[0])return[];for(let[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${s(r)}`,...i]}})}function E(){return f("unknown",()=>!0)}function T(t,e,r){return new u({...t,coercer:(n,i)=>h(n,e)[0]?t.coercer(n,i):t.coercer(r(n,i),i)})}}}]);