Files
noah-6a426fea762485cd9a634857/backend/public/assets/index-DLlBFUEW.js

493 lines
671 KiB
JavaScript

var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),p=s((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),m=s((e=>{var t=f(),n=p(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(Te(e,ArrayBuffer)||e&&Te(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Te(e,SharedArrayBuffer)||e&&Te(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:y(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(Te(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function v(e){if(s.isBuffer(e)){let t=y(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||Ee(e.length)?o(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(Te(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),Te(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(Te(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Te(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return be(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Ce(e).length;default:if(i)return r?-1:be(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return M(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return ie(this,t,n);case`latin1`:case`binary`:return j(this,t,n);case`base64`:return te(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ae(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?A(this,0,e):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(Te(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Ee(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)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(Ee(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return we(be(t,e.length-n),e,n,r)}function O(e,t,n,r){return we(xe(t),e,n,r)}function k(e,t,n,r){return we(Ce(t),e,n,r)}function ee(e,t,n,r){return we(Se(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ee(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function te(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return re(r)}var ne=4096;function re(e){let t=e.length;if(t<=ne)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ne));return n}function ie(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function j(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function M(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=De[e[r]];return i}function ae(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function N(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Oe(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Oe(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Oe(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=Oe(function(e){e>>>=0,ge(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&_e(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!1,52,8)};function oe(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;oe(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;oe(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function se(e,t,n,r,i){he(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function P(e,t,n,r,i){he(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=Oe(function(e,t=0){return se(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=Oe(function(e,t=0){return P(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);oe(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);oe(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||oe(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||oe(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]=e&255,t+4},s.prototype.writeBigInt64LE=Oe(function(e,t=0){return se(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=Oe(function(e,t=0){return P(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function ce(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function le(e,t,r,i,a){return t=+t,r>>>=0,a||ce(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return le(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return le(this,e,t,!1,n)};function ue(e,t,r,i,a){return t=+t,r>>>=0,a||ce(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return ue(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return ue(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var de={};function fe(e,t,n){de[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}fe(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),fe(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),fe(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=pe(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=pe(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function pe(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function me(e,t,n){ge(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&_e(t,e.length-(n+1))}function he(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new de.ERR_OUT_OF_RANGE(`value`,i,e)}me(r,i,a)}function ge(e,t){if(typeof e!=`number`)throw new de.ERR_INVALID_ARG_TYPE(t,`number`,e)}function _e(e,t,n){throw Math.floor(e)===e?t<0?new de.ERR_BUFFER_OUT_OF_BOUNDS:new de.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(ge(e,n),new de.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var ve=/[^+/0-9A-Za-z-_]/g;function ye(e){if(e=e.split(`=`)[0],e=e.trim().replace(ve,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function be(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function xe(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function Se(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Ce(e){return t.toByteArray(ye(e))}function we(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Te(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Ee(e){return e!==e}var De=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function Oe(e){return typeof BigInt>`u`?ke:e}function ke(){throw Error(`BigInt not supported`)}})),h=m();window.Buffer=h.Buffer;var g=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),_=s(((e,t)=>{t.exports=g()})),v=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S={H:null,A:null,T:null,S:null,V:null},C=Object.prototype.hasOwnProperty;function w(e,n,r,i,a,o){return r=o.ref,{$$typeof:t,type:e,key:n,ref:r===void 0?null:r,props:o}}function T(e,t){return w(e.type,t,void 0,void 0,void 0,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function D(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?D(``+e.key):t.toString(36)}function ee(){}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ee,ee):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,x(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=T(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(x(e))for(var u=0;u<e.length;u++)a=e[u],s=l+k(a,u),c+=A(a,r,i,s,o);else if(u=p(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+k(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ie=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function j(){}e.Children={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=h({},e.props),i=e.key,a=void 0;if(t!=null)for(o in t.ref!==void 0&&(a=void 0),t.key!==void 0&&(i=``+t.key),t)!C.call(t,o)||o===`key`||o===`__self`||o===`__source`||o===`ref`&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];r.children=s}return w(e.type,i,void 0,void 0,a,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)C.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return w(e,a,void 0,void 0,null,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=E,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=S.T,n={};S.T=n;try{var r=e(),i=S.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(j,ie)}catch(e){ie(e)}finally{S.T=t}},e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t,n){var r=S.H;if(typeof n==`function`)throw Error(`useEffect CRUD overload is not enabled in this build of React.`);return r.useEffect(e,t)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return S.H.useTransition()},e.version=`19.1.0`})),y=s(((e,t)=>{t.exports=v()})),b=s((e=>{var t=y();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.1.0`})),x=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=b()})),S=s((e=>{var t=_(),n=y(),r=x();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(o(e)!==e)throw Error(i(188))}function l(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return c(a),e;if(s===r)return c(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var l=!1,u=a.child;u;){if(u===n){l=!0,n=a,r=s;break}if(u===r){l=!0,r=a,n=s;break}u=u.sibling}if(!l){for(u=s.child;u;){if(u===n){l=!0,n=s,r=a;break}if(u===r){l=!0,r=s,n=a;break}u=u.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function u(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=u(e),t!==null)return t;e=e.sibling}return null}var d=Object.assign,f=Symbol.for(`react.element`),p=Symbol.for(`react.transitional.element`),m=Symbol.for(`react.portal`),h=Symbol.for(`react.fragment`),g=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),b=Symbol.for(`react.provider`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case h:return`Fragment`;case v:return`Profiler`;case g:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case m:return`Portal`;case C:return(e.displayName||`Context`)+`.Provider`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},N=[],oe=-1;function se(e){return{current:e}}function P(e){0>oe||(e.current=N[oe],N[oe]=null,oe--)}function ce(e,t){oe++,N[oe]=e.current,e.current=t}var le=se(null),ue=se(null),de=se(null),fe=se(null);function pe(e,t){switch(ce(de,t),ce(ue,e),ce(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Nd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Nd(t),e=Pd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}P(le),ce(le,e)}function me(){P(le),P(ue),P(de)}function he(e){e.memoizedState!==null&&ce(fe,e);var t=le.current,n=Pd(t,e.type);t!==n&&(ce(ue,e),ce(le,n))}function ge(e){ue.current===e&&(P(le),P(ue)),fe.current===e&&(P(fe),Rf._currentValue=ae)}var _e=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,Se=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=4194304;function Be(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ve(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var e=Re;return Re<<=1,!(Re&4194048)&&(Re=256),e}function Ge(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Pe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&4194090}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=M.p;return e===0?(e=window.event,e===void 0?32:Qf(e.type)):e}function et(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qd(e);e!==null;){if(n=e[nt])return n;e=Qd(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),xt={},St={};function Ct(e){return _e.call(St,e)?!0:_e.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function F(e,t,n){if(Ct(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}var Et,Dt;function Ot(e){if(Et===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Et=t&&t[1]||``,Dt=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+Et+e+Dt}var kt=!1;function At(e,t){if(!e||kt)return``;kt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{kt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ot(n):``}function jt(e){switch(e.tag){case 26:case 27:case 5:return Ot(e.type);case 16:return Ot(`Lazy`);case 13:return Ot(`Suspense`);case 19:return Ot(`SuspenseList`);case 0:case 15:return At(e.type,!1);case 11:return At(e.type.render,!1);case 1:return At(e.type,!0);case 31:return Ot(`Activity`);default:return``}}function Mt(e){try{var t=``;do t+=jt(e),e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e){var t=Pt(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){e._valueTracker||=Ft(e)}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null))return;n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),$t=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(du(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,`passive`,{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return d(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=d({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=d({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(d({},On,{dataTransfer:0})),jn=bn(d({},Cn,{relatedTarget:0})),Mn=bn(d({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(d({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(d({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(d({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(d({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(d({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(d({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(d({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Gn=bn(d({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=vd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){ud(e,0)}function ur(e){if(Lt(pt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!_e.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Rt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&wr(Nr,r)||(Nr=r,r=vd(Mr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};un&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),vt(t,[e])}var I=new WeakMap;function Zr(e,t){if(typeof e==`object`&&e){var n=I.get(e);return n===void 0?(t={value:e,source:t,stack:Mt(t)},I.set(e,t),t):n}return{value:e,source:t,stack:Mt(t)}}var Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<nu)throw nu=0,ru=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=kf(e,n,le.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=li(31,n,t,a),e.elementType=k,e.lanes=o,e;case h:return mi(n.children,a,o,t);case g:s=8,a|=24;break;case v:return e=li(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case T:return e=li(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=li(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=[],vi=0,yi=null,bi=0,xi=[],Si=0,Ci=null,wi=1,Ti=``;function Ei(e,t){_i[vi++]=bi,_i[vi++]=yi,yi=e,bi=t}function Di(e,t,n){xi[Si++]=wi,xi[Si++]=Ti,xi[Si++]=Ci,Ci=e;var r=wi;e=Ti;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wi=1<<32-Pe(t)+i|n<<i|r,Ti=a+e}else wi=1<<a|n<<i|r,Ti=e}function Oi(e){e.return!==null&&(Ei(e,1),Di(e,1,0))}function ki(e){for(;e===yi;)yi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null;for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,Ti=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null}var Ai=null,ji=null,L=!1,Mi=null,Ni=!1,Pi=Error(i(519));function Fi(e){throw Vi(Zr(Error(i(418,``)),e)),Pi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:dd(`cancel`,t),dd(`close`,t);break;case`iframe`:case`object`:case`embed`:dd(`load`,t);break;case`video`:case`audio`:for(n=0;n<cd.length;n++)dd(cd[n],t);break;case`source`:dd(`error`,t);break;case`img`:case`image`:case`link`:dd(`error`,t),dd(`load`,t);break;case`details`:dd(`toggle`,t);break;case`input`:dd(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),It(t);break;case`select`:dd(`invalid`,t);break;case`textarea`:dd(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children),It(t)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||wd(t.textContent,n)?(r.popover!=null&&(dd(`beforetoggle`,t),dd(`toggle`,t)),r.onScroll!=null&&dd(`scroll`,t),r.onScrollEnd!=null&&dd(`scrollend`,t),r.onClick!=null&&(t.onclick=Td),t=!0):t=!1,t||Fi(e)}function Li(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Ri(e){if(e!==Ai)return!1;if(!L)return Li(e),L=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Fd(e.type,e.memoizedProps)),n=!n),n&&ji&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n===`/$`){if(t===0){ji=Xd(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++;e=e.nextSibling}ji=null}}else t===27?(t=ji,Ud(e.type)?(e=Zd,Zd=null,ji=e):ji=t):ji=Ai?Xd(e.stateNode.nextSibling):null;return!0}function zi(){ji=Ai=null,L=!1}function Bi(){var e=Mi;return e!==null&&(Ul===null?Ul=e:Ul.push.apply(Ul,e),Mi=null),e}function Vi(e){Mi===null?Mi=[e]:Mi.push(e)}var Hi=se(null),Ui=null,Wi=null;function Gi(e,t,n){ce(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,P(Hi)}function qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ji(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),qi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Yi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===fe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Rf]:e.push(Rf))}a=a.return}e!==null&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(i(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},na=t.unstable_scheduleCallback,ra=t.unstable_NormalPriority,ia={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aa(){return{controller:new ta,data:new Map,refCount:0}}function oa(e){e.refCount--,e.refCount===0&&na(ra,function(){e.controller.abort()})}var sa=null,ca=0,la=0,ua=null;function da(e,t){if(sa===null){var n=sa=[];ca=0,la=nd(),ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ca++,t.then(fa,fa),t}function fa(){if(--ca===0&&sa!==null){ua!==null&&(ua.status=`fulfilled`);var e=sa;sa=null,la=0,ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ma=j.S;j.S=function(e,t){typeof t==`object`&&t&&typeof t.then==`function`&&da(e,t),ma!==null&&ma(e,t)};var ha=se(null);function ga(){var e=ha.current;return e===null?G.pooledCache:e}function _a(e,t){t===null?ce(ha,ha.current):ce(ha,t.pool)}function va(){var e=ga();return e===null?null:{parent:ia._currentValue,pool:e}}var ya=Error(i(460)),ba=Error(i(474)),xa=Error(i(542)),Sa={then:function(){}};function Ca(e){return e=e.status,e===`fulfilled`||e===`rejected`}function wa(){}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(wa,wa),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e;default:if(typeof t.status==`string`)t.then(wa,wa);else{if(e=G,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e}throw Ea=t,ya}}var Ea=null;function Da(){if(Ea===null)throw Error(i(459));var e=Ea;return Ea=null,e}function Oa(e){if(e===ya||e===xa)throw Error(i(483))}var ka=!1;function Aa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,kl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Fa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ia=!1;function La(){if(Ia){var e=ua;if(e!==null)throw e}}function Ra(e,t,n,r){Ia=!1;var i=e.updateQueue;ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(K&p)===p:(r&p)===p){p!==0&&p===la&&(Ia=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){f=h.call(_,f,p);break a}f=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,f,p):h,p==null)break a;f=d({},f,p);break a;case 2:ka=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=f):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=f),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ll|=o,e.lanes=o,e.memoizedState=f}}function za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ba(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)za(n[e],t)}var Va=se(null),Ha=se(0);function Ua(e,t){e=Fl,ce(Ha,e),ce(Va,t),Fl=e|t.baseLanes}function Wa(){ce(Ha,Fl),ce(Va,Va.current)}function Ga(){Fl=Ha.current,P(Va),P(Ha)}var Ka=0,R=null,qa=null,Ja=null,Ya=!1,Xa=!1,Za=!1,Qa=0,$a=0,eo=null,to=0;function no(){throw Error(i(321))}function ro(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function io(e,t,n,r,i,a){return Ka=a,R=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?xs:Ss,Za=!1,a=n(r,i),Za=!1,Xa&&(a=oo(t,n,r,i)),ao(e),a}function ao(e){j.H=bs;var t=qa!==null&&qa.next!==null;if(Ka=0,Ja=qa=R=null,Ya=!1,$a=0,eo=null,t)throw Error(i(300));e===null||nc||(e=e.dependencies,e!==null&&Xi(e)&&(nc=!0))}function oo(e,t,n,r){R=e;var a=0;do{if(Xa&&(eo=null),$a=0,Xa=!1,25<=a)throw Error(i(301));if(a+=1,Ja=qa=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Cs,o=t(n,r)}while(Xa);return o}function so(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?ho(t):t,e=e.useState()[0],(qa===null?null:qa.memoizedState)!==e&&(R.flags|=1024),t}function co(){var e=Qa!==0;return Qa=0,e}function lo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function uo(e){if(Ya){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ya=!1}Ka=0,Ja=qa=R=null,Xa=!1,$a=Qa=0,eo=null}function fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ja===null?R.memoizedState=Ja=e:Ja=Ja.next=e,Ja}function po(){if(qa===null){var e=R.alternate;e=e===null?null:e.memoizedState}else e=qa.next;var t=Ja===null?R.memoizedState:Ja.next;if(t!==null)Ja=t,qa=e;else{if(e===null)throw R.alternate===null?Error(i(467)):Error(i(310));qa=e,e={memoizedState:qa.memoizedState,baseState:qa.baseState,baseQueue:qa.baseQueue,queue:qa.queue,next:null},Ja===null?R.memoizedState=Ja=e:Ja=Ja.next=e}return Ja}function mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ho(e){var t=$a;return $a+=1,eo===null&&(eo=[]),e=Ta(eo,e,t),t=R,(Ja===null?t.memoizedState:Ja.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?xs:Ss),e}function go(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ho(e);if(e.$$typeof===C)return Qi(e)}throw Error(i(438,String(e)))}function _o(e){var t=null,n=R.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=R.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=mo(),R.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function vo(e,t){return typeof t==`function`?t(e):t}function yo(e){return bo(po(),qa,e)}function bo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ka&f)===f:(K&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===la&&(d=!0);else if((Ka&p)===p){u=u.next,p===la&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,R.lanes|=p,Ll|=p;f=u.action,Za&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,R.lanes|=f,Ll|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(nc=!0,d&&(n=ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function xo(e){var t=po(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Cr(o,t.memoizedState)||(nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function So(e,t,n){var r=R,a=po(),o=L;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((qa||a).memoizedState,n);if(s&&(a.memoizedState=n,nc=!0),a=a.queue,Ko(2048,8,To.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||Ja!==null&&Ja.memoizedState.tag&1){if(r.flags|=2048,Ho(9,Uo(),wo.bind(null,r,a,n,t),null),G===null)throw Error(i(349));o||Ka&124||Co(r,t,n)}return n}function Co(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=R.updateQueue,t===null?(t=mo(),R.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wo(e,t,n,r){t.value=n,t.getSnapshot=r,Eo(t)&&Do(e)}function To(e,t,n){return n(function(){Eo(t)&&Do(e)})}function Eo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Do(e){var t=ii(e,2);t!==null&&ou(t,e,2)}function Oo(e){var t=fo();if(typeof e==`function`){var n=e;if(e=n(),Za){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:e},t}function ko(e,t,n,r){return e.baseState=n,bo(e,qa,typeof r==`function`?r:vo)}function Ao(e,t,n,r,a){if(_s(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Mo(e,t,s)}catch(n){Po(e,t,n)}finally{j.T=a}}else try{a=n(i,r),Mo(e,t,a)}catch(n){Po(e,t,n)}}function Mo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){No(e,t,n)},function(n){return Po(e,t,n)}):No(e,t,n)}function No(e,t,n){t.status=`fulfilled`,t.value=n,Fo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,jo(e,n)))}function Po(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Fo(t),t=t.next;while(t!==r)}e.action=null}function Fo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Io(e,t){return t}function Lo(e,t){if(L){var n=G.formState;if(n!==null){a:{var r=R;if(L){if(ji){b:{for(var i=ji,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=Xd(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=Xd(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=fo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:t},n.queue=r,n=ms.bind(null,R,r),r.dispatch=n,r=Oo(!1),a=gs.bind(null,R,!1,r.queue),r=fo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ao.bind(null,R,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ro(e){return zo(po(),qa,e)}function zo(e,t,n){if(t=bo(e,t,Io)[0],e=yo(vo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ho(t)}catch(e){throw e===ya?xa:e}else r=t;t=po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(R.flags|=2048,Ho(9,Uo(),Bo.bind(null,i,n),null)),[r,a,e]}function Bo(e,t){e.action=t}function Vo(e){var t=po(),n=qa;if(n!==null)return zo(t,n,e);po(),t=t.memoizedState,n=po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ho(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=R.updateQueue,t===null&&(t=mo(),R.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Uo(){return{destroy:void 0,resource:void 0}}function Wo(){return po().memoizedState}function Go(e,t,n,r){var i=fo();r=r===void 0?null:r,R.flags|=e,i.memoizedState=Ho(1|t,Uo(),n,r)}function Ko(e,t,n,r){var i=po();r=r===void 0?null:r;var a=i.memoizedState.inst;qa!==null&&r!==null&&ro(r,qa.memoizedState.deps)?i.memoizedState=Ho(t,a,n,r):(R.flags|=e,i.memoizedState=Ho(1|t,a,n,r))}function qo(e,t){Go(8390656,8,e,t)}function Jo(e,t){Ko(2048,8,e,t)}function Yo(e,t){return Ko(4,2,e,t)}function Xo(e,t){return Ko(4,4,e,t)}function Zo(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qo(e,t,n){n=n==null?null:n.concat([e]),Ko(4,4,Zo.bind(null,t,e),n)}function $o(){}function es(e,t){var n=po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ro(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ts(e,t){var n=po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ro(t,r[1]))return r[0];if(r=e(),Za){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function ns(e,t,n){return n===void 0||Ka&1073741824?e.memoizedState=t:(e.memoizedState=n,e=au(),R.lanes|=e,Ll|=e,n)}function rs(e,t,n,r){return Cr(n,t)?n:Va.current===null?Ka&42?(e=au(),R.lanes|=e,Ll|=e,t):(nc=!0,e.memoizedState=n):(e=ns(e,n,r),Cr(e,t)||(nc=!0),e)}function is(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,gs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?hs(e,t,pa(c,r),iu(e)):hs(e,t,r,iu(e))}catch(n){hs(e,t,{then:function(){},status:`rejected`,reason:n},iu())}finally{M.p=a,j.T=o}}function as(){}function os(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ss(e).queue;is(e,a,t,ae,n===null?as:function(){return cs(e),n(r)})}function ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cs(e){var t=ss(e).next.queue;hs(e,t,{},iu())}function ls(){return Qi(Rf)}function us(){return po().memoizedState}function ds(){return po().memoizedState}function fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=iu();e=Ma(n);var r=Na(t,e,n);r!==null&&(ou(r,t,n),Pa(r,t,n)),t={cache:aa()},e.payload=t;return}t=t.return}}function ps(e,t,n){var r=iu();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},_s(e)?vs(t,n):(n=ri(e,t,n,r),n!==null&&(ou(n,e,r),ys(n,t,r)))}function ms(e,t,n){hs(e,t,n,iu())}function hs(e,t,n,r){var i={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(_s(e))vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ni(e,t,i,0),G===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return ou(n,e,r),ys(n,t,r),!0}return!1}function gs(e,t,n,r){if(r={lane:2,revertLane:nd(),action:r,hasEagerState:!1,eagerState:null,next:null},_s(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&ou(t,e,2)}function _s(e){var t=e.alternate;return e===R||t!==null&&t===R}function vs(e,t){Xa=Ya=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ys(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var bs={readContext:Qi,use:go,useCallback:no,useContext:no,useEffect:no,useImperativeHandle:no,useLayoutEffect:no,useInsertionEffect:no,useMemo:no,useReducer:no,useRef:no,useState:no,useDebugValue:no,useDeferredValue:no,useTransition:no,useSyncExternalStore:no,useId:no,useHostTransitionStatus:no,useFormState:no,useActionState:no,useOptimistic:no,useMemoCache:no,useCacheRefresh:no},xs={readContext:Qi,use:go,useCallback:function(e,t){return fo().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:qo,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Go(4194308,4,Zo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Go(4194308,4,e,t)},useInsertionEffect:function(e,t){Go(4,2,e,t)},useMemo:function(e,t){var n=fo();t=t===void 0?null:t;var r=e();if(Za){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=fo();if(n!==void 0){var i=n(t);if(Za){Ne(!0);try{n(t)}finally{Ne(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ps.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=fo();return e={current:e},t.memoizedState=e},useState:function(e){e=Oo(e);var t=e.queue,n=ms.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$o,useDeferredValue:function(e,t){return ns(fo(),e,t)},useTransition:function(){var e=Oo(!1);return e=is.bind(null,R,e.queue,!0,!1),fo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=fo();if(L){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),G===null)throw Error(i(349));K&124||Co(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,qo(To.bind(null,r,o,e),[e]),r.flags|=2048,Ho(9,Uo(),wo.bind(null,r,o,n,t),null),n},useId:function(){var e=fo(),t=G.identifierPrefix;if(L){var n=Ti,r=wi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`«`+t+`R`+n,n=Qa++,0<n&&(t+=`H`+n.toString(32)),t+=`»`}else n=to++,t=`«`+t+`r`+n.toString(32)+`»`;return e.memoizedState=t},useHostTransitionStatus:ls,useFormState:Lo,useActionState:Lo,useOptimistic:function(e){var t=fo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gs.bind(null,R,!0,n),n.dispatch=t,[e,t]},useMemoCache:_o,useCacheRefresh:function(){return fo().memoizedState=fs.bind(null,R)}},Ss={readContext:Qi,use:go,useCallback:es,useContext:Qi,useEffect:Jo,useImperativeHandle:Qo,useInsertionEffect:Yo,useLayoutEffect:Xo,useMemo:ts,useReducer:yo,useRef:Wo,useState:function(){return yo(vo)},useDebugValue:$o,useDeferredValue:function(e,t){return rs(po(),qa.memoizedState,e,t)},useTransition:function(){var e=yo(vo)[0],t=po().memoizedState;return[typeof e==`boolean`?e:ho(e),t]},useSyncExternalStore:So,useId:us,useHostTransitionStatus:ls,useFormState:Ro,useActionState:Ro,useOptimistic:function(e,t){return ko(po(),qa,e,t)},useMemoCache:_o,useCacheRefresh:ds},Cs={readContext:Qi,use:go,useCallback:es,useContext:Qi,useEffect:Jo,useImperativeHandle:Qo,useInsertionEffect:Yo,useLayoutEffect:Xo,useMemo:ts,useReducer:xo,useRef:Wo,useState:function(){return xo(vo)},useDebugValue:$o,useDeferredValue:function(e,t){var n=po();return qa===null?ns(n,e,t):rs(n,qa.memoizedState,e,t)},useTransition:function(){var e=xo(vo)[0],t=po().memoizedState;return[typeof e==`boolean`?e:ho(e),t]},useSyncExternalStore:So,useId:us,useHostTransitionStatus:ls,useFormState:Vo,useActionState:Vo,useOptimistic:function(e,t){var n=po();return qa===null?(n.baseState=e,[e,n.queue.dispatch]):ko(n,qa,e,t)},useMemoCache:_o,useCacheRefresh:ds},ws=null,Ts=0;function Es(e){var t=Ts;return Ts+=1,ws===null&&(ws=[]),Ta(ws,e,t)}function Ds(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Os(e,t){throw t.$$typeof===f?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ks(e){var t=e._init;return t(e._payload)}function As(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===h?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&ks(i)===t.type)?(t=a(t,n.props),Ds(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Ds(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=gi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case p:return n=pi(t.type,t.key,t.props,null,e.mode,n),Ds(n,t),n.return=e,n;case m:return t=gi(t,e.mode,n),t.return=e,t;case O:var r=t._init;return t=r(t._payload),f(e,t,n)}if(ie(t)||A(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Es(t),n);if(t.$$typeof===C)return f(e,$i(e,t),n);Os(e,t)}return null}function g(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case p:return n.key===i?l(e,t,n,r):null;case m:return n.key===i?u(e,t,n,r):null;case O:return i=n._init,n=i(n._payload),g(e,t,n,r)}if(ie(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return g(e,t,Es(n),r);if(n.$$typeof===C)return g(e,t,$i(e,n),r);Os(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case p:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case m:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:var a=r._init;return r=a(r._payload),_(e,t,n,r,i)}if(ie(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Es(r),i);if(r.$$typeof===C)return _(e,t,n,$i(t,r),i);Os(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,p=a=0,m=null;d!==null&&p<s.length;p++){d.index>p?(m=d,d=null):m=d.sibling;var h=g(i,d,s[p],c);if(h===null){d===null&&(d=m);break}e&&d&&h.alternate===null&&t(i,d),a=o(h,a,p),u===null?l=h:u.sibling=h,u=h,d=m}if(p===s.length)return n(i,d),L&&Ei(i,p),l;if(d===null){for(;p<s.length;p++)d=f(i,s[p],c),d!==null&&(a=o(d,a,p),u===null?l=d:u.sibling=d,u=d);return L&&Ei(i,p),l}for(d=r(d);p<s.length;p++)m=_(d,i,p,s[p],c),m!==null&&(e&&m.alternate!==null&&d.delete(m.key===null?p:m.key),a=o(m,a,p),u===null?l=m:u.sibling=m,u=m);return e&&d.forEach(function(e){return t(i,e)}),L&&Ei(i,p),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,p=s,m=s=0,h=null,v=c.next();p!==null&&!v.done;m++,v=c.next()){p.index>m?(h=p,p=null):h=p.sibling;var y=g(a,p,v.value,l);if(y===null){p===null&&(p=h);break}e&&p&&y.alternate===null&&t(a,p),s=o(y,s,m),d===null?u=y:d.sibling=y,d=y,p=h}if(v.done)return n(a,p),L&&Ei(a,m),u;if(p===null){for(;!v.done;m++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,m),d===null?u=v:d.sibling=v,d=v);return L&&Ei(a,m),u}for(p=r(p);!v.done;m++,v=c.next())v=_(p,a,m,v.value,l),v!==null&&(e&&v.alternate!==null&&p.delete(v.key===null?m:v.key),s=o(v,s,m),d===null?u=v:d.sibling=v,d=v);return e&&p.forEach(function(e){return t(a,e)}),L&&Ei(a,m),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===h&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case p:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===h){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ks(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ds(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===h?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Ds(c,o),c.return=e,e=c)}return s(e);case m:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return l=o._init,o=l(o._payload),b(e,r,o,c)}if(ie(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Es(o),c);if(o.$$typeof===C)return b(e,r,$i(e,o),c);Os(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ts=0;var i=b(e,t,n,r);return ws=null,i}catch(t){if(t===ya||t===xa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var js=As(!0),Ms=As(!1),Ns=se(null),Ps=null;function Fs(e){var t=e.alternate;ce(zs,zs.current&1),ce(Ns,e),Ps===null&&(t===null||Va.current!==null||t.memoizedState!==null)&&(Ps=e)}function Is(e){if(e.tag===22){if(ce(zs,zs.current),ce(Ns,e),Ps===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Ps=e)}}else Ls(e)}function Ls(){ce(zs,zs.current),ce(Ns,Ns.current)}function Rs(e){P(Ns),Ps===e&&(Ps=null),P(zs)}var zs=se(0);function Bs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||Jd(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:d({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=iu(),i=Ma(r);i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(ou(t,e,r),Pa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=iu(),i=Ma(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(ou(t,e,r),Pa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=iu(),r=Ma(n);r.tag=2,t!=null&&(r.callback=t),t=Na(e,r,n),t!==null&&(ou(t,e,n),Pa(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,a):!0}function Ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function z(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=d({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}var Gs=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function Ks(e){Gs(e)}function qs(e){console.error(e)}function Js(e){Gs(e)}function Ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){return n=Ma(n),n.tag=3,n.payload={element:null},n.callback=function(){Ys(e,t)},n}function Qs(e){return e=Ma(e),e.tag=3,e}function $s(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Xs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Xs(t,n,r),typeof i!=`function`&&(Jl===null?Jl=new Set([this]):Jl.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,a,!0),n=Ns.current,n!==null){switch(n.tag){case 13:return Ps===null?_u():n.alternate===null&&Il===0&&(Il=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Iu(e,r,a)),!1;case 22:return n.flags|=65536,r===Sa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Iu(e,r,a)),!1}throw Error(i(435,n.tag))}return Iu(e,r,a),_u(),!1}if(L)return t=Ns.current,t===null?(r!==Pi&&(t=Error(i(423),{cause:r}),Vi(Zr(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Zr(r,n),a=Zs(e.stateNode,r,a),Fa(e,a),Il!==4&&(Il=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Pi&&(e=Error(i(422),{cause:r}),Vi(Zr(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Zr(o,n),Hl===null?Hl=[o]:Hl.push(o),Il!==4&&(Il=2),t===null)return!0;r=Zr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zs(n.stateNode,r,e),Fa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Jl===null||!Jl.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qs(a),$s(a,e,n,r),Fa(n,a),!1}n=n.return}while(n!==null);return!1}var tc=Error(i(461)),nc=!1;function rc(e,t,n,r){t.child=e===null?Ms(t,null,n,r):js(t,e.child,n,r)}function ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Zi(t),r=io(e,t,n,o,a,i),s=co(),e!==null&&!nc?(lo(e,t,i),wc(e,t,i)):(L&&s&&Oi(t),t.flags|=1,rc(e,t,r,i),t.child)}function ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,oc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(nc=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&(nc=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function sc(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(t.flags&128){if(r=a===null?n:a.baseLanes|n,e!==null){for(i=t.child=e.child,a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return cc(e,t,r,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,a===null?null:a.cachePool),a===null?Wa():Ua(t,a),Is(t);else return t.lanes=t.childLanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n)}else a===null?(e!==null&&_a(t,null),Wa(),Ls(t)):(_a(t,a.cachePool),Ua(t,a),Ls(t),t.memoizedState=null);return rc(e,t,i,n),t.child}function cc(e,t,n,r){var i=ga();return i=i===null?null:{parent:ia._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&_a(t,null),Wa(),Is(t),e!==null&&Yi(e,t,r,!0),null}function lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function uc(e,t,n,r,i){return Zi(t),n=io(e,t,n,r,void 0,i),r=co(),e!==null&&!nc?(lo(e,t,i),wc(e,t,i)):(L&&r&&Oi(t),t.flags|=1,rc(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=oo(t,r,n,i),ao(e),r=co(),e!==null&&!nc?(lo(e,t,a),wc(e,t,a)):(L&&r&&Oi(t),t.flags|=1,rc(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Aa(t),o=n.contextType,a.context=typeof o==`object`&&o?Qi(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Vs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),Ra(t,r,a,i),La(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=z(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=Qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ws(t,a,r,o),ka=!1;var f=t.memoizedState;a.state=f,Ra(t,r,a,i),La(),l=t.memoizedState,s||f!==l||ka?(typeof d==`function`&&(Vs(t,n,d,r),l=t.memoizedState),(c=ka||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ja(e,t),o=t.memoizedProps,u=z(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=Qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ws(t,a,r,c),ka=!1,f=t.memoizedState,a.state=f,Ra(t,r,a,i),La();var p=t.memoizedState;o!==d||f!==p||ka||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof s==`function`&&(Vs(t,n,s,r),p=t.memoizedState),(u=ka||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=js(t,e.child,null,i),t.child=js(t,null,n,i)):rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return zi(),t.flags|=256,rc(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:va()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Bl),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(zs.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(L){if(a?Fs(t):Ls(t),L){var c=ji,l;if(l=c){c:{for(l=c,c=Ni;l.nodeType!==8;){if(!c){c=null;break c}if(l=Xd(l.nextSibling),l===null){c=null;break c}}c=l}c===null?l=!1:(t.memoizedState={dehydrated:c,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},l=li(18,null,null,0),l.stateNode=c,l.return=t,t.child=l,Ai=t,ji=null,l=!0)}l||Fi(t)}if(c=t.memoizedState,c!==null&&(c=c.dehydrated,c!==null))return Jd(c)?t.lanes=32:t.lanes=536870912,null;Rs(t)}return c=r.children,r=r.fallback,a?(Ls(t),a=t.mode,c=yc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,a=t.child,a.memoizedState=hc(n),a.childLanes=gc(e,s,n),t.memoizedState=mc,r):(Fs(t),vc(t,c))}if(l=e.memoizedState,l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Fs(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?(Ls(t),a=r.fallback,c=t.mode,r=yc({mode:`visible`,children:r.children},c),a=mi(a,c,n,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,js(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=a):(Ls(t),t.child=e.child,t.flags|=128,t=null);else if(Fs(t),Jd(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Vi({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(nc||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,nc||s){if(s=G,s!==null&&(r=n&-n,r=r&42?1:Ze(r),r=(r&(s.suspendedLanes|n))===0?r:0,r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),ou(s,e,r),tc;c.data===`$?`||_u(),t=bc(e,t,n)}else c.data===`$?`?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=Xd(c.nextSibling),Ai=t,L=!0,Mi=null,Ni=!1,e!==null&&(xi[Si++]=wi,xi[Si++]=Ti,xi[Si++]=Ci,wi=e.id,Ti=e.overflow,Ci=t),t=vc(t,r.children),t.flags|=4096);return t}return a?(Ls(t),a=r.fallback,c=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(a=mi(a,c,n,null),a.flags|=2):a=di(u,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,c=e.child.memoizedState,c===null?c=hc(n):(l=c.cachePool,l===null?l=va():(u=ia._currentValue,l=l.parent===u?l:{parent:u,pool:u}),c={baseLanes:c.baseLanes|n,cachePool:l}),a.memoizedState=c,a.childLanes=gc(e,s,n),t.memoizedState=mc,r):(Fs(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=li(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function bc(e,t,n){return js(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function Sc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(rc(e,t,r.children,n),r=zs.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(ce(zs,r),i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Bs(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bs(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a);break;case`together`:Sc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ll|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Yi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Xi(e))):!0}function Ec(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),Gi(t,ia,e.memoizedState.cache),zi();break;case 27:case 5:he(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Fs(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(Fs(t),t.flags|=128,null);Fs(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ce(zs,zs.current),r)break;return null;case 22:case 23:return t.lanes=0,sc(e,t,n);case 24:Gi(t,ia,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)nc=!0;else{if(!Tc(e,n)&&!(t.flags&128))return nc=!1,Ec(e,t,n);nc=!!(e.flags&131072)}else nc=!1,L&&t.flags&1048576&&Di(t,bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{e=t.pendingProps;var r=t.elementType,a=r._init;if(r=a(r._payload),t.type=r,typeof r==`function`)ui(r)?(e=z(r,e),t.tag=1,t=fc(null,t,r,e,n)):(t.tag=0,t=uc(null,t,r,e,n));else{if(r!=null){if(a=r.$$typeof,a===w){t.tag=11,t=ic(null,t,r,e,n);break a}else if(a===D){t.tag=14,t=ac(null,t,r,e,n);break a}}throw t=re(r)||r,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=z(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ja(e,t),Ra(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Gi(t,ia,r),r!==o.cache&&Ji(t,[ia],n,!0),La(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=pc(e,t,r,n);break a}else if(r!==a){a=Zr(Error(i(424)),t),Vi(a),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=Xd(e.firstChild),Ai=t,L=!0,Mi=null,Ni=!0,n=Ms(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===a){t=wc(e,t,n);break a}rc(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=_f(t.type,null,t.pendingProps,null))?t.memoizedState=n:L||(n=t.type,e=t.pendingProps,r=Md(de.current).createElement(n),r[nt]=t,r[rt]=e,Od(r,n,e),ht(r),t.stateNode=r):t.memoizedState=_f(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),e===null&&L&&(r=t.stateNode=$d(t.type,t.pendingProps,de.current),Ai=t,Ni=!0,a=ji,Ud(t.type)?(Zd=a,ji=Xd(r.firstChild)):ji=a),rc(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&L&&((a=r=ji)&&(r=Kd(r,t.type,t.pendingProps,Ni),r===null?a=!1:(t.stateNode=r,Ai=t,ji=Xd(r.firstChild),Ni=!1,a=!0)),a||Fi(t)),he(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Fd(a,o)?r=null:s!==null&&Fd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=io(e,t,so,null,null,n),Rf._currentValue=a),lc(e,t),rc(e,t,r,n),t.child;case 6:return e===null&&L&&((e=n=ji)&&(n=qd(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return _c(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=js(t,null,r,n):rc(e,t,r,n),t.child;case 11:return ic(e,t,t.type,t.pendingProps,n);case 7:return rc(e,t,t.pendingProps,n),t.child;case 8:return rc(e,t,t.pendingProps.children,n),t.child;case 12:return rc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),rc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Zi(t),a=Qi(a),r=r(a),t.flags|=1,rc(e,t,r,n),t.child;case 14:return ac(e,t,t.type,t.pendingProps,n);case 15:return oc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},e===null?(n=yc(r,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=di(e.child,r),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return sc(e,t,n);case 24:return Zi(t),r=Qi(ia),e===null?(a=ga(),a===null&&(a=G,o=aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Aa(t),Gi(t,ia,a)):((e.lanes&n)!==0&&(ja(e,t),Ra(t,null,null,n),La()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Gi(t,ia,r),r!==a.cache&&Ji(t,[ia],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gi(t,ia,r))),rc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Af(t)){if(t=Ns.current,t!==null&&((K&4194048)===K?Ps!==null:(K&62914560)!==K&&!(K&536870912)||t!==Ps))throw Ea=Sa,ba;e.flags|=8192}}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Vl|=t)}function jc(e,t){if(!L)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Nc(e,t,n){var r=t.pendingProps;switch(ki(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(ia),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),Mc(t),null;case 26:return n=t.memoizedState,e===null?(Oc(t),n===null?(Mc(t),t.flags&=-16777217):(Mc(t),kc(t,n))):n?n===e.memoizedState?(Mc(t),t.flags&=-16777217):(Oc(t),Mc(t),kc(t,n)):(e.memoizedProps!==r&&Oc(t),Mc(t),t.flags&=-16777217),null;case 27:ge(t),n=de.current;var a=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=le.current,Ri(t)?Ii(t,e):(e=$d(a,r,n),t.stateNode=e,Oc(t))}return Mc(t),null;case 5:if(ge(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(e=le.current,Ri(t))Ii(t,e);else{switch(a=Md(de.current),e){case 1:e=a.createElementNS(`http://www.w3.org/2000/svg`,n);break;case 2:e=a.createElementNS(`http://www.w3.org/1998/Math/MathML`,n);break;default:switch(n){case`svg`:e=a.createElementNS(`http://www.w3.org/2000/svg`,n);break;case`math`:e=a.createElementNS(`http://www.w3.org/1998/Math/MathML`,n);break;case`script`:e=a.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild);break;case`select`:e=typeof r.is==`string`?a.createElement(`select`,{is:r.is}):a.createElement(`select`),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is==`string`?a.createElement(n,{is:r.is}):a.createElement(n)}}e[nt]=t,e[rt]=r;a:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break a;for(;a.sibling===null;){if(a.return===null||a.return===t)break a;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=e;a:switch(Od(e,n,r),n){case`button`:case`input`:case`select`:case`textarea`:e=!!r.autoFocus;break a;case`img`:e=!0;break a;default:e=!1}e&&Oc(t)}}return Mc(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=de.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||wd(e.nodeValue,n)),e||Fi(t)}else e=Md(e).createTextNode(r),e[nt]=t,t.stateNode=e}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ri(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Rs(t),t):(Rs(t),null)}if(Rs(t),t.flags&128)return t.lanes=n,t;if(n=r!==null,e=e!==null&&e.memoizedState!==null,n){r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool);var o=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Ac(t,t.updateQueue),Mc(t),null;case 4:return me(),e===null&&md(t.stateNode.containerInfo),Mc(t),null;case 10:return Ki(t.type),Mc(t),null;case 19:if(P(zs),a=t.memoizedState,a===null)return Mc(t),null;if(r=(t.flags&128)!=0,o=a.rendering,o===null)if(r)jc(a,!1);else{if(Il!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bs(e),o!==null){for(t.flags|=128,jc(a,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return ce(zs,zs.current&1|2),t.child}e=e.sibling}a.tail!==null&&Se()>Kl&&(t.flags|=128,r=!0,jc(a,!1),t.lanes=4194304)}else{if(!r)if(e=Bs(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(a,!0),a.tail===null&&a.tailMode===`hidden`&&!o.alternate&&!L)return Mc(t),null}else 2*Se()-a.renderingStartTime>Kl&&n!==536870912&&(t.flags|=128,r=!0,jc(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e===null?t.child=o:e.sibling=o,a.last=o)}return a.tail===null?(Mc(t),null):(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Se(),t.sibling=null,e=zs.current,ce(zs,r?e&1|2:e&1),t);case 22:case 23:return Rs(t),Ga(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&P(ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(ia),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(ia),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 13:if(Rs(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(zs),null;case 4:return me(),null;case 10:return Ki(t.type),null;case 22:case 23:return Rs(t),Ga(),e!==null&&P(ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(ia),null;case 25:return null;default:return null}}function Fc(e,t){switch(ki(t),t.tag){case 3:Ki(ia),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 13:Rs(t);break;case 19:P(zs);break;case 10:Ki(t.type);break;case 22:case 23:Rs(t),Ga(),e!==null&&P(ha);break;case 24:Ki(ia)}}function Ic(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Fu(t,t.return,e)}}function Lc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Fu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Fu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ba(t,n)}catch(t){Fu(e,e.return,t)}}}function zc(e,t,n){n.props=z(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Fu(e,t,n)}}function Bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Fu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Fu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Fu(e,t,n)}else n.current=null}function Hc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Fu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;kd(r,e.type,n,t),r[rt]=t}catch(t){Fu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ud(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ud(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Td));else if(r!==4&&(r===27&&Ud(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Ud(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Od(t,r,n),t[nt]=e,t[rt]=n}catch(t){Fu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Ad=Gf,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(jd={focusedElem:e,selectionRange:n},Gf=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1024&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=z(n.type,a,n.elementType===n.type);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Fu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Gd(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:Gd(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Ic(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Fu(n,n.return,e)}else{var i=z(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Fu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ba(e,t)}catch(e){Fu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:hl(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=zu.bind(null,n),Yd(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Yc=i,Xc=a}break;case 30:break;default:hl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Ud(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),ef(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Fu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Fu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Wd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),gp(e)):Wd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Xc||Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gp(e)}catch(e){Fu(t,t.return,e)}}function cl(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){var r=Bu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Ud(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Od(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Y(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Od(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Y(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Od(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Of(a,e.type,e.stateNode);else e.stateNode=Cf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Of(a,e.type,e.stateNode):Cf(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){Fu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Fu(e,e.return,t)}}break;case 3:if(Df=null,a=dl,dl=rf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{gp(t.containerInfo)}catch(t){Fu(e,e.return,t)}Zc&&(Zc=!1,ml(e));break;case 4:r=dl,dl=rf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Gl=Se()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,ul(t,e),Xc=d,Yc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Fu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Fu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Fu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),gl(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),gl(t);break;case 27:ef(t.stateNode);case 26:case 5:Vc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Ic(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Fu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)za(c[i],s)}catch(e){Fu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:_l(i,a,n);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),Bc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&oa(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e))}function B(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:B(e,t,n,r),i&2048&&Ic(9,t);break;case 1:B(e,t,n,r);break;case 3:B(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e)));break;case 12:if(i&2048){B(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Fu(t,t.return,e)}}else B(e,t,n,r);break;case 13:B(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?B(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,(t.subtreeFlags&10256)!=0)):a._visibility&2?B(e,t,n,r):Sl(e,t),i&2048&&vl(o,t);break;case 24:B(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:B(e,t,n,r)}}function xl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:xl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Sl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Sl(n,r),i&2048&&yl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)V(e),e=e.sibling}function V(e){switch(e.tag){case 26:wl(e),e.flags&Cl&&e.memoizedState!==null&&Mf(dl,e.memoizedState,e.memoizedProps);break;case 5:wl(e);break;case 3:case 4:var t=dl;dl=rf(e.stateNode.containerInfo),wl(e),dl=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Cl,Cl=16777216,wl(e),Cl=t):wl(e));break;default:wl(e)}}function Tl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function El(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,H(r,e)}Tl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dl(e),e=e.sibling}function Dl(e){switch(e.tag){case 0:case 11:case 15:El(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:El(e);break;case 12:El(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ol(e)):El(e);break;default:El(e)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,H(r,e)}Tl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),Ol(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ol(t));break;default:Ol(t)}e=e.sibling}}function H(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var U={getCacheForType:function(e){var t=Qi(ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},W=typeof WeakMap==`function`?WeakMap:Map,kl=0,G=null,Al=null,K=0,q=0,jl=null,Ml=!1,Nl=!1,Pl=!1,Fl=0,Il=0,Ll=0,Rl=0,zl=0,Bl=0,Vl=0,Hl=null,Ul=null,Wl=!1,Gl=0,Kl=1/0,ql=null,Jl=null,Yl=0,Xl=null,Zl=null,Ql=0,$l=0,eu=null,tu=null,nu=0,ru=null;function iu(){if(kl&2&&K!==0)return K&-K;if(j.T!==null){var e=la;return e===0?nd():e}return $e()}function au(){Bl===0&&(Bl=!(K&536870912)||L?We():536870912);var e=Ns.current;return e!==null&&(e.flags|=32),Bl}function ou(e,t,n){(e===G&&(q===2||q===9)||e.cancelPendingCommit!==null)&&(pu(e,0),uu(e,K,Bl,!1)),qe(e,n),(!(kl&2)||e!==G)&&(e===G&&(!(kl&2)&&(Rl|=n),Il===4&&uu(e,K,Bl,!1)),Ju(e))}function su(e,t,n){if(kl&6)throw Error(i(327));var r=!n&&(t&124)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?bu(e,t):vu(e,t,!0),o=r;do{if(a===0){Nl&&!r&&uu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!lu(n)){a=vu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Hl;var l=c.current.memoizedState.isDehydrated;if(l&&(pu(c,s).flags|=256),s=vu(c,s,!1),s!==2){if(Pl&&!l){c.errorRecoveryDisabledLanes|=o,Rl|=o,a=4;break a}o=Ul,Ul=a,o!==null&&(Ul===null?Ul=o:Ul.push.apply(Ul,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){pu(e,0),uu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:uu(r,t,Bl,!Ml);break a;case 2:Ul=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Gl+300-Se(),10<a)){if(uu(r,t,Bl,!Ml),Ve(r,0,!0)!==0)break a;r.timeoutHandle=Rd(cu.bind(null,r,n,Ul,ql,Wl,t,Bl,Rl,Vl,Ml,o,2,-0,0),a);break a}cu(r,n,Ul,ql,Wl,t,Bl,Rl,Vl,Ml,o,0,-0,0)}}break}while(1);Ju(e)}function cu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,(d&8192||(d&16785408)==16785408)&&(X={stylesheets:null,count:0,unsuspend:jf},V(t),d=Nf(),d!==null)){e.cancelPendingCommit=d(Du.bind(null,e,t,a,n,r,i,o,s,c,u,1,f,p)),uu(e,a,o,!l);return}Du(e,t,a,n,r,i,o,s,c)}function lu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function uu(e,t,n,r){t&=~zl,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function du(){return kl&6?!0:(Yu(0,!1),!1)}function fu(){if(Al!==null){if(q===0)var e=Al.return;else e=Al,Wi=Ui=null,uo(e),ws=null,Ts=0,e=Al;for(;e!==null;)Fc(e.alternate,e),e=e.return;Al=null}}function pu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),fu(),G=e,Al=n=di(e.current,null),K=t,q=0,jl=null,Ml=!1,Nl=He(e,t),Pl=!1,Vl=Bl=zl=Rl=Ll=Il=0,Ul=Hl=null,Wl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Fl=t,ti(),n}function mu(e,t){R=null,j.H=bs,t===ya||t===xa?(t=Da(),q=3):t===ba?(t=Da(),q=4):q=t===tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,jl=t,Al===null&&(Il=1,Ys(e,Zr(t,e.current)))}function hu(){var e=j.H;return j.H=bs,e===null?bs:e}function gu(){var e=j.A;return j.A=U,e}function _u(){Il=4,Ml||(K&4194048)!==K&&Ns.current!==null||(Nl=!0),!(Ll&134217727)&&!(Rl&134217727)||G===null||uu(G,K,Bl,!1)}function vu(e,t,n){var r=kl;kl|=2;var i=hu(),a=gu();(G!==e||K!==t)&&(ql=null,pu(e,t)),t=!1;var o=Il;a:do try{if(q!==0&&Al!==null){var s=Al,c=jl;switch(q){case 8:fu(),o=6;break a;case 3:case 2:case 9:case 6:Ns.current===null&&(t=!0);var l=q;if(q=0,jl=null,wu(e,s,c,l),n&&Nl){o=0;break a}break;default:l=q,q=0,jl=null,wu(e,s,c,l)}}yu(),o=Il;break}catch(t){mu(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,kl=r,j.H=i,j.A=a,Al===null&&(G=null,K=0,ti()),o}function yu(){for(;Al!==null;)Su(Al)}function bu(e,t){var n=kl;kl|=2;var r=hu(),a=gu();G!==e||K!==t?(ql=null,Kl=Se()+500,pu(e,t)):Nl=He(e,t);a:do try{if(q!==0&&Al!==null){t=Al;var o=jl;b:switch(q){case 1:q=0,jl=null,wu(e,t,o,1);break;case 2:case 9:if(Ca(o)){q=0,jl=null,Cu(t);break}t=function(){q!==2&&q!==9||G!==e||(q=7),Ju(e)},o.then(t,t);break a;case 3:q=7;break a;case 4:q=5;break a;case 7:Ca(o)?(q=0,jl=null,Cu(t)):(q=0,jl=null,wu(e,t,o,7));break;case 5:var s=null;switch(Al.tag){case 26:s=Al.memoizedState;case 5:case 27:var c=Al;if(!s||Af(s)){q=0,jl=null;var l=c.sibling;if(l!==null)Al=l;else{var u=c.return;u===null?Al=null:(Al=u,Tu(u))}break b}}q=0,jl=null,wu(e,t,o,5);break;case 6:q=0,jl=null,wu(e,t,o,6);break;case 8:fu(),Il=6;break a;default:throw Error(i(462))}}xu();break}catch(t){mu(e,t)}while(1);return Wi=Ui=null,j.H=r,j.A=a,kl=n,Al===null?(G=null,K=0,ti(),Il):0}function xu(){for(;Al!==null&&!be();)Su(Al)}function Su(e){var t=Dc(e.alternate,e,Fl);e.memoizedProps=e.pendingProps,t===null?Tu(e):Al=t}function Cu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:uo(t);default:Fc(n,t),t=Al=fi(t,Fl),t=Dc(n,t,Fl)}e.memoizedProps=e.pendingProps,t===null?Tu(e):Al=t}function wu(e,t,n,r){Wi=Ui=null,uo(t),ws=null,Ts=0;var i=t.return;try{if(ec(e,i,t,n,K)){Il=1,Ys(e,Zr(n,e.current)),Al=null;return}}catch(t){if(i!==null)throw Al=i,t;Il=1,Ys(e,Zr(n,e.current)),Al=null;return}t.flags&32768?(L||r===1?e=!0:Nl||K&536870912?e=!1:(Ml=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ns.current,r!==null&&r.tag===13&&(r.flags|=16384))),Eu(t,e)):Tu(t)}function Tu(e){var t=e;do{if(t.flags&32768){Eu(t,Ml);return}e=t.return;var n=Nc(t.alternate,t,Fl);if(n!==null){Al=n;return}if(t=t.sibling,t!==null){Al=t;return}Al=t=e}while(t!==null);Il===0&&(Il=5)}function Eu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Al=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Al=e;return}Al=e=n}while(e!==null);Il=6,Al=null}function Du(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Mu();while(Yl!==0);if(kl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,Je(e,n,o,s,c,l),e===G&&(Al=G=null,K=0),Zl=t,Xl=e,Ql=n,$l=o,eu=a,tu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Vu(Ee,function(){return Nu(!0),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=kl,kl|=4;try{el(e,t,n)}finally{kl=s,M.p=a,j.T=r}}Yl=1,Ou(),ku(),Au()}}function Ou(){if(Yl===1){Yl=0;var e=Xl,t=Zl,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=kl;kl|=4;try{fl(t,e);var a=jd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Gf=!!Ad,jd=Ad=null}finally{kl=i,M.p=r,j.T=n}}e.current=t,Yl=2}}function ku(){if(Yl===2){Yl=0;var e=Xl,t=Zl,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=kl;kl|=4;try{tl(e,t.alternate,t)}finally{kl=i,M.p=r,j.T=n}}Yl=3}}function Au(){if(Yl===4||Yl===3){Yl=0,xe();var e=Xl,t=Zl,n=Ql,r=tu;t.subtreeFlags&10256||t.flags&10256?Yl=5:(Yl=0,Zl=Xl=null,ju(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Jl=null),Qe(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}Ql&3&&Mu(),Ju(e),i=e.pendingLanes,n&4194090&&i&42?e===ru?nu++:(nu=0,ru=e):nu=0,Yu(0,!1)}}function ju(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,oa(t)))}function Mu(e){return Ou(),ku(),Au(),Nu(e)}function Nu(){if(Yl!==5)return!1;var e=Xl,t=$l;$l=0;var n=Qe(Ql),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=eu,eu=null;var o=Xl,s=Ql;if(Yl=0,Zl=Xl=null,Ql=0,kl&6)throw Error(i(331));var c=kl;if(kl|=4,Dl(o.current),bl(o,o.current,s,n),kl=c,Yu(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{M.p=a,j.T=r,ju(e,t)}}function Pu(e,t,n){t=Zr(n,t),t=Zs(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(qe(e,2),Ju(e))}function Fu(e,t,n){if(e.tag===3)Pu(e,e,n);else for(;t!==null;){if(t.tag===3){Pu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Jl===null||!Jl.has(r))){e=Zr(n,e),n=Qs(2),r=Na(t,n,2),r!==null&&($s(n,r,t,e),qe(r,2),Ju(r));break}}t=t.return}}function Iu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new W;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Pl=!0,i.add(n),e=Lu.bind(null,e,t,n),t.then(e,e))}function Lu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,G===e&&(K&n)===n&&(Il===4||Il===3&&(K&62914560)===K&&300>Se()-Gl?!(kl&2)&&pu(e,0):zl|=n,Vl===K&&(Vl=0)),Ju(e)}function Ru(e,t){t===0&&(t=Ge()),e=ii(e,t),e!==null&&(qe(e,t),Ju(e))}function zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ru(e,n)}function Bu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ru(e,n)}function Vu(e,t){return ve(e,t)}var Hu=null,Uu=null,Wu=!1,Gu=!1,Ku=!1,qu=0;function Ju(e){e!==Uu&&e.next===null&&(Uu===null?Hu=Uu=e:Uu=Uu.next=e),Gu=!0,Wu||(Wu=!0,td())}function Yu(e,t){if(!Ku&&Gu){Ku=!0;do for(var n=!1,r=Hu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ed(r,a))}else a=K,a=Ve(r,r===G?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,ed(r,a));r=r.next}while(n);Ku=!1}}function Xu(){Zu()}function Zu(){Gu=Wu=!1;var e=0;qu!==0&&(Ld()&&(e=qu),qu=0);for(var t=Se(),n=null,r=Hu;r!==null;){var i=r.next,a=Qu(r,t);a===0?(r.next=null,n===null?Hu=i:n.next=i,i===null&&(Uu=n)):(n=r,(e!==0||a&3)&&(Gu=!0)),r=i}Yu(e,!1)}function Qu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=G,n=K,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(q===2||q===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ye(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ye(r),Qe(n)){case 2:case 8:n=Te;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=$u.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(r),e.callbackPriority=2,e.callbackNode=null,2}function $u(e,t){if(Yl!==0&&Yl!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Mu(!0)&&e.callbackNode!==n)return null;var r=K;return r=Ve(e,e===G?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(su(e,r,t),Qu(e,Se()),e.callbackNode!=null&&e.callbackNode===n?$u.bind(null,e):null)}function ed(e,t){if(Mu())return null;su(e,t,!0)}function td(){Vd(function(){kl&6?ve(we,Xu):Zu()})}function nd(){return qu===0&&(qu=We()),qu}function rd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function id(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function ad(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=rd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?rd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(qu!==0){var e=o?id(i,o):new FormData(i);os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?id(i,o):new FormData(i),os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var od=0;od<Yr.length;od++){var sd=Yr[od];Xr(sd.toLowerCase(),`on`+(sd[0].toUpperCase()+sd.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var cd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),ld=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(cd));function ud(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gs(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gs(e)}i.currentTarget=null,a=c}}}}function dd(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(hd(t,e,2,!1),n.add(r))}function fd(e,t,n){var r=0;t&&(r|=4),hd(n,e,r,t)}var pd=`_reactListening`+Math.random().toString(36).slice(2);function md(e){if(!e[pd]){e[pd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(ld.has(t)||fd(t,!1,e),fd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pd]||(t[pd]=!0,fd(`selectionchange`,!1,t))}}function hd(e,t,n,r){switch(Qf(t)){case 2:var i=Kf;break;case 8:i=qf;break;default:i=Jf}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function gd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Vr:case Hr:case Ur:l=Mn;break;case qr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(_d(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=l,p=u,m=0,h=d;h;h=yd(h))m++;for(h=0,g=p;g;g=yd(g))h++;for(;0<m-h;)d=yd(d),m--;for(;0<h-m;)p=yd(p),h--;for(;m--;){if(d===p||p!==null&&d===p.alternate)break b;d=yd(d),p=yd(p)}d=null}else d=null;l!==null&&bd(s,c,l,d,!1),u!==null&&f!==null&&bd(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=dr;else if(ar(c))if(fr)_=xr;else{_=yr;var v=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(_=dr):_=br;if(_&&=_(e,r)){or(s,_,n,i);break a}v&&v(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(v=r?pt(r):window,e){case`focusin`:(ar(v)||v.contentEditable===`true`)&&(jr=v,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var y;if(qn)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else tr?$n(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Xn&&n.locale!==`ko`&&(tr||b!==`onCompositionStart`?b===`onCompositionEnd`&&tr&&(y=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),v=vd(r,b),0<v.length&&(b=new Pn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=er(n),y!==null&&(b.data=y)))),(y=Yn?nr(e,n):rr(e,n))&&(b=vd(r,`onBeforeInput`),0<b.length&&(v=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),ad(s,e,r,n,i)}ud(s,t)})}function _d(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(_d(e,i,a)),i=ln(e,t),i!=null&&r.push(_d(e,i,a))),e.tag===3)return r;e=e.return}return[]}function yd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function bd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(_d(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(_d(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var xd=/\r\n?/g,Sd=/\u0000|\uFFFD/g;function Cd(e){return(typeof e==`string`?e:``+e).replace(xd,`
`).replace(Sd,``)}function wd(e,t){return t=Cd(t),Cd(e)===t}function Td(){}function Ed(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ed(e,t,`name`,a.name,a,null),Ed(e,t,`formEncType`,a.formEncType,a,null),Ed(e,t,`formMethod`,a.formMethod,a,null),Ed(e,t,`formTarget`,a.formTarget,a,null)):(Ed(e,t,`encType`,a.encType,a,null),Ed(e,t,`method`,a.method,a,null),Ed(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Td);break;case`onScroll`:r!=null&&dd(`scroll`,e);break;case`onScrollEnd`:r!=null&&dd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:dd(`beforetoggle`,e),dd(`toggle`,e),F(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:F(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,F(e,n,r))}}function Dd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&dd(`scroll`,e);break;case`onScrollEnd`:r!=null&&dd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Td);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):F(e,n,r)}}}function Od(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:dd(`error`,e),dd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ed(e,t,o,s,n,null)}}a&&Ed(e,t,`srcSet`,n.srcSet,n,null),r&&Ed(e,t,`src`,n.src,n,null);return;case`input`:dd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ed(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1),It(e);return;case`select`:for(a in dd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ed(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in dd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ed(e,t,s,c,n,null)}Kt(e,r,a,o),It(e);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ed(e,t,l,r,n,null)}return;case`dialog`:dd(`beforetoggle`,e),dd(`toggle`,e),dd(`cancel`,e),dd(`close`,e);break;case`iframe`:case`object`:dd(`load`,e);break;case`video`:case`audio`:for(r=0;r<cd.length;r++)dd(cd[r],e);break;case`image`:dd(`error`,e),dd(`load`,e);break;case`details`:dd(`toggle`,e);break;case`embed`:case`source`:case`link`:dd(`error`,e),dd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ed(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Dd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ed(e,t,c,r,n,null))}function kd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ed(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ed(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ed(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ed(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ed(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ed(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ed(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ed(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ed(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ed(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Dd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Dd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ed(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ed(e,t,f,p,r,m)}var Ad=null,jd=null;function Md(e){return e.nodeType===9?e:e.ownerDocument}function Nd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Pd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Fd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Id=null;function Ld(){var e=window.event;return e&&e.type===`popstate`?e===Id?!1:(Id=e,!0):(Id=null,!1)}var Rd=typeof setTimeout==`function`?setTimeout:void 0,zd=typeof clearTimeout==`function`?clearTimeout:void 0,Bd=typeof Promise==`function`?Promise:void 0,Vd=typeof queueMicrotask==`function`?queueMicrotask:Bd===void 0?Rd:function(e){return Bd.resolve(null).then(e).catch(Hd)};function Hd(e){setTimeout(function(){throw e})}function Ud(e){return e===`head`}function Wd(e,t){var n=t,r=0,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n===`/$`){if(0<r&&8>r){n=r;var o=e.ownerDocument;if(n&1&&ef(o.documentElement),n&2&&ef(o.body),n&4)for(n=o.head,ef(n),o=n.firstChild;o;){var s=o.nextSibling,c=o.nodeName;o[lt]||c===`SCRIPT`||c===`STYLE`||c===`LINK`&&o.rel.toLowerCase()===`stylesheet`||n.removeChild(o),o=s}}if(i===0){e.removeChild(a),gp(t);return}i--}else n===`$`||n===`$?`||n===`$!`?i++:r=n.charCodeAt(0)-48;else r=0;n=a}while(n);gp(t)}function Gd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:Gd(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function Kd(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Xd(e.nextSibling),e===null)break}return null}function qd(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Xd(e.nextSibling),e===null))return null;return e}function Jd(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState===`complete`}function Yd(e,t){var n=e.ownerDocument;if(e.data!==`$?`||n.readyState===`complete`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Xd(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`F!`||t===`F`)break;if(t===`/$`)return null}}return e}var Zd=null;function Qd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}function $d(e,t,n){switch(t=Md(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function ef(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var tf=new Map,nf=new Set;function rf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var af=M.d;M.d={f:of,r:sf,D:uf,C:df,L:ff,m:pf,X:hf,S:mf,M:gf};function of(){var e=af.f(),t=du();return e||t}function sf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?cs(t):af.r(e)}var cf=typeof document>`u`?null:document;function lf(e,t,n){var r=cf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),nf.has(i)||(nf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Od(t,`link`,e),ht(t),r.head.appendChild(t)))}}function uf(e){af.D(e),lf(`dns-prefetch`,e,null)}function df(e,t){af.C(e,t),lf(`preconnect`,e,t)}function ff(e,t,n){af.L(e,t,n);var r=cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=vf(e);break;case`script`:a=xf(e)}tf.has(a)||(e=d({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(yf(a))||t===`script`&&r.querySelector(Sf(a))||(t=r.createElement(`link`),Od(t,`link`,e),ht(t),r.head.appendChild(t)))}}function pf(e,t){af.m(e,t);var n=cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=xf(e)}if(!tf.has(a)&&(e=d({rel:`modulepreload`,href:e},t),tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Sf(a)))return}r=n.createElement(`link`),Od(r,`link`,e),ht(r),n.head.appendChild(r)}}}function mf(e,t,n){af.S(e,t,n);var r=cf;if(r&&e){var i=mt(r).hoistableStyles,a=vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(yf(a)))s.loading=5;else{e=d({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=tf.get(a))&&Tf(e,n);var c=o=r.createElement(`link`);ht(c),Od(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,wf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function hf(e,t){af.X(e,t);var n=cf;if(n&&e){var r=mt(n).hoistableScripts,i=xf(e),a=r.get(i);a||(a=n.querySelector(Sf(i)),a||(e=d({src:e,async:!0},t),(t=tf.get(i))&&Ef(e,t),a=n.createElement(`script`),ht(a),Od(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function gf(e,t){af.M(e,t);var n=cf;if(n&&e){var r=mt(n).hoistableScripts,i=xf(e),a=r.get(i);a||(a=n.querySelector(Sf(i)),a||(e=d({src:e,async:!0,type:`module`},t),(t=tf.get(i))&&Ef(e,t),a=n.createElement(`script`),ht(a),Od(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function _f(e,t,n,r){var a=(a=de.current)?rf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=vf(n.href),n=mt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=vf(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(yf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),tf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},tf.set(e,n),o||J(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=xf(n),n=mt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function vf(e){return`href="`+Bt(e)+`"`}function yf(e){return`link[rel="stylesheet"][`+e+`]`}function bf(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function J(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Od(t,`link`,n),ht(t),e.head.appendChild(t))}function xf(e){return`[src="`+Bt(e)+`"]`}function Sf(e){return`script[async]`+e}function Cf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=d({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Od(r,`style`,a),wf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=vf(n.href);var o=e.querySelector(yf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=bf(n),(a=tf.get(a))&&Tf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Od(o,`link`,r),t.state.loading|=4,wf(o,n.precedence,e),t.instance=o;case`script`:return o=xf(n.src),(a=e.querySelector(Sf(o)))?(t.instance=a,ht(a),a):(r=n,(a=tf.get(o))&&(r=d({},n),Ef(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Od(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,wf(r,n.precedence,e));return t.instance}function wf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Tf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ef(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Df=null;function Y(e,t,n){if(Df===null){var r=new Map,i=Df=new Map;i.set(n,r)}else i=Df,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[lt]||a[nt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Of(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Af(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}var X=null;function jf(){}function Mf(e,t,n){if(X===null)throw Error(i(475));var r=X;if(t.type===`stylesheet`&&(typeof n.media!=`string`||!1!==matchMedia(n.media).matches)&&!(t.state.loading&4)){if(t.instance===null){var a=vf(n.href),o=e.querySelector(yf(a));if(o){e=o._p,typeof e==`object`&&e&&typeof e.then==`function`&&(r.count++,r=Pf.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=o,ht(o);return}o=e.ownerDocument||e,n=bf(n),(a=tf.get(a))&&Tf(n,a),o=o.createElement(`link`),ht(o);var s=o;s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Od(o,`link`,n),t.instance=o}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(r.count++,t=Pf.bind(r),e.addEventListener(`load`,t),e.addEventListener(`error`,t))}}function Nf(){if(X===null)throw Error(i(475));var e=X;return e.stylesheets&&e.count===0&&If(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&If(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Pf(){if(this.count--,this.count===0){if(this.stylesheets)If(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ff=null;function If(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ff=new Map,t.forEach(Lf,e),Ff=null,Pf.call(e))}function Lf(e,t){if(!(t.state.loading&4)){var n=Ff.get(e);if(n)var r=n.get(null);else{n=new Map,Ff.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Pf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Rf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function zf(e,t,n,r,i,a,o,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function Bf(e,t,n,r,i,a,o,s,c,l,u,d){return e=new zf(e,t,n,o,s,c,l,d),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Aa(a),e}function Vf(e){return e?(e=si,e):si}function Z(e,t,n,r,i,a){i=Vf(i),r.context===null?r.context=i:r.pendingContext=i,r=Ma(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Na(e,r,t),n!==null&&(ou(n,e,t),Pa(n,e,t))}function Hf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Uf(e,t){Hf(e,t),(e=e.alternate)&&Hf(e,t)}function Wf(e){if(e.tag===13){var t=ii(e,67108864);t!==null&&ou(t,e,67108864),Uf(e,67108864)}}var Gf=!0;function Kf(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,Jf(e,t,n,r)}finally{M.p=a,j.T=i}}function qf(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,Jf(e,t,n,r)}finally{M.p=a,j.T=i}}function Jf(e,t,n,r){if(Gf){var i=Yf(r);if(i===null)gd(e,t,r,Xf,n),sp(e,r);else if(lp(i,e,t,n,r))r.stopPropagation();else if(sp(e,r),t&4&&-1<op.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}Ju(a),!(kl&6)&&(Kl=Se()+500,Yu(0,!1))}}break;case 13:s=ii(a,2),s!==null&&ou(s,a,2),du(),Uf(a,2)}if(a=Yf(r),a===null&&gd(e,t,r,Xf,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else gd(e,t,r,null,n)}}function Yf(e){return e=nn(e),Zf(e)}var Xf=null;function Zf(e){if(Xf=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Xf=e,null}function Qf(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var $f=!1,ep=null,tp=null,np=null,rp=new Map,ip=new Map,ap=[],op=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function sp(e,t){switch(e){case`focusin`:case`focusout`:ep=null;break;case`dragenter`:case`dragleave`:tp=null;break;case`mouseover`:case`mouseout`:np=null;break;case`pointerover`:case`pointerout`:rp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:ip.delete(t.pointerId)}}function cp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ft(t),t!==null&&Wf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function lp(e,t,n,r,i){switch(t){case`focusin`:return ep=cp(ep,e,t,n,r,i),!0;case`dragenter`:return tp=cp(tp,e,t,n,r,i),!0;case`mouseover`:return np=cp(np,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return rp.set(a,cp(rp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,ip.set(a,cp(ip.get(a)||null,e,t,n,r,i)),!0}return!1}function up(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){if(n.tag===13){var e=iu();e=Ze(e);var t=ii(n,e);t!==null&&ou(t,n,e),Uf(n,e)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yf(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=ft(n),t!==null&&Wf(t),e.blockedOn=n,!1;t.shift()}return!0}function fp(e,t,n){dp(e)&&n.delete(t)}function pp(){$f=!1,ep!==null&&dp(ep)&&(ep=null),tp!==null&&dp(tp)&&(tp=null),np!==null&&dp(np)&&(np=null),rp.forEach(fp),ip.forEach(fp)}function mp(e,n){e.blockedOn===n&&(e.blockedOn=null,$f||($f=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,pp)))}var hp=null;function Q(e){hp!==e&&(hp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){hp===e&&(hp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Zf(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function gp(e){function t(t){return mp(t,e)}ep!==null&&mp(ep,e),tp!==null&&mp(tp,e),np!==null&&mp(np,e),rp.forEach(t),ip.forEach(t);for(var n=0;n<ap.length;n++){var r=ap[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ap.length&&(n=ap[0],n.blockedOn===null);)up(n),n.blockedOn===null&&ap.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[rt]||null;if(typeof a==`function`)o||Q(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(Zf(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Q(n)}}}function _p(e){this._internalRoot=e}vp.prototype.render=_p.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Z(n,iu(),e,t,null,null)},vp.prototype.unmount=_p.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Z(e.current,2,null,e,null,null),du(),t[it]=null}};function vp(e){this._internalRoot=e}vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ap.length&&t!==0&&t<ap[n].priority;n++);ap.splice(n,0,e),n===0&&up(e)}};var yp=n.version;if(yp!==`19.1.0`)throw Error(i(527,yp,`19.1.0`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=l(t),e=e===null?null:u(e),e=e===null?null:e.stateNode,e};var bp={bundleType:0,version:`19.1.0`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.1.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var xp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xp.isDisabled&&xp.supportsFiber)try{je=xp.inject(bp),Me=xp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ks,s=qs,c=Js,l=null;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(l=t.unstable_transitionCallbacks)),t=Bf(e,1,!1,null,null,n,r,o,s,c,l,null),e[it]=t.current,md(e),new _p(t)}})),C=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=S()})),w=u(y()),T=u(x()),E=C();function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(this,arguments)}var O;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(O||={});var k=`popstate`;function ee(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return ie(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:j(t)}return ae(t,n,null,e)}function te(e,t){if(e===!1||e==null)throw Error(t)}function A(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ne(){return Math.random().toString(36).substr(2,8)}function re(e,t){return{usr:e.state,key:e.key,idx:t}}function ie(e,t,n,r){return n===void 0&&(n=null),D({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?M(t):t,{state:n,key:t&&t.key||r||ne()})}function j(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function M(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ae(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=O.Pop,c=null,l=u();l??(l=0,o.replaceState(D({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=O.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=O.Push;let r=ie(h.location,e,t);n&&n(r,e),l=u()+1;let d=re(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=O.Replace;let r=ie(h.location,e,t);n&&n(r,e),l=u();let i=re(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:j(e);return n=n.replace(/ $/,`%20`),te(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(k,d),c=e,()=>{i.removeEventListener(k,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var N;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(N||={});function oe(e,t,n){n===void 0&&(n=`/`);let r=Se((typeof t==`string`?M(t):t).pathname||`/`,n);if(r==null)return null;let i=se(e);ce(i);let a=null;for(let e=0;a==null&&e<i.length;++e){let t=xe(r);a=ve(i[e],t)}return a}function se(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(te(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=Ce([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(te(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),se(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:ge(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of P(e.path))i(e,t,n)}),t}function P(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=P(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ce(e){e.sort((e,t)=>e.score===t.score?_e(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var le=/^:[\w-]+$/,ue=3,de=2,fe=1,pe=10,me=-2,he=e=>e===`*`;function ge(e,t){let n=e.split(`/`),r=n.length;return n.some(he)&&(r+=me),t&&(r+=de),n.filter(e=>!he(e)).reduce((e,t)=>e+(le.test(t)?ue:t===``?fe:pe),r)}function _e(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ve(e,t){let{routesMeta:n}=e,r={},i=`/`,a=[];for(let e=0;e<n.length;++e){let o=n[e],s=e===n.length-1,c=i===`/`?t:t.slice(i.length)||`/`,l=ye({path:o.relativePath,caseSensitive:o.caseSensitive,end:s},c);if(!l)return null;Object.assign(r,l.params);let u=o.route;a.push({params:r,pathname:Ce([i,l.pathname]),pathnameBase:we(Ce([i,l.pathnameBase])),route:u}),l.pathnameBase!==`/`&&(i=Ce([i,l.pathnameBase]))}return a}function ye(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=be(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function be(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),A(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function xe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return A(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function Se(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var Ce=e=>e.join(`/`).replace(/\/\/+/g,`/`),we=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`);function Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var Ee=[`post`,`put`,`patch`,`delete`];new Set(Ee);var De=[`get`,...Ee];new Set(De);function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oe.apply(this,arguments)}var ke=w.createContext(null),Ae=w.createContext(null),je=w.createContext(null),Me=w.createContext(null),Ne=w.createContext({outlet:null,matches:[],isDataRoute:!1}),Pe=w.createContext(null);function Fe(){return w.useContext(Me)!=null}function Ie(){return!Fe()&&te(!1),w.useContext(Me).location}function Le(e,t){return Re(e,t)}function Re(e,t,n,r){!Fe()&&te(!1);let{navigator:i}=w.useContext(je),{matches:a}=w.useContext(Ne),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Ie(),u;if(t){let e=typeof t==`string`?M(t):t;!(c===`/`||e.pathname?.startsWith(c))&&te(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=oe(e,{pathname:f}),m=Ue(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Ce([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ce([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?w.createElement(Me.Provider,{value:{location:Oe({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:O.Pop}},m):m}function ze(){let e=Je(),t=Te(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return w.createElement(w.Fragment,null,w.createElement(`h2`,null,`Unexpected Application Error!`),w.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?w.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Be=w.createElement(ze,null),Ve=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:w.createElement(Ne.Provider,{value:this.props.routeContext},w.createElement(Pe.Provider,{value:this.state.error,children:this.props.component}))}};function He(e){let{routeContext:t,match:n,children:r}=e,i=w.useContext(ke);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Ne.Provider,{value:t},r)}function Ue(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]);!(e>=0)&&te(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||Be,s&&(c<0&&i===0?(Xe(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?w.createElement(r.route.Component,null):r.route.element?r.route.element:e,w.createElement(He,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?w.createElement(Ve,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var We=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(We||{});function Ge(e){let t=w.useContext(Ae);return!t&&te(!1),t}function Ke(e){let t=w.useContext(Ne);return!t&&te(!1),t}function qe(e){let t=Ke(e),n=t.matches[t.matches.length-1];return!n.route.id&&te(!1),n.route.id}function Je(){let e=w.useContext(Pe),t=Ge(We.UseRouteError),n=qe(We.UseRouteError);return e===void 0?t.errors?.[n]:e}var Ye={};function Xe(e,t,n){!t&&!Ye[e]&&(Ye[e]=!0)}w.startTransition;function Ze(e){te(!1)}function Qe(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=O.Pop,navigator:a,static:o=!1,future:s}=e;Fe()&&te(!1);let c=t.replace(/^\/*/,`/`),l=w.useMemo(()=>({basename:c,navigator:a,static:o,future:Oe({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=M(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=w.useMemo(()=>{let e=Se(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:w.createElement(je.Provider,{value:l},w.createElement(Me.Provider,{children:n,value:h}))}function $e(e){let{children:t,location:n}=e;return Le(tt(t),n)}var et=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(et||{});new Promise(()=>{}),w.Component;function tt(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(e,r)=>{if(!w.isValidElement(e))return;let i=[...t,r];if(e.type===w.Fragment){n.push.apply(n,tt(e.props.children,i));return}e.type!==Ze&&te(!1),!(!e.props.index||!e.props.children)&&te(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=tt(e.props.children,i)),n.push(a)}),n}var nt=`6`;try{window.__reactRouterVersion=nt}catch{}var rt=w.startTransition;T.flushSync,w.useId;function it(e){let{basename:t,children:n,future:r,window:i}=e,a=w.useRef();a.current??=ee({window:i,v5Compat:!0});let o=a.current,[s,c]=w.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=w.useCallback(e=>{l&&rt?rt(()=>c(e)):c(e)},[c,l]);return w.useLayoutEffect(()=>o.listen(u),[o,u]),w.createElement(Qe,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}typeof window<`u`&&window.document!==void 0&&window.document.createElement;var at;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(at||={});var ot;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(ot||={});var st=1,ct=1e6,lt=0;function ut(){return lt=(lt+1)%(2**53-1),lt.toString()}var dt=new Map,ft=e=>{if(dt.has(e))return;let t=setTimeout(()=>{dt.delete(e),gt({type:`REMOVE_TOAST`,toastId:e})},ct);dt.set(e,t)},pt=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,st)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?ft(n):e.toasts.forEach(e=>{ft(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},mt=[],ht={toasts:[]};function gt(e){ht=pt(ht,e),mt.forEach(e=>{e(ht)})}function _t({...e}){let t=ut(),n=e=>gt({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>gt({type:`DISMISS_TOAST`,toastId:t});return gt({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function vt(){let[e,t]=w.useState(ht);return w.useEffect(()=>(mt.push(t),()=>{let e=mt.indexOf(t);e>-1&&mt.splice(e,1)}),[e]),{...e,toast:_t,dismiss:e=>gt({type:`DISMISS_TOAST`,toastId:e})}}function yt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function bt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function xt(...e){return t=>{let n=!1,r=e.map(e=>{let r=bt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():bt(e[t],null)}}}}function St(...e){return w.useCallback(xt(...e),e)}var Ct=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=s(((e,t)=>{t.exports=Ct()}))();function wt(e,t=[]){let n=[];function r(t,r){let i=w.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=w.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=w.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>w.createContext(e));return function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Tt(i,...t)]}function Tt(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Et=w.forwardRef((e,t)=>{let{children:n,...r}=e,i=w.Children.toArray(n),a=i.find(kt);if(a){let e=a.props.children,n=i.map(t=>t===a?w.Children.count(e)>1?w.Children.only(null):w.isValidElement(e)?e.props.children:null:t);return(0,F.jsx)(Dt,{...r,ref:t,children:w.isValidElement(e)?w.cloneElement(e,void 0,n):null})}return(0,F.jsx)(Dt,{...r,ref:t,children:n})});Et.displayName=`Slot`;var Dt=w.forwardRef((e,t)=>{let{children:n,...r}=e;if(w.isValidElement(n)){let e=jt(n);return w.cloneElement(n,{...At(r,n.props),ref:t?xt(t,e):e})}return w.Children.count(n)>1?w.Children.only(null):null});Dt.displayName=`SlotClone`;var Ot=({children:e})=>(0,F.jsx)(F.Fragment,{children:e});function kt(e){return w.isValidElement(e)&&e.type===Ot}function At(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{a(...e),i(...e)}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function jt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mt(e){let t=e+`CollectionProvider`,[n,r]=wt(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,F.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=w.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,F.jsx)(Et,{ref:St(t,a(s,n).collectionRef),children:r})});c.displayName=s;let l=e+`CollectionItemSlot`,u=`data-radix-collection-item`,d=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=St(t,o),c=a(l,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,F.jsx)(Et,{[u]:``,ref:s,children:r})});d.displayName=l;function f(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:c,ItemSlot:d},f,r]}var Nt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w.forwardRef((e,n)=>{let{asChild:r,...i}=e,a=r?Et:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(a,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Pt(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}function Ft(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...e)=>t.current?.(...e),[])}function It(e,t=globalThis?.document){let n=Ft(e);w.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Lt=`DismissableLayer`,Rt=`dismissableLayer.update`,zt=`dismissableLayer.pointerDownOutside`,Bt=`dismissableLayer.focusOutside`,Vt,Ht=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ut=w.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=w.useContext(Ht),[u,d]=w.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=w.useState({}),m=St(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Kt(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=qt(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return It(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),w.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Vt=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Jt(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Vt)}},[u,f,n,l]),w.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Jt())},[u,l]),w.useEffect(()=>{let e=()=>p({});return document.addEventListener(Rt,e),()=>document.removeEventListener(Rt,e)},[]),(0,F.jsx)(Nt.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,S.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,x.onPointerDownCapture)})});Ut.displayName=Lt;var Wt=`DismissableLayerBranch`,Gt=w.forwardRef((e,t)=>{let n=w.useContext(Ht),r=w.useRef(null),i=St(t,r);return w.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,F.jsx)(Nt.div,{...e,ref:i})});Gt.displayName=Wt;function Kt(e,t=globalThis?.document){let n=Ft(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Yt(zt,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qt(e,t=globalThis?.document){let n=Ft(e),r=w.useRef(!1);return w.useEffect(()=>{let e=e=>{e.target&&!r.current&&Yt(Bt,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Jt(){let e=new CustomEvent(Rt);document.dispatchEvent(e)}function Yt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pt(i,a):i.dispatchEvent(a)}var Xt=Ut,Zt=Gt,Qt=globalThis?.document?w.useLayoutEffect:()=>{},$t=`Portal`,en=w.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=w.useState(!1);Qt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?T.createPortal((0,F.jsx)(Nt.div,{...r,ref:t}),o):null});en.displayName=$t;function tn(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}var nn=e=>{let{present:t,children:n}=e,r=rn(t),i=typeof n==`function`?n({present:r.isPresent}):w.Children.only(n),a=St(r.ref,on(i));return typeof n==`function`||r.isPresent?w.cloneElement(i,{ref:a}):null};nn.displayName=`Presence`;function rn(e){let[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),a=w.useRef(`none`),[o,s]=tn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return w.useEffect(()=>{let e=an(r.current);a.current=o===`mounted`?e:`none`},[o]),Qt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=an(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Qt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=an(r.current).includes(a.animationName);if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=an(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:w.useCallback(e=>{e&&(r.current=getComputedStyle(e)),n(e)},[])}}function an(e){return e?.animationName||`none`}function on(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function sn({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=cn({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Ft(n);return[o,w.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function cn({defaultProp:e,onChange:t}){let n=w.useState(e),[r]=n,i=w.useRef(r),a=Ft(t);return w.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}var ln=`VisuallyHidden`,un=w.forwardRef((e,t)=>(0,F.jsx)(Nt.span,{...e,ref:t,style:{position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`,...e.style}}));un.displayName=ln;var dn=`ToastProvider`,[fn,pn,mn]=Mt(`Toast`),[hn,gn]=wt(`Toast`,[mn]),[_n,vn]=hn(dn),yn=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(!1),f=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${dn}\`. Expected non-empty \`string\`.`),(0,F.jsx)(fn.Provider,{scope:t,children:(0,F.jsx)(_n,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:w.useCallback(()=>u(e=>e+1),[]),onToastRemove:w.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};yn.displayName=dn;var bn=`ToastViewport`,xn=[`F8`],Sn=`toast.viewportPause`,Cn=`toast.viewportResume`,wn=w.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=xn,label:i=`Notifications ({hotkey})`,...a}=e,o=vn(bn,n),s=pn(n),c=w.useRef(null),l=w.useRef(null),u=w.useRef(null),d=w.useRef(null),f=St(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;w.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),w.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(Sn);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Cn);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=w.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Zn(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return w.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Qn(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,F.jsxs)(Zt,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,F.jsx)(En,{ref:l,onFocusFromOutsideViewport:()=>{Qn(h({tabbingDirection:`forwards`}))}}),(0,F.jsx)(fn.Slot,{scope:n,children:(0,F.jsx)(Nt.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,F.jsx)(En,{ref:u,onFocusFromOutsideViewport:()=>{Qn(h({tabbingDirection:`backwards`}))}})]})});wn.displayName=bn;var Tn=`ToastFocusProxy`,En=w.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=vn(Tn,n);return(0,F.jsx)(un,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});En.displayName=Tn;var Dn=`Toast`,On=`toast.swipeStart`,kn=`toast.swipeMove`,An=`toast.swipeCancel`,jn=`toast.swipeEnd`,Mn=w.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s=!0,c]=sn({prop:r,defaultProp:i,onChange:a});return(0,F.jsx)(nn,{present:n||s,children:(0,F.jsx)(Fn,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Ft(e.onPause),onResume:Ft(e.onResume),onSwipeStart:yt(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:yt(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:yt(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:yt(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Mn.displayName=Dn;var[Nn,Pn]=hn(Dn,{onClose(){}}),Fn=w.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=vn(Dn,n),[g,_]=w.useState(null),v=St(t,e=>_(e)),y=w.useRef(null),b=w.useRef(null),x=i||h.duration,S=w.useRef(0),C=w.useRef(x),E=w.useRef(0),{onToastAdd:D,onToastRemove:O}=h,k=Ft(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),ee=w.useCallback(e=>{!e||e===1/0||(window.clearTimeout(E.current),S.current=new Date().getTime(),E.current=window.setTimeout(k,e))},[k]);w.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{ee(C.current),l?.()},n=()=>{let e=new Date().getTime()-S.current;C.current-=e,window.clearTimeout(E.current),c?.()};return e.addEventListener(Sn,n),e.addEventListener(Cn,t),()=>{e.removeEventListener(Sn,n),e.removeEventListener(Cn,t)}}},[h.viewport,x,c,l,ee]),w.useEffect(()=>{a&&!h.isClosePausedRef.current&&ee(x)},[a,x,h.isClosePausedRef,ee]),w.useEffect(()=>(D(),()=>O()),[D,O]);let te=w.useMemo(()=>g?Kn(g):null,[g]);return h.viewport?(0,F.jsxs)(F.Fragment,{children:[te&&(0,F.jsx)(In,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,"aria-atomic":!0,children:te}),(0,F.jsx)(Nn,{scope:n,onClose:k,children:T.createPortal((0,F.jsx)(fn.ItemSlot,{scope:n,children:(0,F.jsx)(Xt,{asChild:!0,onEscapeKeyDown:yt(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||k(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,F.jsx)(Nt.li,{role:`status`,"aria-live":`off`,"aria-atomic":!0,tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:yt(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:yt(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:yt(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!b.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(b.current=l,qn(kn,d,f,{discrete:!1})):Jn(l,h.swipeDirection,c)?(b.current=l,qn(On,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:yt(e.onPointerUp,e=>{let t=b.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),b.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Jn(t,h.swipeDirection,h.swipeThreshold)?qn(jn,p,r,{discrete:!0}):qn(An,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),In=e=>{let{__scopeToast:t,children:n,...r}=e,i=vn(Dn,t),[a,o]=w.useState(!1),[s,c]=w.useState(!1);return Yn(()=>o(!0)),w.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,F.jsx)(en,{asChild:!0,children:(0,F.jsx)(un,{...r,children:a&&(0,F.jsxs)(F.Fragment,{children:[i.label,` `,n]})})})},Ln=`ToastTitle`,Rn=w.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,F.jsx)(Nt.div,{...r,ref:t})});Rn.displayName=Ln;var zn=`ToastDescription`,Bn=w.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,F.jsx)(Nt.div,{...r,ref:t})});Bn.displayName=zn;var Vn=`ToastAction`,Hn=w.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,F.jsx)(Gn,{altText:n,asChild:!0,children:(0,F.jsx)(Wn,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Vn}\`. Expected non-empty \`string\`.`),null)});Hn.displayName=Vn;var Un=`ToastClose`,Wn=w.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Pn(Un,n);return(0,F.jsx)(Gn,{asChild:!0,children:(0,F.jsx)(Nt.button,{type:`button`,...r,ref:t,onClick:yt(e.onClick,i.onClose)})})});Wn.displayName=Un;var Gn=w.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,F.jsx)(Nt.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Kn(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Xn(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Kn(e))}}),t}function qn(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Pt(i,a):i.dispatchEvent(a)}var Jn=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Yn(e=()=>{}){let t=Ft(e);Qt(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Xn(e){return e.nodeType===e.ELEMENT_NODE}function Zn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qn(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var $n=yn,er=wn,tr=Mn,nr=Rn,rr=Bn,ir=Hn,ar=Wn;function or(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=or(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function sr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=or(e))&&(r&&(r+=` `),r+=t);return r}var cr=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,lr=sr,ur=(e,t)=>n=>{if(t?.variants==null)return lr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=cr(t)||cr(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return lr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},dr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),fr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),pr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},mr=(0,w.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,w.createElement)(`svg`,{ref:c,...pr,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:fr(`lucide`,i),...s},[...o.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(a)?a:[a]])),hr=((e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},i)=>(0,w.createElement)(mr,{ref:i,iconNode:t,className:fr(`lucide-${dr(e)}`,n),...r}));return n.displayName=`${e}`,n})(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),gr=`-`,_r=e=>{let t=xr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(gr);return n[0]===``&&n.length!==1&&n.shift(),vr(n,t)||br(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},vr=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?vr(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(gr);return t.validators.find(({validator:e})=>e(a))?.classGroupId},yr=/^\[(.+)\]$/,br=e=>{if(yr.test(e)){let t=yr.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},xr=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Tr(Object.entries(e.classGroups),n).forEach(([e,n])=>{Sr(n,r,e,t)}),r},Sr=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:Cr(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(wr(e)){Sr(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{Sr(i,Cr(t,e),n,r)})})},Cr=(e,t)=>{let n=e;return t.split(gr).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},wr=e=>e.isThemeGetter,Tr=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,Er=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},Dr=`!`,Or=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(Dr);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},kr=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Ar=e=>({cache:Er(e.cacheSize),parseClassName:Or(e),..._r(e)}),jr=/\s+/,Mr=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(jr),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=kr(c).join(`:`),h=l?m+Dr:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function Nr(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=Pr(t))&&(r&&(r+=` `),r+=n);return r}var Pr=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Pr(e[r]))&&(n&&(n+=` `),n+=t);return n};function Fr(e,...t){let n,r,i,a=o;function o(o){return n=Ar(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=Mr(e,n);return i(e,a),a}return function(){return a(Nr.apply(null,arguments))}}var Ir=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},Lr=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rr=/^\d+\/\d+$/,zr=new Set([`px`,`full`,`screen`]),Br=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ur=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gr=e=>qr(e)||zr.has(e)||Rr.test(e),Kr=e=>ai(e,`length`,oi),qr=e=>!!e&&!Number.isNaN(Number(e)),Jr=e=>ai(e,`number`,qr),Yr=e=>!!e&&Number.isInteger(Number(e)),Xr=e=>e.endsWith(`%`)&&qr(e.slice(0,-1)),I=e=>Lr.test(e),Zr=e=>Br.test(e),Qr=new Set([`length`,`size`,`percentage`]),$r=e=>ai(e,Qr,si),ei=e=>ai(e,`position`,si),ti=new Set([`image`,`url`]),ni=e=>ai(e,ti,li),ri=e=>ai(e,``,ci),ii=()=>!0,ai=(e,t,n)=>{let r=Lr.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},oi=e=>Vr.test(e)&&!Hr.test(e),si=()=>!1,ci=e=>Ur.test(e),li=e=>Wr.test(e),ui=Fr(()=>{let e=Ir(`colors`),t=Ir(`spacing`),n=Ir(`blur`),r=Ir(`brightness`),i=Ir(`borderColor`),a=Ir(`borderRadius`),o=Ir(`borderSpacing`),s=Ir(`borderWidth`),c=Ir(`contrast`),l=Ir(`grayscale`),u=Ir(`hueRotate`),d=Ir(`invert`),f=Ir(`gap`),p=Ir(`gradientColorStops`),m=Ir(`gradientColorStopPositions`),h=Ir(`inset`),g=Ir(`margin`),_=Ir(`opacity`),v=Ir(`padding`),y=Ir(`saturate`),b=Ir(`scale`),x=Ir(`sepia`),S=Ir(`skew`),C=Ir(`space`),w=Ir(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,I,t],O=()=>[I,t],k=()=>[``,Gr,Kr],ee=()=>[`auto`,qr,I],te=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],A=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],ne=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],ie=()=>[``,`0`,I],j=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],M=()=>[qr,I];return{cacheSize:500,separator:`:`,theme:{colors:[ii],spacing:[Gr,Kr],blur:[`none`,``,Zr,I],brightness:M(),borderColor:[e],borderRadius:[`none`,``,`full`,Zr,I],borderSpacing:O(),borderWidth:k(),contrast:M(),grayscale:ie(),hueRotate:M(),invert:ie(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Xr,Kr],inset:D(),margin:D(),opacity:M(),padding:O(),saturate:M(),scale:M(),sepia:ie(),skew:M(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,I]}],container:[`container`],columns:[{columns:[Zr]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...te(),I]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,Yr,I]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,I]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:[`first`,`last`,`none`,Yr,I]}],"grid-cols":[{"grid-cols":[ii]}],"col-start-end":[{col:[`auto`,{span:[`full`,Yr,I]},I]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ii]}],"row-start-end":[{row:[`auto`,{span:[Yr,I]},I]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,I]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,I]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...re()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...re(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...re(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,I,t]}],"min-w":[{"min-w":[I,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[I,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[Zr]},Zr]}],h:[{h:[I,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[I,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[I,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[I,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,Zr,Kr]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Jr]}],"font-family":[{font:[ii]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,I]}],"line-clamp":[{"line-clamp":[`none`,qr,Jr]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Gr,I]}],"list-image":[{"list-image":[`none`,I]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,I]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...A(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Gr,Kr]}],"underline-offset":[{"underline-offset":[`auto`,Gr,I]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,I]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,I]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...te(),ei]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,$r]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ni]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...A(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:A()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...A()]}],"outline-offset":[{"outline-offset":[Gr,I]}],"outline-w":[{outline:[Gr,Kr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Gr,Kr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,Zr,ri]}],"shadow-color":[{shadow:[ii]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...ne(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":ne()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,Zr,I]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,I]}],duration:[{duration:M()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,I]}],delay:[{delay:M()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,I]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Yr,I]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,I]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,I]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,I]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Gr,Kr,Jr]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function di(...e){return ui(sr(e))}var fi=$n,pi=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(er,{ref:n,className:di(`fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]`,e),...t}));pi.displayName=er.displayName;var mi=ur(`group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full`,{variants:{variant:{default:`border bg-background text-foreground`,destructive:`destructive group border-destructive bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),hi=w.forwardRef(({className:e,variant:t,...n},r)=>(0,F.jsx)(tr,{ref:r,className:di(mi({variant:t}),e),...n}));hi.displayName=tr.displayName;var gi=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(ir,{ref:n,className:di(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive`,e),...t}));gi.displayName=ir.displayName;var _i=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(ar,{ref:n,className:di(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,F.jsx)(hr,{className:`h-4 w-4`})}));_i.displayName=ar.displayName;var vi=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(nr,{ref:n,className:di(`text-sm font-semibold`,e),...t}));vi.displayName=nr.displayName;var yi=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(rr,{ref:n,className:di(`text-sm opacity-90`,e),...t}));yi.displayName=rr.displayName;function bi(){let{toasts:e}=vt();return(0,F.jsxs)(fi,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,F.jsxs)(hi,{...i,children:[(0,F.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,F.jsx)(vi,{children:t}),n&&(0,F.jsx)(yi,{children:n})]}),r,(0,F.jsx)(_i,{})]},e)}),(0,F.jsx)(pi,{})]})}var xi,Si=o((()=>{xi=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0}));function Ci(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function wi(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function Ti(e,...t){if(!Ci(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function Ei(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);wi(e.outputLen),wi(e.blockLen)}function Di(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Oi(e,t){Ti(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function ki(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ai(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ji(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function L(e,t){return e<<32-t|e>>>t}function Mi(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Ni(e){for(let t=0;t<e.length;t++)e[t]=Mi(e[t]);return e}function Pi(e){if(Ti(e),Gi)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Ki[e[n]];return t}function Fi(e){if(e>=qi._0&&e<=qi._9)return e-qi._0;if(e>=qi.A&&e<=qi.F)return e-(qi.A-10);if(e>=qi.a&&e<=qi.f)return e-(qi.a-10)}function Ii(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(Gi)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Fi(e.charCodeAt(i)),a=Fi(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function Li(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function Ri(e){return typeof e==`string`&&(e=Li(e)),Ti(e),e}function zi(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];Ti(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function Bi(e){let t=t=>e().update(Ri(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Vi(e){let t=(t,n)=>e(n).update(Ri(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function Hi(e=32){if(xi&&typeof xi.getRandomValues==`function`)return xi.getRandomValues(new Uint8Array(e));if(xi&&typeof xi.randomBytes==`function`)return Uint8Array.from(xi.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}var Ui,Wi,Gi,Ki,qi,Ji,Yi=o((()=>{Si(),Ui=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Wi=Ui?e=>e:Ni,Gi=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Ki=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)),qi={_0:48,_9:57,A:65,F:70,a:97,f:102},Ji=class{}}));function Xi(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Zi(e,t,n){return e&t^~e&n}function Qi(e,t,n){return e&t^e&n^t&n}var $i,ea,ta,na=o((()=>{Yi(),$i=class extends Ji{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=ji(this.buffer)}update(e){Di(this),e=Ri(e),Ti(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=ji(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Di(this),Oi(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,Ai(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Xi(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=ji(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},ea=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ta=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])}));function ra(e,t=!1){return t?{h:Number(e&oa),l:Number(e>>sa&oa)}:{h:Number(e>>sa&oa)|0,l:Number(e&oa)|0}}function ia(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=ra(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}function aa(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa=o((()=>{oa=BigInt(2**32-1),sa=BigInt(32),ca=(e,t,n)=>e>>>n,la=(e,t,n)=>e<<32-n|t>>>n,ua=(e,t,n)=>e>>>n|t<<32-n,da=(e,t,n)=>e<<32-n|t>>>n,fa=(e,t,n)=>e<<64-n|t>>>n-32,pa=(e,t,n)=>e>>>n-32|t<<64-n,ma=(e,t,n)=>e<<n|t>>>32-n,ha=(e,t,n)=>t<<n|e>>>32-n,ga=(e,t,n)=>t<<n-32|e>>>64-n,_a=(e,t,n)=>e<<n-32|t>>>64-n,va=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),ya=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,ba=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),xa=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,Sa=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Ca=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0})),Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia=o((()=>{na(),wa(),Yi(),Ta=Uint32Array.from([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]),Ea=new Uint32Array(64),Da=class extends $i{constructor(e=32){super(64,e,8,!1),this.A=ea[0]|0,this.B=ea[1]|0,this.C=ea[2]|0,this.D=ea[3]|0,this.E=ea[4]|0,this.F=ea[5]|0,this.G=ea[6]|0,this.H=ea[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Ea[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Ea[e-15],n=Ea[e-2],r=L(t,7)^L(t,18)^t>>>3;Ea[e]=(L(n,17)^L(n,19)^n>>>10)+Ea[e-7]+r+Ea[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=L(o,6)^L(o,11)^L(o,25),u=l+t+Zi(o,s,c)+Ta[e]+Ea[e]|0,d=(L(n,2)^L(n,13)^L(n,22))+Qi(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){Ai(Ea)}destroy(){this.set(0,0,0,0,0,0,0,0),Ai(this.buffer)}},Oa=ia(`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`.split(`.`).map(e=>BigInt(e))),ka=Oa[0],Aa=Oa[1],ja=new Uint32Array(80),Ma=new Uint32Array(80),Na=class extends $i{constructor(e=64){super(128,e,16,!1),this.Ah=ta[0]|0,this.Al=ta[1]|0,this.Bh=ta[2]|0,this.Bl=ta[3]|0,this.Ch=ta[4]|0,this.Cl=ta[5]|0,this.Dh=ta[6]|0,this.Dl=ta[7]|0,this.Eh=ta[8]|0,this.El=ta[9]|0,this.Fh=ta[10]|0,this.Fl=ta[11]|0,this.Gh=ta[12]|0,this.Gl=ta[13]|0,this.Hh=ta[14]|0,this.Hl=ta[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)ja[n]=e.getUint32(t),Ma[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=ja[e-15]|0,n=Ma[e-15]|0,r=ua(t,n,1)^ua(t,n,8)^ca(t,n,7),i=da(t,n,1)^da(t,n,8)^la(t,n,7),a=ja[e-2]|0,o=Ma[e-2]|0,s=ua(a,o,19)^fa(a,o,61)^ca(a,o,6),c=da(a,o,19)^pa(a,o,61)^la(a,o,6),l=ba(i,c,Ma[e-7],Ma[e-16]);ja[e]=xa(l,r,s,ja[e-7],ja[e-16])|0,Ma[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=ua(u,d,14)^ua(u,d,18)^fa(u,d,41),v=da(u,d,14)^da(u,d,18)^pa(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=Sa(_,v,b,Aa[e],Ma[e]),S=Ca(x,g,t,y,ka[e],ja[e]),C=x|0,w=ua(n,r,28)^fa(n,r,34)^fa(n,r,39),T=da(n,r,28)^pa(n,r,34)^pa(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=aa(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=va(C,T,D);n=ya(O,S,w,E),r=O|0}({h:n,l:r}=aa(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=aa(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=aa(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=aa(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=aa(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=aa(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=aa(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=aa(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){Ai(ja,Ma)}destroy(){Ai(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Pa=Bi(()=>new Da),Fa=Bi(()=>new Na)}));function La(e,t=``){if(typeof e!=`boolean`){let n=t&&`"${t}"`;throw Error(n+`expected boolean, got type=`+typeof e)}return e}function Ra(e,t,n=``){let r=Ci(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}function za(e){let t=e.toString(16);return t.length&1?`0`+t:t}function Ba(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?eo:BigInt(`0x`+e)}function Va(e){return Ba(Pi(e))}function Ha(e){return Ti(e),Ba(Pi(Uint8Array.from(e).reverse()))}function Ua(e,t){return Ii(e.toString(16).padStart(t*2,`0`))}function Wa(e,t){return Ua(e,t).reverse()}function Ga(e,t,n){let r;if(typeof t==`string`)try{r=Ii(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(Ci(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function Ka(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function R(e){return Uint8Array.from(e)}function qa(e,t,n){return no(e)&&no(t)&&no(n)&&t<=e&&e<n}function Ja(e,t,n,r){if(!qa(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function Ya(e){let t;for(t=0;e>eo;e>>=to,t+=1);return t}function Xa(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),a=r(e),o=r(e),s=0,c=()=>{a.fill(1),o.fill(0),s=0},l=(...e)=>n(o,a,...e),u=(e=r(0))=>{o=l(i(0),e),a=l(),e.length!==0&&(o=l(i(1),e),a=l())},d=()=>{if(s++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){a=l();let t=a.slice();n.push(t),e+=a.length}return zi(...n)};return(e,t)=>{c(),u(e);let n;for(;!(n=t(d()));)u();return c(),n}}function Za(e){return typeof e==`function`&&Number.isSafeInteger(e.outputLen)}function Qa(e,t,n={}){if(!e||typeof e!=`object`)throw Error(`expected valid options object`);function r(t,n,r){let i=e[t];if(r&&i===void 0)return;let a=typeof i;if(a!==n||i===null)throw Error(`param "${t}" is invalid: expected ${n}, got ${a}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function $a(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}var eo,to,no,ro,io,ao=o((()=>{Yi(),eo=BigInt(0),to=BigInt(1),no=e=>typeof e==`bigint`&&eo<=e,ro=e=>(to<<BigInt(e))-to,io=()=>{throw Error(`not implemented`)}}));function oo(e,t){let n=e%t;return n>=Eo?n:t+n}function so(e,t,n){let r=e;for(;t-- >Eo;)r*=r,r%=n;return r}function co(e,t){if(e===Eo)throw Error(`invert: expected non-zero number`);if(t<=Eo)throw Error(`invert: expected positive modulus, got `+t);let n=oo(e,t),r=t,i=Eo,a=Do,o=Do,s=Eo;for(;n!==Eo;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==Do)throw Error(`invert: does not exist`);return oo(i,t)}function lo(e,t,n){if(!e.eql(e.sqr(t),n))throw Error(`Cannot find square root`)}function uo(e,t){let n=(e.ORDER+Do)/Ao,r=e.pow(t,n);return lo(e,r,t),r}function fo(e,t){let n=(e.ORDER-jo)/No,r=e.mul(t,Oo),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,Oo),i),s=e.mul(a,e.sub(o,e.ONE));return lo(e,s,t),s}function po(e){let t=xo(e),n=mo(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+Mo)/Fo;return(e,t)=>{let n=e.pow(t,o),s=e.mul(n,r),c=e.mul(n,i),l=e.mul(n,a),u=e.eql(e.sqr(s),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,s,u),s=e.cmov(l,c,d);let f=e.eql(e.sqr(s),t),p=e.cmov(n,s,f);return lo(e,p,t),p}}function mo(e){if(e<ko)throw Error(`sqrt is not defined for small field`);let t=e-Do,n=0;for(;t%Oo===Eo;)t/=Oo,n++;let r=Oo,i=xo(e);for(;yo(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return uo;let a=i.pow(r,t),o=(t+Do)/Oo;return function(e,r){if(e.is0(r))return r;if(yo(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=Do<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function ho(e){return e%Ao===ko?uo:e%No===jo?fo:e%Fo===Po?po(e):mo(e)}function go(e){return Qa(e,Lo.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`number`,BITS:`number`})),e}function _o(e,t,n){if(n<Eo)throw Error(`invalid exponent, negatives unsupported`);if(n===Eo)return e.ONE;if(n===Do)return t;let r=e.ONE,i=t;for(;n>Eo;)n&Do&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Do;return r}function vo(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function yo(e,t){let n=(e.ORDER-Do)/Oo,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function bo(e,t){t!==void 0&&wi(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function xo(e,t,n=!1,r={}){if(e<=Eo)throw Error(`invalid field: expected ORDER > 0, got `+e);let i,a,o=!1,s;if(typeof t==`object`&&t){if(r.sqrt||n)throw Error(`cannot specify opts in two arguments`);let e=t;e.BITS&&(i=e.BITS),e.sqrt&&(a=e.sqrt),typeof e.isLE==`boolean`&&(n=e.isLE),typeof e.modFromBytes==`boolean`&&(o=e.modFromBytes),s=e.allowedLengths}else typeof t==`number`&&(i=t),r.sqrt&&(a=r.sqrt);let{nBitLength:c,nByteLength:l}=bo(e,i);if(l>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let u,d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:ro(c),ZERO:Eo,ONE:Do,allowedLengths:s,create:t=>oo(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return Eo<=t&&t<e},is0:e=>e===Eo,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&Do)===Do,neg:t=>oo(-t,e),eql:(e,t)=>e===t,sqr:t=>oo(t*t,e),add:(t,n)=>oo(t+n,e),sub:(t,n)=>oo(t-n,e),mul:(t,n)=>oo(t*n,e),pow:(e,t)=>_o(d,e,t),div:(t,n)=>oo(t*co(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>co(t,e),sqrt:a||(t=>(u||=ho(e),u(d,t))),toBytes:e=>n?Wa(e,l):Ua(e,l),fromBytes:(t,r=!0)=>{if(s){if(!s.includes(t.length)||t.length>l)throw Error(`Field.fromBytes: expected `+s+` bytes, got `+t.length);let e=new Uint8Array(l);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==l)throw Error(`Field.fromBytes: expected `+l+` bytes, got `+t.length);let i=n?Ha(t):Va(t);if(o&&(i=oo(i,e)),!r&&!d.isValid(i))throw Error(`invalid field element: outside of range 0..ORDER`);return i},invertBatch:e=>vo(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function So(e,t){if(!e.isOdd)throw Error(`Field doesn't have isOdd`);let n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n}function Co(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function wo(e){let t=Co(e);return t+Math.ceil(t/2)}function To(e,t,n=!1){let r=e.length,i=Co(t),a=wo(t);if(r<16||r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=oo(n?Ha(e):Va(e),t-Do)+Do;return n?Wa(o,i):Ua(o,i)}var Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro=o((()=>{ao(),Eo=BigInt(0),Do=BigInt(1),Oo=BigInt(2),ko=BigInt(3),Ao=BigInt(4),jo=BigInt(5),Mo=BigInt(7),No=BigInt(8),Po=BigInt(9),Fo=BigInt(16),Io=(e,t)=>(oo(e,t)&Do)===Do,Lo=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`]}));function zo(e,t){let n=t.negate();return e?n:t}function Bo(e,t){let n=vo(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function Vo(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function Ho(e,t){Vo(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:ro(e),maxNumber:i,shiftBy:BigInt(e)}}function Uo(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=$o);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function Wo(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function Go(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}function Ko(e){return ts.get(e)||1}function qo(e){if(e!==Qo)throw Error(`invalid wNAF`)}function Jo(e,t,n,r){let i=t,a=e.ZERO,o=e.ZERO;for(;n>Qo||r>Qo;)n&$o&&(a=a.add(i)),r&$o&&(o=o.add(i)),i=i.double(),n>>=$o,r>>=$o;return{p1:a,p2:o}}function Yo(e,t,n,r){Wo(n,e),Go(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=Ya(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=ro(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function Xo(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return go(t),t}else return xo(e,{isLE:n})}function Zo(e,t,n={},r){if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(typeof n==`bigint`&&n>Qo))throw Error(`CURVE.${e} must be positive bigint`)}let i=Xo(t.p,n.Fp,r),a=Xo(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}var Qo,$o,es,ts,ns,rs=o((()=>{ao(),Ro(),Qo=BigInt(0),$o=BigInt(1),es=new WeakMap,ts=new WeakMap,ns=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>Qo;)t&$o&&(n=n.add(r)),r=r.double(),t>>=$o;return n}precomputeWindow(e,t){let{windows:n,windowSize:r}=Ho(t,this.bits),i=[],a=e,o=a;for(let e=0;e<n;e++){o=a,i.push(o);for(let e=1;e<r;e++)o=o.add(a),i.push(o);a=o.double()}return i}wNAF(e,t,n){if(!this.Fn.isValid(n))throw Error(`invalid scalar`);let r=this.ZERO,i=this.BASE,a=Ho(e,this.bits);for(let e=0;e<a.windows;e++){let{nextN:o,offset:s,isZero:c,isNeg:l,isNegF:u,offsetF:d}=Uo(n,e,a);n=o,c?i=i.add(zo(u,t[d])):r=r.add(zo(l,t[s]))}return qo(n),{p:r,f:i}}wNAFUnsafe(e,t,n,r=this.ZERO){let i=Ho(e,this.bits);for(let e=0;e<i.windows&&n!==Qo;e++){let{nextN:a,offset:o,isZero:s,isNeg:c}=Uo(n,e,i);if(n=a,!s){let e=t[o];r=r.add(c?e.negate():e)}}return qo(n),r}getPrecomputes(e,t,n){let r=es.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&(typeof n==`function`&&(r=n(r)),es.set(t,r))),r}cached(e,t,n){let r=Ko(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){let i=Ko(e);return i===1?this._unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)}createCache(e,t){Vo(t,this.bits),ts.set(e,t),es.delete(e)}hasCache(e){return Ko(e)!==1}}}));function is(e,t,n,r){let i=e.sqr(n),a=e.sqr(r),o=e.add(e.mul(t.a,i),a),s=e.add(e.ONE,e.mul(t.d,e.mul(i,a)));return e.eql(o,s)}function as(e,t={}){let n=Zo(`edwards`,e,t,t.FpFnLE),{Fp:r,Fn:i}=n,a=n.CURVE,{h:o}=a;Qa(t,{},{uvRatio:`function`});let s=fs<<BigInt(i.BYTES*8)-ds,c=e=>r.create(e),l=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(r.div(e,t))}}catch{return{isValid:!1,value:us}}});if(!is(r,a,a.Gx,a.Gy))throw Error(`bad curve params: generator point`);function u(e,t,n=!1){let r=n?ds:us;return Ja(`coordinate `+e,t,r,s),t}function d(e){if(!(e instanceof m))throw Error(`ExtendedPoint expected`)}let f=$a((e,t)=>{let{X:n,Y:i,Z:a}=e,o=e.is0();t??=o?ps:r.inv(a);let s=c(n*t),l=c(i*t),u=r.mul(a,t);if(o)return{x:us,y:ds};if(u!==ds)throw Error(`invZ was invalid`);return{x:s,y:l}}),p=$a(e=>{let{a:t,d:n}=a;if(e.is0())throw Error(`bad point: ZERO`);let{X:r,Y:i,Z:o,T:s}=e,l=c(r*r),u=c(i*i),d=c(o*o),f=c(d*d);if(c(d*c(c(l*t)+u))!==c(f+c(n*c(l*u))))throw Error(`bad point: equation left != right (1)`);if(c(r*i)!==c(o*s))throw Error(`bad point: equation left != right (2)`);return!0});class m{constructor(e,t,n,r){this.X=u(`x`,e),this.Y=u(`y`,t),this.Z=u(`z`,n,!0),this.T=u(`t`,r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){if(e instanceof m)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return u(`x`,t),u(`y`,n),new m(t,n,ds,c(t*n))}static fromBytes(e,t=!1){let n=r.BYTES,{a:i,d:o}=a;e=R(Ra(e,n,`point`)),La(t,`zip215`);let u=R(e),d=e[n-1];u[n-1]=d&-129;let f=Ha(u);Ja(`point.y`,f,us,t?s:r.ORDER);let p=c(f*f),{isValid:h,value:g}=l(c(p-ds),c(o*p-i));if(!h)throw Error(`bad point: invalid y coordinate`);let _=(g&ds)===ds,v=(d&128)!=0;if(!t&&g===us&&v)throw Error(`bad point: x=0 and x_0=1`);return v!==_&&(g=c(-g)),m.fromAffine({x:g,y:f})}static fromHex(e,t=!1){return m.fromBytes(Ga(`point`,e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return h.createCache(this,e),t||this.multiply(fs),this}assertValidity(){p(this)}equals(e){d(e);let{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:o}=e,s=c(t*o),l=c(i*r),u=c(n*o),f=c(a*r);return s===l&&u===f}is0(){return this.equals(m.ZERO)}negate(){return new m(c(-this.X),this.Y,this.Z,c(-this.T))}double(){let{a:e}=a,{X:t,Y:n,Z:r}=this,i=c(t*t),o=c(n*n),s=c(fs*c(r*r)),l=c(e*i),u=t+n,d=c(c(u*u)-i-o),f=l+o,p=f-s,h=l-o,g=c(d*p),_=c(f*h),v=c(d*h);return new m(g,_,c(p*f),v)}add(e){d(e);let{a:t,d:n}=a,{X:r,Y:i,Z:o,T:s}=this,{X:l,Y:u,Z:f,T:p}=e,h=c(r*l),g=c(i*u),_=c(s*n*p),v=c(o*f),y=c((r+i)*(l+u)-h-g),b=v-_,x=v+_,S=c(g-t*h),C=c(y*b),w=c(x*S),T=c(y*S);return new m(C,w,c(b*x),T)}subtract(e){return this.add(e.negate())}multiply(e){if(!i.isValidNot0(e))throw Error(`invalid scalar: expected 1 <= sc < curve.n`);let{p:t,f:n}=h.cached(this,e,e=>Bo(m,e));return Bo(m,[t,n])[0]}multiplyUnsafe(e,t=m.ZERO){if(!i.isValid(e))throw Error(`invalid scalar: expected 0 <= sc < curve.n`);return e===us?m.ZERO:this.is0()||e===ds?this:h.unsafe(this,e,e=>Bo(m,e),t)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}isTorsionFree(){return h.unsafe(this,a.n).is0()}toAffine(e){return f(this,e)}clearCofactor(){return o===ds?this:this.multiplyUnsafe(o)}toBytes(){let{x:e,y:t}=this.toAffine(),n=r.toBytes(t);return n[n.length-1]|=e&ds?128:0,n}toHex(){return Pi(this.toBytes())}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return Bo(m,e)}static msm(e,t){return Yo(m,i,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}m.BASE=new m(a.Gx,a.Gy,ds,c(a.Gx*a.Gy)),m.ZERO=new m(us,ds,ds,us),m.Fp=r,m.Fn=i;let h=new ns(m,i.BITS);return m.BASE.precompute(8),m}function os(e,t,n={}){if(typeof t!=`function`)throw Error(`"hash" function param is required`);Qa(n,{},{adjustScalarBytes:`function`,randomBytes:`function`,domain:`function`,prehash:`function`,mapToCurve:`function`});let{prehash:r}=n,{BASE:i,Fp:a,Fn:o}=e,s=n.randomBytes||Hi,c=n.adjustScalarBytes||(e=>e),l=n.domain||((e,t,n)=>{if(La(n,`phflag`),t.length||n)throw Error(`Contexts/pre-hash are not supported`);return e});function u(e){return o.create(Ha(e))}function d(e){let n=y.secretKey;e=Ga(`private key`,e,n);let r=Ga(`hashed private key`,t(e),2*n),i=c(r.slice(0,n));return{head:i,prefix:r.slice(n,2*n),scalar:u(i)}}function f(e){let{head:t,prefix:n,scalar:r}=d(e),a=i.multiply(r);return{head:t,prefix:n,scalar:r,point:a,pointBytes:a.toBytes()}}function p(e){return f(e).pointBytes}function m(e=Uint8Array.of(),...n){return u(t(l(zi(...n),Ga(`context`,e),!!r)))}function h(e,t,n={}){e=Ga(`message`,e),r&&(e=r(e));let{prefix:a,scalar:s,pointBytes:c}=f(t),l=m(n.context,a,e),u=i.multiply(l).toBytes(),d=m(n.context,u,c,e),p=o.create(l+d*s);if(!o.isValid(p))throw Error(`sign failed: invalid s`);return Ra(zi(u,o.toBytes(p)),y.signature,`result`)}let g={zip215:!0};function _(t,n,a,o=g){let{context:s,zip215:c}=o,l=y.signature;t=Ga(`signature`,t,l),n=Ga(`message`,n),a=Ga(`publicKey`,a,y.publicKey),c!==void 0&&La(c,`zip215`),r&&(n=r(n));let u=l/2,d=t.subarray(0,u),f=Ha(t.subarray(u,l)),p,h,_;try{p=e.fromBytes(a,c),h=e.fromBytes(d,c),_=i.multiplyUnsafe(f)}catch{return!1}if(!c&&p.isSmallOrder())return!1;let v=m(s,h.toBytes(),p.toBytes(),n);return h.add(p.multiplyUnsafe(v)).subtract(_).clearCofactor().is0()}let v=a.BYTES,y={secretKey:v,publicKey:v,signature:2*v,seed:v};function b(e=s(y.seed)){return Ra(e,y.seed,`seed`)}function x(e){let t=w.randomSecretKey(e);return{secretKey:t,publicKey:p(t)}}function S(e){return Ci(e)&&e.length===o.BYTES}function C(t,n){try{return!!e.fromBytes(t,n)}catch{return!1}}let w={getExtendedPublicKey:f,randomSecretKey:b,isValidSecretKey:S,isValidPublicKey:C,toMontgomery(t){let{y:n}=e.fromBytes(t),r=y.publicKey,i=r===32;if(!i&&r!==57)throw Error(`only defined for 25519 and 448`);let o=i?a.div(ds+n,ds-n):a.div(n-ds,n+ds);return a.toBytes(o)},toMontgomerySecret(e){let n=y.secretKey;return Ra(e,n),c(t(e.subarray(0,n))).subarray(0,n)},randomPrivateKey:b,precompute(t=8,n=e.BASE){return n.precompute(t,!1)}};return Object.freeze({keygen:x,getPublicKey:p,sign:h,verify:_,utils:w,Point:e,lengths:y})}function ss(e){let t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n={Fp:e.Fp,Fn:xo(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},r={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:n,hash:e.hash,eddsaOpts:r}}function cs(e,t){let n=t.Point;return Object.assign({},t,{ExtendedPoint:n,CURVE:e,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function ls(e){let{CURVE:t,curveOpts:n,hash:r,eddsaOpts:i}=ss(e);return cs(e,os(as(t,n),r,i))}var us,ds,fs,ps,ms,hs=o((()=>{ao(),rs(),Ro(),us=BigInt(0),ds=BigInt(1),fs=BigInt(2),ps=BigInt(8),ms=class{constructor(e){this.ep=e}static fromBytes(e){io()}static fromHex(e){io()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return Pi(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}}));function gs(e,t){if(vs(e),vs(t),e<0||e>=1<<8*t)throw Error(`invalid I2OSP input: `+e);let n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=e&255,e>>>=8;return new Uint8Array(n)}function _s(e,t){let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function vs(e){if(!Number.isSafeInteger(e))throw Error(`number expected`)}function ys(e){if(!Ci(e)&&typeof e!=`string`)throw Error(`DST must be Uint8Array or string`);return typeof e==`string`?Li(e):e}function bs(e,t,n,r){Ti(e),vs(n),t=ys(t),t.length>255&&(t=r(zi(Li(`H2C-OVERSIZE-DST-`),t)));let{outputLen:i,blockLen:a}=r,o=Math.ceil(n/i);if(n>65535||o>255)throw Error(`expand_message_xmd: invalid lenInBytes`);let s=zi(t,gs(t.length,1)),c=gs(0,a),l=gs(n,2),u=Array(o),d=r(zi(c,e,l,gs(0,1),s));u[0]=r(zi(d,gs(1,1),s));for(let e=1;e<=o;e++)u[e]=r(zi(_s(d,u[e-1]),gs(e+1,1),s));return zi(...u).slice(0,n)}function xs(e,t,n,r,i){if(Ti(e),vs(n),t=ys(t),t.length>255){let e=Math.ceil(2*r/8);t=i.create({dkLen:e}).update(Li(`H2C-OVERSIZE-DST-`)).update(t).digest()}if(n>65535||t.length>255)throw Error(`expand_message_xof: invalid lenInBytes`);return i.create({dkLen:n}).update(e).update(gs(n,2)).update(t).update(gs(t.length,1)).digest()}function Ss(e,t,n){Qa(n,{p:`bigint`,m:`number`,k:`number`,hash:`function`});let{p:r,k:i,m:a,hash:o,expand:s,DST:c}=n;if(!Za(n.hash))throw Error(`expected valid hash`);Ti(e),vs(t);let l=r.toString(2).length,u=Math.ceil((l+i)/8),d=t*a*u,f;if(s===`xmd`)f=bs(e,c,d,o);else if(s===`xof`)f=xs(e,c,d,i,o);else if(s===`_internal_pass`)f=e;else throw Error(`expand must be "xmd" or "xof"`);let p=Array(t);for(let e=0;e<t;e++){let t=Array(a);for(let n=0;n<a;n++){let i=u*(n+e*a);t[n]=oo(Ts(f.subarray(i,i+u)),r)}p[e]=t}return p}function Cs(e,t){let n=t.map(e=>Array.from(e).reverse());return(t,r)=>{let[i,a,o,s]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r))),[c,l]=vo(e,[a,s],!0);return t=e.mul(i,c),r=e.mul(r,e.mul(o,l)),{x:t,y:r}}}function ws(e,t,n){if(typeof t!=`function`)throw Error(`mapToCurve() must be defined`);function r(n){return e.fromAffine(t(n))}function i(t){let n=t.clearCofactor();return n.equals(e.ZERO)?e.ZERO:(n.assertValidity(),n)}return{defaults:n,hashToCurve(e,t){let a=Ss(e,2,Object.assign({},n,t)),o=r(a[0]),s=r(a[1]);return i(o.add(s))},encodeToCurve(e,t){let a=n.encodeDST?{DST:n.encodeDST}:{};return i(r(Ss(e,1,Object.assign({},n,a,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw Error(`expected array of bigints`);for(let t of e)if(typeof t!=`bigint`)throw Error(`expected array of bigints`);return i(r(e))},hashToScalar(t,r){let i=e.Fn.ORDER;return Ss(t,1,Object.assign({},n,{p:i,m:1,DST:Es},r))[0][0]}}}var Ts,Es,Ds=o((()=>{ao(),Ro(),Ts=Va,Es=Li(`HashToScalar-`)}));function Os(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=Hs,o=e*e%a*e%a,s=so(so(o,Rs,a)*o%a,Ls,a)*e%a,c=so(s,Bs,a)*s%a,l=so(c,t,a)*c%a,u=so(l,n,a)*l%a,d=so(u,r,a)*u%a;return{pow_p_5_8:so(so(so(so(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,Rs,a)*e%a,b2:o}}function ks(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function As(e,t){let n=Hs,r=oo(t*t*t,n),i=Os(e*oo(r*r*t,n)).pow_p_5_8,a=oo(e*r*i,n),o=oo(t*a*a,n),s=a,c=oo(a*Ws,n),l=o===e,u=o===oo(-e,n),d=o===oo(-e*Ws,n);return l&&(a=s),(u||d)&&(a=c),Io(a,n)&&(a=oo(-a,n)),{isValid:l||u,value:a}}function js(e,t,n){if(t.length>255)throw Error(`Context is too big`);return zi(Li(`SigEd25519 no Ed25519 collisions`),new Uint8Array([+!!n,t.length]),t,e)}function Ms(e){let t=(Hs-Bs)/Vs,n=BigInt(486662),r=z.sqr(e);r=z.mul(r,Rs);let i=z.add(r,z.ONE),a=z.neg(n),o=z.sqr(i),s=z.mul(o,i),c=z.mul(r,n);c=z.mul(c,a),c=z.add(c,o),c=z.mul(c,a);let l=z.sqr(s);o=z.sqr(l),l=z.mul(l,s),l=z.mul(l,c),o=z.mul(o,l);let u=z.pow(o,t);u=z.mul(u,l);let d=z.mul(u,Xs);o=z.sqr(u),o=z.mul(o,s);let f=z.eql(o,c),p=z.cmov(d,u,f),m=z.mul(a,r),h=z.mul(u,e);h=z.mul(h,Ys);let g=z.mul(h,Xs),_=z.mul(c,r);o=z.sqr(h),o=z.mul(o,s);let v=z.eql(o,_),y=z.cmov(g,h,v);o=z.sqr(p),o=z.mul(o,s);let b=z.eql(o,c),x=z.cmov(m,a,b),S=z.cmov(y,p,b),C=z.isOdd(S);return S=z.cmov(S,z.neg(S),b!==C),{xMn:x,xMd:i,yMn:S,yMd:Ls}}function Ns(e){let{xMn:t,xMd:n,yMn:r,yMd:i}=Ms(e),a=z.mul(t,i);a=z.mul(a,Zs);let o=z.mul(n,r),s=z.sub(t,n),c=z.add(t,n),l=z.mul(o,c),u=z.eql(l,z.ZERO);a=z.cmov(a,z.ZERO,u),o=z.cmov(o,z.ONE,u),s=z.cmov(s,z.ONE,u),c=z.cmov(c,z.ONE,u);let[d,f]=vo(z,[o,c],!0);return{x:z.mul(a,d),y:z.mul(s,f)}}function Ps(e){let{d:t}=Us,n=Hs,r=e=>z.create(e),i=r($s*e*e),a=r((i+Ls)*nc),o=BigInt(-1),s=r((o-t*i)*r(i+t)),{isValid:c,value:l}=As(a,s),u=r(l*e);Io(u,n)||(u=r(-u)),c||(l=u),c||(o=i);let d=r(o*(i-Ls)*rc-s),f=l*l,p=r((l+l)*s),m=r(d*ec),h=r(Ls-f),g=r(Ls+f);return new qs.Point(r(p*g),r(h*m),r(m*g),r(p*h))}function Fs(e){Ti(e,64);let t=Ps(oc(e.subarray(0,32))),n=Ps(oc(e.subarray(32,64)));return new sc(t.add(n))}var Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,z,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc=o((()=>{Ia(),Yi(),rs(),hs(),Ds(),Ro(),ao(),Is=BigInt(0),Ls=BigInt(1),Rs=BigInt(2),zs=BigInt(3),Bs=BigInt(5),Vs=BigInt(8),Hs=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),Us={p:Hs,n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:Vs,a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)},Ws=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`),z=xo(Us.p,{isLE:!0}),Gs=xo(Us.n,{isLE:!0}),Ks={...Us,Fp:z,hash:Fa,adjustScalarBytes:ks,uvRatio:As},qs=ls(Ks),ls({...Ks,domain:js}),ls(Object.assign({},Ks,{domain:js,prehash:Fa})),Js=(Hs+zs)/Vs,Ys=z.pow(Rs,Js),Xs=z.sqrt(z.neg(z.ONE)),Zs=So(z,z.neg(BigInt(486664))),Qs=ws(qs.Point,e=>Ns(e[0]),{DST:`edwards25519_XMD:SHA-512_ELL2_RO_`,encodeDST:`edwards25519_XMD:SHA-512_ELL2_NU_`,p:Hs,m:1,k:128,expand:`xmd`,hash:Fa}),$s=Ws,ec=BigInt(`25063068953384623474111414158702152701244531502492656460079210482610430750235`),tc=BigInt(`54469307008909316920995813868745141605393597292927456921205312896311721017578`),nc=BigInt(`1159843021668779879193775521855586647937357759715417654439879720876111806838`),rc=BigInt(`40440834346308536858101042469323190826248399146238708352240133220865137265952`),ic=e=>As(Ls,e),ac=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),oc=e=>qs.Point.Fp.create(Ha(e)&ac),sc=class e extends ms{constructor(e){super(e)}static fromAffine(t){return new e(qs.Point.fromAffine(t))}assertSame(t){if(!(t instanceof e))throw Error(`RistrettoPoint expected`)}init(t){return new e(t)}static hashToCurve(e){return Fs(Ga(`ristrettoHash`,e,64))}static fromBytes(t){Ti(t,32);let{a:n,d:r}=Us,i=Hs,a=e=>z.create(e),o=oc(t);if(!Ka(z.toBytes(o),t)||Io(o,i))throw Error(`invalid ristretto255 encoding 1`);let s=a(o*o),c=a(Ls+n*s),l=a(Ls-n*s),u=a(c*c),d=a(l*l),f=a(n*r*u-d),{isValid:p,value:m}=ic(a(f*d)),h=a(m*l),g=a(m*h*f),_=a((o+o)*h);Io(_,i)&&(_=a(-_));let v=a(c*g),y=a(_*v);if(!p||Io(y,i)||v===Is)throw Error(`invalid ristretto255 encoding 2`);return new e(new qs.Point(_,v,Ls,y))}static fromHex(t){return e.fromBytes(Ga(`ristrettoHex`,t,32))}static msm(t,n){return Yo(e,qs.Point.Fn,t,n)}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep,i=Hs,a=e=>z.create(e),o=a(a(n+t)*a(n-t)),s=a(e*t),{value:c}=ic(a(o*a(s*s))),l=a(c*o),u=a(c*s),d=a(l*u*r),f;if(Io(r*d,i)){let n=a(t*$s),r=a(e*$s);e=n,t=r,f=a(l*tc)}else f=u;Io(e*d,i)&&(t=a(-t));let p=a((n-t)*f);return Io(p,i)&&(p=a(-p)),z.toBytes(p)}equals(e){this.assertSame(e);let{X:t,Y:n}=this.ep,{X:r,Y:i}=e.ep,a=e=>z.create(e),o=a(t*i)===a(n*r),s=a(n*i)===a(t*r);return o||s}is0(){return this.equals(e.ZERO)}},sc.BASE=new sc(qs.Point.BASE),sc.ZERO=new sc(qs.Point.ZERO),sc.Fp=z,sc.Fn=Gs,cc={hashToCurve(e,t){return Fs(bs(e,t?.DST||`ristretto255_XMD:SHA-512_R255MAP_RO_`,64,Fa))},hashToScalar(e,t={DST:Es}){let n=bs(e,t.DST,64,Fa);return Gs.create(Ha(n))}},Qs.hashToCurve,Qs.encodeToCurve,cc.hashToCurve,cc.hashToCurve})),uc=s(((e,t)=>{t.exports={}})),dc=s(((e,t)=>{(function(e,t){function n(e,t){if(!e)throw Error(t||`Assertion failed`)}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,e!==null&&((t===`le`||t===`be`)&&(n=t,t=10),this._init(e||0,t||10,n||`be`))}typeof e==`object`?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var a;try{a=typeof window<`u`&&window.Buffer!==void 0?window.Buffer:uc().Buffer}catch{}i.isBN=function(e){return e instanceof i?!0:typeof e==`object`&&!!e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if(typeof e==`number`)return this._initNumber(e,t,r);if(typeof e==`object`)return this._initArray(e,t,r);t===`hex`&&(t=16),n(t===(t|0)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,``);var i=0;e[0]===`-`&&(i++,this.negative=1),i<e.length&&(t===16?this._parseHex(e,i,r):(this._parseBase(e,t,i),r===`le`&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[e&67108863],this.length=1):e<4503599627370496?(this.words=[e&67108863,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[e&67108863,e/67108864&67108863,1],this.length=3),r===`le`&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n(typeof e.length==`number`),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if(r===`be`)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);else if(r===`le`)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,s+=24,s>=26&&(s-=26,a++);return this._strip()};function o(e,t){var r=e.charCodeAt(t);if(r>=48&&r<=57)return r-48;if(r>=65&&r<=70)return r-55;if(r>=97&&r<=102)return r-87;n(!1,`Invalid character in `+e)}function s(e,t,n){var r=o(e,n);return n-1>=t&&(r|=o(e,n-1)<<4),r}i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i=0,a=0,o;if(n===`be`)for(r=e.length-1;r>=t;r-=2)o=s(e,t,r)<<i,this.words[a]|=o&67108863,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=s(e,t,r)<<i,this.words[a]|=o&67108863,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()};function c(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),c=t;c<s;c++){var l=e.charCodeAt(c)-48;a*=i,o=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&o<i,`Invalid character`),a+=o}return a}i.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 a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,l=0,u=n;u<s;u+=r)l=c(e,u,u+r,t),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(o!==0){var d=1;for(l=c(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red};function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.prototype._move=function(e){l(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<`u`&&typeof Symbol.for==`function`)try{i.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=u}catch{i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?`<BN-R: `:`<BN: `)+this.toString(16)+`>`}var d=`.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`.split(`.`),f=[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];i.prototype.toString=function(e,t){e||=10,t=t|0||1;var r;if(e===16||e===`hex`){r=``;for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=((s<<i|a)&16777215).toString(16);a=s>>>24-i&16777215,i+=2,i>=26&&(i-=26,o--),r=a!==0||o!==this.length-1?d[6-c.length]+c+r:c+r}for(a!==0&&(r=a.toString(16)+r);r.length%t!==0;)r=`0`+r;return this.negative!==0&&(r=`-`+r),r}if(e===(e|0)&&e>=2&&e<=36){var l=f[e],u=p[e];r=``;var m=this.clone();for(m.negative=0;!m.isZero();){var h=m.modrn(u).toString(e);m=m.idivn(u),r=m.isZero()?h+r:d[l-h.length]+h+r}for(this.isZero()&&(r=`0`+r);r.length%t!==0;)r=`0`+r;return this.negative!==0&&(r=`-`+r),r}n(!1,`Base should be between 2 and 36`)},i.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,`Number can only safely store up to 53 bits`),this.negative===0?e:-e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var m=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,`byte array longer than desired length`),n(a>0,`Requested array length <= 0`);var o=m(e,a);return this[`_toArrayLike`+(t===`le`?`LE`:`BE`)](o,i),o},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=o&255,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),a===6?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=o&255,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),a===6?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.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},i.prototype._zeroBits=function(e){if(e===0)return 26;var t=e,n=0;return t&8191||(n+=13,t>>>=13),t&127||(n+=7,t>>>=7),t&15||(n+=4,t>>>=4),t&3||(n+=2,t>>>=2),t&1||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t};function h(e){for(var t=Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,n!==26)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return this.negative===0?this.clone():this.abs().inotn(e).iaddn(1)},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n((this.negative|e.negative)===0),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){for(var t=this.length>e.length?e:this,n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n((this.negative|e.negative)===0),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n((this.negative|e.negative)===0),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n(typeof e==`number`&&e>=0);var t=Math.ceil(e/26)|0,r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=~this.words[i]&67108863;for(r>0&&(this.words[i]=~this.words[i]&67108863>>26-r,i++);i<this.length;i++)this.words[i]=0;return this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n(typeof e==`number`&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t;if(this.negative!==0&&e.negative===0)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(this.negative===0&&e.negative!==0)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();var n,r;this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(n.words[a]|0)+(r.words[a]|0)+i,this.words[a]=t&67108863,i=t>>>26;for(;i!==0&&a<n.length;a++)t=(n.words[a]|0)+i,this.words[a]=t&67108863,i=t>>>26;if(this.length=n.length,i!==0)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},i.prototype.add=function(e){var t;return e.negative!==0&&this.negative===0?(e.negative=0,t=this.sub(e),e.negative^=1,t):e.negative===0&&this.negative!==0?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(n===0)return this.negative=0,this.length=1,this.words[0]=0,this;var r,i;n>0?(r=this,i=e):(r=e,i=this);for(var a=0,o=0;o<i.length;o++)t=(r.words[o]|0)-(i.words[o]|0)+a,a=t>>26,this.words[o]=t&67108863;for(;a!==0&&o<r.length;o++)t=(r.words[o]|0)+a,a=t>>26,this.words[o]=t&67108863;if(a===0&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};function g(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=e.words[0]|0,a=t.words[0]|0,o=i*a,s=o&67108863,c=o/67108864|0;n.words[0]=s;for(var l=1;l<r;l++){for(var u=c>>>26,d=c&67108863,f=Math.min(l,t.length-1),p=Math.max(0,l-e.length+1);p<=f;p++){var m=l-p|0;i=e.words[m]|0,a=t.words[p]|0,o=i*a+d,u+=o/67108864|0,d=o&67108863}n.words[l]=d|0,c=u|0}return c===0?n.length--:n.words[l]=c|0,n._strip()}var _=function(e,t,n){var r=e.words,i=t.words,a=n.words,o=0,s,c,l,u=r[0]|0,d=u&8191,f=u>>>13,p=r[1]|0,m=p&8191,h=p>>>13,g=r[2]|0,_=g&8191,v=g>>>13,y=r[3]|0,b=y&8191,x=y>>>13,S=r[4]|0,C=S&8191,w=S>>>13,T=r[5]|0,E=T&8191,D=T>>>13,O=r[6]|0,k=O&8191,ee=O>>>13,te=r[7]|0,A=te&8191,ne=te>>>13,re=r[8]|0,ie=re&8191,j=re>>>13,M=r[9]|0,ae=M&8191,N=M>>>13,oe=i[0]|0,se=oe&8191,P=oe>>>13,ce=i[1]|0,le=ce&8191,ue=ce>>>13,de=i[2]|0,fe=de&8191,pe=de>>>13,me=i[3]|0,he=me&8191,ge=me>>>13,_e=i[4]|0,ve=_e&8191,ye=_e>>>13,be=i[5]|0,xe=be&8191,Se=be>>>13,Ce=i[6]|0,we=Ce&8191,Te=Ce>>>13,Ee=i[7]|0,De=Ee&8191,Oe=Ee>>>13,ke=i[8]|0,Ae=ke&8191,je=ke>>>13,Me=i[9]|0,Ne=Me&8191,Pe=Me>>>13;n.negative=e.negative^t.negative,n.length=19,s=Math.imul(d,se),c=Math.imul(d,P),c=c+Math.imul(f,se)|0,l=Math.imul(f,P);var Fe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,s=Math.imul(m,se),c=Math.imul(m,P),c=c+Math.imul(h,se)|0,l=Math.imul(h,P),s=s+Math.imul(d,le)|0,c=c+Math.imul(d,ue)|0,c=c+Math.imul(f,le)|0,l=l+Math.imul(f,ue)|0;var Ie=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,s=Math.imul(_,se),c=Math.imul(_,P),c=c+Math.imul(v,se)|0,l=Math.imul(v,P),s=s+Math.imul(m,le)|0,c=c+Math.imul(m,ue)|0,c=c+Math.imul(h,le)|0,l=l+Math.imul(h,ue)|0,s=s+Math.imul(d,fe)|0,c=c+Math.imul(d,pe)|0,c=c+Math.imul(f,fe)|0,l=l+Math.imul(f,pe)|0;var Le=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Le>>>26)|0,Le&=67108863,s=Math.imul(b,se),c=Math.imul(b,P),c=c+Math.imul(x,se)|0,l=Math.imul(x,P),s=s+Math.imul(_,le)|0,c=c+Math.imul(_,ue)|0,c=c+Math.imul(v,le)|0,l=l+Math.imul(v,ue)|0,s=s+Math.imul(m,fe)|0,c=c+Math.imul(m,pe)|0,c=c+Math.imul(h,fe)|0,l=l+Math.imul(h,pe)|0,s=s+Math.imul(d,he)|0,c=c+Math.imul(d,ge)|0,c=c+Math.imul(f,he)|0,l=l+Math.imul(f,ge)|0;var Re=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Re>>>26)|0,Re&=67108863,s=Math.imul(C,se),c=Math.imul(C,P),c=c+Math.imul(w,se)|0,l=Math.imul(w,P),s=s+Math.imul(b,le)|0,c=c+Math.imul(b,ue)|0,c=c+Math.imul(x,le)|0,l=l+Math.imul(x,ue)|0,s=s+Math.imul(_,fe)|0,c=c+Math.imul(_,pe)|0,c=c+Math.imul(v,fe)|0,l=l+Math.imul(v,pe)|0,s=s+Math.imul(m,he)|0,c=c+Math.imul(m,ge)|0,c=c+Math.imul(h,he)|0,l=l+Math.imul(h,ge)|0,s=s+Math.imul(d,ve)|0,c=c+Math.imul(d,ye)|0,c=c+Math.imul(f,ve)|0,l=l+Math.imul(f,ye)|0;var ze=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(ze>>>26)|0,ze&=67108863,s=Math.imul(E,se),c=Math.imul(E,P),c=c+Math.imul(D,se)|0,l=Math.imul(D,P),s=s+Math.imul(C,le)|0,c=c+Math.imul(C,ue)|0,c=c+Math.imul(w,le)|0,l=l+Math.imul(w,ue)|0,s=s+Math.imul(b,fe)|0,c=c+Math.imul(b,pe)|0,c=c+Math.imul(x,fe)|0,l=l+Math.imul(x,pe)|0,s=s+Math.imul(_,he)|0,c=c+Math.imul(_,ge)|0,c=c+Math.imul(v,he)|0,l=l+Math.imul(v,ge)|0,s=s+Math.imul(m,ve)|0,c=c+Math.imul(m,ye)|0,c=c+Math.imul(h,ve)|0,l=l+Math.imul(h,ye)|0,s=s+Math.imul(d,xe)|0,c=c+Math.imul(d,Se)|0,c=c+Math.imul(f,xe)|0,l=l+Math.imul(f,Se)|0;var Be=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Be>>>26)|0,Be&=67108863,s=Math.imul(k,se),c=Math.imul(k,P),c=c+Math.imul(ee,se)|0,l=Math.imul(ee,P),s=s+Math.imul(E,le)|0,c=c+Math.imul(E,ue)|0,c=c+Math.imul(D,le)|0,l=l+Math.imul(D,ue)|0,s=s+Math.imul(C,fe)|0,c=c+Math.imul(C,pe)|0,c=c+Math.imul(w,fe)|0,l=l+Math.imul(w,pe)|0,s=s+Math.imul(b,he)|0,c=c+Math.imul(b,ge)|0,c=c+Math.imul(x,he)|0,l=l+Math.imul(x,ge)|0,s=s+Math.imul(_,ve)|0,c=c+Math.imul(_,ye)|0,c=c+Math.imul(v,ve)|0,l=l+Math.imul(v,ye)|0,s=s+Math.imul(m,xe)|0,c=c+Math.imul(m,Se)|0,c=c+Math.imul(h,xe)|0,l=l+Math.imul(h,Se)|0,s=s+Math.imul(d,we)|0,c=c+Math.imul(d,Te)|0,c=c+Math.imul(f,we)|0,l=l+Math.imul(f,Te)|0;var Ve=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,s=Math.imul(A,se),c=Math.imul(A,P),c=c+Math.imul(ne,se)|0,l=Math.imul(ne,P),s=s+Math.imul(k,le)|0,c=c+Math.imul(k,ue)|0,c=c+Math.imul(ee,le)|0,l=l+Math.imul(ee,ue)|0,s=s+Math.imul(E,fe)|0,c=c+Math.imul(E,pe)|0,c=c+Math.imul(D,fe)|0,l=l+Math.imul(D,pe)|0,s=s+Math.imul(C,he)|0,c=c+Math.imul(C,ge)|0,c=c+Math.imul(w,he)|0,l=l+Math.imul(w,ge)|0,s=s+Math.imul(b,ve)|0,c=c+Math.imul(b,ye)|0,c=c+Math.imul(x,ve)|0,l=l+Math.imul(x,ye)|0,s=s+Math.imul(_,xe)|0,c=c+Math.imul(_,Se)|0,c=c+Math.imul(v,xe)|0,l=l+Math.imul(v,Se)|0,s=s+Math.imul(m,we)|0,c=c+Math.imul(m,Te)|0,c=c+Math.imul(h,we)|0,l=l+Math.imul(h,Te)|0,s=s+Math.imul(d,De)|0,c=c+Math.imul(d,Oe)|0,c=c+Math.imul(f,De)|0,l=l+Math.imul(f,Oe)|0;var He=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(He>>>26)|0,He&=67108863,s=Math.imul(ie,se),c=Math.imul(ie,P),c=c+Math.imul(j,se)|0,l=Math.imul(j,P),s=s+Math.imul(A,le)|0,c=c+Math.imul(A,ue)|0,c=c+Math.imul(ne,le)|0,l=l+Math.imul(ne,ue)|0,s=s+Math.imul(k,fe)|0,c=c+Math.imul(k,pe)|0,c=c+Math.imul(ee,fe)|0,l=l+Math.imul(ee,pe)|0,s=s+Math.imul(E,he)|0,c=c+Math.imul(E,ge)|0,c=c+Math.imul(D,he)|0,l=l+Math.imul(D,ge)|0,s=s+Math.imul(C,ve)|0,c=c+Math.imul(C,ye)|0,c=c+Math.imul(w,ve)|0,l=l+Math.imul(w,ye)|0,s=s+Math.imul(b,xe)|0,c=c+Math.imul(b,Se)|0,c=c+Math.imul(x,xe)|0,l=l+Math.imul(x,Se)|0,s=s+Math.imul(_,we)|0,c=c+Math.imul(_,Te)|0,c=c+Math.imul(v,we)|0,l=l+Math.imul(v,Te)|0,s=s+Math.imul(m,De)|0,c=c+Math.imul(m,Oe)|0,c=c+Math.imul(h,De)|0,l=l+Math.imul(h,Oe)|0,s=s+Math.imul(d,Ae)|0,c=c+Math.imul(d,je)|0,c=c+Math.imul(f,Ae)|0,l=l+Math.imul(f,je)|0;var Ue=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,s=Math.imul(ae,se),c=Math.imul(ae,P),c=c+Math.imul(N,se)|0,l=Math.imul(N,P),s=s+Math.imul(ie,le)|0,c=c+Math.imul(ie,ue)|0,c=c+Math.imul(j,le)|0,l=l+Math.imul(j,ue)|0,s=s+Math.imul(A,fe)|0,c=c+Math.imul(A,pe)|0,c=c+Math.imul(ne,fe)|0,l=l+Math.imul(ne,pe)|0,s=s+Math.imul(k,he)|0,c=c+Math.imul(k,ge)|0,c=c+Math.imul(ee,he)|0,l=l+Math.imul(ee,ge)|0,s=s+Math.imul(E,ve)|0,c=c+Math.imul(E,ye)|0,c=c+Math.imul(D,ve)|0,l=l+Math.imul(D,ye)|0,s=s+Math.imul(C,xe)|0,c=c+Math.imul(C,Se)|0,c=c+Math.imul(w,xe)|0,l=l+Math.imul(w,Se)|0,s=s+Math.imul(b,we)|0,c=c+Math.imul(b,Te)|0,c=c+Math.imul(x,we)|0,l=l+Math.imul(x,Te)|0,s=s+Math.imul(_,De)|0,c=c+Math.imul(_,Oe)|0,c=c+Math.imul(v,De)|0,l=l+Math.imul(v,Oe)|0,s=s+Math.imul(m,Ae)|0,c=c+Math.imul(m,je)|0,c=c+Math.imul(h,Ae)|0,l=l+Math.imul(h,je)|0,s=s+Math.imul(d,Ne)|0,c=c+Math.imul(d,Pe)|0,c=c+Math.imul(f,Ne)|0,l=l+Math.imul(f,Pe)|0;var We=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(We>>>26)|0,We&=67108863,s=Math.imul(ae,le),c=Math.imul(ae,ue),c=c+Math.imul(N,le)|0,l=Math.imul(N,ue),s=s+Math.imul(ie,fe)|0,c=c+Math.imul(ie,pe)|0,c=c+Math.imul(j,fe)|0,l=l+Math.imul(j,pe)|0,s=s+Math.imul(A,he)|0,c=c+Math.imul(A,ge)|0,c=c+Math.imul(ne,he)|0,l=l+Math.imul(ne,ge)|0,s=s+Math.imul(k,ve)|0,c=c+Math.imul(k,ye)|0,c=c+Math.imul(ee,ve)|0,l=l+Math.imul(ee,ye)|0,s=s+Math.imul(E,xe)|0,c=c+Math.imul(E,Se)|0,c=c+Math.imul(D,xe)|0,l=l+Math.imul(D,Se)|0,s=s+Math.imul(C,we)|0,c=c+Math.imul(C,Te)|0,c=c+Math.imul(w,we)|0,l=l+Math.imul(w,Te)|0,s=s+Math.imul(b,De)|0,c=c+Math.imul(b,Oe)|0,c=c+Math.imul(x,De)|0,l=l+Math.imul(x,Oe)|0,s=s+Math.imul(_,Ae)|0,c=c+Math.imul(_,je)|0,c=c+Math.imul(v,Ae)|0,l=l+Math.imul(v,je)|0,s=s+Math.imul(m,Ne)|0,c=c+Math.imul(m,Pe)|0,c=c+Math.imul(h,Ne)|0,l=l+Math.imul(h,Pe)|0;var Ge=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,s=Math.imul(ae,fe),c=Math.imul(ae,pe),c=c+Math.imul(N,fe)|0,l=Math.imul(N,pe),s=s+Math.imul(ie,he)|0,c=c+Math.imul(ie,ge)|0,c=c+Math.imul(j,he)|0,l=l+Math.imul(j,ge)|0,s=s+Math.imul(A,ve)|0,c=c+Math.imul(A,ye)|0,c=c+Math.imul(ne,ve)|0,l=l+Math.imul(ne,ye)|0,s=s+Math.imul(k,xe)|0,c=c+Math.imul(k,Se)|0,c=c+Math.imul(ee,xe)|0,l=l+Math.imul(ee,Se)|0,s=s+Math.imul(E,we)|0,c=c+Math.imul(E,Te)|0,c=c+Math.imul(D,we)|0,l=l+Math.imul(D,Te)|0,s=s+Math.imul(C,De)|0,c=c+Math.imul(C,Oe)|0,c=c+Math.imul(w,De)|0,l=l+Math.imul(w,Oe)|0,s=s+Math.imul(b,Ae)|0,c=c+Math.imul(b,je)|0,c=c+Math.imul(x,Ae)|0,l=l+Math.imul(x,je)|0,s=s+Math.imul(_,Ne)|0,c=c+Math.imul(_,Pe)|0,c=c+Math.imul(v,Ne)|0,l=l+Math.imul(v,Pe)|0;var Ke=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,s=Math.imul(ae,he),c=Math.imul(ae,ge),c=c+Math.imul(N,he)|0,l=Math.imul(N,ge),s=s+Math.imul(ie,ve)|0,c=c+Math.imul(ie,ye)|0,c=c+Math.imul(j,ve)|0,l=l+Math.imul(j,ye)|0,s=s+Math.imul(A,xe)|0,c=c+Math.imul(A,Se)|0,c=c+Math.imul(ne,xe)|0,l=l+Math.imul(ne,Se)|0,s=s+Math.imul(k,we)|0,c=c+Math.imul(k,Te)|0,c=c+Math.imul(ee,we)|0,l=l+Math.imul(ee,Te)|0,s=s+Math.imul(E,De)|0,c=c+Math.imul(E,Oe)|0,c=c+Math.imul(D,De)|0,l=l+Math.imul(D,Oe)|0,s=s+Math.imul(C,Ae)|0,c=c+Math.imul(C,je)|0,c=c+Math.imul(w,Ae)|0,l=l+Math.imul(w,je)|0,s=s+Math.imul(b,Ne)|0,c=c+Math.imul(b,Pe)|0,c=c+Math.imul(x,Ne)|0,l=l+Math.imul(x,Pe)|0;var qe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(qe>>>26)|0,qe&=67108863,s=Math.imul(ae,ve),c=Math.imul(ae,ye),c=c+Math.imul(N,ve)|0,l=Math.imul(N,ye),s=s+Math.imul(ie,xe)|0,c=c+Math.imul(ie,Se)|0,c=c+Math.imul(j,xe)|0,l=l+Math.imul(j,Se)|0,s=s+Math.imul(A,we)|0,c=c+Math.imul(A,Te)|0,c=c+Math.imul(ne,we)|0,l=l+Math.imul(ne,Te)|0,s=s+Math.imul(k,De)|0,c=c+Math.imul(k,Oe)|0,c=c+Math.imul(ee,De)|0,l=l+Math.imul(ee,Oe)|0,s=s+Math.imul(E,Ae)|0,c=c+Math.imul(E,je)|0,c=c+Math.imul(D,Ae)|0,l=l+Math.imul(D,je)|0,s=s+Math.imul(C,Ne)|0,c=c+Math.imul(C,Pe)|0,c=c+Math.imul(w,Ne)|0,l=l+Math.imul(w,Pe)|0;var Je=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Je>>>26)|0,Je&=67108863,s=Math.imul(ae,xe),c=Math.imul(ae,Se),c=c+Math.imul(N,xe)|0,l=Math.imul(N,Se),s=s+Math.imul(ie,we)|0,c=c+Math.imul(ie,Te)|0,c=c+Math.imul(j,we)|0,l=l+Math.imul(j,Te)|0,s=s+Math.imul(A,De)|0,c=c+Math.imul(A,Oe)|0,c=c+Math.imul(ne,De)|0,l=l+Math.imul(ne,Oe)|0,s=s+Math.imul(k,Ae)|0,c=c+Math.imul(k,je)|0,c=c+Math.imul(ee,Ae)|0,l=l+Math.imul(ee,je)|0,s=s+Math.imul(E,Ne)|0,c=c+Math.imul(E,Pe)|0,c=c+Math.imul(D,Ne)|0,l=l+Math.imul(D,Pe)|0;var Ye=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,s=Math.imul(ae,we),c=Math.imul(ae,Te),c=c+Math.imul(N,we)|0,l=Math.imul(N,Te),s=s+Math.imul(ie,De)|0,c=c+Math.imul(ie,Oe)|0,c=c+Math.imul(j,De)|0,l=l+Math.imul(j,Oe)|0,s=s+Math.imul(A,Ae)|0,c=c+Math.imul(A,je)|0,c=c+Math.imul(ne,Ae)|0,l=l+Math.imul(ne,je)|0,s=s+Math.imul(k,Ne)|0,c=c+Math.imul(k,Pe)|0,c=c+Math.imul(ee,Ne)|0,l=l+Math.imul(ee,Pe)|0;var Xe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,s=Math.imul(ae,De),c=Math.imul(ae,Oe),c=c+Math.imul(N,De)|0,l=Math.imul(N,Oe),s=s+Math.imul(ie,Ae)|0,c=c+Math.imul(ie,je)|0,c=c+Math.imul(j,Ae)|0,l=l+Math.imul(j,je)|0,s=s+Math.imul(A,Ne)|0,c=c+Math.imul(A,Pe)|0,c=c+Math.imul(ne,Ne)|0,l=l+Math.imul(ne,Pe)|0;var Ze=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,s=Math.imul(ae,Ae),c=Math.imul(ae,je),c=c+Math.imul(N,Ae)|0,l=Math.imul(N,je),s=s+Math.imul(ie,Ne)|0,c=c+Math.imul(ie,Pe)|0,c=c+Math.imul(j,Ne)|0,l=l+Math.imul(j,Pe)|0;var Qe=(o+s|0)+((c&8191)<<13)|0;o=(l+(c>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,s=Math.imul(ae,Ne),c=Math.imul(ae,Pe),c=c+Math.imul(N,Ne)|0,l=Math.imul(N,Pe);var $e=(o+s|0)+((c&8191)<<13)|0;return o=(l+(c>>>13)|0)+($e>>>26)|0,$e&=67108863,a[0]=Fe,a[1]=Ie,a[2]=Le,a[3]=Re,a[4]=ze,a[5]=Be,a[6]=Ve,a[7]=He,a[8]=Ue,a[9]=We,a[10]=Ge,a[11]=Ke,a[12]=qe,a[13]=Je,a[14]=Ye,a[15]=Xe,a[16]=Ze,a[17]=Qe,a[18]=$e,o!==0&&(a[19]=o,n.length++),n};Math.imul||(_=g);function v(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=r&67108863,c=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=c;l++){var u=a-l,d=(e.words[u]|0)*(t.words[l]|0),f=d&67108863;o=o+(d/67108864|0)|0,f=f+s|0,s=f&67108863,o=o+(f>>>26)|0,i+=o>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return r===0?n.length--:n.words[a]=r,n._strip()}function y(e,t,n){return v(e,t,n)}i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=this.length===10&&e.length===10?_(this,e,t):r<63?g(this,e,t):r<1024?v(this,e,t):y(this,e,t),n};function b(e,t){this.x=e,this.y=t}b.prototype.makeRBT=function(e){for(var t=Array(e),n=i.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},b.prototype.revBin=function(e,t,n){if(e===0||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(e&1)<<t-i-1,e>>=1;return r},b.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o<a;o++)r[o]=t[e[o]],i[o]=n[e[o]]},b.prototype.transform=function(e,t,n,r,i,a){this.permute(a,e,t,n,r,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,c=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var d=c,f=l,p=0;p<o;p++){var m=n[u+p],h=r[u+p],g=n[u+p+o],_=r[u+p+o],v=d*g-f*_;_=d*_+f*g,g=v,n[u+p]=m+g,r[u+p]=h+_,n[u+p+o]=m-g,r[u+p+o]=h-_,p!==s&&(v=c*d-l*f,f=c*f+l*d,d=v)}},b.prototype.guessLen13b=function(e,t){var n=Math.max(t,e)|1,r=n&1,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},b.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},b.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=Math.round(e[2*r+1]/t)*8192+Math.round(e[2*r]/t)+n;e[r]=i&67108863,n=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=e[o]|0,r[2*o]=a&8191,a>>>=13,r[2*o+1]=a&8191,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(a===0),n((a&-8192)==0)},b.prototype.stub=function(e){for(var t=Array(e),n=0;n<e;n++)t[n]=0;return t},b.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),a=this.stub(r),o=Array(r),s=Array(r),c=Array(r),l=Array(r),u=Array(r),d=Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,l,r),this.transform(o,a,s,c,r,i),this.transform(l,a,u,d,r,i);for(var p=0;p<r;p++){var m=s[p]*u[p]-c[p]*d[p];c[p]=s[p]*d[p]+c[p]*u[p],s[p]=m}return this.conjugate(s,c,r),this.transform(s,c,f,a,r,i),this.conjugate(f,a,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n(typeof e==`number`),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*e,o=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=o&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=e===0?1:this.length,t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(t.length===0)return new i(1);for(var n=this,r=0;r<t.length&&t[r]===0;r++,n=n.sqr());if(++r<t.length)for(var a=n.sqr();r<t.length;r++,a=a.sqr())t[r]!==0&&(n=n.mul(a));return n},i.prototype.iushln=function(e){n(typeof e==`number`&&e>=0);var t=e%26,r=(e-t)/26,i=67108863>>>26-t<<26-t,a;if(t!==0){var o=0;for(a=0;a<this.length;a++){var s=this.words[a]&i,c=(this.words[a]|0)-s<<t;this.words[a]=c|o,o=s>>>26-t}o&&(this.words[a]=o,this.length++)}if(r!==0){for(a=this.length-1;a>=0;a--)this.words[a+r]=this.words[a];for(a=0;a<r;a++)this.words[a]=0;this.length+=r}return this._strip()},i.prototype.ishln=function(e){return n(this.negative===0),this.iushln(e)},i.prototype.iushrn=function(e,t,r){n(typeof e==`number`&&e>=0);var i=t?(t-t%26)/26:0,a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=r;if(i-=o,i=Math.max(0,i),c){for(var l=0;l<o;l++)c.words[l]=this.words[l];c.length=o}if(o!==0)if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(u!==0||l>=i);l--){var d=this.words[l]|0;this.words[l]=u<<26-a|d>>>a,u=d&s}return c&&u!==0&&(c.words[c.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(this.negative===0),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n(typeof e==`number`&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return this.length<=r?!1:!!(this.words[r]&i)},i.prototype.imaskn=function(e){n(typeof e==`number`&&e>=0);var t=e%26,r=(e-t)/26;if(n(this.negative===0,`imaskn works only with positive numbers`),this.length<=r)return this;if(t!==0&&r++,this.length=Math.min(r,this.length),t!==0){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n(typeof e==`number`),n(e<67108864),e<0?this.isubn(-e):this.negative===0?this._iaddn(e):this.length===1&&(this.words[0]|0)<=e?(this.words[0]=e-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n(typeof e==`number`),n(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,--this.words[t+1];return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i=e.length+r,a;this._expand(i);var o,s=0;for(a=0;a<e.length;a++){o=(this.words[a+r]|0)+s;var c=(e.words[a]|0)*t;o-=c&67108863,s=(o>>26)-(c/67108864|0),this.words[a+r]=o&67108863}for(;a<this.length-r;a++)o=(this.words[a+r]|0)+s,s=o>>26,this.words[a+r]=o&67108863;if(s===0)return this._strip();for(n(s===-1),s=0,a=0;a<this.length;a++)o=-(this.words[a]|0)+s,s=o>>26,this.words[a]=o&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=this.length-e.length,r=this.clone(),a=e,o=a.words[a.length-1]|0;n=26-this._countBits(o),n!==0&&(a=a.ushln(n),r.iushln(n),o=a.words[a.length-1]|0);var s=r.length-a.length,c;if(t!==`mod`){c=new i(null),c.length=s+1,c.words=Array(c.length);for(var l=0;l<c.length;l++)c.words[l]=0}var u=r.clone()._ishlnsubmul(a,1,s);u.negative===0&&(r=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var f=(r.words[a.length+d]|0)*67108864+(r.words[a.length+d-1]|0);for(f=Math.min(f/o|0,67108863),r._ishlnsubmul(a,f,d);r.negative!==0;)f--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);c&&(c.words[d]=f)}return c&&c._strip(),r._strip(),t!==`div`&&n!==0&&r.iushrn(n),{div:c||null,mod:r}},i.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var a,o,s;return this.negative!==0&&e.negative===0?(s=this.neg().divmod(e,t),t!==`mod`&&(a=s.div.neg()),t!==`div`&&(o=s.mod.neg(),r&&o.negative!==0&&o.iadd(e)),{div:a,mod:o}):this.negative===0&&e.negative!==0?(s=this.divmod(e.neg(),t),t!==`mod`&&(a=s.div.neg()),{div:a,mod:s.mod}):(this.negative&e.negative)===0?e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:e.length===1?t===`div`?{div:this.divn(e.words[0]),mod:null}:t===`mod`?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t):(s=this.neg().divmod(e.neg(),t),t!==`div`&&(o=s.mod.neg(),r&&o.negative!==0&&o.isub(e)),{div:s.div,mod:o})},i.prototype.div=function(e){return this.divmod(e,`div`,!1).div},i.prototype.mod=function(e){return this.divmod(e,`mod`,!1).mod},i.prototype.umod=function(e){return this.divmod(e,`mod`,!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=t.div.negative===0?t.mod:t.mod.isub(e),r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||i===1&&a===0?t.div:t.div.negative===0?t.div.iaddn(1):t.div.isubn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(e.negative===0),n(!e.isZero());var t=this,r=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var a=new i(1),o=new i(0),s=new i(0),c=new i(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;(t.words[0]&p)===0&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var m=0,h=1;(r.words[0]&h)===0&&m<26;++m,h<<=1);if(m>0)for(r.iushrn(m);m-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(l)}},i.prototype._invmp=function(e){n(e.negative===0),n(!e.isZero());var t=this,r=e.clone();t=t.negative===0?t.clone():t.umod(e);for(var a=new i(1),o=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;(t.words[0]&l)===0&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var u=0,d=1;(r.words[0]&d)===0&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o)):(r.isub(t),o.isub(a))}var f=t.cmpn(1)===0?a:o;return f.cmpn(0)<0&&f.iadd(e),f},i.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);do{for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(i===0||n.cmpn(1)===0)break;t.isub(n)}while(!0);return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return(this.words[0]&1)==0},i.prototype.isOdd=function(){return(this.words[0]&1)==1},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n(typeof e==`number`);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;a!==0&&o<this.length;o++){var s=this.words[o]|0;s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return a!==0&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this._strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,`Number is too big`);var i=this.words[0]|0;r=i===e?0:i<e?-1:1}return this.negative===0?r:-r|0},i.prototype.cmp=function(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var t=this.ucmp(e);return this.negative===0?t:-t|0},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=this.words[n]|0,i=e.words[n]|0;if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return this.cmpn(e)===1},i.prototype.gt=function(e){return this.cmp(e)===1},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return this.cmpn(e)===-1},i.prototype.lt=function(e){return this.cmp(e)===-1},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return this.cmpn(e)===0},i.prototype.eq=function(e){return this.cmp(e)===0},i.red=function(e){return new D(e)},i.prototype.toRed=function(e){return n(!this.red,`Already a number in reduction context`),n(this.negative===0,`red works only with positives`),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,`Already a number in reduction context`),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,`redAdd works only with red numbers`),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,`redSub works only with red numbers`),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,`redISub works only with red numbers`),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,`redShl works only with red numbers`),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,`redMul works only with red numbers`),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,`redSqr works only with red numbers`),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,`redISqr works only with red numbers`),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,`redSqrt works only with red numbers`),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,`redInvm works only with red numbers`),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,`redNeg works only with red numbers`),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,`redPow(normalNum)`),this.red._verify1(this),this.red.pow(this,e)};var x={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var e=new i(null);return e.words=Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t=e,n;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),n=t.bitLength();while(n>this.n);var r=n<this.n?-1:t.ucmp(this.p);return r===0?(t.words[0]=0,t.length=1):r>0?t.isub(this.p):t.strip===void 0?t._strip():t.strip(),t},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)};function C(){S.call(this,`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}r(C,S),C.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9){e.words[0]=0,e.length=1;return}var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=e.words[i]|0;e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,a===0&&e.length>10?e.length-=10:e.length-=9},C.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<e.length;n++){var r=e.words[n]|0;t+=r*977,e.words[n]=t&67108863,t=r*64+(t/67108864|0)}return e.words[e.length-1]===0&&(e.length--,e.words[e.length-1]===0&&e.length--),e};function w(){S.call(this,`p224`,`ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001`)}r(w,S);function T(){S.call(this,`p192`,`ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff`)}r(T,S);function E(){S.call(this,`25519`,`7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed`)}r(E,S),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=(e.words[n]|0)*19+t,i=r&67108863;r>>>=26,e.words[n]=i,t=r}return t!==0&&(e.words[e.length++]=t),e},i._prime=function(e){if(x[e])return x[e];var t;if(e===`k256`)t=new C;else if(e===`p224`)t=new w;else if(e===`p192`)t=new T;else if(e===`p25519`)t=new E;else throw Error(`Unknown prime `+e);return x[e]=t,t};function D(e){if(typeof e==`string`){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}D.prototype._verify1=function(e){n(e.negative===0,`red works only with positives`),n(e.red,`red works only with red numbers`)},D.prototype._verify2=function(e,t){n((e.negative|t.negative)===0,`red works only with positives`),n(e.red&&e.red===t.red,`red works only with red numbers`)},D.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},D.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},D.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)},D.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},D.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)},D.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},D.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},D.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},D.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},D.prototype.isqr=function(e){return this.imul(e,e.clone())},D.prototype.sqr=function(e){return this.mul(e,e)},D.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),t===3){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&a.andln(1)===0;)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,l).cmp(c)!==0;)u.redIAdd(c);for(var d=this.pow(u,a),f=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),m=o;p.cmp(s)!==0;){for(var h=p,g=0;h.cmp(s)!==0;g++)h=h.redSqr();n(g<m);var _=this.pow(d,new i(1).iushln(m-g-1));f=f.redMul(_),d=_.redSqr(),p=p.redMul(d),m=g}return f},D.prototype.invm=function(e){var t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())},D.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(t.cmpn(1)===0)return e.clone();var n=4,r=Array(1<<n);r[0]=new i(1).toRed(this),r[1]=e;for(var a=2;a<r.length;a++)r[a]=this.mul(r[a-1],e);var o=r[0],s=0,c=0,l=t.bitLength()%26;for(l===0&&(l=26),a=t.length-1;a>=0;a--){for(var u=t.words[a],d=l-1;d>=0;d--){var f=u>>d&1;if(o!==r[0]&&(o=this.sqr(o)),f===0&&s===0){c=0;continue}s<<=1,s|=f,c++,!(c!==n&&(a!==0||d!==0))&&(o=this.mul(o,r[s]),c=0,s=0)}l=26}return o},D.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},D.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new O(e)};function O(e){D.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}r(O,D),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.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),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)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(t===void 0||t,e)})),fc=s(((e,t)=>{var n=m(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),pc=s(((e,t)=>{var n=fc().Buffer;function r(e){if(e.length>=255)throw TypeError(`Alphabet too long`);for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(t[o]!==255)throw TypeError(a+` is ambiguous`);t[o]=i}var s=e.length,c=e.charAt(0),l=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function d(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw TypeError(`Expected Buffer`);if(t.length===0)return``;for(var r=0,i=0,a=0,o=t.length;a!==o&&t[a]===0;)a++,r++;for(var l=(o-a)*u+1>>>0,d=new Uint8Array(l);a!==o;){for(var f=t[a],p=0,m=l-1;(f!==0||p<i)&&m!==-1;m--,p++)f+=256*d[m]>>>0,d[m]=f%s>>>0,f=f/s>>>0;if(f!==0)throw Error(`Non-zero carry`);i=p,a++}for(var h=l-i;h!==l&&d[h]===0;)h++;for(var g=c.repeat(r);h<l;++h)g+=e.charAt(d[h]);return g}function f(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return n.alloc(0);for(var r=0,i=0,a=0;e[r]===c;)i++,r++;for(var o=(e.length-r)*l+1>>>0,u=new Uint8Array(o);r<e.length;){var d=e.charCodeAt(r);if(d>255)return;var f=t[d];if(f===255)return;for(var p=0,m=o-1;(f!==0||p<a)&&m!==-1;m--,p++)f+=s*u[m]>>>0,u[m]=f%256>>>0,f=f/256>>>0;if(f!==0)throw Error(`Non-zero carry`);a=p,r++}for(var h=o-a;h!==o&&u[h]===0;)h++;var g=n.allocUnsafe(i+(o-h));g.fill(0,0,i);for(var _=i;h!==o;)g[_++]=u[h++];return g}function p(e){var t=f(e);if(t)return t;throw Error(`Non-base`+s+` character`)}return{encode:d,decodeUnsafe:f,decode:p}}t.exports=r})),mc=s(((e,t)=>{t.exports=pc()(`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`)})),hc,gc=o((()=>{Ia(),hc=Pa})),_c=c({TextDecoder:()=>Ec,TextEncoder:()=>Dc});function vc(e,t,n){return t<=e&&e<=n}function yc(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError(`Could not convert argument to dictionary`)}function bc(e){for(var t=String(e),n=t.length,r=0,i=[];r<n;){var a=t.charCodeAt(r);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(r===n-1)i.push(65533);else{var o=e.charCodeAt(r+1);if(56320<=o&&o<=57343){var s=a&1023,c=o&1023;i.push(65536+(s<<10)+c),r+=1}else i.push(65533)}r+=1}return i}function xc(e){for(var t=``,n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t}function Sc(e){this.tokens=[].slice.call(e)}function Cc(e,t){if(e)throw TypeError(`Decoder error`);return t||65533}function wc(){}function Tc(){}function Ec(e,t){if(!(this instanceof Ec))return new Ec(e,t);if(e=e===void 0?Mc:String(e).toLowerCase(),e!==Mc)throw Error(`Encoding not supported. Only utf-8 is supported`);t=yc(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,`encoding`,{value:`utf-8`}),Object.defineProperty(this,`fatal`,{value:this._fatal}),Object.defineProperty(this,`ignoreBOM`,{value:this._ignoreBOM})}function Dc(e,t){if(!(this instanceof Dc))return new Dc(e,t);if(e=e===void 0?Mc:String(e).toLowerCase(),e!==Mc)throw Error(`Encoding not supported. Only utf-8 is supported`);t=yc(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,`encoding`,{value:`utf-8`})}function Oc(e){var t=e.fatal,n=0,r=0,i=0,a=128,o=191;this.handler=function(e,s){if(s===Ac&&i!==0)return i=0,Cc(t);if(s===Ac)return jc;if(i===0){if(vc(s,0,127))return s;if(vc(s,194,223))i=1,n=s-192;else if(vc(s,224,239))s===224&&(a=160),s===237&&(o=159),i=2,n=s-224;else if(vc(s,240,244))s===240&&(a=144),s===244&&(o=143),i=3,n=s-240;else return Cc(t);return n<<=6*i,null}if(!vc(s,a,o))return n=i=r=0,a=128,o=191,e.prepend(s),Cc(t);if(a=128,o=191,r+=1,n+=s-128<<6*(i-r),r!==i)return null;var c=n;return n=i=r=0,c}}function kc(e){e.fatal,this.handler=function(e,t){if(t===Ac)return jc;if(vc(t,0,127))return t;var n,r;vc(t,128,2047)?(n=1,r=192):vc(t,2048,65535)?(n=2,r=224):vc(t,65536,1114111)&&(n=3,r=240);for(var i=[(t>>6*n)+r];n>0;){var a=t>>6*(n-1);i.push(128|a&63),--n}return i}}var Ac,jc,Mc,Nc=o((()=>{Ac=-1,Sc.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Ac},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}},jc=-1,wc.prototype={handler:function(e,t){}},Tc.prototype={handler:function(e,t){}},Mc=`utf-8`,Ec.prototype={decode:function(e,t){var n=typeof e==`object`&&e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`object`&&`buffer`in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array;t=yc(t),this._streaming||(this._decoder=new Oc({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var r=new Sc(n),i=[],a;!r.endOfStream()&&(a=this._decoder.handler(r,r.read()),a!==jc);)a!==null&&(Array.isArray(a)?i.push.apply(i,a):i.push(a));if(!this._streaming){do{if(a=this._decoder.handler(r,r.read()),a===jc)break;if(a===null)continue;Array.isArray(a)?i.push.apply(i,a):i.push(a)}while(!r.endOfStream());this._decoder=null}return i.length&&[`utf-8`].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),xc(i)}},Dc.prototype={encode:function(e,t){e=e?String(e):``,t=yc(t),this._streaming||(this._encoder=new kc(this._options)),this._streaming=!!t.stream;for(var n=[],r=new Sc(bc(e)),i;!r.endOfStream()&&(i=this._encoder.handler(r,r.read()),i!==jc);)Array.isArray(i)?n.push.apply(n,i):n.push(i);if(!this._streaming){for(;i=this._encoder.handler(r,r.read()),i!==jc;)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)}}})),Pc=s((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__decorate||function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;var o=a(dc()),s=a(mc()),c=i((Nc(),d(_c))),l=new(typeof TextDecoder==`function`?TextDecoder:c.TextDecoder)(`utf-8`,{fatal:!0});function u(e){return typeof e==`string`&&(e=Buffer.from(e,`utf8`)),s.default.encode(Buffer.from(e))}e.baseEncode=u;function f(e){return Buffer.from(s.default.decode(e))}e.baseDecode=f;var p=1024,m=class 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(`.`)}};e.BorshError=m;var h=class{constructor(){this.buf=Buffer.alloc(p),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(p)]))}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(Buffer.from(new o.default(e).toArray(`le`,8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(e).toArray(`le`,16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(e).toArray(`le`,32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(e).toArray(`le`,64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(p)]),this.length+=e.length}writeString(e){this.maybeResize();let t=Buffer.from(e,`utf8`);this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}};e.BinaryWriter=h;function g(e,t,n){let r=n.value;n.value=function(...e){try{return r.apply(this,e)}catch(e){if(e instanceof RangeError){let t=e.code;if([`ERR_BUFFER_OUT_OF_BOUNDS`,`ERR_OUT_OF_RANGE`].indexOf(t)>=0)throw new m(`Reached the end of buffer when deserializing`)}throw e}}}var _=class{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new o.default(e,`le`)}readU128(){let e=this.readBuffer(16);return new o.default(e,`le`)}readU256(){let e=this.readBuffer(32);return new o.default(e,`le`)}readU512(){let e=this.readBuffer(64);return new o.default(e,`le`)}readBuffer(e){if(this.offset+e>this.buf.length)throw new m(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return l.decode(t)}catch(e){throw new m(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),n=[];for(let r=0;r<t;++r)n.push(e());return n}};r([g],_.prototype,`readU8`,null),r([g],_.prototype,`readU16`,null),r([g],_.prototype,`readU32`,null),r([g],_.prototype,`readU64`,null),r([g],_.prototype,`readU128`,null),r([g],_.prototype,`readU256`,null),r([g],_.prototype,`readU512`,null),r([g],_.prototype,`readString`,null),r([g],_.prototype,`readFixedArray`,null),r([g],_.prototype,`readArray`,null),e.BinaryReader=_;function v(e){return e.charAt(0).toUpperCase()+e.slice(1)}function y(e,t,n,r,i){try{if(typeof r==`string`)i[`write${v(r)}`](n);else if(r instanceof Array)if(typeof r[0]==`number`){if(n.length!==r[0])throw new m(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);i.writeFixedArray(n)}else if(r.length===2&&typeof r[1]==`number`){if(n.length!==r[1])throw new m(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let t=0;t<r[1];t++)y(e,null,n[t],r[0],i)}else i.writeArray(n,n=>{y(e,t,n,r[0],i)});else if(r.kind!==void 0)switch(r.kind){case`option`:n==null?i.writeU8(0):(i.writeU8(1),y(e,t,n,r.type,i));break;case`map`:i.writeU32(n.size),n.forEach((n,a)=>{y(e,t,a,r.key,i),y(e,t,n,r.value,i)});break;default:throw new m(`FieldType ${r} unrecognized`)}else b(e,n,i)}catch(e){throw e instanceof m&&e.addToFieldPath(t),e}}function b(e,t,n){if(typeof t.borshSerialize==`function`){t.borshSerialize(n);return}let r=e.get(t.constructor);if(!r)throw new m(`Class ${t.constructor.name} is missing in schema`);if(r.kind===`struct`)r.fields.map(([r,i])=>{y(e,r,t[r],i,n)});else if(r.kind===`enum`){let i=t[r.field];for(let a=0;a<r.values.length;++a){let[o,s]=r.values[a];if(o===i){n.writeU8(a),y(e,o,t[o],s,n);break}}}else throw new m(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function x(e,t,n=h){let r=new n;return b(e,t,r),r.toArray()}e.serialize=x;function S(e,t,n,r){try{if(typeof n==`string`)return r[`read${v(n)}`]();if(n instanceof Array){if(typeof n[0]==`number`)return r.readFixedArray(n[0]);if(typeof n[1]==`number`){let t=[];for(let i=0;i<n[1];i++)t.push(S(e,null,n[0],r));return t}else return r.readArray(()=>S(e,t,n[0],r))}if(n.kind===`option`)return r.readU8()?S(e,t,n.type,r):void 0;if(n.kind===`map`){let i=new Map,a=r.readU32();for(let o=0;o<a;o++){let a=S(e,t,n.key,r),o=S(e,t,n.value,r);i.set(a,o)}return i}return C(e,n,r)}catch(e){throw e instanceof m&&e.addToFieldPath(t),e}}function C(e,t,n){if(typeof t.borshDeserialize==`function`)return t.borshDeserialize(n);let r=e.get(t);if(!r)throw new m(`Class ${t.name} is missing in schema`);if(r.kind===`struct`){let r={};for(let[i,a]of e.get(t).fields)r[i]=S(e,i,a,n);return new t(r)}if(r.kind===`enum`){let i=n.readU8();if(i>=r.values.length)throw new m(`Enum index: ${i} is out of range`);let[a,o]=r.values[i],s=S(e,a,o,n);return new t({[a]:s})}throw new m(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function w(e,t,n,r=_){let i=new r(n),a=C(e,t,i);if(i.offset<n.length)throw new m(`Unexpected ${n.length-i.offset} bytes after deserialized data`);return a}e.deserialize=w;function T(e,t,n,r=_){return C(e,t,new r(n))}e.deserializeUnchecked=T})),Fc=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.s16=e.s8=e.nu64be=e.u48be=e.u40be=e.u32be=e.u24be=e.u16be=e.nu64=e.u48=e.u40=e.u32=e.u24=e.u16=e.u8=e.offset=e.greedy=e.Constant=e.UTF8=e.CString=e.Blob=e.Boolean=e.BitField=e.BitStructure=e.VariantLayout=e.Union=e.UnionLayoutDiscriminator=e.UnionDiscriminator=e.Structure=e.Sequence=e.DoubleBE=e.Double=e.FloatBE=e.Float=e.NearInt64BE=e.NearInt64=e.NearUInt64BE=e.NearUInt64=e.IntBE=e.Int=e.UIntBE=e.UInt=e.OffsetLayout=e.GreedyCount=e.ExternalLayout=e.bindConstructorLayout=e.nameWithProperty=e.Layout=e.uint8ArrayToBuffer=e.checkUint8Array=void 0,e.constant=e.utf8=e.cstr=e.blob=e.unionLayoutDiscriminator=e.union=e.seq=e.bits=e.struct=e.f64be=e.f64=e.f32be=e.f32=e.ns64be=e.s48be=e.s40be=e.s32be=e.s24be=e.s16be=e.ns64=e.s48=e.s40=e.s32=e.s24=void 0;var t=m();function n(e){if(!(e instanceof Uint8Array))throw TypeError(`b must be a Uint8Array`)}e.checkUint8Array=n;function r(e){return n(e),t.Buffer.from(e.buffer,e.byteOffset,e.length)}e.uint8ArrayToBuffer=r;var i=class{constructor(e,t){if(!Number.isInteger(e))throw TypeError(`span must be an integer`);this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw RangeError(`indeterminate span`);return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};e.Layout=i;function a(e,t){return t.property?e+`[`+t.property+`]`:e}e.nameWithProperty=a;function o(e,t){if(typeof e!=`function`)throw TypeError(`Class must be constructor`);if(Object.prototype.hasOwnProperty.call(e,`layout_`))throw Error(`Class is already bound to a layout`);if(!(t&&t instanceof i))throw TypeError(`layout must be a Layout`);if(Object.prototype.hasOwnProperty.call(t,`boundConstructor_`))throw Error(`layout is already bound to a constructor`);e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=(()=>new e),Object.defineProperty(e.prototype,`encode`,{value(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,`decode`,{value(e,n){return t.decode(e,n)},writable:!0})}e.bindConstructorLayout=o;var s=class extends i{isCount(){throw Error(`ExternalLayout is abstract`)}};e.ExternalLayout=s;var c=class extends s{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw TypeError(`elementSpan must be a (positive) integer`);super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){n(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,n){return 0}};e.GreedyCount=c;var l=class extends s{constructor(e,t=0,n){if(!(e instanceof i))throw TypeError(`layout must be a Layout`);if(!Number.isInteger(t))throw 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 d}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,n=0){return this.layout.encode(e,t,n+this.offset)}};e.OffsetLayout=l;var u=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readUIntLE(t,this.span)}encode(e,t,n=0){return r(t).writeUIntLE(e,n,this.span),this.span}};e.UInt=u;var d=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readUIntBE(t,this.span)}encode(e,t,n=0){return r(t).writeUIntBE(e,n,this.span),this.span}};e.UIntBE=d;var f=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readIntLE(t,this.span)}encode(e,t,n=0){return r(t).writeIntLE(e,n,this.span),this.span}};e.Int=f;var p=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readIntBE(t,this.span)}encode(e,t,n=0){return r(t).writeIntBE(e,n,this.span),this.span}};e.IntBE=p;var h=2**32;function g(e){let t=Math.floor(e/h);return{hi32:t,lo32:e-t*h}}function _(e,t){return e*h+t}var v=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e),i=n.readUInt32LE(t);return _(n.readUInt32LE(t+4),i)}encode(e,t,n=0){let i=g(e),a=r(t);return a.writeUInt32LE(i.lo32,n),a.writeUInt32LE(i.hi32,n+4),8}};e.NearUInt64=v;var y=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e);return _(n.readUInt32BE(t),n.readUInt32BE(t+4))}encode(e,t,n=0){let i=g(e),a=r(t);return a.writeUInt32BE(i.hi32,n),a.writeUInt32BE(i.lo32,n+4),8}};e.NearUInt64BE=y;var b=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e),i=n.readUInt32LE(t);return _(n.readInt32LE(t+4),i)}encode(e,t,n=0){let i=g(e),a=r(t);return a.writeUInt32LE(i.lo32,n),a.writeInt32LE(i.hi32,n+4),8}};e.NearInt64=b;var x=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e);return _(n.readInt32BE(t),n.readUInt32BE(t+4))}encode(e,t,n=0){let i=g(e),a=r(t);return a.writeInt32BE(i.hi32,n),a.writeUInt32BE(i.lo32,n+4),8}};e.NearInt64BE=x;var S=class extends i{constructor(e){super(4,e)}decode(e,t=0){return r(e).readFloatLE(t)}encode(e,t,n=0){return r(t).writeFloatLE(e,n),4}};e.Float=S;var C=class extends i{constructor(e){super(4,e)}decode(e,t=0){return r(e).readFloatBE(t)}encode(e,t,n=0){return r(t).writeFloatBE(e,n),4}};e.FloatBE=C;var w=class extends i{constructor(e){super(8,e)}decode(e,t=0){return r(e).readDoubleLE(t)}encode(e,t,n=0){return r(t).writeDoubleLE(e,n),8}};e.Double=w;var T=class extends i{constructor(e){super(8,e)}decode(e,t=0){return r(e).readDoubleBE(t)}encode(e,t,n=0){return r(t).writeDoubleBE(e,n),8}};e.DoubleBE=T;var E=class extends i{constructor(e,t,n){if(!(e instanceof i))throw TypeError(`elementLayout must be a Layout`);if(!(t instanceof s&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError(`count must be non-negative integer or an unsigned integer ExternalLayout`);let r=-1;!(t instanceof s)&&0<e.span&&(r=t*e.span),super(r,n),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0,r=this.count;if(r instanceof s&&(r=r.decode(e,t)),0<this.elementLayout.span)n=r*this.elementLayout.span;else{let i=0;for(;i<r;)n+=this.elementLayout.getSpan(e,t+n),++i}return n}decode(e,t=0){let n=[],r=0,i=this.count;for(i instanceof s&&(i=i.decode(e,t));r<i;)n.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),r+=1;return n}encode(e,t,n=0){let r=this.elementLayout,i=e.reduce((e,i)=>e+r.encode(i,t,n+e),0);return this.count instanceof s&&this.count.encode(e.length,t,n),i}};e.Sequence=E;var D=class extends i{constructor(e,t,n){if(!(Array.isArray(e)&&e.reduce((e,t)=>e&&t instanceof i,!0)))throw TypeError(`fields must be array of Layout instances`);typeof t==`boolean`&&n===void 0&&(n=t,t=void 0);for(let t of e)if(0>t.span&&t.property===void 0)throw Error(`fields cannot contain unnamed variable-length layout`);let r=-1;try{r=e.reduce((e,t)=>e+t.getSpan(),0)}catch{}super(r,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((n,r)=>{let i=r.getSpan(e,t);return t+=i,n+i},0)}catch{throw RangeError(`indeterminate span`)}return n}decode(e,t=0){n(e);let r=this.makeDestinationObject();for(let n of this.fields)if(n.property!==void 0&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,n=0){let r=n,i=0,a=0;for(let r of this.fields){let o=r.span;if(a=0<o?o:0,r.property!==void 0){let i=e[r.property];i!==void 0&&(a=r.encode(i,t,n),0>o&&(o=r.getSpan(t,n)))}i=n,n+=o}return i+a-r}fromArray(e){let t=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0<e.length&&(t[n.property]=e.shift());return t}layoutFor(e){if(typeof e!=`string`)throw TypeError(`property must be string`);for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!=`string`)throw TypeError(`property must be string`);let t=0;for(let n of this.fields){if(n.property===e)return t;0>n.span?t=-1:0<=t&&(t+=n.span)}}};e.Structure=D;var O=class{constructor(e){this.property=e}decode(e,t){throw Error(`UnionDiscriminator is abstract`)}encode(e,t,n){throw Error(`UnionDiscriminator is abstract`)}};e.UnionDiscriminator=O;var k=class extends O{constructor(e,t){if(!(e instanceof s&&e.isCount()))throw TypeError(`layout must be an unsigned integer ExternalLayout`);super(t||e.property||`variant`),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,n){return this.layout.encode(e,t,n)}};e.UnionLayoutDiscriminator=k;var ee=class extends i{constructor(e,t,n){let r;if(e instanceof u||e instanceof d)r=new k(new l(e));else if(e instanceof s&&e.isCount())r=new k(e);else if(e instanceof O)r=e;else throw TypeError(`discr must be a UnionDiscriminator or an unsigned integer layout`);if(t===void 0&&(t=null),!(t===null||t instanceof i))throw TypeError(`defaultLayout must be null or a Layout`);if(t!==null){if(0>t.span)throw Error(`defaultLayout must have constant span`);t.property===void 0&&(t=t.replicate(`content`))}let a=-1;t&&(a=t.span,0<=a&&(e instanceof u||e instanceof d)&&(a+=r.layout.span)),super(a,n),this.discriminator=r,this.usesPrefixDiscriminator=e instanceof u||e instanceof d,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,t=0){if(0<=this.span)return this.span;let n=this.getVariant(e,t);if(!n)throw 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;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let n=this.registry[t];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw Error(`unable to infer src variant`)}decode(e,t=0){let n,r=this.discriminator,i=r.decode(e,t),a=this.registry[i];if(a===void 0){let a=this.defaultLayout,o=0;this.usesPrefixDiscriminator&&(o=r.layout.span),n=this.makeDestinationObject(),n[r.property]=i,n[a.property]=a.decode(e,t+o)}else n=a.decode(e,t);return n}encode(e,t,n=0){let r=this.getSourceVariant(e);if(r===void 0){let r=this.discriminator,i=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=r.layout.span),r.encode(e[r.property],t,n),a+i.encode(e[i.property],t,n+a)}return r.encode(e,t,n)}addVariant(e,t,n){let r=new te(this,e,t,n);return this.registry[e]=r,r}getVariant(e,t=0){let n;return n=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[n]}};e.Union=ee;var te=class extends i{constructor(e,t,n,r){if(!(e instanceof ee))throw TypeError(`union must be a Union`);if(!Number.isInteger(t)||0>t)throw TypeError(`variant must be a (non-negative) integer`);if(typeof n==`string`&&r===void 0&&(r=n,n=null),n){if(!(n instanceof i))throw TypeError(`layout must be a Layout`);if(e.defaultLayout!==null&&0<=n.span&&n.span>e.defaultLayout.span)throw Error(`variant span exceeds span of containing union`);if(typeof r!=`string`)throw TypeError(`variant must have a String property`)}let a=e.span;0>e.span&&(a=n?n.span:0,0<=a&&e.usesPrefixDiscriminator&&(a+=e.discriminator.layout.span)),super(a,r),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t=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,t=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw 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=0){let r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw TypeError(`variant lacks property `+this.property);this.union.discriminator.encode(this.variant,t,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 Error(`encoded variant overruns containing union`);return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};e.VariantLayout=te;function A(e){return 0>e&&(e+=4294967296),e}var ne=class extends i{constructor(e,t,n){if(!(e instanceof u||e instanceof d))throw TypeError(`word must be a UInt or UIntBE layout`);if(typeof t==`string`&&n===void 0&&(n=t,t=!1),4<e.span)throw RangeError(`word cannot exceed 32 bits`);super(e.span,n),this.word=e,this.msb=!!t,this.fields=[];let r=0;this._packedSetValue=function(e){return r=A(e),this},this._packedGetValue=function(){return r}}decode(e,t=0){let n=this.makeDestinationObject(),r=this.word.decode(e,t);this._packedSetValue(r);for(let t of this.fields)t.property!==void 0&&(n[t.property]=t.decode(e));return n}encode(e,t,n=0){let r=this.word.decode(t,n);this._packedSetValue(r);for(let t of this.fields)if(t.property!==void 0){let n=e[t.property];n!==void 0&&t.encode(n)}return this.word.encode(this._packedGetValue(),t,n)}addField(e,t){let n=new re(this,e,t);return this.fields.push(n),n}addBoolean(e){let t=new ie(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!=`string`)throw TypeError(`property must be string`);for(let t of this.fields)if(t.property===e)return t}};e.BitStructure=ne;var re=class{constructor(e,t,n){if(!(e instanceof ne))throw TypeError(`container must be a BitStructure`);if(!Number.isInteger(t)||0>=t)throw TypeError(`bits must be positive integer`);let r=8*e.span,i=e.fields.reduce((e,t)=>e+t.bits,0);if(t+i>r)throw Error(`bits too long for span remainder (`+(r-i)+` of `+r+` remain)`);this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=r-i-t),this.wordMask=A(this.valueMask<<this.start),this.property=n}decode(e,t){return A(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(e){if(typeof e!=`number`||!Number.isInteger(e)||e!==A(e&this.valueMask))throw TypeError(a(`BitField.encode`,this)+` value must be integer not exceeding `+this.valueMask);let t=this.container._packedGetValue(),n=A(e<<this.start);this.container._packedSetValue(A(t&~this.wordMask)|n)}};e.BitField=re;var ie=class extends re{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e==`boolean`&&(e=+e),super.encode(e)}};e.Boolean=ie;var j=class extends i{constructor(e,t){if(!(e instanceof s&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError(`length must be positive integer or an unsigned integer ExternalLayout`);let n=-1;e instanceof s||(n=e),super(n,t),this.length=e}getSpan(e,t){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),n}decode(e,t=0){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),r(e).slice(t,t+n)}encode(e,t,n){let i=this.length;if(this.length instanceof s&&(i=e.length),!(e instanceof Uint8Array&&i===e.length))throw TypeError(a(`Blob.encode`,this)+` requires (length `+i+`) Uint8Array as src`);if(n+i>t.length)throw RangeError(`encoding overruns Uint8Array`);let o=r(e);return r(t).write(o.toString(`hex`),n,i,`hex`),this.length instanceof s&&this.length.encode(i,t,n),i}};e.Blob=j;var M=class extends i{constructor(e){super(-1,e)}getSpan(e,t=0){n(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let n=this.getSpan(e,t);return r(e).slice(t,t+n-1).toString(`utf-8`)}encode(e,n,i=0){typeof e!=`string`&&(e=String(e));let a=t.Buffer.from(e,`utf8`),o=a.length;if(i+o>n.length)throw RangeError(`encoding overruns Buffer`);let s=r(n);return a.copy(s,i),s[i+o]=0,o+1}};e.CString=M;var ae=class extends i{constructor(e,t){if(typeof e==`string`&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw TypeError(`maxSpan must be an integer`);super(-1,t),this.maxSpan=e}getSpan(e,t=0){return n(e),e.length-t}decode(e,t=0){let n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<n)throw RangeError(`text length exceeds maxSpan`);return r(e).slice(t,t+n).toString(`utf-8`)}encode(e,n,i=0){typeof e!=`string`&&(e=String(e));let a=t.Buffer.from(e,`utf8`),o=a.length;if(0<=this.maxSpan&&this.maxSpan<o)throw RangeError(`text length exceeds maxSpan`);if(i+o>n.length)throw RangeError(`encoding overruns Buffer`);return a.copy(r(n),i),o}};e.UTF8=ae;var N=class extends i{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,n){return 0}};e.Constant=N,e.greedy=((e,t)=>new c(e,t)),e.offset=((e,t,n)=>new l(e,t,n)),e.u8=(e=>new u(1,e)),e.u16=(e=>new u(2,e)),e.u24=(e=>new u(3,e)),e.u32=(e=>new u(4,e)),e.u40=(e=>new u(5,e)),e.u48=(e=>new u(6,e)),e.nu64=(e=>new v(e)),e.u16be=(e=>new d(2,e)),e.u24be=(e=>new d(3,e)),e.u32be=(e=>new d(4,e)),e.u40be=(e=>new d(5,e)),e.u48be=(e=>new d(6,e)),e.nu64be=(e=>new y(e)),e.s8=(e=>new f(1,e)),e.s16=(e=>new f(2,e)),e.s24=(e=>new f(3,e)),e.s32=(e=>new f(4,e)),e.s40=(e=>new f(5,e)),e.s48=(e=>new f(6,e)),e.ns64=(e=>new b(e)),e.s16be=(e=>new p(2,e)),e.s24be=(e=>new p(3,e)),e.s32be=(e=>new p(4,e)),e.s40be=(e=>new p(5,e)),e.s48be=(e=>new p(6,e)),e.ns64be=(e=>new x(e)),e.f32=(e=>new S(e)),e.f32be=(e=>new C(e)),e.f64=(e=>new w(e)),e.f64be=(e=>new T(e)),e.struct=((e,t,n)=>new D(e,t,n)),e.bits=((e,t,n)=>new ne(e,t,n)),e.seq=((e,t,n)=>new E(e,t,n)),e.union=((e,t,n)=>new ee(e,t,n)),e.unionLayoutDiscriminator=((e,t)=>new k(e,t)),e.blob=((e,t)=>new j(e,t)),e.cstr=(e=>new M(e)),e.utf8=((e,t)=>new ae(e,t)),e.constant=((e,t)=>new N(e,t))}));function Ic(e){return Array.isArray(e)?`%5B`+e.map(Ic).join(`%2C%20`)+`%5D`:typeof e==`bigint`?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function Lc([e,t]){return`${e}=${Ic(t)}`}function Rc(e){let t=Object.entries(e).map(Lc).join(`&`);return btoa(t)}function zc(e,t={}){{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${Rc(t)}'`),`${n}\``}}var Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc=o((()=>{Bc=8078e3,Vc=8078001,Hc=8078004,Uc=8078005,Wc=8078006,Gc=8078011,Kc=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;if(t){let{cause:e,...i}=t;e&&(r={cause:e}),Object.keys(i).length>0&&(n=i)}let i=zc(e,n);super(i,r),this.context={__code:e,...n},this.name=`SolanaError`}}}));function Jc(e,t){return`fixedSize`in t?t.fixedSize:t.getSizeFromValue(e)}function Yc(e){return Object.freeze({...e,encode:t=>{let n=new Uint8Array(Jc(t,e));return e.write(t,n,0),n}})}function Xc(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function Zc(e){return`fixedSize`in e&&typeof e.fixedSize==`number`}function Qc(e,t){if(Zc(e)!==Zc(t))throw new Kc(Hc);if(Zc(e)&&Zc(t)&&e.fixedSize!==t.fixedSize)throw new Kc(Uc,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!Zc(e)&&!Zc(t)&&e.maxSize!==t.maxSize)throw new Kc(Wc,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function $c(e,t,n=0){if(t.length-n<=0)throw new Kc(Bc,{codecDescription:e})}function el(e,t,n,r=0){let i=n.length-r;if(i<t)throw new Kc(Vc,{bytesLength:i,codecDescription:e,expected:t})}var tl=o((()=>{qc()}));function nl(e,t,n,r){if(r<t||r>n)throw new Kc(Gc,{codecDescription:e,max:n,min:t,value:r})}function rl(e){return e?.endian!==1}function il(e){return Yc({fixedSize:e.size,write(t,n,r){e.range&&nl(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,rl(e.config)),n.set(new Uint8Array(i),r),r+e.size}})}function al(e){return Xc({fixedSize:e.size,read(t,n=0){$c(e.name,t,n),el(e.name,e.size,t,n);let r=new DataView(ol(t,n,e.size));return[e.get(r,rl(e.config)),n+e.size]}})}function ol(e,t,n){let r=e.byteOffset+(t??0),i=n??e.byteLength;return e.buffer.slice(r,r+i)}var sl,cl,ll,ul=o((()=>{qc(),tl(),sl=(e={})=>il({config:e,name:`u64`,range:[0n,BigInt(`0xffffffffffffffff`)],set:(e,t,n)=>e.setBigUint64(0,BigInt(t),n),size:8}),cl=(e={})=>al({config:e,get:(e,t)=>e.getBigUint64(0,t),name:`u64`,size:8}),ll=(e={})=>Qc(sl(e),cl(e))}));function dl(e){return fl(e)&&typeof e[Symbol.iterator]==`function`}function fl(e){return typeof e==`object`&&!!e}function pl(e){return fl(e)&&!Array.isArray(e)}function ml(e){return typeof e==`symbol`?e.toString():typeof e==`string`?JSON.stringify(e):`${e}`}function hl(e){let{done:t,value:n}=e.next();return t?void 0:n}function gl(e,t,n,r){if(e===!0)return;e===!1?e={}:typeof e==`string`&&(e={message:e});let{path:i,branch:a}=t,{type:o}=n,{refinement:s,message:c=`Expected a value of type \`${o}\`${s?` with refinement \`${s}\``:``}, but received: \`${ml(r)}\``}=e;return{value:r,type:o,refinement:s,key:i[i.length-1],path:i,branch:a,...e,message:c}}function*_l(e,t,n,r){dl(e)||(e=[e]);for(let i of e){let e=gl(i,t,n,r);e&&(yield e)}}function*vl(e,t,n={}){let{path:r=[],branch:i=[e],coerce:a=!1,mask:o=!1}=n,s={path:r,branch:i,mask:o};a&&(e=t.coercer(e,s));let c=`valid`;for(let r of t.validator(e,s))r.explanation=n.message,c=`not_valid`,yield[r,void 0];for(let[l,u,d]of t.entries(e,s)){let t=vl(u,d,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,u],coerce:a,mask:o,message:n.message});for(let n of t)n[0]?(c=n[0].refinement==null?`not_valid`:`not_refined`,yield[n[0],void 0]):a&&(u=n[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):fl(e)&&(u!==void 0||l in e)&&(e[l]=u))}if(c!==`not_valid`)for(let r of t.refiner(e,s))r.explanation=n.message,c=`not_refined`,yield[r,void 0];c===`valid`&&(yield[void 0,e])}function yl(e,t,n){let r=Sl(e,t,{message:n});if(r[0])throw r[0]}function B(e,t,n){let r=Sl(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function bl(e,t,n){let r=Sl(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function xl(e,t){return!Sl(e,t)[0]}function Sl(e,t,n={}){let r=vl(e,t,n),i=hl(r);return i[0]?[new Nl(i[0],function*(){for(let e of r)e[0]&&(yield e[0])}),void 0]:[void 0,i[1]]}function Cl(e,t){return new Pl({type:e,schema:null,validator:t})}function wl(){return Cl(`any`,()=>!0)}function V(e){return new Pl({type:`array`,schema:e,*entries(t){if(e&&Array.isArray(t))for(let[n,r]of t.entries())yield[n,r,e]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${ml(e)}`}})}function Tl(){return Cl(`boolean`,e=>typeof e==`boolean`)}function El(e){return Cl(`instance`,t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ml(t)}`)}function Dl(e){let t=ml(e),n=typeof e;return new Pl({type:`literal`,schema:n===`string`||n===`number`||n===`boolean`?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ml(n)}`}})}function Ol(){return Cl(`never`,()=>!1)}function H(e){return new Pl({...e,validator:(t,n)=>t===null||e.validator(t,n),refiner:(t,n)=>t===null||e.refiner(t,n)})}function U(){return Cl(`number`,e=>typeof e==`number`&&!isNaN(e)||`Expected a number, but received: ${ml(e)}`)}function W(e){return new Pl({...e,validator:(t,n)=>t===void 0||e.validator(t,n),refiner:(t,n)=>t===void 0||e.refiner(t,n)})}function kl(e,t){return new Pl({type:`record`,schema:null,*entries(n){if(fl(n))for(let r in n){let i=n[r];yield[r,r,e],yield[r,i,t]}},validator(e){return pl(e)||`Expected an object, but received: ${ml(e)}`},coercer(e){return pl(e)?{...e}:e}})}function G(){return Cl(`string`,e=>typeof e==`string`||`Expected a string, but received: ${ml(e)}`)}function Al(e){let t=Ol();return new Pl({type:`tuple`,schema:null,*entries(n){if(Array.isArray(n)){let r=Math.max(e.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],e[i]||t]}},validator(e){return Array.isArray(e)||`Expected an array, but received: ${ml(e)}`},coercer(e){return Array.isArray(e)?e.slice():e}})}function K(e){let t=Object.keys(e);return new Pl({type:`type`,schema:e,*entries(n){if(fl(n))for(let r of t)yield[r,n[r],e[r]]},validator(e){return pl(e)||`Expected an object, but received: ${ml(e)}`},coercer(e){return pl(e)?{...e}:e}})}function q(e){let t=e.map(e=>e.type).join(` | `);return new Pl({type:`union`,schema:null,coercer(t,n){for(let r of e){let[e,i]=r.validate(t,{coerce:!0,mask:n.mask});if(!e)return i}return t},validator(n,r){let i=[];for(let t of e){let[...e]=vl(n,t,r),[a]=e;if(a[0])for(let[t]of e)t&&i.push(t);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ml(n)}`,...i]}})}function jl(){return Cl(`unknown`,()=>!0)}function Ml(e,t,n){return new Pl({...e,coercer:(r,i)=>xl(r,t)?e.coercer(n(r,i),i):e.coercer(r,i)})}var Nl,Pl,Fl=o((()=>{Nl=class extends TypeError{constructor(e,t){let n,{message:r,explanation:i,...a}=e,{path:o}=e,s=o.length===0?r:`At path: ${o.join(`.`)} -- ${r}`;super(i??s),i!=null&&(this.cause=s),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??=[e,...t()]}},Pl=class{constructor(e){let{type:t,schema:n,validator:r,refiner:i,coercer:a=e=>e,entries:o=function*(){}}=e;this.type=t,this.schema=n,this.entries=o,this.coercer=a,r?this.validator=(e,t)=>_l(r(e,t),t,this,e):this.validator=()=>[],i?this.refiner=(e,t)=>_l(i(e,t),t,this,e):this.refiner=()=>[]}assert(e,t){return yl(e,this,t)}create(e,t){return B(e,this,t)}is(e){return xl(e,this)}mask(e,t){return bl(e,this,t)}validate(e,t={}){return Sl(e,this,t)}}}));function Il(){if(!Ll&&(Ll=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!Ll))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return Ll(Rl)}var Ll,Rl,zl=o((()=>{Rl=new Uint8Array(16)})),Bl,Vl=o((()=>{Bl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i}));function Hl(e){return typeof e==`string`&&Bl.test(e)}var Ul=o((()=>{Vl()}));function Wl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Gl[e[t+0]]+Gl[e[t+1]]+Gl[e[t+2]]+Gl[e[t+3]]+`-`+Gl[e[t+4]]+Gl[e[t+5]]+`-`+Gl[e[t+6]]+Gl[e[t+7]]+`-`+Gl[e[t+8]]+Gl[e[t+9]]+`-`+Gl[e[t+10]]+Gl[e[t+11]]+Gl[e[t+12]]+Gl[e[t+13]]+Gl[e[t+14]]+Gl[e[t+15]]).toLowerCase();if(!Hl(n))throw TypeError(`Stringified UUID is invalid`);return n}var Gl,Kl,ql=o((()=>{for(Ul(),Gl=[],Kl=0;Kl<256;++Kl)Gl.push((Kl+256).toString(16).substr(1))}));function Jl(e,t,n){var r=t&&n||0,i=t||Array(16);e||={};var a=e.node||Yl,o=e.clockseq===void 0?Xl:e.clockseq;if(a==null||o==null){var s=e.random||(e.rng||Il)();a??=Yl=[s[0]|1,s[1],s[2],s[3],s[4],s[5]],o??=Xl=(s[6]<<8|s[7])&16383}var c=e.msecs===void 0?Date.now():e.msecs,l=e.nsecs===void 0?Ql+1:e.nsecs,u=c-Zl+(l-Ql)/1e4;if(u<0&&e.clockseq===void 0&&(o=o+1&16383),(u<0||c>Zl)&&e.nsecs===void 0&&(l=0),l>=1e4)throw Error(`uuid.v1(): Can't create more than 10M uuids/sec`);Zl=c,Ql=l,Xl=o,c+=0xb1d069b5400;var d=((c&268435455)*1e4+l)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var f=c/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=f&255,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=o>>>8|128,i[r++]=o&255;for(var p=0;p<6;++p)i[r+p]=a[p];return t||Wl(i)}var Yl,Xl,Zl,Ql,$l=o((()=>{zl(),ql(),Zl=0,Ql=0}));function eu(e){if(!Hl(e))throw TypeError(`Invalid UUID`);var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}var tu=o((()=>{Ul()}));function nu(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}function ru(e,t,n){function r(e,r,i,a){if(typeof e==`string`&&(e=nu(e)),typeof r==`string`&&(r=eu(r)),r.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);var o=new Uint8Array(16+e.length);if(o.set(r),o.set(e,r.length),o=n(o),o[6]=o[6]&15|t,o[8]=o[8]&63|128,i){a||=0;for(var s=0;s<16;++s)i[a+s]=o[s];return i}return Wl(o)}try{r.name=e}catch{}return r.DNS=iu,r.URL=au,r}var iu,au,ou=o((()=>{ql(),tu(),iu=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,au=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`}));function su(e){if(typeof e==`string`){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return cu(uu(du(e),e.length*8))}function cu(e){for(var t=[],n=e.length*32,r=`0123456789abcdef`,i=0;i<n;i+=8){var a=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(a>>>4&15)+r.charAt(a&15),16);t.push(o)}return t}function lu(e){return(e+64>>>9<<4)+14+1}function uu(e,t){e[t>>5]|=128<<t%32,e[lu(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,c=r,l=i,u=a;n=hu(n,r,i,a,e[o],7,-680876936),a=hu(a,n,r,i,e[o+1],12,-389564586),i=hu(i,a,n,r,e[o+2],17,606105819),r=hu(r,i,a,n,e[o+3],22,-1044525330),n=hu(n,r,i,a,e[o+4],7,-176418897),a=hu(a,n,r,i,e[o+5],12,1200080426),i=hu(i,a,n,r,e[o+6],17,-1473231341),r=hu(r,i,a,n,e[o+7],22,-45705983),n=hu(n,r,i,a,e[o+8],7,1770035416),a=hu(a,n,r,i,e[o+9],12,-1958414417),i=hu(i,a,n,r,e[o+10],17,-42063),r=hu(r,i,a,n,e[o+11],22,-1990404162),n=hu(n,r,i,a,e[o+12],7,1804603682),a=hu(a,n,r,i,e[o+13],12,-40341101),i=hu(i,a,n,r,e[o+14],17,-1502002290),r=hu(r,i,a,n,e[o+15],22,1236535329),n=gu(n,r,i,a,e[o+1],5,-165796510),a=gu(a,n,r,i,e[o+6],9,-1069501632),i=gu(i,a,n,r,e[o+11],14,643717713),r=gu(r,i,a,n,e[o],20,-373897302),n=gu(n,r,i,a,e[o+5],5,-701558691),a=gu(a,n,r,i,e[o+10],9,38016083),i=gu(i,a,n,r,e[o+15],14,-660478335),r=gu(r,i,a,n,e[o+4],20,-405537848),n=gu(n,r,i,a,e[o+9],5,568446438),a=gu(a,n,r,i,e[o+14],9,-1019803690),i=gu(i,a,n,r,e[o+3],14,-187363961),r=gu(r,i,a,n,e[o+8],20,1163531501),n=gu(n,r,i,a,e[o+13],5,-1444681467),a=gu(a,n,r,i,e[o+2],9,-51403784),i=gu(i,a,n,r,e[o+7],14,1735328473),r=gu(r,i,a,n,e[o+12],20,-1926607734),n=_u(n,r,i,a,e[o+5],4,-378558),a=_u(a,n,r,i,e[o+8],11,-2022574463),i=_u(i,a,n,r,e[o+11],16,1839030562),r=_u(r,i,a,n,e[o+14],23,-35309556),n=_u(n,r,i,a,e[o+1],4,-1530992060),a=_u(a,n,r,i,e[o+4],11,1272893353),i=_u(i,a,n,r,e[o+7],16,-155497632),r=_u(r,i,a,n,e[o+10],23,-1094730640),n=_u(n,r,i,a,e[o+13],4,681279174),a=_u(a,n,r,i,e[o],11,-358537222),i=_u(i,a,n,r,e[o+3],16,-722521979),r=_u(r,i,a,n,e[o+6],23,76029189),n=_u(n,r,i,a,e[o+9],4,-640364487),a=_u(a,n,r,i,e[o+12],11,-421815835),i=_u(i,a,n,r,e[o+15],16,530742520),r=_u(r,i,a,n,e[o+2],23,-995338651),n=vu(n,r,i,a,e[o],6,-198630844),a=vu(a,n,r,i,e[o+7],10,1126891415),i=vu(i,a,n,r,e[o+14],15,-1416354905),r=vu(r,i,a,n,e[o+5],21,-57434055),n=vu(n,r,i,a,e[o+12],6,1700485571),a=vu(a,n,r,i,e[o+3],10,-1894986606),i=vu(i,a,n,r,e[o+10],15,-1051523),r=vu(r,i,a,n,e[o+1],21,-2054922799),n=vu(n,r,i,a,e[o+8],6,1873313359),a=vu(a,n,r,i,e[o+15],10,-30611744),i=vu(i,a,n,r,e[o+6],15,-1560198380),r=vu(r,i,a,n,e[o+13],21,1309151649),n=vu(n,r,i,a,e[o+4],6,-145523070),a=vu(a,n,r,i,e[o+11],10,-1120210379),i=vu(i,a,n,r,e[o+2],15,718787259),r=vu(r,i,a,n,e[o+9],21,-343485551),n=fu(n,s),r=fu(r,c),i=fu(i,l),a=fu(a,u)}return[n,r,i,a]}function du(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(lu(t)),r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function fu(e,t){var n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function pu(e,t){return e<<t|e>>>32-t}function mu(e,t,n,r,i,a){return fu(pu(fu(fu(t,e),fu(r,a)),i),n)}function hu(e,t,n,r,i,a,o){return mu(t&n|~t&r,e,t,i,a,o)}function gu(e,t,n,r,i,a,o){return mu(t&r|n&~r,e,t,i,a,o)}function _u(e,t,n,r,i,a,o){return mu(t^n^r,e,t,i,a,o)}function vu(e,t,n,r,i,a,o){return mu(n^(t|~r),e,t,i,a,o)}var yu=o((()=>{})),bu,xu=o((()=>{ou(),yu(),bu=ru(`v3`,48,su)}));function Su(e,t,n){e||={};var r=e.random||(e.rng||Il)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Wl(r)}var Cu=o((()=>{zl(),ql()}));function wu(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Tu(e,t){return e<<t|e>>>32-t}function Eu(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e==`string`){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=Array(o),c=0;c<o;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];s[c]=l}s[o-1][14]=(e.length-1)*8/2**32,s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var f=new Uint32Array(80),p=0;p<16;++p)f[p]=s[d][p];for(var m=16;m<80;++m)f[m]=Tu(f[m-3]^f[m-8]^f[m-14]^f[m-16],1);for(var h=n[0],g=n[1],_=n[2],v=n[3],y=n[4],b=0;b<80;++b){var x=Math.floor(b/20),S=Tu(h,5)+wu(x,g,_,v)+y+t[x]+f[b]>>>0;y=v,v=_,_=Tu(g,30)>>>0,g=h,h=S}n[0]=n[0]+h>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+_>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+y>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var Du=o((()=>{})),Ou,ku=o((()=>{ou(),Du(),Ou=ru(`v5`,80,Eu)})),Au,ju=o((()=>{Au=`00000000-0000-0000-0000-000000000000`}));function Mu(e){if(!Hl(e))throw TypeError(`Invalid UUID`);return parseInt(e.substr(14,1),16)}var Nu=o((()=>{Ul()})),Pu=c({NIL:()=>Au,parse:()=>eu,stringify:()=>Wl,v1:()=>Jl,v3:()=>bu,v4:()=>Su,v5:()=>Ou,validate:()=>Hl,version:()=>Mu}),Fu=o((()=>{$l(),xu(),Cu(),ku(),ju(),Nu(),Ul(),ql(),tu()})),Iu=s(((e,t)=>{var n=(Fu(),d(Pu)).v4;t.exports=function(e,t,r,i){if(typeof e!=`string`)throw TypeError(e+` must be a string`);i||={};let a=typeof i.version==`number`?i.version:2;if(a!==1&&a!==2)throw TypeError(a+` must be 1 or 2`);let o={method:e};if(a===2&&(o.jsonrpc=`2.0`),t){if(typeof t!=`object`&&!Array.isArray(t))throw TypeError(t+` must be an object, array or omitted`);o.params=t}return r===void 0?o.id=(typeof i.generator==`function`?i.generator:function(){return n()})(o,i):a===2&&r===null?i.notificationIdNull&&(o.id=null):o.id=r,o}})),Lu=s(((e,t)=>{var n=(Fu(),d(Pu)).v4,r=Iu(),i=function(e,t){if(!(this instanceof i))return new i(e,t);t||={},this.options={reviver:t.reviver===void 0?null:t.reviver,replacer:t.replacer===void 0?null:t.replacer,generator:t.generator===void 0?function(){return n()}:t.generator,version:t.version===void 0?2:t.version,notificationIdNull:typeof t.notificationIdNull==`boolean`?t.notificationIdNull:!1},this.callServer=e};t.exports=i,i.prototype.request=function(e,t,n,i){let a=this,o=null,s=Array.isArray(e)&&typeof t==`function`;if(this.options.version===1&&s)throw TypeError(`JSON-RPC 1.0 does not support batching`);if(s||!s&&e&&typeof e==`object`&&typeof t==`function`)i=t,o=e;else{typeof n==`function`&&(i=n,n=void 0);let a=typeof i==`function`;try{o=r(e,t,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(e){if(a){i(e);return}throw e}if(!a)return o}let c;try{c=JSON.stringify(o,this.options.replacer)}catch(e){i(e);return}return this.callServer(c,function(e,t){a._parseResponse(e,t,i)}),o},i.prototype._parseResponse=function(e,t,n){if(e){n(e);return}if(!t){n();return}let r;try{r=JSON.parse(t,this.options.reviver)}catch(e){n(e);return}if(n.length===3)if(Array.isArray(r)){let e=function(e){return e.error!==void 0};n(null,r.filter(e),r.filter(function(t){return!e(t)}));return}else{n(null,r.error,r.result);return}n(null,r)}})),Ru=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+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 s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),zu,Bu=o((()=>{zu=u(Ru(),1)}));function Vu(e,t){return new Uu(e,t)}var Hu,Uu,Wu,Gu,Ku=o((()=>{Hu=m(),Bu(),Uu=class extends zu.default{socket;constructor(e,t){super(),this.socket=new window.WebSocket(e,t.protocols),this.socket.onopen=()=>this.emit(`open`),this.socket.onmessage=e=>this.emit(`message`,e.data),this.socket.onerror=e=>this.emit(`error`,e),this.socket.onclose=e=>{this.emit(`close`,e.code,e.reason)}}send(e,t,n){let r=n||t;try{this.socket.send(e),r()}catch(e){r(e)}}close(e,t){this.socket.close(e,t)}addEventListener(e,t,n){this.socket.addEventListener(e,t,n)}},Wu=class{encode(e){return JSON.stringify(e)}decode(e){return JSON.parse(e)}},Gu=class extends zu.default{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(e,t=`ws://localhost:8080`,{autoconnect:n=!0,reconnect:r=!0,reconnect_interval:i=1e3,max_reconnects:a=5,...o}={},s,c){super(),this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=n,this.ready=!1,this.reconnect=r,this.reconnect_timer_id=void 0,this.reconnect_interval=i,this.max_reconnects=a,this.rest_options=o,this.current_reconnects=0,this.generate_request_id=s||(()=>typeof this.rpc_id==`number`?++this.rpc_id:Number(this.rpc_id)+1),c?this.dataPack=c:this.dataPack=new Wu,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,n,r){return!r&&typeof n==`object`&&(r=n,n=null),new Promise((i,a)=>{if(!this.ready)return a(Error(`socket not ready`));let o=this.generate_request_id(e,t),s={jsonrpc:`2.0`,method:e,params:t||void 0,id:o};this.socket.send(this.dataPack.encode(s),r,e=>{if(e)return a(e);this.queue[o]={promise:[i,a]},n&&(this.queue[o].timeout=setTimeout(()=>{delete this.queue[o],a(Error(`reply timeout`))},n))})})}async login(e){let t=await this.call(`rpc.login`,e);if(!t)throw Error(`authentication failed`);return t}async listMethods(){return await this.call(`__listMethods`)}notify(e,t){return new Promise((n,r)=>{if(!this.ready)return r(Error(`socket not ready`));let i={jsonrpc:`2.0`,method:e,params:t};this.socket.send(this.dataPack.encode(i),e=>{if(e)return r(e);n()})})}async subscribe(e){typeof e==`string`&&(e=[e]);let t=await this.call(`rpc.on`,e);if(typeof e==`string`&&t[e]!==`ok`)throw Error(`Failed subscribing to an event '`+e+`' with: `+t[e]);return t}async unsubscribe(e){typeof e==`string`&&(e=[e]);let t=await this.call(`rpc.off`,e);if(typeof e==`string`&&t[e]!==`ok`)throw Error(`Failed unsubscribing from an event with: `+t);return t}close(e,t){this.socket&&this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}getCurrentReconnects(){return this.current_reconnects}getMaxReconnects(){return this.max_reconnects}isReconnecting(){return this.reconnect_timer_id!==void 0}willReconnect(){return this.reconnect&&(this.max_reconnects===0||this.current_reconnects<this.max_reconnects)}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener(`open`,()=>{this.ready=!0,this.emit(`open`),this.current_reconnects=0}),this.socket.addEventListener(`message`,({data:e})=>{e instanceof ArrayBuffer&&(e=Hu.Buffer.from(e).toString());try{e=this.dataPack.decode(e)}catch{return}if(e.notification&&this.listeners(e.notification).length){if(!Object.keys(e.params).length)return this.emit(e.notification);let t=[e.notification];if(e.params.constructor===Object)t.push(e.params);else for(let n=0;n<e.params.length;n++)t.push(e.params[n]);return Promise.resolve().then(()=>{this.emit.apply(this,t)})}if(!this.queue[e.id])return e.method?Promise.resolve().then(()=>{this.emit(e.method,e?.params)}):void 0;`error`in e==`result`in e&&this.queue[e.id].promise[1](Error(`Server response malformed. Response must include either "result" or "error", but not both.`)),this.queue[e.id].timeout&&clearTimeout(this.queue[e.id].timeout),e.error?this.queue[e.id].promise[1](e.error):this.queue[e.id].promise[0](e.result),delete this.queue[e.id]}),this.socket.addEventListener(`error`,e=>this.emit(`error`,e)),this.socket.addEventListener(`close`,({code:n,reason:r})=>{this.ready&&setTimeout(()=>this.emit(`close`,n,r),0),this.ready=!1,this.socket=void 0,n!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)?this.reconnect_timer_id=setTimeout(()=>this._connect(e,t),this.reconnect_interval):this.reconnect&&this.max_reconnects>0&&this.current_reconnects>=this.max_reconnects&&setTimeout(()=>this.emit(`max_reconnects_reached`,n,r),1))})}}}));function qu(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=od(a,o,1)^n[r],c=sd(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=td[n],a=od(t,i,r),o=sd(t,i,r),s=ed[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=id[r],e[1]^=ad[r]}Ai(n)}var Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd=o((()=>{wa(),Yi(),Ju=BigInt(0),Yu=BigInt(1),Xu=BigInt(2),Zu=BigInt(7),Qu=BigInt(256),$u=BigInt(113),ed=[],td=[],nd=[];for(let e=0,t=Yu,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ed.push(2*(5*r+n)),td.push((e+1)*(e+2)/2%64);let i=Ju;for(let e=0;e<7;e++)t=(t<<Yu^(t>>Zu)*$u)%Qu,t&Xu&&(i^=Yu<<(Yu<<BigInt(e))-Yu);nd.push(i)}rd=ia(nd,!0),id=rd[0],ad=rd[1],od=(e,t,n)=>n>32?ga(e,t,n):ma(e,t,n),sd=(e,t,n)=>n>32?_a(e,t,n):ha(e,t,n),cd=class e extends Ji{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,wi(n),!(0<e&&e<200))throw Error(`only keccak-f1600 function is supported`);this.state=new Uint8Array(200),this.state32=ki(this.state)}clone(){return this._cloneInto()}keccak(){Wi(this.state32),qu(this.state32,this.rounds),Wi(this.state32),this.posOut=0,this.pos=0}update(e){Di(this),e=Ri(e),Ti(e);let{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Di(this,!1),Ti(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return wi(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Oi(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Ai(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},ld=(e,t,n)=>Bi(()=>new cd(t,e,n)),ld(6,144,224/8),ld(6,136,256/8),ld(6,104,384/8),ld(6,72,512/8),ld(1,144,224/8),ud=ld(1,136,256/8),ld(1,104,384/8),ld(1,72,512/8),dd=(e,t,n)=>Vi((r={})=>new cd(t,e,r.dkLen===void 0?n:r.dkLen,!0)),dd(31,168,128/8),dd(31,136,256/8)})),pd,md,hd=o((()=>{Yi(),pd=class extends Ji{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Ei(e);let n=Ri(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),Ai(i)}update(e){return Di(this),this.iHash.update(e),this}digestInto(e){Di(this),Ti(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},md=(e,t,n)=>new pd(e,t).update(n).digest(),md.create=(e,t)=>new pd(e,t)}));function gd(e,t,n){let[[r,i],[a,o]]=t,s=jd(o*e,n),c=jd(-i*e,n),l=e-s*r-c*a,u=-s*i-c*o,d=l<Pd,f=u<Pd;d&&(l=-l),f&&(u=-u);let p=ro(Math.ceil(Ya(n)/2))+Fd;if(l<Pd||l>=p||u<Pd||u>=p)throw Error(`splitScalar (endomorphism): failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}function _d(e){if(![`compact`,`recovered`,`der`].includes(e))throw Error(`Signature format must be "compact", "recovered", or "der"`);return e}function vd(e,t){let n={};for(let r of Object.keys(t))n[r]=e[r]===void 0?t[r]:e[r];return La(n.lowS,`lowS`),La(n.prehash,`prehash`),n.format!==void 0&&_d(n.format),n}function yd(e,t){let{BYTES:n}=e,r;if(typeof t==`bigint`)r=t;else{let i=Ga(`private key`,t);try{r=e.fromBytes(i)}catch{throw Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw Error(`invalid private key: out of range [1..N-1]`);return r}function bd(e,t={}){let n=Zo(`weierstrass`,e,t),{Fp:r,Fn:i}=n,a=n.CURVE,{h:o,n:s}=a;Qa(t,{},{allowInfinityPoint:`boolean`,clearCofactor:`function`,isTorsionFree:`function`,fromBytes:`function`,toBytes:`function`,endo:`object`,wrapPrivateKey:`boolean`});let{endo:c}=t;if(c&&(!r.is0(a.a)||typeof c.beta!=`bigint`||!Array.isArray(c.basises)))throw Error(`invalid endo: expected "beta": bigint and "basises": array`);let l=wd(r,i);function u(){if(!r.isOdd)throw Error(`compression is not supported: Field does not have .isOdd()`)}function d(e,t,n){let{x:i,y:a}=t.toAffine(),o=r.toBytes(i);return La(n,`isCompressed`),n?(u(),zi(xd(!r.isOdd(a)),o)):zi(Uint8Array.of(4),o,r.toBytes(a))}function f(e){Ra(e,void 0,`Point`);let{publicKey:t,publicKeyUncompressed:n}=l,i=e.length,a=e[0],o=e.subarray(1);if(i===t&&(a===2||a===3)){let e=r.fromBytes(o);if(!r.isValid(e))throw Error(`bad point: is not on curve, wrong x`);let t=h(e),n;try{n=r.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`bad point: is not on curve, sqrt error`+t)}u();let i=r.isOdd(n);return(a&1)==1!==i&&(n=r.neg(n)),{x:e,y:n}}else if(i===n&&a===4){let e=r.BYTES,t=r.fromBytes(o.subarray(0,e)),n=r.fromBytes(o.subarray(e,e*2));if(!g(t,n))throw Error(`bad point: is not on curve`);return{x:t,y:n}}else throw Error(`bad point: got length ${i}, expected compressed=${t} or uncompressed=${n}`)}let p=t.toBytes||d,m=t.fromBytes||f;function h(e){let t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function g(e,t){let n=r.sqr(t),i=h(e);return r.eql(n,i)}if(!g(a.Gx,a.Gy))throw Error(`bad curve params: generator point`);let _=r.mul(r.pow(a.a,Ld),Rd),v=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(_,v)))throw Error(`bad curve params: a or b`);function y(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw Error(`bad point coordinate ${e}`);return t}function b(e){if(!(e instanceof T))throw Error(`ProjectivePoint expected`)}function x(e){if(!c||!c.basises)throw Error(`no endo`);return gd(e,c.basises,i.ORDER)}let S=$a((e,t)=>{let{X:n,Y:i,Z:a}=e;if(r.eql(a,r.ONE))return{x:n,y:i};let o=e.is0();t??=o?r.ONE:r.inv(a);let s=r.mul(n,t),c=r.mul(i,t),l=r.mul(a,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error(`invZ was invalid`);return{x:s,y:c}}),C=$a(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw Error(`bad point: ZERO`)}let{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw Error(`bad point: x or y not field elements`);if(!g(n,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);return!0});function w(e,t,n,i,a){return n=new T(r.mul(n.X,e),n.Y,n.Z),t=zo(i,t),n=zo(a,n),t.add(n)}class T{constructor(e,t,n){this.X=y(`x`,e),this.Y=y(`y`,t,!0),this.Z=y(`z`,n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error(`invalid affine point`);if(e instanceof T)throw Error(`projective point not allowed`);return r.is0(t)&&r.is0(n)?T.ZERO:new T(t,n,r.ONE)}static fromBytes(e){let t=T.fromAffine(m(Ra(e,void 0,`point`)));return t.assertValidity(),t}static fromHex(e){return T.fromBytes(Ga(`pointHex`,e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return D.createCache(this,e),t||this.multiply(Ld),this}assertValidity(){C(this)}hasEvenY(){let{y:e}=this.toAffine();if(!r.isOdd)throw Error(`Field doesn't support isOdd`);return!r.isOdd(e)}equals(e){b(e);let{X:t,Y:n,Z:i}=this,{X:a,Y:o,Z:s}=e,c=r.eql(r.mul(t,s),r.mul(a,i)),l=r.eql(r.mul(n,s),r.mul(o,i));return c&&l}negate(){return new T(this.X,r.neg(this.Y),this.Z)}double(){let{a:e,b:t}=a,n=r.mul(t,Ld),{X:i,Y:o,Z:s}=this,c=r.ZERO,l=r.ZERO,u=r.ZERO,d=r.mul(i,i),f=r.mul(o,o),p=r.mul(s,s),m=r.mul(i,o);return m=r.add(m,m),u=r.mul(i,s),u=r.add(u,u),c=r.mul(e,u),l=r.mul(n,p),l=r.add(c,l),c=r.sub(f,l),l=r.add(f,l),l=r.mul(c,l),c=r.mul(m,c),u=r.mul(n,u),p=r.mul(e,p),m=r.sub(d,p),m=r.mul(e,m),m=r.add(m,u),u=r.add(d,d),d=r.add(u,d),d=r.add(d,p),d=r.mul(d,m),l=r.add(l,d),p=r.mul(o,s),p=r.add(p,p),d=r.mul(p,m),c=r.sub(c,d),u=r.mul(p,f),u=r.add(u,u),u=r.add(u,u),new T(c,l,u)}add(e){b(e);let{X:t,Y:n,Z:i}=this,{X:o,Y:s,Z:c}=e,l=r.ZERO,u=r.ZERO,d=r.ZERO,f=a.a,p=r.mul(a.b,Ld),m=r.mul(t,o),h=r.mul(n,s),g=r.mul(i,c),_=r.add(t,n),v=r.add(o,s);_=r.mul(_,v),v=r.add(m,h),_=r.sub(_,v),v=r.add(t,i);let y=r.add(o,c);return v=r.mul(v,y),y=r.add(m,g),v=r.sub(v,y),y=r.add(n,i),l=r.add(s,c),y=r.mul(y,l),l=r.add(h,g),y=r.sub(y,l),d=r.mul(f,v),l=r.mul(p,g),d=r.add(l,d),l=r.sub(h,d),d=r.add(h,d),u=r.mul(l,d),h=r.add(m,m),h=r.add(h,m),g=r.mul(f,g),v=r.mul(p,v),h=r.add(h,g),g=r.sub(m,g),g=r.mul(f,g),v=r.add(v,g),m=r.mul(h,v),u=r.add(u,m),m=r.mul(y,v),l=r.mul(_,l),l=r.sub(l,m),m=r.mul(_,h),d=r.mul(y,d),d=r.add(d,m),new T(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(T.ZERO)}multiply(e){let{endo:n}=t;if(!i.isValidNot0(e))throw Error(`invalid scalar: out of range`);let r,a,o=e=>D.cached(this,e,e=>Bo(T,e));if(n){let{k1neg:t,k1:i,k2neg:s,k2:c}=x(e),{p:l,f:u}=o(i),{p:d,f}=o(c);a=u.add(f),r=w(n.beta,l,d,t,s)}else{let{p:t,f:n}=o(e);r=t,a=n}return Bo(T,[r,a])[0]}multiplyUnsafe(e){let{endo:n}=t,r=this;if(!i.isValid(e))throw Error(`invalid scalar: out of range`);if(e===Pd||r.is0())return T.ZERO;if(e===Fd)return r;if(D.hasCache(this))return this.multiply(e);if(n){let{k1neg:t,k1:i,k2neg:a,k2:o}=x(e),{p1:s,p2:c}=Jo(T,r,i,o);return w(n.beta,s,c,t,a)}else return D.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){let r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return S(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return o===Fd?!0:e?e(T,this):D.unsafe(this,s).is0()}clearCofactor(){let{clearCofactor:e}=t;return o===Fd?this:e?e(T,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(e=!0){return La(e,`isCompressed`),this.assertValidity(),p(T,this,e)}toHex(e=!0){return Pi(this.toBytes(e))}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return Bo(T,e)}static msm(e,t){return Yo(T,i,e,t)}static fromPrivateKey(e){return T.BASE.multiply(yd(i,e))}}T.BASE=new T(a.Gx,a.Gy,r.ONE),T.ZERO=new T(r.ZERO,r.ONE,r.ZERO),T.Fp=r,T.Fn=i;let E=i.BITS,D=new ns(T,t.endo?Math.ceil(E/2):E);return T.BASE.precompute(8),T}function xd(e){return Uint8Array.of(e?2:3)}function Sd(e,t){let n=e.ORDER,r=Pd;for(let e=n-Fd;e%Id===Pd;e/=Id)r+=Fd;let i=r,a=Id<<i-Fd-Fd,o=a*Id,s=(n-Fd)/o,c=(s-Fd)/Id,l=o-Fd,u=a,d=e.pow(t,s),f=e.pow(t,(s+Fd)/Id),p=(t,n)=>{let r=d,a=e.pow(n,l),o=e.sqr(a);o=e.mul(o,n);let s=e.mul(t,o);s=e.pow(s,c),s=e.mul(s,a),a=e.mul(s,n),o=e.mul(s,t);let p=e.mul(o,a);s=e.pow(p,u);let m=e.eql(s,e.ONE);a=e.mul(o,f),s=e.mul(p,r),o=e.cmov(a,o,m),p=e.cmov(s,p,m);for(let t=i;t>Fd;t--){let n=t-Id;n=Id<<n-Fd;let i=e.pow(p,n),s=e.eql(i,e.ONE);a=e.mul(o,r),r=e.mul(r,r),i=e.mul(p,r),o=e.cmov(a,o,s),p=e.cmov(i,p,s)}return{isValid:m,value:o}};if(e.ORDER%Rd===Ld){let n=(e.ORDER-Ld)/Rd,r=e.sqrt(e.neg(t));p=(t,i)=>{let a=e.sqr(i),o=e.mul(t,i);a=e.mul(a,o);let s=e.pow(a,n);s=e.mul(s,o);let c=e.mul(s,r),l=e.mul(e.sqr(s),i),u=e.eql(l,t);return{isValid:u,value:e.cmov(c,s,u)}}}return p}function Cd(e,t){go(e);let{A:n,B:r,Z:i}=t;if(!e.isValid(n)||!e.isValid(r)||!e.isValid(i))throw Error(`mapToCurveSimpleSWU: invalid opts`);let a=Sd(e,i);if(!e.isOdd)throw Error(`Field does not have .isOdd()`);return t=>{let o,s,c,l,u,d,f,p;o=e.sqr(t),o=e.mul(o,i),s=e.sqr(o),s=e.add(s,o),c=e.add(s,e.ONE),c=e.mul(c,r),l=e.cmov(i,e.neg(s),!e.eql(s,e.ZERO)),l=e.mul(l,n),s=e.sqr(c),d=e.sqr(l),u=e.mul(d,n),s=e.add(s,u),s=e.mul(s,c),d=e.mul(d,l),u=e.mul(d,r),s=e.add(s,u),f=e.mul(o,c);let{isValid:m,value:h}=a(s,d);p=e.mul(o,t),p=e.mul(p,h),f=e.cmov(f,c,m),p=e.cmov(p,h,m);let g=e.isOdd(t)===e.isOdd(p);p=e.cmov(e.neg(p),p,g);let _=vo(e,[l],!0)[0];return f=e.mul(f,_),{x:f,y:p}}}function wd(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Td(e,t={}){let{Fn:n}=e,r=t.randomBytes||Hi,i=Object.assign(wd(e.Fp,n),{seed:wo(n.ORDER)});function a(e){try{return!!yd(n,e)}catch{return!1}}function o(t,n){let{publicKey:r,publicKeyUncompressed:a}=i;try{let i=t.length;return n===!0&&i!==r||n===!1&&i!==a?!1:!!e.fromBytes(t)}catch{return!1}}function s(e=r(i.seed)){return To(Ra(e,i.seed,`seed`),n.ORDER)}function c(t,r=!0){return e.BASE.multiply(yd(n,t)).toBytes(r)}function l(e){let t=s(e);return{secretKey:t,publicKey:c(t)}}function u(t){if(typeof t==`bigint`)return!1;if(t instanceof e)return!0;let{secretKey:r,publicKey:a,publicKeyUncompressed:o}=i;if(n.allowedLengths||r===a)return;let s=Ga(`key`,t).length;return s===a||s===o}function d(t,r,i=!0){if(u(t)===!0)throw Error(`first arg must be private key`);if(u(r)===!1)throw Error(`second arg must be public key`);let a=yd(n,t);return e.fromHex(r).multiply(a).toBytes(i)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:e,utils:{isValidSecretKey:a,isValidPublicKey:o,randomSecretKey:s,isValidPrivateKey:a,randomPrivateKey:s,normPrivateKeyToScalar:e=>yd(n,e),precompute(t=8,n=e.BASE){return n.precompute(t,!1)}},lengths:i})}function Ed(e,t,n={}){Ei(t),Qa(n,{},{hmac:`function`,lowS:`boolean`,randomBytes:`function`,bits2int:`function`,bits2int_modN:`function`});let r=n.randomBytes||Hi,i=n.hmac||((e,...n)=>md(t,e,zi(...n))),{Fp:a,Fn:o}=e,{ORDER:s,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:p}=Td(e,n),m={prehash:!1,lowS:typeof n.lowS==`boolean`?n.lowS:!1,format:void 0,extraEntropy:!1},h=`compact`;function g(e){return e>s>>Fd}function _(e,t){if(!o.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function v(e,t){_d(t);let n=p.signature;return Ra(e,t===`compact`?n:t===`recovered`?n+1:void 0,`${t} signature`)}class y{constructor(e,t,n){this.r=_(`r`,e),this.s=_(`s`,t),n!=null&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,t=h){v(e,t);let n;if(t===`der`){let{r:t,s:n}=Nd.toSig(Ra(e));return new y(t,n)}t===`recovered`&&(n=e[0],t=`compact`,e=e.subarray(1));let r=o.BYTES,i=e.subarray(0,r),a=e.subarray(r,r*2);return new y(o.fromBytes(i),o.fromBytes(a),n)}static fromHex(e,t){return this.fromBytes(Ii(e),t)}addRecoveryBit(e){return new y(this.r,this.s,e)}recoverPublicKey(t){let n=a.ORDER,{r,s:i,recovery:c}=this;if(c==null||![0,1,2,3].includes(c))throw Error(`recovery id invalid`);if(s*Id<n&&c>1)throw Error(`recovery id is ambiguous for h>1 curve`);let l=c===2||c===3?r+s:r;if(!a.isValid(l))throw Error(`recovery id 2 or 3 invalid`);let u=a.toBytes(l),d=e.fromBytes(zi(xd((c&1)==0),u)),f=o.inv(l),p=x(Ga(`msgHash`,t)),m=o.create(-p*f),h=o.create(i*f),g=e.BASE.multiplyUnsafe(m).add(d.multiplyUnsafe(h));if(g.is0())throw Error(`point at infinify`);return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(e=h){if(_d(e),e===`der`)return Ii(Nd.hexFromSig(this));let t=o.toBytes(this.r),n=o.toBytes(this.s);if(e===`recovered`){if(this.recovery==null)throw Error(`recovery bit must be present`);return zi(Uint8Array.of(this.recovery),t,n)}return zi(t,n)}toHex(e){return Pi(this.toBytes(e))}assertValidity(){}static fromCompact(e){return y.fromBytes(Ga(`sig`,e),`compact`)}static fromDER(e){return y.fromBytes(Ga(`sig`,e),`der`)}normalizeS(){return this.hasHighS()?new y(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes(`der`)}toDERHex(){return Pi(this.toBytes(`der`))}toCompactRawBytes(){return this.toBytes(`compact`)}toCompactHex(){return Pi(this.toBytes(`compact`))}}let b=n.bits2int||function(e){if(e.length>8192)throw Error(`input is too large`);let t=Va(e),n=e.length*8-c;return n>0?t>>BigInt(n):t},x=n.bits2int_modN||function(e){return o.create(b(e))},S=ro(c);function C(e){return Ja(`num < 2^`+c,e,Pd,S),o.toBytes(e)}function w(e,n){return Ra(e,void 0,`message`),n?Ra(t(e),void 0,`prehashed message`):e}function T(t,n,i){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{lowS:a,prehash:s,extraEntropy:c}=vd(i,m);t=w(t,s);let l=x(t),u=yd(o,n),d=[C(u),C(l)];if(c!=null&&c!==!1){let e=c===!0?r(p.secretKey):c;d.push(Ga(`extraEntropy`,e))}let f=zi(...d),h=l;function _(t){let n=b(t);if(!o.isValidNot0(n))return;let r=o.inv(n),i=e.BASE.multiply(n).toAffine(),s=o.create(i.x);if(s===Pd)return;let c=o.create(r*o.create(h+s*u));if(c===Pd)return;let l=(i.x===s?0:2)|Number(i.y&Fd),d=c;return a&&g(c)&&(d=o.neg(c),l^=1),new y(s,d,l)}return{seed:f,k2sig:_}}function E(e,n,r={}){e=Ga(`message`,e);let{seed:a,k2sig:s}=T(e,n,r);return Xa(t.outputLen,o.BYTES,i)(a,s)}function D(e){let t,n=typeof e==`string`||Ci(e),r=!n&&typeof e==`object`&&!!e&&typeof e.r==`bigint`&&typeof e.s==`bigint`;if(!n&&!r)throw Error(`invalid signature, expected Uint8Array, hex string or Signature instance`);if(r)t=new y(e.r,e.s);else if(n){try{t=y.fromBytes(Ga(`sig`,e),`der`)}catch(e){if(!(e instanceof Nd.Err))throw e}if(!t)try{t=y.fromBytes(Ga(`sig`,e),`compact`)}catch{return!1}}return t||!1}function O(t,n,r,i={}){let{lowS:a,prehash:s,format:c}=vd(i,m);if(r=Ga(`publicKey`,r),n=w(Ga(`message`,n),s),`strict`in i)throw Error(`options.strict was renamed to lowS`);let l=c===void 0?D(t):y.fromBytes(Ga(`sig`,t),c);if(l===!1)return!1;try{let t=e.fromBytes(r);if(a&&l.hasHighS())return!1;let{r:i,s}=l,c=x(n),u=o.inv(s),d=o.create(c*u),f=o.create(i*u),p=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(f));return p.is0()?!1:o.create(p.x)===i}catch{return!1}}function k(e,t,n={}){let{prehash:r}=vd(n,m);return t=w(t,r),y.fromBytes(e,`recovered`).recoverPublicKey(t).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:p,Point:e,sign:E,verify:O,recoverPublicKey:k,Signature:y,hash:t})}function Dd(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:xo(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function Od(e){let{CURVE:t,curveOpts:n}=Dd(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}function kd(e,t){let n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,bo(n.Fn.ORDER,n.Fn.BITS))})}function Ad(e){let{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:i}=Od(e);return kd(e,Ed(bd(t,n),r,i))}var jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd=o((()=>{hd(),Yi(),ao(),rs(),Ro(),jd=(e,t)=>(e+(e>=0?t:-t)/Id)/t,Md=class extends Error{constructor(e=``){super(e)}},Nd={Err:Md,_tlv:{encode:(e,t)=>{let{Err:n}=Nd;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=za(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?za(i.length/2|128):``;return za(e)+a+i+t},decode(e,t){let{Err:n}=Nd,r=0;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=Nd;if(e<Pd)throw new t(`integer: negative integers are not allowed`);let n=za(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=Nd;if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return Va(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=Nd,i=Ga(`signature`,e),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=Nd,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Pd=BigInt(0),Fd=BigInt(1),Id=BigInt(2),Ld=BigInt(3),Rd=BigInt(4)}));function Bd(e,t){let n=t=>Ad({...e,hash:t});return{...n(t),create:n}}var Vd=o((()=>{zd()}));function Hd(e){let t=Ud.p,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=so(so(so(u,n,t)*u%t,n,t)*u%t,Gd,t)*l%t,f=so(d,i,t)*d%t,p=so(f,a,t)*f%t,m=so(p,s,t)*p%t,h=so(so(so(so(so(so(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,Gd,t);if(!Kd.eql(Kd.sqr(h),e))throw Error(`Cannot find square root`);return h}var Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd=o((()=>{Ia(),Vd(),Ds(),Ro(),zd(),Ud={p:BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),n:BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt(`0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`),Gy:BigInt(`0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`)},Wd={beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),basises:[[BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),-BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`)],[BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),BigInt(`0x3086d221a7d46bcde86c90e49284eb15`)]]},Gd=BigInt(2),Kd=xo(Ud.p,{sqrt:Hd}),qd=Bd({...Ud,Fp:Kd,lowS:!0,endo:Wd},Pa),qd.Point,Jd=Cs(Kd,[[`0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7`,`0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581`,`0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262`,`0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c`],[`0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b`,`0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14`,`0x0000000000000000000000000000000000000000000000000000000000000001`],[`0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c`,`0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3`,`0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931`,`0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84`],[`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b`,`0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573`,`0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f`,`0x0000000000000000000000000000000000000000000000000000000000000001`]].map(e=>e.map(e=>BigInt(e)))),Yd=Cd(Kd,{A:BigInt(`0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533`),B:BigInt(`1771`),Z:Kd.create(BigInt(`-11`))}),Xd=ws(qd.Point,e=>{let{x:t,y:n}=Yd(Kd.create(e[0]));return Jd(t,n)},{DST:`secp256k1_XMD:SHA-256_SSWU_RO_`,encodeDST:`secp256k1_XMD:SHA-256_SSWU_NU_`,p:Kd.ORDER,m:1,k:128,expand:`xmd`,hash:Pa}),Xd.hashToCurve,Xd.encodeToCurve}));function Qd(e){try{return qs.ExtendedPoint.fromHex(e),!0}catch{return!1}}function $d(e){return e._bn!==void 0}function ef(e,t){let n=e=>{if(e.span>=0)return e.span;if(typeof e.alloc==`function`)return e.alloc(t[e.property]);if(`count`in e&&`elementLayout`in e){let r=t[e.property];if(Array.isArray(r))return r.length*n(e.elementLayout)}else if(`fields`in e)return ef({layout:e},t[e.property]);return 0},r=0;return e.layout.fields.forEach(e=>{r+=n(e)}),r}function tf(e){let t=0,n=0;for(;;){let r=e.shift();if(t|=(r&127)<<n*7,n+=1,!(r&128))break}return t}function nf(e,t){let n=t;for(;;){let t=n&127;if(n>>=7,n==0){e.push(t);break}else t|=128,e.push(t)}}function rf(e,t){if(!e)throw Error(t||`Assertion failed`)}function af(e){if(e.length===0)throw Error(tp);return e.shift()}function of(e,...t){let[n]=t;if(t.length===2?n+(t[1]??0)>e.length:n>=e.length)throw Error(tp);return e.splice(...t)}async function sf(e,t,n,r){let i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},a=await e.sendTransaction(t,n,i),o;if(t.recentBlockhash!=null&&t.lastValidBlockHeight!=null)o=(await e.confirmTransaction({abortSignal:r?.abortSignal,signature:a,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},r&&r.commitment)).value;else if(t.minNonceContextSlot!=null&&t.nonceInfo!=null){let{nonceInstruction:n}=t.nonceInfo,i=n.keys[0].pubkey;o=(await e.confirmTransaction({abortSignal:r?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:i,nonceValue:t.nonceInfo.nonce,signature:a},r&&r.commitment)).value}else r?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),o=(await e.confirmTransaction(a,r&&r.commitment)).value;if(o.err)throw a==null?Error(`Transaction ${a} failed (${JSON.stringify(o)})`):new hp({action:`send`,signature:a,transactionMessage:`Status: (${JSON.stringify(o)})`});return a}function cf(e){return new Promise(t=>setTimeout(t,e))}function lf(e,t){let n=e.layout.span>=0?e.layout.span:ef(e,t),r=Y.Buffer.alloc(n),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,r),r}function uf(e){let t=(0,jf.blob)(8,e),n=t.decode.bind(t),r=t.encode.bind(t),i=t,a=ll();return i.decode=(e,t)=>{let r=n(e,t);return a.decode(r)},i.encode=(e,t,n)=>r(a.encode(e),t,n),i}function df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function ff(){if(Tp)return wp;Tp=1;var e=Object.prototype.toString,t=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function n(r,i){var a,o,s,c,l,u,d;if(r===!0)return`true`;if(r===!1)return`false`;switch(typeof r){case`object`:if(r===null)return null;if(r.toJSON&&typeof r.toJSON==`function`)return n(r.toJSON(),i);if(d=e.call(r),d===`[object Array]`){for(s=`[`,o=r.length-1,a=0;a<o;a++)s+=n(r[a],!0)+`,`;return o>-1&&(s+=n(r[a],!0)),s+`]`}else if(d===`[object Object]`){for(c=t(r).sort(),o=c.length,s=``,a=0;a<o;)l=c[a],u=n(r[l],!1),u!==void 0&&(s&&(s+=`,`),s+=JSON.stringify(l)+`:`+u),a++;return`{`+s+`}`}else return JSON.stringify(r);case`function`:case`undefined`:return i?null:void 0;case`string`:return JSON.stringify(r);default:return isFinite(r)?r:null}}return wp=function(e){var t=n(e,!1);if(t!==void 0)return``+t},wp}function pf(e){let t=0;for(;e>1;)e/=2,t++;return t}function mf(e){return e===0?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e+1)}function hf(e,t){let n;try{n=e.layout.decode(t)}catch(e){throw Error(`invalid instruction; `+e)}if(n.typeIndex!==e.index)throw Error(`invalid account data; account type mismatch ${n.typeIndex} != ${e.index}`);return n}function gf(e){let t=e.match(Pp);if(t==null)throw TypeError(`Failed to validate endpoint URL \`${e}\``);let[n,r,i,a]=t,o=e.startsWith(`https:`)?`wss:`:`ws:`,s=i==null?null:parseInt(i.slice(1),10);return`${o}//${r}${s==null?``:`:${s+1}`}${a}`}function _f(e){if(/^https?:/.test(e)===!1)throw TypeError("Endpoint URL must start with `http:` or `https:`.");return e}function vf(e){let t,n;if(typeof e==`string`)t=e;else if(e){let{commitment:r,...i}=e;t=r,n=i}return{commitment:t,config:n}}function yf(e){return e.map(e=>`memcmp`in e?{...e,memcmp:{...e.memcmp,encoding:e.memcmp.encoding??`base58`}}:e)}function bf(e){return q([K({jsonrpc:Dl(`2.0`),id:G(),result:e}),K({jsonrpc:Dl(`2.0`),id:G(),error:K({code:jl(),message:G(),data:W(wl())})})])}function J(e){return Ml(bf(e),zp,t=>`error`in t?t:{...t,result:B(t.result,e)})}function xf(e){return J(K({context:K({slot:U()}),value:e}))}function Sf(e){return K({context:K({slot:U()}),value:e})}function Cf(e,t){return e===0?new rp({header:t.header,staticAccountKeys:t.accountKeys.map(e=>new Z(e)),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:kf.default.decode(e.data)})),addressTableLookups:t.addressTableLookups}):new np(t)}function wf(e,t,n,r,i,a){let o=n||kp;a!=null&&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.");let s;return r&&(s=async(e,t)=>await o(...await new Promise((n,i)=>{try{r(e,t,(e,t)=>n([e,t]))}catch(e){i(e)}}))),new Mf.default(async(n,r)=>{let a={method:`POST`,body:n,agent:void 0,headers:Object.assign({"Content-Type":`application/json`},t||{},hh)};try{let t=5,n,c=500;for(;n=s?await s(e,a):await o(e,a),!(n.status!==429||i===!0||(--t,t===0));)console.error(`Server responded with ${n.status} ${n.statusText}. Retrying after ${c}ms delay...`),await cf(c),c*=2;let l=await n.text();n.ok?r(null,l):r(Error(`${n.status} ${n.statusText}: ${l}`))}catch(e){e instanceof Error&&r(e)}},{})}function Tf(e){return(t,n)=>new Promise((r,i)=>{e.request(t,n,(e,t)=>{if(e){i(e);return}r(t)})})}function Ef(e){return t=>new Promise((n,r)=>{t.length===0&&n([]);let i=t.map(t=>e.request(t.methodName,t.args));e.request(i,(e,t)=>{if(e){r(e);return}n(t)})})}function Df(e,t){let n=t===!1?`http`:`https`;if(!e)return Hh[n].devnet;let r=Hh[n][e];if(!r)throw Error(`Unknown ${n} cluster: ${e}`);return r}var Y,Of,kf,Af,X,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Z,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,Q,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh=o((()=>{Y=m(),lc(),Of=u(dc()),kf=u(mc()),gc(),Af=Pc(),X=u(Fc()),jf=u(Fc()),ul(),Fl(),Mf=u(Lu()),Ku(),fd(),Zd(),qs.utils.randomPrivateKey,Nf=()=>{let e=qs.utils.randomPrivateKey(),t=Pf(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},Pf=qs.getPublicKey,Ff=(e,t)=>qs.sign(e,t.slice(0,32)),If=qs.verify,Lf=e=>Y.Buffer.isBuffer(e)?e:e instanceof Uint8Array?Y.Buffer.from(e.buffer,e.byteOffset,e.byteLength):Y.Buffer.from(e),Rf=class{constructor(e){Object.assign(this,e)}encode(){return Y.Buffer.from((0,Af.serialize)(zf,this))}static decode(e){return(0,Af.deserialize)(zf,this,e)}static decodeUnchecked(e){return(0,Af.deserializeUnchecked)(zf,this,e)}},zf=new Map,Vf=1,Z=class e extends Rf{constructor(e){if(super({}),this._bn=void 0,$d(e))this._bn=e._bn;else{if(typeof e==`string`){let t=kf.default.decode(e);if(t.length!=32)throw Error(`Invalid public key input`);this._bn=new Of.default(t)}else this._bn=new Of.default(e);if(this._bn.byteLength()>32)throw Error(`Invalid public key input`)}}static unique(){let t=new e(Vf);return Vf+=1,new e(t.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return kf.default.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){let e=this._bn.toArrayLike(Y.Buffer);if(e.length===32)return e;let t=Y.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,n,r){return new e(hc(Y.Buffer.concat([t.toBuffer(),Y.Buffer.from(n),r.toBuffer()])))}static createProgramAddressSync(t,n){let r=Y.Buffer.alloc(0);t.forEach(function(e){if(e.length>32)throw TypeError(`Max seed length exceeded`);r=Y.Buffer.concat([r,Lf(e)])}),r=Y.Buffer.concat([r,n.toBuffer(),Y.Buffer.from(`ProgramDerivedAddress`)]);let i=hc(r);if(Qd(i))throw Error(`Invalid seeds, address must fall off the curve`);return new e(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let n=255,r;for(;n!=0;){try{let i=e.concat(Y.Buffer.from([n]));r=this.createProgramAddressSync(i,t)}catch(e){if(e instanceof TypeError)throw e;n--;continue}return[r,n]}throw Error(`Unable to find a viable program address nonce`)}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(t){return Qd(new e(t).toBytes())}},Bf=Z,Z.default=new Bf(`11111111111111111111111111111111`),zf.set(Z,{kind:`struct`,fields:[[`_bn`,`u256`]]}),new Z(`BPFLoader1111111111111111111111111111111111`),Hf=1232,Uf=class extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}},Object.defineProperty(Uf.prototype,`name`,{value:`TransactionExpiredBlockheightExceededError`}),Wf=class extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}},Object.defineProperty(Wf.prototype,`name`,{value:`TransactionExpiredTimeoutError`}),Gf=class extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}},Object.defineProperty(Gf.prototype,`name`,{value:`TransactionExpiredNonceInvalidError`}),Kf=class{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){let e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(let t of this.keySegments())if(e<t.length)return t[e];else e-=t.length}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw Error(`Account index overflow encountered during compilation`);let t=new Map;this.keySegments().flat().forEach((e,n)=>{t.set(e.toBase58(),n)});let n=e=>{let n=t.get(e.toBase58());if(n===void 0)throw 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}))}},qf=(e=`publicKey`)=>X.blob(32,e),Jf=(e=`signature`)=>X.blob(64,e),Yf=(e=`string`)=>{let t=X.struct([X.u32(`length`),X.u32(`lengthPadding`),X.blob(X.offset(X.u32(),-8),`chars`)],e),n=t.decode.bind(t),r=t.encode.bind(t),i=t;return i.decode=(e,t)=>n(e,t).chars.toString(),i.encode=(e,t,n)=>r({chars:Y.Buffer.from(e,`utf8`)},t,n),i.alloc=e=>X.u32().span+X.u32().span+Y.Buffer.from(e,`utf8`).length,i},Xf=(e=`authorized`)=>X.struct([qf(`staker`),qf(`withdrawer`)],e),Zf=(e=`lockup`)=>X.struct([X.ns64(`unixTimestamp`),X.ns64(`epoch`),qf(`custodian`)],e),Qf=(e=`voteInit`)=>X.struct([qf(`nodePubkey`),qf(`authorizedVoter`),qf(`authorizedWithdrawer`),X.u8(`commission`)],e),$f=(e=`voteAuthorizeWithSeedArgs`)=>X.struct([X.u32(`voteAuthorizationType`),qf(`currentAuthorityDerivedKeyOwnerPubkey`),Yf(`currentAuthorityDerivedKeySeed`),qf(`newAuthorized`)],e),ep=class e{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(t,n){let r=new Map,i=e=>{let t=e.toBase58(),n=r.get(t);return n===void 0&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},a=i(n);a.isSigner=!0,a.isWritable=!0;for(let e of t){i(e.programId).isInvoked=!0;for(let t of e.keys){let e=i(t.pubkey);e.isSigner||=t.isSigner,e.isWritable||=t.isWritable}}return new e(n,r)}getMessageComponents(){let e=[...this.keyMetaMap.entries()];rf(e.length<=256,`Max static account keys length exceeded`);let t=e.filter(([,e])=>e.isSigner&&e.isWritable),n=e.filter(([,e])=>e.isSigner&&!e.isWritable),r=e.filter(([,e])=>!e.isSigner&&e.isWritable),i=e.filter(([,e])=>!e.isSigner&&!e.isWritable),a={numRequiredSignatures:t.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{rf(t.length>0,`Expected at least one writable signer key`);let[e]=t[0];rf(e===this.payer.toBase58(),`Expected first writable signer key to be the fee payer`)}return[a,[...t.map(([e])=>new Z(e)),...n.map(([e])=>new Z(e)),...r.map(([e])=>new Z(e)),...i.map(([e])=>new Z(e))]]}extractTableLookup(e){let[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(!(t.length===0&&r.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:r},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(e,t){let n=[],r=[];for(let[i,a]of this.keyMetaMap.entries())if(t(a)){let t=new Z(i),a=e.findIndex(e=>e.equals(t));a>=0&&(rf(a<256,`Max lookup table index exceeded`),n.push(a),r.push(t),this.keyMetaMap.delete(i))}return[n,r]}},tp=`Reached end of buffer unexpectedly`,np=class e{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 Z(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:kf.default.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Kf(this.staticAccountKeys)}static compile(t){let[n,r]=ep.compile(t.instructions,t.payerKey).getMessageComponents(),i=new Kf(r).compileInstructions(t.instructions).map(e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:kf.default.encode(e.data)}));return new e({header:n,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures;return e>=this.header.numRequiredSignatures?e-t<this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts:e<t-this.header.numReadonlySignedAccounts}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){let e=this.accountKeys.length,t=[];nf(t,e);let n=this.instructions.map(e=>{let{accounts:t,programIdIndex:n}=e,r=Array.from(kf.default.decode(e.data)),i=[];nf(i,t.length);let a=[];return nf(a,r.length),{programIdIndex:n,keyIndicesCount:Y.Buffer.from(i),keyIndices:t,dataLength:Y.Buffer.from(a),data:r}}),r=[];nf(r,n.length);let i=Y.Buffer.alloc(Hf);Y.Buffer.from(r).copy(i);let a=r.length;n.forEach(e=>{let t=X.struct([X.u8(`programIdIndex`),X.blob(e.keyIndicesCount.length,`keyIndicesCount`),X.seq(X.u8(`keyIndex`),e.keyIndices.length,`keyIndices`),X.blob(e.dataLength.length,`dataLength`),X.seq(X.u8(`userdatum`),e.data.length,`data`)]).encode(e,i,a);a+=t}),i=i.slice(0,a);let o=X.struct([X.blob(1,`numRequiredSignatures`),X.blob(1,`numReadonlySignedAccounts`),X.blob(1,`numReadonlyUnsignedAccounts`),X.blob(t.length,`keyCount`),X.seq(qf(`key`),e,`keys`),qf(`recentBlockhash`)]),s={numRequiredSignatures:Y.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Y.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Y.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Y.Buffer.from(t),keys:this.accountKeys.map(e=>Lf(e.toBytes())),recentBlockhash:kf.default.decode(this.recentBlockhash)},c=Y.Buffer.alloc(2048),l=o.encode(s,c);return i.copy(c,l),c.slice(0,l+i.length)}static from(t){let n=[...t],r=af(n);if(r!==(r&127))throw Error(`Versioned messages must be deserialized with VersionedMessage.deserialize()`);let i=af(n),a=af(n),o=tf(n),s=[];for(let e=0;e<o;e++){let e=of(n,0,32);s.push(new Z(Y.Buffer.from(e)))}let c=of(n,0,32),l=tf(n),u=[];for(let e=0;e<l;e++){let e=af(n),t=of(n,0,tf(n)),r=of(n,0,tf(n)),i=kf.default.encode(Y.Buffer.from(r));u.push({programIdIndex:e,accounts:t,data:i})}return new e({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:a},recentBlockhash:kf.default.encode(Y.Buffer.from(c)),accountKeys:s,instructions:u})}},rp=class e{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(let t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&`accountKeysFromLookups`in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw Error(`Failed to get account keys because of a mismatch in the number of account keys from lookups`);t=e.accountKeysFromLookups}else if(e&&`addressLookupTableAccounts`in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error(`Failed to get account keys because address table lookups were not resolved`);return new Kf(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures,n=this.staticAccountKeys.length;return e>=n?e-n<this.addressTableLookups.reduce((e,t)=>e+t.writableIndexes.length,0):e>=this.header.numRequiredSignatures?e-t<n-t-this.header.numReadonlyUnsignedAccounts:e<t-this.header.numReadonlySignedAccounts}resolveAddressTableLookups(e){let t={writable:[],readonly:[]};for(let n of this.addressTableLookups){let r=e.find(e=>e.key.equals(n.accountKey));if(!r)throw Error(`Failed to find address lookup table account for table key ${n.accountKey.toBase58()}`);for(let e of n.writableIndexes)if(e<r.state.addresses.length)t.writable.push(r.state.addresses[e]);else throw Error(`Failed to find address for index ${e} in address lookup table ${n.accountKey.toBase58()}`);for(let e of n.readonlyIndexes)if(e<r.state.addresses.length)t.readonly.push(r.state.addresses[e]);else throw Error(`Failed to find address for index ${e} in address lookup table ${n.accountKey.toBase58()}`)}return t}static compile(t){let n=ep.compile(t.instructions,t.payerKey),r=[],i={writable:[],readonly:[]},a=t.addressLookupTableAccounts||[];for(let e of a){let t=n.extractTableLookup(e);if(t!==void 0){let[e,{writable:n,readonly:a}]=t;r.push(e),i.writable.push(...n),i.readonly.push(...a)}}let[o,s]=n.getMessageComponents(),c=new Kf(s,i).compileInstructions(t.instructions);return new e({header:o,staticAccountKeys:s,recentBlockhash:t.recentBlockhash,compiledInstructions:c,addressTableLookups:r})}serialize(){let e=[];nf(e,this.staticAccountKeys.length);let t=this.serializeInstructions(),n=[];nf(n,this.compiledInstructions.length);let r=this.serializeAddressTableLookups(),i=[];nf(i,this.addressTableLookups.length);let a=X.struct([X.u8(`prefix`),X.struct([X.u8(`numRequiredSignatures`),X.u8(`numReadonlySignedAccounts`),X.u8(`numReadonlyUnsignedAccounts`)],`header`),X.blob(e.length,`staticAccountKeysLength`),X.seq(qf(),this.staticAccountKeys.length,`staticAccountKeys`),qf(`recentBlockhash`),X.blob(n.length,`instructionsLength`),X.blob(t.length,`serializedInstructions`),X.blob(i.length,`addressTableLookupsLength`),X.blob(r.length,`serializedAddressTableLookups`)]),o=new Uint8Array(Hf),s=a.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(e=>e.toBytes()),recentBlockhash:kf.default.decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:r},o);return o.slice(0,s)}serializeInstructions(){let e=0,t=new Uint8Array(Hf);for(let n of this.compiledInstructions){let r=[];nf(r,n.accountKeyIndexes.length);let i=[];nf(i,n.data.length);let a=X.struct([X.u8(`programIdIndex`),X.blob(r.length,`encodedAccountKeyIndexesLength`),X.seq(X.u8(),n.accountKeyIndexes.length,`accountKeyIndexes`),X.blob(i.length,`encodedDataLength`),X.blob(n.data.length,`data`)]);e+=a.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,t=new Uint8Array(Hf);for(let n of this.addressTableLookups){let r=[];nf(r,n.writableIndexes.length);let i=[];nf(i,n.readonlyIndexes.length);let a=X.struct([qf(`accountKey`),X.blob(r.length,`encodedWritableIndexesLength`),X.seq(X.u8(),n.writableIndexes.length,`writableIndexes`),X.blob(i.length,`encodedReadonlyIndexesLength`),X.seq(X.u8(),n.readonlyIndexes.length,`readonlyIndexes`)]);e+=a.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(t){let n=[...t],r=af(n),i=r&127;rf(r!==i,`Expected versioned message but received legacy message`);let a=i;rf(a===0,`Expected versioned message with version 0 but found version ${a}`);let o={numRequiredSignatures:af(n),numReadonlySignedAccounts:af(n),numReadonlyUnsignedAccounts:af(n)},s=[],c=tf(n);for(let e=0;e<c;e++)s.push(new Z(of(n,0,32)));let l=kf.default.encode(of(n,0,32)),u=tf(n),d=[];for(let e=0;e<u;e++){let e=af(n),t=of(n,0,tf(n)),r=tf(n),i=new Uint8Array(of(n,0,r));d.push({programIdIndex:e,accountKeyIndexes:t,data:i})}let f=tf(n),p=[];for(let e=0;e<f;e++){let e=new Z(of(n,0,32)),t=of(n,0,tf(n)),r=of(n,0,tf(n));p.push({accountKey:e,writableIndexes:t,readonlyIndexes:r})}return new e({header:o,staticAccountKeys:s,recentBlockhash:l,compiledInstructions:d,addressTableLookups:p})}},ip={deserializeMessageVersion(e){let t=e[0],n=t&127;return n===t?`legacy`:n},deserialize:e=>{let t=ip.deserializeMessageVersion(e);if(t===`legacy`)return np.from(e);if(t===0)return rp.deserialize(e);throw Error(`Transaction message version ${t} deserialization is not supported`)}},ap=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}({}),op=Y.Buffer.alloc(64).fill(0),sp=class{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Y.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:n})=>({pubkey:e.toJSON(),isSigner:t,isWritable:n})),programId:this.programId.toJSON(),data:[...this.data]}}},cp=class e{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`)){let{minContextSlot:t,nonceInfo:n}=e;this.minNonceContextSlot=t,this.nonceInfo=n}else if(Object.prototype.hasOwnProperty.call(e,`lastValidBlockHeight`)){let{blockhash:t,lastValidBlockHeight:n}=e;this.recentBlockhash=t,this.lastValidBlockHeight=n}else{let{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(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw Error(`No instructions`);return e.forEach(e=>{`instructions`in e?this.instructions=this.instructions.concat(e.instructions):`data`in e&&`programId`in e&&`keys`in e?this.instructions.push(e):this.instructions.push(new sp(e))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]==this.nonceInfo.nonceInstruction?this.instructions:[this.nonceInfo.nonceInstruction,...this.instructions]):(e=this.recentBlockhash,t=this.instructions),!e)throw Error(`Transaction recentBlockhash required`);t.length<1&&console.warn(`No instructions provided`);let n;if(this.feePayer)n=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)n=this.signatures[0].publicKey;else throw Error(`Transaction fee payer required`);for(let e=0;e<t.length;e++)if(t[e].programId===void 0)throw Error(`Transaction instruction index ${e} has undefined program id`);let r=[],i=[];t.forEach(e=>{e.keys.forEach(e=>{i.push({...e})});let t=e.programId.toString();r.includes(t)||r.push(t)}),r.forEach(e=>{i.push({pubkey:new Z(e),isSigner:!1,isWritable:!1})});let a=[];i.forEach(e=>{let t=e.pubkey.toString(),n=a.findIndex(e=>e.pubkey.toString()===t);n>-1?(a[n].isWritable=a[n].isWritable||e.isWritable,a[n].isSigner=a[n].isSigner||e.isSigner):a.push(e)}),a.sort(function(e,t){return e.isSigner===t.isSigner?e.isWritable===t.isWritable?e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),`en`,{localeMatcher:`best fit`,usage:`sort`,sensitivity:`variant`,ignorePunctuation:!1,numeric:!1,caseFirst:`lower`}):e.isWritable?-1:1:e.isSigner?-1:1});let o=a.findIndex(e=>e.pubkey.equals(n));if(o>-1){let[e]=a.splice(o,1);e.isSigner=!0,e.isWritable=!0,a.unshift(e)}else a.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(let e of this.signatures){let t=a.findIndex(t=>t.pubkey.equals(e.publicKey));if(t>-1)a[t].isSigner||(a[t].isSigner=!0,console.warn(`Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release.`));else throw Error(`unknown signer: ${e.publicKey.toString()}`)}let s=0,c=0,l=0,u=[],d=[];a.forEach(({pubkey:e,isSigner:t,isWritable:n})=>{t?(u.push(e.toString()),s+=1,n||(c+=1)):(d.push(e.toString()),n||(l+=1))});let f=u.concat(d),p=t.map(e=>{let{data:t,programId:n}=e;return{programIdIndex:f.indexOf(n.toString()),accounts:e.keys.map(e=>f.indexOf(e.pubkey.toString())),data:kf.default.encode(t)}});return p.forEach(e=>{rf(e.programIdIndex>=0),e.accounts.forEach(e=>rf(e>=0))}),new np({header:{numRequiredSignatures:s,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:l},accountKeys:f,recentBlockhash:e,instructions:p})}_compile(){let e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((e,n)=>t[n].equals(e.publicKey))||(this.signatures=t.map(e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw Error(`No signers`);let t=new Set;this.signatures=e.filter(e=>{let n=e.toString();return t.has(n)?!1:(t.add(n),!0)}).map(e=>({signature:null,publicKey:e}))}sign(...e){if(e.length===0)throw Error(`No signers`);let t=new Set,n=[];for(let r of e){let e=r.publicKey.toString();t.has(e)||(t.add(e),n.push(r))}this.signatures=n.map(e=>({signature:null,publicKey:e.publicKey}));let r=this._compile();this._partialSign(r,...n)}partialSign(...e){if(e.length===0)throw Error(`No signers`);let t=new Set,n=[];for(let r of e){let e=r.publicKey.toString();t.has(e)||(t.add(e),n.push(r))}let r=this._compile();this._partialSign(r,...n)}_partialSign(e,...t){let n=e.serialize();t.forEach(e=>{let t=Ff(n,e.secretKey);this._addSignature(e.publicKey,Lf(t))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){rf(t.length===64);let n=this.signatures.findIndex(t=>e.equals(t.publicKey));if(n<0)throw Error(`unknown signer: ${e.toString()}`);this.signatures[n].signature=Y.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){let n={};for(let{signature:r,publicKey:i}of this.signatures)r===null?t&&(n.missing||=[]).push(i):If(r,e,i.toBytes())||(n.invalid||=[]).push(i);return n.invalid||n.missing?n:void 0}serialize(e){let{requireAllSignatures:t,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),r=this.serializeMessage();if(n){let e=this._getMessageSignednessErrors(r,t);if(e){let t=`Signature verification failed.`;throw e.invalid&&(t+=`\nInvalid signature for public key${e.invalid.length===1?``:`(s)`} [\`${e.invalid.map(e=>e.toBase58()).join("`, `")}\`].`),e.missing&&(t+=`\nMissing signature for public key${e.missing.length===1?``:`(s)`} [\`${e.missing.map(e=>e.toBase58()).join("`, `")}\`].`),Error(t)}}return this._serialize(r)}_serialize(e){let{signatures:t}=this,n=[];nf(n,t.length);let r=n.length+t.length*64+e.length,i=Y.Buffer.alloc(r);return rf(t.length<256),Y.Buffer.from(n).copy(i,0),t.forEach(({signature:e},t)=>{e!==null&&(rf(e.length===64,`signature has invalid length`),Y.Buffer.from(e).copy(i,n.length+t*64))}),e.copy(i,n.length+t.length*64),rf(i.length<=Hf,`Transaction too large: ${i.length} > ${Hf}`),i}get keys(){return rf(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return rf(this.instructions.length===1),this.instructions[0].programId}get data(){return rf(this.instructions.length===1),this.instructions[0].data}static from(t){let n=[...t],r=tf(n),i=[];for(let e=0;e<r;e++){let e=of(n,0,64);i.push(kf.default.encode(Y.Buffer.from(e)))}return e.populate(np.from(n),i)}static populate(t,n=[]){let r=new e;return r.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(r.feePayer=t.accountKeys[0]),n.forEach((e,n)=>{let i={signature:e==kf.default.encode(op)?null:kf.default.decode(e),publicKey:t.accountKeys[n]};r.signatures.push(i)}),t.instructions.forEach(e=>{let n=e.accounts.map(e=>{let n=t.accountKeys[e];return{pubkey:n,isSigner:r.signatures.some(e=>e.publicKey.toString()===n.toString())||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}});r.instructions.push(new sp({keys:n,programId:t.accountKeys[e.programIdIndex],data:kf.default.decode(e.data)}))}),r._message=t,r._json=r.toJSON(),r}},lp=class e{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,t!==void 0)rf(t.length===e.header.numRequiredSignatures,`Expected signatures length to be equal to the number of required signatures`),this.signatures=t;else{let t=[];for(let n=0;n<e.header.numRequiredSignatures;n++)t.push(new Uint8Array(64));this.signatures=t}this.message=e}serialize(){let e=this.message.serialize(),t=[];nf(t,this.signatures.length);let n=X.struct([X.blob(t.length,`encodedSignaturesLength`),X.seq(Jf(),this.signatures.length,`signatures`),X.blob(e.length,`serializedMessage`)]),r=new Uint8Array(2048),i=n.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},r);return r.slice(0,i)}static deserialize(t){let n=[...t],r=[],i=tf(n);for(let e=0;e<i;e++)r.push(new Uint8Array(of(n,0,64)));return new e(ip.deserialize(new Uint8Array(n)),r)}sign(e){let t=this.message.serialize(),n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let r of e){let e=n.findIndex(e=>e.equals(r.publicKey));rf(e>=0,`Cannot sign with non signer key ${r.publicKey.toBase58()}`),this.signatures[e]=Ff(t,r.secretKey)}}addSignature(e,t){rf(t.byteLength===64,`Signature must be 64 bytes long`);let n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(t=>t.equals(e));rf(n>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[n]=t}},up=1e3/(160/64),dp=new Z(`SysvarC1ock11111111111111111111111111111111`),new Z(`SysvarEpochSchedu1e111111111111111111111111`),new Z(`Sysvar1nstructions1111111111111111111111111`),fp=new Z(`SysvarRecentB1ockHashes11111111111111111111`),pp=new Z(`SysvarRent111111111111111111111111111111111`),new Z(`SysvarRewards111111111111111111111111111111`),new Z(`SysvarS1otHashes111111111111111111111111111`),new Z(`SysvarS1otHistory11111111111111111111111111`),mp=new Z(`SysvarStakeHistory1111111111111111111111111`),hp=class extends Error{constructor({action:e,signature:t,transactionMessage:n,logs:r}){let i=r?`Logs: \n${JSON.stringify(r.slice(-10),null,2)}. `:``,a="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.",o;switch(e){case`send`:o=`Transaction ${t} resulted in an error. \n${n}. `+i+a;break;case`simulate`:o=`Simulation failed. \nMessage: ${n}. \n`+i+a;break;default:o=`Unknown action '${(e=>e)(e)}'`}super(o),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=n,this.transactionLogs=r||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let e=this.transactionLogs;if(!(typeof e==`object`&&e&&`then`in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,n)=>{e.getTransaction(this.signature).then(e=>{if(e&&e.meta&&e.meta.logMessages){let n=e.meta.logMessages;this.transactionLogs=n,t(n)}else n(Error(`Log messages not found`))}).catch(n)})),await this.transactionLogs}},Q=class extends Error{constructor({code:e,message:t,data:n},r){super(r==null?t:`${r}: ${t}`),this.code=void 0,this.data=void 0,this.code=e,this.data=n,this.name=`SolanaJSONRPCError`}},gp=X.nu64(`lamportsPerSignature`),_p=X.struct([X.u32(`version`),X.u32(`state`),qf(`authorizedPubkey`),qf(`nonce`),X.struct([gp],`feeCalculator`)]),vp=_p.span,yp=class e{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(t){let n=_p.decode(Lf(t),0);return new e({authorizedPubkey:new Z(n.authorizedPubkey),nonce:new Z(n.nonce).toString(),feeCalculator:n.feeCalculator})}},bp=Object.freeze({Create:{index:0,layout:X.struct([X.u32(`instruction`),X.ns64(`lamports`),X.ns64(`space`),qf(`programId`)])},Assign:{index:1,layout:X.struct([X.u32(`instruction`),qf(`programId`)])},Transfer:{index:2,layout:X.struct([X.u32(`instruction`),uf(`lamports`)])},CreateWithSeed:{index:3,layout:X.struct([X.u32(`instruction`),qf(`base`),Yf(`seed`),X.ns64(`lamports`),X.ns64(`space`),qf(`programId`)])},AdvanceNonceAccount:{index:4,layout:X.struct([X.u32(`instruction`)])},WithdrawNonceAccount:{index:5,layout:X.struct([X.u32(`instruction`),X.ns64(`lamports`)])},InitializeNonceAccount:{index:6,layout:X.struct([X.u32(`instruction`),qf(`authorized`)])},AuthorizeNonceAccount:{index:7,layout:X.struct([X.u32(`instruction`),qf(`authorized`)])},Allocate:{index:8,layout:X.struct([X.u32(`instruction`),X.ns64(`space`)])},AllocateWithSeed:{index:9,layout:X.struct([X.u32(`instruction`),qf(`base`),Yf(`seed`),X.ns64(`space`),qf(`programId`)])},AssignWithSeed:{index:10,layout:X.struct([X.u32(`instruction`),qf(`base`),Yf(`seed`),qf(`programId`)])},TransferWithSeed:{index:11,layout:X.struct([X.u32(`instruction`),uf(`lamports`),Yf(`seed`),qf(`programId`)])},UpgradeNonceAccount:{index:12,layout:X.struct([X.u32(`instruction`)])}}),xp=class e{constructor(){}static createAccount(e){let t=bp.Create,n=lf(t,{lamports:e.lamports,space:e.space,programId:Lf(e.programId.toBuffer())});return new sp({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:n})}static transfer(e){let t,n;if(`basePubkey`in e){let r=bp.TransferWithSeed;t=lf(r,{lamports:BigInt(e.lamports),seed:e.seed,programId:Lf(e.programId.toBuffer())}),n=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{let r=bp.Transfer;t=lf(r,{lamports:BigInt(e.lamports)}),n=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new sp({keys:n,programId:this.programId,data:t})}static assign(e){let t,n;if(`basePubkey`in e){let r=bp.AssignWithSeed;t=lf(r,{base:Lf(e.basePubkey.toBuffer()),seed:e.seed,programId:Lf(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let r=bp.Assign;t=lf(r,{programId:Lf(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new sp({keys:n,programId:this.programId,data:t})}static createAccountWithSeed(e){let t=bp.CreateWithSeed,n=lf(t,{base:Lf(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Lf(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new sp({keys:r,programId:this.programId,data:n})}static createNonceAccount(t){let n=new cp;`basePubkey`in t&&`seed`in t?n.add(e.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:vp,programId:this.programId})):n.add(e.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:vp,programId:this.programId}));let r={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}static nonceInitialize(e){let t=bp.InitializeNonceAccount,n=lf(t,{authorized:Lf(e.authorizedPubkey.toBuffer())});return new sp({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:fp,isSigner:!1,isWritable:!1},{pubkey:pp,isSigner:!1,isWritable:!1}],programId:this.programId,data:n})}static nonceAdvance(e){let t=bp.AdvanceNonceAccount,n=lf(t);return new sp({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:fp,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static nonceWithdraw(e){let t=bp.WithdrawNonceAccount,n=lf(t,{lamports:e.lamports});return new sp({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:fp,isSigner:!1,isWritable:!1},{pubkey:pp,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static nonceAuthorize(e){let t=bp.AuthorizeNonceAccount,n=lf(t,{authorized:Lf(e.newAuthorizedPubkey.toBuffer())});return new sp({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}static allocate(e){let t,n;if(`basePubkey`in e){let r=bp.AllocateWithSeed;t=lf(r,{base:Lf(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Lf(e.programId.toBuffer())}),n=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{let r=bp.Allocate;t=lf(r,{space:e.space}),n=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new sp({keys:n,programId:this.programId,data:t})}},xp.programId=new Z(`11111111111111111111111111111111`),Sp=Hf-300,Cp=class e{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/e.chunkSize)+1+1)}static async load(t,n,r,i,a){{let e=await t.getMinimumBalanceForRentExemption(a.length),o=await t.getAccountInfo(r.publicKey,`confirmed`),s=null;if(o!==null){if(o.executable)return console.error(`Program load failed, account is already executable`),!1;o.data.length!==a.length&&(s||=new cp,s.add(xp.allocate({accountPubkey:r.publicKey,space:a.length}))),o.owner.equals(i)||(s||=new cp,s.add(xp.assign({accountPubkey:r.publicKey,programId:i}))),o.lamports<e&&(s||=new cp,s.add(xp.transfer({fromPubkey:n.publicKey,toPubkey:r.publicKey,lamports:e-o.lamports})))}else s=new cp().add(xp.createAccount({fromPubkey:n.publicKey,newAccountPubkey:r.publicKey,lamports:e>0?e:1,space:a.length,programId:i}));s!==null&&await sf(t,s,[n,r],{commitment:`confirmed`})}let o=X.struct([X.u32(`instruction`),X.u32(`offset`),X.u32(`bytesLength`),X.u32(`bytesLengthPadding`),X.seq(X.u8(`byte`),X.offset(X.u32(),-8),`bytes`)]),s=e.chunkSize,c=0,l=a,u=[];for(;l.length>0;){let e=l.slice(0,s),a=Y.Buffer.alloc(s+16);o.encode({instruction:0,offset:c,bytes:e,bytesLength:0,bytesLengthPadding:0},a);let d=new cp().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:a});u.push(sf(t,d,[n,r],{commitment:`confirmed`})),t._rpcEndpoint.includes(`solana.com`)&&await cf(1e3/4),c+=s,l=l.slice(s)}await Promise.all(u);{let e=X.struct([X.u32(`instruction`)]),a=Y.Buffer.alloc(e.span);e.encode({instruction:1},a);let o=new cp().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:pp,isSigner:!1,isWritable:!1}],programId:i,data:a}),s=`processed`,c=await t.sendTransaction(o,[n,r],{preflightCommitment:s}),{context:l,value:u}=await t.confirmTransaction({signature:c,lastValidBlockHeight:o.lastValidBlockHeight,blockhash:o.recentBlockhash},s);if(u.err)throw Error(`Transaction ${c} failed (${JSON.stringify(u)})`);for(;;){try{if(await t.getSlot({commitment:s})>l.slot)break}catch{}await new Promise(e=>setTimeout(e,Math.round(up/2)))}}return!0}},Cp.chunkSize=Sp,new Z(`BPFLoader2111111111111111111111111111111111`),Ep=df(ff()),Dp=32,Op=class{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<this.firstNormalSlot){let t=pf(mf(e+Dp+1))-pf(Dp)-1;return[t,e-(this.getSlotsInEpoch(t)-Dp)]}else{let t=e-this.firstNormalSlot,n=Math.floor(t/this.slotsPerEpoch);return[this.firstNormalEpoch+n,t%this.slotsPerEpoch]}}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?(2**e-1)*Dp:(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?2**(e+pf(Dp)):this.slotsPerEpoch}},kp=globalThis.fetch,Ap=class extends Gu{constructor(e,t,n){super(e=>{let n=Vu(e,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return`socket`in n?this.underlyingSocket=n.socket:this.underlyingSocket=n,n},e,t,n),this.underlyingSocket=void 0}call(...e){let t=this.underlyingSocket?.readyState;return t===1?super.call(...e):Promise.reject(Error("Tried to call a JSON-RPC method `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+`)`))}notify(...e){let t=this.underlyingSocket?.readyState;return t===1?super.notify(...e):Promise.reject(Error("Tried to send a JSON-RPC notification `"+e[0]+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+`)`))}},jp=56,Mp=class{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){let e=BigInt(`0xffffffffffffffff`);return this.state.deactivationSlot===e}static deserialize(e){let t=hf(Np,e),n=e.length-jp;rf(n>=0,`lookup table is invalid`),rf(n%32==0,`lookup table is invalid`);let r=n/32,{addresses:i}=X.struct([X.seq(qf(),r,`addresses`)]).decode(e.slice(jp));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:t.authority.length===0?void 0:new Z(t.authority[0]),addresses:i.map(e=>new Z(e))}}},Np={index:1,layout:X.struct([X.u32(`typeIndex`),uf(`deactivationSlot`),X.nu64(`lastExtendedSlot`),X.u8(`lastExtendedStartIndex`),X.u8(),X.seq(qf(),X.offset(X.u8(),-1),`authority`)])},Pp=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i,Fp=Ml(El(Z),G(),e=>new Z(e)),Ip=Al([G(),Dl(`base64`)]),Lp=Ml(El(Y.Buffer),Ip,e=>Y.Buffer.from(e[0],`base64`)),Rp=30*1e3,zp=bf(jl()),Bp=K({foundation:U(),foundationTerm:U(),initial:U(),taper:U(),terminal:U()}),Vp=J(V(H(K({epoch:U(),effectiveSlot:U(),amount:U(),postBalance:U(),commission:W(H(U()))})))),Hp=V(K({slot:U(),prioritizationFee:U()})),Up=K({total:U(),validator:U(),foundation:U(),epoch:U()}),Wp=K({epoch:U(),slotIndex:U(),slotsInEpoch:U(),absoluteSlot:U(),blockHeight:W(U()),transactionCount:W(U())}),Gp=K({slotsPerEpoch:U(),leaderScheduleSlotOffset:U(),warmup:Tl(),firstNormalEpoch:U(),firstNormalSlot:U()}),Kp=kl(G(),V(U())),qp=H(q([K({}),G()])),Jp=K({err:qp}),Yp=Dl(`receivedSignature`),Xp=K({"solana-core":G(),"feature-set":W(U())}),Zp=K({program:G(),programId:Fp,parsed:jl()}),Qp=K({programId:Fp,accounts:V(Fp),data:G()}),$p=xf(K({err:H(q([K({}),G()])),logs:H(V(G())),accounts:W(H(V(H(K({executable:Tl(),owner:G(),lamports:U(),data:V(G()),rentEpoch:W(U())}))))),unitsConsumed:W(U()),returnData:W(H(K({programId:G(),data:Al([G(),Dl(`base64`)])}))),innerInstructions:W(H(V(K({index:U(),instructions:V(q([Zp,Qp]))}))))})),em=xf(K({byIdentity:kl(G(),V(U())),range:K({firstSlot:U(),lastSlot:U()})})),tm=J(Bp),nm=J(Up),rm=J(Hp),im=J(Wp),am=J(Gp),om=J(Kp),sm=J(U()),cm=xf(K({total:U(),circulating:U(),nonCirculating:U(),nonCirculatingAccounts:V(Fp)})),lm=K({amount:G(),uiAmount:H(U()),decimals:U(),uiAmountString:W(G())}),um=xf(V(K({address:Fp,amount:G(),uiAmount:H(U()),decimals:U(),uiAmountString:W(G())}))),dm=xf(V(K({pubkey:Fp,account:K({executable:Tl(),owner:Fp,lamports:U(),data:Lp,rentEpoch:U()})}))),fm=K({program:G(),parsed:jl(),space:U()}),pm=xf(V(K({pubkey:Fp,account:K({executable:Tl(),owner:Fp,lamports:U(),data:fm,rentEpoch:U()})}))),mm=xf(V(K({lamports:U(),address:Fp}))),hm=K({executable:Tl(),owner:Fp,lamports:U(),data:Lp,rentEpoch:U()}),gm=K({pubkey:Fp,account:hm}),_m=Ml(q([El(Y.Buffer),fm]),q([Ip,fm]),e=>Array.isArray(e)?B(e,Lp):e),vm=K({executable:Tl(),owner:Fp,lamports:U(),data:_m,rentEpoch:U()}),ym=K({pubkey:Fp,account:vm}),bm=K({state:q([Dl(`active`),Dl(`inactive`),Dl(`activating`),Dl(`deactivating`)]),active:U(),inactive:U()}),xm=J(V(K({signature:G(),slot:U(),err:qp,memo:H(G()),blockTime:W(H(U()))}))),Sm=J(V(K({signature:G(),slot:U(),err:qp,memo:H(G()),blockTime:W(H(U()))}))),Cm=K({subscription:U(),result:Sf(hm)}),wm=K({pubkey:Fp,account:hm}),Tm=K({subscription:U(),result:Sf(wm)}),Em=K({parent:U(),slot:U(),root:U()}),Dm=K({subscription:U(),result:Em}),Om=q([K({type:q([Dl(`firstShredReceived`),Dl(`completed`),Dl(`optimisticConfirmation`),Dl(`root`)]),slot:U(),timestamp:U()}),K({type:Dl(`createdBank`),parent:U(),slot:U(),timestamp:U()}),K({type:Dl(`frozen`),slot:U(),timestamp:U(),stats:K({numTransactionEntries:U(),numSuccessfulTransactions:U(),numFailedTransactions:U(),maxTransactionsPerEntry:U()})}),K({type:Dl(`dead`),slot:U(),timestamp:U(),err:G()})]),km=K({subscription:U(),result:Om}),Am=K({subscription:U(),result:Sf(q([Jp,Yp]))}),jm=K({subscription:U(),result:U()}),Mm=K({pubkey:G(),gossip:H(G()),tpu:H(G()),rpc:H(G()),version:H(G())}),Nm=K({votePubkey:G(),nodePubkey:G(),activatedStake:U(),epochVoteAccount:Tl(),epochCredits:V(Al([U(),U(),U()])),commission:U(),lastVote:U(),rootSlot:H(U())}),Pm=J(K({current:V(Nm),delinquent:V(Nm)})),Fm=q([Dl(`processed`),Dl(`confirmed`),Dl(`finalized`)]),Im=xf(V(H(K({slot:U(),confirmations:H(U()),err:qp,confirmationStatus:W(Fm)})))),Lm=J(U()),Rm=K({accountKey:Fp,writableIndexes:V(U()),readonlyIndexes:V(U())}),zm=K({signatures:V(G()),message:K({accountKeys:V(G()),header:K({numRequiredSignatures:U(),numReadonlySignedAccounts:U(),numReadonlyUnsignedAccounts:U()}),instructions:V(K({accounts:V(U()),data:G(),programIdIndex:U()})),recentBlockhash:G(),addressTableLookups:W(V(Rm))})}),Bm=K({pubkey:Fp,signer:Tl(),writable:Tl(),source:W(q([Dl(`transaction`),Dl(`lookupTable`)]))}),Vm=K({accountKeys:V(Bm),signatures:V(G())}),Hm=K({parsed:jl(),program:G(),programId:Fp}),Um=K({accounts:V(Fp),data:G(),programId:Fp}),Wm=Ml(q([Um,Hm]),q([K({parsed:jl(),program:G(),programId:G()}),K({accounts:V(G()),data:G(),programId:G()})]),e=>`accounts`in e?B(e,Um):B(e,Hm)),Gm=K({signatures:V(G()),message:K({accountKeys:V(Bm),instructions:V(Wm),recentBlockhash:G(),addressTableLookups:W(H(V(Rm)))})}),Km=K({accountIndex:U(),mint:G(),owner:W(G()),programId:W(G()),uiTokenAmount:lm}),qm=K({writable:V(Fp),readonly:V(Fp)}),Jm=K({err:qp,fee:U(),innerInstructions:W(H(V(K({index:U(),instructions:V(K({accounts:V(U()),data:G(),programIdIndex:U()}))})))),preBalances:V(U()),postBalances:V(U()),logMessages:W(H(V(G()))),preTokenBalances:W(H(V(Km))),postTokenBalances:W(H(V(Km))),loadedAddresses:W(qm),computeUnitsConsumed:W(U())}),Ym=K({err:qp,fee:U(),innerInstructions:W(H(V(K({index:U(),instructions:V(Wm)})))),preBalances:V(U()),postBalances:V(U()),logMessages:W(H(V(G()))),preTokenBalances:W(H(V(Km))),postTokenBalances:W(H(V(Km))),loadedAddresses:W(qm),computeUnitsConsumed:W(U())}),Xm=q([Dl(0),Dl(`legacy`)]),Zm=K({pubkey:G(),lamports:U(),postBalance:H(U()),rewardType:H(G()),commission:W(H(U()))}),Qm=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),transactions:V(K({transaction:zm,meta:H(Jm),version:W(Xm)})),rewards:W(V(Zm)),blockTime:H(U()),blockHeight:H(U())}))),$m=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),rewards:W(V(Zm)),blockTime:H(U()),blockHeight:H(U())}))),eh=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),transactions:V(K({transaction:Vm,meta:H(Jm),version:W(Xm)})),rewards:W(V(Zm)),blockTime:H(U()),blockHeight:H(U())}))),th=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),transactions:V(K({transaction:Gm,meta:H(Ym),version:W(Xm)})),rewards:W(V(Zm)),blockTime:H(U()),blockHeight:H(U())}))),nh=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),transactions:V(K({transaction:Vm,meta:H(Ym),version:W(Xm)})),rewards:W(V(Zm)),blockTime:H(U()),blockHeight:H(U())}))),rh=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),rewards:W(V(Zm)),blockTime:H(U()),blockHeight:H(U())}))),ih=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),transactions:V(K({transaction:zm,meta:H(Jm)})),rewards:W(V(Zm)),blockTime:H(U())}))),ah=J(H(K({blockhash:G(),previousBlockhash:G(),parentSlot:U(),signatures:V(G()),blockTime:H(U())}))),oh=J(H(K({slot:U(),meta:H(Jm),blockTime:W(H(U())),transaction:zm,version:W(Xm)}))),sh=J(H(K({slot:U(),transaction:Gm,meta:H(Ym),blockTime:W(H(U())),version:W(Xm)}))),ch=xf(K({blockhash:G(),lastValidBlockHeight:U()})),lh=xf(Tl()),uh=J(V(K({slot:U(),numTransactions:U(),numSlots:U(),samplePeriodSecs:U()}))),dh=xf(H(K({feeCalculator:K({lamportsPerSignature:U()})}))),fh=J(G()),ph=J(G()),mh=K({result:Sf(K({err:qp,logs:V(G()),signature:G()})),subscription:U()}),hh={"solana-client":`js/1.0.0-maintenance`},gh=class{constructor(e,t){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=(()=>{let e={};return async t=>{let{commitment:n,config:r}=vf(t),i=this._buildArgs([],n,void 0,r),a=Ep(i);return e[a]=e[a]??(async()=>{try{let e=B(await this._rpcRequest(`getBlockHeight`,i),J(U()));if(`error`in e)throw new Q(e.error,`failed to get block height information`);return e.result}finally{delete e[a]}})(),await e[a]}})();let n,r,i,a,o,s;t&&typeof t==`string`?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,n=t.wsEndpoint,r=t.httpHeaders,i=t.fetch,a=t.fetchMiddleware,o=t.disableRetryOnRateLimit,s=t.httpAgent),this._rpcEndpoint=_f(e),this._rpcWsEndpoint=n||gf(e),this._rpcClient=wf(e,r,i,a,o,s),this._rpcRequest=Tf(this._rpcClient),this._rpcBatchRequest=Ef(this._rpcClient),this._rpcWebSocket=new Ap(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){let{commitment:n,config:r}=vf(t),i=this._buildArgs([e.toBase58()],n,void 0,r),a=B(await this._rpcRequest(`getBalance`,i),xf(U()));if(`error`in a)throw new Q(a.error,`failed to get balance for ${e.toBase58()}`);return a.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then(e=>e.value).catch(t=>{throw Error(`failed to get balance of account `+e.toBase58()+`: `+t)})}async getBlockTime(e){let t=B(await this._rpcRequest(`getBlockTime`,[e]),J(H(U())));if(`error`in t)throw new Q(t.error,`failed to get block time for slot ${e}`);return t.result}async getMinimumLedgerSlot(){let e=B(await this._rpcRequest(`minimumLedgerSlot`,[]),J(U()));if(`error`in e)throw new Q(e.error,`failed to get minimum ledger slot`);return e.result}async getFirstAvailableBlock(){let e=B(await this._rpcRequest(`getFirstAvailableBlock`,[]),sm);if(`error`in e)throw new Q(e.error,`failed to get first available block`);return e.result}async getSupply(e){let t={};t=typeof e==`string`?{commitment:e}:e?{...e,commitment:e&&e.commitment||this.commitment}:{commitment:this.commitment};let n=B(await this._rpcRequest(`getSupply`,[t]),cm);if(`error`in n)throw new Q(n.error,`failed to get supply`);return n.result}async getTokenSupply(e,t){let n=this._buildArgs([e.toBase58()],t),r=B(await this._rpcRequest(`getTokenSupply`,n),xf(lm));if(`error`in r)throw new Q(r.error,`failed to get token supply`);return r.result}async getTokenAccountBalance(e,t){let n=this._buildArgs([e.toBase58()],t),r=B(await this._rpcRequest(`getTokenAccountBalance`,n),xf(lm));if(`error`in r)throw new Q(r.error,`failed to get token account balance`);return r.result}async getTokenAccountsByOwner(e,t,n){let{commitment:r,config:i}=vf(n),a=[e.toBase58()];`mint`in t?a.push({mint:t.mint.toBase58()}):a.push({programId:t.programId.toBase58()});let o=this._buildArgs(a,r,`base64`,i),s=B(await this._rpcRequest(`getTokenAccountsByOwner`,o),dm);if(`error`in s)throw new Q(s.error,`failed to get token accounts owned by account ${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()});let i=this._buildArgs(r,n,`jsonParsed`),a=B(await this._rpcRequest(`getTokenAccountsByOwner`,i),pm);if(`error`in a)throw new Q(a.error,`failed to get token accounts owned by account ${e.toBase58()}`);return a.result}async getLargestAccounts(e){let t={...e,commitment:e&&e.commitment||this.commitment},n=t.filter||t.commitment?[t]:[],r=B(await this._rpcRequest(`getLargestAccounts`,n),mm);if(`error`in r)throw new Q(r.error,`failed to get largest accounts`);return r.result}async getTokenLargestAccounts(e,t){let n=this._buildArgs([e.toBase58()],t),r=B(await this._rpcRequest(`getTokenLargestAccounts`,n),um);if(`error`in r)throw new Q(r.error,`failed to get token largest accounts`);return r.result}async getAccountInfoAndContext(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgs([e.toBase58()],n,`base64`,r),a=B(await this._rpcRequest(`getAccountInfo`,i),xf(H(hm)));if(`error`in a)throw new Q(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getParsedAccountInfo(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgs([e.toBase58()],n,`jsonParsed`,r),a=B(await this._rpcRequest(`getAccountInfo`,i),xf(H(vm)));if(`error`in a)throw new Q(a.error,`failed to get info about account ${e.toBase58()}`);return a.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(t){throw Error(`failed to get info about account `+e.toBase58()+`: `+t)}}async getMultipleParsedAccounts(e,t){let{commitment:n,config:r}=vf(t),i=e.map(e=>e.toBase58()),a=this._buildArgs([i],n,`jsonParsed`,r),o=B(await this._rpcRequest(`getMultipleAccounts`,a),xf(V(H(vm))));if(`error`in o)throw new Q(o.error,`failed to get info for accounts ${i}`);return o.result}async getMultipleAccountsInfoAndContext(e,t){let{commitment:n,config:r}=vf(t),i=e.map(e=>e.toBase58()),a=this._buildArgs([i],n,`base64`,r),o=B(await this._rpcRequest(`getMultipleAccounts`,a),xf(V(H(hm))));if(`error`in o)throw new Q(o.error,`failed to get info for accounts ${i}`);return o.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,n){let{commitment:r,config:i}=vf(t),a=this._buildArgs([e.toBase58()],r,void 0,{...i,epoch:n??i?.epoch}),o=B(await this._rpcRequest(`getStakeActivation`,a),J(bm));if(`error`in o)throw new Q(o.error,`failed to get Stake Activation ${e.toBase58()}`);return o.result}async getProgramAccounts(e,t){let{commitment:n,config:r}=vf(t),{encoding:i,...a}=r||{},o=this._buildArgs([e.toBase58()],n,i||`base64`,{...a,...a.filters?{filters:yf(a.filters)}:null}),s=await this._rpcRequest(`getProgramAccounts`,o),c=V(gm),l=a.withContext===!0?B(s,xf(c)):B(s,J(c));if(`error`in l)throw new Q(l.error,`failed to get accounts owned by program ${e.toBase58()}`);return l.result}async getParsedProgramAccounts(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgs([e.toBase58()],n,`jsonParsed`,r),a=B(await this._rpcRequest(`getProgramAccounts`,i),J(V(ym)));if(`error`in a)throw new Q(a.error,`failed to get accounts owned by program ${e.toBase58()}`);return a.result}async confirmTransaction(e,t){let n;if(typeof e==`string`)n=e;else{let t=e;if(t.abortSignal?.aborted)return Promise.reject(t.abortSignal.reason);n=t.signature}let r;try{r=kf.default.decode(n)}catch{throw Error(`signature must be base58 encoded: `+n)}return rf(r.length===64,`signature has invalid length`),typeof e==`string`?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)=>{e!=null&&(e.aborted?n(e.reason):e.addEventListener(`abort`,()=>{n(e.reason)}))})}getTransactionConfirmationPromise({commitment:e,signature:t}){let n,r,i=!1;return{abortConfirmation:()=>{r&&=(r(),void 0),n!=null&&(this.removeSignatureListener(n),n=void 0)},confirmationPromise:new Promise((a,o)=>{try{n=this.onSignature(t,(e,t)=>{n=void 0;let r={context:t,value:e};a({__type:ap.PROCESSED,response:r})},e);let s=new Promise(e=>{n==null?e():r=this._onSubscriptionStateChange(n,t=>{t===`subscribed`&&e()})});(async()=>{if(await s,i)return;let n=await this.getSignatureStatus(t);if(i||n==null)return;let{context:r,value:c}=n;if(c!=null)if(c?.err)o(c.err);else{switch(e){case`confirmed`:case`single`:case`singleGossip`:if(c.confirmationStatus===`processed`)return;break;case`finalized`:case`max`:case`root`:if(c.confirmationStatus===`processed`||c.confirmationStatus===`confirmed`)return;break;case`processed`:case`recent`:}i=!0,a({__type:ap.PROCESSED,response:{context:r,value:c}})}})()}catch(e){o(e)}})}}async confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:e,strategy:{abortSignal:t,lastValidBlockHeight:n,signature:r}}){let i=!1,a=new Promise(t=>{let r=async()=>{try{return await this.getBlockHeight(e)}catch{return-1}};(async()=>{let e=await r();if(!i){for(;e<=n;)if(await cf(1e3),i||(e=await r(),i))return;t({__type:ap.BLOCKHEIGHT_EXCEEDED})}})()}),{abortConfirmation:o,confirmationPromise:s}=this.getTransactionConfirmationPromise({commitment:e,signature:r}),c=this.getCancellationPromise(t),l;try{let e=await Promise.race([c,s,a]);if(e.__type===ap.PROCESSED)l=e.response;else throw new Uf(r)}finally{i=!0,o()}return l}async confirmTransactionUsingDurableNonceStrategy({commitment:e,strategy:{abortSignal:t,minContextSlot:n,nonceAccountPubkey:r,nonceValue:i,signature:a}}){let o=!1,s=new Promise(t=>{let a=i,s=null,c=async()=>{try{let{context:t,value:i}=await this.getNonceAndContext(r,{commitment:e,minContextSlot:n});return s=t.slot,i?.nonce}catch{return a}};(async()=>{if(a=await c(),!o)for(;;){if(i!==a){t({__type:ap.NONCE_INVALID,slotInWhichNonceDidAdvance:s});return}if(await cf(2e3),o||(a=await c(),o))return}})()}),{abortConfirmation:c,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:e,signature:a}),u=this.getCancellationPromise(t),d;try{let t=await Promise.race([u,l,s]);if(t.__type===ap.PROCESSED)d=t.response;else{let r;for(;;){let e=await this.getSignatureStatus(a);if(e==null)break;if(e.context.slot<(t.slotInWhichNonceDidAdvance??n)){await cf(400);continue}r=e;break}if(r?.value){let t=e||`finalized`,{confirmationStatus:n}=r.value;switch(t){case`processed`:case`recent`:if(n!==`processed`&&n!==`confirmed`&&n!==`finalized`)throw new Gf(a);break;case`confirmed`:case`single`:case`singleGossip`:if(n!==`confirmed`&&n!==`finalized`)throw new Gf(a);break;case`finalized`:case`max`:case`root`:if(n!==`finalized`)throw new Gf(a);break;default:(e=>{})(t)}d={context:r.context,value:{err:r.value.err}}}else throw new Gf(a)}}finally{o=!0,c()}return d}async confirmTransactionUsingLegacyTimeoutStrategy({commitment:e,signature:t}){let n,r=new Promise(t=>{let r=this._confirmTransactionInitialTimeout||60*1e3;switch(e){case`processed`:case`recent`:case`single`:case`confirmed`:case`singleGossip`:r=this._confirmTransactionInitialTimeout||30*1e3;break}n=setTimeout(()=>t({__type:ap.TIMED_OUT,timeoutMs:r}),r)}),{abortConfirmation:i,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:e,signature:t}),o;try{let e=await Promise.race([a,r]);if(e.__type===ap.PROCESSED)o=e.response;else throw new Wf(t,e.timeoutMs/1e3)}finally{clearTimeout(n),i()}return o}async getClusterNodes(){let e=B(await this._rpcRequest(`getClusterNodes`,[]),J(V(Mm)));if(`error`in e)throw new Q(e.error,`failed to get cluster nodes`);return e.result}async getVoteAccounts(e){let t=this._buildArgs([],e),n=B(await this._rpcRequest(`getVoteAccounts`,t),Pm);if(`error`in n)throw new Q(n.error,`failed to get vote accounts`);return n.result}async getSlot(e){let{commitment:t,config:n}=vf(e),r=this._buildArgs([],t,void 0,n),i=B(await this._rpcRequest(`getSlot`,r),J(U()));if(`error`in i)throw new Q(i.error,`failed to get slot`);return i.result}async getSlotLeader(e){let{commitment:t,config:n}=vf(e),r=this._buildArgs([],t,void 0,n),i=B(await this._rpcRequest(`getSlotLeader`,r),J(G()));if(`error`in i)throw new Q(i.error,`failed to get slot leader`);return i.result}async getSlotLeaders(e,t){let n=[e,t],r=B(await this._rpcRequest(`getSlotLeaders`,n),J(V(Fp)));if(`error`in r)throw new Q(r.error,`failed to get slot leaders`);return r.result}async getSignatureStatus(e,t){let{context:n,value:r}=await this.getSignatureStatuses([e],t);return rf(r.length===1),{context:n,value:r[0]}}async getSignatureStatuses(e,t){let n=[e];t&&n.push(t);let r=B(await this._rpcRequest(`getSignatureStatuses`,n),Im);if(`error`in r)throw new Q(r.error,`failed to get signature status`);return r.result}async getTransactionCount(e){let{commitment:t,config:n}=vf(e),r=this._buildArgs([],t,void 0,n),i=B(await this._rpcRequest(`getTransactionCount`,r),J(U()));if(`error`in i)throw new Q(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){let t=this._buildArgs([],e),n=B(await this._rpcRequest(`getInflationGovernor`,t),tm);if(`error`in n)throw new Q(n.error,`failed to get inflation`);return n.result}async getInflationReward(e,t,n){let{commitment:r,config:i}=vf(n),a=this._buildArgs([e.map(e=>e.toBase58())],r,void 0,{...i,epoch:t??i?.epoch}),o=B(await this._rpcRequest(`getInflationReward`,a),Vp);if(`error`in o)throw new Q(o.error,`failed to get inflation reward`);return o.result}async getInflationRate(){let e=B(await this._rpcRequest(`getInflationRate`,[]),nm);if(`error`in e)throw new Q(e.error,`failed to get inflation rate`);return e.result}async getEpochInfo(e){let{commitment:t,config:n}=vf(e),r=this._buildArgs([],t,void 0,n),i=B(await this._rpcRequest(`getEpochInfo`,r),im);if(`error`in i)throw new Q(i.error,`failed to get epoch info`);return i.result}async getEpochSchedule(){let e=B(await this._rpcRequest(`getEpochSchedule`,[]),am);if(`error`in e)throw new Q(e.error,`failed to get epoch schedule`);let t=e.result;return new Op(t.slotsPerEpoch,t.leaderScheduleSlotOffset,t.warmup,t.firstNormalEpoch,t.firstNormalSlot)}async getLeaderSchedule(){let e=B(await this._rpcRequest(`getLeaderSchedule`,[]),om);if(`error`in e)throw new Q(e.error,`failed to get leader schedule`);return e.result}async getMinimumBalanceForRentExemption(e,t){let n=this._buildArgs([e],t),r=B(await this._rpcRequest(`getMinimumBalanceForRentExemption`,n),Lm);return`error`in r?(console.warn(`Unable to fetch minimum balance for rent exemption`),0):r.result}async getRecentBlockhashAndContext(e){let{context:t,value:{blockhash:n}}=await this.getLatestBlockhashAndContext(e);return{context:t,value:{blockhash:n,feeCalculator:{get lamportsPerSignature(){throw Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message.")},toJSON(){return{}}}}}}async getRecentPerformanceSamples(e){let t=B(await this._rpcRequest(`getRecentPerformanceSamples`,e?[e]:[]),uh);if(`error`in t)throw new Q(t.error,`failed to get recent performance samples`);return t.result}async getFeeCalculatorForBlockhash(e,t){let n=this._buildArgs([e],t),r=B(await this._rpcRequest(`getFeeCalculatorForBlockhash`,n),dh);if(`error`in r)throw new Q(r.error,`failed to get fee calculator`);let{context:i,value:a}=r.result;return{context:i,value:a===null?null:a.feeCalculator}}async getFeeForMessage(e,t){let n=Lf(e.serialize()).toString(`base64`),r=this._buildArgs([n],t),i=B(await this._rpcRequest(`getFeeForMessage`,r),xf(H(U())));if(`error`in i)throw new Q(i.error,`failed to get fee for message`);if(i.result===null)throw Error(`invalid blockhash`);return i.result}async getRecentPrioritizationFees(e){let t=e?.lockedWritableAccounts?.map(e=>e.toBase58()),n=t?.length?[t]:[],r=B(await this._rpcRequest(`getRecentPrioritizationFees`,n),rm);if(`error`in r)throw new Q(r.error,`failed to get recent prioritization fees`);return r.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(e){throw Error(`failed to get recent blockhash: `+e)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(e){throw Error(`failed to get recent blockhash: `+e)}}async getLatestBlockhashAndContext(e){let{commitment:t,config:n}=vf(e),r=this._buildArgs([],t,void 0,n),i=B(await this._rpcRequest(`getLatestBlockhash`,r),ch);if(`error`in i)throw new Q(i.error,`failed to get latest blockhash`);return i.result}async isBlockhashValid(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgs([e],n,void 0,r),a=B(await this._rpcRequest(`isBlockhashValid`,i),lh);if(`error`in a)throw new Q(a.error,"failed to determine if the blockhash `"+e+"`is valid");return a.result}async getVersion(){let e=B(await this._rpcRequest(`getVersion`,[]),J(Xp));if(`error`in e)throw new Q(e.error,`failed to get version`);return e.result}async getGenesisHash(){let e=B(await this._rpcRequest(`getGenesisHash`,[]),J(G()));if(`error`in e)throw new Q(e.error,`failed to get genesis hash`);return e.result}async getBlock(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgsAtLeastConfirmed([e],n,void 0,r),a=await this._rpcRequest(`getBlock`,i);try{switch(r?.transactionDetails){case`accounts`:{let e=B(a,eh);if(`error`in e)throw e.error;return e.result}case`none`:{let e=B(a,$m);if(`error`in e)throw e.error;return e.result}default:{let e=B(a,Qm);if(`error`in e)throw e.error;let{result:t}=e;return t?{...t,transactions:t.transactions.map(({transaction:e,meta:t,version:n})=>({meta:t,transaction:{...e,message:Cf(n,e.message)},version:n}))}:null}}}catch(e){throw new Q(e,`failed to get confirmed block`)}}async getParsedBlock(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgsAtLeastConfirmed([e],n,`jsonParsed`,r),a=await this._rpcRequest(`getBlock`,i);try{switch(r?.transactionDetails){case`accounts`:{let e=B(a,nh);if(`error`in e)throw e.error;return e.result}case`none`:{let e=B(a,rh);if(`error`in e)throw e.error;return e.result}default:{let e=B(a,th);if(`error`in e)throw e.error;return e.result}}}catch(e){throw new Q(e,`failed to get block`)}}async getBlockProduction(e){let t,n;if(typeof e==`string`)n=e;else if(e){let{commitment:r,...i}=e;n=r,t=i}let r=this._buildArgs([],n,`base64`,t),i=B(await this._rpcRequest(`getBlockProduction`,r),em);if(`error`in i)throw new Q(i.error,`failed to get block production information`);return i.result}async getTransaction(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgsAtLeastConfirmed([e],n,void 0,r),a=B(await this._rpcRequest(`getTransaction`,i),oh);if(`error`in a)throw new Q(a.error,`failed to get transaction`);let o=a.result;return o&&{...o,transaction:{...o.transaction,message:Cf(o.version,o.transaction.message)}}}async getParsedTransaction(e,t){let{commitment:n,config:r}=vf(t),i=this._buildArgsAtLeastConfirmed([e],n,`jsonParsed`,r),a=B(await this._rpcRequest(`getTransaction`,i),sh);if(`error`in a)throw new Q(a.error,`failed to get transaction`);return a.result}async getParsedTransactions(e,t){let{commitment:n,config:r}=vf(t),i=e.map(e=>({methodName:`getTransaction`,args:this._buildArgsAtLeastConfirmed([e],n,`jsonParsed`,r)}));return(await this._rpcBatchRequest(i)).map(e=>{let t=B(e,sh);if(`error`in t)throw new Q(t.error,`failed to get transactions`);return t.result})}async getTransactions(e,t){let{commitment:n,config:r}=vf(t),i=e.map(e=>({methodName:`getTransaction`,args:this._buildArgsAtLeastConfirmed([e],n,void 0,r)}));return(await this._rpcBatchRequest(i)).map(e=>{let t=B(e,oh);if(`error`in t)throw new Q(t.error,`failed to get transactions`);let n=t.result;return n&&{...n,transaction:{...n.transaction,message:Cf(n.version,n.transaction.message)}}})}async getConfirmedBlock(e,t){let n=this._buildArgsAtLeastConfirmed([e],t),r=B(await this._rpcRequest(`getBlock`,n),ih);if(`error`in r)throw new Q(r.error,`failed to get confirmed block`);let i=r.result;if(!i)throw Error(`Confirmed block `+e+` not found`);let a={...i,transactions:i.transactions.map(({transaction:e,meta:t})=>{let n=new np(e.message);return{meta:t,transaction:{...e,message:n}}})};return{...a,transactions:a.transactions.map(({transaction:e,meta:t})=>({meta:t,transaction:cp.populate(e.message,e.signatures)}))}}async getBlocks(e,t,n){let r=this._buildArgsAtLeastConfirmed(t===void 0?[e]:[e,t],n),i=B(await this._rpcRequest(`getBlocks`,r),J(V(U())));if(`error`in i)throw new Q(i.error,`failed to get blocks`);return i.result}async getBlockSignatures(e,t){let n=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:`signatures`,rewards:!1}),r=B(await this._rpcRequest(`getBlock`,n),ah);if(`error`in r)throw new Q(r.error,`failed to get block`);let i=r.result;if(!i)throw Error(`Block `+e+` not found`);return i}async getConfirmedBlockSignatures(e,t){let n=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:`signatures`,rewards:!1}),r=B(await this._rpcRequest(`getBlock`,n),ah);if(`error`in r)throw new Q(r.error,`failed to get confirmed block`);let i=r.result;if(!i)throw Error(`Confirmed block `+e+` not found`);return i}async getConfirmedTransaction(e,t){let n=this._buildArgsAtLeastConfirmed([e],t),r=B(await this._rpcRequest(`getTransaction`,n),oh);if(`error`in r)throw new Q(r.error,`failed to get transaction`);let i=r.result;if(!i)return i;let a=new np(i.transaction.message),o=i.transaction.signatures;return{...i,transaction:cp.populate(a,o)}}async getParsedConfirmedTransaction(e,t){let n=this._buildArgsAtLeastConfirmed([e],t,`jsonParsed`),r=B(await this._rpcRequest(`getTransaction`,n),sh);if(`error`in r)throw new Q(r.error,`failed to get confirmed transaction`);return r.result}async getParsedConfirmedTransactions(e,t){let n=e.map(e=>({methodName:`getTransaction`,args:this._buildArgsAtLeastConfirmed([e],t,`jsonParsed`)}));return(await this._rpcBatchRequest(n)).map(e=>{let t=B(e,sh);if(`error`in t)throw new Q(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--,!(t<=0||t<i));)try{let e=await this.getConfirmedBlockSignatures(t,`finalized`);e.signatures.length>0&&(r.until=e.signatures[e.signatures.length-1].toString())}catch(e){if(e instanceof Error&&e.message.includes(`skipped`))continue;throw e}let a=await this.getSlot(`finalized`);for(;!(`before`in r)&&(n++,!(n>a));)try{let e=await this.getConfirmedBlockSignatures(n);e.signatures.length>0&&(r.before=e.signatures[e.signatures.length-1].toString())}catch(e){if(e instanceof Error&&e.message.includes(`skipped`))continue;throw e}return(await this.getConfirmedSignaturesForAddress2(e,r)).map(e=>e.signature)}async getConfirmedSignaturesForAddress2(e,t,n){let r=this._buildArgsAtLeastConfirmed([e.toBase58()],n,void 0,t),i=B(await this._rpcRequest(`getConfirmedSignaturesForAddress2`,r),xm);if(`error`in i)throw new Q(i.error,`failed to get confirmed signatures for address`);return i.result}async getSignaturesForAddress(e,t,n){let r=this._buildArgsAtLeastConfirmed([e.toBase58()],n,void 0,t),i=B(await this._rpcRequest(`getSignaturesForAddress`,r),Sm);if(`error`in i)throw new Q(i.error,`failed to get signatures for address`);return i.result}async getAddressLookupTable(e,t){let{context:n,value:r}=await this.getAccountInfoAndContext(e,t),i=null;return r!==null&&(i=new Mp({key:e,state:Mp.deserialize(r.data)})),{context:n,value:i}}async getNonceAndContext(e,t){let{context:n,value:r}=await this.getAccountInfoAndContext(e,t),i=null;return r!==null&&(i=yp.fromAccountData(r.data)),{context:n,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then(e=>e.value).catch(t=>{throw Error(`failed to get nonce for account `+e.toBase58()+`: `+t)})}async requestAirdrop(e,t){let n=B(await this._rpcRequest(`requestAirdrop`,[e.toBase58(),t]),fh);if(`error`in n)throw new Q(n.error,`airdrop to ${e.toBase58()} failed`);return n.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await cf(100);let e=Date.now()-this._blockhashInfo.lastFetch>=Rp;if(this._blockhashInfo.latestBlockhash!==null&&!e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{let e=Date.now(),t=this._blockhashInfo.latestBlockhash,n=t?t.blockhash:null;for(let e=0;e<50;e++){let e=await this.getLatestBlockhash(`finalized`);if(n!==e.blockhash)return this._blockhashInfo={latestBlockhash:e,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e;await cf(up/2)}throw Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){let{commitment:t,config:n}=vf(e),r=this._buildArgs([],t,`base64`,n),i=B(await this._rpcRequest(`getStakeMinimumDelegation`,r),xf(U()));if(`error`in i)throw new Q(i.error,`failed to get stake minimum delegation`);return i.result}async simulateTransaction(e,t,n){if(`message`in e){let r=e.serialize(),i=Y.Buffer.from(r).toString(`base64`);if(Array.isArray(t)||n!==void 0)throw Error(`Invalid arguments`);let a=t||{};a.encoding=`base64`,`commitment`in a||(a.commitment=this.commitment),t&&typeof t==`object`&&`innerInstructions`in t&&(a.innerInstructions=t.innerInstructions);let o=[i,a],s=B(await this._rpcRequest(`simulateTransaction`,o),$p);if(`error`in s)throw Error(`failed to simulate transaction: `+s.error.message);return s.result}let r;if(e instanceof cp){let t=e;r=new cp,r.feePayer=t.feePayer,r.instructions=e.instructions,r.nonceInfo=t.nonceInfo,r.signatures=t.signatures}else r=cp.populate(e),r._message=r._json=void 0;if(t!==void 0&&!Array.isArray(t))throw Error(`Invalid arguments`);let i=t;if(r.nonceInfo&&i)r.sign(...i);else{let e=this._disableBlockhashCaching;for(;;){let t=await this._blockhashWithExpiryBlockHeight(e);if(r.lastValidBlockHeight=t.lastValidBlockHeight,r.recentBlockhash=t.blockhash,!i)break;if(r.sign(...i),!r.signature)throw Error(`!signature`);let n=r.signature.toString(`base64`);if(!this._blockhashInfo.simulatedSignatures.includes(n)&&!this._blockhashInfo.transactionSignatures.includes(n)){this._blockhashInfo.simulatedSignatures.push(n);break}else e=!0}}let a=r._compile(),o=a.serialize(),s=r._serialize(o).toString(`base64`),c={encoding:`base64`,commitment:this.commitment};n&&(c.accounts={encoding:`base64`,addresses:(Array.isArray(n)?n:a.nonProgramIds()).map(e=>e.toBase58())}),i&&(c.sigVerify=!0),t&&typeof t==`object`&&`innerInstructions`in t&&(c.innerInstructions=t.innerInstructions);let l=[s,c],u=B(await this._rpcRequest(`simulateTransaction`,l),$p);if(`error`in u){let e;if(`data`in u.error&&(e=u.error.data.logs,e&&Array.isArray(e))){let t=`
`,n=t+e.join(t);console.error(u.error.message,n)}throw new hp({action:`simulate`,signature:``,transactionMessage:u.error.message,logs:e})}return u.result}async sendTransaction(e,t,n){if(`version`in e){if(t&&Array.isArray(t))throw Error(`Invalid arguments`);let n=e.serialize();return await this.sendRawTransaction(n,t)}if(t===void 0||!Array.isArray(t))throw Error(`Invalid arguments`);let r=t;if(e.nonceInfo)e.sign(...r);else{let t=this._disableBlockhashCaching;for(;;){let n=await this._blockhashWithExpiryBlockHeight(t);if(e.lastValidBlockHeight=n.lastValidBlockHeight,e.recentBlockhash=n.blockhash,e.sign(...r),!e.signature)throw Error(`!signature`);let i=e.signature.toString(`base64`);if(this._blockhashInfo.transactionSignatures.includes(i))t=!0;else{this._blockhashInfo.transactionSignatures.push(i);break}}}let i=e.serialize();return await this.sendRawTransaction(i,n)}async sendRawTransaction(e,t){let n=Lf(e).toString(`base64`);return await this.sendEncodedTransaction(n,t)}async sendEncodedTransaction(e,t){let n={encoding:`base64`},r=t&&t.skipPreflight,i=r===!0?`processed`:t&&t.preflightCommitment||this.commitment;t&&t.maxRetries!=null&&(n.maxRetries=t.maxRetries),t&&t.minContextSlot!=null&&(n.minContextSlot=t.minContextSlot),r&&(n.skipPreflight=r),i&&(n.preflightCommitment=i);let a=[e,n],o=B(await this._rpcRequest(`sendTransaction`,a),ph);if(`error`in o){let e;throw`data`in o.error&&(e=o.error.data.logs),new hp({action:r?`send`:`simulate`,signature:``,transactionMessage:o.error.message,logs:e})}return o.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){if(this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%(2**53-1),this._rpcWebSocketIdleTimeout&&=(clearTimeout(this._rpcWebSocketIdleTimeout),null),this._rpcWebSocketHeartbeat&&=(clearInterval(this._rpcWebSocketHeartbeat),null),e===1e3){this._updateSubscriptions();return}this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach(([e,t])=>{this._setSubscription(e,{...t,state:`pending`})})}_setSubscription(e,t){let n=this._subscriptionsByHash[e]?.state;if(this._subscriptionsByHash[e]=t,n!==t.state){let n=this._subscriptionStateChangeCallbacksByHash[e];n&&n.forEach(e=>{try{e(t.state)}catch{}})}}_onSubscriptionStateChange(e,t){let n=this._subscriptionHashByClientSubscriptionId[e];if(n==null)return()=>{};let r=this._subscriptionStateChangeCallbacksByHash[n]||=new Set;return r.add(t),()=>{r.delete(t),r.size===0&&delete this._subscriptionStateChangeCallbacksByHash[n]}}async _updateSubscriptions(){if(Object.keys(this._subscriptionsByHash).length===0){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: ${e.message}`)}},500));return}if(this._rpcWebSocketIdleTimeout!==null&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected){this._rpcWebSocket.connect();return}let e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map(async e=>{let n=this._subscriptionsByHash[e];if(n!==void 0)switch(n.state){case`pending`:case`unsubscribed`:if(n.callbacks.size===0){delete this._subscriptionsByHash[e],n.state===`unsubscribed`&&delete this._subscriptionCallbacksByServerSubscriptionId[n.serverSubscriptionId],await this._updateSubscriptions();return}await(async()=>{let{args:r,method:i}=n;try{this._setSubscription(e,{...n,state:`subscribing`});let t=await this._rpcWebSocket.call(i,r);this._setSubscription(e,{...n,serverSubscriptionId:t,state:`subscribed`}),this._subscriptionCallbacksByServerSubscriptionId[t]=n.callbacks,await this._updateSubscriptions()}catch(a){if(console.error(`Received ${a instanceof Error?``:`JSON-RPC `}error calling \`${i}\``,{args:r,error:a}),!t())return;this._setSubscription(e,{...n,state:`pending`}),await this._updateSubscriptions()}})();break;case`subscribed`:n.callbacks.size===0&&await(async()=>{let{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(r){if(r instanceof Error&&console.error(`${i} error:`,r.message),!t())return;this._setSubscription(e,{...n,state:`subscribed`}),await this._updateSubscriptions();return}}this._setSubscription(e,{...n,state:`unsubscribed`}),await this._updateSubscriptions()})();break}}))}_handleServerNotification(e,t){let n=this._subscriptionCallbacksByServerSubscriptionId[e];n!==void 0&&n.forEach(e=>{try{e(...t)}catch(e){console.error(e)}})}_wsOnAccountNotification(e){let{result:t,subscription:n}=B(e,Cm);this._handleServerNotification(n,[t.value,t.context])}_makeSubscription(e,t){let n=this._nextClientSubscriptionId++,r=Ep([e.method,t]),i=this._subscriptionsByHash[r];return i===void 0?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];let t=this._subscriptionsByHash[r];rf(t!==void 0,`Could not find a \`Subscription\` when tearing down client subscription #${n}`),t.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),n}onAccountChange(e,t,n){let{commitment:r,config:i}=vf(n),a=this._buildArgs([e.toBase58()],r||this._commitment||`finalized`,`base64`,i);return this._makeSubscription({callback:t,method:`accountSubscribe`,unsubscribeMethod:`accountUnsubscribe`},a)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,`account change`)}_wsOnProgramAccountNotification(e){let{result:t,subscription:n}=B(e,Tm);this._handleServerNotification(n,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,n,r){let{commitment:i,config:a}=vf(n),o=this._buildArgs([e.toBase58()],i||this._commitment||`finalized`,`base64`,a||(r?{filters:yf(r)}:void 0));return this._makeSubscription({callback:t,method:`programSubscribe`,unsubscribeMethod:`programUnsubscribe`},o)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,`program account change`)}onLogs(e,t,n){let r=this._buildArgs([typeof e==`object`?{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){let{result:t,subscription:n}=B(e,mh);this._handleServerNotification(n,[t.value,t.context])}_wsOnSlotNotification(e){let{result:t,subscription:n}=B(e,Dm);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){let{result:t,subscription:n}=B(e,km);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){let n=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];n?await n():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,n,r){let 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){let i=t||this._commitment;if(i&&![`confirmed`,`finalized`].includes(i))throw Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,n,r)}_wsOnSignatureNotification(e){let{result:t,subscription:n}=B(e,Am);t.value!==`receivedSignature`&&this._subscriptionsAutoDisposedByRpc.add(n),this._handleServerNotification(n,t.value===`receivedSignature`?[{type:`received`},t.context]:[{type:`status`,result:t.value},t.context])}onSignature(e,t,n){let r=this._buildArgs([e],n||this._commitment||`finalized`),i=this._makeSubscription({callback:(e,n)=>{if(e.type===`status`){t(e.result,n);try{this.removeSignatureListener(i)}catch{}}},method:`signatureSubscribe`,unsubscribeMethod:`signatureUnsubscribe`},r);return i}onSignatureWithOptions(e,t,n){let{commitment:r,...i}={...n,commitment:n&&n.commitment||this._commitment||`finalized`},a=this._buildArgs([e],r,void 0,i),o=this._makeSubscription({callback:(e,n)=>{t(e,n);try{this.removeSignatureListener(o)}catch{}},method:`signatureSubscribe`,unsubscribeMethod:`signatureUnsubscribe`},a);return o}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,`signature result`)}_wsOnRootNotification(e){let{result:t,subscription:n}=B(e,jm);this._handleServerNotification(n,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:`rootSubscribe`,unsubscribeMethod:`rootUnsubscribe`},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,`root change`)}},_h=class e{constructor(e){this._keypair=void 0,this._keypair=e??Nf()}static generate(){return new e(Nf())}static fromSecretKey(t,n){if(t.byteLength!==64)throw Error(`bad secret key size`);let r=t.slice(32,64);if(!n||!n.skipValidation){let e=Pf(t.slice(0,32));for(let t=0;t<32;t++)if(r[t]!==e[t])throw Error(`provided secretKey is invalid`)}return new e({publicKey:r,secretKey:t})}static fromSeed(t){let n=Pf(t),r=new Uint8Array(64);return r.set(t),r.set(n,32),new e({publicKey:n,secretKey:r})}get publicKey(){return new Z(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}},vh=Object.freeze({CreateLookupTable:{index:0,layout:X.struct([X.u32(`instruction`),uf(`recentSlot`),X.u8(`bumpSeed`)])},FreezeLookupTable:{index:1,layout:X.struct([X.u32(`instruction`)])},ExtendLookupTable:{index:2,layout:X.struct([X.u32(`instruction`),uf(),X.seq(qf(),X.offset(X.u32(),-8),`addresses`)])},DeactivateLookupTable:{index:3,layout:X.struct([X.u32(`instruction`)])},CloseLookupTable:{index:4,layout:X.struct([X.u32(`instruction`)])}}),yh=class{constructor(){}static createLookupTable(e){let[t,n]=Z.findProgramAddressSync([e.authority.toBuffer(),sl().encode(e.recentSlot)],this.programId),r=vh.CreateLookupTable,i=lf(r,{recentSlot:BigInt(e.recentSlot),bumpSeed:n}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:xp.programId,isSigner:!1,isWritable:!1}];return[new sp({programId:this.programId,keys:a,data:i}),t]}static freezeLookupTable(e){let t=vh.FreezeLookupTable,n=lf(t),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new sp({programId:this.programId,keys:r,data:n})}static extendLookupTable(e){let t=vh.ExtendLookupTable,n=lf(t,{addresses:e.addresses.map(e=>e.toBytes())}),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&r.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:xp.programId,isSigner:!1,isWritable:!1}),new sp({programId:this.programId,keys:r,data:n})}static deactivateLookupTable(e){let t=vh.DeactivateLookupTable,n=lf(t),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new sp({programId:this.programId,keys:r,data:n})}static closeLookupTable(e){let t=vh.CloseLookupTable,n=lf(t),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new sp({programId:this.programId,keys:r,data:n})}},yh.programId=new Z(`AddressLookupTab1e1111111111111111111111111`),bh=Object.freeze({RequestUnits:{index:0,layout:X.struct([X.u8(`instruction`),X.u32(`units`),X.u32(`additionalFee`)])},RequestHeapFrame:{index:1,layout:X.struct([X.u8(`instruction`),X.u32(`bytes`)])},SetComputeUnitLimit:{index:2,layout:X.struct([X.u8(`instruction`),X.u32(`units`)])},SetComputeUnitPrice:{index:3,layout:X.struct([X.u8(`instruction`),uf(`microLamports`)])}}),xh=class{constructor(){}static requestUnits(e){let t=bh.RequestUnits,n=lf(t,e);return new sp({keys:[],programId:this.programId,data:n})}static requestHeapFrame(e){let t=bh.RequestHeapFrame,n=lf(t,e);return new sp({keys:[],programId:this.programId,data:n})}static setComputeUnitLimit(e){let t=bh.SetComputeUnitLimit,n=lf(t,e);return new sp({keys:[],programId:this.programId,data:n})}static setComputeUnitPrice(e){let t=bh.SetComputeUnitPrice,n=lf(t,{microLamports:BigInt(e.microLamports)});return new sp({keys:[],programId:this.programId,data:n})}},xh.programId=new Z(`ComputeBudget111111111111111111111111111111`),Sh=64,Ch=32,wh=64,Th=X.struct([X.u8(`numSignatures`),X.u8(`padding`),X.u16(`signatureOffset`),X.u16(`signatureInstructionIndex`),X.u16(`publicKeyOffset`),X.u16(`publicKeyInstructionIndex`),X.u16(`messageDataOffset`),X.u16(`messageDataSize`),X.u16(`messageInstructionIndex`)]),Eh=class e{constructor(){}static createInstructionWithPublicKey(t){let{publicKey:n,message:r,signature:i,instructionIndex:a}=t;rf(n.length===Ch,`Public Key must be ${Ch} bytes but received ${n.length} bytes`),rf(i.length===wh,`Signature must be ${wh} bytes but received ${i.length} bytes`);let o=Th.span,s=o+n.length,c=s+i.length,l=Y.Buffer.alloc(c+r.length),u=a??65535;return Th.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:u,publicKeyOffset:o,publicKeyInstructionIndex:u,messageDataOffset:c,messageDataSize:r.length,messageInstructionIndex:u},l),l.fill(n,o),l.fill(i,s),l.fill(r,c),new sp({keys:[],programId:e.programId,data:l})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:n,instructionIndex:r}=e;rf(t.length===Sh,`Private key must be ${Sh} bytes but received ${t.length} bytes`);try{let e=_h.fromSecretKey(t),i=e.publicKey.toBytes(),a=Ff(n,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:a,instructionIndex:r})}catch(e){throw Error(`Error creating instruction; ${e}`)}}},Eh.programId=new Z(`Ed25519SigVerify111111111111111111111111111`),Dh=(e,t)=>{let n=qd.sign(e,t);return[n.toCompactRawBytes(),n.recovery]},qd.utils.isValidPrivateKey,Oh=qd.getPublicKey,kh=32,Ah=20,jh=64,Mh=11,Nh=X.struct([X.u8(`numSignatures`),X.u16(`signatureOffset`),X.u8(`signatureInstructionIndex`),X.u16(`ethAddressOffset`),X.u8(`ethAddressInstructionIndex`),X.u16(`messageDataOffset`),X.u16(`messageDataSize`),X.u8(`messageInstructionIndex`),X.blob(20,`ethAddress`),X.blob(64,`signature`),X.u8(`recoveryId`)]),Ph=class e{constructor(){}static publicKeyToEthAddress(e){rf(e.length===jh,`Public key must be ${jh} bytes but received ${e.length} bytes`);try{return Y.Buffer.from(ud(Lf(e))).slice(-Ah)}catch(e){throw Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){let{publicKey:n,message:r,signature:i,recoveryId:a,instructionIndex:o}=t;return e.createInstructionWithEthAddress({ethAddress:e.publicKeyToEthAddress(n),message:r,signature:i,recoveryId:a,instructionIndex:o})}static createInstructionWithEthAddress(t){let{ethAddress:n,message:r,signature:i,recoveryId:a,instructionIndex:o=0}=t,s;s=typeof n==`string`?n.startsWith(`0x`)?Y.Buffer.from(n.substr(2),`hex`):Y.Buffer.from(n,`hex`):n,rf(s.length===Ah,`Address must be ${Ah} bytes but received ${s.length} bytes`);let c=1+Mh,l=c,u=c+s.length,d=u+i.length+1,f=Y.Buffer.alloc(Nh.span+r.length);return Nh.encode({numSignatures:1,signatureOffset:u,signatureInstructionIndex:o,ethAddressOffset:l,ethAddressInstructionIndex:o,messageDataOffset:d,messageDataSize:r.length,messageInstructionIndex:o,signature:Lf(i),ethAddress:Lf(s),recoveryId:a},f),f.fill(Lf(r),Nh.span),new sp({keys:[],programId:e.programId,data:f})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:n,instructionIndex:r}=e;rf(t.length===kh,`Private key must be ${kh} bytes but received ${t.length} bytes`);try{let e=Lf(t),i=Oh(e,!1).slice(1),[a,o]=Dh(Y.Buffer.from(ud(Lf(n))),e);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:a,recoveryId:o,instructionIndex:r})}catch(e){throw Error(`Error creating instruction; ${e}`)}}},Ph.programId=new Z(`KeccakSecp256k11111111111111111111111111111`),Ih=new Z(`StakeConfig11111111111111111111111111111111`),Lh=class{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}},Fh=Lh,Lh.default=new Fh(0,0,Z.default),Rh=Object.freeze({Initialize:{index:0,layout:X.struct([X.u32(`instruction`),Xf(),Zf()])},Authorize:{index:1,layout:X.struct([X.u32(`instruction`),qf(`newAuthorized`),X.u32(`stakeAuthorizationType`)])},Delegate:{index:2,layout:X.struct([X.u32(`instruction`)])},Split:{index:3,layout:X.struct([X.u32(`instruction`),X.ns64(`lamports`)])},Withdraw:{index:4,layout:X.struct([X.u32(`instruction`),X.ns64(`lamports`)])},Deactivate:{index:5,layout:X.struct([X.u32(`instruction`)])},Merge:{index:7,layout:X.struct([X.u32(`instruction`)])},AuthorizeWithSeed:{index:8,layout:X.struct([X.u32(`instruction`),qf(`newAuthorized`),X.u32(`stakeAuthorizationType`),Yf(`authoritySeed`),qf(`authorityOwner`)])}}),Object.freeze({Staker:{index:0},Withdrawer:{index:1}}),zh=class{constructor(){}static initialize(e){let{stakePubkey:t,authorized:n,lockup:r}=e,i=r||Lh.default,a=Rh.Initialize,o=lf(a,{authorized:{staker:Lf(n.staker.toBuffer()),withdrawer:Lf(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:Lf(i.custodian.toBuffer())}});return new sp({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:pp,isSigner:!1,isWritable:!1}],programId:this.programId,data:o})}static createAccountWithSeed(e){let t=new cp;t.add(xp.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static createAccount(e){let t=new cp;t.add(xp.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:n,authorized:r,lockup:i}=e;return t.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static delegate(e){let{stakePubkey:t,authorizedPubkey:n,votePubkey:r}=e,i=Rh.Delegate,a=lf(i);return new cp().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:mp,isSigner:!1,isWritable:!1},{pubkey:Ih,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static authorize(e){let{stakePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,stakeAuthorizationType:i,custodianPubkey:a}=e,o=Rh.Authorize,s=lf(o,{newAuthorized:Lf(r.toBuffer()),stakeAuthorizationType:i.index}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dp,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return a&&c.push({pubkey:a,isSigner:!0,isWritable:!1}),new cp().add({keys:c,programId:this.programId,data:s})}static authorizeWithSeed(e){let{stakePubkey:t,authorityBase:n,authoritySeed:r,authorityOwner:i,newAuthorizedPubkey:a,stakeAuthorizationType:o,custodianPubkey:s}=e,c=Rh.AuthorizeWithSeed,l=lf(c,{newAuthorized:Lf(a.toBuffer()),stakeAuthorizationType:o.index,authoritySeed:r,authorityOwner:Lf(i.toBuffer())}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:dp,isSigner:!1,isWritable:!1}];return s&&u.push({pubkey:s,isSigner:!0,isWritable:!1}),new cp().add({keys:u,programId:this.programId,data:l})}static splitInstruction(e){let{stakePubkey:t,authorizedPubkey:n,splitStakePubkey:r,lamports:i}=e,a=Rh.Split,o=lf(a,{lamports:i});return new sp({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,t){let n=new cp;return n.add(xp.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),n.add(this.splitInstruction(e))}static splitWithSeed(e,t){let{stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,basePubkey:a,seed:o,lamports:s}=e,c=new cp;return c.add(xp.allocate({accountPubkey:i,basePubkey:a,seed:o,space:this.space,programId:this.programId})),t&&t>0&&c.add(xp.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),c.add(this.splitInstruction({stakePubkey:n,authorizedPubkey:r,splitStakePubkey:i,lamports:s}))}static merge(e){let{stakePubkey:t,sourceStakePubKey:n,authorizedPubkey:r}=e,i=Rh.Merge,a=lf(i);return new cp().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:mp,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static withdraw(e){let{stakePubkey:t,authorizedPubkey:n,toPubkey:r,lamports:i,custodianPubkey:a}=e,o=Rh.Withdraw,s=lf(o,{lamports:i}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:mp,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return a&&c.push({pubkey:a,isSigner:!0,isWritable:!1}),new cp().add({keys:c,programId:this.programId,data:s})}static deactivate(e){let{stakePubkey:t,authorizedPubkey:n}=e,r=Rh.Deactivate,i=lf(r);return new cp().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}},zh.programId=new Z(`Stake11111111111111111111111111111111111111`),zh.space=200,Bh=Object.freeze({InitializeAccount:{index:0,layout:X.struct([X.u32(`instruction`),Qf()])},Authorize:{index:1,layout:X.struct([X.u32(`instruction`),qf(`newAuthorized`),X.u32(`voteAuthorizationType`)])},Withdraw:{index:3,layout:X.struct([X.u32(`instruction`),X.ns64(`lamports`)])},UpdateValidatorIdentity:{index:4,layout:X.struct([X.u32(`instruction`)])},AuthorizeWithSeed:{index:10,layout:X.struct([X.u32(`instruction`),$f()])}}),Object.freeze({Voter:{index:0},Withdrawer:{index:1}}),Vh=class e{constructor(){}static initializeAccount(e){let{votePubkey:t,nodePubkey:n,voteInit:r}=e,i=Bh.InitializeAccount,a=lf(i,{voteInit:{nodePubkey:Lf(r.nodePubkey.toBuffer()),authorizedVoter:Lf(r.authorizedVoter.toBuffer()),authorizedWithdrawer:Lf(r.authorizedWithdrawer.toBuffer()),commission:r.commission}});return new sp({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:pp,isSigner:!1,isWritable:!1},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:a})}static createAccount(e){let t=new cp;return t.add(xp.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){let{votePubkey:t,authorizedPubkey:n,newAuthorizedPubkey:r,voteAuthorizationType:i}=e,a=Bh.Authorize,o=lf(a,{newAuthorized:Lf(r.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new cp().add({keys:s,programId:this.programId,data:o})}static authorizeWithSeed(e){let{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:i,voteAuthorizationType:a,votePubkey:o}=e,s=Bh.AuthorizeWithSeed,c=lf(s,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Lf(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:Lf(i.toBuffer()),voteAuthorizationType:a.index}}),l=[{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:dp,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return new cp().add({keys:l,programId:this.programId,data:c})}static withdraw(e){let{votePubkey:t,authorizedWithdrawerPubkey:n,lamports:r,toPubkey:i}=e,a=Bh.Withdraw,o=lf(a,{lamports:r}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return new cp().add({keys:s,programId:this.programId,data:o})}static safeWithdraw(t,n,r){if(t.lamports>n-r)throw Error(`Withdraw will leave vote account with insufficient funds.`);return e.withdraw(t)}static updateValidatorIdentity(e){let{votePubkey:t,authorizedWithdrawerPubkey:n,nodePubkey:r}=e,i=Bh.UpdateValidatorIdentity,a=lf(i),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return new cp().add({keys:o,programId:this.programId,data:a})}},Vh.programId=new Z(`Vote111111111111111111111111111111111111111`),Vh.space=3762,new Z(`Va1idator1nfo111111111111111111111111111111`),K({name:G(),website:W(G()),details:W(G()),iconUrl:W(G()),keybaseUsername:W(G())}),new Z(`Vote111111111111111111111111111111111111111`),X.struct([qf(`nodePubkey`),qf(`authorizedWithdrawer`),X.u8(`commission`),X.nu64(),X.seq(X.struct([X.nu64(`slot`),X.u32(`confirmationCount`)]),X.offset(X.u32(),-8),`votes`),X.u8(`rootSlotValid`),X.nu64(`rootSlot`),X.nu64(),X.seq(X.struct([X.nu64(`epoch`),qf(`authorizedVoter`)]),X.offset(X.u32(),-8),`authorizedVoters`),X.struct([X.seq(X.struct([qf(`authorizedPubkey`),X.nu64(`epochOfLastAuthorizedSwitch`),X.nu64(`targetEpoch`)]),32,`buf`),X.nu64(`idx`),X.u8(`isEmpty`)],`priorVoters`),X.nu64(),X.seq(X.struct([X.nu64(`epoch`),X.nu64(`credits`),X.nu64(`prevCredits`)]),X.offset(X.u32(),-8),`epochCredits`),X.struct([X.nu64(`slot`),X.nu64(`timestamp`)],`lastTimestamp`)]),Hh={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/`}}})),Wh=(0,w.createContext)({});function Gh(){return(0,w.useContext)(Wh)}Uh();var Kh=({children:e,endpoint:t,config:n={commitment:`confirmed`}})=>{let r=(0,w.useMemo)(()=>new gh(t,n),[t,n]);return w.createElement(Wh.Provider,{value:{connection:r}},e)},qh=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+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 s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,Jh=class extends Error{constructor(e,t){super(e),this.error=t}},Yh=class extends Jh{constructor(){super(...arguments),this.name=`WalletNotReadyError`}},Xh=class extends Jh{constructor(){super(...arguments),this.name=`WalletConfigError`}},Zh=class extends Jh{constructor(){super(...arguments),this.name=`WalletConnectionError`}},Qh=class extends Jh{constructor(){super(...arguments),this.name=`WalletDisconnectedError`}},$h=class extends Jh{constructor(){super(...arguments),this.name=`WalletDisconnectionError`}},eg=class extends Jh{constructor(){super(...arguments),this.name=`WalletAccountError`}},tg=class extends Jh{constructor(){super(...arguments),this.name=`WalletPublicKeyError`}},ng=class extends Jh{constructor(){super(...arguments),this.name=`WalletNotConnectedError`}},rg=class extends Jh{constructor(){super(...arguments),this.name=`WalletSendTransactionError`}},ig=class extends Jh{constructor(){super(...arguments),this.name=`WalletSignTransactionError`}},ag=class extends Jh{constructor(){super(...arguments),this.name=`WalletSignMessageError`}},og=class extends Jh{constructor(){super(...arguments),this.name=`WalletSignInError`}},sg;(function(e){e.Installed=`Installed`,e.NotDetected=`NotDetected`,e.Loadable=`Loadable`,e.Unsupported=`Unsupported`})(sg||={});var cg=class extends qh{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,t,n={}){let r=this.publicKey;if(!r)throw new ng;return e.feePayer=e.feePayer||r,e.recentBlockhash=e.recentBlockhash||(await t.getLatestBlockhash({commitment:n.preflightCommitment,minContextSlot:n.minContextSlot})).blockhash,e}};function lg(e){if(typeof window>`u`||typeof document>`u`)return;let t=[];function n(){if(e())for(let e of t)e()}let r=setInterval(n,1e3);t.push(()=>clearInterval(r)),document.readyState===`loading`&&(document.addEventListener(`DOMContentLoaded`,n,{once:!0}),t.push(()=>document.removeEventListener(`DOMContentLoaded`,n))),document.readyState!==`complete`&&(window.addEventListener(`load`,n,{once:!0}),t.push(()=>window.removeEventListener(`load`,n))),n()}function ug(){if(!navigator)return!1;let e=navigator.userAgent.toLowerCase(),t=e.includes(`iphone`)||e.includes(`ipad`),n=e.includes(`safari`);return t&&n}function dg(e){return`version`in e}var fg=class extends cg{async sendTransaction(e,t,n={}){let r=!0;try{if(dg(e)){if(!this.supportedTransactionVersions)throw new rg(`Sending versioned transactions isn't supported by this wallet`);if(!this.supportedTransactionVersions.has(e.version))throw new rg(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);let r=e.serialize();return await t.sendRawTransaction(r,n)}catch(e){throw e instanceof ig?(r=!1,e):new rg(e?.message,e)}}else try{let{signers:r,...i}=n;e=await this.prepareTransaction(e,t,i),r?.length&&e.partialSign(...r),e=await this.signTransaction(e);let a=e.serialize();return await t.sendRawTransaction(a,i)}catch(e){throw e instanceof ig?(r=!1,e):new rg(e?.message,e)}}catch(e){throw r&&this.emit(`error`,e),e}}async signAllTransactions(e){for(let t of e)if(dg(t)){if(!this.supportedTransactionVersions)throw new ig(`Signing versioned transactions isn't supported by this wallet`);if(!this.supportedTransactionVersions.has(t.version))throw new ig(`Signing transaction version ${t.version} isn't supported by this wallet`)}let t=[];for(let n of e)t.push(await this.signTransaction(n));return t}},pg=class extends fg{},mg=class extends pg{},hg=`solana:signAndSendTransaction`,gg=`solana:signIn`,_g=`solana:signMessage`,vg=`solana:signTransaction`,yg=`standard:connect`,bg=`standard:disconnect`,xg=`standard:events`;function Sg(e){return`standard:connect`in e.features&&`standard:events`in e.features&&(`solana:signAndSendTransaction`in e.features||`solana:signTransaction`in e.features)}var Cg;(function(e){e.Mainnet=`mainnet-beta`,e.Testnet=`testnet`,e.Devnet=`devnet`})(Cg||={});var wg=class extends Jh{constructor(){super(...arguments),this.name=`WalletNotSelectedError`}},Tg=[],Eg={autoConnect:!1,connecting:!1,connected:!1,disconnecting:!1,select(){Dg(`call`,`select`)},connect(){return Promise.reject(Dg(`call`,`connect`))},disconnect(){return Promise.reject(Dg(`call`,`disconnect`))},sendTransaction(){return Promise.reject(Dg(`call`,`sendTransaction`))},signTransaction(){return Promise.reject(Dg(`call`,`signTransaction`))},signAllTransactions(){return Promise.reject(Dg(`call`,`signAllTransactions`))},signMessage(){return Promise.reject(Dg(`call`,`signMessage`))},signIn(){return Promise.reject(Dg(`call`,`signIn`))}};Object.defineProperty(Eg,`wallets`,{get(){return Dg(`read`,`wallets`),Tg}}),Object.defineProperty(Eg,`wallet`,{get(){return Dg(`read`,`wallet`),null}}),Object.defineProperty(Eg,`publicKey`,{get(){return Dg(`read`,`publicKey`),null}});function Dg(e,t){let n=Error(`You have tried to ${e} "${t}" on a WalletContext without providing one. Make sure to render a WalletProvider as an ancestor of the component that uses WalletContext.`);return console.error(n),n}var Og=(0,w.createContext)(Eg);function kg(){return(0,w.useContext)(Og)}function Ag(e,t){let n=(0,w.useState)(()=>{try{let t=localStorage.getItem(e);if(t)return JSON.parse(t)}catch(e){typeof window<`u`&&console.error(e)}return t}),r=n[0],i=(0,w.useRef)(!0);return(0,w.useEffect)(()=>{if(i.current){i.current=!1;return}try{r===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(r))}catch(e){typeof window<`u`&&console.error(e)}},[r,e]),n}var jg=8078012;function Mg(e){return Array.isArray(e)?`%5B`+e.map(Mg).join(`%2C%20`)+`%5D`:typeof e==`bigint`?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function Ng([e,t]){return`${e}=${Mg(t)}`}function Pg(e){let t=Object.entries(e).map(Ng).join(`&`);return btoa(t)}function Fg(e,t={}){{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${Pg(t)}'`),`${n}\``}}var Ig=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;t&&Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([t,i])=>{t===`cause`?r={cause:i.value}:(n===void 0&&(n={__code:e}),Object.defineProperty(n,t,i))});let i=Fg(e,n);super(i,r),this.context=Object.freeze(n===void 0?{__code:e}:n),this.name=`SolanaError`}};function Lg(e,t){return`fixedSize`in t?t.fixedSize:t.getSizeFromValue(e)}function Rg(e){return Object.freeze({...e,encode:t=>{let n=new Uint8Array(Lg(t,e));return e.write(t,n,0),n}})}function zg(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function Bg(e,t,n=t){if(!t.match(RegExp(`^[${e}]*$`)))throw new Ig(jg,{alphabet:e,base:e.length,value:n})}var Vg=e=>Rg({getSizeFromValue:t=>{let[n,r]=Ug(t,e[0]);if(!r)return t.length;let i=Wg(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(Bg(e,t),t===``)return r;let[i,a]=Ug(t,e[0]);if(!a)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let o=Wg(a,e),s=[];for(;o>0n;)s.unshift(Number(o%256n)),o/=256n;let c=[...Array(i.length).fill(0),...s];return n.set(c,r),r+c.length}}),Hg=e=>zg({read(t,n){let r=n===0||n<=-t.byteLength?t:t.slice(n);if(r.length===0)return[``,0];let i=r.findIndex(e=>e!==0);i=i===-1?r.length:i;let a=e[0].repeat(i);return i===r.length?[a,t.length]:[a+Gg(r.slice(i).reduce((e,t)=>e*256n+BigInt(t),0n),e),t.length]}});function Ug(e,t){let[n,r]=e.split(RegExp(`((?!${t}).*)`));return[n,r]}function Wg(e,t){let n=BigInt(t.length),r=0n;for(let i of e)r*=n,r+=BigInt(t.indexOf(i));return r}function Gg(e,t){let n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join(``)}var Kg=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,qg=()=>Vg(Kg),Jg=()=>Hg(Kg),Yg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Xg=()=>Rg({getSizeFromValue:e=>{try{return atob(e).length}catch{throw new Ig(jg,{alphabet:Yg,base:64,value:e})}},write(e,t,n){try{let r=atob(e).split(``).map(e=>e.charCodeAt(0));return t.set(r,n),r.length+n}catch{throw new Ig(jg,{alphabet:Yg,base:64,value:e})}}}),Zg=()=>zg({read(e,t=0){let n=e.slice(t);return[btoa(String.fromCharCode(...n)),e.length]}}),Qg=e=>e.replace(/\u0000/g,``),$g=globalThis.TextDecoder,e_=globalThis.TextEncoder,t_=()=>{let e;return Rg({getSizeFromValue:t=>(e||=new e_).encode(t).length,write:(t,n,r)=>{let i=(e||=new e_).encode(t);return n.set(i,r),r+i.length}})},n_=()=>{let e;return zg({read(t,n){return[Qg((e||=new $g).decode(t.slice(n))),t.length]}})};function r_(e){return Zg().decode(t_().encode(e))}function i_(e,t){let n=Zg().decode(e);return t?n.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``):n}function a_(e){return Xg().encode(e)}function o_(e){return Jg().decode(e)}function s_(e){return qg().encode(e)}function c_(e){return o_(a_(e))}function l_(e){return i_(new Uint8Array(e))}function u_(e){return o_(e)}function d_(e){return s_(e)}function f_(e){return i_(e)}function p_(e){return a_(e)}function m_(e){return n_().decode(e)}function h_(e){return t_().encode(e)}var g_=`solana:mainnet`,__=`solana:devnet`,v_=`solana:testnet`,y_=`solana:localnet`;function b_(e,t){if(e===t)return!0;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function x_(e){switch(e){case`processed`:case`confirmed`:case`finalized`:case void 0:return e;case`recent`:return`processed`;case`single`:case`singleGossip`:return`confirmed`;case`max`:case`root`:return`finalized`;default:return}}function S_(e){return e.includes(`https://api.mainnet-beta.solana.com`)?g_:/\bdevnet\b/i.test(e)?__:/\btestnet\b/i.test(e)?v_:/\blocalhost\b/i.test(e)||/\b127\.0\.0\.1\b/.test(e)?y_:g_}function C_(e){let t=`${e.domain} wants you to sign in with your Solana account:\n`;t+=`${e.address}`,e.statement&&(t+=`\n\n${e.statement}`);let n=[];if(e.uri&&n.push(`URI: ${e.uri}`),e.version&&n.push(`Version: ${e.version}`),e.chainId&&n.push(`Chain ID: ${e.chainId}`),e.nonce&&n.push(`Nonce: ${e.nonce}`),e.issuedAt&&n.push(`Issued At: ${e.issuedAt}`),e.expirationTime&&n.push(`Expiration Time: ${e.expirationTime}`),e.notBefore&&n.push(`Not Before: ${e.notBefore}`),e.requestId&&n.push(`Request ID: ${e.requestId}`),e.resources){n.push(`Resources:`);for(let t of e.resources)n.push(`- ${t}`)}return n.length&&(t+=`\n\n${n.join(`
`)}`),t}var w_={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:`ERROR_ASSOCIATION_PORT_OUT_OF_RANGE`,ERROR_REFLECTOR_ID_OUT_OF_RANGE:`ERROR_REFLECTOR_ID_OUT_OF_RANGE`,ERROR_FORBIDDEN_WALLET_BASE_URL:`ERROR_FORBIDDEN_WALLET_BASE_URL`,ERROR_SECURE_CONTEXT_REQUIRED:`ERROR_SECURE_CONTEXT_REQUIRED`,ERROR_SESSION_CLOSED:`ERROR_SESSION_CLOSED`,ERROR_SESSION_TIMEOUT:`ERROR_SESSION_TIMEOUT`,ERROR_WALLET_NOT_FOUND:`ERROR_WALLET_NOT_FOUND`,ERROR_INVALID_PROTOCOL_VERSION:`ERROR_INVALID_PROTOCOL_VERSION`,ERROR_BROWSER_NOT_SUPPORTED:`ERROR_BROWSER_NOT_SUPPORTED`,ERROR_LOOPBACK_ACCESS_BLOCKED:`ERROR_LOOPBACK_ACCESS_BLOCKED`,ERROR_ASSOCIATION_CANCELLED:`ERROR_ASSOCIATION_CANCELLED`},T_=class extends Error{data;code;constructor(...e){let[t,n,r]=e;super(n),this.code=t,this.data=r,this.name=`SolanaMobileWalletAdapterError`}},E_=class extends Error{data;code;jsonRpcMessageId;constructor(...e){let[t,n,r,i]=e;super(r),this.code=n,this.data=i,this.jsonRpcMessageId=t,this.name=`SolanaMobileWalletAdapterProtocolError`}};async function D_(e,t){let n=await crypto.subtle.exportKey(`raw`,e),r=await crypto.subtle.sign({hash:`SHA-256`,name:`ECDSA`},t,n),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(new Uint8Array(n),0),i.set(new Uint8Array(r),n.byteLength),i}function O_(e){return C_(e)}function k_(e){return r_(O_(e)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var A_=`solana:signTransactions`,j_=`solana:cloneAuthorization`;function M_(e,t){return new Proxy({},{get(n,r){return r===`then`?null:(n[r]??(n[r]=async function(n){let{method:i,params:a}=N_(r,n,e),o=await t(i,a);return i===`authorize`&&a.sign_in_payload&&!o.sign_in_result&&(o.sign_in_result=await F_(a.sign_in_payload,o,t)),P_(r,o,e)}),n[r])},defineProperty(){return!1},deleteProperty(){return!1}})}function N_(e,t,n){let r=t,i=e.toString().replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`).toLowerCase();switch(e){case`authorize`:{let e=r,{chain:t}=e;if(n===`legacy`){switch(t){case`solana:testnet`:t=`testnet`;break;case`solana:devnet`:t=`devnet`;break;case`solana:mainnet`:t=`mainnet-beta`;break;default:t=e.cluster}e.cluster=t,r=e}else{switch(t){case`testnet`:case`devnet`:t=`solana:${t}`;break;case`mainnet-beta`:t=`solana:mainnet`;break}e.chain=t,r=e}}case`reauthorize`:{let{auth_token:e,identity:t}=r;if(e)switch(n){case`legacy`:i=`reauthorize`,r={auth_token:e,identity:t};break;default:i=`authorize`;break}break}}return{method:i,params:r}}function P_(e,t,n){switch(e){case`getCapabilities`:{let e=t;switch(n){case`legacy`:{let t=[A_];return e.supports_clone_authorization===!0&&t.push(j_),{...e,features:t}}case`v1`:return{...e,supports_sign_and_send_transactions:!0,supports_clone_authorization:e.features.includes(j_)}}}}return t}async function F_(e,t,n){let r=e.domain??window.location.host,i=t.accounts[0].address,a=k_({...e,domain:r,address:c_(i)}),o=a_((await n(`sign_messages`,{addresses:[i],payloads:[a]})).signed_payloads[0]),s=i_(o.slice(0,o.length-64)),c=i_(o.slice(o.length-64));return{address:i,signed_message:s.length==0?a:s,signature:c}}function I_(e){if(e>=4294967296)throw Error(`Outbound sequence number overflow. The maximum sequence number is 32-bytes.`);let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}var L_=12;async function R_(e,t,n){let r=I_(t),i=new Uint8Array(L_);crypto.getRandomValues(i);let a=await crypto.subtle.encrypt(B_(r,i),n,h_(e)),o=new Uint8Array(r.byteLength+i.byteLength+a.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(i),r.byteLength),o.set(new Uint8Array(a),r.byteLength+i.byteLength),o}async function z_(e,t){let n=e.slice(0,4),r=e.slice(4,4+L_),i=e.slice(4+L_),a=await crypto.subtle.decrypt(B_(n,r),t,i);return m_(new Uint8Array(a))}function B_(e,t){return{additionalData:e,iv:t,name:`AES-GCM`,tagLength:128}}async function V_(){return await crypto.subtle.generateKey({name:`ECDSA`,namedCurve:`P-256`},!1,[`sign`])}async function H_(){return await crypto.subtle.generateKey({name:`ECDH`,namedCurve:`P-256`},!1,[`deriveKey`,`deriveBits`])}function U_(){return W_(49152+Math.floor(Math.random()*16384))}function W_(e){if(e<49152||e>65535)throw new T_(w_.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${e} given.`,{port:e});return e}function G_(e){return e.replace(/[/+=]/g,e=>({"/":`_`,"+":`-`,"=":`.`})[e])}var K_=`solana-wallet`;function q_(e){return e.replace(/(^\/+|\/+$)/g,``).split(`/`)}function J_(e,t){let n=null;if(t){try{n=new URL(t)}catch{}if(n?.protocol!==`https:`)throw new T_(w_.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||=new URL(`${K_}:/`);let r=e.startsWith(`/`)?e:[...q_(n.pathname),...q_(e)].join(`/`);return new URL(r,n)}async function Y_(e,t,n,r=[`v1`]){let i=W_(t),a=l_(await crypto.subtle.exportKey(`raw`,e)),o=J_(`v1/associate/local`,n);return o.searchParams.set(`association`,G_(a)),o.searchParams.set(`port`,`${i}`),r.forEach(e=>{o.searchParams.set(`v`,e)}),o}async function X_(e,t){let n=JSON.stringify(e),r=e.id;return R_(n,r,t)}async function Z_(e,t){let n=await z_(e,t),r=JSON.parse(n);if(Object.hasOwnProperty.call(r,`error`))throw new E_(r.id,r.error.code,r.error.message);return r}async function Q_(e,t,n){let[r,i]=await Promise.all([crypto.subtle.exportKey(`raw`,t),crypto.subtle.importKey(`raw`,e.slice(0,65),{name:`ECDH`,namedCurve:`P-256`},!1,[])]),a=await crypto.subtle.deriveBits({name:`ECDH`,public:i},n,256),o=await crypto.subtle.importKey(`raw`,a,`HKDF`,!1,[`deriveKey`]);return await crypto.subtle.deriveKey({name:`HKDF`,hash:`SHA-256`,salt:new Uint8Array(r),info:new Uint8Array},o,{name:`AES-GCM`,length:128},!1,[`encrypt`,`decrypt`])}async function $_(e,t){let n=await z_(e,t),r=JSON.parse(n),i=`legacy`;if(Object.hasOwnProperty.call(r,`v`))switch(r.v){case 1:case`1`:case`v1`:i=`v1`;break;case`legacy`:i=`legacy`;break;default:throw new T_(w_.ERROR_INVALID_PROTOCOL_VERSION,`Unknown/unsupported protocol version: ${r.v}`)}return{protocol_version:i}}var ev={Firefox:0,Other:1};function tv(){return navigator.userAgent.indexOf(`Firefox/`)===-1?ev.Other:ev.Firefox}function nv(){return new Promise((e,t)=>{function n(){clearTimeout(i),window.removeEventListener(`blur`,r)}function r(){n(),e()}window.addEventListener(`blur`,r);let i=setTimeout(()=>{n(),t()},3e3)})}var rv=null;function iv(e){rv??(rv=document.createElement(`iframe`),rv.style.display=`none`,document.body.appendChild(rv)),rv.contentWindow.location.href=e.toString()}async function av(e){if(e.protocol===`https:`)window.location.assign(e);else try{switch(tv()){case ev.Firefox:iv(e);break;case ev.Other:{let t=nv();window.location.assign(e),await t;break}default:}}catch{throw new T_(w_.ERROR_WALLET_NOT_FOUND,`Found no installed wallet that supports the mobile wallet protocol.`)}}async function ov(e,t){let n=U_();return await av(await Y_(e,n,t)),n}var sv={retryDelayScheduleMs:[150,150,200,500,500,750,750,1e3],timeoutMs:3e4},cv=`com.solana.mobilewalletadapter.v1`;function lv(){if(typeof window>`u`||window.isSecureContext!==!0)throw new T_(w_.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function uv(e){let t;try{t=new URL(e)}catch{throw new T_(w_.ERROR_FORBIDDEN_WALLET_BASE_URL,`Invalid base URL supplied by wallet`)}if(t.protocol!==`https:`)throw new T_(w_.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}function dv(e){return new DataView(e).getUint32(0,!1)}async function fv(e){lv();let t=await V_(),n=`ws://localhost:${await ov(t.publicKey,e?.baseUri)}/solana-wallet`,r,i=(()=>{let e=[...sv.retryDelayScheduleMs];return()=>e.length>1?e.shift():e[0]})(),a=1,o=0,s={__type:`disconnected`},c,l=!1,u;return{close:()=>{c.close(),u()},wallet:new Promise((e,d)=>{let f={},p=async()=>{if(s.__type!==`connecting`){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${s.__type}\`.`);return}c.removeEventListener(`open`,p);let{associationKeypair:e}=s,t=await H_();c.send(await D_(t.publicKey,e.privateKey)),s={__type:`hello_req_sent`,associationPublicKey:e.publicKey,ecdhPrivateKey:t.privateKey}},m=e=>{e.wasClean?s={__type:`disconnected`}:d(new T_(w_.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${e.code}: ${e.reason}).`,{closeEvent:e})),_()},h=async e=>{_(),Date.now()-r>=sv.timeoutMs?d(new T_(w_.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${n}.`)):(await new Promise(e=>{let t=i();v=window.setTimeout(e,t)}),y())},g=async n=>{let r=await n.data.arrayBuffer();switch(s.__type){case`connecting`:{if(r.byteLength!==0)throw Error(`Encountered unexpected message while connecting`);let e=await H_();c.send(await D_(e.publicKey,t.privateKey)),s={__type:`hello_req_sent`,associationPublicKey:t.publicKey,ecdhPrivateKey:e.privateKey};break}case`connected`:try{let e=dv(r.slice(0,4));if(e!==o+1)throw Error(`Encrypted message has invalid sequence number`);o=e;let t=await Z_(r,s.sharedSecret),n=f[t.id];delete f[t.id],n.resolve(t.result)}catch(e){if(e instanceof E_){let t=f[e.jsonRpcMessageId];delete f[e.jsonRpcMessageId],t.reject(e)}else throw e}break;case`hello_req_sent`:{if(r.byteLength===0){let e=await H_();c.send(await D_(e.publicKey,t.privateKey)),s={__type:`hello_req_sent`,associationPublicKey:t.publicKey,ecdhPrivateKey:e.privateKey};break}let n=await Q_(r,s.associationPublicKey,s.ecdhPrivateKey),i=r.slice(65),u=i.byteLength===0?{protocol_version:`legacy`}:await(async()=>{let e=dv(i.slice(0,4));if(e!==o+1)throw Error(`Encrypted message has invalid sequence number`);return o=e,$_(i,n)})();s={__type:`connected`,sharedSecret:n,sessionProperties:u};let p=M_(u.protocol_version,async(e,t)=>{let r=a++;return c.send(await X_({id:r,jsonrpc:`2.0`,method:e,params:t??{}},n)),new Promise((t,n)=>{f[r]={resolve(r){switch(e){case`authorize`:case`reauthorize`:{let{wallet_uri_base:e}=r;if(e!=null)try{uv(e)}catch(e){n(e);return}break}}t(r)},reject:n}})});l=!0;try{e(p)}catch(e){d(e)}break}}};u=()=>{c.removeEventListener(`message`,g),_(),l||d(new T_(w_.ERROR_SESSION_CLOSED,`The wallet session was closed before connection.`,{closeEvent:new CloseEvent(`socket was closed before connection`)}))};let _,v,y=()=>{_&&_(),s={__type:`connecting`,associationKeypair:t},r===void 0&&(r=Date.now()),c=new WebSocket(n,[cv]),c.addEventListener(`open`,p),c.addEventListener(`close`,m),c.addEventListener(`error`,h),c.addEventListener(`message`,g),_=()=>{window.clearTimeout(v),c.removeEventListener(`open`,p),c.removeEventListener(`close`,m),c.removeEventListener(`error`,h),c.removeEventListener(`message`,g)}};y()})}}var pv=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),mv=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),hv=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),gv=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),_v=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),vv=s((e=>{var t=mv().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),yv=s((e=>{var t=mv().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),bv=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),xv=s((e=>{var t=hv(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Sv=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Cv=s((e=>{var t=Sv();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),wv=s(((e,t)=>{var n=Cv();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),Tv=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),Ev=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),Dv=s((e=>{var t=Tv(),n=Ev();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Ov=s((e=>{var t=mv(),n=xv(),r=hv(),i=Dv(),a=Tv(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),kv=s((e=>{var t=mv(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),Av=s(((e,t)=>{var n=Dv();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),jv=s(((e,t)=>{var n=Dv(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),Mv=s(((e,t)=>{var n=Dv();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Nv=s(((e,t)=>{var n=Dv(),r=mv();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Pv=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Fv=s((e=>{var t=Dv(),n=Av(),r=jv(),i=Mv(),a=Nv(),o=Ev(),s=mv(),c=Pv();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Iv=s((e=>{var t=mv(),n=hv(),r=gv(),i=_v(),a=vv(),o=yv(),s=bv(),c=xv(),l=wv(),u=Ov(),d=kv(),f=Dv(),p=Fv();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+c+`.
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),Lv=s((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Rv=s((e=>{var t=Lv();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),zv=s((e=>{var t=Lv();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
`;return typeof a==`function`&&a(null,p),p}}));s((e=>{var t=pv(),n=Iv(),r=Rv(),i=zv();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))();var Bv=`SolanaMobileWalletAdapterDefaultAuthorizationCache`;function Vv(){let e;try{e=window.localStorage}catch{}return{async clear(){if(e)try{e.removeItem(Bv)}catch{}},async get(){if(e)try{let t=JSON.parse(e.getItem(Bv));if(t&&t.accounts){let e=t.accounts.map(e=>({...e,publicKey:`publicKey`in e?new Uint8Array(Object.values(e.publicKey)):d_(e.address)}));return{...t,accounts:e}}else return t||void 0}catch{}},async set(t){if(e)try{e.setItem(Bv,JSON.stringify(t))}catch{}}}}function Hv(){return{async select(e){return e.length===1?e[0]:e.includes(`solana:mainnet`)?g_:e[0]}}}var Uv=`
<div class="mobile-wallet-adapter-embedded-modal-container" role="dialog" aria-modal="true" aria-labelledby="modal-title">
<div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div>
<div class="mobile-wallet-adapter-embedded-modal-card">
<div>
<button data-modal-close class="mobile-wallet-adapter-embedded-modal-close">
<svg width="14" height="14">
<path d="M 6.7125,8.3036995 1.9082,13.108199 c -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 C 0.1056,12.896899 0,12.631699 0,12.312499 c 0,-0.3192 0.1056,-0.5844 0.3167,-0.7958 L 5.1212,6.7124995 0.3167,1.9082 C 0.1056,1.6969 0,1.4317 0,1.1125 0,0.7933 0.1056,0.5281 0.3167,0.3167 0.5281,0.1056 0.7933,0 1.1125,0 1.4317,0 1.6969,0.1056 1.9082,0.3167 L 6.7125,5.1212 11.5167,0.3167 C 11.7281,0.1056 11.9933,0 12.3125,0 c 0.3192,0 0.5844,0.1056 0.7957,0.3167 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 L 8.3037001,6.7124995 13.1082,11.516699 c 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 z" />
</svg>
</button>
</div>
<div class="mobile-wallet-adapter-embedded-modal-content"></div>
</div>
</div>
`,Wv=`
.mobile-wallet-adapter-embedded-modal-container {
display: flex; /* Use flexbox to center content */
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
position: fixed; /* Stay in place */
z-index: 2147483647; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
overflow-y: auto; /* enable scrolling */
}
.mobile-wallet-adapter-embedded-modal-card {
display: flex;
flex-direction: column;
margin: auto 20px;
max-width: 780px;
padding: 20px;
border-radius: 24px;
background: #ffffff;
font-family: "Inter Tight", "PT Sans", Calibri, sans-serif;
transform: translateY(-200%);
animation: slide-in 0.5s forwards;
}
@keyframes slide-in {
100% { transform: translateY(0%); }
}
.mobile-wallet-adapter-embedded-modal-close {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
cursor: pointer;
background: #e4e9e9;
border: none;
border-radius: 50%;
}
.mobile-wallet-adapter-embedded-modal-close:focus-visible {
outline-color: red;
}
.mobile-wallet-adapter-embedded-modal-close svg {
fill: #546266;
transition: fill 200ms ease 0s;
}
.mobile-wallet-adapter-embedded-modal-close:hover svg {
fill: #fff;
}
`,Gv=`
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
`,Kv=class{#e=null;#t={};#n=!1;dom=null;constructor(){this.init=this.init.bind(this),this.#e=document.getElementById(`mobile-wallet-adapter-embedded-root-ui`)}async init(){console.log(`Injecting modal`),this.#r()}open=()=>{console.debug(`Modal open`),this.#i(),this.#e&&(this.#e.style.display=`flex`)};close=(e=void 0)=>{console.debug(`Modal close`),this.#a(),this.#e&&(this.#e.style.display=`none`),this.#t.close?.forEach(t=>t(e))};addEventListener(e,t){return this.#t[e]?.push(t)||(this.#t[e]=[t]),()=>this.removeEventListener(e,t)}removeEventListener(e,t){this.#t[e]=this.#t[e]?.filter(e=>t!==e)}#r(){if(document.getElementById(`mobile-wallet-adapter-embedded-root-ui`)){this.#e||=document.getElementById(`mobile-wallet-adapter-embedded-root-ui`);return}this.#e=document.createElement(`div`),this.#e.id=`mobile-wallet-adapter-embedded-root-ui`,this.#e.innerHTML=Uv,this.#e.style.display=`none`;let e=this.#e.querySelector(`.mobile-wallet-adapter-embedded-modal-content`);e&&(e.innerHTML=this.contentHtml);let t=document.createElement(`style`);t.id=`mobile-wallet-adapter-embedded-modal-styles`,t.textContent=Wv+this.contentStyles;let n=document.createElement(`div`);n.innerHTML=Gv,this.dom=n.attachShadow({mode:`closed`}),this.dom.appendChild(t),this.dom.appendChild(this.#e),document.body.appendChild(n)}#i(){!this.#e||this.#n||([...this.#e.querySelectorAll(`[data-modal-close]`)].forEach(e=>e?.addEventListener(`click`,this.close)),window.addEventListener(`load`,this.close),document.addEventListener(`keydown`,this.#o),this.#n=!0)}#a(){this.#n&&(window.removeEventListener(`load`,this.close),document.removeEventListener(`keydown`,this.#o),this.#e&&([...this.#e.querySelectorAll(`[data-modal-close]`)].forEach(e=>e?.removeEventListener(`click`,this.close)),this.#n=!1))}#o=e=>{e.key===`Escape`&&this.close(e)}},qv=`To use mobile wallet adapter, you must have a compatible mobile wallet application installed on your device.`,Jv=`This browser appears to be incompatible with mobile wallet adapter. Open this page in a compatible mobile browser app and try again.`,Yv=class extends Kv{contentStyles=Zv;contentHtml=Xv;initWithError(e){super.init(),this.populateError(e)}populateError(e){let t=this.dom?.getElementById(`mobile-wallet-adapter-error-message`),n=this.dom?.getElementById(`mobile-wallet-adapter-error-action`);if(t){if(e.name===`SolanaMobileWalletAdapterError`)switch(e.code){case`ERROR_WALLET_NOT_FOUND`:t.innerHTML=qv,n&&n.addEventListener(`click`,()=>{window.location.href=`https://solanamobile.com/wallets`});return;case`ERROR_BROWSER_NOT_SUPPORTED`:t.innerHTML=Jv,n&&(n.style.display=`none`);return}t.innerHTML=`An unexpected error occurred: ${e.message}`}else console.log(`Failed to locate error dialog element`)}},Xv=`
<svg class="mobile-wallet-adapter-embedded-modal-error-icon" xmlns="http://www.w3.org/2000/svg" height="50px" viewBox="0 -960 960 960" width="50px" fill="#000000"><path d="M 280,-80 Q 197,-80 138.5,-138.5 80,-197 80,-280 80,-363 138.5,-421.5 197,-480 280,-480 q 83,0 141.5,58.5 58.5,58.5 58.5,141.5 0,83 -58.5,141.5 Q 363,-80 280,-80 Z M 824,-120 568,-376 Q 556,-389 542.5,-402.5 529,-416 516,-428 q 38,-24 61,-64 23,-40 23,-88 0,-75 -52.5,-127.5 Q 495,-760 420,-760 345,-760 292.5,-707.5 240,-655 240,-580 q 0,6 0.5,11.5 0.5,5.5 1.5,11.5 -18,2 -39.5,8 -21.5,6 -38.5,14 -2,-11 -3,-22 -1,-11 -1,-23 0,-109 75.5,-184.5 Q 311,-840 420,-840 q 109,0 184.5,75.5 75.5,75.5 75.5,184.5 0,43 -13.5,81.5 Q 653,-460 629,-428 l 251,252 z m -615,-61 71,-71 70,71 29,-28 -71,-71 71,-71 -28,-28 -71,71 -71,-71 -28,28 71,71 -71,71 z"/></svg>
<div class="mobile-wallet-adapter-embedded-modal-title">We can't find a wallet.</div>
<div id="mobile-wallet-adapter-error-message" class="mobile-wallet-adapter-embedded-modal-subtitle"></div>
<div>
<button data-error-action id="mobile-wallet-adapter-error-action" class="mobile-wallet-adapter-embedded-modal-error-action">
Find a wallet
</button>
</div>
`,Zv=`
.mobile-wallet-adapter-embedded-modal-content {
text-align: center;
}
.mobile-wallet-adapter-embedded-modal-error-icon {
margin-top: 24px;
}
.mobile-wallet-adapter-embedded-modal-title {
margin: 18px 100px auto 100px;
color: #000000;
font-size: 2.75em;
font-weight: 600;
}
.mobile-wallet-adapter-embedded-modal-subtitle {
margin: 30px 60px 40px 60px;
color: #000000;
font-size: 1.25em;
font-weight: 400;
}
.mobile-wallet-adapter-embedded-modal-error-action {
display: block;
width: 100%;
height: 56px;
/*margin-top: 40px;*/
font-size: 1.25em;
/*line-height: 24px;*/
/*letter-spacing: -1%;*/
background: #000000;
color: #FFFFFF;
border-radius: 18px;
}
/* Smaller screens */
@media all and (max-width: 600px) {
.mobile-wallet-adapter-embedded-modal-title {
font-size: 1.5em;
margin-right: 12px;
margin-left: 12px;
}
.mobile-wallet-adapter-embedded-modal-subtitle {
margin-right: 12px;
margin-left: 12px;
}
}
`;async function Qv(){if(typeof window<`u`){let e=window.navigator.userAgent.toLowerCase(),t=new Yv;e.includes(`wv`)?t.initWithError({name:`SolanaMobileWalletAdapterError`,code:`ERROR_BROWSER_NOT_SUPPORTED`,message:``}):t.initWithError({name:`SolanaMobileWalletAdapterError`,code:`ERROR_WALLET_NOT_FOUND`,message:``}),t.open()}}var $v=class extends Kv{contentStyles=ty;contentHtml=ey;initWithCallback(e){super.init(),this.#e(e)}#e(e){let t=this.dom?.getElementById(`mobile-wallet-adapter-launch-action`),n=async()=>{t?.removeEventListener(`click`,n),this.close(),e()};t?.addEventListener(`click`,n)}},ey=`
<svg class="mobile-wallet-adapter-embedded-modal-launch-icon" width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#15994E"/>
<mask id="mask0_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
<rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask0_189_522)">
<mask id="mask1_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
<rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask1_189_522)">
<path d="M22.1092 26.1208L19.4498 23.4615C19.1736 23.1851 18.8253 23.0468 18.4048 23.0468C17.9846 23.0468 17.6363 23.1851 17.3598 23.4615C17.0836 23.7377 16.9468 24.0861 16.9495 24.5065C16.9522 24.9267 17.0916 25.275 17.3678 25.5512L21.0405 29.2238C21.3463 29.5276 21.7031 29.6795 22.1108 29.6795C22.5184 29.6795 22.8742 29.5276 23.1782 29.2238L30.5918 21.8098C30.8683 21.5336 31.0065 21.1867 31.0065 20.7692C31.0065 20.3514 30.8683 20.0044 30.5918 19.7282C30.3156 19.4517 29.9673 19.3135 29.5468 19.3135C29.1266 19.3135 28.7784 19.4517 28.5022 19.7282L22.1092 26.1208ZM23.9998 37.6042C22.113 37.6042 20.3425 37.2473 18.6885 36.5335C17.0343 35.8197 15.5954 34.8512 14.3718 33.6278C13.1485 32.4043 12.18 30.9654 11.4662 29.3112C10.7524 27.6572 10.3955 25.8867 10.3955 23.9998C10.3955 22.113 10.7524 20.3425 11.4662 18.6885C12.18 17.0343 13.1485 15.5954 14.3718 14.3718C15.5954 13.1485 17.0343 12.18 18.6885 11.4662C20.3425 10.7524 22.113 10.3955 23.9998 10.3955C25.8867 10.3955 27.6572 10.7524 29.3112 11.4662C30.9654 12.18 32.4043 13.1485 33.6278 14.3718C34.8512 15.5954 35.8197 17.0343 36.5335 18.6885C37.2473 20.3425 37.6042 22.113 37.6042 23.9998C37.6042 25.8867 37.2473 27.6572 36.5335 29.3112C35.8197 30.9654 34.8512 32.4043 33.6278 33.6278C32.4043 34.8512 30.9654 35.8197 29.3112 36.5335C27.6572 37.2473 25.8867 37.6042 23.9998 37.6042Z" fill="white"/>
</g>
</g>
</svg>
<div class="mobile-wallet-adapter-embedded-modal-title">Ready to connect!</div>
<div>
<button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
Connect Wallet
</button>
</div>
`,ty=`
.mobile-wallet-adapter-embedded-modal-close {
display: none;
}
.mobile-wallet-adapter-embedded-modal-content {
text-align: center;
min-width: 300px;
}
.mobile-wallet-adapter-embedded-modal-launch-icon {
margin-top: 24px;
}
.mobile-wallet-adapter-embedded-modal-title {
margin: 18px 100px 30px 100px;
color: #000000;
font-size: 2.75em;
font-weight: 600;
}
.mobile-wallet-adapter-embedded-modal-launch-action {
display: block;
width: 100%;
height: 56px;
font-size: 1.25em;
background: #000000;
color: #FFFFFF;
border-radius: 18px;
}
/* Smaller screens */
@media all and (max-width: 600px) {
.mobile-wallet-adapter-embedded-modal-title {
font-size: 1.5em;
margin-right: 12px;
margin-left: 12px;
}
}
`,ny=class extends Kv{contentStyles=iy;get contentHtml(){let e=ly()?`Long press the app icon on your home screen to open site settings`:`Tap the lock or settings icon in the address bar to open site settings`;return ry.replace(`{{PERMISSION_INSTRUCTION_DETAIL}}`,e)}async init(){super.init(),this.#e()}#e(){let e=this.dom?.getElementById(`mobile-wallet-adapter-launch-action`),t=async n=>{e?.removeEventListener(`click`,t),this.close(n)};e?.addEventListener(`click`,t)}},ry=`
<div class="mobile-wallet-adapter-embedded-modal-header">
Local Wallet Connection
</div>
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#ED1515"/>
<mask id="mask0_147_1364" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
<rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask0_147_1364)">
<path d="M20.1398 36.2705C19.7363 36.2705 19.3508 36.1945 18.9835 36.0425C18.6162 35.8907 18.2916 35.674 18.0098 35.3922L12.6072 29.9895C12.3254 29.7077 12.1086 29.3832 11.9568 29.0158C11.8048 28.6485 11.7288 28.2631 11.7288 27.8595V20.1395C11.7288 19.736 11.8048 19.3505 11.9568 18.9832C12.1086 18.6158 12.3254 18.2913 12.6072 18.0095L18.0098 12.6068C18.2916 12.3251 18.6162 12.1083 18.9835 11.9565C19.3508 11.8045 19.7363 11.7285 20.1398 11.7285H27.8598C28.2634 11.7285 28.6488 11.8045 29.0162 11.9565C29.3835 12.1083 29.708 12.3251 29.9898 12.6068L35.3925 18.0095C35.6743 18.2913 35.891 18.6158 36.0428 18.9832C36.1948 19.3505 36.2708 19.736 36.2708 20.1395V27.8595C36.2708 28.2631 36.1948 28.6485 36.0428 29.0158C35.891 29.3832 35.6743 29.7077 35.3925 29.9895L29.9898 35.3922C29.708 35.674 29.3835 35.8907 29.0162 36.0425C28.6488 36.1945 28.2634 36.2705 27.8598 36.2705H20.1398ZM20.1732 33.2372H27.8265L33.2375 27.8262V20.1728L27.8265 14.7618H20.1732L14.7622 20.1728V27.8262L20.1732 33.2372ZM23.9998 25.9538L26.7868 28.7408C27.0473 29.0013 27.3729 29.1302 27.7638 29.1275C28.1549 29.1248 28.4807 28.9933 28.7412 28.7328C29.0016 28.4724 29.1318 28.1466 29.1318 27.7555C29.1318 27.3646 29.0016 27.039 28.7412 26.7785L25.9542 23.9995L28.7412 21.2125C29.0016 20.9521 29.1318 20.6264 29.1318 20.2355C29.1318 19.8444 29.0016 19.5186 28.7412 19.2582C28.4807 18.9977 28.1549 18.8675 27.7638 18.8675C27.3729 18.8675 27.0473 18.9977 26.7868 19.2582L23.9998 22.0452L21.2128 19.2582C20.9524 18.9977 20.628 18.8675 20.2398 18.8675C19.8514 18.8675 19.5269 18.9977 19.2665 19.2582C19.006 19.5186 18.8758 19.8444 18.8758 20.2355C18.8758 20.6264 19.006 20.9521 19.2665 21.2125L22.0455 23.9995L19.2585 26.7865C18.998 27.047 18.8692 27.3713 18.8718 27.7595C18.8745 28.148 19.006 28.4724 19.2665 28.7328C19.5269 28.9933 19.8527 29.1235 20.2438 29.1235C20.6347 29.1235 20.9604 28.9933 21.2208 28.7328L23.9998 25.9538Z" fill="black"/>
</g>
</svg>
<div class="mobile-wallet-adapter-embedded-modal-title">
Your wallet connection is blocked
</div>
<div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle">
Visit site settings in the address bar and allow "Apps on Device".
</div>
<div class="mobile-wallet-adapter-embedded-modal-divider"><hr></div>
<div class="mobile-wallet-adapter-embedded-modal-footer">
<div class="mobile-wallet-adapter-embedded-modal-details">
<!-- Clickable header (label associated with the checkbox) -->
<label for="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-header">
<!-- Hidden checkbox to track state -->
<input type="checkbox" id="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-input">
<span class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-label">
See details
</span>
<svg class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_147_1382" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
<rect width="24" height="24" fill="#D9D9D9"/>
</mask>
<g mask="url(#mask0_147_1382)">
<path d="M11.9999 17.0811C11.8506 17.0811 11.7087 17.0563 11.5741 17.0067C11.4395 16.957 11.3162 16.8762 11.2042 16.7643L6.57924 12.1393C6.36801 11.9281 6.26656 11.667 6.27489 11.3561C6.28322 11.0453 6.39301 10.7842 6.60424 10.573C6.81547 10.3618 7.08069 10.2561 7.39989 10.2561C7.71909 10.2561 7.9843 10.3618 8.19554 10.573L11.9999 14.3773L15.8292 10.548C16.0405 10.3368 16.3015 10.2353 16.6124 10.2436C16.9233 10.252 17.1843 10.3618 17.3955 10.573C17.6068 10.7842 17.7124 11.0494 17.7124 11.3686C17.7124 11.6878 17.6068 11.9531 17.3955 12.1643L12.7955 16.7643C12.6836 16.8762 12.5603 16.957 12.4257 17.0067C12.2911 17.0563 12.1492 17.0811 11.9999 17.0811Z" fill="black"/>
</g>
</svg>
</label>
<!-- Content to show/hide -->
<ul class="mobile-wallet-adapter-embedded-modal-details-collapsible-content">
<li>{{PERMISSION_INSTRUCTION_DETAIL}}</li>
<li>Allow "Apps on Device"</li>
</ul>
</div>
</div>
<div>
<button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
Got it
</button>
</div>
`,iy=`
.mobile-wallet-adapter-embedded-modal-close {
display: none;
}
.mobile-wallet-adapter-embedded-modal-content {
text-align: center;
}
.mobile-wallet-adapter-embedded-modal-header {
margin: 18px auto 30px auto;
color: #7D9093;
font-size: 1.0em;
font-weight: 500;
}
.mobile-wallet-adapter-embedded-modal-title {
margin: 18px 100px auto 100px;
color: #000000;
font-size: 2.75em;
font-weight: 600;
}
.mobile-wallet-adapter-embedded-modal-subtitle {
margin: 12px 60px 30px 60px;
color: #7D9093;
font-size: 1.25em;
font-weight: 400;
}
.mobile-wallet-adapter-embedded-modal-details-collapsible-header {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 10px auto 10px auto;
color: #000000;
font-size: 1.5em;
font-weight: 600;
cursor: pointer; /* Show pointer on hover */
transition: background 0.2s ease; /* Smooth background change */
}
.mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon {
transition: rotate 0.3s ease;
}
.mobile-wallet-adapter-embedded-modal-details-collapsible-input {
display: none; /* Hide the checkbox */
}
.mobile-wallet-adapter-embedded-modal-details-collapsible-content {
margin: 0px auto 40px auto;
max-height: 0px; /* Collapse content */
overflow: hidden; /* Hide overflow when collapsed */
transition: max-height 0.3s ease; /* Smooth transition */
}
.mobile-wallet-adapter-embedded-modal-details-collapsible-content li {
margin: 20px auto;
color: #000000;
font-size: 1.25em;
font-weight: 400;
text-align: left;
}
/* When checkbox is checked, show content */
.mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) ~ .mobile-wallet-adapter-embedded-modal-details-collapsible-content {
max-height: 300px;
}
.mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) > .mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon {
rotate: 180deg;
}
.mobile-wallet-adapter-embedded-modal-launch-action {
display: block;
width: 100%;
height: 56px;
/*margin-top: 40px;*/
font-size: 1.25em;
/*line-height: 24px;*/
/*letter-spacing: -1%;*/
background: #000000;
color: #FFFFFF;
border-radius: 18px;
}
/* Smaller screens */
@media all and (max-width: 600px) {
.mobile-wallet-adapter-embedded-modal-title {
font-size: 1.75em;
margin-right: 12px;
margin-left: 12px;
}
.mobile-wallet-adapter-embedded-modal-subtitle {
margin-right: 12px;
margin-left: 12px;
}
}
`,ay=class extends Kv{contentStyles=sy;contentHtml=oy;async init(){super.init(),this.#e()}#e(){let e=this.dom?.getElementById(`mobile-wallet-adapter-launch-action`),t=async()=>{e?.removeEventListener(`click`,t);try{await fetch(`http://localhost`)}catch{}this.close()};e?.addEventListener(`click`,t)}},oy=`
<div class="mobile-wallet-adapter-embedded-modal-title">Allow connections to your wallet</div>
<div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle">
Tap "Allow" on the next screen
</div>
<svg class="mobile-wallet-adapter-embedded-modal-permission-prompt-mock" xmlns="http://www.w3.org/2000/svg" width="281" height="83" viewBox="0 0 281 83" fill="none">
<rect width="281" height="83" rx="22" fill="#F0F3F5"/>
<path d="M254.194 64L252.626 56.657H254.047L254.866 61.452L254.985 62.278H255.02L255.146 61.452L255.993 57.497H257.4L258.254 61.431L258.373 62.278H258.415L258.534 61.431L259.346 56.657H260.718L259.143 64H257.673L256.826 59.961L256.693 59.093H256.651L256.511 59.961L255.664 64H254.194Z" fill="black"/>
<path d="M248.837 64.231C248.147 64.231 247.54 64.07 247.017 63.748C246.495 63.426 246.086 62.978 245.792 62.404C245.498 61.83 245.351 61.1673 245.351 60.416V60.241C245.351 59.4897 245.498 58.827 245.792 58.253C246.086 57.679 246.495 57.2333 247.017 56.916C247.54 56.594 248.147 56.433 248.837 56.433C249.528 56.433 250.135 56.594 250.657 56.916C251.18 57.2333 251.588 57.679 251.882 58.253C252.176 58.827 252.323 59.4897 252.323 60.241V60.416C252.323 61.1673 252.176 61.83 251.882 62.404C251.588 62.978 251.18 63.426 250.657 63.748C250.135 64.07 249.528 64.231 248.837 64.231ZM248.837 62.824C249.43 62.824 249.897 62.607 250.237 62.173C250.583 61.7343 250.755 61.1417 250.755 60.395V60.262C250.755 59.5107 250.583 58.918 250.237 58.484C249.897 58.05 249.43 57.833 248.837 57.833C248.249 57.833 247.783 58.05 247.437 58.484C247.092 58.918 246.919 59.5107 246.919 60.262V60.395C246.919 61.1417 247.092 61.7343 247.437 62.173C247.783 62.607 248.249 62.824 248.837 62.824Z" fill="black"/>
<path d="M242.298 64.231C241.467 64.231 240.814 63.993 240.338 63.517C239.866 63.0364 239.631 62.3737 239.631 61.529V53.78H241.178V61.389C241.178 62.3317 241.591 62.803 242.417 62.803C242.65 62.803 242.865 62.7587 243.061 62.67C243.257 62.5814 243.464 62.4367 243.684 62.236L244.538 63.377C244.225 63.6664 243.884 63.881 243.516 64.021C243.152 64.161 242.746 64.231 242.298 64.231ZM237.51 55.061V53.78H240.611V55.061H237.51Z" fill="black"/>
<path d="M234.463 64.231C233.633 64.231 232.979 63.993 232.503 63.517C232.032 63.0364 231.796 62.3737 231.796 61.529V53.78H233.343V61.389C233.343 62.3317 233.756 62.803 234.582 62.803C234.816 62.803 235.03 62.7587 235.226 62.67C235.422 62.5814 235.63 62.4367 235.849 62.236L236.703 63.377C236.391 63.6664 236.05 63.881 235.681 64.021C235.317 64.161 234.911 64.231 234.463 64.231ZM229.675 55.061V53.78H232.776V55.061H229.675Z" fill="black"/>
<path d="M221.442 64L224.557 53.976H226.132L229.233 64H227.581L225.642 56.972L225.341 55.761H225.299L225.005 56.972L223.073 64H221.442ZM222.835 61.634L223.255 60.29H227.371L227.805 61.634H222.835Z" fill="black"/>
<path d="M178.261 64L175.034 60.066V60.024L178.121 56.657H180.011L176.504 60.423V59.632L180.165 64H178.261ZM173.543 64V53.78H175.097V64H173.543Z" fill="#7D9093" fill-opacity="0.5"/>
<path d="M169.306 64.224C168.588 64.224 167.958 64.0653 167.416 63.748C166.88 63.426 166.462 62.9803 166.163 62.411C165.865 61.837 165.715 61.1673 165.715 60.402V60.248C165.715 59.4873 165.862 58.8223 166.156 58.253C166.45 57.679 166.863 57.2333 167.395 56.916C167.927 56.594 168.546 56.433 169.25 56.433C169.978 56.433 170.59 56.6056 171.084 56.951C171.579 57.2917 171.955 57.777 172.211 58.407L170.874 58.995C170.72 58.6123 170.508 58.323 170.237 58.127C169.967 57.9263 169.633 57.826 169.236 57.826C168.63 57.826 168.149 58.0383 167.794 58.463C167.444 58.883 167.269 59.4616 167.269 60.199V60.465C167.269 61.1837 167.454 61.7577 167.822 62.187C168.196 62.6163 168.69 62.831 169.306 62.831C169.712 62.831 170.06 62.733 170.349 62.537C170.639 62.341 170.877 62.0423 171.063 61.641L172.379 62.285C172.188 62.6957 171.941 63.0457 171.637 63.335C171.334 63.6243 170.986 63.846 170.594 64C170.202 64.1493 169.773 64.224 169.306 64.224Z" fill="#7D9093" fill-opacity="0.5"/>
<path d="M161.003 64.231C160.312 64.231 159.706 64.07 159.183 63.748C158.66 63.426 158.252 62.978 157.958 62.404C157.664 61.83 157.517 61.1673 157.517 60.416V60.241C157.517 59.4897 157.664 58.827 157.958 58.253C158.252 57.679 158.66 57.2333 159.183 56.916C159.706 56.594 160.312 56.433 161.003 56.433C161.694 56.433 162.3 56.594 162.823 56.916C163.346 57.2333 163.754 57.679 164.048 58.253C164.342 58.827 164.489 59.4897 164.489 60.241V60.416C164.489 61.1673 164.342 61.83 164.048 62.404C163.754 62.978 163.346 63.426 162.823 63.748C162.3 64.07 161.694 64.231 161.003 64.231ZM161.003 62.824C161.596 62.824 162.062 62.607 162.403 62.173C162.748 61.7343 162.921 61.1417 162.921 60.395V60.262C162.921 59.5107 162.748 58.918 162.403 58.484C162.062 58.05 161.596 57.833 161.003 57.833C160.415 57.833 159.948 58.05 159.603 58.484C159.258 58.918 159.085 59.5107 159.085 60.262V60.395C159.085 61.1417 159.258 61.7343 159.603 62.173C159.948 62.607 160.415 62.824 161.003 62.824Z" fill="#7D9093" fill-opacity="0.5"/>
<path d="M154.463 64.231C153.633 64.231 152.979 63.993 152.503 63.517C152.032 63.0364 151.796 62.3737 151.796 61.529V53.78H153.343V61.389C153.343 62.3317 153.756 62.803 154.582 62.803C154.816 62.803 155.03 62.7587 155.226 62.67C155.422 62.5814 155.63 62.4367 155.849 62.236L156.703 63.377C156.391 63.6664 156.05 63.881 155.681 64.021C155.317 64.161 154.911 64.231 154.463 64.231ZM149.675 55.061V53.78H152.776V55.061H149.675Z" fill="#7D9093" fill-opacity="0.5"/>
<path d="M142.24 64V53.976H145.544C146.421 53.976 147.112 54.1953 147.616 54.634C148.12 55.0726 148.372 55.6583 148.372 56.391V56.566C148.372 57.0886 148.246 57.5366 147.994 57.91C147.742 58.2833 147.38 58.5586 146.909 58.736V58.792C147.492 58.9226 147.947 59.2003 148.274 59.625C148.605 60.045 148.771 60.5606 148.771 61.172V61.361C148.771 61.893 148.645 62.3573 148.393 62.754C148.145 63.1506 147.795 63.4586 147.343 63.678C146.895 63.8926 146.365 64 145.754 64H142.24ZM143.794 62.656H145.572C146.085 62.656 146.482 62.5253 146.762 62.264C147.042 62.0026 147.182 61.6293 147.182 61.144V60.99C147.182 60.5046 147.037 60.1313 146.748 59.87C146.463 59.604 146.05 59.471 145.509 59.471H143.36V58.183H145.32C145.791 58.183 146.153 58.064 146.405 57.826C146.657 57.588 146.783 57.2496 146.783 56.811V56.685C146.783 56.2416 146.657 55.9033 146.405 55.67C146.157 55.4366 145.796 55.32 145.32 55.32H143.794V62.656Z" fill="#7D9093" fill-opacity="0.5"/>
<rect x="18" y="17" width="246" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/>
<rect x="18" y="33" width="82" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/>
</svg>
<div>
<button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
Continue to Allow
</button>
</div>
`,sy=`
.mobile-wallet-adapter-embedded-modal-close {
display: none;
}
.mobile-wallet-adapter-embedded-modal-content {
text-align: center;
}
.mobile-wallet-adapter-embedded-modal-title {
margin: 18px 100px auto 100px;
color: #000000;
font-size: 2.75em;
font-weight: 600;
}
.mobile-wallet-adapter-embedded-modal-subtitle {
margin: 20px 60px 40px 60px;
color: #7D9093;
font-size: 1.25em;
font-weight: 400;
}
.mobile-wallet-adapter-embedded-modal-permission-prompt-mock {
width: 90%;
height: auto;
margin: 0 auto 30px auto;
display: block;
}
.mobile-wallet-adapter-embedded-modal-launch-action {
display: block;
width: 100%;
height: 56px;
font-size: 1.25em;
background: #000000;
color: #FFFFFF;
border-radius: 18px;
}
/* Smaller screens */
@media all and (max-width: 600px) {
.mobile-wallet-adapter-embedded-modal-title {
font-size: 1.5em;
margin-right: 12px;
margin-left: 12px;
}
.mobile-wallet-adapter-embedded-modal-subtitle {
margin-right: 12px;
margin-left: 12px;
}
}
`;function cy(e){return e.includes(`Solana Mobile Web Shell`)}function ly(){let e=typeof document<`u`&&document.referrer.startsWith(`android-app://`);if(typeof window>`u`)return e;let t=window.matchMedia(`(display-mode: standalone)`).matches,n=window.matchMedia(`(display-mode: fullscreen)`).matches,r=window.matchMedia(`(display-mode: minimal-ui)`).matches;return e||t||n||r}async function uy(){if(!(typeof navigator<`u`&&cy(navigator.userAgent)))try{let e=await navigator.permissions.query({name:`loopback-network`});if(e.state===`granted`)return;if(e.state===`denied`){let e=new ny;throw e.init(),e.open(),new T_(w_.ERROR_LOOPBACK_ACCESS_BLOCKED,`Local Network Access permission denied`)}else if(e.state===`prompt`){let t=new ay;if(await new Promise((n,r)=>{t.addEventListener(`close`,e=>{e&&r(new T_(w_.ERROR_ASSOCIATION_CANCELLED,`Wallet connection cancelled by user`,{event:e}))}),e.onchange=()=>{e.onchange=null,n(e.state)},t.init(),t.open()})===`granted`){let e=new $v;await new Promise((t,n)=>{e.addEventListener(`close`,e=>{e&&n(new T_(w_.ERROR_ASSOCIATION_CANCELLED,`Wallet connection cancelled by user`,{event:e}))}),e.initWithCallback(async()=>{t(!0)}),e.open()});return}else return await uy()}throw new T_(w_.ERROR_LOOPBACK_ACCESS_BLOCKED,`Local Network Access permission unknown`)}catch(e){if(e instanceof TypeError&&(e.message.includes(`loopback-network`)||e.message.includes(`local-network-access`)))return;throw e instanceof T_?e:new T_(w_.ERROR_LOOPBACK_ACCESS_BLOCKED,e instanceof Error?e.message:`Local Network Access permission unknown`)}}var dy=`
<div class="mobile-wallet-adapter-embedded-loading-indicator" role="dialog" aria-modal="true" aria-labelledby="modal-title">
<div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div>
<div class="mobile-wallet-adapter-embedded-loading-container">
<div class="mobile-wallet-adapter-embedded-loading-animation"></div>
</div>
</div>
`,fy=`
.mobile-wallet-adapter-embedded-loading-indicator {
display: flex; /* Use flexbox to center content */
justify-content: center; /* Center horizontally */
align-items: start; /* Center vertically */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
overflow-y: auto; /* enable scrolling */
}
.mobile-wallet-adapter-embedded-loading-container {
display: flex;
margin: auto;
}
.mobile-wallet-adapter-embedded-loading-animation {
position: relative;
left: -9999px;
width: 10px;
height: 10px;
border-radius: 5px;
background-color: var(--spinner-color);
color: var(--spinner-color);
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
animation: dot-typing 1.5s infinite linear;
}
@keyframes dot-typing {
0% {
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
}
16.667% {
box-shadow: 9984px -10px 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
}
33.333% {
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
}
50% {
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px -10px 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
}
66.667% {
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
}
83.333% {
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px -10px 0 0 var(--spinner-color);
}
100% {
box-shadow: 9984px 0 0 0 var(--spinner-color),
9999px 0 0 0 var(--spinner-color),
10014px 0 0 0 var(--spinner-color);
}
}
`,py=class{#e=null;#t={};#n=!1;dom=null;constructor(){this.init=this.init.bind(this),this.#e=document.getElementById(`mobile-wallet-adapter-embedded-root-ui`)}async init(){console.log(`Injecting modal`),this.#r()}open=()=>{console.debug(`Modal open`),this.#i(),this.#e&&(this.#e.style.display=`flex`)};close=(e=void 0)=>{console.debug(`Modal close`),this.#a(),this.#e&&(this.#e.style.display=`none`),this.#t.close?.forEach(t=>t(e))};addEventListener(e,t){return this.#t[e]?.push(t)||(this.#t[e]=[t]),()=>this.removeEventListener(e,t)}removeEventListener(e,t){this.#t[e]=this.#t[e]?.filter(e=>t!==e)}#r(){if(this.dom)return;this.#e=document.createElement(`div`),this.#e.id=`mobile-wallet-adapter-embedded-root-ui`,this.#e.innerHTML=dy,this.#e.style.display=`none`;let e=document.createElement(`style`);e.id=`mobile-wallet-adapter-embedded-modal-styles`,e.textContent=fy;let t=document.createElement(`div`);this.dom=t.attachShadow({mode:`closed`}),t.style.setProperty(`--spinner-color`,`#FFFFFF`),this.dom.appendChild(e),this.dom.appendChild(this.#e),document.body.appendChild(t)}#i(){!this.#e||this.#n||([...this.#e.querySelectorAll(`[data-modal-close]`)].forEach(e=>e?.addEventListener(`click`,e=>{this.close(e)})),window.addEventListener(`load`,this.close),document.addEventListener(`keydown`,this.#o),this.#n=!0)}#a(){this.#n&&(window.removeEventListener(`load`,this.close),document.removeEventListener(`keydown`,this.#o),this.#e&&([...this.#e.querySelectorAll(`[data-modal-close]`)].forEach(e=>e?.removeEventListener(`click`,this.close)),this.#n=!1))}#o=e=>{e.key===`Escape`&&this.close(e)}},my=`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDIuNUgxN0MxNy44Mjg0IDIuNSAxOC41IDMuMTcxNTcgMTguNSA0VjIwQzE4LjUgMjAuODI4NCAxNy44Mjg0IDIxLjUgMTcgMjEuNUg3QzYuMTcxNTcgMjEuNSA1LjUgMjAuODI4NCA1LjUgMjBWNEM1LjUgMy4xNzE1NyA2LjE3MTU3IDIuNSA3IDIuNVpNMyA0QzMgMS43OTA4NiA0Ljc5MDg2IDAgNyAwSDE3QzE5LjIwOTEgMCAyMSAxLjc5MDg2IDIxIDRWMjBDMjEgMjIuMjA5MSAxOS4yMDkxIDI0IDE3IDI0SDdDNC43OTA4NiAyNCAzIDIyLjIwOTEgMyAyMFY0Wk0xMSA0LjYxNTM4QzEwLjQ0NzcgNC42MTUzOCAxMCA1LjA2MzEgMTAgNS42MTUzOFY2LjM4NDYyQzEwIDYuOTM2OSAxMC40NDc3IDcuMzg0NjIgMTEgNy4zODQ2MkgxM0MxMy41NTIzIDcuMzg0NjIgMTQgNi45MzY5IDE0IDYuMzg0NjJWNS42MTUzOEMxNCA1LjA2MzEgMTMuNTUyMyA0LjYxNTM4IDEzIDQuNjE1MzhIMTFaIiBmaWxsPSIjRENCOEZGIi8+Cjwvc3ZnPgo=`,hy=`Mobile Wallet Adapter`,gy=64,_y=[hg,vg,_g,gg],vy=3e4;function yy(e){return e instanceof Error?e.message:`Unknown error`}var by=class{#e={};#t=`1.0.0`;#n=hy;#r=`https://solanamobile.com/wallets`;#i=my;#a;#o;#s;#c=!1;#l=0;#u=[];#d;#f;#p;get version(){return this.#t}get name(){return this.#n}get url(){return this.#r}get icon(){return this.#i}get chains(){return this.#u}get features(){return{[yg]:{version:`1.0.0`,connect:this.#_},[bg]:{version:`1.0.0`,disconnect:this.#S},[xg]:{version:`1.0.0`,on:this.#m},[_g]:{version:`1.0.0`,signMessage:this.#A},[gg]:{version:`1.0.0`,signIn:this.#j},...this.#f}}get accounts(){return this.#o?.accounts??[]}constructor(e){this.#s=e.authorizationCache,this.#a=e.appIdentity,this.#u=e.chains,this.#d=e.chainSelector,this.#p=e.onWalletNotFound,this.#f={[hg]:{version:`1.0.0`,supportedTransactionVersions:[`legacy`,0],signAndSendTransaction:this.#O},[vg]:{version:`1.0.0`,supportedTransactionVersions:[`legacy`,0],signTransaction:this.#k}}}get connected(){return!!this.#o}get isAuthorized(){return!!this.#o}get currentAuthorization(){return this.#o}get cachedAuthorizationResult(){return this.#s.get()}#m=(e,t)=>(this.#e[e]?.push(t)||(this.#e[e]=[t]),()=>this.#g(e,t));#h(e,...t){this.#e[e]?.forEach(e=>e.apply(null,t))}#g(e,t){this.#e[e]=this.#e[e]?.filter(e=>t!==e)}#_=async({silent:e}={})=>{if(this.#c||this.connected)return{accounts:this.accounts};this.#c=!0;try{if(e){let e=await this.#s.get();if(e)await this.#b(e.capabilities),await this.#y(e);else return{accounts:this.accounts}}else await this.#v()}catch(e){throw Error(yy(e),{cause:e})}finally{this.#c=!1}return{accounts:this.accounts}};#v=async e=>{try{let t=await this.#s.get();if(t)return this.#y(t),t;let n=await this.#d.select(this.#u);return await this.#C(async t=>{let[r,i]=await Promise.all([t.getCapabilities(),t.authorize({chain:n,identity:this.#a,sign_in_payload:e})]),a=this.#T(i.accounts),o={...i,accounts:a,chain:n,capabilities:r};return Promise.all([this.#b(r),this.#s.set(o),this.#y(o)]),o})}catch(e){throw Error(yy(e),{cause:e})}};#y=async e=>{let t=this.#o==null||this.#o?.accounts.length!==e.accounts.length||this.#o.accounts.some((t,n)=>t.address!==e.accounts[n].address);this.#o=e,t&&this.#h(`change`,{accounts:this.accounts})};#b=async e=>{let t=e.features.includes(`solana:signTransactions`),n=e.supports_sign_and_send_transactions,r=`solana:signAndSendTransaction`in this.features!==n||`solana:signTransaction`in this.features!==t;this.#f={...(n||!n&&!t)&&{"solana:signAndSendTransaction":{version:`1.0.0`,supportedTransactionVersions:[`legacy`,0],signAndSendTransaction:this.#O}},...t&&{"solana:signTransaction":{version:`1.0.0`,supportedTransactionVersions:[`legacy`,0],signTransaction:this.#k}}},r&&this.#h(`change`,{features:this.features})};#x=async(e,t,n)=>{try{let[r,i]=await Promise.all([this.#o?.capabilities??await e.getCapabilities(),e.authorize({auth_token:t,identity:this.#a,chain:n})]),a=this.#T(i.accounts),o={...i,accounts:a,chain:n,capabilities:r};Promise.all([this.#s.set(o),this.#y(o)])}catch(e){throw this.#S(),Error(yy(e),{cause:e})}};#S=async()=>{this.#s.clear(),this.#c=!1,this.#l++,this.#o=void 0,this.#h(`change`,{accounts:this.accounts})};#C=async e=>{let t=this.#o?.wallet_uri_base,n=t?{baseUri:t}:void 0,r=this.#l,i=new py;try{let t=!0,r,a=await Promise.race([uy().then(async()=>{i.init();let{wallet:r,close:a}=await fv(n);t=!1,i.addEventListener(`close`,e=>{e&&a()}),i.open();let o=await e(await r);return i.close(),a(),o}),new Promise((e,n)=>{r=setTimeout(()=>{t&&n(new T_(w_.ERROR_ASSOCIATION_CANCELLED,`Wallet connection timed out`,{event:void 0}))},vy)})]);return clearTimeout(r),a}catch(e){throw i.close(),this.#l!==r&&await new Promise(()=>{}),e instanceof Error&&e.name===`SolanaMobileWalletAdapterError`&&e.code===`ERROR_WALLET_NOT_FOUND`&&await this.#p(this),e}};#w=()=>{if(!this.#o)throw Error(`Wallet not connected`);return{authToken:this.#o.auth_token,chain:this.#o.chain}};#T=e=>e.map(e=>{let t=p_(e.address);return{address:u_(t),publicKey:t,label:e.label,icon:e.icon,chains:e.chains??this.#u,features:e.features??_y}});#E=async e=>{let{authToken:t,chain:n}=this.#w();try{let r=e.map(e=>f_(e));return await this.#C(async e=>(await this.#x(e,t,n),(await e.signTransactions({payloads:r})).signed_payloads.map(p_)))}catch(e){throw Error(yy(e),{cause:e})}};#D=async(e,t)=>{let{authToken:n,chain:r}=this.#w();try{return await this.#C(async i=>{let[a]=await Promise.all([i.getCapabilities(),this.#x(i,n,r)]);if(a.supports_sign_and_send_transactions){let n=f_(e);return(await i.signAndSendTransactions({...t,payloads:[n]})).signatures.map(p_)[0]}else throw Error(`connected wallet does not support signAndSendTransaction`)})}catch(e){throw Error(yy(e),{cause:e})}};#O=async(...e)=>{let t=[];for(let n of e){let e=await this.#D(n.transaction,n.options);t.push({signature:e})}return t};#k=async(...e)=>(await this.#E(e.map(({transaction:e})=>e))).map(e=>({signedTransaction:e}));#A=async(...e)=>{let{authToken:t,chain:n}=this.#w(),r=e.map(({account:e})=>f_(new Uint8Array(e.publicKey))),i=e.map(({message:e})=>f_(e));try{return await this.#C(async e=>(await this.#x(e,t,n),(await e.signMessages({addresses:r,payloads:i})).signed_payloads.map(p_).map(e=>({signedMessage:e,signature:e.slice(-gy)}))))}catch(e){throw Error(yy(e),{cause:e})}};#j=async(...e)=>{let t=[];if(e.length>1)for(let n of e)t.push(await this.#M(n));else return[await this.#M(e[0])];return t};#M=async e=>{this.#c=!0;try{let t=await this.#v({...e,domain:e?.domain??window.location.host});if(!t.sign_in_result)throw Error(`Sign in failed, no sign in result returned by wallet`);let n=t.sign_in_result.address,r=t.accounts.find(e=>e.address==n);return{account:{...r??{address:u_(p_(n))},publicKey:p_(n),chains:r?.chains??this.#u,features:r?.features??t.capabilities.features},signedMessage:p_(t.sign_in_result.signed_message),signature:p_(t.sign_in_result.signature)}}catch(e){throw Error(yy(e),{cause:e})}finally{this.#c=!1}}},xy=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Sy=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},Cy,wy=void 0,Ty=new Set;function Ey(e){jy=void 0,Ty.add(e)}function Dy(e){jy=void 0,Ty.delete(e)}var Oy={};function ky(){if(wy||(wy=Object.freeze({register:Ay,get:My,on:Ny}),typeof window>`u`))return wy;let e=Object.freeze({register:Ay});try{window.addEventListener(`wallet-standard:register-wallet`,({detail:t})=>t(e))}catch(e){console.error(`wallet-standard:register-wallet event listener could not be added
`,e)}try{window.dispatchEvent(new Fy(e))}catch(e){console.error(`wallet-standard:app-ready event could not be dispatched
`,e)}return wy}function Ay(...e){return e=e.filter(e=>!Ty.has(e)),e.length?(e.forEach(e=>Ey(e)),Oy.register?.forEach(t=>Py(()=>t(...e))),function(){e.forEach(e=>Dy(e)),Oy.unregister?.forEach(t=>Py(()=>t(...e)))}):()=>{}}var jy;function My(){return jy||=[...Ty],jy}function Ny(e,t){return Oy[e]?.push(t)||(Oy[e]=[t]),function(){Oy[e]=Oy[e]?.filter(e=>t!==e)}}function Py(e){try{e()}catch(e){console.error(e)}}var Fy=class extends Event{get detail(){return xy(this,Cy,`f`)}get type(){return`wallet-standard:app-ready`}constructor(e){super(`wallet-standard:app-ready`,{bubbles:!1,cancelable:!1,composed:!1}),Cy.set(this,void 0),Sy(this,Cy,e,`f`)}preventDefault(){throw Error(`preventDefault cannot be called`)}stopImmediatePropagation(){throw Error(`stopImmediatePropagation cannot be called`)}stopPropagation(){throw Error(`stopPropagation cannot be called`)}};Cy=new WeakMap;function Iy(){if(wy||(wy=ky(),typeof window>`u`))return wy;let e=window.navigator.wallets||[];if(!Array.isArray(e))return console.error(`window.navigator.wallets is not an array`),wy;let{register:t}=wy,n=(...e)=>e.forEach(e=>Py(()=>e({register:t})));try{Object.defineProperty(window.navigator,`wallets`,{value:Object.freeze({push:n})})}catch{return console.error(`window.navigator.wallets could not be set`),wy}return n(...e),wy}Uh();function Ly(){return typeof window<`u`&&window.isSecureContext&&typeof document<`u`&&/android/i.test(navigator.userAgent)}var Ry=hy,zy=64;function By(e){return`version`in e}function Vy(e){switch(e){case`mainnet-beta`:return`solana:mainnet`;case`testnet`:return`solana:testnet`;case`devnet`:return`solana:devnet`;default:return e}}function Hy(e){return e instanceof Error?e.message:`Unknown error`}var Uy=class extends mg{supportedTransactionVersions=new Set([`legacy`,0]);name;icon;url;#e;#t=!1;#n=Ly()?sg.Loadable:sg.Unsupported;#r;#i;#a;#o=async e=>{if(e.accounts&&e.accounts.length>0){this.#c();let t=await this.#r(e.accounts);t!==this.#i&&(this.#i=t,this.#a=void 0,this.emit(`connect`,this.publicKey))}};constructor(e,t){super(),this.#r=async e=>{let n=await t.addressSelector.select(e.map(({publicKey:e})=>f_(new Uint8Array(e))));return e.find(({publicKey:e})=>f_(new Uint8Array(e))===n)??e[0]},this.#e=e,this.#e.features[xg].on(`change`,this.#o),this.name=this.#e.name,this.icon=this.#e.icon,this.url=this.#e.url}get publicKey(){if(!this.#a&&this.#i)try{this.#a=new Z(this.#i.publicKey)}catch(e){throw new tg(e instanceof Error&&e?.message||`Unknown error`,e)}return this.#a??null}get connected(){return this.#e.connected}get connecting(){return this.#t}get readyState(){return this.#n}async autoConnect_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(){return await this.autoConnect()}async autoConnect(){this.#s(!0)}async connect(){this.#s()}async#s(e=!1){if(!(this.connecting||this.connected))return await this.#d(async()=>{if(this.#n!==sg.Installed&&this.#n!==sg.Loadable)throw new Yh;this.#t=!0;try{await this.#e.features[yg].connect({silent:e})}catch(e){throw new Zh(e instanceof Error&&e.message||`Unknown error`,e)}finally{this.#t=!1}})}async performAuthorization(e){try{let t=await this.#e.cachedAuthorizationResult;return t?(await this.#e.features[yg].connect({silent:!0}),t):(e?await this.#e.features[gg].signIn(e):await this.#e.features[yg].connect(),await await this.#e.cachedAuthorizationResult)}catch(e){throw new Zh(e instanceof Error&&e.message||`Unknown error`,e)}}async disconnect(){return await this.#d(async()=>{this.#t=!1,this.#a=void 0,this.#i=void 0,await this.#e.features[bg].disconnect(),this.emit(`disconnect`)})}async signIn(e){return this.#d(async()=>{if(this.#n!==sg.Installed&&this.#n!==sg.Loadable)throw new Yh;this.#t=!0;try{let t=await this.#e.features[gg].signIn({...e,domain:e?.domain??window.location.host});if(t.length>0)return t[0];throw Error(`Sign in failed, no sign in result returned by wallet`)}catch(e){throw new Zh(e instanceof Error&&e.message||`Unknown error`,e)}finally{this.#t=!1}})}async signMessage(e){return await this.#d(async()=>{let t=this.#l();try{return(await this.#e.features[_g].signMessage({account:t,message:e}))[0].signature}catch(e){throw new ag(Hy(e),e)}})}async sendTransaction(e,t,n){return await this.#d(async()=>{let r=this.#l();try{function i(){let e;switch(t.commitment){case`confirmed`:case`finalized`:case`processed`:e=t.commitment;break;default:e=`finalized`}let r;switch(n?.preflightCommitment){case`confirmed`:case`finalized`:case`processed`:r=n.preflightCommitment;break;case void 0:r=e;break;default:r=`finalized`}return(r===`finalized`?2:+(r===`confirmed`))<(e===`finalized`?2:+(e===`confirmed`))?r:e}if(`solana:signAndSendTransaction`in this.#e.features){let t=Vy(this.#e.currentAuthorization.chain),[i]=(await this.#e.features[hg].signAndSendTransaction({account:r,transaction:e.serialize(),chain:t,options:n?{skipPreflight:n.skipPreflight,maxRetries:n.maxRetries}:void 0})).map(e=>f_(e.signature));return i}else{let[r]=await this.#u([e]);if(By(r))return await t.sendTransaction(r);{let e=r.serialize();return await t.sendRawTransaction(e,{...n,preflightCommitment:i()})}}}catch(e){throw new rg(Hy(e),e)}})}async signTransaction(e){return await this.#d(async()=>{let[t]=await this.#u([e]);return t})}async signAllTransactions(e){return await this.#d(async()=>await this.#u(e))}#c(){this.#n!==sg.Installed&&this.emit(`readyStateChange`,this.#n=sg.Installed)}#l(){if(!this.#e.isAuthorized||!this.#i)throw new ng;return this.#i}async#u(e){let t=this.#l();try{if(`solana:signTransaction`in this.#e.features)return this.#e.features[vg].signTransaction(...e.map(e=>({account:t,transaction:e.serialize()}))).then(e=>e.map(e=>{let t=e.signedTransaction,n=t[0]*zy+1;return ip.deserializeMessageVersion(t.slice(n,t.length))===`legacy`?cp.from(t):lp.deserialize(t)}));throw Error(`Connected wallet does not support signing transactions`)}catch(e){throw new ig(Hy(e),e)}}async#d(e){try{return await e()}catch(e){throw this.emit(`error`,e instanceof Jh?e:new Jh(Hy(e),e)),e}}},Wy=class extends Uy{constructor(e){let t=Vy(e.chain??e.cluster);super(new by({appIdentity:e.appIdentity,authorizationCache:{set:e.authorizationResultCache.set,get:async()=>await e.authorizationResultCache.get(),clear:e.authorizationResultCache.clear},chains:[t],chainSelector:Hv(),onWalletNotFound:async()=>{e.onWalletNotFound(this)}}),{addressSelector:e.addressSelector,chain:t})}},Gy=class extends Wy{};function Ky(){return{async select(e){return e[0]}}}function qy(){return Vv()}async function Jy(e){return Qv()}function Yy(){return Jy}function Xy(e){if(e.length>=255)throw TypeError(`Alphabet too long`);let t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let n=0;n<e.length;n++){let r=e.charAt(n),i=r.charCodeAt(0);if(t[i]!==255)throw TypeError(r+` is ambiguous`);t[i]=n}let n=e.length,r=e.charAt(0),i=Math.log(n)/Math.log(256),a=Math.log(256)/Math.log(n);function o(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 TypeError(`Expected Uint8Array`);if(t.length===0)return``;let i=0,o=0,s=0,c=t.length;for(;s!==c&&t[s]===0;)s++,i++;let l=(c-s)*a+1>>>0,u=new Uint8Array(l);for(;s!==c;){let e=t[s],r=0;for(let t=l-1;(e!==0||r<o)&&t!==-1;t--,r++)e+=256*u[t]>>>0,u[t]=e%n>>>0,e=e/n>>>0;if(e!==0)throw Error(`Non-zero carry`);o=r,s++}let d=l-o;for(;d!==l&&u[d]===0;)d++;let f=r.repeat(i);for(;d<l;++d)f+=e.charAt(u[d]);return f}function s(e){if(typeof e!=`string`)throw TypeError(`Expected String`);if(e.length===0)return new Uint8Array;let a=0,o=0,s=0;for(;e[a]===r;)o++,a++;let c=(e.length-a)*i+1>>>0,l=new Uint8Array(c);for(;a<e.length;){let r=e.charCodeAt(a);if(r>255)return;let i=t[r];if(i===255)return;let o=0;for(let e=c-1;(i!==0||o<s)&&e!==-1;e--,o++)i+=n*l[e]>>>0,l[e]=i%256>>>0,i=i/256>>>0;if(i!==0)throw Error(`Non-zero carry`);s=o,a++}let u=c-s;for(;u!==c&&l[u]===0;)u++;let d=new Uint8Array(o+(c-u)),f=o;for(;u!==c;)d[f++]=l[u++];return d}function c(e){let t=s(e);if(t)return t;throw Error(`Non-base`+n+` character`)}return{encode:o,decodeUnsafe:s,decode:c}}var Zy=Xy(`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`);Uh();var $=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Qy=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},$y,eb,tb,nb,rb,ib,ab,ob,sb,cb,lb,ub,db,fb,pb,mb,hb,gb,_b=class extends cg{get name(){return $(this,ob,`f`).name}get url(){return`https://github.com/solana-labs/wallet-standard`}get icon(){return $(this,ob,`f`).icon}get readyState(){return $(this,sb,`f`)}get publicKey(){return $(this,tb,`f`)}get connecting(){return $(this,nb,`f`)}get supportedTransactionVersions(){return $(this,ab,`f`)}get wallet(){return $(this,ob,`f`)}get standard(){return!0}constructor({wallet:e}){super(),$y.add(this),eb.set(this,void 0),tb.set(this,void 0),nb.set(this,void 0),rb.set(this,void 0),ib.set(this,void 0),ab.set(this,void 0),ob.set(this,void 0),sb.set(this,typeof window>`u`||typeof document>`u`?sg.Unsupported:sg.Installed),fb.set(this,e=>{if(`accounts`in e){let e=$(this,ob,`f`).accounts[0];$(this,eb,`f`)&&!$(this,rb,`f`)&&e!==$(this,eb,`f`)&&(e?$(this,$y,`m`,lb).call(this,e):(this.emit(`error`,new Qh),$(this,$y,`m`,ub).call(this)))}`features`in e&&$(this,$y,`m`,db).call(this)}),Qy(this,ob,e,`f`),Qy(this,eb,null,`f`),Qy(this,tb,null,`f`),Qy(this,nb,!1,`f`),Qy(this,rb,!1,`f`),Qy(this,ib,$(this,ob,`f`).features[xg].on(`change`,$(this,fb,`f`)),`f`),$(this,$y,`m`,db).call(this)}destroy(){Qy(this,eb,null,`f`),Qy(this,tb,null,`f`),Qy(this,nb,!1,`f`),Qy(this,rb,!1,`f`);let e=$(this,ib,`f`);e&&(Qy(this,ib,null,`f`),e())}async autoConnect(){return $(this,$y,`m`,cb).call(this,{silent:!0})}async connect(){return $(this,$y,`m`,cb).call(this)}async disconnect(){if(`standard:disconnect`in $(this,ob,`f`).features)try{Qy(this,rb,!0,`f`),await $(this,ob,`f`).features[bg].disconnect()}catch(e){this.emit(`error`,new $h(e?.message,e))}finally{Qy(this,rb,!1,`f`)}$(this,$y,`m`,ub).call(this)}async sendTransaction(e,t,n={}){try{let r=$(this,eb,`f`);if(!r)throw new ng;let i;if(`solana:signAndSendTransaction`in $(this,ob,`f`).features)if(r.features.includes(`solana:signAndSendTransaction`))i=hg;else if(`solana:signTransaction`in $(this,ob,`f`).features&&r.features.includes(`solana:signTransaction`))i=vg;else throw new eg;else if(`solana:signTransaction`in $(this,ob,`f`).features){if(!r.features.includes(`solana:signTransaction`))throw new eg;i=vg}else throw new Xh;let a=S_(t.rpcEndpoint);if(!r.chains.includes(a))throw new rg;try{let{signers:o,...s}=n,c;if(dg(e)?(o?.length&&e.sign(o),c=e.serialize()):(e=await this.prepareTransaction(e,t,s),o?.length&&e.partialSign(...o),c=new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))),i===`solana:signAndSendTransaction`){let[e]=await $(this,ob,`f`).features[hg].signAndSendTransaction({account:r,chain:a,transaction:c,options:{preflightCommitment:x_(s.preflightCommitment||t.commitment),skipPreflight:s.skipPreflight,maxRetries:s.maxRetries,minContextSlot:s.minContextSlot}});return Zy.encode(e.signature)}else{let[e]=await $(this,ob,`f`).features[vg].signTransaction({account:r,chain:a,transaction:c,options:{preflightCommitment:x_(s.preflightCommitment||t.commitment),minContextSlot:s.minContextSlot}});return await t.sendRawTransaction(e.signedTransaction,{...s,preflightCommitment:x_(s.preflightCommitment||t.commitment)})}}catch(e){throw e instanceof Jh?e:new rg(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}}};eb=new WeakMap,tb=new WeakMap,nb=new WeakMap,rb=new WeakMap,ib=new WeakMap,ab=new WeakMap,ob=new WeakMap,sb=new WeakMap,fb=new WeakMap,$y=new WeakSet,cb=async function(e){try{if(this.connected||this.connecting)return;if($(this,sb,`f`)!==sg.Installed)throw new Yh;if(Qy(this,nb,!0,`f`),!$(this,ob,`f`).accounts.length)try{await $(this,ob,`f`).features[yg].connect(e)}catch(e){throw new Zh(e?.message,e)}let t=$(this,ob,`f`).accounts[0];if(!t)throw new eg;$(this,$y,`m`,lb).call(this,t)}catch(e){throw this.emit(`error`,e),e}finally{Qy(this,nb,!1,`f`)}},lb=function(e){let t;try{t=new Z(e.address)}catch(e){throw new tg(e?.message,e)}Qy(this,eb,e,`f`),Qy(this,tb,t,`f`),$(this,$y,`m`,db).call(this),this.emit(`connect`,t)},ub=function(){Qy(this,eb,null,`f`),Qy(this,tb,null,`f`),$(this,$y,`m`,db).call(this),this.emit(`disconnect`)},db=function(){let e=`solana:signAndSendTransaction`in $(this,ob,`f`).features?$(this,ob,`f`).features[hg].supportedTransactionVersions:$(this,ob,`f`).features[vg].supportedTransactionVersions;Qy(this,ab,b_(e,[`legacy`])?null:new Set(e),`f`),`solana:signTransaction`in $(this,ob,`f`).features&&$(this,eb,`f`)?.features.includes(`solana:signTransaction`)?(this.signTransaction=$(this,$y,`m`,pb),this.signAllTransactions=$(this,$y,`m`,mb)):(delete this.signTransaction,delete this.signAllTransactions),`solana:signMessage`in $(this,ob,`f`).features&&$(this,eb,`f`)?.features.includes(`solana:signMessage`)?this.signMessage=$(this,$y,`m`,hb):delete this.signMessage,`solana:signIn`in $(this,ob,`f`).features?this.signIn=$(this,$y,`m`,gb):delete this.signIn},pb=async function(e){try{let t=$(this,eb,`f`);if(!t)throw new ng;if(!(`solana:signTransaction`in $(this,ob,`f`).features))throw new Xh;if(!t.features.includes(`solana:signTransaction`))throw new eg;try{let n=(await $(this,ob,`f`).features[vg].signTransaction({account:t,transaction:dg(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}))[0].signedTransaction;return dg(e)?lp.deserialize(n):cp.from(n)}catch(e){throw e instanceof Jh?e:new ig(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}},mb=async function(e){try{let t=$(this,eb,`f`);if(!t)throw new ng;if(!(`solana:signTransaction`in $(this,ob,`f`).features))throw new Xh;if(!t.features.includes(`solana:signTransaction`))throw new eg;try{let n=await $(this,ob,`f`).features[vg].signTransaction(...e.map(e=>({account:t,transaction:dg(e)?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))})));return e.map((e,t)=>{let r=n[t].signedTransaction;return dg(e)?lp.deserialize(r):cp.from(r)})}catch(e){throw new ig(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}},hb=async function(e){try{let t=$(this,eb,`f`);if(!t)throw new ng;if(!(`solana:signMessage`in $(this,ob,`f`).features))throw new Xh;if(!t.features.includes(`solana:signMessage`))throw new eg;try{return(await $(this,ob,`f`).features[_g].signMessage({account:t,message:e}))[0].signature}catch(e){throw new ag(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}},gb=async function(e={}){try{if(!(`solana:signIn`in $(this,ob,`f`).features))throw new Xh;let t;try{[t]=await $(this,ob,`f`).features[gg].signIn(e)}catch(e){throw new og(e?.message,e)}if(!t)throw new og;return $(this,$y,`m`,lb).call(this,t.account),t}catch(e){throw this.emit(`error`,e),e}};var vb=Sg;function yb(e){let t=bb(()=>new Set),{get:n,on:r}=bb(()=>Iy()),[i,a]=(0,w.useState)(()=>Sb(n()));(0,w.useEffect)(()=>{let e=[r(`register`,(...e)=>a(t=>[...t,...Sb(e)])),r(`unregister`,(...e)=>a(t=>t.filter(t=>e.some(e=>e===t.wallet))))];return()=>e.forEach(e=>e())},[r]);let o=xb(i);return(0,w.useEffect)(()=>{if(!o)return;let e=new Set(i);new Set(o.filter(t=>!e.has(t))).forEach(e=>e.destroy())},[o,i]),(0,w.useEffect)(()=>()=>i.forEach(e=>e.destroy()),[]),(0,w.useMemo)(()=>[...i,...e.filter(({name:e})=>i.some(t=>t.name===e)?(t.has(e)||(t.add(e),console.warn(`${e} was registered as a Standard Wallet. The Wallet Adapter for ${e} can be removed from your app.`)),!1):!0)],[i,e,t])}function bb(e){let t=(0,w.useRef)(void 0);return t.current===void 0&&(t.current={value:e()}),t.current.value}function xb(e){let t=(0,w.useRef)(void 0);return(0,w.useEffect)(()=>{t.current=e}),t.current}function Sb(e){return e.filter(vb).map(e=>new _b({wallet:e}))}var Cb;(function(e){e[e.DESKTOP_WEB=0]=`DESKTOP_WEB`,e[e.MOBILE_WEB=1]=`MOBILE_WEB`})(Cb||={});function wb(e){return/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(e)}function Tb({adapters:e,userAgentString:t}){return e.some(e=>e.name!==Ry&&e.readyState===sg.Installed)?Cb.DESKTOP_WEB:t&&/android/i.test(t)&&!wb(t)?Cb.MOBILE_WEB:Cb.DESKTOP_WEB}function Eb(e){return e?/devnet/i.test(e)?`devnet`:/testnet/i.test(e)?`testnet`:`mainnet-beta`:`mainnet-beta`}function Db({children:e,wallets:t,adapter:n,isUnloadingRef:r,onAutoConnectRequest:i,onConnectError:a,onError:o,onSelectWallet:s}){let c=(0,w.useRef)(!1),[l,u]=(0,w.useState)(!1),d=(0,w.useRef)(!1),[f,p]=(0,w.useState)(!1),[m,h]=(0,w.useState)(()=>n?.publicKey??null),[g,_]=(0,w.useState)(()=>n?.connected??!1),v=(0,w.useRef)(o);(0,w.useEffect)(()=>(v.current=o,()=>{v.current=void 0}),[o]);let y=(0,w.useRef)((e,t)=>(r.current||(v.current?v.current(e,t):(console.error(e,t),e instanceof Yh&&typeof window<`u`&&t&&window.open(t.url,`_blank`))),e)),[b,x]=(0,w.useState)(()=>t.map(e=>({adapter:e,readyState:e.readyState})).filter(({readyState:e})=>e!==sg.Unsupported));(0,w.useEffect)(()=>{x(e=>t.map((t,n)=>{let r=e[n];return r&&r.adapter===t&&r.readyState===t.readyState?r:{adapter:t,readyState:t.readyState}}).filter(({readyState:e})=>e!==sg.Unsupported));function e(e){x(t=>{let n=t.findIndex(({adapter:e})=>e===this);if(n===-1)return t;let{adapter:r}=t[n];return[...t.slice(0,n),{adapter:r,readyState:e},...t.slice(n+1)].filter(({readyState:e})=>e!==sg.Unsupported)})}return t.forEach(t=>t.on(`readyStateChange`,e,t)),()=>{t.forEach(t=>t.off(`readyStateChange`,e,t))}},[n,t]);let S=(0,w.useMemo)(()=>b.find(e=>e.adapter===n)??null,[n,b]);(0,w.useEffect)(()=>{if(!n)return;let e=e=>{h(e),c.current=!1,u(!1),_(!0),d.current=!1,p(!1)},t=()=>{r.current||(h(null),c.current=!1,u(!1),_(!1),d.current=!1,p(!1))},i=e=>{y.current(e,n)};return n.on(`connect`,e),n.on(`disconnect`,t),n.on(`error`,i),()=>{n.off(`connect`,e),n.off(`disconnect`,t),n.off(`error`,i),t()}},[n,r]);let C=(0,w.useRef)(!1);(0,w.useEffect)(()=>()=>{C.current=!1},[n]),(0,w.useEffect)(()=>{C.current||c.current||g||!i||!(S?.readyState===sg.Installed||S?.readyState===sg.Loadable)||(c.current=!0,u(!0),C.current=!0,(async function(){try{await i()}catch{a()}finally{u(!1),c.current=!1}})())},[g,i,a,S]);let T=(0,w.useCallback)(async(e,t,r)=>{if(!n)throw y.current(new wg);if(!g)throw y.current(new ng,n);return await n.sendTransaction(e,t,r)},[n,g]),E=(0,w.useMemo)(()=>n&&`signTransaction`in n?async e=>{if(!g)throw y.current(new ng,n);return await n.signTransaction(e)}:void 0,[n,g]),D=(0,w.useMemo)(()=>n&&`signAllTransactions`in n?async e=>{if(!g)throw y.current(new ng,n);return await n.signAllTransactions(e)}:void 0,[n,g]),O=(0,w.useMemo)(()=>n&&`signMessage`in n?async e=>{if(!g)throw y.current(new ng,n);return await n.signMessage(e)}:void 0,[n,g]),k=(0,w.useMemo)(()=>n&&`signIn`in n?async e=>await n.signIn(e):void 0,[n]),ee=(0,w.useCallback)(async()=>{if(c.current||d.current||S?.adapter.connected)return;if(!S)throw y.current(new wg);let{adapter:e,readyState:t}=S;if(!(t===sg.Installed||t===sg.Loadable))throw y.current(new Yh,e);c.current=!0,u(!0);try{await e.connect()}catch(e){throw a(),e}finally{u(!1),c.current=!1}},[a,S]),te=(0,w.useCallback)(async()=>{if(!d.current&&n){d.current=!0,p(!0);try{await n.disconnect()}finally{p(!1),d.current=!1}}},[n]);return w.createElement(Og.Provider,{value:{autoConnect:!!i,wallets:b,wallet:S,publicKey:m,connected:g,connecting:l,disconnecting:f,select:s,connect:ee,disconnect:te,sendTransaction:T,signTransaction:E,signAllTransactions:D,signMessage:O,signIn:k}},e)}var Ob;function kb(){return Ob===void 0&&(Ob=globalThis.navigator?.userAgent??null),Ob}function Ab(e){return Tb({adapters:e,userAgentString:kb()})===Cb.MOBILE_WEB}function jb(){let e=globalThis.location;if(e)return`${e.protocol}//${e.host}`}function Mb({children:e,wallets:t,autoConnect:n,localStorageKey:r=`walletName`,onError:i}){let{connection:a}=Gh(),o=yb(t),s=(0,w.useMemo)(()=>Ab(o)?o.find(e=>e.name===Ry)||new Gy({addressSelector:Ky(),appIdentity:{uri:jb()},authorizationResultCache:qy(),cluster:Eb(a?.rpcEndpoint),onWalletNotFound:Yy()}):null,[o,a?.rpcEndpoint]),c=(0,w.useMemo)(()=>s==null||o.indexOf(s)!==-1?o:[s,...o],[o,s]),[l,u]=Ag(r,null),d=(0,w.useMemo)(()=>c.find(e=>e.name===l)??null,[c,l]),f=(0,w.useCallback)(e=>{l!==e&&(d&&d.name!==Ry&&d.disconnect(),u(e))},[d,u,l]);(0,w.useEffect)(()=>{if(!d)return;function e(){h.current||u(null)}return d.on(`disconnect`,e),()=>{d.off(`disconnect`,e)}},[d,o,u,l]);let p=(0,w.useRef)(!1),m=(0,w.useMemo)(()=>{if(!(!n||!d))return async()=>{(n===!0||await n(d))&&(p.current?await d.connect():await d.autoConnect())}},[n,d]),h=(0,w.useRef)(!1);(0,w.useEffect)(()=>{if(l===Ry&&Ab(o)){h.current=!1;return}function e(){h.current=!0}return window.addEventListener(`beforeunload`,e),()=>{window.removeEventListener(`beforeunload`,e)}},[o,l]);let g=(0,w.useCallback)(()=>{d&&f(null)},[d,f]),_=(0,w.useCallback)(e=>{p.current=!0,f(e)},[f]);return w.createElement(Db,{wallets:c,adapter:d,isUnloadingRef:h,onAutoConnectRequest:m,onConnectError:g,onError:i,onSelectWallet:_},e)}Uh();var Nb=`Phantom`,Pb=class extends pg{constructor(e={}){super(),this.name=Nb,this.url=`https://phantom.app`,this.icon=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiB2aWV3Qm94PSIwIDAgMTA4IDEwOCIgZmlsbD0ibm9uZSI+CjxyZWN0IHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiByeD0iMjYiIGZpbGw9IiNBQjlGRjIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00Ni41MjY3IDY5LjkyMjlDNDIuMDA1NCA3Ni44NTA5IDM0LjQyOTIgODUuNjE4MiAyNC4zNDggODUuNjE4MkMxOS41ODI0IDg1LjYxODIgMTUgODMuNjU2MyAxNSA3NS4xMzQyQzE1IDUzLjQzMDUgNDQuNjMyNiAxOS44MzI3IDcyLjEyNjggMTkuODMyN0M4Ny43NjggMTkuODMyNyA5NCAzMC42ODQ2IDk0IDQzLjAwNzlDOTQgNTguODI1OCA4My43MzU1IDc2LjkxMjIgNzMuNTMyMSA3Ni45MTIyQzcwLjI5MzkgNzYuOTEyMiA2OC43MDUzIDc1LjEzNDIgNjguNzA1MyA3Mi4zMTRDNjguNzA1MyA3MS41NzgzIDY4LjgyNzUgNzAuNzgxMiA2OS4wNzE5IDY5LjkyMjlDNjUuNTg5MyA3NS44Njk5IDU4Ljg2ODUgODEuMzg3OCA1Mi41NzU0IDgxLjM4NzhDNDcuOTkzIDgxLjM4NzggNDUuNjcxMyA3OC41MDYzIDQ1LjY3MTMgNzQuNDU5OEM0NS42NzEzIDcyLjk4ODQgNDUuOTc2OCA3MS40NTU2IDQ2LjUyNjcgNjkuOTIyOVpNODMuNjc2MSA0Mi41Nzk0QzgzLjY3NjEgNDYuMTcwNCA4MS41NTc1IDQ3Ljk2NTggNzkuMTg3NSA0Ny45NjU4Qzc2Ljc4MTYgNDcuOTY1OCA3NC42OTg5IDQ2LjE3MDQgNzQuNjk4OSA0Mi41Nzk0Qzc0LjY5ODkgMzguOTg4NSA3Ni43ODE2IDM3LjE5MzEgNzkuMTg3NSAzNy4xOTMxQzgxLjU1NzUgMzcuMTkzMSA4My42NzYxIDM4Ljk4ODUgODMuNjc2MSA0Mi41Nzk0Wk03MC4yMTAzIDQyLjU3OTVDNzAuMjEwMyA0Ni4xNzA0IDY4LjA5MTYgNDcuOTY1OCA2NS43MjE2IDQ3Ljk2NThDNjMuMzE1NyA0Ny45NjU4IDYxLjIzMyA0Ni4xNzA0IDYxLjIzMyA0Mi41Nzk1QzYxLjIzMyAzOC45ODg1IDYzLjMxNTcgMzcuMTkzMSA2NS43MjE2IDM3LjE5MzFDNjguMDkxNiAzNy4xOTMxIDcwLjIxMDMgMzguOTg4NSA3MC4yMTAzIDQyLjU3OTVaIiBmaWxsPSIjRkZGREY4Ii8+Cjwvc3ZnPg==`,this.supportedTransactionVersions=new Set([`legacy`,0]),this._readyState=typeof window>`u`||typeof document>`u`?sg.Unsupported:sg.NotDetected,this._disconnected=()=>{let e=this._wallet;e&&(e.off(`disconnect`,this._disconnected),e.off(`accountChanged`,this._accountChanged),this._wallet=null,this._publicKey=null,this.emit(`error`,new Qh),this.emit(`disconnect`))},this._accountChanged=e=>{let t=this._publicKey;if(t){try{e=new Z(e.toBytes())}catch(e){this.emit(`error`,new tg(e?.message,e));return}t.equals(e)||(this._publicKey=e,this.emit(`connect`,e))}},this._connecting=!1,this._wallet=null,this._publicKey=null,this._readyState!==sg.Unsupported&&(ug()?(this._readyState=sg.Loadable,this.emit(`readyStateChange`,this._readyState)):lg(()=>window?.isPhantomInstalled&&(window.phantom?.solana?.isPhantom||window.solana?.isPhantom)?(this._readyState=sg.Installed,this.emit(`readyStateChange`,this._readyState),!0):!1))}get publicKey(){return this._publicKey}get connecting(){return this._connecting}get readyState(){return this._readyState}async autoConnect(){this.readyState===sg.Installed&&await this.connect()}async connect(){try{if(this.connected||this.connecting)return;if(this.readyState===sg.Loadable){let e=encodeURIComponent(window.location.href),t=encodeURIComponent(window.location.origin);window.location.href=`https://phantom.app/ul/browse/${e}?ref=${t}`;return}if(this.readyState!==sg.Installed)throw new Yh;this._connecting=!0;let e=window.phantom?.solana||window.solana;if(!e.isConnected)try{await e.connect()}catch(e){throw new Zh(e?.message,e)}if(!e.publicKey)throw new eg;let t;try{t=new Z(e.publicKey.toBytes())}catch(e){throw new tg(e?.message,e)}e.on(`disconnect`,this._disconnected),e.on(`accountChanged`,this._accountChanged),this._wallet=e,this._publicKey=t,this.emit(`connect`,t)}catch(e){throw this.emit(`error`,e),e}finally{this._connecting=!1}}async disconnect(){let e=this._wallet;if(e){e.off(`disconnect`,this._disconnected),e.off(`accountChanged`,this._accountChanged),this._wallet=null,this._publicKey=null;try{await e.disconnect()}catch(e){this.emit(`error`,new $h(e?.message,e))}}this.emit(`disconnect`)}async sendTransaction(e,t,n={}){try{let r=this._wallet;if(!r)throw new ng;try{let{signers:i,...a}=n;dg(e)?i?.length&&e.sign(i):(e=await this.prepareTransaction(e,t,a),i?.length&&e.partialSign(...i)),a.preflightCommitment=a.preflightCommitment||t.commitment;let{signature:o}=await r.signAndSendTransaction(e,a);return o}catch(e){throw e instanceof Jh?e:new rg(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}}async signTransaction(e){try{let t=this._wallet;if(!t)throw new ng;try{return await t.signTransaction(e)||e}catch(e){throw new ig(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}}async signAllTransactions(e){try{let t=this._wallet;if(!t)throw new ng;try{return await t.signAllTransactions(e)||e}catch(e){throw new ig(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}}async signMessage(e){try{let t=this._wallet;if(!t)throw new ng;try{let{signature:n}=await t.signMessage(e);return n}catch(e){throw new ag(e?.message,e)}}catch(e){throw this.emit(`error`,e),e}}},Fb={setVisible(e){console.error(Ib(`call`,`setVisible`))},visible:!1};Object.defineProperty(Fb,`visible`,{get(){return console.error(Ib(`read`,`visible`)),!1}});function Ib(e,t){return`You have tried to ${e} "${t}" on a WalletModalContext without providing one. Make sure to render a WalletModalProvider as an ancestor of the component that uses WalletModalContext`}var Lb=(0,w.createContext)(Fb);function Rb(){return(0,w.useContext)(Lb)}function zb({onSelectWallet:e}){let{connect:t,connected:n,connecting:r,disconnect:i,disconnecting:a,publicKey:o,select:s,wallet:c,wallets:l}=kg(),u;u=r?`connecting`:n?`connected`:a?`disconnecting`:c?`has-wallet`:`no-wallet`;let d=(0,w.useCallback)(()=>{t().catch(()=>{})},[t]),f=(0,w.useCallback)(()=>{i().catch(()=>{})},[i]),p=(0,w.useCallback)(()=>{e({onSelectWallet:s,wallets:l})},[e,s,l]);return{buttonState:u,onConnect:u===`has-wallet`?d:void 0,onDisconnect:u!==`disconnecting`&&u!==`no-wallet`?f:void 0,onSelectWallet:p,publicKey:o??void 0,walletIcon:c?.adapter.icon,walletName:c?.adapter.name}}var Bb=e=>w.createElement(`button`,{className:`wallet-adapter-button ${e.className||``}`,disabled:e.disabled,style:e.style,onClick:e.onClick,tabIndex:e.tabIndex||0,type:`button`},e.startIcon&&w.createElement(`i`,{className:`wallet-adapter-button-start-icon`},e.startIcon),e.children,e.endIcon&&w.createElement(`i`,{className:`wallet-adapter-button-end-icon`},e.endIcon)),Vb=({wallet:e,...t})=>e&&w.createElement(`img`,{src:e.adapter.icon,alt:`${e.adapter.name} icon`,...t});function Hb({walletIcon:e,walletName:t,...n}){return w.createElement(Bb,{...n,className:`wallet-adapter-button-trigger`,startIcon:e&&t?w.createElement(Vb,{wallet:{adapter:{icon:e,name:t}}}):void 0})}function Ub({children:e,labels:t,...n}){let{setVisible:r}=Rb(),{buttonState:i,onConnect:a,onDisconnect:o,publicKey:s,walletIcon:c,walletName:l}=zb({onSelectWallet(){r(!0)}}),[u,d]=(0,w.useState)(!1),[f,p]=(0,w.useState)(!1),m=(0,w.useRef)(null);(0,w.useEffect)(()=>{let e=e=>{let t=m.current;!t||t.contains(e.target)||p(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[]);let h=(0,w.useMemo)(()=>{if(e)return e;if(s){let e=s.toBase58();return e.slice(0,4)+`..`+e.slice(-4)}else if(i===`connecting`||i===`has-wallet`)return t[i];else return t[`no-wallet`]},[i,e,t,s]);return w.createElement(`div`,{className:`wallet-adapter-dropdown`},w.createElement(Hb,{...n,"aria-expanded":f,style:{pointerEvents:f?`none`:`auto`,...n.style},onClick:()=>{switch(i){case`no-wallet`:r(!0);break;case`has-wallet`:a&&a();break;case`connected`:p(!0);break}},walletIcon:c,walletName:l},h),w.createElement(`ul`,{"aria-label":`dropdown-list`,className:`wallet-adapter-dropdown-list ${f&&`wallet-adapter-dropdown-list-active`}`,ref:m,role:`menu`},s?w.createElement(`li`,{className:`wallet-adapter-dropdown-list-item`,onClick:async()=>{await navigator.clipboard.writeText(s.toBase58()),d(!0),setTimeout(()=>d(!1),400)},role:`menuitem`},u?t.copied:t[`copy-address`]):null,w.createElement(`li`,{className:`wallet-adapter-dropdown-list-item`,onClick:()=>{r(!0),p(!1)},role:`menuitem`},t[`change-wallet`]),o?w.createElement(`li`,{className:`wallet-adapter-dropdown-list-item`,onClick:()=>{o(),p(!1)},role:`menuitem`},t.disconnect):null))}var Wb=({id:e,children:t,expanded:n=!1})=>{let r=(0,w.useRef)(null),i=(0,w.useRef)(!0),a=()=>{let e=r.current;e&&requestAnimationFrame(()=>{e.style.height=e.scrollHeight+`px`})},o=()=>{let e=r.current;e&&requestAnimationFrame(()=>{e.style.height=e.offsetHeight+`px`,e.style.overflow=`hidden`,requestAnimationFrame(()=>{e.style.height=`0`})})};return(0,w.useLayoutEffect)(()=>{n?a():o()},[n]),(0,w.useLayoutEffect)(()=>{let e=r.current;if(!e)return;function t(){e&&(e.style.overflow=n?`initial`:`hidden`,n&&(e.style.height=`auto`))}function a(n){e&&n.target===e&&n.propertyName===`height`&&t()}return i.current&&=(t(),!1),e.addEventListener(`transitionend`,a),()=>e.removeEventListener(`transitionend`,a)},[n]),w.createElement(`div`,{className:`wallet-adapter-collapse`,id:e,ref:r,role:`region`,style:{height:0,transition:i.current?void 0:`height 250ms ease-out`}},t)},Gb=({handleClick:e,tabIndex:t,wallet:n})=>w.createElement(`li`,null,w.createElement(Bb,{onClick:e,startIcon:w.createElement(Vb,{wallet:n}),tabIndex:t},n.adapter.name,n.readyState===sg.Installed&&w.createElement(`span`,null,`Detected`))),Kb=()=>w.createElement(`svg`,{width:`97`,height:`96`,viewBox:`0 0 97 96`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},w.createElement(`circle`,{cx:`48.5`,cy:`48`,r:`48`,fill:`url(#paint0_linear_880_5115)`,fillOpacity:`0.1`}),w.createElement(`circle`,{cx:`48.5`,cy:`48`,r:`47`,stroke:`url(#paint1_linear_880_5115)`,strokeOpacity:`0.4`,strokeWidth:`2`}),w.createElement(`g`,{clipPath:`url(#clip0_880_5115)`},w.createElement(`path`,{d:`M65.5769 28.1523H31.4231C27.6057 28.1523 24.5 31.258 24.5 35.0754V60.9215C24.5 64.7389 27.6057 67.8446 31.4231 67.8446H65.5769C69.3943 67.8446 72.5 64.7389 72.5 60.9215V35.0754C72.5 31.258 69.3943 28.1523 65.5769 28.1523ZM69.7308 52.1523H59.5769C57.2865 52.1523 55.4231 50.289 55.4231 47.9985C55.4231 45.708 57.2864 43.8446 59.5769 43.8446H69.7308V52.1523ZM69.7308 41.0754H59.5769C55.7595 41.0754 52.6539 44.1811 52.6539 47.9985C52.6539 51.8159 55.7595 54.9215 59.5769 54.9215H69.7308V60.9215C69.7308 63.2119 67.8674 65.0754 65.5769 65.0754H31.4231C29.1327 65.0754 27.2692 63.212 27.2692 60.9215V35.0754C27.2692 32.785 29.1326 30.9215 31.4231 30.9215H65.5769C67.8673 30.9215 69.7308 32.7849 69.7308 35.0754V41.0754Z`,fill:`url(#paint2_linear_880_5115)`}),w.createElement(`path`,{d:`M61.4231 46.6172H59.577C58.8123 46.6172 58.1924 47.2371 58.1924 48.0018C58.1924 48.7665 58.8123 49.3863 59.577 49.3863H61.4231C62.1878 49.3863 62.8077 48.7664 62.8077 48.0018C62.8077 47.2371 62.1878 46.6172 61.4231 46.6172Z`,fill:`url(#paint3_linear_880_5115)`})),w.createElement(`defs`,null,w.createElement(`linearGradient`,{id:`paint0_linear_880_5115`,x1:`3.41664`,y1:`98.0933`,x2:`103.05`,y2:`8.42498`,gradientUnits:`userSpaceOnUse`},w.createElement(`stop`,{stopColor:`#9945FF`}),w.createElement(`stop`,{offset:`0.14`,stopColor:`#8A53F4`}),w.createElement(`stop`,{offset:`0.42`,stopColor:`#6377D6`}),w.createElement(`stop`,{offset:`0.79`,stopColor:`#24B0A7`}),w.createElement(`stop`,{offset:`0.99`,stopColor:`#00D18C`}),w.createElement(`stop`,{offset:`1`,stopColor:`#00D18C`})),w.createElement(`linearGradient`,{id:`paint1_linear_880_5115`,x1:`3.41664`,y1:`98.0933`,x2:`103.05`,y2:`8.42498`,gradientUnits:`userSpaceOnUse`},w.createElement(`stop`,{stopColor:`#9945FF`}),w.createElement(`stop`,{offset:`0.14`,stopColor:`#8A53F4`}),w.createElement(`stop`,{offset:`0.42`,stopColor:`#6377D6`}),w.createElement(`stop`,{offset:`0.79`,stopColor:`#24B0A7`}),w.createElement(`stop`,{offset:`0.99`,stopColor:`#00D18C`}),w.createElement(`stop`,{offset:`1`,stopColor:`#00D18C`})),w.createElement(`linearGradient`,{id:`paint2_linear_880_5115`,x1:`25.9583`,y1:`68.7101`,x2:`67.2337`,y2:`23.7879`,gradientUnits:`userSpaceOnUse`},w.createElement(`stop`,{stopColor:`#9945FF`}),w.createElement(`stop`,{offset:`0.14`,stopColor:`#8A53F4`}),w.createElement(`stop`,{offset:`0.42`,stopColor:`#6377D6`}),w.createElement(`stop`,{offset:`0.79`,stopColor:`#24B0A7`}),w.createElement(`stop`,{offset:`0.99`,stopColor:`#00D18C`}),w.createElement(`stop`,{offset:`1`,stopColor:`#00D18C`})),w.createElement(`linearGradient`,{id:`paint3_linear_880_5115`,x1:`58.3326`,y1:`49.4467`,x2:`61.0002`,y2:`45.4453`,gradientUnits:`userSpaceOnUse`},w.createElement(`stop`,{stopColor:`#9945FF`}),w.createElement(`stop`,{offset:`0.14`,stopColor:`#8A53F4`}),w.createElement(`stop`,{offset:`0.42`,stopColor:`#6377D6`}),w.createElement(`stop`,{offset:`0.79`,stopColor:`#24B0A7`}),w.createElement(`stop`,{offset:`0.99`,stopColor:`#00D18C`}),w.createElement(`stop`,{offset:`1`,stopColor:`#00D18C`})),w.createElement(`clipPath`,{id:`clip0_880_5115`},w.createElement(`rect`,{width:`48`,height:`48`,fill:`white`,transform:`translate(24.5 24)`})))),qb=({className:e=``,container:t=`body`})=>{let n=(0,w.useRef)(null),{wallets:r,select:i}=kg(),{setVisible:a}=Rb(),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)(!1),[u,d]=(0,w.useState)(null),[f,p]=(0,w.useMemo)(()=>{let e=[],t=[];for(let n of r)n.readyState===sg.Installed?e.push(n):t.push(n);return e.length?[e,t]:[t,[]]},[r]),m=(0,w.useCallback)(()=>{l(!1),setTimeout(()=>a(!1),150)},[a]),h=(0,w.useCallback)(e=>{e.preventDefault(),m()},[m]),g=(0,w.useCallback)((e,t)=>{i(t),h(e)},[i,h]),_=(0,w.useCallback)(()=>s(!o),[o]),v=(0,w.useCallback)(e=>{let t=n.current;if(!t)return;let r=t.querySelectorAll(`button`),i=r[0],a=r[r.length-1];e.shiftKey?document.activeElement===i&&(a.focus(),e.preventDefault()):document.activeElement===a&&(i.focus(),e.preventDefault())},[n]);return(0,w.useLayoutEffect)(()=>{let e=e=>{e.key===`Escape`?m():e.key===`Tab`&&v(e)},{overflow:t}=window.getComputedStyle(document.body);return setTimeout(()=>l(!0),0),document.body.style.overflow=`hidden`,window.addEventListener(`keydown`,e,!1),()=>{document.body.style.overflow=t,window.removeEventListener(`keydown`,e,!1)}},[m,v]),(0,w.useLayoutEffect)(()=>d(document.querySelector(t)),[t]),u&&(0,T.createPortal)(w.createElement(`div`,{"aria-labelledby":`wallet-adapter-modal-title`,"aria-modal":`true`,className:`wallet-adapter-modal ${c&&`wallet-adapter-modal-fade-in`} ${e}`,ref:n,role:`dialog`},w.createElement(`div`,{className:`wallet-adapter-modal-container`},w.createElement(`div`,{className:`wallet-adapter-modal-wrapper`},w.createElement(`button`,{onClick:h,className:`wallet-adapter-modal-button-close`},w.createElement(`svg`,{width:`14`,height:`14`},w.createElement(`path`,{d:`M14 12.461 8.3 6.772l5.234-5.233L12.006 0 6.772 5.234 1.54 0 0 1.539l5.234 5.233L0 12.006l1.539 1.528L6.772 8.3l5.69 5.7L14 12.461z`}))),f.length?w.createElement(w.Fragment,null,w.createElement(`h1`,{className:`wallet-adapter-modal-title`},`Connect a wallet on Solana to continue`),w.createElement(`ul`,{className:`wallet-adapter-modal-list`},f.map(e=>w.createElement(Gb,{key:e.adapter.name,handleClick:t=>g(t,e.adapter.name),wallet:e})),p.length?w.createElement(Wb,{expanded:o,id:`wallet-adapter-modal-collapse`},p.map(e=>w.createElement(Gb,{key:e.adapter.name,handleClick:t=>g(t,e.adapter.name),tabIndex:o?0:-1,wallet:e}))):null),p.length?w.createElement(`button`,{className:`wallet-adapter-modal-list-more`,onClick:_,tabIndex:0},w.createElement(`span`,null,o?`Less `:`More `,`options`),w.createElement(`svg`,{width:`13`,height:`7`,viewBox:`0 0 13 7`,xmlns:`http://www.w3.org/2000/svg`,className:`${o?`wallet-adapter-modal-list-more-icon-rotate`:``}`},w.createElement(`path`,{d:`M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z`}))):null):w.createElement(w.Fragment,null,w.createElement(`h1`,{className:`wallet-adapter-modal-title`},`You'll need a wallet on Solana to continue`),w.createElement(`div`,{className:`wallet-adapter-modal-middle`},w.createElement(Kb,null)),p.length?w.createElement(w.Fragment,null,w.createElement(`button`,{className:`wallet-adapter-modal-list-more`,onClick:_,tabIndex:0},w.createElement(`span`,null,o?`Hide `:`Already have a wallet? View `,`options`),w.createElement(`svg`,{width:`13`,height:`7`,viewBox:`0 0 13 7`,xmlns:`http://www.w3.org/2000/svg`,className:`${o?`wallet-adapter-modal-list-more-icon-rotate`:``}`},w.createElement(`path`,{d:`M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z`}))),w.createElement(Wb,{expanded:o,id:`wallet-adapter-modal-collapse`},w.createElement(`ul`,{className:`wallet-adapter-modal-list`},p.map(e=>w.createElement(Gb,{key:e.adapter.name,handleClick:t=>g(t,e.adapter.name),tabIndex:o?0:-1,wallet:e}))))):null))),w.createElement(`div`,{className:`wallet-adapter-modal-overlay`,onMouseDown:h})),u)},Jb=({children:e,...t})=>{let[n,r]=(0,w.useState)(!1);return w.createElement(Lb.Provider,{value:{visible:n,setVisible:r}},e,n&&w.createElement(qb,{...t}))},Yb={"change-wallet":`Change wallet`,connecting:`Connecting ...`,"copy-address":`Copy address`,copied:`Copied`,disconnect:`Disconnect`,"has-wallet":`Connect`,"no-wallet":`Select Wallet`};function Xb(e){return w.createElement(Ub,{...e,labels:Yb})}var Zb=()=>{let e=Ie();return(0,w.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,F.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-muted`,children:(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(`h1`,{className:`mb-4 text-4xl font-bold`,children:`404`}),(0,F.jsx)(`p`,{className:`mb-4 text-xl text-muted-foreground`,children:`Oops! Page not found`}),(0,F.jsx)(`a`,{href:`/`,className:`text-primary underline hover:text-primary/90`,children:`Return to Home`})]})})},Qb=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:di(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));Qb.displayName=`Card`;var $b=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:di(`flex flex-col space-y-1.5 p-6`,e),...t}));$b.displayName=`CardHeader`;var ex=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:di(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));ex.displayName=`CardTitle`;var tx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:di(`text-sm text-muted-foreground`,e),...t}));tx.displayName=`CardDescription`;var nx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:di(`p-6 pt-0`,e),...t}));nx.displayName=`CardContent`;var rx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{ref:n,className:di(`flex items-center p-6 pt-0`,e),...t}));rx.displayName=`CardFooter`;var ix=ur(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),ax=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,F.jsx)(r?Et:`button`,{className:di(ix({variant:t,size:n,className:e})),ref:a,...i}));ax.displayName=`Button`;var ox=w.forwardRef(({className:e,type:t,...n},r)=>(0,F.jsx)(`input`,{type:t,className:di(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`,e),ref:r,...n}));ox.displayName=`Input`;var sx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`textarea`,{className:di(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));sx.displayName=`Textarea`;var cx=ur(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground hover:bg-primary/80`,secondary:`border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function lx({className:e,variant:t,...n}){return(0,F.jsx)(`div`,{className:di(cx({variant:t}),e),...n})}var ux=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,F.jsx)(`table`,{ref:n,className:di(`w-full caption-bottom text-sm`,e),...t})}));ux.displayName=`Table`;var dx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`thead`,{ref:n,className:di(`[&_tr]:border-b`,e),...t}));dx.displayName=`TableHeader`;var fx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`tbody`,{ref:n,className:di(`[&_tr:last-child]:border-0`,e),...t}));fx.displayName=`TableBody`;var px=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`tfoot`,{ref:n,className:di(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));px.displayName=`TableFooter`;var mx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`tr`,{ref:n,className:di(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...t}));mx.displayName=`TableRow`;var hx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`th`,{ref:n,className:di(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));hx.displayName=`TableHead`;var gx=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`td`,{ref:n,className:di(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));gx.displayName=`TableCell`;var _x=w.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`caption`,{ref:n,className:di(`mt-4 text-sm text-muted-foreground`,e),...t}));_x.displayName=`TableCaption`;var vx=`/api`;function yx(){let[e,t]=(0,w.useState)([]),[n,r]=(0,w.useState)(!0),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(``),[c,l]=(0,w.useState)(``),[u,d]=(0,w.useState)(null),[f,p]=(0,w.useState)(``),[m,h]=(0,w.useState)(``),g=(0,w.useCallback)(async()=>{try{r(!0),a(null);let e=await fetch(`${vx}/todos`);if(!e.ok)throw Error(`HTTP ${e.status}`);t((await e.json()).todos??[])}catch(e){a(e instanceof Error?e.message:`Failed to fetch todos`)}finally{r(!1)}},[]);(0,w.useEffect)(()=>{g()},[g]);let _=async()=>{if(o.trim())try{let e=await fetch(`${vx}/todos`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:o.trim(),description:c.trim()||null})});if(!e.ok)throw Error(`HTTP ${e.status}`);s(``),l(``),await g()}catch(e){a(e instanceof Error?e.message:`Failed to create todo`)}},v=async e=>{try{let t=await fetch(`${vx}/todos/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:f,description:m||null})});if(!t.ok)throw Error(`HTTP ${t.status}`);d(null),await g()}catch(e){a(e instanceof Error?e.message:`Failed to update todo`)}},y=async e=>{try{await fetch(`${vx}/todos/${e.id}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({completed:!e.completed})}),await g()}catch(e){a(e instanceof Error?e.message:`Failed to toggle todo`)}},b=async e=>{try{let t=await fetch(`${vx}/todos/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`HTTP ${t.status}`);await g()}catch(e){a(e instanceof Error?e.message:`Failed to delete todo`)}};return(0,F.jsxs)(Qb,{children:[(0,F.jsx)($b,{children:(0,F.jsxs)(ex,{className:`flex items-center gap-2`,children:[`Todo API Testing`,(0,F.jsx)(ax,{variant:`outline`,size:`sm`,onClick:g,disabled:n,children:n?`Loading...`:`Refresh`})]})}),(0,F.jsxs)(nx,{className:`space-y-4`,children:[i&&(0,F.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:i}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(ox,{placeholder:`Todo title`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&_()}),(0,F.jsx)(sx,{placeholder:`Description (optional)`,value:c,onChange:e=>l(e.target.value),className:`max-w-xs`}),(0,F.jsx)(ax,{onClick:_,disabled:!o.trim(),children:`Create`})]}),(0,F.jsxs)(ux,{children:[(0,F.jsx)(dx,{children:(0,F.jsxs)(mx,{children:[(0,F.jsx)(hx,{className:`w-16`,children:`ID`}),(0,F.jsx)(hx,{children:`Title`}),(0,F.jsx)(hx,{className:`hidden md:table-cell`,children:`Description`}),(0,F.jsx)(hx,{className:`w-24`,children:`Status`}),(0,F.jsx)(hx,{className:`w-40`,children:`Actions`})]})}),(0,F.jsxs)(fx,{children:[e.length===0&&!n&&(0,F.jsx)(mx,{children:(0,F.jsx)(gx,{colSpan:5,className:`text-center text-muted-foreground py-8`,children:`No todos yet. Create one above.`})}),e.map(e=>(0,F.jsxs)(mx,{children:[(0,F.jsx)(gx,{className:`font-mono text-xs`,children:e.id}),(0,F.jsx)(gx,{children:u===e.id?(0,F.jsx)(ox,{value:f,onChange:e=>p(e.target.value),className:`h-8`}):(0,F.jsx)(`span`,{className:e.completed?`line-through text-muted-foreground`:``,children:e.title})}),(0,F.jsx)(gx,{className:`hidden md:table-cell`,children:u===e.id?(0,F.jsx)(sx,{value:m,onChange:e=>h(e.target.value),className:`h-8 min-h-0`}):(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description||``})}),(0,F.jsx)(gx,{children:(0,F.jsx)(lx,{variant:e.completed?`default`:`secondary`,children:e.completed?`Done`:`Open`})}),(0,F.jsx)(gx,{children:(0,F.jsx)(`div`,{className:`flex gap-1`,children:u===e.id?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ax,{size:`sm`,variant:`default`,onClick:()=>v(e.id),children:`Save`}),(0,F.jsx)(ax,{size:`sm`,variant:`ghost`,onClick:()=>d(null),children:`Cancel`})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ax,{size:`sm`,variant:`outline`,onClick:()=>{d(e.id),p(e.title),h(e.description??``)},children:`Edit`}),(0,F.jsx)(ax,{size:`sm`,variant:`outline`,onClick:()=>y(e),children:e.completed?`Reopen`:`Done`}),(0,F.jsx)(ax,{size:`sm`,variant:`destructive`,onClick:()=>b(e.id),children:`Del`})]})})})]},e.id))]})]})]})]})}function bx(){let[e,t]=(0,w.useState)(null),[n,r]=(0,w.useState)(!0);return(0,w.useEffect)(()=>{fetch(`${vx}/health`).then(e=>e.json()).then(e=>t(e)).catch(()=>t(null)).finally(()=>r(!1))},[]),(0,F.jsxs)(Qb,{children:[(0,F.jsx)($b,{children:(0,F.jsx)(ex,{children:`Health Check`})}),(0,F.jsx)(nx,{children:n?(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Checking...`}):e?(0,F.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:`Status:`}),(0,F.jsx)(lx,{variant:e.status===`ok`?`default`:`destructive`,children:e.status})]}),(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{className:`font-medium`,children:`Project ID:`}),` `,e.projectId]}),(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{className:`font-medium`,children:`Database:`}),` `,(0,F.jsx)(lx,{variant:e.config.databaseConfigured?`default`:`destructive`,children:e.config.databaseConfigured?`Configured`:`Missing`})]}),(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{className:`font-medium`,children:`Storage:`}),` `,(0,F.jsx)(lx,{variant:e.config.storageConfigured?`default`:`destructive`,children:e.config.storageConfigured?`Configured`:`Missing`})]}),e.config.missingEnv.length>0&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`font-medium`,children:`Missing Env Vars:`}),(0,F.jsx)(`ul`,{className:`list-disc list-inside text-destructive text-xs mt-1`,children:e.config.missingEnv.map(e=>(0,F.jsx)(`li`,{children:e},e))})]})]}):(0,F.jsx)(`p`,{className:`text-sm text-destructive`,children:`Failed to reach health endpoint`})})]})}function xx(){return(0,F.jsxs)(Qb,{children:[(0,F.jsx)($b,{children:(0,F.jsx)(ex,{children:`API Endpoints`})}),(0,F.jsx)(nx,{children:(0,F.jsx)(`div`,{className:`space-y-1`,children:[{method:`GET`,path:`/api/health`,desc:`Backend health check`},{method:`GET`,path:`/api/todos`,desc:`List all todos`},{method:`POST`,path:`/api/todos`,desc:`Create a todo`},{method:`GET`,path:`/api/todos/:id`,desc:`Get a single todo`},{method:`PUT`,path:`/api/todos/:id`,desc:`Update a todo`},{method:`DELETE`,path:`/api/todos/:id`,desc:`Delete a todo`},{method:`POST`,path:`/api/todos/:id/attachment/presign`,desc:`Presign attachment upload`},{method:`POST`,path:`/api/todos/:id/attachment/complete`,desc:`Complete attachment upload`}].map(e=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-mono`,children:[(0,F.jsx)(lx,{variant:`outline`,className:`w-16 justify-center font-mono text-xs`,children:e.method}),(0,F.jsx)(`span`,{className:`text-foreground`,children:e.path}),(0,F.jsxs)(`span`,{className:`text-muted-foreground text-xs hidden sm:inline`,children:[``,e.desc]})]},e.path))})})]})}var Sx=()=>(0,F.jsxs)(`div`,{className:`min-h-screen bg-background`,children:[(0,F.jsx)(`header`,{className:`flex justify-end p-4 border-b`,children:(0,F.jsx)(Xb,{style:{backgroundColor:`#18181b`,color:`#ffffff`,borderRadius:`8px`,fontSize:`14px`,fontWeight:`400`,height:`38px`,padding:`0 16px`}})}),(0,F.jsxs)(`main`,{className:`max-w-5xl mx-auto p-4 space-y-6`,children:[(0,F.jsxs)(`div`,{className:`text-center py-4`,children:[(0,F.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Backend API Test Dashboard`}),(0,F.jsx)(`p`,{className:`text-muted-foreground text-sm mt-1`,children:`Test and verify your backend API endpoints`})]}),(0,F.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,F.jsx)(bx,{}),(0,F.jsx)(xx,{})]}),(0,F.jsx)(yx,{})]})]});Uh();var Cx=()=>{let e=Cg.Devnet;return(0,F.jsx)(Kh,{endpoint:(0,w.useMemo)(()=>Df(e),[e]),children:(0,F.jsx)(Mb,{wallets:(0,w.useMemo)(()=>[new Pb],[]),autoConnect:!0,children:(0,F.jsxs)(Jb,{children:[(0,F.jsxs)($e,{children:[(0,F.jsx)(Ze,{path:`/`,element:(0,F.jsx)(Sx,{})}),(0,F.jsx)(Ze,{path:`*`,element:(0,F.jsx)(Zb,{})})]}),(0,F.jsx)(bi,{})]})})})},wx=document.getElementById(`root`);if(!wx)throw Error(`Failed to find the root element`);(0,E.createRoot)(wx).render((0,F.jsx)(it,{children:(0,F.jsx)(Cx,{})}));