/*! For license information please see main.c5d5ff0b.js.LICENSE.txt */ (()=>{var __webpack_modules__={6796:()=>{!function(){"use strict";function e(e,t){e.querySelector(".apply-loading").classList.remove("d-block"),e.querySelector(".error-message").innerHTML=t,e.querySelector(".error-message").classList.add("d-block")}document.querySelectorAll(".emailForm").forEach((function(t){t.addEventListener("submit",(function(t){t.preventDefault();let n=this,r=n.getAttribute("action"),i=n.getAttribute("data-recaptcha-site-key");if(!r)return void e(n,"The form action property is not set!");n.querySelector(".apply-loading").classList.add("d-block"),n.querySelector(".error-message").classList.remove("d-block"),n.querySelector(".sent-message").classList.remove("d-block");let o=new FormData(n);i||function(t,n,r){fetch(n,{method:"POST",body:r,headers:{"X-Requested-With":"XMLHttpRequest"}}).then((e=>{if(e.ok)return e.text();throw new Error("".concat(e.status," ").concat(e.statusText," ").concat(e.url))})).then((e=>{if(t.querySelector(".apply-loading").classList.remove("d-block"),"OK"!=e.trim())throw new Error(e||"Form submission failed and no error message returned from: "+n);t.querySelector(".sent-message").classList.add("d-block"),t.reset()})).catch((n=>{e(t,n)}))}(n,r,o)}))}))}()},8070:function(e,t,n){"use strict";var r=n(918).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.map=t.array=t.rustEnum=t.str=t.vecU8=t.tagged=t.vec=t.bool=t.option=t.publicKey=t.i256=t.u256=t.i128=t.u128=t.i64=t.u64=t.struct=t.f64=t.f32=t.i32=t.u32=t.i16=t.u16=t.i8=t.u8=void 0;const o=n(2799),a=n(4845),s=i(n(4166));var c=n(2799);Object.defineProperty(t,"u8",{enumerable:!0,get:function(){return c.u8}}),Object.defineProperty(t,"i8",{enumerable:!0,get:function(){return c.s8}}),Object.defineProperty(t,"u16",{enumerable:!0,get:function(){return c.u16}}),Object.defineProperty(t,"i16",{enumerable:!0,get:function(){return c.s16}}),Object.defineProperty(t,"u32",{enumerable:!0,get:function(){return c.u32}}),Object.defineProperty(t,"i32",{enumerable:!0,get:function(){return c.s32}}),Object.defineProperty(t,"f32",{enumerable:!0,get:function(){return c.f32}}),Object.defineProperty(t,"f64",{enumerable:!0,get:function(){return c.f64}}),Object.defineProperty(t,"struct",{enumerable:!0,get:function(){return c.struct}});class u extends o.Layout{constructor(e,t,n){super(e,n),this.blob=(0,o.blob)(e),this.signed=t}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=new s.default(this.blob.decode(e,t),10,"le");return this.signed?n.fromTwos(8*this.span).clone():n}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(r,"le",this.span),t,n)}}function l(e){return new u(8,!1,e)}t.u64=l,t.i64=function(e){return new u(8,!0,e)},t.u128=function(e){return new u(16,!1,e)},t.i128=function(e){return new u(16,!0,e)},t.u256=function(e){return new u(32,!1,e)},t.i256=function(e){return new u(32,!0,e)};class d extends o.Layout{constructor(e,t,n,r){super(e.span,r),this.layout=e,this.decoder=t,this.encoder=n}decode(e,t){return this.decoder(this.layout.decode(e,t))}encode(e,t,n){return this.layout.encode(this.encoder(e),t,n)}getSpan(e,t){return this.layout.getSpan(e,t)}}t.publicKey=function(e){return new d((0,o.blob)(32),(e=>new a.PublicKey(e)),(e=>e.toBuffer()),e)};class f extends o.Layout{constructor(e,t){super(-1,t),this.layout=e,this.discriminator=(0,o.u8)()}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null===e||void 0===e?this.discriminator.encode(0,t,n):(this.discriminator.encode(1,t,n),this.layout.encode(e,t,n+1)+1)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.discriminator.decode(e,t);if(0===n)return null;if(1===n)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.discriminator.decode(e,t);if(0===n)return 1;if(1===n)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}function h(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function p(e){return e?1:0}function m(e){const t=(0,o.u32)("length"),n=(0,o.struct)([t,(0,o.blob)((0,o.offset)(t,-t.span),"data")]);return new d(n,(e=>{let{data:t}=e;return t}),(e=>({data:e})),e)}t.option=function(e,t){return new f(e,t)},t.bool=function(e){return new d((0,o.u8)(),h,p,e)},t.vec=function(e,t){const n=(0,o.u32)("length"),r=(0,o.struct)([n,(0,o.seq)(e,(0,o.offset)(n,-n.span),"values")]);return new d(r,(e=>{let{values:t}=e;return t}),(e=>({values:e})),t)},t.tagged=function(e,t,n){const r=(0,o.struct)([l("tag"),t.replicate("data")]);return new d(r,(function(t){let{tag:n,data:r}=t;if(!n.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+n.toString("hex"));return r}),(t=>({tag:e,data:t})),n)},t.vecU8=m,t.str=function(e){return new d(m(),(e=>e.toString("utf-8")),(e=>r.from(e,"utf-8")),e)},t.rustEnum=function(e,t,n){const r=(0,o.union)(null!==n&&void 0!==n?n:(0,o.u8)(),t);return e.forEach(((e,t)=>r.addVariant(t,e,e.property))),r},t.array=function(e,t,n){const r=(0,o.struct)([(0,o.seq)(e,t,"values")]);return new d(r,(e=>{let{values:t}=e;return t}),(e=>({values:e})),n)};class y extends o.Layout{constructor(e,t,n){super(e.span+t.span,n),this.keyLayout=e,this.valueLayout=t}decode(e,t){t=t||0;return[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}encode(e,t,n){n=n||0;const r=this.keyLayout.encode(e[0],t,n);return r+this.valueLayout.encode(e[1],t,n+r)}getSpan(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}t.map=function(e,t,n){const r=(0,o.u32)("length"),i=(0,o.struct)([r,(0,o.seq)(new y(e,t),(0,o.offset)(r,-r.span),"values")]);return new d(i,(e=>{let{values:t}=e;return new Map(t)}),(e=>({values:Array.from(e.entries())})),n)}},9723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const i=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},5579:e=>{"use strict";const t=/[\p{Lu}]/u,n=/[\p{Ll}]/u,r=/^[\p{Lu}](?![\p{Lu}])/gu,i=/([\p{Alpha}\p{N}_]|$)/u,o=/[_.\- ]+/,a=new RegExp("^"+o.source),s=new RegExp(o.source+i.source,"gu"),c=new RegExp("\\d+"+i.source,"gu"),u=(e,i)=>{if("string"!==typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");if(i={pascalCase:!1,preserveConsecutiveUppercase:!1,...i},0===(e=Array.isArray(e)?e.map((e=>e.trim())).filter((e=>e.length)).join("-"):e.trim()).length)return"";const o=!1===i.locale?e=>e.toLowerCase():e=>e.toLocaleLowerCase(i.locale),u=!1===i.locale?e=>e.toUpperCase():e=>e.toLocaleUpperCase(i.locale);if(1===e.length)return i.pascalCase?u(e):o(e);return e!==o(e)&&(e=((e,r,i)=>{let o=!1,a=!1,s=!1;for(let c=0;c(r.lastIndex=0,e.replace(r,(e=>t(e)))))(e,o):o(e),i.pascalCase&&(e=u(e.charAt(0))+e.slice(1)),((e,t)=>(s.lastIndex=0,c.lastIndex=0,e.replace(s,((e,n)=>t(n))).replace(c,(e=>t(e)))))(e,u)};e.exports=u,e.exports.default=u},3546:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,u=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,n++}for(var h=o-i;h!==o&&0===u[h];)h++;for(var p=new Uint8Array(r+(o-h)),m=r;h!==o;)p[m++]=u[h++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var d=t[i],f=0,h=c-1;(0!==d||f>>0,l[h]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=f,i++}for(var p=c-r;p!==c&&0===l[p];)p++;for(var m=s.repeat(n);p{const r=n(3546);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},9563:(e,t,n)=>{"use strict";t._O=t.Jq=t.KB=t.u8=t.cv=void 0,t.Ik=t.A9=t.n_=t.gM=void 0;const r=n(918);function i(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function o(e){return i(e),r.Buffer.from(e.buffer,e.byteOffset,e.length)}class a{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function s(e,t){return t.property?e+"["+t.property+"]":e}class c extends a{isCount(){throw new Error("ExternalLayout is abstract")}}class u extends c{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(e);const n=e.length-t;return Math.floor(n/this.elementSpan)}encode(e,t,n){return 0}}class l extends c{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(!(e instanceof a))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof d||this.layout instanceof f}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.layout.decode(e,t+this.offset)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.layout.encode(e,t,n+this.offset)}}class d extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return o(e).readUIntLE(t,this.span)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeUIntLE(e,n,this.span),this.span}}class f extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return o(e).readUIntBE(t,this.span)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeUIntBE(e,n,this.span),this.span}}class h extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return o(e).readIntLE(t,this.span)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeIntLE(e,n,this.span),this.span}}class p extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return o(e).readIntBE(t,this.span)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeIntBE(e,n,this.span),this.span}}const m=Math.pow(2,32);function y(e){const t=Math.floor(e/m);return{hi32:t,lo32:e-t*m}}function g(e,t){return e*m+t}class v extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=o(e),r=n.readUInt32LE(t);return g(n.readUInt32LE(t+4),r)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=y(e),i=o(t);return i.writeUInt32LE(r.lo32,n),i.writeUInt32LE(r.hi32,n+4),8}}class w extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=o(e);return g(n.readUInt32BE(t),n.readUInt32BE(t+4))}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=y(e),i=o(t);return i.writeUInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}class b extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=o(e),r=n.readUInt32LE(t);return g(n.readInt32LE(t+4),r)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=y(e),i=o(t);return i.writeUInt32LE(r.lo32,n),i.writeInt32LE(r.hi32,n+4),8}}class S extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=o(e);return g(n.readInt32BE(t),n.readUInt32BE(t+4))}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=y(e),i=o(t);return i.writeInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}class _ extends a{constructor(e){super(4,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(e).readFloatLE(t)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeFloatLE(e,n),4}}class x extends a{constructor(e){super(4,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(e).readFloatBE(t)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeFloatBE(e,n),4}}class E extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(e).readDoubleLE(t)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeDoubleLE(e,n),8}}class k extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(e).readDoubleBE(t)}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o(t).writeDoubleBE(e,n),8}}class C extends a{constructor(e,t,n){if(!(e instanceof a))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof c&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let r=-1;!(t instanceof c)&&01&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;let n=0,r=this.count;if(r instanceof c&&(r=r.decode(e,t)),01&&void 0!==arguments[1]?arguments[1]:0;const n=[];let r=0,i=this.count;for(i instanceof c&&(i=i.decode(e,t));r2&&void 0!==arguments[2]?arguments[2]:0;const r=this.elementLayout,i=e.reduce(((e,i)=>e+r.encode(i,t,n+e)),0);return this.count instanceof c&&this.count.encode(e.length,t,n),i}}class A extends a{constructor(e,t,n){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof a),!0))throw new TypeError("fields must be array of Layout instances");"boolean"===typeof t&&void 0===n&&(n=t,t=void 0);for(const o of e)if(0>o.span&&void 0===o.property)throw new Error("fields cannot contain unnamed variable-length layout");let r=-1;try{r=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(i){}super(r,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce(((n,r)=>{const i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(r){throw new RangeError("indeterminate span")}return n}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(e);const n=this.makeDestinationObject();for(const r of this.fields)if(void 0!==r.property&&(n[r.property]=r.decode(e,t)),t+=r.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return n}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=n;let i=0,o=0;for(const a of this.fields){let r=a.span;if(o=0r&&(r=a.getSpan(t,n)))}i=n,n+=r}return i+o-r}fromArray(e){const t=this.makeDestinationObject();for(const n of this.fields)void 0!==n.property&&0n.span?t=-1:0<=t&&(t+=n.span)}}}class T{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,n){throw new Error("UnionDiscriminator is abstract")}}class I extends T{constructor(e,t){if(!(e instanceof c&&e.isCount()))throw new 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,n){return this.layout.encode(e,t,n)}}class M extends a{constructor(e,t,n){let r;if(e instanceof d||e instanceof f)r=new I(new l(e));else if(e instanceof c&&e.isCount())r=new I(e);else{if(!(e instanceof T))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");r=e}if(void 0===t&&(t=null),!(null===t||t instanceof a))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let i=-1;t&&(i=t.span,0<=i&&(e instanceof d||e instanceof f)&&(i+=r.layout.span)),super(i,n),this.discriminator=r,this.usesPrefixDiscriminator=e instanceof d||e instanceof f,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return o(e)},this.configGetSourceVariant=function(e){o=e.bind(this)}}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;const n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.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;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const n=this.registry[t];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw new Error("unable to infer src variant")}decode(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this.discriminator,i=r.decode(e,n),o=this.registry[i];if(void 0===o){const o=this.defaultLayout;let a=0;this.usesPrefixDiscriminator&&(a=r.layout.span),t=this.makeDestinationObject(),t[r.property]=i,t[o.property]=o.decode(e,n+a)}else t=o.decode(e,n);return t}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=this.getSourceVariant(e);if(void 0===r){const r=this.discriminator,i=this.defaultLayout;let o=0;return this.usesPrefixDiscriminator&&(o=r.layout.span),r.encode(e[r.property],t,n),o+i.encode(e[i.property],t,n+o)}return r.encode(e,t,n)}addVariant(e,t,n){const r=new N(this,e,t,n);return this.registry[e]=r,r}getVariant(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=e instanceof Uint8Array?this.discriminator.decode(e,n):e,this.registry[t]}}class N extends a{constructor(e,t,n,r){if(!(e instanceof M))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof n&&void 0===r&&(r=n,n=null),n){if(!(n instanceof a))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=n.span&&n.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof r)throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=n?n.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,r),this.union=e,this.variant=t,this.layout=n||null}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);let i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new 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+=4294967296),e}class j extends a{constructor(e,t,n){if(!(e instanceof d||e instanceof f))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof t&&void 0===n&&(n=t,t=!1),41&&void 0!==arguments[1]?arguments[1]:0;const n=this.makeDestinationObject(),r=this.word.decode(e,t);this._packedSetValue(r);for(const i of this.fields)void 0!==i.property&&(n[i.property]=i.decode(e));return n}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=this.word.decode(t,n);this._packedSetValue(r);for(const i of this.fields)if(void 0!==i.property){const t=e[i.property];void 0!==t&&i.encode(t)}return this.word.encode(this._packedGetValue(),t,n)}addField(e,t){const n=new L(this,e,t);return this.fields.push(n),n}addBoolean(e){const t=new P(this,e);return this.fields.push(t),t}fieldFor(e){if("string"!==typeof e)throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}}class L{constructor(e,t,n){if(!(e instanceof j))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");const r=8*e.span,i=e.fields.reduce(((e,t)=>e+t.bits),0);if(t+i>r)throw new Error("bits too long for span remainder ("+(r-i)+" of "+r+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start}encode(e){if("number"!==typeof e||!Number.isInteger(e)||e!==O(e&this.valueMask))throw new TypeError(s("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),n=O(e<n&&(n=this.length.decode(e,t)),n}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.span;return 0>n&&(n=this.length.decode(e,t)),o(e).slice(t,t+n)}encode(e,t,n){let r=this.length;if(this.length instanceof c&&(r=e.length),!(e instanceof Uint8Array&&r===e.length))throw new TypeError(s("Blob.encode",this)+" requires (length "+r+") Uint8Array as src");if(n+r>t.length)throw new RangeError("encoding overruns Uint8Array");const i=o(e);return o(t).write(i.toString("hex"),n,r,"hex"),this.length instanceof c&&this.length.encode(r,t,n),r}}class D extends a{constructor(e){super(-1,e)}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(e);let n=t;for(;n1&&void 0!==arguments[1]?arguments[1]:0;const n=this.getSpan(e,t);return o(e).slice(t,t+n-1).toString("utf-8")}encode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;"string"!==typeof e&&(e=String(e));const i=r.Buffer.from(e,"utf8"),a=i.length;if(n+a>t.length)throw new RangeError("encoding overruns Buffer");const s=o(t);return i.copy(s,n),s[n+a]=0,a+1}}class B extends a{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 new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(e),e.length-t}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan2&&void 0!==arguments[2]?arguments[2]:0;"string"!==typeof e&&(e=String(e));const i=r.Buffer.from(e,"utf8"),a=i.length;if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return i.copy(o(t),n),a}}class U extends a{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,n){return 0}}t.cv=(e,t,n)=>new l(e,t,n),t.u8=e=>new d(1,e),t.KB=e=>new d(2,e),t.Jq=e=>new d(4,e),t._O=e=>new v(e),t.gM=e=>new b(e),t.n_=(e,t,n)=>new A(e,t,n),t.A9=(e,t,n)=>new C(e,t,n),t.Ik=(e,t)=>new R(e,t)},4845:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Account:()=>Rn,AddressLookupTableAccount:()=>Kr,AddressLookupTableInstruction:()=>Ho,AddressLookupTableProgram:()=>Fo,Authorized:()=>$o,BLOCKHASH_CACHE_TIMEOUT_MS:()=>Jr,BPF_LOADER_DEPRECATED_PROGRAM_ID:()=>Dn,BPF_LOADER_PROGRAM_ID:()=>Or,BpfLoader:()=>jr,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:()=>Wo,ComputeBudgetInstruction:()=>Vo,ComputeBudgetProgram:()=>Yo,Connection:()=>Bo,Ed25519Program:()=>qo,Enum:()=>Tn,EpochSchedule:()=>zr,FeeCalculatorLayout:()=>Sr,Keypair:()=>Uo,LAMPORTS_PER_SOL:()=>_a,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:()=>zo,Loader:()=>Nr,Lockup:()=>ea,MAX_SEED_LENGTH:()=>On,Message:()=>$n,MessageAccountKeys:()=>Wn,MessageV0:()=>er,NONCE_ACCOUNT_LENGTH:()=>xr,NonceAccount:()=>Er,PACKET_DATA_SIZE:()=>Bn,PUBLIC_KEY_LENGTH:()=>jn,PublicKey:()=>Pn,SIGNATURE_LENGTH_IN_BYTES:()=>zn,SOLANA_SCHEMA:()=>In,STAKE_CONFIG_ID:()=>Jo,STAKE_INSTRUCTION_LAYOUTS:()=>na,SYSTEM_INSTRUCTION_LAYOUTS:()=>Tr,SYSVAR_CLOCK_PUBKEY:()=>cr,SYSVAR_EPOCH_SCHEDULE_PUBKEY:()=>ur,SYSVAR_INSTRUCTIONS_PUBKEY:()=>lr,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:()=>dr,SYSVAR_RENT_PUBKEY:()=>fr,SYSVAR_REWARDS_PUBKEY:()=>hr,SYSVAR_SLOT_HASHES_PUBKEY:()=>pr,SYSVAR_SLOT_HISTORY_PUBKEY:()=>mr,SYSVAR_STAKE_HISTORY_PUBKEY:()=>yr,Secp256k1Program:()=>Xo,SendTransactionError:()=>Hr,SolanaJSONRPCError:()=>Vr,SolanaJSONRPCErrorCode:()=>Fr,StakeAuthorizationLayout:()=>ra,StakeInstruction:()=>ta,StakeProgram:()=>ia,Struct:()=>An,SystemInstruction:()=>Ar,SystemProgram:()=>Ir,Transaction:()=>or,TransactionExpiredBlockheightExceededError:()=>Hn,TransactionExpiredNonceInvalidError:()=>Vn,TransactionExpiredTimeoutError:()=>Fn,TransactionInstruction:()=>ir,TransactionMessage:()=>ar,TransactionStatus:()=>nr,VALIDATOR_INFO_KEY:()=>la,VERSION_PREFIX_MASK:()=>Un,VOTE_PROGRAM_ID:()=>ha,ValidatorInfo:()=>fa,VersionedMessage:()=>tr,VersionedTransaction:()=>sr,VoteAccount:()=>ma,VoteAuthorizationLayout:()=>ca,VoteInit:()=>oa,VoteInstruction:()=>aa,VoteProgram:()=>ua,clusterApiUrl:()=>ba,sendAndConfirmRawTransaction:()=>Sa,sendAndConfirmTransaction:()=>gr});var r={};n.r(r),n.d(r,{dQ:()=>Q,ci:()=>z,bytesToNumberBE:()=>Y,ty:()=>K,eV:()=>X,n$:()=>ee,ql:()=>Z,hexToBytes:()=>W,_t:()=>B,tL:()=>q,S5:()=>G,FF:()=>ne});var i=n(918);function o(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: ".concat(e))}function a(e){if(!((t=e)instanceof Uint8Array||null!=t&&"object"===typeof t&&"Uint8Array"===t.constructor.name))throw new Error("Expected Uint8Array");for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0&&!r.includes(e.length))throw new Error("Expected Uint8Array of length ".concat(r,", not of length=").concat(e.length))}function s(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");o(e.outputLen),o(e.blockLen)}function c(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){a(e);const n=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),h=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function p(e){if("string"!==typeof e)throw new Error("utf8ToBytes expected string, got ".concat(typeof e));return new Uint8Array((new TextEncoder).encode(e))}function m(e){if("string"===typeof e&&(e=p(e)),!d(e))throw new Error("expected Uint8Array, got ".concat(typeof e));return e}function y(){let e=0;for(let n=0;ne().update(m(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(l&&"function"===typeof l.getRandomValues)return l.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class b extends g{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=f(this.buffer)}update(e){c(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=m(e)).length;for(let o=0;or-o&&(this.process(n,0),o=0);for(let c=o;c>i&o),s=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const a=f(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=s/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&S),l:Number(e>>_&S)}:{h:0|Number(e>>_&S),l:0|Number(e&S)}}function E(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;ie<>>32-n,C=(e,t,n)=>t<>>32-n,A=(e,t,n)=>t<>>64-n,T=(e,t,n)=>e<>>64-n;const I={fromBig:x,split:E,toBig:(e,t)=>BigInt(e>>>0)<<_|BigInt(t>>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:k,rotlSL:C,rotlBH:A,rotlBL:T,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},[M,N]=(()=>I.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),O=new Uint32Array(80),j=new Uint32Array(80);class L extends b{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:m}=this;return[e,t,n,r,i,o,a,s,c,u,l,d,f,h,p,m]}set(e,t,n,r,i,o,a,s,c,u,l,d,f,h,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let v=0;v<16;v++,t+=4)O[v]=e.getUint32(t),j[v]=e.getUint32(t+=4);for(let v=16;v<80;v++){const e=0|O[v-15],t=0|j[v-15],n=I.rotrSH(e,t,1)^I.rotrSH(e,t,8)^I.shrSH(e,t,7),r=I.rotrSL(e,t,1)^I.rotrSL(e,t,8)^I.shrSL(e,t,7),i=0|O[v-2],o=0|j[v-2],a=I.rotrSH(i,o,19)^I.rotrBH(i,o,61)^I.shrSH(i,o,6),s=I.rotrSL(i,o,19)^I.rotrBL(i,o,61)^I.shrSL(i,o,6),c=I.add4L(r,s,j[v-7],j[v-16]),u=I.add4H(c,n,a,O[v-7],O[v-16]);O[v]=0|u,j[v]=0|c}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:a,Cl:s,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:m,Hh:y,Hl:g}=this;for(let v=0;v<80;v++){const e=I.rotrSH(l,d,14)^I.rotrSH(l,d,18)^I.rotrBH(l,d,41),t=I.rotrSL(l,d,14)^I.rotrSL(l,d,18)^I.rotrBL(l,d,41),w=l&f^~l&p,b=d&h^~d&m,S=I.add5L(g,t,b,N[v],j[v]),_=I.add5H(S,y,e,w,M[v],O[v]),x=0|S,E=I.rotrSH(n,r,28)^I.rotrBH(n,r,34)^I.rotrBH(n,r,39),k=I.rotrSL(n,r,28)^I.rotrBL(n,r,34)^I.rotrBL(n,r,39),C=n&i^n&a^i&a,A=r&o^r&s^o&s;y=0|p,g=0|m,p=0|f,m=0|h,f=0|l,h=0|d,({h:l,l:d}=I.add(0|c,0|u,0|_,0|x)),c=0|a,u=0|s,a=0|i,s=0|o,i=0|n,o=0|r;const T=I.add3L(x,k,A);n=I.add3H(T,_,E,C),r=0|T}({h:n,l:r}=I.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=I.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:a,l:s}=I.add(0|this.Ch,0|this.Cl,0|a,0|s)),({h:c,l:u}=I.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=I.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=I.add(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:m}=I.add(0|this.Gh,0|this.Gl,0|p,0|m)),({h:y,l:g}=I.add(0|this.Hh,0|this.Hl,0|y,0|g)),this.set(n,r,i,o,a,s,c,u,l,d,f,h,p,m,y,g)}roundClean(){O.fill(0),j.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const P=v((()=>new L)),R=(BigInt(0),BigInt(1)),D=BigInt(2);function B(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name}const U=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function z(e){if(!B(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n=F._0&&e<=F._9?e-F._0:e>=F._A&&e<=F._F?e-(F._A-10):e>=F._a&&e<=F._f?e-(F._a-10):void 0}function W(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,o=0;i(D<new Uint8Array(e),$=e=>Uint8Array.from(e);function ee(e,t,n){if("number"!==typeof e||e<2)throw new Error("hashLen must be a number");if("number"!==typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!==typeof n)throw new Error("hmacFn must be a function");let r=J(e),i=J(e),o=0;const a=()=>{r.fill(1),i.fill(0),o=0},s=function(){for(var e=arguments.length,t=new Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:J();i=s($([0]),e),r=s(),0!==e.length&&(i=s($([1]),e),r=s())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e{let n;for(a(),c(e);!(n=t(u()));)c();return a(),n}}const te={bigint:e=>"bigint"===typeof e,function:e=>"function"===typeof e,boolean:e=>"boolean"===typeof e,string:e=>"string"===typeof e,stringOrUint8Array:e=>"string"===typeof e||B(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"===typeof e&&Number.isSafeInteger(e.outputLen)};function ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(t,n,r)=>{const i=te[n];if("function"!==typeof i)throw new Error('Invalid validator "'.concat(n,'", expected function'));const o=e[t];if((!r||void 0!==o)&&!i(o,e))throw new Error("Invalid param ".concat(String(t),"=").concat(o," (").concat(typeof o,"), expected ").concat(n))};for(const[i,o]of Object.entries(t))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return e}const re=BigInt(0),ie=BigInt(1),oe=BigInt(2),ae=BigInt(3),se=BigInt(4),ce=BigInt(5),ue=BigInt(8);BigInt(9),BigInt(16);function le(e,t){const n=e%t;return n>=re?n:t+n}function de(e,t,n){if(n<=re||t 0");if(n===ie)return re;let r=ie;for(;t>re;)t&ie&&(r=r*e%n),e=e*e%n,t>>=ie;return r}function fe(e,t,n){let r=e;for(;t-- >re;)r*=r,r%=n;return r}function he(e,t){if(e===re||t<=re)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));let n=le(e,t),r=t,i=re,o=ie,a=ie,s=re;for(;n!==re;){const e=r/n,t=r%n,c=i-a*e,u=o-s*e;r=n,n=t,i=a,o=s,a=c,s=u}if(r!==ie)throw new Error("invert: does not exist");return le(i,t)}function pe(e){if(e%se===ae){const t=(e+ie)/se;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%ue===ce){const t=(e-ce)/ue;return function(e,n){const r=e.mul(n,oe),i=e.pow(r,t),o=e.mul(n,i),a=e.mul(e.mul(o,oe),i),s=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(s),n))throw new Error("Cannot find square root");return s}}return function(e){const t=(e-ie)/oe;let n,r,i;for(n=e-ie,r=0;n%oe===re;n/=oe,r++);for(i=oe;i(le(e,t)&ie)===ie,ye=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ge(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function ve(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=re)throw new Error("Expected Field ORDER > 0, got ".concat(e));const{nBitLength:i,nByteLength:o}=ge(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=pe(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:Q(i),ZERO:re,ONE:ie,create:t=>le(t,e),isValid:t=>{if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got ".concat(typeof t));return re<=t&&te===re,isOdd:e=>(e&ie)===ie,neg:t=>le(-t,e),eql:(e,t)=>e===t,sqr:t=>le(t*t,e),add:(t,n)=>le(t+n,e),sub:(t,n)=>le(t-n,e),mul:(t,n)=>le(t*n,e),pow:(e,t)=>function(e,t,n){if(n 0");if(n===re)return e.ONE;if(n===ie)return t;let r=e.ONE,i=t;for(;n>re;)n&ie&&(r=e.mul(r,i)),i=e.sqr(i),n>>=ie;return r}(s,e,t),div:(t,n)=>le(t*he(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>he(t,e),sqrt:r.sqrt||(e=>a(s,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce(((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r))),e.ONE),i=e.inv(r);return t.reduceRight(((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))),i),n}(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?G(e,o):q(e,o),fromBytes:e=>{if(e.length!==o)throw new Error("Fp.fromBytes: expected ".concat(o,", got ").concat(e.length));return n?K(e):Y(e)}});return Object.freeze(s)}function we(e){if("bigint"!==typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function be(e){const t=we(e);return t+Math.ceil(t/2)}const Se=BigInt(0),_e=BigInt(1);function xe(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>Se;)n&_e&&(r=r.add(i)),i=i.double(),n>>=_e;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),o=[];let a=e,s=a;for(let r=0;r>=f,r>s&&(r-=d,o+=_e);const a=t,h=t+Math.abs(r)-1,p=e%2!==0,m=r<0;0===r?u=u.add(n(p,i[a])):c=c.add(n(m,i[h]))}return{p:c,f:u}},wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,r(o))),this.wNAF(i,o,n)}}}function Ee(e){return function(e){const t=ye.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});ne(e,t)}(e.Fp),ne(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ge(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const ke=BigInt(0),Ce=BigInt(1),Ae=BigInt(2),Te=BigInt(8),Ie={zip215:!0};function Me(e){const t=function(e){const t=Ee(e);return ne(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:r,prehash:i,hash:o,randomBytes:a,nByteLength:s,h:c}=t,u=Ae<{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(r){return{isValid:!1,value:ke}}}),f=t.adjustScalarBytes||(e=>e),h=t.domain||((e,t,n)=>{if(t.length||n)throw new Error("Contexts/pre-hash are not supported");return e}),p=e=>"bigint"===typeof e&&kep(e)&&p(t)&&ee===ke||m(e,u);function g(e,t){if(m(e,t))return e;throw new Error("Expected valid scalar < ".concat(t,", got ").concat(typeof e," ").concat(e))}function v(e){return e===ke?e:g(e,r)}const w=new Map;function b(e){if(!(e instanceof S))throw new Error("ExtendedPoint expected")}class S{constructor(e,t,n,r){if(this.ex=e,this.ey=t,this.ez=n,this.et=r,!y(e))throw new Error("x required");if(!y(t))throw new Error("y required");if(!y(n))throw new Error("z required");if(!y(r))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof S)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};if(!y(t)||!y(n))throw new Error("invalid affine point");return new S(t,n,Ce,l(t*n))}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.ez)));return e.map(((e,n)=>e.toAffine(t[n]))).map(S.fromAffine)}_setWindowSize(e){this._WINDOW_SIZE=e,w.delete(this)}assertValidity(){const{a:e,d:n}=t;if(this.is0())throw new Error("bad point: ZERO");const{ex:r,ey:i,ez:o,et:a}=this,s=l(r*r),c=l(i*i),u=l(o*o),d=l(u*u),f=l(s*e);if(l(u*l(f+c))!==l(d+l(n*l(s*c))))throw new Error("bad point: equation left != right (1)");if(l(r*i)!==l(o*a))throw new Error("bad point: equation left != right (2)")}equals(e){b(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:a}=e,s=l(t*a),c=l(i*r),u=l(n*a),d=l(o*r);return s===c&&u===d}is0(){return this.equals(S.ZERO)}negate(){return new S(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:n,ey:r,ez:i}=this,o=l(n*n),a=l(r*r),s=l(Ae*l(i*i)),c=l(e*o),u=n+r,d=l(l(u*u)-o-a),f=c+a,h=f-s,p=c-a,m=l(d*h),y=l(f*p),g=l(d*p),v=l(h*f);return new S(m,y,v,g)}add(e){b(e);const{a:n,d:r}=t,{ex:i,ey:o,ez:a,et:s}=this,{ex:c,ey:u,ez:d,et:f}=e;if(n===BigInt(-1)){const e=l((o-i)*(u+c)),t=l((o+i)*(u-c)),n=l(t-e);if(n===ke)return this.double();const r=l(a*Ae*f),h=l(s*Ae*d),p=h+r,m=t+e,y=h-r,g=l(p*n),v=l(m*y),w=l(p*y),b=l(n*m);return new S(g,v,b,w)}const h=l(i*c),p=l(o*u),m=l(s*r*f),y=l(a*d),g=l((i+o)*(c+u)-h-p),v=y-m,w=y+m,_=l(p-n*h),x=l(g*v),E=l(w*_),k=l(g*_),C=l(v*w);return new S(x,E,C,k)}subtract(e){return this.add(e.negate())}wNAF(e){return E.wNAFCached(this,w,e,S.normalizeZ)}multiply(e){const{p:t,f:n}=this.wNAF(g(e,r));return S.normalizeZ([t,n])[0]}multiplyUnsafe(e){let t=v(e);return t===ke?x:this.equals(x)||t===Ce?this:this.equals(_)?this.wNAF(t).p:E.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return E.unsafeLadder(this,r).is0()}toAffine(e){const{ex:t,ey:r,ez:i}=this,o=this.is0();null==e&&(e=o?Te:n.inv(i));const a=l(t*e),s=l(r*e),c=l(i*e);if(o)return{x:ke,y:Ce};if(c!==Ce)throw new Error("invZ was invalid");return{x:a,y:s}}clearCofactor(){const{h:e}=t;return e===Ce?this:this.multiplyUnsafe(e)}static fromHex(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{d:i,a:o}=t,a=n.BYTES,s=(e=Z("pointHex",e,a)).slice(),c=e[a-1];s[a-1]=-129&c;const f=K(s);f===ke||g(f,r?u:n.ORDER);const h=l(f*f),p=l(h-Ce),m=l(i*h-o);let{isValid:y,value:v}=d(p,m);if(!y)throw new Error("Point.fromHex: invalid y coordinate");const w=(v&Ce)===Ce,b=0!==(128&c);if(!r&&v===ke&&b)throw new Error("Point.fromHex: x=0 and x_0=1");return b!==w&&(v=l(-v)),S.fromAffine({x:v,y:f})}static fromPrivateKey(e){return A(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=G(t,n.BYTES);return r[r.length-1]|=e&Ce?128:0,r}toHex(){return z(this.toRawBytes())}}S.BASE=new S(t.Gx,t.Gy,Ce,l(t.Gx*t.Gy)),S.ZERO=new S(ke,Ce,Ce,ke);const{BASE:_,ZERO:x}=S,E=xe(S,8*s);function k(e){return le(e,r)}function C(e){return k(K(e))}function A(e){const t=s;e=Z("private key",e,t);const n=Z("hashed private key",o(e),2*t),r=f(n.slice(0,t)),i=n.slice(t,2*t),a=C(r),c=_.multiply(a),u=c.toRawBytes();return{head:r,prefix:i,scalar:a,point:c,pointBytes:u}}function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;ra(n.BYTES),precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};return{CURVE:t,getPublicKey:function(e){return A(e).pointBytes},sign:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=Z("message",e),i&&(e=i(e));const{prefix:o,scalar:a,pointBytes:c}=A(t),u=T(r.context,o,e),l=_.multiply(u).toRawBytes(),d=k(u+T(r.context,l,c,e)*a);return v(d),Z("result",X(l,G(d,n.BYTES)),2*s)},verify:function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:I;const{context:a,zip215:s}=o,c=n.BYTES;e=Z("signature",e,2*c),t=Z("message",t),i&&(t=i(t));const u=K(e.slice(c,2*c));let l,d,f;try{l=S.fromHex(r,s),d=S.fromHex(e.slice(0,c),s),f=_.multiplyUnsafe(u)}catch(p){return!1}if(!s&&l.isSmallOrder())return!1;const h=T(a,d.toRawBytes(),l.toRawBytes(),t);return d.add(l.multiplyUnsafe(h)).subtract(f).clearCofactor().equals(S.ZERO)},ExtendedPoint:S,utils:M}}const Ne=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Oe=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),je=(BigInt(0),BigInt(1)),Le=BigInt(2),Pe=BigInt(5),Re=BigInt(10),De=BigInt(20),Be=BigInt(40),Ue=BigInt(80);function ze(e){const t=Ne,n=e*e%t*e%t,r=fe(n,Le,t)*n%t,i=fe(r,je,t)*e%t,o=fe(i,Pe,t)*i%t,a=fe(o,Re,t)*o%t,s=fe(a,De,t)*a%t,c=fe(s,Be,t)*s%t,u=fe(c,Ue,t)*c%t,l=fe(u,Ue,t)*c%t,d=fe(l,Re,t)*o%t;return{pow_p_5_8:fe(d,Le,t)*e%t,b2:n}}function He(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function Fe(e,t){const n=Ne,r=le(t*t*t,n),i=le(r*r*t,n);let o=le(e*r*ze(e*i).pow_p_5_8,n);const a=le(t*o*o,n),s=o,c=le(o*Oe,n),u=a===e,l=a===le(-e,n),d=a===le(-e*Oe,n);return u&&(o=s),(l||d)&&(o=c),me(o,n)&&(o=le(-o,n)),{isValid:u||l,value:o}}const Ve=ve(Ne,void 0,!0),We={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Ve,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:P,randomBytes:w,adjustScalarBytes:He,uvRatio:Fe},Ye=Me(We);function Ke(e,t,n){if(t.length>255)throw new Error("Context is too big");return y(p("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}const qe=(Ve.ORDER+BigInt(3))/BigInt(8);Ve.pow(Le,qe),Ve.sqrt(Ve.neg(Ve.ONE)),Ve.ORDER,BigInt(5),BigInt(8),BigInt(486662);!function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);e.isOdd(n)&&e.neg(n)}(Ve,Ve.neg(BigInt(486664)));BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Ge=n(4166),Ze=n.n(Ge),Xe=n(9955),Qe=n.n(Xe);const Je=(e,t,n)=>e&t^e&n^t&n,$e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),et=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tt=new Uint32Array(64);class nt extends b{constructor(){super(64,32,8,!1),this.A=0|et[0],this.B=0|et[1],this.C=0|et[2],this.D=0|et[3],this.E=0|et[4],this.F=0|et[5],this.G=0|et[6],this.H=0|et[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:o,G:a,H:s}=this;return[e,t,n,r,i,o,a,s]}set(e,t,n,r,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let d=0;d<16;d++,t+=4)tt[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){const e=tt[d-15],t=tt[d-2],n=h(e,7)^h(e,18)^e>>>3,r=h(t,17)^h(t,19)^t>>>10;tt[d]=r+tt[d-7]+n+tt[d-16]|0}let{A:n,B:r,C:i,D:o,E:a,F:s,G:c,H:u}=this;for(let d=0;d<64;d++){const e=u+(h(a,6)^h(a,11)^h(a,25))+((l=a)&s^~l&c)+$e[d]+tt[d]|0,t=(h(n,2)^h(n,13)^h(n,22))+Je(n,r,i)|0;u=c,c=s,s=a,a=o+e|0,o=i,i=r,r=n,n=e+t|0}var l;n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,i,o,a,s,c,u)}roundClean(){tt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const rt=v((()=>new nt));var it=n(3333),ot=n(9563),at=n(3289);class st extends TypeError{constructor(e,t){let n;const{message:r,...i}=e,{path:o}=e;super(0===o.length?r:"At path: "+o.join(".")+" -- "+r),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var r;return null!=(r=n)?r:n=[e,...t()]}}}function ct(e){return"object"===typeof e&&null!=e}function ut(e){return"string"===typeof e?JSON.stringify(e):""+e}function lt(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"===typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:a}=n,{refinement:s,message:c="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+ut(r)+"`"}=e;return{value:r,type:a,refinement:s,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*dt(e,t,n,r){var i;ct(i=e)&&"function"===typeof i[Symbol.iterator]||(e=[e]);for(const o of e){const e=lt(o,t,n,r);e&&(yield e)}}function ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const{path:r=[],branch:i=[e],coerce:o=!1,mask:a=!1}=n,s={path:r,branch:i};if(o&&(e=t.coercer(e,s),a&&"type"!==t.type&&ct(t.schema)&&ct(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let c=!0;for(const n of t.validator(e,s))c=!1,yield[n,void 0];for(let[n,u,l]of t.entries(e,s)){const t=ft(u,l,{path:void 0===n?r:[...r,n],branch:void 0===n?i:[...i,u],coerce:o,mask:a});for(const r of t)r[0]?(c=!1,yield[r[0],void 0]):o&&(u=r[1],void 0===n?e=u:e instanceof Map?e.set(n,u):e instanceof Set?e.add(u):ct(e)&&(e[n]=u))}if(c)for(const n of t.refiner(e,s))c=!1,yield[n,void 0];c&&(yield[void 0,e])}()}class ht{constructor(e){const{type:t,schema:n,validator:r,refiner:i,coercer:o=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=n,this.entries=a,this.coercer=o,this.validator=r?(e,t)=>dt(r(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>dt(i(e,t),t,this,e):()=>[]}assert(e){return pt(e,this)}create(e){return mt(e,this)}is(e){return yt(e,this)}mask(e){return function(e,t){const n=gt(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}validate(e){return gt(e,this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}}function pt(e,t){const n=gt(e,t);if(n[0])throw n[0]}function mt(e,t){const n=gt(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function yt(e,t){return!gt(e,t)[0]}function gt(e,t){const n=ft(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),r=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(n);if(r[0]){return[new st(r[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,r[1]]}function vt(e,t){return new ht({type:e,schema:null,validator:t})}function wt(e){return new ht({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+ut(e)})}function bt(){return vt("boolean",(e=>"boolean"===typeof e))}function St(e){return vt("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+ut(t)))}function _t(e){const t=ut(e),n=typeof e;return new ht({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||"Expected the literal `"+t+"`, but received: "+ut(n)})}function xt(){return vt("never",(()=>!1))}function Et(e){return new ht({...e,validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)})}function kt(){return vt("number",(e=>"number"===typeof e&&!isNaN(e)||"Expected a number, but received: "+ut(e)))}function Ct(e){return new ht({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function At(e,t){return new ht({type:"record",schema:null,*entries(n){if(ct(n))for(const r in n){const i=n[r];yield[r,r,e],yield[r,i,t]}},validator:e=>ct(e)||"Expected an object, but received: "+ut(e)})}function Tt(){return vt("string",(e=>"string"===typeof e||"Expected a string, but received: "+ut(e)))}function It(e){const t=xt();return new ht({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let i=0;iArray.isArray(e)||"Expected an array, but received: "+ut(e)})}function Mt(e){const t=Object.keys(e);return new ht({type:"type",schema:e,*entries(n){if(ct(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>ct(e)||"Expected an object, but received: "+ut(e)})}function Nt(e){const t=e.map((e=>e.type)).join(" | ");return new ht({type:"union",schema:null,validator(n,r){const i=[];for(const t of e){const[...e]=ft(n,t,r),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+ut(n),...i]}})}function Ot(){return vt("unknown",(()=>!0))}function jt(e,t,n){return new ht({...e,coercer:(r,i)=>yt(r,t)?e.coercer(n(r,i),i):e.coercer(r,i)})}var Lt=n(2630),Pt=n.n(Lt),Rt=n(7144),Dt=n(1386);const[Bt,Ut,zt]=[[],[],[]],Ht=BigInt(0),Ft=BigInt(1),Vt=BigInt(2),Wt=BigInt(7),Yt=BigInt(256),Kt=BigInt(113);for(let xa=0,Ea=Ft,ka=1,Ca=0;xa<24;xa++){[ka,Ca]=[Ca,(2*ka+3*Ca)%5],Bt.push(2*(5*Ca+ka)),Ut.push((xa+1)*(xa+2)/2%64);let e=Ht;for(let t=0;t<7;t++)Ea=(Ea<>Wt)*Kt)%Yt,Ea&Vt&&(e^=Ft<<(Ft<n>32?A(e,t,n):k(e,t,n),Xt=(e,t,n)=>n>32?T(e,t,n):C(e,t,n);class Qt extends g{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,o(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var a;this.state=new Uint8Array(200),this.state32=(a=this.state,new Uint32Array(a.buffer,a.byteOffset,Math.floor(a.byteLength/4)))}keccak(){!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,o=n[i],a=n[i+1],s=Zt(o,a,1)^n[t],c=Xt(o,a,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=s,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=Ut[n],o=Zt(t,i,r),a=Xt(t,i,r),s=Bt[n];t=e[s],i=e[s+1],e[s]=o,e[s+1]=a}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=qt[r],e[1]^=Gt[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){c(this);const{blockLen:t,state:n}=this,r=(e=m(e)).length;for(let i=0;i=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return o(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(u(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new Qt(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Jt=(e,t,n)=>v((()=>new Qt(t,e,n))),$t=Jt(1,136,32);class en extends g{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,s(e);const n=m(t);if(this.iHash=e.create(),"function"!==typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let o=0;onew en(e,t).update(n).digest();tn.create=(e,t)=>new en(e,t);const{bytesToNumberBE:nn,hexToBytes:rn}=r,on={Err:class extends Error{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},_parseInt(e){const{Err:t}=on;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:nn(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=on,n="string"===typeof e?rn(e):e;if(!B(n))throw new Error("ui8a expected");let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:o}=on._parseInt(n.subarray(2)),{d:a,l:s}=on._parseInt(o);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?"0".concat(t):t},r=t(n(e.s)),i=t(n(e.r)),o=r.length/2,a=i.length/2,s=n(o),c=n(a);return"30".concat(n(a+o+4),"02").concat(c).concat(i,"02").concat(s).concat(r)}},an=BigInt(0),sn=BigInt(1),cn=(BigInt(2),BigInt(3));BigInt(4);function un(e){const t=function(e){const t=Ee(e);ne(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const i=t.toAffine();return X(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){const{a:r,b:i}=t,o=n.sqr(e),a=n.mul(o,e);return n.add(n.add(a,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"===typeof e&&ann.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(i(Z("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),a=o(e);if(!n.eql(i,a))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:r,pz:i}=this,{px:o,py:a,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(o,i)),u=n.eql(n.mul(r,s),n.mul(a,i));return c&&u}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,cn),{px:o,py:a,pz:s}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,f=n.mul(o,o),h=n.mul(a,a),p=n.mul(s,s),m=n.mul(o,a);return m=n.add(m,m),l=n.mul(o,s),l=n.add(l,l),c=n.mul(e,l),u=n.mul(i,p),u=n.add(c,u),c=n.sub(h,u),u=n.add(h,u),u=n.mul(c,u),c=n.mul(m,c),l=n.mul(i,l),p=n.mul(e,p),m=n.sub(f,p),m=n.mul(e,m),m=n.add(m,l),l=n.add(f,f),f=n.add(l,f),f=n.add(f,p),f=n.mul(f,m),u=n.add(u,f),p=n.mul(a,s),p=n.add(p,p),f=n.mul(p,m),c=n.sub(c,f),l=n.mul(p,h),l=n.add(l,l),l=n.add(l,l),new d(c,u,l)}add(e){l(e);const{px:r,py:i,pz:o}=this,{px:a,py:s,pz:c}=e;let u=n.ZERO,f=n.ZERO,h=n.ZERO;const p=t.a,m=n.mul(t.b,cn);let y=n.mul(r,a),g=n.mul(i,s),v=n.mul(o,c),w=n.add(r,i),b=n.add(a,s);w=n.mul(w,b),b=n.add(y,g),w=n.sub(w,b),b=n.add(r,o);let S=n.add(a,c);return b=n.mul(b,S),S=n.add(y,v),b=n.sub(b,S),S=n.add(i,o),u=n.add(s,c),S=n.mul(S,u),u=n.add(g,v),S=n.sub(S,u),h=n.mul(p,b),u=n.mul(m,v),h=n.add(u,h),u=n.sub(g,h),h=n.add(g,h),f=n.mul(u,h),g=n.add(y,y),g=n.add(g,y),v=n.mul(p,v),b=n.mul(m,b),g=n.add(g,v),v=n.sub(y,v),v=n.mul(p,v),b=n.add(b,v),y=n.mul(g,b),f=n.add(f,y),y=n.mul(S,b),u=n.mul(w,u),u=n.sub(u,y),y=n.mul(w,g),h=n.mul(S,h),h=n.add(h,y),new d(u,f,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return h.wNAFCached(this,u,e,(e=>{const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(d.fromAffine)}))}multiplyUnsafe(e){const r=d.ZERO;if(e===an)return r;if(s(e),e===sn)return this;const{endo:i}=t;if(!i)return h.unsafeLadder(this,e);let{k1neg:o,k1:a,k2neg:c,k2:u}=i.splitScalar(e),l=r,f=r,p=this;for(;a>an||u>an;)a&sn&&(l=l.add(p)),u&sn&&(f=f.add(p)),p=p.double(),a>>=sn,u>>=sn;return o&&(l=l.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,i.beta),f.py,f.pz),l.add(f)}multiply(e){s(e);let r,i,o=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:s,k2:c}=a.splitScalar(o);let{p:u,f:l}=this.wNAF(t),{p:f,f:p}=this.wNAF(c);u=h.constTimeNegate(e,u),f=h.constTimeNegate(s,f),f=new d(n.mul(f.px,a.beta),f.py,f.pz),r=u.add(f),i=l.add(p)}else{const{p:e,f:t}=this.wNAF(o);r=e,i=t}return d.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,i=(e,t)=>t!==an&&t!==sn&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,n));return o.is0()?void 0:o}toAffine(e){const{px:t,py:r,pz:i}=this,o=this.is0();null==e&&(e=o?n.ONE:n.inv(i));const a=n.mul(t,e),s=n.mul(r,e),c=n.mul(i,e);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:a,y:s}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===sn)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===sn?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.assertValidity(),r(d,this,e)}toHex(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return z(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const f=t.nBitLength,h=xe(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function ln(e){const t=function(e){const t=Ee(e);return ne(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,i=n.BYTES+1,o=2*n.BYTES+1;function a(e){return le(e,r)}function s(e){return he(e,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=un({...t,toBytes(e,t,r){const i=t.toAffine(),o=n.toBytes(i.x),a=X;return r?a(Uint8Array.from([t.hasEvenY()?2:3]),o):a(Uint8Array.from([4]),o,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],a=e.subarray(1);if(t!==i||2!==r&&3!==r){if(t===o&&4===r){return{x:n.fromBytes(a.subarray(0,n.BYTES)),y:n.fromBytes(a.subarray(n.BYTES,2*n.BYTES))}}throw new Error("Point of length ".concat(t," was invalid. Expected ").concat(i," compressed bytes or ").concat(o," uncompressed bytes"))}{const e=Y(a);if(!(an<(s=e)&&sz(q(e,t.nByteLength));function h(e){return e>r>>sn}const p=(e,t,n)=>Y(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=Z("compactSignature",e,2*n),new m(p(e,0,n),p(e,n,2*n))}static fromDER(e){const{r:t,s:n}=on.toSig(Z("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:i,recovery:o}=this,u=w(Z("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const l=2===o||3===o?r+t.n:r;if(l>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=0===(1&o)?"02":"03",h=c.fromHex(d+f(l)),p=s(l),m=a(-u*p),y=a(i*p),g=c.BASE.multiplyAndAddUnsafe(h,m,y);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return W(this.toDERHex())}toDERHex(){return on.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return W(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const y={isValidPrivateKey(e){try{return u(e),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=be(t.n);return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.length,i=we(t),o=be(t);if(r<16||r1024)throw new Error("expected ".concat(o,"-1024 bytes of input, got ").concat(r));const a=le(n?Y(e):K(e),t-ie)+ie;return n?G(a,i):q(a,i)}(t.randomBytes(e),t.n)},precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function g(e){const t=B(e),n="string"===typeof e,r=(t||n)&&e.length;return t?r===i||r===o:n?r===2*i||r===2*o:e instanceof c}const v=t.bits2int||function(e){const n=Y(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},w=t.bits2int_modN||function(e){return a(v(e))},b=Q(t.nBitLength);function S(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(an<=e&&e2&&void 0!==arguments[2]?arguments[2]:x;if(["recovered","canonical"].some((e=>e in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:l}=t;let{lowS:f,prehash:p,extraEntropy:y}=i;null==f&&(f=!0),e=Z("msgHash",e),p&&(e=Z("prehashed msgHash",o(e)));const g=w(e),b=u(r),_=[S(b),S(g)];if(null!=y){const e=!0===y?l(n.BYTES):y;_.push(Z("extraEntropy",e))}const E=X(..._),k=g;return{seed:E,k2sig:function(e){const t=v(e);if(!d(t))return;const n=s(t),r=c.BASE.multiply(t).toAffine(),i=a(r.x);if(i===an)return;const o=a(n*a(k+i*b));if(o===an)return;let u=(r.x===i?0:2)|Number(r.y&sn),l=o;return f&&h(o)&&(l=function(e){return h(e)?a(-e):e}(o),u^=1),new m(i,l,u)}}}const x={lowS:t.lowS,prehash:!1},E={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(g(e))throw new Error("first arg must be private key");if(!g(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(n)},sign:function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x;const{seed:i,k2sig:o}=_(e,n,r),a=t;return ee(a.hash.outputLen,a.nByteLength,a.hmac)(i,o)},verify:function(e,n,r){var i;let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:E;const u=e;if(n=Z("msgHash",n),r=Z("publicKey",r),"strict"in o)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:d}=o;let f,h;try{if("string"===typeof u||B(u))try{f=m.fromDER(u)}catch(x){if(!(x instanceof on.Err))throw x;f=m.fromCompact(u)}else{if("object"!==typeof u||"bigint"!==typeof u.r||"bigint"!==typeof u.s)throw new Error("PARSE");{const{r:e,s:t}=u;f=new m(e,t)}}h=c.fromHex(r)}catch(k){if("PARSE"===k.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&f.hasHighS())return!1;d&&(n=t.hash(n));const{r:p,s:y}=f,g=w(n),v=s(y),b=a(g*v),S=a(p*v),_=null===(i=c.BASE.multiplyAndAddUnsafe(h,b,S))||void 0===i?void 0:i.toAffine();return!!_&&a(_.x)===p},ProjectivePoint:c,Signature:m,utils:y}}function dn(e){return{hash:e,hmac:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i(e+t/mn)/t;function gn(e){const t=fn,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=fe(l,n,t)*l%t,f=fe(d,n,t)*l%t,h=fe(f,mn,t)*u%t,p=fe(h,i,t)*h%t,m=fe(p,o,t)*p%t,y=fe(m,s,t)*m%t,g=fe(y,c,t)*y%t,v=fe(g,s,t)*m%t,w=fe(v,n,t)*l%t,b=fe(w,a,t)*p%t,S=fe(b,r,t)*u%t,_=fe(S,mn,t);if(!vn.eql(vn.sqr(_),e))throw new Error("Cannot find square root");return _}const vn=ve(fn,void 0,void 0,{sqrt:gn}),wn=function(e,t){const n=t=>ln({...e,...dn(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:vn,n:hn,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=hn,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-pn*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),s=yn(o*e,t),c=yn(-r*e,t);let u=le(e-s*n-c*i,t),l=le(-s*r-c*o,t);const d=u>a,f=l>a;if(d&&(u=t-u),f&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},rt);BigInt(0);wn.ProjectivePoint;const bn=Ye.utils.randomPrivateKey,Sn=()=>{const e=Ye.utils.randomPrivateKey(),t=_n(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},_n=Ye.getPublicKey;function xn(e){try{return Ye.ExtendedPoint.fromHex(e),!0}catch{return!1}}const En=(e,t)=>Ye.sign(e,t.slice(0,32)),kn=Ye.verify,Cn=e=>i.Buffer.isBuffer(e)?e:e instanceof Uint8Array?i.Buffer.from(e.buffer,e.byteOffset,e.byteLength):i.Buffer.from(e);class An{constructor(e){Object.assign(this,e)}encode(){return i.Buffer.from((0,it.serialize)(In,this))}static decode(e){return(0,it.deserialize)(In,this,e)}static decodeUnchecked(e){return(0,it.deserializeUnchecked)(In,this,e)}}class Tn extends An{constructor(e){if(super(e),this.enum="",1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map((e=>{this.enum=e}))}}const In=new Map;var Mn;let Nn;const On=32,jn=32;let Ln=1;Nn=Symbol.toStringTag;class Pn extends An{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=Qe().decode(e);if(t.length!=jn)throw new Error("Invalid public key input");this._bn=new(Ze())(t)}else this._bn=new(Ze())(e);if(this._bn.byteLength()>jn)throw new Error("Invalid public key input")}}static unique(){const e=new Pn(Ln);return Ln+=1,new Pn(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return Qe().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(i.Buffer);if(e.length===jn)return e;const t=i.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Nn](){return"PublicKey(".concat(this.toString(),")")}toString(){return this.toBase58()}static async createWithSeed(e,t,n){const r=i.Buffer.concat([e.toBuffer(),i.Buffer.from(t),n.toBuffer()]),o=rt(r);return new Pn(o)}static createProgramAddressSync(e,t){let n=i.Buffer.alloc(0);e.forEach((function(e){if(e.length>On)throw new TypeError("Max seed length exceeded");n=i.Buffer.concat([n,Cn(e)])})),n=i.Buffer.concat([n,t.toBuffer(),i.Buffer.from("ProgramDerivedAddress")]);const r=rt(n);if(xn(r))throw new Error("Invalid seeds, address must fall off the curve");return new Pn(r)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let n,r=255;for(;0!=r;){try{const o=e.concat(i.Buffer.from([r]));n=this.createProgramAddressSync(o,t)}catch(o){if(o instanceof TypeError)throw o;r--;continue}return[n,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return xn(new Pn(e).toBytes())}}Mn=Pn,Pn.default=new Mn("11111111111111111111111111111111"),In.set(Pn,{kind:"struct",fields:[["_bn","u256"]]});class Rn{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const t=Cn(e);if(64!==e.length)throw new Error("bad secret key size");this._publicKey=t.slice(32,64),this._secretKey=t.slice(0,32)}else this._secretKey=Cn(bn()),this._publicKey=Cn(_n(this._secretKey))}get publicKey(){return new Pn(this._publicKey)}get secretKey(){return i.Buffer.concat([this._secretKey,this._publicKey],64)}}const Dn=new Pn("BPFLoader1111111111111111111111111111111111"),Bn=1232,Un=127,zn=64;class Hn extends Error{constructor(e){super("Signature ".concat(e," has expired: block height exceeded.")),this.signature=void 0,this.signature=e}}Object.defineProperty(Hn.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class Fn extends Error{constructor(e,t){super("Transaction was not confirmed in ".concat(t.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools.")),this.signature=void 0,this.signature=e}}Object.defineProperty(Fn.prototype,"name",{value:"TransactionExpiredTimeoutError"});class Vn extends Error{constructor(e){super("Signature ".concat(e," has expired: the nonce is no longer valid.")),this.signature=void 0,this.signature=e}}Object.defineProperty(Vn.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class Wn{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e256)throw new Error("Account index overflow encountered during compilation");const t=new Map;this.keySegments().flat().forEach(((e,n)=>{t.set(e.toBase58(),n)}));const n=e=>{const n=t.get(e.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return e.map((e=>({programIdIndex:n(e.programId),accountKeyIndexes:e.keys.map((e=>n(e.pubkey))),data:e.data})))}}const Yn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return ot.Ik(32,e)},Kn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature";return ot.Ik(64,e)},qn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string";const t=ot.n_([ot.Jq("length"),ot.Jq("lengthPadding"),ot.Ik(ot.cv(ot.Jq(),-8),"chars")],e),n=t.decode.bind(t),r=t.encode.bind(t),o=t;return o.decode=(e,t)=>n(e,t).chars.toString(),o.encode=(e,t,n)=>{const o={chars:i.Buffer.from(e,"utf8")};return r(o,t,n)},o.alloc=e=>ot.Jq().span+ot.Jq().span+i.Buffer.from(e,"utf8").length,o};function Gn(e,t){const n=e=>{if(e.span>=0)return e.span;if("function"===typeof e.alloc)return e.alloc(t[e.property]);if("count"in e&&"elementLayout"in e){const r=t[e.property];if(Array.isArray(r))return r.length*n(e.elementLayout)}else if("fields"in e)return Gn({layout:e},t[e.property]);return 0};let r=0;return e.layout.fields.forEach((e=>{r+=n(e)})),r}function Zn(e){let t=0,n=0;for(;;){let r=e.shift();if(t|=(127&r)<<7*n,n+=1,0===(128&r))break}return t}function Xn(e,t){let n=t;for(;;){let t=127&n;if(n>>=7,0==n){e.push(t);break}t|=128,e.push(t)}}function Qn(e,t){if(!e)throw new Error(t||"Assertion failed")}class Jn{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const n=new Map,r=e=>{const t=e.toBase58();let r=n.get(t);return void 0===r&&(r={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(t,r)),r},i=r(t);i.isSigner=!0,i.isWritable=!0;for(const o of e){r(o.programId).isInvoked=!0;for(const e of o.keys){const t=r(e.pubkey);t.isSigner||(t.isSigner=e.isSigner),t.isWritable||(t.isWritable=e.isWritable)}}return new Jn(t,n)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Qn(e.length<=256,"Max static account keys length exceeded");const t=e.filter((e=>{let[,t]=e;return t.isSigner&&t.isWritable})),n=e.filter((e=>{let[,t]=e;return t.isSigner&&!t.isWritable})),r=e.filter((e=>{let[,t]=e;return!t.isSigner&&t.isWritable})),i=e.filter((e=>{let[,t]=e;return!t.isSigner&&!t.isWritable})),o={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{Qn(t.length>0,"Expected at least one writable signer key");const[e]=t[0];Qn(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...t.map((e=>{let[t]=e;return new Pn(t)})),...n.map((e=>{let[t]=e;return new Pn(t)})),...r.map((e=>{let[t]=e;return new Pn(t)})),...i.map((e=>{let[t]=e;return new Pn(t)}))]]}extractTableLookup(e){const[t,n]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&e.isWritable)),[r,i]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&!e.isWritable));if(0!==t.length||0!==r.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:r},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(e,t){const n=new Array,r=new Array;for(const[i,o]of this.keyMetaMap.entries())if(t(o)){const t=new Pn(i),o=e.findIndex((e=>e.equals(t)));o>=0&&(Qn(o<256,"Max lookup table index exceeded"),n.push(o),r.push(t),this.keyMetaMap.delete(i))}return[n,r]}}class $n{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 Pn(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:Qe().decode(e.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new Wn(this.staticAccountKeys)}static compile(e){const t=Jn.compile(e.instructions,e.payerKey),[n,r]=t.getMessageComponents(),i=new Wn(r).compileInstructions(e.instructions).map((e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:Qe().encode(e.data)})));return new $n({header:n,accountKeys:r,recentBlockhash:e.recentBlockhash,instructions:i})}isAccountSigner(e){return e=this.header.numRequiredSignatures){return e-t!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];Xn(t,e);const n=this.instructions.map((e=>{const{accounts:t,programIdIndex:n}=e,r=Array.from(Qe().decode(e.data));let o=[];Xn(o,t.length);let a=[];return Xn(a,r.length),{programIdIndex:n,keyIndicesCount:i.Buffer.from(o),keyIndices:t,dataLength:i.Buffer.from(a),data:r}}));let r=[];Xn(r,n.length);let o=i.Buffer.alloc(Bn);i.Buffer.from(r).copy(o);let a=r.length;n.forEach((e=>{const t=ot.n_([ot.u8("programIdIndex"),ot.Ik(e.keyIndicesCount.length,"keyIndicesCount"),ot.A9(ot.u8("keyIndex"),e.keyIndices.length,"keyIndices"),ot.Ik(e.dataLength.length,"dataLength"),ot.A9(ot.u8("userdatum"),e.data.length,"data")]).encode(e,o,a);a+=t})),o=o.slice(0,a);const s=ot.n_([ot.Ik(1,"numRequiredSignatures"),ot.Ik(1,"numReadonlySignedAccounts"),ot.Ik(1,"numReadonlyUnsignedAccounts"),ot.Ik(t.length,"keyCount"),ot.A9(Yn("key"),e,"keys"),Yn("recentBlockhash")]),c={numRequiredSignatures:i.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:i.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:i.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:i.Buffer.from(t),keys:this.accountKeys.map((e=>Cn(e.toBytes()))),recentBlockhash:Qe().decode(this.recentBlockhash)};let u=i.Buffer.alloc(2048);const l=s.encode(c,u);return o.copy(u,l),u.slice(0,l+o.length)}static from(e){let t=[...e];const n=t.shift();if(n!==(n&Un))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const r=t.shift(),o=t.shift(),a=Zn(t);let s=[];for(let f=0;f0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Wn(this.staticAccountKeys,t)}isAccountSigner(e){return e=n){return e-ne+t.writableIndexes.length),0)}if(e>=this.header.numRequiredSignatures){return e-te.key.equals(n.accountKey)));if(!r)throw new Error("Failed to find address lookup table account for table key ".concat(n.accountKey.toBase58()));for(const e of n.writableIndexes){if(!(ee.toBytes())),recentBlockhash:Qe().decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:r},a);return a.slice(0,s)}serializeInstructions(){let e=0;const t=new Uint8Array(Bn);for(const n of this.compiledInstructions){const r=Array();Xn(r,n.accountKeyIndexes.length);const i=Array();Xn(i,n.data.length);e+=ot.n_([ot.u8("programIdIndex"),ot.Ik(r.length,"encodedAccountKeyIndexesLength"),ot.A9(ot.u8(),n.accountKeyIndexes.length,"accountKeyIndexes"),ot.Ik(i.length,"encodedDataLength"),ot.Ik(n.data.length,"data")]).encode({programIdIndex:n.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(r),accountKeyIndexes:n.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:n.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(Bn);for(const n of this.addressTableLookups){const r=Array();Xn(r,n.writableIndexes.length);const i=Array();Xn(i,n.readonlyIndexes.length);e+=ot.n_([Yn("accountKey"),ot.Ik(r.length,"encodedWritableIndexesLength"),ot.A9(ot.u8(),n.writableIndexes.length,"writableIndexes"),ot.Ik(i.length,"encodedReadonlyIndexesLength"),ot.A9(ot.u8(),n.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:n.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(r),writableIndexes:n.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:n.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const n=t.shift(),r=n&Un;Qn(n!==r,"Expected versioned message but received legacy message");Qn(0===r,"Expected versioned message with version 0 but found version ".concat(r));const i={numRequiredSignatures:t.shift(),numReadonlySignedAccounts:t.shift(),numReadonlyUnsignedAccounts:t.shift()},o=[],a=Zn(t);for(let f=0;f{const t=tr.deserializeMessageVersion(e);if("legacy"===t)return $n.from(e);if(0===t)return er.deserialize(e);throw new Error("Transaction message version ".concat(t," deserialization is not supported"))}};let nr=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({});const rr=i.Buffer.alloc(zn).fill(0);class ir{constructor(e){this.keys=void 0,this.programId=void 0,this.data=i.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((e=>{let{pubkey:t,isSigner:n,isWritable:r}=e;return{pubkey:t.toJSON(),isSigner:n,isWritable:r}})),programId:this.programId.toJSON(),data:[...this.data]}}}class or{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)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:n}=e;this.minNonceContextSlot=t,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:n}=e;this.recentBlockhash=t,this.lastValidBlockHeight=n}else{const{recentBlockhash:t,nonceInfo:n}=e;n&&(this.nonceInfo=n),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((e=>{let{publicKey:t}=e;return t.toJSON()}))}}add(){for(var e=arguments.length,t=new Array(e),n=0;n{"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 ir(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t,n;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 new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(let p=0;p{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();r.includes(t)||r.push(t)})),r.forEach((e=>{i.push({pubkey:new Pn(e),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),n=o.findIndex((e=>e.pubkey.toString()===t));n>-1?(o[n].isWritable=o[n].isWritable||e.isWritable,o[n].isSigner=o[n].isSigner||e.isSigner):o.push(e)})),o.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const a=o.findIndex((e=>e.pubkey.equals(n)));if(a>-1){const[e]=o.splice(a,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(const p of this.signatures){const e=o.findIndex((e=>e.pubkey.equals(p.publicKey)));if(!(e>-1))throw new Error("unknown signer: ".concat(p.publicKey.toString()));o[e].isSigner||(o[e].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."))}let s=0,c=0,u=0;const l=[],d=[];o.forEach((e=>{let{pubkey:t,isSigner:n,isWritable:r}=e;n?(l.push(t.toString()),s+=1,r||(c+=1)):(d.push(t.toString()),r||(u+=1))}));const f=l.concat(d),h=t.map((e=>{const{data:t,programId:n}=e;return{programIdIndex:f.indexOf(n.toString()),accounts:e.keys.map((e=>f.indexOf(e.pubkey.toString()))),data:Qe().encode(t)}}));return h.forEach((e=>{Qn(e.programIdIndex>=0),e.accounts.forEach((e=>Qn(e>=0)))})),new $n({header:{numRequiredSignatures:s,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:f,recentBlockhash:e,instructions:h})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){if(this.signatures.every(((e,n)=>t[n].equals(e.publicKey))))return e}return 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(){for(var e=arguments.length,t=new Array(e),n=0;n{const t=e.toString();return!r.has(t)&&(r.add(t),!0)})).map((e=>({signature:null,publicKey:e})))}sign(){for(var e=arguments.length,t=new Array(e),n=0;n({signature:null,publicKey:e.publicKey})));const o=this._compile();this._partialSign(o,...i)}partialSign(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;i{const n=En(t,e.secretKey);this._addSignature(e.publicKey,Cn(n))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Qn(64===t.length);const n=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(n<0)throw new Error("unknown signer: ".concat(e.toString()));this.signatures[n].signature=i.Buffer.from(t)}verifySignatures(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const n={};for(const{signature:r,publicKey:i}of this.signatures)null===r?t&&(n.missing||(n.missing=[])).push(i):kn(r,e,i.toBytes())||(n.invalid||(n.invalid=[])).push(i);return n.invalid||n.missing?n:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),r=this.serializeMessage();if(n){const e=this._getMessageSignednessErrors(r,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+="\nInvalid signature for public key".concat(1===e.invalid.length?"":"(s)"," [`").concat(e.invalid.map((e=>e.toBase58())).join("`, `"),"`].")),e.missing&&(t+="\nMissing signature for public key".concat(1===e.missing.length?"":"(s)"," [`").concat(e.missing.map((e=>e.toBase58())).join("`, `"),"`].")),new Error(t)}}return this._serialize(r)}_serialize(e){const{signatures:t}=this,n=[];Xn(n,t.length);const r=n.length+64*t.length+e.length,o=i.Buffer.alloc(r);return Qn(t.length<256),i.Buffer.from(n).copy(o,0),t.forEach(((e,t)=>{let{signature:r}=e;null!==r&&(Qn(64===r.length,"signature has invalid length"),i.Buffer.from(r).copy(o,n.length+64*t))})),e.copy(o,n.length+64*t.length),Qn(o.length<=Bn,"Transaction too large: ".concat(o.length," > ").concat(Bn)),o}get keys(){return Qn(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return Qn(1===this.instructions.length),this.instructions[0].programId}get data(){return Qn(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const n=Zn(t);let r=[];for(let o=0;o1&&void 0!==arguments[1]?arguments[1]:[];const n=new or;return n.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(n.feePayer=e.accountKeys[0]),t.forEach(((t,r)=>{const i={signature:t==Qe().encode(rr)?null:Qe().decode(t),publicKey:e.accountKeys[r]};n.signatures.push(i)})),e.instructions.forEach((t=>{const r=t.accounts.map((t=>{const r=e.accountKeys[t];return{pubkey:r,isSigner:n.signatures.some((e=>e.publicKey.toString()===r.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));n.instructions.push(new ir({keys:r,programId:e.accountKeys[t.programIdIndex],data:Qe().decode(t.data)}))})),n._message=e,n._json=n.toJSON(),n}}class ar{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,t){const{header:n,compiledInstructions:r,recentBlockhash:i}=e,{numRequiredSignatures:o,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:s}=n,c=o-a;Qn(c>0,"Message header is invalid");const u=e.staticAccountKeys.length-o-s;Qn(u>=0,"Message header is invalid");const l=e.getAccountKeys(t),d=l.get(0);if(void 0===d)throw new Error("Failed to decompile message because no account keys were found");const f=[];for(const h of r){const e=[];for(const r of h.accountKeyIndexes){const t=l.get(r);if(void 0===t)throw new Error("Failed to find key for account key index ".concat(r));let i;i=re.equals(r.publicKey)));Qn(e>=0,"Cannot sign with non signer key ".concat(r.publicKey.toBase58())),this.signatures[e]=En(t,r.secretKey)}}addSignature(e,t){Qn(64===t.byteLength,"Signature must be 64 bytes long");const n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((t=>t.equals(e)));Qn(n>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[n]=t}}const cr=new Pn("SysvarC1ock11111111111111111111111111111111"),ur=new Pn("SysvarEpochSchedu1e111111111111111111111111"),lr=new Pn("Sysvar1nstructions1111111111111111111111111"),dr=new Pn("SysvarRecentB1ockHashes11111111111111111111"),fr=new Pn("SysvarRent111111111111111111111111111111111"),hr=new Pn("SysvarRewards111111111111111111111111111111"),pr=new Pn("SysvarS1otHashes111111111111111111111111111"),mr=new Pn("SysvarS1otHistory11111111111111111111111111"),yr=new Pn("SysvarStakeHistory1111111111111111111111111");async function gr(e,t,n,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},o=await e.sendTransaction(t,n,i);let a;if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)a=(await e.confirmTransaction({abortSignal:null===r||void 0===r?void 0:r.abortSignal,signature:o,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},r&&r.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){const{nonceInstruction:n}=t.nonceInfo,i=n.keys[0].pubkey;a=(await e.confirmTransaction({abortSignal:null===r||void 0===r?void 0:r.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:i,nonceValue:t.nonceInfo.nonce,signature:o},r&&r.commitment)).value}else null!=(null===r||void 0===r?void 0:r.abortSignal)&&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."),a=(await e.confirmTransaction(o,r&&r.commitment)).value;if(a.err)throw new Error("Transaction ".concat(o," failed (").concat(JSON.stringify(a),")"));return o}function vr(e){return new Promise((t=>setTimeout(t,e)))}function wr(e,t){const n=e.layout.span>=0?e.layout.span:Gn(e,t),r=i.Buffer.alloc(n),o=Object.assign({instruction:e.index},t);return e.layout.encode(o,r),r}function br(e,t){let n;try{n=e.layout.decode(t)}catch(r){throw new Error("invalid instruction; "+r)}if(n.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(n.instruction," != ").concat(e.index));return n}const Sr=ot._O("lamportsPerSignature"),_r=ot.n_([ot.Jq("version"),ot.Jq("state"),Yn("authorizedPubkey"),Yn("nonce"),ot.n_([Sr],"feeCalculator")]),xr=_r.span;class Er{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=_r.decode(Cn(e),0);return new Er({authorizedPubkey:new Pn(t.authorizedPubkey),nonce:new Pn(t.nonce).toString(),feeCalculator:t.feeCalculator})}}const kr=(Cr=8,e=>{const t=(0,ot.Ik)(Cr,e),{encode:n,decode:r}=(e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)}))(t),o=t;return o.decode=(e,t)=>{const n=r(e,t);return(0,at.oU)(i.Buffer.from(n))},o.encode=(e,t,r)=>{const i=(0,at.k$)(e,Cr);return n(i,t,r)},o});var Cr;class Ar{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ot.Jq("instruction").decode(e.data);let n;for(const[r,i]of Object.entries(Tr))if(i.index==t){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a SystemInstruction");return n}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t,space:n,programId:r}=br(Tr.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:t,space:n,programId:new Pn(r)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t}=br(Tr.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t,seed:n,programId:r}=br(Tr.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:t,seed:n,programId:new Pn(r)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:t}=br(Tr.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:t}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:n,space:r,programId:i}=br(Tr.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Pn(t),seed:n,space:r,programId:new Pn(i)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:t}=br(Tr.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new Pn(t)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:n,programId:r}=br(Tr.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Pn(t),seed:n,programId:new Pn(r)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:t,seed:n,lamports:r,space:i,programId:o}=br(Tr.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Pn(t),seed:n,lamports:r,space:i,programId:new Pn(o)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:t}=br(Tr.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Pn(t)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),br(Tr.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=br(Tr.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t}=br(Tr.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Pn(t)}}static checkProgramId(e){if(!e.equals(Ir.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,t){if(e.length0?i:1,space:o.length,programId:r}));null!==s&&await gr(e,s,[t,n],{commitment:"confirmed"})}const a=ot.n_([ot.Jq("instruction"),ot.Jq("offset"),ot.Jq("bytesLength"),ot.Jq("bytesLengthPadding"),ot.A9(ot.u8("byte"),ot.cv(ot.Jq(),-8),"bytes")]),s=Nr.chunkSize;let c=0,u=o,l=[];for(;u.length>0;){const o=u.slice(0,s),d=i.Buffer.alloc(s+16);a.encode({instruction:0,offset:c,bytes:o,bytesLength:0,bytesLengthPadding:0},d);const f=(new or).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:r,data:d});if(l.push(gr(e,f,[t,n],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await vr(1e3/e)}c+=s,u=u.slice(s)}await Promise.all(l);{const o=ot.n_([ot.Jq("instruction")]),a=i.Buffer.alloc(o.span);o.encode({instruction:1},a);const s=(new or).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:fr,isSigner:!1,isWritable:!1}],programId:r,data:a}),c="processed",u=await e.sendTransaction(s,[t,n],{preflightCommitment:c}),{context:l,value:d}=await e.confirmTransaction({signature:u,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},c);if(d.err)throw new Error("Transaction ".concat(u," failed (").concat(JSON.stringify(d),")"));for(;;){try{if(await e.getSlot({commitment:c})>l.slot)break}catch{}await new Promise((e=>setTimeout(e,Math.round(200))))}}return!0}}Nr.chunkSize=Mr;const Or=new Pn("BPFLoader2111111111111111111111111111111111");class jr{static getMinNumSignatures(e){return Nr.getMinNumSignatures(e)}static load(e,t,n,r,i){return Nr.load(e,t,n,i,r)}}function Lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pr=Object.prototype.toString,Rr=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function Dr(e,t){var n,r,i,o,a,s,c;if(!0===e)return"true";if(!1===e)return"false";switch(typeof e){case"object":if(null===e)return null;if(e.toJSON&&"function"===typeof e.toJSON)return Dr(e.toJSON(),t);if("[object Array]"===(c=Pr.call(e))){for(i="[",r=e.length-1,n=0;n-1&&(i+=Dr(e[n],!0)),i+"]"}if("[object Object]"===c){for(r=(o=Rr(e).sort()).length,i="",n=0;n1;)e/=2,t++;return t}class zr{constructor(e,t,n,r,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=n,this.firstNormalEpoch=r,this.firstNormalSlot=i}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,1+(t|=t>>32)))-Ur(32)-1;return[n,e-(this.getSlotsInEpoch(n)-32)]}{const t=e-this.firstNormalSlot,n=Math.floor(t/this.slotsPerEpoch);return[this.firstNormalEpoch+n,t%this.slotsPerEpoch]}var t}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e{const n=(0,Dt.Z)(e,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return this.underlyingSocket="socket"in n?n.socket:n,n}),e,t,n),this.underlyingSocket=void 0}call(){var e;const t=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState;return 1===t?super.call(...arguments):Promise.reject(new Error("Tried to call a JSON-RPC method `"+(arguments.length<=0?void 0:arguments[0])+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(){var e;const t=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState;return 1===t?super.notify(...arguments):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+(arguments.length<=0?void 0:arguments[0])+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}}class Kr{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=function(e,t){let n;try{n=e.layout.decode(t)}catch(r){throw new Error("invalid instruction; "+r)}if(n.typeIndex!==e.index)throw new Error("invalid account data; account type mismatch ".concat(n.typeIndex," != ").concat(e.index));return n}(qr,e),n=e.length-56;Qn(n>=0,"lookup table is invalid"),Qn(n%32===0,"lookup table is invalid");const r=n/32,{addresses:i}=ot.n_([ot.A9(Yn(),r,"addresses")]).decode(e.slice(56));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:0!==t.authority.length?new Pn(t.authority[0]):void 0,addresses:i.map((e=>new Pn(e)))}}}const qr={index:1,layout:ot.n_([ot.Jq("typeIndex"),kr("deactivationSlot"),ot._O("lastExtendedSlot"),ot.u8("lastExtendedStartIndex"),ot.u8(),ot.A9(Yn(),ot.cv(ot.u8(),-1),"authority")])},Gr=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;const Zr=jt(St(Pn),Tt(),(e=>new Pn(e))),Xr=It([Tt(),_t("base64")]),Qr=jt(St(i.Buffer),Xr,(e=>i.Buffer.from(e[0],"base64"))),Jr=3e4;function $r(e){let t,n;if("string"===typeof e)t=e;else if(e){const{commitment:r,...i}=e;t=r,n=i}return{commitment:t,config:n}}function ei(e){return Nt([Mt({jsonrpc:_t("2.0"),id:Tt(),result:e}),Mt({jsonrpc:_t("2.0"),id:Tt(),error:Mt({code:Ot(),message:Tt(),data:Ct(vt("any",(()=>!0)))})})])}const ti=ei(Ot());function ni(e){return jt(ei(e),ti,(t=>"error"in t?t:{...t,result:mt(t.result,e)}))}function ri(e){return ni(Mt({context:Mt({slot:kt()}),value:e}))}function ii(e){return Mt({context:Mt({slot:kt()}),value:e})}function oi(e,t){return 0===e?new er({header:t.header,staticAccountKeys:t.accountKeys.map((e=>new Pn(e))),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Qe().decode(e.data)}))),addressTableLookups:t.addressTableLookups}):new $n(t)}const ai=Mt({foundation:kt(),foundationTerm:kt(),initial:kt(),taper:kt(),terminal:kt()}),si=ni(wt(Et(Mt({epoch:kt(),effectiveSlot:kt(),amount:kt(),postBalance:kt(),commission:Ct(Et(kt()))})))),ci=wt(Mt({slot:kt(),prioritizationFee:kt()})),ui=Mt({total:kt(),validator:kt(),foundation:kt(),epoch:kt()}),li=Mt({epoch:kt(),slotIndex:kt(),slotsInEpoch:kt(),absoluteSlot:kt(),blockHeight:Ct(kt()),transactionCount:Ct(kt())}),di=Mt({slotsPerEpoch:kt(),leaderScheduleSlotOffset:kt(),warmup:bt(),firstNormalEpoch:kt(),firstNormalSlot:kt()}),fi=At(Tt(),wt(kt())),hi=Et(Nt([Mt({}),Tt()])),pi=Mt({err:hi}),mi=_t("receivedSignature"),yi=Mt({"solana-core":Tt(),"feature-set":Ct(kt())}),gi=ri(Mt({err:Et(Nt([Mt({}),Tt()])),logs:Et(wt(Tt())),accounts:Ct(Et(wt(Et(Mt({executable:bt(),owner:Tt(),lamports:kt(),data:wt(Tt()),rentEpoch:Ct(kt())}))))),unitsConsumed:Ct(kt()),returnData:Ct(Et(Mt({programId:Tt(),data:It([Tt(),_t("base64")])})))})),vi=ri(Mt({byIdentity:At(Tt(),wt(kt())),range:Mt({firstSlot:kt(),lastSlot:kt()})}));const wi=ni(ai),bi=ni(ui),Si=ni(ci),_i=ni(li),xi=ni(di),Ei=ni(fi),ki=ni(kt()),Ci=ri(Mt({total:kt(),circulating:kt(),nonCirculating:kt(),nonCirculatingAccounts:wt(Zr)})),Ai=Mt({amount:Tt(),uiAmount:Et(kt()),decimals:kt(),uiAmountString:Ct(Tt())}),Ti=ri(wt(Mt({address:Zr,amount:Tt(),uiAmount:Et(kt()),decimals:kt(),uiAmountString:Ct(Tt())}))),Ii=ri(wt(Mt({pubkey:Zr,account:Mt({executable:bt(),owner:Zr,lamports:kt(),data:Qr,rentEpoch:kt()})}))),Mi=Mt({program:Tt(),parsed:Ot(),space:kt()}),Ni=ri(wt(Mt({pubkey:Zr,account:Mt({executable:bt(),owner:Zr,lamports:kt(),data:Mi,rentEpoch:kt()})}))),Oi=ri(wt(Mt({lamports:kt(),address:Zr}))),ji=Mt({executable:bt(),owner:Zr,lamports:kt(),data:Qr,rentEpoch:kt()}),Li=Mt({pubkey:Zr,account:ji}),Pi=jt(Nt([St(i.Buffer),Mi]),Nt([Xr,Mi]),(e=>Array.isArray(e)?mt(e,Qr):e)),Ri=Mt({executable:bt(),owner:Zr,lamports:kt(),data:Pi,rentEpoch:kt()}),Di=Mt({pubkey:Zr,account:Ri}),Bi=Mt({state:Nt([_t("active"),_t("inactive"),_t("activating"),_t("deactivating")]),active:kt(),inactive:kt()}),Ui=ni(wt(Mt({signature:Tt(),slot:kt(),err:hi,memo:Et(Tt()),blockTime:Ct(Et(kt()))}))),zi=ni(wt(Mt({signature:Tt(),slot:kt(),err:hi,memo:Et(Tt()),blockTime:Ct(Et(kt()))}))),Hi=Mt({subscription:kt(),result:ii(ji)}),Fi=Mt({pubkey:Zr,account:ji}),Vi=Mt({subscription:kt(),result:ii(Fi)}),Wi=Mt({parent:kt(),slot:kt(),root:kt()}),Yi=Mt({subscription:kt(),result:Wi}),Ki=Nt([Mt({type:Nt([_t("firstShredReceived"),_t("completed"),_t("optimisticConfirmation"),_t("root")]),slot:kt(),timestamp:kt()}),Mt({type:_t("createdBank"),parent:kt(),slot:kt(),timestamp:kt()}),Mt({type:_t("frozen"),slot:kt(),timestamp:kt(),stats:Mt({numTransactionEntries:kt(),numSuccessfulTransactions:kt(),numFailedTransactions:kt(),maxTransactionsPerEntry:kt()})}),Mt({type:_t("dead"),slot:kt(),timestamp:kt(),err:Tt()})]),qi=Mt({subscription:kt(),result:Ki}),Gi=Mt({subscription:kt(),result:ii(Nt([pi,mi]))}),Zi=Mt({subscription:kt(),result:kt()}),Xi=Mt({pubkey:Tt(),gossip:Et(Tt()),tpu:Et(Tt()),rpc:Et(Tt()),version:Et(Tt())}),Qi=Mt({votePubkey:Tt(),nodePubkey:Tt(),activatedStake:kt(),epochVoteAccount:bt(),epochCredits:wt(It([kt(),kt(),kt()])),commission:kt(),lastVote:kt(),rootSlot:Et(kt())}),Ji=ni(Mt({current:wt(Qi),delinquent:wt(Qi)})),$i=Nt([_t("processed"),_t("confirmed"),_t("finalized")]),eo=Mt({slot:kt(),confirmations:Et(kt()),err:hi,confirmationStatus:Ct($i)}),to=ri(wt(Et(eo))),no=ni(kt()),ro=Mt({accountKey:Zr,writableIndexes:wt(kt()),readonlyIndexes:wt(kt())}),io=Mt({signatures:wt(Tt()),message:Mt({accountKeys:wt(Tt()),header:Mt({numRequiredSignatures:kt(),numReadonlySignedAccounts:kt(),numReadonlyUnsignedAccounts:kt()}),instructions:wt(Mt({accounts:wt(kt()),data:Tt(),programIdIndex:kt()})),recentBlockhash:Tt(),addressTableLookups:Ct(wt(ro))})}),oo=Mt({pubkey:Zr,signer:bt(),writable:bt(),source:Ct(Nt([_t("transaction"),_t("lookupTable")]))}),ao=Mt({accountKeys:wt(oo),signatures:wt(Tt())}),so=Mt({parsed:Ot(),program:Tt(),programId:Zr}),co=Mt({accounts:wt(Zr),data:Tt(),programId:Zr}),uo=jt(Nt([co,so]),Nt([Mt({parsed:Ot(),program:Tt(),programId:Tt()}),Mt({accounts:wt(Tt()),data:Tt(),programId:Tt()})]),(e=>mt(e,"accounts"in e?co:so))),lo=Mt({signatures:wt(Tt()),message:Mt({accountKeys:wt(oo),instructions:wt(uo),recentBlockhash:Tt(),addressTableLookups:Ct(Et(wt(ro)))})}),fo=Mt({accountIndex:kt(),mint:Tt(),owner:Ct(Tt()),uiTokenAmount:Ai}),ho=Mt({writable:wt(Zr),readonly:wt(Zr)}),po=Mt({err:hi,fee:kt(),innerInstructions:Ct(Et(wt(Mt({index:kt(),instructions:wt(Mt({accounts:wt(kt()),data:Tt(),programIdIndex:kt()}))})))),preBalances:wt(kt()),postBalances:wt(kt()),logMessages:Ct(Et(wt(Tt()))),preTokenBalances:Ct(Et(wt(fo))),postTokenBalances:Ct(Et(wt(fo))),loadedAddresses:Ct(ho),computeUnitsConsumed:Ct(kt())}),mo=Mt({err:hi,fee:kt(),innerInstructions:Ct(Et(wt(Mt({index:kt(),instructions:wt(uo)})))),preBalances:wt(kt()),postBalances:wt(kt()),logMessages:Ct(Et(wt(Tt()))),preTokenBalances:Ct(Et(wt(fo))),postTokenBalances:Ct(Et(wt(fo))),loadedAddresses:Ct(ho),computeUnitsConsumed:Ct(kt())}),yo=Nt([_t(0),_t("legacy")]),go=Mt({pubkey:Tt(),lamports:kt(),postBalance:Et(kt()),rewardType:Et(Tt()),commission:Ct(Et(kt()))}),vo=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),transactions:wt(Mt({transaction:io,meta:Et(po),version:Ct(yo)})),rewards:Ct(wt(go)),blockTime:Et(kt()),blockHeight:Et(kt())}))),wo=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),rewards:Ct(wt(go)),blockTime:Et(kt()),blockHeight:Et(kt())}))),bo=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),transactions:wt(Mt({transaction:ao,meta:Et(po),version:Ct(yo)})),rewards:Ct(wt(go)),blockTime:Et(kt()),blockHeight:Et(kt())}))),So=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),transactions:wt(Mt({transaction:lo,meta:Et(mo),version:Ct(yo)})),rewards:Ct(wt(go)),blockTime:Et(kt()),blockHeight:Et(kt())}))),_o=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),transactions:wt(Mt({transaction:ao,meta:Et(mo),version:Ct(yo)})),rewards:Ct(wt(go)),blockTime:Et(kt()),blockHeight:Et(kt())}))),xo=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),rewards:Ct(wt(go)),blockTime:Et(kt()),blockHeight:Et(kt())}))),Eo=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),transactions:wt(Mt({transaction:io,meta:Et(po)})),rewards:Ct(wt(go)),blockTime:Et(kt())}))),ko=ni(Et(Mt({blockhash:Tt(),previousBlockhash:Tt(),parentSlot:kt(),signatures:wt(Tt()),blockTime:Et(kt())}))),Co=ni(Et(Mt({slot:kt(),meta:Et(po),blockTime:Ct(Et(kt())),transaction:io,version:Ct(yo)}))),Ao=ni(Et(Mt({slot:kt(),transaction:lo,meta:Et(mo),blockTime:Ct(Et(kt())),version:Ct(yo)}))),To=ri(Mt({blockhash:Tt(),feeCalculator:Mt({lamportsPerSignature:kt()})})),Io=ri(Mt({blockhash:Tt(),lastValidBlockHeight:kt()})),Mo=ri(bt()),No=ni(wt(Mt({slot:kt(),numTransactions:kt(),numSlots:kt(),samplePeriodSecs:kt()}))),Oo=ri(Et(Mt({feeCalculator:Mt({lamportsPerSignature:kt()})}))),jo=ni(Tt()),Lo=ni(Tt()),Po=Mt({err:hi,logs:wt(Tt()),signature:Tt()}),Ro=Mt({result:ii(Po),subscription:kt()}),Do={"solana-client":"js/".concat("0.0.0-development")};class Bo{constructor(e,t){let n,r,i,o,a,s;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const e={};return async t=>{var n;const{commitment:r,config:i}=$r(t),o=this._buildArgs([],r,void 0,i),a=Br(o);return e[a]=null!==(n=e[a])&&void 0!==n?n:(async()=>{try{const e=mt(await this._rpcRequest("getBlockHeight",o),ni(kt()));if("error"in e)throw new Vr(e.error,"failed to get block height information");return e.result}finally{delete e[a]}})(),await e[a]}})(),t&&"string"===typeof t?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,n=t.wsEndpoint,r=t.httpHeaders,i=t.fetch,o=t.fetchMiddleware,a=t.disableRetryOnRateLimit,s=t.httpAgent),this._rpcEndpoint=function(e){if(!1===/^https?:/.test(e))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}(e),this._rpcWsEndpoint=n||function(e){const t=e.match(Gr);if(null==t)throw TypeError("Failed to validate endpoint URL `".concat(e,"`"));const[n,r,i,o]=t,a=e.startsWith("https:")?"wss:":"ws:",s=null==i?null:parseInt(i.slice(1),10),c=null==s?"":":".concat(s+1);return"".concat(a,"//").concat(r).concat(c).concat(o)}(e),this._rpcClient=function(e,t,n,r,i,o){const a=n||Wr;let s;return null!=o&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),r&&(s=async(e,t)=>{const n=await new Promise(((n,i)=>{try{r(e,t,((e,t)=>n([e,t])))}catch(o){i(o)}}));return await a(...n)}),new(Pt())((async(n,r)=>{const o={method:"POST",body:n,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},t||{},Do)};try{let t,n=5,c=500;for(;t=s?await s(e,o):await a(e,o),429===t.status&&!0!==i&&(n-=1,0!==n);)console.log("Server responded with ".concat(t.status," ").concat(t.statusText,". Retrying after ").concat(c,"ms delay...")),await vr(c),c*=2;const u=await t.text();t.ok?r(null,u):r(new Error("".concat(t.status," ").concat(t.statusText,": ").concat(u)))}catch(c){c instanceof Error&&r(c)}}),{})}(e,r,i,o,a,s),this._rpcRequest=function(e){return(t,n)=>new Promise(((r,i)=>{e.request(t,n,((e,t)=>{e?i(e):r(t)}))}))}(this._rpcClient),this._rpcBatchRequest=function(e){return t=>new Promise(((n,r)=>{0===t.length&&n([]);const i=t.map((t=>e.request(t.methodName,t.args)));e.request(i,((e,t)=>{e?r(e):n(t)}))}))}(this._rpcClient),this._rpcWebSocket=new Yr(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgs([e.toBase58()],n,void 0,r),o=mt(await this._rpcRequest("getBalance",i),ri(kt()));if("error"in o)throw new Vr(o.error,"failed to get balance for ".concat(e.toBase58()));return o.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+t)}))}async getBlockTime(e){const t=mt(await this._rpcRequest("getBlockTime",[e]),ni(Et(kt())));if("error"in t)throw new Vr(t.error,"failed to get block time for slot ".concat(e));return t.result}async getMinimumLedgerSlot(){const e=mt(await this._rpcRequest("minimumLedgerSlot",[]),ni(kt()));if("error"in e)throw new Vr(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){const e=mt(await this._rpcRequest("getFirstAvailableBlock",[]),ki);if("error"in e)throw new Vr(e.error,"failed to get first available block");return e.result}async getSupply(e){let t={};t="string"===typeof e?{commitment:e}:e?{...e,commitment:e&&e.commitment||this.commitment}:{commitment:this.commitment};const n=mt(await this._rpcRequest("getSupply",[t]),Ci);if("error"in n)throw new Vr(n.error,"failed to get supply");return n.result}async getTokenSupply(e,t){const n=this._buildArgs([e.toBase58()],t),r=mt(await this._rpcRequest("getTokenSupply",n),ri(Ai));if("error"in r)throw new Vr(r.error,"failed to get token supply");return r.result}async getTokenAccountBalance(e,t){const n=this._buildArgs([e.toBase58()],t),r=mt(await this._rpcRequest("getTokenAccountBalance",n),ri(Ai));if("error"in r)throw new Vr(r.error,"failed to get token account balance");return r.result}async getTokenAccountsByOwner(e,t,n){const{commitment:r,config:i}=$r(n);let o=[e.toBase58()];"mint"in t?o.push({mint:t.mint.toBase58()}):o.push({programId:t.programId.toBase58()});const a=this._buildArgs(o,r,"base64",i),s=mt(await this._rpcRequest("getTokenAccountsByOwner",a),Ii);if("error"in s)throw new Vr(s.error,"failed to get token accounts owned by account ".concat(e.toBase58()));return s.result}async getParsedTokenAccountsByOwner(e,t,n){let r=[e.toBase58()];"mint"in t?r.push({mint:t.mint.toBase58()}):r.push({programId:t.programId.toBase58()});const i=this._buildArgs(r,n,"jsonParsed"),o=mt(await this._rpcRequest("getTokenAccountsByOwner",i),Ni);if("error"in o)throw new Vr(o.error,"failed to get token accounts owned by account ".concat(e.toBase58()));return o.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},n=t.filter||t.commitment?[t]:[],r=mt(await this._rpcRequest("getLargestAccounts",n),Oi);if("error"in r)throw new Vr(r.error,"failed to get largest accounts");return r.result}async getTokenLargestAccounts(e,t){const n=this._buildArgs([e.toBase58()],t),r=mt(await this._rpcRequest("getTokenLargestAccounts",n),Ti);if("error"in r)throw new Vr(r.error,"failed to get token largest accounts");return r.result}async getAccountInfoAndContext(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgs([e.toBase58()],n,"base64",r),o=mt(await this._rpcRequest("getAccountInfo",i),ri(Et(ji)));if("error"in o)throw new Vr(o.error,"failed to get info about account ".concat(e.toBase58()));return o.result}async getParsedAccountInfo(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgs([e.toBase58()],n,"jsonParsed",r),o=mt(await this._rpcRequest("getAccountInfo",i),ri(Et(Ri)));if("error"in o)throw new Vr(o.error,"failed to get info about account ".concat(e.toBase58()));return o.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(n){throw new Error("failed to get info about account "+e.toBase58()+": "+n)}}async getMultipleParsedAccounts(e,t){const{commitment:n,config:r}=$r(t),i=e.map((e=>e.toBase58())),o=this._buildArgs([i],n,"jsonParsed",r),a=mt(await this._rpcRequest("getMultipleAccounts",o),ri(wt(Et(Ri))));if("error"in a)throw new Vr(a.error,"failed to get info for accounts ".concat(i));return a.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:n,config:r}=$r(t),i=e.map((e=>e.toBase58())),o=this._buildArgs([i],n,"base64",r),a=mt(await this._rpcRequest("getMultipleAccounts",o),ri(wt(Et(ji))));if("error"in a)throw new Vr(a.error,"failed to get info for accounts ".concat(i));return a.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,n){const{commitment:r,config:i}=$r(t),o=this._buildArgs([e.toBase58()],r,void 0,{...i,epoch:null!=n?n:null===i||void 0===i?void 0:i.epoch}),a=mt(await this._rpcRequest("getStakeActivation",o),ni(Bi));if("error"in a)throw new Vr(a.error,"failed to get Stake Activation ".concat(e.toBase58()));return a.result}async getProgramAccounts(e,t){const{commitment:n,config:r}=$r(t),{encoding:i,...o}=r||{},a=this._buildArgs([e.toBase58()],n,i||"base64",o),s=await this._rpcRequest("getProgramAccounts",a),c=wt(Li),u=!0===o.withContext?mt(s,ri(c)):mt(s,ni(c));if("error"in u)throw new Vr(u.error,"failed to get accounts owned by program ".concat(e.toBase58()));return u.result}async getParsedProgramAccounts(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgs([e.toBase58()],n,"jsonParsed",r),o=mt(await this._rpcRequest("getProgramAccounts",i),ni(wt(Di)));if("error"in o)throw new Vr(o.error,"failed to get accounts owned by program ".concat(e.toBase58()));return o.result}async confirmTransaction(e,t){let n,r;if("string"==typeof e)n=e;else{var i;const t=e;if(null!==(i=t.abortSignal)&&void 0!==i&&i.aborted)return Promise.reject(t.abortSignal.reason);n=t.signature}try{r=Qe().decode(n)}catch(o){throw new Error("signature must be base58 encoded: "+n)}return Qn(64===r.length,"signature has invalid length"),"string"===typeof e?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:n}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise(((t,n)=>{null!=e&&(e.aborted?n(e.reason):e.addEventListener("abort",(()=>{n(e.reason)})))}))}getTransactionConfirmationPromise(e){let t,n,{commitment:r,signature:i}=e,o=!1;return{abortConfirmation:()=>{n&&(n(),n=void 0),null!=t&&(this.removeSignatureListener(t),t=void 0)},confirmationPromise:new Promise(((e,a)=>{try{t=this.onSignature(i,((n,r)=>{t=void 0;const i={context:r,value:n};e({__type:nr.PROCESSED,response:i})}),r);const s=new Promise((e=>{null==t?e():n=this._onSubscriptionStateChange(t,(t=>{"subscribed"===t&&e()}))}));(async()=>{if(await s,o)return;const t=await this.getSignatureStatus(i);if(o)return;if(null==t)return;const{context:n,value:c}=t;if(null!=c)if(null!==c&&void 0!==c&&c.err)a(c.err);else{switch(r){case"confirmed":case"single":case"singleGossip":if("processed"===c.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===c.confirmationStatus||"confirmed"===c.confirmationStatus)return}o=!0,e({__type:nr.PROCESSED,response:{context:n,value:c}})}})()}catch(s){a(s)}}))}}async confirmTransactionUsingBlockHeightExceedanceStrategy(e){let{commitment:t,strategy:{abortSignal:n,lastValidBlockHeight:r,signature:i}}=e,o=!1;const a=new Promise((e=>{const n=async()=>{try{return await this.getBlockHeight(t)}catch(e){return-1}};(async()=>{let t=await n();if(!o){for(;t<=r;){if(await vr(1e3),o)return;if(t=await n(),o)return}e({__type:nr.BLOCKHEIGHT_EXCEEDED})}})()})),{abortConfirmation:s,confirmationPromise:c}=this.getTransactionConfirmationPromise({commitment:t,signature:i}),u=this.getCancellationPromise(n);let l;try{const e=await Promise.race([u,c,a]);if(e.__type!==nr.PROCESSED)throw new Hn(i);l=e.response}finally{o=!0,s()}return l}async confirmTransactionUsingDurableNonceStrategy(e){let{commitment:t,strategy:{abortSignal:n,minContextSlot:r,nonceAccountPubkey:i,nonceValue:o,signature:a}}=e,s=!1;const c=new Promise((e=>{let n=o,a=null;const c=async()=>{try{const{context:e,value:n}=await this.getNonceAndContext(i,{commitment:t,minContextSlot:r});return a=e.slot,null===n||void 0===n?void 0:n.nonce}catch(e){return n}};(async()=>{if(n=await c(),!s)for(;;){if(o!==n)return void e({__type:nr.NONCE_INVALID,slotInWhichNonceDidAdvance:a});if(await vr(2e3),s)return;if(n=await c(),s)return}})()})),{abortConfirmation:u,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:t,signature:a}),d=this.getCancellationPromise(n);let f;try{const e=await Promise.race([d,l,c]);if(e.__type===nr.PROCESSED)f=e.response;else{var h;let n;for(;;){var p;const t=await this.getSignatureStatus(a);if(null==t)break;if(!(t.context.slot<(null!==(p=e.slotInWhichNonceDidAdvance)&&void 0!==p?p:r))){n=t;break}await vr(400)}if(null===(h=n)||void 0===h||!h.value)throw new Vn(a);{const e=t||"finalized",{confirmationStatus:r}=n.value;switch(e){case"processed":case"recent":if("processed"!==r&&"confirmed"!==r&&"finalized"!==r)throw new Vn(a);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==r&&"finalized"!==r)throw new Vn(a);break;case"finalized":case"max":case"root":if("finalized"!==r)throw new Vn(a)}f={context:n.context,value:{err:n.value.err}}}}}finally{s=!0,u()}return f}async confirmTransactionUsingLegacyTimeoutStrategy(e){let t,{commitment:n,signature:r}=e;const i=new Promise((e=>{let r=this._confirmTransactionInitialTimeout||6e4;switch(n){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":r=this._confirmTransactionInitialTimeout||3e4}t=setTimeout((()=>e({__type:nr.TIMED_OUT,timeoutMs:r})),r)})),{abortConfirmation:o,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:n,signature:r});let s;try{const e=await Promise.race([a,i]);if(e.__type!==nr.PROCESSED)throw new Fn(r,e.timeoutMs/1e3);s=e.response}finally{clearTimeout(t),o()}return s}async getClusterNodes(){const e=mt(await this._rpcRequest("getClusterNodes",[]),ni(wt(Xi)));if("error"in e)throw new Vr(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(e){const t=this._buildArgs([],e),n=mt(await this._rpcRequest("getVoteAccounts",t),Ji);if("error"in n)throw new Vr(n.error,"failed to get vote accounts");return n.result}async getSlot(e){const{commitment:t,config:n}=$r(e),r=this._buildArgs([],t,void 0,n),i=mt(await this._rpcRequest("getSlot",r),ni(kt()));if("error"in i)throw new Vr(i.error,"failed to get slot");return i.result}async getSlotLeader(e){const{commitment:t,config:n}=$r(e),r=this._buildArgs([],t,void 0,n),i=mt(await this._rpcRequest("getSlotLeader",r),ni(Tt()));if("error"in i)throw new Vr(i.error,"failed to get slot leader");return i.result}async getSlotLeaders(e,t){const n=[e,t],r=mt(await this._rpcRequest("getSlotLeaders",n),ni(wt(Zr)));if("error"in r)throw new Vr(r.error,"failed to get slot leaders");return r.result}async getSignatureStatus(e,t){const{context:n,value:r}=await this.getSignatureStatuses([e],t);Qn(1===r.length);return{context:n,value:r[0]}}async getSignatureStatuses(e,t){const n=[e];t&&n.push(t);const r=mt(await this._rpcRequest("getSignatureStatuses",n),to);if("error"in r)throw new Vr(r.error,"failed to get signature status");return r.result}async getTransactionCount(e){const{commitment:t,config:n}=$r(e),r=this._buildArgs([],t,void 0,n),i=mt(await this._rpcRequest("getTransactionCount",r),ni(kt()));if("error"in i)throw new Vr(i.error,"failed to get transaction count");return i.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),n=mt(await this._rpcRequest("getInflationGovernor",t),wi);if("error"in n)throw new Vr(n.error,"failed to get inflation");return n.result}async getInflationReward(e,t,n){const{commitment:r,config:i}=$r(n),o=this._buildArgs([e.map((e=>e.toBase58()))],r,void 0,{...i,epoch:null!=t?t:null===i||void 0===i?void 0:i.epoch}),a=mt(await this._rpcRequest("getInflationReward",o),si);if("error"in a)throw new Vr(a.error,"failed to get inflation reward");return a.result}async getInflationRate(){const e=mt(await this._rpcRequest("getInflationRate",[]),bi);if("error"in e)throw new Vr(e.error,"failed to get inflation rate");return e.result}async getEpochInfo(e){const{commitment:t,config:n}=$r(e),r=this._buildArgs([],t,void 0,n),i=mt(await this._rpcRequest("getEpochInfo",r),_i);if("error"in i)throw new Vr(i.error,"failed to get epoch info");return i.result}async getEpochSchedule(){const e=mt(await this._rpcRequest("getEpochSchedule",[]),xi);if("error"in e)throw new Vr(e.error,"failed to get epoch schedule");const t=e.result;return new zr(t.slotsPerEpoch,t.leaderScheduleSlotOffset,t.warmup,t.firstNormalEpoch,t.firstNormalSlot)}async getLeaderSchedule(){const e=mt(await this._rpcRequest("getLeaderSchedule",[]),Ei);if("error"in e)throw new Vr(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(e,t){const n=this._buildArgs([e],t),r=mt(await this._rpcRequest("getMinimumBalanceForRentExemption",n),no);return"error"in r?(console.warn("Unable to fetch minimum balance for rent exemption"),0):r.result}async getRecentBlockhashAndContext(e){const t=this._buildArgs([],e),n=mt(await this._rpcRequest("getRecentBlockhash",t),To);if("error"in n)throw new Vr(n.error,"failed to get recent blockhash");return n.result}async getRecentPerformanceSamples(e){const t=mt(await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),No);if("error"in t)throw new Vr(t.error,"failed to get recent performance samples");return t.result}async getFeeCalculatorForBlockhash(e,t){const n=this._buildArgs([e],t),r=mt(await this._rpcRequest("getFeeCalculatorForBlockhash",n),Oo);if("error"in r)throw new Vr(r.error,"failed to get fee calculator");const{context:i,value:o}=r.result;return{context:i,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(e,t){const n=Cn(e.serialize()).toString("base64"),r=this._buildArgs([n],t),i=mt(await this._rpcRequest("getFeeForMessage",r),ri(Et(kt())));if("error"in i)throw new Vr(i.error,"failed to get fee for message");if(null===i.result)throw new Error("invalid blockhash");return i.result}async getRecentPrioritizationFees(e){var t;const n=null===e||void 0===e||null===(t=e.lockedWritableAccounts)||void 0===t?void 0:t.map((e=>e.toBase58())),r=null!==n&&void 0!==n&&n.length?[n]:[],i=mt(await this._rpcRequest("getRecentPrioritizationFees",r),Si);if("error"in i)throw new Vr(i.error,"failed to get recent prioritization fees");return i.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:n}=$r(e),r=this._buildArgs([],t,void 0,n),i=mt(await this._rpcRequest("getLatestBlockhash",r),Io);if("error"in i)throw new Vr(i.error,"failed to get latest blockhash");return i.result}async isBlockhashValid(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgs([e],n,void 0,r),o=mt(await this._rpcRequest("isBlockhashValid",i),Mo);if("error"in o)throw new Vr(o.error,"failed to determine if the blockhash `"+e+"`is valid");return o.result}async getVersion(){const e=mt(await this._rpcRequest("getVersion",[]),ni(yi));if("error"in e)throw new Vr(e.error,"failed to get version");return e.result}async getGenesisHash(){const e=mt(await this._rpcRequest("getGenesisHash",[]),ni(Tt()));if("error"in e)throw new Vr(e.error,"failed to get genesis hash");return e.result}async getBlock(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgsAtLeastConfirmed([e],n,void 0,r),o=await this._rpcRequest("getBlock",i);try{switch(null===r||void 0===r?void 0:r.transactionDetails){case"accounts":{const e=mt(o,bo);if("error"in e)throw e.error;return e.result}case"none":{const e=mt(o,wo);if("error"in e)throw e.error;return e.result}default:{const e=mt(o,vo);if("error"in e)throw e.error;const{result:t}=e;return t?{...t,transactions:t.transactions.map((e=>{let{transaction:t,meta:n,version:r}=e;return{meta:n,transaction:{...t,message:oi(r,t.message)},version:r}}))}:null}}}catch(a){throw new Vr(a,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed",r),o=await this._rpcRequest("getBlock",i);try{switch(null===r||void 0===r?void 0:r.transactionDetails){case"accounts":{const e=mt(o,_o);if("error"in e)throw e.error;return e.result}case"none":{const e=mt(o,xo);if("error"in e)throw e.error;return e.result}default:{const e=mt(o,So);if("error"in e)throw e.error;return e.result}}}catch(a){throw new Vr(a,"failed to get block")}}async getBlockProduction(e){let t,n;if("string"===typeof e)n=e;else if(e){const{commitment:r,...i}=e;n=r,t=i}const r=this._buildArgs([],n,"base64",t),i=mt(await this._rpcRequest("getBlockProduction",r),vi);if("error"in i)throw new Vr(i.error,"failed to get block production information");return i.result}async getTransaction(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgsAtLeastConfirmed([e],n,void 0,r),o=mt(await this._rpcRequest("getTransaction",i),Co);if("error"in o)throw new Vr(o.error,"failed to get transaction");const a=o.result;return a?{...a,transaction:{...a.transaction,message:oi(a.version,a.transaction.message)}}:a}async getParsedTransaction(e,t){const{commitment:n,config:r}=$r(t),i=this._buildArgsAtLeastConfirmed([e],n,"jsonParsed",r),o=mt(await this._rpcRequest("getTransaction",i),Ao);if("error"in o)throw new Vr(o.error,"failed to get transaction");return o.result}async getParsedTransactions(e,t){const{commitment:n,config:r}=$r(t),i=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],n,"jsonParsed",r)})));return(await this._rpcBatchRequest(i)).map((e=>{const t=mt(e,Ao);if("error"in t)throw new Vr(t.error,"failed to get transactions");return t.result}))}async getTransactions(e,t){const{commitment:n,config:r}=$r(t),i=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],n,void 0,r)})));return(await this._rpcBatchRequest(i)).map((e=>{const t=mt(e,Co);if("error"in t)throw new Vr(t.error,"failed to get transactions");const n=t.result;return n?{...n,transaction:{...n.transaction,message:oi(n.version,n.transaction.message)}}:n}))}async getConfirmedBlock(e,t){const n=this._buildArgsAtLeastConfirmed([e],t),r=mt(await this._rpcRequest("getConfirmedBlock",n),Eo);if("error"in r)throw new Vr(r.error,"failed to get confirmed block");const i=r.result;if(!i)throw new Error("Confirmed block "+e+" not found");const o={...i,transactions:i.transactions.map((e=>{let{transaction:t,meta:n}=e;const r=new $n(t.message);return{meta:n,transaction:{...t,message:r}}}))};return{...o,transactions:o.transactions.map((e=>{let{transaction:t,meta:n}=e;return{meta:n,transaction:or.populate(t.message,t.signatures)}}))}}async getBlocks(e,t,n){const r=this._buildArgsAtLeastConfirmed(void 0!==t?[e,t]:[e],n),i=mt(await this._rpcRequest("getBlocks",r),ni(wt(kt())));if("error"in i)throw new Vr(i.error,"failed to get blocks");return i.result}async getBlockSignatures(e,t){const n=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),r=mt(await this._rpcRequest("getBlock",n),ko);if("error"in r)throw new Vr(r.error,"failed to get block");const i=r.result;if(!i)throw new Error("Block "+e+" not found");return i}async getConfirmedBlockSignatures(e,t){const n=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),r=mt(await this._rpcRequest("getConfirmedBlock",n),ko);if("error"in r)throw new Vr(r.error,"failed to get confirmed block");const i=r.result;if(!i)throw new Error("Confirmed block "+e+" not found");return i}async getConfirmedTransaction(e,t){const n=this._buildArgsAtLeastConfirmed([e],t),r=mt(await this._rpcRequest("getConfirmedTransaction",n),Co);if("error"in r)throw new Vr(r.error,"failed to get transaction");const i=r.result;if(!i)return i;const o=new $n(i.transaction.message),a=i.transaction.signatures;return{...i,transaction:or.populate(o,a)}}async getParsedConfirmedTransaction(e,t){const n=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),r=mt(await this._rpcRequest("getConfirmedTransaction",n),Ao);if("error"in r)throw new Vr(r.error,"failed to get confirmed transaction");return r.result}async getParsedConfirmedTransactions(e,t){const n=e.map((e=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([e],t,"jsonParsed")})));return(await this._rpcBatchRequest(n)).map((e=>{const t=mt(e,Ao);if("error"in t)throw new Vr(t.error,"failed to get confirmed transactions");return t.result}))}async getConfirmedSignaturesForAddress(e,t,n){let r={},i=await this.getFirstAvailableBlock();for(;!("until"in r)&&!(--t<=0||t0&&(r.until=e.signatures[e.signatures.length-1].toString())}catch(a){if(a instanceof Error&&a.message.includes("skipped"))continue;throw a}let o=await this.getSlot("finalized");for(;!("before"in r)&&!(++n>o);)try{const e=await this.getConfirmedBlockSignatures(n);e.signatures.length>0&&(r.before=e.signatures[e.signatures.length-1].toString())}catch(a){if(a instanceof Error&&a.message.includes("skipped"))continue;throw a}return(await this.getConfirmedSignaturesForAddress2(e,r)).map((e=>e.signature))}async getConfirmedSignaturesForAddress2(e,t,n){const r=this._buildArgsAtLeastConfirmed([e.toBase58()],n,void 0,t),i=mt(await this._rpcRequest("getConfirmedSignaturesForAddress2",r),Ui);if("error"in i)throw new Vr(i.error,"failed to get confirmed signatures for address");return i.result}async getSignaturesForAddress(e,t,n){const r=this._buildArgsAtLeastConfirmed([e.toBase58()],n,void 0,t),i=mt(await this._rpcRequest("getSignaturesForAddress",r),zi);if("error"in i)throw new Vr(i.error,"failed to get signatures for address");return i.result}async getAddressLookupTable(e,t){const{context:n,value:r}=await this.getAccountInfoAndContext(e,t);let i=null;return null!==r&&(i=new Kr({key:e,state:Kr.deserialize(r.data)})),{context:n,value:i}}async getNonceAndContext(e,t){const{context:n,value:r}=await this.getAccountInfoAndContext(e,t);let i=null;return null!==r&&(i=Er.fromAccountData(r.data)),{context:n,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+t)}))}async requestAirdrop(e,t){const n=mt(await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),jo);if("error"in n)throw new Vr(n.error,"airdrop to ".concat(e.toBase58()," failed"));return n.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await vr(100);const e=Date.now()-this._blockhashInfo.lastFetch>=Jr;if(null!==this._blockhashInfo.latestBlockhash&&!e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,n=t?t.blockhash:null;for(let r=0;r<50;r++){const e=await this.getLatestBlockhash("finalized");if(n!==e.blockhash)return this._blockhashInfo={latestBlockhash:e,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e;await vr(200)}throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-e,"ms"))}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:n}=$r(e),r=this._buildArgs([],t,"base64",n),i=mt(await this._rpcRequest("getStakeMinimumDelegation",r),ri(kt()));if("error"in i)throw new Vr(i.error,"failed to get stake minimum delegation");return i.result}async simulateTransaction(e,t,n){if("message"in e){const r=e.serialize(),o=i.Buffer.from(r).toString("base64");if(Array.isArray(t)||void 0!==n)throw new Error("Invalid arguments");const a=t||{};a.encoding="base64","commitment"in a||(a.commitment=this.commitment);const s=[o,a],c=mt(await this._rpcRequest("simulateTransaction",s),gi);if("error"in c)throw new Error("failed to simulate transaction: "+c.error.message);return c.result}let r;if(e instanceof or){let t=e;r=new or,r.feePayer=t.feePayer,r.instructions=e.instructions,r.nonceInfo=t.nonceInfo,r.signatures=t.signatures}else r=or.populate(e),r._message=r._json=void 0;if(void 0!==t&&!Array.isArray(t))throw new Error("Invalid arguments");const o=t;if(r.nonceInfo&&o)r.sign(...o);else{let e=this._disableBlockhashCaching;for(;;){const t=await this._blockhashWithExpiryBlockHeight(e);if(r.lastValidBlockHeight=t.lastValidBlockHeight,r.recentBlockhash=t.blockhash,!o)break;if(r.sign(...o),!r.signature)throw new Error("!signature");const n=r.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(n)&&!this._blockhashInfo.transactionSignatures.includes(n)){this._blockhashInfo.simulatedSignatures.push(n);break}e=!0}}const a=r._compile(),s=a.serialize(),c=r._serialize(s).toString("base64"),u={encoding:"base64",commitment:this.commitment};if(n){const e=(Array.isArray(n)?n:a.nonProgramIds()).map((e=>e.toBase58()));u.accounts={encoding:"base64",addresses:e}}o&&(u.sigVerify=!0);const l=[c,u],d=mt(await this._rpcRequest("simulateTransaction",l),gi);if("error"in d){let e;if("data"in d.error&&(e=d.error.data.logs,e&&Array.isArray(e))){const t="\n ",n=t+e.join(t);console.error(d.error.message,n)}throw new Hr("failed to simulate transaction: "+d.error.message,e)}return d.result}async sendTransaction(e,t,n){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const n=e.serialize();return await this.sendRawTransaction(n,t)}if(void 0===t||!Array.isArray(t))throw new Error("Invalid arguments");const r=t;if(e.nonceInfo)e.sign(...r);else{let t=this._disableBlockhashCaching;for(;;){const n=await this._blockhashWithExpiryBlockHeight(t);if(e.lastValidBlockHeight=n.lastValidBlockHeight,e.recentBlockhash=n.blockhash,e.sign(...r),!e.signature)throw new Error("!signature");const i=e.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.transactionSignatures.push(i);break}t=!0}}const i=e.serialize();return await this.sendRawTransaction(i,n)}async sendRawTransaction(e,t){const n=Cn(e).toString("base64");return await this.sendEncodedTransaction(n,t)}async sendEncodedTransaction(e,t){const n={encoding:"base64"},r=t&&t.skipPreflight,i=t&&t.preflightCommitment||this.commitment;t&&null!=t.maxRetries&&(n.maxRetries=t.maxRetries),t&&null!=t.minContextSlot&&(n.minContextSlot=t.minContextSlot),r&&(n.skipPreflight=r),i&&(n.preflightCommitment=i);const o=[e,n],a=mt(await this._rpcRequest("sendTransaction",o),Lo);if("error"in a){let e;throw"data"in a.error&&(e=a.error.data.logs),new Hr("failed to send transaction: "+a.error.message,e)}return a.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()}),5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((e=>{let[t,n]=e;this._setSubscription(t,{...n,state:"pending"})}))):this._updateSubscriptions()}_setSubscription(e,t){var n;const r=null===(n=this._subscriptionsByHash[e])||void 0===n?void 0:n.state;if(this._subscriptionsByHash[e]=t,r!==t.state){const n=this._subscriptionStateChangeCallbacksByHash[e];n&&n.forEach((e=>{try{e(t.state)}catch{}}))}}_onSubscriptionStateChange(e,t){var n;const r=this._subscriptionHashByClientSubscriptionId[e];if(null==r)return()=>{};const i=(n=this._subscriptionStateChangeCallbacksByHash)[r]||(n[r]=new Set);return i.add(t),()=>{i.delete(t),0===i.size&&delete this._subscriptionStateChangeCallbacksByHash[r]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async e=>{const n=this._subscriptionsByHash[e];if(void 0!==n)switch(n.state){case"pending":case"unsubscribed":if(0===n.callbacks.size)return delete this._subscriptionsByHash[e],"unsubscribed"===n.state&&delete this._subscriptionCallbacksByServerSubscriptionId[n.serverSubscriptionId],void await this._updateSubscriptions();await(async()=>{const{args:r,method:i}=n;try{this._setSubscription(e,{...n,state:"subscribing"});const t=await this._rpcWebSocket.call(i,r);this._setSubscription(e,{...n,serverSubscriptionId:t,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[t]=n.callbacks,await this._updateSubscriptions()}catch(o){if(o instanceof Error&&console.error("".concat(i," error for argument"),r,o.message),!t())return;this._setSubscription(e,{...n,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===n.callbacks.size&&await(async()=>{const{serverSubscriptionId:r,unsubscribeMethod:i}=n;if(this._subscriptionsAutoDisposedByRpc.has(r))this._subscriptionsAutoDisposedByRpc.delete(r);else{this._setSubscription(e,{...n,state:"unsubscribing"}),this._setSubscription(e,{...n,state:"unsubscribing"});try{await this._rpcWebSocket.call(i,[r])}catch(o){if(o instanceof Error&&console.error("".concat(i," error:"),o.message),!t())return;return this._setSubscription(e,{...n,state:"subscribed"}),void await this._updateSubscriptions()}}this._setSubscription(e,{...n,state:"unsubscribed"}),await this._updateSubscriptions()})()}})))}_handleServerNotification(e,t){const n=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==n&&n.forEach((e=>{try{e(...t)}catch(n){console.error(n)}}))}_wsOnAccountNotification(e){const{result:t,subscription:n}=mt(e,Hi);this._handleServerNotification(n,[t.value,t.context])}_makeSubscription(e,t){const n=this._nextClientSubscriptionId++,r=Br([e.method,t],!0),i=this._subscriptionsByHash[r];return void 0===i?this._subscriptionsByHash[r]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:i.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[n]=r,this._subscriptionDisposeFunctionsByClientSubscriptionId[n]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[n],delete this._subscriptionHashByClientSubscriptionId[n];const t=this._subscriptionsByHash[r];Qn(void 0!==t,"Could not find a `Subscription` when tearing down client subscription #".concat(n)),t.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),n}onAccountChange(e,t,n){const r=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:n}=mt(e,Vi);this._handleServerNotification(n,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,n,r){const i=this._buildArgs([e.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,n){const r=this._buildArgs(["object"===typeof e?{mentions:[e.toString()]}:e],n||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:n}=mt(e,Ro);this._handleServerNotification(n,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:n}=mt(e,Yi);this._handleServerNotification(n,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:n}=mt(e,qi);this._handleServerNotification(n,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const n=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];n?await n():console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(e,"` for '").concat(t,"' events ")+"could not be found.")}_buildArgs(e,t,n,r){const i=t||this._commitment;if(i||n||r){let t={};n&&(t.encoding=n),i&&(t.commitment=i),r&&(t=Object.assign(t,r)),e.push(t)}return e}_buildArgsAtLeastConfirmed(e,t,n,r){const i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}_wsOnSignatureNotification(e){const{result:t,subscription:n}=mt(e,Gi);"receivedSignature"!==t.value&&this._subscriptionsAutoDisposedByRpc.add(n),this._handleServerNotification(n,"receivedSignature"===t.value?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,n){const r=this._buildArgs([e],n||this._commitment||"finalized"),i=this._makeSubscription({callback:(e,n)=>{if("status"===e.type){t(e.result,n);try{this.removeSignatureListener(i)}catch(r){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},r);return i}onSignatureWithOptions(e,t,n){const{commitment:r,...i}={...n,commitment:n&&n.commitment||this._commitment||"finalized"},o=this._buildArgs([e],r,void 0,i),a=this._makeSubscription({callback:(e,n)=>{t(e,n);try{this.removeSignatureListener(a)}catch(r){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:n}=mt(e,Zi);this._handleServerNotification(n,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class Uo{constructor(e){this._keypair=void 0,this._keypair=null!==e&&void 0!==e?e:Sn()}static generate(){return new Uo(Sn())}static fromSecretKey(e,t){if(64!==e.byteLength)throw new Error("bad secret key size");const n=e.slice(32,64);if(!t||!t.skipValidation){const t=e.slice(0,32),r=_n(t);for(let e=0;e<32;e++)if(n[e]!==r[e])throw new Error("provided secretKey is invalid")}return new Uo({publicKey:n,secretKey:e})}static fromSeed(e){const t=_n(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),new Uo({publicKey:t,secretKey:n})}get publicKey(){return new Pn(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const zo=Object.freeze({CreateLookupTable:{index:0,layout:ot.n_([ot.Jq("instruction"),kr("recentSlot"),ot.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:ot.n_([ot.Jq("instruction")])},ExtendLookupTable:{index:2,layout:ot.n_([ot.Jq("instruction"),kr(),ot.A9(Yn(),ot.cv(ot.Jq(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:ot.n_([ot.Jq("instruction")])},CloseLookupTable:{index:4,layout:ot.n_([ot.Jq("instruction")])}});class Ho{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ot.Jq("instruction").decode(e.data);let n;for(const[r,i]of Object.entries(zo))if(i.index==t){n=r;break}if(!n)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return n}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:t}=br(zo.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error("invalid instruction; found ".concat(e.keys.length," keys, expected at least 2"));const{addresses:t}=br(zo.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map((e=>new Pn(e)))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(Fo.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,t){if(e.lengthe.toBytes()))}),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&n.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Ir.programId,isSigner:!1,isWritable:!1}),new ir({programId:this.programId,keys:n,data:t})}static deactivateLookupTable(e){const t=wr(zo.DeactivateLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new ir({programId:this.programId,keys:n,data:t})}static closeLookupTable(e){const t=wr(zo.CloseLookupTable),n=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new ir({programId:this.programId,keys:n,data:t})}}Fo.programId=new Pn("AddressLookupTab1e1111111111111111111111111");class Vo{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ot.u8("instruction").decode(e.data);let n;for(const[r,i]of Object.entries(Wo))if(i.index==t){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return n}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:t,additionalFee:n}=br(Wo.RequestUnits,e.data);return{units:t,additionalFee:n}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:t}=br(Wo.RequestHeapFrame,e.data);return{bytes:t}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:t}=br(Wo.SetComputeUnitLimit,e.data);return{units:t}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:t}=br(Wo.SetComputeUnitPrice,e.data);return{microLamports:t}}static checkProgramId(e){if(!e.equals(Yo.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Wo=Object.freeze({RequestUnits:{index:0,layout:ot.n_([ot.u8("instruction"),ot.Jq("units"),ot.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:ot.n_([ot.u8("instruction"),ot.Jq("bytes")])},SetComputeUnitLimit:{index:2,layout:ot.n_([ot.u8("instruction"),ot.Jq("units")])},SetComputeUnitPrice:{index:3,layout:ot.n_([ot.u8("instruction"),kr("microLamports")])}});class Yo{constructor(){}static requestUnits(e){const t=wr(Wo.RequestUnits,e);return new ir({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){const t=wr(Wo.RequestHeapFrame,e);return new ir({keys:[],programId:this.programId,data:t})}static setComputeUnitLimit(e){const t=wr(Wo.SetComputeUnitLimit,e);return new ir({keys:[],programId:this.programId,data:t})}static setComputeUnitPrice(e){const t=wr(Wo.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new ir({keys:[],programId:this.programId,data:t})}}Yo.programId=new Pn("ComputeBudget111111111111111111111111111111");const Ko=ot.n_([ot.u8("numSignatures"),ot.u8("padding"),ot.KB("signatureOffset"),ot.KB("signatureInstructionIndex"),ot.KB("publicKeyOffset"),ot.KB("publicKeyInstructionIndex"),ot.KB("messageDataOffset"),ot.KB("messageDataSize"),ot.KB("messageInstructionIndex")]);class qo{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:n,signature:r,instructionIndex:o}=e;Qn(32===t.length,"Public Key must be ".concat(32," bytes but received ").concat(t.length," bytes")),Qn(64===r.length,"Signature must be ".concat(64," bytes but received ").concat(r.length," bytes"));const a=Ko.span,s=a+t.length,c=s+r.length,u=i.Buffer.alloc(c+n.length),l=null==o?65535:o;return Ko.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:l,publicKeyOffset:a,publicKeyInstructionIndex:l,messageDataOffset:c,messageDataSize:n.length,messageInstructionIndex:l},u),u.fill(t,a),u.fill(r,s),u.fill(n,c),new ir({keys:[],programId:qo.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:n,instructionIndex:r}=e;Qn(64===t.length,"Private key must be ".concat(64," bytes but received ").concat(t.length," bytes"));try{const e=Uo.fromSecretKey(t),i=e.publicKey.toBytes(),o=En(n,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:o,instructionIndex:r})}catch(i){throw new Error("Error creating instruction; ".concat(i))}}}qo.programId=new Pn("Ed25519SigVerify111111111111111111111111111");wn.utils.isValidPrivateKey;const Go=wn.getPublicKey,Zo=ot.n_([ot.u8("numSignatures"),ot.KB("signatureOffset"),ot.u8("signatureInstructionIndex"),ot.KB("ethAddressOffset"),ot.u8("ethAddressInstructionIndex"),ot.KB("messageDataOffset"),ot.KB("messageDataSize"),ot.u8("messageInstructionIndex"),ot.Ik(20,"ethAddress"),ot.Ik(64,"signature"),ot.u8("recoveryId")]);class Xo{constructor(){}static publicKeyToEthAddress(e){Qn(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return i.Buffer.from($t(Cn(e))).slice(-20)}catch(t){throw new Error("Error constructing Ethereum address: ".concat(t))}}static createInstructionWithPublicKey(e){const{publicKey:t,message:n,signature:r,recoveryId:i,instructionIndex:o}=e;return Xo.createInstructionWithEthAddress({ethAddress:Xo.publicKeyToEthAddress(t),message:n,signature:r,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:n,signature:r,recoveryId:o,instructionIndex:a=0}=e;let s;s="string"===typeof t?t.startsWith("0x")?i.Buffer.from(t.substr(2),"hex"):i.Buffer.from(t,"hex"):t,Qn(20===s.length,"Address must be ".concat(20," bytes but received ").concat(s.length," bytes"));const c=12+s.length,u=c+r.length+1,l=i.Buffer.alloc(Zo.span+n.length);return Zo.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:a,ethAddressOffset:12,ethAddressInstructionIndex:a,messageDataOffset:u,messageDataSize:n.length,messageInstructionIndex:a,signature:Cn(r),ethAddress:Cn(s),recoveryId:o},l),l.fill(Cn(n),Zo.span),new ir({keys:[],programId:Xo.programId,data:l})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:n,instructionIndex:r}=e;Qn(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{const e=Cn(t),o=Go(e,!1).slice(1),a=i.Buffer.from($t(Cn(n))),[s,c]=((e,t)=>{const n=wn.sign(e,t);return[n.toCompactRawBytes(),n.recovery]})(a,e);return this.createInstructionWithPublicKey({publicKey:o,message:n,signature:s,recoveryId:c,instructionIndex:r})}catch(o){throw new Error("Error creating instruction; ".concat(o))}}}var Qo;Xo.programId=new Pn("KeccakSecp256k11111111111111111111111111111");const Jo=new Pn("StakeConfig11111111111111111111111111111111");class $o{constructor(e,t){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=t}}class ea{constructor(e,t,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=n}}Qo=ea,ea.default=new Qo(0,0,Pn.default);class ta{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ot.Jq("instruction").decode(e.data);let n;for(const[r,i]of Object.entries(na))if(i.index==t){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a StakeInstruction");return n}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t,lockup:n}=br(na.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new $o(new Pn(t.staker),new Pn(t.withdrawer)),lockup:new ea(n.unixTimestamp,n.epoch,new Pn(n.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),br(na.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,stakeAuthorizationType:n}=br(na.Authorize,e.data),r={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Pn(t),stakeAuthorizationType:{index:n}};return e.keys.length>3&&(r.custodianPubkey=e.keys[3].pubkey),r}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:t,stakeAuthorizationType:n,authoritySeed:r,authorityOwner:i}=br(na.AuthorizeWithSeed,e.data),o={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:r,authorityOwner:new Pn(i),newAuthorizedPubkey:new Pn(t),stakeAuthorizationType:{index:n}};return e.keys.length>3&&(o.custodianPubkey=e.keys[3].pubkey),o}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=br(na.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),br(na.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=br(na.Withdraw,e.data),n={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(n.custodianPubkey=e.keys[5].pubkey),n}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),br(na.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(ia.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"authorized";return ot.n_([Yn("staker"),Yn("withdrawer")],e)}(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return ot.n_([ot.gM("unixTimestamp"),ot.gM("epoch"),Yn("custodian")],e)}()])},Authorize:{index:1,layout:ot.n_([ot.Jq("instruction"),Yn("newAuthorized"),ot.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:ot.n_([ot.Jq("instruction")])},Split:{index:3,layout:ot.n_([ot.Jq("instruction"),ot.gM("lamports")])},Withdraw:{index:4,layout:ot.n_([ot.Jq("instruction"),ot.gM("lamports")])},Deactivate:{index:5,layout:ot.n_([ot.Jq("instruction")])},Merge:{index:7,layout:ot.n_([ot.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:ot.n_([ot.Jq("instruction"),Yn("newAuthorized"),ot.Jq("stakeAuthorizationType"),qn("authoritySeed"),Yn("authorityOwner")])}}),ra=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class ia{constructor(){}static initialize(e){const{stakePubkey:t,authorized:n,lockup:r}=e,i=r||ea.default,o=wr(na.Initialize,{authorized:{staker:Cn(n.staker.toBuffer()),withdrawer:Cn(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:Cn(i.custodian.toBuffer())}}),a={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:fr,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new ir(a)}static createAccountWithSeed(e){const t=new or;t.add(Ir.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static createAccount(e){const t=new or;t.add(Ir.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:n,votePubkey:r}=e,i=wr(na.Delegate);return(new or).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:yr,isSigner:!1,isWritable:!1},{pubkey:Jo,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){const{stakePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,stakeAuthorizationType:i,custodianPubkey:o}=e,a=wr(na.Authorize,{newAuthorized:Cn(r.toBuffer()),stakeAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:cr,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!0,isWritable:!1}),(new or).add({keys:s,programId:this.programId,data:a})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:n,authoritySeed:r,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:a,custodianPubkey:s}=e,c=wr(na.AuthorizeWithSeed,{newAuthorized:Cn(o.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:r,authorityOwner:Cn(i.toBuffer())}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:cr,isSigner:!1,isWritable:!1}];return s&&u.push({pubkey:s,isSigner:!0,isWritable:!1}),(new or).add({keys:u,programId:this.programId,data:c})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:i}=e,o=wr(na.Split,{lamports:i});return new ir({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(e){const t=new or;return t.add(Ir.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}static splitWithSeed(e){const{stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,basePubkey:i,seed:o,lamports:a}=e,s=new or;return s.add(Ir.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),s.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:a}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:n,authorizedPubkey:r}=e,i=wr(na.Merge);return(new or).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:yr,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:n,toPubkey:r,lamports:i,custodianPubkey:o}=e,a=wr(na.Withdraw,{lamports:i}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:yr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&s.push({pubkey:o,isSigner:!0,isWritable:!1}),(new or).add({keys:s,programId:this.programId,data:a})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:n}=e,r=wr(na.Deactivate);return(new or).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}ia.programId=new Pn("Stake11111111111111111111111111111111111111"),ia.space=200;class oa{constructor(e,t,n,r){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=t,this.authorizedWithdrawer=n,this.commission=r}}class aa{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ot.Jq("instruction").decode(e.data);let n;for(const[r,i]of Object.entries(sa))if(i.index==t){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a VoteInstruction");return n}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:t}=br(sa.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new oa(new Pn(t.nodePubkey),new Pn(t.authorizedVoter),new Pn(t.authorizedWithdrawer),t.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,voteAuthorizationType:n}=br(sa.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Pn(t),voteAuthorizationType:{index:n}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:t,currentAuthorityDerivedKeySeed:n,newAuthorized:r,voteAuthorizationType:i}}=br(sa.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Pn(t),currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:new Pn(r),voteAuthorizationType:{index:i},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=br(sa.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(ua.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"voteInit";return ot.n_([Yn("nodePubkey"),Yn("authorizedVoter"),Yn("authorizedWithdrawer"),ot.u8("commission")],e)}()])},Authorize:{index:1,layout:ot.n_([ot.Jq("instruction"),Yn("newAuthorized"),ot.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:ot.n_([ot.Jq("instruction"),ot.gM("lamports")])},AuthorizeWithSeed:{index:10,layout:ot.n_([ot.Jq("instruction"),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return ot.n_([ot.Jq("voteAuthorizationType"),Yn("currentAuthorityDerivedKeyOwnerPubkey"),qn("currentAuthorityDerivedKeySeed"),Yn("newAuthorized")],e)}()])}}),ca=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class ua{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:n,voteInit:r}=e,i=wr(sa.InitializeAccount,{voteInit:{nodePubkey:Cn(r.nodePubkey.toBuffer()),authorizedVoter:Cn(r.authorizedVoter.toBuffer()),authorizedWithdrawer:Cn(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:fr,isSigner:!1,isWritable:!1},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new ir(o)}static createAccount(e){const t=new or;return t.add(Ir.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){const{votePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,voteAuthorizationType:i}=e,o=wr(sa.Authorize,{newAuthorized:Cn(r.toBuffer()),voteAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new or).add({keys:a,programId:this.programId,data:o})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:a}=e,s=wr(sa.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Cn(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:Cn(i.toBuffer()),voteAuthorizationType:o.index}}),c=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:cr,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new or).add({keys:c,programId:this.programId,data:s})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:n,lamports:r,toPubkey:i}=e,o=wr(sa.Withdraw,{lamports:r}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new or).add({keys:a,programId:this.programId,data:o})}static safeWithdraw(e,t,n){if(e.lamports>t-n)throw new Error("Withdraw will leave vote account with insuffcient funds.");return ua.withdraw(e)}}ua.programId=new Pn("Vote111111111111111111111111111111111111111"),ua.space=3731;const la=new Pn("Va1idator1nfo111111111111111111111111111111"),da=Mt({name:Tt(),website:Ct(Tt()),details:Ct(Tt()),keybaseUsername:Ct(Tt())});class fa{constructor(e,t){this.key=void 0,this.info=void 0,this.key=e,this.info=t}static fromConfigData(e){let t=[...e];if(2!==Zn(t))return null;const n=[];for(let r=0;r<2;r++){const e=new Pn(t.slice(0,jn));t=t.slice(jn);const r=1===t.slice(0,1)[0];t=t.slice(1),n.push({publicKey:e,isSigner:r})}if(n[0].publicKey.equals(la)&&n[1].isSigner){const e=qn().decode(i.Buffer.from(t)),r=JSON.parse(e);return pt(r,da),new fa(n[1].publicKey,r)}return null}}const ha=new Pn("Vote111111111111111111111111111111111111111"),pa=ot.n_([Yn("nodePubkey"),Yn("authorizedWithdrawer"),ot.u8("commission"),ot._O(),ot.A9(ot.n_([ot._O("slot"),ot.Jq("confirmationCount")]),ot.cv(ot.Jq(),-8),"votes"),ot.u8("rootSlotValid"),ot._O("rootSlot"),ot._O(),ot.A9(ot.n_([ot._O("epoch"),Yn("authorizedVoter")]),ot.cv(ot.Jq(),-8),"authorizedVoters"),ot.n_([ot.A9(ot.n_([Yn("authorizedPubkey"),ot._O("epochOfLastAuthorizedSwitch"),ot._O("targetEpoch")]),32,"buf"),ot._O("idx"),ot.u8("isEmpty")],"priorVoters"),ot._O(),ot.A9(ot.n_([ot._O("epoch"),ot._O("credits"),ot._O("prevCredits")]),ot.cv(ot.Jq(),-8),"epochCredits"),ot.n_([ot._O("slot"),ot._O("timestamp")],"lastTimestamp")]);class ma{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const t=pa.decode(Cn(e),4);let n=t.rootSlot;return t.rootSlotValid||(n=null),new ma({nodePubkey:new Pn(t.nodePubkey),authorizedWithdrawer:new Pn(t.authorizedWithdrawer),commission:t.commission,votes:t.votes,rootSlot:n,authorizedVoters:t.authorizedVoters.map(ya),priorVoters:va(t.priorVoters),epochCredits:t.epochCredits,lastTimestamp:t.lastTimestamp})}}function ya(e){let{authorizedVoter:t,epoch:n}=e;return{epoch:n,authorizedVoter:new Pn(t)}}function ga(e){let{authorizedPubkey:t,epochOfLastAuthorizedSwitch:n,targetEpoch:r}=e;return{authorizedPubkey:new Pn(t),epochOfLastAuthorizedSwitch:n,targetEpoch:r}}function va(e){let{buf:t,idx:n,isEmpty:r}=e;return r?[]:[...t.slice(n+1).map(ga),...t.slice(0,n).map(ga)]}const wa={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function ba(e,t){const n=!1===t?"http":"https";if(!e)return wa[n].devnet;const r=wa[n][e];if(!r)throw new Error("Unknown ".concat(n," cluster: ").concat(e));return r}async function Sa(e,t,n,r){let i,o;n&&Object.prototype.hasOwnProperty.call(n,"lastValidBlockHeight")||n&&Object.prototype.hasOwnProperty.call(n,"nonceValue")?(i=n,o=r):o=n;const a=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},s=await e.sendRawTransaction(t,a),c=o&&o.commitment,u=i?e.confirmTransaction(i,c):e.confirmTransaction(s,c),l=(await u).value;if(l.err)throw new Error("Raw transaction ".concat(s," failed (").concat(JSON.stringify(l),")"));return s}const _a=1e9},5205:(e,t,n)=>{"use strict";var r=n(7490);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i{"use strict";var r=n(7490);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;te.length)&&(n=e.length),e.substring(n-t.length,n)===t}var b="",S="",_="",x="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function k(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){n[t]=e[t]})),Object.defineProperty(n,"message",{value:e.message}),n}function C(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function A(e,t,n){var i="",o="",a=0,s="",c=!1,u=C(e),l=u.split("\n"),d=C(t).split("\n"),f=0,h="";if("strictEqual"===n&&"object"===y(e)&&"object"===y(t)&&null!==e&&null!==t&&(n="strictEqualObject"),1===l.length&&1===d.length&&l[0]!==d[0]){var p=l[0].length+d[0].length;if(p<=10){if(("object"!==y(e)||null===e)&&("object"!==y(t)||null===t)&&(0!==e||0!==t))return"".concat(E[n],"\n\n")+"".concat(l[0]," !== ").concat(d[0],"\n")}else if("strictEqualObject"!==n){if(p<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;l[0][f]===d[0][f];)f++;f>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,n-e.length)}(" ",f),"^"),f=0)}}}for(var m=l[l.length-1],g=d[d.length-1];m===g&&(f++<2?s="\n ".concat(m).concat(s):i=m,l.pop(),d.pop(),0!==l.length&&0!==d.length);)m=l[l.length-1],g=d[d.length-1];var v=Math.max(l.length,d.length);if(0===v){var k=u.split("\n");if(k.length>30)for(k[26]="".concat(b,"...").concat(x);k.length>27;)k.pop();return"".concat(E.notIdentical,"\n\n").concat(k.join("\n"),"\n")}f>3&&(s="\n".concat(b,"...").concat(x).concat(s),c=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,T=E[n]+"\n".concat(S,"+ actual").concat(x," ").concat(_,"- expected").concat(x),I=" ".concat(b,"...").concat(x," Lines skipped");for(f=0;f1&&f>2&&(M>4?(o+="\n".concat(b,"...").concat(x),c=!0):M>3&&(o+="\n ".concat(d[f-2]),A++),o+="\n ".concat(d[f-1]),A++),a=f,i+="\n".concat(_,"-").concat(x," ").concat(d[f]),A++;else if(d.length1&&f>2&&(M>4?(o+="\n".concat(b,"...").concat(x),c=!0):M>3&&(o+="\n ".concat(l[f-2]),A++),o+="\n ".concat(l[f-1]),A++),a=f,o+="\n".concat(S,"+").concat(x," ").concat(l[f]),A++;else{var N=d[f],O=l[f],j=O!==N&&(!w(O,",")||O.slice(0,-1)!==N);j&&w(N,",")&&N.slice(0,-1)===O&&(j=!1,O+=","),j?(M>1&&f>2&&(M>4?(o+="\n".concat(b,"...").concat(x),c=!0):M>3&&(o+="\n ".concat(l[f-2]),A++),o+="\n ".concat(l[f-1]),A++),a=f,o+="\n".concat(S,"+").concat(x," ").concat(O),i+="\n".concat(_,"-").concat(x," ").concat(N),A+=2):(o+=i,i="",1!==M&&0!==f||(o+="\n ".concat(O),A++))}if(A>20&&f30)for(p[26]="".concat(b,"...").concat(x);p.length>27;)p.pop();t=1===p.length?c.call(this,"".concat(h," ").concat(p[0])):c.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var m=C(a),g="",w=E[i];"notDeepEqual"===i||"notEqual"===i?(m="".concat(E[i],"\n\n").concat(m)).length>1024&&(m="".concat(m.slice(0,1021),"...")):(g="".concat(C(s)),m.length>512&&(m="".concat(m.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===i||"equal"===i?m="".concat(w,"\n\n").concat(m,"\n\nshould equal\n\n"):g=" ".concat(i," ").concat(g)),t=c.call(this,"".concat(m).concat(g))}return Error.stackTraceLimit=f,t.generatedMessage=!n,Object.defineProperty(l(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=s,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(l(t),o),t.stack,t.name="AssertionError",u(t)}return n=d,(i=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&s(n.prototype,i),a&&s(n,a),Object.defineProperty(n,"prototype",{writable:!1}),d}(d(Error),g.custom);e.exports=T},3905:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,a,s,c;if(void 0===u&&(u=n(5205)),u("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(a="not ",t.substr(!s||s<0?0:+s,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))c="The ".concat(e," ").concat(o," ").concat(h(t,"type"));else{var l=function(e,t,n){return"number"!==typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";c='The "'.concat(e,'" ').concat(l," ").concat(o," ").concat(h(t,"type"))}return c+=". Received type ".concat(r(i))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=n(7736));var i=l.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(e,t,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),r=0;r0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=d},8527:(e,t,n)=>{"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function j(e){return Object.keys(e).filter(O).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function L(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i{"use strict";var r=n(5734).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,l=new Uint8Array(a);e[n];){var d=t[e.charCodeAt(n)];if(255===d)return;for(var f=0,h=a-1;(0!==d||f>>0,l[h]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=f,n++}for(var p=a-o;p!==a&&0===l[p];)p++;var m=r.allocUnsafe(i+(a-p));m.fill(0,0,i);for(var y=i;p!==a;)m[y++]=l[p++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=r.from(t)),!r.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,n++;for(var u=(a-o)*l+1>>>0,d=new Uint8Array(u);o!==a;){for(var f=t[o],h=0,p=u-1;(0!==f||h>>0,d[p]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");i=h,o++}for(var m=u-i;m!==u&&0===d[m];)m++;for(var y=c.repeat(n);m{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=s(e),a=o[0],c=o[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,d=c>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,u=r-i;su?u:s+a));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},3289:(e,t,n)=>{"use strict";var r=n(918).Buffer;t.oU=function(e){{const t=r.from(e);t.reverse();const n=t.toString("hex");return 0===n.length?BigInt(0):BigInt("0x".concat(n))}},t.k$=function(e,t){{const n=e.toString(16),i=r.from(n.padStart(2*t,"0").slice(0,2*t),"hex");return i.reverse(),i}}},4166:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(6601).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=c(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(T){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],l=p[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,v=y>>>13,w=0|a[3],b=8191&w,S=w>>>13,_=0|a[4],x=8191&_,E=_>>>13,k=0|a[5],C=8191&k,A=k>>>13,T=0|a[6],I=8191&T,M=T>>>13,N=0|a[7],O=8191&N,j=N>>>13,L=0|a[8],P=8191&L,R=L>>>13,D=0|a[9],B=8191&D,U=D>>>13,z=0|s[0],H=8191&z,F=z>>>13,V=0|s[1],W=8191&V,Y=V>>>13,K=0|s[2],q=8191&K,G=K>>>13,Z=0|s[3],X=8191&Z,Q=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],de=8191&le,fe=le>>>13,he=0|s[9],pe=8191&he,me=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ye=(u+(r=Math.imul(d,H))|0)+((8191&(i=(i=Math.imul(d,F))+Math.imul(f,H)|0))<<13)|0;u=((o=Math.imul(f,F))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(p,H),i=(i=Math.imul(p,F))+Math.imul(m,H)|0,o=Math.imul(m,F);var ge=(u+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(f,W)|0))<<13)|0;u=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,H),i=(i=Math.imul(g,F))+Math.imul(v,H)|0,o=Math.imul(v,F),r=r+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var ve=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,G)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,H),i=(i=Math.imul(b,F))+Math.imul(S,H)|0,o=Math.imul(S,F),r=r+Math.imul(g,W)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,G)|0;var we=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(f,X)|0))<<13)|0;u=((o=o+Math.imul(f,Q)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(x,H),i=(i=Math.imul(x,F))+Math.imul(E,H)|0,o=Math.imul(E,F),r=r+Math.imul(b,W)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,Y)|0,r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,G)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Q)|0;var be=(u+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,H),i=(i=Math.imul(C,F))+Math.imul(A,H)|0,o=Math.imul(A,F),r=r+Math.imul(x,W)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(b,q)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,G)|0,r=r+Math.imul(g,X)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var Se=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(I,H),i=(i=Math.imul(I,F))+Math.imul(M,H)|0,o=Math.imul(M,F),r=r+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,G)|0,r=r+Math.imul(b,X)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(O,H),i=(i=Math.imul(O,F))+Math.imul(j,H)|0,o=Math.imul(j,F),r=r+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,r=r+Math.imul(C,q)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,G)|0,r=r+Math.imul(x,X)|0,i=(i=i+Math.imul(x,Q)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var xe=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,H),i=(i=Math.imul(P,F))+Math.imul(R,H)|0,o=Math.imul(R,F),r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,G)|0,r=r+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,Q)|0,r=r+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(b,ne)|0,i=(i=i+Math.imul(b,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Ee=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(B,H),i=(i=Math.imul(B,F))+Math.imul(U,H)|0,o=Math.imul(U,F),r=r+Math.imul(P,W)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,Y)|0,r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,G)|0,r=r+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Q)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,r=r+Math.imul(x,ne)|0,i=(i=i+Math.imul(x,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var ke=(u+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,W),i=(i=Math.imul(B,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,G)|0,r=r+Math.imul(O,X)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(A,ne)|0,o=o+Math.imul(A,re)|0,r=r+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(U,q)|0,o=Math.imul(U,G),r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Q)|0,r=r+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(I,ne)|0,i=(i=i+Math.imul(I,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,r=r+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,r=r+Math.imul(b,de)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var Ae=(u+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,X),i=(i=Math.imul(B,Q))+Math.imul(U,X)|0,o=Math.imul(U,Q),r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,r=r+Math.imul(x,de)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(E,de)|0,o=o+Math.imul(E,fe)|0;var Te=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,$),i=(i=Math.imul(B,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,fe)|0;var Ie=(u+(r=r+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,ne),i=(i=Math.imul(B,re))+Math.imul(U,ne)|0,o=Math.imul(U,re),r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(j,ce)|0,o=o+Math.imul(j,ue)|0,r=r+Math.imul(I,de)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(M,de)|0,o=o+Math.imul(M,fe)|0;var Me=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),r=r+Math.imul(P,ce)|0,i=(i=i+Math.imul(P,ue)|0)+Math.imul(R,ce)|0,o=o+Math.imul(R,ue)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(j,de)|0,o=o+Math.imul(j,fe)|0;var Ne=(u+(r=r+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),r=r+Math.imul(P,de)|0,i=(i=i+Math.imul(P,fe)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,fe)|0;var Oe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,de),i=(i=Math.imul(B,fe))+Math.imul(U,de)|0,o=Math.imul(U,fe);var je=(u+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Le=(u+(r=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(U,pe)|0))<<13)|0;return u=((o=Math.imul(U,me))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=ye,c[1]=ge,c[2]=ve,c[3]=we,c[4]=be,c[5]=Se,c[6]=_e,c[7]=xe,c[8]=Ee,c[9]=ke,c[10]=Ce,c[11]=Ae,c[12]=Te,c[13]=Ie,c[14]=Me,c[15]=Ne,c[16]=Oe,c[17]=je,c[18]=Le,0!==u&&(c[19]=u,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function v(e,t,n){return g(e,t,n)}function w(e,t){this.x=e,this.y=t}Math.imul||(y=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):n<63?m(this,e,t):n<1024?g(this,e,t):v(this,e,t)},w.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,c=r.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var f=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(i,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(c)):(n.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,f=1;0===(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new C(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)},i(_,S),_.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}c=26}return i},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new A(e)},i(A,C),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},3333:function(e,t,n){"use strict";var r=n(918).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;const u=c(n(4166)),l=c(n(9955)),d=s(n(4210)),f=new("function"!==typeof TextDecoder?d.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"===typeof e&&(e=r.from(e,"utf8")),l.default.encode(r.from(e))},t.baseDecode=function(e){return r.from(l.default.decode(e))};const h=1024;class p 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(".")}}t.BorshError=p;class m{constructor(){this.buf=r.alloc(h),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=r.concat([this.buf,r.alloc(h)]))}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(r.from(new u.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(r.from(new u.default(e).toArray("le",64)))}writeBuffer(e){this.buf=r.concat([r.from(this.buf.subarray(0,this.length)),e,r.alloc(h)]),this.length+=e.length}writeString(e){this.maybeResize();const t=r.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(r.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}}function y(e,t,n){const r=n.value;n.value=function(){try{for(var e=arguments.length,t=new Array(e),n=0;n=0)throw new p("Reached the end of buffer when deserializing")}throw i}}}t.BinaryWriter=m;class g{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new u.default(e,"le")}readU128(){const e=this.readBuffer(16);return new u.default(e,"le")}readU256(){const e=this.readBuffer(32);return new u.default(e,"le")}readU512(){const e=this.readBuffer(64);return new u.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new p("Expected buffer length ".concat(e," isn't within bounds"));const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return f.decode(t)}catch(n){throw new p("Error decoding UTF-8 string: ".concat(n))}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),n=Array();for(let r=0;r{w(e,t,n,r[0],i)}));else if(void 0!==r.kind)switch(r.kind){case"option":null===n||void 0===n?i.writeU8(0):(i.writeU8(1),w(e,t,n,r.type,i));break;case"map":i.writeU32(n.size),n.forEach(((n,o)=>{w(e,t,o,r.key,i),w(e,t,n,r.value,i)}));break;default:throw new p("FieldType ".concat(r," unrecognized"))}else b(e,n,i)}catch(o){throw o instanceof p&&o.addToFieldPath(t),o}}function b(e,t,n){if("function"===typeof t.borshSerialize)return void t.borshSerialize(n);const r=e.get(t.constructor);if(!r)throw new p("Class ".concat(t.constructor.name," is missing in schema"));if("struct"===r.kind)r.fields.map((r=>{let[i,o]=r;w(e,i,t[i],o,n)}));else{if("enum"!==r.kind)throw new p("Unexpected schema kind: ".concat(r.kind," for ").concat(t.constructor.name));{const i=t[r.field];for(let o=0;oS(e,t,n[0],r)))}if("option"===n.kind){return r.readU8()?S(e,t,n.type,r):void 0}if("map"===n.kind){let i=new Map;const o=r.readU32();for(let a=0;a=r.values.length)throw new p("Enum index: ".concat(i," is out of range"));const[o,a]=r.values[i];return new t({[o]:S(e,o,a,n)})}throw new p("Unexpected schema kind: ".concat(r.kind," for ").concat(t.constructor.name))}a([y],g.prototype,"readU8",null),a([y],g.prototype,"readU16",null),a([y],g.prototype,"readU32",null),a([y],g.prototype,"readU64",null),a([y],g.prototype,"readU128",null),a([y],g.prototype,"readU256",null),a([y],g.prototype,"readU512",null),a([y],g.prototype,"readString",null),a([y],g.prototype,"readFixedArray",null),a([y],g.prototype,"readArray",null),t.BinaryReader=g,t.serialize=function(e,t){const n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:m);return b(e,t,n),n.toArray()},t.deserialize=function(e,t,n){const r=new(arguments.length>3&&void 0!==arguments[3]?arguments[3]:g)(n),i=_(e,t,r);if(r.offset3&&void 0!==arguments[3]?arguments[3]:g)(n))}},9955:(e,t,n)=>{var r=n(7152);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},2799:(e,t,n)=>{"use strict";var r=n(918).Buffer;class i{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}decode(e,t){throw new Error("Layout is abstract")}encode(e,t,n){throw new Error("Layout is abstract")}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const 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}t.Layout=i,t.nameWithProperty=o,t.bindConstructorLayout=function(e,t){if("function"!==typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof i))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value:function(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,n){return t.decode(e,n)},writable:!0})};class a extends i{isCount(){throw new Error("ExternalLayout is abstract")}}class s extends a{constructor(e,t){if(void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t){void 0===t&&(t=0);const n=e.length-t;return Math.floor(n/this.elementSpan)}encode(e,t,n){return 0}}class c extends a{constructor(e,t,n){if(!(e instanceof i))throw new TypeError("layout must be a Layout");if(void 0===t)t=0;else if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof u||this.layout instanceof l}decode(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}encode(e,t,n){return void 0===n&&(n=0),this.layout.encode(e,t,n+this.offset)}}class u extends i{constructor(e,t){if(super(e,t),6e+r.encode(i,t,n+e)),0);return this.count instanceof a&&this.count.encode(e.length,t,n),i}}class k extends i{constructor(e,t,n){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof i),!0))throw new TypeError("fields must be array of Layout instances");"boolean"===typeof t&&void 0===n&&(n=t,t=void 0);for(const i of e)if(0>i.span&&void 0===i.property)throw new Error("fields cannot contain unnamed variable-length layout");let r=-1;try{r=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(o){}super(r,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);let n=0;try{n=this.fields.reduce(((n,r)=>{const i=r.getSpan(e,t);return t+=i,n+i}),0)}catch(r){throw new RangeError("indeterminate span")}return n}decode(e,t){void 0===t&&(t=0);const n=this.makeDestinationObject();for(const r of this.fields)if(void 0!==r.property&&(n[r.property]=r.decode(e,t)),t+=r.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return n}encode(e,t,n){void 0===n&&(n=0);const r=n;let i=0,o=0;for(const a of this.fields){let r=a.span;if(o=0r&&(r=a.getSpan(t,n)))}i=n,n+=r}return i+o-r}fromArray(e){const t=this.makeDestinationObject();for(const n of this.fields)void 0!==n.property&&0n.span?t=-1:0<=t&&(t+=n.span)}}}class C{constructor(e){this.property=e}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class A extends C{constructor(e,t){if(!(e instanceof a&&e.isCount()))throw new 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,n){return this.layout.encode(e,t,n)}}class T extends i{constructor(e,t,n){const r=e instanceof u||e instanceof l;if(r)e=new A(new c(e));else if(e instanceof a&&e.isCount())e=new A(e);else if(!(e instanceof C))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===t&&(t=null),!(null===t||t instanceof i))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let o=-1;t&&(o=t.span,0<=o&&r&&(o+=e.layout.span)),super(o,n),this.discriminator=e,this.usesPrefixDiscriminator=r,this.defaultLayout=t,this.registry={};let s=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return s(e)},this.configGetSourceVariant=function(e){s=e.bind(this)}}getSpan(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);const n=this.getVariant(e,t);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(e,t)}defaultGetSourceVariant(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(const t in this.registry){const n=this.registry[t];if(e.hasOwnProperty(n.property))return n}throw new Error("unable to infer src variant")}decode(e,t){let n;void 0===t&&(t=0);const r=this.discriminator,i=r.decode(e,t);let o=this.registry[i];if(void 0===o){let a=0;o=this.defaultLayout,this.usesPrefixDiscriminator&&(a=r.layout.span),n=this.makeDestinationObject(),n[r.property]=i,n[o.property]=this.defaultLayout.decode(e,t+a)}else n=o.decode(e,t);return n}encode(e,t,n){void 0===n&&(n=0);const r=this.getSourceVariant(e);if(void 0===r){const r=this.discriminator,i=this.defaultLayout;let o=0;return this.usesPrefixDiscriminator&&(o=r.layout.span),r.encode(e[r.property],t,n),o+i.encode(e[i.property],t,n+o)}return r.encode(e,t,n)}addVariant(e,t,n){const r=new I(this,e,t,n);return this.registry[e]=r,r}getVariant(e,t){let n=e;return r.isBuffer(e)&&(void 0===t&&(t=0),n=this.discriminator.decode(e,t)),this.registry[n]}}class I extends i{constructor(e,t,n,r){if(!(e instanceof T))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof n&&void 0===r&&(r=n,n=null),n){if(!(n instanceof i))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=n.span&&n.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof r)throw new TypeError("variant must have a String property")}let o=e.span;0>e.span&&(o=n?n.span:0,0<=o&&e.usesPrefixDiscriminator&&(o+=e.discriminator.layout.span)),super(o,r),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(e,t+n)}decode(e,t){const n=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(e,t,n){void 0===n&&(n=0);let r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,n);let i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function M(e){return 0>e&&(e+=4294967296),e}class N extends i{constructor(e,t,n){if(!(e instanceof u||e instanceof l))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof t&&void 0===n&&(n=t,t=void 0),4=t)throw new TypeError("bits must be positive integer");const r=8*e.span,i=e.fields.reduce(((e,t)=>e+t.bits),0);if(t+i>r)throw new Error("bits too long for span remainder ("+(r-i)+" of "+r+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start}encode(e){if(!Number.isInteger(e)||e!==M(e&this.valueMask))throw new TypeError(o("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),n=M(e<n&&(n=this.length.decode(e,t)),n}decode(e,t){void 0===t&&(t=0);let n=this.span;return 0>n&&(n=this.length.decode(e,t)),e.slice(t,t+n)}encode(e,t,n){let i=this.length;if(this.length instanceof a&&(i=e.length),!r.isBuffer(e)||i!==e.length)throw new TypeError(o("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(n+i>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),n,i,"hex"),this.length instanceof a&&this.length.encode(i,t,n),i}}class P extends i{constructor(e){super(-1,e)}getSpan(e,t){if(!r.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);let n=t;for(;nt.length)throw new RangeError("encoding overruns Buffer");return i.copy(t,n),t[n+o]=0,o+1}}class R extends i{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 new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t){if(!r.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}decode(e,t,n){void 0===t&&(t=0);let r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return i.copy(t,n),o}}class D extends i{constructor(e,t){super(0,t),this.value=e}decode(e,t,n){return this.value}encode(e,t,n){return 0}}t.ExternalLayout=a,t.GreedyCount=s,t.OffsetLayout=c,t.UInt=u,t.UIntBE=l,t.Int=d,t.IntBE=f,t.Float=b,t.FloatBE=S,t.Double=_,t.DoubleBE=x,t.Sequence=E,t.Structure=k,t.UnionDiscriminator=C,t.UnionLayoutDiscriminator=A,t.Union=T,t.VariantLayout=I,t.BitStructure=N,t.BitField=O,t.Boolean=j,t.Blob=L,t.CString=P,t.UTF8=R,t.Constant=D,t.greedy=(e,t)=>new s(e,t),t.offset=(e,t,n)=>new c(e,t,n),t.u8=e=>new u(1,e),t.u16=e=>new u(2,e),t.u24=e=>new u(3,e),t.u32=e=>new u(4,e),t.u40=e=>new u(5,e),t.u48=e=>new u(6,e),t.nu64=e=>new y(e),t.u16be=e=>new l(2,e),t.u24be=e=>new l(3,e),t.u32be=e=>new l(4,e),t.u40be=e=>new l(5,e),t.u48be=e=>new l(6,e),t.nu64be=e=>new g(e),t.s8=e=>new d(1,e),t.s16=e=>new d(2,e),t.s24=e=>new d(3,e),t.s32=e=>new d(4,e),t.s40=e=>new d(5,e),t.s48=e=>new d(6,e),t.ns64=e=>new v(e),t.s16be=e=>new f(2,e),t.s24be=e=>new f(3,e),t.s32be=e=>new f(4,e),t.s40be=e=>new f(5,e),t.s48be=e=>new f(6,e),t.ns64be=e=>new w(e),t.f32=e=>new b(e),t.f32be=e=>new S(e),t.f64=e=>new _(e),t.f64be=e=>new x(e),t.struct=(e,t,n)=>new k(e,t,n),t.bits=(e,t,n)=>new N(e,t,n),t.seq=(e,t,n)=>new E(e,t,n),t.union=(e,t,n)=>new T(e,t,n),t.unionLayoutDiscriminator=(e,t)=>new A(e,t),t.blob=(e,t)=>new L(e,t),t.cstr=e=>new P(e),t.utf8=(e,t)=>new R(e,t),t.const=(e,t)=>new D(e,t)},918:(e,t,n)=>{"use strict";const r=n(2470),i=n(545),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=s(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||X(e.length)?s(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,i){let o,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;os&&(n=s-c),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128===(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[i+1],r=e[i+2],128===(192&n)&&128===(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128===(192&n)&&128===(192&r)&&128===(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(o,a),u=this.slice(r,i),l=e.slice(t,n);for(let c=0;c>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return _(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let o=t;on)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r,i){F(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function P(e,t,n,r,i){F(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function R(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);let r=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,n||O(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J((function(e){V(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||O(e,t,this.length);let r=this[e],i=1,o=0;for(;++o=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J((function(e){V(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J((function(e){return L(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=J((function(e){return P(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);j(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);j(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J((function(e){return L(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=J((function(e){return P(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i=r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function F(e,t,n,r,i,o){if(e>n||e3?0===t||t===BigInt(0)?">= 0".concat(r," and < 2").concat(r," ** ").concat(8*(o+1)).concat(r):">= -(2".concat(r," ** ").concat(8*(o+1)-1).concat(r,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(r):">= ".concat(t).concat(r," and <= ").concat(n).concat(r),new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,i,o)}function V(e,t){if("number"!==typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw V(e,n),new U.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,n){let r='The value of "'.concat(e,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=H(String(n)):"bigint"===typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),r+=" It must be ".concat(t,". Received ").concat(i),r}),RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function K(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function G(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function J(e){return"undefined"===typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},4680:(e,t,n)=>{"use strict";var r=n(8476),i=n(9962),o=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&o(e,".prototype.")>-1?i(n):n}},9962:(e,t,n)=>{"use strict";var r=n(1199),i=n(8476),o=n(1267),a=i("%TypeError%"),s=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||r.call(c,s),l=i("%Object.defineProperty%",!0),d=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(h){l=null}e.exports=function(e){if("function"!==typeof e)throw new a("a function is required");var t=u(r,c,arguments);return o(t,1+d(0,e.length-(arguments.length-1)),!0)};var f=function(){return u(r,s,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},1759:function(e,t,n){var r;!function(i){"use strict";var o,a=1e9,s={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},c=!0,u="[DecimalError] ",l=u+"Invalid argument: ",d=u+"Exponent out of range: ",f=Math.floor,h=Math.pow,p=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,m=1e7,y=7,g=9007199254740991,v=f(g/y),w={};function b(e,t){var n,r,i,o,a,s,u,l,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),c?M(t,f):t;if(u=e.d,l=t.d,a=e.e,i=t.e,u=u.slice(),o=a-i){for(o<0?(r=u,o=-o,s=l.length):(r=l,i=a,s=u.length),o>(s=(a=Math.ceil(f/y))>s?a+1:s+1)&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for((s=u.length)-(o=l.length)<0&&(o=s,r=l,l=u,u=r),n=0;o;)n=(u[--o]=u[o]+l[o]+n)/m|0,u[o]%=m;for(n&&(u.unshift(n),++i),s=u.length;0==u[--s];)u.pop();return t.d=u,t.e=i,c?M(t,f):t}function S(e,t,n){if(e!==~~e||en)throw Error(l+e)}function _(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;te.e^o.s<0?1:-1;for(t=0,n=(r=o.d.length)<(i=e.d.length)?r:i;te.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1},w.decimalPlaces=w.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*y;if(t=e.d[t])for(;t%10==0;t/=10)n--;return n<0?0:n},w.dividedBy=w.div=function(e){return x(this,new this.constructor(e))},w.dividedToIntegerBy=w.idiv=function(e){var t=this.constructor;return M(x(this,new t(e),0,1),t.precision)},w.equals=w.eq=function(e){return!this.cmp(e)},w.exponent=function(){return k(this)},w.greaterThan=w.gt=function(e){return this.cmp(e)>0},w.greaterThanOrEqualTo=w.gte=function(e){return this.cmp(e)>=0},w.isInteger=w.isint=function(){return this.e>this.d.length-2},w.isNegative=w.isneg=function(){return this.s<0},w.isPositive=w.ispos=function(){return this.s>0},w.isZero=function(){return 0===this.s},w.lessThan=w.lt=function(e){return this.cmp(e)<0},w.lessThanOrEqualTo=w.lte=function(e){return this.cmp(e)<1},w.logarithm=w.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(o))throw Error(u+"NaN");if(n.s<1)throw Error(u+(n.s?"NaN":"-Infinity"));return n.eq(o)?new r(0):(c=!1,t=x(T(n,a),T(e,a),a),c=!0,M(t,i))},w.minus=w.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?N(t,e):b(t,(e.s=-e.s,e))},w.modulo=w.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(!(e=new r(e)).s)throw Error(u+"NaN");return n.s?(c=!1,t=x(n,e,0,1).times(e),c=!0,n.minus(t)):M(new r(n),i)},w.naturalExponential=w.exp=function(){return E(this)},w.naturalLogarithm=w.ln=function(){return T(this)},w.negated=w.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},w.plus=w.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?b(t,e):N(t,(e.s=-e.s,e))},w.precision=w.sd=function(e){var t,n,r,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(l+e);if(t=k(i)+1,n=(r=i.d.length-1)*y+1,r=i.d[r]){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},w.squareRoot=w.sqrt=function(){var e,t,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(u+"NaN")}for(e=k(s),c=!1,0==(i=Math.sqrt(+s))||i==1/0?(((t=_(s.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=f((e+1)/2)-(e<0||e%2),r=new l(t=i==1/0?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new l(i.toString()),i=a=(n=l.precision)+3;;)if(r=(o=r).plus(x(s,o,a+2)).times(.5),_(o.d).slice(0,a)===(t=_(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&"4999"==t){if(M(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if("9999"!=t)break;a+=4}return c=!0,M(r,n)},w.times=w.mul=function(e){var t,n,r,i,o,a,s,u,l,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,(u=h.length)<(l=p.length)&&(o=h,h=p,p=o,a=u,u=l,l=a),o=[],r=a=u+l;r--;)o.push(0);for(r=l;--r>=0;){for(t=0,i=u+r;i>r;)s=o[i]+p[r]*h[i-r-1]+t,o[i--]=s%m|0,t=s/m|0;o[i]=(o[i]+t)%m|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,c?M(e,f.precision):e},w.toDecimalPlaces=w.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(S(e,0,a),void 0===t?t=r.rounding:S(t,0,8),M(n,e+k(n)+1,t))},w.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=O(r,!0):(S(e,0,a),void 0===t?t=i.rounding:S(t,0,8),n=O(r=M(new i(r),e+1,t),!0,e+1)),n},w.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?O(i):(S(e,0,a),void 0===t?t=o.rounding:S(t,0,8),n=O((r=M(new o(i),e+k(i)+1,t)).abs(),!1,e+k(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)},w.toInteger=w.toint=function(){var e=this,t=e.constructor;return M(new t(e),k(e)+1,t.rounding)},w.toNumber=function(){return+this},w.toPower=w.pow=function(e){var t,n,r,i,a,s,l=this,d=l.constructor,h=+(e=new d(e));if(!e.s)return new d(o);if(!(l=new d(l)).s){if(e.s<1)throw Error(u+"Infinity");return l}if(l.eq(o))return l;if(r=d.precision,e.eq(o))return M(l,r);if(s=(t=e.e)>=(n=e.d.length-1),a=l.s,s){if((n=h<0?-h:h)<=g){for(i=new d(o),t=Math.ceil(r/y+4),c=!1;n%2&&j((i=i.times(l)).d,t),0!==(n=f(n/2));)j((l=l.times(l)).d,t);return c=!0,e.s<0?new d(o).div(i):M(i,r)}}else if(a<0)throw Error(u+"NaN");return a=a<0&&1&e.d[Math.max(t,n)]?-1:1,l.s=1,c=!1,i=e.times(T(l,r+12)),c=!0,(i=E(i)).s=a,i},w.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?r=O(i,(n=k(i))<=o.toExpNeg||n>=o.toExpPos):(S(e,1,a),void 0===t?t=o.rounding:S(t,0,8),r=O(i=M(new o(i),e,t),e<=(n=k(i))||n<=o.toExpNeg,e)),r},w.toSignificantDigits=w.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(S(e,1,a),void 0===t?t=n.rounding:S(t,0,8)),M(new n(this),e,t)},w.toString=w.valueOf=w.val=w.toJSON=function(){var e=this,t=k(e),n=e.constructor;return O(e,t<=n.toExpNeg||t>=n.toExpPos)};var x=function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%m|0,r=n/m|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(r,i,o,a){var s,c,l,d,f,h,p,g,v,w,b,S,_,x,E,C,A,T,I=r.constructor,N=r.s==i.s?1:-1,O=r.d,j=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(u+"Division by zero");for(c=r.e-i.e,A=j.length,E=O.length,g=(p=new I(N)).d=[],l=0;j[l]==(O[l]||0);)++l;if(j[l]>(O[l]||0)&&--c,(S=null==o?o=I.precision:a?o+(k(r)-k(i))+1:o)<0)return new I(0);if(S=S/y+2|0,l=0,1==A)for(d=0,j=j[0],S++;(l1&&(j=e(j,d),O=e(O,d),A=j.length,E=O.length),x=A,w=(v=O.slice(0,A)).length;w=m/2&&++C;do{d=0,(s=t(j,v,A,w))<0?(b=v[0],A!=w&&(b=b*m+(v[1]||0)),(d=b/C|0)>1?(d>=m&&(d=m-1),1==(s=t(f=e(j,d),v,h=f.length,w=v.length))&&(d--,n(f,A16)throw Error(d+k(e));if(!e.s)return new f(o);for(null==t?(c=!1,s=p):s=t,a=new f(.03125);e.abs().gte(.1);)e=e.times(a),l+=5;for(s+=Math.log(h(2,l))/Math.LN10*2+5|0,n=r=i=new f(o),f.precision=s;;){if(r=M(r.times(e),s),n=n.times(++u),_((a=i.plus(x(r,n,s))).d).slice(0,s)===_(i.d).slice(0,s)){for(;l--;)i=M(i.times(i),s);return f.precision=p,null==t?(c=!0,M(i,p)):i}i=a}}function k(e){for(var t=e.e*y,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw c=!0,n&&(e.precision=n),Error(u+"LN10 precision limit exceeded");return M(new e(e.LN10),t)}function A(e){for(var t="";e--;)t+="0";return t}function T(e,t){var n,r,i,a,s,l,d,f,h,p=1,m=e,y=m.d,g=m.constructor,v=g.precision;if(m.s<1)throw Error(u+(m.s?"NaN":"-Infinity"));if(m.eq(o))return new g(0);if(null==t?(c=!1,f=v):f=t,m.eq(10))return null==t&&(c=!0),C(g,f);if(f+=10,g.precision=f,r=(n=_(y)).charAt(0),a=k(m),!(Math.abs(a)<15e14))return d=C(g,f+2,v).times(a+""),m=T(new g(r+"."+n.slice(1)),f-10).plus(d),g.precision=v,null==t?(c=!0,M(m,v)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=_((m=m.times(e)).d)).charAt(0),p++;for(a=k(m),r>1?(m=new g("0."+n),a++):m=new g(r+"."+n.slice(1)),l=s=m=x(m.minus(o),m.plus(o),f),h=M(m.times(m),f),i=3;;){if(s=M(s.times(h),f),_((d=l.plus(x(s,new g(i),f))).d).slice(0,f)===_(l.d).slice(0,f))return l=l.times(2),0!==a&&(l=l.plus(C(g,f+2,v).times(a+""))),l=x(l,new g(p),f),g.precision=v,null==t?(c=!0,M(l,v)):l;l=d,i+=2}}function I(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(r,i)){if(i-=r,n=n-r-1,e.e=f(n/y),e.d=[],r=(n+1)%y,n<0&&(r+=y),rv||e.e<-v))throw Error(d+n)}else e.s=0,e.e=0,e.d=[0];return e}function M(e,t,n){var r,i,o,a,s,u,l,p,g=e.d;for(a=1,o=g[0];o>=10;o/=10)a++;if((r=t-a)<0)r+=y,i=t,l=g[p=0];else{if((p=Math.ceil((r+1)/y))>=(o=g.length))return e;for(l=o=g[p],a=1;o>=10;o/=10)a++;i=(r%=y)-y+a}if(void 0!==n&&(s=l/(o=h(10,a-i-1))%10|0,u=t<0||void 0!==g[p+1]||l%o,u=n<4?(s||u)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||u||6==n&&(r>0?i>0?l/h(10,a-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return u?(o=k(e),g.length=1,t=t-o-1,g[0]=h(10,(y-t%y)%y),e.e=f(-t/y)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=p,o=1,p--):(g.length=p+1,o=h(10,y-r),g[p]=i>0?(l/h(10,a-i)%h(10,i)|0)*o:0),u)for(;;){if(0==p){(g[0]+=o)==m&&(g[0]=1,++e.e);break}if(g[p]+=o,g[p]!=m)break;g[p--]=0,o=1}for(r=g.length;0===g[--r];)g.pop();if(c&&(e.e>v||e.e<-v))throw Error(d+k(e));return e}function N(e,t){var n,r,i,o,a,s,u,l,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),c?M(t,p):t;if(u=e.d,f=t.d,r=t.e,l=e.e,u=u.slice(),a=l-r){for((d=a<0)?(n=u,a=-a,s=f.length):(n=f,r=l,s=u.length),a>(i=Math.max(Math.ceil(p/y),s)+2)&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for((d=(i=u.length)<(s=f.length))&&(s=i),i=0;i0;--i)u[s++]=0;for(i=f.length;i>a;){if(u[--i]0?o=o.charAt(0)+"."+o.slice(1)+A(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+A(-i-1)+o,n&&(r=n-a)>0&&(o+=A(r))):i>=a?(o+=A(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+A(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=A(r))),e.s<0?"-"+o:o}function j(e,t){if(e.length>t)return e.length=t,!0}function L(e){if(!e||"object"!==typeof e)throw Error(u+"Object expected");var t,n,r,i=["precision",1,a,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t=i[t+1]&&r<=i[t+2]))throw Error(l+n+": "+r);this[n]=r}if(void 0!==(r=e[n="LN10"])){if(r!=Math.LN10)throw Error(l+n+": "+r);this[n]=new this(r)}return this}s=function e(t){var n,r,i;function o(e){var t=this;if(!(t instanceof o))return new o(e);if(t.constructor=o,e instanceof o)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"===typeof e){if(0*e!==0)throw Error(l+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):I(t,e.toString())}if("string"!==typeof e)throw Error(l+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!p.test(e))throw Error(l+e);I(t,e)}if(o.prototype=w,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=e,o.config=o.set=L,void 0===t&&(t={}),t)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n{"use strict";var r=n(2926)(),i=n(8476),o=r&&i("%Object.defineProperty%",!0);if(o)try{o({},"a",{value:1})}catch(u){o=!1}var a=i("%SyntaxError%"),s=i("%TypeError%"),c=n(6103);e.exports=function(e,t,n){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new s("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],d=!!c&&c(e,t);if(o)o(e,t,{configurable:null===u&&d?d.configurable:!u,enumerable:null===r&&d?d.enumerable:!r,value:n,writable:null===i&&d?d.writable:!i});else{if(!l&&(r||i||u))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},9959:(e,t,n)=>{"use strict";var r=n(6328),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=n(5150),c=n(2926)(),u=function(e,t,n,r){if(t in e)if(!0===r){if(e[t]===n)return}else if("function"!==typeof(i=r)||"[object Function]"!==o.call(i)||!r())return;var i;c?s(e,t,n,!0):s(e,t,n)},l=function(e,t){var n=arguments.length>2?arguments[2]:{},o=r(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i{"use strict";var r=n(8866),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=n),"[object Array]"===i.call(e)?function(e,t,n){for(var r=0,i=e.length;r{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r{"use strict";var r=n(2781);e.exports=Function.prototype.bind||r},8476:(e,t,n)=>{"use strict";var r,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(M){c=null}var u=function(){throw new a},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(t){return u}}}():u,d=n(5520)(),f=n(7593)(),h=Object.getPrototypeOf||(f?function(e){return e.__proto__}:null),p={},m="undefined"!==typeof Uint8Array&&h?h(Uint8Array):r,y={"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":d&&h?h([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d&&h?h(h([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&d&&h?h((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&d&&h?h((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d&&h?h(""[Symbol.iterator]()):r,"%Symbol%":d?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":m,"%TypeError%":a,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(h)try{null.error}catch(M){var g=h(h(M));y["%Error.prototype%"]=g}var v=function e(t){var n;if("%AsyncFunction%"===t)n=s("async function () {}");else if("%GeneratorFunction%"===t)n=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=s("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&h&&(n=h(i.prototype))}return y[t]=n,n},w={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=n(1199),S=n(6834),_=b.call(Function.call,Array.prototype.concat),x=b.call(Function.apply,Array.prototype.splice),E=b.call(Function.call,String.prototype.replace),k=b.call(Function.call,String.prototype.slice),C=b.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,I=function(e,t){var n,r=e;if(S(w,r)&&(r="%"+(n=w[r])[0]+"%"),S(y,r)){var o=y[r];if(o===p&&(o=v(r)),"undefined"===typeof o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=k(e,0,1),n=k(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return E(e,A,(function(e,t,n,i){r[r.length]=n?E(i,T,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=I("%"+r+"%",t),s=o.name,u=o.value,l=!1,d=o.alias;d&&(r=d[0],x(n,_([0,1],d)));for(var f=1,h=!0;f=n.length){var v=c(u,p);u=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:u[p]}else h=S(u,p),u=u[p];h&&!l&&(y[s]=u)}}return u}},6103:(e,t,n)=>{"use strict";var r=n(8476)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(i){r=null}e.exports=r},2926:(e,t,n)=>{"use strict";var r=n(8476)("%Object.defineProperty%",!0),i=function(){if(r)try{return r({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},7593:e=>{"use strict";var t={foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof n)}},5520:(e,t,n)=>{"use strict";var r="undefined"!==typeof Symbol&&Symbol,i=n(541);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},541:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},8857:(e,t,n)=>{"use strict";var r=n(541);e.exports=function(){return r()&&!!Symbol.toStringTag}},6834:(e,t,n)=>{"use strict";var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=n(1199);e.exports=o.call(r,i)},7861:(e,t,n)=>{"use strict";var r=n(6214),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=l(n);d&&(a=a.concat(d(n)));for(var s=c(t),m=c(n),y=0;y{t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=u}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*m}},273:e=>{"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},5021:(e,t,n)=>{"use strict";var r=n(8857)(),i=n(4680)("Object.prototype.toString"),o=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},8866:e=>{"use strict";var t,n,r=Function.prototype.toString,i="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof i&&"function"===typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,t)}catch(h){h!==n&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=r.call(e);return o.test(t)}catch(n){return!1}},s=function(e){try{return!a(e)&&(r.call(e),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"===typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),d=function(){return!1};if("object"===typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(d=function(e){if((l||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(n){}return!1})}e.exports=i?function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{i(e,null,t)}catch(r){if(r!==n)return!1}return!a(e)&&s(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(u)return s(e);if(a(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},7469:(e,t,n)=>{"use strict";var r,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=n(8857)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!c)return!1;if("undefined"===typeof r){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&c(t)}return c(e)===r}},1546:e=>{"use strict";e.exports=function(e){return e!==e}},5738:(e,t,n)=>{"use strict";var r=n(9962),i=n(9959),o=n(1546),a=n(9221),s=n(5434),c=r(a(),Number);i(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},9221:(e,t,n)=>{"use strict";var r=n(1546);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}},5434:(e,t,n)=>{"use strict";var r=n(9959),i=n(9221);e.exports=function(){var e=i();return r(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2105:(e,t,n)=>{"use strict";var r=n(1520);e.exports=function(e){return!!r(e)}},2630:(e,t,n)=>{"use strict";const r=n(2363).v4,i=n(6013),o=function(e,t){if(!(this instanceof o))return new o(e,t);t||(t={}),this.options={reviver:"undefined"!==typeof t.reviver?t.reviver:null,replacer:"undefined"!==typeof t.replacer?t.replacer:null,generator:"undefined"!==typeof t.generator?t.generator:function(){return r()},version:"undefined"!==typeof t.version?t.version:2,notificationIdNull:"boolean"===typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=o,o.prototype.request=function(e,t,n,r){const o=this;let a=null;const s=Array.isArray(e)&&"function"===typeof t;if(1===this.options.version&&s)throw new TypeError("JSON-RPC 1.0 does not support batching");if(s||!s&&e&&"object"===typeof e&&"function"===typeof t)r=t,a=e;else{"function"===typeof n&&(r=n,n=void 0);const o="function"===typeof r;try{a=i(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(o)return r(u);throw u}if(!o)return a}let c;try{c=JSON.stringify(a,this.options.replacer)}catch(u){return r(u)}return this.callServer(c,(function(e,t){o._parseResponse(e,t,r)})),a},o.prototype._parseResponse=function(e,t,n){if(e)return void n(e);if(!t)return n();let r;try{r=JSON.parse(t,this.options.reviver)}catch(e){return n(e)}if(3===n.length){if(Array.isArray(r)){const e=function(e){return"undefined"!==typeof e.error},t=function(t){return!e(t)};return n(null,r.filter(e),r.filter(t))}return n(null,r.error,r.result)}n(null,r)}},6013:(e,t,n)=>{"use strict";const r=n(2363).v4;e.exports=function(e,t,n,i){if("string"!==typeof e)throw new TypeError(e+" must be a string");const o="number"===typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const a={method:e};if(2===o&&(a.jsonrpc="2.0"),t){if("object"!==typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");a.params=t}if("undefined"===typeof n){const e="function"===typeof i.generator?i.generator:function(){return r()};a.id=e(a,i)}else 2===o&&null===n?i.notificationIdNull&&(a.id=null):a.id=n;return a}},9293:(module,exports,__webpack_require__)=>{var process=__webpack_require__(7490),__WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"===typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(n){return new Sha256(t,!0).update(n)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n>6,a[c++]=128|63&o):o<55296||o>=57344?(a[c++]=224|o>>12,a[c++]=128|o>>6&63,a[c++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++r)),a[c++]=240|o>>18,a[c++]=128|o>>12&63,a[c++]=128|o>>6&63,a[c++]=128|63&o);e=a}else{if("object"!==i)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var u=[],l=[];for(r=0;r<64;++r){var d=e[r]||0;u[r]=92^d,l[r]=54^d}Sha256.call(this,t,n),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=n}Sha256.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var r,i,o=0,a=e.length,s=this.blocks;o>2]|=e[o]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(s[i>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,n,r,i,o,a,s,c,u=this.h0,l=this.h1,d=this.h2,f=this.h3,h=this.h4,p=this.h5,m=this.h6,y=this.h7,g=this.blocks;for(e=16;e<64;++e)t=((i=g[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=g[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,g[e]=g[e-16]+t+g[e-7]+n<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,y=(i=g[0]-1413257819)-150054599<<0,f=i+24177077<<0):(o=704751109,y=(i=g[0]-210244248)-1521486534<<0,f=i+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(o=u&l)^u&d^c,y=f+(i=y+(n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&p^~h&m)+K[e]+g[e])<<0,f=i+(t+r)<<0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(a=f&u)^f&l^o,m=d+(i=m+(n=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&h^~y&p)+K[e+1]+g[e+1])<<0,t=((d=i+(t+r)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(s=d&f)^d&u^a,p=l+(i=p+(n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&y^~m&h)+K[e+2]+g[e+2])<<0,t=((l=i+(t+r)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(c=l&d)^l&f^s,h=u+(i=h+(n=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&y)+K[e+3]+g[e+3])<<0,u=i+(t+r)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+d<<0,this.h3=this.h3+f<<0,this.h4=this.h4+h<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+y<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,c=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(c+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||c.push(s>>24&255,s>>16&255,s>>8&255,255&s),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},6031:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",c=16,u=32,l=64,d=128,f=256,h=1/0,p=9007199254740991,m=NaN,y=4294967295,g=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",u],["partialRight",l],["rearg",f]],v="[object Arguments]",w="[object Array]",b="[object Boolean]",S="[object Date]",_="[object Error]",x="[object Function]",E="[object GeneratorFunction]",k="[object Map]",C="[object Number]",A="[object Object]",T="[object Promise]",I="[object RegExp]",M="[object Set]",N="[object String]",O="[object Symbol]",j="[object WeakMap]",L="[object ArrayBuffer]",P="[object DataView]",R="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",U="[object Int16Array]",z="[object Int32Array]",H="[object Uint8Array]",F="[object Uint8ClampedArray]",V="[object Uint16Array]",W="[object Uint32Array]",Y=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,X=RegExp(G.source),Q=RegExp(Z.source),J=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ye=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,we=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,Se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",ke="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="['\u2019]",Oe="["+Ee+"]",je="["+Me+"]",Le="["+ke+"]",Pe="\\d+",Re="["+Ce+"]",De="["+Ae+"]",Be="[^"+Ee+Me+Pe+Ce+Ae+Te+"]",Ue="\\ud83c[\\udffb-\\udfff]",ze="[^"+Ee+"]",He="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+Te+"]",We="\\u200d",Ye="(?:"+De+"|"+Be+")",Ke="(?:"+Ve+"|"+Be+")",qe="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ge="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ze="(?:"+Le+"|"+Ue+")"+"?",Xe="["+Ie+"]?",Qe=Xe+Ze+("(?:"+We+"(?:"+[ze,He,Fe].join("|")+")"+Xe+Ze+")*"),Je="(?:"+[Re,He,Fe].join("|")+")"+Qe,$e="(?:"+[ze+Le+"?",Le,He,Fe,Oe].join("|")+")",et=RegExp(Ne,"g"),tt=RegExp(Le,"g"),nt=RegExp(Ue+"(?="+Ue+")|"+$e+Qe,"g"),rt=RegExp([Ve+"?"+De+"+"+qe+"(?="+[je,Ve,"$"].join("|")+")",Ke+"+"+Ge+"(?="+[je,Ve+Ye,"$"].join("|")+")",Ve+"?"+Ye+"+"+qe,Ve+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Je].join("|"),"g"),it=RegExp("["+We+Ee+ke+Ie+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,ct={};ct[R]=ct[D]=ct[B]=ct[U]=ct[z]=ct[H]=ct[F]=ct[V]=ct[W]=!0,ct[v]=ct[w]=ct[L]=ct[b]=ct[P]=ct[S]=ct[_]=ct[x]=ct[k]=ct[C]=ct[A]=ct[I]=ct[M]=ct[N]=ct[j]=!1;var ut={};ut[v]=ut[w]=ut[L]=ut[P]=ut[b]=ut[S]=ut[R]=ut[D]=ut[B]=ut[U]=ut[z]=ut[k]=ut[C]=ut[A]=ut[I]=ut[M]=ut[N]=ut[O]=ut[H]=ut[F]=ut[V]=ut[W]=!0,ut[_]=ut[x]=ut[j]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,ft=parseInt,ht="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pt="object"==typeof self&&self&&self.Object===Object&&self,mt=ht||pt||Function("return this")(),yt=t&&!t.nodeType&&t,gt=yt&&e&&!e.nodeType&&e,vt=gt&>.exports===yt,wt=vt&&ht.process,bt=function(){try{var e=gt&>.require&>.require("util").types;return e||wt&&wt.binding&&wt.binding("util")}catch(t){}}(),St=bt&&bt.isArrayBuffer,_t=bt&&bt.isDate,xt=bt&&bt.isMap,Et=bt&&bt.isRegExp,kt=bt&&bt.isSet,Ct=bt&&bt.isTypedArray;function At(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function rn(e,t){for(var n=e.length;n--&&Vt(t,e[n],0)>-1;);return n}var on=Gt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),an=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+lt[e]}function cn(e){return it.test(e)}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function ln(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var vn=function e(t){var n=(t=null==t?mt:vn.defaults(mt.Object(),t,vn.pick(mt,at))).Array,r=t.Date,se=t.Error,Ee=t.Function,ke=t.Math,Ce=t.Object,Ae=t.RegExp,Te=t.String,Ie=t.TypeError,Me=n.prototype,Ne=Ee.prototype,Oe=Ce.prototype,je=t["__core-js_shared__"],Le=Ne.toString,Pe=Oe.hasOwnProperty,Re=0,De=function(){var e=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Be=Oe.toString,Ue=Le.call(Ce),ze=mt._,He=Ae("^"+Le.call(Pe).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=vt?t.Buffer:i,Ve=t.Symbol,We=t.Uint8Array,Ye=Fe?Fe.allocUnsafe:i,Ke=ln(Ce.getPrototypeOf,Ce),qe=Ce.create,Ge=Oe.propertyIsEnumerable,Ze=Me.splice,Xe=Ve?Ve.isConcatSpreadable:i,Qe=Ve?Ve.iterator:i,Je=Ve?Ve.toStringTag:i,$e=function(){try{var e=fo(Ce,"defineProperty");return e({},"",{}),e}catch(t){}}(),nt=t.clearTimeout!==mt.clearTimeout&&t.clearTimeout,it=r&&r.now!==mt.Date.now&&r.now,lt=t.setTimeout!==mt.setTimeout&&t.setTimeout,ht=ke.ceil,pt=ke.floor,yt=Ce.getOwnPropertySymbols,gt=Fe?Fe.isBuffer:i,wt=t.isFinite,bt=Me.join,zt=ln(Ce.keys,Ce),Gt=ke.max,wn=ke.min,bn=r.now,Sn=t.parseInt,_n=ke.random,xn=Me.reverse,En=fo(t,"DataView"),kn=fo(t,"Map"),Cn=fo(t,"Promise"),An=fo(t,"Set"),Tn=fo(t,"WeakMap"),In=fo(Ce,"create"),Mn=Tn&&new Tn,Nn={},On=Bo(En),jn=Bo(kn),Ln=Bo(Cn),Pn=Bo(An),Rn=Bo(Tn),Dn=Ve?Ve.prototype:i,Bn=Dn?Dn.valueOf:i,Un=Dn?Dn.toString:i;function zn(e){if(ts(e)&&!Wa(e)&&!(e instanceof Wn)){if(e instanceof Vn)return e;if(Pe.call(e,"__wrapped__"))return Uo(e)}return new Vn(e)}var Hn=function(){function e(){}return function(t){if(!es(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Fn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function cr(e,t,n,r,o,a){var s,c=1&t,u=2&t,l=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!es(e))return e;var d=Wa(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Pe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Ii(e,s)}else{var f=mo(e),h=f==x||f==E;if(Ga(e))return xi(e,c);if(f==A||f==v||h&&!o){if(s=u||h?{}:go(e),!c)return u?function(e,t){return Mi(e,po(e),t)}(e,function(e,t){return e&&Mi(t,Os(t),e)}(s,e)):function(e,t){return Mi(e,ho(e),t)}(e,ir(s,e))}else{if(!ut[f])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case L:return Ei(e);case b:case S:return new r(+e);case P:return function(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case R:case D:case B:case U:case z:case H:case F:case V:case W:return ki(e,n);case k:return new r;case C:case N:return new r(e);case I:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new r;case O:return i=e,Bn?Ce(Bn.call(i)):{}}var i}(e,f,c)}}a||(a=new Zn);var p=a.get(e);if(p)return p;a.set(e,s),as(e)?e.forEach((function(r){s.add(cr(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,cr(r,t,n,i,e,a))}));var m=d?i:(l?u?io:ro:u?Os:Ns)(e);return It(m||e,(function(r,i){m&&(r=e[i=r]),tr(s,i,cr(r,t,n,i,e,a))})),s}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Ie(o);return No((function(){e.apply(i,n)}),t)}function dr(e,t,n,r){var i=-1,o=jt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;n&&(t=Pt(t,$t(n))),r?(o=Lt,a=!1):t.length>=200&&(o=tn,a=!1,t=new Gn(t));e:for(;++i-1},Kn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(kn||Kn),string:new Yn}},qn.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return uo(this,e).get(e)},qn.prototype.has=function(e){return uo(this,e).has(e)},qn.prototype.set=function(e,t){var n=uo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,a),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Zn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Zn.prototype.get=function(e){return this.__data__.get(e)},Zn.prototype.has=function(e){return this.__data__.has(e)},Zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!kn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var fr=ji(br),hr=ji(Sr,!0);function pr(e,t){var n=!0;return fr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function mr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?gr(s,t-1,n,r,i):Rt(i,s):r||(i[i.length]=s)}return i}var vr=Li(),wr=Li(!0);function br(e,t){return e&&vr(e,t,Ns)}function Sr(e,t){return e&&wr(e,t,Ns)}function _r(e,t){return Ot(t,(function(t){return Qa(e[t])}))}function xr(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&nt}function Ar(e,t){return null!=e&&Pe.call(e,t)}function Tr(e,t){return null!=e&&t in Ce(e)}function Ir(e,t,r){for(var o=r?Lt:jt,a=e[0].length,s=e.length,c=s,u=n(s),l=1/0,d=[];c--;){var f=e[c];c&&t&&(f=Pt(f,$t(t))),l=wn(f.length,l),u[c]=!r&&(t||a>=120&&f.length>=120)?new Gn(c&&f):i}f=e[0];var h=-1,p=u[0];e:for(;++h=s?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function qr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Ze.call(e,i,1):di(e,i)}}return e}function Gr(e,t){return e+pt(_n()*(t-e+1))}function Zr(e,t){var n="";if(!e||t<1||t>p)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Xr(e,t){return Oo(Ao(e,t,rc),e+"")}function Qr(e){return Qn(zs(e))}function Jr(e,t){var n=zs(e);return Po(n,sr(t,0,n.length))}function $r(e,t,n,r){if(!es(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oo?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i>>1,a=e[o];null!==a&&!cs(a)&&(n?a<=t:a=200){var u=t?null:Zi(e);if(u)return fn(u);a=!1,i=tn,c=new Gn}else c=t?[]:s;e:for(;++r=r?e:ri(e,t,n)}var _i=nt||function(e){return mt.clearTimeout(e)};function xi(e,t){if(t)return e.slice();var n=e.length,r=Ye?Ye(n):new e.constructor(n);return e.copy(r),r}function Ei(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function ki(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,a=cs(e),s=t!==i,c=null===t,u=t===t,l=cs(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!o)return 1;if(!r&&!a&&!l&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&bo(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=Ce(t);++r-1?o[a?t[s]:s]:i}}function Ui(e){return no((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Ie(o);if(a&&!c&&"wrapper"==ao(s))var c=new Vn([],!0)}for(r=c?r:n;++r1&&b.reverse(),h&&lc))return!1;var l=a.get(e),d=a.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&n?new Gn:i;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return It(g,(function(n){var r="_."+n[0];t&n[1]&&!jt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function Lo(e){var t=0,n=0;return function(){var r=bn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Po(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,oa(e,n)}));function fa(e){var t=zn(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var pa=no((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Wn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ma=Ni((function(e,t,n){Pe.call(e,n)?++e[n]:or(e,n,1)}));var ya=Bi(Vo),ga=Bi(Wo);function va(e,t){return(Wa(e)?It:fr)(e,co(t,3))}function wa(e,t){return(Wa(e)?Mt:hr)(e,co(t,3))}var ba=Ni((function(e,t,n){Pe.call(e,n)?e[n].push(t):or(e,n,[t])}));var Sa=Xr((function(e,t,r){var i=-1,o="function"==typeof t,a=Ka(e)?n(e.length):[];return fr(e,(function(e){a[++i]=o?At(t,e,r):Mr(e,t,r)})),a})),_a=Ni((function(e,t,n){or(e,n,t)}));function xa(e,t){return(Wa(e)?Pt:Ur)(e,co(t,3))}var Ea=Ni((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ka=Xr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&bo(e,t[0],t[1])?t=[]:n>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Wr(e,gr(t,1),[])})),Ca=it||function(){return mt.Date.now()};function Aa(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Qi(e,d,i,i,i,i,t)}function Ta(e,t){var n;if("function"!=typeof t)throw new Ie(o);return e=ps(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ia=Xr((function(e,t,n){var r=1;if(n.length){var i=dn(n,so(Ia));r|=u}return Qi(e,r,t,n,i)})),Ma=Xr((function(e,t,n){var r=3;if(n.length){var i=dn(n,so(Ma));r|=u}return Qi(t,r,e,n,i)}));function Na(e,t,n){var r,a,s,c,u,l,d=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(o);function m(t){var n=r,o=a;return r=a=i,d=t,c=e.apply(o,n)}function y(e){var n=e-l;return l===i||n>=t||n<0||h&&e-d>=s}function g(){var e=Ca();if(y(e))return v(e);u=No(g,function(e){var n=t-(e-l);return h?wn(n,s-(e-d)):n}(e))}function v(e){return u=i,p&&r?m(e):(r=a=i,c)}function w(){var e=Ca(),n=y(e);if(r=arguments,a=this,l=e,n){if(u===i)return function(e){return d=e,u=No(g,t),f?m(e):c}(l);if(h)return _i(u),u=No(g,t),m(l)}return u===i&&(u=No(g,t)),c}return t=ys(t)||0,es(n)&&(f=!!n.leading,s=(h="maxWait"in n)?Gt(ys(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),w.cancel=function(){u!==i&&_i(u),d=0,r=l=a=u=i},w.flush=function(){return u===i?c:v(Ca())},w}var Oa=Xr((function(e,t){return lr(e,1,t)})),ja=Xr((function(e,t,n){return lr(e,ys(t)||0,n)}));function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(La.Cache||qn),n}function Pa(e){if("function"!=typeof e)throw new Ie(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=qn;var Ra=bi((function(e,t){var n=(t=1==t.length&&Wa(t[0])?Pt(t[0],$t(co())):Pt(gr(t,1),$t(co()))).length;return Xr((function(r){for(var i=-1,o=wn(r.length,n);++i=t})),Va=Nr(function(){return arguments}())?Nr:function(e){return ts(e)&&Pe.call(e,"callee")&&!Ge.call(e,"callee")},Wa=n.isArray,Ya=St?$t(St):function(e){return ts(e)&&kr(e)==L};function Ka(e){return null!=e&&$a(e.length)&&!Qa(e)}function qa(e){return ts(e)&&Ka(e)}var Ga=gt||yc,Za=_t?$t(_t):function(e){return ts(e)&&kr(e)==S};function Xa(e){if(!ts(e))return!1;var t=kr(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Qa(e){if(!es(e))return!1;var t=kr(e);return t==x||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ja(e){return"number"==typeof e&&e==ps(e)}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function es(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ts(e){return null!=e&&"object"==typeof e}var ns=xt?$t(xt):function(e){return ts(e)&&mo(e)==k};function rs(e){return"number"==typeof e||ts(e)&&kr(e)==C}function is(e){if(!ts(e)||kr(e)!=A)return!1;var t=Ke(e);if(null===t)return!0;var n=Pe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Le.call(n)==Ue}var os=Et?$t(Et):function(e){return ts(e)&&kr(e)==I};var as=kt?$t(kt):function(e){return ts(e)&&mo(e)==M};function ss(e){return"string"==typeof e||!Wa(e)&&ts(e)&&kr(e)==N}function cs(e){return"symbol"==typeof e||ts(e)&&kr(e)==O}var us=Ct?$t(Ct):function(e){return ts(e)&&$a(e.length)&&!!ct[kr(e)]};var ls=Ki(Br),ds=Ki((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Ka(e))return ss(e)?mn(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=mo(e);return(t==k?un:t==M?fn:zs)(e)}function hs(e){return e?(e=ys(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ps(e){var t=hs(e),n=t%1;return t===t?n?t-n:t:0}function ms(e){return e?sr(ps(e),0,y):0}function ys(e){if("number"==typeof e)return e;if(cs(e))return m;if(es(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=es(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=ge.test(e);return n||we.test(e)?ft(e.slice(2),n?2:8):ye.test(e)?m:+e}function gs(e){return Mi(e,Os(e))}function vs(e){return null==e?"":ui(e)}var ws=Oi((function(e,t){if(Eo(t)||Ka(t))Mi(t,Ns(t),e);else for(var n in t)Pe.call(t,n)&&tr(e,n,t[n])})),bs=Oi((function(e,t){Mi(t,Os(t),e)})),Ss=Oi((function(e,t,n,r){Mi(t,Os(t),e,r)})),_s=Oi((function(e,t,n,r){Mi(t,Ns(t),e,r)})),xs=no(ar);var Es=Xr((function(e,t){e=Ce(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&bo(t[0],t[1],o)&&(r=1);++n1),t})),Mi(e,io(e),n),r&&(n=cr(n,7,eo));for(var i=t.length;i--;)di(n,t[i]);return n}));var Rs=no((function(e,t){return null==e?{}:function(e,t){return Yr(e,t,(function(t,n){return As(e,n)}))}(e,t)}));function Ds(e,t){if(null==e)return{};var n=Pt(io(e),(function(e){return[e]}));return t=co(t),Yr(e,n,(function(e,n){return t(e,n[0])}))}var Bs=Xi(Ns),Us=Xi(Os);function zs(e){return null==e?[]:en(e,Ns(e))}var Hs=Ri((function(e,t,n){return t=t.toLowerCase(),e+(n?Fs(t):t)}));function Fs(e){return Xs(vs(e).toLowerCase())}function Vs(e){return(e=vs(e))&&e.replace(Se,on).replace(tt,"")}var Ws=Ri((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=Ri((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ks=Pi("toLowerCase");var qs=Ri((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Gs=Ri((function(e,t,n){return e+(n?" ":"")+Xs(t)}));var Zs=Ri((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Xs=Pi("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?i:t)===i?function(e){return ot.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var Js=Xr((function(e,t){try{return At(e,i,t)}catch(n){return Xa(n)?n:new se(n)}})),$s=no((function(e,t){return It(t,(function(t){t=Do(t),or(e,t,Ia(e[t],e))})),e}));function ec(e){return function(){return e}}var tc=Ui(),nc=Ui(!0);function rc(e){return e}function ic(e){return Pr("function"==typeof e?e:cr(e,1))}var oc=Xr((function(e,t){return function(n){return Mr(n,e,t)}})),ac=Xr((function(e,t){return function(n){return Mr(e,n,t)}}));function sc(e,t,n){var r=Ns(t),i=_r(t,r);null!=n||es(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=_r(t,Ns(t)));var o=!(es(n)&&"chain"in n)||!!n.chain,a=Qa(e);return It(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ii(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Rt([this.value()],arguments))})})),e}function cc(){}var uc=Vi(Pt),lc=Vi(Nt),dc=Vi(Ut);function fc(e){return So(e)?qt(Do(e)):function(e){return function(t){return xr(t,e)}}(e)}var hc=Yi(),pc=Yi(!0);function mc(){return[]}function yc(){return!1}var gc=Fi((function(e,t){return e+t}),0),vc=Gi("ceil"),wc=Fi((function(e,t){return e/t}),1),bc=Gi("floor");var Sc=Fi((function(e,t){return e*t}),1),_c=Gi("round"),xc=Fi((function(e,t){return e-t}),0);return zn.after=function(e,t){if("function"!=typeof t)throw new Ie(o);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},zn.ary=Aa,zn.assign=ws,zn.assignIn=bs,zn.assignInWith=Ss,zn.assignWith=_s,zn.at=xs,zn.before=Ta,zn.bind=Ia,zn.bindAll=$s,zn.bindKey=Ma,zn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Wa(e)?e:[e]},zn.chain=fa,zn.chunk=function(e,t,r){t=(r?bo(e,t,r):t===i)?1:Gt(ps(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,c=n(ht(o/t));ao?0:o+n),(r=r===i||r>o?o:ps(r))<0&&(r+=o),r=n>r?0:ms(r);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=ui(t))&&cn(e)?Si(mn(e),0,n):e.split(t,n):[]},zn.spread=function(e,t){if("function"!=typeof e)throw new Ie(o);return t=null==t?0:Gt(ps(t),0),Xr((function(n){var r=n[t],i=Si(n,0,t);return r&&Rt(i,r),At(e,this,i)}))},zn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},zn.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===i?1:ps(t))<0?0:t):[]},zn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ri(e,(t=r-(t=n||t===i?1:ps(t)))<0?0:t,r):[]},zn.takeRightWhile=function(e,t){return e&&e.length?hi(e,co(t,3),!1,!0):[]},zn.takeWhile=function(e,t){return e&&e.length?hi(e,co(t,3)):[]},zn.tap=function(e,t){return t(e),e},zn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ie(o);return es(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Na(e,t,{leading:r,maxWait:t,trailing:i})},zn.thru=ha,zn.toArray=fs,zn.toPairs=Bs,zn.toPairsIn=Us,zn.toPath=function(e){return Wa(e)?Pt(e,Do):cs(e)?[e]:Ii(Ro(vs(e)))},zn.toPlainObject=gs,zn.transform=function(e,t,n){var r=Wa(e),i=r||Ga(e)||us(e);if(t=co(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:es(e)&&Qa(o)?Hn(Ke(e)):{}}return(i?It:br)(e,(function(e,r,i){return t(n,e,r,i)})),n},zn.unary=function(e){return Aa(e,1)},zn.union=ta,zn.unionBy=na,zn.unionWith=ra,zn.uniq=function(e){return e&&e.length?li(e):[]},zn.uniqBy=function(e,t){return e&&e.length?li(e,co(t,2)):[]},zn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?li(e,i,t):[]},zn.unset=function(e,t){return null==e||di(e,t)},zn.unzip=ia,zn.unzipWith=oa,zn.update=function(e,t,n){return null==e?e:fi(e,t,vi(n))},zn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:fi(e,t,vi(n),r)},zn.values=zs,zn.valuesIn=function(e){return null==e?[]:en(e,Os(e))},zn.without=aa,zn.words=Qs,zn.wrap=function(e,t){return Da(vi(t),e)},zn.xor=sa,zn.xorBy=ca,zn.xorWith=ua,zn.zip=la,zn.zipObject=function(e,t){return yi(e||[],t||[],tr)},zn.zipObjectDeep=function(e,t){return yi(e||[],t||[],$r)},zn.zipWith=da,zn.entries=Bs,zn.entriesIn=Us,zn.extend=bs,zn.extendWith=Ss,sc(zn,zn),zn.add=gc,zn.attempt=Js,zn.camelCase=Hs,zn.capitalize=Fs,zn.ceil=vc,zn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ys(n))===n?n:0),t!==i&&(t=(t=ys(t))===t?t:0),sr(ys(e),t,n)},zn.clone=function(e){return cr(e,4)},zn.cloneDeep=function(e){return cr(e,5)},zn.cloneDeepWith=function(e,t){return cr(e,5,t="function"==typeof t?t:i)},zn.cloneWith=function(e,t){return cr(e,4,t="function"==typeof t?t:i)},zn.conformsTo=function(e,t){return null==t||ur(e,t,Ns(t))},zn.deburr=Vs,zn.defaultTo=function(e,t){return null==e||e!==e?t:e},zn.divide=wc,zn.endsWith=function(e,t,n){e=vs(e),t=ui(t);var r=e.length,o=n=n===i?r:sr(ps(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},zn.eq=za,zn.escape=function(e){return(e=vs(e))&&Q.test(e)?e.replace(Z,an):e},zn.escapeRegExp=function(e){return(e=vs(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},zn.every=function(e,t,n){var r=Wa(e)?Nt:pr;return n&&bo(e,t,n)&&(t=i),r(e,co(t,3))},zn.find=ya,zn.findIndex=Vo,zn.findKey=function(e,t){return Ht(e,co(t,3),br)},zn.findLast=ga,zn.findLastIndex=Wo,zn.findLastKey=function(e,t){return Ht(e,co(t,3),Sr)},zn.floor=bc,zn.forEach=va,zn.forEachRight=wa,zn.forIn=function(e,t){return null==e?e:vr(e,co(t,3),Os)},zn.forInRight=function(e,t){return null==e?e:wr(e,co(t,3),Os)},zn.forOwn=function(e,t){return e&&br(e,co(t,3))},zn.forOwnRight=function(e,t){return e&&Sr(e,co(t,3))},zn.get=Cs,zn.gt=Ha,zn.gte=Fa,zn.has=function(e,t){return null!=e&&yo(e,t,Ar)},zn.hasIn=As,zn.head=Ko,zn.identity=rc,zn.includes=function(e,t,n,r){e=Ka(e)?e:zs(e),n=n&&!r?ps(n):0;var i=e.length;return n<0&&(n=Gt(i+n,0)),ss(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Vt(e,t,n)>-1},zn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ps(n);return i<0&&(i=Gt(r+i,0)),Vt(e,t,i)},zn.inRange=function(e,t,n){return t=hs(t),n===i?(n=t,t=0):n=hs(n),function(e,t,n){return e>=wn(t,n)&&e=-9007199254740991&&e<=p},zn.isSet=as,zn.isString=ss,zn.isSymbol=cs,zn.isTypedArray=us,zn.isUndefined=function(e){return e===i},zn.isWeakMap=function(e){return ts(e)&&mo(e)==j},zn.isWeakSet=function(e){return ts(e)&&"[object WeakSet]"==kr(e)},zn.join=function(e,t){return null==e?"":bt.call(e,t)},zn.kebabCase=Ws,zn.last=Xo,zn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ps(n))<0?Gt(r+o,0):wn(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ft(e,Yt,o,!0)},zn.lowerCase=Ys,zn.lowerFirst=Ks,zn.lt=ls,zn.lte=ds,zn.max=function(e){return e&&e.length?mr(e,rc,Cr):i},zn.maxBy=function(e,t){return e&&e.length?mr(e,co(t,2),Cr):i},zn.mean=function(e){return Kt(e,rc)},zn.meanBy=function(e,t){return Kt(e,co(t,2))},zn.min=function(e){return e&&e.length?mr(e,rc,Br):i},zn.minBy=function(e,t){return e&&e.length?mr(e,co(t,2),Br):i},zn.stubArray=mc,zn.stubFalse=yc,zn.stubObject=function(){return{}},zn.stubString=function(){return""},zn.stubTrue=function(){return!0},zn.multiply=Sc,zn.nth=function(e,t){return e&&e.length?Vr(e,ps(t)):i},zn.noConflict=function(){return mt._===this&&(mt._=ze),this},zn.noop=cc,zn.now=Ca,zn.pad=function(e,t,n){e=vs(e);var r=(t=ps(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Wi(pt(i),n)+e+Wi(ht(i),n)},zn.padEnd=function(e,t,n){e=vs(e);var r=(t=ps(t))?pn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=_n();return wn(e+o*(t-e+dt("1e-"+((o+"").length-1))),t)}return Gr(e,t)},zn.reduce=function(e,t,n){var r=Wa(e)?Dt:Zt,i=arguments.length<3;return r(e,co(t,4),n,i,fr)},zn.reduceRight=function(e,t,n){var r=Wa(e)?Bt:Zt,i=arguments.length<3;return r(e,co(t,4),n,i,hr)},zn.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===i)?1:ps(t),Zr(vs(e),t)},zn.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zn.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++rp)return[];var n=y,r=wn(e,y);t=co(t),e-=y;for(var i=Qt(r,t);++n=a)return e;var c=n-pn(r);if(c<1)return r;var u=s?Si(s,0,c).join(""):e.slice(0,c);if(o===i)return u+r;if(s&&(c+=u.length-c),os(o)){if(e.slice(c).search(o)){var l,d=u;for(o.global||(o=Ae(o.source,vs(me.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var f=l.index;u=u.slice(0,f===i?c:f)}}else if(e.indexOf(ui(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+r},zn.unescape=function(e){return(e=vs(e))&&X.test(e)?e.replace(G,gn):e},zn.uniqueId=function(e){var t=++Re;return vs(e)+t},zn.upperCase=Zs,zn.upperFirst=Xs,zn.each=va,zn.eachRight=wa,zn.first=Ko,sc(zn,function(){var e={};return br(zn,(function(t,n){Pe.call(zn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),zn.VERSION="4.17.21",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zn[e].placeholder=zn})),It(["drop","take"],(function(e,t){Wn.prototype[e]=function(n){n=n===i?1:Gt(ps(n),0);var r=this.__filtered__&&!t?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,y),type:e+(r.__dir__<0?"Right":"")}),r},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),It(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Wn.prototype[e]=function(){return this[n](1).value()[0]}})),It(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(rc)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Xr((function(e,t){return"function"==typeof e?new Wn(this):this.map((function(n){return Mr(n,e,t)}))})),Wn.prototype.reject=function(e){return this.filter(Pa(co(e)))},Wn.prototype.slice=function(e,t){e=ps(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=ps(t))<0?n.dropRight(-t):n.take(t-e)),n)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(y)},br(Wn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=zn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(zn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof Wn,u=s[0],l=c||Wa(t),d=function(e){var t=o.apply(zn,Rt([e],s));return r&&f?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,m=c&&!h;if(!a&&l){t=m?t:new Wn(this);var y=e.apply(t,s);return y.__actions__.push({func:ha,args:[d],thisArg:i}),new Vn(y,f)}return p&&m?e.apply(this,s):(y=this.thru(d),p?r?y.value()[0]:y.value():y)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);zn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Wa(i)?i:[],e)}return this[n]((function(n){return t.apply(Wa(n)?n:[],e)}))}})),br(Wn.prototype,(function(e,t){var n=zn[t];if(n){var r=n.name+"";Pe.call(Nn,r)||(Nn[r]=[]),Nn[r].push({name:t,func:n})}})),Nn[zi(i,2).name]=[{name:"wrapper",func:i}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Wa(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},zn.prototype.plant=function(e){for(var t,n=this;n instanceof Fn;){var r=Uo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var t=e;return this.__actions__.length&&(t=new Wn(this)),(t=t.reverse()).__actions__.push({func:ha,args:[ea],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ea)},zn.prototype.toJSON=zn.prototype.valueOf=zn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},zn.prototype.first=zn.prototype.head,Qe&&(zn.prototype[Qe]=function(){return this}),zn}();mt._=vn,(r=function(){return vn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},816:function(e,t,n){(e=n.nmd(e)).exports=function(){"use strict";var t,n;function r(){return t.apply(null,arguments)}function i(e){t=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function u(e){return void 0===e}function l(e){return"number"===typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[],i=e.length;for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,D=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,B={},U={};function z(e,t,n,r){var i=r;"string"===typeof r&&(i=function(){return this[r]()}),e&&(U[e]=i),t&&(U[t[0]]=function(){return P(i.apply(this,arguments),t[1],t[2])}),n&&(U[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function H(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function F(e){var t,n,r=e.match(R);for(t=0,n=r.length;t=0&&D.test(e);)e=e.replace(D,r),D.lastIndex=0,n-=1;return e}var Y={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function K(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var q="Invalid date";function G(){return this._invalidDate}var Z="%d",X=/\d{1,2}/;function Q(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function $(e,t,n,r){var i=this._relativeTime[n];return I(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return I(n)?n(t):n.replace(/%s/i,t)}var te={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"===typeof e?te[e]||te[e.toLowerCase()]:void 0}function re(e){var t,n,r={};for(n in e)s(e,n)&&(t=ne(n))&&(r[t]=e[n]);return r}var ie={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function oe(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:ie[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}var ae,se=/\d/,ce=/\d\d/,ue=/\d{3}/,le=/\d{4}/,de=/[+-]?\d{6}/,fe=/\d\d?/,he=/\d\d\d\d?/,pe=/\d\d\d\d\d\d?/,me=/\d{1,3}/,ye=/\d{1,4}/,ge=/[+-]?\d{1,6}/,ve=/\d+/,we=/[+-]?\d+/,be=/Z|[+-]\d\d:?\d\d/gi,Se=/Z|[+-]\d\d(?::?\d\d)?/gi,_e=/[+-]?\d+(\.\d{1,3})?/,xe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ee=/^[1-9]\d?/,ke=/^([1-9]\d|\d)/;function Ce(e,t,n){ae[e]=I(t)?t:function(e,r){return e&&n?n:t}}function Ae(e,t){return s(ae,e)?ae[e](t._strict,t._locale):new RegExp(Te(e))}function Te(e){return Ie(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,i){return t||n||r||i})))}function Ie(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Me(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ne(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Me(t)),n}ae={};var Oe={};function je(e,t){var n,r,i=t;for("string"===typeof e&&(e=[e]),l(t)&&(i=function(e,n){n[t]=Ne(e)}),r=e.length,n=0;n68?1900:2e3)};var qe,Ge=Xe("FullYear",!0);function Ze(){return Re(this.year())}function Xe(e,t){return function(n){return null!=n?(Je(this,e,n),r.updateOffset(this,t),this):Qe(this,e)}}function Qe(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Je(e,t,n){var r,i,o,a,s;if(e.isValid()&&!isNaN(n)){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,a=e.month(),s=29!==(s=e.date())||1!==a||Re(o)?s:28,i?r.setUTCFullYear(o,a,s):r.setFullYear(o,a,s)}}function $e(e){return I(this[e=ne(e)])?this[e]():this}function et(e,t){if("object"===typeof e){var n,r=oe(e=re(e)),i=r.length;for(n=0;n=0?(s=new Date(e+400,t,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,o,a),s}function wt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function bt(e,t,n){var r=7+t-n;return-(7+wt(e,0,r).getUTCDay()-t)%7+r-1}function St(e,t,n,r,i){var o,a,s=1+7*(t-1)+(7+n-r)%7+bt(e,r,i);return s<=0?a=Ke(o=e-1)+s:s>Ke(e)?(o=e+1,a=s-Ke(e)):(o=e,a=s),{year:o,dayOfYear:a}}function _t(e,t,n){var r,i,o=bt(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?r=a+xt(i=e.year()-1,t,n):a>xt(e.year(),t,n)?(r=a-xt(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function xt(e,t,n){var r=bt(e,t,n),i=bt(e+1,t,n);return(Ke(e)-r+i)/7}function Et(e){return _t(e,this._week.dow,this._week.doy).week}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),Ce("w",fe,Ee),Ce("ww",fe,ce),Ce("W",fe,Ee),Ce("WW",fe,ce),Le(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=Ne(e)}));var kt={dow:0,doy:6};function Ct(){return this._week.dow}function At(){return this._week.doy}function Tt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function It(e){var t=_t(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Mt(e,t){return"string"!==typeof e?e:isNaN(e)?"number"===typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Nt(e,t){return"string"===typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ot(e,t){return e.slice(t,7).concat(e.slice(0,t))}z("d",0,"do","day"),z("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),z("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),z("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),Ce("d",fe),Ce("e",fe),Ce("E",fe),Ce("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Ce("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Ce("dddd",(function(e,t){return t.weekdaysRegex(e)})),Le(["dd","ddd","dddd"],(function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e})),Le(["d","e","E"],(function(e,t,n,r){t[r]=Ne(e)}));var jt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Lt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Pt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Rt=xe,Dt=xe,Bt=xe;function Ut(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ot(n,this._week.dow):e?n[e.day()]:n}function zt(e){return!0===e?Ot(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Ht(e){return!0===e?Ot(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ft(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,a))||-1!==(i=qe.call(this._shortWeekdaysParse,a))||-1!==(i=qe.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,a))||-1!==(i=qe.call(this._weekdaysParse,a))||-1!==(i=qe.call(this._minWeekdaysParse,a))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,a))||-1!==(i=qe.call(this._weekdaysParse,a))||-1!==(i=qe.call(this._shortWeekdaysParse,a))?i:null}function Vt(e,t,n){var r,i,o;if(this._weekdaysParseExact)return Ft.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Wt(e){if(!this.isValid())return null!=e?this:NaN;var t=Qe(this,"Day");return null!=e?(e=Mt(e,this.localeData()),this.add(e-t,"d")):t}function Yt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Kt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Nt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function qt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Rt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Gt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Dt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Zt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Bt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xt(){function e(e,t){return t.length-e.length}var t,n,r,i,o,a=[],s=[],c=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=Ie(this.weekdaysMin(n,"")),i=Ie(this.weekdaysShort(n,"")),o=Ie(this.weekdays(n,"")),a.push(r),s.push(i),c.push(o),u.push(r),u.push(i),u.push(o);a.sort(e),s.sort(e),c.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qt(){return this.hours()%12||12}function Jt(){return this.hours()||24}function $t(e,t){z(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function en(e,t){return t._meridiemParse}function tn(e){return"p"===(e+"").toLowerCase().charAt(0)}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,Qt),z("k",["kk",2],0,Jt),z("hmm",0,0,(function(){return""+Qt.apply(this)+P(this.minutes(),2)})),z("hmmss",0,0,(function(){return""+Qt.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)})),z("Hmm",0,0,(function(){return""+this.hours()+P(this.minutes(),2)})),z("Hmmss",0,0,(function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)})),$t("a",!0),$t("A",!1),Ce("a",en),Ce("A",en),Ce("H",fe,ke),Ce("h",fe,Ee),Ce("k",fe,Ee),Ce("HH",fe,ce),Ce("hh",fe,ce),Ce("kk",fe,ce),Ce("hmm",he),Ce("hmmss",pe),Ce("Hmm",he),Ce("Hmmss",pe),je(["H","HH"],ze),je(["k","kk"],(function(e,t,n){var r=Ne(e);t[ze]=24===r?0:r})),je(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),je(["h","hh"],(function(e,t,n){t[ze]=Ne(e),y(n).bigHour=!0})),je("hmm",(function(e,t,n){var r=e.length-2;t[ze]=Ne(e.substr(0,r)),t[He]=Ne(e.substr(r)),y(n).bigHour=!0})),je("hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[ze]=Ne(e.substr(0,r)),t[He]=Ne(e.substr(r,2)),t[Fe]=Ne(e.substr(i)),y(n).bigHour=!0})),je("Hmm",(function(e,t,n){var r=e.length-2;t[ze]=Ne(e.substr(0,r)),t[He]=Ne(e.substr(r))})),je("Hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[ze]=Ne(e.substr(0,r)),t[He]=Ne(e.substr(r,2)),t[Fe]=Ne(e.substr(i))}));var nn=/[ap]\.?m?\.?/i,rn=Xe("Hours",!0);function on(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var an,sn={calendar:j,longDateFormat:Y,invalidDate:q,ordinal:Z,dayOfMonthOrdinalParse:X,relativeTime:J,months:rt,monthsShort:it,week:kt,weekdays:jt,weekdaysMin:Pt,weekdaysShort:Lt,meridiemParse:nn},cn={},un={};function ln(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=pn(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&ln(i,n)>=t-1)break;t--}o++}return an}function hn(e){return!(!e||!e.match("^[^/\\\\]*$"))}function pn(t){var n=null;if(void 0===cn[t]&&e&&e.exports&&hn(t))try{n=an._abbr,Object(function(){var e=new Error("Cannot find module 'undefined'");throw e.code="MODULE_NOT_FOUND",e}()),mn(n)}catch(r){cn[t]=null}return cn[t]}function mn(e,t){var n;return e&&((n=u(t)?vn(e):yn(e,t))?an=n:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),an._abbr}function yn(e,t){if(null!==t){var n,r=sn;if(t.abbr=e,null!=cn[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])r=cn[t.parentLocale]._config;else{if(null==(n=pn(t.parentLocale)))return un[t.parentLocale]||(un[t.parentLocale]=[]),un[t.parentLocale].push({name:e,config:t}),null;r=n._config}return cn[e]=new O(N(r,t)),un[e]&&un[e].forEach((function(e){yn(e.name,e.config)})),mn(e),cn[e]}return delete cn[e],null}function gn(e,t){if(null!=t){var n,r,i=sn;null!=cn[e]&&null!=cn[e].parentLocale?cn[e].set(N(cn[e]._config,t)):(null!=(r=pn(e))&&(i=r._config),t=N(i,t),null==r&&(t.abbr=e),(n=new O(t)).parentLocale=cn[e],cn[e]=n),mn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?(cn[e]=cn[e].parentLocale,e===mn()&&mn(e)):null!=cn[e]&&delete cn[e]);return cn[e]}function vn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return an;if(!o(e)){if(t=pn(e))return t;e=[e]}return fn(e)}function wn(){return C(cn)}function bn(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[Be]<0||n[Be]>11?Be:n[Ue]<1||n[Ue]>nt(n[De],n[Be])?Ue:n[ze]<0||n[ze]>24||24===n[ze]&&(0!==n[He]||0!==n[Fe]||0!==n[Ve])?ze:n[He]<0||n[He]>59?He:n[Fe]<0||n[Fe]>59?Fe:n[Ve]<0||n[Ve]>999?Ve:-1,y(e)._overflowDayOfYear&&(tUe)&&(t=Ue),y(e)._overflowWeeks&&-1===t&&(t=We),y(e)._overflowWeekday&&-1===t&&(t=Ye),y(e).overflow=t),e}var Sn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xn=/Z|[+-]\d\d(?::?\d\d)?/,En=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,An=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Tn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function In(e){var t,n,r,i,o,a,s=e._i,c=Sn.exec(s)||_n.exec(s),u=En.length,l=kn.length;if(c){for(y(e).iso=!0,t=0,n=u;tKe(o)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=wt(o,0,e._dayOfYear),e._a[Be]=n.getUTCMonth(),e._a[Ue]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ze]&&0===e._a[He]&&0===e._a[Fe]&&0===e._a[Ve]&&(e._nextDay=!0,e._a[ze]=0),e._d=(e._useUTC?wt:vt).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ze]=24),e._w&&"undefined"!==typeof e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function zn(e){var t,n,r,i,o,a,s,c,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(o=1,a=4,n=Dn(t.GG,e._a[De],_t(Zn(),1,4).year),r=Dn(t.W,1),((i=Dn(t.E,1))<1||i>7)&&(c=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,u=_t(Zn(),o,a),n=Dn(t.gg,e._a[De],u.year),r=Dn(t.w,u.week),null!=t.d?((i=t.d)<0||i>6)&&(c=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(c=!0)):i=o),r<1||r>xt(n,o,a)?y(e)._overflowWeeks=!0:null!=c?y(e)._overflowWeekday=!0:(s=St(n,r,i,o,a),e._a[De]=s.year,e._dayOfYear=s.dayOfYear)}function Hn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],y(e).empty=!0;var t,n,i,o,a,s,c,u=""+e._i,l=u.length,d=0;for(c=(i=W(e._f,e._locale).match(R)||[]).length,t=0;t0&&y(e).unusedInput.push(a),u=u.slice(u.indexOf(n)+n.length),d+=n.length),U[o]?(n?y(e).empty=!1:y(e).unusedTokens.push(o),Pe(o,n,e)):e._strict&&!n&&y(e).unusedTokens.push(o);y(e).charsLeftOver=l-d,u.length>0&&y(e).unusedInput.push(u),e._a[ze]<=12&&!0===y(e).bigHour&&e._a[ze]>0&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[ze]=Fn(e._locale,e._a[ze],e._meridiem),null!==(s=y(e).era)&&(e._a[De]=e._locale.erasConvertYear(s,e._a[De])),Un(e),bn(e)}else Pn(e);else In(e)}function Fn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Vn(e){var t,n,r,i,o,a,s=!1,c=e._f.length;if(0===c)return y(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:v()}));function Jn(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Zn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return S(t,this),(t=Kn(t))._a?(e=t._isUTC?p(t._a):Zn(t._a),this._isDSTShifted=this.isValid()&&ur(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function xr(){return!!this.isValid()&&!this._isUTC}function Er(){return!!this.isValid()&&this._isUTC}function kr(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Cr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ar=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Tr(e,t){var n,r,i,o=e,a=null;return sr(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(o={},t?o[t]=+e:o.milliseconds=+e):(a=Cr.exec(e))?(n="-"===a[1]?-1:1,o={y:0,d:Ne(a[Ue])*n,h:Ne(a[ze])*n,m:Ne(a[He])*n,s:Ne(a[Fe])*n,ms:Ne(cr(1e3*a[Ve]))*n}):(a=Ar.exec(e))?(n="-"===a[1]?-1:1,o={y:Ir(a[2],n),M:Ir(a[3],n),w:Ir(a[4],n),d:Ir(a[5],n),h:Ir(a[6],n),m:Ir(a[7],n),s:Ir(a[8],n)}):null==o?o={}:"object"===typeof o&&("from"in o||"to"in o)&&(i=Nr(Zn(o.from),Zn(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new ar(o),sr(e)&&s(e,"_locale")&&(r._locale=e._locale),sr(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Ir(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Mr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Nr(e,t){var n;return e.isValid()&&t.isValid()?(t=hr(t,e),e.isBefore(t)?n=Mr(e,t):((n=Mr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Or(e,t){return function(n,r){var i;return null===r||isNaN(+r)||(T(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),jr(this,Tr(n,r),e),this}}function jr(e,t,n,i){var o=t._milliseconds,a=cr(t._days),s=cr(t._months);e.isValid()&&(i=null==i||i,s&&ft(e,Qe(e,"Month")+s*n),a&&Je(e,"Date",Qe(e,"Date")+a*n),o&&e._d.setTime(e._d.valueOf()+o*n),i&&r.updateOffset(e,a||s))}Tr.fn=ar.prototype,Tr.invalid=or;var Lr=Or(1,"add"),Pr=Or(-1,"subtract");function Rr(e){return"string"===typeof e||e instanceof String}function Dr(e){return x(e)||d(e)||Rr(e)||l(e)||Ur(e)||Br(e)||null===e||void 0===e}function Br(e){var t,n,r=a(e)&&!c(e),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=o.length;for(t=0;tn.valueOf():n.valueOf()9999?V(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):I(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ei(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=o+'[")]',this.format(e+t+n+r)}function ti(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=V(this,e);return this.localeData().postformat(t)}function ni(e,t){return this.isValid()&&(x(e)&&e.isValid()||Zn(e).isValid())?Tr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ri(e){return this.from(Zn(),e)}function ii(e,t){return this.isValid()&&(x(e)&&e.isValid()||Zn(e).isValid())?Tr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.to(Zn(),e)}function ai(e){var t;return void 0===e?this._locale._abbr:(null!=(t=vn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var si=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function ci(){return this._locale}var ui=1e3,li=60*ui,di=60*li,fi=3506328*di;function hi(e,t){return(e%t+t)%t}function pi(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-fi:new Date(e,t,n).valueOf()}function mi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-fi:Date.UTC(e,t,n)}function yi(e){var t,n;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?mi:pi,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=hi(t+(this._isUTC?0:this.utcOffset()*li),di);break;case"minute":t=this._d.valueOf(),t-=hi(t,li);break;case"second":t=this._d.valueOf(),t-=hi(t,ui)}return this._d.setTime(t),r.updateOffset(this,!0),this}function gi(e){var t,n;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?mi:pi,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=di-hi(t+(this._isUTC?0:this.utcOffset()*li),di)-1;break;case"minute":t=this._d.valueOf(),t+=li-hi(t,li)-1;break;case"second":t=this._d.valueOf(),t+=ui-hi(t,ui)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function vi(){return this._d.valueOf()-6e4*(this._offset||0)}function wi(){return Math.floor(this.valueOf()/1e3)}function bi(){return new Date(this.valueOf())}function Si(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function _i(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function xi(){return this.isValid()?this.toISOString():null}function Ei(){return g(this)}function ki(){return h({},y(this))}function Ci(){return y(this).overflow}function Ai(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ti(e,t){var n,i,o,a=this._eras||vn("en")._eras;for(n=0,i=a.length;n=0)return c[r]}function Mi(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Ni(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e(o=xt(e,r,i))&&(t=o),Qi.call(this,e,t,n,r,i))}function Qi(e,t,n,r,i){var o=St(e,t,n,r,i),a=wt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}z("N",0,0,"eraAbbr"),z("NN",0,0,"eraAbbr"),z("NNN",0,0,"eraAbbr"),z("NNNN",0,0,"eraName"),z("NNNNN",0,0,"eraNarrow"),z("y",["y",1],"yo","eraYear"),z("y",["yy",2],0,"eraYear"),z("y",["yyy",3],0,"eraYear"),z("y",["yyyy",4],0,"eraYear"),Ce("N",Bi),Ce("NN",Bi),Ce("NNN",Bi),Ce("NNNN",Ui),Ce("NNNNN",zi),je(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?y(n).era=i:y(n).invalidEra=e})),Ce("y",ve),Ce("yy",ve),Ce("yyy",ve),Ce("yyyy",ve),Ce("yo",Hi),je(["y","yy","yyy","yyyy"],De),je(["yo"],(function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[De]=n._locale.eraYearOrdinalParse(e,i):t[De]=parseInt(e,10)})),z(0,["gg",2],0,(function(){return this.weekYear()%100})),z(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Vi("gggg","weekYear"),Vi("ggggg","weekYear"),Vi("GGGG","isoWeekYear"),Vi("GGGGG","isoWeekYear"),Ce("G",we),Ce("g",we),Ce("GG",fe,ce),Ce("gg",fe,ce),Ce("GGGG",ye,le),Ce("gggg",ye,le),Ce("GGGGG",ge,de),Ce("ggggg",ge,de),Le(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=Ne(e)})),Le(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),z("Q",0,"Qo","quarter"),Ce("Q",se),je("Q",(function(e,t){t[Be]=3*(Ne(e)-1)})),z("D",["DD",2],"Do","date"),Ce("D",fe,Ee),Ce("DD",fe,ce),Ce("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),je(["D","DD"],Ue),je("Do",(function(e,t){t[Ue]=Ne(e.match(fe)[0])}));var $i=Xe("Date",!0);function eo(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}z("DDD",["DDDD",3],"DDDo","dayOfYear"),Ce("DDD",me),Ce("DDDD",ue),je(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=Ne(e)})),z("m",["mm",2],0,"minute"),Ce("m",fe,ke),Ce("mm",fe,ce),je(["m","mm"],He);var to=Xe("Minutes",!1);z("s",["ss",2],0,"second"),Ce("s",fe,ke),Ce("ss",fe,ce),je(["s","ss"],Fe);var no,ro,io=Xe("Seconds",!1);for(z("S",0,0,(function(){return~~(this.millisecond()/100)})),z(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),z(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),z(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),z(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),z(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),z(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Ce("S",me,se),Ce("SS",me,ce),Ce("SSS",me,ue),no="SSSS";no.length<=9;no+="S")Ce(no,ve);function oo(e,t){t[Ve]=Ne(1e3*("0."+e))}for(no="S";no.length<=9;no+="S")je(no,oo);function ao(){return this._isUTC?"UTC":""}function so(){return this._isUTC?"Coordinated Universal Time":""}ro=Xe("Milliseconds",!1),z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var co=_.prototype;function uo(e){return Zn(1e3*e)}function lo(){return Zn.apply(null,arguments).parseZone()}function fo(e){return e}co.add=Lr,co.calendar=Fr,co.clone=Vr,co.diff=Xr,co.endOf=gi,co.format=ti,co.from=ni,co.fromNow=ri,co.to=ii,co.toNow=oi,co.get=$e,co.invalidAt=Ci,co.isAfter=Wr,co.isBefore=Yr,co.isBetween=Kr,co.isSame=qr,co.isSameOrAfter=Gr,co.isSameOrBefore=Zr,co.isValid=Ei,co.lang=si,co.locale=ai,co.localeData=ci,co.max=Qn,co.min=Xn,co.parsingFlags=ki,co.set=et,co.startOf=yi,co.subtract=Pr,co.toArray=Si,co.toObject=_i,co.toDate=bi,co.toISOString=$r,co.inspect=ei,"undefined"!==typeof Symbol&&null!=Symbol.for&&(co[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),co.toJSON=xi,co.toString=Jr,co.unix=wi,co.valueOf=vi,co.creationData=Ai,co.eraName=Ni,co.eraNarrow=Oi,co.eraAbbr=ji,co.eraYear=Li,co.year=Ge,co.isLeapYear=Ze,co.weekYear=Wi,co.isoWeekYear=Yi,co.quarter=co.quarters=Ji,co.month=ht,co.daysInMonth=pt,co.week=co.weeks=Tt,co.isoWeek=co.isoWeeks=It,co.weeksInYear=Gi,co.weeksInWeekYear=Zi,co.isoWeeksInYear=Ki,co.isoWeeksInISOWeekYear=qi,co.date=$i,co.day=co.days=Wt,co.weekday=Yt,co.isoWeekday=Kt,co.dayOfYear=eo,co.hour=co.hours=rn,co.minute=co.minutes=to,co.second=co.seconds=io,co.millisecond=co.milliseconds=ro,co.utcOffset=mr,co.utc=gr,co.local=vr,co.parseZone=wr,co.hasAlignedHourOffset=br,co.isDST=Sr,co.isLocal=xr,co.isUtcOffset=Er,co.isUtc=kr,co.isUTC=kr,co.zoneAbbr=ao,co.zoneName=so,co.dates=k("dates accessor is deprecated. Use date instead.",$i),co.months=k("months accessor is deprecated. Use month instead",ht),co.years=k("years accessor is deprecated. Use year instead",Ge),co.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yr),co.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var ho=O.prototype;function po(e,t,n,r){var i=vn(),o=p().set(r,t);return i[n](o,e)}function mo(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return po(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=po(e,r,n,"month");return i}function yo(e,t,n,r){"boolean"===typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var i,o=vn(),a=e?o._week.dow:0,s=[];if(null!=n)return po(t,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=po(t,(i+a)%7,r,"day");return s}function go(e,t){return mo(e,t,"months")}function vo(e,t){return mo(e,t,"monthsShort")}function wo(e,t,n){return yo(e,t,n,"weekdays")}function bo(e,t,n){return yo(e,t,n,"weekdaysShort")}function So(e,t,n){return yo(e,t,n,"weekdaysMin")}ho.calendar=L,ho.longDateFormat=K,ho.invalidDate=G,ho.ordinal=Q,ho.preparse=fo,ho.postformat=fo,ho.relativeTime=$,ho.pastFuture=ee,ho.set=M,ho.eras=Ti,ho.erasParse=Ii,ho.erasConvertYear=Mi,ho.erasAbbrRegex=Ri,ho.erasNameRegex=Pi,ho.erasNarrowRegex=Di,ho.months=ct,ho.monthsShort=ut,ho.monthsParse=dt,ho.monthsRegex=yt,ho.monthsShortRegex=mt,ho.week=Et,ho.firstDayOfYear=At,ho.firstDayOfWeek=Ct,ho.weekdays=Ut,ho.weekdaysMin=Ht,ho.weekdaysShort=zt,ho.weekdaysParse=Vt,ho.weekdaysRegex=qt,ho.weekdaysShortRegex=Gt,ho.weekdaysMinRegex=Zt,ho.isPM=tn,ho.meridiem=on,mn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Ne(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",mn),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",vn);var _o=Math.abs;function xo(){var e=this._data;return this._milliseconds=_o(this._milliseconds),this._days=_o(this._days),this._months=_o(this._months),e.milliseconds=_o(e.milliseconds),e.seconds=_o(e.seconds),e.minutes=_o(e.minutes),e.hours=_o(e.hours),e.months=_o(e.months),e.years=_o(e.years),this}function Eo(e,t,n,r){var i=Tr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function ko(e,t){return Eo(this,e,t,1)}function Co(e,t){return Eo(this,e,t,-1)}function Ao(e){return e<0?Math.floor(e):Math.ceil(e)}function To(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,c=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*Ao(Mo(s)+a),a=0,s=0),c.milliseconds=o%1e3,e=Me(o/1e3),c.seconds=e%60,t=Me(e/60),c.minutes=t%60,n=Me(t/60),c.hours=n%24,a+=Me(n/24),s+=i=Me(Io(a)),a-=Ao(Mo(i)),r=Me(s/12),s%=12,c.days=a,c.months=s,c.years=r,this}function Io(e){return 4800*e/146097}function Mo(e){return 146097*e/4800}function No(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Io(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Mo(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Oo(e){return function(){return this.as(e)}}var jo=Oo("ms"),Lo=Oo("s"),Po=Oo("m"),Ro=Oo("h"),Do=Oo("d"),Bo=Oo("w"),Uo=Oo("M"),zo=Oo("Q"),Ho=Oo("y"),Fo=jo;function Vo(){return Tr(this)}function Wo(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function Yo(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ko=Yo("milliseconds"),qo=Yo("seconds"),Go=Yo("minutes"),Zo=Yo("hours"),Xo=Yo("days"),Qo=Yo("months"),Jo=Yo("years");function $o(){return Me(this.days()/7)}var ea=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ra(e,t,n,r){var i=Tr(e).abs(),o=ea(i.as("s")),a=ea(i.as("m")),s=ea(i.as("h")),c=ea(i.as("d")),u=ea(i.as("M")),l=ea(i.as("w")),d=ea(i.as("y")),f=o<=n.ss&&["s",o]||o0,f[4]=r,na.apply(null,f)}function ia(e){return void 0===e?ea:"function"===typeof e&&(ea=e,!0)}function oa(e,t){return void 0!==ta[e]&&(void 0===t?ta[e]:(ta[e]=t,"s"===e&&(ta.ss=t-1),!0))}function aa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=ta;return"object"===typeof e&&(t=e,e=!1),"boolean"===typeof e&&(i=e),"object"===typeof t&&(o=Object.assign({},ta,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),r=ra(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var sa=Math.abs;function ca(e){return(e>0)-(e<0)||+e}function ua(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,o,a,s,c=sa(this._milliseconds)/1e3,u=sa(this._days),l=sa(this._months),d=this.asSeconds();return d?(e=Me(c/60),t=Me(e/60),c%=60,e%=60,n=Me(l/12),l%=12,r=c?c.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=ca(this._months)!==ca(d)?"-":"",a=ca(this._days)!==ca(d)?"-":"",s=ca(this._milliseconds)!==ca(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(l?o+l+"M":"")+(u?a+u+"D":"")+(t||e||c?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(c?s+r+"S":"")):"P0D"}var la=ar.prototype;return la.isValid=ir,la.abs=xo,la.add=ko,la.subtract=Co,la.as=No,la.asMilliseconds=jo,la.asSeconds=Lo,la.asMinutes=Po,la.asHours=Ro,la.asDays=Do,la.asWeeks=Bo,la.asMonths=Uo,la.asQuarters=zo,la.asYears=Ho,la.valueOf=Fo,la._bubble=To,la.clone=Vo,la.get=Wo,la.milliseconds=Ko,la.seconds=qo,la.minutes=Go,la.hours=Zo,la.days=Xo,la.weeks=$o,la.months=Qo,la.years=Jo,la.humanize=aa,la.toISOString=ua,la.toString=ua,la.toJSON=ua,la.locale=ai,la.localeData=ci,la.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ua),la.lang=si,z("X",0,0,"unix"),z("x",0,0,"valueOf"),Ce("x",we),Ce("X",_e),je("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),je("x",(function(e,t,n){n._d=new Date(Ne(e))})),r.version="2.30.1",i(Zn),r.fn=co,r.min=$n,r.max=er,r.now=tr,r.utc=p,r.unix=uo,r.months=go,r.isDate=d,r.locale=mn,r.invalid=v,r.duration=Tr,r.isMoment=x,r.weekdays=wo,r.parseZone=lo,r.localeData=vn,r.isDuration=sr,r.monthsShort=vo,r.weekdaysMin=So,r.defineLocale=yn,r.updateLocale=gn,r.locales=wn,r.weekdaysShort=bo,r.normalizeUnits=ne,r.relativeTimeRounding=ia,r.relativeTimeThreshold=oa,r.calendarFormat=Hr,r.prototype=co,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()},1843:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var o,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c{"use strict";var t=function(e){return e!==e};e.exports=function(e,n){return 0===e&&0===n?1/e===1/n:e===n||!(!t(e)||!t(n))}},8199:(e,t,n)=>{"use strict";var r=n(9959),i=n(9962),o=n(4091),a=n(4584),s=n(8229),c=i(a(),Object);r(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},4584:(e,t,n)=>{"use strict";var r=n(4091);e.exports=function(){return"function"===typeof Object.is?Object.is:r}},8229:(e,t,n)=>{"use strict";var r=n(4584),i=n(9959);e.exports=function(){var e=r();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},2782:(e,t,n)=>{"use strict";var r;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=n(2950),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{d(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();r=function(e){var t=null!==e&&"object"===typeof e,n="[object Function]"===o.call(e),r=a(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var p=u&&n;if(s&&e.length>0&&!i.call(e,0))for(var m=0;m0)for(var y=0;y{"use strict";var r=Array.prototype.slice,i=n(2950),o=Object.keys,a=o?function(e){return o(e)}:n(2782),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(r.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},2950:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},8047:(e,t,n)=>{"use strict";var r=n(6328),i=n(541)(),o=n(4680),a=Object,s=o("Array.prototype.push"),c=o("Object.prototype.propertyIsEnumerable"),u=i?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var n=a(e);if(1===arguments.length)return n;for(var o=1;o{"use strict";var r=n(8047);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r{var r=n(5097);e.exports=h,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",l=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],f=n[1],h=n.index;if(s+=e.slice(a,h),a=h+d.length,f)s+=f[1];else{var p=e[a],m=n[2],y=n[3],g=n[4],v=n[5],w=n[6],b=n[7];s&&(r.push(s),s="");var S=null!=m&&null!=p&&p!==m,_="+"===w||"*"===w,x="?"===w||"*"===w,E=n[2]||l,k=g||v;r.push({name:y||o++,prefix:m||"",delimiter:E,optional:x,repeat:_,partial:S,asterisk:!!b,pattern:k?u(k):b?".*":"[^"+c(E)+"]+?"})}}return a{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},7490:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"===typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var s,c=[],u=!1,l=-1;function d(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&f())}function f(){if(!u){var e=a(d);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l1)for(var n=1;n{"use strict";var r=n(9165);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5192:(e,t,n)=>{e.exports=n(1729)()},9165:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},534:(e,t,n)=>{"use strict";var r=n(7313),i=n(1843),o=n(2224);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n