vendor: 6,448 bytes, line 1
1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,809234,(e,t,r)=>{"use strict";var n=e.r(309870).Buffer;t.exports=function(e){if(e.length>=255)throw TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),s=a.charCodeAt(0);if(255!==t[s])throw TypeError(a+" is ambiguous");t[s]=i}var o=e.length,u=e.charAt(0),c=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,a=0;e[r]===u;)i++,r++;for(var s=(e.length-r)*c+1>>>0,l=new Uint8Array(s);r<e.length;){var d=e.charCodeAt(r);if(d>255)return;var f=t[d];if(255===f)return;for(var h=0,p=s-1;(0!==f||h<a)&&-1!==p;p--,h++)f+=o*l[p]>>>0,l[p]=f%256>>>0,f=f/256>>>0;if(0!==f)throw Error("Non-zero carry");a=h,r++}for(var m=s-a;m!==s&&0===l[m];)m++;var g=n.allocUnsafe(i+(s-m));g.fill(0,0,i);for(var y=i;m!==s;)g[y++]=l[m++];return g}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,a=0,s=t.length;a!==s&&0===t[a];)a++,r++;for(var c=(s-a)*l+1>>>0,d=new Uint8Array(c);a!==s;){for(var f=t[a],h=0,p=c-1;(0!==f||h<i)&&-1!==p;p--,h++)f+=256*d[p]>>>0,d[p]=f%o>>>0,f=f/o>>>0;if(0!==f)throw Error("Non-zero carry");i=h,a++}for(var m=c-i;m!==c&&0===d[m];)m++;for(var g=u.repeat(r);m<c;++m)g+=e.charAt(d[m]);return g},decodeUnsafe:d,decode:function(e){var t=d(e);if(t)return t;throw Error("Non-base"+o+" character")}}}},341669,(e,t,r)=>{t.exports=e.r(809234)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},227861,(e,t,r)=>{"use strict";function n(e,t,r){return t<=e&&e<=r}function i(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function a(e){this.tokens=[].slice.call(e)}function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}a.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(;e.length;)this.tokens.push(e.shift());else this.tokens.push(e)}};var o="utf-8";function u(e,t){if(!(this instanceof u))return new u(e,t);if((e=void 0!==e?String(e).toLowerCase():o)!==o)throw Error("Encoding not supported. Only utf-8 is supported");t=i(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if((e=void 0!==e?String(e).toLowerCase():o)!==o)throw Error("Encoding not supported. Only utf-8 is supported");t=i(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}function l(e){var t=e.fatal,r=0,i=0,a=0,o=128,u=191;this.handler=function(e,c){if(-1===c&&0!==a)return a=0,s(t);if(-1===c)return -1;if(0===a){if(n(c,0,127))return c;if(n(c,194,223))a=1,r=c-192;else if(n(c,224,239))224===c&&(o=160),237===c&&(u=159),a=2,r=c-224;else{if(!n(c,240,244))return s(t);240===c&&(o=144),244===c&&(u=143),a=3,r=c-240}return r<<=6*a,null}if(!n(c,o,u))return r=a=i=0,o=128,u=191,e.prepend(c),s(t);if(o=128,u=191,i+=1,r+=c-128<<6*(a-i),i!==a)return null;var l=r;return r=a=i=0,l}}function d(e){e.fatal,this.handler=function(e,t){if(-1===t)return -1;if(n(t,0,127))return t;n(t,128,2047)?(r=1,i=192):n(t,2048,65535)?(r=2,i=224):n(t,65536,1114111)&&(r=3,i=240);for(var r,i,a=[(t>>6*r)+i];r>0;){var s=t>>6*(r-1);a.push(128|63&s),r-=1}return a}}u.prototype={decode:function(e,t){r="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=i(t),this._streaming||(this._decoder=new l({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var r,n,s=new a(r),o=[];!s.endOfStream()&&-1!==(n=this._decoder.handler(s,s.read()));)null!==n&&(Array.isArray(n)?o.push.apply(o,n):o.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(s,s.read())))break;if(null===n)continue;Array.isArray(n)?o.push.apply(o,n):o.push(n)}while(!s.endOfStream())this._decoder=null}!o.length||-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===o[0]?(this._BOMseen=!0,o.shift()):this._BOMseen=!0);for(var u="",c=0;c<o.length;++c){var d=o[c];d<=65535?u+=String.fromCharCode(d):(d-=65536,u+=String.fromCharCode((d>>10)+55296,(1023&d)+56320))}return u}},c.prototype={encode:function(e,t){e=e?String(e):"",t=i(t),this._streaming||(this._encoder=new d(this._options)),this._streaming=!!t.stream;for(var r,n=[],s=new a(function(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var s=e.charCodeAt(n+1);if(56320<=s&&s<=57343){var o=1023&a,u=1023&s;i.push(65536+(o<<10)+u),n+=1}else i.push(65533)}n+=1}return i}(e));!s.endOfStream()&&-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;-1!==(r=this._encoder.handler(s,s.read()));)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)}},r.TextEncoder=c,r.TextDecoder=u},894119,(e,t,r)=>{"use strict";var n=e.i(802163),i=e.e&&e.e.__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]}),a=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=e.e&&e.e.__decorate||function(e,t,r,n){var i,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(s=(a<3?i(s):a>3?i(t,r,s):i(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}
1,o=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return a(t,e),t},u=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.deserializeUnchecked=r.deserialize=r.serialize=r.BinaryReader=r.BinaryWriter=r.BorshError=r.baseDecode=r.baseEncode=void 0;let c=u(e.r(424509)),l=u(e.r(341669)),d=o(e.r(227861)),f=new("function"!=typeof TextDecoder?d.TextDecoder:TextDecoder)("utf-8",{fatal:!0});r.baseEncode=function(e){return"string"==typeof e&&(e=n.Buffer.from(e,"utf8")),l.default.encode(n.Buffer.from(e))},r.baseDecode=function(e){return n.Buffer.from(l.default.decode(e))};class h extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}r.BorshError=h;class p{constructor(){this.buf=n.Buffer.alloc(1024),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=n.Buffer.concat([this.buf,n.Buffer.alloc(1024)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(n.Buffer.from(new c.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(n.Buffer.from(new c.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(n.Buffer.from(new c.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(n.Buffer.from(new c.default(e).toArray("le",64)))}writeBuffer(e){this.buf=n.Buffer.concat([n.Buffer.from(this.buf.subarray(0,this.length)),e,n.Buffer.alloc(1024)]),this.length+=e.length}writeString(e){this.maybeResize();let t=n.Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(n.Buffer.from(e))}writeArray(e,t){for(let r of(this.maybeResize(),this.writeU32(e.length),e))this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function m(e,t,r){let n=r.value;r.value=function(...e){try{return n.apply(this,e)}catch(e){if(e instanceof RangeError&&["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(e.code)>=0)throw new h("Reached the end of buffer when deserializing");throw e}}}r.BinaryWriter=p;class g{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new c.default(e,"le")}readU128(){let e=this.readBuffer(16);return new c.default(e,"le")}readU256(){let e=this.readBuffer(32);return new c.default(e,"le")}readU512(){let e=this.readBuffer(64);return new c.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new h(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return f.decode(t)}catch(e){throw new h(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=[];for(let n=0;n<t;++n)r.push(e());return r}}function y(e){return e.charAt(0).toUpperCase()+e.slice(1)}function b(e,t,r,n,i){try{if("string"==typeof n)i[`write${y(n)}`](r);else if(n instanceof Array)if("number"==typeof n[0]){if(r.length!==n[0])throw new h(`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 h(`Expecting byte array of length ${n[1]}, but got ${r.length} bytes`);for(let t=0;t<n[1];t++)b(e,null,r[t],n[0],i)}else i.writeArray(r,r=>{b(e,t,r,n[0],i)});else if(void 0!==n.kind)switch(n.kind){case"option":null==r?i.writeU8(0):(i.writeU8(1),b(e,t,r,n.type,i));break;case"map":i.writeU32(r.size),r.forEach((r,a)=>{b(e,t,a,n.key,i),b(e,t,r,n.value,i)});break;default:throw new h(`FieldType ${n} unrecognized`)}else v(e,r,i)}catch(e){throw e instanceof h&&e.addToFieldPath(t),e}}function v(e,t,r){if("function"==typeof t.borshSerialize)return void t.borshSerialize(r);let n=e.get(t.constructor);if(!n)throw new h(`Class ${t.constructor.name} is missing in schema`);if("struct"===n.kind)n.fields.map(([n,i])=>{b(e,n,t[n],i,r)});else if("enum"===n.kind){let i=t[n.field];for(let a=0;a<n.values.length;++a){let[s,o]=n.values[a];if(s===i){r.writeU8(a),b(e,s,t[s],o,r);break}}}else throw new h(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}function w(e,t,r,n){try{if("string"==typeof r)return n[`read${y(r)}`]();if(r instanceof Array)if("number"==typeof r[0])return n.readFixedArray(r[0]);else{if("number"!=typeof r[1])return n.readArray(()=>
1w(e,t,r[0],n));let i=[];for(let t=0;t<r[1];t++)i.push(w(e,null,r[0],n));return i}if("option"===r.kind){if(n.readU8())return w(e,t,r.type,n);return}if("map"===r.kind){let i=new Map,a=n.readU32();for(let s=0;s<a;s++){let a=w(e,t,r.key,n),s=w(e,t,r.value,n);i.set(a,s)}return i}return k(e,r,n)}catch(e){throw e instanceof h&&e.addToFieldPath(t),e}}function k(e,t,r){if("function"==typeof t.borshDeserialize)return t.borshDeserialize(r);let n=e.get(t);if(!n)throw new h(`Class ${t.name} is missing in schema`);if("struct"===n.kind){let n={};for(let[i,a]of e.get(t).fields)n[i]=w(e,i,a,r);return new t(n)}if("enum"===n.kind){let i=r.readU8();if(i>=n.values.length)throw new h(`Enum index: ${i} is out of range`);let[a,s]=n.values[i],o=w(e,a,s,r);return new t({[a]:o})}throw new h(`Unexpected schema kind: ${n.kind} for ${t.constructor.name}`)}s([m],g.prototype,"readU8",null),s([m],g.prototype,"readU16",null),s([m],g.prototype,"readU32",null),s([m],g.prototype,"readU64",null),s([m],g.prototype,"readU128",null),s([m],g.prototype,"readU256",null),s([m],g.prototype,"readU512",null),s([m],g.prototype,"readString",null),s([m],g.prototype,"readFixedArray",null),s([m],g.prototype,"readArray",null),r.BinaryReader=g,r.serialize=function(e,t,r=p){let n=new r;return v(e,t,n),n.toArray()},r.deserialize=function(e,t,r,n=g){let i=new n(r),a=k(e,t,i);if(i.offset<r.length)throw new h(`Unexpected ${r.length-i.offset} bytes after deserialized data`);return a},r.deserializeUnchecked=function(e,t,r,n=g){return k(e,t,new n(r))}},742542,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.s16=r.s8=r.nu64be=r.u48be=r.u40be=r.u32be=r.u24be=r.u16be=r.nu64=r.u48=r.u40=r.u32=r.u24=r.u16=r.u8=r.offset=r.greedy=r.Constant=r.UTF8=r.CString=r.Blob=r.Boolean=r.BitField=r.BitStructure=r.VariantLayout=r.Union=r.UnionLayoutDiscriminator=r.UnionDiscriminator=r.Structure=r.Sequence=r.DoubleBE=r.Double=r.FloatBE=r.Float=r.NearInt64BE=r.NearInt64=r.NearUInt64BE=r.NearUInt64=r.IntBE=r.Int=r.UIntBE=r.UInt=r.OffsetLayout=r.GreedyCount=r.ExternalLayout=r.bindConstructorLayout=r.nameWithProperty=r.Layout=r.uint8ArrayToBuffer=r.checkUint8Array=void 0,r.constant=r.utf8=r.cstr=r.blob=r.unionLayoutDiscriminator=r.union=r.seq=r.bits=r.struct=r.f64be=r.f64=r.f32be=r.f32=r.ns64be=r.s48be=r.s40be=r.s32be=r.s24be=r.s16be=r.ns64=r.s48=r.s40=r.s32=r.s24=void 0;let n=e.r(259390);function i(e){if(!(e instanceof Uint8Array))throw TypeError("b must be a Uint8Array")}function a(e){return i(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}r.checkUint8Array=i,r.uint8ArrayToBuffer=a;class s{constructor(e,t){if(!Number.isInteger(e))throw TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw RangeError("indeterminate span");return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function o(e,t){return t.property?e+"["+t.property+"]":e}r.Layout=s,r.nameWithProperty=o,r.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw Error("Class is already bound to a layout");if(!(t&&t instanceof s))throw TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value(e,r){return t.encode(this,e,r)},writable:!0}),Object.defineProperty(e,"decode",{value:(e,r)=>t.decode(e,r),writable:!0})};class u extends s{isCount(){throw Error("ExternalLayout is abstract")}}r.ExternalLayout=u;class c extends u{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){return i(e),Math.floor((e.length-t)/this.elementSpan)}encode(e,t,r){return 0}}r.GreedyCount=c;class l extends u{constructor(e,t=0,r){if(!(e instanceof s))throw TypeError("layout must be a Layout");if(!Number.isInteger(t))throw TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof d||this.layout instanceof f}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}r.OffsetLayout=l;class d extends s{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return a(e).readUIntLE(t,this.span)}encode(e,t,r=0){return a(t).writeUIntLE(e,r,this.span),this.span}}r.UInt=d;class f extends s{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return a(e).readUIntBE(t,this.span)}encode(e,t,r=0){return a(t).writeUIntBE(e,r,this.span),this.span}}r.UIntBE=f;class h extends s{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return a(e).readIntLE(t,this.span)}encode(e,t,r=0){return a(t).writeIntLE(e,r,this.span),this.span}}r.Int=h;class p extends s{constructor(e,t){if(super(e,t),6<this.span)throw RangeError("span must not exceed 6 bytes")}decode(e,t=0){return a(e).readIntBE(t,this.span)}encode(e,t,r=0){return a(t).writeIntBE(e,r,this.span),this.span}}function m(e){let t=Math.floor(e/0x100000000);return{hi32:t,lo32:e-0x100000000*t}}function g(e,t){return 0x100000000*e+t}r.IntBE=p;class y extends s{constructor(e){super(8,e)}decode(e,t=0){let r=a(e),n=r.readUInt32LE(t);return g(r.readUInt32LE(t+4),n)}encode(e,t,r=0){let n=m(e),i=a(t);return i.writeUInt32LE(n.lo32,r),i.writeUInt32LE(n.hi32,r+4),8}}r.NearUInt64=y;class b extends s{constructor(e){super(8,e)}decode(e,t=0){let r=a(e);return g(r.readUInt32BE(t),r.readUInt32BE(t+4))}encode(e,t,r=0){let n=m(e),i=a(t);return i.writeUInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}r.NearUInt64BE=b;class v extends s{constructor(e){super(8,e)}decode(e,t=0){let r=a(e),n=r.readUInt32LE(t);return g(r.readInt32LE(t+4),n)}encode(e,t,r=0){let n=m(e),i=a(t);return i.writeUInt32LE(n.lo32,r),i.writeInt32LE(n.hi32,r+4),8}}r.NearInt64=v;class w extends s{constructor(e){super(8,e)}decode(e,t=0){let r=a(e);return g(r.readInt32BE(t),r.readUInt32BE(t+4))}encode(e,t,r=0){let n=m(e),i=a(t);return i.writeInt32BE(n.hi32,r),i.writeUInt32BE(n.lo32,r+4),8}}r.NearInt64BE=w;class k extends s{constructor(e){super(4,e)}decode(e,t=0){return a(e).readFloatLE(t)}encode(e,t,r=0){return a(t).writeFloatLE(e,r),4}}r.Float=k;class _ extends s{constructor(e){super(4,e)}decode(e,t=0){return a(e).readFloatBE(t)}encode(e,t,r=0){return a(t).writeFloatBE(e,r),4}}r.FloatBE=_;class x extends s{constructor(e){super(8,e)}decode(e,t=0){return a(e).readDoubleLE(t)}encode(e,t,r=0){return a(t).writeDoubleLE(e,r),8}}r.Double=x;class S extends s{constructor(e){super(8,e)}decode(e,t=0){return a(e).readDoubleBE(t)}encode(e,t,r=0){return a(t).writeDoubleBE(e,r),8}}r.DoubleBE=S;class E extends s{constructor(e,t,r){if(!(e instanceof s))throw TypeError("elementLayout must be a Layout");if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;t instanceof u||!(0<e.span)||(n=t*e.span),super(n,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof u&&(n=n.decode(e,t)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let i=0;for(;i<n;)r+=this.elementLayout.getSpan(e,t+r),++i}return r}decode(e,t=0){let r=[],n=0,i=this.count;for(i instanceof u&&(i=i.decode(e,t));n<i;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),n+=1;return r}encode(e,t,r=0){let n=this.elementLayout,i=e.reduce((e,i)=>e+n.encode(i,t,r+e),0);return this.count instanceof u&&this.count.encode(e.length,t,r),i}}r.Sequence=E;class I extends s{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((e,t)=>
1e&&t instanceof s,!0)))throw TypeError("fields must be array of Layout instances");for(const n of("boolean"==typeof t&&void 0===r&&(r=t,t=void 0),e))if(0>n.span&&void 0===n.property)throw Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce((e,t)=>e+t.getSpan(),0)}catch(e){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{let i=n.getSpan(e,t);return t+=i,r+i},0)}catch(e){throw RangeError("indeterminate span")}return r}decode(e,t=0){i(e);let r=this.makeDestinationObject();for(let n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let n=r,i=0,a=0;for(let n of this.fields){let s=n.span;if(a=0<s?s:0,void 0!==n.property){let i=e[n.property];void 0!==i&&(a=n.encode(i,t,r),0>s&&(s=n.getSpan(t,r)))}i=r,r+=s}return i+a-n}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)void 0!==r.property&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if("string"!=typeof e)throw TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if("string"!=typeof e)throw TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}r.Structure=I;class A{constructor(e){this.property=e}decode(e,t){throw Error("UnionDiscriminator is abstract")}encode(e,t,r){throw Error("UnionDiscriminator is abstract")}}r.UnionDiscriminator=A;class B extends A{constructor(e,t){if(!(e instanceof u&&e.isCount()))throw TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}r.UnionLayoutDiscriminator=B;class T extends s{constructor(e,t,r){let n;if(e instanceof d||e instanceof f)n=new B(new l(e));else if(e instanceof u&&e.isCount())n=new B(e);else if(e instanceof A)n=e;else throw TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===t&&(t=null),!(null===t||t instanceof s))throw TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let i=-1;t&&0<=(i=t.span)&&(e instanceof d||e instanceof f)&&(i+=n.layout.span),super(i,r),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof d||e instanceof f,this.defaultLayout=t,this.registry={};let a=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return a(e)},this.configGetSourceVariant=function(e){a=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let r=this.getVariant(e,t);if(!r)throw Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw Error("unable to infer src variant")}decode(e,t=0){let r,n=this.discriminator,i=n.decode(e,t),a=this.registry[i];if(void 0===a){let a=this.defaultLayout,s=0;this.usesPrefixDiscriminator&&(s=n.layout.span),(r=this.makeDestinationObject())[n.property]=i,r[a.property]=a.decode(e,t+s)}else r=a.decode(e,t);return r}encode(e,t,r=0){let n=this.getSourceVariant(e);if(void 0===n){let n=this.discriminator,i=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=n.layout.span),n.encode(e[n.property],t,r),a+i.encode(e[i.property],t,r+a)}return n.encode(e,t,r)}addVariant(e,t,r){let n=new P(this,e,t,r);return this.registry[e]=n,n}getVariant(e,t=0){let r;return r=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[r]}}r.Union=T;class P extends s{constructor(e,t,r,n){if(!(e instanceof T))throw TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)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");
1if(null!==e.defaultLayout&&0<=r.span&&r.span>e.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=e.span;0>e.span&&0<=(i=r?r.span:0)&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span),super(i,n),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=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(e,t+r)),r+n}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))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(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let i=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),i+=this.layout.getSpan(t,r+n),0<=this.union.span&&i>this.union.span))throw Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function O(e){return 0>e&&(e+=0x100000000),e}r.VariantLayout=P;class j extends s{constructor(e,t,r){if(!(e instanceof d||e instanceof f))throw TypeError("word must be a UInt or UIntBE layout");if("string"==typeof t&&void 0===r&&(r=t,t=!1),4<e.span)throw RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let n=0;this._packedSetValue=function(e){return n=O(e),this},this._packedGetValue=function(){return n}}decode(e,t=0){let r=this.makeDestinationObject(),n=this.word.decode(e,t);for(let t of(this._packedSetValue(n),this.fields))void 0!==t.property&&(r[t.property]=t.decode(e));return r}encode(e,t,r=0){let n=this.word.decode(t,r);for(let t of(this._packedSetValue(n),this.fields))if(void 0!==t.property){let r=e[t.property];void 0!==r&&t.encode(r)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new R(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new L(this,e);return this.fields.push(t),t}fieldFor(e){if("string"!=typeof e)throw TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}}r.BitStructure=j;class R{constructor(e,t,r){if(!(e instanceof j))throw TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw TypeError("bits must be positive integer");const n=8*e.span,i=e.fields.reduce((e,t)=>e+t.bits,0);if(t+i>n)throw Error("bits too long for span remainder ("+(n-i)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,32===t&&(this.valueMask=0xffffffff),this.start=i,this.container.msb&&(this.start=n-i-t),this.wordMask=O(this.valueMask<<this.start),this.property=r}decode(e,t){return O(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(e){if("number"!=typeof e||!Number.isInteger(e)||e!==O(e&this.valueMask))throw TypeError(o("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=O(e<<this.start);this.container._packedSetValue(O(t&~this.wordMask)|r)}}r.BitField=R;class L extends R{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){"boolean"==typeof e&&(e*=1),super.encode(e)}}r.Boolean=L;class C extends s{constructor(e,t){if(!(e instanceof u&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof u||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),a(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof u&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw TypeError(o("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw RangeError("encoding overruns Uint8Array");let i=a(e);return a(t).write(i.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,t,r),n}}r.Blob=C;class N extends s{constructor(e){super(-1,e)}getSpan(e,t=0){i(e);let r=t;for(;r<e.length&&0!==e[r];)r+=1;return 1+r-t}decode(e,t=0){let r=this.getSpan(e,t);return a(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){"string"!=typeof e&&(e=String(e));let i=n.Buffer.from(e,"utf8"),s=i.length;if(r+s>t.length)throw RangeError("encoding overruns Buffer");let o=a(t);return i.copy(o,r),o[r+s]=0,s+1}}r.CString=N;class z extends s{constructor(e,t){if("string"==typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return i(e),e.length-t}decode(e,t=0){let r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw RangeError("text length exceeds maxSpan");return a(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){"string"!=typeof e&&(e=String(e));let i=n.Buffer.from(e,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw RangeError("text length exceeds maxSpan");if(r+s>t.length)throw RangeError("encoding overruns Buffer");return i.copy(a(t),r),s}}r.UTF8=z;class U extends s{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}}r.Constant=U,r.greedy=(e,t)=>new c(e,t),r.offset=(e,t,r)=>new l(e,t,r),r.u8=e=>
1new d(1,e),r.u16=e=>new d(2,e),r.u24=e=>new d(3,e),r.u32=e=>new d(4,e),r.u40=e=>new d(5,e),r.u48=e=>new d(6,e),r.nu64=e=>new y(e),r.u16be=e=>new f(2,e),r.u24be=e=>new f(3,e),r.u32be=e=>new f(4,e),r.u40be=e=>new f(5,e),r.u48be=e=>new f(6,e),r.nu64be=e=>new b(e),r.s8=e=>new h(1,e),r.s16=e=>new h(2,e),r.s24=e=>new h(3,e),r.s32=e=>new h(4,e),r.s40=e=>new h(5,e),r.s48=e=>new h(6,e),r.ns64=e=>new v(e),r.s16be=e=>new p(2,e),r.s24be=e=>new p(3,e),r.s32be=e=>new p(4,e),r.s40be=e=>new p(5,e),r.s48be=e=>new p(6,e),r.ns64be=e=>new w(e),r.f32=e=>new k(e),r.f32be=e=>new _(e),r.f64=e=>new x(e),r.f64be=e=>new S(e),r.struct=(e,t,r)=>new I(e,t,r),r.bits=(e,t,r)=>new j(e,t,r),r.seq=(e,t,r)=>new E(e,t,r),r.union=(e,t,r)=>new T(e,t,r),r.unionLayoutDiscriminator=(e,t)=>new B(e,t),r.blob=(e,t)=>new C(e,t),r.cstr=e=>new N(e),r.utf8=(e,t)=>new z(e,t),r.constant=(e,t)=>new U(e,t)},539451,e=>{"use strict";e.s([],954354),e.i(954354);var t,r,n=e.i(530647),i=e.i(109414),a=0,s=0,o=e.i(882730);let u=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,r[11]=t/0x100000000&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function c(e,t,r){function n(e,n,a,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=u(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var o=new Uint8Array(16+e.length);if(o.set(n),o.set(e,n.length),(o=r(o))[6]=15&o[6]|t,o[8]=63&o[8]|128,a){s=s||0;for(var c=0;c<16;++c)a[s+c]=o[c];return a}return(0,i.default)(o)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function l(e){return(e+64>>>9<<4)+14+1}function d(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(e,t,r,n,i,a){var s;return d((s=d(d(t,e),d(n,a)))<<i|s>>>32-i,r)}function h(e,t,r,n,i,a,s){return f(t&r|~t&n,e,t,i,a,s)}function p(e,t,r,n,i,a,s){return f(t&n|r&~n,e,t,i,a,s)}function m(e,t,r,n,i,a,s){return f(t^r^n,e,t,i,a,s)}function g(e,t,r,n,i,a,s){return f(r^(t|~n),e,t,i,a,s)}var y=c("v3",48,function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var a=e[i>>5]>>>i%32&255,s=parseInt(n.charAt(a>>>4&15)+n.charAt(15&a),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[l(t)-1]=t;for(var r=0x67452301,n=-0x10325477,i=-0x67452302,a=0x10325476,s=0;s<e.length;s+=16){var o=r,u=n,c=i,f=a;r=h(r,n,i,a,e[s],7,-0x28955b88),a=h(a,r,n,i,e[s+1],12,-0x173848aa),i=h(i,a,r,n,e[s+2],17,0x242070db),n=h(n,i,a,r,e[s+3],22,-0x3e423112),r=h(r,n,i,a,e[s+4],7,-0xa83f051),a=h(a,r,n,i,e[s+5],12,0x4787c62a),i=h(i,a,r,n,e[s+6],17,-0x57cfb9ed),n=h(n,i,a,r,e[s+7],22,-0x2b96aff),r=h(r,n,i,a,e[s+8],7,0x698098d8),a=h(a,r,n,i,e[s+9],12,-0x74bb0851),i=h(i,a,r,n,e[s+10],17,-42063),n=h(n,i,a,r,e[s+11],22,-0x76a32842),r=h(r,n,i,a,e[s+12],7,0x6b901122),a=h(a,r,n,i,e[s+13],12,-0x2678e6d),i=h(i,a,r,n,e[s+14],17,-0x5986bc72),n=h(n,i,a,r,e[s+15],22,0x49b40821),r=p(r,n,i,a,e[s+1],5,-0x9e1da9e),a=p(a,r,n,i,e[s+6],9,-0x3fbf4cc0),i=p(i,a,r,n,e[s+11],14,0x265e5a51),n=p(n,i,a,r,e[s],20,-0x16493856),r=p(r,n,i,a,e[s+5],5,-0x29d0efa3),a=p(a,r,n,i,e[s+10],9,0x2441453),i=p(i,a,r,n,e[s+15],14,-0x275e197f),n=p(n,i,a,r,e[s+4],20,-0x182c0438),r=p(r,n,i,a,e[s+9],5,0x21e1cde6),a=p(a,r,n,i,e[s+14],9,-0x3cc8f82a),i=p(i,a,r,n,e[s+3],14,-0xb2af279),n=p(n,i,a,r,e[s+8],20,0x455a14ed),r=p(r,n,i,a,e[s+13],5,-0x561c16fb),a=p(a,r,n,i,e[s+2],9,-0x3105c08),i=p(i,a,r,n,e[s+7],14,0x676f02d9),n=p(n,i,a,r,e[s+12],20,-0x72d5b376),r=m(r,n,i,a,e[s+5],4,-378558),a=m(a,r,n,i,e[s+8],11,-0x788e097f),i=m(i,a,r,n,e[s+11],16,0x6d9d6122),n=m(n,i,a,r,e[s+14],23,-0x21ac7f4),r=m(r,n,i,a,e[s+1],4,-0x5b4115bc),a=m(a,r,n,i,e[s+4],11,0x4bdecfa9),i=m(i,a,r,n,e[s+7],16,-0x944b4a0),n=m(n,i,a,r,e[s+10],23,-0x41404390),r=m(r,n,i,a,e[s+13],4,0x289b7ec6),a=m(a,r,n,i,e[s],11,-0x155ed806),i=m(i,a,r,n,e[s+3],16,-0x2b10cf7b),n=m(n,i,a,r,e[s+6],23,0x4881d05
1),r=m(r,n,i,a,e[s+9],4,-0x262b2fc7),a=m(a,r,n,i,e[s+12],11,-0x1924661b),i=m(i,a,r,n,e[s+15],16,0x1fa27cf8),n=m(n,i,a,r,e[s+2],23,-0x3b53a99b),r=g(r,n,i,a,e[s],6,-0xbd6ddbc),a=g(a,r,n,i,e[s+7],10,0x432aff97),i=g(i,a,r,n,e[s+14],15,-0x546bdc59),n=g(n,i,a,r,e[s+5],21,-0x36c5fc7),r=g(r,n,i,a,e[s+12],6,0x655b59c3),a=g(a,r,n,i,e[s+3],10,-0x70f3336e),i=g(i,a,r,n,e[s+10],15,-1051523),n=g(n,i,a,r,e[s+1],21,-0x7a7ba22f),r=g(r,n,i,a,e[s+8],6,0x6fa87e4f),a=g(a,r,n,i,e[s+15],10,-0x1d31920),i=g(i,a,r,n,e[s+6],15,-0x5cfebcec),n=g(n,i,a,r,e[s+13],21,0x4e0811a1),r=g(r,n,i,a,e[s+4],6,-0x8ac817e),a=g(a,r,n,i,e[s+11],10,-0x42c50dcb),i=g(i,a,r,n,e[s+2],15,0x2ad7d2bb),n=g(n,i,a,r,e[s+9],21,-0x14792c6f),r=d(r,o),n=d(n,u),i=d(i,c),a=d(a,f)}return[r,n,i,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(l(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}),b=e.i(39880);function v(e,t){return e<<t|e>>>32-t}var w=c("v5",80,function(e){var t=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],r=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=Math.ceil((e.length/4+2)/16),s=Array(a),o=0;o<a;++o){for(var u=new Uint32Array(16),c=0;c<16;++c)u[c]=e[64*o+4*c]<<24|e[64*o+4*c+1]<<16|e[64*o+4*c+2]<<8|e[64*o+4*c+3];s[o]=u}s[a-1][14]=(e.length-1)*8/0x100000000,s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(e.length-1)*8|0;for(var l=0;l<a;++l){for(var d=new Uint32Array(80),f=0;f<16;++f)d[f]=s[l][f];for(var h=16;h<80;++h)d[h]=v(d[h-3]^d[h-8]^d[h-14]^d[h-16],1);for(var p=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=0;w<80;++w){var k=Math.floor(w/20),_=v(p,5)+function(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}(k,m,g,y)+b+t[k]+d[w]>>>0;b=y,y=g,g=v(m,30)>>>0,m=p,p=_}r[0]=r[0]+p>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+g>>>0,r[3]=r[3]+y>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]});e.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,u,"stringify",()=>i.default,"v1",0,function(e,o,u){var c=o&&u||0,l=o||Array(16),d=(e=e||{}).node||t,f=void 0!==e.clockseq?e.clockseq:r;if(null==d||null==f){var h=e.random||(e.rng||n.default)();null==d&&(d=t=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==f&&(f=r=(h[6]<<8|h[7])&16383)}var p=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:s+1,g=p-a+(m-s)/1e4;if(g<0&&void 0===e.clockseq&&(f=f+1&16383),(g<0||p>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,s=m,r=f;var y=((0xfffffff&(p+=122192928e5))*1e4+m)%0x100000000;l[c++]=y>>>24&255,l[c++]=y>>>16&255,l[c++]=y>>>8&255,l[c++]=255&y;var b=p/0x100000000*1e4&0xfffffff;l[c++]=b>>>8&255,l[c++]=255&b,l[c++]=b>>>24&15|16,l[c++]=b>>>16&255,l[c++]=f>>>8|128,l[c++]=255&f;for(var v=0;v<6;++v)l[c+v]=d[v];return o||(0,i.default)(l)},"v3",0,y,"v4",()=>b.default,"v5",0,w,"validate",()=>o.default,"version",0,function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}],539451)},61206,(e,t,r)=>{"use strict";let n=e.r(539451).v4;t.exports=function(e,t,r,i){if("string"!=typeof e)throw TypeError(e+" must be a string");let a="number"==typeof(i=i||{}).version?i.version:2;if(1!==a&&2!==a)throw TypeError(a+" must be 1 or 2");let s={method:e};if(2===a&&(s.jsonrpc="2.0"),t){if("object"!=typeof t&&!Array.isArray(t))throw TypeError(t+" must be an object, array or omitted");s.params=t}return void 0===r?s.id=("function"==typeof i.generator?i.generator:function(){return n()})(s,i):2===a&&null===r?i.notificationIdNull&&(s.id=null):s.id=r,s}},826291,(e,t,r)=>{"use strict";let n=e.r(539451).v4,i=e.r(61206),a=function(e,t){if(!(this instanceof a))return new a(e,t);t||(t={}),this.options={reviver:void 0!==t.reviver?t.reviver:null,replacer:void 0!==t.replacer?t.replacer:null,generator:void 0!==t.generator?t.generator:function(){return n()},version:void 0!==t.version?t.version:2,notificationIdNull:"boolean"==typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};t.exports=a,a.prototype.request=function(e,t,r,n){let a,s=this,o=null,u=Array.isArray(e)&&"function"==typeof t;if(1===this.options.version&&u)throw TypeError("JSON-RPC 1.0 does not support batching");let c=!u&&e&&"object"==typeof e&&"function"==typeof t;if(u||c)n=t,o=e;else{"function"==typeof r&&(n=r,r=void 0);let a="function"==typeof n;try{o=i(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(a)return void n(e);throw e}if(!a)return o}try{a=JSON.stringify(o,this.options.replacer)}catch(e){n(e);return}return this.callServer(a,function(e,t){s._parseResponse(e,t,n)}),o},a.prototype._parseResponse=function(e,t,r){let n;if(e)return void r(e);if(!t)return void r();try{n=JSON.parse(t,this.options.reviver)}catch(e){r(e);return}if(3===r.length)if(!Array.isArray(n))return void r(null,n.error,n.result);else{let e=function(e){return void 0!==e.error};r(null,n.filter(e),n.filter(function(t){return!e(t)}));return}r(null,n)}},449112,e=>{"use strict";let t,r,n,i,a;e.s([],180703),e.i(180703),(tf=tm||(tm={})).assertEqual=e=>{},tf.assertIs=function(e){},tf.assertNever=function(e){throw Error()},tf.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},tf.getValidEnumValues=e=>{let t=tf.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return tf.objectValues(r)},tf.objectValues=e=>tf.objectKeys(e).map(function(t){return e[t]}),tf.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},tf.find=(e,t)=>{for(let r of e)if(t(r))return r},tf.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,tf.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},tf.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(tg||(tg={})).mergeShapes=(e,t)=>({...e,...t});let s=tm.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":if(Array.isArray(e))return s.array;if(null===e)return s.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return s.promise;if("u">typeof Map&&e instanceof Map)return s.map;if("u">typeof Set&&e instanceof Set)return s.set;if("u">typeof Date&&e instanceof Date)return s.date;return s.object;default:return s.unknown}};e.s(["ZodParsedType",0,s,"getParsedType",0,o,"objectUtil",0,tg,"util",0,tm],458728);
1let u=tm.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),c=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class l extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof l))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tm.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}l.create=e=>new l(e),e.s(["ZodError",0,l,"ZodIssueCode",0,u,"quotelessJson",0,c],559413);let d=(e,t)=>{let r;switch(e.code){case u.invalid_type:r=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case u.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,tm.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:r=`Unrecognized key(s) in object: ${tm.joinValues(e.keys,", ")}`;break;case u.invalid_union:r="Invalid input";break;case u.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${tm.joinValues(e.options)}`;break;case u.invalid_enum_value:r=`Invalid enum value. Expected ${tm.joinValues(e.options)}, received '${e.received}'`;break;case u.invalid_arguments:r="Invalid function arguments";break;case u.invalid_return_type:r="Invalid function return type";break;case u.invalid_date:r="Invalid date";break;case u.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:tm.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case u.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case u.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case u.custom:r="Invalid input";break;
1case u.invalid_intersection_types:r="Intersection results could not be merged";break;case u.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case u.not_finite:r="Number must be finite";break;default:r=t.defaultError,tm.assertNever(e)}return{message:r}},f=d;function h(e){f=e}function p(){return f}e.s(["getErrorMap",0,p,"setErrorMap",0,h],725827),e.i(725827),e.s(["defaultErrorMap",0,d,"getErrorMap",0,p,"setErrorMap",0,h],279407),e.i(279407);let m=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(void 0!==i.message)return{...i,path:a,message:i.message};let o="";for(let e of n.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}},g=[];function y(e,t){let r=p(),n=m({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===d?void 0:d].filter(e=>!!e)});e.common.issues.push(n)}class b{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return v;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return b.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return v;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let v=Object.freeze({status:"aborted"}),w=e=>({status:"dirty",value:e}),k=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,x=e=>"dirty"===e.status,S=e=>"valid"===e.status,E=e=>"u">typeof Promise&&e instanceof Promise;e.s(["DIRTY",0,w,"EMPTY_PATH",0,g,"INVALID",0,v,"OK",0,k,"ParseStatus",0,b,"addIssueToContext",0,y,"isAborted",0,_,"isAsync",0,E,"isDirty",0,x,"isValid",0,S,"makeIssue",0,m],696555),e.i(696555),e.s([],924326),e.i(924326),e.i(458728),(th=ty||(ty={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},th.toString=e=>"string"==typeof e?e:e?.message;class I{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let A=(e,t)=>{if(S(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new l(e.common.issues);return this._error=t,this._error}}};function B(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return"invalid_enum_value"===t.code?{message:a??i.defaultError}:void 0===i.data?{message:a??n??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:a??r??i.defaultError}},description:i}}class T{get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(E(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},n=this._parseSync({data:e,path:r.path,parent:r});return A(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return S(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>S(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},n=this._parse({data:e,path:r.path,parent:r});return A(r,await (E(n)?n:Promise.resolve(n)))}refine(e,t){return this._refinement((r,n)=>{let i=e(r),a=()=>n.addIssue({code:u.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new ex({schema:this,typeName:tb.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eS.create(this,this._def)}nullable(){return eE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this)}promise(){return e_.create(this,this._def)}or(e){return eu.create([this,e],this._def)}and(e){return ed.create(this,e,this._def)}transform(e){return new ex({...B(this._def),schema:this,typeName:tb.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eI({...B(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:tb.ZodDefault})}brand(){return new eP({typeName:tb.ZodBranded,type:this,...B(this._def)})}catch(e){return new eA({...B(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:tb.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eO.create(this,e)}readonly(){return ej.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let P=/^c[^\s-]{8,}
vendor: 26,423 bytes, line 1
1$/i,O=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,R=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,z=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,U=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Z=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,M=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,W=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,D="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$=RegExp(`^${D}$`);function q(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function V(e){let t=`${D}T${q(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}class J extends T{_parse(e){var r,n,i,a;let o;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.string,received:t.parsedType}),v}let c=new b;for(let s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(y(o=this._getOrReturnCtx(e,o),{code:u.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),c.dirty());else if("max"===s.kind)e.data.length>s.value&&(y(o=this._getOrReturnCtx(e,o),{code:u.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),c.dirty());else if("length"===s.kind){let t=e.data.length>s.value,r=e.data.length<s.value;(t||r)&&(o=this._getOrReturnCtx(e,o),t?y(o,{code:u.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&y(o,{code:u.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),c.dirty())}else if("email"===s.kind)z.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"email",code:u.invalid_string,message:s.message}),c.dirty());else if("emoji"===s.kind)t||(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"emoji",code:u.invalid_string,message:s.message}),c.dirty());else if("uuid"===s.kind)R.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"uuid",code:u.invalid_string,message:s.message}),c.dirty());else if("nanoid"===s.kind)L.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"nanoid",code:u.invalid_string,message:s.message}),c.dirty());else if("cuid"===s.kind)P.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"cuid",code:u.invalid_string,message:s.message}),c.dirty());else if("cuid2"===s.kind)O.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"cuid2",code:u.invalid_string,message:s.message}),c.dirty());else if("ulid"===s.kind)j.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"ulid",code:u.invalid_string,message:s.message}),c.dirty());else if("url"===s.kind)try{new URL(e.data)}catch{y(o=this._getOrReturnCtx(e,o),{validation:"url",code:u.invalid_string,message:s.message}),c.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"regex",code:u.invalid_string,message:s.message}),c.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(y(o=this._getOrReturnCtx(e,o),{code:u.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),c.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(y(o=this._getOrReturnCtx(e,o),{code:u.invalid_string,validation:{startsWith:s.value},message:s.message}),c.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(y(o=this._getOrReturnCtx(e,o),{code:u.invalid_string,validation:{endsWith:s.value},message:s.message}),c.dirty()):"datetime"===s.kind?V(s).test(e.data)||(y(o=this._getOrReturnCtx(e,o),{code:u.invalid_string,validation:"datetime",message:s.message}),c.dirty()):"date"===s.kind?$.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{code:u.invalid_string,validation:"date",message:s.message}),c.dirty()):"time"===s.kind?RegExp(`^${q(s)}$`).test(e.data)||(y(o=this._getOrReturnCtx(e,o),{code:u.invalid_string,validation:"time",message:s.message}),c.dirty()):"duration"===s.kind?N.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"duration",code:u.invalid_string,message:s.message}),c.dirty()):"ip"===s.kind?(r=e.data,!(("v4"===(n=s.version)||!n)&&U.test(r)||("v6"===n||!n)&&M.test(r))&&1&&(y(o=this._getOrReturnCtx(e,o),{validation:"ip",code:u.invalid_string,message:s.message}),c.dirty())):"jwt"===s.kind?!function(e,t){if(!C.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}(e.data,s.alg)&&(y(o=this._getOrReturnCtx(e,o),{validation:"jwt",code:u.invalid_string,message:s.message}),c.dirty()):"cidr"===s.kind?(i=e.data,!(("v4"===(a=s.version)||!a)&&Z.test(i)||("v6"===a||!a)&&W.test(i))&&1&&(y(o=this._getOrReturnCtx(e,o),{validation:"cidr",code:u.invalid_string,message:s.message}),c.dirty())):"base64"===s.kind?F.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"base64",code:u.invalid_string,message:s.message}),c.dirty()):"base64url"===s.kind?K.test(e.data)||(y(o=this._getOrReturnCtx(e,o),{validation:"base64url",code:u.invalid_string,message:s.message}),c.dirty()):tm.assertNever(s);return{status:c.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:u.invalid_string,...ty.errToObj(r)})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ty.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ty.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ty.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ty.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ty.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ty.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ty.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ty.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ty.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ty.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ty.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ty.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ty.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ty.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...ty.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ty.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ty.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...ty.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ty.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ty.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ty.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ty.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ty.errToObj(t)})}nonempty(e){return this.min(1,ty.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}J.create=e=>new J({checks:[],typeName:tb.ZodString,coerce:e?.coerce??!1,...B(e)});class H extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.number,received:t.parsedType}),v}let r=new b;for(let n of this._def.checks)"int"===n.kind?tm.isInteger(e.data)||(y(t=this._getOrReturnCtx(e,t),{code:u.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(y(t=this._getOrReturnCtx(e,t),{code:u.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(y(t=this._getOrReturnCtx(e,t),{code:u.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(e.data,n.value)&&(y(t=this._getOrReturnCtx(e,t),{code:u.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(y(t=this._getOrReturnCtx(e,t),{code:u.not_finite,message:n.message}),r.dirty()):tm.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ty.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ty.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ty.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ty.toString(t))}setLimit(e,t,r,n){return new H({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ty.toString(n)}]})}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ty.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ty.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ty.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ty.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ty.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ty.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ty.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ty.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ty.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&tm.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}H.create=e=>new H({checks:[],typeName:tb.ZodNumber,coerce:e?.coerce||!1,...B(e)});class G extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==s.bigint)return this._getInvalidInput(e);let r=new b;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(y(t=this._getOrReturnCtx(e,t),{code:u.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(y(t=this._getOrReturnCtx(e,t),{code:u.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(y(t=this._getOrReturnCtx(e,t),{code:u.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):tm.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.bigint,received:t.parsedType}),v}gte(e,t){return this.setLimit("min",e,!0,ty.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ty.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ty.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ty.toString(t))}setLimit(e,t,r,n){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ty.toString(n)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ty.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ty.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ty.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ty.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ty.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}G.create=e=>new G({checks:[],typeName:tb.ZodBigInt,coerce:e?.coerce??!1,...B(e)});class Y extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==s.boolean){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.boolean,received:t.parsedType}),v}return k(e.data)}}Y.create=e=>new Y({typeName:tb.ZodBoolean,coerce:e?.coerce||!1,...B(e)});class X extends T{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.date,received:t.parsedType}),v}if(Number.isNaN(e.data.getTime()))return y(this._getOrReturnCtx(e),{code:u.invalid_date}),v;let r=new b;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(y(t=this._getOrReturnCtx(e,t),{code:u.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(y(t=this._getOrReturnCtx(e,t),{code:u.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):tm.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ty.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ty.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}X.create=e=>new X({checks:[],coerce:e?.coerce||!1,typeName:tb.ZodDate,...B(e)});class Q extends T{_parse(e){if(this._getType(e)!==s.symbol){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.symbol,received:t.parsedType}),v}return k(e.data)}}Q.create=e=>new Q({typeName:tb.ZodSymbol,...B(e)});class ee extends T{_parse(e){if(this._getType(e)!==s.undefined){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.undefined,received:t.parsedType}),v}return k(e.data)}}ee.create=e=>new ee({typeName:tb.ZodUndefined,...B(e)});class et extends T{_parse(e){if(this._getType(e)!==s.null){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.null,received:t.parsedType}),v}return k(e.data)}}et.create=e=>new et({typeName:tb.ZodNull,...B(e)});class er extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}er.create=e=>new er({typeName:tb.ZodAny,...B(e)});class en extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}en.create=e=>new en({typeName:tb.ZodUnknown,...B(e)});class ei extends T{_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.never,received:t.parsedType}),v}}ei.create=e=>new ei({typeName:tb.ZodNever,...B(e)});class ea extends T{_parse(e){if(this._getType(e)!==s.undefined){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.void,received:t.parsedType}),v}return k(e.data)}}ea.create=e=>new ea({typeName:tb.ZodVoid,...B(e)});class es extends T{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.array)return y(t,{code:u.invalid_type,expected:s.array,received:t.parsedType}),v;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(y(t,{code:e?u.too_big:u.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(y(t,{code:u.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(y(t,{code:u.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new I(t,e,t.path,r)))).then(e=>b.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new I(t,e,t.path,r)));return b.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new es({...this._def,minLength:{value:e,message:ty.toString(t)}})}max(e,t){return new es({...this._def,maxLength:{value:e,message:ty.toString(t)}})}length(e,t){return new es({...this._def,exactLength:{value:e,message:ty.toString(t)}})}nonempty(e){return this.min(1,e)}}es.create=(e,t)=>new es({type:e,minLength:null,maxLength:null,exactLength:null,typeName:tb.ZodArray,...B(t)});class eo extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=tm.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==s.object){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.object,received:t.parsedType}),v}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ei&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=n[e],i=r.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new I(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ei){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(y(r,{code:u.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let n=r.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new I(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>b.mergeObjectSync(t,e)):b.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return ty.errToObj,new eo({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:ty.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new eo({...this._def,unknownKeys:"strip"})}passthrough(){return new eo({...this._def,unknownKeys:"passthrough"})}extend(e){return new eo({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new eo({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:tb.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new eo({...this._def,catchall:e})}pick(e){let t={};for(let r of tm.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new eo({...this._def,shape:()=>t})}omit(e){let t={};for(let r of tm.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new eo({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof eo){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=eS.create(e(i))}return new eo({...t._def,shape:()=>r})}if(t instanceof es)return new es({...t._def,type:e(t.element)});if(t instanceof eS)return eS.create(e(t.unwrap()));if(t instanceof eE)return eE.create(e(t.unwrap()));if(t instanceof ef)return ef.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of tm.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new eo({...this._def,shape:()=>t})}required(e){let t={};for(let r of tm.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof eS;)e=e._def.innerType;t[r]=e}return new eo({...this._def,shape:()=>t})}keyof(){return ev(tm.objectKeys(this.shape))}}eo.create=(e,t)=>new eo({shape:()=>e,unknownKeys:"strip",catchall:ei.create(),typeName:tb.ZodObject,...B(t)}),eo.strictCreate=(e,t)=>new eo({shape:()=>e,unknownKeys:"strict",catchall:ei.create(),typeName:tb.ZodObject,...B(t)}),eo.lazycreate=(e,t)=>new eo({shape:e,unknownKeys:"strip",catchall:ei.create(),typeName:tb.ZodObject,...B(t)});class eu extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new l(e.ctx.common.issues));return y(t,{code:u.invalid_union,unionErrors:r}),v});{let e,n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new l(e));return y(t,{code:u.invalid_union,unionErrors:i}),v}}get options(){return this._def.options}}eu.create=(e,t)=>
1new eu({options:e,typeName:tb.ZodUnion,...B(t)});let ec=e=>{if(e instanceof ey)return ec(e.schema);if(e instanceof ex)return ec(e.innerType());if(e instanceof eb)return[e.value];if(e instanceof ew)return e.options;if(e instanceof ek)return tm.objectValues(e.enum);else if(e instanceof eI)return ec(e._def.innerType);else if(e instanceof ee)return[void 0];else if(e instanceof et)return[null];else if(e instanceof eS)return[void 0,...ec(e.unwrap())];else if(e instanceof eE)return[null,...ec(e.unwrap())];else if(e instanceof eP)return ec(e.unwrap());else if(e instanceof ej)return ec(e.unwrap());else if(e instanceof eA)return ec(e._def.innerType);else return[]};class el extends T{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return y(t,{code:u.invalid_type,expected:s.object,received:t.parsedType}),v;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),v)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=ec(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new el({typeName:tb.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...B(r)})}}class ed extends T{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(_(e)||_(n))return v;let i=function e(t,r){let n=o(t),i=o(r);if(t===r)return{valid:!0,data:t};if(n===s.object&&i===s.object){let n=tm.objectKeys(r),i=tm.objectKeys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};a[n]=i.data}return{valid:!0,data:a}}if(n===s.array&&i===s.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;i<t.length;i++){let a=e(t[i],r[i]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}if(n===s.date&&i===s.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,n.value);return i.valid?((x(e)||x(n))&&t.dirty(),{status:t.value,value:i.data}):(y(r,{code:u.invalid_intersection_types}),v)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ed.create=(e,t,r)=>new ed({left:e,right:t,typeName:tb.ZodIntersection,...B(r)});class ef extends T{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.array)return y(r,{code:u.invalid_type,expected:s.array,received:r.parsedType}),v;if(r.data.length<this._def.items.length)return y(r,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&r.data.length>this._def.items.length&&(y(r,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new I(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>b.mergeArray(t,e)):b.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ef({...this._def,rest:e})}}ef.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ef({items:e,typeName:tb.ZodTuple,rest:null,...B(t)})};class eh extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.object)return y(r,{code:u.invalid_type,expected:s.object,received:r.parsedType}),v;let n=[],i=this._def.keyType,a=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new I(r,e,r.path,e)),value:a._parse(new I(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?b.mergeObjectAsync(t,n):b.mergeObjectSync(t,n)}
1get element(){return this._def.valueType}static create(e,t,r){return new eh(t instanceof T?{keyType:e,valueType:t,typeName:tb.ZodRecord,...B(r)}:{keyType:J.create(),valueType:e,typeName:tb.ZodRecord,...B(t)})}}class ep extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.map)return y(r,{code:u.invalid_type,expected:s.map,received:r.parsedType}),v;let n=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new I(r,e,r.path,[a,"key"])),value:i._parse(new I(r,t,r.path,[a,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of a){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return v;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of a){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return v;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ep.create=(e,t,r)=>new ep({valueType:t,keyType:e,typeName:tb.ZodMap,...B(r)});class em extends T{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.set)return y(r,{code:u.invalid_type,expected:s.set,received:r.parsedType}),v;let n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(y(r,{code:u.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(y(r,{code:u.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let r=new Set;for(let n of e){if("aborted"===n.status)return v;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let o=[...r.data.values()].map((e,t)=>i._parse(new I(r,e,r.path,t)));return r.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(e,t){return new em({...this._def,minSize:{value:e,message:ty.toString(t)}})}max(e,t){return new em({...this._def,maxSize:{value:e,message:ty.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}em.create=(e,t)=>new em({valueType:e,minSize:null,maxSize:null,typeName:tb.ZodSet,...B(t)});class eg extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return y(t,{code:u.invalid_type,expected:s.function,received:t.parsedType}),v;function r(e,r){return m({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,p(),d].filter(e=>!!e),issueData:{code:u.invalid_arguments,argumentsError:r}})}function n(e,r){return m({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,p(),d].filter(e=>!!e),issueData:{code:u.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof e_){let e=this;return k(async function(...t){let s=new l([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(r(t,e)),s}),u=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(u,i).catch(e=>{throw s.addIssue(n(u,e)),s})})}{let e=this;return k(function(...t){let s=e._def.args.safeParse(t,i);if(!s.success)throw new l([r(t,s.error)]);let o=Reflect.apply(a,this,s.data),u=e._def.returns.safeParse(o,i);if(!u.success)throw new l([n(o,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eg({...this._def,args:ef.create(e).rest(en.create())})}returns(e){return new eg({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new eg({args:e||ef.create([]).rest(en.create()),returns:t||en.create(),typeName:tb.ZodFunction,...B(r)})}}class ey extends T{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ey.create=(e,t)=>
1new ey({getter:e,typeName:tb.ZodLazy,...B(t)});class eb extends T{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:u.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ev(e,t){return new ew({values:e,typeName:tb.ZodEnum,...B(t)})}eb.create=(e,t)=>new eb({value:e,typeName:tb.ZodLiteral,...B(t)});class ew extends T{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return y(t,{expected:tm.joinValues(r),received:t.parsedType,code:u.invalid_type}),v}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return y(t,{received:t.data,code:u.invalid_enum_value,options:r}),v}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ew.create(e,{...this._def,...t})}exclude(e,t=this._def){return ew.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ew.create=ev;class ek extends T{_parse(e){let t=tm.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==s.string&&r.parsedType!==s.number){let e=tm.objectValues(t);return y(r,{expected:tm.joinValues(e),received:r.parsedType,code:u.invalid_type}),v}if(this._cache||(this._cache=new Set(tm.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=tm.objectValues(t);return y(r,{received:r.data,code:u.invalid_enum_value,options:e}),v}return k(e.data)}get enum(){return this._def.values}}ek.create=(e,t)=>new ek({values:e,typeName:tb.ZodNativeEnum,...B(t)});class e_ extends T{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==s.promise&&!1===t.common.async?(y(t,{code:u.invalid_type,expected:s.promise,received:t.parsedType}),v):k((t.parsedType===s.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}e_.create=(e,t)=>new e_({type:e,typeName:tb.ZodPromise,...B(t)});class ex extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===tb.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{y(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return v;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?v:"dirty"===n.status||"dirty"===t.value?w(n.value):n});{if("aborted"===t.value)return v;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?v:"dirty"===n.status||"dirty"===t.value?w(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?v:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?v:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>S(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):v);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!S(e))return v;let a=n.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}tm.assertNever(n)}}ex.create=(e,t,r)=>new ex({schema:e,typeName:tb.ZodEffects,effect:t,...B(r)}),ex.createWithPreprocess=(e,t,r)=>new ex({schema:t,effect:{type:"preprocess",transform:e},typeName:tb.ZodEffects,...B(r)});class eS extends T{_parse(e){return this._getType(e)===s.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eS.create=(e,t)=>
1new eS({innerType:e,typeName:tb.ZodOptional,...B(t)});class eE extends T{_parse(e){return this._getType(e)===s.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eE.create=(e,t)=>new eE({innerType:e,typeName:tb.ZodNullable,...B(t)});class eI extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===s.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eI.create=(e,t)=>new eI({innerType:e,typeName:tb.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...B(t)});class eA extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return E(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new l(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eA.create=(e,t)=>new eA({innerType:e,typeName:tb.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...B(t)});class eB extends T{_parse(e){if(this._getType(e)!==s.nan){let t=this._getOrReturnCtx(e);return y(t,{code:u.invalid_type,expected:s.nan,received:t.parsedType}),v}return{status:"valid",value:e.data}}}eB.create=e=>new eB({typeName:tb.ZodNaN,...B(e)});let eT=Symbol("zod_brand");class eP extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eO extends T{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),w(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eO({in:e,out:t,typeName:tb.ZodPipeline})}}class ej extends T{_parse(e){let t=this._def.innerType._parse(e),r=e=>(S(e)&&(e.value=Object.freeze(e.value)),e);return E(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function eR(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function eL(e,t={},r){return e?er.create().superRefine((n,i)=>{let a=e(n);if(a instanceof Promise)return a.then(e=>{if(!e){let e=eR(t,n),a=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:a})}});if(!a){let e=eR(t,n),a=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:a})}}):er.create()}ej.create=(e,t)=>new ej({innerType:e,typeName:tb.ZodReadonly,...B(t)});let eC={object:eo.lazycreate};(tp=tb||(tb={})).ZodString="ZodString",tp.ZodNumber="ZodNumber",tp.ZodNaN="ZodNaN",tp.ZodBigInt="ZodBigInt",tp.ZodBoolean="ZodBoolean",tp.ZodDate="ZodDate",tp.ZodSymbol="ZodSymbol",tp.ZodUndefined="ZodUndefined",tp.ZodNull="ZodNull",tp.ZodAny="ZodAny",tp.ZodUnknown="ZodUnknown",tp.ZodNever="ZodNever",tp.ZodVoid="ZodVoid",tp.ZodArray="ZodArray",tp.ZodObject="ZodObject",tp.ZodUnion="ZodUnion",tp.ZodDiscriminatedUnion="ZodDiscriminatedUnion",tp.ZodIntersection="ZodIntersection",tp.ZodTuple="ZodTuple",tp.ZodRecord="ZodRecord",tp.ZodMap="ZodMap",tp.ZodSet="ZodSet",tp.ZodFunction="ZodFunction",tp.ZodLazy="ZodLazy",tp.ZodLiteral="ZodLiteral",tp.ZodEnum="ZodEnum",tp.ZodEffects="ZodEffects",tp.ZodNativeEnum="ZodNativeEnum",tp.ZodOptional="ZodOptional",tp.ZodNullable="ZodNullable",tp.ZodDefault="ZodDefault",tp.ZodCatch="ZodCatch",tp.ZodPromise="ZodPromise",tp.ZodBranded="ZodBranded",tp.ZodPipeline="ZodPipeline",tp.ZodReadonly="ZodReadonly";let eN=(e,t={message:`Input not instance of ${e.name}`})=>eL(t=>t instanceof e,t),ez=J.create,eU=H.create,eZ=eB.create,eM=G.create,eW=Y.create,eF=X.create,eK=Q.create,eD=ee.create,e$=et.create,eq=er.create,eV=en.create,eJ=ei.create,eH=ea.create,eG=es.create,eY=eo.create,eX=eo.strictCreate,eQ=eu.create,e0=el.create,e1=ed.create,e2=ef.create,e6=eh.create,e4=ep.create,e5=em.create,e3=eg.create,e8=ey.create,e9=eb.create,e7=ew.create,te=ek.create,tt=e_.create,tr=ex.create,tn=eS.create,ti=eE.create,ta=ex.
1createWithPreprocess,ts=eO.create,to=()=>ez().optional(),tu=()=>eU().optional(),tc=()=>eW().optional(),tl={string:e=>J.create({...e,coerce:!0}),number:e=>H.create({...e,coerce:!0}),boolean:e=>Y.create({...e,coerce:!0}),bigint:e=>G.create({...e,coerce:!0}),date:e=>X.create({...e,coerce:!0})};e.s(["BRAND",0,eT,"NEVER",0,v,"Schema",0,T,"ZodAny",0,er,"ZodArray",0,es,"ZodBigInt",0,G,"ZodBoolean",0,Y,"ZodBranded",0,eP,"ZodCatch",0,eA,"ZodDate",0,X,"ZodDefault",0,eI,"ZodDiscriminatedUnion",0,el,"ZodEffects",0,ex,"ZodEnum",0,ew,"ZodFirstPartyTypeKind",0,tb,"ZodFunction",0,eg,"ZodIntersection",0,ed,"ZodLazy",0,ey,"ZodLiteral",0,eb,"ZodMap",0,ep,"ZodNaN",0,eB,"ZodNativeEnum",0,ek,"ZodNever",0,ei,"ZodNull",0,et,"ZodNullable",0,eE,"ZodNumber",0,H,"ZodObject",0,eo,"ZodOptional",0,eS,"ZodPipeline",0,eO,"ZodPromise",0,e_,"ZodReadonly",0,ej,"ZodRecord",0,eh,"ZodSchema",0,T,"ZodSet",0,em,"ZodString",0,J,"ZodSymbol",0,Q,"ZodTransformer",0,ex,"ZodTuple",0,ef,"ZodType",0,T,"ZodUndefined",0,ee,"ZodUnion",0,eu,"ZodUnknown",0,en,"ZodVoid",0,ea,"any",0,eq,"array",0,eG,"bigint",0,eM,"boolean",0,eW,"coerce",0,tl,"custom",0,eL,"date",0,eF,"datetimeRegex",0,V,"discriminatedUnion",0,e0,"effect",0,tr,"enum",0,e7,"function",0,e3,"instanceof",0,eN,"intersection",0,e1,"late",0,eC,"lazy",0,e8,"literal",0,e9,"map",0,e4,"nan",0,eZ,"nativeEnum",0,te,"never",0,eJ,"null",0,e$,"nullable",0,ti,"number",0,eU,"object",0,eY,"oboolean",0,tc,"onumber",0,tu,"optional",0,tn,"ostring",0,to,"pipeline",0,ts,"preprocess",0,ta,"promise",0,tt,"record",0,e6,"set",0,e5,"strictObject",0,eX,"string",0,ez,"symbol",0,eK,"transformer",0,tr,"tuple",0,e2,"undefined",0,eD,"union",0,eQ,"unknown",0,eV,"void",0,eH],480),e.i(480),e.i(559413),e.s(["BRAND",0,eT,"DIRTY",0,w,"EMPTY_PATH",0,g,"INVALID",0,v,"NEVER",0,v,"OK",0,k,"ParseStatus",0,b,"Schema",0,T,"ZodAny",0,er,"ZodArray",0,es,"ZodBigInt",0,G,"ZodBoolean",0,Y,"ZodBranded",0,eP,"ZodCatch",0,eA,"ZodDate",0,X,"ZodDefault",0,eI,"ZodDiscriminatedUnion",0,el,"ZodEffects",0,ex,"ZodEnum",0,ew,"ZodError",0,l,"ZodFirstPartyTypeKind",0,tb,"ZodFunction",0,eg,"ZodIntersection",0,ed,"ZodIssueCode",0,u,"ZodLazy",0,ey,"ZodLiteral",0,eb,"ZodMap",0,ep,"ZodNaN",0,eB,"ZodNativeEnum",0,ek,"ZodNever",0,ei,"ZodNull",0,et,"ZodNullable",0,eE,"ZodNumber",0,H,"ZodObject",0,eo,"ZodOptional",0,eS,"ZodParsedType",0,s,"ZodPipeline",0,eO,"ZodPromise",0,e_,"ZodReadonly",0,ej,"ZodRecord",0,eh,"ZodSchema",0,T,"ZodSet",0,em,"ZodString",0,J,"ZodSymbol",0,Q,"ZodTransformer",0,ex,"ZodTuple",0,ef,"ZodType",0,T,"ZodUndefined",0,ee,"ZodUnion",0,eu,"ZodUnknown",0,en,"ZodVoid",0,ea,"addIssueToContext",0,y,"any",0,eq,"array",0,eG,"bigint",0,eM,"boolean",0,eW,"coerce",0,tl,"custom",0,eL,"date",0,eF,"datetimeRegex",0,V,"defaultErrorMap",0,d,"discriminatedUnion",0,e0,"effect",0,tr,"enum",0,e7,"function",0,e3,"getErrorMap",0,p,"getParsedType",0,o,"instanceof",0,eN,"intersection",0,e1,"isAborted",0,_,"isAsync",0,E,"isDirty",0,x,"isValid",0,S,"late",0,eC,"lazy",0,e8,"literal",0,e9,"makeIssue",0,m,"map",0,e4,"nan",0,eZ,"nativeEnum",0,te,"never",0,eJ,"null",0,e$,"nullable",0,ti,"number",0,eU,"object",0,eY,"objectUtil",0,tg,"oboolean",0,tc,"onumber",0,tu,"optional",0,tn,"ostring",0,to,"pipeline",0,ts,"preprocess",0,ta,"promise",0,tt,"quotelessJson",0,c,"record",0,e6,"set",0,e5,"setErrorMap",0,h,"strictObject",0,eX,"string",0,ez,"symbol",0,eK,"transformer",0,tr,"tuple",0,e2,"undefined",0,eD,"union",0,eQ,"unknown",0,eV,"util",0,tm,"void",0,eH],966951);var td,tf,th,tp,tm,tg,ty,tb,tv=e.i(966951),tv=tv,tv=tv;let tw=/[@#$%^&*+=/\\|~«»]/,tk=/(!{2,}|\?{2,}|-{2,})/,t_=/[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u,tx=({max:e,noSpaces:t}={})=>(t?tv.string().max(e??1/0).regex(/^\S*$/,"Spaces are not allowed"):tv.string().max(e??1/0)).refine(e=>!t_.test(e),{message:"Emojis and symbols are not allowed"}).refine(e=>!tw.test(e),{message:"Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, «, ») are not allowed"}).refine(e=>!tk.test(e),{message:"Repeated punctuations (!!, ??, --) are not allowed"}),tS=tv.string().url().startsWith("https://",{message:"Must be an https url"}).max(1024).refine(e=>!e.includes(" "),{message:"URL must not contain spaces"}).refine(e=>{try{let t=new URL(e).hostname;if("localhost"===t||t.endsWith(".localhost")||/^(\d{1,3}\.){3}\d{1,3}$/.test(t)||t.startsWith("[")&&t.endsWith("]"))return!1;return!0}catch{return!1}},{message:"URL must not use IP addresses or localhost"}),tE=tv.string().max(32),tI=tv.string().max(32),tA=tv.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/,{message:"Invalid CAIP-19 asset ID"}),tB=tv.string().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),tT=tv.string().max(1024).regex(/^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,{message:"Must be a valid domain name (e.g., example.com, sub.example.com)"}).refine(e=>!e.includes("://"),{message:"Domain must not include protocol (http://, https://, etc.)"}).refine(e=>!e.includes("/"),{message:"Domain must not include path separators"}).refine(e=>!e.includes("@"),{message:"Domain must not include @ symbol"}).refine(e=>!e.includes(":"),{message:"Domain must not include port numbers"}),tP=tv.union([tv.literal("1:1"),tv.literal("3:2")]),tO=tv.object({header:tv.string(),payload:tv.string(),signature:tv.string()});
1tv.object({fid:tv.number(),type:tv.literal("app_key"),key:tv.string().startsWith("0x")});let tj=tv.object({type:tv.literal("launch_frame"),name:tE,url:tS.optional(),splashImageUrl:tS.optional(),splashBackgroundColor:tB.optional()}),tR=tv.object({type:tv.literal("launch_miniapp"),name:tE,url:tS.optional(),splashImageUrl:tS.optional(),splashBackgroundColor:tB.optional()}),tL=tv.object({type:tv.literal("view_token"),token:tA}),tC=tv.discriminatedUnion("type",[tR,tL,tj]),tN=tv.object({title:tI,action:tC});tv.object({version:tv.union([tv.string(),tv.number()]).transform(e=>String(e)).pipe(tv.union([tv.literal("next"),tv.literal("1")])),imageUrl:tS,aspectRatio:tP.optional(),button:tN});var tv=tv,tv=tv;let tz=tv.object({url:tv.string(),token:tv.string()});tv.object({notificationId:tv.string().max(128),title:tv.string().max(32),body:tv.string().max(128),targetUrl:tS,tokens:tv.string().array().max(100)}),tv.object({result:tv.object({successfulTokens:tv.array(tv.string()),invalidTokens:tv.array(tv.string()),rateLimitedTokens:tv.array(tv.string())})});let tU=tv.object({event:tv.literal("miniapp_added"),notificationDetails:tz.optional()}),tZ=tv.object({event:tv.literal("miniapp_removed")}),tM=tv.object({event:tv.literal("notifications_enabled"),notificationDetails:tz.required()}),tW=tv.object({event:tv.literal("notifications_disabled")});tv.discriminatedUnion("event",[tU,tZ,tM,tW]);var tv=tv;let tF=tv.enum(["games","social","finance","utility","productivity","health-fitness","news-media","music","shopping","education","developer-tools","entertainment","art-creativity"]),tK=tv.union([tv.literal("0.0.0"),tv.literal("0.0.1"),tv.literal("1"),tv.literal("next")]),tD=tx({max:30}),t$=tx({max:170}),tq=tv.array(tS).max(3),tV=tv.array(tx({max:20,noSpaces:!0})).max(5),tJ=tx({max:30}),tH=tx({max:30}),tG=tx({max:100}),tY=tv.boolean();function tX(e){return Array.from(new Set(e))}let tQ=tv.array(tv.enum(["eip155:1","eip155:8453","eip155:42161","eip155:421614","eip155:84532","eip155:666666666","eip155:100","eip155:10","eip155:11155420","eip155:137","eip155:11155111","eip155:7777777","eip155:130","eip155:10143","eip155:42220","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"])).transform(tX),t0=tv.array(tv.enum(["wallet.getEthereumProvider","wallet.getSolanaProvider","actions.ready","actions.openUrl","actions.close","actions.setPrimaryButton","actions.addMiniApp","actions.signIn","actions.viewCast","actions.viewProfile","actions.composeCast","actions.viewToken","actions.sendToken","actions.swapToken","actions.openMiniApp","actions.requestCameraAndMicrophoneAccess","experimental.signManifest","haptics.impactOccurred","haptics.notificationOccurred","haptics.selectionChanged","back"])).transform(tX),t1=tv.object({version:tK,name:tE,iconUrl:tS,homeUrl:tS,imageUrl:tS.optional(),buttonTitle:tI.optional(),splashImageUrl:tS.optional(),splashBackgroundColor:tB.optional(),webhookUrl:tS.optional(),subtitle:tD.optional(),description:t$.optional(),screenshotUrls:tq.optional(),primaryCategory:tF.optional(),tags:tV.optional(),heroImageUrl:tS.optional(),tagline:tJ.optional(),ogTitle:tH.optional(),ogDescription:tG.optional(),ogImageUrl:tS.optional(),noindex:tY.optional(),requiredChains:tQ.optional(),requiredCapabilities:t0.optional(),castShareUrl:tS.optional(),canonicalDomain:tT.optional()}).refine(e=>{if(void 0===e.castShareUrl)return!0;try{let t=new URL(e.homeUrl).hostname,r=new URL(e.castShareUrl).hostname;return t===r}catch{return!1}},{message:"castShareUrl must have the same domain as homeUrl",path:["castShareUrl"]});tv.object({accountAssociation:tO,miniapp:t1.optional(),frame:t1.optional()}).refine(e=>!e.frame||!e.miniapp||JSON.stringify(e.frame)===JSON.stringify(e.miniapp),{message:'If both "frame" and "miniapp" are provided, they must be identical',path:["frame","miniapp"]}).transform(e=>({...e,frame:e.frame??e.miniapp}));var t2=e.i(259390),t6=e.i(837474),t4=e.i(944445),t5=e.i(365490),t3=e.i(878660),t8=e.i(288667);let t9=BigInt(0),t7=BigInt(1),re=BigInt(2),rt=BigInt(8);class rr{constructor(e){this.ep=e}static fromBytes(e){(0,t3.notImplemented)()}static fromHex(e){(0,t3.notImplemented)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return(0,t4.bytesToHex)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}
vendor: 9,438 bytes, line 1
1add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}var rn=e.i(79262);BigInt(0),BigInt(1),BigInt(2);let ri=BigInt(0),ra=BigInt(1),rs=BigInt(2),ro=BigInt(3),ru=BigInt(5),rc=BigInt(8),rl=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),rd={p:rl,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:rc,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},rf=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function rh(e,t){var r;let n,i,a,s,o,u,c,l,d,f,h,p,m,g,y=(0,t8.mod)(t*t*t,rl),b=(r=e*(0,t8.mod)(y*y*t,rl),n=BigInt(10),i=BigInt(20),a=BigInt(40),s=BigInt(80),o=r*r%rl*r%rl,u=(0,t8.pow2)(o,rs,rl)*o%rl,c=(0,t8.pow2)(u,ra,rl)*r%rl,l=(0,t8.pow2)(c,ru,rl)*c%rl,d=(0,t8.pow2)(l,n,rl)*l%rl,f=(0,t8.pow2)(d,i,rl)*d%rl,h=(0,t8.pow2)(f,a,rl)*f%rl,p=(0,t8.pow2)(h,s,rl)*h%rl,m=(0,t8.pow2)(p,s,rl)*h%rl,g=(0,t8.pow2)(m,n,rl)*l%rl,{pow_p_5_8:(0,t8.pow2)(g,rs,rl)*r%rl,b2:o}).pow_p_5_8,v=(0,t8.mod)(e*y*b,rl),w=(0,t8.mod)(t*v*v,rl),k=v,_=(0,t8.mod)(v*rf,rl),x=w===e,S=w===(0,t8.mod)(-e,rl),E=w===(0,t8.mod)(-e*rf,rl);return x&&(v=k),(S||E)&&(v=_),(0,t8.isNegativeLE)(v,rl)&&(v=(0,t8.mod)(-v,rl)),{isValid:x||S,value:v}}let rp=(0,t8.Field)(rd.p,{isLE:!0}),rm=(0,t8.Field)(rd.n,{isLE:!0}),rg=function(e){let t,r,n,i,{CURVE:a,curveOpts:s,hash:o,eddsaOpts:u}=(t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r={Fp:e.Fp,Fn:(0,t8.Field)(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},n={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve},{CURVE:t,curveOpts:r,hash:e.hash,eddsaOpts:n}),c=function(e,t,r={}){if("function"!=typeof t)throw Error('"hash" function param is required');(0,t3._validateObject)(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:n}=r,{BASE:i,Fp:a,Fn:s}=e,o=r.randomBytes||t4.randomBytes,u=r.adjustScalarBytes||(e=>e),c=r.domain||((e,t,r)=>{if((0,t3._abool2)(r,"phflag"),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function l(e){return s.create((0,t3.bytesToNumberLE)(e))}function d(e){var r;let n,a,s,o,c,{head:d,prefix:f,scalar:h}=(r=e,n=g.secretKey,r=(0,t3.ensureBytes)("private key",r,n),s=u((a=(0,t3.ensureBytes)("hashed private key",t(r),2*n)).slice(0,n)),o=a.slice(n,2*n),c=l(s),{head:s,prefix:o,scalar:c}),p=i.multiply(h),m=p.toBytes();return{head:d,prefix:f,scalar:h,point:p,pointBytes:m}}function f(e){return d(e).pointBytes}function h(e=Uint8Array.of(),...r){return l(t(c((0,t4.concatBytes)(...r),(0,t3.ensureBytes)("context",e),!!n)))}let p={zip215:!0},m=a.BYTES,g={secretKey:m,publicKey:m,signature:2*m,seed:m};function y(e=o(g.seed)){return(0,t3._abytes2)(e,g.seed,"seed")}let b={getExtendedPublicKey:d,randomSecretKey:y,isValidSecretKey:function(e){return(0,t4.isBytes)(e)&&e.length===s.BYTES},isValidPublicKey:function(t,r){try{return!!e.fromBytes(t,r)}catch(e){return!1}},toMontgomery(t){let{y:r}=e.fromBytes(t),n=g.publicKey,i=32===n;if(!i&&57!==n)throw Error("only defined for 25519 and 448");let s=i?a.div(t7+r,t7-r):a.div(r-t7,r+t7);return a.toBytes(s)},toMontgomerySecret(e){let r=g.secretKey;return(0,t3._abytes2)(e,r),u(t(e.subarray(0,r))).subarray(0,r)},randomPrivateKey:y,precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};return Object.freeze({keygen:function(e){let t=b.randomSecretKey(e);return{secretKey:t,publicKey:f(t)}},getPublicKey:f,sign:function(e,t,r={}){e=(0,t3.ensureBytes)("message",e),n&&(e=n(e));let{prefix:a,scalar:o,pointBytes:u}=d(t),c=h(r.context,a,e),l=i.multiply(c).toBytes(),f=h(r.context,l,u,e),p=s.create(c+f*o);if(!s.isValid(p))throw Error("sign failed: invalid s");let m=(0,t4.concatBytes)(l,s.toBytes(p));return(0,t3._abytes2)(m,g.signature,"result")},verify:function(t,r,a,s=p){let o,u,c,{context:l,zip215:d}=s,f=g.signature;t=(0,t3.ensureBytes)("signature",t,f),r=(0,t3.ensureBytes)("message",r),a=(0,t3.ensureBytes)("publicKey",a,g.publicKey),void 0!==d&&(0,t3._abool2)(d,"zip215"),n&&(r=n(r));let m=f/2,y=t.subarray(0,m),b=(0,t3.bytesToNumberLE)(t.subarray(m,f));try{o=e.fromBytes(a,d),u=e.fromBytes(y,d),c=i.multiplyUnsafe(b)}catch(e){return!1}if(!d&&o.isSmallOrder())return!1;let v=h(l,u.toBytes(),o.toBytes(),r);return u.add(o.multiplyUnsafe(v)).subtract(c).clearCofactor().is0()},utils:b,Point:e,lengths:g})}(function(e,t={}){var r,n;let i,a,s,o,u,c=(0,t5._createCurveFields)("edwards",e,t,t.FpFnLE),{Fp:l,Fn:d}=c,f=c.CURVE,{h:h}=f;(0,t3._validateObject)(t,{},{uvRatio:"function"});let p=re<<BigInt(8*d.BYTES)-t7,m=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:l.sqrt(l.div(e,t))}}catch(e){return{isValid:!1,value:t9}}});if(r=f.Gx,n=f.Gy,i=l.sqr(r),a=l.sqr(n),s=l.add(l.mul(f.a,i),a),o=l.add(l.ONE,l.mul(f.d,l.mul(i,a))),!l.eql(s,o))throw Error("bad curve params: generator point");function g(e,t,r=!1){let n=r?t7:t9;return(0,t3.aInRange)("coordinate "+e,t,n,p),t}function y(e){if(!(e instanceof w))throw Error("ExtendedPoint expected")}let b=(0,t3.memoized)((e,t)=>{let r,n,{X:i,Y:a,Z:s}=e,o=e.is0();null==t&&(t=o?rt:l.inv(s));let u=(r=i*t,l.create(r)),c=(n=a*t,l.create(n)),d=l.mul(s,t);if(o)return{x:t9,y:t7};if(d!==t7)throw Error("invZ was invalid");return{x:u,y:c}}),v=(0,t3.memoized)(e=>{let t,r,n,i,a,s,o,u,c,d,h,p,{a:m,d:g}=f;if(e.is0())throw Error("bad point: ZERO");let{X:y,Y:b,Z:v,T:w}=e,k=(t=y*y,l.create(t)),_=(r=b*b,l.create(r)),x=(n=v*v,l.create(n)),S=(i=x*x,l.create(i));if(o=x*(a=k*m,s=l.create(a)+_,l.create(s)),l.create(o)!==(d=S+(c=g*(u=k*_,l.create(u)),l.create(c)),l.create(d)))throw Error("bad point: equation left != right (1)");if(h=y*b,l.create(h)!==(p=v*w,l.create(p)))throw Error("bad point: equation left != right (2)");return!0});class w{constructor(e,t,r,n){this.X=g("x",e),this.Y=g("y",t),this.Z=g("z",r,!0),this.T=g("t",n),Object.freeze(this)}static CURVE(){return f}static fromAffine(e){let t;if(e instanceof w)throw Error("extended point not allowed");let{x:r,y:n}=e||{};return g("x",r),g("y",n),new w(r,n,t7,(t=r*n,l.create(t)))}static fromBytes(e,t=!1){let r,n,i,a,s=l.BYTES,{a:o,d:u}=f;e=(0,t3.copyBytes)((0,t3._abytes2)(e,s,"point")),(0,t3._abool2)(t,"zip215");let c=(0,t3.copyBytes)(e),d=e[s-1];c[s-1]=-129&d;let h=(0,t3.bytesToNumberLE)(c),g=t?p:l.ORDER;(0,t3.aInRange)("point.y",h,t9,g);let y=(r=h*h,l.create(r)),{isValid:b,value:v}=m((n=y-t7,l.create(n)),(i=u*y-o,l.create(i)));if(!b)throw Error("bad point: invalid y coordinate");let k=(v&t7)===t7,_=(128&d)!=0;if(!t&&v===t9&&_)throw Error("bad point: x=0 and x_0=1");return _!==k&&(a=-v,v=l.create(a)),w.fromAffine({x:v,y:h})}static fromHex(e,t=!1){return w.fromBytes((0,t3.ensureBytes)("point",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return k.createCache(this,e),t||this.multiply(re),this}assertValidity(){v(this)}equals(e){let t,r,n,i;y(e);let{X:a,Y:s,Z:o}=this,{X:u,Y:c,Z:d}=e,f=(t=a*d,l.create(t)),h=(r=u*o,l.create(r)),p=(n=s*d,l.create(n)),m=(i=c*o,l.create(i));return f===h&&p===m}is0(){return this.equals(w.ZERO)}negate(){let e,t;return new w((e=-this.X,l.create(e)),this.Y,this.Z,(t=-this.T,l.create(t)))}double(){let e,t,r,n,i,a,s,o,u,c,d,{a:h}=f,{X:p,Y:m,Z:g}=this,y=(e=p*p,l.create(e)),b=(t=m*m,l.create(t)),v=(n=re*(r=g*g,l.create(r)),l.create(n)),k=(i=h*y,l.create(i)),_=p+m,x=(a=_*_,s=l.create(a)-y-b,l.create(s)),S=k+b,E=S-v,I=k-b,A=(o=x*E,l.create(o)),B=(u=S*I,l.create(u)),T=(c=x*I,l.create(c));return new w(A,B,(d=E*S,l.create(d)),T)}add(e){let t,r,n,i,a,s,o,u,c,d;y(e);let{a:h,d:p}=f,{X:m,Y:g,Z:b,T:v}=this,{X:k,Y:_,Z:x,T:S}=e,E=(t=m*k,l.create(t)),I=(r=g*_,l.create(r)),A=(n=v*p*S,l.create(n)),B=(i=b*x,l.create(i)),T=(a=(m+g)*(k+_)-E-I,l.create(a)),P=B-A,O=B+A,j=(s=I-h*E,l.create(s)),R=(o=T*P,l.create(o)),L=(u=O*j,l.create(u)),C=(c=T*j,l.create(c));return new w(R,L,(d=P*O,l.create(d)),C)}subtract(e){return this.add(e.negate())}multiply(e){if(!d.isValidNot0(e))throw Error("invalid scalar: expected 1 <= sc < curve.n");let{p:t,f:r}=k.cached(this,e,e=>(0,t5.normalizeZ)(w,e));return(0,t5.normalizeZ)(w,[t,r])[0]}multiplyUnsafe(e,t=w.ZERO){if(!d.isValid(e))throw Error("invalid scalar: expected 0 <= sc < curve.n");return e===t9?w.ZERO:this.is0()||e===t7?this:k.unsafe(this,e,e=>(0,t5.normalizeZ)(w,e),t)}isSmallOrder(){return this.multiplyUnsafe(h).is0()}isTorsionFree(){return k.unsafe(this,f.n).is0()}toAffine(e){return b(this,e)}clearCofactor(){return h===t7?this:this.multiplyUnsafe(h)}toBytes(){let{x:e,y:t}=this.toAffine(),r=l.toBytes(t);return r[r.length-1]|=e&t7?128:0,r}toHex(){return(0,t4.bytesToHex)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return(0,t5.normalizeZ)(w,e)}static msm(e,t){return(0,t5.pippenger)(w,d,e,t)}
1_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}w.BASE=new w(f.Gx,f.Gy,t7,(u=f.Gx*f.Gy,l.create(u))),w.ZERO=new w(t9,t7,t7,t9),w.Fp=l,w.Fn=d;let k=new t5.wNAF(w,d.BITS);return w.BASE.precompute(8),w}(a,s),o,u);return i=c.Point,Object.assign({},c,{ExtendedPoint:i,CURVE:e,nBitLength:i.Fn.BITS,nByteLength:i.Fn.BYTES})}({...rd,Fp:rp,hash:t6.sha512,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},uvRatio:rh}),ry=(rl+ro)/rc,rb=rp.pow(rs,ry),rv=rp.sqrt(rp.neg(rp.ONE)),rw=(0,t8.FpSqrtEven)(rp,rp.neg(BigInt(486664)));(0,rn.createHasher)(rg.Point,e=>(function(e){let t,r,n,i,a,s,o,u,c,l,d,f,h,p,m,g,y,b,v,w,k,_,x,{xMn:S,xMd:E,yMn:I,yMd:A}=(t=(rl-ru)/rc,r=BigInt(486662),n=rp.sqr(e),n=rp.mul(n,rs),i=rp.add(n,rp.ONE),a=rp.neg(r),s=rp.sqr(i),o=rp.mul(s,i),u=rp.mul(n,r),u=rp.mul(u,a),u=rp.add(u,s),u=rp.mul(u,a),c=rp.sqr(o),s=rp.sqr(c),c=rp.mul(c,o),c=rp.mul(c,u),s=rp.mul(s,c),l=rp.pow(s,t),l=rp.mul(l,c),d=rp.mul(l,rv),s=rp.sqr(l),s=rp.mul(s,o),f=rp.eql(s,u),h=rp.cmov(d,l,f),p=rp.mul(a,n),m=rp.mul(l,e),m=rp.mul(m,rb),g=rp.mul(m,rv),y=rp.mul(u,n),s=rp.sqr(m),s=rp.mul(s,o),b=rp.eql(s,y),v=rp.cmov(g,m,b),s=rp.sqr(h),s=rp.mul(s,o),w=rp.eql(s,u),k=rp.cmov(p,a,w),_=rp.cmov(v,h,w),x=rp.isOdd(_),{xMn:k,xMd:i,yMn:_=rp.cmov(_,rp.neg(_),w!==x),yMd:ra}),B=rp.mul(S,A);B=rp.mul(B,rw);let T=rp.mul(E,I),P=rp.sub(S,E),O=rp.add(S,E),j=rp.mul(T,O),R=rp.eql(j,rp.ZERO);B=rp.cmov(B,rp.ZERO,R),T=rp.cmov(T,rp.ONE,R),P=rp.cmov(P,rp.ONE,R),O=rp.cmov(O,rp.ONE,R);let[L,C]=(0,t8.FpInvertBatch)(rp,[T,O],!0);return{x:rp.mul(B,L),y:rp.mul(P,C)}})(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:rl,m:1,k:128,expand:"xmd",hash:t6.sha512});let rk=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),r_=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),rx=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),rS=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),rE=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),rI=e=>rg.Point.Fp.create((0,t3.bytesToNumberLE)(e)&rE);function rA(e){let t,r,n,i,a,s,o,u,c,l,d,f,h,p,m,{d:g}=rd,y=(t=rf*e*e,rp.create(t)),b=(r=(y+ra)*rx,rp.create(r)),v=BigInt(-1),w=(i=(v-g*y)*(n=y+g,rp.create(n)),rp.create(i)),{isValid:k,value:_}=rh(b,w),x=(a=_*e,rp.create(a));(0,t8.isNegativeLE)(x,rl)||(s=-x,x=rp.create(s)),k||(_=x),k||(v=y);let S=(o=v*(y-ra)*rS-w,rp.create(o)),E=_*_,I=(u=(_+_)*w,rp.create(u)),A=(c=S*rk,rp.create(c)),B=(l=ra-E,rp.create(l)),T=(d=ra+E,rp.create(d));return new rg.Point((f=I*T,rp.create(f)),(h=B*A,rp.create(h)),(p=A*T,rp.create(p)),(m=I*B,rp.create(m)))}class rB extends rr{constructor(e){super(e)}static fromAffine(e){return new rB(rg.Point.fromAffine(e))}assertSame(e){if(!(e instanceof rB))throw Error("RistrettoPoint expected")}init(e){return new rB(e)}static hashToCurve(e){var t;let r,n;return t=(0,t3.ensureBytes)("ristrettoHash",e,64),(0,t4.abytes)(t,64),r=rA(rI(t.subarray(0,32))),n=rA(rI(t.subarray(32,64))),new rB(r.add(n))}static fromBytes(e){let t,r,n,i,a,s,o,u,c,l,d,f,h;(0,t4.abytes)(e,32);let{a:p,d:m}=rd,g=rI(e);if(!(0,t3.equalBytes)(rp.toBytes(g),e)||(0,t8.isNegativeLE)(g,rl))throw Error("invalid ristretto255 encoding 1");let y=(t=g*g,rp.create(t)),b=(r=ra+p*y,rp.create(r)),v=(n=ra-p*y,rp.create(n)),w=(i=b*b,rp.create(i)),k=(a=v*v,rp.create(a)),_=(s=p*m*w-k,rp.create(s)),{isValid:x,value:S}=(o=_*k,rh(ra,rp.create(o))),E=(u=S*v,rp.create(u)),I=(c=S*E*_,rp.create(c)),A=(l=(g+g)*E,rp.create(l));(0,t8.isNegativeLE)(A,rl)&&(d=-A,A=rp.create(d));let B=(f=b*I,rp.create(f)),T=(h=A*B,rp.create(h));if(!x||(0,t8.isNegativeLE)(T,rl)||B===ri)throw Error("invalid ristretto255 encoding 2");return new rB(new rg.Point(A,B,ra,T))}static fromHex(e){return rB.fromBytes((0,t3.ensureBytes)("ristrettoHex",e,32))}static msm(e,t){return(0,t5.pippenger)(rB,rg.Point.Fn,e,t)}toBytes(){let e,t,r,n,i,a,s,o,u,c,l,d,f,{X:h,Y:p,Z:m,T:g}=this.ep,y=(e=m+p,r=rp.create(e)*(t=m-p,rp.create(t)),rp.create(r)),b=(n=h*p,rp.create(n)),{value:v}=(a=y*(i=b*b,rp.create(i)),rh(ra,rp.create(a))),w=(s=v*y,rp.create(s)),k=(o=v*b,rp.create(o)),_=(u=w*k*g,rp.create(u));if((0,t8.isNegativeLE)(g*_,rl)){let e,t,r=(e=p*rf,rp.create(e)),n=(t=h*rf,rp.create(t));h=r,p=n,f=rp.create(w*r_)}else f=k;(0,t8.isNegativeLE)(h*_,rl)&&(c=-p,p=rp.create(c));let x=(l=(m-p)*f,rp.create(l));
vendor: 45,182 bytes, lines 1-7
1return(0,t8.isNegativeLE)(x,rl)&&(d=-x,x=rp.create(d)),rp.toBytes(x)}equals(e){let t,r,n,i;this.assertSame(e);let{X:a,Y:s}=this.ep,{X:o,Y:u}=e.ep,c=(t=a*u,rp.create(t)===(r=s*o,rp.create(r))),l=(n=s*u,rp.create(n)===(i=a*o,rp.create(i)));return c||l}is0(){return this.equals(rB.ZERO)}}rB.BASE=new rB(rg.Point.BASE),rB.ZERO=new rB(rg.Point.ZERO),rB.Fp=rp,rB.Fn=rm;var rT=e.i(424509),rP=e.i(341669),rO=e.i(403893),rj=e.i(894119),rR=e.i(742542);function rL([e,t]){return`${e}=${function e(t){return Array.isArray(t)?"%5B"+t.map(e).join("%2C%20")+"%5D":"bigint"==typeof t?`${t}n`:encodeURIComponent(String(null!=t&&null===Object.getPrototypeOf(t)?{...t}:t))}(t)}`}e.i(681304);var rC=class extends Error{cause=this.cause;context;constructor(...[e,t]){let r,n;if(t){const{cause:e,...i}=t;e&&(n={cause:e}),Object.keys(i).length>0&&(r=i)}super(function(e,t={}){{let r=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(r+=` '${btoa(Object.entries(t).map(rL).join("&"))}'`),`${r}\``}}(e,r),n),this.context={__code:e,...r},this.name="SolanaError"}};function rN(e){return"fixedSize"in e&&"number"==typeof e.fixedSize}var rz=((td=rz||{})[td.Little=0]="Little",td[td.Big=1]="Big",td);function rU(e){return e?.endian!==1}class rZ extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...a}=e,{path:s}=e,o=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??o),null!=i&&(this.cause=o),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function rM(e){return"object"==typeof e&&null!=e}function rW(e){return rM(e)&&!Array.isArray(e)}function rF(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function*rK(e,t,r,n){var i;for(let a of(rM(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]),e)){let e=function(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});let{path:i,branch:a}=t,{type:s}=r,{refinement:o,message:u=`Expected a value of type \`${s}\`${o?` with refinement \`${o}\``:""}, but received: \`${rF(n)}\``}=e;return{value:n,type:s,refinement:o,key:i[i.length-1],path:i,branch:a,...e,message:u}}(a,t,r,n);e&&(yield e)}}function*rD(e,t,r={}){let{path:n=[],branch:i=[e],coerce:a=!1,mask:s=!1}=r,o={path:n,branch:i,mask:s};a&&(e=t.coercer(e,o));let u="valid";for(let n of t.validator(e,o))n.explanation=r.message,u="not_valid",yield[n,void 0];for(let[c,l,d]of t.entries(e,o))for(let t of rD(l,d,{path:void 0===c?n:[...n,c],branch:void 0===c?i:[...i,l],coerce:a,mask:s,message:r.message}))t[0]?(u=null!=t[0].refinement?"not_refined":"not_valid",yield[t[0],void 0]):a&&(l=t[1],void 0===c?e=l:e instanceof Map?e.set(c,l):e instanceof Set?e.add(l):rM(e)&&(void 0!==l||c in e)&&(e[c]=l));if("not_valid"!==u)for(let n of t.refiner(e,o))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,e])}class r${constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:a=e=>e,entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=a,n?this.validator=(e,t)=>rK(n(e,t),t,this,e):this.validator=()=>[],i?this.refiner=(e,t)=>rK(i(e,t),t,this,e):this.refiner=()=>[]}assert(e,t){var r=e,n=this,i=t;let a=rV(r,n,{message:i});if(a[0])throw a[0]}create(e,t){return rq(e,this,t)}is(e){var t,r;return t=e,r=this,!rV(t,r)[0]}mask(e,t){var r=e,n=this,i=t;let a=rV(r,n,{coerce:!0,mask:!0,message:i});if(!a[0])return a[1];throw a[0]}validate(e,t={}){return rV(e,this,t)}}function rq(e,t,r){let n=rV(e,t,{coerce:!0,message:r});if(!n[0])return n[1];throw n[0]}function rV(e,t,r={}){let n=rD(e,t,r),i=function(e){let{done:t,value:r}=e.next();return t?void 0:r}(n);return i[0]?[new rZ(i[0],function*(){for(let e of n)e[0]&&(yield e[0])}),void 0]:[void 0,i[1]]}function rJ(e,t){return new r$({type:e,schema:null,validator:t})}function rH(e){return new r$({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(let[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${rF(e)}`})}function rG(){return rJ("boolean",e=>"boolean"==typeof e)}function rY(e){return rJ("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${rF(t)}`)}function rX(e){let t=rF(e),r=typeof e;return new r$({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${rF(r)}`})}function rQ(e){return new r$({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function r0(){return rJ("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${rF(e)}`)}function r1(e){return new r$({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function r2(e,t){return new r$({type:"record",schema:null,*entries(r){if(rM(r))for(let n in r){let i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>rW(e)||`Expected an object, but received: ${rF(e)}`,coercer:e=>rW(e)?{...e}:e})}function r6(){return rJ("string",e=>"string"==typeof e||`Expected a string, but received: ${rF(e)}`)}function r4(e){let t=rJ("never",()=>!1);return new r$({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){let n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${rF(e)}`,coercer:e=>Array.isArray(e)?e.slice():e})}function r5(e){let t=Object.keys(e);return new r$({type:"type",schema:e,*entries(r){if(rM(r))for(let n of t)yield[n,r[n],e[n]]},validator:e=>rW(e)||`Expected an object, but received: ${rF(e)}`,coercer:e=>rW(e)?{...e}:e})}function r3(e){let t=e.map(e=>e.type).join(" | ");return new r$({type:"union",schema:null,coercer(t,r){for(let n of e){let[e,i]=n.validate(t,{coerce:!0,mask:r.mask});if(!e)return i}return t},validator(r,n){let i=[];for(let t of e){let[...e]=rD(r,t,n),[a]=e;if(!a[0])return[];for(let[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${rF(r)}`,...i]}})}function r8(){return rJ("unknown",()=>!0)}function r9(e,t,r){return new r$({...e,coercer:(n,i)=>rV(n,t)[0]?e.coercer(n,i):e.coercer(r(n,i),i)})}e.i(826291);var r7=e.i(571650);let ne=r7.default;r7.default;r7.default;var nt=e.i(626014),nr=e.i(563488);rg.utils.randomPrivateKey;let nn=()=>{let e=rg.utils.randomPrivateKey(),t=ni(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),{publicKey:t,secretKey:r}},ni=rg.getPublicKey;function na(e){try{return rg.ExtendedPoint.fromHex(e),!0}catch{return!1}}let ns=(e,t)=>rg.sign(e,t.slice(0,32)),no=rg.verify,nu=e=>t2.Buffer.isBuffer(e)?e:e instanceof Uint8Array?t2.Buffer.from(e.buffer,e.byteOffset,e.byteLength):t2.Buffer.from(e);class nc{constructor(e){Object.assign(this,e)}encode(){return t2.Buffer.from((0,rj.serialize)(nl,this))}static decode(e){return(0,rj.deserialize)(nl,this,e)}static decodeUnchecked(e){return(0,rj.deserializeUnchecked)(nl,this,e)}}let nl=new Map,nd=1;class nf extends nc{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"==typeof e){const t=rP.default.decode(e);if(32!=t.length)throw Error("Invalid public key input");this._bn=new rT.default(t)}else this._bn=new rT.default(e);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let e=new nf(nd);return nd+=1,new nf(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return rP.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){let e=this._bn.toArrayLike(t2.Buffer);if(32===e.length)return e;let t=t2.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){let n=t2.Buffer.concat([e.toBuffer(),t2.Buffer.from(t),r.toBuffer()]);return new nf((0,rO.sha256)(n))}static createProgramAddressSync(e,t){let r=t2.Buffer.alloc(0);e.forEach(function(e){if(e.length>32)throw TypeError("Max seed length exceeded");r=t2.Buffer.concat([r,nu(e)])}),r=t2.Buffer.concat([r,t.toBuffer(),t2.Buffer.from("ProgramDerivedAddress")]);let n=(0,rO.sha256)(r);if(na(n))throw Error("Invalid seeds, address must fall off the curve");return new nf(n)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,n=255;for(;0!=n;){try{let i=e.concat(t2.Buffer.from([n]));r=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;n--;continue}return[r,n]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return na(new nf(e).toBytes())}}nf.default=new nf("11111111111111111111111111111111"),nl.set(nf,{kind:"struct",fields:[["_bn","u256"]]}),new nf("BPFLoader1111111111111111111111111111111111"),Object.defineProperty((class extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}).prototype,"name",{value:"TransactionExpiredBlockheightExceededError"}),Object.defineProperty((class extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}).prototype,"name",{value:"TransactionExpiredTimeoutError"}),Object.defineProperty((class extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}).prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class nh{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){let e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(let t of this.keySegments())if(e<t.length)return t[e];else e-=t.length}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw Error("Account index overflow encountered during compilation");let t=new Map;this.keySegments().flat().forEach((e,r)=>{t.set(e.toBase58(),r)});let r=e=>{let r=t.get(e.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return e.map(e=>({programIdIndex:r(e.programId),accountKeyIndexes:e.keys.map(e=>r(e.pubkey)),data:e.data}))}}let np=(e="publicKey")=>rR.blob(32,e),nm=(e="string")=>{let t=rR.struct([rR.u32("length"),rR.u32("lengthPadding"),rR.blob(rR.offset(rR.u32(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t);return t.decode=(e,t)=>r(e,t).chars.toString(),t.encode=(e,t,r)=>n({chars:t2.Buffer.from(e,"utf8")},t,r),t.alloc=e=>rR.u32().span+rR.u32().span+t2.Buffer.from(e,"utf8").length,t};function ng(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,(128&n)==0)break}return t}function ny(e,t){let r=t;for(;;){let t=127&r;if(0==(r>>=7)){e.push(t);break}t|=128,e.push(t)}}function nb(e,t){if(!e)throw Error(t||"Assertion failed")}class nv{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){let r=new Map,n=e=>{let t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},i=n(t);for(let t of(i.isSigner=!0,i.isWritable=!0,e))for(let e of(n(t.programId).isInvoked=!0,t.keys)){let t=n(e.pubkey);t.isSigner||=e.isSigner,t.isWritable||=e.isWritable}return new nv(t,r)}getMessageComponents(){let e=[...this.keyMetaMap.entries()];nb(e.length<=256,"Max static account keys length exceeded");let t=e.filter(([,e])=>e.isSigner&&e.isWritable),r=e.filter(([,e])=>e.isSigner&&!e.isWritable),n=e.filter(([,e])=>!e.isSigner&&e.isWritable),i=e.filter(([,e])=>!e.isSigner&&!e.isWritable),a={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{nb(t.length>0,"Expected at least one writable signer key");let[e]=t[0];nb(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[a,[...t.map(([e])=>new nf(e)),...r.map(([e])=>new nf(e)),...n.map(([e])=>new nf(e)),...i.map(([e])=>new nf(e))]]}extractTableLookup(e){let[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,e=>!e.isSigner&&!e.isInvoked&&e.isWritable),[n,i]=this.drainKeysFoundInLookupTable(e.state.addresses,e=>!e.isSigner&&!e.isInvoked&&!e.isWritable);if(0!==t.length||0!==n.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(e,t){let r=[],n=[];for(let[i,a]of this.keyMetaMap.entries())if(t(a)){let t=new nf(i),a=e.findIndex(e=>e.equals(t));a>=0&&(nb(a<256,"Max lookup table index exceeded"),r.push(a),n.push(t),this.keyMetaMap.delete(i))}return[r,n]}}let nw="Reached end of buffer unexpectedly";function nk(e){if(0===e.length)throw Error(nw);return e.shift()}function n_(e,...t){let[r]=t;if(2===t.length?r+(t[1]??0)>e.length:r>=e.length)throw Error(nw);return e.splice(...t)}class nx{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(e=>new nf(e)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:rP.default.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new nh(this.staticAccountKeys)}static compile(e){let[t,r]=nv.compile(e.instructions,e.payerKey).getMessageComponents(),n=new nh(r).compileInstructions(e.instructions).map(e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:rP.default.encode(e.data)}));return new nx({header:t,accountKeys:r,recentBlockhash:e.recentBlockhash,instructions:n})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures;if(!(e>=this.header.numRequiredSignatures))return e<t-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return e-t<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){let e=this.accountKeys.length,t=[];ny(t,e);let r=this.instructions.map(e=>{let{accounts:t,programIdIndex:r}=e,n=Array.from(rP.default.decode(e.data)),i=[];ny(i,t.length);let a=[];return ny(a,n.length),{programIdIndex:r,keyIndicesCount:t2.Buffer.from(i),keyIndices:t,dataLength:t2.Buffer.from(a),data:n}}),n=[];ny(n,r.length);let i=t2.Buffer.alloc(1232);t2.Buffer.from(n).copy(i);let a=n.length;r.forEach(e=>{let t=rR.struct([rR.u8("programIdIndex"),rR.blob(e.keyIndicesCount.length,"keyIndicesCount"),rR.seq(rR.u8("keyIndex"),e.keyIndices.length,"keyIndices"),rR.blob(e.dataLength.length,"dataLength"),rR.seq(rR.u8("userdatum"),e.data.length,"data")]).encode(e,i,a);a+=t}),i=i.slice(0,a);let s=rR.struct([rR.blob(1,"numRequiredSignatures"),rR.blob(1,"numReadonlySignedAccounts"),rR.blob(1,"numReadonlyUnsignedAccounts"),rR.blob(t.length,"keyCount"),rR.seq(np("key"),e,"keys"),np("recentBlockhash")]),o={numRequiredSignatures:t2.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:t2.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:t2.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:t2.Buffer.from(t),keys:this.accountKeys.map(e=>nu(e.toBytes())),recentBlockhash:rP.default.decode(this.recentBlockhash)},u=t2.Buffer.alloc(2048),c=s.encode(o,u);return i.copy(u,c),u.slice(0,c+i.length)}static from(e){let t=[...e],r=nk(t);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let n=nk(t),i=nk(t),a=ng(t),s=[];for(let e=0;e<a;e++){let e=n_(t,0,32);s.push(new nf(t2.Buffer.from(e)))}let o=n_(t,0,32),u=ng(t),c=[];for(let e=0;e<u;e++){let e=nk(t),r=ng(t),n=n_(t,0,r),i=ng(t),a=n_(t,0,i),s=rP.default.encode(t2.Buffer.from(a));c.push({programIdIndex:e,accounts:n,data:s})}return new nx({header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:rP.default.encode(t2.Buffer.from(o)),accountKeys:s,instructions:c})}}class nS{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(let t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new nh(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r)return e-r<this.addressTableLookups.reduce((e,t)=>e+t.writableIndexes.length,0);if(!(e>=this.header.numRequiredSignatures))return e<t-this.header.numReadonlySignedAccounts;{let n=r-t-this.header.numReadonlyUnsignedAccounts;return e-t<n}}resolveAddressTableLookups(e){let t={writable:[],readonly:[]};for(let r of this.addressTableLookups){let n=e.find(e=>e.key.equals(r.accountKey));if(!n)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let e of r.writableIndexes)if(e<n.state.addresses.length)t.writable.push(n.state.addresses[e]);else throw Error(`Failed to find address for index ${e} in address lookup table ${r.accountKey.toBase58()}`);for(let e of r.readonlyIndexes)if(e<n.state.addresses.length)t.readonly.push(n.state.addresses[e]);else throw Error(`Failed to find address for index ${e} in address lookup table ${r.accountKey.toBase58()}`)}return t}static compile(e){let t=nv.compile(e.instructions,e.payerKey),r=[],n={writable:[],readonly:[]};for(let i of e.addressLookupTableAccounts||[]){let e=t.extractTableLookup(i);if(void 0!==e){let[t,{writable:i,readonly:a}]=e;r.push(t),n.writable.push(...i),n.readonly.push(...a)}}let[i,a]=t.getMessageComponents(),s=new nh(a,n).compileInstructions(e.instructions);return new nS({header:i,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:s,addressTableLookups:r})}serialize(){let e=[];ny(e,this.staticAccountKeys.length);let t=this.serializeInstructions(),r=[];ny(r,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),i=[];ny(i,this.addressTableLookups.length);let a=rR.struct([rR.u8("prefix"),rR.struct([rR.u8("numRequiredSignatures"),rR.u8("numReadonlySignedAccounts"),rR.u8("numReadonlyUnsignedAccounts")],"header"),rR.blob(e.length,"staticAccountKeysLength"),rR.seq(np(),this.staticAccountKeys.length,"staticAccountKeys"),np("recentBlockhash"),rR.blob(r.length,"instructionsLength"),rR.blob(t.length,"serializedInstructions"),rR.blob(i.length,"addressTableLookupsLength"),rR.blob(n.length,"serializedAddressTableLookups")]),s=new Uint8Array(1232),o=a.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(e=>e.toBytes()),recentBlockhash:rP.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},s);return s.slice(0,o)}serializeInstructions(){let e=0,t=new Uint8Array(1232);for(let r of this.compiledInstructions){let n=[];ny(n,r.accountKeyIndexes.length);let i=[];ny(i,r.data.length);let a=rR.struct([rR.u8("programIdIndex"),rR.blob(n.length,"encodedAccountKeyIndexesLength"),rR.seq(rR.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),rR.blob(i.length,"encodedDataLength"),rR.blob(r.data.length,"data")]);e+=a.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0,t=new Uint8Array(1232);for(let r of this.addressTableLookups){let n=[];ny(n,r.writableIndexes.length);let i=[];ny(i,r.readonlyIndexes.length);let a=rR.struct([np("accountKey"),rR.blob(n.length,"encodedWritableIndexesLength"),rR.seq(rR.u8(),r.writableIndexes.length,"writableIndexes"),rR.blob(i.length,"encodedReadonlyIndexesLength"),rR.seq(rR.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=a.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e],r=nk(t),n=127&r;nb(r!==n,"Expected versioned message but received legacy message"),nb(0===n,`Expected versioned message with version 0 but found version ${n}`);let i={numRequiredSignatures:nk(t),numReadonlySignedAccounts:nk(t),numReadonlyUnsignedAccounts:nk(t)},a=[],s=ng(t);for(let e=0;e<s;e++)a.push(new nf(n_(t,0,32)));let o=rP.default.encode(n_(t,0,32)),u=ng(t),c=[];for(let e=0;e<u;e++){let e=nk(t),r=ng(t),n=n_(t,0,r),i=ng(t),a=new Uint8Array(n_(t,0,i));c.push({programIdIndex:e,accountKeyIndexes:n,data:a})}let l=ng(t),d=[];for(let e=0;e<l;e++){let e=new nf(n_(t,0,32)),r=ng(t),n=n_(t,0,r),i=ng(t),a=n_(t,0,i);d.push({accountKey:e,writableIndexes:n,readonlyIndexes:a})}return new nS({header:i,staticAccountKeys:a,recentBlockhash:o,compiledInstructions:c,addressTableLookups:d})}}let nE={deserializeMessageVersion(e){let t=e[0],r=127&t;return r===t?"legacy":r},deserialize:e=>{let t=nE.deserializeMessageVersion(e);if("legacy"===t)return nx.from(e);if(0===t)return nS.deserialize(e);throw Error(`Transaction message version ${t} deserialization is not supported`)}},nI=t2.Buffer.alloc(64).fill(0);class nA{constructor(e){this.keys=void 0,this.programId=void 0,this.data=t2.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class nB{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!e)return;if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(0===e.length)throw Error("No instructions");return e.forEach(e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new nA(e))}),this}compileMessage(){let e,t,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let e=0;e<t.length;e++)if(void 0===t[e].programId)throw Error(`Transaction instruction index ${e} has undefined program id`);let n=[],i=[];t.forEach(e=>{e.keys.forEach(e=>{i.push({...e})});let t=e.programId.toString();n.includes(t)||n.push(t)}),n.forEach(e=>{i.push({pubkey:new nf(e),isSigner:!1,isWritable:!1})});let a=[];i.forEach(e=>{let t=e.pubkey.toString(),r=a.findIndex(e=>e.pubkey.toString()===t);r>-1?(a[r].isWritable=a[r].isWritable||e.isWritable,a[r].isSigner=a[r].isSigner||e.isSigner):a.push(e)}),a.sort(function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let s=a.findIndex(e=>e.pubkey.equals(r));if(s>-1){let[e]=a.splice(s,1);e.isSigner=!0,e.isWritable=!0,a.unshift(e)}else a.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let e of this.signatures){let t=a.findIndex(t=>t.pubkey.equals(e.publicKey));if(t>-1)a[t].isSigner||(a[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${e.publicKey.toString()}`)}let o=0,u=0,c=0,l=[],d=[];a.forEach(({pubkey:e,isSigner:t,isWritable:r})=>{t?(l.push(e.toString()),o+=1,r||(u+=1)):(d.push(e.toString()),r||(c+=1))});let f=l.concat(d),h=t.map(e=>{let{data:t,programId:r}=e;return{programIdIndex:f.indexOf(r.toString()),accounts:e.keys.map(e=>f.indexOf(e.pubkey.toString())),data:rP.default.encode(t)}});return h.forEach(e=>{nb(e.programIdIndex>=0),e.accounts.forEach(e=>nb(e>=0))}),new nx({header:{numRequiredSignatures:o,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:c},accountKeys:f,recentBlockhash:e,instructions:h})}_compile(){let e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((e,r)=>t[r].equals(e.publicKey))?e:(this.signatures=t.map(e=>({signature:null,publicKey:e})),e)}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw Error("No signers");let t=new Set;this.signatures=e.filter(e=>{let r=e.toString();return!t.has(r)&&(t.add(r),!0)}).map(e=>({signature:null,publicKey:e}))}sign(...e){if(0===e.length)throw Error("No signers");let t=new Set,r=[];for(let n of e){let e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}this.signatures=r.map(e=>({signature:null,publicKey:e.publicKey}));let n=this._compile();this._partialSign(n,...r)}partialSign(...e){if(0===e.length)throw Error("No signers");let t=new Set,r=[];for(let n of e){let e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}let n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){let r=e.serialize();t.forEach(e=>{let t=ns(r,e.secretKey);this._addSignature(e.publicKey,nu(t))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){nb(64===t.length);let r=this.signatures.findIndex(t=>e.equals(t.publicKey));if(r<0)throw Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=t2.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){let r={};for(let{signature:n,publicKey:i}of this.signatures)null===n?t&&(r.missing||=[]).push(i):no(n,e,i.toBytes())||(r.invalid||=[]).push(i);return r.invalid||r.missing?r:void 0}serialize(e){let{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r){let e=this._getMessageSignednessErrors(n,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+=` 2Invalid signature for public key${1===e.invalid.length?"":"(s)"} [\`${e.invalid.map(e=>e.toBase58()).join("`, `")}\`].`),e.missing&&(t+=` 3Missing signature for public key${1===e.missing.length?"":"(s)"} [\`${e.missing.map(e=>e.toBase58()).join("`, `")}\`].`),Error(t)}}return this._serialize(n)}_serialize(e){let{signatures:t}=this,r=[];ny(r,t.length);let n=r.length+64*t.length+e.length,i=t2.Buffer.alloc(n);return nb(t.length<256),t2.Buffer.from(r).copy(i,0),t.forEach(({signature:e},t)=>{null!==e&&(nb(64===e.length,"signature has invalid length"),t2.Buffer.from(e).copy(i,r.length+64*t))}),e.copy(i,r.length+64*t.length),nb(i.length<=1232,`Transaction too large: ${i.length} > 1232`),i}get keys(){return nb(1===this.instructions.length),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return nb(1===this.instructions.length),this.instructions[0].programId}get data(){return nb(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e],r=ng(t),n=[];for(let e=0;e<r;e++){let e=n_(t,0,64);n.push(rP.default.encode(t2.Buffer.from(e)))}return nB.populate(nx.from(t),n)}static populate(e,t=[]){let r=new nB;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach((t,n)=>{let i={signature:t==rP.default.encode(nI)?null:rP.default.decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)}),e.instructions.forEach(t=>{let n=t.accounts.map(t=>{let n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some(e=>e.publicKey.toString()===n.toString())||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}});r.instructions.push(new nA({keys:n,programId:e.accountKeys[t.programIdIndex],data:rP.default.decode(t.data)}))}),r._message=e,r._json=r.toJSON(),r}}class nT{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,void 0!==t)nb(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{const t=[];for(let r=0;r<e.header.numRequiredSignatures;r++)t.push(new Uint8Array(64));this.signatures=t}this.message=e}serialize(){let e=this.message.serialize(),t=[];ny(t,this.signatures.length);let r=rR.struct([rR.blob(t.length,"encodedSignaturesLength"),rR.seq(((e="signature")=>rR.blob(64,e))(),this.signatures.length,"signatures"),rR.blob(e.length,"serializedMessage")]),n=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},n);return n.slice(0,i)}static deserialize(e){let t=[...e],r=[],n=ng(t);for(let e=0;e<n;e++)r.push(new Uint8Array(n_(t,0,64)));return new nT(nE.deserialize(new Uint8Array(t)),r)}sign(e){let t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let n of e){let e=r.findIndex(e=>e.equals(n.publicKey));nb(e>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[e]=ns(t,n.secretKey)}}addSignature(e,t){nb(64===t.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(t=>t.equals(e));nb(r>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=t}}let nP=new nf("SysvarC1ock11111111111111111111111111111111");new nf("SysvarEpochSchedu1e111111111111111111111111"),new nf("Sysvar1nstructions1111111111111111111111111");let nO=new nf("SysvarRecentB1ockHashes11111111111111111111"),nj=new nf("SysvarRent111111111111111111111111111111111");new nf("SysvarRewards111111111111111111111111111111"),new nf("SysvarS1otHashes111111111111111111111111111"),new nf("SysvarS1otHistory11111111111111111111111111");let nR=new nf("SysvarStakeHistory1111111111111111111111111");class nL extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:n}){let i;const a=n?`Logs: 4${JSON.stringify(n.slice(-10),null,2)}. `:"",s="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(e){case"send":i=`Transaction ${t} resulted in an error. 5${r}. `+a+s;break;case"simulate":i=`Simulation failed. 6Message: ${r}. 7`+a+s;break;default:i=`Unknown action '${(e=>e)(e)}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let e=this.transactionLogs;if(null==e||"object"!=typeof e||!("then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,r)=>{e.getTransaction(this.signature).then(e=>{if(e&&e.meta&&e.meta.logMessages){let r=e.meta.logMessages;this.transactionLogs=r,t(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}async function nC(e,t,r,n){let i,a=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},s=await e.sendTransaction(t,r,a);if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)i=(await e.confirmTransaction({abortSignal:n?.abortSignal,signature:s,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){let{nonceInstruction:r}=t.nonceInfo,a=r.keys[0].pubkey;i=(await e.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:a,nonceValue:t.nonceInfo.nonce,signature:s},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),i=(await e.confirmTransaction(s,n&&n.commitment)).value;if(i.err){if(null!=s)throw new nL({action:"send",signature:s,transactionMessage:`Status: (${JSON.stringify(i)})`});throw Error(`Transaction ${s} failed (${JSON.stringify(i)})`)}return s}function nN(e,t){let r=e.layout.span>=0?e.layout.span:function e(t,r){let n=t=>{if(t.span>=0)return t.span;if("function"==typeof t.alloc)return t.alloc(r[t.property]);if("count"in t&&"elementLayout"in t){let e=r[t.property];if(Array.isArray(e))return e.length*n(t.elementLayout)}else if("fields"in t)return e({layout:t},r[t.property]);return 0},i=0;return t.layout.fields.forEach(e=>{i+=n(e)}),i}(e,t),n=t2.Buffer.alloc(r),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,n),n}let nz=rR.nu64("lamportsPerSignature"),nU=rR.struct([rR.u32("version"),rR.u32("state"),np("authorizedPubkey"),np("nonce"),rR.struct([nz],"feeCalculator")]).span;function nZ(e){let t=(0,rR.blob)(8,e),r=t.decode.bind(t),n=t.encode.bind(t),i=((e={})=>(function(e,t){if(rN(e)!==rN(t))throw new rC(8078004);if(rN(e)&&rN(t)&&e.fixedSize!==t.fixedSize)throw new rC(8078005,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!rN(e)&&!rN(t)&&e.maxSize!==t.maxSize)throw new rC(8078006,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}})(((e={})=>{var t,r;return Object.freeze({...r={fixedSize:(t={config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,r)=>e.setBigUint64(0,BigInt(t),r),size:8}).size,write(e,r,n){t.range&&function(e,t,r,n){if(n<t||n>r)throw new rC(8078011,{codecDescription:e,max:r,min:t,value:n})}(t.name,t.range[0],t.range[1],e);let i=new ArrayBuffer(t.size);return t.set(new DataView(i),e,rU(t.config)),r.set(new Uint8Array(i),n),n+t.size}},encode:e=>{let t=new Uint8Array("fixedSize"in r?r.fixedSize:r.getSizeFromValue(e));return r.write(e,t,0),t}})})(e),((e={})=>{var t,r;return Object.freeze({...r={fixedSize:(t={config:e,get:(e,t)=>e.getBigUint64(0,t),name:"u64",size:8}).size,read(e,r=0){var n,i,a;let s,o;!function(e,t,r=0){if(t.length-r<=0)throw new rC(8078e3,{codecDescription:e})}(t.name,e,r),function(e,t,r,n=0){let i=r.length-n;if(i<t)throw new rC(8078001,{bytesLength:i,codecDescription:e,expected:t})}(t.name,t.size,e,r);let u=new DataView((n=e,i=r,a=t.size,s=n.byteOffset+(i??0),o=a??n.byteLength,n.buffer.slice(s,s+o)));return[t.get(u,rU(t.config)),r+t.size]}},decode:(e,t=0)=>r.read(e,t)[0]})})(e)))();return t.decode=(e,t)=>{let n=r(e,t);return i.decode(n)},t.encode=(e,t,r)=>n(i.encode(e),t,r),t}let nM=Object.freeze({Create:{index:0,layout:rR.struct([rR.u32("instruction"),rR.ns64("lamports"),rR.ns64("space"),np("programId")])},Assign:{index:1,layout:rR.struct([rR.u32("instruction"),np("programId")])},Transfer:{index:2,layout:rR.struct([rR.u32("instruction"),nZ("lamports")])},CreateWithSeed:{index:3,layout:rR.struct([rR.u32("instruction"),np("base"),nm("seed"),rR.ns64("lamports"),rR.ns64("space"),np("programId")])},AdvanceNonceAccount:{index:4,layout:rR.struct([rR.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:rR.struct([rR.u32("instruction"),rR.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:rR.struct([rR.u32("instruction"),np("authorized")])},AuthorizeNonceAccount:{index:7,layout:rR.struct([rR.u32("instruction"),np("authorized")])},Allocate:{index:8,layout:rR.struct([rR.u32("instruction"),rR.ns64("space")])},AllocateWithSeed:{index:9,layout:rR.struct([rR.u32("instruction"),np("base"),nm("seed"),rR.ns64("space"),np("programId")])},AssignWithSeed:{index:10,layout:rR.struct([rR.u32("instruction"),np("base"),nm("seed"),np("programId")])},TransferWithSeed:{index:11,layout:rR.struct([rR.u32("instruction"),nZ("lamports"),nm("seed"),np("programId")])},UpgradeNonceAccount:{index:12,layout:rR.struct([rR.u32("instruction")])}});class nW{static createAccount(e){let t=nN(nM.Create,{lamports:e.lamports,space:e.space,programId:nu(e.programId.toBuffer())});return new nA({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,r;return"basePubkey"in e?(t=nN(nM.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:nu(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=nN(nM.Transfer,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]),new nA({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;return"basePubkey"in e?(t=nN(nM.AssignWithSeed,{base:nu(e.basePubkey.toBuffer()),seed:e.seed,programId:nu(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=nN(nM.Assign,{programId:nu(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new nA({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){let t=nN(nM.CreateWithSeed,{base:nu(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:nu(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new nA({keys:r,programId:this.programId,data:t})}static createNonceAccount(e){let t=new nB;"basePubkey"in e&&"seed"in e?t.add(nW.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:nU,programId:this.programId})):t.add(nW.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:nU,programId:this.programId}));let r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){let t=nN(nM.InitializeNonceAccount,{authorized:nu(e.authorizedPubkey.toBuffer())});return new nA({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:nO,isSigner:!1,isWritable:!1},{pubkey:nj,isSigner:!1,isWritable:!1}],programId:this.programId,data:t})}static nonceAdvance(e){let t=nN(nM.AdvanceNonceAccount);return new nA({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:nO,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceWithdraw(e){let t=nN(nM.WithdrawNonceAccount,{lamports:e.lamports});return new nA({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:nO,isSigner:!1,isWritable:!1},{pubkey:nj,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){let t=nN(nM.AuthorizeNonceAccount,{authorized:nu(e.newAuthorizedPubkey.toBuffer())});return new nA({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,r;return"basePubkey"in e?(t=nN(nM.AllocateWithSeed,{base:nu(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:nu(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=nN(nM.Allocate,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new nA({keys:r,programId:this.programId,data:t})}}nW.programId=new nf("11111111111111111111111111111111");class nF{static getMinNumSignatures(e){return 2*(Math.ceil(e/nF.chunkSize)+1+1)}static async load(e,t,r,n,i){{let a=await e.getMinimumBalanceForRentExemption(i.length),s=await e.getAccountInfo(r.publicKey,"confirmed"),o=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(o=o||new nB).add(nW.allocate({accountPubkey:r.publicKey,space:i.length})),s.owner.equals(n)||(o=o||new nB).add(nW.assign({accountPubkey:r.publicKey,programId:n})),s.lamports<a&&(o=o||new nB).add(nW.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:a-s.lamports}))}else o=new nB().add(nW.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:a>0?a:1,space:i.length,programId:n}));null!==o&&await nC(e,o,[t,r],{commitment:"confirmed"})}let a=rR.struct([rR.u32("instruction"),rR.u32("offset"),rR.u32("bytesLength"),rR.u32("bytesLengthPadding"),rR.seq(rR.u8("byte"),rR.offset(rR.u32(),-8),"bytes")]),s=nF.chunkSize,o=0,u=i,c=[];for(;u.length>0;){let i=u.slice(0,s),l=t2.Buffer.alloc(s+16);a.encode({instruction:0,offset:o,bytes:i,bytesLength:0,bytesLengthPadding:0},l);let d=new nB().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:l});c.push(nC(e,d,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await new Promise(e=>setTimeout(e,250)),o+=s,u=u.slice(s)}await Promise.all(c);{let i=rR.struct([rR.u32("instruction")]),a=t2.Buffer.alloc(i.span);i.encode({instruction:1},a);let s=new nB().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:nj,isSigner:!1,isWritable:!1}],programId:n,data:a}),o="processed",u=await e.sendTransaction(s,[t,r],{preflightCommitment:o}),{context:c,value:l}=await e.confirmTransaction({signature:u,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},o);if(l.err)throw Error(`Transaction ${u} failed (${JSON.stringify(l)})`);for(;;){try{if(await e.getSlot({commitment:o})>c.slot)break}catch{}await new Promise(e=>setTimeout(e,Math.round(200)))}}return!0}}nF.chunkSize=932,new nf("BPFLoader2111111111111111111111111111111111"),rR.struct([rR.u32("typeIndex"),nZ("deactivationSlot"),rR.nu64("lastExtendedSlot"),rR.u8("lastExtendedStartIndex"),rR.u8(
7),rR.seq(np(),rR.offset(rR.u8(),-1),"authority")]);let nK=r9(rY(nf),r6(),e=>new nf(e)),nD=r4([r6(),rX("base64")]),n$=r9(rY(t2.Buffer),nD,e=>t2.Buffer.from(e[0],"base64"));function nq(e){return r3([r5({jsonrpc:rX("2.0"),id:r6(),result:e}),r5({jsonrpc:rX("2.0"),id:r6(),error:r5({code:r8(),message:r6(),data:r1(rJ("any",()=>!0))})})])}let nV=nq(r8());function nJ(e){return r9(nq(e),nV,t=>"error"in t?t:{...t,result:rq(t.result,e)})}function nH(e){return nJ(r5({context:r5({slot:r0()}),value:e}))}function nG(e){return r5({context:r5({slot:r0()}),value:e})}let nY=r5({foundation:r0(),foundationTerm:r0(),initial:r0(),taper:r0(),terminal:r0()});nJ(rH(rQ(r5({epoch:r0(),effectiveSlot:r0(),amount:r0(),postBalance:r0(),commission:r1(rQ(r0()))}))));let nX=rH(r5({slot:r0(),prioritizationFee:r0()})),nQ=r5({total:r0(),validator:r0(),foundation:r0(),epoch:r0()}),n0=r5({epoch:r0(),slotIndex:r0(),slotsInEpoch:r0(),absoluteSlot:r0(),blockHeight:r1(r0()),transactionCount:r1(r0())}),n1=r5({slotsPerEpoch:r0(),leaderScheduleSlotOffset:r0(),warmup:rG(),firstNormalEpoch:r0(),firstNormalSlot:r0()}),n2=r2(r6(),rH(r0())),n6=rQ(r3([r5({}),r6()])),n4=r5({err:n6}),n5=rX("receivedSignature");r5({"solana-core":r6(),"feature-set":r1(r0())});let n3=r5({program:r6(),programId:nK,parsed:r8()}),n8=r5({programId:nK,accounts:rH(nK),data:r6()});nH(r5({err:rQ(r3([r5({}),r6()])),logs:rQ(rH(r6())),accounts:r1(rQ(rH(rQ(r5({executable:rG(),owner:r6(),lamports:r0(),data:rH(r6()),rentEpoch:r1(r0())}))))),unitsConsumed:r1(r0()),returnData:r1(rQ(r5({programId:r6(),data:r4([r6(),rX("base64")])}))),innerInstructions:r1(rQ(rH(r5({index:r0(),instructions:rH(r3([n3,n8]))}))))})),nH(r5({byIdentity:r2(r6(),rH(r0())),range:r5({firstSlot:r0(),lastSlot:r0()})})),nJ(nY),nJ(nQ),nJ(nX),nJ(n0),nJ(n1),nJ(n2),nJ(r0()),nH(r5({total:r0(),circulating:r0(),nonCirculating:r0(),nonCirculatingAccounts:rH(nK)}));let n9=r5({amount:r6(),uiAmount:rQ(r0()),decimals:r0(),uiAmountString:r1(r6())});nH(rH(r5({address:nK,amount:r6(),uiAmount:rQ(r0()),decimals:r0(),uiAmountString:r1(r6())}))),nH(rH(r5({pubkey:nK,account:r5({executable:rG(),owner:nK,lamports:r0(),data:n$,rentEpoch:r0()})})));let n7=r5({program:r6(),parsed:r8(),space:r0()});nH(rH(r5({pubkey:nK,account:r5({executable:rG(),owner:nK,lamports:r0(),data:n7,rentEpoch:r0()})}))),nH(rH(r5({lamports:r0(),address:nK})));let ie=r5({executable:rG(),owner:nK,lamports:r0(),data:n$,rentEpoch:r0()});r5({pubkey:nK,account:ie});
7let it=r9(r3([rY(t2.Buffer),n7]),r3([nD,n7]),e=>Array.isArray(e)?rq(e,n$):e),ir=r5({executable:rG(),owner:nK,lamports:r0(),data:it,rentEpoch:r0()});r5({pubkey:nK,account:ir}),r5({state:r3([rX("active"),rX("inactive"),rX("activating"),rX("deactivating")]),active:r0(),inactive:r0()}),nJ(rH(r5({signature:r6(),slot:r0(),err:n6,memo:rQ(r6()),blockTime:r1(rQ(r0()))}))),nJ(rH(r5({signature:r6(),slot:r0(),err:n6,memo:rQ(r6()),blockTime:r1(rQ(r0()))}))),r5({subscription:r0(),result:nG(ie)});let ii=r5({pubkey:nK,account:ie});r5({subscription:r0(),result:nG(ii)});let ia=r5({parent:r0(),slot:r0(),root:r0()});r5({subscription:r0(),result:ia});let is=r3([r5({type:r3([rX("firstShredReceived"),rX("completed"),rX("optimisticConfirmation"),rX("root")]),slot:r0(),timestamp:r0()}),r5({type:rX("createdBank"),parent:r0(),slot:r0(),timestamp:r0()}),r5({type:rX("frozen"),slot:r0(),timestamp:r0(),stats:r5({numTransactionEntries:r0(),numSuccessfulTransactions:r0(),numFailedTransactions:r0(),maxTransactionsPerEntry:r0()})}),r5({type:rX("dead"),slot:r0(),timestamp:r0(),err:r6()})]);r5({subscription:r0(),result:is}),r5({subscription:r0(),result:nG(r3([n4,n5]))}),r5({subscription:r0(),result:r0()}),r5({pubkey:r6(),gossip:rQ(r6()),tpu:rQ(r6()),rpc:rQ(r6()),version:rQ(r6())});let io=r5({votePubkey:r6(),nodePubkey:r6(),activatedStake:r0(),epochVoteAccount:rG(),epochCredits:rH(r4([r0(),r0(),r0()])),commission:r0(),lastVote:r0(),rootSlot:rQ(r0())});nJ(r5({current:rH(io),delinquent:rH(io)}));let iu=r3([rX("processed"),rX("confirmed"),rX("finalized")]),ic=r5({slot:r0(),confirmations:rQ(r0()),err:n6,confirmationStatus:r1(iu)});nH(rH(rQ(ic))),nJ(r0());let il=r5({accountKey:nK,writableIndexes:rH(r0()),readonlyIndexes:rH(r0())}),id=r5({signatures:rH(r6()),message:r5({accountKeys:rH(r6()),header:r5({numRequiredSignatures:r0(),numReadonlySignedAccounts:r0(),numReadonlyUnsignedAccounts:r0()}),instructions:rH(r5({accounts:rH(r0()),data:r6(),programIdIndex:r0()})),recentBlockhash:r6(),addressTableLookups:r1(rH(il))})}),ih=r5({pubkey:nK,signer:rG(),writable:rG(),source:r1(r3([rX("transaction"),rX("lookupTable")]))}),ip=r5({accountKeys:rH(ih),signatures:rH(r6())}),im=r5({parsed:r8(),program:r6(),programId:nK}),ig=r5({accounts:rH(nK),data:r6(),programId:nK}),iy=r9(r3([ig,im]),r3([r5({parsed:r8(),program:r6(),programId:r6()}),r5({accounts:rH(r6()),data:r6(),programId:r6()})]),e=>"accounts"in e?rq(e,ig):rq(e,im)),ib=r5({signatures:rH(r6()),message:r5({accountKeys:rH(ih),instructions:rH(iy),recentBlockhash:r6(),addressTableLookups:r1(rQ(rH(il)))})}),iv=r5({accountIndex:r0(),mint:r6(),owner:r1(r6()),programId:r1(r6()),uiTokenAmount:n9}),iw=r5({writable:rH(nK),readonly:rH(nK)}),ik=r5({err:n6,fee:r0(),innerInstructions:r1(rQ(rH(r5({index:r0(),instructions:rH(r5({accounts:rH(r0()),data:r6(),programIdIndex:r0()}))})))),preBalances:rH(r0()),postBalances:rH(r0()),logMessages:r1(rQ(rH(r6()))),preTokenBalances:r1(rQ(rH(iv))),postTokenBalances:r1(rQ(rH(iv))),loadedAddresses:r1(iw),computeUnitsConsumed:r1(r0()),costUnits:r1(r0())}),i_=r5({err:n6,fee:r0(),innerInstructions:r1(rQ(rH(r5({index:r0(),instructions:rH(iy)})))),preBalances:rH(r0()),postBalances:rH(r0()),logMessages:r1(rQ(rH(r6()))),preTokenBalances:r1(rQ(rH(iv))),postTokenBalances:r1(rQ(rH(iv))),loadedAddresses:r1(iw),computeUnitsConsumed:r1(r0()),costUnits:r1(r0())}),ix=r3([rX(0),rX("legacy")]),iS=r5({pubkey:r6(),lamports:r0(),postBalance:rQ(r0()),rewardType:rQ(r6()),commission:r1(rQ(r0()))});nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),transactions:rH(r5({transaction:id,meta:rQ(ik),version:r1(ix)})),rewards:r1(rH(iS)),blockTime:rQ(r0()),blockHeight:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),rewards:r1(rH(iS)),blockTime:rQ(r0()),blockHeight:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),transactions:rH(r5({transaction:ip,meta:rQ(ik),version:r1(ix)})),rewards:r1(rH(iS)),blockTime:rQ(r0()),blockHeight:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),transactions:rH(r5({transaction:ib,meta:rQ(i_),version:r1(ix)})),rewards:r1(rH(iS)),blockTime:rQ(r0()),blockHeight:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),transactions:rH(r5({transaction:ip,meta:rQ(i_),version:r1(ix)})),rewards:r1(rH(iS)),blockTime:rQ(r0()),blockHeight:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),rewards:r1(rH(iS)),blockTime:rQ(r0()),blockHeight:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),transactions:rH(r5({transaction:id,meta:rQ(ik)})),rewards:r1(rH(iS)),blockTime:rQ(r0())}))),nJ(rQ(r5({blockhash:r6(),previousBlockhash:r6(),parentSlot:r0(),signatures:rH(r6()),blockTime:rQ(r0())}))),nJ(rQ(r5({slot:r0(),meta:rQ(ik),blockTime:r1(rQ(r0())),transaction:id,version:r1(ix)}))),nJ(rQ(r5({slot:r0(),transaction:ib,meta:rQ(i_),blockTime:r1(rQ(r0())),version:r1(ix)}
vendor: 14,418 bytes, line 7
7))),nH(r5({blockhash:r6(),lastValidBlockHeight:r0()})),nH(rG()),nJ(rH(r5({slot:r0(),numTransactions:r0(),numSlots:r0(),samplePeriodSecs:r0()}))),nH(rQ(r5({feeCalculator:r5({lamportsPerSignature:r0()})}))),nJ(r6()),nJ(r6());let iE=r5({err:n6,logs:rH(r6()),signature:r6()});r5({result:nG(iE),subscription:r0()});class iI{constructor(e){this._keypair=void 0,this._keypair=e??nn()}static generate(){return new iI(nn())}static fromSecretKey(e,t){if(64!==e.byteLength)throw Error("bad secret key size");let r=e.slice(32,64);if(!t||!t.skipValidation){let t=ni(e.slice(0,32));for(let e=0;e<32;e++)if(r[e]!==t[e])throw Error("provided secretKey is invalid")}return new iI({publicKey:r,secretKey:e})}static fromSeed(e){let t=ni(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new iI({publicKey:t,secretKey:r})}get publicKey(){return new nf(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:rR.struct([rR.u32("instruction"),nZ("recentSlot"),rR.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:rR.struct([rR.u32("instruction")])},ExtendLookupTable:{index:2,layout:rR.struct([rR.u32("instruction"),nZ(),rR.seq(np(),rR.offset(rR.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:rR.struct([rR.u32("instruction")])},CloseLookupTable:{index:4,layout:rR.struct([rR.u32("instruction")])}}),new nf("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:rR.struct([rR.u8("instruction"),rR.u32("units"),rR.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:rR.struct([rR.u8("instruction"),rR.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:rR.struct([rR.u8("instruction"),rR.u32("units")])},SetComputeUnitPrice:{index:3,layout:rR.struct([rR.u8("instruction"),nZ("microLamports")])}}),new nf("ComputeBudget111111111111111111111111111111");let iA=rR.struct([rR.u8("numSignatures"),rR.u8("padding"),rR.u16("signatureOffset"),rR.u16("signatureInstructionIndex"),rR.u16("publicKeyOffset"),rR.u16("publicKeyInstructionIndex"),rR.u16("messageDataOffset"),rR.u16("messageDataSize"),rR.u16("messageInstructionIndex")]);class iB{static createInstructionWithPublicKey(e){let{publicKey:t,message:r,signature:n,instructionIndex:i}=e;nb(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),nb(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);let a=iA.span,s=a+t.length,o=s+n.length,u=t2.Buffer.alloc(o+r.length),c=null==i?65535:i;return iA.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:c,publicKeyOffset:a,publicKeyInstructionIndex:c,messageDataOffset:o,messageDataSize:r.length,messageInstructionIndex:c},u),u.fill(t,a),u.fill(n,s),u.fill(r,o),new nA({keys:[],programId:iB.programId,data:u})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:r,instructionIndex:n}=e;nb(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{let e=iI.fromSecretKey(t),i=e.publicKey.toBytes(),a=ns(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:a,instructionIndex:n})}catch(e){throw Error(`Error creating instruction; ${e}`)}}}iB.programId=new nf("Ed25519SigVerify111111111111111111111111111"),nr.secp256k1.utils.isValidPrivateKey;let iT=nr.secp256k1.getPublicKey,iP=rR.struct([rR.u8("numSignatures"),rR.u16("signatureOffset"),rR.u8("signatureInstructionIndex"),rR.u16("ethAddressOffset"),rR.u8("ethAddressInstructionIndex"),rR.u16("messageDataOffset"),rR.u16("messageDataSize"),rR.u8("messageInstructionIndex"),rR.blob(20,"ethAddress"),rR.blob(64,"signature"),rR.u8("recoveryId")]);class iO{static publicKeyToEthAddress(e){nb(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return t2.Buffer.from((0,nt.keccak_256)(nu(e))).slice(-20)}catch(e){throw Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(e){let{publicKey:t,message:r,signature:n,recoveryId:i,instructionIndex:a}=e;return iO.createInstructionWithEthAddress({ethAddress:iO.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:i,instructionIndex:a})}static createInstructionWithEthAddress(e){let t,{ethAddress:r,message:n,signature:i,recoveryId:a,instructionIndex:s=0}=e;nb(20===(t="string"==typeof r?r.startsWith("0x")?t2.Buffer.from(r.substr(2),"hex"):t2.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${t.length} bytes`);let o=12+t.length,u=o+i.length+1,c=t2.Buffer.alloc(iP.span+n.length);return iP.encode({numSignatures:1,signatureOffset:o,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:n.length,messageInstructionIndex:s,signature:nu(i),ethAddress:nu(t),recoveryId:a},c),c.fill(nu(n),iP.span),new nA({keys:[],programId:iO.programId,data:c})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:r,instructionIndex:n}=e;nb(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{var i;let e,a=nu(t),s=iT(a,!1).slice(1),[o,u]=(i=t2.Buffer.from((0,nt.keccak_256)(nu(r))),[(e=nr.secp256k1.sign(i,a)).toCompactRawBytes(),e.recovery]);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:o,recoveryId:u,instructionIndex:n})}catch(e){throw Error(`Error creating instruction; ${e}`)}}}iO.programId=new nf("KeccakSecp256k11111111111111111111111111111");let ij=new nf("StakeConfig11111111111111111111111111111111");class iR{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}iR.default=new iR(0,0,nf.default);let iL=Object.freeze({Initialize:{index:0,layout:rR.struct([rR.u32("instruction"),((e="authorized")=>rR.struct([np("staker"),np("withdrawer")],e))(),((e="lockup")=>rR.struct([rR.ns64("unixTimestamp"),rR.ns64("epoch"),np("custodian")],e))()])},Authorize:{index:1,layout:rR.struct([rR.u32("instruction"),np("newAuthorized"),rR.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:rR.struct([rR.u32("instruction")])},Split:{index:3,layout:rR.struct([rR.u32("instruction"),rR.ns64("lamports")])},Withdraw:{index:4,layout:rR.struct([rR.u32("instruction"),rR.ns64("lamports")])},Deactivate:{index:5,layout:rR.struct([rR.u32("instruction")])},Merge:{index:7,layout:rR.struct([rR.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:rR.struct([rR.u32("instruction"),np("newAuthorized"),rR.u32("stakeAuthorizationType"),nm("authoritySeed"),np("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class iC{static initialize(e){let{stakePubkey:t,authorized:r,lockup:n}=e,i=n||iR.default,a=nN(iL.Initialize,{authorized:{staker:nu(r.staker.toBuffer()),withdrawer:nu(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:nu(i.custodian.toBuffer())}});return new nA({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:nj,isSigner:!1,isWritable:!1}],programId:this.programId,data:a})}static createAccountWithSeed(e){let t=new nB;t.add(nW.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(e){let t=new nB;t.add(nW.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(e){let{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,i=nN(iL.Delegate);return new nB().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:nR,isSigner:!1,isWritable:!1},{pubkey:ij,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){let{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:a}=e,s=nN(iL.Authorize,{newAuthorized:nu(n.toBuffer()),stakeAuthorizationType:i.index}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:nP,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return a&&o.push({pubkey:a,isSigner:!0,isWritable:!1}),new nB().add({keys:o,programId:this.programId,data:s})}static authorizeWithSeed(e){let{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:a,stakeAuthorizationType:s,custodianPubkey:o}=e,u=nN(iL.AuthorizeWithSeed,{newAuthorized:nu(a.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:nu(i.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:nP,isSigner:!1,isWritable:!1}];return o&&c.push({pubkey:o,isSigner:!0,isWritable:!1}),new nB().add({keys:c,programId:this.programId,data:u})}static splitInstruction(e){let{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=e,a=nN(iL.Split,{lamports:i});return new nA({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static split(e,t){let r=new nB;return r.add(nW.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){let{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,basePubkey:a,seed:s,lamports:o}=e,u=new nB;return u.add(nW.allocate({accountPubkey:i,basePubkey:a,seed:s,space:this.space,programId:this.programId})),t&&t>0&&u.add(nW.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,lamports:o}))}static merge(e){let{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,i=nN(iL.Merge);return new nB().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:nR,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){let{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:a}=e,s=nN(iL.Withdraw,{lamports:i}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:nR,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return a&&o.push({pubkey:a,isSigner:!0,isWritable:!1}),new nB().add({keys:o,programId:this.programId,data:s})}static deactivate(e){let{stakePubkey:t,authorizedPubkey:r}=e,n=nN(iL.Deactivate);return new nB().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}iC.programId=new nf("Stake11111111111111111111111111111111111111"),iC.space=200;let iN=Object.freeze({InitializeAccount:{index:0,layout:rR.struct([rR.u32("instruction"),((e="voteInit")=>rR.struct([np("nodePubkey"),np("authorizedVoter"),np("authorizedWithdrawer"),rR.u8("commission")],e))()])},Authorize:{index:1,layout:rR.struct([rR.u32("instruction"),np("newAuthorized"),rR.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:rR.struct([rR.u32("instruction"),rR.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:rR.struct([rR.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:rR.struct([rR.u32("instruction"),((e="voteAuthorizeWithSeedArgs")=>rR.struct([rR.u32("voteAuthorizationType"),np("currentAuthorityDerivedKeyOwnerPubkey"),nm("currentAuthorityDerivedKeySeed"),np("newAuthorized")],e))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class iz{static initializeAccount(e){let{votePubkey:t,nodePubkey:r,voteInit:n}=e,i=nN(iN.InitializeAccount,{voteInit:{nodePubkey:nu(n.nodePubkey.toBuffer()),authorizedVoter:nu(n.authorizedVoter.toBuffer()),authorizedWithdrawer:nu(n.authorizedWithdrawer.toBuffer()),commission:n.commission}});return new nA({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:nj,isSigner:!1,isWritable:!1},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static createAccount(e){let t=new nB;return t.add(nW.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){let{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=e,a=nN(iN.Authorize,{newAuthorized:nu(n.toBuffer()),voteAuthorizationType:i.index});return new nB().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static authorizeWithSeed(e){let{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:i,voteAuthorizationType:a,votePubkey:s}=e,o=nN(iN.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:nu(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:nu(i.toBuffer()),voteAuthorizationType:a.index}});return new nB().add({keys:[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:nP,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){let{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=e,a=nN(iN.Withdraw,{lamports:n});return new nB().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw Error("Withdraw will leave vote account with insufficient funds.");return iz.withdraw(e)}static updateValidatorIdentity(e){let{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:n}=e,i=nN(iN.UpdateValidatorIdentity);return new nB().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}iz.programId=new nf("Vote111111111111111111111111111111111111111"),iz.space=3762,new nf("Va1idator1nfo111111111111111111111111111111"),r5({name:r6(),website:r1(r
76()),details:r1(r6()),iconUrl:r1(r6()),keybaseUsername:r1(r6())}),new nf("Vote111111111111111111111111111111111111111"),rR.struct([np("nodePubkey"),np("authorizedWithdrawer"),rR.u8("commission"),rR.nu64(),rR.seq(rR.struct([rR.nu64("slot"),rR.u32("confirmationCount")]),rR.offset(rR.u32(),-8),"votes"),rR.u8("rootSlotValid"),rR.nu64("rootSlot"),rR.nu64(),rR.seq(rR.struct([rR.nu64("epoch"),np("authorizedVoter")]),rR.offset(rR.u32(),-8),"authorizedVoters"),rR.struct([rR.seq(rR.struct([np("authorizedPubkey"),rR.nu64("epochOfLastAuthorizedSwitch"),rR.nu64("targetEpoch")]),32,"buf"),rR.nu64("idx"),rR.u8("isEmpty")],"priorVoters"),rR.nu64(),rR.seq(rR.struct([rR.nu64("epoch"),rR.nu64("credits"),rR.nu64("prevCredits")]),rR.offset(rR.u32(),-8),"epochCredits"),rR.struct([rR.nu64("slot"),rR.nu64("timestamp")],"lastTimestamp")]);var iU=e.i(802163);function iZ(e){return iU.Buffer.from(e.serialize({verifySignatures:!1})).toString("base64")}class iM extends Error{name="BaseError";cause;constructor(e,t={}){super(e,t.cause?{cause:t.cause}:void 0),this.cause=t.cause}}e.s(["InvalidDomainManifest",0,class extends iM{name="AddMiniApp.InvalidDomainManifest";constructor(){super("Invalid domain manifest")}},"RejectedByUser",0,class extends iM{name="AddMiniApp.RejectedByUser";constructor(){super("Add miniapp rejected by user")}}],349833);var iW=e.i(349833),iW=iW;e.s(["RejectedByUser",0,class extends iM{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}}],497627);var iF=e.i(497627),iF=iF;e.s(["GenericError",0,class extends iM{name="SignManifest.GenericError";constructor(e="Manifest signing failed"){super(e)}},"InvalidDomain",0,class extends iM{name="SignManifest.InvalidDomain";constructor(){super("Invalid domain provided")}},"RejectedByUser",0,class extends iM{name="SignManifest.RejectedByUser";constructor(){super("Sign manifest rejected by user")}}],174674);var iK=e.i(174674),iK=iK;e.i(785373);var iD=e.i(50158);class i$ extends Error{constructor(e,t={}){const r=(()=>{if(t.cause instanceof i$){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause?.message?t.cause.message:t.details})(),n=t.cause instanceof i$&&t.cause.docsPath||t.docsPath,i=`https://oxlib.sh${n??""}`;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||n?["",r?`Details: ${r}`:void 0,n?`See: ${i}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"[email protected]"}),this.cause=t.cause,this.details=r,this.docs=i,this.docsPath=n,this.shortMessage=e}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}function iq(e,t={}){let{raw:r=!1}=t;if(r)return e;if(e.error){let{code:t}=e.error;throw new(t===i4.code?i4:t===iJ.code?iJ:t===i6.code?i6:t===i1.code?i1:t===iQ.code?iQ:t===i2.code?i2:t===iX.code?iX:t===i5.code?i5:t===iH.code?iH:t===iG.code?iG:t===iY.code?iY:t===i0.code?i0:iV)(e.error)}return e.result}class iV extends Error{constructor(e){const{code:t,message:r,data:n}=e;super(r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t,this.data=n}}class iJ extends iV{constructor(e={}){super({message:"Missing or invalid parameters.",...e,code:iJ.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidInputError"})}}Object.defineProperty(iJ,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class iH extends iV{constructor(e={}){super({message:"Requested resource not found.",...e,code:iH.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceNotFoundError"})}}Object.defineProperty(iH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class iG extends iV{constructor(e={}){super({message:"Requested resource not available.",...e,code:iG.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceUnavailableError"})}}Object.defineProperty(iG,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class iY extends iV{constructor(e={}){super({message:"Transaction creation failed.",...e,code:iY.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.TransactionRejectedError"})}}Object.defineProperty(iY,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class iX extends iV{constructor(e={}){super({message:"Method is not implemented.",...e,code:iX.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotSupportedError"})}}Object.defineProperty(iX,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class iQ extends iV{constructor(e={}){super({message:"Rate limit exceeded.",...e,code:iQ.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.LimitExceededError"})}}Object.defineProperty(iQ,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class i0 extends iV{constructor(e={}){super({message:"JSON-RPC version not supported.",...e,code:i0.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.VersionNotSupportedError"})}}Object.defineProperty(i0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class i1 extends iV{constructor(e={}){super({message:"Input is not a valid JSON-RPC request.",...e,code:i1.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidRequestError"})}}Object.defineProperty(i1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class i2 extends iV{constructor(e={}){super({message:"Method does not exist.",...e,code:i2.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotFoundError"})}}Object.defineProperty(i2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class i6 extends iV{constructor(e={}){super({message:"Invalid method parameters.",...e,code:i6.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidParamsError"})}}Object.defineProperty(i6,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class i4 extends iV{constructor(e={}){super({message:"Internal JSON-RPC error.",...e,code:i4.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalErrorError"})}}Object.defineProperty(i4,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class i5 extends iV{constructor(e={}){super({message:"Failed to parse JSON-RPC response.",...e,code:i5.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ParseError"})}}Object.defineProperty(i5,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});
7class i3 extends Error{constructor(e,t){super(t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=t}}class i8 extends i3{constructor({message:e="The user rejected the request."}={}){super(4001,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}}Object.defineProperty(i8,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class i9 extends i3{constructor({message:e="The requested method and/or account has not been authorized by the user."}={}){super(4100,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}}Object.defineProperty(i9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class i7 extends i3{constructor({message:e="The provider does not support the requested method."}={}){super(4200,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}}Object.defineProperty(i7,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ae extends i3{constructor({message:e="The provider is disconnected from all chains."}={}){super(4900,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}}Object.defineProperty(ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class at extends i3{constructor({message:e="The provider is not connected to the requested chain."}={}){super(4901,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}}Object.defineProperty(at,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ar extends i${constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}}let an=Symbol("Comlink.proxy"),ai=Symbol("Comlink.endpoint"),aa=Symbol("Comlink.releaseProxy"),as=Symbol("Comlink.finalizer"),ao=Symbol("Comlink.thrown"),au=e=>"object"==typeof e&&null!==e||"function"==typeof e,ac=new Map([["proxy",{canHandle:e=>au(e)&&e[an],serialize(e){let{port1:t,port2:r}=new MessageChannel;return function e(t,r=globalThis,n=["*"]){r.addEventListener("message",function i(a){let s;if(!a||!a.data)return;if(!function(e,t){for(let r of e)if(t===r||"*"===r||r instanceof RegExp&&r.test(t))return!0;return!1}(n,a.origin))return void console.warn(`Invalid origin '${a.origin}' for comlink proxy`);let{id:o,type:u,path:c}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(av);try{var d,f,h;let r=c.slice(0,-1).reduce((e,t)=>e[t],t),n=c.reduce((e,t)=>e[t],t);switch(u){case"GET":s=n;break;case"SET":r[c.slice(-1)[0]]=av(a.data.value),s=!0;break;case"APPLY":s=n.apply(r,l);break;case"CONSTRUCT":d=new n(...l),s=Object.assign(d,{[an]:!0});break;case"ENDPOINT":{let{port1:r,port2:n}=new MessageChannel;e(t,n),f=r,h=[r],ay.set(f,h),s=f}break;case"RELEASE":s=void 0;break;default:return}}catch(e){s={value:e,[ao]:0}}Promise.resolve(s).catch(e=>({value:e,[ao]:0})).then(e=>{let[n,a]=ab(e);r.postMessage(Object.assign(Object.assign({},n),{id:o}),a),"RELEASE"===u&&(r.removeEventListener("message",i),al(r),as in t&&"function"==typeof t[as]&&t[as]())}).catch(e=>{let[t,n]=ab({value:TypeError("Unserializable return value"),[ao]:0});r.postMessage(Object.assign(Object.assign({},t),{id:o}),n)})}),r.start&&r.start()}(e,t),[r,[r]]},deserialize:e=>(e.start(),ad(e))}],["throw",{canHandle:e=>au(e)&&ao in e,serialize:({value:e})=>[e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[]],deserialize(e){if(e.isError)throw Object.assign(Error(e.value.message),e.value);throw e.value}}]]);function al(e){"MessagePort"===e.constructor.name&&e.close()}function ad(e,t){let r=new Map;return e.addEventListener("message",function(e){let{data:t}=e;if(!t||!t.id)return;let n=r.get(t.id);if(n)try{n(t)}finally{r.delete(t.id)}}),function e(t,r,n=[],i=function(){}){let a,s=!1,o=new Proxy(i,{get(i,a){if(af(s),a===aa)return()=>{am&&am.unregister(o),ah(t),r.clear(),s=!0};if("then"===a){if(0===n.length)return{then:()=>o};let e=aw(t,r,{type:"GET",path:n.map(e=>e.toString())}).then(av);return e.then.bind(e)}return e(t,r,[...n,a])},set(e,i,a){af(s);let[o,u]=ab(a);return aw(t,r,{type:"SET",path:[...n,i].map(e=>e.toString()),value:o},u).then(av)},apply(i,a,o){af(s);let u=n[n.length-1];if(u===ai)return aw(t,r,{type:"ENDPOINT"}).then(av);if("bind"===u)return e(t,r,n.slice(0,-1));let[c,l]=ag(o);
7return aw(t,r,{type:"APPLY",path:n.map(e=>e.toString()),argumentList:c},l).then(av)},construct(e,i){af(s);let[a,o]=ag(i);return aw(t,r,{type:"CONSTRUCT",path:n.map(e=>e.toString()),argumentList:a},o).then(av)}});return a=(ap.get(t)||0)+1,ap.set(t,a),am&&am.register(o,t,o),o}(e,r,[],t)}function af(e){if(e)throw Error("Proxy has been released and is not useable")}function ah(e){return aw(e,new Map,{type:"RELEASE"}).then(()=>{al(e)})}let ap=new WeakMap,am="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{let t=(ap.get(e)||0)-1;ap.set(e,t),0===t&&ah(e)});function ag(e){var t;let r=e.map(ab);return[r.map(e=>e[0]),(t=r.map(e=>e[1]),Array.prototype.concat.apply([],t))]}let ay=new WeakMap;function ab(e){for(let[t,r]of ac)if(r.canHandle(e)){let[n,i]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:e},ay.get(e)||[]]}function av(e){switch(e.type){case"HANDLER":return ac.get(e.name).deserialize(e.value);case"RAW":return e.value}}function aw(e,t,r,n){return new Promise(i=>{let a=[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},r),n)})}let ak=ad("u"<typeof window?{postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}}:window?.ReactNativeWebView?{postMessage:e=>{window.ReactNativeWebView.postMessage(JSON.stringify(e))},addEventListener:(e,t,...r)=>{document.addEventListener("FarcasterFrameCallback",t,...r)},removeEventListener:(e,t)=>{document.removeEventListener("FarcasterFrameCallback",t)}}:function(e,t=globalThis,r="*"){return{postMessage:(t,n)=>e.postMessage(t,r,n),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}(window?.parent??window)),a_={get eventNames(){return n.eventNames.bind(n)},get listenerCount(){return n.listenerCount.bind(n)},get listeners(){return n.listeners.bind(n)},addListener:(n=new iD.EventEmitter).addListener.bind(n),emit:n.emit.bind(n),off:n.off.bind(n),on:n.on.bind(n),once:n.once.bind(n),removeAllListeners:n.removeAllListeners.bind(n),removeListener:n.removeListener.bind(n)},ax=function(e={}){let t=e.id??0;return{prepare:e=>({...{id:t++,...e},jsonrpc:"2.0"}),get id(){return t}}}(),aS=function(e,t={}){let{includeEvents:r=!0}=t;if(!e)throw new ar;return{...r?{on:e.on?.bind(e),removeListener:e.removeListener?.bind(e)}:{},async request(t){let r=await e.request(t);return r&&"object"==typeof r&&"jsonrpc"in r?iq(r):r}}}({...a_,async request(e){let t=ax.prepare(e);try{let e=await ak.ethProviderRequestV2(t).then(e=>iq(e,{request:t,raw:!0}));if(e.error)throw function({code:e,details:t}){switch(e){case 4001:return new i8;case 4100:return new i9;case 4200:return new i7;case 4900:return new ae;case 4901:return new at;default:return new i3(e,t??"Unknown provider RPC error")}}(e.error);return e.result}catch(e){if(e instanceof Error&&e.message.match(/cannot read property 'apply'/i))return await ak.ethProviderRequest(t);if(e instanceof i3||e instanceof iV)throw e;throw new i4({message:e instanceof Error?e.message:void 0})}}});async function aE(){try{let e=await ak.getCapabilities();if(!e.includes("wallet.getEthereumProvider")&&!e.includes("wallet.getEvmProvider"))return;return aS}catch{return aS}}function aI(e){let t=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(e)});window.dispatchEvent(t);let r=()=>window.dispatchEvent(t);return window.addEventListener("eip6963:requestProvider",r),()=>window.removeEventListener("eip6963:requestProvider",r)}"u">typeof document&&(document.addEventListener("eip6963:requestProvider",()=>{ak.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",e=>{if(e instanceof MessageEvent){let t=e.data;a_.emit(t.event,...t.params)}}),document.addEventListener("FarcasterFrameEvent",e=>{if(e instanceof MessageEvent){let t=e.data;"eip6963:announceProvider"===t.event&&aI({info:t.info,provider:aS})}})),"u">typeof window&&(window.addEventListener("eip6963:requestProvider",()=>{ak.eip6963RequestProvider()}),window.addEventListener("message",e=>{if(e instanceof MessageEvent&&"frameEthProviderEvent"===e.data.type){let t=e.data;a_.emit(t.event,...t.params)}}),window.addEventListener("message",e=>
7{if(e instanceof MessageEvent&&"frameEvent"===e.data.type){let t=e.data.event;"eip6963:announceProvider"===t.event&&aI({info:t.info,provider:aS})}}));var iF=iF;new TextEncoder;let aA=new TextDecoder;class aB extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}aB.code="ERR_JOSE_GENERIC";class aT extends aB{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}aT.code="ERR_JWT_INVALID";class aP extends Error{constructor(e,t={}){const r=(()=>{if(t.cause instanceof aP){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})();super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r?["",r?`Details: ${r}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),this.name="BaseError",this.cause=t.cause,this.details=r,this.shortMessage=e}}class aO extends aP{constructor({status:e}){super(`Request failed with status ${e}`),this.name="RequestFailedError"}}class aj extends aP{constructor(e){super(e),this.name="InvalidToken"}}async function aR({origin:e}){let t=await fetch(`${e}/nonce`,{method:"POST"});if(!t.ok)throw new aO({status:t.status});return await t.json()}async function aL({origin:e},t){let r=await fetch(`${e}/verify-siwf`,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(t)});if(!r.ok)throw new aO({status:r.status});let n=await r.json();if(!1===n.valid)throw new aj(n.message??"unknown");return{token:n.token}}let aC=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,aN=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/,az=(()=>{let e,t;async function r(t){let r=function(e={}){let t=function(e={}){return{origin:e.origin??"https://auth.farcaster.xyz"}}(e);return{generateNonce:()=>aR(t),verifySiwf:e=>aL(t,e)}}({origin:t.quickAuthServerOrigin}),{nonce:n}=await r.generateNonce(),i=await ak.signIn({nonce:n,acceptAuthAddress:!0});if(i.result){let t=function(e){let{scheme:t,statement:r,...n}=e.match(aC)?.groups??{},{chainId:i,expirationTime:a,issuedAt:s,notBefore:o,requestId:u,...c}=e.match(aN)?.groups??{},l=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...n,...c,...i?{chainId:Number(i)}:{},...a?{expirationTime:new Date(a)}:{},...s?{issuedAt:new Date(s)}:{},...o?{notBefore:new Date(o)}:{},...u?{requestId:u}:{},...l?{resources:l}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}(i.result.message);if(!t.domain)throw Error("Missing domain on SIWE message");let n=await r.verifySiwf({domain:t.domain,message:i.result.message,signature:i.result.signature});return e={token:n.token,payload:function(e){let t,r;if("string"!=typeof e)throw new aT("JWTs must use Compact JWS serialization, JWT must be a string");let{1:n,length:i}=e.split(".");if(5===i)throw new aT("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new aT("Invalid JWT");if(!n)throw new aT("JWTs must contain a payload");try{t=(e=>{let t=e;t instanceof Uint8Array&&(t=aA.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{var r=t;let e=atob(r),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}catch{throw TypeError("The input to be decoded is not correctly encoded.")}})(n)}catch{throw new aT("Failed to base64url decode the payload")}try{r=JSON.parse(aA.decode(t))}catch{throw new aT("Failed to parse the decoded payload as JSON")}if(!function(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(r))throw new aT("Invalid JWT Claims Set");return r}(n.token)},n}if("rejected_by_user"===i.error.type)throw new iF.RejectedByUser;throw Error("Unreachable")}return{get token(){if(e&&new Date(1e3*e.payload.exp)>new Date(Date.now()+15e3))return e.token;return},async getToken(n={}){let i=n.force??!1;return e&&!i&&new Date(1e3*e.payload.exp)>new Date(Date.now()+15e3)?{token:e.token}:(t||(t=r(n)),t.finally(()=>{t=void 0}),t)},async fetch(e,t){let{token:r}=await this.getToken(),n=new Headers(t?.headers);return n.set("Authorization",`Bearer ${r}`),fetch(e,{...t,headers:n})}}})(),aU={get eventNames(){return i.eventNames.bind(i)},get listenerCount(){return i.listenerCount.bind(i)},get listeners(){return i.listeners.bind(i)},addListener:(i=new ne).addListener.bind(i),emit:i.emit.bind(i),off:i.off.bind(i),on:i.on.bind(i),once:i.once.bind(i),removeAllListeners:i.removeAllListeners.bind(i),removeListener:i.removeListener.bind(i)}
7,{solanaProviderRequest:aZ}=ak;async function aM(){let e;try{e=await ak.getCapabilities()}catch{}if(e?.includes("wallet.getSolanaProvider"))return r}aZ&&(r={request:a=async e=>{if("connect"===e.method||"signMessage"===e.method)return await aZ(e);if("signAndSendTransaction"===e.method){let{transaction:t}=e.params,r={transaction:iZ(t)};return await aZ({method:"signAndSendTransaction",params:r})}if("signTransaction"===e.method){let t,{transaction:r}=e.params,n={transaction:iZ(r)},{signedTransaction:i}=await aZ({method:"signTransaction",params:n});return{signedTransaction:(t=iU.Buffer.from(i,"base64"),"legacy"===nE.deserializeMessageVersion(t)?nT.deserialize(t):nB.from(t))}}},signMessage:e=>a({method:"signMessage",params:{message:e}}),signTransaction:e=>a({method:"signTransaction",params:{transaction:e}}),signAndSendTransaction:e=>a({method:"signAndSendTransaction",params:e})});let aW=null;async function aF(e=1e3){if(!0===aW)return!0;if("u"<typeof window||!window.ReactNativeWebView&&window===window.parent)return!1;let t=await Promise.race([ak.context.then(e=>!!e),new Promise(t=>{setTimeout(()=>t(!1),e)})]).catch(()=>!1);return t&&(aW=!0),t}let aK=async()=>{let e=await ak.addFrame();if(e.result)return e.result;if("invalid_domain_manifest"===e.error.type)throw new iW.InvalidDomainManifest;if("rejected_by_user"===e.error.type)throw new iW.RejectedByUser;throw Error("Unreachable")},aD={...aU,getCapabilities:ak.getCapabilities,getChains:ak.getChains,isInMiniApp:aF,context:ak.context,back:(({miniAppHost:e,emitter:t})=>{let r,n=null;return{visible:!1,get onback(){return n},set onback(cb){n&&t.removeListener("backNavigationTriggered",n),n=cb,cb&&t.addListener("backNavigationTriggered",cb)},async show(){await e.updateBackState({visible:!0}),this.visible=!0},async hide(){await e.updateBackState({visible:!1}),this.visible=!1},async enableWebNavigation(){r=function({emitter:e,back:t}){let r=function(){if("u">typeof window&&void 0!==window.navigation)return window.navigation}();return r?function({emitter:e,back:t,navigation:r}){function n(){r.canGoBack?t.show():t.hide()}function i(){t.visible&&r.canGoBack&&r.back()}return r.addEventListener("navigatesuccess",n),e.addListener("backNavigationTriggered",i),()=>{r.removeEventListener("navigatesuccess",n),e.removeListener("backNavigationTriggered",i)}}({emitter:e,back:t,navigation:r}):"u">typeof window?function({emitter:e,back:t,window:r}){function n(){t.visible&&r.history.back()}return t.show(),e.addListener("backNavigationTriggered",n),()=>{e.removeListener("backNavigationTriggered",n)}}({emitter:e,back:t,window}):void 0}({back:this,emitter:t})},async disableWebNavigation(){r?.(),r=void 0}}})({miniAppHost:ak,emitter:aU}),quickAuth:az,actions:{setPrimaryButton:ak.setPrimaryButton.bind(ak),ready:async(e={})=>await ak.ready(e),close:ak.close.bind(ak),viewCast:ak.viewCast.bind(ak),viewProfile:ak.viewProfile.bind(ak),openMiniApp:ak.openMiniApp.bind(ak),signIn:async e=>{let t=await ak.signIn({...e,acceptAuthAddress:e.acceptAuthAddress??!0});if(t.result)return t.result;if("rejected_by_user"===t.error.type)throw new iF.RejectedByUser;throw Error("Unreachable")},openUrl:e=>{let t="string"==typeof e?e:e.url;return ak.openUrl(t.trim())},addFrame:aK,addMiniApp:aK,composeCast:(e={})=>ak.composeCast(e),viewToken:ak.viewToken.bind(ak),sendToken:ak.sendToken.bind(ak),swapToken:ak.swapToken.bind(ak),requestCameraAndMicrophoneAccess:ak.requestCameraAndMicrophoneAccess.bind(ak)},experimental:{getSolanaProvider:aM,signManifest:async e=>{let t=await ak.signManifest(e);if(t.result)return t.result;if("rejected_by_user"===t.error.type)throw new iK.RejectedByUser;if("invalid_domain"===t.error.type)throw new iK.InvalidDomain;if("generic_error"===t.error.type)throw new iK.GenericError(t.error.message);throw Error("Unreachable")},quickAuth:e=>az.getToken(e)},wallet:{ethProvider:aS,getEthereumProvider:aE,getSolanaProvider:aM},haptics:{impactOccurred:ak.impactOccurred.bind(ak),notificationOccurred:ak.notificationOccurred.bind(ak),selectionChanged:ak.selectionChanged.bind(ak)}};"u">typeof document&&document.addEventListener("FarcasterFrameEvent",e=>{if(e instanceof MessageEvent){let t=e.data;
7"primary_button_clicked"===t.event?aU.emit("primaryButtonClicked"):"miniapp_added"===t.event?aU.emit("miniAppAdded",{notificationDetails:t.notificationDetails}):"miniapp_add_rejected"===t.event?aU.emit("miniAppAddRejected",{reason:t.reason}):"miniapp_removed"===t.event?aU.emit("miniAppRemoved"):"notifications_enabled"===t.event?aU.emit("notificationsEnabled",{notificationDetails:t.notificationDetails}):"notifications_disabled"===t.event?aU.emit("notificationsDisabled"):"back_navigation_triggered"===t.event&&aU.emit("backNavigationTriggered")}}),"u">typeof window&&window.addEventListener("message",e=>{if(e instanceof MessageEvent&&"frameEvent"===e.data.type){let t=e.data.event;"primary_button_clicked"===t.event?aU.emit("primaryButtonClicked"):"miniapp_added"===t.event?aU.emit("miniAppAdded",{notificationDetails:t.notificationDetails}):"miniapp_add_rejected"===t.event?aU.emit("miniAppAddRejected",{reason:t.reason}):"miniapp_removed"===t.event?aU.emit("miniAppRemoved"):"notifications_enabled"===t.event?aU.emit("notificationsEnabled",{notificationDetails:t.notificationDetails}):"notifications_disabled"===t.event?aU.emit("notificationsDisabled"):"back_navigation_triggered"===t.event&&aU.emit("backNavigationTriggered")}}),e.s(["default",0,aD],449112)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.