@mysten-incubation/sui-agent-pass 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deployments/mainnet.json +1 -0
- package/deployments/testnet.json +1 -0
- package/dist/activation.js +14 -5
- package/dist/agent.js +74 -6
- package/dist/domain.js +115 -5
- package/dist/explorer.js +68 -26
- package/dist/mcp.js +4 -4
- package/dist/plugin.js +20 -8
- package/dist/server.js +4 -7
- package/docs/PLAYBOOK.md +19 -4
- package/package.json +1 -1
- package/skills/agent-pass/SKILL.md +19 -4
- package/web-dist/agent-setup.md +69 -0
- package/web-dist/assets/index-CiuC-y47.js +846 -0
- package/web-dist/assets/index-Coq1FGKP.css +1 -0
- package/web-dist/assets/{mount-Cf1pxccE.js → mount-CvSnQ6dg.js} +1 -1
- package/web-dist/deployments/mainnet.json +1 -0
- package/web-dist/deployments/testnet.json +1 -0
- package/web-dist/index.html +2 -2
- package/web-dist/assets/index-BP_XyvSE.js +0 -846
- package/web-dist/assets/index-Dtb3YCq1.css +0 -1
|
@@ -1,846 +0,0 @@
|
|
|
1
|
-
var wE=e=>{throw TypeError(e)};var C0=(e,t,s)=>t.has(e)||wE("Cannot "+s);var Gt=(e,t,s)=>(C0(e,t,"read from private field"),s?s.call(e):t.get(e)),Gn=(e,t,s)=>t.has(e)?wE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Fn=(e,t,s,r)=>(C0(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),rn=(e,t,s)=>(C0(e,t,"access private method"),s);function qC(e,t){for(var s=0;s<t.length;s++){const r=t[s];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const c=Object.getOwnPropertyDescriptor(r,i);c&&Object.defineProperty(e,i,c.get?c:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function s(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(i){if(i.ep)return;i.ep=!0;const c=s(i);fetch(i.href,c)}})();var Sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ZC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I0={exports:{}},lu={};var TE;function YC(){if(TE)return lu;TE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,i,c){var u=null;if(c!==void 0&&(u=""+c),i.key!==void 0&&(u=""+i.key),"key"in i){c={};for(var f in i)f!=="key"&&(c[f]=i[f])}else c=i;return i=c.ref,{$$typeof:e,type:r,key:u,ref:i!==void 0?i:null,props:c}}return lu.Fragment=t,lu.jsx=s,lu.jsxs=s,lu}var EE;function WC(){return EE||(EE=1,I0.exports=YC()),I0.exports}var T=WC();const T4=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,E4=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,XC=235;function JC(e){return e.length>XC?!1:e.includes("@")?T4.test(e):E4.test(e)}function KC(e,t="at"){const s=e.toLowerCase();let r;if(s.includes("@")){if(!T4.test(s))throw new Error(`Invalid SuiNS name ${e}`);const[i,c]=s.split("@");r=[...i?i.split("."):[],c]}else{if(!E4.test(s))throw new Error(`Invalid SuiNS name ${e}`);r=s.split(".").slice(0,-1)}return t==="dot"?`${r.join(".")}.sui`:`${r.slice(0,-1).join(".")}@${r[r.length-1]}`}const QC=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,e6=/^\d+$/,t6=64,S4="/",Ju=e=>{const t=e.split(S4);if(t.length<2||t.length>3)return!1;const[s,r,i]=t;return i!==void 0&&!e6.test(i)||!JC(s)?!1:QC.test(r)&&r.length<t6};function xh(e){let t=BigInt(e);const s=[];let r=0;if(t===0n)return[0];for(;t>0;)s[r]=Number(t&127n),t>>=7n,t>0n&&(s[r]|=128),r+=1;return s}function n6(e){let t=0n,s=0n,r=0;for(;;){if(r>=e.length)throw new Error("ULEB decode error: buffer overflow");const i=e[r];if(r+=1,t+=BigInt(i&127)<<s,(i&128)===0){if(i===0&&r>1)throw new Error("ULEB decode error: non-canonical encoding");break}s+=7n}if(t>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("ULEB decode error: value exceeds MAX_SAFE_INTEGER");return{value:Number(t),length:r}}var s6=class{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength)}shift(e){return this.bytePosition+=e,this}read8(){const e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){const e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){const e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){const e=this.read32(),t=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+t).toString(10)}read128(){const e=BigInt(this.read64()),t=BigInt(this.read64()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+t).toString(10)}read256(){const e=BigInt(this.read128()),t=BigInt(this.read128()).toString(16)+e.toString(16).padStart(32,"0");return BigInt("0x"+t).toString(10)}readBytes(e){const t=this.bytePosition+this.dataView.byteOffset,s=new Uint8Array(this.dataView.buffer,t,e);return this.shift(e),s}readULEB(){const e=this.bytePosition+this.dataView.byteOffset,{value:t,length:s}=n6(new Uint8Array(this.dataView.buffer,e));return this.shift(s),t}readVec(e){const t=this.readULEB(),s=[];for(let r=0;r<t;r++)s.push(e(this,r,t));return s}};const _4=e=>Object.freeze(e());function k4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ju(e){if(!k4(e))throw new TypeError("Uint8Array expected")}function r6(e,t){return Array.isArray(t)?t.length===0?!0:t.every(s=>Number.isSafeInteger(s)):!1}function a6(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Ch(e,t){if(typeof t!="string")throw new TypeError(`${e}: string expected`);return!0}function Ny(e,t="number"){if(typeof e!="number")throw new TypeError(`${t}: expected number, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`${t}: expected safe integer, got ${e}`)}function SE(e,t){if(!r6(!1,t))throw new TypeError(`${e}: array of numbers expected`)}const i6=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function _E(e,t=e.length){const s=new Array(t);for(let r=0;r<t;r++)s[r]=e[r];return s}const kE=(()=>{try{const e=new TextDecoder;return e.decode(Uint8Array.of(65,48,43,127))==="A0+"?e:void 0}catch{return}})(),R0=8192;function o6(e){const t=e.length;if(kE!==void 0&&t>=12)return kE.decode(e);if(t<=R0)return String.fromCharCode.apply(null,e);let s="";for(let r=0;r<t;r+=R0)s+=String.fromCharCode.apply(null,e.subarray(r,r+R0));return s}function c6(e){if(Ny(e),e<=0||e>8)throw new RangeError("radix2: bits should be in (0..8]");const t=i6[e]-1;return{encode:s=>{ju(s);const r=s.length,i=new Uint8Array(Math.ceil(r*8/e));let c=0,u=0,f=0;for(let p=0;p<r;)for(p+2<r?(c=c<<24|s[p]<<16|s[p+1]<<8|s[p+2],u+=24,p+=3):(c=(c<<8|s[p])&65535,u+=8,p++);u-=e,i[f++]=c>>u&t,!(u<e););return u>0&&(i[f]=c<<e-u&t),i},decode:s=>{const r=s.length,i=new Uint8Array(Math.floor(r*e/8));let c=0,u=0,f=0;for(let p=0;p<r;p++)for(c=(c<<e|s[p])&65535,u+=e;u>=8;u-=8)i[f++]=c>>u-8&255;if(c=c<<8-u&255,u>=e)throw new Error("Excess padding");if(c>0)throw new Error(`Non-zero padding: ${c}`);return i}}}function A4(e,t){const s=e.length;if(s>128)throw new Error("alphabet: max 128 letters");const r=new Uint8Array(s),i=new Int8Array(128).fill(-1);for(let c=0;c<s;c++){const u=e.charCodeAt(c);if(e.codePointAt(c)!==u||u>127)throw new Error("alphabet: single-char ASCII letters only");r[c]=u,i[u]=c}if(t!==void 0)for(const c of Object.keys(t)){const u=c.charCodeAt(0),f=i[t[c].charCodeAt(0)];if(c.length!==1||u>127||f===void 0||f===-1)throw new Error(`alphabet: invalid alias ${c}`);i[u]=f}return{encode:c=>{const u=new Uint8Array(c.length);for(let f=0;f<c.length;f++){const p=c[f],m=r[p];if(m===void 0)throw new Error(`alphabet.encode: invalid digit ${p}`);u[f]=m}return o6(u)},decode:c=>{Ch("decode",c);const u=c.length,f=new Uint8Array(u);for(let p=0;p<u;p++){const m=c.charCodeAt(p),g=m<128?i[m]:-1;if(g===-1)throw new Error(`Unknown letter "${c[p]}". Allowed: ${e}`);f[p]=g}return f}}}function AE(e){return a6(e),function(...t){try{return e.apply(null,t)}catch{}}}const l6=656356768,OE=65536,u6=2048,d6=4096,f6=(e,t)=>({encode:s=>{ju(s);const r=s.length;if(r===0)return new Uint8Array(0);if(r>=OE)throw new Error("invalid length");let i=0;for(;i<r-1&&s[i]===0;)i++;const c=Math.ceil(r/2),u=new Uint16Array(c),f=r&1;f&&(u[0]=s[0]);for(let O=f,C=f;O<r;O+=2,C++)u[C]=s[O]<<8|s[O+1];const p=[];let m=0;for(;m<c;){let O=0;for(let C=m;C<c;C++){const R=O*65536+u[C],$=Math.floor(R/t);O=R-$*t,u[C]=$,$===0&&C===m&&m++}p.push(O)}const g=p.length-1;let y=g*5;for(let O=p[g];y++,!(O<e);O=Math.floor(O/e));const b=new Uint8Array(i+y);let S=b.length-1;for(let O=0;O<g;O++){let C=p[O];for(let R=0;R<5;R++)b[S--]=C%e,C=Math.floor(C/e)}for(let O=p[g];S>=i;O=Math.floor(O/e))b[S--]=O%e;return b},decode:s=>{ju(s);const r=s.length;if(r===0)return new Uint8Array(0);if(r>=OE)throw new Error("invalid length");let i=0;for(;i<r-1&&s[i]===0;)i++;const c=new Uint16Array(Math.ceil(r*6/16)+1);let u=0,f=0,p=r%5||5;for(;f<r;){let b=0,S=1;for(const C=f+p;f<C;f++){const R=s[f];if(R>=e)throw new Error(`invalid integer: ${R}`);b=b*e+R,S*=e}p=5;let O=b;for(let C=0;C<u;C++){const R=c[C]*S+O;O=Math.floor(R/65536),c[C]=R-O*65536}for(;O>0;O=Math.floor(O/65536))c[u++]=O%65536}const m=u===0?1:u*2-(c[u-1]<256?1:0),g=new Uint8Array(i+m);let y=g.length-1;for(let b=0;b<u;b++){const S=c[b];g[y--]=S&255,y>=i&&(g[y--]=S>>8)}return g}}),h6=(e,t)=>{const s=A4(t);return{encode(r){if(ju(r),r.length>u6)throw new Error("invalid length");return s.encode(e.encode(r))},decode(r){if(Ch("baseN.decode",r),r.length>d6)throw new Error("invalid length");return e.decode(s.decode(r))}}},p6=f6(58,l6),m6=e=>h6(p6,e),O4=_4(()=>m6("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),xy=A4("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),g6=/^[\x21-\x60\x7b-\x7e]+$/;function NE(e,t){for(let s=0;s<t.length;s++){const r=t.charCodeAt(s);if(r<33||r>126)throw new Error(`${e}: printable ASCII expected`)}}function y6(e){const t=e.length,s=new Uint8Array(t);for(let r=0;r<t;r++){const i=e[r];if(i<0||i>=32)throw new Error(`alphabet.encode: invalid digit ${i}`);s[r]=i}return s}const xE=[996825010,642813549,513874426,1027748829,705979059];function uu(e){const t=e>>25;let s=(e&33554431)<<5;for(let r=0;r<xE.length;r++)(t>>r&1)===1&&(s^=xE[r]);return s}function CE(e,t,s=1){const r=e.length;let i=1;for(let u=0;u<r;u++){const f=e.charCodeAt(u);if(f<33||f>126)throw new Error(`Invalid prefix (${e})`);i=uu(i)^f>>5}i=uu(i);for(let u=0;u<r;u++)i=uu(i)^e.charCodeAt(u)&31;for(let u of t)i=uu(i)^u;for(let u=0;u<6;u++)i=uu(i);i^=s;const c=new Uint8Array(6);for(let u=0;u<6;u++)c[u]=i>>>5*(5-u)&31;return xy.encode(c)}function v6(e){const s=c6(5),r=y=>{ju(y);const b=y.length,S=new Array(Math.ceil(b*8/5));let O=0,C=0,R=0;for(let $=0;$<b;$++)for(O=O<<8|y[$],C+=8;C>=5;C-=5)S[R++]=O>>C-5&31;return C>0&&(S[R]=O<<5-C&31),S},i=y=>{SE("radix2.decode",y);const b=y.length,S=new Uint8Array(b);for(let O=0;O<b;O++){const C=y[O];if(C<0||C>=32)throw new Error(`convertRadix2: invalid word=${C}`);S[O]=C}return s.decode(S)},c=AE(i);function u(y,b,S=90){Ch("bech32.encode prefix",y),S!==!1&&Ny(S,"limit"),k4(b)&&(b=_E(b)),SE("bech32.encode",b);const O=y.length;if(O===0)throw new TypeError(`Invalid prefix length ${O}`);const C=O+7+b.length;if(S!==!1&&C>S)throw new TypeError(`Length ${C} exceeds limit ${S}`);NE("bech32.encode prefix",y);const R=y.toLowerCase(),$=CE(R,b,1);return`${R}1${xy.encode(y6(b))}${$}`}function f(y,b=90){Ch("bech32.decode input",y),b!==!1&&Ny(b,"limit");const S=y.length;if(S<8||b!==!1&&S>b)throw new TypeError(`invalid string length ${S}, expected (8..${b})`);const O=y.toLowerCase();if(y!==O&&!g6.test(y))throw NE("bech32.decode input",y),new Error("mixed-case string not allowed");const C=O.lastIndexOf("1");if(C===0||C===-1)throw new Error('invalid separator "1"');const R=O.slice(0,C),$=O.slice(C+1);if($.length<6)throw new Error("invalid data length");const x=xy.decode($),W=_E(x,x.length-6),ce=CE(R,W,1);if(!$.endsWith(ce))throw new Error(`Invalid checksum in ${y}`);return{prefix:R,words:W}}const p=AE(f);function m(y,b=90){const{prefix:S,words:O}=f(y,b);return{prefix:S,words:O,bytes:i(O)}}function g(y,b){return u(y,r(b))}return{encode:u,decode:f,encodeFromBytes:g,decodeToBytes:m,decodeUnsafe:p,fromWords:i,fromWordsUnsafe:c,toWords:r}}const Ih=_4(()=>v6()),Ku=e=>O4.encode(e),Rh=e=>O4.decode(e);function qe(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const j0=8192;function st(e){if(e.length<j0)return btoa(String.fromCharCode(...e));let t="";for(var s=0;s<e.length;s+=j0){const r=e.slice(s,s+j0);t+=String.fromCharCode(...r)}return btoa(t)}function Qu(e){const t=e.startsWith("0x")?e.slice(2):e,s=t.length%2===0?t:`0${t}`,r=s.match(/[0-9a-fA-F]{2}/g)?.map(i=>parseInt(i,16))??[];if(r.length!==s.length/2)throw new Error(`Invalid hex string ${e}`);return Uint8Array.from(r)}function kr(e){return e.reduce((t,s)=>t+s.toString(16).padStart(2,"0"),"")}function jh(e,t){return Array.from({length:Math.ceil(e.length/t)},(s,r)=>e.slice(r*t,(r+1)*t))}function N4(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}var IE=class{constructor(e,t){if(typeof e!="function")throw new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but got: ${e}.`);this._batchLoadFn=e,this._maxBatchSize=E6(t),this._batchScheduleFn=S6(t),this._cacheKeyFn=_6(t),this._cacheMap=k6(t),this._batch=null,this.name=A6(t)}load(e){if(e==null)throw new TypeError(`The loader.load() function must be called with a value, but got: ${String(e)}.`);const t=w6(this),s=this._cacheMap;let r;if(s){r=this._cacheKeyFn(e);const c=s.get(r);if(c){const u=t.cacheHits||(t.cacheHits=[]);return new Promise(f=>{u.push(()=>{f(c)})})}}t.keys.push(e);const i=new Promise((c,u)=>{t.callbacks.push({resolve:c,reject:u})});return s&&s.set(r,i),i}loadMany(e){if(!x4(e))throw new TypeError(`The loader.loadMany() function must be called with Array<key>, but got: ${e}.`);const t=[];for(let s=0;s<e.length;s++)t.push(this.load(e[s]).catch(r=>r));return Promise.all(t)}clear(e){const t=this._cacheMap;if(t){const s=this._cacheKeyFn(e);t.delete(s)}return this}clearAll(){const e=this._cacheMap;return e&&e.clear(),this}prime(e,t){const s=this._cacheMap;if(s){const r=this._cacheKeyFn(e);if(s.get(r)===void 0){let i;t instanceof Error?(i=Promise.reject(t),i.catch(()=>{})):i=Promise.resolve(t),s.set(r,i)}}return this}};const b6=typeof process=="object"&&typeof process.nextTick=="function"?function(e){M0||(M0=Promise.resolve()),M0.then(()=>{process.nextTick(e)})}:typeof setImmediate=="function"?function(e){setImmediate(e)}:function(e){setTimeout(e)};let M0;function w6(e){const t=e._batch;if(t!==null&&!t.hasDispatched&&t.keys.length<e._maxBatchSize)return t;const s={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=s,e._batchScheduleFn(()=>{T6(e,s)}),s}function T6(e,t){if(t.hasDispatched=!0,t.keys.length===0){Cy(t);return}let s;try{s=e._batchLoadFn(t.keys)}catch(r){return D0(e,t,new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function errored synchronously: ${String(r)}.`))}if(!s||typeof s.then!="function")return D0(e,t,new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise: ${String(s)}.`));Promise.resolve(s).then(r=>{if(!x4(r))throw new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array: ${String(r)}.`);if(r.length!==t.keys.length)throw new TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.
|
|
2
|
-
|
|
3
|
-
Keys:
|
|
4
|
-
${String(t.keys)}
|
|
5
|
-
|
|
6
|
-
Values:
|
|
7
|
-
${String(r)}`);Cy(t);for(let i=0;i<t.callbacks.length;i++){const c=r[i];c instanceof Error?t.callbacks[i].reject(c):t.callbacks[i].resolve(c)}}).catch(r=>{D0(e,t,r)})}function D0(e,t,s){Cy(t);for(let r=0;r<t.keys.length;r++)e.clear(t.keys[r]),t.callbacks[r].reject(s)}function Cy(e){if(e.cacheHits)for(let t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function E6(e){if(!(!e||e.batch!==!1))return 1;const t=e&&e.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError(`maxBatchSize must be a positive number: ${t}`);return t}function S6(e){const t=e&&e.batchScheduleFn;if(t===void 0)return b6;if(typeof t!="function")throw new TypeError(`batchScheduleFn must be a function: ${t}`);return t}function _6(e){const t=e&&e.cacheKeyFn;if(t===void 0)return s=>s;if(typeof t!="function")throw new TypeError(`cacheKeyFn must be a function: ${t}`);return t}function k6(e){if(!(!e||e.cache!==!1))return null;const t=e&&e.cacheMap;if(t===void 0)return new Map;if(t!==null){const s=["get","set","delete","clear"].filter(r=>t&&typeof t[r]!="function");if(s.length!==0)throw new TypeError("Custom cacheMap missing methods: "+s.join(", "))}return t}function A6(e){return e&&e.name?e.name:null}function x4(e){return typeof e=="object"&&e!==null&&"length"in e&&typeof e.length=="number"&&(e.length===0||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}function C4(e){return e=e||new Map,{all:e,on(t,s){const r=e.get(t);r?r.push(s):e.set(t,[s])},off(t,s){const r=e.get(t);r&&(s?r.splice(r.indexOf(s)>>>0,1):e.set(t,[]))},emit(t,s){let r=e.get(t);r&&r.slice().map(i=>{i(s)}),r=e.get("*"),r&&r.slice().map(i=>{i(t,s)})}}}function O6(e,t){switch(t){case"base58":return Ku(e);case"base64":return st(e);case"hex":return kr(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function I4(e,t=["<",">"]){const[s,r]=t,i=[];let c="",u=0;for(let f=0;f<e.length;f++){const p=e[f];if(p===s&&u++,p===r&&u--,u===0&&p===","){i.push(c.trim()),c="";continue}c+=p}return i.push(c.trim()),i}var N6=class{constructor({initialSize:e=1024,maxSize:t=1/0,allocateSize:s=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=t,this.allocateSize=s,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const t=this.bytePosition+e;if(t>this.size){const s=Math.min(this.maxSize,Math.max(this.size+t,this.size+this.allocateSize));if(t>s)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${t}`);this.size=s;const r=new ArrayBuffer(this.size);new Uint8Array(r).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(r)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}writeBytes(e){this.ensureSizeOrGrow(e.length);for(let t=0;t<e.length;t++)this.dataView.setUint8(this.bytePosition+t,e[t]);return this.shift(e.length)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return U0(BigInt(e),8).forEach(t=>this.write8(t)),this}write128(e){return U0(BigInt(e),16).forEach(t=>this.write8(t)),this}write256(e){return U0(BigInt(e),32).forEach(t=>this.write8(t)),this}writeULEB(e){return xh(e).forEach(t=>this.write8(t)),this}writeVec(e,t){return this.writeULEB(e.length),Array.from(e).forEach((s,r)=>t(this,s,r,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return O6(this.toBytes(),e)}};function U0(e,t){const s=new Uint8Array(t);let r=0;for(;e>0;)s[r]=Number(e%BigInt(256)),e=e/BigInt(256),r+=1;return s}var rr=class R4{#e;#t;constructor(t){this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),this.#e=t.write,this.#t=t.serialize??((s,r)=>{const i=new N6({initialSize:this.serializedSize(s)??void 0,...r});return this.#e(s,i),i.toBytes()}),this.validate=t.validate??(()=>{})}write(t,s){this.validate(t),this.#e(t,s)}serialize(t,s){return this.validate(t),new x6(this,this.#t(t,s))}parse(t){const s=new s6(t);return this.read(s)}fromHex(t){return this.parse(Qu(t))}fromBase58(t){return this.parse(Rh(t))}fromBase64(t){return this.parse(qe(t))}transform({name:t,input:s,output:r,validate:i}){return new R4({name:t??this.name,read:c=>r?r(this.read(c)):this.read(c),write:(c,u)=>this.#e(s?s(c):c,u),serializedSize:c=>this.serializedSize(s?s(c):c),serialize:(c,u)=>this.#t(s?s(c):c,u),validate:c=>{i?.(c),this.validate(s?s(c):c)}})}};const j4=Symbol.for("@mysten/serialized-bcs");function Iy(e){return!!e&&typeof e=="object"&&e[j4]===!0}var x6=class{#e;#t;get[j4](){return!0}constructor(e,t){this.#e=e,this.#t=t}toBytes(){return this.#t}toHex(){return kr(this.#t)}toBase64(){return st(this.#t)}toBase58(){return Ku(this.#t)}parse(){return this.#e.parse(this.#t)}};function Mh({size:e,...t}){return new rr({...t,serializedSize:()=>e})}function B0({readMethod:e,writeMethod:t,...s}){return Mh({...s,read:r=>r[e](),write:(r,i)=>i[t](r),validate:r=>{if(r<0||r>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${r}. Expected value in range 0-${s.maxValue}`);s.validate?.(r)}})}function L0({readMethod:e,writeMethod:t,...s}){return Mh({...s,read:r=>r[e](),write:(r,i)=>i[t](BigInt(r)),validate:r=>{const i=BigInt(r);if(i<0||i>s.maxValue)throw new TypeError(`Invalid ${s.name} value: ${i}. Expected value in range 0-${s.maxValue}`);s.validate?.(i)}})}function C6({serialize:e,...t}){const s=new rr({...t,serialize:e,write:(r,i)=>{for(const c of s.serialize(r).toBytes())i.write8(c)}});return s}function I6({toBytes:e,fromBytes:t,...s}){return new rr({...s,read:r=>{const i=r.readULEB();return t(r.readBytes(i))},write:(r,i)=>{const c=e(r);i.writeULEB(c.length);for(let u=0;u<c.length;u++)i.write8(c[u])},serialize:r=>{const i=e(r),c=xh(i.length),u=new Uint8Array(c.length+i.length);return u.set(c,0),u.set(i,c.length),u},validate:r=>{if(typeof r!="string")throw new TypeError(`Invalid ${s.name} value: ${r}. Expected string`);s.validate?.(r)}})}function R6(e){let t=null;function s(){return t||(t=e()),t}return new rr({name:"lazy",read:r=>s().read(r),serializedSize:r=>s().serializedSize(r),write:(r,i)=>s().write(r,i),serialize:(r,i)=>s().serialize(r,i).toBytes()})}var j6=class extends rr{constructor({name:e,fields:t,...s}){const r=Object.entries(t);super({name:e,serializedSize:i=>{let c=0;for(const[u,f]of r){const p=f.serializedSize(i[u]);if(p==null)return null;c+=p}return c},read:i=>{const c={};for(const[u,f]of r)c[u]=f.read(i);return c},write:(i,c)=>{for(const[u,f]of r)f.write(i[u],c)},...s,validate:i=>{if(s?.validate?.(i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})}},M6=class extends rr{constructor({fields:e,...t}){const s=Object.entries(e);super({read:r=>{const i=r.readULEB(),c=s[i];if(!c)throw new TypeError(`Unknown value ${i} for enum ${t.name}`);const[u,f]=c;return{[u]:f?.read(r)??!0,$kind:u}},write:(r,i)=>{const[c,u]=Object.entries(r).filter(([f])=>Object.hasOwn(e,f))[0];for(let f=0;f<s.length;f++){const[p,m]=s[f];if(p===c){i.writeULEB(f),m?.write(u,i);return}}},...t,validate:r=>{if(t?.validate?.(r),typeof r!="object"||r==null)throw new TypeError(`Expected object, found ${typeof r}`);const i=Object.keys(r).filter(u=>r[u]!==void 0&&Object.hasOwn(e,u));if(i.length!==1)throw new TypeError(`Expected object with one key, but found ${i.length} for type ${t.name}}`);const[c]=i;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})}},D6=class extends rr{constructor({fields:e,name:t,...s}){super({name:t??`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let i=0;for(let c=0;c<e.length;c++){const u=e[c].serializedSize(r[c]);if(u==null)return null;i+=u}return i},read:r=>{const i=[];for(const c of e)i.push(c.read(r));return i},write:(r,i)=>{for(let c=0;c<e.length;c++)e[c].write(r[c],i)},...s,validate:r=>{if(s?.validate?.(r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})}};function U6(e,t,s){return new rr({read:r=>{const i=new Array(e);for(let c=0;c<e;c++)i[c]=t.read(r);return i},write:(r,i)=>{for(const c of r)t.write(c,i)},...s,name:s?.name??`${t.name}[${e}]`,validate:r=>{if(s?.validate?.(r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})}function B6(e){return E.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>t.$kind==="Some"?t.Some:null})}function L6(e,t){return new rr({read:s=>{const r=s.readULEB(),i=new Array(r);for(let c=0;c<r;c++)i[c]=e.read(s);return i},write:(s,r)=>{r.writeULEB(s.length);for(const i of s)e.write(i,r)},...t,name:t?.name??`vector<${e.name}>`,validate:s=>{if(t?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`)}})}function z6(e,t){for(let s=0;s<Math.min(e.length,t.length);s++)if(e[s]!==t[s])return e[s]-t[s];return e.length-t.length}function $6(e,t){return new rr({name:`Map<${e.name}, ${t.name}>`,read:s=>{const r=s.readULEB(),i=new Map;for(let c=0;c<r;c++)i.set(e.read(s),t.read(s));return i},write:(s,r)=>{const i=[...s.entries()].map(([c,u])=>[e.serialize(c).toBytes(),u]);i.sort(([c],[u])=>z6(c,u)),r.writeULEB(i.length);for(const[c,u]of i)r.writeBytes(c),t.write(u,r)}})}const E={u8(e){return B0({readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e,name:e?.name??"u8"})},u16(e){return B0({readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e,name:e?.name??"u16"})},u32(e){return B0({readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e,name:e?.name??"u32"})},u64(e){return L0({readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e,name:e?.name??"u64"})},u128(e){return L0({readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e,name:e?.name??"u128"})},u256(e){return L0({readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e,name:e?.name??"u256"})},bool(e){return Mh({size:1,read:t=>{const s=t.read8();if(s>1)throw new TypeError(`Invalid bool value: expected 0 or 1, found ${s}`);return s===1},write:(t,s)=>s.write8(t?1:0),...e,name:e?.name??"bool",validate:t=>{if(e?.validate?.(t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return C6({read:t=>t.readULEB(),serialize:t=>Uint8Array.from(xh(t)),...e,name:e?.name??"uleb128"})},bytes(e,t){return Mh({size:e,read:s=>s.readBytes(e),write:(s,r)=>{r.writeBytes(new Uint8Array(s))},...t,name:t?.name??`bytes[${e}]`,validate:s=>{if(t?.validate?.(s),!s||typeof s!="object"||!("length"in s))throw new TypeError(`Expected array, found ${typeof s}`);if(s.length!==e)throw new TypeError(`Expected array of length ${e}, found ${s.length}`)}})},byteVector(e){return new rr({read:t=>{const s=t.readULEB();return t.readBytes(s)},write:(t,s)=>{const r=new Uint8Array(t);s.writeULEB(r.length),s.writeBytes(r)},...e,name:e?.name??"vector<u8>",serializedSize:t=>{const s="length"in t?t.length:null;return s==null?null:xh(s).length+s},validate:t=>{if(e?.validate?.(t),!t||typeof t!="object"||!("length"in t))throw new TypeError(`Expected array, found ${typeof t}`)}})},string(e){return I6({toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t),...e,name:e?.name??"string"})},fixedArray:U6,option:B6,vector:L6,tuple(e,t){return new D6({fields:e,...t})},struct(e,t,s){return new j6({name:e,fields:t,...s})},enum(e,t,s){return new M6({name:e,fields:t,...s})},map:$6,lazy(e){return R6(e)}},el=32;function da(e){return F6(e)&&H6(e)===el}const V6=/^[a-zA-Z][a-zA-Z0-9_]*$/;function RE(e){return V6.test(e)}const P6=["bool","u8","u16","u32","u64","u128","u256","address","signer"],G6=/^vector<(.+)>$/;function M4(e){if(P6.includes(e))return!0;const t=e.match(G6);return t?M4(t[1]):e.includes("::")?U4(e):!1}function D4(e){return!da(e.address)&&!Ju(e.address)||!RE(e.module)||!RE(e.name)?!1:e.typeParams.every(t=>typeof t=="string"?M4(t):D4(t))}function U4(e){try{return D4(ws(e))}catch{return!1}}function B4(e){if(e.startsWith("vector<")){if(!e.endsWith(">"))throw new Error(`Invalid type tag: ${e}`);const t=e.slice(7,-1);if(!t)throw new Error(`Invalid type tag: ${e}`);const s=B4(t);return typeof s=="string"?`vector<${s}>`:`vector<${De(s)}>`}return e.includes("::")?ws(e):e}function ws(e){const t=e.split("::");if(t.length<3)throw new Error(`Invalid struct tag: ${e}`);const[s,r]=t;if(!s||!r)throw new Error(`Invalid struct tag: ${e}`);const i=Ju(s),c=e.slice(s.length+r.length+4),u=c.includes("<")?c.slice(0,c.indexOf("<")):c;if(!u||c.includes("<")&&!c.endsWith(">"))throw new Error(`Invalid struct tag: ${e}`);const f=c.includes("<")?I4(c.slice(c.indexOf("<")+1,c.lastIndexOf(">"))).map(p=>B4(p.trim())):[];return{address:i?s:ye(s),module:r,name:u,typeParams:f}}function De(e){if(typeof e=="string"&&e.startsWith("vector<"))throw new Error("normalizeStructTag does not support vector types. Use normalizeTypeTag instead.");const{address:t,module:s,name:r,typeParams:i}=typeof e=="string"?ws(e):e;return`${t}::${s}::${r}${i?.length>0?`<${i.map(c=>typeof c=="string"?c:De(c)).join(",")}>`:""}`}function ye(e,t=!1){let s=e.toLowerCase();return!t&&s.startsWith("0x")&&(s=s.slice(2)),`0x${s.padStart(el*2,"0")}`}function Ry(e,t=!1){return ye(e,t)}function F6(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function H6(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const q6=/^vector<(.+)>$/,Z6=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;var co=class vc{static parseFromStr(t,s=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const r=t.match(q6);if(r)return{vector:vc.parseFromStr(r[1],s)};const i=t.match(Z6);if(i)return{struct:{address:s?ye(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:vc.parseStructTypeArgs(i[5],s)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,s=!1){return I4(t).map(r=>vc.parseFromStr(r,s))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${vc.tagToString(t.vector)}>`;if("struct"in t){const s=t.struct,r=s.typeParams.map(vc.tagToString).join(", ");return`${s.address}::${s.module}::${s.name}${r?`<${r}>`:""}`}throw new Error("Invalid TypeTag")}};function Y6(e){return E.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function W6(e){return E.enum("Option",{None:null,Some:e})}const rt=E.bytes(el).transform({validate:e=>{const t=typeof e=="string"?e:kr(e);if(!t||!da(ye(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?Qu(ye(e)):e,output:e=>ye(kr(e))}),qt=E.byteVector().transform({name:"ObjectDigest",input:e=>Rh(e),output:e=>Ku(new Uint8Array(e)),validate:e=>{if(Rh(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Bs=E.struct("SuiObjectRef",{objectId:rt,version:E.u64(),digest:qt}),L4=E.struct("SharedObjectRef",{objectId:rt,initialSharedVersion:E.u64(),mutable:E.bool()}),z4=E.enum("ObjectArg",{ImmOrOwnedObject:Bs,SharedObject:L4,Receiving:Bs}),oa=E.enum("Owner",{AddressOwner:rt,ObjectOwner:rt,Shared:E.struct("Shared",{initialSharedVersion:E.u64()}),Immutable:null,ConsensusAddressOwner:E.struct("ConsensusAddressOwner",{startVersion:E.u64(),owner:rt})}),X6=E.enum("Reservation",{MaxAmountU64:E.u64()}),J6=E.enum("WithdrawalType",{Balance:E.lazy(()=>vo)}),K6=E.enum("WithdrawFrom",{Sender:null,Sponsor:null,SenderAllowance:E.struct("SenderAllowance",{funder:rt,allowance:rt})}),Q6=E.struct("FundsWithdrawal",{reservation:X6,typeArg:J6,withdrawFrom:K6}),$4=E.enum("CallArg",{Pure:E.struct("Pure",{bytes:E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})}),Object:z4,FundsWithdrawal:Q6}),Nv=E.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:E.lazy(()=>Nv),struct:E.lazy(()=>Cv),u16:null,u32:null,u256:null}),vo=Nv.transform({input:e=>typeof e=="string"?co.parseFromStr(e,!0):e,output:e=>co.tagToString(e)}),br=E.enum("Argument",{GasCoin:null,Input:E.u16(),Result:E.u16(),NestedResult:E.tuple([E.u16(),E.u16()])}),V4=E.struct("ProgrammableMoveCall",{package:rt,module:E.string(),function:E.string(),typeArguments:E.vector(vo),arguments:E.vector(br)}),P4=E.enum("Command",{MoveCall:V4,TransferObjects:E.struct("TransferObjects",{objects:E.vector(br),address:br}),SplitCoins:E.struct("SplitCoins",{coin:br,amounts:E.vector(br)}),MergeCoins:E.struct("MergeCoins",{destination:br,sources:E.vector(br)}),Publish:E.struct("Publish",{modules:E.vector(E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})),dependencies:E.vector(rt)}),MakeMoveVec:E.struct("MakeMoveVec",{type:W6(vo).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:E.vector(br)}),Upgrade:E.struct("Upgrade",{modules:E.vector(E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))})),dependencies:E.vector(rt),package:rt,ticket:br})}),jy=E.struct("ProgrammableTransaction",{inputs:E.vector($4),commands:E.vector(P4)}),eI=E.struct("ValidDuring",{minEpoch:E.option(E.u64()),maxEpoch:E.option(E.u64()),minTimestamp:E.option(E.u64()),maxTimestamp:E.option(E.u64()),chain:qt,nonce:E.u32()});function xv(e){if(e.length===0)throw new Error("Allowed proposers must not be empty");return e}function G4(e){xv(e);for(let t=1;t<e.length;t++)if(e[t]<=e[t-1])throw new Error("Allowed proposers must be strictly increasing");return e}const tI=E.vector(E.u32()).transform({input:G4,output:xv}),nI=E.struct("AllowedProposers",{epoch:E.u64(),proposers:tI}),sI=E.struct("Validity",{minEpoch:E.option(E.u64()),maxEpoch:E.option(E.u64()),minTimestamp:E.option(E.u64()),maxTimestamp:E.option(E.u64()),chain:qt,nonce:E.u32(),allowedProposers:E.option(nI)}),F4=E.enum("TransactionExpiration",{None:null,Epoch:Y6(),ValidDuring:eI,Validity:sI}),Cv=E.struct("StructTag",{address:rt,module:E.string(),name:E.string(),typeParams:E.vector(Nv)}),H4=E.struct("GasData",{payment:E.vector(Bs),owner:rt,price:E.u64(),budget:E.u64()}),q4=E.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),Z4=E.enum("IntentVersion",{V0:null}),Y4=E.enum("AppId",{Sui:null}),W4=E.struct("Intent",{scope:q4,version:Z4,appId:Y4});function X4(e){return E.struct(`IntentMessage<${e.name}>`,{intent:W4,value:e})}const J4=E.enum("CompressedSignature",{ED25519:E.bytes(64),Secp256k1:E.bytes(64),Secp256r1:E.bytes(64),ZkLogin:E.byteVector(),Passkey:E.byteVector()}),K4=E.enum("PublicKey",{ED25519:E.bytes(32),Secp256k1:E.bytes(33),Secp256r1:E.bytes(33),ZkLogin:E.byteVector(),Passkey:E.bytes(33)}),Q4=E.struct("MultiSigPkMap",{pubKey:K4,weight:E.u8()}),ek=E.struct("MultiSigPublicKey",{pk_map:E.vector(Q4),threshold:E.u16()}),rI=E.struct("MultiSig",{sigs:E.vector(J4),bitmap:E.u16(),multisig_pk:ek}),aI=E.byteVector().transform({input:e=>typeof e=="string"?qe(e):e,output:e=>st(new Uint8Array(e))}),tk=E.struct("PasskeyAuthenticator",{authenticatorData:E.byteVector(),clientDataJson:E.string(),userSignature:E.byteVector()}),nk=E.enum("MoveObjectType",{Other:Cv,GasCoin:null,StakedSui:null,Coin:vo,AccumulatorBalanceWrapper:null}),sk=E.struct("TypeOrigin",{moduleName:E.string(),datatypeName:E.string(),package:rt}),rk=E.struct("UpgradeInfo",{upgradedId:rt,upgradedVersion:E.u64()}),ak=E.struct("MovePackage",{id:rt,version:E.u64(),moduleMap:E.map(E.string(),E.byteVector()),typeOriginTable:E.vector(sk),linkageTable:E.map(rt,rk)}),ik=E.struct("MoveObject",{type:nk,hasPublicTransfer:E.bool(),version:E.u64(),contents:E.byteVector()}),Iv=E.enum("Data",{Move:ik,Package:ak}),iI=E.struct("ObjectInner",{data:Iv,owner:oa,previousTransaction:qt,storageRebate:E.u64()}),ok=E.struct("ChangeEpoch",{epoch:E.u64(),protocolVersion:E.u64(),storageCharge:E.u64(),computationCharge:E.u64(),storageRebate:E.u64(),nonRefundableStorageFee:E.u64(),epochStartTimestampMs:E.u64(),systemPackages:E.vector(E.tuple([E.u64(),E.vector(E.byteVector()),E.vector(rt)]))}),oI=E.enum("GenesisObject",{RawObject:E.struct("RawObject",{data:Iv,owner:oa})}),cI=E.struct("GenesisTransaction",{objects:E.vector(oI)}),lI=E.struct("ConsensusCommitPrologue",{epoch:E.u64(),round:E.u64(),commitTimestampMs:E.u64()}),uI=E.struct("ConsensusCommitPrologueV2",{epoch:E.u64(),round:E.u64(),commitTimestampMs:E.u64(),consensusCommitDigest:qt}),ck=E.enum("ConsensusDeterminedVersionAssignments",{CancelledTransactions:E.vector(E.tuple([qt,E.vector(E.tuple([rt,E.u64()]))])),CancelledTransactionsV2:E.vector(E.tuple([qt,E.vector(E.tuple([E.tuple([rt,E.u64()]),E.u64()]))]))}),dI=E.struct("ConsensusCommitPrologueV3",{epoch:E.u64(),round:E.u64(),subDagIndex:E.option(E.u64()),commitTimestampMs:E.u64(),consensusCommitDigest:qt,consensusDeterminedVersionAssignments:ck}),fI=E.struct("ConsensusCommitPrologueV4",{epoch:E.u64(),round:E.u64(),subDagIndex:E.option(E.u64()),commitTimestampMs:E.u64(),consensusCommitDigest:qt,consensusDeterminedVersionAssignments:ck,additionalStateDigest:qt}),hI=E.struct("ActiveJwk",{jwkId:E.struct("JwkId",{iss:E.string(),kid:E.string()}),jwk:E.struct("JWK",{kty:E.string(),e:E.string(),n:E.string(),alg:E.string()}),epoch:E.u64()}),pI=E.struct("AuthenticatorStateUpdate",{epoch:E.u64(),round:E.u64(),newActiveJwks:E.vector(hI),authenticatorObjInitialSharedVersion:E.u64()}),mI=E.struct("RandomnessStateUpdate",{epoch:E.u64(),randomnessRound:E.u64(),randomBytes:E.byteVector(),randomnessObjInitialSharedVersion:E.u64()}),gI=E.struct("AuthenticatorStateExpire",{minEpoch:E.u64(),authenticatorObjInitialSharedVersion:E.u64()}),yI=E.enum("ExecutionTimeObservationKey",{MoveEntryPoint:E.struct("MoveEntryPoint",{package:rt,module:E.string(),function:E.string(),typeArguments:E.vector(vo)}),TransferObjects:null,SplitCoins:null,MergeCoins:null,Publish:null,MakeMoveVec:null,Upgrade:null}),vI=E.enum("StoredExecutionTimeObservations",{V1:E.vector(E.tuple([yI,E.vector(E.tuple([E.byteVector(),E.struct("Duration",{secs:E.u64(),nanos:E.u32()})]))]))}),bI=E.struct("WriteAccumulatorStorageCost",{storageCost:E.u64()}),wI=E.enum("EndOfEpochTransactionKind",{ChangeEpoch:ok,AuthenticatorStateCreate:null,AuthenticatorStateExpire:gI,RandomnessStateCreate:null,DenyListStateCreate:null,BridgeStateCreate:qt,BridgeCommitteeInit:E.u64(),StoreExecutionTimeObservations:vI,AccumulatorRootCreate:null,CoinRegistryCreate:null,DisplayRegistryCreate:null,AddressAliasStateCreate:null,WriteAccumulatorStorageCost:bI,ForwardingAddressRegistryCreate:null}),lk=E.enum("TransactionKind",{ProgrammableTransaction:jy,ChangeEpoch:ok,Genesis:cI,ConsensusCommitPrologue:lI,AuthenticatorStateUpdate:pI,EndOfEpochTransaction:E.vector(wI),RandomnessStateUpdate:mI,ConsensusCommitPrologueV2:uI,ConsensusCommitPrologueV3:dI,ConsensusCommitPrologueV4:fI,ProgrammableSystemTransaction:jy}),uk=E.struct("TransactionDataV1",{kind:lk,sender:rt,gasData:H4,expiration:F4}),dk=E.enum("TransactionData",{V1:uk}),fk=E.struct("SenderSignedTransaction",{intentMessage:X4(dk),txSignatures:E.vector(aI)}),TI=E.vector(fk,{name:"SenderSignedData"}),EI=E.enum("PackageUpgradeError",{UnableToFetchPackage:E.struct("UnableToFetchPackage",{packageId:rt}),NotAPackage:E.struct("NotAPackage",{objectId:rt}),IncompatibleUpgrade:null,DigestDoesNotMatch:E.struct("DigestDoesNotMatch",{digest:E.byteVector()}),UnknownUpgradePolicy:E.struct("UnknownUpgradePolicy",{policy:E.u8()}),PackageIDDoesNotMatch:E.struct("PackageIDDoesNotMatch",{packageId:rt,ticketId:rt})}),SI=E.struct("ModuleId",{address:rt,name:E.string()}),jE=E.struct("MoveLocation",{module:SI,function:E.u16(),instruction:E.u16(),functionName:E.option(E.string())}),_I=E.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:E.struct("IndexOutOfBounds",{idx:E.u16()}),SecondaryIndexOutOfBounds:E.struct("SecondaryIndexOutOfBounds",{resultIdx:E.u16(),secondaryIdx:E.u16()}),InvalidResultArity:E.struct("InvalidResultArity",{resultIdx:E.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null,InvalidArgumentArity:null,InvalidTransferObject:null,InvalidMakeMoveVecNonObjectArgument:null,ArgumentWithoutValue:null,CannotMoveBorrowedValue:null,CannotWriteToExtendedReference:null,InvalidReferenceArgument:null,InvalidTxContext:null}),kI=E.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),AI=E.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:E.struct("MoveObjectTooBig",{objectSize:E.u64(),maxObjectSize:E.u64()}),MovePackageTooBig:E.struct("MovePackageTooBig",{objectSize:E.u64(),maxObjectSize:E.u64()}),CircularObjectOwnership:E.struct("CircularObjectOwnership",{object:rt}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:E.option(jE),MoveAbort:E.tuple([jE,E.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:E.struct("CommandArgumentError",{argIdx:E.u16(),kind:_I}),TypeArgumentError:E.struct("TypeArgumentError",{argumentIdx:E.u16(),kind:kI}),UnusedValueWithoutDrop:E.struct("UnusedValueWithoutDrop",{resultIdx:E.u16(),secondaryIdx:E.u16()}),InvalidPublicFunctionReturnType:E.struct("InvalidPublicFunctionReturnType",{idx:E.u16()}),InvalidTransferObject:null,EffectsTooLarge:E.struct("EffectsTooLarge",{currentSize:E.u64(),maxSize:E.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:E.struct("PackageUpgradeError",{upgradeError:EI}),WrittenObjectsTooLarge:E.struct("WrittenObjectsTooLarge",{currentSize:E.u64(),maxSize:E.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:E.struct("ExecutionCancelledDueToSharedObjectCongestion",{congested_objects:E.vector(rt)}),AddressDeniedForCoin:E.struct("AddressDeniedForCoin",{address:rt,coinType:E.string()}),CoinTypeGlobalPause:E.struct("CoinTypeGlobalPause",{coinType:E.string()}),ExecutionCancelledDueToRandomnessUnavailable:null,MoveVectorElemTooBig:E.struct("MoveVectorElemTooBig",{valueSize:E.u64(),maxScaledSize:E.u64()}),MoveRawValueTooBig:E.struct("MoveRawValueTooBig",{valueSize:E.u64(),maxScaledSize:E.u64()}),InvalidLinkage:null,InsufficientBalanceForWithdraw:null,NonExclusiveWriteInputObjectModified:E.struct("NonExclusiveWriteInputObjectModified",{id:rt})}),Rv=E.enum("ExecutionStatus",{Success:null,Failure:E.struct("Failure",{error:AI,command:E.option(E.u64())})}),hk=E.struct("GasCostSummary",{computationCost:E.u64(),storageCost:E.u64(),storageRebate:E.u64(),nonRefundableStorageFee:E.u64()}),OI=E.struct("TransactionEffectsV1",{status:Rv,executedEpoch:E.u64(),gasUsed:hk,modifiedAtVersions:E.vector(E.tuple([rt,E.u64()])),sharedObjects:E.vector(Bs),transactionDigest:qt,created:E.vector(E.tuple([Bs,oa])),mutated:E.vector(E.tuple([Bs,oa])),unwrapped:E.vector(E.tuple([Bs,oa])),deleted:E.vector(Bs),unwrappedThenDeleted:E.vector(Bs),wrapped:E.vector(Bs),gasObject:E.tuple([Bs,oa]),eventsDigest:E.option(qt),dependencies:E.vector(qt)}),jv=E.tuple([E.u64(),qt]),NI=E.enum("ObjectIn",{NotExist:null,Exist:E.tuple([jv,oa])}),xI=E.struct("AccumulatorAddress",{address:rt,ty:vo}),CI=E.enum("AccumulatorOperation",{Merge:null,Split:null}),II=E.enum("AccumulatorValue",{Integer:E.u64(),IntegerTuple:E.tuple([E.u64(),E.u64()]),EventDigest:E.vector(E.tuple([E.u64(),qt]))}),RI=E.struct("AccumulatorWriteV1",{address:xI,operation:CI,value:II}),jI=E.enum("ObjectOut",{NotExist:null,ObjectWrite:E.tuple([qt,oa]),PackageWrite:jv,AccumulatorWriteV1:RI}),MI=E.enum("IDOperation",{None:null,Created:null,Deleted:null}),DI=E.struct("EffectsObjectChange",{inputState:NI,outputState:jI,idOperation:MI}),UI=E.enum("UnchangedConsensusKind",{ReadOnlyRoot:jv,MutateConsensusStreamEnded:E.u64(),ReadConsensusStreamEnded:E.u64(),Cancelled:E.u64(),PerEpochConfig:null}),BI=E.struct("TransactionEffectsV2",{status:Rv,executedEpoch:E.u64(),gasUsed:hk,transactionDigest:qt,gasObjectIndex:E.option(E.u32()),eventsDigest:E.option(qt),dependencies:E.vector(qt),lamportVersion:E.u64(),changedObjects:E.vector(E.tuple([rt,DI])),unchangedConsensusObjects:E.vector(E.tuple([rt,UI])),auxDataDigest:E.option(qt)}),LI=E.enum("TransactionEffects",{V1:OI,V2:BI});function Ou(e){switch(e){case"u8":return E.u8();case"u16":return E.u16();case"u32":return E.u32();case"u64":return E.u64();case"u128":return E.u128();case"u256":return E.u256();case"bool":return E.bool();case"string":return E.string();case"id":case"address":return rt}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[s,r]=t.slice(1);return s==="vector"?E.vector(Ou(r)):E.option(Ou(r))}throw new Error(`Invalid Pure type name: ${e}`)}const H={...E,U8:E.u8(),U16:E.u16(),U32:E.u32(),U64:E.u64(),U128:E.u128(),U256:E.u256(),ULEB128:E.uleb128(),Bool:E.bool(),String:E.string(),Address:rt,AppId:Y4,Argument:br,CallArg:$4,Command:P4,CompressedSignature:J4,Data:Iv,GasData:H4,Intent:W4,IntentMessage:X4,IntentScope:q4,IntentVersion:Z4,MoveObject:ik,MoveObjectType:nk,MovePackage:ak,MultiSig:rI,MultiSigPkMap:Q4,MultiSigPublicKey:ek,Object:iI,ObjectArg:z4,ObjectDigest:qt,Owner:oa,PasskeyAuthenticator:tk,ProgrammableMoveCall:V4,ProgrammableTransaction:jy,PublicKey:K4,SenderSignedData:TI,SenderSignedTransaction:fk,SharedObjectRef:L4,StructTag:Cv,SuiObjectRef:Bs,TransactionData:dk,TransactionDataV1:uk,TransactionEffects:LI,TransactionExpiration:F4,TransactionKind:lk,TypeOrigin:sk,TypeTag:vo,UpgradeInfo:rk},zI={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Mv(e){return zI}let $I;function VI(e){return $I?.get(e)}let PI;function GI(e){return PI?.get(e)}let FI;function HI(e,t){return FI?.get(e)?.get(t)}function Dv(e){const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function wn(e,t,s,r,i){const c=i&&"input"in i?i.input:s.value,u=i?.expected??e.expects??null,f=i?.received??Dv(c),p={kind:e.kind,type:e.type,input:c,expected:u,received:f,message:`Invalid ${t}: ${u?`Expected ${u} but r`:"R"}eceived ${f}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},m=e.kind==="schema",g=i?.message??e.message??HI(e.reference,p.lang)??(m?GI(p.lang):null)??r.message??VI(p.lang);g!==void 0&&(p.message=typeof g=="function"?g(p):g),m&&(s.typed=!1),s.issues?s.issues.push(p):s.issues=[p]}function qI(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ZI(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Uv(e,t){const s=[...new Set(e)];return s.length>1?`(${s.join(` ${t} `)})`:s[0]??"never"}function En(e){return e["~standard"]={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},Mv())},e}var YI=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};const WI=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function tl(e,t){return{kind:"validation",type:"check",reference:tl,async:!1,expects:null,requirement:e,message:t,"~run"(s,r){return s.typed&&!this.requirement(s.value)&&wn(this,"input",s,r),s}}}function Hn(e){return{kind:"validation",type:"integer",reference:Hn,async:!1,expects:null,requirement:Number.isInteger,message:e,"~run"(t,s){return t.typed&&!this.requirement(t.value)&&wn(this,"integer",t,s),t}}}function ed(e){return{kind:"transformation",type:"transform",reference:ed,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function pk(e){return{kind:"validation",type:"uuid",reference:pk,async:!1,expects:null,requirement:WI,message:e,"~run"(t,s){return t.typed&&!this.requirement.test(t.value)&&wn(this,"UUID",t,s),t}}}const mk={abortEarly:!0};function XI(e,t,s){return typeof e.fallback=="function"?e.fallback(t,s):e.fallback}function Tp(e,t,s){return typeof e.default=="function"?e.default(t,s):e.default}function My(e,t){return!e["~run"]({value:t},mk).issues}function ct(e,t){return En({kind:"schema",type:"array",reference:ct,expects:"Array",async:!1,item:e,message:t,"~run"(s,r){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let c=0;c<i.length;c++){const u=i[c],f=this.item["~run"]({value:u},r);if(f.issues){const p={type:"array",origin:"value",input:i,key:c,value:u};for(const m of f.issues)m.path?m.path.unshift(p):m.path=[p],s.issues?.push(m);if(s.issues||(s.issues=f.issues),r.abortEarly){s.typed=!1;break}}f.typed||(s.typed=!1),s.value.push(f.value)}}else wn(this,"type",s,r);return s}})}function Bv(e){return En({kind:"schema",type:"bigint",reference:Bv,expects:"bigint",async:!1,message:e,"~run"(t,s){return typeof t.value=="bigint"?t.typed=!0:wn(this,"type",t,s),t}})}function lo(e){return En({kind:"schema",type:"boolean",reference:lo,expects:"boolean",async:!1,message:e,"~run"(t,s){return typeof t.value=="boolean"?t.typed=!0:wn(this,"type",t,s),t}})}function Dy(e){return En({kind:"schema",type:"lazy",reference:Dy,expects:"unknown",async:!1,getter:e,"~run"(t,s){return this.getter(t.value)["~run"](t,s)}})}function nt(e,t){return En({kind:"schema",type:"literal",reference:nt,expects:Dv(e),async:!1,literal:e,message:t,"~run"(s,r){return qI(s.value,this.literal)?s.typed=!0:wn(this,"type",s,r),s}})}function It(e,t){return En({kind:"schema",type:"nullable",reference:It,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,"~run"(s,r){return s.value===null&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Mu(e,t){return En({kind:"schema",type:"nullish",reference:Mu,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,"~run"(s,r){return(s.value===null||s.value===void 0)&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===null||s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Cn(e){return En({kind:"schema",type:"number",reference:Cn,expects:"number",async:!1,message:e,"~run"(t,s){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:wn(this,"type",t,s),t}})}function Ne(e,t){return En({kind:"schema",type:"object",reference:Ne,expects:"Object",async:!1,entries:e,message:t,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const c in this.entries){const u=this.entries[c];if(c in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const f=c in i?i[c]:Tp(u),p=u["~run"]({value:f},r);if(p.issues){const m={type:"object",origin:"value",input:i,key:c,value:f};for(const g of p.issues)g.path?g.path.unshift(m):g.path=[m],s.issues?.push(g);if(s.issues||(s.issues=p.issues),r.abortEarly){s.typed=!1;break}}p.typed||(s.typed=!1),s.value[c]=p.value}else if(u.fallback!==void 0)s.value[c]=XI(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(wn(this,"key",s,r,{input:void 0,expected:`"${c}"`,path:[{type:"object",origin:"key",input:i,key:c,value:i[c]}]}),r.abortEarly))break}}else wn(this,"type",s,r);return s}})}function dn(e,t){return En({kind:"schema",type:"optional",reference:dn,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,"~run"(s,r){return s.value===void 0&&(this.default!==void 0&&(s.value=Tp(this,s,r)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,r)}})}function Lv(e,t){return En({kind:"schema",type:"picklist",reference:Lv,expects:Uv(e.map(Dv),"|"),async:!1,options:e,message:t,"~run"(s,r){return this.options.includes(s.value)?s.typed=!0:wn(this,"type",s,r),s}})}function Du(e,t,s){return En({kind:"schema",type:"record",reference:Du,expects:"Object",async:!1,key:e,value:t,message:s,"~run"(r,i){const c=r.value;if(c&&typeof c=="object"){r.typed=!0,r.value={};for(const u in c)if(ZI(c,u)){const f=c[u],p=this.key["~run"]({value:u},i);if(p.issues){const g={type:"object",origin:"key",input:c,key:u,value:f};for(const y of p.issues)y.path=[g],r.issues?.push(y);if(r.issues||(r.issues=p.issues),i.abortEarly){r.typed=!1;break}}const m=this.value["~run"]({value:f},i);if(m.issues){const g={type:"object",origin:"value",input:c,key:u,value:f};for(const y of m.issues)y.path?y.path.unshift(g):y.path=[g],r.issues?.push(y);if(r.issues||(r.issues=m.issues),i.abortEarly){r.typed=!1;break}}(!p.typed||!m.typed)&&(r.typed=!1),p.typed&&(r.value[p.value]=m.value)}}else wn(this,"type",r,i);return r}})}function Be(e){return En({kind:"schema",type:"string",reference:Be,expects:"string",async:!1,message:e,"~run"(t,s){return typeof t.value=="string"?t.typed=!0:wn(this,"type",t,s),t}})}function zv(e,t){return En({kind:"schema",type:"tuple",reference:zv,expects:"Array",async:!1,items:e,message:t,"~run"(s,r){const i=s.value;if(Array.isArray(i)){s.typed=!0,s.value=[];for(let c=0;c<this.items.length;c++){const u=i[c],f=this.items[c]["~run"]({value:u},r);if(f.issues){const p={type:"array",origin:"value",input:i,key:c,value:u};for(const m of f.issues)m.path?m.path.unshift(p):m.path=[p],s.issues?.push(m);if(s.issues||(s.issues=f.issues),r.abortEarly){s.typed=!1;break}}f.typed||(s.typed=!1),s.value.push(f.value)}}else wn(this,"type",s,r);return s}})}function ME(e){let t;if(e)for(const s of e)if(t)for(const r of s.issues)t.push(r);else t=s.issues;return t}function nr(e,t){return En({kind:"schema",type:"union",reference:nr,expects:Uv(e.map(s=>s.expects),"|"),async:!1,options:e,message:t,"~run"(s,r){let i,c,u;for(const f of this.options){const p=f["~run"]({value:s.value},r);if(p.typed)if(p.issues)c?c.push(p):c=[p];else{i=p;break}else u?u.push(p):u=[p]}if(i)return i;if(c){if(c.length===1)return c[0];wn(this,"type",s,r,{issues:ME(c)}),s.typed=!0}else{if(u?.length===1)return u[0];wn(this,"type",s,r,{issues:ME(u)})}return s}})}function nl(){return En({kind:"schema",type:"unknown",reference:nl,expects:"unknown",async:!1,"~run"(e){return e.typed=!0,e}})}function Ep(e,t,s){return En({kind:"schema",type:"variant",reference:Ep,expects:"Object",async:!1,key:e,options:t,message:s,"~run"(r,i){const c=r.value;if(c&&typeof c=="object"){let u,f=0,p=this.key,m=[];const g=(y,b)=>{for(const S of y.options){if(S.type==="variant")g(S,new Set(b).add(S.key));else{let O=!0,C=0;for(const R of b){const $=S.entries[R];if(R in c?$["~run"]({typed:!1,value:c[R]},mk).issues:$.type!=="exact_optional"&&$.type!=="optional"&&$.type!=="nullish"){O=!1,p!==R&&(f<C||f===C&&R in c&&!(p in c))&&(f=C,p=R,m=[]),p===R&&m.push(S.entries[R].expects);break}C++}if(O){const R=S["~run"]({value:c},i);(!u||!u.typed&&R.typed)&&(u=R)}}if(u&&!u.issues)break}};if(g(this,new Set([this.key])),u)return u;wn(this,"type",r,i,{input:c[p],expected:Uv(m,"|"),path:[{type:"object",origin:"value",input:c,key:p,value:c[p]}]})}else wn(this,"type",r,i);return r}})}function St(e,t,s){const r=e["~run"]({value:t},Mv());if(r.issues)throw new YI(r.issues);return r.value}function Xt(...e){return En({...e[0],pipe:e,"~run"(t,s){for(const r of e)if(r.kind!=="metadata"){if(t.issues&&(r.kind==="schema"||r.kind==="transformation")){t.typed=!1;break}(!t.issues||!s.abortEarly&&!s.abortPipeEarly)&&(t=r["~run"](t,s))}return t}})}function JI(e,t,s){const r=e["~run"]({value:t},Mv());return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}function jr(e){const t=Object.keys(e).map(s=>Ne({[s]:e[s],$kind:nt(s)}));return Xt(nl(),tl(s=>DE(s,e)===void 0,({input:s,message:r})=>DE(s,e)??r),ed(KI),Ep("$kind",t))}function gk(e){return typeof e!="object"||e===null?null:"$kind"in e&&typeof e.$kind=="string"?e.$kind:Object.keys(e).find(t=>t!=="$kind")??null}function KI(e){if(typeof e!="object"||e===null||"$kind"in e)return e;const t=gk(e);return t===null?e:{...e,$kind:t}}function DE(e,t){const s=gk(e);if(!(s===null||Object.hasOwn(t,s)))return`Unsupported enum variant "${s}". Expected one of: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`}function Pf(e,t){return Xt(Ne({...t.entries,$kind:dn(nt(e))}),ed(s=>({...s,$kind:e})))}const bo=Xt(Be(),ed(e=>ye(e)),tl(da)),ss=bo,uo=Be(),nn=Xt(nr([Be(),Xt(Cn(),Hn())]),tl(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),yk=Xt(Cn(),Hn(),tl(e=>e>=0&&e<2**32,"Invalid u32")),fi=Ne({objectId:bo,version:nn,digest:Be()}),Ut=nr([Pf("GasCoin",Ne({GasCoin:nt(!0)})),Pf("Input",Ne({Input:Xt(Cn(),Hn()),type:dn(nr([nt("pure"),nt("object"),nt("withdrawal")]))})),Pf("Result",Ne({Result:Xt(Cn(),Hn())})),Pf("NestedResult",Ne({NestedResult:zv([Xt(Cn(),Hn()),Xt(Cn(),Hn())])}))]),QI=Ne({budget:It(nn),price:It(nn),owner:It(bo),payment:It(ct(fi))}),Uy=nr([Ne({$kind:nt("address")}),Ne({$kind:nt("bool")}),Ne({$kind:nt("u8")}),Ne({$kind:nt("u16")}),Ne({$kind:nt("u32")}),Ne({$kind:nt("u64")}),Ne({$kind:nt("u128")}),Ne({$kind:nt("u256")}),Ne({$kind:nt("unknown")}),Ne({$kind:nt("vector"),vector:Dy(()=>Uy)}),Ne({$kind:nt("datatype"),datatype:Ne({typeName:Be(),typeParameters:ct(Dy(()=>Uy))})}),Ne({$kind:nt("typeParameter"),index:Xt(Cn(),Hn())})]),eR=Ne({reference:It(nr([nt("mutable"),nt("immutable"),nt("unknown")])),body:Uy}),tR=Ne({package:ss,module:Be(),function:Be(),typeArguments:ct(Be()),arguments:ct(Ut),_argumentTypes:dn(It(ct(eR)))}),nR=Ne({name:Be(),inputs:Du(Be(),nr([Ut,ct(Ut)])),data:Du(Be(),nl())}),sR=jr({MoveCall:tR,TransferObjects:Ne({objects:ct(Ut),address:Ut}),SplitCoins:Ne({coin:Ut,amounts:ct(Ut)}),MergeCoins:Ne({destination:Ut,sources:ct(Ut)}),Publish:Ne({modules:ct(uo),dependencies:ct(ss)}),MakeMoveVec:Ne({type:It(Be()),elements:ct(Ut)}),Upgrade:Ne({modules:ct(uo),dependencies:ct(ss),package:ss,ticket:Ut}),$Intent:nR}),vk=jr({ImmOrOwnedObject:fi,SharedObject:Ne({objectId:ss,initialSharedVersion:nn,mutable:lo()}),Receiving:fi}),rR=jr({MaxAmountU64:nn}),aR=jr({Balance:Be()}),iR=jr({Sender:nt(!0),Sponsor:nt(!0),SenderAllowance:Ne({funder:bo,allowance:ss})}),bk=Ne({reservation:rR,typeArg:aR,withdrawFrom:iR}),oR=jr({Object:vk,Pure:Ne({bytes:uo}),UnresolvedPure:Ne({value:nl()}),UnresolvedObject:Ne({objectId:ss,version:dn(It(nn)),digest:dn(It(Be())),initialSharedVersion:dn(It(nn)),mutable:dn(It(lo()))}),FundsWithdrawal:bk}),UE=jr({Object:vk,Pure:Ne({bytes:uo})}),$v=Ne({minEpoch:It(nn),maxEpoch:It(nn),minTimestamp:It(nn),maxTimestamp:It(nn),chain:Be(),nonce:yk}),cR=Ne({epoch:nn,proposers:Xt(ct(yk),tl(e=>e.length>0,"Allowed proposers must not be empty"))}),wk=Ne({...$v.entries,allowedProposers:It(cR)}),Tk=jr({None:nt(!0),Epoch:nn,ValidDuring:$v,Validity:wk}),ih=Ne({version:nt(2),sender:Mu(bo),expiration:Mu(Tk),gasData:QI,inputs:ct(oR),commands:ct(sR)});function Dh(e){if(typeof e=="string")return ye(e);if(e.Object)return e.Object.ImmOrOwnedObject?ye(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?ye(e.Object.Receiving.objectId):ye(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return ye(e.UnresolvedObject.objectId)}function lR(e,t,s){const r=i=>{switch(i.$kind){case"Input":{const c=t.get(i.Input);if(c===void 0)throw new Error(`Input ${i.Input} not found in input mapping`);return{...i,Input:c}}case"Result":{const c=s.get(i.Result);return c!==void 0?{...i,Result:c}:i}case"NestedResult":{const c=s.get(i.NestedResult[0]);return c!==void 0?{...i,NestedResult:[c,i.NestedResult[1]]}:i}default:return i}};switch(e.$kind){case"MoveCall":e.MoveCall.arguments=e.MoveCall.arguments.map(r);break;case"TransferObjects":e.TransferObjects.objects=e.TransferObjects.objects.map(r),e.TransferObjects.address=r(e.TransferObjects.address);break;case"SplitCoins":e.SplitCoins.coin=r(e.SplitCoins.coin),e.SplitCoins.amounts=e.SplitCoins.amounts.map(r);break;case"MergeCoins":e.MergeCoins.destination=r(e.MergeCoins.destination),e.MergeCoins.sources=e.MergeCoins.sources.map(r);break;case"MakeMoveVec":e.MakeMoveVec.elements=e.MakeMoveVec.elements.map(r);break;case"Upgrade":e.Upgrade.ticket=r(e.Upgrade.ticket);break;case"$Intent":{const i=e.$Intent.inputs;e.$Intent.inputs={};for(const[c,u]of Object.entries(i))e.$Intent.inputs[c]=Array.isArray(u)?u.map(r):r(u);break}}}const BE=Ne({digest:Be(),objectId:Be(),version:nr([Xt(Cn(),Hn()),Be(),Bv()])}),uR=jr({ImmOrOwned:BE,Shared:Ne({objectId:ss,initialSharedVersion:nn,mutable:lo()}),Receiving:BE}),LE=jr({Object:uR,Pure:ct(Xt(Cn(),Hn()))});function dR(e){if(!e)return null;switch(e.$kind){case"Epoch":return{Epoch:Number(e.Epoch)};case"ValidDuring":return{ValidDuring:e.ValidDuring};case"Validity":return{Validity:e.Validity};case"None":return{None:!0};default:throw new Error(`Unknown transaction expiration: ${JSON.stringify(e)}`)}}function fR(e){if(!e)return null;if("Epoch"in e)return{Epoch:e.Epoch};if("ValidDuring"in e)return{ValidDuring:e.ValidDuring};if("Validity"in e)return{Validity:e.Validity};if("None"in e)return{None:!0};throw new Error(`Unknown transaction expiration in v1 transaction data: ${Object.keys(e).join(", ")}`)}function hR(e){const t=e.inputs.map((s,r)=>{if(s.Object)return{kind:"Input",index:r,value:{Object:s.Object.ImmOrOwnedObject?{ImmOrOwned:s.Object.ImmOrOwnedObject}:s.Object.Receiving?{Receiving:{digest:s.Object.Receiving.digest,version:s.Object.Receiving.version,objectId:s.Object.Receiving.objectId}}:{Shared:{mutable:s.Object.SharedObject.mutable,initialSharedVersion:s.Object.SharedObject.initialSharedVersion,objectId:s.Object.SharedObject.objectId}}},type:"object"};if(s.Pure)return{kind:"Input",index:r,value:{Pure:Array.from(qe(s.Pure.bytes))},type:"pure"};if(s.UnresolvedPure)return{kind:"Input",type:"pure",index:r,value:s.UnresolvedPure.value};if(s.UnresolvedObject)return{kind:"Input",type:"object",index:r,value:s.UnresolvedObject.objectId};throw new Error("Invalid input")});return{version:1,sender:e.sender??void 0,expiration:dR(e.expiration),gasConfig:{owner:e.gasData.owner??void 0,budget:e.gasData.budget??void 0,price:e.gasData.price??void 0,payment:e.gasData.payment??void 0},inputs:t,transactions:e.commands.map(s=>{if(s.MakeMoveVec)return{kind:"MakeMoveVec",type:s.MakeMoveVec.type===null?{None:!0}:{Some:co.parseFromStr(s.MakeMoveVec.type)},objects:s.MakeMoveVec.elements.map(r=>Wr(r,t))};if(s.MergeCoins)return{kind:"MergeCoins",destination:Wr(s.MergeCoins.destination,t),sources:s.MergeCoins.sources.map(r=>Wr(r,t))};if(s.MoveCall)return{kind:"MoveCall",target:`${s.MoveCall.package}::${s.MoveCall.module}::${s.MoveCall.function}`,typeArguments:s.MoveCall.typeArguments,arguments:s.MoveCall.arguments.map(r=>Wr(r,t))};if(s.Publish)return{kind:"Publish",modules:s.Publish.modules.map(r=>Array.from(qe(r))),dependencies:s.Publish.dependencies};if(s.SplitCoins)return{kind:"SplitCoins",coin:Wr(s.SplitCoins.coin,t),amounts:s.SplitCoins.amounts.map(r=>Wr(r,t))};if(s.TransferObjects)return{kind:"TransferObjects",objects:s.TransferObjects.objects.map(r=>Wr(r,t)),address:Wr(s.TransferObjects.address,t)};if(s.Upgrade)return{kind:"Upgrade",modules:s.Upgrade.modules.map(r=>Array.from(qe(r))),dependencies:s.Upgrade.dependencies,packageId:s.Upgrade.package,ticket:Wr(s.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(s)}`)})}}function Wr(e,t){if(e.$kind==="GasCoin")return{kind:"GasCoin"};if(e.$kind==="Result")return{kind:"Result",index:e.Result};if(e.$kind==="NestedResult")return{kind:"NestedResult",index:e.NestedResult[0],resultIndex:e.NestedResult[1]};if(e.$kind==="Input")return t[e.Input];throw new Error(`Invalid argument ${Object.keys(e)}`)}function pR(e){return St(ih,{version:2,sender:e.sender??null,expiration:fR(e.expiration),gasData:{owner:e.gasConfig.owner??null,budget:e.gasConfig.budget?.toString()??null,price:e.gasConfig.price?.toString()??null,payment:e.gasConfig.payment?.map(t=>({digest:t.digest,objectId:t.objectId,version:t.version.toString()}))??null},inputs:e.inputs.map(t=>{if(t.kind==="Input"){if(My(LE,t.value)){const s=St(LE,t.value);if(s.Object){if(s.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:s.Object.ImmOrOwned.objectId,version:String(s.Object.ImmOrOwned.version),digest:s.Object.ImmOrOwned.digest}}};if(s.Object.Shared)return{Object:{SharedObject:{mutable:s.Object.Shared.mutable??null,initialSharedVersion:s.Object.Shared.initialSharedVersion,objectId:s.Object.Shared.objectId}}};if(s.Object.Receiving)return{Object:{Receiving:{digest:s.Object.Receiving.digest,version:String(s.Object.Receiving.version),objectId:s.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:st(new Uint8Array(s.Pure))}}}return t.type==="object"?{UnresolvedObject:{objectId:t.value}}:{UnresolvedPure:{value:t.value}}}throw new Error("Invalid input")}),commands:e.transactions.map(t=>{switch(t.kind){case"MakeMoveVec":return{MakeMoveVec:{type:"Some"in t.type?co.tagToString(t.type.Some):null,elements:t.objects.map(s=>Xr(s))}};case"MergeCoins":return{MergeCoins:{destination:Xr(t.destination),sources:t.sources.map(s=>Xr(s))}};case"MoveCall":{const[s,r,i]=t.target.split("::");return{MoveCall:{package:s,module:r,function:i,typeArguments:t.typeArguments,arguments:t.arguments.map(c=>Xr(c))}}}case"Publish":return{Publish:{modules:t.modules.map(s=>st(Uint8Array.from(s))),dependencies:t.dependencies}};case"SplitCoins":return{SplitCoins:{coin:Xr(t.coin),amounts:t.amounts.map(s=>Xr(s))}};case"TransferObjects":return{TransferObjects:{objects:t.objects.map(s=>Xr(s)),address:Xr(t.address)}};case"Upgrade":return{Upgrade:{modules:t.modules.map(s=>st(Uint8Array.from(s))),dependencies:t.dependencies,package:t.packageId,ticket:Xr(t.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(t)}`)})})}function Xr(e){switch(e.kind){case"GasCoin":return{GasCoin:!0};case"Result":return{Result:e.index};case"NestedResult":return{NestedResult:[e.index,e.resultIndex]};case"Input":return{Input:e.index}}}function By(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const Ly=e=>e?`"${e}" `:"";function rs(e,t=""){if(typeof e!="number")throw new TypeError(Ly(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(Ly(t)+"expected integer >= 0, got "+e);return e}function Dn(e,t,s=""){if(By(e)&&(t===void 0||e.length===t))return e;t!==void 0&&rs(t,"length");const r=By(e),i=t!==void 0?` of length ${t}`:"",c=r?`length=${e.length}`:`type=${typeof e}`,u=Ly(s)+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(u):new TypeError(u)}function zE(e){return Uint8Array.from(Dn(e))}function Vv(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(rs(e.outputLen),rs(e.blockLen),e.outputLen<1||e.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const mR=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},$E=(e,t)=>{mR(e,t);const s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};function $c(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function Pv(e,t){Dn(e,void 0,"output");const s=t.outputLen;if(!(e.length>=s))throw new RangeError('"output" expected length >= '+s)}function Uh(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function $s(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function oh(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function yr(e,t){return e<<32-t|e>>>t}const Ek=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Sk(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const ea=Ek?e=>e:e=>Sk(e)>>>0;function gR(e){for(let t=0;t<e.length;t++)e[t]=Sk(e[t]);return e}const pc=Ek?e=>e:gR,_k=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",yR=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function td(e){if(Dn(e),_k)return e.toHex();let t="";for(let s=0;s<e.length;s++)t+=yR[e[s]];return t}function VE(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function Gv(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);if(_k)try{return Uint8Array.fromHex(e)}catch(i){throw i instanceof SyntaxError?new RangeError(i.message):i}const t=e.length,s=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(s);for(let i=0,c=0;i<s;i++,c+=2){const u=VE(e.charCodeAt(c)),f=VE(e.charCodeAt(c+1));if(u===void 0||f===void 0){const p=e[c]+e[c+1];throw new RangeError('hex string expected, got non-hex character "'+p+'" at index '+c)}r[i]=u*16+f}return r}function vR(e){if(typeof e!="string")throw new TypeError("string expected");const t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{$s(t)}}function PE(e,t=""){return typeof e=="string"?vR(e):Dn(e,void 0,t)}function bR(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];Dn(i),t+=i.length}const s=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const c=e[r];s.set(c,i),i+=c.length}return s}function Fv(e,t,s="opts"){return $E(e,"defaults"),t!==void 0&&$E(t,s),Object.assign(Object.create(null),e,t)}function Hv(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=Fv({},t,"info");const s=(i,c)=>e(c).update(i).digest(),r=e(void 0);return s.outputLen=r.outputLen,s.blockLen=r.blockLen,s.canXOF=r.canXOF,s.create=i=>e(i),Object.assign(s,t),Object.freeze(s)}function wR(e=32){rs(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const kk=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),TR=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Gf=BigInt(2**32-1),GE=BigInt(32);function ER(e,t=!1){return t?{h:Number(e&Gf),l:Number(e>>GE&Gf)}:{h:Number(e>>GE&Gf)|0,l:Number(e&Gf)|0}}function SR(e,t=!1){const s=e.length;let r=new Uint32Array(s),i=new Uint32Array(s);for(let c=0;c<s;c++){const{h:u,l:f}=ER(e[c],t);[r[c],i[c]]=[u,f]}return[r,i]}const Ak=e=>e/2**32|0,Ok=e=>e>>>0;function _R(e,t,s,r){const i=Ak(s),c=Ok(s);e.setUint32(t,r?c:i,r),e.setUint32(t+4,r?i:c,r)}const FE=(e,t,s)=>e>>>s,HE=(e,t,s)=>e<<32-s|t>>>s,ti=(e,t,s)=>e>>>s|t<<32-s,ni=(e,t,s)=>e<<32-s|t>>>s,bu=(e,t,s)=>e<<64-s|t>>>s-32,wu=(e,t,s)=>e>>>s-32|t<<64-s,kR=(e,t)=>t,AR=(e,t)=>e;function Ws(e,t,s,r){const i=(t>>>0)+(r>>>0);return{h:e+s+(i/2**32|0)|0,l:i|0}}const qv=(e,t,s)=>(e>>>0)+(t>>>0)+(s>>>0),Zv=(e,t,s,r)=>t+s+r+(e/2**32|0)|0,OR=(e,t,s,r)=>(e>>>0)+(t>>>0)+(s>>>0)+(r>>>0),NR=(e,t,s,r,i)=>t+s+r+i+(e/2**32|0)|0,xR=(e,t,s,r,i)=>(e>>>0)+(t>>>0)+(s>>>0)+(r>>>0)+(i>>>0),CR=(e,t,s,r,i,c)=>t+s+r+i+c+(e/2**32|0)|0;function IR(e,t,s){return e&t^~e&s}function RR(e,t,s){return e&t^e&s^t&s}class Nk{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,s,r,i){this.blockLen=t,this.outputLen=s,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=oh(this.buffer)}update(t){$c(this),Dn(t);const{view:s,buffer:r,blockLen:i}=this,c=t.length;let u=!1;for(let f=0;f<c;){const p=Math.min(i-this.pos,c-f);if(p===i){const m=oh(t);for(;i<=c-f;f+=i)this.process(m,f);u=!0;continue}r.set(f===0&&p===c?t:t.subarray(f,f+p),this.pos),this.pos+=p,f+=p,this.pos===i&&(this.process(s,0),this.pos=0,u=!0)}return this.length+=t.length,u&&this.roundClean(),this}digestInto(t){$c(this),Pv(t,this),this.finished=!0;const{buffer:s,view:r,blockLen:i,isLE:c}=this;let{pos:u}=this;s[u++]=128,s.fill(0,u),this.padOffset>i-u&&(this.process(r,0),s.fill(0)),_R(r,i-8,this.length*8,c),this.process(r,0),this.roundClean();const f=t===s?r:oh(t),p=this.outputLen,m=p/4,g=this.get();if(p%4||m>g.length)throw new Error("invalid outputLen");for(let y=0;y<m;y++)f.setUint32(4*y,g[y],c)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneIntoMeta(t){const{buffer:s,length:r,finished:i,destroyed:c,pos:u}=this;return t.destroyed=c,t.finished=i,t.length=r,t.pos=u,u&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const jR=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),MR=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),an=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Se=new Uint32Array(32);function Za(e,t,s,r,i,c){const u=i[c],f=i[c+1];let p=Se[2*e],m=Se[2*e+1],g=Se[2*t],y=Se[2*t+1],b=Se[2*s],S=Se[2*s+1],O=Se[2*r],C=Se[2*r+1];const R=qv(p,g,u);m=Zv(R,m,y,f),p=R|0;let $=C^m,x=O^p;C=kR($,x),O=AR($),{h:S,l:b}=Ws(S,b,C,O),$=y^S,x=g^b,y=ti($,x,24),g=ni($,x,24),Se[2*e]=p,Se[2*e+1]=m,Se[2*t]=g,Se[2*t+1]=y,Se[2*s]=b,Se[2*s+1]=S,Se[2*r]=O,Se[2*r+1]=C}function Ya(e,t,s,r,i,c){const u=i[c],f=i[c+1];let p=Se[2*e],m=Se[2*e+1],g=Se[2*t],y=Se[2*t+1],b=Se[2*s],S=Se[2*s+1],O=Se[2*r],C=Se[2*r+1];const R=qv(p,g,u);m=Zv(R,m,y,f),p=R|0;let $=C^m,x=O^p;C=ti($,x,16),O=ni($,x,16),{h:S,l:b}=Ws(S,b,C,O),$=y^S,x=g^b,y=bu($,x,63),g=wu($,x,63),Se[2*e]=p,Se[2*e+1]=m,Se[2*t]=g,Se[2*t+1]=y,Se[2*s]=b,Se[2*s+1]=S,Se[2*r]=O,Se[2*r+1]=C}function DR(e,t={},s,r,i){if(rs(s),e<=0||e>s)throw new Error('"dkLen" must be 1..'+s+", got "+e);const{key:c,salt:u,personalization:f}=t;if(c!==void 0&&(c.length<1||c.length>s))throw new Error('"key" expected to be undefined or of length=1..'+s);u!==void 0&&Dn(u,r,"salt"),f!==void 0&&Dn(f,i,"personalization")}class UR{buffer;buffer32;finished=!1;destroyed=!1;length=0;pos=0;blockLen;outputLen;canXOF=!1;constructor(t,s){rs(t),rs(s),this.blockLen=t,this.outputLen=s,this.buffer=new Uint8Array(t),this.buffer32=Uh(this.buffer)}update(t){$c(this),Dn(t);const{blockLen:s,buffer:r,buffer32:i}=this,c=t.length,u=t.byteOffset,f=t.buffer;for(let p=0;p<c;){this.pos===s&&(pc(i),this.compress(i,0,!1),pc(i),this.pos=0);const m=Math.min(s-this.pos,c-p),g=u+p;if(m===s&&!(g%4)&&p+m<c){const y=new Uint32Array(f,g,Math.floor((c-p)/4));pc(y);for(let b=0;p+s<c;b+=i.length,p+=s)this.length+=s,this.compress(y,b,!1);pc(y);continue}r.set(p===0&&m===c?t:t.subarray(p,p+m),this.pos),this.pos+=m,this.length+=m,p+=m}return this}digestInto(t){if($c(this),Pv(t,this),t.byteOffset&3)throw new RangeError('"output" expected 4-byte aligned byteOffset, got '+t.byteOffset);const{pos:s,buffer32:r}=this;this.finished=!0,this.buffer.fill(0,s),pc(r),this.compress(r,0,!0),pc(r);const i=this.get(),c=t===this.buffer?r:Uh(t),u=Math.floor(this.outputLen/4);for(let g=0;g<u;g++)c[g]=ea(i[g]);const f=this.outputLen%4;if(!f)return;const p=u*4,m=i[u];for(let g=0;g<f;g++)t[p+g]=m>>>8*g}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const r=t.slice(0,s);return this.destroy(),r}_cloneInto(t){const{buffer:s,length:r,finished:i,destroyed:c,outputLen:u,pos:f}=this;return t||=new this.constructor({dkLen:u}),t.set(...this.get()),t.buffer.set(s),t.destroyed=c,t.finished=i,t.length=r,t.pos=f,t.outputLen=u,t}clone(){return this._cloneInto()}}class BR extends UR{v0l=an[0]|0;v0h=an[1]|0;v1l=an[2]|0;v1h=an[3]|0;v2l=an[4]|0;v2h=an[5]|0;v3l=an[6]|0;v3h=an[7]|0;v4l=an[8]|0;v4h=an[9]|0;v5l=an[10]|0;v5h=an[11]|0;v6l=an[12]|0;v6h=an[13]|0;v7l=an[14]|0;v7h=an[15]|0;constructor(t={}){t=Fv({},t);const s=t.dkLen===void 0?64:t.dkLen;super(128,s),DR(s,t,64,16,16);let{key:r,personalization:i,salt:c}=t,u=0;if(r!==void 0&&(Dn(r,void 0,"key"),u=r.length),this.v0l^=this.outputLen|u<<8|65536|1<<24,c!==void 0){Dn(c,void 0,"salt");const f=Uh(zE(c));this.v4l^=ea(f[0]),this.v4h^=ea(f[1]),this.v5l^=ea(f[2]),this.v5h^=ea(f[3])}if(i!==void 0){Dn(i,void 0,"personalization");const f=Uh(zE(i));this.v6l^=ea(f[0]),this.v6h^=ea(f[1]),this.v7l^=ea(f[2]),this.v7h^=ea(f[3])}if(r!==void 0){const f=new Uint8Array(this.blockLen);f.set(r),this.update(f),$s(f)}}get(){let{v0l:t,v0h:s,v1l:r,v1h:i,v2l:c,v2h:u,v3l:f,v3h:p,v4l:m,v4h:g,v5l:y,v5h:b,v6l:S,v6h:O,v7l:C,v7h:R}=this;return[t,s,r,i,c,u,f,p,m,g,y,b,S,O,C,R]}set(t,s,r,i,c,u,f,p,m,g,y,b,S,O,C,R){this.v0l=t|0,this.v0h=s|0,this.v1l=r|0,this.v1h=i|0,this.v2l=c|0,this.v2h=u|0,this.v3l=f|0,this.v3h=p|0,this.v4l=m|0,this.v4h=g|0,this.v5l=y|0,this.v5h=b|0,this.v6l=S|0,this.v6h=O|0,this.v7l=C|0,this.v7h=R|0}compress(t,s,r){const{v0l:i,v0h:c,v1l:u,v1h:f,v2l:p,v2h:m,v3l:g,v3h:y,v4l:b,v4h:S,v5l:O,v5h:C,v6l:R,v6h:$,v7l:x,v7h:W}=this;Se[0]=i,Se[1]=c,Se[2]=u,Se[3]=f,Se[4]=p,Se[5]=m,Se[6]=g,Se[7]=y,Se[8]=b,Se[9]=S,Se[10]=O,Se[11]=C,Se[12]=R,Se[13]=$,Se[14]=x,Se[15]=W,Se.set(an,16);const ce=Ok(this.length),ge=Ak(this.length);Se[24]=an[8]^ce,Se[25]=an[9]^ge,r&&(Se[28]=~Se[28],Se[29]=~Se[29]);let F=0;const K=TR;for(let w=0;w<12;w++)Za(0,4,8,12,t,s+2*K[F++]),Ya(0,4,8,12,t,s+2*K[F++]),Za(1,5,9,13,t,s+2*K[F++]),Ya(1,5,9,13,t,s+2*K[F++]),Za(2,6,10,14,t,s+2*K[F++]),Ya(2,6,10,14,t,s+2*K[F++]),Za(3,7,11,15,t,s+2*K[F++]),Ya(3,7,11,15,t,s+2*K[F++]),Za(0,5,10,15,t,s+2*K[F++]),Ya(0,5,10,15,t,s+2*K[F++]),Za(1,6,11,12,t,s+2*K[F++]),Ya(1,6,11,12,t,s+2*K[F++]),Za(2,7,8,13,t,s+2*K[F++]),Ya(2,7,8,13,t,s+2*K[F++]),Za(3,4,9,14,t,s+2*K[F++]),Ya(3,4,9,14,t,s+2*K[F++]);this.v0l^=Se[0]^Se[16],this.v0h^=Se[1]^Se[17],this.v1l^=Se[2]^Se[18],this.v1h^=Se[3]^Se[19],this.v2l^=Se[4]^Se[20],this.v2h^=Se[5]^Se[21],this.v3l^=Se[6]^Se[22],this.v3h^=Se[7]^Se[23],this.v4l^=Se[8]^Se[24],this.v4h^=Se[9]^Se[25],this.v5l^=Se[10]^Se[26],this.v5h^=Se[11]^Se[27],this.v6l^=Se[12]^Se[28],this.v6h^=Se[13]^Se[29],this.v7l^=Se[14]^Se[30],this.v7h^=Se[15]^Se[31],$s(Se)}destroy(){this.destroyed=!0,$s(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Vc=Hv(e=>new BR(e));function LR(e,t){const s=Array.from(`${e}::`).map(i=>i.charCodeAt(0)),r=new Uint8Array(s.length+t.length);return r.set(s),r.set(t,s.length),Vc(r,{dkLen:32})}function qE(e){return ye(e).replace("0x","")}var Xi=class Yi{static fromKindBytes(t){const s=H.TransactionKind.parse(t).ProgrammableTransaction;if(!s)throw new Error("Unable to deserialize from bytes.");return Yi.restore({version:2,sender:null,expiration:null,gasData:{budget:null,owner:null,payment:null,price:null},inputs:s.inputs,commands:s.commands})}static fromBytes(t){const s=H.TransactionData.parse(t)?.V1,r=s.kind.ProgrammableTransaction;if(!s||!r)throw new Error("Unable to deserialize from bytes.");return Yi.restore({version:2,sender:s.sender,expiration:s.expiration,gasData:s.gasData,inputs:r.inputs,commands:r.commands})}static restore(t){return t.version===2?new Yi(St(ih,t)):new Yi(St(ih,pR(t)))}static getDigestFromBytes(t){return Ku(LR("TransactionData",t))}constructor(t){this.version=2,this.sender=t?.sender??null,this.expiration=t?.expiration??null,this.inputs=t?.inputs??[],this.commands=t?.commands??[],this.gasData=t?.gasData??{budget:null,price:null,owner:null,payment:null}}build({maxSizeBytes:t=1/0,overrides:s,onlyTransactionKind:r}={}){const i=this.inputs,c=this.commands,u={ProgrammableTransaction:{inputs:i,commands:c}};if(r)return H.TransactionKind.serialize(u,{maxSize:t}).toBytes();const f=s?.expiration??this.expiration,p=s?.sender??this.sender,m={...this.gasData,...s?.gasData};if(!p)throw new Error("Missing transaction sender");if(!m.budget)throw new Error("Missing gas budget");if(!m.payment)throw new Error("Missing gas payment");if(!m.price)throw new Error("Missing gas price");const g={sender:qE(p),expiration:f||{None:!0},gasData:{payment:m.payment,owner:qE(this.gasData.owner??p),price:BigInt(m.price),budget:BigInt(m.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:c}}};return H.TransactionData.serialize({V1:g},{maxSize:t}).toBytes()}addInput(t,s){const r=this.inputs.length;return this.inputs.push(s),{Input:r,type:t,$kind:"Input"}}getInputUses(t,s){this.mapArguments((r,i)=>(r.$kind==="Input"&&r.Input===t&&s(r,i),r))}mapCommandArguments(t,s){const r=this.commands[t];switch(r.$kind){case"MoveCall":r.MoveCall.arguments=r.MoveCall.arguments.map(c=>s(c,r,t));break;case"TransferObjects":r.TransferObjects.objects=r.TransferObjects.objects.map(c=>s(c,r,t)),r.TransferObjects.address=s(r.TransferObjects.address,r,t);break;case"SplitCoins":r.SplitCoins.coin=s(r.SplitCoins.coin,r,t),r.SplitCoins.amounts=r.SplitCoins.amounts.map(c=>s(c,r,t));break;case"MergeCoins":r.MergeCoins.destination=s(r.MergeCoins.destination,r,t),r.MergeCoins.sources=r.MergeCoins.sources.map(c=>s(c,r,t));break;case"MakeMoveVec":r.MakeMoveVec.elements=r.MakeMoveVec.elements.map(c=>s(c,r,t));break;case"Upgrade":r.Upgrade.ticket=s(r.Upgrade.ticket,r,t);break;case"$Intent":const i=r.$Intent.inputs;r.$Intent.inputs={};for(const[c,u]of Object.entries(i))r.$Intent.inputs[c]=Array.isArray(u)?u.map(f=>s(f,r,t)):s(u,r,t);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${r.$kind}`)}}mapArguments(t){for(const s of this.commands.keys())this.mapCommandArguments(s,t)}replaceCommand(t,s,r=t){if(!Array.isArray(s)){this.commands[t]=s;return}const i=s.length-1;this.commands.splice(t,1,...structuredClone(s)),this.mapArguments((c,u,f)=>{if(f<t+s.length)return c;if(typeof r!="number"&&(c.$kind==="Result"&&c.Result===t||c.$kind==="NestedResult"&&c.NestedResult[0]===t)){if(!("NestedResult"in c)||c.NestedResult[1]===0)return St(Ut,structuredClone(r));throw new Error(`Cannot replace command ${t} with a specific result type: NestedResult[${t}, ${c.NestedResult[1]}] references a nested element that cannot be mapped to the replacement result`)}switch(c.$kind){case"Result":c.Result===t&&typeof r=="number"&&(c.Result=r),c.Result>t&&(c.Result+=i);break;case"NestedResult":if(c.NestedResult[0]===t&&typeof r=="number")return{$kind:"NestedResult",NestedResult:[r,c.NestedResult[1]]};c.NestedResult[0]>t&&(c.NestedResult[0]+=i);break}return c})}replaceCommandWithTransaction(t,s,r){if(r.$kind!=="Result"&&r.$kind!=="NestedResult")throw new Error("Result must be of kind Result or NestedResult");this.insertTransaction(t,s),this.replaceCommand(t+s.commands.length,[],"Result"in r?{NestedResult:[r.Result+t,0]}:{NestedResult:[r.NestedResult[0]+t,r.NestedResult[1]]})}insertTransaction(t,s){const r=new Map,i=new Map;for(let f=0;f<s.inputs.length;f++){const p=s.inputs[f],m=Dh(p);let g=-1;if(m!==void 0&&(g=this.inputs.findIndex(y=>Dh(y)===m),g!==-1&&this.inputs[g].Object?.SharedObject&&p.Object?.SharedObject&&(this.inputs[g].Object.SharedObject.mutable=this.inputs[g].Object.SharedObject.mutable||p.Object.SharedObject.mutable)),g!==-1)r.set(f,g);else{const y=this.inputs.length;this.inputs.push(p),r.set(f,y)}}for(let f=0;f<s.commands.length;f++)i.set(f,t+f);const c=[];for(let f=0;f<s.commands.length;f++){const p=structuredClone(s.commands[f]);lR(p,r,i),c.push(p)}this.commands.splice(t,0,...c);const u=c.length;u>0&&this.mapArguments((f,p,m)=>{if(m>=t&&m<t+c.length)return f;switch(f.$kind){case"Result":f.Result>=t&&(f.Result+=u);break;case"NestedResult":f.NestedResult[0]>=t&&(f.NestedResult[0]+=u);break}return f})}getDigest(){const t=this.build({onlyTransactionKind:!1});return Yi.getDigestFromBytes(t)}snapshot(){return St(ih,this)}getData(){return this.snapshot()}shallowClone(){return new Yi({version:this.version,sender:this.sender,expiration:this.expiration,gasData:{...this.gasData},inputs:[...this.inputs],commands:[...this.commands]})}applyResolvedData(t){this.sender||(this.sender=t.sender??null),this.expiration||(this.expiration=t.expiration??null),this.gasData.budget||(this.gasData.budget=t.gasData.budget),this.gasData.owner||(this.gasData.owner=t.gasData.owner??null),this.gasData.payment||(this.gasData.payment=t.gasData.payment),this.gasData.price||(this.gasData.price=t.gasData.price);for(let s=0;s<this.inputs.length;s++){const r=this.inputs[s],i=t.inputs[s];switch(r.$kind){case"UnresolvedPure":if(i.$kind!=="Pure")throw new Error(`Expected input at index ${s} to resolve to a Pure argument, but got ${JSON.stringify(i)}`);this.inputs[s]=i;break;case"UnresolvedObject":if(i.$kind!=="Object")throw new Error(`Expected input at index ${s} to resolve to an Object argument, but got ${JSON.stringify(i)}`);if(i.Object.$kind==="ImmOrOwnedObject"||i.Object.$kind==="Receiving"){const c=r.UnresolvedObject,u=i.Object.ImmOrOwnedObject??i.Object.Receiving;if(ye(c.objectId)!==ye(u.objectId)||c.version!=null&&c.version!==u.version||c.digest!=null&&c.digest!==u.digest||c.mutable!=null||c.initialSharedVersion!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(c)} is not compatible with ${JSON.stringify(u)}`)}else if(i.Object.$kind==="SharedObject"){const c=r.UnresolvedObject,u=i.Object.SharedObject;if(ye(c.objectId)!==ye(u.objectId)||c.initialSharedVersion!=null&&c.initialSharedVersion!==u.initialSharedVersion||c.mutable!=null&&c.mutable!==u.mutable||c.version!=null||c.digest!=null)throw new Error(`Input at index ${s} did not match unresolved object. ${JSON.stringify(c)} is not compatible with ${JSON.stringify(u)}`)}else throw new Error(`Input at index ${s} resolved to an unexpected Object kind: ${JSON.stringify(i.Object)}`);this.inputs[s]=i;break}}}};const Wt={MoveCall(e){const[t,s="",r=""]="target"in e?e.target.split("::"):[e.package,e.module,e.function];return{$kind:"MoveCall",MoveCall:{package:t,module:s,function:r,typeArguments:e.typeArguments??[],arguments:e.arguments??[]}}},TransferObjects(e,t){return{$kind:"TransferObjects",TransferObjects:{objects:e.map(s=>St(Ut,s)),address:St(Ut,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:St(Ut,e),amounts:t.map(s=>St(Ut,s))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:St(Ut,e),sources:t.map(s=>St(Ut,s))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(s=>typeof s=="string"?s:st(new Uint8Array(s))),dependencies:t.map(s=>Ry(s))}}},Upgrade({modules:e,dependencies:t,package:s,ticket:r}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:st(new Uint8Array(i))),dependencies:t.map(i=>Ry(i)),package:s,ticket:St(Ut,r)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(s=>St(Ut,s))}}},Intent({name:e,inputs:t={},data:s={}}){return{$kind:"$Intent",$Intent:{name:e,inputs:Object.fromEntries(Object.entries(t).map(([r,i])=>[r,Array.isArray(i)?i.map(c=>St(Ut,c)):St(Ut,i)])),data:s}}}};function zR(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?st(e):e.toBase64()}}}const cn={Pure:zR,ObjectRef({objectId:e,digest:t,version:s}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:s,objectId:ye(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:s}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:s,objectId:ye(e)}}}},ReceivingRef({objectId:e,digest:t,version:s}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:s,objectId:ye(e)}}}},FundsWithdrawal({reservation:e,typeArg:t,withdrawFrom:s}){return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:e,typeArg:t,withdrawFrom:s}}}};BigInt(1e9);const xk="0x0000000000000000000000000000000000000000000000000000000000000001",Yv="0x0000000000000000000000000000000000000000000000000000000000000002",ch="0x0000000000000000000000000000000000000000000000000000000000000006",Bh=`${Yv}::sui::SUI`,ZE="0x0000000000000000000000000000000000000000000000000000000000000005",$R="0x0000000000000000000000000000000000000000000000000000000000000008",VR="0x0000000000000000000000000000000000000000000000000000000000000403";function Ck(e){const t=e.split("::");if(t.length!==3)throw new Error(`Invalid type name format: ${e}`);return{package:t[0],module:t[1],name:t[2]}}function PR(e){if(e.body.$kind!=="datatype")return!1;const{package:t,module:s,name:r}=Ck(e.body.datatype.typeName);return ye(t)===Yv&&s==="tx_context"&&r==="TxContext"}function zy(e){switch(e.$kind){case"address":return H.Address;case"bool":return H.Bool;case"u8":return H.U8;case"u16":return H.U16;case"u32":return H.U32;case"u64":return H.U64;case"u128":return H.U128;case"u256":return H.U256;case"vector":{if(e.vector.$kind==="u8")return H.byteVector().transform({input:s=>typeof s=="string"?new TextEncoder().encode(s):s,output:s=>s});const t=zy(e.vector);return t?H.vector(t):null}case"datatype":{const{package:t,module:s,name:r}=Ck(e.datatype.typeName),i=ye(t);if(i===xk){if(s==="ascii"&&r==="String"||s==="string"&&r==="String")return H.String;if(s==="option"&&r==="Option"){const c=zy(e.datatype.typeParameters[0]);return c?H.vector(c):null}}return i===Yv&&s==="object"&&r==="ID"?H.Address:null}case"typeParameter":case"unknown":return null}}const hi="AllowanceBalance",fa="CoinWithBalance",GR=e=>{const t=e.split(/::|<|>|,/);for(const s of t)if(s.includes(S4)&&!Ju(s))return!1;return U4(e)},FR="2.33.1",HR="/",qR={"Mvr-Source":`@mysten/sui@${FR}`};var ZR=class{#e;#t;#r;#s;constructor({cache:e,url:t,pageSize:s=50,overrides:r}){this.#e=e,this.#t=t,this.#r=s,this.#s={packages:r?.packages,types:r?.types},YR(this.#s)}get#a(){return this.#e.readSync(["#mvrPackageDataLoader",this.#t??""],()=>{const e=new IE(async s=>{if(!this.#t)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const r=await this.#o(s);return s.map(i=>r[i]??new Error(`Failed to resolve package: ${i}`))}),t=this.#s?.packages;if(t)for(const[s,r]of Object.entries(t))e.prime(s,r);return e})}get#i(){return this.#e.readSync(["#mvrTypeDataLoader",this.#t??""],()=>{const e=new IE(async s=>{if(!this.#t)throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const r=await this.#c(s);return s.map(i=>r[i]??new Error(`Failed to resolve type: ${i}`))}),t=this.#s?.types;if(t)for(const[s,r]of Object.entries(t))e.prime(s,r);return e})}async#o(e){if(e.length===0)return{};const t=jh(e,this.#r),s={};return await Promise.all(t.map(async r=>{const i=await this.#n("/v1/resolution/bulk",{names:r});if(i?.resolution)for(const c of Object.keys(i?.resolution)){const u=i.resolution[c]?.package_id;u&&(s[c]=u)}})),s}async#c(e){if(e.length===0)return{};const t=jh(e,this.#r),s={};return await Promise.all(t.map(async r=>{const i=await this.#n("/v1/struct-definition/bulk",{types:r});if(i?.resolution)for(const c of Object.keys(i?.resolution)){const u=i.resolution[c]?.type_tag;u&&(s[c]=u)}})),s}async#n(e,t){if(!this.#t)throw new Error("MVR Api URL is not set for the current client");const s=await fetch(`${this.#t}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...qR},body:JSON.stringify(t)});if(!s.ok){const r=await s.json().catch(()=>({}));throw new Error(`Failed to resolve types: ${r?.message}`)}return s.json()}async resolvePackage({package:e,signal:t}){return t?.throwIfAborted(),ys(e)?{package:await lh(this.#a.load(e),t)}:{package:e}}async resolveType({type:e,signal:t}){if(t?.throwIfAborted(),!ys(e))return{type:e};const s=[...Lh(e)],r=await lh(this.#i.loadMany(s),t),i={};for(let c=0;c<s.length;c++){const u=r[c];if(u instanceof Error)throw u;i[s[c]]=u}return{type:zh(e,i)}}async resolve({types:e=[],packages:t=[],signal:s}){s?.throwIfAborted();const r=new Set;for(const g of e??[])Lh(g,r);const i=[...r],[c,u]=await lh(Promise.all([i.length>0?this.#i.loadMany(i):[],t.length>0?this.#a.loadMany(t):[]]),s),f={...this.#s?.types};for(const[g,y]of i.entries()){const b=c[g];if(b instanceof Error)throw b;f[y]=b}const p={};for(const g of e??[])p[g]={type:zh(g,f)};const m={};for(const[g,y]of(t??[]).entries()){const b=this.#s?.packages?.[y]??u[g];if(b instanceof Error)throw b;m[y]={package:b}}return{types:p,packages:m}}};function YR(e){if(e?.packages)for(const[t,s]of Object.entries(e.packages)){if(!Ju(t))throw new Error(`Invalid package name: ${t}`);if(!da(ye(s)))throw new Error(`Invalid package ID: ${s}`)}if(e?.types)for(const[t,s]of Object.entries(e.types)){if(ws(t).typeParams.length>0)throw new Error("Type overrides must be first-level only. If you want to supply generic types, just pass each type individually.");if(!da(ws(s).address))throw new Error(`Invalid type: ${s}`)}}function Lh(e,t=new Set){if(typeof e=="string"&&!ys(e))return t;if(typeof e=="string"&&e.startsWith("vector<")&&e.endsWith(">"))return Lh(e.slice(7,-1),t);const s=Ik(e)?e:ws(e);ys(s.address)&&t.add(`${s.address}::${s.module}::${s.name}`);for(const r of s.typeParams)Lh(r,t);return t}function zh(e,t){if(typeof e=="string"&&!e.includes("::"))return e;if(typeof e=="string"&&e.startsWith("vector<")&&e.endsWith(">"))return`vector<${zh(e.slice(7,-1),t)}>`;const s=Ik(e)?e:ws(e),r=t[`${s.address}::${s.module}::${s.name}`];return De({...s,address:r?r.split("::")[0]:s.address,typeParams:s.typeParams.map(i=>zh(i,t))})}function ys(e){return e.includes(HR)||e.includes("@")||e.includes(".sui")}function lh(e,t){return t?t.aborted?Promise.reject(t.reason):new Promise((s,r)=>{const i=()=>r(t.reason);t.addEventListener("abort",i,{once:!0}),e.then(s,r).finally(()=>{t.removeEventListener("abort",i)})}):e}function Ik(e){return typeof e=="object"&&"address"in e&&"module"in e&&"name"in e&&"typeParams"in e}function WR(e){const t=new Set,s=new Set;for(const r of e.commands)switch(r.$kind){case"MakeMoveVec":r.MakeMoveVec.type&&YE([r.MakeMoveVec.type]).forEach(u=>{s.add(u)});break;case"MoveCall":const i=r.MoveCall,c=i.package.split("::")[0];if(ys(c)){if(!Ju(c))throw new Error(`Invalid package name: ${c}`);t.add(c)}YE(i.typeArguments??[]).forEach(u=>{s.add(u)});break}return{packages:[...t],types:[...s]}}function XR(e,t){for(const s of e.commands){if(s.MakeMoveVec?.type){if(!ys(s.MakeMoveVec.type))continue;if(!t.types[s.MakeMoveVec.type])throw new Error(`No resolution found for type: ${s.MakeMoveVec.type}`);s.MakeMoveVec.type=t.types[s.MakeMoveVec.type].type}const r=s.MoveCall;if(!r)continue;const i=r.package.split("::"),c=i[0];if(ys(c)&&!t.packages[c])throw new Error(`No address found for package: ${c}`);ys(c)&&(i[0]=t.packages[c].package,r.package=i.join("::"));const u=r.typeArguments;if(u){for(let f=0;f<u.length;f++)if(ys(u[f])){if(!t.types[u[f]])throw new Error(`No resolution found for type: ${u[f]}`);u[f]=t.types[u[f]].type}r.typeArguments=u}}}function YE(e){const t=new Set;for(const s of e)if(ys(s)){if(!GR(s))throw new Error(`Invalid type with names: ${s}`);t.add(s)}return t}function Rk(e){let t=!1;return e.mapArguments(s=>(s.$kind==="GasCoin"&&(t=!0),s)),t}var Wv=class extends Error{},$y=class extends Wv{constructor(e,t){super(e,{cause:t?.cause}),this.executionError=t?.executionError}},uh=class extends Wv{constructor(e,t,s){super(t,{cause:s?.cause}),this.code=e,this.reason=s?.reason??"unknown",this.objectId=s?.objectId}};const JR={notFound:e=>`Transaction ${e} not found`};var WE=class extends Wv{constructor(e,t,s){super(JR[e](t),s),this.reason=e,this.digest=t}};function Xv(e,t,s){const r=H.Address.serialize(e).toBytes(),i=H.TypeTag.serialize(t).toBytes(),c=H.u64().serialize(s.length).toBytes(),u=Vc.create({dkLen:32});return u.update(new Uint8Array([240])),u.update(r),u.update(c),u.update(s),u.update(i),`0x${kr(u.digest().slice(0,32))}`}const KR=ye("0xacc"),QR=co.parseFromStr("0x2::accumulator::Key<0x2::balance::Balance<0x2::sui::SUI>>"),e5=new Uint8Array([172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172]);function t5(e,t){const s=Qu(Xv(KR,QR,H.Address.serialize(e).toBytes()).slice(2)),r=Rh(t);if(r.length!==32)throw new Error(`Invalid chain identifier length: expected 32 bytes, got ${r.length}`);const i=new Uint8Array(32);for(let c=0;c<32;c++)i[c]=s[c]^r[c];return`0x${kr(i)}`}function n5(e,t,s,r){const i=new Uint8Array(32),c=new DataView(i.buffer);c.setBigUint64(0,e,!0);const u=Number(r);if(!Number.isSafeInteger(u)||u<0||u>4294967295)throw new Error(`Epoch ${r} out of u32 range for coin reservation digest`);return c.setUint32(8,u,!0),i.set(e5,12),St(fi,{objectId:t5(t,s),version:"0",digest:Ku(i)})}const s5=50,XE=256,r5=1000n,a5=5e10;function i5(e,t=1n){const s=r5*BigInt(t),r=BigInt(e.computationCost)+s,i=r+BigInt(e.storageCost)-BigInt(e.storageRebate);return String(i>r?i:r)}function o5(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}async function c5(e,t,s){const r=o5(t),i=!t.onlyTransactionKind&&!e.gasData.price,c=!t.onlyTransactionKind&&!e.gasData.payment,u=e.gasData.owner??e.sender,f=Rk(e);let p=0n;const m=u?ye(u):null;for(const $ of e.inputs){if($.$kind!=="FundsWithdrawal"||!m||De($.FundsWithdrawal.typeArg.Balance)!==Bh)continue;const x=$.FundsWithdrawal.withdrawFrom,W=x.SenderAllowance?x.SenderAllowance.funder:x.Sender?e.sender:u;W&&ye(W)===m&&$.FundsWithdrawal.reservation.$kind==="MaxAmountU64"&&(p+=BigInt($.FundsWithdrawal.reservation.MaxAmountU64))}const g=!t.onlyTransactionKind&&!e.expiration&&!e.gasData.budget,y=i||c&&f||g,b=c&&f||g,[,S,O,C,R]=await Promise.all([h5(e,r),y?r.core.getCurrentSystemState():null,c&&u?r.core.getBalance({owner:u}):null,c&&u?r.core.listCoins({owner:u,coinType:Bh}):null,b?r.core.getChainIdentifier():null]);if(await f5(e,r),!t.onlyTransactionKind){const $=S?.systemState??null,x=R?.chainIdentifier??null;if($&&!e.gasData.price&&(e.gasData.price=$.referenceGasPrice),await l5(e,r,g&&$&&x?jk($,x):void 0),c){if(!O||!C)throw new Error("Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.");u5({transactionData:e,balance:O,coins:C,usesGasCoin:f,withdrawals:p,gasPayer:u,chainIdentifier:x,epoch:$?.epoch??null})}!e.expiration&&e.gasData.payment?.length===0&&await d5(e,r,$,x)}return await s()}async function l5(e,t,s){if(e.gasData.budget)return;const r=await t.core.simulateTransaction({transaction:e.build({overrides:{gasData:{budget:String(a5),payment:[]},...s&&{expiration:s}}}),include:{effects:!0},doGasSelection:!1});if(r.$kind==="FailedTransaction"){const i=r.FailedTransaction.status.error??void 0;throw new $y(`Transaction resolution failed: ${i?.message??"Unknown error"}`,{cause:r,executionError:i})}e.gasData.budget=i5(r.Transaction.effects.gasUsed,e.gasData.price?String(e.gasData.price):void 0)}function u5({transactionData:e,balance:t,coins:s,usesGasCoin:r,withdrawals:i,gasPayer:c,chainIdentifier:u,epoch:f}){const p=BigInt(e.gasData.budget),m=BigInt(t.balance.addressBalance);if(p===0n||!r&&m>=p+i){e.gasData.payment=[];return}const g=s.objects.filter(S=>!e.inputs.find(O=>O.Object?.ImmOrOwnedObject?S.objectId===O.Object.ImmOrOwnedObject.objectId:!1)),y=g.map(S=>({objectId:S.objectId,digest:S.digest,version:S.version})),b=m-i;if(r&&b>0n&&u&&f)e.gasData.payment=[n5(b,c,u,f),...y.slice(0,XE-1)];else if(g.length)e.gasData.payment=y.slice(0,XE);else throw new Error("No valid gas coins found for the transaction.")}async function d5(e,t,s,r=null){const[i,c]=await Promise.all([r??t.core.getChainIdentifier().then(u=>u.chainIdentifier),s??t.core.getCurrentSystemState().then(u=>u.systemState)]);e.expiration=jk(c,i)}function jk(e,t){const s=BigInt(e.epoch);return{$kind:"ValidDuring",ValidDuring:{minEpoch:String(s),maxEpoch:String(s+1n),minTimestamp:null,maxTimestamp:null,chain:t,nonce:Math.random()*4294967296>>>0}}}async function f5(e,t){const s=e.inputs.filter(g=>g.UnresolvedObject&&!(g.UnresolvedObject.version||g.UnresolvedObject?.initialSharedVersion)),r=[...new Set(s.map(g=>Ry(g.UnresolvedObject.objectId)))],i=r.length?jh(r,s5):[],c=(await Promise.all(i.map(g=>t.core.getObjects({objectIds:g})))).flatMap(g=>g.objects),u=new Map(r.map((g,y)=>[g,c[y]])),f=Array.from(u).filter(([g,y])=>y instanceof Error).map(([g,y])=>y.message);if(f.length)throw new Error(`The following input objects are invalid: ${f.join(", ")}`);const p=c.map(g=>{if(g instanceof Error)throw new Error(`Failed to fetch object: ${g.message}`);const y=g.owner,b=y&&typeof y=="object"?y.$kind==="Shared"?y.Shared.initialSharedVersion:y.$kind==="ConsensusAddressOwner"?y.ConsensusAddressOwner.startVersion:null:null;return{objectId:g.objectId,digest:g.digest,version:g.version,initialSharedVersion:b}}),m=new Map(r.map((g,y)=>[g,p[y]]));for(const[g,y]of e.inputs.entries()){if(!y.UnresolvedObject)continue;let b;const S=ye(y.UnresolvedObject.objectId),O=m.get(S);y.UnresolvedObject.initialSharedVersion??O?.initialSharedVersion?b=cn.SharedObjectRef({objectId:S,initialSharedVersion:y.UnresolvedObject.initialSharedVersion||O?.initialSharedVersion,mutable:y.UnresolvedObject.mutable||p5(e,g)}):m5(e,g)&&(b=cn.ReceivingRef({objectId:S,digest:y.UnresolvedObject.digest??O?.digest,version:y.UnresolvedObject.version??O?.version})),e.inputs[e.inputs.indexOf(y)]=b??cn.ObjectRef({objectId:S,digest:y.UnresolvedObject.digest??O?.digest,version:y.UnresolvedObject.version??O?.version})}}async function h5(e,t){const{inputs:s,commands:r}=e,i=[],c=new Set;r.forEach(f=>{if(f.MoveCall){if(f.MoveCall._argumentTypes)return;if(f.MoveCall.arguments.map(p=>p.$kind==="Input"?e.inputs[p.Input]:null).some(p=>p?.UnresolvedPure||p?.UnresolvedObject&&typeof p?.UnresolvedObject.mutable!="boolean")){const p=`${f.MoveCall.package}::${f.MoveCall.module}::${f.MoveCall.function}`;c.add(p),i.push(f.MoveCall)}}});const u=new Map;c.size>0&&await Promise.all([...c].map(async f=>{const[p,m,g]=f.split("::"),{function:y}=await t.core.getMoveFunction({packageId:p,moduleName:m,name:g});u.set(f,y.parameters)})),i.length&&await Promise.all(i.map(async f=>{const p=u.get(`${f.package}::${f.module}::${f.function}`);p&&(f._argumentTypes=p.length>0&&PR(p.at(-1))?p.slice(0,p.length-1):p)})),r.forEach(f=>{if(!f.MoveCall)return;const p=f.MoveCall,m=`${p.package}::${p.module}::${p.function}`,g=p._argumentTypes;if(g){if(g.length!==f.MoveCall.arguments.length)throw new Error(`Incorrect number of arguments for ${m}`);g.forEach((y,b)=>{const S=p.arguments[b];if(S.$kind!=="Input")return;const O=s[S.Input];if(!O.UnresolvedPure&&!O.UnresolvedObject)return;const C=O.UnresolvedPure?.value??O.UnresolvedObject?.objectId,R=zy(y.body);if(R){S.type="pure",s[s.indexOf(O)]=cn.Pure(R.serialize(C));return}if(typeof C!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(C,null,2)}`);S.type="object";const $=O.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:C}}:O;s[S.Input]=$})}})}function p5(e,t){let s=!1;return e.getInputUses(t,(r,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const c=i.MoveCall.arguments.indexOf(r);s=i.MoveCall._argumentTypes[c].reference!=="immutable"||s}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins"||i.$kind==="TransferObjects")&&(s=!0)}),s}function m5(e,t){let s=!1;return e.getInputUses(t,(r,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const c=i.MoveCall.arguments.indexOf(r);s=y5(i.MoveCall._argumentTypes[c])||s}}),s}const g5="0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving";function y5(e){return e.body.$kind!=="datatype"?!1:e.body.datatype.typeName===g5}function Mk(e,t){if(e.inputs.some(s=>s.UnresolvedObject||s.UnresolvedPure))return!0;if(!t.onlyTransactionKind){if(!e.gasData.price||!e.gasData.budget)return!0;if(e.gasData.payment){if(e.gasData.payment.length===0&&!e.expiration)return!0}else if(!(t.assumeSufficientAddressBalances&&!Rk(e))||e.expiration?.$kind!=="ValidDuring"&&e.expiration?.$kind!=="Validity")return!0}return!1}async function v5(e,t,s){return b5(e),Mk(e,t)?(Vy(t).core?.resolveTransactionPlugin()??c5)(e,t,async()=>{await JE(e),await s()}):(!t.onlyTransactionKind&&!e.gasData.payment&&(e.gasData.payment=[]),await JE(e),s())}function JE(e){e.inputs.forEach((t,s)=>{if(t.$kind!=="Object"&&t.$kind!=="Pure"&&t.$kind!=="FundsWithdrawal")throw new Error(`Input at index ${s} has not been resolved. Expected a Pure, Object, or FundsWithdrawal input, but found ${JSON.stringify(t)}`)})}function Vy(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}function b5(e){for(const t of e.commands)switch(t.$kind){case"SplitCoins":t.SplitCoins.amounts.forEach(s=>{KE(s,H.U64,e)});break;case"TransferObjects":KE(t.TransferObjects.address,H.Address,e);break}}function KE(e,t,s){if(e.$kind!=="Input")return;const r=s.inputs[e.Input];r.$kind==="UnresolvedPure"&&(s.inputs[e.Input]=cn.Pure(t.serialize(r.UnresolvedPure.value)))}const QE=Ne({objectId:Be(),funder:dn(Be()),appType:dn(Be()),type:Be(),amount:Be(),outputKind:Lv(["coin","balance"])}),w5=H.struct("AllowanceMetadata",{id:H.Address,funder:H.Address,spender:H.option(H.Address),app:H.option(H.string())});function eS({allowance:e,amount:t,type:s="0x2::sui::SUI",outputKind:r}){H.U64.validate(t);const i=ye(typeof e=="string"?e:e.objectId),c=typeof e=="string"?{}:e;return u=>(u.addIntentResolver(hi,Uu),u.add(Wt.Intent({name:hi,inputs:{allowance:u.object(i),clock:u.object.clock(),...c.app?{permit:u.object(c.app.permit)}:{}},data:{objectId:i,funder:c.funder?ye(c.funder):void 0,appType:c.app?De(c.app.type):void 0,type:De(s),amount:String(t),outputKind:r}})))}const T5=async(e,t,s)=>{const r=new Set,i=new Set;for(const p of e.commands){if(p.$kind!=="$Intent"||p.$Intent.name!==hi)continue;const m=St(QE,p.$Intent.data);m.funder||r.add(m.objectId);for(const g of[m.type,m.appType])g&&ys(g)&&i.add(g)}const[c,u]=await Promise.all([i.size?Vy(t).core.mvr.resolve({types:[...i]}):void 0,r.size?Vy(t).core.getObjects({objectIds:[...r],include:{content:!0}}).then(p=>p.objects):[]]),f=new Map;for(const p of u){if(p instanceof Error)throw p;f.set(p.objectId,p)}for(let p=0;p<e.commands.length;p++){const m=e.commands[p];if(m.$kind!=="$Intent"||m.$Intent.name!==hi)continue;const g=St(QE,m.$Intent.data);if(ys(g.type)){const C=c?.types[g.type];if(!C)throw new Error(`No resolution found for type: ${g.type}`);g.type=De(C.type)}if(g.appType&&ys(g.appType)){const C=c?.types[g.appType];if(!C)throw new Error(`No resolution found for type: ${g.appType}`);g.appType=De(C.type)}let y=g.funder;if(!y){const C=f.get(g.objectId),R=De(`0x2::allowance::Allowance<0x2::balance::Balance<${g.type}>>`);if(!C||C.type!==R||C.owner.$kind!=="Shared")throw new Error(`Expected a shared ${R} allowance at ${g.objectId}`);const $=w5.parse(C.content);if($.app!==null&&!g.appType)throw new Error(`Allowance ${g.objectId} is app-bound; pass allowance.app with the app type and SpendPermit`);if(g.appType&&($.app===null||De($.app)!==g.appType))throw new Error(`Allowance ${g.objectId} is not bound to app ${g.appType}`);y=$.funder;const x=m.$Intent.inputs.allowance;x.$kind==="Input"&&(e.inputs[x.Input]=cn.SharedObjectRef({objectId:g.objectId,initialSharedVersion:C.owner.Shared.initialSharedVersion,mutable:!0}))}const b=m.$Intent.inputs.allowance;if(b.$kind==="Input"){const C=e.inputs[b.Input];C.Object?.SharedObject&&(C.Object.SharedObject.mutable=!0),C.UnresolvedObject&&(C.UnresolvedObject.mutable=!0)}const S=e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:g.amount},typeArg:{$kind:"Balance",Balance:g.type},withdrawFrom:{$kind:"SenderAllowance",SenderAllowance:{funder:y,allowance:g.objectId}}})),O=[Wt.MoveCall({target:g.appType?"0x2::allowance::app_balance_spend":"0x2::allowance::balance_spend",typeArguments:g.appType?[g.type,g.appType]:[g.type],arguments:[m.$Intent.inputs.allowance,...g.appType?[m.$Intent.inputs.permit]:[],S,m.$Intent.inputs.clock]})];g.outputKind==="coin"&&O.push(Wt.MoveCall({target:"0x2::coin::from_balance",typeArguments:[g.type],arguments:[{$kind:"Result",Result:p}]})),e.replaceCommand(p,O,{NestedResult:[p+O.length-1,0]}),p+=O.length-1}return s()};async function Uu(e,t,s){const r=new Set(t.intentNames??[hi,fa]),i=c=>r.has(c)&&!t.supportedIntents?.includes(c)&&e.commands.some(u=>u.$Intent?.name===c);i(hi)&&await T5(e,t,async()=>{}),i(fa)&&await _5(e,t,async()=>{}),await s()}const ra=De("0x2::sui::SUI");function E5({type:e=ra,balance:t,useGasCoin:s=!0}){let r=null;return i=>{if(r)return r;i.addIntentResolver(fa,Uu);const c=e==="gas"?e:De(e);return r=i.add(Wt.Intent({name:fa,inputs:{},data:{type:c===ra&&s?"gas":c,balance:BigInt(t),outputKind:"coin"}})),r}}function S5({type:e=ra,balance:t,useGasCoin:s=!0}){let r=null;return i=>{if(r)return r;i.addIntentResolver(fa,Uu);const c=e==="gas"?e:De(e);return r=i.add(Wt.Intent({name:fa,inputs:{},data:{type:c===ra&&s?"gas":c,balance:BigInt(t),outputKind:"balance"}})),r}}const tS=Ne({type:Be(),balance:Xt(nr([Bv(),Be(),Xt(Cn(),Hn())]),ed(e=>BigInt(e))),outputKind:dn(Lv(["coin","balance"]))});async function _5(e,t,s){const r=new Set,i=new Map,c=new Map;if(!e.sender)throw new Error("Sender must be set to resolve CoinWithBalance");if(e.commands.some(R=>R.$Intent?.name===hi))throw new Error("Resolve AllowanceBalance together with CoinWithBalance, or preserve both intents");const u=new Map;for(const R of e.inputs){if(!R.FundsWithdrawal)continue;const{withdrawFrom:$,typeArg:x,reservation:W}=R.FundsWithdrawal;if(ye($.SenderAllowance?.funder??($.Sender?e.sender:e.gasData.owner??e.sender))!==ye(e.sender))continue;const ce=De(x.Balance);u.set(ce,(u.get(ce)??0n)+BigInt(W.MaxAmountU64))}for(const[R,$]of e.commands.entries()){if($.$kind!=="$Intent"||$.$Intent.name!==fa)continue;const{type:x,balance:W,outputKind:ce}=St(tS,$.$Intent.data);if(W===0n){const ge=x==="gas"?ra:x;e.replaceCommand(R,Wt.MoveCall({target:(ce??"coin")==="balance"?"0x2::balance::zero":"0x2::coin::zero",typeArguments:[ge]}));continue}x!=="gas"&&r.add(x),i.set(x,(i.get(x)??0n)+W),c.has(x)||c.set(x,[]),c.get(x).push({balance:W,outputKind:ce??"coin"})}if(i.has("gas")&&i.has(ra))throw new Error("Cannot mix SUI CoinWithBalance intents that use the gas coin with ones that do not (useGasCoin: false). Use one or the other.");const f=new Set;for(const R of e.inputs)R.Object?.ImmOrOwnedObject&&f.add(R.Object.ImmOrOwnedObject.objectId),R.UnresolvedObject?.objectId&&f.add(R.UnresolvedObject.objectId);const p=new Map,m=new Map,g=t.client,y=t.assumeSufficientAddressBalances;if(!g&&!y)throw new Error("Client must be provided to build or serialize transactions with CoinWithBalance intents");if(y)for(const[R,$]of i)m.set(R,$);else await Promise.all([...[...r].map(async R=>{const{coins:$,addressBalance:x}=await k5({coinType:R,balance:i.get(R),client:g,owner:e.sender,usedIds:f,reserved:u.get(R)??0n});p.set(R,$),m.set(R,x)}),i.has("gas")?await g.core.getBalance({owner:e.sender,coinType:ra}).then(({balance:R})=>{m.set("gas",Dk(R.addressBalance,u.get(ra)??0n))}):null]);const b=new Map,S=new Set,O=new Map;let C=0;for(;C<e.commands.length;){const R=e.commands[C];if(R.$kind!=="$Intent"||R.$Intent.name!==fa){C++;continue}const{type:$,balance:x}=St(tS,R.$Intent.data),W=$==="gas"?ra:$,ce=i.get($),ge=m.get($)??0n,F=[];let K;const w=c.get($)??[];if(w.every(A=>A.outputKind==="balance")&&ge>=ce)F.push(Wt.MoveCall({target:"0x2::balance::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(x)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),K={$kind:"NestedResult",NestedResult:[C+F.length-1,0]};else{if(!O.has($)){const N=w,P=[];if(ge>=ce)S.add($),F.push(Wt.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(ce)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),P.push({$kind:"Result",Result:C+F.length-1});else if($==="gas")P.push({$kind:"GasCoin",GasCoin:!0});else{const k=p.get($),j=k.reduce((z,J)=>z+BigInt(J.balance),0n),D=ce>j?ce-j:0n;b.set($,j+D===ce);for(const z of k)P.push(e.addInput("object",cn.ObjectRef({objectId:z.objectId,digest:z.digest,version:z.version})));D>0n&&(S.add($),F.push(Wt.MoveCall({target:"0x2::coin::redeem_funds",typeArguments:[W],arguments:[e.addInput("withdrawal",cn.FundsWithdrawal({reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(D)},typeArg:{$kind:"Balance",Balance:W},withdrawFrom:{$kind:"Sender",Sender:!0}}))]})),P.push({$kind:"Result",Result:C+F.length-1}))}const U=P[0],q=P.slice(1);for(let k=0;k<q.length;k+=500)F.push(Wt.MergeCoins(U,q.slice(k,k+500)));const L=C+F.length;F.push(Wt.SplitCoins(U,N.map(k=>e.addInput("pure",cn.Pure(H.u64().serialize(k.balance))))));const M=[];for(let k=0;k<N.length;k++){const j={$kind:"NestedResult",NestedResult:[L,k]};N[k].outputKind==="balance"?(F.push(Wt.MoveCall({target:"0x2::coin::into_balance",typeArguments:[W],arguments:[j]})),M.push({$kind:"NestedResult",NestedResult:[C+F.length-1,0]})):M.push(j)}if($!=="gas"||S.has($)){const k=N.some(D=>D.outputKind==="balance"),j=S.has($);k||j?F.push(Wt.MoveCall({target:"0x2::coin::send_funds",typeArguments:[W],arguments:[U,e.addInput("pure",cn.Pure(H.Address.serialize(e.sender)))]})):b.get($)&&F.push(Wt.MoveCall({target:"0x2::coin::destroy_zero",typeArguments:[W],arguments:[U]}))}O.set($,{results:M,nextIntent:0})}const A=O.get($);K=A.results[A.nextIntent++]}e.replaceCommand(C,F,K),C+=F.length}return s()}async function k5({coinType:e,balance:t,client:s,owner:r,usedIds:i,reserved:c}){let u=t;const f=[],p=s.core.getBalance({owner:r,coinType:e}).then(({balance:b})=>{const S=Dk(b.addressBalance,c);return u-=S,{...b,addressBalance:String(S),balance:String(BigInt(b.balance)-c)}}),[m,g]=await Promise.all([y(),p]);if(BigInt(g.balance)<t)throw new Error(`Insufficient balance of ${e} for owner ${r}. Required: ${t}, Available: ${t-u}`);return{coins:m,balance:BigInt(g.coinBalance),addressBalance:BigInt(g.addressBalance),coinBalance:BigInt(g.coinBalance)};async function y(b=null){const{objects:S,hasNextPage:O,cursor:C}=await s.core.listCoins({owner:r,coinType:e,cursor:b});await p;for(const R of S)i.has(R.objectId)||(f.push(R),u-=BigInt(R.balance));return u>0n&&O?y(C):f}}function Dk(e,t){const s=BigInt(e)-t;if(s<0n)throw new Error(`Insufficient address balance for existing withdrawals. Required: ${t}, Available: ${e}`);return s}function Bu(e){return nr(Object.entries(e).map(([t,s])=>Ne({[t]:s})))}const Xs=Bu({GasCoin:nt(!0),Input:Xt(Cn(),Hn()),Result:Xt(Cn(),Hn()),NestedResult:zv([Xt(Cn(),Hn()),Xt(Cn(),Hn())])}),A5=Ne({budget:It(nn),price:It(nn),owner:It(bo),payment:It(ct(fi))}),O5=Ne({package:ss,module:Be(),function:Be(),typeArguments:ct(Be()),arguments:ct(Xs)}),N5=Ne({name:Be(),inputs:Du(Be(),nr([Xs,ct(Xs)])),data:Du(Be(),nl())}),x5=Bu({MoveCall:O5,TransferObjects:Ne({objects:ct(Xs),address:Xs}),SplitCoins:Ne({coin:Xs,amounts:ct(Xs)}),MergeCoins:Ne({destination:Xs,sources:ct(Xs)}),Publish:Ne({modules:ct(uo),dependencies:ct(ss)}),MakeMoveVec:Ne({type:It(Be()),elements:ct(Xs)}),Upgrade:Ne({modules:ct(uo),dependencies:ct(ss),package:ss,ticket:Xs}),$Intent:N5}),C5=Bu({Object:Bu({ImmOrOwnedObject:fi,SharedObject:Ne({objectId:ss,initialSharedVersion:nn,mutable:lo()}),Receiving:fi}),Pure:Ne({bytes:uo}),UnresolvedPure:Ne({value:nl()}),UnresolvedObject:Ne({objectId:ss,version:dn(It(nn)),digest:dn(It(Be())),initialSharedVersion:dn(It(nn)),mutable:dn(It(lo()))}),FundsWithdrawal:bk}),I5=Bu({None:nt(!0),Epoch:nn,ValidDuring:$v,Validity:wk}),R5=Ne({version:nt(2),sender:Mu(bo),expiration:Mu(I5),gasData:A5,inputs:ct(C5),commands:ct(x5),digest:dn(It(Be()))});function j5(e){function t(s){return e(s)}return t.system=s=>{const r=s?.mutable;return t(r!==void 0?cn.SharedObjectRef({objectId:ZE,initialSharedVersion:1,mutable:r}):{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ZE,initialSharedVersion:1}})},t.clock=()=>t(cn.SharedObjectRef({objectId:ch,initialSharedVersion:1,mutable:!1})),t.random=()=>t({$kind:"UnresolvedObject",UnresolvedObject:{objectId:$R,mutable:!1}}),t.denyList=s=>t({$kind:"UnresolvedObject",UnresolvedObject:{objectId:VR,mutable:s?.mutable}}),t.option=({type:s,value:r})=>i=>i.moveCall({typeArguments:[s],target:`${xk}::option::${r===null?"none":"some"}`,arguments:r===null?[]:[i.object(r)]}),t}function M5(e){function t(s,r){if(typeof s=="string")return e(Ou(s).serialize(r));if(s instanceof Uint8Array||Iy(s))return e(s);throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value")}return t.u8=s=>e(H.U8.serialize(s)),t.u16=s=>e(H.U16.serialize(s)),t.u32=s=>e(H.U32.serialize(s)),t.u64=s=>e(H.U64.serialize(s)),t.u128=s=>e(H.U128.serialize(s)),t.u256=s=>e(H.U256.serialize(s)),t.bool=s=>e(H.Bool.serialize(s)),t.string=s=>e(H.String.serialize(s)),t.address=s=>e(H.Address.serialize(s)),t.id=t.address,t.vector=(s,r)=>e(H.vector(Ou(s)).serialize(r)),t.option=(s,r)=>e(H.option(Ou(s)).serialize(r)),t}function D5(){return async(e,t,s)=>{const r=WR(e);if(r.types.length===0&&r.packages.length===0)return s();if(!t.client)throw new Error("Transaction contains MVR names but no client was provided to resolve them. Please pass a client to Transaction#build()");XR(e,await t.client.core.mvr.resolve({types:r.types,packages:r.packages})),await s()}}function nS(e){if(e.allowance!==void 0&&e.useGasCoin!==void 0)throw new Error("useGasCoin cannot be combined with allowance");const t=e.balance;if(typeof t=="string"&&!/^[0-9]+$/.test(t))throw new Error("Amount must be a non-empty string of decimal digits");if(typeof t=="number"&&!Number.isSafeInteger(t))throw new Error("Amount must be a safe integer; use bigint or a string for larger amounts");return BigInt(t)}function z0(e,t=1/0){const s={$kind:"Result",get Result(){return typeof e=="function"?e():e}},r=[],i=c=>r[c]??={$kind:"NestedResult",get NestedResult(){return[typeof e=="function"?e():e,c]}};return new Proxy(s,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(c,u){if(u in c)return Reflect.get(c,u);if(u===Symbol.iterator)return function*(){let p=0;for(;p<t;)yield i(p),p++};if(typeof u=="symbol")return;const f=parseInt(u,10);if(!(Number.isNaN(f)||f<0))return i(f)}})}const U5=Symbol.for("@mysten/transaction");var Zn=class dh{#e;#t;#r=new Map;#s=[];#a=[];#i=new Set;#o=new Set;#c=new Map;static fromKind(t){const s=new dh;return s.#n=Xi.fromKindBytes(typeof t=="string"?qe(t):t),s.#s=s.#n.inputs.slice(),s.#a=s.#n.commands.slice(),s.#i=new Set(s.#a.map((r,i)=>i)),s}static from(t,s={}){const r=new dh;typeof t=="object"&&"getData"in t?r.#n=Xi.restore(t.getData()):typeof t!="string"||!t.startsWith("{")?r.#n=Xi.fromBytes(typeof t=="string"?qe(t):t):r.#n=Xi.restore(JSON.parse(t)),r.#s=r.#n.inputs.slice(),r.#a=r.#n.commands.slice(),r.#i=new Set(r.#a.map((c,u)=>u));const i=new Map([[fa,Uu],[hi,Uu],...Object.entries(s.intentResolvers??{})]);if(!r.isPreparedForSerialization({supportedIntents:[...i.keys()]}))throw new Error("Transaction has unresolved intents or async thunks. Provide resolvers for any custom intents via the `intentResolvers` option, or call `prepareForSerialization` before copying.");for(const[c,u]of i)r.addIntentResolver(c,u);return r}addSerializationPlugin(t){this.#e.push(t)}addBuildPlugin(t){this.#t.push(t)}addIntentResolver(t,s){if(this.#r.has(t)&&this.#r.get(t)!==s)throw new Error(`Intent resolver for ${t} already exists`);this.#r.set(t,s)}setSender(t){this.#n.sender=t}setSenderIfNotSet(t){this.#n.sender||(this.#n.sender=t)}setExpiration(t){this.#n.expiration=t?St(Tk,t):null}setGasPrice(t){this.#n.gasData.price=String(t)}setGasBudget(t){this.#n.gasData.budget=String(t)}setGasBudgetIfNotSet(t){this.#n.gasData.budget==null&&(this.#n.gasData.budget=String(t))}setGasOwner(t){this.#n.gasData.owner=t}setGasPayment(t){this.#n.gasData.payment=t.map(s=>St(fi,s))}#n;getData(){return this.#n.snapshot()}get[U5](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:M5(t=>Iy(t)?this.#f("pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):this.#f("pure",My(UE,t)?St(UE,t):t instanceof Uint8Array?cn.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}constructor(){this.object=j5(t=>{if(typeof t=="function")return this.object(this.add(t));if(typeof t=="object"&&My(Ut,t))return t;const s=Dh(t),r=this.#n.inputs.find(i=>s===Dh(i));return r?.Object?.SharedObject&&typeof t=="object"&&t.Object?.SharedObject&&(r.Object.SharedObject.mutable=r.Object.SharedObject.mutable||t.Object.SharedObject.mutable),r?{$kind:"Input",Input:this.#n.inputs.indexOf(r),type:"object"}:this.#f("object",typeof t=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:ye(t)}}:t)}),this.#n=new Xi,this.#t=[],this.#e=[]}get gas(){return{$kind:"GasCoin",GasCoin:!0}}coin(t){const s=nS(t);return this.add(t.allowance!==void 0?eS({...t,amount:s,outputKind:"coin"}):E5({...t,balance:s}))}balance(t){const s=nS(t);return this.add(t.allowance!==void 0?eS({...t,amount:s,outputKind:"balance"}):S5({...t,balance:s}))}objectRef(...t){return this.object(cn.ObjectRef(...t))}receivingRef(...t){return this.object(cn.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(cn.SharedObjectRef(...t))}#m(){const t=new dh;return t.#n=this.#n,t.#e=this.#e,t.#t=this.#t,t.#r=this.#r,t.#o=this.#o,t.#i=new Set(this.#i),t.#c=this.#c,this.#s.push(t.#s),this.#a.push(t.#a),t}add(t){if(typeof t=="function"){if(this.#c.has(t))return this.#c.get(t);const s=this.#m(),r=t(s);if(!(r&&typeof r=="object"&&"then"in r))return this.#i=s.#i,this.#c.set(t,r),r;const i=this.#h({$kind:"$Intent",$Intent:{name:"AsyncTransactionThunk",inputs:{},data:{resultIndex:this.#n.commands.length,result:null}}});this.#o.add(Promise.resolve(r).then(u=>{i.$Intent.data.result=u}));const c=z0(()=>i.$Intent.data.resultIndex);return this.#c.set(t,c),c}else this.#h(t);return z0(this.#n.commands.length-1)}#h(t){const s=this.#n.commands.length;return this.#a.push(t),this.#i.add(s),this.#n.commands.push(t),this.#n.mapCommandArguments(s,r=>{if(r.$kind==="Result"&&!this.#i.has(r.Result))throw new Error(`Result { Result: ${r.Result} } is not available to use in the current transaction`);if(r.$kind==="NestedResult"&&!this.#i.has(r.NestedResult[0]))throw new Error(`Result { NestedResult: [${r.NestedResult[0]}, ${r.NestedResult[1]}] } is not available to use in the current transaction`);if(r.$kind==="Input"&&r.Input>=this.#n.inputs.length)throw new Error(`Input { Input: ${r.Input} } references an input that does not exist in the current transaction`);return r}),t}#f(t,s){return this.#s.push(s),this.#n.addInput(t,s)}#p(t){return Iy(t)?this.pure(t):this.#l(t)}#l(t){if(typeof t=="function"){const s=this.add(t);return typeof s=="function"?this.#l(s):St(Ut,s)}return St(Ut,t)}splitCoins(t,s){const r=Wt.SplitCoins(typeof t=="string"?this.object(t):this.#l(t),s.map(i=>typeof i=="number"||typeof i=="bigint"||typeof i=="string"?this.pure.u64(i):this.#p(i)));return this.#h(r),z0(this.#n.commands.length-1,s.length)}mergeCoins(t,s){return this.add(Wt.MergeCoins(this.object(t),s.map(r=>this.object(r))))}publish({modules:t,dependencies:s}){return this.add(Wt.Publish({modules:t,dependencies:s}))}upgrade({modules:t,dependencies:s,package:r,ticket:i}){return this.add(Wt.Upgrade({modules:t,dependencies:s,package:r,ticket:this.object(i)}))}moveCall({arguments:t,...s}){return this.add(Wt.MoveCall({...s,arguments:t?.map(r=>this.#p(r))}))}transferObjects(t,s){return this.add(Wt.TransferObjects(t.map(r=>this.object(r)),typeof s=="string"?this.pure.address(s):this.#p(s)))}makeMoveVec({type:t,elements:s}){return this.add(Wt.MakeMoveVec({type:t,elements:s.map(r=>this.object(r))}))}withdrawal(t){const s={$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:String(t.amount)},typeArg:{$kind:"Balance",Balance:t.type??"0x2::sui::SUI"},withdrawFrom:t.from==="allowance"?{$kind:"SenderAllowance",SenderAllowance:{funder:ye(t.funder),allowance:ye(t.allowance)}}:t.from==="sponsor"?{$kind:"Sponsor",Sponsor:!0}:{$kind:"Sender",Sender:!0}}};return this.#f("object",s)}serialize(){return JSON.stringify(hR(this.#n.snapshot()))}async toJSON(t={}){await this.prepareForSerialization(t);const s=this.isFullyResolved();return JSON.stringify(St(R5,s?{...this.#n.snapshot(),digest:this.#n.getDigest()}:this.#n.snapshot()),(r,i)=>typeof i=="bigint"?i.toString():i,2)}async sign(t){const{signer:s,...r}=t,i=await this.build(r);return s.signTransaction(i)}isPreparedForSerialization(t={}){return!(this.#o.size>0||this.#n.commands.some(s=>s.$Intent&&!t.supportedIntents?.includes(s.$Intent.name)))}isFullyResolved(){return!(!this.isPreparedForSerialization()||!this.#n.sender||Mk(this.#n,{}))}async build(t={}){return await this.prepareForSerialization(t),await this.#g(t),this.#n.build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await this.prepareForSerialization(t),await this.#g(t),this.#n.getDigest()}async#g(t){if(!t.onlyTransactionKind&&!this.#n.sender)throw new Error("Missing transaction sender");await this.#d([...this.#t,v5],t)}async#d(t,s){try{const r=i=>{if(i>=t.length)return()=>{};const c=t[i];return async()=>{const u=r(i+1);let f=!1,p=!1;if(await c(this.#n,s,async()=>{if(f)throw new Error(`next() was call multiple times in TransactionPlugin ${i}`);f=!0,await u(),p=!0}),!f)throw new Error(`next() was not called in TransactionPlugin ${i}`);if(!p)throw new Error(`next() was not awaited in TransactionPlugin ${i}`)}};await r(0)()}finally{this.#s=this.#n.inputs.slice(),this.#a=this.#n.commands.slice(),this.#i=new Set(this.#a.map((r,i)=>i))}}async#y(){for(;this.#o.size>0;){const t=Promise.all(this.#o);this.#o.clear(),this.#o.add(t),await t,this.#o.delete(t)}}#u(){const t=this.#n.commands,s=this.#n.inputs,r=this.#a.flat(1/0),i=this.#s.flat(1/0);if(r.length!==t.length)throw new Error("Unexpected number of commands found in transaction data");if(i.length!==s.length)throw new Error("Unexpected number of inputs found in transaction data");const c=r.filter(f=>f.$Intent?.name!=="AsyncTransactionThunk");this.#n.commands=c,this.#n.inputs=i,this.#a=c,this.#s=i,this.#i=new Set(c.map((f,p)=>p));function u(f){const p=t[f];if(p.$Intent?.name==="AsyncTransactionThunk"){const g=p.$Intent.data.result;if(g==null)throw new Error("AsyncTransactionThunk has not been resolved");return u(g.Result)}const m=c.indexOf(p);if(m===-1)throw new Error("Unable to find original index for command");return m}this.#n.mapArguments(f=>{if(f.$kind==="Input"){const p=i.indexOf(s[f.Input]);if(p===-1)throw new Error("Input has not been resolved");return{...f,Input:p}}else if(f.$kind==="Result"){const p=u(f.Result);return{...f,Result:p}}else if(f.$kind==="NestedResult"){const p=u(f.NestedResult[0]);return{...f,NestedResult:[p,f.NestedResult[1]]}}return f});for(const[f,p]of t.entries())if(p.$Intent?.name==="AsyncTransactionThunk")try{p.$Intent.data.resultIndex=u(f)}catch{}}async prepareForSerialization(t){await this.#y(),this.#u();const s=new Set;for(const c of this.#n.commands)c.$Intent&&s.add(c.$Intent.name);const r=[...this.#e],i=new Map;for(const c of s){if(t.supportedIntents?.includes(c))continue;const u=this.#r.get(c);if(!u)throw new Error(`Missing intent resolver for ${c}`);const f=i.get(u)??[];f.push(c),i.set(u,f)}for(const[c,u]of i)r.push((f,p,m)=>c(f,{...p,intentNames:u},m));r.push(D5()),await this.#d(r,t)}};const B5="…";function Uk(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${B5}${e.slice(-4)}`}function L5(e,t,s){return Xv(e,`0x2::derived_object::DerivedObjectKey<${typeof t=="string"?t:co.tagToString(t)}>`,s)}const Bk="sui:signTransactionBlock",$h="sui:signTransaction",z5="sui:signAndExecuteTransactionBlock",Py="sui:signAndExecuteTransaction",Gy="sui:signPersonalMessage";var $5=function(e,t,s,r){if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?r:s==="a"?r.call(e):r?r.value:t.get(e)},V5=function(e,t,s,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,s):i?i.value=s:t.set(e,s),s},fh;let du;const Sp=new Set;function P5(e){Nu=void 0,Sp.add(e)}function G5(e){Nu=void 0,Sp.delete(e)}const _c={};function _p(){if(du||(du=Object.freeze({register:sS,get:F5,on:H5}),typeof window>"u"))return du;const e=Object.freeze({register:sS});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(t){console.error(`wallet-standard:register-wallet event listener could not be added
|
|
8
|
-
`,t)}try{window.dispatchEvent(new q5(e))}catch(t){console.error(`wallet-standard:app-ready event could not be dispatched
|
|
9
|
-
`,t)}return du}function sS(...e){return e=e.filter(t=>!Sp.has(t)),e.length?(e.forEach(t=>P5(t)),_c.register?.forEach(t=>rS(()=>t(...e))),function(){e.forEach(s=>G5(s)),_c.unregister?.forEach(s=>rS(()=>s(...e)))}):()=>{}}let Nu;function F5(){return Nu||(Nu=[...Sp]),Nu}function H5(e,t){return _c[e]?.push(t)||(_c[e]=[t]),function(){_c[e]=_c[e]?.filter(r=>t!==r)}}function rS(e){try{e()}catch(t){console.error(t)}}class q5 extends Event{get detail(){return $5(this,fh,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),fh.set(this,void 0),V5(this,fh,t,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}fh=new WeakMap;const Z5=3834e3,Y5=3834001,W5=4001e3,X5=616e4,J5=6160001,K5=6160002;function Lk(e){return Array.isArray(e)?"%5B"+e.map(Lk).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function Q5([e,t]){return`${e}=${Lk(t)}`}function ej(e){const t=Object.entries(e).map(Q5).join("&");return btoa(t)}var aS;(function(e){e[e.EscapeSequence=0]="EscapeSequence",e[e.Text=1]="Text",e[e.Variable=2]="Variable"})(aS||(aS={}));function tj(e,t={}){{let s=`Wallet Standard error #${e}; Decode this error by running \`npx @wallet-standard/errors decode -- ${e}`;return Object.keys(t).length&&(s+=` '${ej(t)}'`),`${s}\``}}function nj(e,t){return e instanceof Error&&e.name==="WalletStandardError"?e.context.__code===t:!1}class nd extends Error{constructor(...[t,s]){let r,i;if(s){const{cause:u,...f}=s;u&&(i={cause:u}),Object.keys(f).length>0&&(r=f)}const c=tj(t,r);super(c,i),this.context={__code:t,...r},this.name="WalletStandardError"}}function kp(...e){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)}const Jv="standard:connect",sj="standard:disconnect",Ap="standard:events";var mc=function(e,t,s,r){if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?r:s==="a"?r.call(e):r?r.value:t.get(e)},gc=function(e,t,s,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,s):i?i.value=s:t.set(e,s),s},hh,ph,mh,gh,yh,vh;class sd{get address(){return mc(this,hh,"f")}get publicKey(){return mc(this,ph,"f").slice()}get chains(){return mc(this,mh,"f").slice()}get features(){return mc(this,gh,"f").slice()}get label(){return mc(this,yh,"f")}get icon(){return mc(this,vh,"f")}constructor(t){hh.set(this,void 0),ph.set(this,void 0),mh.set(this,void 0),gh.set(this,void 0),yh.set(this,void 0),vh.set(this,void 0),new.target===sd&&Object.freeze(this),gc(this,hh,t.address,"f"),gc(this,ph,t.publicKey.slice(),"f"),gc(this,mh,t.chains.slice(),"f"),gc(this,gh,t.features.slice(),"f"),gc(this,yh,t.label,"f"),gc(this,vh,t.icon,"f")}}hh=new WeakMap,ph=new WeakMap,mh=new WeakMap,gh=new WeakMap,yh=new WeakMap,vh=new WeakMap;const rj="sui:devnet",aj="sui:testnet",ij="sui:localnet",zk="sui:mainnet",Lu=[rj,aj,ij,zk],oj=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage"];function cj(e){const t=[...Lu],s=new Set(Lu);for(const r of e??[]){const i=`sui:${r}`;s.has(i)||(s.add(i),t.push(i))}return t}function Fy(e,t,s,r,i){return{address:t,label:s,signer:e,walletAccount:new sd({address:t,label:s,publicKey:e.getPublicKey().toSuiBytes(),chains:[...Lu],features:[...oj]})}}function lj(e){return e.split(":")[1]}async function uj({type:e,signer:t,data:s,client:r}){switch(e){case"sign-personal-message":{if(!(s instanceof Uint8Array))throw new Error("sign-personal-message expects data to be a Uint8Array");const{bytes:i,signature:c}=await t.signPersonalMessage(s);return{type:e,bytes:i,signature:c}}case"sign-transaction":{if(!r)throw new Error("No client provided for sign-transaction");if(typeof s!="string")throw new Error("sign-transaction expects data to be a JSON string");const{bytes:i,signature:c}=await Zn.from(s).sign({client:r,signer:t});return{type:e,bytes:i,signature:c}}case"sign-and-execute-transaction":{if(!r)throw new Error("No client provided for sign-and-execute-transaction");if(typeof s!="string")throw new Error("sign-and-execute-transaction expects data to be a JSON string");const{bytes:i,signature:c}=await Zn.from(s).sign({client:r,signer:t}),u=await r.core.executeTransaction({transaction:qe(i),signatures:[c],include:{effects:!0}}),f=u.Transaction??u.FailedTransaction;if(!f)throw new Error("Transaction execution returned empty result");if(!f.status.success)throw new Error(f.status.error?.message??"Transaction execution failed");return{type:e,bytes:i,signature:c,digest:f.digest,effects:f.effects?.bcs?st(f.effects.bcs):""}}}}const $k="x-sui-client-protocol-version",Vk=138;function ma(e){let t=typeof e;if(t=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return t}function Vh(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let aa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Op=[];for(let e=0;e<aa.length;e++)Op[aa[e].charCodeAt(0)]=e;Op[45]=aa.indexOf("+");Op[95]=aa.indexOf("/");function Pk(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let s=new Uint8Array(t),r=0,i=0,c,u=0;for(let f=0;f<e.length;f++){if(c=Op[e.charCodeAt(f)],c===void 0)switch(e[f]){case"=":i=0;case`
|
|
10
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:u=c,i=1;break;case 1:s[r++]=u<<2|(c&48)>>4,u=c,i=2;break;case 2:s[r++]=(u&15)<<4|(c&60)>>2,u=c,i=3;break;case 3:s[r++]=(u&3)<<6|c,i=0;break}}if(i==1)throw Error("invalid base64 string.");return s.subarray(0,r)}function Gk(e){let t="",s=0,r,i=0;for(let c=0;c<e.length;c++)switch(r=e[c],s){case 0:t+=aa[r>>2],i=(r&3)<<4,s=1;break;case 1:t+=aa[i|r>>4],i=(r&15)<<2,s=2;break;case 2:t+=aa[i|r>>6],t+=aa[r&63],s=0;break}return s&&(t+=aa[i],t+="=",s==1&&(t+="=")),t}var Ph;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(s,r,i,c,u)=>{(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:c,data:u})},e.onWrite=(s,r,i)=>{for(let{no:c,wireType:u,data:f}of e.list(r))i.tag(c,u).raw(f)},e.list=(s,r)=>{if(t(s)){let i=s[e.symbol];return r?i.filter(c=>c.no==r):i}return[]},e.last=(s,r)=>e.list(s,r).slice(-1)[0];const t=s=>s&&Array.isArray(s[e.symbol])})(Ph||(Ph={}));function dj(e,t){return Object.assign(Object.assign({},e),t)}var Yt;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Yt||(Yt={}));function fj(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[e,t]}let s=this.buf[this.pos++];if(e|=(s&15)<<28,t=(s&112)>>4,(s&128)==0)return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,(i&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function $0(e,t,s){for(let c=0;c<28;c=c+7){const u=e>>>c,f=!(!(u>>>7)&&t==0),p=(f?u|128:u)&255;if(s.push(p),!f)return}const r=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(s.push((i?r|128:r)&255),!!i){for(let c=3;c<31;c=c+7){const u=t>>>c,f=!!(u>>>7),p=(f?u|128:u)&255;if(s.push(p),!f)return}s.push(t>>>31&1)}}const bh=65536*65536;function Fk(e){let t=e[0]=="-";t&&(e=e.slice(1));const s=1e6;let r=0,i=0;function c(u,f){const p=Number(e.slice(u,f));i*=s,r=r*s+p,r>=bh&&(i=i+(r/bh|0),r=r%bh)}return c(-24,-18),c(-18,-12),c(-12,-6),c(-6),[t,r,i]}function Hy(e,t){if(t>>>0<=2097151)return""+(bh*t+(e>>>0));let s=e&16777215,r=(e>>>24|t<<8)>>>0&16777215,i=t>>16&65535,c=s+r*6777216+i*6710656,u=r+i*8147497,f=i*2,p=1e7;c>=p&&(u+=Math.floor(c/p),c%=p),u>=p&&(f+=Math.floor(u/p),u%=p);function m(g,y){let b=g?String(g):"";return y?"0000000".slice(b.length)+b:b}return m(f,0)+m(u,f)+m(c,1)}function iS(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let s=0;s<9;s++)t.push(e&127|128),e=e>>7;t.push(1)}}function hj(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let s=5;(e&128)!==0&&s<10;s++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}let Ct;function pj(){const e=new DataView(new ArrayBuffer(8));Ct=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}pj();function Hk(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const qk=/^-?[0-9]+$/,Gh=4294967296,Ff=2147483648;class Zk{constructor(t,s){this.lo=t|0,this.hi=s|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*Gh+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class Un extends Zk{static from(t){if(Ct)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=Ct.C(t);case"number":if(t===0)return this.ZERO;t=Ct.C(t);case"bigint":if(!t)return this.ZERO;if(t<Ct.UMIN)throw new Error("signed value for ulong");if(t>Ct.UMAX)throw new Error("ulong too large");return Ct.V.setBigUint64(0,t,!0),new Un(Ct.V.getInt32(0,!0),Ct.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!qk.test(t))throw new Error("string is no integer");let[s,r,i]=Fk(t);if(s)throw new Error("signed value for ulong");return new Un(r,i);case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new Un(t,t/Gh)}throw new Error("unknown value "+typeof t)}toString(){return Ct?this.toBigInt().toString():Hy(this.lo,this.hi)}toBigInt(){return Hk(Ct),Ct.V.setInt32(0,this.lo,!0),Ct.V.setInt32(4,this.hi,!0),Ct.V.getBigUint64(0,!0)}}Un.ZERO=new Un(0,0);class Ot extends Zk{static from(t){if(Ct)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=Ct.C(t);case"number":if(t===0)return this.ZERO;t=Ct.C(t);case"bigint":if(!t)return this.ZERO;if(t<Ct.MIN)throw new Error("signed long too small");if(t>Ct.MAX)throw new Error("signed long too large");return Ct.V.setBigInt64(0,t,!0),new Ot(Ct.V.getInt32(0,!0),Ct.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!qk.test(t))throw new Error("string is no integer");let[s,r,i]=Fk(t);if(s){if(i>Ff||i==Ff&&r!=0)throw new Error("signed long too small")}else if(i>=Ff)throw new Error("signed long too large");let c=new Ot(r,i);return s?c.negate():c;case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new Ot(t,t/Gh):new Ot(-t,-t/Gh).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&Ff)!==0}negate(){let t=~this.hi,s=this.lo;return s?s=~s+1:t+=1,new Ot(s,t)}toString(){if(Ct)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+Hy(t.lo,t.hi)}return Hy(this.lo,this.hi)}toBigInt(){return Hk(Ct),Ct.V.setInt32(0,this.lo,!0),Ct.V.setInt32(4,this.hi,!0),Ct.V.getBigInt64(0,!0)}}Ot.ZERO=new Ot(0,0);const oS={readUnknownField:!0,readerFactory:e=>new gj(e)};function mj(e){return e?Object.assign(Object.assign({},oS),e):oS}class gj{constructor(t,s){this.varint64=fj,this.uint32=hj,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=s??new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),s=t>>>3,r=t&7;if(s<=0||r<0||r>5)throw new Error("illegal tag: field no "+s+" wire type "+r);return[s,r]}skip(t){let s=this.pos;switch(t){case Yt.Varint:for(;this.buf[this.pos++]&128;);break;case Yt.Bit64:this.pos+=4;case Yt.Bit32:this.pos+=4;break;case Yt.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Yt.StartGroup:let i;for(;(i=this.tag()[1])!==Yt.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(s,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return new Ot(...this.varint64())}uint64(){return new Un(...this.varint64())}sint64(){let[t,s]=this.varint64(),r=-(t&1);return t=(t>>>1|(s&1)<<31)^r,s=s>>>1^r,new Ot(t,s)}bool(){let[t,s]=this.varint64();return t!==0||s!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new Un(this.sfixed32(),this.sfixed32())}sfixed64(){return new Ot(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),s=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(s,s+t)}string(){return this.textDecoder.decode(this.bytes())}}function Qe(e,t){if(!e)throw new Error(t)}function yj(e,t){throw new Error("Unexpected object: "+e)}const vj=34028234663852886e22,bj=-34028234663852886e22,wj=4294967295,Tj=2147483647,Ej=-2147483648;function xu(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Tj||e<Ej)throw new Error("invalid int 32: "+e)}function Fh(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>wj||e<0)throw new Error("invalid uint 32: "+e)}function Kv(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>vj||e<bj))throw new Error("invalid float 32: "+e)}const cS={writeUnknownFields:!0,writerFactory:()=>new _j};function Sj(e){return e?Object.assign(Object.assign({},cS),e):cS}class _j{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let i=0;i<this.chunks.length;i++)t+=this.chunks[i].length;let s=new Uint8Array(t),r=0;for(let i=0;i<this.chunks.length;i++)s.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],s}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),s=this.stack.pop();if(!s)throw new Error("invalid state, fork stack empty");return this.chunks=s.chunks,this.buf=s.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,s){return this.uint32((t<<3|s)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Fh(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return xu(t),iS(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let s=this.textEncoder.encode(t);return this.uint32(s.byteLength),this.raw(s)}float(t){Kv(t);let s=new Uint8Array(4);return new DataView(s.buffer).setFloat32(0,t,!0),this.raw(s)}double(t){let s=new Uint8Array(8);return new DataView(s.buffer).setFloat64(0,t,!0),this.raw(s)}fixed32(t){Fh(t);let s=new Uint8Array(4);return new DataView(s.buffer).setUint32(0,t,!0),this.raw(s)}sfixed32(t){xu(t);let s=new Uint8Array(4);return new DataView(s.buffer).setInt32(0,t,!0),this.raw(s)}sint32(t){return xu(t),t=(t<<1^t>>31)>>>0,iS(t,this.buf),this}sfixed64(t){let s=new Uint8Array(8),r=new DataView(s.buffer),i=Ot.from(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(s)}fixed64(t){let s=new Uint8Array(8),r=new DataView(s.buffer),i=Un.from(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(s)}int64(t){let s=Ot.from(t);return $0(s.lo,s.hi,this.buf),this}sint64(t){let s=Ot.from(t),r=s.hi>>31,i=s.lo<<1^r,c=(s.hi<<1|s.lo>>>31)^r;return $0(i,c,this.buf),this}uint64(t){let s=Un.from(t);return $0(s.lo,s.hi,this.buf),this}}const lS={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},uS={ignoreUnknownFields:!1};function kj(e){return e?Object.assign(Object.assign({},uS),e):uS}function Yk(e){return e?Object.assign(Object.assign({},lS),e):lS}function Aj(e,t){var s,r;let i=Object.assign(Object.assign({},e),t);return i.typeRegistry=[...(s=e?.typeRegistry)!==null&&s!==void 0?s:[],...(r=t?.typeRegistry)!==null&&r!==void 0?r:[]],i}const Wk=Symbol.for("protobuf-ts/message-type");function Hh(e){let t=!1;const s=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);i=="_"?t=!0:/\d/.test(i)?(s.push(i),t=!0):t?(s.push(i.toUpperCase()),t=!1):r==0?s.push(i.toLowerCase()):s.push(i)}return s.join("")}var ve;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(ve||(ve={}));var Er;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(Er||(Er={}));var qh;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(qh||(qh={}));function Oj(e){var t,s,r,i;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Hh(e.name),e.jsonName=(s=e.jsonName)!==null&&s!==void 0?s:Hh(e.name),e.repeat=(r=e.repeat)!==null&&r!==void 0?r:qh.NO,e.opt=(i=e.opt)!==null&&i!==void 0?i:e.repeat||e.oneof?!1:e.kind=="message",e}function Nj(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class xj{constructor(t){var s;this.fields=(s=t.fields)!==null&&s!==void 0?s:[]}prepare(){if(this.data)return;const t=[],s=[],r=[];for(let i of this.fields)if(i.oneof)r.includes(i.oneof)||(r.push(i.oneof),t.push(i.oneof),s.push(i.oneof));else switch(s.push(i.localName),i.kind){case"scalar":case"enum":(!i.opt||i.repeat)&&t.push(i.localName);break;case"message":i.repeat&&t.push(i.localName);break;case"map":t.push(i.localName);break}this.data={req:t,known:s,oneofs:Object.values(r)}}is(t,s,r=!1){if(s<0)return!0;if(t==null||typeof t!="object")return!1;this.prepare();let i=Object.keys(t),c=this.data;if(i.length<c.req.length||c.req.some(u=>!i.includes(u))||!r&&i.some(u=>!c.known.includes(u)))return!1;if(s<1)return!0;for(const u of c.oneofs){const f=t[u];if(!Nj(f))return!1;if(f.oneofKind===void 0)continue;const p=this.fields.find(m=>m.localName===f.oneofKind);if(!p||!this.field(f[f.oneofKind],p,r,s))return!1}for(const u of this.fields)if(u.oneof===void 0&&!this.field(t[u.localName],u,r,s))return!1;return!0}field(t,s,r,i){let c=s.repeat;switch(s.kind){case"scalar":return t===void 0?s.opt:c?this.scalars(t,s.T,i,s.L):this.scalar(t,s.T,s.L);case"enum":return t===void 0?s.opt:c?this.scalars(t,ve.INT32,i):this.scalar(t,ve.INT32);case"message":return t===void 0?!0:c?this.messages(t,s.T(),r,i):this.message(t,s.T(),r,i);case"map":if(typeof t!="object"||t===null)return!1;if(i<2)return!0;if(!this.mapKeys(t,s.K,i))return!1;switch(s.V.kind){case"scalar":return this.scalars(Object.values(t),s.V.T,i,s.V.L);case"enum":return this.scalars(Object.values(t),ve.INT32,i);case"message":return this.messages(Object.values(t),s.V.T(),r,i)}break}return!0}message(t,s,r,i){return r?s.isAssignable(t,i):s.is(t,i)}messages(t,s,r,i){if(!Array.isArray(t))return!1;if(i<2)return!0;if(r){for(let c=0;c<t.length&&c<i;c++)if(!s.isAssignable(t[c],i-1))return!1}else for(let c=0;c<t.length&&c<i;c++)if(!s.is(t[c],i-1))return!1;return!0}scalar(t,s,r){let i=typeof t;switch(s){case ve.UINT64:case ve.FIXED64:case ve.INT64:case ve.SFIXED64:case ve.SINT64:switch(r){case Er.BIGINT:return i=="bigint";case Er.NUMBER:return i=="number"&&!isNaN(t);default:return i=="string"}case ve.BOOL:return i=="boolean";case ve.STRING:return i=="string";case ve.BYTES:return t instanceof Uint8Array;case ve.DOUBLE:case ve.FLOAT:return i=="number"&&!isNaN(t);default:return i=="number"&&Number.isInteger(t)}}scalars(t,s,r,i){if(!Array.isArray(t))return!1;if(r<2)return!0;if(Array.isArray(t)){for(let c=0;c<t.length&&c<r;c++)if(!this.scalar(t[c],s,i))return!1}return!0}mapKeys(t,s,r){let i=Object.keys(t);switch(s){case ve.INT32:case ve.FIXED32:case ve.SFIXED32:case ve.SINT32:case ve.UINT32:return this.scalars(i.slice(0,r).map(c=>parseInt(c)),s,r);case ve.BOOL:return this.scalars(i.slice(0,r).map(c=>c=="true"?!0:c=="false"?!1:c),s,r);default:return this.scalars(i,s,r,Er.STRING)}}}function Ks(e,t){switch(t){case Er.BIGINT:return e.toBigInt();case Er.NUMBER:return e.toNumber();default:return e.toString()}}class Cj{constructor(t){this.info=t}prepare(){var t;if(this.fMap===void 0){this.fMap={};const s=(t=this.info.fields)!==null&&t!==void 0?t:[];for(const r of s)this.fMap[r.name]=r,this.fMap[r.jsonName]=r,this.fMap[r.localName]=r}}assert(t,s,r){if(!t){let i=ma(r);throw(i=="number"||i=="boolean")&&(i=r.toString()),new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${s}`)}}read(t,s,r){this.prepare();const i=[];for(const[c,u]of Object.entries(t)){const f=this.fMap[c];if(!f){if(!r.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${c}`);continue}const p=f.localName;let m;if(f.oneof){if(u===null&&(f.kind!=="enum"||f.T()[0]!=="google.protobuf.NullValue"))continue;if(i.includes(f.oneof))throw new Error(`Multiple members of the oneof group "${f.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(f.oneof),m=s[f.oneof]={oneofKind:p}}else m=s;if(f.kind=="map"){if(u===null)continue;this.assert(Vh(u),f.name,u);const g=m[p];for(const[y,b]of Object.entries(u)){this.assert(b!==null,f.name+" map value",null);let S;switch(f.V.kind){case"message":S=f.V.T().internalJsonRead(b,r);break;case"enum":if(S=this.enum(f.V.T(),b,f.name,r.ignoreUnknownFields),S===!1)continue;break;case"scalar":S=this.scalar(b,f.V.T,f.V.L,f.name);break}this.assert(S!==void 0,f.name+" map value",b);let O=y;f.K==ve.BOOL&&(O=O=="true"?!0:O=="false"?!1:O),O=this.scalar(O,f.K,Er.STRING,f.name).toString(),g[O]=S}}else if(f.repeat){if(u===null)continue;this.assert(Array.isArray(u),f.name,u);const g=m[p];for(const y of u){this.assert(y!==null,f.name,null);let b;switch(f.kind){case"message":b=f.T().internalJsonRead(y,r);break;case"enum":if(b=this.enum(f.T(),y,f.name,r.ignoreUnknownFields),b===!1)continue;break;case"scalar":b=this.scalar(y,f.T,f.L,f.name);break}this.assert(b!==void 0,f.name,u),g.push(b)}}else switch(f.kind){case"message":if(u===null&&f.T().typeName!="google.protobuf.Value"){this.assert(f.oneof===void 0,f.name+" (oneof member)",null);continue}m[p]=f.T().internalJsonRead(u,r,m[p]);break;case"enum":if(u===null)continue;let g=this.enum(f.T(),u,f.name,r.ignoreUnknownFields);if(g===!1)continue;m[p]=g;break;case"scalar":if(u===null)continue;m[p]=this.scalar(u,f.T,f.L,f.name);break}}}enum(t,s,r,i){if(t[0]=="google.protobuf.NullValue"&&Qe(s===null||s==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${r}, enum ${t[0]} only accepts null.`),s===null)return 0;switch(typeof s){case"number":return Qe(Number.isInteger(s),`Unable to parse field ${this.info.typeName}#${r}, enum can only be integral number, got ${s}.`),s;case"string":let c=s;t[2]&&s.substring(0,t[2].length)===t[2]&&(c=s.substring(t[2].length));let u=t[1][c];return typeof u>"u"&&i?!1:(Qe(typeof u=="number",`Unable to parse field ${this.info.typeName}#${r}, enum ${t[0]} has no value for "${s}".`),u)}Qe(!1,`Unable to parse field ${this.info.typeName}#${r}, cannot parse enum value from ${typeof s}".`)}scalar(t,s,r,i){let c;try{switch(s){case ve.DOUBLE:case ve.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""){c="empty string";break}if(typeof t=="string"&&t.trim().length!==t.length){c="extra whitespace";break}if(typeof t!="string"&&typeof t!="number")break;let u=Number(t);if(Number.isNaN(u)){c="not a number";break}if(!Number.isFinite(u)){c="too large or small";break}return s==ve.FLOAT&&Kv(u),u;case ve.INT32:case ve.FIXED32:case ve.SFIXED32:case ve.SINT32:case ve.UINT32:if(t===null)return 0;let f;if(typeof t=="number"?f=t:t===""?c="empty string":typeof t=="string"&&(t.trim().length!==t.length?c="extra whitespace":f=Number(t)),f===void 0)break;return s==ve.UINT32?Fh(f):xu(f),f;case ve.INT64:case ve.SFIXED64:case ve.SINT64:if(t===null)return Ks(Ot.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return Ks(Ot.from(t),r);case ve.FIXED64:case ve.UINT64:if(t===null)return Ks(Un.ZERO,r);if(typeof t!="number"&&typeof t!="string")break;return Ks(Un.from(t),r);case ve.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case ve.STRING:if(t===null)return"";if(typeof t!="string"){c="extra whitespace";break}try{encodeURIComponent(t)}catch(p){p="invalid UTF8";break}return t;case ve.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return Pk(t)}}catch(u){c=u.message}this.assert(!1,i+(c?" - "+c:""),t)}}class Ij{constructor(t){var s;this.fields=(s=t.fields)!==null&&s!==void 0?s:[]}write(t,s){const r={},i=t;for(const c of this.fields){if(!c.oneof){let m=this.field(c,i[c.localName],s);m!==void 0&&(r[s.useProtoFieldName?c.name:c.jsonName]=m);continue}const u=i[c.oneof];if(u.oneofKind!==c.localName)continue;const f=c.kind=="scalar"||c.kind=="enum"?Object.assign(Object.assign({},s),{emitDefaultValues:!0}):s;let p=this.field(c,u[c.localName],f);Qe(p!==void 0),r[s.useProtoFieldName?c.name:c.jsonName]=p}return r}field(t,s,r){let i;if(t.kind=="map"){Qe(typeof s=="object"&&s!==null);const c={};switch(t.V.kind){case"scalar":for(const[p,m]of Object.entries(s)){const g=this.scalar(t.V.T,m,t.name,!1,!0);Qe(g!==void 0),c[p.toString()]=g}break;case"message":const u=t.V.T();for(const[p,m]of Object.entries(s)){const g=this.message(u,m,t.name,r);Qe(g!==void 0),c[p.toString()]=g}break;case"enum":const f=t.V.T();for(const[p,m]of Object.entries(s)){Qe(m===void 0||typeof m=="number");const g=this.enum(f,m,t.name,!1,!0,r.enumAsInteger);Qe(g!==void 0),c[p.toString()]=g}break}(r.emitDefaultValues||Object.keys(c).length>0)&&(i=c)}else if(t.repeat){Qe(Array.isArray(s));const c=[];switch(t.kind){case"scalar":for(let p=0;p<s.length;p++){const m=this.scalar(t.T,s[p],t.name,t.opt,!0);Qe(m!==void 0),c.push(m)}break;case"enum":const u=t.T();for(let p=0;p<s.length;p++){Qe(s[p]===void 0||typeof s[p]=="number");const m=this.enum(u,s[p],t.name,t.opt,!0,r.enumAsInteger);Qe(m!==void 0),c.push(m)}break;case"message":const f=t.T();for(let p=0;p<s.length;p++){const m=this.message(f,s[p],t.name,r);Qe(m!==void 0),c.push(m)}break}(r.emitDefaultValues||c.length>0||r.emitDefaultValues)&&(i=c)}else switch(t.kind){case"scalar":i=this.scalar(t.T,s,t.name,t.opt,r.emitDefaultValues);break;case"enum":i=this.enum(t.T(),s,t.name,t.opt,r.emitDefaultValues,r.enumAsInteger);break;case"message":i=this.message(t.T(),s,t.name,r);break}return i}enum(t,s,r,i,c,u){if(t[0]=="google.protobuf.NullValue")return!c&&!i?void 0:null;if(s===void 0){Qe(i);return}if(!(s===0&&!c&&!i))return Qe(typeof s=="number"),Qe(Number.isInteger(s)),u||!t[1].hasOwnProperty(s)?s:t[2]?t[2]+t[1][s]:t[1][s]}message(t,s,r,i){return s===void 0?i.emitDefaultValues?null:void 0:t.internalJsonWrite(s,i)}scalar(t,s,r,i,c){if(s===void 0){Qe(i);return}const u=c||i;switch(t){case ve.INT32:case ve.SFIXED32:case ve.SINT32:return s===0?u?0:void 0:(xu(s),s);case ve.FIXED32:case ve.UINT32:return s===0?u?0:void 0:(Fh(s),s);case ve.FLOAT:Kv(s);case ve.DOUBLE:return s===0?u?0:void 0:(Qe(typeof s=="number"),Number.isNaN(s)?"NaN":s===Number.POSITIVE_INFINITY?"Infinity":s===Number.NEGATIVE_INFINITY?"-Infinity":s);case ve.STRING:return s===""?u?"":void 0:(Qe(typeof s=="string"),s);case ve.BOOL:return s===!1?u?!1:void 0:(Qe(typeof s=="boolean"),s);case ve.UINT64:case ve.FIXED64:Qe(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let f=Un.from(s);return f.isZero()&&!u?void 0:f.toString();case ve.INT64:case ve.SFIXED64:case ve.SINT64:Qe(typeof s=="number"||typeof s=="string"||typeof s=="bigint");let p=Ot.from(s);return p.isZero()&&!u?void 0:p.toString();case ve.BYTES:return Qe(s instanceof Uint8Array),s.byteLength?Gk(s):u?"":void 0}}}function qy(e,t=Er.STRING){switch(e){case ve.BOOL:return!1;case ve.UINT64:case ve.FIXED64:return Ks(Un.ZERO,t);case ve.INT64:case ve.SFIXED64:case ve.SINT64:return Ks(Ot.ZERO,t);case ve.DOUBLE:case ve.FLOAT:return 0;case ve.BYTES:return new Uint8Array(0);case ve.STRING:return"";default:return 0}}class Rj{constructor(t){this.info=t}prepare(){var t;if(!this.fieldNoToField){const s=(t=this.info.fields)!==null&&t!==void 0?t:[];this.fieldNoToField=new Map(s.map(r=>[r.no,r]))}}read(t,s,r,i){this.prepare();const c=i===void 0?t.len:t.pos+i;for(;t.pos<c;){const[u,f]=t.tag(),p=this.fieldNoToField.get(u);if(!p){let b=r.readUnknownField;if(b=="throw")throw new Error(`Unknown field ${u} (wire type ${f}) for ${this.info.typeName}`);let S=t.skip(f);b!==!1&&(b===!0?Ph.onRead:b)(this.info.typeName,s,u,f,S);continue}let m=s,g=p.repeat,y=p.localName;switch(p.oneof&&(m=m[p.oneof],m.oneofKind!==y&&(m=s[p.oneof]={oneofKind:y})),p.kind){case"scalar":case"enum":let b=p.kind=="enum"?ve.INT32:p.T,S=p.kind=="scalar"?p.L:void 0;if(g){let R=m[y];if(f==Yt.LengthDelimited&&b!=ve.STRING&&b!=ve.BYTES){let $=t.uint32()+t.pos;for(;t.pos<$;)R.push(this.scalar(t,b,S))}else R.push(this.scalar(t,b,S))}else m[y]=this.scalar(t,b,S);break;case"message":if(g){let R=m[y],$=p.T().internalBinaryRead(t,t.uint32(),r);R.push($)}else m[y]=p.T().internalBinaryRead(t,t.uint32(),r,m[y]);break;case"map":let[O,C]=this.mapEntry(p,t,r);m[y][O]=C;break}}}mapEntry(t,s,r){let i=s.uint32(),c=s.pos+i,u,f;for(;s.pos<c;){let[p,m]=s.tag();switch(p){case 1:t.K==ve.BOOL?u=s.bool().toString():u=this.scalar(s,t.K,Er.STRING);break;case 2:switch(t.V.kind){case"scalar":f=this.scalar(s,t.V.T,t.V.L);break;case"enum":f=s.int32();break;case"message":f=t.V.T().internalBinaryRead(s,s.uint32(),r);break}break;default:throw new Error(`Unknown field ${p} (wire type ${m}) in map entry for ${this.info.typeName}#${t.name}`)}}if(u===void 0){let p=qy(t.K);u=t.K==ve.BOOL?p.toString():p}if(f===void 0)switch(t.V.kind){case"scalar":f=qy(t.V.T,t.V.L);break;case"enum":f=0;break;case"message":f=t.V.T().create();break}return[u,f]}scalar(t,s,r){switch(s){case ve.INT32:return t.int32();case ve.STRING:return t.string();case ve.BOOL:return t.bool();case ve.DOUBLE:return t.double();case ve.FLOAT:return t.float();case ve.INT64:return Ks(t.int64(),r);case ve.UINT64:return Ks(t.uint64(),r);case ve.FIXED64:return Ks(t.fixed64(),r);case ve.FIXED32:return t.fixed32();case ve.BYTES:return t.bytes();case ve.UINT32:return t.uint32();case ve.SFIXED32:return t.sfixed32();case ve.SFIXED64:return Ks(t.sfixed64(),r);case ve.SINT32:return t.sint32();case ve.SINT64:return Ks(t.sint64(),r)}}}class jj{constructor(t){this.info=t}prepare(){if(!this.fields){const t=this.info.fields?this.info.fields.concat():[];this.fields=t.sort((s,r)=>s.no-r.no)}}write(t,s,r){this.prepare();for(const c of this.fields){let u,f,p=c.repeat,m=c.localName;if(c.oneof){const g=t[c.oneof];if(g.oneofKind!==m)continue;u=g[m],f=!0}else u=t[m],f=!1;switch(c.kind){case"scalar":case"enum":let g=c.kind=="enum"?ve.INT32:c.T;if(p)if(Qe(Array.isArray(u)),p==qh.PACKED)this.packed(s,g,c.no,u);else for(const y of u)this.scalar(s,g,c.no,y,!0);else u===void 0?Qe(c.opt):this.scalar(s,g,c.no,u,f||c.opt);break;case"message":if(p){Qe(Array.isArray(u));for(const y of u)this.message(s,r,c.T(),c.no,y)}else this.message(s,r,c.T(),c.no,u);break;case"map":Qe(typeof u=="object"&&u!==null);for(const[y,b]of Object.entries(u))this.mapEntry(s,r,c,y,b);break}}let i=r.writeUnknownFields;i!==!1&&(i===!0?Ph.onWrite:i)(this.info.typeName,t,s)}mapEntry(t,s,r,i,c){t.tag(r.no,Yt.LengthDelimited),t.fork();let u=i;switch(r.K){case ve.INT32:case ve.FIXED32:case ve.UINT32:case ve.SFIXED32:case ve.SINT32:u=Number.parseInt(i);break;case ve.BOOL:Qe(i=="true"||i=="false"),u=i=="true";break}switch(this.scalar(t,r.K,1,u,!0),r.V.kind){case"scalar":this.scalar(t,r.V.T,2,c,!0);break;case"enum":this.scalar(t,ve.INT32,2,c,!0);break;case"message":this.message(t,s,r.V.T(),2,c);break}t.join()}message(t,s,r,i,c){c!==void 0&&(r.internalBinaryWrite(c,t.tag(i,Yt.LengthDelimited).fork(),s),t.join())}scalar(t,s,r,i,c){let[u,f,p]=this.scalarInfo(s,i);(!p||c)&&(t.tag(r,u),t[f](i))}packed(t,s,r,i){if(!i.length)return;Qe(s!==ve.BYTES&&s!==ve.STRING),t.tag(r,Yt.LengthDelimited),t.fork();let[,c]=this.scalarInfo(s);for(let u=0;u<i.length;u++)t[c](i[u]);t.join()}scalarInfo(t,s){let r=Yt.Varint,i,c=s===void 0,u=s===0;switch(t){case ve.INT32:i="int32";break;case ve.STRING:u=c||!s.length,r=Yt.LengthDelimited,i="string";break;case ve.BOOL:u=s===!1,i="bool";break;case ve.UINT32:i="uint32";break;case ve.DOUBLE:r=Yt.Bit64,i="double";break;case ve.FLOAT:r=Yt.Bit32,i="float";break;case ve.INT64:u=c||Ot.from(s).isZero(),i="int64";break;case ve.UINT64:u=c||Un.from(s).isZero(),i="uint64";break;case ve.FIXED64:u=c||Un.from(s).isZero(),r=Yt.Bit64,i="fixed64";break;case ve.BYTES:u=c||!s.byteLength,r=Yt.LengthDelimited,i="bytes";break;case ve.FIXED32:r=Yt.Bit32,i="fixed32";break;case ve.SFIXED32:r=Yt.Bit32,i="sfixed32";break;case ve.SFIXED64:u=c||Ot.from(s).isZero(),r=Yt.Bit64,i="sfixed64";break;case ve.SINT32:i="sint32";break;case ve.SINT64:u=c||Ot.from(s).isZero(),i="sint64";break}return[r,i,c||u]}}function Mj(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},Wk,{value:e});for(let s of e.fields){let r=s.localName;if(!s.opt)if(s.oneof)t[s.oneof]={oneofKind:void 0};else if(s.repeat)t[r]=[];else switch(s.kind){case"scalar":t[r]=qy(s.T,s.L);break;case"enum":t[r]=0;break;case"map":t[r]={};break}}return t}function V0(e,t,s){let r,i=s,c;for(let u of e.fields){let f=u.localName;if(u.oneof){const p=i[u.oneof];if(p?.oneofKind==null)continue;if(r=p[f],c=t[u.oneof],c.oneofKind=p.oneofKind,r==null){delete c[f];continue}}else if(r=i[f],c=t,r==null)continue;switch(u.repeat&&(c[f].length=r.length),u.kind){case"scalar":case"enum":if(u.repeat)for(let m=0;m<r.length;m++)c[f][m]=r[m];else c[f]=r;break;case"message":let p=u.T();if(u.repeat)for(let m=0;m<r.length;m++)c[f][m]=p.create(r[m]);else c[f]===void 0?c[f]=p.create(r):p.mergePartial(c[f],r);break;case"map":switch(u.V.kind){case"scalar":case"enum":Object.assign(c[f],r);break;case"message":let m=u.V.T();for(let g of Object.keys(r))c[f][g]=m.create(r[g]);break}break}}}function Dj(e,t,s){if(t===s)return!0;if(!t||!s)return!1;for(let r of e.fields){let i=r.localName,c=r.oneof?t[r.oneof][i]:t[i],u=r.oneof?s[r.oneof][i]:s[i];switch(r.kind){case"enum":case"scalar":let f=r.kind=="enum"?ve.INT32:r.T;if(!(r.repeat?dS(f,c,u):Xk(f,c,u)))return!1;break;case"map":if(!(r.V.kind=="message"?fS(r.V.T(),Hf(c),Hf(u)):dS(r.V.kind=="enum"?ve.INT32:r.V.T,Hf(c),Hf(u))))return!1;break;case"message":let p=r.T();if(!(r.repeat?fS(p,c,u):p.equals(c,u)))return!1;break}}return!0}const Hf=Object.values;function Xk(e,t,s){if(t===s)return!0;if(e!==ve.BYTES)return!1;let r=t,i=s;if(r.length!==i.length)return!1;for(let c=0;c<r.length;c++)if(r[c]!=i[c])return!1;return!0}function dS(e,t,s){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!Xk(e,t[r],s[r]))return!1;return!0}function fS(e,t,s){if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!e.equals(t[r],s[r]))return!1;return!0}const Jk=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Uj=Jk[Wk]={};class Y{constructor(t,s,r){this.defaultCheckDepth=16,this.typeName=t,this.fields=s.map(Oj),this.options=r??{},Uj.value=this,this.messagePrototype=Object.create(null,Jk),this.refTypeCheck=new xj(this),this.refJsonReader=new Cj(this),this.refJsonWriter=new Ij(this),this.refBinReader=new Rj(this),this.refBinWriter=new jj(this)}create(t){let s=Mj(this);return t!==void 0&&V0(this,s,t),s}clone(t){let s=this.create();return V0(this,s,t),s}equals(t,s){return Dj(this,t,s)}is(t,s=this.defaultCheckDepth){return this.refTypeCheck.is(t,s,!1)}isAssignable(t,s=this.defaultCheckDepth){return this.refTypeCheck.is(t,s,!0)}mergePartial(t,s){V0(this,t,s)}fromBinary(t,s){let r=mj(s);return this.internalBinaryRead(r.readerFactory(t),t.byteLength,r)}fromJson(t,s){return this.internalJsonRead(t,kj(s))}fromJsonString(t,s){let r=JSON.parse(t);return this.fromJson(r,s)}toJson(t,s){return this.internalJsonWrite(t,Yk(s))}toJsonString(t,s){var r;let i=this.toJson(t,s);return JSON.stringify(i,null,(r=s?.prettySpaces)!==null&&r!==void 0?r:0)}toBinary(t,s){let r=Sj(s);return this.internalBinaryWrite(t,r.writerFactory(),r).finish()}internalJsonRead(t,s,r){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let i=r??this.create();return this.refJsonReader.read(t,i,s),i}throw new Error(`Unable to parse message ${this.typeName} from JSON ${ma(t)}.`)}internalJsonWrite(t,s){return this.refJsonWriter.write(t,s)}internalBinaryWrite(t,s,r){return this.refBinWriter.write(t,s,r),s}internalBinaryRead(t,s,r,i){let c=i??this.create();return this.refBinReader.read(t,c,r,s),c}}function Bj(e,t){var s,r,i;let c=e;return c.service=t,c.localName=(s=c.localName)!==null&&s!==void 0?s:Hh(c.name),c.serverStreaming=!!c.serverStreaming,c.clientStreaming=!!c.clientStreaming,c.options=(r=c.options)!==null&&r!==void 0?r:{},c.idempotency=(i=c.idempotency)!==null&&i!==void 0?i:void 0,c}class gi{constructor(t,s,r){this.typeName=t,this.methods=s.map(i=>Bj(i,this)),this.options=r??{}}}class gt extends Error{constructor(t,s="UNKNOWN",r){super(t),this.name="RpcError",Object.setPrototypeOf(this,new.target.prototype),this.code=s,this.meta=r??{}}toString(){const t=[this.name+": "+this.message];this.code&&(t.push(""),t.push("Code: "+this.code)),this.serviceName&&this.methodName&&t.push("Method: "+this.serviceName+"/"+this.methodName);let s=Object.entries(this.meta);if(s.length){t.push(""),t.push("Meta:");for(let[r,i]of s)t.push(` ${r}: ${i}`)}return t.join(`
|
|
11
|
-
`)}}function Lj(e,t){if(!t)return e;let s={};qf(e,s),qf(t,s);for(let r of Object.keys(t)){let i=t[r];switch(r){case"jsonOptions":s.jsonOptions=Aj(e.jsonOptions,s.jsonOptions);break;case"binaryOptions":s.binaryOptions=dj(e.binaryOptions,s.binaryOptions);break;case"meta":s.meta={},qf(e.meta,s.meta),qf(t.meta,s.meta);break;case"interceptors":s.interceptors=e.interceptors?e.interceptors.concat(i):i.concat();break}}return s}function qf(e,t){if(!e)return;let s=t;for(let[r,i]of Object.entries(e))i instanceof Date?s[r]=new Date(i.getTime()):Array.isArray(i)?s[r]=i.concat():s[r]=i}var Us;(function(e){e[e.PENDING=0]="PENDING",e[e.REJECTED=1]="REJECTED",e[e.RESOLVED=2]="RESOLVED"})(Us||(Us={}));class Qa{constructor(t=!0){this._state=Us.PENDING,this._promise=new Promise((s,r)=>{this._resolve=s,this._reject=r}),t&&this._promise.catch(s=>{})}get state(){return this._state}get promise(){return this._promise}resolve(t){if(this.state!==Us.PENDING)throw new Error(`cannot resolve ${Us[this.state].toLowerCase()}`);this._resolve(t),this._state=Us.RESOLVED}reject(t){if(this.state!==Us.PENDING)throw new Error(`cannot reject ${Us[this.state].toLowerCase()}`);this._reject(t),this._state=Us.REJECTED}resolvePending(t){this._state===Us.PENDING&&this.resolve(t)}rejectPending(t){this._state===Us.PENDING&&this.reject(t)}}class zj{constructor(){this._lis={nxt:[],msg:[],err:[],cmp:[]},this._closed=!1,this._itState={q:[]}}onNext(t){return this.addLis(t,this._lis.nxt)}onMessage(t){return this.addLis(t,this._lis.msg)}onError(t){return this.addLis(t,this._lis.err)}onComplete(t){return this.addLis(t,this._lis.cmp)}addLis(t,s){return s.push(t),()=>{let r=s.indexOf(t);r>=0&&s.splice(r,1)}}clearLis(){for(let t of Object.values(this._lis))t.splice(0,t.length)}get closed(){return this._closed!==!1}notifyNext(t,s,r){Qe((t?1:0)+(s?1:0)+(r?1:0)<=1,"only one emission at a time"),t&&this.notifyMessage(t),s&&this.notifyError(s),r&&this.notifyComplete()}notifyMessage(t){Qe(!this.closed,"stream is closed"),this.pushIt({value:t,done:!1}),this._lis.msg.forEach(s=>s(t)),this._lis.nxt.forEach(s=>s(t,void 0,!1))}notifyError(t){Qe(!this.closed,"stream is closed"),this._closed=t,this.pushIt(t),this._lis.err.forEach(s=>s(t)),this._lis.nxt.forEach(s=>s(void 0,t,!1)),this.clearLis()}notifyComplete(){Qe(!this.closed,"stream is closed"),this._closed=!0,this.pushIt({value:null,done:!0}),this._lis.cmp.forEach(t=>t()),this._lis.nxt.forEach(t=>t(void 0,void 0,!0)),this.clearLis()}[Symbol.asyncIterator](){return this._closed===!0?this.pushIt({value:null,done:!0}):this._closed!==!1&&this.pushIt(this._closed),{next:()=>{let t=this._itState;Qe(t,"bad state"),Qe(!t.p,"iterator contract broken");let s=t.q.shift();return s?"value"in s?Promise.resolve(s):Promise.reject(s):(t.p=new Qa,t.p.promise)}}}pushIt(t){let s=this._itState;if(s.p){const r=s.p;Qe(r.state==Us.PENDING,"iterator contract broken"),"value"in t?r.resolve(t):r.reject(t),delete s.p}else s.q.push(t)}}var $j=function(e,t,s,r){function i(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function f(g){try{m(r.next(g))}catch(y){u(y)}}function p(g){try{m(r.throw(g))}catch(y){u(y)}}function m(g){g.done?c(g.value):i(g.value).then(f,p)}m((r=r.apply(e,t||[])).next())})};class Kk{constructor(t,s,r,i,c,u,f){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.response=c,this.status=u,this.trailers=f}then(t,s){return this.promiseFinished().then(r=>t?Promise.resolve(t(r)):r,r=>s?Promise.resolve(s(r)):Promise.reject(r))}promiseFinished(){return $j(this,void 0,void 0,function*(){let[t,s,r,i]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:t,response:s,status:r,trailers:i}})}}var Vj=function(e,t,s,r){function i(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function f(g){try{m(r.next(g))}catch(y){u(y)}}function p(g){try{m(r.throw(g))}catch(y){u(y)}}function m(g){g.done?c(g.value):i(g.value).then(f,p)}m((r=r.apply(e,t||[])).next())})};class Pj{constructor(t,s,r,i,c,u,f){this.method=t,this.requestHeaders=s,this.request=r,this.headers=i,this.responses=c,this.status=u,this.trailers=f}then(t,s){return this.promiseFinished().then(r=>t?Promise.resolve(t(r)):r,r=>s?Promise.resolve(s(r)):Promise.reject(r))}promiseFinished(){return Vj(this,void 0,void 0,function*(){let[t,s,r]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:t,status:s,trailers:r}})}}function yt(e,t,s,r,i){var c,u,f,p;if(e=="unary"){let m=(g,y,b)=>t.unary(g,y,b);for(const g of((c=r.interceptors)!==null&&c!==void 0?c:[]).filter(y=>y.interceptUnary).reverse()){const y=m;m=(b,S,O)=>g.interceptUnary(y,b,S,O)}return m(s,i,r)}if(e=="serverStreaming"){let m=(g,y,b)=>t.serverStreaming(g,y,b);for(const g of((u=r.interceptors)!==null&&u!==void 0?u:[]).filter(y=>y.interceptServerStreaming).reverse()){const y=m;m=(b,S,O)=>g.interceptServerStreaming(y,b,S,O)}return m(s,i,r)}if(e=="clientStreaming"){let m=(g,y)=>t.clientStreaming(g,y);for(const g of((f=r.interceptors)!==null&&f!==void 0?f:[]).filter(y=>y.interceptClientStreaming).reverse()){const y=m;m=(b,S)=>g.interceptClientStreaming(y,b,S)}return m(s,r)}if(e=="duplex"){let m=(g,y)=>t.duplex(g,y);for(const g of((p=r.interceptors)!==null&&p!==void 0?p:[]).filter(y=>y.interceptDuplex).reverse()){const y=m;m=(b,S)=>g.interceptDuplex(y,b,S)}return m(s,r)}yj(e)}var we;(function(e){e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.ALREADY_EXISTS=6]="ALREADY_EXISTS",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e[e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",e[e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",e[e.ABORTED=10]="ABORTED",e[e.OUT_OF_RANGE=11]="OUT_OF_RANGE",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.DATA_LOSS=15]="DATA_LOSS"})(we||(we={}));var Gj=function(e,t,s,r){function i(c){return c instanceof s?c:new s(function(u){u(c)})}return new(s||(s=Promise))(function(c,u){function f(g){try{m(r.next(g))}catch(y){u(y)}}function p(g){try{m(r.throw(g))}catch(y){u(y)}}function m(g){g.done?c(g.value):i(g.value).then(f,p)}m((r=r.apply(e,t||[])).next())})};function hS(e,t,s,r,i){if(r)for(let[c,u]of Object.entries(r))if(typeof u=="string")e.append(c,u);else for(let f of u)e.append(c,f);if(e.set("Content-Type",t==="text"?"application/grpc-web-text":"application/grpc-web+proto"),t=="text"&&e.set("Accept","application/grpc-web-text"),e.set("X-Grpc-Web","1"),typeof s=="number"){if(s<=0)throw new gt(`timeout ${s} ms exceeded`,we[we.DEADLINE_EXCEEDED]);e.set("grpc-timeout",`${s}m`)}else if(s){const c=s.getTime(),u=Date.now();if(c<=u)throw new gt(`deadline ${s} exceeded`,we[we.DEADLINE_EXCEEDED]);e.set("grpc-timeout",`${c-u}m`)}return e}function pS(e,t){let s=new Uint8Array(5+e.length);s[0]=er.DATA;for(let r=e.length,i=4;i>0;i--)s[i]=r%256,r>>>=8;return s.set(e,5),t==="binary"?s:Gk(s)}function Zy(e,t,s){if(arguments.length===1){let p=e,m;try{m=p.type}catch{}switch(m){case"error":case"opaque":case"opaqueredirect":throw new gt(`fetch response type ${p.type}`,we[we.UNKNOWN])}return Zy(Zj(p.headers),p.status,p.statusText)}let r=e,i=t>=200&&t<300,c=eA(r),[u,f]=Qk(r);return(u===void 0||u===we.OK)&&!i&&(u=Yj(t),f=s),[u,f,c]}function mS(e){let t=qj(e),[s,r]=Qk(t),i=eA(t);return[s??we.OK,r,i]}var er;(function(e){e[e.DATA=0]="DATA",e[e.TRAILER=128]="TRAILER"})(er||(er={}));function gS(e,t,s){return Gj(this,void 0,void 0,function*(){let r,i="",c=new Uint8Array(0),u=Hj(t);if(Fj(e)){let f=e.getReader();r={next:()=>f.read()}}else r=e[Symbol.asyncIterator]();for(;;){let f=yield r.next();if(f.value!==void 0){if(u==="text"){for(let m=0;m<f.value.length;m++)i+=String.fromCharCode(f.value[m]);let p=i.length-i.length%4;if(p===0)continue;c=yS(c,Pk(i.substring(0,p))),i=i.substring(p)}else c=yS(c,f.value);for(;c.length>=5&&c[0]===er.DATA;){let p=0;for(let m=1;m<5;m++)p=(p<<8)+c[m];if(c.length-5>=p)s(er.DATA,c.subarray(5,5+p)),c=c.subarray(5+p);else break}}if(f.done){if(c.length===0)break;if(c[0]!==er.TRAILER||c.length<5)throw new gt("premature EOF",we[we.DATA_LOSS]);s(er.TRAILER,c.subarray(5));break}}})}const Fj=e=>typeof e.getReader=="function";function yS(e,t){let s=new Uint8Array(e.length+t.length);return s.set(e),s.set(t,e.length),s}function Hj(e){switch(e){case"application/grpc-web-text":case"application/grpc-web-text+proto":return"text";case"application/grpc-web":case"application/grpc-web+proto":return"binary";case void 0:case null:throw new gt("missing response content type",we[we.INTERNAL]);default:throw new gt("unexpected response content type: "+e,we[we.INTERNAL])}}function Qk(e){let t,s,r=e["grpc-message"];if(r!==void 0){if(Array.isArray(r))return[we.INTERNAL,"invalid grpc-web message"];s=r}let i=e["grpc-status"];if(i!==void 0){if(Array.isArray(i))return[we.INTERNAL,"invalid grpc-web status"];if(t=parseInt(i,10),we[t]===void 0)return[we.INTERNAL,"invalid grpc-web status"]}return[t,s]}function eA(e){let t={};for(let[s,r]of Object.entries(e))switch(s){case"grpc-message":case"grpc-status":case"content-type":break;default:t[s]=r}return t}function qj(e){let t={};for(let s of String.fromCharCode.apply(String,e).trim().split(`\r
|
|
12
|
-
`)){if(s=="")continue;let[r,...i]=s.split(":");const c=i.join(":").trim();r=r.trim();let u=t[r];typeof u=="string"?t[r]=[u,c]:Array.isArray(u)?u.push(c):t[r]=c}return t}function Zj(e){let t={};return e.forEach((s,r)=>{let i=t[r];typeof i=="string"?t[r]=[i,s]:Array.isArray(i)?i.push(s):t[r]=s}),t}function Yj(e){switch(e){case 200:return we.OK;case 400:return we.INVALID_ARGUMENT;case 401:return we.UNAUTHENTICATED;case 403:return we.PERMISSION_DENIED;case 404:return we.NOT_FOUND;case 409:return we.ABORTED;case 412:return we.FAILED_PRECONDITION;case 429:return we.RESOURCE_EXHAUSTED;case 499:return we.CANCELLED;case 500:return we.UNKNOWN;case 501:return we.UNIMPLEMENTED;case 503:return we.UNAVAILABLE;case 504:return we.DEADLINE_EXCEEDED;default:return we.UNKNOWN}}class Wj{constructor(t){this.defaultOptions=t}mergeOptions(t){return Lj(this.defaultOptions,t)}makeUrl(t,s){let r=s.baseUrl;return r.endsWith("/")&&(r=r.substring(0,r.length-1)),`${r}/${t.service.typeName}/${t.name}`}clientStreaming(t){const s=new gt("Client streaming is not supported by grpc-web",we[we.UNIMPLEMENTED]);throw s.methodName=t.name,s.serviceName=t.service.typeName,s}duplex(t){const s=new gt("Duplex streaming is not supported by grpc-web",we[we.UNIMPLEMENTED]);throw s.methodName=t.name,s.serviceName=t.service.typeName,s}serverStreaming(t,s,r){var i,c,u,f,p;let m=r,g=(i=m.format)!==null&&i!==void 0?i:"text",y=(c=m.fetch)!==null&&c!==void 0?c:globalThis.fetch,b=(u=m.fetchInit)!==null&&u!==void 0?u:{},S=this.makeUrl(t,m),O=t.I.toBinary(s,m.binaryOptions),C=new Qa,R=new zj,$=!0,x,W=new Qa,ce,ge=new Qa;return y(S,Object.assign(Object.assign({},b),{method:"POST",headers:hS(new globalThis.Headers,g,m.timeout,m.meta),body:pS(O,g),signal:(f=r.abort)!==null&&f!==void 0?f:null})).then(F=>{let[K,w,A]=Zy(F);if(C.resolve(A),K!=null&&K!==we.OK)throw new gt(w??we[K],we[K],A);return K!=null&&(x={code:we[K],detail:w??we[K]}),F}).then(F=>{if(!F.body)throw new gt("missing response body",we[we.INTERNAL]);return gS(F.body,F.headers.get("content-type"),(K,w)=>{switch(K){case er.DATA:R.notifyMessage(t.O.fromBinary(w,m.binaryOptions)),$=!1;break;case er.TRAILER:let A,N;[A,N,ce]=mS(w),x={code:we[A],detail:N??we[A]};break}})}).then(()=>{if(!ce&&!$)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!x)throw new gt("missing status",we[we.INTERNAL]);if(x.code!=="OK")throw new gt(x.detail,x.code,ce);R.notifyComplete(),W.resolve(x),ge.resolve(ce||{})}).catch(F=>{let K;F instanceof gt?K=F:F instanceof Error&&F.name==="AbortError"?K=new gt(F.message,we[we.CANCELLED]):K=new gt(F instanceof Error?F.message:""+F,we[we.INTERNAL]),K.methodName=t.name,K.serviceName=t.service.typeName,C.rejectPending(K),R.notifyError(K),W.rejectPending(K),ge.rejectPending(K)}),new Pj(t,(p=m.meta)!==null&&p!==void 0?p:{},s,C.promise,R,W.promise,ge.promise)}unary(t,s,r){var i,c,u,f,p;let m=r,g=(i=m.format)!==null&&i!==void 0?i:"text",y=(c=m.fetch)!==null&&c!==void 0?c:globalThis.fetch,b=(u=m.fetchInit)!==null&&u!==void 0?u:{},S=this.makeUrl(t,m),O=t.I.toBinary(s,m.binaryOptions),C=new Qa,R,$=new Qa,x,W=new Qa,ce,ge=new Qa;return y(S,Object.assign(Object.assign({},b),{method:"POST",headers:hS(new globalThis.Headers,g,m.timeout,m.meta),body:pS(O,g),signal:(f=r.abort)!==null&&f!==void 0?f:null})).then(F=>{let[K,w,A]=Zy(F);if(C.resolve(A),K!=null&&K!==we.OK)throw new gt(w??we[K],we[K],A);return K!=null&&(x={code:we[K],detail:w??we[K]}),F}).then(F=>{if(!F.body)throw new gt("missing response body",we[we.INTERNAL]);return gS(F.body,F.headers.get("content-type"),(K,w)=>{switch(K){case er.DATA:if(R)throw new gt("unary call received 2nd message",we[we.DATA_LOSS]);R=t.O.fromBinary(w,m.binaryOptions);break;case er.TRAILER:let A,N;[A,N,ce]=mS(w),x={code:we[A],detail:N??we[A]};break}})}).then(()=>{if(!ce&&R)throw new gt("missing trailers",we[we.DATA_LOSS]);if(!x)throw new gt("missing status",we[we.INTERNAL]);if(!R&&x.code==="OK")throw new gt("expected error status",we[we.DATA_LOSS]);if(!R)throw new gt(x.detail,x.code,ce);if($.resolve(R),x.code!=="OK")throw new gt(x.detail,x.code,ce);W.resolve(x),ge.resolve(ce||{})}).catch(F=>{let K;F instanceof gt?K=F:F instanceof Error&&F.name==="AbortError"?K=new gt(F.message,we[we.CANCELLED]):K=new gt(F instanceof Error?F.message:""+F,we[we.INTERNAL]),K.methodName=t.name,K.serviceName=t.service.typeName,C.rejectPending(K),$.rejectPending(K),W.rejectPending(K),ge.rejectPending(K)}),new Kk(t,(p=m.meta)!==null&&p!==void 0?p:{},s,C.promise,$.promise,W.promise,ge.promise)}}const Yy=Symbol.for("@mysten/sui/grpc/decoded-status-message");function Xj(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function tA(e){return Yy in e?!1:(Object.defineProperty(e,Yy,{value:!0,configurable:!0}),!0)}function vS(e){tA(e)&&(e.message=Xj(e.message))}function Jj(e){return Yy in e}function Wy(e,t){if(!(typeof e!="object"||e===null))try{return e[t]}catch{return}}function Kj(e){const t=Wy(e,"code");return typeof t=="string"&&typeof we[t]=="number"?t:Wy(e,"name")==="TimeoutError"?we[we.DEADLINE_EXCEEDED]:we[we.CANCELLED]}function Qj(e,t){if(typeof t=="string")return e===t;const s=Wy(t,"message");return typeof s=="string"&&e===s}function nA(e,t){try{e8(e,t)}catch{}}function e8(e,t){if(e instanceof gt){if(t?.aborted&&(e.code===we[we.INTERNAL]||e.code===we[we.CANCELLED])){e.code=Kj(t.reason),Qj(e.message,t.reason)?tA(e):vS(e);return}vS(e)}}function bS(e,t){for(const s of e)s.then(void 0,r=>nA(r,t))}var Qv=class extends Wj{constructor(e){super({...e,meta:{[$k]:String(Vk),...e.meta}})}unary(e,t,s){const r=super.unary(e,t,s);return bS([r.headers,r.response,r.status,r.trailers],s.abort),r}serverStreaming(e,t,s){const r=super.serverStreaming(e,t,s);return r.responses.onError(i=>nA(i,s.abort)),bS([r.headers,r.status,r.trailers],s.abort),r}};function t8(e){return{mergeOptions(t){const s=e.mergeOptions(t);return{...s,meta:{[$k]:String(Vk),...s.meta}}},unary:e.unary.bind(e),serverStreaming:e.serverStreaming.bind(e),clientStreaming:e.clientStreaming.bind(e),duplex:e.duplex.bind(e)}}var n8=class sA{#e;#t;constructor({prefix:t,cache:s}={}){this.#e=t??[],this.#t=s??new Map}read(t,s){const r=[this.#e,...t].join(":");if(this.#t.has(r))return this.#t.get(r);const i=s();return this.#t.set(r,i),typeof i=="object"&&i!==null&&"then"in i?Promise.resolve(i).then(c=>(this.#t.set(r,c),c)).catch(c=>{throw this.#t.delete(r),c}):i}readSync(t,s){const r=[this.#e,...t].join(":");if(this.#t.has(r))return this.#t.get(r);const i=s();return this.#t.set(r,i),i}clear(t){const s=[...this.#e,...t??[]].join(":");if(!s){this.#t.clear();return}for(const r of this.#t.keys())r.startsWith(s)&&this.#t.delete(r)}scope(t){return new sA({prefix:[...this.#e,...Array.isArray(t)?t:[t]],cache:this.#t})}},rA=class{constructor({network:e,base:t,cache:s=t?.cache??new n8}){this.network=e,this.base=t??this,this.cache=s}$extend(...e){const t=Object.fromEntries(e.map(r=>[r.name,r.register(this)])),s=new Map;return new Proxy(this,{get(r,i,c){if(typeof i=="string"&&i in t)return t[i];const u=Reflect.get(r,i,c);return typeof u=="function"?i==="$extend"?u.bind(c):(s.has(i)||s.set(i,u.bind(r)),s.get(i)):u}})}};const s8={mainnet:"https://mainnet.mvr.mystenlabs.com",testnet:"https://testnet.mvr.mystenlabs.com"};var r8=class extends rA{constructor(e){super(e),this.core=this,this.mvr=new ZR({cache:this.cache.scope("core.mvr"),url:e.mvr?.url??s8[this.network],pageSize:e.mvr?.pageSize,overrides:e.mvr?.overrides})}async getObject(e){const{objectId:t}=e,{objects:[s]}=await this.getObjects({objectIds:[t],signal:e.signal,include:e.include});if(s instanceof Error)throw s;return{object:s}}async getDynamicField(e){const t=co.parseFromStr((await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type),s=Xv(e.parentId,t,e.name.bcs),{objects:[r]}=await this.getObjects({objectIds:[s],signal:e.signal,include:{previousTransaction:!0,content:!0}});if(r instanceof Error)throw r;const i=ws(r.type),c=await r.content,u=i.typeParams[0],f=typeof u!="string"&&u.module==="dynamic_object_field"&&u.name==="Wrapper",p=c.slice(el+e.name.bcs.length),m=typeof i.typeParams[1]=="string"?i.typeParams[1]:De(i.typeParams[1]);return{dynamicField:{$kind:f?"DynamicObject":"DynamicField",fieldId:r.objectId,digest:r.digest,version:r.version,type:r.type,previousTransaction:r.previousTransaction,name:{type:typeof u=="string"?u:De(u),bcs:e.name.bcs},value:{type:m,bcs:p},childId:f?H.Address.parse(p):void 0}}}async getDynamicObjectField(e){const t=`0x2::dynamic_object_field::Wrapper<${(await this.core.mvr.resolveType({type:e.name.type,signal:e.signal})).type}>`,{dynamicField:s}=await this.getDynamicField({parentId:e.parentId,name:{type:t,bcs:e.name.bcs},signal:e.signal}),{object:r}=await this.getObject({objectId:s.childId,signal:e.signal,include:e.include});return{object:r}}async waitForTransaction(e){const{signal:t,timeout:s=60*1e3,pollSchedule:r,include:i}=e,c="result"in e&&e.result?(e.result.Transaction??e.result.FailedTransaction).digest:e.digest,u=t?AbortSignal.any([AbortSignal.timeout(s),t]):AbortSignal.timeout(s),f=new Promise((b,S)=>{u.addEventListener("abort",()=>S(u.reason))});f.catch(()=>{});const p=r??[0,300,600,1500,3500],m=Date.now();let g=0;const y=p.length>0?p[p.length-1]-(p[p.length-2]??0):2e3;for(;;){if(g<p.length){const b=m+p[g]-Date.now();g++,b>0&&await Promise.race([new Promise(S=>setTimeout(S,b)),f])}else await Promise.race([new Promise(b=>setTimeout(b,y)),f]);u.throwIfAborted();try{return await this.getTransaction({digest:c,include:i,signal:u})}catch{}}}async signAndExecuteTransaction({transaction:e,signer:t,additionalSignatures:s=[],...r}){let i;e instanceof Uint8Array?i=e:(e.setSenderIfNotSet(t.toSuiAddress()),i=await e.build({client:this}));const{signature:c}=await t.signTransaction(i);return this.executeTransaction({transaction:i,signatures:[c,...s],...r})}};const a8=new Intl.PluralRules("en-US",{type:"ordinal"}),i8=new Map([["one","st"],["two","nd"],["few","rd"],["other","th"]]);function o8(e){return`${e}${i8.get(a8.select(e))}`}function aA(e){const{command:t,location:s,abortCode:r,cleverError:i}=e,c=[];if(t!=null?c.push(`MoveAbort in ${o8(t+1)} command`):c.push("MoveAbort"),i?.constantName){const u=i.value?`'${i.constantName}': ${i.value}`:`'${i.constantName}'`;c.push(u)}else c.push(`abort code: ${r}`);if(s?.package&&s?.module){const u=[`in '${[s.package.startsWith("0x")?s.package:`0x${s.package}`,s.module,s.functionName].filter(Boolean).join("::")}'`];i?.lineNumber!=null?u.push(`(line ${i.lineNumber})`):s.instruction!=null&&u.push(`(instruction ${s.instruction})`),c.push(u.join(" "))}return c.join(", ")}const wS=H.struct("MinimalEffectsWithError",{status:Rv}),c8=H.enum("MinimalTransactionEffectsWithError",{V1:wS,V2:wS}),l8=H.enum("MinimalExecutionStatusNoError",{Success:null,Failed:null}),TS=H.struct("MinimalEffectsNoError",{status:l8}),u8=H.enum("MinimalTransactionEffectsNoError",{V1:TS,V2:TS});function ts(e,t){return t!=null&&typeof t!="boolean"?`${e}(${JSON.stringify(t,(s,r)=>typeof r=="bigint"?r.toString():r)})`:e}function eb(e){const t=e.error,s=e.command!=null?Number(e.command):void 0;switch(t.$kind){case"MoveAbort":{const[r,i]=t.MoveAbort,c={package:r.module.address,module:r.module.name,function:r.function,functionName:r.functionName??void 0,instruction:r.instruction};return{$kind:"MoveAbort",message:aA({command:s,location:c,abortCode:String(i)}),command:s,MoveAbort:{abortCode:String(i),location:c}}}case"MoveObjectTooBig":return{$kind:"SizeError",message:ts("MoveObjectTooBig",t.MoveObjectTooBig),command:s,SizeError:{name:"ObjectTooBig",size:Number(t.MoveObjectTooBig.objectSize),maxSize:Number(t.MoveObjectTooBig.maxObjectSize)}};case"MovePackageTooBig":return{$kind:"SizeError",message:ts("MovePackageTooBig",t.MovePackageTooBig),command:s,SizeError:{name:"PackageTooBig",size:Number(t.MovePackageTooBig.objectSize),maxSize:Number(t.MovePackageTooBig.maxObjectSize)}};case"EffectsTooLarge":return{$kind:"SizeError",message:ts("EffectsTooLarge",t.EffectsTooLarge),command:s,SizeError:{name:"EffectsTooLarge",size:Number(t.EffectsTooLarge.currentSize),maxSize:Number(t.EffectsTooLarge.maxSize)}};case"WrittenObjectsTooLarge":return{$kind:"SizeError",message:ts("WrittenObjectsTooLarge",t.WrittenObjectsTooLarge),command:s,SizeError:{name:"WrittenObjectsTooLarge",size:Number(t.WrittenObjectsTooLarge.currentSize),maxSize:Number(t.WrittenObjectsTooLarge.maxSize)}};case"MoveVectorElemTooBig":return{$kind:"SizeError",message:ts("MoveVectorElemTooBig",t.MoveVectorElemTooBig),command:s,SizeError:{name:"MoveVectorElemTooBig",size:Number(t.MoveVectorElemTooBig.valueSize),maxSize:Number(t.MoveVectorElemTooBig.maxScaledSize)}};case"MoveRawValueTooBig":return{$kind:"SizeError",message:ts("MoveRawValueTooBig",t.MoveRawValueTooBig),command:s,SizeError:{name:"MoveRawValueTooBig",size:Number(t.MoveRawValueTooBig.valueSize),maxSize:Number(t.MoveRawValueTooBig.maxScaledSize)}};case"CommandArgumentError":return{$kind:"CommandArgumentError",message:ts("CommandArgumentError",t.CommandArgumentError),command:s,CommandArgumentError:{argument:t.CommandArgumentError.argIdx,name:t.CommandArgumentError.kind.$kind}};case"TypeArgumentError":return{$kind:"TypeArgumentError",message:ts("TypeArgumentError",t.TypeArgumentError),command:s,TypeArgumentError:{typeArgument:t.TypeArgumentError.argumentIdx,name:t.TypeArgumentError.kind.$kind}};case"PackageUpgradeError":{const r=t.PackageUpgradeError.upgradeError;return{$kind:"PackageUpgradeError",message:ts("PackageUpgradeError",t.PackageUpgradeError),command:s,PackageUpgradeError:{name:r.$kind,packageId:r.$kind==="UnableToFetchPackage"?r.UnableToFetchPackage.packageId:void 0,digest:r.$kind==="DigestDoesNotMatch"?st(r.DigestDoesNotMatch.digest):void 0}}}case"ExecutionCancelledDueToSharedObjectCongestion":return{$kind:"CongestedObjects",message:ts("ExecutionCancelledDueToSharedObjectCongestion",t.ExecutionCancelledDueToSharedObjectCongestion),command:s,CongestedObjects:{name:"ExecutionCanceledDueToConsensusObjectCongestion",objects:t.ExecutionCancelledDueToSharedObjectCongestion.congested_objects}};case"AddressDeniedForCoin":return{$kind:"CoinDenyListError",message:ts("AddressDeniedForCoin",t.AddressDeniedForCoin),command:s,CoinDenyListError:{name:"AddressDeniedForCoin",address:t.AddressDeniedForCoin.address,coinType:t.AddressDeniedForCoin.coinType}};case"CoinTypeGlobalPause":return{$kind:"CoinDenyListError",message:ts("CoinTypeGlobalPause",t.CoinTypeGlobalPause),command:s,CoinDenyListError:{name:"CoinTypeGlobalPause",coinType:t.CoinTypeGlobalPause.coinType}};case"CircularObjectOwnership":return{$kind:"ObjectIdError",message:ts("CircularObjectOwnership",t.CircularObjectOwnership),command:s,ObjectIdError:{name:"CircularObjectOwnership",objectId:t.CircularObjectOwnership.object}};case"InvalidGasObject":return{$kind:"ObjectIdError",message:"InvalidGasObject",command:s,ObjectIdError:{name:"InvalidGasObject",objectId:""}};case"InputObjectDeleted":return{$kind:"ObjectIdError",message:"InputObjectDeleted",command:s,ObjectIdError:{name:"InputObjectDeleted",objectId:""}};case"InvalidTransferObject":return{$kind:"ObjectIdError",message:"InvalidTransferObject",command:s,ObjectIdError:{name:"InvalidTransferObject",objectId:""}};case"NonExclusiveWriteInputObjectModified":return{$kind:"Unknown",message:ts("NonExclusiveWriteInputObjectModified",t.NonExclusiveWriteInputObjectModified),command:s,Unknown:null};case"InsufficientGas":case"InvariantViolation":case"FeatureNotYetSupported":case"InsufficientCoinBalance":case"CoinBalanceOverflow":case"PublishErrorNonZeroAddress":case"SuiMoveVerificationError":case"MovePrimitiveRuntimeError":case"VMVerificationOrDeserializationError":case"VMInvariantViolation":case"FunctionNotFound":case"ArityMismatch":case"TypeArityMismatch":case"NonEntryFunctionInvoked":case"UnusedValueWithoutDrop":case"InvalidPublicFunctionReturnType":case"PublishUpgradeMissingDependency":case"PublishUpgradeDependencyDowngrade":case"CertificateDenied":case"SuiMoveVerificationTimedout":case"SharedObjectOperationNotAllowed":case"ExecutionCancelledDueToRandomnessUnavailable":case"InvalidLinkage":case"InsufficientBalanceForWithdraw":return{$kind:"Unknown",message:t.$kind,command:s,Unknown:null};default:return{$kind:"Unknown",message:"Unknown error",command:s,Unknown:null}}}function d8(e,t=!1){return(t?Xi.fromKindBytes(e):Xi.fromBytes(e)).snapshot()}function f8(e){try{return H.TransactionData.parse(e).V1?.gasData.payment?.length===0}catch{return!1}}function h8(e){let t=null;try{t=c8.parse(e)}catch{const r=u8.parse(e);return(r.V1??r.V2).status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:{$kind:"Unknown",message:"ExecutionFailed",Unknown:null}}}const s=(t.V1??t.V2).status;return s.$kind==="Success"?{success:!0,error:null}:{success:!1,error:eb(s.Failure)}}function p8(e){const t=H.TransactionEffects.parse(e);switch(t.$kind){case"V1":return m8({bytes:e,effects:t.V1});case"V2":return g8({bytes:e,effects:t.V2});default:throw new Error(`Unknown transaction effects version: ${t.$kind}`)}}function m8({bytes:e,effects:t}){const s=new Map(t.modifiedAtVersions),r=new Map(t.sharedObjects.map(b=>[b.objectId,b])),i=(b,S)=>{const O=r.get(b.objectId);return{objectId:b.objectId,inputState:S.inputState,inputVersion:S.inputState==="Exists"?O?.version??s.get(b.objectId)??null:null,inputDigest:S.inputState==="Exists"?O?.digest??null:null,inputOwner:null,outputState:S.outputState,outputVersion:S.outputState==="DoesNotExist"?null:b.version,outputDigest:S.outputState==="DoesNotExist"?null:b.digest,outputOwner:S.outputOwner,idOperation:S.idOperation}},c=(b,S,O)=>b.map(([C,R])=>i(C,{inputState:S,outputState:"ObjectWrite",outputOwner:R,idOperation:O})),u=(b,S,O)=>b.map(C=>i(C,{inputState:S,outputState:"DoesNotExist",outputOwner:null,idOperation:O})),f=[...c(t.created,"DoesNotExist","Created"),...c(t.mutated,"Exists","None"),...c(t.unwrapped,"DoesNotExist","None"),...u(t.deleted,"Exists","Deleted"),...u(t.unwrappedThenDeleted,"DoesNotExist","Deleted"),...u(t.wrapped,"Exists","None")],p=t.gasObject[0].objectId,m=f.find(b=>b.objectId===p)??null,g=new Set(f.map(b=>b.objectId)),y=t.modifiedAtVersions.reduce((b,[,S])=>BigInt(S)>b?BigInt(S):b,0n);return{bcs:e,version:1,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:eb(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:m,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:(y+1n).toString(),changedObjects:f,unchangedConsensusObjects:t.sharedObjects.filter(b=>!g.has(b.objectId)).map(b=>({kind:"ReadOnlyRoot",objectId:b.objectId,version:b.version,digest:b.digest})),auxiliaryDataDigest:null}}function g8({bytes:e,effects:t}){const s=t.changedObjects.map(([r,i])=>({objectId:r,inputState:i.inputState.$kind==="Exist"?"Exists":"DoesNotExist",inputVersion:i.inputState.Exist?.[0][0]??null,inputDigest:i.inputState.Exist?.[0][1]??null,inputOwner:i.inputState.Exist?.[1]??null,outputState:i.outputState.$kind==="NotExist"?"DoesNotExist":i.outputState.$kind,outputVersion:i.outputState.$kind==="PackageWrite"?i.outputState.PackageWrite?.[0]:i.outputState.$kind==="ObjectWrite"?t.lamportVersion:null,outputDigest:i.outputState.$kind==="PackageWrite"?i.outputState.PackageWrite?.[1]:i.outputState.$kind==="ObjectWrite"?i.outputState.ObjectWrite?.[0]??null:null,outputOwner:i.outputState.$kind==="ObjectWrite"?i.outputState.ObjectWrite[1]:null,idOperation:i.idOperation.$kind}));return{bcs:e,version:2,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:eb(t.status.Failure)},gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:t.gasObjectIndex===null?null:s[t.gasObjectIndex]??null,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:t.lamportVersion,changedObjects:s,unchangedConsensusObjects:t.unchangedConsensusObjects.map(([r,i])=>({kind:i.$kind,objectId:r,version:i.$kind==="ReadOnlyRoot"?i.ReadOnlyRoot[0]:i[i.$kind],digest:i.$kind==="ReadOnlyRoot"?i.ReadOnlyRoot[1]:null})),auxiliaryDataDigest:t.auxDataDigest}}let ES=(function(e){return e[e.NULL_VALUE=0]="NULL_VALUE",e})({});var y8=class extends Y{constructor(){super("google.protobuf.Struct",[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:()=>hn}}])}internalJsonWrite(e,t){let s={};for(let[r,i]of Object.entries(e.fields))s[r]=hn.toJson(i);return s}internalJsonRead(e,t,s){if(!Vh(e))throw new globalThis.Error("Unable to parse message "+this.typeName+" from JSON "+ma(e)+".");s||(s=this.create());for(let[r,i]of globalThis.Object.entries(e))s.fields[r]=hn.fromJson(i);return s}};const SS=new y8;var v8=class extends Y{constructor(){super("google.protobuf.Value",[{no:1,name:"null_value",kind:"enum",oneof:"kind",T:()=>["google.protobuf.NullValue",ES]},{no:2,name:"number_value",kind:"scalar",oneof:"kind",T:1},{no:3,name:"string_value",kind:"scalar",oneof:"kind",T:9},{no:4,name:"bool_value",kind:"scalar",oneof:"kind",T:8},{no:5,name:"struct_value",kind:"message",oneof:"kind",T:()=>SS},{no:6,name:"list_value",kind:"message",oneof:"kind",T:()=>_S}])}internalJsonWrite(e,t){if(e.kind.oneofKind===void 0)throw new globalThis.Error;switch(e.kind.oneofKind){case void 0:throw new globalThis.Error;case"boolValue":return e.kind.boolValue;case"nullValue":return null;case"numberValue":let s=e.kind.numberValue;if(typeof s=="number"&&!Number.isFinite(s))throw new globalThis.Error;return s;case"stringValue":return e.kind.stringValue;case"listValue":let r=this.fields.find(c=>c.no===6);if(r?.kind!=="message")throw new globalThis.Error;return r.T().toJson(e.kind.listValue);case"structValue":let i=this.fields.find(c=>c.no===5);if(i?.kind!=="message")throw new globalThis.Error;return i.T().toJson(e.kind.structValue)}}internalJsonRead(e,t,s){switch(s||(s=this.create()),typeof e){case"number":s.kind={oneofKind:"numberValue",numberValue:e};break;case"string":s.kind={oneofKind:"stringValue",stringValue:e};break;case"boolean":s.kind={oneofKind:"boolValue",boolValue:e};break;case"object":e===null?s.kind={oneofKind:"nullValue",nullValue:ES.NULL_VALUE}:globalThis.Array.isArray(e)?s.kind={oneofKind:"listValue",listValue:_S.fromJson(e)}:s.kind={oneofKind:"structValue",structValue:SS.fromJson(e)};break;default:throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ma(e))}return s}};const hn=new v8;var b8=class extends Y{constructor(){super("google.protobuf.ListValue",[{no:1,name:"values",kind:"message",repeat:2,T:()=>hn}])}internalJsonWrite(e,t){return e.values.map(s=>hn.toJson(s))}internalJsonRead(e,t,s){if(!globalThis.Array.isArray(e))throw new globalThis.Error("Unable to parse "+this.typeName+" from JSON "+ma(e));s||(s=this.create());let r=e.map(i=>hn.fromJson(i));return s.values.push(...r),s}};const _S=new b8;let w8=(function(e){return e[e.DATATYPE_KIND_UNKNOWN=0]="DATATYPE_KIND_UNKNOWN",e[e.STRUCT=1]="STRUCT",e[e.ENUM=2]="ENUM",e})({}),gs=(function(e){return e[e.TYPE_UNKNOWN=0]="TYPE_UNKNOWN",e[e.ADDRESS=1]="ADDRESS",e[e.BOOL=2]="BOOL",e[e.U8=3]="U8",e[e.U16=4]="U16",e[e.U32=5]="U32",e[e.U64=6]="U64",e[e.U128=7]="U128",e[e.U256=8]="U256",e[e.VECTOR=9]="VECTOR",e[e.DATATYPE=10]="DATATYPE",e[e.TYPE_PARAMETER=11]="TYPE_PARAMETER",e})({}),wh=(function(e){return e[e.VISIBILITY_UNKNOWN=0]="VISIBILITY_UNKNOWN",e[e.PRIVATE=1]="PRIVATE",e[e.PUBLIC=2]="PUBLIC",e[e.FRIEND=3]="FRIEND",e})({}),Xy=(function(e){return e[e.REFERENCE_UNKNOWN=0]="REFERENCE_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e})({}),kc=(function(e){return e[e.ABILITY_UNKNOWN=0]="ABILITY_UNKNOWN",e[e.COPY=1]="COPY",e[e.DROP=2]="DROP",e[e.STORE=3]="STORE",e[e.KEY=4]="KEY",e})({});var T8=class extends Y{constructor(){super("sui.rpc.v2.Package",[{no:1,name:"storage_id",kind:"scalar",opt:!0,T:9},{no:2,name:"original_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"modules",kind:"message",repeat:2,T:()=>S8},{no:5,name:"type_origins",kind:"message",repeat:2,T:()=>j8},{no:6,name:"linkage",kind:"message",repeat:2,T:()=>D8}])}};const iA=new T8;var E8=class extends Y{constructor(){super("sui.rpc.v2.Module",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"contents",kind:"scalar",opt:!0,T:12},{no:3,name:"datatypes",kind:"message",repeat:2,T:()=>oA},{no:4,name:"functions",kind:"message",repeat:2,T:()=>uA}])}};const S8=new E8;var _8=class extends Y{constructor(){super("sui.rpc.v2.DatatypeDescriptor",[{no:1,name:"type_name",kind:"scalar",opt:!0,T:9},{no:2,name:"defining_id",kind:"scalar",opt:!0,T:9},{no:3,name:"module",kind:"scalar",opt:!0,T:9},{no:4,name:"name",kind:"scalar",opt:!0,T:9},{no:5,name:"abilities",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",kc]},{no:6,name:"type_parameters",kind:"message",repeat:2,T:()=>cA},{no:7,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DatatypeDescriptor.DatatypeKind",w8]},{no:8,name:"fields",kind:"message",repeat:2,T:()=>lA},{no:9,name:"variants",kind:"message",repeat:2,T:()=>N8}])}};const oA=new _8;var k8=class extends Y{constructor(){super("sui.rpc.v2.TypeParameter",[{no:1,name:"constraints",kind:"enum",repeat:1,T:()=>["sui.rpc.v2.Ability",kc]},{no:2,name:"is_phantom",kind:"scalar",opt:!0,T:8}])}};const cA=new k8;var A8=class extends Y{constructor(){super("sui.rpc.v2.FieldDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"position",kind:"scalar",opt:!0,T:13},{no:3,name:"type",kind:"message",T:()=>tb}])}};const lA=new A8;var O8=class extends Y{constructor(){super("sui.rpc.v2.VariantDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"position",kind:"scalar",opt:!0,T:13},{no:3,name:"fields",kind:"message",repeat:2,T:()=>lA}])}};const N8=new O8;var x8=class extends Y{constructor(){super("sui.rpc.v2.OpenSignatureBody",[{no:1,name:"type",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignatureBody.Type",gs]},{no:2,name:"type_name",kind:"scalar",opt:!0,T:9},{no:3,name:"type_parameter_instantiation",kind:"message",repeat:2,T:()=>tb},{no:4,name:"type_parameter",kind:"scalar",opt:!0,T:13}])}};const tb=new x8;var C8=class extends Y{constructor(){super("sui.rpc.v2.FunctionDescriptor",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.FunctionDescriptor.Visibility",wh]},{no:6,name:"is_entry",kind:"scalar",opt:!0,T:8},{no:7,name:"type_parameters",kind:"message",repeat:2,T:()=>cA},{no:8,name:"parameters",kind:"message",repeat:2,T:()=>kS},{no:9,name:"returns",kind:"message",repeat:2,T:()=>kS}])}};const uA=new C8;var I8=class extends Y{constructor(){super("sui.rpc.v2.OpenSignature",[{no:1,name:"reference",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.OpenSignature.Reference",Xy]},{no:2,name:"body",kind:"message",T:()=>tb}])}};const kS=new I8;var R8=class extends Y{constructor(){super("sui.rpc.v2.TypeOrigin",[{no:1,name:"module_name",kind:"scalar",opt:!0,T:9},{no:2,name:"datatype_name",kind:"scalar",opt:!0,T:9},{no:3,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const j8=new R8;var M8=class extends Y{constructor(){super("sui.rpc.v2.Linkage",[{no:1,name:"original_id",kind:"scalar",opt:!0,T:9},{no:2,name:"upgraded_id",kind:"scalar",opt:!0,T:9},{no:3,name:"upgraded_version",kind:"scalar",opt:!0,T:4,L:0}])}};const D8=new M8;let bc=(function(e){return e[e.OWNER_KIND_UNKNOWN=0]="OWNER_KIND_UNKNOWN",e[e.ADDRESS=1]="ADDRESS",e[e.OBJECT=2]="OBJECT",e[e.SHARED=3]="SHARED",e[e.IMMUTABLE=4]="IMMUTABLE",e[e.CONSENSUS_ADDRESS=5]="CONSENSUS_ADDRESS",e})({});var U8=class extends Y{constructor(){super("sui.rpc.v2.Owner",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Owner.OwnerKind",bc]},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const Jy=new U8;let ii=(function(e){return e[e.ARGUMENT_KIND_UNKNOWN=0]="ARGUMENT_KIND_UNKNOWN",e[e.GAS=1]="GAS",e[e.INPUT=2]="INPUT",e[e.RESULT=3]="RESULT",e})({});var B8=class extends Y{constructor(){super("sui.rpc.v2.Argument",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Argument.ArgumentKind",ii]},{no:2,name:"input",kind:"scalar",opt:!0,T:13},{no:3,name:"result",kind:"scalar",opt:!0,T:13},{no:4,name:"subresult",kind:"scalar",opt:!0,T:13}])}};const Ar=new B8;let Qs=(function(e){return e[e.INPUT_KIND_UNKNOWN=0]="INPUT_KIND_UNKNOWN",e[e.PURE=1]="PURE",e[e.IMMUTABLE_OR_OWNED=2]="IMMUTABLE_OR_OWNED",e[e.SHARED=3]="SHARED",e[e.RECEIVING=4]="RECEIVING",e[e.FUNDS_WITHDRAWAL=5]="FUNDS_WITHDRAWAL",e})({}),L8=(function(e){return e[e.MUTABILITY_UNKNOWN=0]="MUTABILITY_UNKNOWN",e[e.IMMUTABLE=1]="IMMUTABLE",e[e.MUTABLE=2]="MUTABLE",e[e.NON_EXCLUSIVE_WRITE=3]="NON_EXCLUSIVE_WRITE",e})({}),Ac=(function(e){return e[e.SOURCE_UNKNOWN=0]="SOURCE_UNKNOWN",e[e.SENDER=1]="SENDER",e[e.SPONSOR=2]="SPONSOR",e[e.SENDER_ALLOWANCE=3]="SENDER_ALLOWANCE",e})({});var z8=class extends Y{constructor(){super("sui.rpc.v2.Input",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.InputKind",Qs]},{no:2,name:"pure",kind:"scalar",opt:!0,T:12},{no:3,name:"object_id",kind:"scalar",opt:!0,T:9},{no:4,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"digest",kind:"scalar",opt:!0,T:9},{no:6,name:"mutable",kind:"scalar",opt:!0,T:8},{no:7,name:"mutability",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Input.Mutability",L8]},{no:8,name:"funds_withdrawal",kind:"message",T:()=>P8},{no:1e3,name:"literal",kind:"message",T:()=>hn}])}};const $8=new z8;var V8=class extends Y{constructor(){super("sui.rpc.v2.FundsWithdrawal",[{no:1,name:"amount",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"source",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.FundsWithdrawal.Source",Ac]},{no:4,name:"funder",kind:"scalar",opt:!0,T:9},{no:5,name:"allowance",kind:"scalar",opt:!0,T:9}])}};const P8=new V8;var G8=class extends Y{constructor(){super("google.protobuf.Duration",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}internalJsonWrite(e,t){let s=Ot.from(e.seconds).toNumber();if(s>315576e6||s<-315576e6)throw new Error("Duration value out of range.");let r=e.seconds.toString();if(s===0&&e.nanos<0&&(r="-"+r),e.nanos!==0){let i=Math.abs(e.nanos).toString();i="0".repeat(9-i.length)+i,i.substring(3)==="000000"?i=i.substring(0,3):i.substring(6)==="000"&&(i=i.substring(0,6)),r+="."+i}return r+"s"}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse Duration from JSON "+ma(e)+". Expected string.");let r=e.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error("Unable to parse Duration from JSON string. Invalid format.");s||(s=this.create());let[,i,c,u]=r,f=Ot.from(i+c);if(f.toNumber()>315576e6||f.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(s.seconds=f.toBigInt(),typeof u=="string"){let p=i+u+"0".repeat(9-u.length);s.nanos=parseInt(p)}return s}};const F8=new G8;var H8=class extends Y{constructor(){super("sui.rpc.v2.JwkId",[{no:1,name:"iss",kind:"scalar",opt:!0,T:9},{no:2,name:"kid",kind:"scalar",opt:!0,T:9}])}};const dA=new H8;var q8=class extends Y{constructor(){super("sui.rpc.v2.Jwk",[{no:1,name:"kty",kind:"scalar",opt:!0,T:9},{no:2,name:"e",kind:"scalar",opt:!0,T:9},{no:3,name:"n",kind:"scalar",opt:!0,T:9},{no:4,name:"alg",kind:"scalar",opt:!0,T:9}])}};const Z8=new q8;var Y8=class extends Y{constructor(){super("sui.rpc.v2.Bcs",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"value",kind:"scalar",opt:!0,T:12}])}};const Ts=new Y8;var W8=class extends Y{constructor(){super("sui.rpc.v2.Object",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"object_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"digest",kind:"scalar",opt:!0,T:9},{no:5,name:"owner",kind:"message",T:()=>Jy},{no:6,name:"object_type",kind:"scalar",opt:!0,T:9},{no:7,name:"has_public_transfer",kind:"scalar",opt:!0,T:8},{no:8,name:"contents",kind:"message",T:()=>Ts},{no:9,name:"package",kind:"message",T:()=>iA},{no:10,name:"previous_transaction",kind:"scalar",opt:!0,T:9},{no:11,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:100,name:"json",kind:"message",T:()=>hn},{no:101,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:102,name:"display",kind:"message",T:()=>K8}])}};const fo=new W8;var X8=class extends Y{constructor(){super("sui.rpc.v2.ObjectSet",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>fo}])}};const fA=new X8;var J8=class extends Y{constructor(){super("sui.rpc.v2.Display",[{no:1,name:"output",kind:"message",T:()=>hn},{no:2,name:"errors",kind:"message",T:()=>hn}])}};const K8=new J8;var Q8=class extends Y{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const e=this.create(),t=Date.now();return e.seconds=Ot.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(Ot.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),s=e.getTime();return t.seconds=Ot.from(Math.floor(s/1e3)).toBigInt(),t.nanos=(s%1e3+(s<0&&s%1e3!==0?1e3:0))*1e6,t}internalJsonWrite(e,t){let s=Ot.from(e.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(e.nanos>0){let i=(e.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+ma(e)+".");let r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=Ot.from(i/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}};const Or=new Q8;var eM=class extends Y{constructor(){super("sui.rpc.v2.ObjectReference",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"digest",kind:"scalar",opt:!0,T:9}])}};const hA=new eM;let ca=(function(e){return e[e.TRANSACTION_EXPIRATION_KIND_UNKNOWN=0]="TRANSACTION_EXPIRATION_KIND_UNKNOWN",e[e.NONE=1]="NONE",e[e.EPOCH=2]="EPOCH",e[e.VALID_DURING=3]="VALID_DURING",e[e.VALIDITY=4]="VALIDITY",e})({}),tM=(function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.PROGRAMMABLE_TRANSACTION=1]="PROGRAMMABLE_TRANSACTION",e[e.CHANGE_EPOCH=2]="CHANGE_EPOCH",e[e.GENESIS=3]="GENESIS",e[e.CONSENSUS_COMMIT_PROLOGUE_V1=4]="CONSENSUS_COMMIT_PROLOGUE_V1",e[e.AUTHENTICATOR_STATE_UPDATE=5]="AUTHENTICATOR_STATE_UPDATE",e[e.END_OF_EPOCH=6]="END_OF_EPOCH",e[e.RANDOMNESS_STATE_UPDATE=7]="RANDOMNESS_STATE_UPDATE",e[e.CONSENSUS_COMMIT_PROLOGUE_V2=8]="CONSENSUS_COMMIT_PROLOGUE_V2",e[e.CONSENSUS_COMMIT_PROLOGUE_V3=9]="CONSENSUS_COMMIT_PROLOGUE_V3",e[e.CONSENSUS_COMMIT_PROLOGUE_V4=10]="CONSENSUS_COMMIT_PROLOGUE_V4",e[e.PROGRAMMABLE_SYSTEM_TRANSACTION=11]="PROGRAMMABLE_SYSTEM_TRANSACTION",e})({}),nM=(function(e){return e[e.KIND_UNKNOWN=0]="KIND_UNKNOWN",e[e.CHANGE_EPOCH=1]="CHANGE_EPOCH",e[e.AUTHENTICATOR_STATE_CREATE=2]="AUTHENTICATOR_STATE_CREATE",e[e.AUTHENTICATOR_STATE_EXPIRE=3]="AUTHENTICATOR_STATE_EXPIRE",e[e.RANDOMNESS_STATE_CREATE=4]="RANDOMNESS_STATE_CREATE",e[e.DENY_LIST_STATE_CREATE=5]="DENY_LIST_STATE_CREATE",e[e.BRIDGE_STATE_CREATE=6]="BRIDGE_STATE_CREATE",e[e.BRIDGE_COMMITTEE_INIT=7]="BRIDGE_COMMITTEE_INIT",e[e.STORE_EXECUTION_TIME_OBSERVATIONS=8]="STORE_EXECUTION_TIME_OBSERVATIONS",e[e.ACCUMULATOR_ROOT_CREATE=9]="ACCUMULATOR_ROOT_CREATE",e[e.COIN_REGISTRY_CREATE=10]="COIN_REGISTRY_CREATE",e[e.DISPLAY_REGISTRY_CREATE=11]="DISPLAY_REGISTRY_CREATE",e[e.ADDRESS_ALIAS_STATE_CREATE=12]="ADDRESS_ALIAS_STATE_CREATE",e[e.WRITE_ACCUMULATOR_STORAGE_COST=13]="WRITE_ACCUMULATOR_STORAGE_COST",e})({}),sM=(function(e){return e[e.EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN=0]="EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",e[e.MOVE_ENTRY_POINT=1]="MOVE_ENTRY_POINT",e[e.TRANSFER_OBJECTS=2]="TRANSFER_OBJECTS",e[e.SPLIT_COINS=3]="SPLIT_COINS",e[e.MERGE_COINS=4]="MERGE_COINS",e[e.PUBLISH=5]="PUBLISH",e[e.MAKE_MOVE_VECTOR=6]="MAKE_MOVE_VECTOR",e[e.UPGRADE=7]="UPGRADE",e})({});var rM=class extends Y{constructor(){super("sui.rpc.v2.Transaction",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"kind",kind:"message",T:()=>fM},{no:5,name:"sender",kind:"scalar",opt:!0,T:9},{no:6,name:"gas_payment",kind:"message",T:()=>iM},{no:7,name:"expiration",kind:"message",T:()=>cM}])}};const nb=new rM;var aM=class extends Y{constructor(){super("sui.rpc.v2.GasPayment",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>hA},{no:2,name:"owner",kind:"scalar",opt:!0,T:9},{no:3,name:"price",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"budget",kind:"scalar",opt:!0,T:4,L:0}])}};const iM=new aM;var oM=class extends Y{constructor(){super("sui.rpc.v2.TransactionExpiration",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionExpiration.TransactionExpirationKind",ca]},{no:2,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"min_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"min_timestamp",kind:"message",T:()=>Or},{no:5,name:"max_timestamp",kind:"message",T:()=>Or},{no:6,name:"chain",kind:"scalar",opt:!0,T:9},{no:7,name:"nonce",kind:"scalar",opt:!0,T:13},{no:8,name:"allowed_proposers",kind:"message",T:()=>uM}])}};const cM=new oM;var lM=class extends Y{constructor(){super("sui.rpc.v2.AllowedProposers",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"proposers",kind:"scalar",repeat:1,T:13}])}};const uM=new lM;var dM=class extends Y{constructor(){super("sui.rpc.v2.TransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TransactionKind.Kind",tM]},{no:2,name:"programmable_transaction",kind:"message",oneof:"data",T:()=>pM},{no:3,name:"change_epoch",kind:"message",oneof:"data",T:()=>mA},{no:4,name:"genesis",kind:"message",oneof:"data",T:()=>UM},{no:5,name:"consensus_commit_prologue",kind:"message",oneof:"data",T:()=>LM},{no:6,name:"authenticator_state_update",kind:"message",oneof:"data",T:()=>qM},{no:7,name:"end_of_epoch",kind:"message",oneof:"data",T:()=>WM},{no:8,name:"randomness_state_update",kind:"message",oneof:"data",T:()=>IM}])}};const fM=new dM;var hM=class extends Y{constructor(){super("sui.rpc.v2.ProgrammableTransaction",[{no:1,name:"inputs",kind:"message",repeat:2,T:()=>$8},{no:2,name:"commands",kind:"message",repeat:2,T:()=>gM}])}};const pM=new hM;var mM=class extends Y{constructor(){super("sui.rpc.v2.Command",[{no:1,name:"move_call",kind:"message",oneof:"command",T:()=>pA},{no:2,name:"transfer_objects",kind:"message",oneof:"command",T:()=>bM},{no:3,name:"split_coins",kind:"message",oneof:"command",T:()=>TM},{no:4,name:"merge_coins",kind:"message",oneof:"command",T:()=>SM},{no:5,name:"publish",kind:"message",oneof:"command",T:()=>kM},{no:6,name:"make_move_vector",kind:"message",oneof:"command",T:()=>OM},{no:7,name:"upgrade",kind:"message",oneof:"command",T:()=>xM}])}};const gM=new mM;var yM=class extends Y{constructor(){super("sui.rpc.v2.MoveCall",[{no:1,name:"package",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"function",kind:"scalar",opt:!0,T:9},{no:4,name:"type_arguments",kind:"scalar",repeat:2,T:9},{no:5,name:"arguments",kind:"message",repeat:2,T:()=>Ar}])}};const pA=new yM;var vM=class extends Y{constructor(){super("sui.rpc.v2.TransferObjects",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>Ar},{no:2,name:"address",kind:"message",T:()=>Ar}])}};const bM=new vM;var wM=class extends Y{constructor(){super("sui.rpc.v2.SplitCoins",[{no:1,name:"coin",kind:"message",T:()=>Ar},{no:2,name:"amounts",kind:"message",repeat:2,T:()=>Ar}])}};const TM=new wM;var EM=class extends Y{constructor(){super("sui.rpc.v2.MergeCoins",[{no:1,name:"coin",kind:"message",T:()=>Ar},{no:2,name:"coins_to_merge",kind:"message",repeat:2,T:()=>Ar}])}};const SM=new EM;var _M=class extends Y{constructor(){super("sui.rpc.v2.Publish",[{no:1,name:"modules",kind:"scalar",repeat:2,T:12},{no:2,name:"dependencies",kind:"scalar",repeat:2,T:9}])}};const kM=new _M;var AM=class extends Y{constructor(){super("sui.rpc.v2.MakeMoveVector",[{no:1,name:"element_type",kind:"scalar",opt:!0,T:9},{no:2,name:"elements",kind:"message",repeat:2,T:()=>Ar}])}};const OM=new AM;var NM=class extends Y{constructor(){super("sui.rpc.v2.Upgrade",[{no:1,name:"modules",kind:"scalar",repeat:2,T:12},{no:2,name:"dependencies",kind:"scalar",repeat:2,T:9},{no:3,name:"package",kind:"scalar",opt:!0,T:9},{no:4,name:"ticket",kind:"message",T:()=>Ar}])}};const xM=new NM;var CM=class extends Y{constructor(){super("sui.rpc.v2.RandomnessStateUpdate",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"randomness_round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"random_bytes",kind:"scalar",opt:!0,T:12},{no:4,name:"randomness_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const IM=new CM;var RM=class extends Y{constructor(){super("sui.rpc.v2.ChangeEpoch",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"storage_charge",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"computation_charge",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"epoch_start_timestamp",kind:"message",T:()=>Or},{no:8,name:"system_packages",kind:"message",repeat:2,T:()=>MM}])}};const mA=new RM;var jM=class extends Y{constructor(){super("sui.rpc.v2.SystemPackage",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"modules",kind:"scalar",repeat:2,T:12},{no:3,name:"dependencies",kind:"scalar",repeat:2,T:9}])}};const MM=new jM;var DM=class extends Y{constructor(){super("sui.rpc.v2.GenesisTransaction",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>fo}])}};const UM=new DM;var BM=class extends Y{constructor(){super("sui.rpc.v2.ConsensusCommitPrologue",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"commit_timestamp",kind:"message",T:()=>Or},{no:4,name:"consensus_commit_digest",kind:"scalar",opt:!0,T:9},{no:5,name:"sub_dag_index",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"consensus_determined_version_assignments",kind:"message",T:()=>FM},{no:7,name:"additional_state_digest",kind:"scalar",opt:!0,T:9}])}};const LM=new BM;var zM=class extends Y{constructor(){super("sui.rpc.v2.VersionAssignment",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"start_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const $M=new zM;var VM=class extends Y{constructor(){super("sui.rpc.v2.CanceledTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"version_assignments",kind:"message",repeat:2,T:()=>$M}])}};const PM=new VM;var GM=class extends Y{constructor(){super("sui.rpc.v2.ConsensusDeterminedVersionAssignments",[{no:1,name:"version",kind:"scalar",opt:!0,T:5},{no:3,name:"canceled_transactions",kind:"message",repeat:2,T:()=>PM}])}};const FM=new GM;var HM=class extends Y{constructor(){super("sui.rpc.v2.AuthenticatorStateUpdate",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"round",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"new_active_jwks",kind:"message",repeat:2,T:()=>gA},{no:4,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const qM=new HM;var ZM=class extends Y{constructor(){super("sui.rpc.v2.ActiveJwk",[{no:1,name:"id",kind:"message",T:()=>dA},{no:2,name:"jwk",kind:"message",T:()=>Z8},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0}])}};const gA=new ZM;var YM=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochTransaction",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>JM}])}};const WM=new YM;var XM=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochTransactionKind",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.EndOfEpochTransactionKind.Kind",nM]},{no:2,name:"change_epoch",kind:"message",oneof:"data",T:()=>mA},{no:3,name:"authenticator_state_expire",kind:"message",oneof:"data",T:()=>QM},{no:4,name:"execution_time_observations",kind:"message",oneof:"data",T:()=>t9},{no:5,name:"bridge_chain_id",kind:"scalar",oneof:"data",T:9},{no:6,name:"bridge_object_version",kind:"scalar",oneof:"data",T:4,L:0},{no:7,name:"storage_cost",kind:"scalar",oneof:"data",T:4,L:0}])}};const JM=new XM;var KM=class extends Y{constructor(){super("sui.rpc.v2.AuthenticatorStateExpire",[{no:1,name:"min_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"authenticator_object_initial_shared_version",kind:"scalar",opt:!0,T:4,L:0}])}};const QM=new KM;var e9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionTimeObservations",[{no:1,name:"version",kind:"scalar",opt:!0,T:5},{no:2,name:"observations",kind:"message",repeat:2,T:()=>s9}])}};const t9=new e9;var n9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionTimeObservation",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionTimeObservation.ExecutionTimeObservationKind",sM]},{no:2,name:"move_entry_point",kind:"message",T:()=>pA},{no:3,name:"validator_observations",kind:"message",repeat:2,T:()=>a9}])}};const s9=new n9;var r9=class extends Y{constructor(){super("sui.rpc.v2.ValidatorExecutionTimeObservation",[{no:1,name:"validator",kind:"scalar",opt:!0,T:12},{no:2,name:"duration",kind:"message",T:()=>F8}])}};const a9=new r9;function AS(e){const t=BigInt(e);return{seconds:t/1000n,nanos:Number(t%1000n)*1e6}}function Zf(e){return(e.seconds*1000n+BigInt(Math.floor(e.nanos/1e6))).toString()}function i9(e){switch(e.$kind){case"Pure":return{kind:Qs.PURE,pure:qe(e.Pure.bytes)};case"Object":if(e.Object.$kind==="ImmOrOwnedObject")return{kind:Qs.IMMUTABLE_OR_OWNED,objectId:e.Object.ImmOrOwnedObject.objectId,version:BigInt(e.Object.ImmOrOwnedObject.version),digest:e.Object.ImmOrOwnedObject.digest};if(e.Object.$kind==="SharedObject")return{kind:Qs.SHARED,objectId:e.Object.SharedObject.objectId,version:BigInt(e.Object.SharedObject.initialSharedVersion),mutable:e.Object.SharedObject.mutable};if(e.Object.$kind==="Receiving")return{kind:Qs.RECEIVING,objectId:e.Object.Receiving.objectId,version:BigInt(e.Object.Receiving.version),digest:e.Object.Receiving.digest};throw new Error(`Unknown Object kind: ${JSON.stringify(e.Object)}`);case"UnresolvedObject":const t=e.UnresolvedObject;return{objectId:t.objectId,version:t.version?BigInt(t.version):t.initialSharedVersion?BigInt(t.initialSharedVersion):void 0,digest:t.digest??void 0,mutable:t.mutable??void 0};case"UnresolvedPure":throw new Error("UnresolvedPure arguments must be resolved before converting to gRPC format");case"FundsWithdrawal":{const s=e.FundsWithdrawal;return{kind:Qs.FUNDS_WITHDRAWAL,fundsWithdrawal:{amount:s.reservation.$kind==="MaxAmountU64"?BigInt(s.reservation.MaxAmountU64):void 0,coinType:s.typeArg.$kind==="Balance"?s.typeArg.Balance:void 0,...o9(s.withdrawFrom)}}}default:throw new Error(`Unknown CallArg kind: ${JSON.stringify(e)}`)}}function o9(e){switch(e.$kind){case"Sender":return{source:Ac.SENDER};case"Sponsor":return{source:Ac.SPONSOR};case"SenderAllowance":return{source:Ac.SENDER_ALLOWANCE,funder:e.SenderAllowance.funder,allowance:e.SenderAllowance.allowance};default:throw new Error(`Unknown WithdrawFrom kind: ${JSON.stringify(e)}`)}}function c9(e){switch(e?.source){case Ac.SPONSOR:return{$kind:"Sponsor",Sponsor:!0};case Ac.SENDER_ALLOWANCE:if(!e.funder||!e.allowance)throw new Error(`SENDER_ALLOWANCE withdrawal is missing funder or allowance: ${JSON.stringify(e)}`);return{$kind:"SenderAllowance",SenderAllowance:{funder:e.funder,allowance:e.allowance}};default:return{$kind:"Sender",Sender:!0}}}function Jr(e){if("GasCoin"in e)return{kind:ii.GAS};if("Input"in e)return{kind:ii.INPUT,input:e.Input};if("Result"in e)return{kind:ii.RESULT,result:e.Result};if("NestedResult"in e)return{kind:ii.RESULT,result:e.NestedResult[0],subresult:e.NestedResult[1]};throw new Error(`Unknown Argument: ${JSON.stringify(e)}`)}function l9(e){switch(e.$kind){case"MoveCall":return{command:{oneofKind:"moveCall",moveCall:{package:e.MoveCall.package,module:e.MoveCall.module,function:e.MoveCall.function,typeArguments:e.MoveCall.typeArguments,arguments:e.MoveCall.arguments.map(Jr)}}};case"TransferObjects":return{command:{oneofKind:"transferObjects",transferObjects:{objects:e.TransferObjects.objects.map(Jr),address:Jr(e.TransferObjects.address)}}};case"SplitCoins":return{command:{oneofKind:"splitCoins",splitCoins:{coin:Jr(e.SplitCoins.coin),amounts:e.SplitCoins.amounts.map(Jr)}}};case"MergeCoins":return{command:{oneofKind:"mergeCoins",mergeCoins:{coin:Jr(e.MergeCoins.destination),coinsToMerge:e.MergeCoins.sources.map(Jr)}}};case"Publish":return{command:{oneofKind:"publish",publish:{modules:e.Publish.modules.map(t=>qe(t)),dependencies:e.Publish.dependencies}}};case"MakeMoveVec":return{command:{oneofKind:"makeMoveVector",makeMoveVector:{elementType:e.MakeMoveVec.type??void 0,elements:e.MakeMoveVec.elements.map(Jr)}}};case"Upgrade":return{command:{oneofKind:"upgrade",upgrade:{modules:e.Upgrade.modules.map(t=>qe(t)),dependencies:e.Upgrade.dependencies,package:e.Upgrade.package,ticket:Jr(e.Upgrade.ticket)}}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(e)}`)}}function yA(e){const t={version:1,kind:{data:{oneofKind:"programmableTransaction",programmableTransaction:{inputs:e.inputs.map(i9),commands:e.commands.map(l9)}}}};e.sender&&(t.sender=e.sender);const s=e.gasData.owner??e.sender;if(t.gasPayment={objects:e.gasData.payment?e.gasData.payment.map(r=>({objectId:r.objectId,version:BigInt(r.version),digest:r.digest})):[],price:e.gasData.price?BigInt(e.gasData.price):void 0,budget:e.gasData.budget?BigInt(e.gasData.budget):void 0},s&&(t.gasPayment.owner=s),e.expiration){if("None"in e.expiration)t.expiration={kind:ca.NONE};else if(e.expiration.$kind==="Epoch")t.expiration={kind:ca.EPOCH,epoch:BigInt(e.expiration.Epoch)};else if(e.expiration.$kind==="ValidDuring"||e.expiration.$kind==="Validity"){const r=e.expiration.$kind==="ValidDuring"?e.expiration.ValidDuring:e.expiration.Validity,i=e.expiration.$kind==="Validity"?e.expiration.Validity.allowedProposers:null;t.expiration={kind:e.expiration.$kind==="ValidDuring"?ca.VALID_DURING:ca.VALIDITY,minEpoch:r.minEpoch!=null?BigInt(r.minEpoch):void 0,epoch:r.maxEpoch!=null?BigInt(r.maxEpoch):void 0,minTimestamp:r.minTimestamp!=null?AS(r.minTimestamp):void 0,maxTimestamp:r.maxTimestamp!=null?AS(r.maxTimestamp):void 0,chain:r.chain,nonce:r.nonce,allowedProposers:i?{epoch:BigInt(i.epoch),proposers:G4(i.proposers)}:void 0}}}return t}function u9(e,t,s){const r=vA(t);s?.onlyTransactionKind?e.applyResolvedData({...r,sender:null,gasData:{budget:null,owner:null,payment:null,price:null},expiration:null}):e.applyResolvedData(r)}function d9(e){const t=e.getData();return t.sender||(t.sender="0x0000000000000000000000000000000000000000000000000000000000000000"),yA(t)}function f9(e){switch(e.kind){case Qs.PURE:return{$kind:"Pure",Pure:{bytes:st(e.pure)}};case Qs.IMMUTABLE_OR_OWNED:return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case Qs.SHARED:return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{objectId:e.objectId,initialSharedVersion:e.version.toString(),mutable:e.mutable??!1}}};case Qs.RECEIVING:return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{objectId:e.objectId,version:e.version.toString(),digest:e.digest}}};case Qs.FUNDS_WITHDRAWAL:return{$kind:"FundsWithdrawal",FundsWithdrawal:{reservation:{$kind:"MaxAmountU64",MaxAmountU64:e.fundsWithdrawal?.amount?.toString()??"0"},typeArg:{$kind:"Balance",Balance:e.fundsWithdrawal?.coinType??"0x2::sui::SUI"},withdrawFrom:c9(e.fundsWithdrawal)}};default:throw new Error(`Unknown Input kind: ${JSON.stringify(e)}`)}}function Kr(e){switch(e.kind){case ii.GAS:return{$kind:"GasCoin",GasCoin:!0};case ii.INPUT:return{$kind:"Input",Input:e.input};case ii.RESULT:return e.subresult!=null?{$kind:"NestedResult",NestedResult:[e.result,e.subresult]}:{$kind:"Result",Result:e.result};default:throw new Error(`Unknown Argument kind: ${JSON.stringify(e)}`)}}function h9(e){const t=e.command;if(!t)throw new Error("Command is missing");switch(t.oneofKind){case"moveCall":return{$kind:"MoveCall",MoveCall:{package:t.moveCall.package,module:t.moveCall.module,function:t.moveCall.function,typeArguments:t.moveCall.typeArguments??[],arguments:t.moveCall.arguments.map(Kr)}};case"transferObjects":return{$kind:"TransferObjects",TransferObjects:{objects:t.transferObjects.objects.map(Kr),address:Kr(t.transferObjects.address)}};case"splitCoins":return{$kind:"SplitCoins",SplitCoins:{coin:Kr(t.splitCoins.coin),amounts:t.splitCoins.amounts.map(Kr)}};case"mergeCoins":return{$kind:"MergeCoins",MergeCoins:{destination:Kr(t.mergeCoins.coin),sources:t.mergeCoins.coinsToMerge.map(Kr)}};case"publish":return{$kind:"Publish",Publish:{modules:t.publish.modules.map(s=>st(s)),dependencies:t.publish.dependencies??[]}};case"makeMoveVector":return{$kind:"MakeMoveVec",MakeMoveVec:{type:t.makeMoveVector.elementType??null,elements:t.makeMoveVector.elements.map(Kr)}};case"upgrade":return{$kind:"Upgrade",Upgrade:{modules:t.upgrade.modules.map(s=>st(s)),dependencies:t.upgrade.dependencies??[],package:t.upgrade.package,ticket:Kr(t.upgrade.ticket)}};default:throw new Error(`Unknown Command kind: ${JSON.stringify(t)}`)}}function vA(e){const t=e.kind?.data;if(t?.oneofKind!=="programmableTransaction")throw new Error("Only programmable transactions are supported");const s=t.programmableTransaction.inputs.map(f9),r=t.programmableTransaction.commands.map(h9);let i=null;if(e.expiration)switch(e.expiration.kind){case ca.NONE:i={$kind:"None",None:!0};break;case ca.EPOCH:i={$kind:"Epoch",Epoch:e.expiration.epoch.toString()};break;case ca.VALID_DURING:i={$kind:"ValidDuring",ValidDuring:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?Zf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?Zf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0}};break;case ca.VALIDITY:i={$kind:"Validity",Validity:{minEpoch:e.expiration.minEpoch?.toString()??null,maxEpoch:e.expiration.epoch?.toString()??null,minTimestamp:e.expiration.minTimestamp?Zf(e.expiration.minTimestamp):null,maxTimestamp:e.expiration.maxTimestamp?Zf(e.expiration.maxTimestamp):null,chain:e.expiration.chain??"",nonce:e.expiration.nonce??0,allowedProposers:e.expiration.allowedProposers?{epoch:e.expiration.allowedProposers.epoch?.toString()??"0",proposers:xv(e.expiration.allowedProposers.proposers)}:null}};break;default:throw new Error(`Unknown transaction expiration kind: ${e.expiration.kind}`)}return{version:2,sender:e.sender??null,expiration:i,gasData:{budget:e.gasPayment?.budget?.toString()??null,owner:e.gasPayment?.owner??null,payment:e.gasPayment?.objects?.map(c=>({objectId:c.objectId,version:c.version.toString(),digest:c.digest}))??null,price:e.gasPayment?.price?.toString()??null},inputs:s,commands:r}}async function p9({transactionData:e,client:t,epoch:s,originalTransactionData:r,isTransactionKindOnly:i,doGasSelection:c}){if(i||c||r.expiration||r.gasData.payment?.length!==0||e.expiration&&e.expiration.$kind!=="None")return;const[{chainIdentifier:u},f]=await Promise.all([t.core.getChainIdentifier(),s==null?t.core.getCurrentSystemState():null]),p=BigInt(s??f.systemState.epoch);e.expiration={$kind:"ValidDuring",ValidDuring:{minEpoch:String(p),maxEpoch:String(p+1n),minTimestamp:null,maxTimestamp:null,chain:u,nonce:Math.random()*4294967296>>>0}}}let m9=(function(e){return e[e.EXECUTION_ERROR_KIND_UNKNOWN=0]="EXECUTION_ERROR_KIND_UNKNOWN",e[e.INSUFFICIENT_GAS=1]="INSUFFICIENT_GAS",e[e.INVALID_GAS_OBJECT=2]="INVALID_GAS_OBJECT",e[e.INVARIANT_VIOLATION=3]="INVARIANT_VIOLATION",e[e.FEATURE_NOT_YET_SUPPORTED=4]="FEATURE_NOT_YET_SUPPORTED",e[e.OBJECT_TOO_BIG=5]="OBJECT_TOO_BIG",e[e.PACKAGE_TOO_BIG=6]="PACKAGE_TOO_BIG",e[e.CIRCULAR_OBJECT_OWNERSHIP=7]="CIRCULAR_OBJECT_OWNERSHIP",e[e.INSUFFICIENT_COIN_BALANCE=8]="INSUFFICIENT_COIN_BALANCE",e[e.COIN_BALANCE_OVERFLOW=9]="COIN_BALANCE_OVERFLOW",e[e.PUBLISH_ERROR_NON_ZERO_ADDRESS=10]="PUBLISH_ERROR_NON_ZERO_ADDRESS",e[e.SUI_MOVE_VERIFICATION_ERROR=11]="SUI_MOVE_VERIFICATION_ERROR",e[e.MOVE_PRIMITIVE_RUNTIME_ERROR=12]="MOVE_PRIMITIVE_RUNTIME_ERROR",e[e.MOVE_ABORT=13]="MOVE_ABORT",e[e.VM_VERIFICATION_OR_DESERIALIZATION_ERROR=14]="VM_VERIFICATION_OR_DESERIALIZATION_ERROR",e[e.VM_INVARIANT_VIOLATION=15]="VM_INVARIANT_VIOLATION",e[e.FUNCTION_NOT_FOUND=16]="FUNCTION_NOT_FOUND",e[e.ARITY_MISMATCH=17]="ARITY_MISMATCH",e[e.TYPE_ARITY_MISMATCH=18]="TYPE_ARITY_MISMATCH",e[e.NON_ENTRY_FUNCTION_INVOKED=19]="NON_ENTRY_FUNCTION_INVOKED",e[e.COMMAND_ARGUMENT_ERROR=20]="COMMAND_ARGUMENT_ERROR",e[e.TYPE_ARGUMENT_ERROR=21]="TYPE_ARGUMENT_ERROR",e[e.UNUSED_VALUE_WITHOUT_DROP=22]="UNUSED_VALUE_WITHOUT_DROP",e[e.INVALID_PUBLIC_FUNCTION_RETURN_TYPE=23]="INVALID_PUBLIC_FUNCTION_RETURN_TYPE",e[e.INVALID_TRANSFER_OBJECT=24]="INVALID_TRANSFER_OBJECT",e[e.EFFECTS_TOO_LARGE=25]="EFFECTS_TOO_LARGE",e[e.PUBLISH_UPGRADE_MISSING_DEPENDENCY=26]="PUBLISH_UPGRADE_MISSING_DEPENDENCY",e[e.PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE=27]="PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE",e[e.PACKAGE_UPGRADE_ERROR=28]="PACKAGE_UPGRADE_ERROR",e[e.WRITTEN_OBJECTS_TOO_LARGE=29]="WRITTEN_OBJECTS_TOO_LARGE",e[e.CERTIFICATE_DENIED=30]="CERTIFICATE_DENIED",e[e.SUI_MOVE_VERIFICATION_TIMEDOUT=31]="SUI_MOVE_VERIFICATION_TIMEDOUT",e[e.CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED=32]="CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED",e[e.INPUT_OBJECT_DELETED=33]="INPUT_OBJECT_DELETED",e[e.EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION=34]="EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION",e[e.ADDRESS_DENIED_FOR_COIN=35]="ADDRESS_DENIED_FOR_COIN",e[e.COIN_TYPE_GLOBAL_PAUSE=36]="COIN_TYPE_GLOBAL_PAUSE",e[e.EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE=37]="EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE",e[e.MOVE_VECTOR_ELEM_TOO_BIG=38]="MOVE_VECTOR_ELEM_TOO_BIG",e[e.MOVE_RAW_VALUE_TOO_BIG=39]="MOVE_RAW_VALUE_TOO_BIG",e[e.INVALID_LINKAGE=40]="INVALID_LINKAGE",e[e.INSUFFICIENT_FUNDS_FOR_WITHDRAW=41]="INSUFFICIENT_FUNDS_FOR_WITHDRAW",e[e.NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED=42]="NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED",e})({}),bA=(function(e){return e[e.COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN=0]="COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",e[e.TYPE_MISMATCH=1]="TYPE_MISMATCH",e[e.INVALID_BCS_BYTES=2]="INVALID_BCS_BYTES",e[e.INVALID_USAGE_OF_PURE_ARGUMENT=3]="INVALID_USAGE_OF_PURE_ARGUMENT",e[e.INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION=4]="INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION",e[e.INDEX_OUT_OF_BOUNDS=5]="INDEX_OUT_OF_BOUNDS",e[e.SECONDARY_INDEX_OUT_OF_BOUNDS=6]="SECONDARY_INDEX_OUT_OF_BOUNDS",e[e.INVALID_RESULT_ARITY=7]="INVALID_RESULT_ARITY",e[e.INVALID_GAS_COIN_USAGE=8]="INVALID_GAS_COIN_USAGE",e[e.INVALID_VALUE_USAGE=9]="INVALID_VALUE_USAGE",e[e.INVALID_OBJECT_BY_VALUE=10]="INVALID_OBJECT_BY_VALUE",e[e.INVALID_OBJECT_BY_MUT_REF=11]="INVALID_OBJECT_BY_MUT_REF",e[e.CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED=12]="CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED",e[e.INVALID_ARGUMENT_ARITY=13]="INVALID_ARGUMENT_ARITY",e[e.INVALID_TRANSFER_OBJECT=14]="INVALID_TRANSFER_OBJECT",e[e.INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT=15]="INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT",e[e.ARGUMENT_WITHOUT_VALUE=16]="ARGUMENT_WITHOUT_VALUE",e[e.CANNOT_MOVE_BORROWED_VALUE=17]="CANNOT_MOVE_BORROWED_VALUE",e[e.CANNOT_WRITE_TO_EXTENDED_REFERENCE=18]="CANNOT_WRITE_TO_EXTENDED_REFERENCE",e[e.INVALID_REFERENCE_ARGUMENT=19]="INVALID_REFERENCE_ARGUMENT",e[e.INVALID_TX_CONTEXT=20]="INVALID_TX_CONTEXT",e})({}),g9=(function(e){return e[e.PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN=0]="PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",e[e.UNABLE_TO_FETCH_PACKAGE=1]="UNABLE_TO_FETCH_PACKAGE",e[e.NOT_A_PACKAGE=2]="NOT_A_PACKAGE",e[e.INCOMPATIBLE_UPGRADE=3]="INCOMPATIBLE_UPGRADE",e[e.DIGEST_DOES_NOT_MATCH=4]="DIGEST_DOES_NOT_MATCH",e[e.UNKNOWN_UPGRADE_POLICY=5]="UNKNOWN_UPGRADE_POLICY",e[e.PACKAGE_ID_DOES_NOT_MATCH=6]="PACKAGE_ID_DOES_NOT_MATCH",e})({}),y9=(function(e){return e[e.TYPE_ARGUMENT_ERROR_KIND_UNKNOWN=0]="TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",e[e.TYPE_NOT_FOUND=1]="TYPE_NOT_FOUND",e[e.CONSTRAINT_NOT_SATISFIED=2]="CONSTRAINT_NOT_SATISFIED",e})({});var v9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionStatus",[{no:1,name:"success",kind:"scalar",opt:!0,T:8},{no:2,name:"error",kind:"message",T:()=>T9}])}};const b9=new v9;var w9=class extends Y{constructor(){super("sui.rpc.v2.ExecutionError",[{no:1,name:"description",kind:"scalar",opt:!0,T:9},{no:2,name:"command",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ExecutionError.ExecutionErrorKind",m9]},{no:4,name:"abort",kind:"message",oneof:"errorDetails",T:()=>S9},{no:5,name:"size_error",kind:"message",oneof:"errorDetails",T:()=>x9},{no:6,name:"command_argument_error",kind:"message",oneof:"errorDetails",T:()=>U9},{no:7,name:"type_argument_error",kind:"message",oneof:"errorDetails",T:()=>$9},{no:8,name:"package_upgrade_error",kind:"message",oneof:"errorDetails",T:()=>L9},{no:9,name:"index_error",kind:"message",oneof:"errorDetails",T:()=>wA},{no:10,name:"object_id",kind:"scalar",oneof:"errorDetails",T:9},{no:11,name:"coin_deny_list_error",kind:"message",oneof:"errorDetails",T:()=>R9},{no:12,name:"congested_objects",kind:"message",oneof:"errorDetails",T:()=>M9}])}};const T9=new w9;var E9=class extends Y{constructor(){super("sui.rpc.v2.MoveAbort",[{no:1,name:"abort_code",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"location",kind:"message",T:()=>k9},{no:3,name:"clever_error",kind:"message",T:()=>O9}])}};const S9=new E9;var _9=class extends Y{constructor(){super("sui.rpc.v2.MoveLocation",[{no:1,name:"package",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"function",kind:"scalar",opt:!0,T:13},{no:4,name:"instruction",kind:"scalar",opt:!0,T:13},{no:5,name:"function_name",kind:"scalar",opt:!0,T:9}])}};const k9=new _9;var A9=class extends Y{constructor(){super("sui.rpc.v2.CleverError",[{no:1,name:"error_code",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"line_number",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"constant_name",kind:"scalar",opt:!0,T:9},{no:4,name:"constant_type",kind:"scalar",opt:!0,T:9},{no:5,name:"rendered",kind:"scalar",oneof:"value",T:9},{no:6,name:"raw",kind:"scalar",oneof:"value",T:12}])}};const O9=new A9;var N9=class extends Y{constructor(){super("sui.rpc.v2.SizeError",[{no:1,name:"size",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"max_size",kind:"scalar",opt:!0,T:4,L:0}])}};const x9=new N9;var C9=class extends Y{constructor(){super("sui.rpc.v2.IndexError",[{no:1,name:"index",kind:"scalar",opt:!0,T:13},{no:2,name:"subresult",kind:"scalar",opt:!0,T:13}])}};const wA=new C9;var I9=class extends Y{constructor(){super("sui.rpc.v2.CoinDenyListError",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const R9=new I9;var j9=class extends Y{constructor(){super("sui.rpc.v2.CongestedObjects",[{no:1,name:"objects",kind:"scalar",repeat:2,T:9}])}};const M9=new j9;var D9=class extends Y{constructor(){super("sui.rpc.v2.CommandArgumentError",[{no:1,name:"argument",kind:"scalar",opt:!0,T:13},{no:2,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CommandArgumentError.CommandArgumentErrorKind",bA]},{no:3,name:"index_error",kind:"message",T:()=>wA}])}};const U9=new D9;var B9=class extends Y{constructor(){super("sui.rpc.v2.PackageUpgradeError",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.PackageUpgradeError.PackageUpgradeErrorKind",g9]},{no:2,name:"package_id",kind:"scalar",opt:!0,T:9},{no:3,name:"digest",kind:"scalar",opt:!0,T:9},{no:4,name:"policy",kind:"scalar",opt:!0,T:13},{no:5,name:"ticket_id",kind:"scalar",opt:!0,T:9}])}};const L9=new B9;var z9=class extends Y{constructor(){super("sui.rpc.v2.TypeArgumentError",[{no:1,name:"type_argument",kind:"scalar",opt:!0,T:13},{no:2,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.TypeArgumentError.TypeArgumentErrorKind",y9]}])}};const $9=new z9;var V9=class extends Y{constructor(){super("sui.rpc.v2.GasCostSummary",[{no:1,name:"computation_cost",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"storage_cost",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"storage_rebate",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0}])}};const TA=new V9;let Th=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.EXISTS=2]="EXISTS",e})({}),wc=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.DOES_NOT_EXIST=1]="DOES_NOT_EXIST",e[e.OBJECT_WRITE=2]="OBJECT_WRITE",e[e.PACKAGE_WRITE=3]="PACKAGE_WRITE",e[e.ACCUMULATOR_WRITE=4]="ACCUMULATOR_WRITE",e})({}),Tu=(function(e){return e[e.ID_OPERATION_UNKNOWN=0]="ID_OPERATION_UNKNOWN",e[e.NONE=1]="NONE",e[e.CREATED=2]="CREATED",e[e.DELETED=3]="DELETED",e})({}),P9=(function(e){return e[e.ACCUMULATOR_OPERATION_UNKNOWN=0]="ACCUMULATOR_OPERATION_UNKNOWN",e[e.MERGE=1]="MERGE",e[e.SPLIT=2]="SPLIT",e})({}),G9=(function(e){return e[e.ACCUMULATOR_VALUE_UNKNOWN=0]="ACCUMULATOR_VALUE_UNKNOWN",e[e.INTEGER=1]="INTEGER",e[e.INTEGER_TUPLE=2]="INTEGER_TUPLE",e[e.EVENT_DIGEST=3]="EVENT_DIGEST",e})({}),Wi=(function(e){return e[e.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN=0]="UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",e[e.READ_ONLY_ROOT=1]="READ_ONLY_ROOT",e[e.MUTATE_CONSENSUS_STREAM_ENDED=2]="MUTATE_CONSENSUS_STREAM_ENDED",e[e.READ_CONSENSUS_STREAM_ENDED=3]="READ_CONSENSUS_STREAM_ENDED",e[e.CANCELED=4]="CANCELED",e[e.PER_EPOCH_CONFIG=5]="PER_EPOCH_CONFIG",e})({});var F9=class extends Y{constructor(){super("sui.rpc.v2.TransactionEffects",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"status",kind:"message",T:()=>b9},{no:5,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"gas_used",kind:"message",T:()=>TA},{no:7,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"gas_object",kind:"message",T:()=>OS},{no:9,name:"events_digest",kind:"scalar",opt:!0,T:9},{no:10,name:"dependencies",kind:"scalar",repeat:2,T:9},{no:11,name:"lamport_version",kind:"scalar",opt:!0,T:4,L:0},{no:12,name:"changed_objects",kind:"message",repeat:2,T:()=>OS},{no:13,name:"unchanged_consensus_objects",kind:"message",repeat:2,T:()=>K9},{no:14,name:"auxiliary_data_digest",kind:"scalar",opt:!0,T:9},{no:15,name:"unchanged_loaded_runtime_objects",kind:"message",repeat:2,T:()=>hA}])}};const H9=new F9;var q9=class extends Y{constructor(){super("sui.rpc.v2.ChangedObject",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"input_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.InputObjectState",Th,"INPUT_OBJECT_STATE_"]},{no:3,name:"input_version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"input_digest",kind:"scalar",opt:!0,T:9},{no:5,name:"input_owner",kind:"message",T:()=>Jy},{no:6,name:"output_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.OutputObjectState",wc,"OUTPUT_OBJECT_STATE_"]},{no:7,name:"output_version",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"output_digest",kind:"scalar",opt:!0,T:9},{no:9,name:"output_owner",kind:"message",T:()=>Jy},{no:12,name:"accumulator_write",kind:"message",T:()=>X9},{no:10,name:"id_operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.ChangedObject.IdOperation",Tu]},{no:11,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const OS=new q9;var Z9=class extends Y{constructor(){super("sui.rpc.v2.EventDigestEntry",[{no:1,name:"event_index",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const Y9=new Z9;var W9=class extends Y{constructor(){super("sui.rpc.v2.AccumulatorWrite",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"accumulator_type",kind:"scalar",opt:!0,T:9},{no:3,name:"operation",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorOperation",P9]},{no:4,name:"value_kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.AccumulatorWrite.AccumulatorValue",G9]},{no:5,name:"integer_value",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"integer_tuple",kind:"scalar",repeat:1,T:4,L:0},{no:7,name:"event_digest_value",kind:"message",repeat:2,T:()=>Y9}])}};const X9=new W9;var J9=class extends Y{constructor(){super("sui.rpc.v2.UnchangedConsensusObject",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.UnchangedConsensusObject.UnchangedConsensusObjectKind",Wi]},{no:2,name:"object_id",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"digest",kind:"scalar",opt:!0,T:9},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const K9=new J9,Q9=50;function NS(e){if(e.after!=null&&e.before!=null)throw new Error("Only one of `after` or `before` may be provided");const t=e.order?e.order==="descending":e.before!=null;if(e.after!=null&&t)throw new Error("`after` can not be combined with descending queries");if(e.before!=null&&!t)throw new Error("`before` can not be combined with ascending queries");return{descending:t,after:e.after??void 0,before:e.before??void 0,limit:e.limit??Q9}}function eD(e,t){if(e?.$kind==="function"&&(t.after!=null||t.before!=null)&&(!e.module||!e.function))throw new Error("Paginating transactions filtered by function requires a fully qualified `package::module::function`")}async function tD(e,t,s){if(EA(t,["sender","function"],"transaction"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};const[r,i,c,...u]=t.function.split("::");if(!r||u.length>0||i===""||c==="")throw new Error(`Invalid function filter "${t.function}": expected "package", "package::module", or "package::module::function"`);return{$kind:"function",package:ye((await e.resolvePackage({package:r,signal:s})).package),module:i,function:c}}async function nD(e,t,s){if(EA(t,["sender","emitModule","eventType"],"event"),t.sender!=null)return{$kind:"sender",sender:ye(t.sender)};if(t.emitModule!=null){const[c,u,...f]=t.emitModule.split("::");if(!c||!u||f.length>0)throw new Error(`Invalid emitModule filter "${t.emitModule}": expected "package::module"`);return{$kind:"emitModule",package:ye((await e.resolvePackage({package:c,signal:s})).package),module:u}}const r=t.eventType,i=r.split("::");if(i.length===2&&i.every(c=>c!==""))return{$kind:"eventTypeModule",package:ye((await e.resolvePackage({package:i[0],signal:s})).package),module:i[1]};if(i.length<3||i.some(c=>c===""))throw new Error(`Invalid eventType filter "${r}": expected "package::module" or a fully qualified type name`);return{$kind:"eventType",eventType:(await e.resolveType({type:r,signal:s})).type}}function EA(e,t,s){const r=t.filter(i=>e[i]!=null);if(r.length!==1)throw new Error(`A ${s} filter must specify exactly one of ${t.join(", ")}${r.length?` (got ${r.join(", ")})`:""}`)}var sD=class extends Y{constructor(){super("sui.rpc.v2.BalanceChange",[{no:1,name:"address",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"amount",kind:"scalar",opt:!0,T:9}])}};const rD=new sD;var aD=class extends Y{constructor(){super("sui.rpc.v2.TransactionEvents",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"events",kind:"message",repeat:2,T:()=>sb}])}};const iD=new aD;var oD=class extends Y{constructor(){super("sui.rpc.v2.Event",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module",kind:"scalar",opt:!0,T:9},{no:3,name:"sender",kind:"scalar",opt:!0,T:9},{no:4,name:"event_type",kind:"scalar",opt:!0,T:9},{no:5,name:"contents",kind:"message",T:()=>Ts},{no:6,name:"json",kind:"message",T:()=>hn},{no:7,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"transaction_digest",kind:"scalar",opt:!0,T:9},{no:9,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"event_index",kind:"scalar",opt:!0,T:13}])}};const sb=new oD;let Np=(function(e){return e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e[e.SECP256R1=2]="SECP256R1",e[e.MULTISIG=3]="MULTISIG",e[e.BLS12381=4]="BLS12381",e[e.ZKLOGIN=5]="ZKLOGIN",e[e.PASSKEY=6]="PASSKEY",e})({});var cD=class extends Y{constructor(){super("sui.rpc.v2.UserSignature",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:3,name:"simple",kind:"message",oneof:"signature",T:()=>rb},{no:4,name:"multisig",kind:"message",oneof:"signature",T:()=>vD},{no:5,name:"zklogin",kind:"message",oneof:"signature",T:()=>_A},{no:6,name:"passkey",kind:"message",oneof:"signature",T:()=>kA}])}};const xp=new cD;var lD=class extends Y{constructor(){super("sui.rpc.v2.SimpleSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"public_key",kind:"scalar",opt:!0,T:12}])}};const rb=new lD;var uD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginPublicIdentifier",[{no:1,name:"iss",kind:"scalar",opt:!0,T:9},{no:2,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const SA=new uD;var dD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMemberPublicKey",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"public_key",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>SA}])}};const fD=new dD;var hD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMember",[{no:1,name:"public_key",kind:"message",T:()=>fD},{no:2,name:"weight",kind:"scalar",opt:!0,T:13}])}};const pD=new hD;var mD=class extends Y{constructor(){super("sui.rpc.v2.MultisigCommittee",[{no:1,name:"members",kind:"message",repeat:2,T:()=>pD},{no:2,name:"threshold",kind:"scalar",opt:!0,T:13}])}};const gD=new mD;var yD=class extends Y{constructor(){super("sui.rpc.v2.MultisigAggregatedSignature",[{no:1,name:"signatures",kind:"message",repeat:2,T:()=>wD},{no:2,name:"bitmap",kind:"scalar",opt:!0,T:13},{no:3,name:"legacy_bitmap",kind:"scalar",opt:!0,T:12},{no:4,name:"committee",kind:"message",T:()=>gD}])}};const vD=new yD;var bD=class extends Y{constructor(){super("sui.rpc.v2.MultisigMemberSignature",[{no:1,name:"scheme",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SignatureScheme",Np]},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"zklogin",kind:"message",T:()=>_A},{no:4,name:"passkey",kind:"message",T:()=>kA}])}};const wD=new bD;var TD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginAuthenticator",[{no:1,name:"inputs",kind:"message",T:()=>SD},{no:2,name:"max_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"signature",kind:"message",T:()=>rb},{no:4,name:"public_identifier",kind:"message",T:()=>SA},{no:5,name:"jwk_id",kind:"message",T:()=>dA}])}};const _A=new TD;var ED=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginInputs",[{no:1,name:"proof_points",kind:"message",T:()=>kD},{no:2,name:"iss_base64_details",kind:"message",T:()=>OD},{no:3,name:"header_base64",kind:"scalar",opt:!0,T:9},{no:4,name:"address_seed",kind:"scalar",opt:!0,T:9}])}};const SD=new ED;var _D=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginProof",[{no:1,name:"a",kind:"message",T:()=>xS},{no:2,name:"b",kind:"message",T:()=>CD},{no:3,name:"c",kind:"message",T:()=>xS}])}};const kD=new _D;var AD=class extends Y{constructor(){super("sui.rpc.v2.ZkLoginClaim",[{no:1,name:"value",kind:"scalar",opt:!0,T:9},{no:2,name:"index_mod_4",kind:"scalar",opt:!0,T:13}])}};const OD=new AD;var ND=class extends Y{constructor(){super("sui.rpc.v2.CircomG1",[{no:1,name:"e0",kind:"scalar",opt:!0,T:9},{no:2,name:"e1",kind:"scalar",opt:!0,T:9},{no:3,name:"e2",kind:"scalar",opt:!0,T:9}])}};const xS=new ND;var xD=class extends Y{constructor(){super("sui.rpc.v2.CircomG2",[{no:1,name:"e00",kind:"scalar",opt:!0,T:9},{no:2,name:"e01",kind:"scalar",opt:!0,T:9},{no:3,name:"e10",kind:"scalar",opt:!0,T:9},{no:4,name:"e11",kind:"scalar",opt:!0,T:9},{no:5,name:"e20",kind:"scalar",opt:!0,T:9},{no:6,name:"e21",kind:"scalar",opt:!0,T:9}])}};const CD=new xD;var ID=class extends Y{constructor(){super("sui.rpc.v2.PasskeyAuthenticator",[{no:1,name:"authenticator_data",kind:"scalar",opt:!0,T:12},{no:2,name:"client_data_json",kind:"scalar",opt:!0,T:9},{no:3,name:"signature",kind:"message",T:()=>rb}])}};const kA=new ID;var RD=class extends Y{constructor(){super("sui.rpc.v2.ValidatorCommittee",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"members",kind:"message",repeat:2,T:()=>AA}])}};const jD=new RD;var MD=class extends Y{constructor(){super("sui.rpc.v2.ValidatorCommitteeMember",[{no:1,name:"public_key",kind:"scalar",opt:!0,T:12},{no:2,name:"weight",kind:"scalar",opt:!0,T:4,L:0}])}};const AA=new MD;var DD=class extends Y{constructor(){super("sui.rpc.v2.ValidatorAggregatedSignature",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"signature",kind:"scalar",opt:!0,T:12},{no:3,name:"bitmap",kind:"scalar",opt:!0,T:12}])}};const UD=new DD;var BD=class extends Y{constructor(){super("sui.rpc.v2.ExecutedTransaction",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"transaction",kind:"message",T:()=>nb},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:4,name:"effects",kind:"message",T:()=>H9},{no:5,name:"events",kind:"message",T:()=>iD},{no:6,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"timestamp",kind:"message",T:()=>Or},{no:8,name:"balance_changes",kind:"message",repeat:2,T:()=>rD},{no:9,name:"objects",kind:"message",T:()=>fA},{no:10,name:"transaction_index",kind:"scalar",opt:!0,T:4,L:0}])}};const ha=new BD;var LD=class extends Y{constructor(){super("google.protobuf.FieldMask",[{no:1,name:"paths",kind:"scalar",repeat:2,T:9}])}internalJsonWrite(e,t){const s=/[A-Z]|(_([.0-9_]|$))/g;return e.paths.map(r=>{if(s.test(r))throw new Error('Unable to encode FieldMask to JSON. lowerCamelCase of path name "'+r+'" is irreversible.');return Hh(r)}).join(",")}internalJsonRead(e,t,s){if(typeof e!="string")throw new Error("Unable to parse FieldMask from JSON "+ma(e)+". Expected string.");if(s||(s=this.create()),e==="")return s;let r=i=>{if(i.includes("_"))throw new Error("Unable to parse FieldMask from JSON. Path names must be lowerCamelCase.");return i.replace(/[A-Z]/g,c=>"_"+c.toLowerCase())};return s.paths=e.split(",").map(r),s}};const Bn=new LD;let Eu=(function(e){return e[e.ENABLED=0]="ENABLED",e[e.DISABLED=1]="DISABLED",e})({});var zD=class extends Y{constructor(){super("sui.rpc.v2.ExecuteTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>nb},{no:2,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:3,name:"read_mask",kind:"message",T:()=>Bn}])}};const $D=new zD;var VD=class extends Y{constructor(){super("sui.rpc.v2.ExecuteTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha}])}};const PD=new VD;var GD=class extends Y{constructor(){super("sui.rpc.v2.SimulateTransactionRequest",[{no:1,name:"transaction",kind:"message",T:()=>nb},{no:2,name:"read_mask",kind:"message",T:()=>Bn},{no:3,name:"checks",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.SimulateTransactionRequest.TransactionChecks",Eu]},{no:4,name:"do_gas_selection",kind:"scalar",opt:!0,T:8}])}};const FD=new GD;var HD=class extends Y{constructor(){super("sui.rpc.v2.SimulateTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"command_outputs",kind:"message",repeat:2,T:()=>ZD},{no:3,name:"suggested_gas_price",kind:"scalar",opt:!0,T:4,L:0}])}};const OA=new HD;var qD=class extends Y{constructor(){super("sui.rpc.v2.CommandResult",[{no:1,name:"return_values",kind:"message",repeat:2,T:()=>CS},{no:2,name:"mutated_by_ref",kind:"message",repeat:2,T:()=>CS}])}};const ZD=new qD;var YD=class extends Y{constructor(){super("sui.rpc.v2.CommandOutput",[{no:1,name:"argument",kind:"message",T:()=>Ar},{no:2,name:"value",kind:"message",T:()=>Ts},{no:3,name:"json",kind:"message",T:()=>hn}])}};const CS=new YD,P0=new gi("sui.rpc.v2.TransactionExecutionService",[{name:"ExecuteTransaction",options:{},I:$D,O:PD},{name:"SimulateTransaction",options:{},I:FD,O:OA}]);let Ky=(function(e){return e[e.ASCENDING=0]="ASCENDING",e[e.DESCENDING=1]="DESCENDING",e})({}),Su=(function(e){return e[e.UNKNOWN=0]="UNKNOWN",e[e.ITEM_LIMIT=1]="ITEM_LIMIT",e[e.SCAN_LIMIT=2]="SCAN_LIMIT",e[e.CHECKPOINT_BOUND=3]="CHECKPOINT_BOUND",e[e.CURSOR_BOUND=4]="CURSOR_BOUND",e[e.LEDGER_TIP=5]="LEDGER_TIP",e})({});var WD=class extends Y{constructor(){super("sui.rpc.v2.QueryOptions",[{no:1,name:"limit",kind:"scalar",opt:!0,T:13},{no:2,name:"after",kind:"scalar",opt:!0,T:12},{no:3,name:"before",kind:"scalar",opt:!0,T:12},{no:4,name:"ordering",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.Ordering",Ky,"ORDERING_"]}])}};const ab=new WD;var XD=class extends Y{constructor(){super("sui.rpc.v2.Watermark",[{no:1,name:"cursor",kind:"scalar",opt:!0,T:12},{no:2,name:"checkpoint",kind:"scalar",opt:!0,T:4,L:0}])}};const rd=new XD;var JD=class extends Y{constructor(){super("sui.rpc.v2.QueryEnd",[{no:1,name:"reason",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.QueryEndReason",Su,"QUERY_END_REASON_"]}])}};const ib=new JD;function KD(e){return{terms:[{literals:[e.$kind==="sender"?{negated:!1,predicate:{oneofKind:"sender",sender:{address:e.sender}}}:{negated:!1,predicate:{oneofKind:"moveCall",moveCall:{function:[e.package,e.module,e.function].filter(Boolean).join("::")}}}]}]}}function QD(e){return{terms:[{literals:[e.$kind==="sender"?{negated:!1,predicate:{oneofKind:"sender",sender:{address:e.sender}}}:e.$kind==="emitModule"?{negated:!1,predicate:{oneofKind:"emitModule",emitModule:{module:`${e.package}::${e.module}`}}}:{negated:!1,predicate:{oneofKind:"eventType",eventType:{eventType:e.$kind==="eventTypeModule"?`${e.package}::${e.module}`:e.eventType}}}]}]}}function eU(e){if(typeof e!="object"||e===null)return!1;const{code:t,message:s}=e;return typeof t!="string"||typeof s!="string"?!1:t===we[we.NOT_FOUND]?!0:t!==we[we.RESOURCE_EXHAUSTED]?!1:s==="name has expired"?!0:!Jj(e)&&s==="name%20has%20expired"}var tU=class extends r8{#e;constructor({client:e,...t}){super(t),this.#e=e}async getObjects(e){const t=jh(e.objectIds,50),s=[],r=["owner","object_type","digest","version","object_id"];e.include?.content&&r.push("contents"),e.include?.previousTransaction&&r.push("previous_transaction"),e.include?.objectBcs&&r.push("bcs"),e.include?.json&&r.push("json"),e.include?.display&&r.push("display");for(const i of t){const c=await this.#e.ledgerService.batchGetObjects({requests:i.map(u=>({objectId:u})),readMask:{paths:r}},{abort:e.signal});s.push(...c.response.objects.map((u,f)=>{if(u.result.oneofKind==="error"){const O=u.result.error;return O.code===we.NOT_FOUND?new uh("notExists",O.message,{cause:O,reason:"notFound",objectId:i[f]}):new uh(we[O.code]??"unknown",O.message,{cause:O,reason:"unknown",objectId:i[f]})}if(u.result.oneofKind!=="object")return new uh("unknown","Unexpected result type",{reason:"unknown",objectId:i[f]});const p=u.result.object.contents?.value??void 0,m=u.result.object.bcs?.value??void 0,g=u.result.object.objectType,y=g&&g.includes("::")?De(g):g??"",b=e.include?.json?u.result.object.json?hn.toJson(u.result.object.json):null:void 0,S=RS(e.include?.display,u.result.object.display);return{objectId:u.result.object.objectId,version:u.result.object.version?.toString(),digest:u.result.object.digest,content:p,owner:Ji(u.result.object.owner),type:y,previousTransaction:u.result.object.previousTransaction??void 0,objectBcs:m,json:b,display:S}}))}return{objects:s}}async listOwnedObjects(e){const t=["owner","object_type","digest","version","object_id"];e.include?.content&&t.push("contents"),e.include?.previousTransaction&&t.push("previous_transaction"),e.include?.objectBcs&&t.push("bcs"),e.include?.json&&t.push("json"),e.include?.display&&t.push("display");const s=await this.#e.stateService.listOwnedObjects({owner:e.owner,objectType:e.type?(await this.mvr.resolveType({type:e.type,signal:e.signal})).type:void 0,pageToken:e.cursor?qe(e.cursor):void 0,pageSize:e.limit,readMask:{paths:t}},{abort:e.signal});return{objects:s.response.objects.map(r=>({objectId:r.objectId,version:r.version?.toString(),digest:r.digest,content:r.contents?.value,owner:Ji(r.owner),type:r.objectType,previousTransaction:r.previousTransaction??void 0,objectBcs:r.bcs?.value,json:e.include?.json?r.json?hn.toJson(r.json):null:void 0,display:RS(e.include?.display,r.display)})),cursor:s.response.nextPageToken?st(s.response.nextPageToken):null,hasNextPage:s.response.nextPageToken!==void 0}}async listCoins(e){const t=["owner","object_type","digest","version","object_id","balance"],s=e.coinType??Bh,r=await this.#e.stateService.listOwnedObjects({owner:e.owner,objectType:`0x2::coin::Coin<${(await this.mvr.resolveType({type:s,signal:e.signal})).type}>`,pageToken:e.cursor?qe(e.cursor):void 0,pageSize:e.limit,readMask:{paths:t}},{abort:e.signal});return{objects:r.response.objects.map(i=>({objectId:i.objectId,version:i.version?.toString(),digest:i.digest,owner:Ji(i.owner),type:i.objectType,balance:i.balance?.toString()})),cursor:r.response.nextPageToken?st(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}async getBalance(e){const t=e.coinType??Bh,s=await this.#e.stateService.getBalance({owner:e.owner,coinType:(await this.mvr.resolveType({type:t,signal:e.signal})).type},{abort:e.signal});return{balance:{balance:s.response.balance?.balance?.toString()??"0",coinType:s.response.balance?.coinType??t,coinBalance:s.response.balance?.coinBalance?.toString()??"0",addressBalance:s.response.balance?.addressBalance?.toString()??"0"}}}async getCoinMetadata(e){const t=(await this.mvr.resolveType({type:e.coinType,signal:e.signal})).type;let s;try{({response:s}=await this.#e.stateService.getCoinInfo({coinType:t},{abort:e.signal}))}catch(r){if(e.signal?.aborted)throw r;return{coinMetadata:null}}return s.metadata?{coinMetadata:{id:s.metadata.id??null,decimals:s.metadata.decimals??0,name:s.metadata.name??"",symbol:s.metadata.symbol??"",description:s.metadata.description??"",iconUrl:s.metadata.iconUrl??null}}:{coinMetadata:null}}async listBalances(e){const t=await this.#e.stateService.listBalances({owner:e.owner,pageToken:e.cursor?qe(e.cursor):void 0,pageSize:e.limit},{abort:e.signal});return{hasNextPage:!!t.response.nextPageToken,cursor:t.response.nextPageToken?st(t.response.nextPageToken):null,balances:t.response.balances.map(s=>({balance:s.balance?.toString()??"0",coinType:s.coinType,coinBalance:s.coinBalance?.toString()??"0",addressBalance:s.addressBalance?.toString()??"0"}))}}async getTransaction(e){try{const{response:t}=await this.#e.ledgerService.getTransaction({digest:e.digest,readMask:{paths:Yf(e.include)}},{abort:e.signal});if(!t.transaction)throw new WE("notFound",e.digest);return G0(Eh(t.transaction,{include:e.include}),e.include,()=>ha.toJson(t.transaction))}catch(t){throw t instanceof gt&&t.code===we[we.NOT_FOUND]?new WE("notFound",e.digest,{cause:t}):t}}async executeTransaction(e){const{response:t}=await this.#e.transactionExecutionService.executeTransaction({transaction:{bcs:{value:e.transaction}},signatures:e.signatures.map(s=>({bcs:{value:qe(s)},signature:{oneofKind:void 0}})),readMask:{paths:Yf(e.include)}},{abort:e.signal});return G0(Eh(t.transaction,{include:e.include}),e.include,()=>ha.toJson(t.transaction))}async simulateTransaction(e){const t=Yf(e.include,"transaction.");e.include?.commandResults&&t.push("command_outputs"),e.transaction instanceof Uint8Array||await e.transaction.prepareForSerialization({client:this});const s=e.doGasSelection??(e.transaction instanceof Uint8Array?f8(e.transaction):e.transaction.getData().gasData.payment?.length===0),{response:r}=await this.#e.transactionExecutionService.simulateTransaction({transaction:e.transaction instanceof Uint8Array?{bcs:{value:e.transaction}}:d9(e.transaction),readMask:{paths:t},doGasSelection:s,checks:e.checksEnabled===!1?Eu.DISABLED:Eu.ENABLED},{abort:e.signal});return G0(aU(r,{include:e.include}),e.include,()=>OA.toJson(r))}async getReferenceGasPrice(e){return{referenceGasPrice:(await this.#e.ledgerService.getEpoch({readMask:{paths:["reference_gas_price"]}},{abort:e?.signal})).response.epoch?.referenceGasPrice?.toString()??""}}async getProtocolConfig(e){const t=(await this.#e.ledgerService.getEpoch({readMask:{paths:["protocol_config"]}},{abort:e?.signal})).response.epoch?.protocolConfig;if(!t)throw new Error("Protocol config not found in response");const s={...t.featureFlags},r={};if(t.attributes)for(const[i,c]of Object.entries(t.attributes))r[i]=c??null;return{protocolConfig:{protocolVersion:t.protocolVersion?.toString()??null,featureFlags:s,attributes:r}}}async getCurrentSystemState(e){const t=(await this.#e.ledgerService.getEpoch({readMask:{paths:["system_state.version","system_state.epoch","system_state.protocol_version","system_state.reference_gas_price","system_state.epoch_start_timestamp_ms","system_state.safe_mode","system_state.safe_mode_storage_rewards","system_state.safe_mode_computation_rewards","system_state.safe_mode_storage_rebates","system_state.safe_mode_non_refundable_storage_fee","system_state.parameters","system_state.storage_fund","system_state.stake_subsidy"]}},{abort:e?.signal})).response.epoch,s=t?.systemState;if(!s)throw new Error("System state not found in response");const r=t?.start?.seconds?Number(t.start.seconds)*1e3+Math.floor((t.start.nanos||0)/1e6):s.epochStartTimestampMs?Number(s.epochStartTimestampMs):null;return{systemState:{systemStateVersion:s.version?.toString()??null,epoch:s.epoch?.toString()??null,protocolVersion:s.protocolVersion?.toString()??null,referenceGasPrice:s.referenceGasPrice?.toString()??null,epochStartTimestampMs:r.toString(),safeMode:s.safeMode??!1,safeModeStorageRewards:s.safeModeStorageRewards?.toString()??null,safeModeComputationRewards:s.safeModeComputationRewards?.toString()??null,safeModeStorageRebates:s.safeModeStorageRebates?.toString()??null,safeModeNonRefundableStorageFee:s.safeModeNonRefundableStorageFee?.toString()??null,parameters:{epochDurationMs:s.parameters?.epochDurationMs?.toString()??null,stakeSubsidyStartEpoch:s.parameters?.stakeSubsidyStartEpoch?.toString()??null,maxValidatorCount:s.parameters?.maxValidatorCount?.toString()??null,minValidatorJoiningStake:s.parameters?.minValidatorJoiningStake?.toString()??null,validatorLowStakeThreshold:s.parameters?.validatorLowStakeThreshold?.toString()??null,validatorLowStakeGracePeriod:s.parameters?.validatorLowStakeGracePeriod?.toString()??null},storageFund:{totalObjectStorageRebates:s.storageFund?.totalObjectStorageRebates?.toString()??null,nonRefundableBalance:s.storageFund?.nonRefundableBalance?.toString()??null},stakeSubsidy:{balance:s.stakeSubsidy?.balance?.toString()??null,distributionCounter:s.stakeSubsidy?.distributionCounter?.toString()??null,currentDistributionAmount:s.stakeSubsidy?.currentDistributionAmount?.toString()??null,stakeSubsidyPeriodLength:s.stakeSubsidy?.stakeSubsidyPeriodLength?.toString()??null,stakeSubsidyDecreaseRate:s.stakeSubsidy?.stakeSubsidyDecreaseRate??null}}}}async listDynamicFields(e){return this.#e.listDynamicFields(e)}async listTransactions(e){const t=Yf(e.include),s=e.filter?await tD(this.mvr,e.filter,e.signal):void 0,r=NS(e);eD(s,r);const i=this.#e.ledgerService.listTransactions({readMask:{paths:t},filter:s&&KD(s),options:IS(r,r.limit+1)},{abort:e.signal}),c=[];let u=null,f=null,p=null,m,g=!1;for await(const b of i.responses)b.watermark?.cursor&&(p=st(b.watermark.cursor)),b.transaction&&(c.length>=r.limit?g=!0:(u??=p,f=p,c.push(Eh(b.transaction,{include:e.include})))),b.end&&(m=b.end);const y=g||m?.reason===Su.SCAN_LIMIT||m?.reason===Su.ITEM_LIMIT;return{transactions:c,hasNextPage:y,startCursor:u,endCursor:g?f:y?p??f:f}}async listEvents(e){const t=NS(e),s=this.#e.ledgerService.listEvents({readMask:{paths:["package_id","module","sender","event_type","contents","json","checkpoint","transaction_digest","event_index"]},filter:e.filter?QD(await nD(this.mvr,e.filter,e.signal)):void 0,options:IS(t,t.limit+1)},{abort:e.signal}),r=[];let i=null,c=null,u=null,f,p=!1;for await(const g of s.responses){if(g.watermark?.cursor&&(u=st(g.watermark.cursor)),g.event)if(r.length>=t.limit)p=!0;else{i??=u,c=u;const y=g.event;r.push({packageId:ye(y.packageId),module:y.module,sender:ye(y.sender),eventType:De(y.eventType),bcs:y.contents?.value??new Uint8Array,json:y.json?hn.toJson(y.json):null,checkpoint:y.checkpoint?.toString()??null,transactionDigest:y.transactionDigest,eventIndex:y.eventIndex})}g.end&&(f=g.end)}const m=p||f?.reason===Su.SCAN_LIMIT||f?.reason===Su.ITEM_LIMIT;return{events:r,hasNextPage:m,startCursor:i,endCursor:p?c:m?u??c:c}}async verifyZkLoginSignature(e){const t=qe(e.bytes),s=e.intentScope==="PersonalMessage"?H.byteVector().serialize(t).toBytes():t,{response:r}=await this.#e.signatureVerificationService.verifySignature({message:{name:e.intentScope,value:s},signature:{bcs:{value:qe(e.signature)},signature:{oneofKind:void 0}},address:e.address,jwks:[]},{abort:e.signal});return{success:r.isValid??!1,errors:r.reason?[r.reason]:[]}}async defaultNameServiceName(e){return{data:{name:(await this.#e.nameService.reverseLookupName({address:e.address},{abort:e.signal})).response.record?.name??null}}}async resolveNameServiceAddress(e){try{const{response:t}=await this.#e.nameService.lookupName({name:e.name},{abort:e.signal});return{address:t.record?.targetAddress??null}}catch(t){if(eU(t))return{address:null};throw t}}async getMoveFunction(e){const t=(await this.mvr.resolvePackage({package:e.packageId,signal:e.signal})).package,{response:s}=await this.#e.movePackageService.getFunction({packageId:t,moduleName:e.moduleName,name:e.name},{abort:e.signal});let r="unknown";switch(s.function?.visibility){case wh.PUBLIC:r="public";break;case wh.PRIVATE:r="private";break;case wh.FRIEND:r="friend";break}return{function:{packageId:ye(t),moduleName:e.moduleName,name:s.function?.name,visibility:r,isEntry:s.function?.isEntry??!1,typeParameters:s.function?.typeParameters?.map(({constraints:i})=>({isPhantom:!1,constraints:i.map(c=>{switch(c){case kc.COPY:return"copy";case kc.DROP:return"drop";case kc.STORE:return"store";case kc.KEY:return"key";default:return"unknown"}})??[]}))??[],parameters:s.function?.parameters?.map(i=>US(i))??[],returns:s.function?.returns?.map(i=>US(i))??[]}}}async getChainIdentifier(e){return lh(Promise.resolve(this.cache.read(["chainIdentifier"],async()=>{const{response:t}=await this.#e.ledgerService.getServiceInfo({});if(!t.chainId)throw new Error("Chain identifier not found in service info");return{chainIdentifier:t.chainId}})),e?.signal)}resolveTransactionPlugin(){const e=this.#e;return async function(s,r,i){const c=s.snapshot();c.sender||(c.sender="0x0000000000000000000000000000000000000000000000000000000000000000");const u=yA(c),f=!r.onlyTransactionKind&&(c.gasData.budget==null||c.gasData.payment==null);let p;try{p=(await e.transactionExecutionService.simulateTransaction({transaction:u,doGasSelection:f,checks:r.onlyTransactionKind?Eu.DISABLED:Eu.ENABLED,readMask:{paths:["transaction.transaction.sender","transaction.transaction.gas_payment","transaction.transaction.expiration","transaction.transaction.kind","transaction.effects.status","transaction.effects.epoch"]}})).response}catch(m){throw m instanceof Error&&m.message?new $y(m.message,{cause:m}):m}if(!r.onlyTransactionKind&&p.transaction?.effects?.status&&!p.transaction.effects.status.success){const m=p.transaction.effects.status.error?ob(p.transaction.effects.status.error):void 0;throw new $y(`Transaction resolution failed: ${m?.message??"Transaction failed"}`,{executionError:m})}if(!p.transaction?.transaction)throw new Error("simulateTransaction did not return resolved transaction data");return u9(s,p.transaction.transaction,r),await p9({transactionData:s,client:e,epoch:p.transaction.effects?.epoch,originalTransactionData:c,isTransactionKindOnly:!!r.onlyTransactionKind,doGasSelection:f}),await i()}}};function IS(e,t){return{limit:t,ordering:e.descending?Ky.DESCENDING:Ky.ASCENDING,after:e.after?qe(e.after):void 0,before:e.before?qe(e.before):void 0}}function Yf(e,t=""){const s=["digest","transaction.digest","signatures","effects.status","timestamp","checkpoint"];return e?.transaction&&s.push("transaction.sender","transaction.gas_payment","transaction.expiration","transaction.kind"),e?.bcs&&s.push("transaction.bcs"),e?.balanceChanges&&s.push("balance_changes"),e?.effects&&s.push("effects"),e?.events&&s.push("events"),e?.objectTypes&&(s.push("effects.changed_objects.object_type"),s.push("effects.changed_objects.object_id")),t?s.map(r=>t+r):s}function G0(e,t,s){return t?.protoJson?{...e,protoJson:s()}:e}function RS(e,t){if(e)return t===void 0?null:{output:t.output!==void 0?hn.toJson(t.output):null,errors:t.errors!==void 0?hn.toJson(t.errors):null}}function Ji(e){if(!e)return null;if(e.kind===bc.IMMUTABLE)return{$kind:"Immutable",Immutable:!0};if(e.kind===bc.ADDRESS)return{AddressOwner:e.address,$kind:"AddressOwner"};if(e.kind===bc.OBJECT)return{$kind:"ObjectOwner",ObjectOwner:e.address};if(e.kind===bc.SHARED)return{$kind:"Shared",Shared:{initialSharedVersion:e.version?.toString()}};if(e.kind===bc.CONSENSUS_ADDRESS)return{$kind:"ConsensusAddressOwner",ConsensusAddressOwner:{startVersion:e.version?.toString(),owner:e.address}};throw new Error(`Unknown owner kind ${JSON.stringify(e,(t,s)=>typeof s=="bigint"?s.toString():s)}`)}function ob(e){const t=e.description??"Unknown error",s=e.command!=null?Number(e.command):void 0,r=e.errorDetails;switch(r?.oneofKind){case"abort":{const i=r.abort,c=i.cleverError;return{$kind:"MoveAbort",message:aA({command:s,location:i.location,abortCode:String(i.abortCode??0n),cleverError:c?{lineNumber:c.lineNumber!=null?Number(c.lineNumber):void 0,constantName:c.constantName,value:c.value?.oneofKind==="rendered"?c.value.rendered:void 0}:void 0}),command:s,MoveAbort:nU(i)}}case"sizeError":return{$kind:"SizeError",message:t,command:s,SizeError:{name:Gi(e.kind),size:Number(r.sizeError.size??0n),maxSize:Number(r.sizeError.maxSize??0n)}};case"commandArgumentError":return{$kind:"CommandArgumentError",message:t,command:s,CommandArgumentError:{argument:r.commandArgumentError.argument??0,name:Gi(r.commandArgumentError.kind)}};case"typeArgumentError":return{$kind:"TypeArgumentError",message:t,command:s,TypeArgumentError:{typeArgument:r.typeArgumentError.typeArgument??0,name:Gi(r.typeArgumentError.kind)}};case"packageUpgradeError":return{$kind:"PackageUpgradeError",message:t,command:s,PackageUpgradeError:{name:Gi(r.packageUpgradeError.kind),packageId:r.packageUpgradeError.packageId,digest:r.packageUpgradeError.digest}};case"indexError":return{$kind:"IndexError",message:t,command:s,IndexError:{index:r.indexError.index,subresult:r.indexError.subresult}};case"coinDenyListError":return{$kind:"CoinDenyListError",message:t,command:s,CoinDenyListError:{name:Gi(e.kind),coinType:r.coinDenyListError.coinType,address:r.coinDenyListError.address}};case"congestedObjects":return{$kind:"CongestedObjects",message:t,command:s,CongestedObjects:{name:Gi(e.kind),objects:r.congestedObjects.objects}};case"objectId":return{$kind:"ObjectIdError",message:t,command:s,ObjectIdError:{name:Gi(e.kind),objectId:r.objectId}};default:return{$kind:"Unknown",message:t,command:s,Unknown:null}}}function nU(e){return{abortCode:String(e.abortCode??0n),location:{...e.location},cleverError:e.cleverError?{errorCode:e.cleverError.errorCode!=null?Number(e.cleverError.errorCode):void 0,lineNumber:e.cleverError.lineNumber!=null?Number(e.cleverError.lineNumber):void 0,constantName:e.cleverError.constantName,constantType:e.cleverError.constantType,value:e.cleverError.value?.oneofKind==="rendered"?e.cleverError.value.rendered:e.cleverError.value?.oneofKind==="raw"?st(e.cleverError.value.raw):void 0}:void 0}}function Gi(e){if(e==null)return"Unknown";const t=bA[e];return!t||t.endsWith("_UNKNOWN")?"Unknown":t.split("_").map(s=>s.charAt(0)+s.slice(1).toLowerCase()).join("")}function jS(e){if(e==null)return null;switch(e){case Tu.CREATED:return"Created";case Tu.DELETED:return"Deleted";case Tu.NONE:case Tu.ID_OPERATION_UNKNOWN:return"None";default:return"Unknown"}}function MS(e){if(e==null)return null;switch(e){case Th.EXISTS:return"Exists";case Th.DOES_NOT_EXIST:return"DoesNotExist";case Th.UNKNOWN:return"Unknown";default:return"Unknown"}}function DS(e){if(e==null)return null;switch(e){case wc.OBJECT_WRITE:return"ObjectWrite";case wc.PACKAGE_WRITE:return"PackageWrite";case wc.DOES_NOT_EXIST:return"DoesNotExist";case wc.ACCUMULATOR_WRITE:return"AccumulatorWriteV1";case wc.UNKNOWN:return"Unknown";default:return"Unknown"}}function sU(e){if(e==null)return null;switch(e){case Wi.UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN:return"Unknown";case Wi.READ_ONLY_ROOT:return"ReadOnlyRoot";case Wi.MUTATE_CONSENSUS_STREAM_ENDED:return"MutateConsensusStreamEnded";case Wi.READ_CONSENSUS_STREAM_ENDED:return"ReadConsensusStreamEnded";case Wi.CANCELED:return"Cancelled";case Wi.PER_EPOCH_CONFIG:return"PerEpochConfig";default:return"Unknown"}}function rU({effects:e}){if(!e)return null;const t=e.changedObjects.map(s=>({objectId:s.objectId,inputState:MS(s.inputState),inputVersion:s.inputVersion?.toString()??null,inputDigest:s.inputDigest??null,inputOwner:Ji(s.inputOwner),outputState:DS(s.outputState),outputVersion:s.outputVersion?.toString()??null,outputDigest:s.outputDigest??null,outputOwner:Ji(s.outputOwner),idOperation:jS(s.idOperation)}));return{bcs:e.bcs?.value,version:e.version??2,status:e.status?.success?{success:!0,error:null}:{success:!1,error:ob(e.status.error)},gasUsed:{computationCost:e.gasUsed?.computationCost?.toString(),storageCost:e.gasUsed?.storageCost?.toString(),storageRebate:e.gasUsed?.storageRebate?.toString(),nonRefundableStorageFee:e.gasUsed?.nonRefundableStorageFee?.toString()},transactionDigest:e.transactionDigest,gasObject:e.gasObject?{objectId:e.gasObject.objectId,inputState:MS(e.gasObject.inputState),inputVersion:e.gasObject.inputVersion?.toString()??null,inputDigest:e.gasObject.inputDigest??null,inputOwner:Ji(e.gasObject.inputOwner),outputState:DS(e.gasObject.outputState),outputVersion:e.gasObject.outputVersion?.toString()??null,outputDigest:e.gasObject.outputDigest??null,outputOwner:Ji(e.gasObject.outputOwner),idOperation:jS(e.gasObject.idOperation)}:null,eventsDigest:e.eventsDigest??null,dependencies:e.dependencies,lamportVersion:e.lamportVersion?.toString()??null,changedObjects:t,unchangedConsensusObjects:e.unchangedConsensusObjects.map(s=>({kind:sU(s.kind),objectId:s.objectId,version:s.version?.toString()??null,digest:s.digest??null})),auxiliaryDataDigest:e.auxiliaryDataDigest??null}}function Eh(e,t){const s=t?.include,r={};s?.objectTypes&&e.effects?.changedObjects?.forEach(m=>{m.objectId&&m.objectType&&(r[m.objectId]=m.objectType)});let i;if(s?.transaction){const m=e.transaction;if(!m)throw new Error("Transaction data is required but missing from gRPC response");const g=vA(m);i={gasData:g.gasData,sender:g.sender,expiration:g.expiration,commands:g.commands,inputs:g.inputs,version:g.version}}const c=s?.bcs?e.transaction?.bcs?.value:void 0,u=s?.effects?rU({effects:e.effects}):void 0,f=e.effects?.status?.success?{success:!0,error:null}:{success:!1,error:e.effects?.status?.error?ob(e.effects.status.error):{$kind:"Unknown",message:"Transaction failed",Unknown:null}},p={digest:e.digest,epoch:e.effects?.epoch?.toString()??null,timestampMs:e.timestamp?Number(e.timestamp.seconds)*1e3+Math.floor(e.timestamp.nanos/1e6):null,checkpoint:e.checkpoint?.toString()??null,status:f,effects:u,objectTypes:s?.objectTypes?r:void 0,transaction:i,bcs:c,signatures:e.signatures?.map(m=>st(m.bcs?.value))??[],balanceChanges:s?.balanceChanges?e.balanceChanges?.map(m=>({coinType:m.coinType,address:m.address,amount:m.amount}))??[]:void 0,events:s?.events?e.events?.events.map(m=>({packageId:ye(m.packageId),module:m.module,sender:ye(m.sender),eventType:m.eventType,bcs:m.contents?.value??new Uint8Array,json:m.json?hn.toJson(m.json):null}))??[]:void 0};return f.success?{$kind:"Transaction",Transaction:p}:{$kind:"FailedTransaction",FailedTransaction:p}}function aU(e,t){const s=t?.include,r=Eh(e.transaction,{include:s}),i=s?.commandResults&&e.commandOutputs?e.commandOutputs.map(c=>({returnValues:(c.returnValues??[]).map(u=>({bcs:u.value?.value??null})),mutatedReferences:(c.mutatedByRef??[]).map(u=>({bcs:u.value?.value??null}))})):void 0;return r.$kind==="Transaction"?{$kind:"Transaction",Transaction:r.Transaction,commandResults:i}:{$kind:"FailedTransaction",FailedTransaction:r.FailedTransaction,commandResults:i}}function US(e){let t=null;return e.reference===Xy.IMMUTABLE?t="immutable":e.reference===Xy.MUTABLE&&(t="mutable"),{reference:t,body:Qy(e.body)}}function Qy(e){switch(e.type){case gs.TYPE_UNKNOWN:return{$kind:"unknown"};case gs.ADDRESS:return{$kind:"address"};case gs.BOOL:return{$kind:"bool"};case gs.U8:return{$kind:"u8"};case gs.U16:return{$kind:"u16"};case gs.U32:return{$kind:"u32"};case gs.U64:return{$kind:"u64"};case gs.U128:return{$kind:"u128"};case gs.U256:return{$kind:"u256"};case gs.VECTOR:return{$kind:"vector",vector:Qy(e.typeParameterInstantiation[0])};case gs.DATATYPE:return{$kind:"datatype",datatype:{typeName:e.typeName,typeParameters:e.typeParameterInstantiation.map(t=>Qy(t))}};case gs.TYPE_PARAMETER:return{$kind:"typeParameter",index:e.typeParameter};default:return{$kind:"unknown"}}}var iU=class{constructor(e){this._transport=e,this.typeName=P0.typeName,this.methods=P0.methods,this.options=P0.options}executeTransaction(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}simulateTransaction(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},oU=class extends Y{constructor(){super("sui.rpc.v2.TransactionFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>lU}])}};const Cp=new oU;var cU=class extends Y{constructor(){super("sui.rpc.v2.TransactionTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>dU}])}};const lU=new cU;var uU=class extends Y{constructor(){super("sui.rpc.v2.TransactionLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>xA},{no:3,name:"affected_address",kind:"message",oneof:"predicate",T:()=>bU},{no:4,name:"affected_object",kind:"message",oneof:"predicate",T:()=>TU},{no:5,name:"move_call",kind:"message",oneof:"predicate",T:()=>SU},{no:6,name:"emit_module",kind:"message",oneof:"predicate",T:()=>CA},{no:7,name:"event_type",kind:"message",oneof:"predicate",T:()=>IA},{no:8,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>RA},{no:9,name:"package_write",kind:"message",oneof:"predicate",T:()=>NU}])}};const dU=new uU;var fU=class extends Y{constructor(){super("sui.rpc.v2.EventFilter",[{no:1,name:"terms",kind:"message",repeat:2,T:()=>pU}])}};const NA=new fU;var hU=class extends Y{constructor(){super("sui.rpc.v2.EventTerm",[{no:1,name:"literals",kind:"message",repeat:2,T:()=>gU}])}};const pU=new hU;var mU=class extends Y{constructor(){super("sui.rpc.v2.EventLiteral",[{no:1,name:"negated",kind:"scalar",T:8},{no:2,name:"sender",kind:"message",oneof:"predicate",T:()=>xA},{no:3,name:"emit_module",kind:"message",oneof:"predicate",T:()=>CA},{no:4,name:"event_type",kind:"message",oneof:"predicate",T:()=>IA},{no:5,name:"event_stream_head",kind:"message",oneof:"predicate",T:()=>RA}])}};const gU=new mU;var yU=class extends Y{constructor(){super("sui.rpc.v2.SenderFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const xA=new yU;var vU=class extends Y{constructor(){super("sui.rpc.v2.AffectedAddressFilter",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const bU=new vU;var wU=class extends Y{constructor(){super("sui.rpc.v2.AffectedObjectFilter",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9}])}};const TU=new wU;var EU=class extends Y{constructor(){super("sui.rpc.v2.MoveCallFilter",[{no:1,name:"function",kind:"scalar",opt:!0,T:9}])}};const SU=new EU;var _U=class extends Y{constructor(){super("sui.rpc.v2.EmitModuleFilter",[{no:1,name:"module",kind:"scalar",opt:!0,T:9}])}};const CA=new _U;var kU=class extends Y{constructor(){super("sui.rpc.v2.EventTypeFilter",[{no:1,name:"event_type",kind:"scalar",opt:!0,T:9}])}};const IA=new kU;var AU=class extends Y{constructor(){super("sui.rpc.v2.EventStreamHeadFilter",[{no:1,name:"stream_id",kind:"scalar",opt:!0,T:9}])}};const RA=new AU;var OU=class extends Y{constructor(){super("sui.rpc.v2.PackageWriteFilter",[])}};const NU=new OU;var xU=class extends Y{constructor(){super("sui.rpc.v2.ProtocolConfig",[{no:1,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"feature_flags",kind:"map",K:9,V:{kind:"scalar",T:8}},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"configs",kind:"map",K:9,V:{kind:"message",T:()=>hn}}])}};const CU=new xU;var IU=class extends Y{constructor(){super("sui.rpc.v2.SystemState",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"validators",kind:"message",T:()=>GU},{no:5,name:"storage_fund",kind:"message",T:()=>VU},{no:6,name:"parameters",kind:"message",T:()=>UU},{no:7,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"validator_report_records",kind:"message",repeat:2,T:()=>MU},{no:9,name:"stake_subsidy",kind:"message",T:()=>zU},{no:10,name:"safe_mode",kind:"scalar",opt:!0,T:8},{no:11,name:"safe_mode_storage_rewards",kind:"scalar",opt:!0,T:4,L:0},{no:12,name:"safe_mode_computation_rewards",kind:"scalar",opt:!0,T:4,L:0},{no:13,name:"safe_mode_storage_rebates",kind:"scalar",opt:!0,T:4,L:0},{no:14,name:"safe_mode_non_refundable_storage_fee",kind:"scalar",opt:!0,T:4,L:0},{no:15,name:"epoch_start_timestamp_ms",kind:"scalar",opt:!0,T:4,L:0},{no:16,name:"extra_fields",kind:"message",T:()=>Ls}])}};const RU=new IU;var jU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorReportRecord",[{no:1,name:"reported",kind:"scalar",opt:!0,T:9},{no:2,name:"reporters",kind:"scalar",repeat:2,T:9}])}};const MU=new jU;var DU=class extends Y{constructor(){super("sui.rpc.v2.SystemParameters",[{no:1,name:"epoch_duration_ms",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"stake_subsidy_start_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"min_validator_count",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"max_validator_count",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"min_validator_joining_stake",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"validator_low_stake_threshold",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"validator_very_low_stake_threshold",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"validator_low_stake_grace_period",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"extra_fields",kind:"message",T:()=>Ls}])}};const UU=new DU;var BU=class extends Y{constructor(){super("sui.rpc.v2.MoveTable",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"size",kind:"scalar",opt:!0,T:4,L:0}])}};const Ls=new BU;var LU=class extends Y{constructor(){super("sui.rpc.v2.StakeSubsidy",[{no:1,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"distribution_counter",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"current_distribution_amount",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"stake_subsidy_period_length",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"stake_subsidy_decrease_rate",kind:"scalar",opt:!0,T:13},{no:6,name:"extra_fields",kind:"message",T:()=>Ls}])}};const zU=new LU;var $U=class extends Y{constructor(){super("sui.rpc.v2.StorageFund",[{no:1,name:"total_object_storage_rebates",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"non_refundable_balance",kind:"scalar",opt:!0,T:4,L:0}])}};const VU=new $U;var PU=class extends Y{constructor(){super("sui.rpc.v2.ValidatorSet",[{no:1,name:"total_stake",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"active_validators",kind:"message",repeat:2,T:()=>HU},{no:3,name:"pending_active_validators",kind:"message",T:()=>Ls},{no:4,name:"pending_removals",kind:"scalar",repeat:1,T:4,L:0},{no:5,name:"staking_pool_mappings",kind:"message",T:()=>Ls},{no:6,name:"inactive_validators",kind:"message",T:()=>Ls},{no:7,name:"validator_candidates",kind:"message",T:()=>Ls},{no:8,name:"at_risk_validators",kind:"map",K:9,V:{kind:"scalar",T:4,L:0}},{no:9,name:"extra_fields",kind:"message",T:()=>Ls}])}};const GU=new PU;var FU=class extends Y{constructor(){super("sui.rpc.v2.Validator",[{no:1,name:"name",kind:"scalar",opt:!0,T:9},{no:2,name:"address",kind:"scalar",opt:!0,T:9},{no:3,name:"description",kind:"scalar",opt:!0,T:9},{no:4,name:"image_url",kind:"scalar",opt:!0,T:9},{no:5,name:"project_url",kind:"scalar",opt:!0,T:9},{no:7,name:"protocol_public_key",kind:"scalar",opt:!0,T:12},{no:8,name:"proof_of_possession",kind:"scalar",opt:!0,T:12},{no:10,name:"network_public_key",kind:"scalar",opt:!0,T:12},{no:12,name:"worker_public_key",kind:"scalar",opt:!0,T:12},{no:13,name:"network_address",kind:"scalar",opt:!0,T:9},{no:14,name:"p2p_address",kind:"scalar",jsonName:"p2pAddress",opt:!0,T:9},{no:15,name:"primary_address",kind:"scalar",opt:!0,T:9},{no:16,name:"worker_address",kind:"scalar",opt:!0,T:9},{no:18,name:"next_epoch_protocol_public_key",kind:"scalar",opt:!0,T:12},{no:19,name:"next_epoch_proof_of_possession",kind:"scalar",opt:!0,T:12},{no:21,name:"next_epoch_network_public_key",kind:"scalar",opt:!0,T:12},{no:23,name:"next_epoch_worker_public_key",kind:"scalar",opt:!0,T:12},{no:24,name:"next_epoch_network_address",kind:"scalar",opt:!0,T:9},{no:25,name:"next_epoch_p2p_address",kind:"scalar",jsonName:"nextEpochP2pAddress",opt:!0,T:9},{no:26,name:"next_epoch_primary_address",kind:"scalar",opt:!0,T:9},{no:27,name:"next_epoch_worker_address",kind:"scalar",opt:!0,T:9},{no:28,name:"metadata_extra_fields",kind:"message",T:()=>Ls},{no:29,name:"voting_power",kind:"scalar",opt:!0,T:4,L:0},{no:30,name:"operation_cap_id",kind:"scalar",opt:!0,T:9},{no:31,name:"gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:32,name:"staking_pool",kind:"message",T:()=>ZU},{no:33,name:"commission_rate",kind:"scalar",opt:!0,T:4,L:0},{no:34,name:"next_epoch_stake",kind:"scalar",opt:!0,T:4,L:0},{no:35,name:"next_epoch_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:36,name:"next_epoch_commission_rate",kind:"scalar",opt:!0,T:4,L:0},{no:37,name:"extra_fields",kind:"message",T:()=>Ls}])}};const HU=new FU;var qU=class extends Y{constructor(){super("sui.rpc.v2.StakingPool",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"activation_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"deactivation_epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"sui_balance",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"rewards_pool",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"pool_token_balance",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"exchange_rates",kind:"message",T:()=>Ls},{no:8,name:"pending_stake",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"pending_total_sui_withdraw",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"pending_pool_token_withdraw",kind:"scalar",opt:!0,T:4,L:0},{no:11,name:"extra_fields",kind:"message",T:()=>Ls}])}};const ZU=new qU;var YU=class extends Y{constructor(){super("sui.rpc.v2.Epoch",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"committee",kind:"message",T:()=>jD},{no:3,name:"system_state",kind:"message",T:()=>RU},{no:4,name:"first_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"last_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"start",kind:"message",T:()=>Or},{no:7,name:"end",kind:"message",T:()=>Or},{no:8,name:"reference_gas_price",kind:"scalar",opt:!0,T:4,L:0},{no:9,name:"protocol_config",kind:"message",T:()=>CU}])}};const WU=new YU;var XU=class extends Y{constructor(){super("sui.rpc.v2.CheckpointContents",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"version",kind:"scalar",opt:!0,T:5},{no:4,name:"transactions",kind:"message",repeat:2,T:()=>QU}])}};const JU=new XU;var KU=class extends Y{constructor(){super("sui.rpc.v2.CheckpointedTransactionInfo",[{no:1,name:"transaction",kind:"scalar",opt:!0,T:9},{no:2,name:"effects",kind:"scalar",opt:!0,T:9},{no:3,name:"signatures",kind:"message",repeat:2,T:()=>xp},{no:4,name:"address_aliases_versions",kind:"message",repeat:2,T:()=>t7}])}};const QU=new KU;var e7=class extends Y{constructor(){super("sui.rpc.v2.AddressAliasesVersion",[{no:1,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const t7=new e7;let n7=(function(e){return e[e.CHECKPOINT_COMMITMENT_KIND_UNKNOWN=0]="CHECKPOINT_COMMITMENT_KIND_UNKNOWN",e[e.ECMH_LIVE_OBJECT_SET=1]="ECMH_LIVE_OBJECT_SET",e[e.CHECKPOINT_ARTIFACTS=2]="CHECKPOINT_ARTIFACTS",e})({});var s7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointSummary",[{no:1,name:"bcs",kind:"message",T:()=>Ts},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"sequence_number",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"total_network_transactions",kind:"scalar",opt:!0,T:4,L:0},{no:6,name:"content_digest",kind:"scalar",opt:!0,T:9},{no:7,name:"previous_digest",kind:"scalar",opt:!0,T:9},{no:8,name:"epoch_rolling_gas_cost_summary",kind:"message",T:()=>TA},{no:9,name:"timestamp",kind:"message",T:()=>Or},{no:10,name:"commitments",kind:"message",repeat:2,T:()=>jA},{no:11,name:"end_of_epoch_data",kind:"message",T:()=>i7},{no:12,name:"version_specific_data",kind:"scalar",opt:!0,T:12}])}};const r7=new s7;var a7=class extends Y{constructor(){super("sui.rpc.v2.EndOfEpochData",[{no:1,name:"next_epoch_committee",kind:"message",repeat:2,T:()=>AA},{no:2,name:"next_epoch_protocol_version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"epoch_commitments",kind:"message",repeat:2,T:()=>jA}])}};const i7=new a7;var o7=class extends Y{constructor(){super("sui.rpc.v2.CheckpointCommitment",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CheckpointCommitment.CheckpointCommitmentKind",n7]},{no:2,name:"digest",kind:"scalar",opt:!0,T:9}])}};const jA=new o7;var c7=class extends Y{constructor(){super("sui.rpc.v2.Checkpoint",[{no:1,name:"sequence_number",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"digest",kind:"scalar",opt:!0,T:9},{no:3,name:"summary",kind:"message",T:()=>r7},{no:4,name:"signature",kind:"message",T:()=>UD},{no:5,name:"contents",kind:"message",T:()=>JU},{no:6,name:"transactions",kind:"message",repeat:2,T:()=>ha},{no:7,name:"objects",kind:"message",T:()=>fA}])}};const cb=new c7;var l7=class extends Y{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(e,t){return{typeUrl:this.typeNameToUrl(t.typeName),value:t.toBinary(e)}}unpack(e,t,s){if(!this.contains(e,t))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+e.typeUrl+"' as "+t.typeName+".");return t.fromBinary(e.value,s)}contains(e,t){return e.typeUrl.length?(typeof t=="string"?t:t.typeName)===this.typeUrlToName(e.typeUrl):!1}internalJsonWrite(e,t){if(e.typeUrl==="")return{};let s=this.typeUrlToName(e.typeUrl),r=Yk(t),i=r.typeRegistry?.find(f=>f.typeName===s);if(!i)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+s+" is not available in the type registry.");let c=i.fromBinary(e.value,{readUnknownField:!1}),u=i.internalJsonWrite(c,r);return(s.startsWith("google.protobuf.")||!Vh(u))&&(u={value:u}),u["@type"]=e.typeUrl,u}internalJsonRead(e,t,s){if(!Vh(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+ma(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let r=this.typeUrlToName(e["@type"]),i=t?.typeRegistry?.find(u=>u.typeName==r);if(!i)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+r+" is not available in the type registry.");let c;if(r.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))c=i.fromJson(e.value,t);else{let u=Object.assign({},e);delete u["@type"],c=i.fromJson(u,t)}return s===void 0&&(s=this.create()),s.typeUrl=e["@type"],s.value=i.toBinary(c),s}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),s=t>0?e.substring(t+1):e;if(!s.length)throw new Error("invalid type url: "+e);return s}};const u7=new l7;var d7=class extends Y{constructor(){super("google.rpc.Status",[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",repeat:2,T:()=>u7}])}};const MA=new d7;var f7=class extends Y{constructor(){super("sui.rpc.v2.GetServiceInfoRequest",[])}};const h7=new f7;var p7=class extends Y{constructor(){super("sui.rpc.v2.GetServiceInfoResponse",[{no:1,name:"chain_id",kind:"scalar",opt:!0,T:9},{no:2,name:"chain",kind:"scalar",opt:!0,T:9},{no:3,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"checkpoint_height",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"timestamp",kind:"message",T:()=>Or},{no:6,name:"lowest_available_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:7,name:"lowest_available_checkpoint_objects",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"server",kind:"scalar",opt:!0,T:9}])}};const m7=new p7;var g7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectRequest",[{no:1,name:"object_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"read_mask",kind:"message",T:()=>Bn}])}};const DA=new g7;var y7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectResponse",[{no:1,name:"object",kind:"message",T:()=>fo}])}};const v7=new y7;var b7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetObjectsRequest",[{no:1,name:"requests",kind:"message",repeat:2,T:()=>DA},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const w7=new b7;var T7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>_7}])}};const E7=new T7;var S7=class extends Y{constructor(){super("sui.rpc.v2.GetObjectResult",[{no:1,name:"object",kind:"message",oneof:"result",T:()=>fo},{no:2,name:"error",kind:"message",oneof:"result",T:()=>MA}])}};const _7=new S7;var k7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionRequest",[{no:1,name:"digest",kind:"scalar",opt:!0,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const A7=new k7;var O7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha}])}};const N7=new O7;var x7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetTransactionsRequest",[{no:1,name:"digests",kind:"scalar",repeat:2,T:9},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const C7=new x7;var I7=class extends Y{constructor(){super("sui.rpc.v2.BatchGetTransactionsResponse",[{no:1,name:"transactions",kind:"message",repeat:2,T:()=>M7}])}};const R7=new I7;var j7=class extends Y{constructor(){super("sui.rpc.v2.GetTransactionResult",[{no:1,name:"transaction",kind:"message",oneof:"result",T:()=>ha},{no:2,name:"error",kind:"message",oneof:"result",T:()=>MA}])}};const M7=new j7;var D7=class extends Y{constructor(){super("sui.rpc.v2.GetCheckpointRequest",[{no:1,name:"sequence_number",kind:"scalar",oneof:"checkpointId",T:4,L:0},{no:2,name:"digest",kind:"scalar",oneof:"checkpointId",T:9},{no:3,name:"read_mask",kind:"message",T:()=>Bn}])}};const U7=new D7;var B7=class extends Y{constructor(){super("sui.rpc.v2.GetCheckpointResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>cb}])}};const L7=new B7;var z7=class extends Y{constructor(){super("sui.rpc.v2.GetEpochRequest",[{no:1,name:"epoch",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"read_mask",kind:"message",T:()=>Bn}])}};const $7=new z7;var V7=class extends Y{constructor(){super("sui.rpc.v2.GetEpochResponse",[{no:1,name:"epoch",kind:"message",T:()=>WU}])}};const P7=new V7;var G7=class extends Y{constructor(){super("sui.rpc.v2.ListCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>Cp},{no:5,name:"options",kind:"message",T:()=>ab}])}};const F7=new G7;var H7=class extends Y{constructor(){super("sui.rpc.v2.ListCheckpointsResponse",[{no:1,name:"checkpoint",kind:"message",T:()=>cb},{no:2,name:"watermark",kind:"message",T:()=>rd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const q7=new H7;var Z7=class extends Y{constructor(){super("sui.rpc.v2.ListTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>Cp},{no:5,name:"options",kind:"message",T:()=>ab}])}};const Y7=new Z7;var W7=class extends Y{constructor(){super("sui.rpc.v2.ListTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"watermark",kind:"message",T:()=>rd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const X7=new W7;var J7=class extends Y{constructor(){super("sui.rpc.v2.ListEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"start_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"end_checkpoint",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"filter",kind:"message",T:()=>NA},{no:5,name:"options",kind:"message",T:()=>ab}])}};const K7=new J7;var Q7=class extends Y{constructor(){super("sui.rpc.v2.ListEventsResponse",[{no:1,name:"event",kind:"message",T:()=>sb},{no:2,name:"watermark",kind:"message",T:()=>rd},{no:3,name:"end",kind:"message",T:()=>ib}])}};const eB=new Q7,F0=new gi("sui.rpc.v2.LedgerService",[{name:"GetServiceInfo",options:{},I:h7,O:m7},{name:"GetObject",options:{},I:DA,O:v7},{name:"BatchGetObjects",options:{},I:w7,O:E7},{name:"GetTransaction",options:{},I:A7,O:N7},{name:"BatchGetTransactions",options:{},I:C7,O:R7},{name:"GetCheckpoint",options:{},I:U7,O:L7},{name:"GetEpoch",options:{},I:$7,O:P7},{name:"ListCheckpoints",serverStreaming:!0,options:{},I:F7,O:q7},{name:"ListTransactions",serverStreaming:!0,options:{},I:Y7,O:X7},{name:"ListEvents",serverStreaming:!0,options:{},I:K7,O:eB}]);var tB=class{constructor(e){this._transport=e,this.typeName=F0.typeName,this.methods=F0.methods,this.options=F0.options}getServiceInfo(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getObject(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}batchGetObjects(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getTransaction(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}batchGetTransactions(e,t){const s=this.methods[4],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getCheckpoint(e,t){const s=this.methods[5],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getEpoch(e,t){const s=this.methods[6],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listCheckpoints(e,t){const s=this.methods[7],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}listTransactions(e,t){const s=this.methods[8],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}listEvents(e,t){const s=this.methods[9],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}},nB=class extends Y{constructor(){super("sui.rpc.v2.GetPackageRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9}])}};const sB=new nB;var rB=class extends Y{constructor(){super("sui.rpc.v2.GetPackageResponse",[{no:1,name:"package",kind:"message",T:()=>iA}])}};const aB=new rB;var iB=class extends Y{constructor(){super("sui.rpc.v2.GetDatatypeRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module_name",kind:"scalar",opt:!0,T:9},{no:3,name:"name",kind:"scalar",opt:!0,T:9}])}};const oB=new iB;var cB=class extends Y{constructor(){super("sui.rpc.v2.GetDatatypeResponse",[{no:1,name:"datatype",kind:"message",T:()=>oA}])}};const lB=new cB;var uB=class extends Y{constructor(){super("sui.rpc.v2.GetFunctionRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"module_name",kind:"scalar",opt:!0,T:9},{no:3,name:"name",kind:"scalar",opt:!0,T:9}])}};const dB=new uB;var fB=class extends Y{constructor(){super("sui.rpc.v2.GetFunctionResponse",[{no:1,name:"function",kind:"message",T:()=>uA}])}};const hB=new fB;var pB=class extends Y{constructor(){super("sui.rpc.v2.ListPackageVersionsRequest",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12}])}};const mB=new pB;var gB=class extends Y{constructor(){super("sui.rpc.v2.ListPackageVersionsResponse",[{no:1,name:"versions",kind:"message",repeat:2,T:()=>bB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const yB=new gB;var vB=class extends Y{constructor(){super("sui.rpc.v2.PackageVersion",[{no:1,name:"package_id",kind:"scalar",opt:!0,T:9},{no:2,name:"version",kind:"scalar",opt:!0,T:4,L:0}])}};const bB=new vB,H0=new gi("sui.rpc.v2.MovePackageService",[{name:"GetPackage",options:{},I:sB,O:aB},{name:"GetDatatype",options:{},I:oB,O:lB},{name:"GetFunction",options:{},I:dB,O:hB},{name:"ListPackageVersions",options:{},I:mB,O:yB}]);var wB=class{constructor(e){this._transport=e,this.typeName=H0.typeName,this.methods=H0.methods,this.options=H0.options}getPackage(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getDatatype(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getFunction(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listPackageVersions(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},TB=class extends Y{constructor(){super("sui.rpc.v2.VerifySignatureRequest",[{no:1,name:"message",kind:"message",T:()=>Ts},{no:2,name:"signature",kind:"message",T:()=>xp},{no:3,name:"address",kind:"scalar",opt:!0,T:9},{no:4,name:"jwks",kind:"message",repeat:2,T:()=>gA}])}};const EB=new TB;var SB=class extends Y{constructor(){super("sui.rpc.v2.VerifySignatureResponse",[{no:1,name:"is_valid",kind:"scalar",opt:!0,T:8},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}};const _B=new SB,q0=new gi("sui.rpc.v2.SignatureVerificationService",[{name:"VerifySignature",options:{},I:EB,O:_B}]);var kB=class{constructor(e){this._transport=e,this.typeName=q0.typeName,this.methods=q0.methods,this.options=q0.options}verifySignature(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};let AB=(function(e){return e[e.METADATA_CAP_STATE_UNKNOWN=0]="METADATA_CAP_STATE_UNKNOWN",e[e.CLAIMED=1]="CLAIMED",e[e.UNCLAIMED=2]="UNCLAIMED",e[e.DELETED=3]="DELETED",e})({}),OB=(function(e){return e[e.SUPPLY_STATE_UNKNOWN=0]="SUPPLY_STATE_UNKNOWN",e[e.FIXED=1]="FIXED",e[e.BURN_ONLY=2]="BURN_ONLY",e})({}),NB=(function(e){return e[e.COIN_REGULATED_STATE_UNKNOWN=0]="COIN_REGULATED_STATE_UNKNOWN",e[e.REGULATED=1]="REGULATED",e[e.UNREGULATED=2]="UNREGULATED",e})({}),UA=(function(e){return e[e.DYNAMIC_FIELD_KIND_UNKNOWN=0]="DYNAMIC_FIELD_KIND_UNKNOWN",e[e.FIELD=1]="FIELD",e[e.OBJECT=2]="OBJECT",e})({});var xB=class extends Y{constructor(){super("sui.rpc.v2.GetCoinInfoRequest",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const CB=new xB;var IB=class extends Y{constructor(){super("sui.rpc.v2.GetCoinInfoResponse",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:2,name:"metadata",kind:"message",T:()=>MB},{no:3,name:"treasury",kind:"message",T:()=>UB},{no:4,name:"regulated_metadata",kind:"message",T:()=>LB}])}};const RB=new IB;var jB=class extends Y{constructor(){super("sui.rpc.v2.CoinMetadata",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"decimals",kind:"scalar",opt:!0,T:13},{no:3,name:"name",kind:"scalar",opt:!0,T:9},{no:4,name:"symbol",kind:"scalar",opt:!0,T:9},{no:5,name:"description",kind:"scalar",opt:!0,T:9},{no:6,name:"icon_url",kind:"scalar",opt:!0,T:9},{no:7,name:"metadata_cap_id",kind:"scalar",opt:!0,T:9},{no:8,name:"metadata_cap_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CoinMetadata.MetadataCapState",AB]}])}};const MB=new jB;var DB=class extends Y{constructor(){super("sui.rpc.v2.CoinTreasury",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"total_supply",kind:"scalar",opt:!0,T:4,L:0},{no:3,name:"supply_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.CoinTreasury.SupplyState",OB]}])}};const UB=new DB;var BB=class extends Y{constructor(){super("sui.rpc.v2.RegulatedCoinMetadata",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_metadata_object",kind:"scalar",opt:!0,T:9},{no:3,name:"deny_cap_object",kind:"scalar",opt:!0,T:9},{no:4,name:"allow_global_pause",kind:"scalar",opt:!0,T:8},{no:5,name:"variant",kind:"scalar",opt:!0,T:13},{no:6,name:"coin_regulated_state",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.RegulatedCoinMetadata.CoinRegulatedState",NB]}])}};const LB=new BB;var zB=class extends Y{constructor(){super("sui.rpc.v2.GetBalanceRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"coin_type",kind:"scalar",opt:!0,T:9}])}};const $B=new zB;var VB=class extends Y{constructor(){super("sui.rpc.v2.GetBalanceResponse",[{no:1,name:"balance",kind:"message",T:()=>BA}])}};const PB=new VB;var GB=class extends Y{constructor(){super("sui.rpc.v2.ListBalancesRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12}])}};const FB=new GB;var HB=class extends Y{constructor(){super("sui.rpc.v2.ListBalancesResponse",[{no:1,name:"balances",kind:"message",repeat:2,T:()=>BA},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const qB=new HB;var ZB=class extends Y{constructor(){super("sui.rpc.v2.Balance",[{no:1,name:"coin_type",kind:"scalar",opt:!0,T:9},{no:3,name:"balance",kind:"scalar",opt:!0,T:4,L:0},{no:4,name:"address_balance",kind:"scalar",opt:!0,T:4,L:0},{no:5,name:"coin_balance",kind:"scalar",opt:!0,T:4,L:0}])}};const BA=new ZB;var YB=class extends Y{constructor(){super("sui.rpc.v2.ListDynamicFieldsRequest",[{no:1,name:"parent",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12},{no:4,name:"read_mask",kind:"message",T:()=>Bn}])}};const WB=new YB;var XB=class extends Y{constructor(){super("sui.rpc.v2.ListDynamicFieldsResponse",[{no:1,name:"dynamic_fields",kind:"message",repeat:2,T:()=>QB},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const JB=new XB;var KB=class extends Y{constructor(){super("sui.rpc.v2.DynamicField",[{no:1,name:"kind",kind:"enum",opt:!0,T:()=>["sui.rpc.v2.DynamicField.DynamicFieldKind",UA]},{no:2,name:"parent",kind:"scalar",opt:!0,T:9},{no:3,name:"field_id",kind:"scalar",opt:!0,T:9},{no:4,name:"field_object",kind:"message",T:()=>fo},{no:5,name:"name",kind:"message",T:()=>Ts},{no:6,name:"value",kind:"message",T:()=>Ts},{no:7,name:"value_type",kind:"scalar",opt:!0,T:9},{no:8,name:"child_id",kind:"scalar",opt:!0,T:9},{no:9,name:"child_object",kind:"message",T:()=>fo}])}};const QB=new KB;var eL=class extends Y{constructor(){super("sui.rpc.v2.ListOwnedObjectsRequest",[{no:1,name:"owner",kind:"scalar",opt:!0,T:9},{no:2,name:"page_size",kind:"scalar",opt:!0,T:13},{no:3,name:"page_token",kind:"scalar",opt:!0,T:12},{no:4,name:"read_mask",kind:"message",T:()=>Bn},{no:5,name:"object_type",kind:"scalar",opt:!0,T:9}])}};const tL=new eL;var nL=class extends Y{constructor(){super("sui.rpc.v2.ListOwnedObjectsResponse",[{no:1,name:"objects",kind:"message",repeat:2,T:()=>fo},{no:2,name:"next_page_token",kind:"scalar",opt:!0,T:12}])}};const sL=new nL,Z0=new gi("sui.rpc.v2.StateService",[{name:"ListDynamicFields",options:{},I:WB,O:JB},{name:"ListOwnedObjects",options:{},I:tL,O:sL},{name:"GetCoinInfo",options:{},I:CB,O:RB},{name:"GetBalance",options:{},I:$B,O:PB},{name:"ListBalances",options:{},I:FB,O:qB}]);var rL=class{constructor(e){this._transport=e,this.typeName=Z0.typeName,this.methods=Z0.methods,this.options=Z0.options}listDynamicFields(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listOwnedObjects(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getCoinInfo(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getBalance(e,t){const s=this.methods[3],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}listBalances(e,t){const s=this.methods[4],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},aL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeCheckpointsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>Cp}])}};const iL=new aL;var oL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeCheckpointsResponse",[{no:1,name:"cursor",kind:"scalar",opt:!0,T:4,L:0},{no:2,name:"checkpoint",kind:"message",T:()=>cb}])}};const cL=new oL;var lL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeTransactionsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>Cp}])}};const uL=new lL;var dL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeTransactionsResponse",[{no:1,name:"transaction",kind:"message",T:()=>ha},{no:2,name:"watermark",kind:"message",T:()=>rd}])}};const fL=new dL;var hL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeEventsRequest",[{no:1,name:"read_mask",kind:"message",T:()=>Bn},{no:2,name:"filter",kind:"message",T:()=>NA}])}};const pL=new hL;var mL=class extends Y{constructor(){super("sui.rpc.v2.SubscribeEventsResponse",[{no:1,name:"event",kind:"message",T:()=>sb},{no:2,name:"watermark",kind:"message",T:()=>rd}])}};const gL=new mL,Y0=new gi("sui.rpc.v2.SubscriptionService",[{name:"SubscribeCheckpoints",serverStreaming:!0,options:{},I:iL,O:cL},{name:"SubscribeTransactions",serverStreaming:!0,options:{},I:uL,O:fL},{name:"SubscribeEvents",serverStreaming:!0,options:{},I:pL,O:gL}]);var yL=class{constructor(e){this._transport=e,this.typeName=Y0.typeName,this.methods=Y0.methods,this.options=Y0.options}subscribeCheckpoints(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}subscribeTransactions(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}subscribeEvents(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("serverStreaming",this._transport,s,r,e)}},vL=class extends Y{constructor(){super("sui.rpc.v2.LookupNameRequest",[{no:1,name:"name",kind:"scalar",opt:!0,T:9}])}};const bL=new vL;var wL=class extends Y{constructor(){super("sui.rpc.v2.LookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>LA}])}};const TL=new wL;var EL=class extends Y{constructor(){super("sui.rpc.v2.ReverseLookupNameRequest",[{no:1,name:"address",kind:"scalar",opt:!0,T:9}])}};const SL=new EL;var _L=class extends Y{constructor(){super("sui.rpc.v2.ReverseLookupNameResponse",[{no:1,name:"record",kind:"message",T:()=>LA}])}};const kL=new _L;var AL=class extends Y{constructor(){super("sui.rpc.v2.NameRecord",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"registration_nft_id",kind:"scalar",opt:!0,T:9},{no:4,name:"expiration_timestamp",kind:"message",T:()=>Or},{no:5,name:"target_address",kind:"scalar",opt:!0,T:9},{no:6,name:"data",kind:"map",K:9,V:{kind:"scalar",T:9}}])}};const LA=new AL,W0=new gi("sui.rpc.v2.NameService",[{name:"LookupName",options:{},I:bL,O:TL},{name:"ReverseLookupName",options:{},I:SL,O:kL}]);var OL=class{constructor(e){this._transport=e,this.typeName=W0.typeName,this.methods=W0.methods,this.options=W0.options}lookupName(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}reverseLookupName(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}},NL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceClockRequest",[{no:1,name:"duration_ms",kind:"scalar",opt:!0,T:4,L:0}])}};const xL=new NL;var CL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceClockResponse",[{no:1,name:"timestamp_ms",kind:"scalar",T:4,L:0},{no:2,name:"tx_digest",kind:"scalar",T:9}])}};const IL=new CL;var RL=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointRequest",[])}};const jL=new RL;var ML=class extends Y{constructor(){super("sui.forking.v1alpha.AdvanceCheckpointResponse",[{no:1,name:"checkpoint_sequence_number",kind:"scalar",T:4,L:0},{no:2,name:"timestamp_ms",kind:"scalar",T:4,L:0}])}};const DL=new ML;var UL=class extends Y{constructor(){super("sui.forking.v1alpha.GetStatusRequest",[])}};const BL=new UL;var LL=class extends Y{constructor(){super("sui.forking.v1alpha.GetStatusResponse",[{no:1,name:"epoch",kind:"scalar",T:4,L:0},{no:2,name:"checkpoint_sequence_number",kind:"scalar",T:4,L:0},{no:3,name:"timestamp_ms",kind:"scalar",T:4,L:0},{no:4,name:"forked_at_checkpoint",kind:"scalar",T:4,L:0}])}};const zL=new LL,X0=new gi("sui.forking.v1alpha.ForkingService",[{name:"AdvanceClock",options:{},I:xL,O:IL},{name:"AdvanceCheckpoint",options:{},I:jL,O:DL},{name:"GetStatus",options:{},I:BL,O:zL}]);var $L=class{constructor(e){this._transport=e,this.typeName=X0.typeName,this.methods=X0.methods,this.options=X0.options}advanceClock(e,t){const s=this.methods[0],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}advanceCheckpoint(e,t){const s=this.methods[1],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}getStatus(e,t){const s=this.methods[2],r=this._transport.mergeOptions(t);return yt("unary",this._transport,s,r,e)}};const VL=Symbol.for("@mysten/SuiGrpcClient");var lb=class extends rA{get mvr(){return this.core.mvr}get[VL](){return!0}constructor(e){super({network:e.network});const{network:t,mvr:s,abort:r,transport:i,...c}=e,u=t8(i??new Qv(c));this.transactionExecutionService=new iU(u),this.ledgerService=new tB(u),this.stateService=new rL(u),this.subscriptionService=new yL(u),this.movePackageService=new wB(u),this.signatureVerificationService=new kB(u),this.nameService=new OL(u),this.forkingService=new $L(u),this.core=new tU({client:this,base:this,network:e.network,mvr:e.mvr})}getObjects(e){return this.core.getObjects(e)}getObject(e){return this.core.getObject(e)}listCoins(e){return this.core.listCoins(e)}listOwnedObjects(e){return this.core.listOwnedObjects(e)}getBalance(e){return this.core.getBalance(e)}listBalances(e){return this.core.listBalances(e)}getCoinMetadata(e){return this.core.getCoinMetadata(e)}getTransaction(e){return this.core.getTransaction(e)}executeTransaction(e){return this.core.executeTransaction(e)}signAndExecuteTransaction(e){return this.core.signAndExecuteTransaction(e)}waitForTransaction(e){return this.core.waitForTransaction(e)}simulateTransaction(e){return this.core.simulateTransaction(e)}getReferenceGasPrice(e){return this.core.getReferenceGasPrice(e)}getCurrentSystemState(e){return this.core.getCurrentSystemState(e)}getProtocolConfig(e){return this.core.getProtocolConfig(e)}getChainIdentifier(e){return this.core.getChainIdentifier(e)}async listDynamicFields(e){const t=e.include?.value??!1,s=["field_id","name","value_type","kind","child_id"];t&&s.push("value");const r=await this.stateService.listDynamicFields({parent:e.parentId,pageToken:e.cursor?qe(e.cursor):void 0,pageSize:e.limit,readMask:{paths:s}},{abort:e.signal});return{dynamicFields:r.response.dynamicFields.map(i=>{const c=i.kind===UA.OBJECT,u=c?`0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${i.name?.name}>,0x2::object::ID>`:`0x2::dynamic_field::Field<${i.name?.name},${i.valueType}>`;return{$kind:c?"DynamicObject":"DynamicField",fieldId:i.fieldId,name:{type:i.name?.name,bcs:i.name?.value},valueType:i.valueType,type:De(u),childId:i.childId,value:t?{type:i.valueType,bcs:i.value?.value??new Uint8Array}:void 0}}),cursor:r.response.nextPageToken?st(r.response.nextPageToken):null,hasNextPage:r.response.nextPageToken!==void 0}}getDynamicField(e){return this.core.getDynamicField(e)}getDynamicObjectField(e){return this.core.getDynamicObjectField(e)}listTransactions(e){return this.core.listTransactions(e)}listEvents(e){return this.core.listEvents(e)}getMoveFunction(e){return this.core.getMoveFunction(e)}resolveTransactionPlugin(){return this.core.resolveTransactionPlugin()}verifyZkLoginSignature(e){return this.core.verifyZkLoginSignature(e)}defaultNameServiceName(e){return this.core.defaultNameServiceName(e)}resolveNameServiceAddress(e){return this.core.resolveNameServiceAddress(e)}};const PL="Dev Wallet",BS="dev-wallet:networks",GL={devnet:"https://fullnode.devnet.sui.io:443",testnet:"https://fullnode.testnet.sui.io:443",localnet:"http://127.0.0.1:9000"};var FL=class{#e;#t;#r;#s;#a;#i;#o;#c;#n;#m;#h;#f;#p=null;#l;#g;#d;#y;#u;#b;#w;#k=!1;constructor(e){e.adapters.length===0&&console.warn("[dev-wallet] No adapters provided. The wallet will have no accounts."),this.#e=e.adapters,this.#h=e.persistNetworks??!1,this.#t=this.#D(e.networks??GL),this.#r={...e.faucets},this.#s={},this.#a=e.activeNetwork??Object.keys(this.#t)[0]??"",this.#i=e.name??PL,this.#o=e.icon??"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0Ij4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0id2FsbGV0R3JhZCIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0eWxlPSJzdG9wLWNvbG9yOiM2MzY2RjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzI1NjNFQiIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImZsYXBHcmFkIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjEwMCUiIHkyPSIxMDAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6IzgxOENGOCIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdHlsZT0ic3RvcC1jb2xvcjojNEY0NkU1IiAvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+CiAgPCEtLSBTaGFkb3cgLS0+CiAgPHJlY3QgeD0iOSIgeT0iMjEiIHdpZHRoPSI1MCIgaGVpZ2h0PSIzNiIgcng9IjYiIHJ5PSI2IiBmaWxsPSIjMDAwIiBvcGFjaXR5PSIwLjEiIC8+CiAgPCEtLSBXYWxsZXQgYm9keSAtLT4KICA8cmVjdCB4PSI2IiB5PSIxOCIgd2lkdGg9IjUwIiBoZWlnaHQ9IjM2IiByeD0iNiIgcnk9IjYiIGZpbGw9InVybCgjd2FsbGV0R3JhZCkiIC8+CiAgPCEtLSBGbGFwIC0tPgogIDxwYXRoIGQ9Ik02IDI2IEw2IDIyIEM2IDE1IDggMTIgMTQgMTIgTDQ2IDEyIEM1MiAxMiA1NiAxNSA1NiAyMiBMNTYgMjYgWiIgZmlsbD0idXJsKCNmbGFwR3JhZCkiIC8+CiAgPCEtLSBDbGFzcCAtLT4KICA8cmVjdCB4PSI0MiIgeT0iMzAiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxMiIgcng9IjQiIHJ5PSI0IiBmaWxsPSIjNDMzOENBIiAvPgogIDwhLS0gR29sZCBjb2luIGluIGNsYXNwIC0tPgogIDxjaXJjbGUgY3g9IjQ4IiBjeT0iMzYiIHI9IjMuNSIgZmlsbD0iI0ZDRDM0RCIgLz4KICA8Y2lyY2xlIGN4PSI0OCIgY3k9IjM2IiByPSIyIiBmaWxsPSIjRjU5RTBCIiAvPgogIDwhLS0gRW1ib3NzZWQgRFcgdGV4dCAtLT4KICA8dGV4dCB4PSIyNiIgeT0iNDUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIiBmb250LXdlaWdodD0iOTAwIiBmb250LXNpemU9IjE4IiBmaWxsPSIjMzczMEEzIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkb21pbmFudC1iYXNlbGluZT0ibWlkZGxlIiBsZXR0ZXItc3BhY2luZz0iMiI+RFc8L3RleHQ+CiAgPHRleHQgeD0iMjYiIHk9IjQ0IiBmb250LWZhbWlseT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiIgZm9udC13ZWlnaHQ9IjkwMCIgZm9udC1zaXplPSIxOCIgZmlsbD0iI0M3RDJGRSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGxlIiBsZXR0ZXItc3BhY2luZz0iMiI+RFc8L3RleHQ+Cjwvc3ZnPgo=",this.#c=e.autoApprove??!1,this.#n=e.autoConnect??!1,this.#m=e.clientFactory??((t,s)=>new lb({baseUrl:s,network:t})),this.#f=this.#A(),this.#l=C4(),this.#g=[],this.#d=null,this.#y=new Set,this.#u=null,this.#b=new Set,this.#w=new Set,this.#C()}get version(){return"1.0.0"}get name(){return this.#i}get icon(){return this.#o}get chains(){return cj(Object.keys(this.#t))}get accounts(){return this.#v()}setSelectedAccount(e){if(e!==null){const t=this.#f.find(s=>s.address.toLowerCase()===e.toLowerCase());if(t===void 0){const s=this.#f.map(r=>r.address).join(", ");throw new Error(`No dev-wallet account for address "${e}". Available: ${s||"(none)"}`)}this.#p=t.address}else this.#p=null;this.#l.emit("change",{accounts:this.#v()})}#v(){return this.#p===null?this.#f:this.#f.filter(e=>e.address.toLowerCase()===this.#p.toLowerCase())}get features(){return{"standard:connect":{version:"1.0.0",connect:this.#R},"standard:events":{version:"1.0.0",on:this.#I},"standard:disconnect":{version:"1.0.0",disconnect:this.#j},"sui:signPersonalMessage":{version:"1.1.0",signPersonalMessage:this.#L},"sui:signTransaction":{version:"2.0.0",signTransaction:this.#z},"sui:signAndExecuteTransaction":{version:"2.0.0",signAndExecuteTransaction:this.#$}}}get pendingRequest(){return this.#d}get adapters(){return this.#e}getAdapterForAccount(e){return this.#e.find(t=>t.getAccount(e)!==void 0)}get clients(){for(const e of Object.keys(this.#t))this.#E(e);return{...this.#s}}getClient(e){return this.#E(e)}get networkUrls(){return{...this.#t}}get faucetUrls(){return{...this.#r}}getFaucet(e){return this.#r[e]??null}get activeFaucet(){return this.getFaucet(this.#a)}get activeNetwork(){return this.#a}get activeClient(){return!this.#a||!this.#t[this.#a]?null:this.#E(this.#a)}get availableNetworks(){return Object.keys(this.#t)}setActiveNetwork(e){if(!this.#t[e])throw new Error(`No client for network "${e}". Available: ${this.availableNetworks.join(", ")}`);this.#a=e,this.#l.emit("change",{accounts:this.#v()})}addNetwork(e,t,s){let r;try{r=new URL(t)}catch{throw new Error(`Invalid URL: ${t}`)}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error(`Invalid URL: must use http or https (got ${r.protocol})`);this.#t[e]=t,this.#s[e]=this.#m(e,t),s!=null&&(this.#r[e]=s),this.#O(),this.#l.emit("change",{accounts:this.#v()})}removeNetwork(e){delete this.#t[e],delete this.#r[e],delete this.#s[e],this.#a===e&&(this.#a=Object.keys(this.#t)[0]??""),this.#O(),this.#l.emit("change",{accounts:this.#v()})}register(){return typeof process<"u"&&console.warn("[@mysten-incubation/dev-wallet] DevWallet is intended for development only. Do not use in production."),_p().register(this)}destroy(){this.#k=!0;for(const e of this.#g)e();this.#g=[];for(const e of this.#e)e.destroy();this.#d&&(this.#d.reject(new Error("Wallet destroyed.")),this.#d=null),this.#u&&(this.#u.reject(new Error("Wallet destroyed.")),this.#u=null),this.#y.clear(),this.#b.clear(),this.#w.clear(),this.#l.all.clear()}async approveRequest(){const e=this.#d;if(!e)throw new Error("No pending request to approve.");try{const t=await this.#N(e.type,e.account,e.chain,e.data);this.#d=null,this.#T(),e.resolve(t)}catch(t){this.#d=null,this.#T(),e.reject(t instanceof Error?t:new Error(String(t)))}}rejectRequest(e){const t=this.#d;if(!t)throw new Error("No pending request to reject.");this.#d=null,this.#T(),t.reject(new Error(e??"Request rejected by user."))}onRequestChange(e){return this.#y.add(e),()=>{this.#y.delete(e)}}get pendingConnect(){return this.#u}approveConnect(e){const t=this.#u;if(!t)throw new Error("No pending connect request to approve.");const s=e.length>0?this.#f.filter(r=>e.includes(r.address)):[...this.#f];this.#u=null,this.#S(),t.resolve({accounts:s})}rejectConnect(e){const t=this.#u;if(!t)throw new Error("No pending connect request to reject.");this.#u=null,this.#S(),t.reject(new Error(e??"Connection rejected by user."))}onConnectChange(e){return this.#b.add(e),()=>{this.#b.delete(e)}}#T(){const e=this.#d;for(const t of this.#y)t(e)}#S(){const e=this.#u;for(const t of this.#b)t(e)}onDAppConnected(e){return this.#w.add(e),()=>{this.#w.delete(e)}}#x(){for(const e of this.#w)try{e()}catch(t){console.error("[dev-wallet] onDAppConnected listener threw:",t)}}#A(){return this.#e.flatMap(e=>e.getAccounts().map(t=>t.walletAccount))}#C(){for(const e of this.#e){const t=e.onAccountsChanged(()=>{this.#f=this.#A(),this.#l.emit("change",{accounts:this.#v()})});this.#g.push(t)}}#I=(e,t)=>(this.#l.on(e,t),()=>this.#l.off(e,t));#R=async()=>(this.#x(),this.#n?{accounts:this.accounts}:this.#u?Promise.reject(new Error("A connect request is already pending.")):new Promise((e,t)=>{this.#u={id:crypto.randomUUID(),resolve:e,reject:t},this.#S()}));#j=async()=>{};#M(e){const t=lj(e);if(!t)throw new Error(`Invalid chain identifier: ${e}`);return this.#E(t)}#D(e){if(!this.#h||typeof localStorage>"u")return{...e};try{const t=localStorage.getItem(BS);if(t){const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}}catch{}return{...e}}#O(){!this.#h||typeof localStorage>"u"||localStorage.setItem(BS,JSON.stringify(this.#t))}#E(e){if(!this.#s[e]){const t=this.#t[e];if(!t)throw new Error(`No client for network "${e}". Available: ${this.availableNetworks.join(", ")}`);this.#s[e]=this.#m(e,t)}return this.#s[e]}#U(e){for(const s of this.#e){const r=s.getAccount(e);if(r)return r.signer}const t=this.#e.flatMap(s=>s.getAccounts().map(r=>r.address));throw new Error(`No account found for address "${e}". Available addresses: ${t.join(", ")}`)}#B(e,t,s,r){return this.getAdapterForAccount(t.address)?.allowAutoSign===!1?!1:this.#c===!0?!0:typeof this.#c=="function"?this.#c({type:e,account:t,chain:s,data:r}):!1}async#N(e,t,s,r){return uj({type:e,signer:this.#U(t.address),data:r,client:e!=="sign-personal-message"?this.#M(s):void 0})}#_(e,t,s,r){return this.#k?Promise.reject(new Error("Wallet has been destroyed.")):this.#B(e,t,s,r)?this.#N(e,t,s,r):this.#d?Promise.reject(new Error("A signing request is already pending.")):new Promise((i,c)=>{this.#d={id:crypto.randomUUID(),type:e,account:t,chain:s,data:r,resolve:i,reject:c},this.#T()})}#L=async e=>this.#_("sign-personal-message",e.account,e.chain??"sui:unknown",e.message);#z=async e=>{const t=await e.transaction.toJSON();return this.#_("sign-transaction",e.account,e.chain,t)};#$=async e=>{const t=await e.transaction.toJSON();return this.#_("sign-and-execute-transaction",e.account,e.chain,t)}};const HL="modulepreload",qL=function(e,t){return new URL(e,t).href},LS={},ZL=function(t,s,r){let i=Promise.resolve();if(s&&s.length>0){let m=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const u=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");i=m(s.map(g=>{if(g=qL(g,r),g in LS)return;LS[g]=!0;const y=g.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(r)for(let O=u.length-1;O>=0;O--){const C=u[O];if(C.href===g&&(!y||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":HL,y||(S.as="script"),S.crossOrigin="",S.href=g,p&&S.setAttribute("nonce",p),document.head.appendChild(S),y)return new Promise((O,C)=>{S.addEventListener("load",O),S.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${g}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};async function YL(e){const{autoInitialize:t=!0,createInitialAccount:s=!1,mountUI:r=!0,dockStyle:i,container:c,onWalletCreated:u,...f}=e;if(t&&await Promise.all(f.adapters.map(y=>y.initialize())),s&&!f.adapters.some(y=>y.getAccounts().length>0)){const y=f.adapters.find(b=>b.createAccount&&b.getAccounts().length===0);y?.createAccount&&await y.createAccount({label:"Dev Account"})}const p=new FL(f);u?.(p);let m;if(r&&typeof document<"u"){const{mountDevWallet:y}=await ZL(async()=>{const{mountDevWallet:b}=await import("./mount-Cf1pxccE.js");return{mountDevWallet:b}},[],import.meta.url);m=y(p,{container:c,dockStyle:i})}const g=p.register();return{wallet:p,dispose(){m?.(),g(),p.destroy()}}}function WL(e){return{id:"dev-wallet-initializer",async initialize({networks:t,getClient:s}){const r={};for(const c of t)r[c]=`dapp-kit://${c}`;const{dispose:i}=await YL({adapters:e.adapters,networks:r,name:e.name,icon:e.icon,autoApprove:e.autoApprove,autoConnect:e.autoConnect,clientFactory:c=>s(c),autoInitialize:e.autoInitialize??!0,createInitialAccount:e.createInitialAccount??!0,mountUI:e.mountUI??!1,dockStyle:e.dockStyle,container:e.container,onWalletCreated:e.onWalletCreated});return{unregister:i}}}}var XL=class{constructor(){this.allowAutoSign=!0,this.#e=[],this.#t=new Set}#e;#t;getAccounts(){return[...this.#e]}getAccount(e){return this.#e.find(t=>t.address===e)}onAccountsChanged(e){return this.#t.add(e),()=>{this.#t.delete(e)}}destroy(){this.#e=[],this.#t.clear()}get _accounts(){return this.#e}setInitialAccounts(e){this.#e=e,this.notifyListeners()}addAccount(e){this.#e.push(e),this.notifyListeners()}removeAccountByAddress(e){const t=this.#e.findIndex(s=>s.address===e);return t===-1?!1:(this.#e.splice(t,1),this.notifyListeners(),!0)}replaceAccount(e,t){const s=this.#e.findIndex(r=>r.address===e);return s===-1?!1:(this.#e[s]=t,this.notifyListeners(),!0)}_performRename(e,t){const s=this.getAccount(e);return s?this.replaceAccount(e,Fy(s.signer,e,t)):!1}getDefaultLabel(){return`Account ${this.getAccounts().length+1}`}notifyListeners(){const e=this.getAccounts();for(const t of this.#t)t(e)}};const yi={ED25519:0,Secp256k1:1,Secp256r1:2,MultiSig:3,ZkLogin:5,Passkey:6},JL={ED25519:32,Secp256k1:33,Secp256r1:33,Passkey:33},ub={0:"ED25519",1:"Secp256k1",2:"Secp256r1",3:"MultiSig",5:"ZkLogin",6:"Passkey"};function zA(e,t){return H.IntentMessage(H.bytes(t.length)).serialize({intent:{scope:{[e]:!0},version:{V0:!0},appId:{Sui:!0}},value:t}).toBytes()}function zu(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}var Ip=class{equals(e){return zu(this.toRawBytes(),e.toRawBytes())}toBase64(){return st(this.toRawBytes())}toString(){throw new Error("`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead.")}toSuiPublicKey(){return st(this.toSuiBytes())}verifyWithIntent(e,t,s){const r=Vc(zA(s,e),{dkLen:32});return this.verify(r,t)}verifyPersonalMessage(e,t){return this.verifyWithIntent(H.byteVector().serialize(e).toBytes(),t,"PersonalMessage")}verifyTransaction(e,t){return this.verifyWithIntent(e,t,"TransactionData")}verifyAddress(e){return this.toSuiAddress()===e}toSuiBytes(){const e=this.toRawBytes(),t=new Uint8Array(e.length+1);return t.set([this.flag()]),t.set(e,1),t}toSuiAddress(){return ye(td(Vc(this.toSuiBytes(),{dkLen:32})).slice(0,el*2))}};function $A(e){const t=qe(e),s=ub[t[0]];switch(s){case"ED25519":case"Secp256k1":case"Secp256r1":const r=JL[s],i=t.slice(1,t.length-r);return{serializedSignature:e,signatureScheme:s,signature:i,publicKey:t.slice(1+i.length),bytes:t};default:throw new Error("Unsupported signature scheme")}}const KL=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]),Wa=new Uint32Array(64);class QL extends Nk{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,s){super(64,t,8,!1),this.A=s[0]|0,this.B=s[1]|0,this.C=s[2]|0,this.D=s[3]|0,this.E=s[4]|0,this.F=s[5]|0,this.G=s[6]|0,this.H=s[7]|0}get(){const{A:t,B:s,C:r,D:i,E:c,F:u,G:f,H:p}=this;return[t,s,r,i,c,u,f,p]}set(t,s,r,i,c,u,f,p){this.A=t|0,this.B=s|0,this.C=r|0,this.D=i|0,this.E=c|0,this.F=u|0,this.G=f|0,this.H=p|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,s){for(let y=0;y<16;y++,s+=4)Wa[y]=t.getUint32(s,!1);for(let y=16;y<64;y++){const b=Wa[y-15],S=Wa[y-2],O=yr(b,7)^yr(b,18)^b>>>3,C=yr(S,17)^yr(S,19)^S>>>10;Wa[y]=C+Wa[y-7]+O+Wa[y-16]|0}let{A:r,B:i,C:c,D:u,E:f,F:p,G:m,H:g}=this;for(let y=0;y<64;y++){const b=yr(f,6)^yr(f,11)^yr(f,25),S=g+b+IR(f,p,m)+KL[y]+Wa[y]|0,C=(yr(r,2)^yr(r,13)^yr(r,22))+RR(r,i,c)|0;g=m,m=p,p=f,f=u+S|0,u=c,c=i,i=r,r=S+C|0}r=r+this.A|0,i=i+this.B|0,c=c+this.C|0,u=u+this.D|0,f=f+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(r,i,c,u,f,p,m,g)}roundClean(){$s(Wa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),$s(this.buffer)}}class ez extends QL{constructor(){super(32,jR)}}const VA=SR(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),tz=VA[0],nz=VA[1],Xa=new Uint32Array(80),Ja=new Uint32Array(80);class sz extends Nk{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(t,s){super(128,t,16,!1),this.Ah=s[0]|0,this.Al=s[1]|0,this.Bh=s[2]|0,this.Bl=s[3]|0,this.Ch=s[4]|0,this.Cl=s[5]|0,this.Dh=s[6]|0,this.Dl=s[7]|0,this.Eh=s[8]|0,this.El=s[9]|0,this.Fh=s[10]|0,this.Fl=s[11]|0,this.Gh=s[12]|0,this.Gl=s[13]|0,this.Hh=s[14]|0,this.Hl=s[15]|0}get(){const{Ah:t,Al:s,Bh:r,Bl:i,Ch:c,Cl:u,Dh:f,Dl:p,Eh:m,El:g,Fh:y,Fl:b,Gh:S,Gl:O,Hh:C,Hl:R}=this;return[t,s,r,i,c,u,f,p,m,g,y,b,S,O,C,R]}set(t,s,r,i,c,u,f,p,m,g,y,b,S,O,C,R){this.Ah=t|0,this.Al=s|0,this.Bh=r|0,this.Bl=i|0,this.Ch=c|0,this.Cl=u|0,this.Dh=f|0,this.Dl=p|0,this.Eh=m|0,this.El=g|0,this.Fh=y|0,this.Fl=b|0,this.Gh=S|0,this.Gl=O|0,this.Hh=C|0,this.Hl=R|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,s){for(let W=0;W<16;W++,s+=4)Xa[W]=t.getUint32(s),Ja[W]=t.getUint32(s+=4);for(let W=16;W<80;W++){const ce=Xa[W-15]|0,ge=Ja[W-15]|0,F=ti(ce,ge,1)^ti(ce,ge,8)^FE(ce,ge,7),K=ni(ce,ge,1)^ni(ce,ge,8)^HE(ce,ge,7),w=Xa[W-2]|0,A=Ja[W-2]|0,N=ti(w,A,19)^bu(w,A,61)^FE(w,A,6),P=ni(w,A,19)^wu(w,A,61)^HE(w,A,6),U=OR(K,P,Ja[W-7],Ja[W-16]),q=NR(U,F,N,Xa[W-7],Xa[W-16]);Xa[W]=q|0,Ja[W]=U|0}let{Ah:r,Al:i,Bh:c,Bl:u,Ch:f,Cl:p,Dh:m,Dl:g,Eh:y,El:b,Fh:S,Fl:O,Gh:C,Gl:R,Hh:$,Hl:x}=this;for(let W=0;W<80;W++){const ce=ti(y,b,14)^ti(y,b,18)^bu(y,b,41),ge=ni(y,b,14)^ni(y,b,18)^wu(y,b,41),F=y&S^~y&C,K=b&O^~b&R,w=xR(x,ge,K,nz[W],Ja[W]),A=CR(w,$,ce,F,tz[W],Xa[W]),N=w|0,P=ti(r,i,28)^bu(r,i,34)^bu(r,i,39),U=ni(r,i,28)^wu(r,i,34)^wu(r,i,39),q=r&c^r&f^c&f,L=i&u^i&p^u&p;$=C|0,x=R|0,C=S|0,R=O|0,S=y|0,O=b|0,{h:y,l:b}=Ws(m|0,g|0,A|0,N|0),m=f|0,g=p|0,f=c|0,p=u|0,c=r|0,u=i|0;const M=qv(N,U,L);r=Zv(M,A,P,q),i=M|0}({h:r,l:i}=Ws(this.Ah|0,this.Al|0,r|0,i|0)),{h:c,l:u}=Ws(this.Bh|0,this.Bl|0,c|0,u|0),{h:f,l:p}=Ws(this.Ch|0,this.Cl|0,f|0,p|0),{h:m,l:g}=Ws(this.Dh|0,this.Dl|0,m|0,g|0),{h:y,l:b}=Ws(this.Eh|0,this.El|0,y|0,b|0),{h:S,l:O}=Ws(this.Fh|0,this.Fl|0,S|0,O|0),{h:C,l:R}=Ws(this.Gh|0,this.Gl|0,C|0,R|0),{h:$,l:x}=Ws(this.Hh|0,this.Hl|0,$|0,x|0),this.set(r,i,c,u,f,p,m,g,y,b,S,O,C,R,$,x)}roundClean(){$s(Xa,Ja)}destroy(){this.destroyed=!0,$s(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class rz extends sz{constructor(){super(64,MR)}}const PA=Hv(()=>new ez,kk(1)),ad=Hv(()=>new rz,kk(3));function GA(e,t,s=()=>{}){if(!Array.isArray(e))throw new TypeError(`"${t}" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)s(e[r],`${t}[${r}]`);return e}const Mt=(e,t,s)=>Dn(e,t,s),FA=rs;function az(e,t=""){if(typeof e!="string"){const s=t&&`"${t}" `;throw new TypeError(s+"expected string, got type="+typeof e)}return e}function Oc(e,t="object"){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(t==="object"?"expected valid options object":`"${t}" expected object, got type=${typeof e}`);return e}function Cu(e,t){if(typeof e!="function")throw new TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const db=td,Tr=(...e)=>bR(...e),Zh=e=>Gv(e),id=By,od=e=>wR(e),Yh=BigInt(0),zS=BigInt(1),iz=e=>e?`"${e}" `:"";function Nr(e,t=""){if(typeof e!="boolean")throw new TypeError(iz(t)+"expected boolean, got type="+typeof e);return e}function fb(e){if(typeof e=="bigint"){if(!no(e))throw new RangeError("positive bigint expected, got "+e)}else FA(e);return e}function Pc(e,t=""){if(typeof e!="number"){const s=t&&`"${t}" `;throw new TypeError(s+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){const s=t&&`"${t}" `;throw new RangeError(s+"expected safe integer, got "+e)}}function Wf(e){const t=fb(e).toString(16);return t.length&1?"0"+t:t}function HA(e){if(typeof e!="string")throw new TypeError("hex string expected, got "+typeof e);return e===""?Yh:BigInt("0x"+e)}function Gc(e){return HA(td(e))}function $u(e){return HA(td(Wh(Dn(e)).reverse()))}function hb(e,t){if(rs(t),t===0)throw new Error("zero output length is invalid");e=fb(e);const s=t*2,r=e.toString(16);if(r.length>s)throw new RangeError("number is too large");return Gv(r.padStart(s,"0"))}function qA(e,t){return hb(e,t).reverse()}function Wh(e){return Uint8Array.from(Mt(e))}function no(e){return typeof e=="bigint"&&Yh<=e}function ZA(e,t,s){return no(e)&&no(t)&&no(s)&&t<=e&&e<s}function Xh(e,t,s,r){if(!ZA(t,s,r))throw new RangeError("expected valid "+e+": "+s+" <= n < "+r+", got "+t)}function pb(e){if(e<Yh)throw new Error("expected non-negative bigint, got "+e);return e===Yh?0:e.toString(2).length}const mb=e=>(Pc(e,"n"),(zS<<BigInt(e))-zS);function oz(e,t,s){if(rs(e,"hashLen"),rs(t,"qByteLen"),typeof s!="function")throw new TypeError("hmacFn must be a function");const r=R=>new Uint8Array(R),i=Uint8Array.of(),c=Uint8Array.of(0),u=Uint8Array.of(1),f=1e3;let p=r(e),m=r(e),g=0;const y=()=>{p.fill(1),m.fill(0),g=0},b=(...R)=>s(m,Tr(p,...R)),S=(R=i)=>{m=b(c,R),p=b(),R.length!==0&&(m=b(u,R),p=b())},O=()=>{if(g++>=f)throw new Error("drbg: tried max amount of iterations");let R=0;const $=[];for(;R<t;){p=b();const x=p.slice();$.push(x),R+=p.length}return Tr(...$)};return(R,$)=>{y(),S(R);let x;for(;(x=$(O()))===void 0;)S();return y(),x}}function Sr(e,t={},s={},r="object"){Oc(e,r),Oc(t,"fields"),Oc(s,"optFields");function i(u,f,p){const m=r==="object"?`param "${String(u)}"`:`"${r}.${String(u)}"`,g=e[u];if(!Object.hasOwn(e,u)&&(p?g!==void 0:f!=="function"))throw new TypeError(`${m} is invalid: expected own property`);if(p&&g===void 0)return;const y=typeof g;if(y!==f||g===null)throw new TypeError(`${m} is invalid: expected ${f}, got ${y}`)}const c=(u,f)=>Object.entries(u).forEach(([p,m])=>i(p,m,f));c(t,!1),c(s,!0)}const un=BigInt(0),vt=BigInt(1),oi=BigInt(2),YA=BigInt(3),gb=BigInt(4),WA=BigInt(5),cz=BigInt(7),XA=BigInt(8),lz=BigInt(9),uz=BigInt(15),JA=BigInt(16),dz=BigInt("0x10000000000000000");function Ft(e,t){if(t<=un)throw new Error("mod: expected positive modulus, got "+t);const s=e%t;return s>=un?s:t+s}function KA(e,t,s){if(s<=vt)throw new Error("pow: expected modulus > 1, got "+s);if(typeof t!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof t);if(t<un)throw new Error("invalid exponent, negatives unsupported");if(t===un)return vt;if(t===vt)return e;let r=e%s;if(r<un&&(r+=s),t<dz){let f=vt;for(;t>un;)t&vt&&(f=f*r%s),r=r*r%s,t>>=vt;return f}const i=[];for(;t>un;)i.push(Number(t&uz)),t>>=gb;const c=new Array(16);c[0]=vt,c[1]=r;for(let f=2;f<16;f++)c[f]=c[f-1]*r%s;let u=c[i[i.length-1]];for(let f=i.length-2;f>=0;f--){u=u*u%s,u=u*u%s,u=u*u%s,u=u*u%s;const p=i[f];p!==0&&(u=u*c[p]%s)}return u}function vr(e,t,s){if(s<=vt)throw new Error("pow2: expected modulus > 1, got "+s);if(t<un)throw new Error("pow2: expected non-negative exponent, got "+t);let r=e;for(;t-- >un;)r*=r,r%=s;return r}function $S(e,t){if(e===un)throw new Error("invert: expected non-zero number");if(t<=vt)throw new Error("invert: expected modulus > 1, got "+t);let s=Ft(e,t),r=t,i=un,c=vt;for(;s!==un;){const f=r/s,p=r-s*f,m=i-c*f;r=s,s=p,i=c,c=m}if(r!==vt)throw new Error("invert: does not exist");return Ft(i,t)}function fz(e,t){if(t<=vt)throw new Error("invertCt: expected prime modulus > 1, got "+t);const s=Ft(e,t);if(s===un)throw new Error("invertCt: expected non-zero number");const r=KA(s,t-oi,t);if(Ft(s*r,t)!==vt)throw new Error("invertCt: does not exist");return r}function yb(e,t,s){const r=e;if(!r.eql(r.sqr(t),s))throw new Error("Cannot find square root")}function vb(e,t){if((e&vt)===un)throw new Error(t+": expected odd modulus, got "+e)}function QA(e,t){const s=e,r=(s.ORDER+vt)/gb,i=s.pow(t,r);return yb(s,i,t),i}function hz(e,t){const s=e,r=(s.ORDER-WA)/XA,i=s.mul(t,oi),c=s.pow(i,r),u=s.mul(t,c),f=s.mul(s.mul(u,oi),c),p=s.mul(u,s.sub(f,s.ONE));return yb(s,p,t),p}function pz(e){const t=bb(e),s=eO(e),r=s(t,t.neg(t.ONE)),i=s(t,r),c=s(t,t.neg(r)),u=(e+cz)/JA;return((f,p)=>{const m=f;let g=m.pow(p,u),y=m.mul(g,r);const b=m.mul(g,i),S=m.mul(g,c),O=m.eql(m.sqr(y),p),C=m.eql(m.sqr(b),p);g=m.cmov(g,y,O),y=m.cmov(S,b,C);const R=m.eql(m.sqr(y),p),$=m.cmov(g,y,R);return yb(m,$,p),$})}function eO(e){if(e<YA)throw new Error("sqrt is not defined for small field");vb(e,"tonelliShanks");let t=e-vt,s=0;for(;t%oi===un;)t/=oi,s++;let r=oi;const i=bb(e);for(;Jh(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(s===1)return QA;let c=i.pow(r,t);const u=(t+vt)/oi;return function(p,m){const g=p;if(g.is0(m))return m;if(Jh(g,m)!==1)throw new Error("Cannot find square root");let y=s,b=g.mul(g.ONE,c),S=g.pow(m,t),O=g.pow(m,u);for(;!g.eql(S,g.ONE);){if(g.is0(S))throw new Error("Cannot find square root: probably non-prime P");let C=1,R=g.sqr(S);for(;!g.eql(R,g.ONE);)if(C++,R=g.sqr(R),C===y)throw new Error("Cannot find square root");const $=vt<<BigInt(y-C-1),x=g.pow(b,$);y=C,b=g.sqr(x),S=g.mul(S,b),O=g.mul(O,x)}return O}}function mz(e){return vb(e,"Fp.sqrt"),e%gb===YA?QA:e%XA===WA?hz:e%JA===lz?pz(e):eO(e)}const gz=(e,t)=>(Ft(e,t)&vt)===vt,yz=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Vu(e){if(Oc(e,"field"),typeof e.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof e.ORDER);Pc(e.BYTES,"BYTES"),Pc(e.BITS,"BITS");for(const t of yz)Cu(e[t],"field."+t);if(e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=vt)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function tO(e,t,s=!1){Vu(e),GA(t,"nums"),Nr(s,"passZero");const r=e,i=new Array(t.length).fill(s?r.ZERO:void 0),c=t.reduce((f,p,m)=>r.is0(p)?f:(i[m]=f,r.mul(f,p)),r.ONE),u=r.inv(c);return t.reduceRight((f,p,m)=>r.is0(p)?f:(i[m]=r.mul(f,i[m]),r.mul(f,p)),u),i}function Jh(e,t){Vu(e);const s=e;vb(s.ORDER,"FpLegendre");const r=(s.ORDER-vt)/oi,i=s.pow(t,r),c=s.eql(i,s.ONE),u=s.eql(i,s.ZERO),f=s.eql(i,s.neg(s.ONE));if(!c&&!u&&!f)throw new Error("invalid Legendre symbol result");return c?1:u?0:-1}function vz(e,t){if(t!==void 0&&FA(t),e<=un)throw new Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);const s=pb(e);if(t!==void 0&&t<s)throw new Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${s})`);const r=t!==void 0?t:s,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}const VS=new WeakMap;class PS{ORDER;BITS;BYTES;isLE;ZERO=un;ONE=vt;_lengths;_mod;constructor(t,s={}){if(t<=vt)throw new Error("invalid field: expected ORDER > 1, got "+t);let r;this.isLE=!1,s!=null&&typeof s=="object"&&(typeof s.BITS=="number"&&(r=s.BITS),typeof s.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:s.sqrt,enumerable:!0}),typeof s.isLE=="boolean"&&(this.isLE=s.isLE),s.allowedLengths&&(this._lengths=Object.freeze(s.allowedLengths.slice())),typeof s.modFromBytes=="boolean"&&(this._mod=s.modFromBytes));const{nBitLength:i,nByteLength:c}=vz(t,r);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=t,this.BITS=i,this.BYTES=c,Object.freeze(this)}create(t){return Ft(t,this.ORDER)}isValid(t){if(typeof t!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof t);return un<=t&&t<this.ORDER}is0(t){return t===un}isValidNot0(t){return!this.is0(t)&&this.isValid(t)}isOdd(t){return(t&vt)===vt}neg(t){return Ft(-t,this.ORDER)}eql(t,s){return t===s}sqr(t){return Ft(t*t,this.ORDER)}add(t,s){return Ft(t+s,this.ORDER)}sub(t,s){return Ft(t-s,this.ORDER)}mul(t,s){return Ft(t*s,this.ORDER)}pow(t,s){return KA(t,s,this.ORDER)}div(t,s){return Ft(t*$S(s,this.ORDER),this.ORDER)}sqrN(t){return t*t}addN(t,s){return t+s}subN(t,s){return t-s}mulN(t,s){return t*s}inv(t){return $S(t,this.ORDER)}sqrt(t){let s=VS.get(this);return s||VS.set(this,s=mz(this.ORDER)),s(this,t)}toBytes(t){return this.isLE?qA(t,this.BYTES):hb(t,this.BYTES)}fromBytes(t,s=!1){Mt(t);const{_lengths:r,BYTES:i,isLE:c,ORDER:u,_mod:f}=this;if(r){if(t.length<1||!r.includes(t.length)||t.length>i)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+t.length);const m=new Uint8Array(i);m.set(t,c?0:m.length-t.length),t=m}if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);let p=c?$u(t):Gc(t);if(f&&(p=Ft(p,u)),!s&&!this.isValid(p))throw new Error("invalid field element: outside of range 0..ORDER");return p}invertBatch(t){return tO(this,t,!0)}cmov(t,s,r){return Nr(r,"condition"),r?s:t}}function bb(e,t={}){return Object.freeze(PS.prototype),new PS(e,t)}function nO(e){if(typeof e!="bigint")throw new Error("field order must be bigint");if(e<=vt)throw new Error("field order must be greater than 1");const t=pb(e-vt);return Math.ceil(t/8)}function wb(e){const t=nO(e);return t+Math.ceil(t/2)}function sO(e,t,s=!1){Mt(e);const r=e.length,i=nO(t),c=Math.max(wb(t),16);if(r<c||r>1024)throw new Error("expected "+c+"-1024 bytes of input, got "+r);const u=s?$u(e):Gc(e),f=Ft(u,t-vt)+vt;return s?qA(f,i):hb(f,i)}const Tb=BigInt(0),Pu=BigInt(1),bz=BigInt(4),J0=16,GS=128,wz=5,FS=2**31;function sl(e){const t=e;if(typeof t!="function")throw new TypeError('"Point" expected constructor, got type='+typeof e);Cu(t.fromAffine,"Point.fromAffine"),Cu(t.fromBytes,"Point.fromBytes"),Cu(t.fromHex,"Point.fromHex"),Oc(t.BASE,"Point.BASE"),Oc(t.ZERO,"Point.ZERO"),Vu(t.Fp),Vu(t.Fn)}function rO(e,t){sl(e),iO(t,e);const s=tO(e.Fp,t.map(r=>r.Z));return t.map((r,i)=>e.fromAffine(r.toAffine(s[i])))}function Tz(e,t,s=1){if(!Number.isSafeInteger(e)||e<s||e>t)throw new Error("invalid window size, expected ["+s+".."+t+"], got W="+e)}function Ez(e,t){const s=e*(4*t+128);if(s>FS)throw new Error("invalid window size: table would need ~"+Math.ceil(s/2**20)+" MiB, max "+FS/2**20+" MiB")}function aO(e,t){if(e!==void 0){Cu(e,"randomBytes");try{const s=e(t);if(!id(s)||s.length!==t)return}catch{return}return e}}function iO(e,t){GA(e,"points"),e.forEach((s,r)=>{if(!(s instanceof t))throw new Error("invalid point at index "+r)})}function Sz(e,t,s){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,i)=>{if(!(s===void 0?t.isValid(r):no(r)&&r<s))throw new Error("invalid scalar at index "+i)})}const oO=new WeakMap;function K0(e){return oO.get(e)||1}function _z(e,t){const s=e.double(),r=[e];for(let i=1;i<t;i++)r.push(r[i-1].add(s));return r}function kz(e,t){const s=2**t,r=s/2,i=BigInt(s-1),c=[];for(;e>Tb;){let u=0;e&Pu&&(u=Number(e&i),u>=r&&(u-=s),e-=BigInt(u)),c.push(u),e>>=Pu}return c}function Az(e,t,s){const r=2**t,i=r/2,c=BigInt(r-1),u=BigInt(t),f=[];for(let p=0;p<s;p++){let m=Number(e&c);e>>=u,m>i&&(m-=r,e+=Pu),f.push(m)}if(e!==Tb)throw new Error("invalid wnaf");return f}function Oz(e,t,s){let r=0;for(const c of s)r=Math.max(r,c.length);let i=e;for(let c=r-1;c>=0;c--){c!==r-1&&(i=i.double());for(let u=0;u<s.length;u++){const f=s[u][c];if(f){const p=t[u][Math.abs(f)-1>>1];i=i.add(f<0?p.negate():p)}}}return i}class cO{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(t,s){sl(t),this.randomBytes=aO(s,J0),this.Point=t,this.BASE=t.BASE,this.ZERO=t.ZERO,this.bits=t.Fn.BITS}buildWnafTable(t,s,r){const i=Math.ceil(r/s)+1,c=2**(s-1),u=[];let f=t;for(let p=0;p<i;p++){let m=f;for(let g=0;g<c;g++)u.push(m),m=m.add(f);f=u[u.length-1].double()}return{W:s,bits:r,windows:i,comp:u}}wnafCachedCT(t,s){const{W:r,windows:i,comp:c}=t,u=2**(r-1),f=Az(s,r,i);let p=this.ZERO,m=this.BASE;for(let g=0;g<i;g++){const y=f[g],b=g*u,S=Math.abs(y)-1;let O=c[b];for(let R=1;R<u;R++)O=R===S?c[b+R]:O;const C=O.negate();y===0?m=m.add(c[b]):p=p.add(y<0?C:O)}return{p,f:m}}getWnafPrecomputes(t,s,r,i){let c=this.wnafPrecomputes.get(s),u=c?.find(f=>f.W===t&&f.bits===r);return u||(u=this.buildWnafTable(s,t,r),typeof i=="function"&&(u={...u,comp:i(u.comp)}),c||(c=[],this.wnafPrecomputes.set(s,c)),c.push(u)),u}assertPoint(t){if(!(t instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof t)}validateMulInput(t,s){if(this.assertPoint(t),!ZA(s,Pu,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(t,s,r,i){const c=K0(t);return c===1?this.fixedWindowCT(t,s,r):this.wnafCachedCT(this.getWnafPrecomputes(c,t,r,i),s)}mulCT(t,s,r){return this.validateMulInput(t,s),this.runCT(t,s,this.bits,r)}mulCTBlinded(t,s,r){if(this.validateMulInput(t,s),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");const i=this.Point.Fn.BITS+GS,c=this.randomBytes(J0);if(!id(c)||c.length!==J0)throw new Error("randomBytes returned invalid byte array");c[0]=c[0]&63|128;const u=s+Gc(c)*this.Point.Fn.ORDER;return this.runCT(t,u,i,r)}fixedWindowCT(t,s,r){const i=wz,c=1<<i,u=mb(i),f=new Array(c);f[0]=this.ZERO;for(let g=1;g<c;g++)f[g]=f[g-1].add(t);const p=Math.ceil(r/i);let m=this.ZERO;for(let g=p-1;g>=0;g--){if(g!==p-1)for(let S=0;S<i;S++)m=m.double();const y=Number(s>>BigInt(g*i)&u);let b=f[0];for(let S=1;S<c;S++)b=S===y?f[S]:b;m=m.add(b)}return{p:m,f:m}}shouldBlind(t,s){return this.randomBytes===void 0?!1:s===Pu?!0:t!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(t,s,r,i){return this.shouldBlind(t,r)?this.mulCTBlinded(t,s,i):this.mulCT(t,s,i)}mulUnsafe(t,s,r){if(this.assertPoint(t),!no(s))throw new Error("invalid scalar");const i=K0(t);if(i===1||s>=this.Point.Fn.ORDER)return ev(this.Point,[t],[s],!0);const c=this.getWnafPrecomputes(i,t,this.bits,r);return this.wnafCachedCT(c,s).p}setWindowSize(t,s){this.assertPoint(t),Tz(s,this.bits);const r=Math.ceil((this.bits+GS)/s)+1;Ez(r*2**(s-1),this.Point.Fp.BYTES),oO.set(t,s),this.wnafPrecomputes.delete(t)}hasWindowSize(t){return K0(t)!==1}}function ev(e,t,s,r=!1){if(sl(e),iO(t,e),Nr(r,"allowOversized"),Sz(s,e.Fn,r?e.Fn.ORDER**bz:void 0),t.length!==s.length)throw new Error("arrays of points and scalars must have equal length");const i=t.map(u=>_z(u,4)),c=s.map(u=>kz(u,4));return Oz(e.ZERO,i,c)}function HS(e,t,s){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Vu(t),t}else return bb(e,{isLE:s})}function lO(e,t,s={},r){if(e!=="weierstrass"&&e!=="edwards")throw new Error('expected curve type "weierstrass" or "edwards"');if(r===void 0&&(r=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);Sr(s);for(const p of["p","n","h"]){const m=t[p];if(!(no(m)&&m!==Tb))throw new Error(`CURVE.${p} must be positive bigint`)}const i=HS(t.p,s.Fp,r),c=HS(t.n,s.Fn,r),f=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const p of f)if(!i.isValid(t[p]))throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:c}}function uO(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}const Xf=BigInt(0),Jf=BigInt(1),Kf=BigInt(2),Nz=BigInt(4),qS=BigInt(8);function xz(e,t,s,r){const i=e.sqr(s),c=e.sqr(r),u=e.add(e.mul(t.a,i),c),f=e.add(e.ONE,e.mul(t.d,e.mul(i,c)));return e.eql(u,f)}function Cz(e,t={}){Sr(t,{},{},"extraOpts");const s=t,r=lO("edwards",e,s,s.FpFnLE),{Fp:i,Fn:c}=r;let u=r.CURVE;const{h:f}=u;if(Jh(i,u.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(Jh(i,u.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");Sr(s,{},{uvRatio:"function",randomBytes:"function"});const p=s.randomBytes===void 0?od:s.randomBytes,m=Kf<<BigInt(i.BYTES*8)-Jf;function g(x){if(!i.isOdd)throw new Error("Field does not have .isOdd()");return i.isOdd(x)}const y=s.uvRatio===void 0?(x,W)=>{try{return{isValid:!0,value:i.sqrt(i.div(x,W))}}catch{return{isValid:!1,value:Xf}}}:s.uvRatio;if(!xz(i,u,u.Gx,u.Gy))throw new Error("bad curve params: generator point");const b=i.eql(u.a,i.neg(i.ONE))?x=>i.neg(x):i.eql(u.a,i.ONE)?x=>x:x=>i.mul(u.a,x);function S(x,W,ce=!1){const ge=ce?Jf:Xf;return Xh("coordinate "+x,W,ge,m),W}function O(x){if(!(x instanceof C))throw new Error("EdwardsPoint expected")}class C{static BASE=new C(u.Gx,u.Gy,i.ONE,i.mul(u.Gx,u.Gy));static ZERO=new C(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=c;X;Y;Z;T;constructor(W,ce,ge,F){this.X=S("x",W),this.Y=S("y",ce),this.Z=S("z",ge,!0),this.T=S("t",F),Object.freeze(this)}static CURVE(){return u}static fromAffine(W){if(W instanceof C)throw new Error("extended point not allowed");const{x:ce,y:ge}=W||{};return S("x",ce),S("y",ge),new C(ce,ge,i.ONE,i.mul(ce,ge))}static fromBytes(W,ce=!1){const ge=i.BYTES,{a:F,d:K}=u;W=Wh(Mt(W,ge,"point")),Nr(ce,"zip215");const w=Wh(W),A=W[ge-1];w[ge-1]=A&-129;const N=$u(w),P=ce?m:i.ORDER;Xh("point.y",N,Xf,P);const U=i.sqr(N),q=i.sub(U,i.ONE),L=i.sub(i.mulN(K,U),F);let{isValid:M,value:k}=y(q,L);if(!M)throw new Error("bad point: invalid y coordinate");const j=g(k),D=(A&128)!==0;if(!ce&&i.is0(k)&&D)throw new Error("bad point: x=0 and x_0=1");return D!==j&&(k=i.neg(k)),C.fromAffine({x:k,y:N})}static fromHex(W,ce=!1){return C.fromBytes(Zh(W),ce)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(W=6,ce=!0){return $.setWindowSize(this,W),ce||this.multiply(Kf),this}assertValidity(){const W=this,{a:ce,d:ge}=u;if(W.is0())throw new Error("bad point: ZERO");const{X:F,Y:K,Z:w,T:A}=W,N=i.sqr(F),P=i.sqr(K),U=i.sqr(w),q=i.sqr(U),L=i.mul(N,ce),M=i.mul(i.add(L,P),U),k=i.add(q,i.mul(ge,i.mul(N,P)));if(!i.eql(M,k))throw new Error("bad point: equation left != right (1)");const j=i.mul(F,K),D=i.mul(w,A);if(!i.eql(j,D))throw new Error("bad point: equation left != right (2)")}equals(W){O(W);const{X:ce,Y:ge,Z:F}=this,{X:K,Y:w,Z:A}=W,N=i.mul(ce,A),P=i.mul(K,F),U=i.mul(ge,A),q=i.mul(w,F);return i.eql(N,P)&&i.eql(U,q)}is0(){return this.equals(C.ZERO)}negate(){return new C(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){const{X:W,Y:ce,Z:ge}=this,F=i.sqr(W),K=i.sqr(ce),w=i.mul(i.sqr(ge),Kf),A=b(F),N=i.addN(W,ce),P=i.sub(i.subN(i.sqr(N),F),K),U=i.addN(A,K),q=i.subN(U,w),L=i.subN(A,K),M=i.mul(P,q),k=i.mul(U,L),j=i.mul(P,L),D=i.mul(q,U);return new C(M,k,D,j)}add(W){O(W);const{d:ce}=u,{X:ge,Y:F,Z:K,T:w}=this,{X:A,Y:N,Z:P,T:U}=W,q=i.mul(ge,A),L=i.mul(F,N),M=i.mul(i.mulN(w,ce),U),k=i.mul(K,P),j=i.sub(i.subN(i.mulN(i.addN(ge,F),i.addN(A,N)),q),L),D=i.subN(k,M),z=i.addN(k,M),J=i.sub(L,b(q)),V=i.mul(j,D),re=i.mul(z,J),ue=i.mul(j,J),I=i.mul(D,z);return new C(V,re,I,ue)}subtract(W){return O(W),this.add(W.negate())}multiply(W){if(!c.isValidNot0(W))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:ce,f:ge}=$.mulSecret(this,W,f,R);return R([ce,ge])[0]}multiplyUnsafe(W){if(!c.isValid(W))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return W===Xf?C.ZERO:this.is0()||W===Jf?this:$.mulUnsafe(this,W,R)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return $.mulUnsafe(this,u.n).is0()}toAffine(W){const ce=this;let ge=W;if(ge!=null&&typeof ge!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof ge);const{X:F,Y:K,Z:w}=ce,A=ce.is0();ge==null&&(ge=A?i.create(qS):i.inv(w));const N=i.mul(F,ge),P=i.mul(K,ge),U=i.mul(w,ge);if(A)return{x:i.ZERO,y:i.ONE};if(!i.eql(U,i.ONE))throw new Error("invZ was invalid");return{x:N,y:P}}clearCofactor(){return f===Jf?this:f===Kf?this.double():f===Nz?this.double().double():f===qS?this.double().double().double():this.multiplyUnsafe(f)}toBytes(){const{x:W,y:ce}=this.toAffine(),ge=i.toBytes(ce);return ge[ge.length-1]|=g(W)?128:0,ge}toHex(){return db(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const R=x=>rO(C,x),$=new cO(C,p);return $.bits>=6&&C.BASE.precompute(6),Object.freeze(C.prototype),Object.freeze(C),C}function Iz(e,t,s={}){if(sl(e),typeof t!="function")throw new Error('"hash" function param is required');const r=t,i=s;Sr(i,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});const{prehash:c}=i,{BASE:u,Fp:f,Fn:p}=e,m=r.outputLen,g=2*f.BYTES;if(m!==void 0&&(Pc(m,"hash.outputLen"),m!==g))throw new Error(`hash.outputLen must be ${g}, got ${m}`);const y=i.randomBytes===void 0?od:i.randomBytes,b=i.toMontgomery,S=i.toMontgomerySecret,O=i.adjustScalarBytes===void 0?L=>L:i.adjustScalarBytes,C=i.domain===void 0?(L,M,k)=>{if(Nr(k,"phflag"),M.length||k)throw new Error("Contexts/pre-hash are not supported");return L}:i.domain;function R(L){return p.create($u(L))}function $(L){const M=A.secretKey;Mt(L,A.secretKey,"secretKey");const k=Mt(r(L),2*M,"hashedSecretKey"),j=O(k.slice(0,M)),D=k.slice(M,2*M),z=R(j);return{head:j,prefix:D,scalar:z}}function x(L){const{head:M,prefix:k,scalar:j}=$(L),D=u.multiply(j),z=D.toBytes();return{head:M,prefix:k,scalar:j,point:D,pointBytes:z}}function W(L){return x(L).pointBytes}function ce(L=Uint8Array.of(),...M){const k=Tr(...M);return R(r(C(k,Mt(L,void 0,"context"),!!c)))}function ge(L,M,k={}){Sr(k,{},{},"options"),L=Wh(Mt(L,void 0,"message")),c&&(L=c(L));const{prefix:j,scalar:D,pointBytes:z}=x(M),J=ce(k.context,j,L),V=u.multiply(J).toBytes(),re=ce(k.context,V,z,L),ue=p.create(J+re*D);if(!p.isValid(ue))throw new Error("sign failed: invalid s");const I=Tr(V,p.toBytes(ue));return Mt(I,A.signature,"result")}const F={zip215:i.zip215};function K(L,M,k,j=F){Sr(j);const{context:D}=j,z=j.zip215===void 0?!!F.zip215:j.zip215,J=A.signature;L=Mt(L,J,"signature"),M=Mt(M,void 0,"message"),k=Mt(k,A.publicKey,"publicKey"),z!==void 0&&Nr(z,"zip215"),c&&(M=c(M));const V=J/2,re=L.subarray(0,V),ue=$u(L.subarray(V,J));let I,X,oe;try{I=e.fromBytes(k,z),X=e.fromBytes(re,z),oe=u.multiplyUnsafe(ue)}catch{return!1}if(!z&&I.isSmallOrder())return!1;const he=ce(D,re,k,M);return X.add(I.multiplyUnsafe(he)).subtract(oe).clearCofactor().is0()}const w=f.BYTES,A={secretKey:w,publicKey:w,signature:2*w,seed:w};function N(L){return L=L===void 0?y(A.seed):L,Mt(L,A.seed,"seed")}function P(L){return id(L)&&L.length===A.secretKey}function U(L,M){try{return!!e.fromBytes(L,M===void 0?F.zip215:M)}catch{return!1}}const q={getExtendedPublicKey:x,randomSecretKey:N,isValidSecretKey:P,isValidPublicKey:U,toMontgomery(L){if(b===void 0)throw new Error("Montgomery conversion is not supported for this curve");return b(e.fromBytes(L))},toMontgomerySecret(L){if(S===void 0)throw new Error("Montgomery conversion is not supported for this curve");return S(L)}};return Object.freeze(A),Object.freeze(q),Object.freeze({keygen:uO(N,W),getPublicKey:W,sign:ge,verify:K,utils:q,Point:e,lengths:A})}const tv=BigInt(1),ZS=BigInt(2),Rz=BigInt(5),jz=BigInt(8),Eb=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Mz={p:Eb,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:jz,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Dz(e){const t=BigInt(10),s=BigInt(20),r=BigInt(40),i=BigInt(80),c=Eb,f=e*e%c*e%c,p=vr(f,ZS,c)*f%c,m=vr(p,tv,c)*e%c,g=vr(m,Rz,c)*m%c,y=vr(g,t,c)*g%c,b=vr(y,s,c)*y%c,S=vr(b,r,c)*b%c,O=vr(S,i,c)*S%c,C=vr(O,i,c)*S%c,R=vr(C,t,c)*g%c;return{pow_p_5_8:vr(R,ZS,c)*e%c,b2:f}}function dO(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const YS=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Uz(e,t){const s=Eb,r=Ft(t*t*t,s),i=Ft(r*r*t,s),c=Dz(e*i).pow_p_5_8;let u=Ft(e*r*c,s);const f=Ft(t*u*u,s),p=u,m=Ft(u*YS,s),g=f===e,y=f===Ft(-e,s),b=f===Ft(-e*YS,s);return g&&(u=p),(y||b)&&(u=m),gz(u,s)&&(u=Ft(-u,s)),{isValid:g||y,value:u}}const Sb=Cz(Mz,{uvRatio:Uz}),WS=Sb.Fp;function Bz(e){const{y:t}=e;return WS.toBytes(WS.div(tv+t,tv-t))}function Lz(e){const t=Sb.Fp.BYTES;return Dn(e,t),dO(ad(e.subarray(0,t))).subarray(0,t)}function zz(e){return Iz(Sb,ad,Object.assign({adjustScalarBytes:dO,toMontgomery:Bz,toMontgomerySecret:Lz,zip215:!0},e))}const ta=zz({}),Q0=32;var Cc,$z=(Cc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==Q0)throw new Error(`Invalid public key input. Expected ${Q0} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.ED25519}async verify(t,s){let r;if(typeof s=="string"){const i=$A(s);if(i.signatureScheme!=="ED25519")throw new Error("Invalid signature scheme");if(!zu(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return ta.verify(r,t,this.toRawBytes())}},Cc.SIZE=Q0,Cc);class XS{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(t,s){if(Vv(t),Dn(s,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("expected Hash instance");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(s.length>r?t.create().update(s).digest():s);for(let c=0;c<i.length;c++)i[c]^=54;this.iHash.update(i),this.oHash=t.create();for(let c=0;c<i.length;c++)i[c]^=106;this.oHash.update(i),$s(i)}update(t){return $c(this),this.iHash.update(t),this}digestInto(t){$c(this),Pv(t,this),this.finished=!0;const s=t.subarray(0,this.outputLen);this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||=Object.create(Object.getPrototypeOf(this),{});const{oHash:s,iHash:r,finished:i,destroyed:c,blockLen:u,outputLen:f,canXOF:p}=this;return t=t,t.finished=i,t.destroyed=c,t.blockLen=u,t.outputLen=f,t.canXOF=p,t.oHash=s._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Rp=(()=>{const e=((t,s,r)=>new XS(t,s).update(r).digest());return e.create=(t,s)=>new XS(t,s),e})();function Vz(e,t,s,r){Vv(e);const i=Fv({dkLen:32,asyncTick:10},r),{c,dkLen:u,asyncTick:f}=i;if(rs(c,"c"),rs(u,"dkLen"),rs(f,"asyncTick"),c<1)throw new Error('"c" (iterations) must be >= 1');if(u<1)throw new Error('"dkLen" must be >= 1');if(u>(2**32-1)*e.outputLen)throw new Error("derived key too long");const p=PE(t,"password");try{const m=PE(s,"salt");try{const g=new Uint8Array(u),{iHash:y,oHash:b,outputLen:S}=Rp.create(e,p),O=new Uint8Array(S),C=Pz(y,b,m,O);return{c,dkLen:u,asyncTick:f,DK:g,outputLen:S,eng:C}}finally{typeof s=="string"&&$s(m)}}finally{typeof t=="string"&&$s(p)}}function Pz(e,t,s,r){const i=new Uint8Array(4),c=oh(i),u=e._cloneInto().update(s),f=t._cloneInto(),p=e._cloneInto,m=t._cloneInto;return{u1:(g,y)=>{c.setInt32(0,g,!1),u._cloneInto(f).update(i).digestInto(r),t._cloneInto(f).update(r).digestInto(r),y.set(r.subarray(0,y.length))},rounds:(g,y)=>{for(let b=1;b<g;b++){p.call(e,f).update(r).digestInto(r),m.call(t,f).update(r).digestInto(r);for(let S=0;S<y.length;S++)y[S]^=r[S]}},output:g=>(e.destroy(),t.destroy(),u.destroy(),f.destroy(),$s(r),g)}}function Gz(e,t,s,r){const{c:i,dkLen:c,DK:u,outputLen:f,eng:p}=Vz(e,t,s,r);for(let m=1,g=0;g<c;m++,g+=f){const y=u.subarray(g,g+f);p.u1(m,y),p.rounds(i,y)}return p.output(u)}function Fz(e){for(let t=0;t<e.length;t++){const s=e.charCodeAt(t);if(s>=55296&&s<=56319){if(t+1>=e.length)return!1;const r=e.charCodeAt(++t);if(r<56320||r>57343)return!1}else if(s>=56320&&s<=57343)return!1}return!0}function fO(e){if(typeof e!="string")throw new TypeError("invalid mnemonic type: "+typeof e);if(!Fz(e))throw new TypeError("expected well-formed Unicode string");return e.normalize("NFKD")}function Hz(e){const t=fO(e),s=t.split(" ");if(![12,15,18,21,24].includes(s.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:s}}const qz=e=>{if(typeof e!="string")throw new TypeError("invalid passphrase type: "+typeof e);return fO("mnemonic"+e)};function Zz(e,t=""){return Gz(ad,Hz(e).nfkd,qz(t),{c:2048,dkLen:64})}function JS(e){return!!new RegExp("^m\\/44'\\/784'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(e)}function Yz(e){return Zz(e,"")}function Wz(e){return kr(Yz(e))}const Xz=BigInt(0);class Jz extends Error{constructor(t=""){super(t)}}const sa={Err:Jz,_tlv:{encode:(e,t)=>{const{Err:s}=sa;if(Pc(e,"tag"),e<0||e>255)throw new s("tlv.encode: wrong tag");if(az(t,"data"),t.length&1)throw new s("tlv.encode: unpadded data");const r=t.length/2,i=Wf(r);if(i.length/2&128)throw new s("tlv.encode: long form length too big");const c=r>127?Wf(i.length/2|128):"";return Wf(e)+c+i+t},decode(e,t){const{Err:s}=sa;t=Mt(t,void 0,"DER data");let r=0;if(e<0||e>255)throw new s("tlv.decode: wrong tag");if(t.length<2||t[r++]!==e)throw new s("tlv.decode: wrong tlv");const i=t[r++],c=!!(i&128);let u=0;if(!c)u=i;else{const p=i&127;if(!p)throw new s("tlv.decode(long): indefinite length not supported");if(p>4)throw new s("tlv.decode(long): byte length is too big");const m=t.subarray(r,r+p);if(m.length!==p)throw new s("tlv.decode: length bytes not complete");if(m[0]===0)throw new s("tlv.decode(long): zero leftmost byte");for(const g of m)u=u<<8|g;if(r+=p,u<128)throw new s("tlv.decode(long): not minimal encoding")}const f=t.subarray(r,r+u);if(f.length!==u)throw new s("tlv.decode: wrong value length");return{v:f,l:t.subarray(r+u)}}},_int:{encode(e){const{Err:t}=sa;if(fb(e),e<Xz)throw new t("integer: negative integers are not allowed");let s=Wf(e);if(Number.parseInt(s[0],16)&8&&(s="00"+s),s.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return s},decode(e){const{Err:t}=sa;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Gc(e)}},toSig(e,t){const{Err:s,_int:r,_tlv:i}=sa;if(t!==void 0&&(Pc(t,"maxScalarBytes"),t<1))throw new s("invalid signature: maxScalarBytes must be positive");const c=Mt(e,void 0,"signature"),{v:u,l:f}=i.decode(48,c);if(f.length)throw new s("invalid signature: left bytes after parsing");const{v:p,l:m}=i.decode(2,u),{v:g,l:y}=i.decode(2,m);if(y.length)throw new s("invalid signature: left bytes after parsing");if(t!==void 0&&(p.length>t||g.length>t))throw new s("invalid signature: integer too large");return{r:r.decode(p),s:r.decode(g)}},hexFromSig(e){const{_tlv:t,_int:s}=sa;Sr(e,{r:"bigint",s:"bigint"},{},"sig");const r=t.encode(2,s.encode(e.r)),i=t.encode(2,s.encode(e.s)),c=r+i;return t.encode(48,c)}},ey=(Object.freeze(sa._tlv),Object.freeze(sa._int),Object.freeze(sa));const KS=(e,t)=>(e+(e>=0?t:-t)/hO)/t;function Kz(e,t,s){Xh("scalar",e,ia,s);const[[r,i],[c,u]]=t,f=KS(u*e,s),p=KS(-i*e,s);let m=e-f*r-p*c,g=-f*i-p*u;const y=m<ia,b=g<ia;y&&(m=-m),b&&(g=-g);const S=mb(Math.ceil(pb(s)/2))+Ki;if(m<ia||m>=S||g<ia||g>=S)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:y,k1:m,k2neg:b,k2:g}}function nv(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ty(e,t){Sr(e);const s={};for(let r of Object.keys(t))s[r]=e[r]===void 0?t[r]:e[r];return Nr(s.lowS,"lowS"),Nr(s.prehash,"prehash"),s.format!==void 0&&nv(s.format),s}const ia=BigInt(0),Ki=BigInt(1),hO=BigInt(2),ny=BigInt(3),Qz=BigInt(4);function e$(e,t={}){const s=lO("weierstrass",e,t),r=s.Fp,i=s.Fn;let c=s.CURVE;const{h:u,n:f}=c;Sr(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",randomBytes:"function"});const{endo:p,allowInfinityPoint:m,clearCofactor:g,isTorsionFree:y,fromBytes:b,toBytes:S}=t,O=t.randomBytes===void 0?od:t.randomBytes;if(p&&(!r.is0(c.a)||typeof p.beta!="bigint"||!Array.isArray(p.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const C=p?{beta:p.beta,basises:p.basises.map(J=>[...J])}:void 0,R=mO(r,i);function $(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function x(J,V,re){if(V.is0()){if(!m)throw new Error("bad point: ZERO");return Uint8Array.of(0)}const{x:ue,y:I}=V.toAffine(),X=r.toBytes(ue);if(Nr(re,"isCompressed"),re){$();const oe=!r.isOdd(I);return Tr(pO(oe),X)}else return Tr(Uint8Array.of(4),X,r.toBytes(I))}function W(J){Mt(J,void 0,"Point");const{publicKey:V,publicKeyUncompressed:re}=R,ue=J.length,I=J[0],X=J.subarray(1);if(m&&ue===1&&I===0)return{x:r.ZERO,y:r.ZERO};if(ue===V&&(I===2||I===3)){const oe=r.fromBytes(X);if(!r.isValid(oe))throw new Error("bad point: is not on curve, wrong x");const he=w(oe);let Te;try{Te=r.sqrt(he)}catch(be){const _e=be instanceof Error?": "+be.message:"";throw new Error("bad point: is not on curve, sqrt error"+_e)}$();const Oe=r.isOdd(Te);return(I&1)===1!==Oe&&(Te=r.neg(Te)),{x:oe,y:Te}}else if(ue===re&&I===4){const oe=r.BYTES,he=r.fromBytes(X.subarray(0,oe)),Te=r.fromBytes(X.subarray(oe,oe*2));if(!A(he,Te))throw new Error("bad point: is not on curve");return{x:he,y:Te}}else throw new Error(`bad point: got length ${ue}, expected compressed=${V} or uncompressed=${re}`)}const ce=S===void 0?x:S,ge=b===void 0?W:b,F=r.mul(c.b,ny),K=r.is0(c.a)?J=>r.ZERO:J=>r.mul(c.a,J);function w(J){const V=r.sqr(J),re=r.mul(V,J);return r.add(r.add(re,r.mul(J,c.a)),c.b)}function A(J,V){const re=r.sqr(V),ue=w(J);return r.eql(re,ue)}if(!A(c.Gx,c.Gy))throw new Error("bad curve params: generator point");const N=r.mul(r.pow(c.a,ny),Qz),P=r.mul(r.sqr(c.b),BigInt(27));if(r.is0(r.add(N,P)))throw new Error("bad curve params: a or b");function U(J,V,re=!1){if(!r.isValid(V)||re&&r.is0(V))throw new Error(`bad point coordinate ${J}`);return typeof V=="object"&&V!==null?r.create(V):V}function q(J){if(!(J instanceof j))throw new Error("Weierstrass Point expected")}function L(J){if(!C||!C.basises)throw new Error("no endo");return Kz(J,C.basises,i.ORDER)}function M(J,V,re,ue){if(!i.isValid(ue))throw new RangeError("invalid scalar: out of range");if(C){const{k1neg:I,k1:X,k2neg:oe,k2:he}=L(ue),Te=new j(r.mul(re.X,C.beta),re.Y,re.Z);J.push(I?re.negate():re,oe?Te.negate():Te),V.push(X,he)}else J.push(re),V.push(ue)}const k=new WeakSet;class j{static BASE=new j(c.Gx,c.Gy,r.ONE);static ZERO=new j(r.ZERO,r.ONE,r.ZERO);static Fp=r;static Fn=i;X;Y;Z;constructor(V,re,ue){this.X=U("x",V),this.Y=U("y",re,!0),this.Z=U("z",ue),Object.freeze(this)}static CURVE(){return c}static fromAffine(V){const{x:re,y:ue}=V||{};if(!V||!r.isValid(re)||!r.isValid(ue))throw new Error("invalid affine point");if(V instanceof j)throw new Error("projective point not allowed");return r.is0(re)&&r.is0(ue)?j.ZERO:new j(re,ue,r.ONE)}static fromBytes(V){const re=j.fromAffine(ge(Mt(V,void 0,"point")));return re.assertValidity(),re}static fromHex(V){return j.fromBytes(Zh(V))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(V=6,re=!0){return z.setWindowSize(this,V),re||this.multiply(ny),this}assertValidity(){const V=this;if(V.is0()){if(m&&r.is0(V.X)&&r.eql(V.Y,r.ONE)&&r.is0(V.Z))return;throw new Error("bad point: ZERO")}if(k.has(V))return;const{x:re,y:ue}=V.toAffine();if(!r.isValid(re)||!r.isValid(ue))throw new Error("bad point: x or y not field elements");if(!A(re,ue))throw new Error("bad point: equation left != right");if(!V.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");k.add(V)}hasEvenY(){const{y:V}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(V)}equals(V){q(V);const{X:re,Y:ue,Z:I}=this,{X,Y:oe,Z:he}=V,Te=r.eql(r.mul(re,he),r.mul(X,I)),Oe=r.eql(r.mul(ue,he),r.mul(oe,I));return Te&&Oe}negate(){return new j(this.X,r.neg(this.Y),this.Z)}double(){const{X:V,Y:re,Z:ue}=this;let I=r.ZERO,X=r.ZERO,oe=r.ZERO,he=r.mul(V,V),Te=r.mul(re,re),Oe=r.mul(ue,ue),Ae=r.mul(V,re);return Ae=r.add(Ae,Ae),oe=r.mul(V,ue),oe=r.add(oe,oe),I=K(oe),X=r.mul(F,Oe),X=r.add(I,X),I=r.sub(Te,X),X=r.add(Te,X),X=r.mul(I,X),I=r.mul(Ae,I),oe=r.mul(F,oe),Oe=K(Oe),Ae=r.sub(he,Oe),Ae=K(Ae),Ae=r.add(Ae,oe),oe=r.add(he,he),he=r.add(oe,he),he=r.add(he,Oe),he=r.mul(he,Ae),X=r.add(X,he),Oe=r.mul(re,ue),Oe=r.add(Oe,Oe),he=r.mul(Oe,Ae),I=r.sub(I,he),oe=r.mul(Oe,Te),oe=r.add(oe,oe),oe=r.add(oe,oe),new j(I,X,oe)}add(V){q(V);const{X:re,Y:ue,Z:I}=this,{X,Y:oe,Z:he}=V;let Te=r.ZERO,Oe=r.ZERO,Ae=r.ZERO,be=r.mul(re,X),_e=r.mul(ue,oe),Ve=r.mul(I,he),at=r.add(re,ue),G=r.add(X,oe);at=r.mul(at,G),G=r.add(be,_e),at=r.sub(at,G),G=r.add(re,I);let te=r.add(X,he);return G=r.mul(G,te),te=r.add(be,Ve),G=r.sub(G,te),te=r.add(ue,I),Te=r.add(oe,he),te=r.mul(te,Te),Te=r.add(_e,Ve),te=r.sub(te,Te),Ae=K(G),Te=r.mul(F,Ve),Ae=r.add(Te,Ae),Te=r.sub(_e,Ae),Ae=r.add(_e,Ae),Oe=r.mul(Te,Ae),_e=r.add(be,be),_e=r.add(_e,be),Ve=K(Ve),G=r.mul(F,G),_e=r.add(_e,Ve),Ve=r.sub(be,Ve),Ve=K(Ve),G=r.add(G,Ve),be=r.mul(_e,G),Oe=r.add(Oe,be),be=r.mul(te,G),Te=r.mul(at,Te),Te=r.sub(Te,be),be=r.mul(at,_e),Ae=r.mul(te,Ae),Ae=r.add(Ae,be),new j(Te,Oe,Ae)}subtract(V){return q(V),this.add(V.negate())}is0(){return this.equals(j.ZERO)}multiply(V){if(!i.isValidNot0(V))throw new RangeError("invalid scalar: out of range");const{p:re,f:ue}=z.mulSecret(this,V,u,D);return D([re,ue])[0]}multiplyUnsafe(V){const re=this,ue=V;if(!i.isValid(ue))throw new RangeError("invalid scalar: out of range");if(ue===ia||re.is0())return j.ZERO;if(ue===Ki)return re;if(z.hasWindowSize(this))return z.mulUnsafe(re,ue,D);const I=[],X=[];return M(I,X,re,ue),ev(j,I,X)}mulAddUnsafe(V,re,ue){q(re);const I=[],X=[];return M(I,X,this,V),M(I,X,re,ue),ev(j,I,X)}toAffine(V){const re=this;let ue=V;if(ue!=null&&!r.isValid(ue))throw new RangeError('"invertedZ" expected valid field element');const{X:I,Y:X,Z:oe}=re;if(r.eql(oe,r.ONE))return{x:I,y:X};const he=re.is0();ue==null&&(ue=he?r.ONE:r.inv(oe));const Te=r.mul(I,ue),Oe=r.mul(X,ue),Ae=r.mul(oe,ue);if(he)return{x:r.ZERO,y:r.ZERO};if(!r.eql(Ae,r.ONE))throw new Error("invZ was invalid");return{x:Te,y:Oe}}isTorsionFree(){return u===Ki?!0:y?y(j,this):z.mulUnsafe(this,f).is0()}clearCofactor(){return u===Ki?this:g?g(j,this):this.multiplyUnsafe(u)}isSmallOrder(){return u===Ki?this.is0():this.clearCofactor().is0()}toBytes(V=!0){return Nr(V,"isCompressed"),this.assertValidity(),ce(j,this,V)}toHex(V=!0){return db(this.toBytes(V))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const D=J=>rO(j,J),z=new cO(j,O);return z.bits>=6&&j.BASE.precompute(6),Object.freeze(j.prototype),Object.freeze(j),j}function pO(e){return Uint8Array.of(e?2:3)}function mO(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function t$(e,t={}){sl(e);const{Fn:s}=e,r=t.randomBytes===void 0?od:t.randomBytes,i=Object.assign(mO(e.Fp,s),{seed:Math.max(wb(s.ORDER),16)});function c(S){try{const O=s.fromBytes(S);return s.isValidNot0(O)}catch{return!1}}function u(S,O){const{publicKey:C,publicKeyUncompressed:R}=i;try{const $=S.length;return O===!0&&$!==C||O===!1&&$!==R?!1:!e.fromBytes(S).is0()}catch{return!1}}function f(S){return S=S===void 0?r(i.seed):S,sO(Mt(S,i.seed,"seed"),s.ORDER)}function p(S,O=!0){return e.BASE.multiply(s.fromBytes(S)).toBytes(O)}function m(S){const{secretKey:O,publicKey:C,publicKeyUncompressed:R}=i,$=s._lengths;if(!id(S))return;const x=Mt(S,void 0,"key").length,W=x===C||x===R,ce=x===O||!!$?.includes(x);if(!(W&&ce))return W}function g(S,O,C=!0){if(m(S)===!0)throw new Error("first arg must be private key");if(m(O)===!1)throw new Error("second arg must be public key");const R=s.fromBytes(S),$=e.fromBytes(O);if($.is0())throw new Error("invalid public key: point at infinity");return $.multiply(R).toBytes(C)}const y={isValidSecretKey:c,isValidPublicKey:u,randomSecretKey:f},b=uO(f,p);return Object.freeze(y),Object.freeze(i),Object.freeze({getPublicKey:p,getSharedSecret:g,keygen:b,Point:e,utils:y,lengths:i})}function n$(e,t,s={}){sl(e);const r=t;Vv(r),Sr(s,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=Object.assign({},s),c=i.randomBytes===void 0?od:i.randomBytes,u=i.hmac===void 0?(J,V)=>Rp(r,J,V):i.hmac,{Fp:f,Fn:p}=e,{ORDER:m,BITS:g}=p,y=wb(m),b=aO(c,y),{keygen:S,getPublicKey:O,getSharedSecret:C,utils:R,lengths:$}=t$(e,i),x={prehash:!0,lowS:typeof i.lowS=="boolean"?i.lowS:!0,format:"compact",extraEntropy:!1},W=m*hO+Ki<f.ORDER;function ce(J){const V=m>>Ki;return J>V}function ge(J,V){if(!p.isValidNot0(V))throw new Error(`invalid signature ${J}: out of range 1..Point.Fn.ORDER`);return V}function F(){if(!f.isOdd)throw new Error("Field doesn't support isOdd")}function K(J,V,re){return F(),(J===re?0:2)|Number(f.isOdd(V))}function w(){if(W)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function A(J,V){nv(V);const re=$.signature,ue=V==="compact"?re:V==="recovered"?re+1:void 0;return Mt(J,ue)}class N{r;s;recovery;constructor(V,re,ue){if(this.r=ge("r",V),this.s=ge("s",re),ue!=null){if(w(),![0,1,2,3].includes(ue))throw new Error("invalid recovery id");this.recovery=ue}Object.freeze(this)}static fromBytes(V,re=x.format){A(V,re);let ue;if(re==="der"){if(V.length>2*p.BYTES+16)throw new ey.Err("invalid signature: DER signature too long");const{r:he,s:Te}=ey.toSig(Mt(V),p.BYTES+1);return new N(he,Te)}re==="recovered"&&(ue=V[0],re="compact",V=V.subarray(1));const I=$.signature/2,X=V.subarray(0,I),oe=V.subarray(I,I*2);return new N(p.fromBytes(X),p.fromBytes(oe),ue)}static fromHex(V,re){return this.fromBytes(Zh(V),re)}assertRecovery(){const{recovery:V}=this;if(V==null)throw new Error("invalid recovery id: must be present");return V}addRecoveryBit(V){return new N(this.r,this.s,V)}recoverPublicKey(V){const{r:re,s:ue}=this,I=this.assertRecovery(),X=I===2||I===3?re+m:re;if(!f.isValid(X))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const oe=f.toBytes(X),he=e.fromBytes(Tr(pO((I&1)===0),oe)),Te=p.inv(X),Oe=U(Mt(V,void 0,"msgHash")),Ae=p.create(-Oe*Te),be=p.create(ue*Te),_e=e.BASE.mulAddUnsafe(Ae,he,be);if(_e.is0())throw new Error("invalid recovery: point at infinify");return _e.assertValidity(),_e}hasHighS(){return ce(this.s)}toBytes(V=x.format){if(nv(V),V==="der")return Zh(ey.hexFromSig(this));const{r:re,s:ue}=this,I=p.toBytes(re),X=p.toBytes(ue);return V==="recovered"?(w(),Tr(Uint8Array.of(this.assertRecovery()),I,X)):Tr(I,X)}toHex(V){return db(this.toBytes(V))}}Object.freeze(N.prototype),Object.freeze(N);const P=i.bits2int===void 0?function(V){if(V.length>8192)throw new Error("input is too large");const re=Gc(V),ue=V.length*8-g;return ue>0?re>>BigInt(ue):re}:i.bits2int,U=i.bits2int_modN===void 0?function(V){return p.create(P(V))}:i.bits2int_modN,q=mb(g);function L(J){return Xh("num < 2^"+g,J,ia,q),p.toBytes(J)}function M(J,V){return Mt(J,void 0,"message"),V?Mt(r(J),void 0,"prehashed message"):J}function k(J,V,re){const{lowS:ue,prehash:I,extraEntropy:X}=ty(re,x);J=M(J,I);const oe=U(J),he=p.fromBytes(V);if(!p.isValidNot0(he))throw new Error("invalid private key");const Te=[L(he),L(oe)];if(X!=null&&X!==!1){const _e=X===!0?c($.secretKey):X;Te.push(Mt(_e,void 0,"extraEntropy"))}const Oe=Tr(...Te),Ae=oe;function be(_e){const Ve=P(_e);if(!p.isValidNot0(Ve))return;const at=e.BASE.multiply(Ve).toAffine(),G=p.create(at.x);if(G===ia)return;let te;if(b!==void 0){const le=Gc(sO(b(y),m)),ze=p.inv(p.mul(le,Ve)),Le=p.mul(le,Ae),Dt=p.mul(le,he);te=p.create(ze*p.create(Le+Dt*G))}else{const le=fz(Ve,m);te=p.create(le*p.create(Ae+G*he))}if(te===ia)return;let de=K(at.x,at.y,G),fe=te;return ue&&ce(te)&&(fe=p.neg(te),de^=1),new N(G,fe,W?void 0:de)}return{seed:Oe,k2sig:be}}function j(J,V,re={}){const{seed:ue,k2sig:I}=k(J,V,re);return oz(r.outputLen,p.BYTES,u)(ue,I).toBytes(re.format)}function D(J,V,re,ue={}){const{lowS:I,prehash:X,format:oe}=ty(ue,x);if(re=Mt(re,void 0,"publicKey"),V=M(V,X),!id(J)){const he=J instanceof N?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+he)}A(J,oe);try{const he=N.fromBytes(J,oe),Te=e.fromBytes(re);if(Te.is0()||I&&he.hasHighS())return!1;const{r:Oe,s:Ae}=he,be=U(V),_e=p.inv(Ae),Ve=p.create(be*_e),at=p.create(Oe*_e),G=e.BASE.mulAddUnsafe(Ve,Te,at);if(G.is0())return!1;const te=G.toAffine();return!(p.create(te.x)!==Oe||oe==="recovered"&&he.recovery!==K(te.x,te.y,Oe))}catch{return!1}}function z(J,V,re={}){const{prehash:ue}=ty(re,x);return V=M(V,ue),N.fromBytes(J,"recovered").recoverPublicKey(V).toBytes()}return Object.freeze({keygen:S,getPublicKey:O,getSharedSecret:C,utils:R,lengths:$,Point:e,sign:j,verify:D,recoverPublicKey:z,Signature:N,hash:r})}const s$={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},r$=e$(s$),Iu=n$(r$,PA),sy=33,sv=64;var Ic;Ic=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==sy)throw new Error(`Invalid public key input. Expected ${sy} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.Passkey}async verify(t,s){const r=gO(s),i=JSON.parse(r.clientDataJson);if(i.type!=="webauthn.get"||!zu(t,qe(i.challenge.replace(/-/g,"+").replace(/_/g,"/"))))return!1;const c=r.userSignature.slice(1+sv);if(!zu(this.toRawBytes(),c))return!1;const u=new Uint8Array([...r.authenticatorData,...PA(new TextEncoder().encode(r.clientDataJson))]),f=r.userSignature.slice(1,sv+1);return Iu.verify(f,u,c)}},Ic.SIZE=sy;function gO(e){const t=typeof e=="string"?qe(e):e;if(t[0]!==yi.Passkey)throw new Error("Invalid signature scheme");const s=tk.parse(t.slice(1));return{signatureScheme:"Passkey",serializedSignature:st(t),signature:t,authenticatorData:s.authenticatorData,clientDataJson:s.clientDataJson,userSignature:new Uint8Array(s.userSignature),publicKey:new Uint8Array(s.userSignature.slice(1+sv))}}function a$(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return t;return-1}function _b(e,t){return Gv(e.toString(16).padStart(t*2,"0").slice(-t*2))}function yO(e,t){const s=_b(e,t),r=a$(s);return r===-1?new Uint8Array([0]):s.slice(r)}function i$(e){return e==="accounts.google.com"?"https://accounts.google.com":e}function o$(e){if(e.length!==1)throw new Error("Invalid base64Url character: "+e);const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".indexOf(e);if(t===-1)throw new Error("Invalid base64Url character: "+e);const s=t.toString(2).padStart(6,"0");return Array.from(s).map(Number)}function c$(e){let t=[];for(let s=0;s<e.length;s++){const r=o$(e.charAt(s));t=t.concat(r)}return t}function l$(e,t){if(e.length<2)throw new Error(`Input (s = ${e}) is not tightly packed because s.length < 2`);let s=c$(e);const r=t%4;if(r!==0)if(r===1)s=s.slice(2);else if(r===2)s=s.slice(4);else throw new Error(`Input (s = ${e}) is not tightly packed because i%4 = 3 (i = ${t}))`);const i=(t+e.length-1)%4;if(i!==3)if(i===2)s=s.slice(0,s.length-2);else if(i===1)s=s.slice(0,s.length-4);else throw new Error(`Input (s = ${e}) is not tightly packed because (i + s.length - 1)%4 = 0 (i = ${t}))`);if(s.length%8!==0)throw new Error("We should never reach here...");const c=new Uint8Array(Math.floor(s.length/8));let u=0;for(let f=0;f<s.length;f+=8){const p=s.slice(f,f+8),m=parseInt(p.join(""),2);c[u++]=m}return new TextDecoder().decode(c)}function u$(e){if(!(e.slice(-1)==="}"||e.slice(-1)===","))throw new Error("Invalid claim");const t=JSON.parse("{"+e.slice(0,-1)+"}");if(Object.keys(t).length!==1)throw new Error("Invalid claim");const s=Object.keys(t)[0];return[s,t[s]]}function vO(e,t){const[s,r]=u$(l$(e.value,e.indexMod4));if(s!==t)throw new Error(`Invalid field name: found ${s} expected ${t}`);return r}const d$=E.struct("ZkLoginSignature",{inputs:E.struct("ZkLoginSignatureInputs",{proofPoints:E.struct("ZkLoginSignatureInputsProofPoints",{a:E.vector(E.string()),b:E.vector(E.vector(E.string())),c:E.vector(E.string())}),issBase64Details:E.struct("ZkLoginSignatureInputsClaim",{value:E.string(),indexMod4:E.u8()}),headerBase64:E.string(),addressSeed:E.string()}),maxEpoch:E.u64(),userSignature:E.byteVector()});function f$(e){return d$.parse(typeof e=="string"?qe(e):e)}var h$=class ei extends Ip{#e;#t;#r;constructor(t,{client:s}={}){super(),this.#t=s,typeof t=="string"?this.#e=qe(t):t instanceof Uint8Array?this.#e=t:this.#e=Uint8Array.from(t),this.#r=this.#e.length!==this.#e[0]+1+32,this.#r&&(this.#e=yc(this.#e,!1))}get legacyAddress(){return this.#r}static fromBytes(t,{client:s,address:r,legacyAddress:i}={}){let c;if(i===!0?c=new ei(yc(t,!0),{client:s}):i===!1?c=new ei(yc(t,!1),{client:s}):r?(c=new ei(yc(t,!1),{client:s}),c.toSuiAddress()!==r&&(c=new ei(yc(t,!0),{client:s}))):c=new ei(t,{client:s}),r&&c.toSuiAddress()!==r)throw new Error("Public key bytes do not match the provided address");return c}static fromProof(t,s){const{issBase64Details:r,addressSeed:i}=s,c=vO(r,"iss"),u=rv(BigInt(i),c,{legacyAddress:!0});if(u.toSuiAddress()===t)return u;const f=rv(BigInt(i),c,{legacyAddress:!1});if(f.toSuiAddress()!==t)throw new Error("Proof does not match address");return f}equals(t){return super.equals(t)}toSuiAddress(){return this.#r?this.#s():super.toSuiAddress()}#s(){const t=yc(this.#e,!0),s=new Uint8Array(t.length+1);return s[0]=this.flag(),s.set(t,1),ye(td(Vc(s,{dkLen:32})).slice(0,el*2))}toRawBytes(){return this.#e}flag(){return yi.ZkLogin}async verify(t,s){throw Error("does not support")}verifyPersonalMessage(t,s){const r=av(s);return QS({address:new ei(r.publicKey).toSuiAddress(),bytes:st(t),signature:r.serializedSignature,intentScope:"PersonalMessage",client:this.#t})}verifyTransaction(t,s){const r=av(s);return QS({address:new ei(r.publicKey).toSuiAddress(),bytes:st(t),signature:r.serializedSignature,intentScope:"TransactionData",client:this.#t})}verifyAddress(t){return t===super.toSuiAddress()||t===this.#s()}};function rv(e,t,s){if(s.legacyAddress===void 0)throw new Error("legacyAddress parameter must be specified");const r=s.legacyAddress?yO(e,32):_b(e,32),i=new TextEncoder().encode(i$(t)),c=new Uint8Array(1+i.length+r.length);return c.set([i.length],0),c.set(i,1),c.set(r,1+i.length),new h$(c,s)}function yc(e,t){const s=e[0]+1,r=BigInt(`0x${kr(e.slice(s))}`),i=t?yO(r,32):_b(r,32),c=new Uint8Array(s+i.length);return c.set(e.slice(0,s),0),c.set(i,s),c}async function QS({address:e,bytes:t,signature:s,intentScope:r,client:i}){if(!i)throw new Error("A Sui Client (GRPC, GraphQL, or JSON RPC) is required to verify zkLogin signatures");const c=await i.core.verifyZkLoginSignature({bytes:t,signature:s,intentScope:r,address:e});return c.success===!0&&c.errors.length===0}function av(e){const t=typeof e=="string"?qe(e):e;if(t[0]!==yi.ZkLogin)throw new Error("Invalid signature scheme");const{inputs:s,maxEpoch:r,userSignature:i}=f$(t.slice(1)),{issBase64Details:c,addressSeed:u}=s,f=vO(c,"iss"),p=rv(BigInt(u),f,{legacyAddress:!1});return{serializedSignature:st(t),signatureScheme:"ZkLogin",zkLogin:{inputs:s,maxEpoch:r,userSignature:i,iss:f,addressSeed:BigInt(u)},signature:t,publicKey:p.toRawBytes()}}function p$({signature:e,signatureScheme:t,publicKey:s}){if(!s)throw new Error("`publicKey` is required");const r=s.toRawBytes(),i=new Uint8Array(1+e.length+r.length);return i.set([yi[t]]),i.set(e,1),i.set(r,1+e.length),st(i)}function m$(e){const t=qe(e),s=ub[t[0]];switch(s){case"Passkey":return gO(e);case"MultiSig":return{serializedSignature:e,signatureScheme:s,multisig:H.MultiSig.parse(t.slice(1)),bytes:t,signature:void 0};case"ZkLogin":return av(e);case"ED25519":case"Secp256k1":case"Secp256r1":return $A(e);default:throw new Error("Unsupported signature scheme")}}const Sh=32,bO="suiprivkey";var wO=class{async signWithIntent(e,t){const s=Vc(zA(t,e),{dkLen:32});return{signature:p$({signature:await this.sign(s),signatureScheme:this.getKeyScheme(),publicKey:this.getPublicKey()}),bytes:st(e)}}async signTransaction(e){return this.signWithIntent(e,"TransactionData")}async signPersonalMessage(e){const{signature:t}=await this.signWithIntent(E.byteVector().serialize(e).toBytes(),"PersonalMessage");return{bytes:st(e),signature:t}}async signAndExecuteTransaction({transaction:e,client:t}){e.setSenderIfNotSet(this.toSuiAddress());const s=await e.build({client:t}),{signature:r}=await this.signTransaction(s);return t.core.executeTransaction({transaction:s,signatures:[r],include:{transaction:!0,effects:!0}})}toSuiAddress(){return this.getPublicKey().toSuiAddress()}},g$=class extends wO{};function y$(e){const{prefix:t,words:s}=Ih.decode(e);if(t!==bO)throw new Error("invalid private key prefix");const r=new Uint8Array(Ih.fromWords(s)),i=r.slice(1);return{scheme:ub[r[0]],secretKey:i}}function v$(e,t){if(e.length!==Sh)throw new Error("Invalid bytes length");const s=yi[t],r=new Uint8Array(e.length+1);return r.set([s]),r.set(e,1),Ih.encode(bO,Ih.toWords(r))}const b$="ed25519 seed",w$=2147483648,T$=new RegExp("^m(\\/[0-9]+')+$"),TO=e=>e.replace("'",""),E$=e=>{const t=Rp.create(ad,new TextEncoder().encode(b$)).update(Qu(e)).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},S$=({key:e,chainCode:t},s)=>{const r=new ArrayBuffer(4);new DataView(r).setUint32(0,s);const i=new Uint8Array(1+e.length+r.byteLength);i.set(new Uint8Array(1).fill(0)),i.set(e,1),i.set(new Uint8Array(r,0,r.byteLength),e.length+1);const c=Rp.create(ad,t).update(i).digest();return{key:c.slice(0,32),chainCode:c.slice(32)}},_$=e=>T$.test(e)?!e.split("/").slice(1).map(TO).some(isNaN):!1,e_=(e,t,s=w$)=>{if(!_$(e))throw new Error("Invalid derivation path");const{key:r,chainCode:i}=E$(t);return e.split("/").slice(1).map(TO).map(c=>parseInt(c,10)).reduce((c,u)=>S$(c,u+s),{key:r,chainCode:i})},t_="m/44'/784'/0'/0'/0'";var k$=class _u extends g${constructor(t){if(super(),t)this.keypair={publicKey:t.publicKey,secretKey:t.secretKey.slice(0,32)};else{const s=ta.utils.randomSecretKey();this.keypair={publicKey:ta.getPublicKey(s),secretKey:s}}}getKeyScheme(){return"ED25519"}static generate(){const t=ta.utils.randomSecretKey();return new _u({publicKey:ta.getPublicKey(t),secretKey:t})}static fromSecretKey(t,s){if(typeof t=="string"){const c=y$(t);if(c.scheme!=="ED25519")throw new Error(`Expected a ED25519 keypair, got ${c.scheme}`);return this.fromSecretKey(c.secretKey,s)}const r=t.length;if(r!==Sh)throw new Error(`Wrong secretKey size. Expected ${Sh} bytes, got ${r}.`);const i={publicKey:ta.getPublicKey(t),secretKey:t};if(!s||!s.skipValidation){const c=new TextEncoder().encode("sui validation"),u=ta.sign(c,t);if(!ta.verify(u,c,i.publicKey))throw new Error("provided secretKey is invalid")}return new _u(i)}getPublicKey(){return new $z(this.keypair.publicKey)}getSecretKey(){return v$(this.keypair.secretKey.slice(0,Sh),this.getKeyScheme())}async sign(t){return ta.sign(t,this.keypair.secretKey)}static deriveKeypair(t,s){if(s==null&&(s=t_),!JS(s))throw new Error("Invalid derivation path");const{key:r}=e_(s,Wz(t));return _u.fromSecretKey(r)}static deriveKeypairFromSeed(t,s){if(s==null&&(s=t_),!JS(s))throw new Error("Invalid derivation path");const r=typeof t=="string"?t:kr(t),{key:i}=e_(s,r);return _u.fromSecretKey(i)}};const ry=33;var Rc,EO=(Rc=class extends Ip{constructor(t){if(super(),typeof t=="string"?this.data=qe(t):t instanceof Uint8Array?this.data=t:this.data=Uint8Array.from(t),this.data.length!==ry)throw new Error(`Invalid public key input. Expected ${ry} bytes, got ${this.data.length}`)}equals(t){return super.equals(t)}toRawBytes(){return this.data}flag(){return yi.Secp256r1}async verify(t,s){let r;if(typeof s=="string"){const i=m$(s);if(i.signatureScheme!=="Secp256r1")throw new Error("Invalid signature scheme");if(!zu(this.toRawBytes(),i.publicKey))throw new Error("Signature does not match public key");r=i.signature}else r=s;return Iu.verify(r,t,this.toRawBytes())}},Rc.SIZE=ry,Rc),A$=class{#e;#t;#r=null;constructor(e,t){this.#e=e,this.#t=t}get(e){return this.#a("readonly",t=>t.get(e))}async set(e,t){await this.#a("readwrite",s=>s.put(t,e))}del(e){return this.#a("readwrite",t=>t.delete(e))}entries(){return this.#s().then(e=>new Promise((t,s)=>{const r=e.transaction(this.#t,"readonly"),i=r.objectStore(this.#t),c=[],u=i.openCursor();u.onsuccess=()=>{const f=u.result;f&&(c.push([f.key,f.value]),f.continue())},r.oncomplete=()=>t(c),r.onerror=()=>s(r.error)}))}#s(){return this.#r||(this.#r=new Promise((e,t)=>{const s=indexedDB.open(this.#e);s.onupgradeneeded=()=>{s.result.objectStoreNames.contains(this.#t)||s.result.createObjectStore(this.#t)},s.onsuccess=()=>e(s.result),s.onerror=()=>{this.#r=null,t(s.error)}})),this.#r}#a(e,t){return this.#s().then(s=>new Promise((r,i)=>{const c=s.transaction(this.#t,e),u=t(c.objectStore(this.#t));c.oncomplete=()=>r(u.result),c.onerror=()=>i(c.error),c.onabort=()=>i(c.error)}))}};function O$(e){const t=new Uint8Array(e),s=t.slice(1,33),r=(t.slice(33,65)[31]&1)===0?2:3,i=new Uint8Array(EO.SIZE);return i[0]=r,i.set(s,1),i}var n_=class iv extends wO{#e;static async generate({extractable:t=!1}={}){const s=await globalThis.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},t,["sign","verify"]),r=await globalThis.crypto.subtle.exportKey("raw",s.publicKey);return new iv(s.privateKey,O$(new Uint8Array(r)))}static import(t){return new iv(t.privateKey,t.publicKey)}getKeyScheme(){return"Secp256r1"}constructor(t,s){super(),this.privateKey=t,this.#e=new EO(s)}export(){const t={privateKey:this.privateKey,publicKey:this.#e.toRawBytes()};return Object.defineProperty(t,"toJSON",{enumerable:!1,value:()=>{throw new Error("The exported keypair must not be serialized. It must be stored in IndexedDB directly.")}}),t}getPublicKey(){return this.#e}async sign(t){const s=await globalThis.crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},this.privateKey,t),r=Iu.Signature.fromBytes(new Uint8Array(s));return(r.hasHighS()?new Iu.Signature(r.r,Iu.Point.Fn.neg(r.s)):r).toBytes("compact")}};const N$="dev-wallet-webcrypto",x$="accounts",ay="__account_meta__";var C$=class extends XL{#e;constructor(e){super(),this.id="webcrypto",this.name="WebCrypto Signer",this.#e=new A$(e?.dbName??N$,e?.storeName??x$)}async initialize(){const e=await this.#e.entries(),t=await this.#e.get(ay)??[],s=[];for(const[r,i]of e){if(r===ay)continue;const c=r;try{const u=i,f=n_.import(u),p=t.find(m=>m.address===c);s.push(Fy(f,c,p?.label??"Account"))}catch(u){console.warn(`[dev-wallet] Failed to load account ${c}, skipping:`,u)}}this.setInitialAccounts(s)}async createAccount(e){const t=await n_.generate(),s=t.getPublicKey().toSuiAddress(),r=Fy(t,s,e?.label??this.getDefaultLabel());return await this.#e.set(s,t.export()),this.addAccount(r),await this.#t(),r}async renameAccount(e,t){return this._performRename(e,t)?(await this.#t(),!0):!1}async removeAccount(e){return this.removeAccountByAddress(e)?(await this.#e.del(e),await this.#t(),!0):!1}async#t(){const e=this.getAccounts().map(t=>({address:t.address,label:t.label}));await this.#e.set(ay,e)}},iy={exports:{}},Ge={};var s_;function I$(){if(s_)return Ge;s_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),S=Symbol.iterator;function O(I){return I===null||typeof I!="object"?null:(I=S&&I[S]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,$={};function x(I,X,oe){this.props=I,this.context=X,this.refs=$,this.updater=oe||C}x.prototype.isReactComponent={},x.prototype.setState=function(I,X){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,X,"setState")},x.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function W(){}W.prototype=x.prototype;function ce(I,X,oe){this.props=I,this.context=X,this.refs=$,this.updater=oe||C}var ge=ce.prototype=new W;ge.constructor=ce,R(ge,x.prototype),ge.isPureReactComponent=!0;var F=Array.isArray;function K(){}var w={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function N(I,X,oe){var he=oe.ref;return{$$typeof:e,type:I,key:X,ref:he!==void 0?he:null,props:oe}}function P(I,X){return N(I.type,X,I.props)}function U(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var X={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(oe){return X[oe]})}var L=/\/+/g;function M(I,X){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):X.toString(36)}function k(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(K,K):(I.status="pending",I.then(function(X){I.status==="pending"&&(I.status="fulfilled",I.value=X)},function(X){I.status==="pending"&&(I.status="rejected",I.reason=X)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function j(I,X,oe,he,Te){var Oe=typeof I;(Oe==="undefined"||Oe==="boolean")&&(I=null);var Ae=!1;if(I===null)Ae=!0;else switch(Oe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(I.$$typeof){case e:case t:Ae=!0;break;case g:return Ae=I._init,j(Ae(I._payload),X,oe,he,Te)}}if(Ae)return Te=Te(I),Ae=he===""?"."+M(I,0):he,F(Te)?(oe="",Ae!=null&&(oe=Ae.replace(L,"$&/")+"/"),j(Te,X,oe,"",function(Ve){return Ve})):Te!=null&&(U(Te)&&(Te=P(Te,oe+(Te.key==null||I&&I.key===Te.key?"":(""+Te.key).replace(L,"$&/")+"/")+Ae)),X.push(Te)),1;Ae=0;var be=he===""?".":he+":";if(F(I))for(var _e=0;_e<I.length;_e++)he=I[_e],Oe=be+M(he,_e),Ae+=j(he,X,oe,Oe,Te);else if(_e=O(I),typeof _e=="function")for(I=_e.call(I),_e=0;!(he=I.next()).done;)he=he.value,Oe=be+M(he,_e++),Ae+=j(he,X,oe,Oe,Te);else if(Oe==="object"){if(typeof I.then=="function")return j(k(I),X,oe,he,Te);throw X=String(I),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function D(I,X,oe){if(I==null)return I;var he=[],Te=0;return j(I,he,"","",function(Oe){return X.call(oe,Oe,Te++)}),he}function z(I){if(I._status===-1){var X=I._result,oe=X();oe.then(function(he){(I._status===0||I._status===-1)&&(I._status=1,I._result=he,oe.status===void 0&&(oe.status="fulfilled",oe.value=he))},function(he){(I._status===0||I._status===-1)&&(I._status=2,I._result=he,oe.status===void 0&&(oe.status="rejected",oe.reason=he))}),I._status===-1&&(I._status=0,I._result=oe)}if(I._status===1)return I._result.default;throw I._result}var J=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function V(I){var X=w.T,oe={};oe.types=X!==null?X.types:null,w.T=oe;try{var he=I(),Te=w.S;Te!==null&&Te(oe,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(K,J)}catch(Oe){J(Oe)}finally{X!==null&&oe.types!==null&&(X.types=oe.types),w.T=X}}function re(I){var X=w.T;if(X!==null){var oe=X.types;oe===null?X.types=[I]:oe.indexOf(I)===-1&&oe.push(I)}else V(re.bind(null,I))}var ue={map:D,forEach:function(I,X,oe){D(I,function(){X.apply(this,arguments)},oe)},count:function(I){var X=0;return D(I,function(){X++}),X},toArray:function(I){return D(I,function(X){return X})||[]},only:function(I){if(!U(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ge.Activity=y,Ge.Children=ue,Ge.Component=x,Ge.Fragment=s,Ge.Profiler=i,Ge.PureComponent=ce,Ge.StrictMode=r,Ge.Suspense=p,Ge.ViewTransition=b,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(I){return w.H.useMemoCache(I)}},Ge.addTransitionType=re,Ge.cache=function(I){return function(){return I.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(I,X,oe){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var he=R({},I.props),Te=I.key;if(X!=null)for(Oe in X.key!==void 0&&(Te=""+X.key),X)!A.call(X,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&X.ref===void 0||(he[Oe]=X[Oe]);var Oe=arguments.length-2;if(Oe===1)he.children=oe;else if(1<Oe){for(var Ae=Array(Oe),be=0;be<Oe;be++)Ae[be]=arguments[be+2];he.children=Ae}return N(I.type,Te,he)},Ge.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},Ge.createElement=function(I,X,oe){var he,Te={},Oe=null;if(X!=null)for(he in X.key!==void 0&&(Oe=""+X.key),X)A.call(X,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Te[he]=X[he]);var Ae=arguments.length-2;if(Ae===1)Te.children=oe;else if(1<Ae){for(var be=Array(Ae),_e=0;_e<Ae;_e++)be[_e]=arguments[_e+2];Te.children=be}if(I&&I.defaultProps)for(he in Ae=I.defaultProps,Ae)Te[he]===void 0&&(Te[he]=Ae[he]);return N(I,Oe,Te)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(I){return{$$typeof:f,render:I}},Ge.isValidElement=U,Ge.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:z}},Ge.memo=function(I,X){return{$$typeof:m,type:I,compare:X===void 0?null:X}},Ge.startTransition=V,Ge.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},Ge.use=function(I){return w.H.use(I)},Ge.useActionState=function(I,X,oe){return w.H.useActionState(I,X,oe)},Ge.useCallback=function(I,X){return w.H.useCallback(I,X)},Ge.useContext=function(I){return w.H.useContext(I)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(I,X){return w.H.useDeferredValue(I,X)},Ge.useEffect=function(I,X){return w.H.useEffect(I,X)},Ge.useEffectEvent=function(I){return w.H.useEffectEvent(I)},Ge.useId=function(){return w.H.useId()},Ge.useImperativeHandle=function(I,X,oe){return w.H.useImperativeHandle(I,X,oe)},Ge.useInsertionEffect=function(I,X){return w.H.useInsertionEffect(I,X)},Ge.useLayoutEffect=function(I,X){return w.H.useLayoutEffect(I,X)},Ge.useMemo=function(I,X){return w.H.useMemo(I,X)},Ge.useOptimistic=function(I,X){return w.H.useOptimistic(I,X)},Ge.useReducer=function(I,X,oe){return w.H.useReducer(I,X,oe)},Ge.useRef=function(I){return w.H.useRef(I)},Ge.useState=function(I){return w.H.useState(I)},Ge.useSyncExternalStore=function(I,X,oe){return w.H.useSyncExternalStore(I,X,oe)},Ge.useTransition=function(){return w.H.useTransition()},Ge.version="19.3.0",Ge}var r_;function kb(){return r_||(r_=1,iy.exports=I$()),iy.exports}var Pe=kb();const Ab=ZC(Pe),SO=qC({__proto__:null,default:Ab},[Pe]),_O=Pe.createContext(null);function R$({dAppKit:e,children:t}){return T.jsx(_O.Provider,{value:e,children:t})}function wo(e){const t=Pe.useContext(_O);if(e)return e;if(!t)throw new Error("Could not find DAppKitContext. Ensure that you have set up the `DAppKitProvider` component.");return t}let oy=0,a_=[];function j$(){return oy+=1,()=>{if(oy-=1,oy===0){let e=a_;a_=[];for(let t of e)t()}}}function Kh(e){let t=j$(),s;try{s=Promise.resolve(e()).finally(t)}catch(r){throw t(),r}return s.t=!0,s}let Js=[],ku=0;const ov=4,_h=globalThis.nanostoresGlobal||={epoch:0};let M$=()=>{let e,t;for(;ku<Js.length;){t=ku,ku+=ov;try{Js[t](Js[t+1].value,Js[t+2],Js[t+3])}catch(s){e=s}}if(Js.length=ku=0,e)throw e};const Qh=e=>{let t=[],s={eq:Object.is,get(){return s.lc||s.listen(()=>{})(),s.value},init:e,lc:0,listen(r){return s.lc=t.push(r),()=>{for(let c=ku;c<Js.length;)Js[c]===r?Js.splice(c,ov):c+=ov;let i=t.indexOf(r);~i&&(t.splice(i,1),--s.lc||s.off())}},notify(r,i){_h.epoch++;let c=!Js.length&&!0;for(let u of t)Js.push(u,s,r,i);c&&M$()},off(){},set(r){let i=s.value;s.eq(i,r)||(s.value=r,s.notify(i))},subscribe(r){let i=s.listen(r);return r(s.value),i},value:e};return s},D$=e=>e,U$=5,Qf=6,eh=10;let B$=(e,t,s,r)=>(e.events=e.events||{},e.events[s+eh]||(e.events[s+eh]=r(i=>{e.events[s].reduceRight((c,u)=>(u(c),c),{shared:{},...i})})),e.events[s]=e.events[s]||[],e.events[s].push(t),()=>{let i=e.events[s],c=i.indexOf(t);~c&&(i.splice(c,1),i.length||(e.events[s+eh](),delete e.events[s+eh]))});const L$=1e3;let jp=(e,t)=>B$(e,r=>{let i=t(r);i&&e.events[Qf].push(i)},U$,r=>{let i=e.listen;e.listen=(...u)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...u));let c=e.off;return e.events[Qf]=[],e.off=()=>{c(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let u of e.events[Qf])u();e.events[Qf]=[]}},L$)},()=>{e.listen=i,e.off=c}}),z$=(e,t,s)=>{Array.isArray(e)||(e=[e]);let r,i,c=()=>{if(i===_h.epoch)return;i=_h.epoch;let m=e.map(g=>g.get());if(!r?.every((g,y)=>e[y].eq(g,m[y]))){r=m;let g=t(...m);g&&g.then&&g.t?g.then(y=>{r===m&&u.set(y)}):(u.set(g),i=_h.epoch)}},u=Qh(),f=u.get;u.get=()=>(c(),f());let p=c;return jp(u,()=>{let m=e.map(g=>g.listen(p));return c(),()=>{for(let g of m)g()}}),u};const cy=(e,t)=>z$(e,t);function i_(e,t){let s=$$(t),r=e;for(let i of s){if(r==null)return;r=r[i]}return r}const o_=/(.*)\[(\d+)\]/;function $$(e){return e.split(".").flatMap(t=>kO(t))}function kO(e){if(o_.test(e)){let[,t,s]=e.match(o_);return[...kO(t),s]}return[e]}function V$(e,t,s){let r=new Set(t);return e.listen((i,c,u)=>{(u===void 0?t.some(f=>c===void 0||i[f]!==c[f]||i_(i,f)!==i_(c,f)):r.has(u)||r.has(u.split(/\.|\[/)[0]))&&s(i,c,u)})}const P$=(e={})=>{let t=Qh(e);return t.eqKey=Object.is,t.setKey=function(s,r){let i=t.value;typeof r>"u"&&s in t.value?(t.value={...t.value},delete t.value[s],t.notify(i,s)):t.eqKey(t.value[s],r,s)||(t.value={...t.value,[s]:r},t.notify(i,s))},t};let ly=(e,t)=>s=>{e.current!==s&&(e.current=s,t())};function G$(e,{keys:t,deps:s=[e,t],ssr:r}={}){let i=Pe.useRef();i.current=e.get();let c=Pe.useCallback(p=>(ly(i,p)(e.value),t?.length>0?V$(e,t,ly(i,p)):e.listen(ly(i,p))),s),u=()=>i.current,f=u;return r&&"init"in e&&(f=r==="initial"?()=>e.init:r),Pe.useSyncExternalStore(c,u,f)}const AO=new WeakMap;function OO(e,t){AO.set(e,t)}function Mp(e){const t=xr(e),s=t.accounts.find(({address:r})=>r===e.address);if(!s){const r=new nd(Y5,{address:e.address,walletName:t.name});throw kp(r,Mp),r}return s}function xr(e){const t=AO.get(e);if(!t){const s=new nd(Z5);throw kp(s,xr),s}return t}function ep(e,t){const s=new Set(e),r=new Set(t);if(s.size!==r.size)return!0;for(const i of s)if(!r.has(i))return!0;return!1}function F$(e,t){if(e.length!==t.length)return!0;for(let s=0;s<e.length;s+=1)if(e[s]!==t[s])return!0;return!1}const c_=new WeakMap;function cv(e,t){let s=c_.get(t);if(s)try{xr(s)!==e&&(s=void 0)}catch{s=void 0}const r=!s;let i=s??{},c=!s;function u(){c||(i={...i},c=!0)}return(r||ep(i.chains,t.chains))&&(u(),i.chains=Object.freeze([...t.chains])),(r||ep(i.features,t.features))&&(u(),i.features=Object.freeze([...t.features])),(r||i.address!==t.address||i.icon!==t.icon||i.label!==t.label||F$(i.publicKey,t.publicKey))&&(u(),i.address=t.address,i.icon=t.icon,i.label=t.label,i.publicKey=t.publicKey),c&&(c_.set(t,i),OO(i,e)),Object.freeze(i)}const l_=new WeakMap;function H$(e){const t=l_.get(e),s=!t;let r=t??{},i=!t;function c(){i||(r={...r},i=!0)}const u={_cache:[],*[Symbol.iterator](){this._cache.length&&(yield*this._cache);for(const f of e.accounts.slice(this._cache.length)){const p=cv(e,f);this._cache.push(p),yield p}},some(f){if(this._cache.some(f))return!0;for(const p of e.accounts.slice(this._cache.length)){const m=cv(e,p);if(this._cache.push(m),f(m))return!0}return!1},get length(){return e.accounts.length}};return(s||r.accounts.length!==e.accounts.length||u.some(f=>!r.accounts.includes(f)))&&(c(),r.accounts=Object.freeze(Array.from(u))),(s||ep(r.features,Object.keys(e.features)))&&(c(),r.features=Object.freeze(Object.keys(e.features))),(s||ep(r.chains,e.chains))&&(c(),r.chains=Object.freeze([...e.chains])),(s||r.icon!==e.icon||r.name!==e.name||r.version!==e.version)&&(c(),r.icon=e.icon,r.name=e.name,r.version=e.version),i&&(l_.set(e,r),OO(r,e)),Object.freeze(r)}function q$(e,t){if(e.address!==t.address)return!1;const s=xr(e),r=xr(t);return s===r}function Fc(e,t){const s=xr(t),r=xr(e);return s===r}function cd(e,t){const s=xr(e);if(!(t in s.features)){const r=new nd(K5,{featureName:t,supportedChains:[...s.chains],supportedFeatures:Object.keys(s.features),walletName:s.name});throw kp(r,cd),r}return s.features[t]}function NO(e,t){if(!e.features.includes(t)){const s=new nd(J5,{address:e.address,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features]});throw kp(s,NO),s}return cd(e,t)}new TextEncoder;const Z$=new TextDecoder,Y$=new TextDecoder("utf-8",{fatal:!0});function W$(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw new TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}const s=atob(e),r=new Uint8Array(s.length);for(let i=0;i<s.length;i++)r[i]=s.charCodeAt(i);return r}class X$ extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,s){super(t,s),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class Fi extends X${static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}const J$="The input to be decoded is not correctly encoded.";function K$(e){try{return W$(typeof e=="string"?e:Z$.decode(e),!0)}catch(t){throw new TypeError(J$,{cause:t})}}function Q$(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function eV(e){if(typeof e!="string")throw new Fi("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:s}=e.split(".");if(s===5)throw new Fi("Only JWTs using Compact JWS serialization can be decoded");if(s!==3)throw new Fi("Invalid JWT");if(!t)throw new Fi("JWTs must contain a payload");let r;try{r=K$(t)}catch{throw new Fi("Failed to base64url decode the payload")}let i;try{i=JSON.parse(Y$.decode(r))}catch{throw new Fi("Failed to parse the decoded payload as JSON")}if(!Q$(i))throw new Fi("Invalid JWT Claims Set");return i}const tV=Ne({address:Be(),publicKey:Be(),label:dn(Be()),features:dn(ct(Be()))}),nV=Ne({exp:Cn(),iat:Cn(),iss:Be(),aud:Be(),payload:Ne({accounts:ct(tV)})});function sV(e){const t=eV(e);return St(nV,t)}const rV=Ep("type",[Ne({type:nt("connect"),session:Be("`session` is required")}),Ne({type:nt("sign-transaction"),bytes:Be(),signature:Be()}),Ne({type:nt("sign-and-execute-transaction"),bytes:Be(),signature:Be(),digest:Be(),effects:Be()}),Ne({type:nt("sign-personal-message"),bytes:Be(),signature:Be()})]),aV=Ep("type",[Ne({type:nt("reject"),reason:dn(Be("`reason` must be a string"))}),Ne({type:nt("resolve"),data:rV})]),iV=Ne({id:Xt(Be(),pk()),source:nt("web-wallet-channel"),payload:aV,version:nt("1")});function oV(){return{version:"1",originUrl:window.location.href,userAgent:navigator.userAgent,screenResolution:`${window.screen.width}x${window.screen.height}`,language:navigator.language,platform:navigator.platform,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:Date.now()}}var cV=class{#e;#t="1";#r;#s;#a;#i;#o;#c;#n;#m;#h=null;#f=!1;constructor({appName:e,hostOrigin:t,hostPathname:s="dapp-request",extraRequestOptions:r,popupWindow:i}){const c=i??window.open("about:blank","_blank");if(!c)throw new Error("Failed to open new window");this.#r=crypto.randomUUID(),this.#e=c,this.#s=t,this.#a=s,this.#i=e;const{promise:u,resolve:f,reject:p}=N4();this.#c=u,this.#n=f,this.#m=p,this.#o=r,this.#h=setInterval(()=>{try{this.#e.closed&&(this.#l(),p(new Error("User closed the wallet window")))}catch{}},1e3)}send({type:e,...t}){if(this.#e.closed)throw new Error("User closed the wallet window");if(this.#f)throw new Error("send() can only be called once");this.#f=!0,window.addEventListener("message",this.#p);const s={version:this.#t,requestId:this.#r,appUrl:window.location.href.split("#")[0],appName:this.#i,payload:{type:e,...t},metadata:oV(),extraRequestOptions:this.#o},r=encodeURIComponent(btoa(JSON.stringify(s)));return this.#e.location.assign(`${this.#s}/${this.#a}#${r}`),this.#c}close(){this.#l(),this.#e.close()}#p=e=>{if(e.origin!==this.#s)return;const{success:t,output:s}=JI(iV,e.data);!t||s.id!==this.#r||(this.#l(),s.payload.type==="reject"?this.#m(new Error(s.payload.reason||"User rejected the request")):s.payload.type==="resolve"&&this.#n(s.payload.data))};#l(){this.#h&&(clearInterval(this.#h),this.#h=null),window.removeEventListener("message",this.#p)}};const lV="https://my.slush.app",tp="slush:session",uV="Slush",dV="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAgMjRDMCAxMC43NDUyIDEwLjc0NTIgMCAyNCAwQzM3LjI1NDggMCA0OCAxMC43NDUyIDQ4IDI0QzQ4IDM3LjI1NDggMzcuMjU0OCA0OCAyNCA0OEMxMC43NDUyIDQ4IDAgMzcuMjU0OCAwIDI0WiIgZmlsbD0iIzBDMEExRiIvPgo8cGF0aCBkPSJNMTMuMTM1OCAzMi4xMDg1QzE0LjE3MDEgMzUuOTY4MyAxOC4wMzMxIDM5LjQ2MjQgMjYuMDI1NSAzNy4zMjA4QzMzLjY1MTUgMzUuMjc3NCAzOC40MzA5IDI5LjAwNCAzNy4xOTE2IDI0LjM3ODlDMzYuNzYzNiAyMi43ODE3IDM1LjQ3NDYgMjEuNzAwNiAzMy40ODcyIDIxLjg3NjVMMTUuNzE2NSAyMy4zNTcyQzE0LjU5NzMgMjMuNDQzIDE0LjA4NDIgMjMuMjU5NiAxMy43ODgxIDIyLjU1NDNDMTMuNTAxIDIxLjg4MjMgMTMuNjY0NiAyMS4xNjA5IDE1LjAxNjMgMjAuNDc3N0wyOC41NDAxIDEzLjUzNzRDMjkuNTc2NyAxMy4wMSAzMC4yNjcxIDEyLjc4OTMgMzAuODk4IDEzLjAxMjZDMzEuMjkzNCAxMy4xNTYzIDMxLjU1MzggMTMuNzI4NCAzMS4zMTQ3IDE0LjQzNDRMMzAuNDM3OCAxNy4wMjMyQzI5LjM2MTcgMjAuMjAwMiAzMS42NjUzIDIwLjkzODIgMzIuOTY0MSAyMC41OTAyQzM0LjkyODkgMjAuMDYzNyAzNS4zOTExIDE4LjE5MjMgMzQuNzU4MSAxNS44Mjk5QzMzLjE1MzMgOS44NDA1NCAyNi43OTkgOC45MDQxMSAyMS4wMzc4IDEwLjQ0NzhDMTUuMTc2NyAxMi4wMTgzIDEwLjA5NiAxNi43Njc2IDExLjY0NzQgMjIuNTU3M0MxMi4wMTI5IDIzLjkyMTYgMTMuMjY4NyAyNS4wMTE2IDE0LjcyMzIgMjQuOTc4NUwxNi45NDM4IDI0Ljk3MzFDMTcuNDAwNCAyNC45NjI1IDE3LjIzNiAyNSAxOC4xMTcgMjQuOTI3MUMxOC45OTggMjQuODU0MSAyMS4zNTA5IDI0LjU2NDYgMjEuMzUwOSAyNC41NjQ2TDMyLjg5NjIgMjMuMjU4TDMzLjE5MzcgMjMuMjE0OEMzMy44Njg5IDIzLjA5OTcgMzQuMzc5MiAyMy4yNzUgMzQuODEwNiAyNC4wMTgzQzM1LjQ1NjMgMjUuMTMwNCAzNC40NzEyIDI1Ljk2OTEgMzMuMjkyIDI2Ljk3MzFDMzMuMjYwNSAyNyAzMy4yMjg4IDI3LjAyNyAzMy4xOTcgMjcuMDU0MUwyMy4wNDgyIDM1LjgwMDVDMjEuMzA4NyAzNy4zMDA4IDIwLjA4NjcgMzYuNzM2NyAxOS42NTg4IDM1LjEzOTVMMTguMTQzMSAyOS40ODI5QzE3Ljc2ODcgMjguMDg1NCAxNi40MDQxIDI2Ljk4ODkgMTQuODA1NiAyNy40MTcyQzEyLjgwNzUgMjcuOTUyNiAxMi42NDU1IDMwLjI3ODQgMTMuMTM1OCAzMi4xMDg1WiIgZmlsbD0iI0ZCRkFGRiIvPgo8L3N2Zz4K",uy="com.mystenlabs.suiwallet",fV="https://api.slush.app/api/wallet/metadata",hV={id:"com.mystenlabs.suiwallet.web",walletName:"Slush",description:"Trade and earn on Sui.",icon:dV,enabled:!0},pV=Ne({id:Be("Wallet ID is required"),walletName:Be("Wallet name is required"),icon:Be("Icon must be a valid wallet icon format"),enabled:lo("Enabled is required")});function mV(e){localStorage.setItem(tp,e)}function fu(){const e=localStorage.getItem(tp);if(!e)throw new Error("No session found");return e}const u_=["sui:signTransaction","sui:signAndExecuteTransaction","sui:signPersonalMessage","sui:signTransactionBlock"];function d_(e){const{payload:t}=sV(e);return t.accounts.map(s=>new sd({address:s.address,chains:Lu,features:s.features?u_.filter(r=>s.features?.includes(r)):u_,publicKey:qe(s.publicKey)}))}var gV=class{#e;#t;#r;#s;#a;#i;#o;#c=null;get name(){return this.#a}get id(){return this.#e}get icon(){return this.#i}get version(){return"1.0.0"}get chains(){return Lu}get accounts(){return this.#r}get features(){return{"standard:connect":{version:"1.0.0",connect:this.#g},"standard:disconnect":{version:"1.0.0",disconnect:this.#y},"standard:events":{version:"1.0.0",on:this.#p},"sui:signTransactionBlock":{version:"1.0.0",signTransactionBlock:this.#n},"sui:signTransaction":{version:"2.0.0",signTransaction:this.#m},"sui:signPersonalMessage":{version:"1.1.0",signPersonalMessage:this.#f},"sui:signAndExecuteTransaction":{version:"2.0.0",signAndExecuteTransaction:this.#h}}}constructor({name:e,origin:t,metadata:s}){if(this.#e=s.id,this.#r=this.#d(),this.#t=C4(),this.#s=t||lV,this.#o=e,this.#a=s.walletName,this.#i=s.icon,typeof window<"u"){const r=window,i=c=>{c.storageArea!==localStorage||c.key!==tp&&c.key!==null||this.#l(this.#d())};r.addEventListener("storage",i),this.#c=()=>r.removeEventListener("storage",i)}}dispose(){this.#c?.(),this.#c=null}#n=async({transactionBlock:e,account:t,chain:s})=>{const r=await e.toJSON(),i=await this.#u().send({type:"sign-transaction",transaction:r,address:t.address,chain:s,session:fu()});return{transactionBlockBytes:i.bytes,signature:i.signature}};#m=async({transaction:e,account:t,chain:s})=>{const r=this.#u(),i=await e.toJSON(),c=await r.send({type:"sign-transaction",transaction:i,address:t.address,chain:s,session:fu()});return{bytes:c.bytes,signature:c.signature}};#h=async({transaction:e,account:t,chain:s})=>{const r=this.#u(),i=await e.toJSON(),c=await r.send({type:"sign-and-execute-transaction",transaction:i,address:t.address,chain:s,session:fu()});return{bytes:c.bytes,signature:c.signature,digest:c.digest,effects:c.effects}};#f=async({message:e,account:t,chain:s})=>{const r=await this.#u().send({type:"sign-personal-message",message:st(e),address:t.address,chain:s??zk,session:fu()});return{bytes:r.bytes,signature:r.signature}};#p=(e,t)=>(this.#t.on(e,t),()=>this.#t.off(e,t));#l(e){this.#r=e,this.#t.emit("change",{accounts:this.accounts})}#g=async e=>{if(e?.silent)return{accounts:this.accounts};const t=await this.#u().send({type:"connect"});return mV(t.session),this.#l(d_(t.session)),{accounts:this.accounts}};#d(){try{return d_(fu())}catch{return[]}}#y=async()=>{localStorage.removeItem(tp),this.#l([])};#u(){return new cV({appName:this.#o,hostOrigin:this.#s})}updateMetadata(e){this.#e=e.id,this.#a=e.walletName,this.#i=e.icon}};async function yV(e){const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch wallet metadata");return St(pV,await t.json())}function vV(e,{origin:t,metadataApiUrl:s=fV}={}){const r=_p();if(r.get().some(m=>m.id===uy))return;const i=new gV({name:e,origin:t,metadata:hV}),c=r.register(i);let u=!1;const f=()=>{u||(u=!0,i.dispose(),p(),c())},p=r.on("register",m=>{m.id===uy&&f()});return r.get().some(m=>m.id===uy)&&f(),yV(s).then(m=>{if(!u){if(!m.enabled){console.log("Slush wallet is not currently enabled."),f();return}i.updateMetadata(m)}}).catch(m=>{console.error("Error fetching metadata",m)}),{wallet:i,unregister:f}}var rl=class extends Error{},Ob=class extends rl{},bV=class extends rl{},Dp=class extends rl{},wV=class extends rl{},Nb=class extends rl{};function al(e){return`sui:${e}`}function TV(e,t){if(e.length===0)throw new rl("You must specify at least one Sui network for your application.");const s=new Map;function r(i){if(s.has(i))return s.get(i);const c=t(i);return s.set(i,c),c}return{networkConfig:Object.freeze(s),getClient:r}}const EV=[Jv,Ap],SV=[$h,Bk];function xO(e){const t=xr(e);return t.id??t.name}function xb(e,t){if(!e.wallet||!e.account)throw new Ob("No wallet is connected.");if(t&&!Fc(t,e.wallet))throw new Nb(`No account with address ${t.address} is connected to ${e.wallet.name}.`);return t??e.account}function CO({account:e,featureName:t,chain:s}){if(!e.chains.includes(s)){const r=new nd(X5,{chain:s,featureName:t,supportedChains:[...e.chains],supportedFeatures:[...e.features],address:e.address});throw new bV(`The account ${r.context.address} does not support the chain "${r.context.chain}".`,{cause:r})}try{return NO(e,t)}catch(r){throw new Dp(`The account ${e.address} does not support the feature "${t}".`,{cause:r})}}function np(...e){try{return CO(...e)}catch(t){if(t instanceof Dp)return null;throw t}}function _V({defaultNetwork:e,getClient:t}){const s=P$({status:"disconnected",currentAccount:null}),r=Qh(e),i=Qh([]),c=cy([i,r],(u,f)=>u.filter(p=>{const m=p.chains.some(b=>al(f)===b),g=EV.every(b=>p.features.includes(b)),y=SV.some(b=>p.features.includes(b));return m&&g&&y}));return{$currentNetwork:r,$registeredWallets:i,$compatibleWallets:c,$baseConnection:s,$currentClient:cy(r,t),$connection:cy([s,c],(u,f)=>{switch(u.status){case"connected":{const p=f.find(m=>Fc(u.currentAccount,m));return p?{wallet:p,account:u.currentAccount,status:u.status,supportedIntents:u.supportedIntents,isConnected:!0,isConnecting:!1,isReconnecting:!1,isDisconnected:!1}:{wallet:null,account:null,status:"disconnected",supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!1,isDisconnected:!0}}case"connecting":return{wallet:null,account:u.currentAccount,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!0,isReconnecting:!1,isDisconnected:!1};case"reconnecting":{const{currentAccount:p}=u,m=p?f.find(g=>Fc(p,g))??null:null;return!p||!m?{wallet:null,account:null,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!0,isDisconnected:!1}:{wallet:m,account:p,status:u.status,supportedIntents:u.supportedIntents,isConnected:!1,isConnecting:!1,isReconnecting:!0,isDisconnected:!1}}case"disconnected":return{wallet:null,account:u.currentAccount,status:u.status,supportedIntents:[],isConnected:!1,isConnecting:!1,isReconnecting:!1,isDisconnected:!0};default:throw new Error(`Encountered unknown connection status: ${u}`)}})}}function kV({$registeredWallets:e}){jp(e,()=>{const t=_p(),s=new Map,r=()=>{const f=t.get(),p=[];for(const m of f)try{p.push(H$(m))}catch{console.warn(`[dapp-kit] Skipping wallet "${m.name}" because it does not comply with the Wallet Standard.`)}e.set(p)},i=f=>{const p=f.features[Ap].on("change",()=>{r()});s.set(f,p)},c=t.on("register",(...f)=>{f.filter(dy).forEach(i),r()}),u=t.on("unregister",(...f)=>{f.filter(dy).forEach(p=>{const m=s.get(p);m&&(s.delete(p),m())}),r()});return t.get().filter(dy).forEach(i),r(),()=>{c(),u(),s.forEach(f=>f()),s.clear()}})}function dy(e){return Ap in e.features}const AV="mysten-dapp-kit:selected-wallet-and-address";function OV(){return NV()?localStorage:IO()}function IO(){const e=new Map;return{getItem(t){return e.get(t)??null},setItem(t,s){e.set(t,s)},removeItem(t){e.delete(t)}}}function RO(e,t,s,r){const i=xO(s).replace(":","_"),c=r.join(","),u=[i,s.address,c].join(":");e.setItem(t,u)}function NV(){try{const e="__storage_test__";return localStorage.setItem(e,"test"),localStorage.removeItem(e),!0}catch{return!1}}function xV({$baseConnection:e},t,{storage:s,storageKey:r}){return async function({wallet:c,account:u,...f}){return await Kh(async()=>{const p=e.get().status==="connected";try{e.setKey("status",p?"reconnecting":"connecting");const{accounts:m,supportedIntents:g}=await jO(c,t,f);if(!p&&m.length===0)throw new wV("No accounts were authorized.");if(u&&!Fc(u,c))throw new Nb(`No account with address ${u.address} is authorized for ${c.name}.`);const y=u??m[0],b=g??[];return e.set({status:"connected",currentAccount:y,supportedIntents:b}),RO(s,r,y,b),{accounts:m}}catch(m){throw e.setKey("status",p?"connected":"disconnected"),m}})}}async function jO(e,t,s){const{connect:r}=cd(e,Jv),i=await r(s),c=xr(e),u=t.map(al),f=i.supportedIntents??await MO(e);return{accounts:i.accounts.filter(p=>p.chains.some(m=>u.includes(m))).map(cv.bind(null,c)),supportedIntents:f}}async function MO(e){return e.features.includes("sui:getCapabilities")?(await cd(e,"sui:getCapabilities")?.getCapabilities())?.supportedIntents??[]:[]}function CV({networks:e,stores:{$baseConnection:t,$compatibleWallets:s},storage:r,storageKey:i,walletsRegistered:c,timeout:u}){jp(s,()=>{let f=!1,p;const m=()=>{f=!0,p?.()},g=y=>Kh(async()=>{if(f)return;const{status:b}=t.get();if(b!=="disconnected"&&b!=="reconnecting"){m();return}const S=await IV({networks:e,storage:r,storageKey:i,wallets:y});f||S&&(t.set({status:"connected",currentAccount:S.account,supportedIntents:S.supportedIntents}),m())});return p=s.subscribe((y,b)=>{y&&(b&&b.length>y.length||g(y))}),Kh(async()=>{const y=!!await r.getItem(i);if(f)return;if(!y){m();return}t.get().status==="disconnected"&&t.set({status:"reconnecting",currentAccount:null,supportedIntents:[]});const b=new Promise(S=>setTimeout(S,u));await Promise.all([c.catch(()=>{}),b]),!f&&(await g(s.get()??[]),!f&&t.get().status==="reconnecting"&&t.set({status:"disconnected",currentAccount:null}))}),m})}async function IV({networks:e,storage:t,storageKey:s,wallets:r}){const i=await t.getItem(s);if(!i)return null;const[c,u,f]=i.split(":");if(!c||!u)return null;const p=r.find(S=>xO(S)===c);if(!p)return null;const m=p.accounts.find(S=>S.address===u);if(m)return{account:m,supportedIntents:(f?f.split(","):null)??await MO(p)};const{accounts:g,supportedIntents:y}=await jO(p,e,{silent:!0}),b=g.find(S=>S.address===u);return b?{account:b,supportedIntents:y}:null}function RV({$compatibleWallets:e,$baseConnection:t}){jp(e,()=>e.listen(async s=>{const r=t.get();if(r.status!=="connected")return;const i=jV(r.currentAccount,s);i?t.setKey("currentAccount",i):t.set({status:"disconnected",currentAccount:null})}))}function jV(e,t){for(const s of t){for(const r of s.accounts)if(q$(e,r))return r;if(Fc(e,s)&&s.accounts[0])return s.accounts[0]}return null}function MV({$currentNetwork:e}){return function(s){e.set(s)}}function DV({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return async function(...c){return await Kh(async()=>{const{wallet:u}=t.get();if(!u)throw new Ob("No wallet is connected.");try{const{disconnect:f}=cd(u,sj);await f(...c)}catch(f){console.warn("Failed to disconnect the current wallet from the application.",f)}finally{s.removeItem(r),e.set({status:"disconnected",currentAccount:null})}})}}function UV({$baseConnection:e,$connection:t},{storage:s,storageKey:r}){return function({account:c}){const u=t.get();if(!u.wallet)throw new Ob("No wallet is connected.");if(!Fc(c,u.wallet))throw new Nb(`No account with address ${c.address} is connected to ${u.wallet.name}.`);e.setKey("currentAccount",c),RO(s,r,c,u.supportedIntents)}}function BV({$connection:e,$currentNetwork:t}){return async function({account:r,network:i,...c}){const u=xb(e.get(),r),f=al(i??t.get());return await CO({account:u,chain:f,featureName:Gy}).signPersonalMessage({...c,account:Mp(u),chain:f})}}function f_(e,t,s,r){const i=h8(r);let c=null;try{c=p8(r)}catch{console.warn("Parsing transaction effects failed, you may need to update the SDK to pickup the latest bcs types")}const u={digest:e,signatures:[t],epoch:null,timestampMs:null,checkpoint:null,status:i,effects:c,transaction:d8(s),balanceChanges:void 0,events:void 0,objectTypes:void 0,bcs:s};return i.success?{$kind:"Transaction",Transaction:u}:{$kind:"FailedTransaction",FailedTransaction:u}}function LV({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...f}){const p=e.get(),m=xb(p,c),g=[...p.supportedIntents],y=Mp(m),b=u??t.get(),S=s(b),O=al(b),C={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:S,supportedIntents:g}))},R=np({account:m,chain:O,featureName:Py});if(R){const x=await R.signAndExecuteTransaction({...f,account:y,transaction:C,chain:O}),W=qe(x.bytes),ce=qe(x.effects);return f_(x.digest,x.signature,W,ce)}const $=np({account:m,chain:O,featureName:z5});if($){const x=Zn.from(await C.toJSON()),{digest:W,rawEffects:ce,rawTransaction:ge}=await $.signAndExecuteTransactionBlock({account:y,chain:O,transactionBlock:x,options:{showRawEffects:!0,showRawInput:!0}}),[{txSignatures:[F],intentMessage:{value:K}}]=H.SenderSignedData.parse(qe(ge));return f_(W,F,H.TransactionData.serialize(K).toBytes(),new Uint8Array(ce))}throw new Dp(`The account ${m.address} does not support signing and executing transactions.`)}}function zV({$connection:e,$currentNetwork:t},s){return async function({transaction:i,account:c,network:u,...f}){const p=e.get(),m=xb(p,c),g=[...p.supportedIntents],y=Mp(m),b=u??t.get(),S=s(b),O=al(b),C={toJSON:async()=>typeof i=="string"?i:(i.setSenderIfNotSet(m.address),await i.toJSON({client:S,supportedIntents:g}))},R=np({account:m,chain:O,featureName:$h});if(R)return await R.signTransaction({...f,transaction:C,account:y,chain:O});const $=np({account:m,chain:O,featureName:Bk});if($){const x=Zn.from(await C.toJSON()),{transactionBlockBytes:W,signature:ce}=await $.signTransactionBlock({transactionBlock:x,account:y,chain:O});return{bytes:W,signature:ce}}throw new Dp(`The account ${m.address} does not support signing transactions.`)}}function $V(e){return{id:"slush-web-wallet-initializer",async initialize(){const t=await vV(e?.appName||VV(),{origin:e?.origin,metadataApiUrl:e?.metadataApiUrl});if(!t)throw new Error("Registration un-successful.");return{unregister:t.unregister}}}}function VV(){return document.querySelector('meta[name="application-name"]')?.content||document.title}const fy=new Map;async function PV(e,t){fy.forEach(i=>i()),fy.clear();const s=[...new Map(e.map(i=>[i.id,i])).values()].map(async i=>({initializer:i,result:await i.initialize(t)})),r=await Promise.allSettled(s);for(const i of r)if(i.status==="fulfilled"){const{initializer:c,result:u}=i.value;fy.set(c.id,u.unregister)}else console.warn(`Skipping wallet initializer: "${i.reason}".`)}function GV(){return{id:"unsafe-burner-initalizer",async initialize({networks:e,getClient:t}){const s=new FV({clients:e.map(t)});return{unregister:_p().register(s)}}}}var FV=class{#e;#t=new k$;#r;constructor({clients:e}){this.#e=e.reduce((t,s)=>{const r=al(s.network);return t[r]=s,t},{}),this.#r=new sd({address:this.#t.getPublicKey().toSuiAddress(),publicKey:this.#t.getPublicKey().toSuiBytes(),chains:this.chains,features:[$h,Py,Gy]}),console.warn("Your application is currently using the unsafe burner wallet. Make sure that this wallet is disabled in production.")}get version(){return"1.0.0"}get name(){return"Unsafe Burner Wallet"}get icon(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAJrElEQVR42tWbe2xT1x3H7UxAyD3XrdrSbGXlUbKWsq5rWdVuVOMRSEqSOmnVRZMmJqZNYv1nf3R/jWmVmVrtRRM/YwPd1nVTNcrE3pQCoikrIRAC4VVNY0hlD9ZOo1uCfe3ra9979v0dcy3s5Pper76Oh/STE+495/4+5/c85zqe2f7HAx5vKsS+monJj/CdHi/f4/HWW4f6AwdblmXjTM0NyS+movKtw9v+j6C5gKhyTMTTpA2x15Qwy+Pz75motOGdgKep8WF5ATgVZIt5NeO2wMqD0hfVGNPh3oYaYflsjG0l63PeyLCDnqbsLpZIhaRNFI+Ox+Le5KB0RybK8gDmJOkI07U4i/FhT1NDQl8Me5rUIfaDfELOJ0NsFa/SJQHm1WLsHcDqRWiy9BCL8s0N5t6UWWFVvxplejYm60hC91cNjPtzCTZsAptCVoeLP8PDDQJNCSodap6H+LtE8ZcdkvVkkD38vwDn4/Jvy4EhBhZSvRaUHiTXn31gJJxkUPoClBKKFizM+inhVA2cYIdM4HJouPvoe9s9H+KzDhyGK6KkmIqitBhww2C11rjQL2L4kgUwFxk8yPyzauUA3Pk/353XnA6zKbKCaQ2UlMvJF6W5uF5F8yHfZWZpC9HRmBziaEpm1bpY9XvhxuWJRldC7Mt03WlZwpjnkZUNa2DMG2EaPj9MGd2l2mofd0hQ7ZSopsXckHxVCUp32fXGdD0ZktrgFUmMqwhcWFjp87RArsD+9bn585IRaSHAKgBL3SZwOTRc8BKg7yYoskp5OJDiiPmF2Sj7ox0siYJ7lJA04EqvzZ9B1xSVt6PlW0IxZgUMJdZYAJuWngLQt9IRuZXmoTEkmci8ZtTXTViUKyasA9FRun5d8z6bfw0gYWm9mmCXxZatQgxfC7I2NVpRYQOxKWppLs4mcgn5NcibgL1K40xYp8CYY5TXEpjcb3LAJ0OZyyg3+2nySm6fjEtzkEz+7VBx3RTb+60z9dma7pkvwO2QQL5HzTtAdpKF7euw/HuzfrosBHy+ZsBimzbQshjWTVMDgez53B5MbjcGbr1ZjdUJOM5O0SLXzJ2R+uOA1dMAVoLsm5zb73JSId8t8Aa1LsAJdoTCrCaw6e3NC2DdFMUXWRg173mysJNOSUNskUJ1cOlXa2LhcbgmSszXYSn9hl3KSxTDjrZ2cbbfbWDyumsh9m3e7zCG7a3ETt+gtI7fx6lEOanZKDVvuA2cjYmt5xNOd2Louz3IQ12UZ2Zo3lkb9cDlvSs6m4Vk5Yqlabs0B97wT7PUuCXQz0Bnt9QxMPTW4iwBtmUlY8hFsHJPlzcQ1xuG75CVK1kXofCUGnU9fg1aVD7kfE9MoabtYkcAvIUYS2op3Hc3TTrDQzIAeojugTVLFolWDR6wFPtY0R66n6HltwjCIawnE2ymresk9NtN+pfUUi0mX6RJLfrh9zMRaRPOqubSA8W2MNzC0mHpK7j2ruuw5mYkxl5+2+HGQeg4yNYg7vNg+xMxFsuRMuiTsRJZG3cysAl4D9n4aC4un8L9qUyVvbCyYwFXX1nGUxFf1cCiEQqy75O+TpMwYKNKSPQUqhLyyWLsRbESLctx0YnixgfphRWA8pOPc+N4F9d+eV9V4OlCX/As5w5g+wtGhJGukp5go2R3D7EW9rSDcnGL56YgJHj+8GcFND/Vy41jj/H0jxc6HU/AA2QlR01UlH3D7CmITQnJq4lVWBi1yl8XYEh278c5H++F+Iui7r7bYR8tH/gbqoJN7fVODUhLYVVxzmYCEyOxFg7RUVa0egCHZZ55eRHnp/tKgMna6s/bbMdTxZgMzl9CCcmq7k690OzDfaeSN4QcsREjsQpgXHwyWyfg9K5WE7hc6JqTWjyihObfygOFOkv6i5K5TZx8LsL1sVS4NL8ItiB7sgAcEKcWHfUCVhK3kUVnBNbfXIs4l5xAv5sJs234eTUy93L0Au2otQOw5ORMyfQ6WwexFupVSHowG6uThXfebmlhWojMS3fazmMeGxEI6S2SUti6RAo2vKohVuH3qUG5FWm/PjH8kzutgSH5g58xrVwzIbZkxHf7OFjFC+wrMDXcpOqOKX/g01U/XPvVJyxdWsiJblqYmnZoWbDxAcR56X5WPuh4ewcL5PY9JBRUYjc7fzjG6Uc3mHBWbg23X1BLaFHOSnrw4bWiNAXSEWcWRntIignXTP/oDsfKZX66mMbZAPfhviU1AyYmJLYAMZa/QXjUSeIiixpj3UUFtd884KytjN7EjdGNNMbWwtlf3FvbQ4OQtIoYSzbxqVDLXMTxP8jnnbiyKcaJLvueGLD6kXW2sKZov1tpn7hwXf3ZUvq0K2FXOM7Op/Xgb6PhxsWIErYGVuK3WGXWkkwMMZVCVl5kWtax5A6usgemvnx4DelUcYcFC0eIbcbXKzggeyBjeXIhkftaKknJKLtnuSg7KmKQsrH+1nqbmLWY6w/tBGy/8xrruR5SM99LLIjfT/4ZbNZnQEPssIVb21rKTGRIPDagNoLdFMKgcuLc/TF6Bulk6c7ovg4TU+XvS6FNw1tDfVqH9MOPmBDui0hcK6wz744FlDjNe0m3aVldJYagtI6YbF+3ZGPsQHlN1vbeh8lJofqJ+uo9Zi4wXZxKFiXKGxbHT7pNq71oNg4Qi6MviE0FpRVqjGXILYoJ4tCjdYU1rWeMdPLc/ochj3B9pGNGL4NupGPRlUl35KMVxFLNO6ZnxYlBsUPqoMkbUqAb6VhMVKQ7MVT1dYdrL8hzEAcjpmvjHKphgaFb0ZVJZw7dwVD9q5fkgPTRbBxnzmGfgRLQsMCkG+moQdcp6GzzZsL2MGyllvBNGWM9RqMCk26kI7aBK526csVShZTfzid6FEzeiNAGP92jpCPQEbrW7EW5MbZxAz/fN9lg0IbQaaxrQ83/VoKPb/HqJx67Hw+43CDQBPsX0gm6ufXNvH4vP9rZapzx7+Nn+oxZAjfo2caZ3n350c5W6FSEdQ86sNarj3c/jRV+H42AXsdGRBfPPIlnb/mUtxzWXfALn/PmRze2Gud6E/xsXwYtnlsWN8Tc5/oyxjn/jvyJrlY82xLUfWuPr/TqxzuXQZkIP9M7CXiyuP4B4WmsTnNhzinjrD+WO9bRhmdZWLXe4EKRtV5tpN3Hx3s2G+d79/MJf4qff0LnE72kfFEs4ITQvWLMab8C131dP9n9Je1Yx000Nz2jAf+UJwCBchc3NvGR1Qx71XXY2Ww1Jvx7YalzAPkX9rp5E5Z+pv+ja8bE43uN491b9dHO9Xx4lUxziLn21Nai/wXWM6t9vkvtrwAAAABJRU5ErkJggg=="}get chains(){return Object.keys(this.#e)}get accounts(){return[this.#r]}get features(){return{[Jv]:{version:"1.0.0",connect:this.#a},[Ap]:{version:"1.0.0",on:this.#s},[Gy]:{version:"1.1.0",signPersonalMessage:this.#i},[$h]:{version:"2.0.0",signTransaction:this.#o},[Py]:{version:"2.0.0",signAndExecuteTransaction:this.#c}}}#s=()=>()=>{};#a=async()=>({accounts:this.accounts});#i=async e=>await this.#t.signPersonalMessage(e.message);#o=async({transaction:e,signal:t,chain:s})=>{t?.throwIfAborted();const r=this.#e[s];if(!r)throw new Error(`Invalid chain "${s}" specified.`);const i=await Zn.from(await e.toJSON()).build({client:r});return await this.#t.signTransaction(i)};#c=async({transaction:e,signal:t,chain:s})=>{t?.throwIfAborted();const r=this.#e[s];if(!r)throw new Error(`Invalid chain "${s}" specified.`);const i=Zn.from(await e.toJSON()),c=await i.build({client:r}),u=await this.#t.signAndExecuteTransaction({transaction:i,client:r}),f=u.Transaction??u.FailedTransaction;return{bytes:st(c),signature:f.signatures[0],digest:f.digest,effects:st(f.effects.bcs)}}};function HV({autoConnect:e=!0,networks:t,createClient:s,defaultNetwork:r=t[0],enableBurnerWallet:i=!1,slushWalletConfig:c,storage:u=OV(),storageKey:f=AV,walletInitializers:p=[],autoConnectTimeout:m=5e3}){const g=TV(t,s),y=_V({defaultNetwork:r,getClient:g.getClient});function b(O){return O?g.getClient(O):y.$currentClient.get()}u||=IO(),kV(y),RV(y);const S=PV([...p,...i?[GV()]:[],...c!==null?[$V(c)]:[]],{networks:t,getClient:b});return e&&CV({networks:t,stores:y,storageKey:f,storage:u,walletsRegistered:S,timeout:m}),{networks:t,getClient:b,signTransaction:zV(y,g.getClient),signAndExecuteTransaction:LV(y,g.getClient),signPersonalMessage:BV(y),connectWallet:xV(y,t,{storage:u,storageKey:f}),disconnectWallet:DV(y,{storage:u,storageKey:f}),switchAccount:UV(y,{storage:u,storageKey:f}),switchNetwork:MV(y),stores:{$wallets:y.$compatibleWallets,$connection:y.$connection,$currentNetwork:D$(y.$currentNetwork),$currentClient:y.$currentClient}}}function qV({dAppKit:e}={}){return G$(wo(e).stores.$connection)}function il({dAppKit:e}={}){return qV({dAppKit:e}).account}const ZV=new Set(["children","localName","ref","style","className"]),h_=new WeakMap,p_=(e,t,s,r,i)=>{const c=i?.[t];c===void 0?(e[t]=s,s==null&&t in HTMLElement.prototype&&e.removeAttribute(t)):s!==r&&((u,f,p)=>{let m=h_.get(u);m===void 0&&h_.set(u,m=new Map);let g=m.get(f);p!==void 0?g===void 0?(m.set(f,g={handleEvent:p}),u.addEventListener(f,g)):g.handleEvent=p:g!==void 0&&(m.delete(f),u.removeEventListener(f,g))})(e,c,s)},DO=({react:e,tagName:t,elementClass:s,events:r,displayName:i})=>{const c=new Set(Object.keys(r??{})),u=e.forwardRef(((f,p)=>{const m=e.useRef(new Map),g=e.useRef(null),y={},b={};for(const[S,O]of Object.entries(f))ZV.has(S)?y[S==="className"?"class":S]=O:c.has(S)||S in s.prototype?b[S]=O:y[S]=O;return e.useLayoutEffect((()=>{if(g.current===null)return;const S=new Map;for(const O in b)p_(g.current,O,f[O],m.current.get(O),r),m.current.delete(O),S.set(O,f[O]);for(const[O,C]of m.current)p_(g.current,O,void 0,C,r);m.current=S})),e.useLayoutEffect((()=>{g.current?.removeAttribute("defer-hydration")}),[]),y.suppressHydrationWarning=!0,e.createElement(t,{...y,ref:e.useCallback((S=>{g.current=S,typeof p=="function"?p(S):p!==null&&(p.current=S)}),[p])})}));return u.displayName=i??s.name,u};var m_={},g_;function YV(){return g_||(g_=1,(function(){function e(G){var te=0;return function(){return te<G.length?{done:!1,value:G[te++]}:{done:!0}}}var t=typeof Object.defineProperties=="function"?Object.defineProperty:function(G,te,de){return G==Array.prototype||G==Object.prototype||(G[te]=de.value),G};function s(G){G=[typeof globalThis=="object"&&globalThis,G,typeof window=="object"&&window,typeof self=="object"&&self,typeof Sc=="object"&&Sc];for(var te=0;te<G.length;++te){var de=G[te];if(de&&de.Math==Math)return de}throw Error("Cannot find global object")}var r=s(this);function i(G,te){if(te)e:{var de=r;G=G.split(".");for(var fe=0;fe<G.length-1;fe++){var le=G[fe];if(!(le in de))break e;de=de[le]}G=G[G.length-1],fe=de[G],te=te(fe),te!=fe&&te!=null&&t(de,G,{configurable:!0,writable:!0,value:te})}}i("Symbol",function(G){function te(le){if(this instanceof te)throw new TypeError("Symbol is not a constructor");return new de("jscomp_symbol_"+(le||"")+"_"+fe++,le)}function de(le,ze){this.l=le,t(this,"description",{configurable:!0,writable:!0,value:ze})}if(G)return G;de.prototype.toString=function(){return this.l};var fe=0;return te}),i("Symbol.iterator",function(G){if(G)return G;G=Symbol("Symbol.iterator");for(var te="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),de=0;de<te.length;de++){var fe=r[te[de]];typeof fe=="function"&&typeof fe.prototype[G]!="function"&&t(fe.prototype,G,{configurable:!0,writable:!0,value:function(){return c(e(this))}})}return G});function c(G){return G={next:G},G[Symbol.iterator]=function(){return this},G}function u(G){var te=typeof Symbol<"u"&&Symbol.iterator&&G[Symbol.iterator];return te?te.call(G):{next:e(G)}}function f(G){if(!(G instanceof Array)){G=u(G);for(var te,de=[];!(te=G.next()).done;)de.push(te.value);G=de}return G}var p=typeof Object.create=="function"?Object.create:function(G){function te(){}return te.prototype=G,new te},m=(function(){function G(){function de(){}return Reflect.construct(de,[],function(){}),new de instanceof de}if(typeof Reflect<"u"&&Reflect.construct){if(G())return Reflect.construct;var te=Reflect.construct;return function(de,fe,le){return de=te(de,fe),le&&Reflect.setPrototypeOf(de,le.prototype),de}}return function(de,fe,le){return le===void 0&&(le=de),le=p(le.prototype||Object.prototype),Function.prototype.apply.call(de,le,fe)||le}})(),g;if(typeof Object.setPrototypeOf=="function")g=Object.setPrototypeOf;else{var y;e:{var b={a:!0},S={};try{S.__proto__=b,y=S.a;break e}catch{}y=!1}g=y?function(G,te){if(G.__proto__=te,G.__proto__!==te)throw new TypeError(G+" is not extensible");return G}:null}var O=g,C=window,R;if(((R=C.CustomElementRegistryPolyfill)==null?void 0:R.formAssociated)===void 0){var $={};C.CustomElementRegistryPolyfill=($.formAssociated=new Set,$)}var x=window.HTMLElement,W=window.customElements.define,ce=window.customElements.get,ge=window.customElements,F=new WeakMap,K=new WeakMap,w=new WeakMap,A=new WeakMap;function N(){var G;this.promise=new Promise(function(te){G=te}),this.resolve=G}function P(){this.h=new Map,this.m=new Map,this.j=new Map,this.i=new Map}P.prototype.define=function(G,te){if(G=G.toLowerCase(),this.h.get(G)!==void 0)throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "`+G+'" has already been used with this registry');if(this.m.get(te)!==void 0)throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");var de=te.prototype.attributeChangedCallback,fe=new Set(te.observedAttributes||[]);M(te,fe,de);var le=ce.call(ge,G),ze,Le,Dt=(Le=(ze=le)==null?void 0:ze.s)!=null?Le:te.formAssociated||C.CustomElementRegistryPolyfill.formAssociated.has(G);if(Dt&&C.CustomElementRegistryPolyfill.formAssociated.add(G),Dt!=te.formAssociated)try{te.formAssociated=Dt}catch{}if(de={tagName:G,g:te,connectedCallback:te.prototype.connectedCallback,disconnectedCallback:te.prototype.disconnectedCallback,adoptedCallback:te.prototype.adoptedCallback,attributeChangedCallback:de,formAssociated:Dt,formAssociatedCallback:te.prototype.formAssociatedCallback,formDisabledCallback:te.prototype.formDisabledCallback,formResetCallback:te.prototype.formResetCallback,formStateRestoreCallback:te.prototype.formStateRestoreCallback,observedAttributes:fe},this.h.set(G,de),this.m.set(te,de),le||(le=L(G),W.call(ge,G,le)),this===window.customElements&&(w.set(te,de),de.o=le),le=this.i.get(G))for(this.i.delete(G),le=u(le),fe=le.next();!fe.done;fe=le.next())fe=fe.value,K.delete(fe),J(fe,de,!0);return le=this.j.get(G),le!==void 0&&(le.resolve(te),this.j.delete(G)),te},P.prototype.upgrade=function(G){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];re.push(this),ge.upgrade.apply(ge,f(te)),re.pop()},P.prototype.get=function(G){var te;return(te=this.h.get(G))==null?void 0:te.g},P.prototype.whenDefined=function(G){var te=this.h.get(G);return te!==void 0?Promise.resolve(te.g):(te=this.j.get(G),te===void 0&&(te=new N,this.j.set(G,te)),te.promise)};function U(G,te,de,fe){var le=G.i.get(de);le||G.i.set(de,le=new Set),fe?le.add(te):le.delete(te)}var q;window.HTMLElement=function(){var G=q;if(G)return q=void 0,G;var te=w.get(this.constructor);if(!te)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return G=Reflect.construct(x,[],te.o),Object.setPrototypeOf(G,this.constructor.prototype),F.set(G,te),G},window.HTMLElement.prototype=x.prototype;function L(G){function te(){var de=Reflect.construct(x,[],this.constructor);Object.setPrototypeOf(de,HTMLElement.prototype);e:{var fe=de.getRootNode();if(!(fe===document||fe instanceof ShadowRoot)){if(fe=re[re.length-1],fe instanceof CustomElementRegistry){var le=fe;break e}fe=fe.getRootNode(),fe===document||fe instanceof ShadowRoot||(fe=((le=A.get(fe))==null?void 0:le.getRootNode())||document)}le=fe.registry}return le=le||window.customElements,(fe=le.h.get(G))?J(de,fe):K.set(de,le),de}return r.Object.defineProperty(te,"formAssociated",{configurable:!0,enumerable:!0,get:function(){return C.CustomElementRegistryPolyfill.formAssociated.has(G)}}),te.prototype.connectedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];j(this),(le=F.get(this))?le.connectedCallback&&le.connectedCallback.apply(this,fe):U(K.get(this),this,G,!0)},te.prototype.disconnectedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];(le=F.get(this))?le.disconnectedCallback&&le.disconnectedCallback.apply(this,fe):U(K.get(this),this,G,!1)},te.prototype.adoptedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];var ze,Le;(ze=F.get(this))==null||(Le=ze.adoptedCallback)==null||Le.apply(this,fe)},te.prototype.formAssociatedCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=F.get(this),le!=null&&le.formAssociated){var ze;le==null||(ze=le.formAssociatedCallback)==null||ze.apply(this,fe)}},te.prototype.formDisabledCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=F.get(this),le!=null&&le.formAssociated){var ze;le==null||(ze=le.formDisabledCallback)==null||ze.apply(this,fe)}},te.prototype.formResetCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=F.get(this),le!=null&&le.formAssociated){var ze;le==null||(ze=le.formResetCallback)==null||ze.apply(this,fe)}},te.prototype.formStateRestoreCallback=function(de){for(var fe=[],le=0;le<arguments.length;++le)fe[le]=arguments[le];if(le=F.get(this),le!=null&&le.formAssociated){var ze;le==null||(ze=le.formStateRestoreCallback)==null||ze.apply(this,fe)}},te}window.CustomElementRegistry=P;function M(G,te,de){if(te.size!==0&&de!==void 0){var fe=G.prototype.setAttribute;fe&&(G.prototype.setAttribute=function(Le,Dt){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var Es=this.getAttribute(Le);fe.call(this,Le,Dt),de.call(this,Le,Es,Dt)}else fe.call(this,Le,Dt)});var le=G.prototype.removeAttribute;le&&(G.prototype.removeAttribute=function(Le){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var Dt=this.getAttribute(Le);le.call(this,Le),de.call(this,Le,Dt,null)}else le.call(this,Le)});var ze=G.prototype.toggleAttribute;ze&&(G.prototype.toggleAttribute=function(Le,Dt){if(j(this),Le=Le.toLowerCase(),te.has(Le)){var Es=this.getAttribute(Le);ze.call(this,Le,Dt),Dt=this.getAttribute(Le),Es!==Dt&&de.call(this,Le,Es,Dt)}else ze.call(this,Le,Dt)})}}var k;document.readyState==="loading"&&(k=new Set,document.addEventListener("readystatechange",function(){k.forEach(function(G){return D(G,F.get(G))})},{once:!0}));function j(G){var te;(te=k)!=null&&te.has(G)&&D(G,F.get(G))}function D(G,te){var de;(de=k)==null||de.delete(G),te.attributeChangedCallback&&te.observedAttributes.forEach(function(fe){G.hasAttribute(fe)&&te.attributeChangedCallback.call(G,fe,null,G.getAttribute(fe))})}function z(G){var te=Object.getPrototypeOf(G);if(te!==window.HTMLElement)return te===x?Object.setPrototypeOf(G,window.HTMLElement):z(te)}function J(G,te,de){de=de===void 0?!1:de,Object.setPrototypeOf(G,te.g.prototype),F.set(G,te),q=G;try{new te.g}catch{z(te.g),new te.g}te.attributeChangedCallback&&(k===void 0||G.hasAttributes()?D(G,te):k.add(G)),de&&te.connectedCallback&&G.isConnected&&te.connectedCallback.call(G)}var V=Element.prototype.attachShadow;Element.prototype.attachShadow=function(G,te){for(var de=[],fe=1;fe<arguments.length;++fe)de[fe-1]=arguments[fe];var le=Object.assign({},G);return fe=G.customElements,fe=G.registry===void 0?fe:G.registry,le=(delete le.customElements,delete le.registry,le),de=V.call.apply(V,[this,le].concat(f(de))),fe!==void 0&&(de.customElements=de.registry=fe),de};var re=[document];function ue(G,te,de){var fe=(de?Object.getPrototypeOf(de):G.prototype)[te];G.prototype[te]=function(le){for(var ze=[],Le=0;Le<arguments.length;++Le)ze[Le]=arguments[Le];return re.push(this),ze=fe.apply(de||this,ze),ze!==void 0&&A.set(ze,this),re.pop(),ze}}ue(ShadowRoot,"createElement",document),ue(ShadowRoot,"createElementNS",document),ue(ShadowRoot,"importNode",document),ue(Element,"insertAdjacentHTML");function I(G){var te=Object.getOwnPropertyDescriptor(G.prototype,"innerHTML");Object.defineProperty(G.prototype,"innerHTML",Object.assign({},te,{set:function(de){re.push(this),te.set.call(this,de),re.pop()}}))}if(I(Element),I(ShadowRoot),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){var X=new WeakMap,oe=HTMLElement.prototype.attachInternals,he=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(G){for(var te=[],de=0;de<arguments.length;++de)te[de]=arguments[de];return te=oe.call.apply(oe,[this].concat(f(te))),X.set(te,this),te},he.forEach(function(G){var te=window.ElementInternals.prototype,de=te[G];te[G]=function(fe){for(var le=[],ze=0;ze<arguments.length;++ze)le[ze]=arguments[ze];if(ze=X.get(this),F.get(ze).formAssociated===!0)return de?.call.apply(de,[this].concat(f(le)));throw new DOMException("Failed to execute "+de+" on 'ElementInternals': The target element is not a form-associated custom element.")}});var Te=function(G){var te=m(Array,[].concat(f(G)),this.constructor);return te.l=G,te},Oe=Te,Ae=Array;if(Oe.prototype=p(Ae.prototype),Oe.prototype.constructor=Oe,O)O(Oe,Ae);else for(var be in Ae)if(be!="prototype")if(Object.defineProperties){var _e=Object.getOwnPropertyDescriptor(Ae,be);_e&&Object.defineProperty(Oe,be,_e)}else Oe[be]=Ae[be];Oe.u=Ae.prototype,r.Object.defineProperty(Te.prototype,"value",{configurable:!0,enumerable:!0,get:function(){var G;return((G=this.l.find(function(te){return te.checked===!0}))==null?void 0:G.value)||""}});var Ve=function(G){var te=this,de=new Map;G.forEach(function(fe,le){var ze=fe.getAttribute("name"),Le=de.get(ze)||[];te[+le]=fe,Le.push(fe),de.set(ze,Le)}),this.length=G.length,de.forEach(function(fe,le){fe&&le!=="length"&&le!=="item"&&le!=="namedItem"&&(te[le]=fe.length===1?fe[0]:new Te(fe))})};Ve.prototype.item=function(G){var te;return(te=this[G])!=null?te:null},Ve.prototype[Symbol.iterator]=function(){throw Error("Method not implemented.")},Ve.prototype.namedItem=function(G){var te;return(te=this[G])!=null?te:null};var at=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){var G=at.get.call(this),te=[];G=u(G);for(var de=G.next();!de.done;de=G.next()){de=de.value;var fe=F.get(de);fe&&fe.formAssociated!==!0||te.push(de)}return new Ve(te)}})}}).call(typeof globalThis=="object"?globalThis:window)),m_}YV();const kh=globalThis,Cb=kh.ShadowRoot&&(kh.ShadyCSS===void 0||kh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ib=Symbol(),y_=new WeakMap;let UO=class{constructor(t,s,r){if(this._$cssResult$=!0,r!==Ib)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(Cb&&t===void 0){const r=s!==void 0&&s.length===1;r&&(t=y_.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&y_.set(s,t))}return t}toString(){return this.cssText}};const WV=e=>new UO(typeof e=="string"?e:e+"",void 0,Ib),ga=(e,...t)=>{const s=e.length===1?e[0]:t.reduce((r,i,c)=>r+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[c+1],e[0]);return new UO(s,e,Ib)},BO=(e,t)=>{if(Cb)e.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const r=document.createElement("style"),i=kh.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=s.cssText,e.appendChild(r)}},v_=Cb?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(const r of t.cssRules)s+=r.cssText;return WV(s)})(e):e;const{is:XV,defineProperty:JV,getOwnPropertyDescriptor:KV,getOwnPropertyNames:QV,getOwnPropertySymbols:eP,getPrototypeOf:tP}=Object,Up=globalThis,b_=Up.trustedTypes,nP=b_?b_.emptyScript:"",sP=Up.reactiveElementPolyfillSupport,Ru=(e,t)=>e,sp={toAttribute(e,t){switch(t){case Boolean:e=e?nP:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},Bp=(e,t)=>!XV(e,t),w_={attribute:!0,type:String,converter:sp,reflect:!1,useDefault:!1,hasChanged:Bp};Symbol.metadata??=Symbol("metadata"),Up.litPropertyMetadata??=new WeakMap;let Tc=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=w_){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(t,r,s);i!==void 0&&JV(this.prototype,t,i)}}static getPropertyDescriptor(t,s,r){const{get:i,set:c}=KV(this.prototype,t)??{get(){return this[s]},set(u){this[s]=u}};return{get:i,set(u){const f=i?.call(this);c?.call(this,u),this.requestUpdate(t,f,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w_}static _$Ei(){if(this.hasOwnProperty(Ru("elementProperties")))return;const t=tP(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ru("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ru("properties"))){const s=this.properties,r=[...QV(s),...eP(s)];for(const i of r)this.createProperty(i,s[i])}const t=this[Symbol.metadata];if(t!==null){const s=litPropertyMetadata.get(t);if(s!==void 0)for(const[r,i]of s)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[s,r]of this.elementProperties){const i=this._$Eu(s,r);i!==void 0&&this._$Eh.set(i,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const i of r)s.unshift(v_(i))}else t!==void 0&&s.push(v_(t));return s}static _$Eu(t,s){const r=s.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const r of s.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return BO(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,s,r){this._$AK(t,r)}_$ET(t,s){const r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){const c=(r.converter?.toAttribute!==void 0?r.converter:sp).toAttribute(s,r.type);this._$Em=t,c==null?this.removeAttribute(i):this.setAttribute(i,c),this._$Em=null}}_$AK(t,s){const r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const c=r.getPropertyOptions(i),u=typeof c.converter=="function"?{fromAttribute:c.converter}:c.converter?.fromAttribute!==void 0?c.converter:sp;this._$Em=i;const f=u.fromAttribute(s,c.type);this[i]=f??this._$Ej?.get(i)??f,this._$Em=null}}requestUpdate(t,s,r,i=!1,c){if(t!==void 0){const u=this.constructor;if(i===!1&&(c=this[t]),r??=u.getPropertyOptions(t),!((r.hasChanged??Bp)(c,s)||r.useDefault&&r.reflect&&c===this._$Ej?.get(t)&&!this.hasAttribute(u._$Eu(t,r))))return;this.C(t,s,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:r,reflect:i,wrapped:c},u){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,u??s??this[t]),c!==!0||u!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(s=void 0),this._$AL.set(t,s)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,c]of this._$Ep)this[i]=c;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[i,c]of r){const{wrapped:u}=c,f=this[i];u!==!0||this._$AL.has(i)||f===void 0||this.C(i,void 0,c,f)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(s)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(t){}firstUpdated(t){}};Tc.elementStyles=[],Tc.shadowRootOptions={mode:"open"},Tc[Ru("elementProperties")]=new Map,Tc[Ru("finalized")]=new Map,sP?.({ReactiveElement:Tc}),(Up.reactiveElementVersions??=[]).push("2.1.2");const Rb=globalThis,T_=e=>e,rp=Rb.trustedTypes,E_=rp?rp.createPolicy("lit-html",{createHTML:e=>e}):void 0,LO="$lit$",ri=`lit$${Math.random().toFixed(9).slice(2)}$`,zO="?"+ri,rP=`<${zO}>`,ho=document,Gu=()=>ho.createComment(""),Fu=e=>e===null||typeof e!="object"&&typeof e!="function",jb=Array.isArray,aP=e=>jb(e)||typeof e?.[Symbol.iterator]=="function",hy=`[
|
|
13
|
-
\f\r]`,hu=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S_=/-->/g,__=/>/g,Hi=RegExp(`>|${hy}(?:([^\\s"'>=/]+)(${hy}*=${hy}*(?:[^
|
|
14
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),k_=/'/g,A_=/"/g,$O=/^(?:script|style|textarea|title)$/i,iP=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),bt=iP(1),po=Symbol.for("lit-noChange"),ln=Symbol.for("lit-nothing"),O_=new WeakMap,Qi=ho.createTreeWalker(ho,129);function VO(e,t){if(!jb(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return E_!==void 0?E_.createHTML(t):t}const oP=(e,t)=>{const s=e.length-1,r=[];let i,c=t===2?"<svg>":t===3?"<math>":"",u=hu;for(let f=0;f<s;f++){const p=e[f];let m,g,y=-1,b=0;for(;b<p.length&&(u.lastIndex=b,g=u.exec(p),g!==null);)b=u.lastIndex,u===hu?g[1]==="!--"?u=S_:g[1]!==void 0?u=__:g[2]!==void 0?($O.test(g[2])&&(i=RegExp("</"+g[2],"g")),u=Hi):g[3]!==void 0&&(u=Hi):u===Hi?g[0]===">"?(u=i??hu,y=-1):g[1]===void 0?y=-2:(y=u.lastIndex-g[2].length,m=g[1],u=g[3]===void 0?Hi:g[3]==='"'?A_:k_):u===A_||u===k_?u=Hi:u===S_||u===__?u=hu:(u=Hi,i=void 0);const S=u===Hi&&e[f+1].startsWith("/>")?" ":"";c+=u===hu?p+rP:y>=0?(r.push(m),p.slice(0,y)+LO+p.slice(y)+ri+S):p+ri+(y===-2?f:S)}return[VO(e,c+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let lv=class PO{constructor({strings:t,_$litType$:s},r){let i;this.parts=[];let c=0,u=0;const f=t.length-1,p=this.parts,[m,g]=oP(t,s);if(this.el=PO.createElement(m,r),Qi.currentNode=this.el.content,s===2||s===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=Qi.nextNode())!==null&&p.length<f;){if(i.nodeType===1){if(i.hasAttributes())for(const y of i.getAttributeNames())if(y.endsWith(LO)){const b=g[u++],S=i.getAttribute(y).split(ri),O=/([.?@])?(.*)/.exec(b);p.push({type:1,index:c,name:O[2],strings:S,ctor:O[1]==="."?lP:O[1]==="?"?uP:O[1]==="@"?dP:Lp}),i.removeAttribute(y)}else y.startsWith(ri)&&(p.push({type:6,index:c}),i.removeAttribute(y));if($O.test(i.tagName)){const y=i.textContent.split(ri),b=y.length-1;if(b>0){i.textContent=rp?rp.emptyScript:"";for(let S=0;S<b;S++)i.append(y[S],Gu()),Qi.nextNode(),p.push({type:2,index:++c});i.append(y[b],Gu())}}}else if(i.nodeType===8)if(i.data===zO)p.push({type:2,index:c});else{let y=-1;for(;(y=i.data.indexOf(ri,y+1))!==-1;)p.push({type:7,index:c}),y+=ri.length-1}c++}}static createElement(t,s){const r=ho.createElement("template");return r.innerHTML=t,r}};function Hc(e,t,s=e,r){if(t===po)return t;let i=r!==void 0?s._$Co?.[r]:s._$Cl;const c=Fu(t)?void 0:t._$litDirective$;return i?.constructor!==c&&(i?._$AO?.(!1),c===void 0?i=void 0:(i=new c(e),i._$AT(e,s,r)),r!==void 0?(s._$Co??=[])[r]=i:s._$Cl=i),i!==void 0&&(t=Hc(e,i._$AS(e,t.values),i,r)),t}class cP{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:s},parts:r}=this._$AD,i=(t?.creationScope??ho).importNode(s,!0);Qi.currentNode=i;let c=Qi.nextNode(),u=0,f=0,p=r[0];for(;p!==void 0;){if(u===p.index){let m;p.type===2?m=new ld(c,c.nextSibling,this,t):p.type===1?m=new p.ctor(c,p.name,p.strings,this,t):p.type===6&&(m=new fP(c,this,t)),this._$AV.push(m),p=r[++f]}u!==p?.index&&(c=Qi.nextNode(),u++)}return Qi.currentNode=ho,i}p(t){let s=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,s),s+=r.strings.length-2):r._$AI(t[s])),s++}}class ld{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,r,i){this.type=2,this._$AH=ln,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=Hc(this,t,s),Fu(t)?t===ln||t==null||t===""?(this._$AH!==ln&&this._$AR(),this._$AH=ln):t!==this._$AH&&t!==po&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):aP(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ln&&Fu(this._$AH)?this._$AA.nextSibling.data=t:this.T(ho.createTextNode(t)),this._$AH=t}$(t){const{values:s,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=lv.createElement(VO(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(s);else{const c=new cP(i,this),u=c.u(this.options);c.p(s),this.T(u),this._$AH=c}}_$AC(t){let s=O_.get(t.strings);return s===void 0&&O_.set(t.strings,s=new lv(t)),s}k(t){jb(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let r,i=0;for(const c of t)i===s.length?s.push(r=new ld(this.O(Gu()),this.O(Gu()),this,this.options)):r=s[i],r._$AI(c),i++;i<s.length&&(this._$AR(r&&r._$AB.nextSibling,i),s.length=i)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){const r=T_(t).nextSibling;T_(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class Lp{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,r,i,c){this.type=1,this._$AH=ln,this._$AN=void 0,this.element=t,this.name=s,this._$AM=i,this.options=c,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ln}_$AI(t,s=this,r,i){const c=this.strings;let u=!1;if(c===void 0)t=Hc(this,t,s,0),u=!Fu(t)||t!==this._$AH&&t!==po,u&&(this._$AH=t);else{const f=t;let p,m;for(t=c[0],p=0;p<c.length-1;p++)m=Hc(this,f[r+p],s,p),m===po&&(m=this._$AH[p]),u||=!Fu(m)||m!==this._$AH[p],m===ln?t=ln:t!==ln&&(t+=(m??"")+c[p+1]),this._$AH[p]=m}u&&!i&&this.j(t)}j(t){t===ln?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}let lP=class extends Lp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ln?void 0:t}};class uP extends Lp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ln)}}let dP=class extends Lp{constructor(t,s,r,i,c){super(t,s,r,i,c),this.type=5}_$AI(t,s=this){if((t=Hc(this,t,s,0)??ln)===po)return;const r=this._$AH,i=t===ln&&r!==ln||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,c=t!==ln&&(r===ln||i);i&&this.element.removeEventListener(this.name,this,r),c&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}};class fP{constructor(t,s,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Hc(this,t)}}const hP=Rb.litHtmlPolyfillSupport;hP?.(lv,ld),(Rb.litHtmlVersions??=[]).push("3.3.3");const pP=(e,t,s)=>{const r=s?.renderBefore??t;let i=r._$litPart$;if(i===void 0){const c=s?.renderBefore??null;r._$litPart$=i=new ld(t.insertBefore(Gu(),c),c,void 0,s??{})}return i._$AI(e),i};const Mb=globalThis;let qn=class extends Tc{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=pP(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return po}};qn._$litElement$=!0,qn.finalized=!0,Mb.litElementHydrateSupport?.({LitElement:qn});const mP=Mb.litElementPolyfillSupport;mP?.({LitElement:qn});(Mb.litElementVersions??=[]).push("4.2.2");const GO=e=>(t,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const gP={attribute:!0,type:String,converter:sp,reflect:!1,hasChanged:Bp},yP=(e=gP,t,s)=>{const{kind:r,metadata:i}=s;let c=globalThis.litPropertyMetadata.get(i);if(c===void 0&&globalThis.litPropertyMetadata.set(i,c=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),c.set(s.name,e),r==="accessor"){const{name:u}=s;return{set(f){const p=t.get.call(this);t.set.call(this,f),this.requestUpdate(u,p,e,!0,f)},init(f){return f!==void 0&&this.C(u,void 0,e,f),f}}}if(r==="setter"){const{name:u}=s;return function(f){const p=this[u];t.call(this,f),this.requestUpdate(u,p,e,!0,f)}}throw Error("Unsupported decorator location: "+r)};function pn(e){return(t,s)=>typeof s=="object"?yP(e,t,s):((r,i,c)=>{const u=i.hasOwnProperty(c);return i.constructor.createProperty(c,r),u?Object.getOwnPropertyDescriptor(i,c):void 0})(e,t,s)}function Db(e){return pn({...e,state:!0,attribute:!1})}const vP=(e,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,s),s);function zp(e,t){return(s,r,i)=>{const c=u=>u.renderRoot?.querySelector(e)??null;return vP(s,r,{get(){return c(this)}})}}var py={},pu={},N_;function bP(){if(N_)return pu;N_=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.StoreController=void 0;let e=class{constructor(s,r){this.host=s,this.atom=r,s.addController(this)}hostConnected(){this.unsubscribe=this.atom.subscribe(()=>{this.host.requestUpdate()})}hostDisconnected(){var s;(s=this.unsubscribe)===null||s===void 0||s.call(this)}get value(){return this.atom.get()}};return pu.StoreController=e,pu}var mu={},x_;function Ub(){if(x_)return mu;x_=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.MultiStoreController=void 0;let e=class{constructor(s,r){this.host=s,this.atoms=r,s.addController(this)}hostConnected(){this.unsubscribes=this.atoms.map(s=>s.subscribe(()=>this.host.requestUpdate()))}hostDisconnected(){var s;(s=this.unsubscribes)===null||s===void 0||s.forEach(r=>r())}get values(){return this.atoms.map(s=>s.get())}};return mu.MultiStoreController=e,mu}var gu={},C_;function wP(){if(C_)return gu;C_=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.useStores=void 0;const e=Ub();function t(...s){return r=>class extends r{constructor(...i){super(...i),new e.MultiStoreController(this,s)}}}return gu.useStores=t,gu}var yu={},I_;function TP(){if(I_)return yu;I_=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.withStores=void 0;const e=Ub(),t=(s,r)=>class extends s{constructor(...c){super(...c),new e.MultiStoreController(this,r)}};return yu.withStores=t,yu}var R_;function EP(){return R_||(R_=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withStores=e.useStores=e.MultiStoreController=e.StoreController=void 0;var t=bP();Object.defineProperty(e,"StoreController",{enumerable:!0,get:function(){return t.StoreController}});var s=Ub();Object.defineProperty(e,"MultiStoreController",{enumerable:!0,get:function(){return s.MultiStoreController}});var r=wP();Object.defineProperty(e,"useStores",{enumerable:!0,get:function(){return r.useStores}});var i=TP();Object.defineProperty(e,"withStores",{enumerable:!0,get:function(){return i.withStores}})})(py)),py}var SP=EP();function $p(e){return class extends e{createRenderRoot(){const t=this.constructor,{registry:s,elementDefinitions:r,shadowRootOptions:i}=t;r&&!s&&(t.registry=new CustomElementRegistry,Object.entries(r).forEach((([u,f])=>t.registry.define(u,f))));const c=this.renderOptions.creationScope=this.attachShadow({...i,customElements:t.registry});return BO(c,this.constructor.elementStyles),c}}}const _P={ATTRIBUTE:1},kP=e=>(...t)=>({_$litDirective$:e,values:t});let AP=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,s,r){this._$Ct=t,this._$AM=s,this._$Ci=r}_$AS(t,s){return this.update(t,s)}update(t,s){return this.render(...s)}};const j_=kP(class extends AP{constructor(e){if(super(e),e.type!==_P.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!this.nt?.has(r)&&this.st.add(r);return this.render(t)}const s=e.element.classList;for(const r of this.st)r in t||(s.remove(r),this.st.delete(r));for(const r in t){const i=!!t[r];i===this.st.has(r)||this.nt?.has(r)||(i?(s.add(r),this.st.add(r)):(s.remove(r),this.st.delete(r)))}return po}}),ap=Math.min,so=Math.max,ip=Math.round,th=Math.floor,ua=e=>({x:e,y:e}),OP={left:"right",right:"left",bottom:"top",top:"bottom"};function NP(e,t,s){return so(e,ap(t,s))}function Vp(e,t){return typeof e=="function"?e(t):e}function qc(e){return e.split("-")[0]}function Pp(e){return e.split("-")[1]}function FO(e){return e==="x"?"y":"x"}function HO(e){return e==="y"?"height":"width"}function ci(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function qO(e){return FO(ci(e))}function xP(e,t,s){s===void 0&&(s=!1);const r=Pp(e),i=qO(e),c=HO(i);let u=i==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=op(u)),[u,op(u)]}function CP(e){const t=op(e);return[uv(e),t,uv(t)]}function uv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const M_=["left","right"],D_=["right","left"],IP=["top","bottom"],RP=["bottom","top"];function jP(e,t,s){switch(e){case"top":case"bottom":return s?t?D_:M_:t?M_:D_;case"left":case"right":return t?IP:RP;default:return[]}}function MP(e,t,s,r){const i=Pp(e);let c=jP(qc(e),s==="start",r);return i&&(c=c.map(u=>u+"-"+i),t&&(c=c.concat(c.map(uv)))),c}function op(e){const t=qc(e);return OP[t]+e.slice(t.length)}function DP(e){var t,s,r,i;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function UP(e){return typeof e!="number"?DP(e):{top:e,right:e,bottom:e,left:e}}function cp(e){const{x:t,y:s,width:r,height:i}=e;return{width:r,height:i,top:s,left:t,right:t+r,bottom:s+i,x:t,y:s}}function U_(e,t,s){let{reference:r,floating:i}=e;const c=ci(t),u=qO(t),f=HO(u),p=qc(t),m=c==="y",g=r.x+r.width/2-i.width/2,y=r.y+r.height/2-i.height/2,b=r[f]/2-i[f]/2;let S;switch(p){case"top":S={x:g,y:r.y-i.height};break;case"bottom":S={x:g,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y};break;case"left":S={x:r.x-i.width,y};break;default:S={x:r.x,y:r.y}}const O=Pp(t);return O&&(S[u]+=b*(O==="end"?1:-1)*(s&&m?-1:1)),S}async function BP(e,t){var s;t===void 0&&(t={});const{x:r,y:i,platform:c,rects:u,elements:f,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:S=0}=Vp(t,e),O=UP(S),R=f[b?y==="floating"?"reference":"floating":y],$=cp(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(R)))==null||s?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:m,rootBoundary:g,strategy:p})),x=y==="floating"?{x:r,y:i,width:u.floating.width,height:u.floating.height}:u.reference,W=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),ce=await(c.isElement==null?void 0:c.isElement(W))&&await(c.getScale==null?void 0:c.getScale(W))||{x:1,y:1},ge=cp(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:x,offsetParent:W,strategy:p}):x);return{top:($.top-ge.top+O.top)/ce.y,bottom:(ge.bottom-$.bottom+O.bottom)/ce.y,left:($.left-ge.left+O.left)/ce.x,right:(ge.right-$.right+O.right)/ce.x}}const LP=50,zP=async(e,t,s)=>{const{placement:r="bottom",strategy:i="absolute",middleware:c=[],platform:u}=s,f=u.detectOverflow?u:{...u,detectOverflow:BP},p=await(u.isRTL==null?void 0:u.isRTL(t));let m=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=U_(m,r,p),b=r,S=0;const O={};for(let C=0;C<c.length;C++){const R=c[C];if(!R)continue;const{name:$,fn:x}=R,{x:W,y:ce,data:ge,reset:F}=await x({x:g,y,initialPlacement:r,placement:b,strategy:i,middlewareData:O,rects:m,platform:f,elements:{reference:e,floating:t}});g=W??g,y=ce??y,O[$]={...O[$],...ge},F&&S<LP&&(S++,typeof F=="object"&&(F.placement&&(b=F.placement),F.rects&&(m=F.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):F.rects),{x:g,y}=U_(m,b,p)),C=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:O}},$P=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,r;const{placement:i,middlewareData:c,rects:u,initialPlacement:f,platform:p,elements:m}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:C=!0,...R}=Vp(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const $=qc(i),x=ci(f),W=qc(f)===f,ce=await(p.isRTL==null?void 0:p.isRTL(m.floating)),ge=b||(W||!C?[op(f)]:CP(f)),F=O!=="none";!b&&F&&ge.push(...MP(f,C,O,ce));const K=[f,...ge],w=await p.detectOverflow(t,R),A=[];let N=((r=c.flip)==null?void 0:r.overflows)||[];if(g&&A.push(w[$]),y){const L=xP(i,u,ce);A.push(w[L[0]],w[L[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(L=>L<=0)){var P,U;const L=(((P=c.flip)==null?void 0:P.index)||0)+1,M=K[L];if(M&&(!(y==="alignment"?x!==ci(M):!1)||N.every(D=>ci(D.placement)===x?D.overflows[0]>0:!0)))return{data:{index:L,overflows:N},reset:{placement:M}};let k=(U=N.filter(j=>j.overflows[0]<=0).sort((j,D)=>j.overflows[1]-D.overflows[1])[0])==null?void 0:U.placement;if(!k)switch(S){case"bestFit":{var q;const j=(q=N.filter(D=>{if(F){const z=ci(D.placement);return z===x||z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(z=>z>0).reduce((z,J)=>z+J,0)]).sort((D,z)=>D[1]-z[1])[0])==null?void 0:q[0];j&&(k=j);break}case"initialPlacement":k=f;break}if(i!==k)return{reset:{placement:k}}}return{}}}},VP=new Set(["left","top"]);async function PP(e,t){const{placement:s,platform:r,elements:i}=e,c=await(r.isRTL==null?void 0:r.isRTL(i.floating)),u=qc(s),f=Pp(s),p=ci(s)==="y",m=VP.has(u)?-1:1,g=c&&p?-1:1,y=Vp(t,e);let{mainAxis:b,crossAxis:S,alignmentAxis:O}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof O=="number"&&(S=f==="end"?O*-1:O),p?{x:S*g,y:b*m}:{x:b*m,y:S*g}}const GP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,r;const{x:i,y:c,placement:u,middlewareData:f}=t,p=await PP(t,e);return u===((s=f.offset)==null?void 0:s.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:i+p.x,y:c+p.y,data:{...p,placement:u}}}}},FP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:r,placement:i,platform:c}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:p={fn:x=>{let{x:W,y:ce}=x;return{x:W,y:ce}}},...m}=Vp(e,t),g={x:s,y:r},y=await c.detectOverflow(t,m),b=ci(i),S=FO(b);let O=g[S],C=g[b];const R=(x,W)=>NP(W+y[x==="y"?"top":"left"],W,W-y[x==="y"?"bottom":"right"]);u&&(O=R(S,O)),f&&(C=R(b,C));const $=p.fn({...t,[S]:O,[b]:C});return{...$,data:{x:$.x-s,y:$.y-r,enabled:{[S]:u,[b]:f}}}}}};function Gp(){return typeof window<"u"}function ol(e){return ZO(e)?(e.nodeName||"").toLowerCase():"#document"}function as(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ya(e){var t;return(t=(ZO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ZO(e){return Gp()?e instanceof Node||e instanceof as(e).Node:!1}function Cr(e){return Gp()?e instanceof Element||e instanceof as(e).Element:!1}function vi(e){return Gp()?e instanceof HTMLElement||e instanceof as(e).HTMLElement:!1}function B_(e){return!Gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof as(e).ShadowRoot}function Fp(e){const{overflow:t,overflowX:s,overflowY:r,display:i}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&i!=="inline"&&i!=="contents"}function HP(e){return/^(table|td|th)$/.test(ol(e))}function Hp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const qP=/transform|translate|scale|rotate|perspective|filter/,ZP=/paint|layout|strict|content/,qi=e=>!!e&&e!=="none";let my;function Bb(e){const t=Cr(e)?Ir(e):e;return qi(t.transform)||qi(t.translate)||qi(t.scale)||qi(t.rotate)||qi(t.perspective)||!Lb()&&(qi(t.backdropFilter)||qi(t.filter))||qP.test(t.willChange||"")||ZP.test(t.contain||"")}function YP(e){let t=mo(e);for(;vi(t)&&!Hu(t);){if(Bb(t))return t;if(Hp(t))return null;t=mo(t)}return null}function Lb(){return my==null&&(my=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),my}function Hu(e){return/^(html|body|#document)$/.test(ol(e))}function Ir(e){return as(e).getComputedStyle(e)}function qp(e){return Cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mo(e){if(ol(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B_(e)&&e.host||ya(e);return B_(t)?t.host:t}function YO(e){const t=mo(e);return Hu(t)?(e.ownerDocument||e).body:vi(t)&&Fp(t)?t:YO(t)}function qu(e,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const i=YO(e),c=i===((r=e.ownerDocument)==null?void 0:r.body),u=as(i);if(c){const f=dv(u);return t.concat(u,u.visualViewport||[],Fp(i)?i:[],f&&s?qu(f):[])}else return t.concat(i,qu(i,[],s))}function dv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WO(e){const t=Ir(e);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vi(e),c=i?e.offsetWidth:s,u=i?e.offsetHeight:r,f=ip(s)!==c||ip(r)!==u;return f&&(s=c,r=u),{width:s,height:r,$:f}}function zb(e){return Cr(e)?e:e.contextElement}function Nc(e){const t=zb(e);if(!vi(t))return ua(1);const s=t.getBoundingClientRect(),{width:r,height:i,$:c}=WO(t);let u=(c?ip(s.width):s.width)/r,f=(c?ip(s.height):s.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const WP=ua(0);function XO(e){const t=as(e);return!Lb()||!t.visualViewport?WP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function XP(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===as(e)}function go(e,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const i=e.getBoundingClientRect(),c=zb(e);let u=ua(1);t&&(r?Cr(r)&&(u=Nc(r)):u=Nc(e));const f=XP(c,s,r)?XO(c):ua(0);let p=(i.left+f.x)/u.x,m=(i.top+f.y)/u.y,g=i.width/u.x,y=i.height/u.y;if(c&&r){const b=as(c),S=Cr(r)?as(r):r;let O=b,C=dv(O);for(;C&&S!==O;){const R=Nc(C),$=C.getBoundingClientRect(),x=Ir(C),W=$.left+(C.clientLeft+parseFloat(x.paddingLeft))*R.x,ce=$.top+(C.clientTop+parseFloat(x.paddingTop))*R.y;p*=R.x,m*=R.y,g*=R.x,y*=R.y,p+=W,m+=ce,O=as(C),C=dv(O)}}return cp({width:g,height:y,x:p,y:m})}function Zp(e,t){const s=qp(e).scrollLeft;return t?t.left+s:go(ya(e)).left+s}function JO(e,t){const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-Zp(e,s),i=s.top+t.scrollTop;return{x:r,y:i}}function JP(e){let{elements:t,rect:s,offsetParent:r,strategy:i}=e;const c=i==="fixed",u=ya(r),f=t?Hp(t.floating):!1;if(r===u||f&&c)return s;let p={scrollLeft:0,scrollTop:0},m=ua(1);const g=ua(0),y=vi(r);if((y||!c)&&((ol(r)!=="body"||Fp(u))&&(p=qp(r)),y)){const S=go(r);m=Nc(r),g.x=S.x+r.clientLeft,g.y=S.y+r.clientTop}const b=u&&!y&&!c?JO(u,p):ua(0);return{width:s.width*m.x,height:s.height*m.y,x:s.x*m.x-p.scrollLeft*m.x+g.x+b.x,y:s.y*m.y-p.scrollTop*m.y+g.y+b.y}}function KP(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function QP(e){const t=qp(e),s=e.ownerDocument.body,r=so(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),i=so(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let c=-t.scrollLeft+Zp(e);const u=-t.scrollTop;return Ir(s).direction==="rtl"&&(c+=so(e.clientWidth,s.clientWidth)-r),{width:r,height:i,x:c,y:u}}const eG=25;function tG(e,t,s){s===void 0&&(s="viewport");const r=s==="layoutViewport",i=as(e),c=ya(e),u=i.visualViewport;let f=c.clientWidth,p=c.clientHeight,m=0,g=0;if(u){const b=!Lb()||t==="fixed";r?b||(m=-u.offsetLeft,g=-u.offsetTop):(f=u.width,p=u.height,b&&(m=u.offsetLeft,g=u.offsetTop))}if(Zp(c)<=0){const b=c.ownerDocument,S=b.body,O=getComputedStyle(S),C=b.compatMode==="CSS1Compat"&&parseFloat(O.marginLeft)+parseFloat(O.marginRight)||0,R=Math.abs(c.clientWidth-S.clientWidth-C),$=getComputedStyle(c).scrollbarGutter==="stable both-edges"?R/2:R;$<=eG&&(f-=$)}return{width:f,height:p,x:m,y:g}}function nG(e,t){const s=go(e,!0,t==="fixed"),r=s.top+e.clientTop,i=s.left+e.clientLeft,c=Nc(e),u=e.clientWidth*c.x,f=e.clientHeight*c.y,p=i*c.x,m=r*c.y;return{width:u,height:f,x:p,y:m}}function L_(e,t,s){let r;if(t==="viewport"||t==="layoutViewport")r=tG(e,s,t);else if(t==="document")r=QP(ya(e));else if(Cr(t))r=nG(t,s);else{const i=XO(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return cp(r)}function sG(e,t){const s=t.get(e);if(s)return s;let r=qu(e,[],!1).filter(f=>Cr(f)&&ol(f)!=="body"),i=null;const c=Ir(e).position==="fixed";let u=c?mo(e):e;for(;Cr(u)&&!Hu(u);){const f=Ir(u),p=Bb(u),m=i?i.position:c?"fixed":"";!p&&(m==="fixed"||m==="absolute"&&f.position==="static")?r=r.filter(y=>y!==u):i=f,u=mo(u)}return t.set(e,r),r}function rG(e){let{element:t,boundary:s,rootBoundary:r,strategy:i}=e;const u=[...s==="clippingAncestors"?Hp(t)?[]:sG(t,this._c):[].concat(s),r],f=L_(t,u[0],i);let p=f.top,m=f.right,g=f.bottom,y=f.left;for(let b=1;b<u.length;b++){const S=L_(t,u[b],i);p=so(S.top,p),m=ap(S.right,m),g=ap(S.bottom,g),y=so(S.left,y)}return{width:m-y,height:g-p,x:y,y:p}}function aG(e){const{width:t,height:s}=WO(e);return{width:t,height:s}}function iG(e,t,s){const r=vi(t),i=ya(t),c=s==="fixed",u=go(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const p=ua(0);if((r||!c)&&((ol(t)!=="body"||Fp(i))&&(f=qp(t)),r)){const b=go(t,!0,c,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}!r&&i&&(p.x=Zp(i));const m=i&&!r&&!c?JO(i,f):ua(0),g=u.left+f.scrollLeft-p.x-m.x,y=u.top+f.scrollTop-p.y-m.y;return{x:g,y,width:u.width,height:u.height}}function gy(e){return Ir(e).position==="static"}function z_(e,t){if(!vi(e)||Ir(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return ya(e)===s&&(s=s.ownerDocument.body),s}function KO(e,t){const s=as(e);if(Hp(e))return s;if(!vi(e)){let i=mo(e);for(;i&&!Hu(i);){if(Cr(i)&&!gy(i))return i;i=mo(i)}return s}let r=z_(e,t);for(;r&&HP(r)&&gy(r);)r=z_(r,t);return r&&Hu(r)&&gy(r)&&!Bb(r)?s:r||YP(e)||s}const oG=async function(e){const t=this.getOffsetParent||KO,s=this.getDimensions,r=await s(e.floating);return{reference:iG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cG(e){return Ir(e).direction==="rtl"}const lG={convertOffsetParentRelativeRectToViewportRelativeRect:JP,getDocumentElement:ya,getClippingRect:rG,getOffsetParent:KO,getElementRects:oG,getClientRects:KP,getDimensions:aG,getScale:Nc,isElement:Cr,isRTL:cG};function QO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uG(e,t,s){let r=null,i;const c=ya(e);function u(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function f(g,y){g===void 0&&(g=!1),y===void 0&&(y=1),u();const b=e.getBoundingClientRect(),{left:S,top:O,width:C,height:R}=b;if(g||t(),!C||!R)return;const $=th(O),x=th(c.clientWidth-(S+C)),W=th(c.clientHeight-(O+R)),ce=th(S),F={rootMargin:-$+"px "+-x+"px "+-W+"px "+-ce+"px",threshold:so(0,ap(1,y))||1};let K=!0;function w(A){const N=A[0].intersectionRatio;if(!QO(b,e.getBoundingClientRect()))return f();if(N!==y){if(!K)return f();N?f(!1,N):i=setTimeout(()=>{f(!1,1e-7)},1e3)}K=!1}try{r=new IntersectionObserver(w,{...F,root:c.ownerDocument})}catch{r=new IntersectionObserver(w,F)}r.observe(e)}const p=as(e),m=()=>f(s);return p.addEventListener("resize",m),f(!0),()=>{p.removeEventListener("resize",m),u()}}function dG(e,t,s,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=r,m=zb(e),g=i||c?[...m?qu(m):[],...t?qu(t):[]]:[];g.forEach($=>{i&&$.addEventListener("scroll",s),c&&$.addEventListener("resize",s)});const y=m&&f?uG(m,s,c):null;let b=-1,S=null;u&&(S=new ResizeObserver($=>{let[x]=$;x&&x.target===m&&S&&t&&(S.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var W;(W=S)==null||W.observe(t)})),s()}),m&&!p&&S.observe(m),t&&S.observe(t));let O,C=p?go(e):null;p&&R();function R(){const $=go(e);C&&!QO(C,$)&&s(),C=$,O=requestAnimationFrame(R)}return s(),()=>{var $;g.forEach(x=>{i&&x.removeEventListener("scroll",s),c&&x.removeEventListener("resize",s)}),y?.(),($=S)==null||$.disconnect(),S=null,p&&cancelAnimationFrame(O)}}const fG=GP,hG=FP,pG=$P,mG=(e,t,s)=>{const r=new Map,i=s??{},c={...lG,...i.platform,_c:r};return zP(e,t,{...i,platform:c})};function fv(e,t,s){return e?t(e):s?.(e)}const gG=Symbol();let e3=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);const i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??yG,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;const t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){const t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t)}async run(t){let s,r;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();const i=++this.p;this.q=new AbortController;let c=!1;try{s=await this.v(t,{signal:this.q.signal})}catch(u){c=!0,r=u}if(this.p===i){if(s===gG)this.i=0;else{if(c===!1){try{this.k?.(s)}catch{}this.i=2,this.o?.(s)}else{try{this.A?.(r)}catch{}this.i=3,this.h?.(r)}this.u=s,this.l=r}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}};const yG=(e,t)=>e===t||e.length===t.length&&e.every(((s,r)=>!Bp(s,t[r])));function t3(){return function(e,t){const s=Symbol(),r=Symbol();Object.defineProperty(e,t,{get(){return this[r]},set(i){const c=this[r];if(c===i)return;this[r]=i;const u=this[s];u&&(u.hostDisconnected(),this.removeController(u));const f=i?new SP.MultiStoreController(this,Object.values(i.stores)):void 0;this[s]=f,u&&!f&&this.requestUpdate(t,c)},configurable:!0,enumerable:!0})}}const vG=ga`
|
|
15
|
-
* {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
-webkit-font-smoothing: antialiased;
|
|
18
|
-
font-family: var(--dapp-kit-font-sans);
|
|
19
|
-
outline-color: color-mix(in oklab, var(--dapp-kit-ring) 50%, transparent);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
button {
|
|
23
|
-
appearance: none;
|
|
24
|
-
background-color: transparent;
|
|
25
|
-
font-size: inherit;
|
|
26
|
-
font-family: inherit;
|
|
27
|
-
line-height: inherit;
|
|
28
|
-
letter-spacing: inherit;
|
|
29
|
-
color: inherit;
|
|
30
|
-
border: 0;
|
|
31
|
-
padding: 0;
|
|
32
|
-
margin: 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
ul {
|
|
36
|
-
list-style: none;
|
|
37
|
-
margin: 0;
|
|
38
|
-
padding: 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
p,
|
|
42
|
-
h1,
|
|
43
|
-
h2,
|
|
44
|
-
h3,
|
|
45
|
-
h4,
|
|
46
|
-
h5,
|
|
47
|
-
h6 {
|
|
48
|
-
font-size: inherit;
|
|
49
|
-
font-weight: inherit;
|
|
50
|
-
color: var(--dapp-kit-foreground);
|
|
51
|
-
margin: 0;
|
|
52
|
-
}
|
|
53
|
-
`,bG=ga`
|
|
54
|
-
:host {
|
|
55
|
-
/** Colors */
|
|
56
|
-
--dapp-kit-background: var(--background, oklch(1 0 0));
|
|
57
|
-
--dapp-kit-foreground: var(--foreground, oklch(0.145 0 0));
|
|
58
|
-
--dapp-kit-primary: var(--primary, oklch(0.216 0.006 56.043));
|
|
59
|
-
--dapp-kit-primary-foreground: var(--primary-foreground, oklch(0.985 0.001 106.423));
|
|
60
|
-
--dapp-kit-secondary: var(--secondary, oklch(0.97 0.001 106.424));
|
|
61
|
-
--dapp-kit-secondary-foreground: var(--secondary-foreground, oklch(0.216 0.006 56.043));
|
|
62
|
-
--dapp-kit-border: var(--border, oklch(0.922 0 0));
|
|
63
|
-
--dapp-kit-accent: var(--accent, oklch(0.97 0.001 106.424));
|
|
64
|
-
--dapp-kit-accent-foreground: var(--accent-foreground, oklch(0.205 0 0));
|
|
65
|
-
--dapp-kit-muted: var(--muted, oklch(0.97 0.001 106.424));
|
|
66
|
-
--dapp-kit-muted-foreground: var(--muted-foreground, oklch(0.553 0.013 58.071));
|
|
67
|
-
--dapp-kit-popover: var(--popover, oklch(1 0 0));
|
|
68
|
-
--dapp-kit-popover-foreground: var(--popover-foreground, oklch(0.145 0 0));
|
|
69
|
-
--dapp-kit-destructive: var(--destructive, oklch(0.577 0.245 27.325));
|
|
70
|
-
--dapp-kit-positive: var(--positive, oklch(0.862 0.127 146.2));
|
|
71
|
-
--dapp-kit-ring: var(--ring, oklch(0.708 0 0));
|
|
72
|
-
--dapp-kit-input: var(--input, oklch(0.922 0 0));
|
|
73
|
-
|
|
74
|
-
/** Radii */
|
|
75
|
-
--dapp-kit-radius: var(--radius, 12px);
|
|
76
|
-
--dapp-kit-radius-xs: calc(var(--dapp-kit-radius) - 4px);
|
|
77
|
-
--dapp-kit-radius-sm: calc(var(--dapp-kit-radius) - 4px);
|
|
78
|
-
--dapp-kit-radius-md: calc(var(--dapp-kit-radius) - 2px);
|
|
79
|
-
--dapp-kit-radius-lg: var(--dapp-kit-radius);
|
|
80
|
-
--dapp-kit-radius-xl: calc(var(--dapp-kit-radius) + 4px);
|
|
81
|
-
|
|
82
|
-
/** Typography */
|
|
83
|
-
--dapp-kit-font-sans: var(
|
|
84
|
-
--font-sans,
|
|
85
|
-
ui-sans-serif,
|
|
86
|
-
system-ui,
|
|
87
|
-
-apple-system,
|
|
88
|
-
BlinkMacSystemFont,
|
|
89
|
-
'Segoe UI',
|
|
90
|
-
Roboto,
|
|
91
|
-
'Helvetica Neue',
|
|
92
|
-
Arial,
|
|
93
|
-
'Noto Sans',
|
|
94
|
-
sans-serif,
|
|
95
|
-
'Apple Color Emoji',
|
|
96
|
-
'Segoe UI Emoji',
|
|
97
|
-
'Segoe UI Symbol',
|
|
98
|
-
'Noto Color Emoji'
|
|
99
|
-
);
|
|
100
|
-
--dapp-kit-font-weight-medium: var(--font-medium, 500);
|
|
101
|
-
--dapp-kit-font-weight-semibold: var(--font-semibold, 600);
|
|
102
|
-
|
|
103
|
-
/** Cursors */
|
|
104
|
-
--dapp-kit-cursor-button: var(--cursor-button, default);
|
|
105
|
-
--dapp-kit-cursor-menu-item: var(--cursor-menu-item, default);
|
|
106
|
-
--dapp-kit-cursor-radio: var(--cursor-radio, default);
|
|
107
|
-
--dapp-kit-cursor-disabled: var(--cursor-disabled, not-allowed);
|
|
108
|
-
}
|
|
109
|
-
`,To=[bG,vG],wG=[To,ga`
|
|
110
|
-
.wallet-button {
|
|
111
|
-
transition-property: background-color;
|
|
112
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
113
|
-
transition-duration: 0.15s;
|
|
114
|
-
text-decoration: none;
|
|
115
|
-
background-color: var(--dapp-kit-secondary);
|
|
116
|
-
border-radius: var(--dapp-kit-radius-lg);
|
|
117
|
-
display: flex;
|
|
118
|
-
align-items: center;
|
|
119
|
-
gap: 12px;
|
|
120
|
-
width: 100%;
|
|
121
|
-
padding: 12px;
|
|
122
|
-
cursor: var(--dapp-kit-cursor-menu-item);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.wallet-button:hover {
|
|
126
|
-
background-color: oklab(from var(--dapp-kit-secondary) calc(l - 0.01) a b);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
img {
|
|
130
|
-
width: 32px;
|
|
131
|
-
height: 32px;
|
|
132
|
-
border-radius: var(--dapp-kit-radius-lg);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
p {
|
|
136
|
-
overflow: hidden;
|
|
137
|
-
white-space: nowrap;
|
|
138
|
-
text-overflow: ellipsis;
|
|
139
|
-
font-weight: var(--dapp-kit-font-weight-medium);
|
|
140
|
-
}
|
|
141
|
-
`];function _t(e,t,s,r){var i=arguments.length,c=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,s):r,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,s,r);else for(var f=e.length-1;f>=0;f--)(u=e[f])&&(c=(i<3?u(c):i>3?u(t,s,c):u(t,s))||c);return i>3&&c&&Object.defineProperty(t,s,c),c}var vp,n3,jc,$b=(jc=class extends qn{constructor(...s){super(...s);Gn(this,vp);this.autofocus=!1}render(){return bt`
|
|
142
|
-
<li>
|
|
143
|
-
<button
|
|
144
|
-
type="button"
|
|
145
|
-
class="wallet-button"
|
|
146
|
-
@click=${rn(this,vp,n3)}
|
|
147
|
-
?autofocus=${this.autofocus}
|
|
148
|
-
>
|
|
149
|
-
<img src=${this.wallet.icon} alt=${`${this.wallet.name} logo`} />
|
|
150
|
-
<p>${this.wallet.name}</p>
|
|
151
|
-
</button>
|
|
152
|
-
</li>
|
|
153
|
-
`}},vp=new WeakSet,n3=function(){this.dispatchEvent(new CustomEvent("wallet-selected",{detail:{wallet:this.wallet},bubbles:!0,composed:!0}))},jc.styles=wG,jc);_t([pn()],$b.prototype,"wallet",void 0);_t([pn({type:Boolean,reflect:!0})],$b.prototype,"autofocus",void 0);const TG=[To,ga`
|
|
154
|
-
:host {
|
|
155
|
-
display: flex;
|
|
156
|
-
flex-direction: column;
|
|
157
|
-
flex-grow: 1;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
ul {
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
gap: 12px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.no-wallets-container {
|
|
167
|
-
display: flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
flex-grow: 1;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.no-wallets-content {
|
|
173
|
-
display: flex;
|
|
174
|
-
flex-direction: column;
|
|
175
|
-
align-items: center;
|
|
176
|
-
justify-content: center;
|
|
177
|
-
flex-grow: 1;
|
|
178
|
-
gap: 32px;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.title {
|
|
182
|
-
font-weight: var(--dapp-kit-font-weight-semibold);
|
|
183
|
-
text-align: center;
|
|
184
|
-
font-size: 28px;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.wallet-cta {
|
|
188
|
-
display: flex;
|
|
189
|
-
flex-direction: column;
|
|
190
|
-
width: 100%;
|
|
191
|
-
}
|
|
192
|
-
`],EG=[To,ga`
|
|
193
|
-
.button {
|
|
194
|
-
transition-property: background-color;
|
|
195
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
196
|
-
transition-duration: 0.15s;
|
|
197
|
-
border-radius: var(--dapp-kit-radius-md);
|
|
198
|
-
font-weight: var(--dapp-kit-font-weight-semibold);
|
|
199
|
-
text-decoration: none;
|
|
200
|
-
outline-style: none;
|
|
201
|
-
display: inline-flex;
|
|
202
|
-
justify-content: center;
|
|
203
|
-
align-items: center;
|
|
204
|
-
gap: 12px;
|
|
205
|
-
padding-left: 16px;
|
|
206
|
-
padding-right: 16px;
|
|
207
|
-
padding-top: 8px;
|
|
208
|
-
padding-bottom: 8px;
|
|
209
|
-
height: 40px;
|
|
210
|
-
cursor: var(--dapp-kit-cursor-button);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.button:disabled {
|
|
214
|
-
cursor: var(--dapp-kit-cursor-disabled);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.button:focus-visible {
|
|
218
|
-
border-color: var(--dapp-kit-ring);
|
|
219
|
-
box-shadow:
|
|
220
|
-
0 0 0 3px color-mix(in oklab, var(--dapp-kit-ring) 50%, transparent),
|
|
221
|
-
rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.button.primary {
|
|
225
|
-
background-color: var(--dapp-kit-primary);
|
|
226
|
-
color: var(--dapp-kit-primary-foreground);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.button.primary:hover:not(:disabled) {
|
|
230
|
-
background-color: color-mix(in oklab, var(--dapp-kit-primary) 90%, transparent);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.button.secondary {
|
|
234
|
-
background-color: var(--dapp-kit-secondary);
|
|
235
|
-
color: var(--dapp-kit-secondary-foreground);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.button.secondary:hover:not(:disabled) {
|
|
239
|
-
background-color: color-mix(in oklab, var(--dapp-kit-secondary) 80%, transparent);
|
|
240
|
-
}
|
|
241
|
-
`];var ro,Eo=(ro=class extends qn{constructor(...t){super(...t),this.variant="primary",this.href="",this.disabled=!1}render(){return this.href?bt`
|
|
242
|
-
<a
|
|
243
|
-
part="trigger"
|
|
244
|
-
href=${this.href}
|
|
245
|
-
?disabled=${this.disabled}
|
|
246
|
-
target="_blank"
|
|
247
|
-
rel="noreferrer"
|
|
248
|
-
class=${j_({button:!0,[this.variant]:!0})}
|
|
249
|
-
>
|
|
250
|
-
<slot part="button-content"></slot>
|
|
251
|
-
</a>
|
|
252
|
-
`:bt`
|
|
253
|
-
<button
|
|
254
|
-
part="trigger"
|
|
255
|
-
type="button"
|
|
256
|
-
?disabled=${this.disabled}
|
|
257
|
-
class=${j_({button:!0,[this.variant]:!0})}
|
|
258
|
-
>
|
|
259
|
-
<slot part="button-content"></slot>
|
|
260
|
-
</button>
|
|
261
|
-
`}},ro.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},ro.styles=EG,ro);_t([pn({type:String})],Eo.prototype,"variant",void 0);_t([pn({type:String})],Eo.prototype,"href",void 0);_t([pn({type:Boolean,reflect:!0})],Eo.prototype,"disabled",void 0);const SG=bt`<svg
|
|
262
|
-
width="80"
|
|
263
|
-
height="80"
|
|
264
|
-
viewBox="0 0 80 80"
|
|
265
|
-
fill="none"
|
|
266
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
267
|
-
>
|
|
268
|
-
<path
|
|
269
|
-
d="M0 40C0 17.9086 17.9086 0 40 0C62.0914 0 80 17.9086 80 40C80 62.0914 62.0914 80 40 80C17.9086 80 0 62.0914 0 40Z"
|
|
270
|
-
fill="currentColor"
|
|
271
|
-
fill-opacity="0.08"
|
|
272
|
-
/>
|
|
273
|
-
<path
|
|
274
|
-
fill-rule="evenodd"
|
|
275
|
-
clip-rule="evenodd"
|
|
276
|
-
d="M39.6881 28.8311C39.4347 28.9111 39.1675 29.1669 39.0607 29.4318L39.0041 29.572L38.9977 35.5349L38.9914 41.4978L37.8217 40.3324C36.5477 39.063 36.5486 39.0637 36.228 39.0138C35.7909 38.9458 35.3452 39.1858 35.1541 39.592C35.0986 39.7101 35.0921 39.7532 35.0921 40C35.0921 40.4608 34.9004 40.2321 37.3099 42.6471C39.1553 44.4968 39.4299 44.763 39.5579 44.8263C39.8344 44.9632 40.1614 44.9624 40.4441 44.8244C40.5705 44.7626 40.843 44.4987 42.679 42.659C45.0881 40.2451 44.9081 40.4599 44.9081 40C44.9081 39.7458 44.9027 39.7132 44.8403 39.586C44.6384 39.1748 44.2051 38.9438 43.7678 39.0142C43.4501 39.0654 43.4497 39.0657 42.1784 40.3324L41.0087 41.4978L41.0024 35.5349L40.9961 29.572L40.9395 29.4318C40.8294 29.1587 40.5615 28.9075 40.2964 28.8288C40.1444 28.7836 39.8347 28.7848 39.6881 28.8311ZM31.114 46.0981C30.9593 46.1346 30.7812 46.2398 30.647 46.374C30.4216 46.5994 30.3357 46.8708 30.3627 47.272C30.3949 47.7507 30.4603 48.0732 30.6081 48.484C31.0707 49.7693 32.1522 50.7474 33.4841 51.0852C33.9919 51.2141 33.6619 51.2078 39.9943 51.2079C46.331 51.208 46.0036 51.2142 46.5161 51.085C47.8428 50.7503 48.9303 49.7668 49.392 48.484C49.5851 47.9478 49.6896 47.2429 49.6266 46.9026C49.5428 46.4495 49.1756 46.1129 48.7285 46.0791C48.3302 46.0489 47.9715 46.2363 47.7705 46.5793C47.687 46.7218 47.6625 46.8267 47.6335 47.1663C47.5846 47.7384 47.4064 48.16 47.0574 48.5289C46.6981 48.9088 46.2476 49.1338 45.7272 49.1934C45.5791 49.2103 43.6721 49.2161 39.8441 49.2112L34.1801 49.204L33.9966 49.1516C33.5867 49.0347 33.3159 48.8845 33.0317 48.6166C32.6281 48.2363 32.4192 47.7806 32.3667 47.1663C32.3377 46.8267 32.3132 46.7218 32.2297 46.5793C32.1479 46.4397 31.9572 46.2518 31.8327 46.1882C31.6225 46.0807 31.3388 46.0451 31.114 46.0981Z"
|
|
277
|
-
fill="currentColor"
|
|
278
|
-
/>
|
|
279
|
-
</svg>`,_G=bt`<svg
|
|
280
|
-
width="17"
|
|
281
|
-
height="16"
|
|
282
|
-
viewBox="0 0 17 16"
|
|
283
|
-
fill="none"
|
|
284
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
285
|
-
>
|
|
286
|
-
<path
|
|
287
|
-
fill-rule="evenodd"
|
|
288
|
-
clip-rule="evenodd"
|
|
289
|
-
d="M4.19888 1.05645C4.0026 1.08501 3.7911 1.24624 3.706 1.43215C3.62348 1.61237 3.62622 1.84103 3.71297 2.01403C3.79982 2.18722 3.99089 2.3325 4.17827 2.36781C4.23528 2.37855 5.77091 2.38405 8.71417 2.38405H13.1639L7.41745 8.13205C2.23561 13.3153 1.66614 13.8898 1.62155 13.9796C1.48908 14.2462 1.5436 14.5657 1.75579 14.7664C1.95884 14.9584 2.23582 15.003 2.50305 14.8868C2.59953 14.8449 2.8643 14.5828 8.36009 9.0896L14.1161 3.33629V7.78598C14.1161 10.7292 14.1216 12.2649 14.1323 12.3219C14.1819 12.5852 14.4093 12.8046 14.6761 12.8467C15.0449 12.9048 15.3918 12.6521 15.4446 12.2868C15.4668 12.1329 15.465 1.71239 15.4427 1.59173C15.3934 1.32528 15.1749 1.10672 14.9084 1.05746C14.7978 1.03703 4.33916 1.03603 4.19888 1.05645Z"
|
|
290
|
-
fill="currentColor"
|
|
291
|
-
/>
|
|
292
|
-
</svg> `;var ao,s3=(ao=class extends $p(qn){constructor(...t){super(...t),this.wallets=[]}render(){return this.wallets.length===0?bt`<div class="no-wallets-container">
|
|
293
|
-
<div class="no-wallets-content">
|
|
294
|
-
${SG}
|
|
295
|
-
<h2 class="title">Install a wallet to get started on Sui</h2>
|
|
296
|
-
</div>
|
|
297
|
-
<internal-button class="wallet-cta" href="https://sui.io/get-started">
|
|
298
|
-
Select a wallet to install ${_G}
|
|
299
|
-
</internal-button>
|
|
300
|
-
</div>`:bt`<ul class="wallet-list">
|
|
301
|
-
${this.wallets.map((t,s)=>bt`<wallet-list-item
|
|
302
|
-
.wallet=${t}
|
|
303
|
-
?autofocus=${s===0}
|
|
304
|
-
></wallet-list-item>`)}
|
|
305
|
-
</ul>`}},ao.elementDefinitions={"wallet-list-item":$b,"internal-button":Eo},ao.styles=TG,ao);_t([pn({type:Object})],s3.prototype,"wallets",void 0);var eo,wr,Mc,ai,Dc,Uc,Vb=(Uc=class extends qn{constructor(){super(...arguments);Gn(this,eo,!1);Gn(this,wr,!1);Gn(this,Mc,N4());Gn(this,ai);Gn(this,Dc,!1)}get open(){return Gt(this,eo)}set open(s){s!==Gt(this,eo)&&(Fn(this,eo,s),Gt(this,eo)?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}async show(){if(Fn(this,wr,!0),await Gt(this,Mc).promise,await this.updateComplete,this._dialog.open||!Gt(this,wr)){Fn(this,wr,!1);return}if(!this.dispatchEvent(new Event("open",{cancelable:!0}))){this.open=!1,Fn(this,wr,!1);return}this._dialog.showModal(),this.open=!0,this.dispatchEvent(new Event("opened")),Fn(this,wr,!1)}async close(s=Gt(this,ai)){if(Fn(this,wr,!1),!this.isConnected){this.open=!1;return}if(await this.updateComplete,!this._dialog.open||Gt(this,wr)){this.open=!1;return}const r=Gt(this,ai);if(Fn(this,ai,s),!this.dispatchEvent(new Event("close",{cancelable:!0}))){Fn(this,ai,r);return}this._dialog.close(Gt(this,ai)),this.open=!1,this.dispatchEvent(new Event("closed"))}connectedCallback(){super.connectedCallback(),Gt(this,Mc).resolve()}disconnectedCallback(){super.disconnectedCallback(),Fn(this,Mc,Promise.withResolvers())}handleContentClick(){Fn(this,Dc,!0)}handleDialogClick(){if(Gt(this,Dc)){Fn(this,Dc,!1);return}this.dispatchEvent(new Event("cancel",{cancelable:!0}))&&this.close()}},eo=new WeakMap,wr=new WeakMap,Mc=new WeakMap,ai=new WeakMap,Dc=new WeakMap,Uc.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},Uc);_t([pn({type:Boolean})],Vb.prototype,"open",null);_t([zp("dialog")],Vb.prototype,"_dialog",void 0);const kG=bt`<svg
|
|
306
|
-
width="16"
|
|
307
|
-
height="16"
|
|
308
|
-
viewBox="0 0 16 16"
|
|
309
|
-
fill="currentColor"
|
|
310
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
311
|
-
>
|
|
312
|
-
<path
|
|
313
|
-
fill-rule="evenodd"
|
|
314
|
-
clip-rule="evenodd"
|
|
315
|
-
d="M2.04841 1.59812C2.00001 1.61375 1.93695 1.63878 1.90828 1.65375C1.83709 1.69091 1.68775 1.84287 1.65047 1.91606C1.54047 2.13201 1.54381 2.37028 1.6597 2.57601C1.68564 2.62206 2.66404 3.61254 4.37417 5.32401L7.04809 8.00001L4.37417 10.676C2.67052 12.381 1.68551 13.3781 1.65959 13.424C1.49234 13.7201 1.56607 14.0843 1.83583 14.2945C2.04141 14.4547 2.34161 14.4734 2.57641 14.3408C2.62228 14.3149 3.61943 13.3299 5.32441 11.6262L8.00041 8.95233L10.6764 11.6262C12.3814 13.3299 13.3785 14.3149 13.4244 14.3408C13.6592 14.4734 13.9594 14.4547 14.165 14.2945C14.4347 14.0843 14.5085 13.7201 14.3412 13.424C14.3153 13.3781 13.3303 12.381 11.6266 10.676L8.95273 8.00001L11.6266 5.32401C13.3303 3.61903 14.3153 2.62188 14.3412 2.57601C14.4738 2.34121 14.4551 2.04102 14.2949 1.83543C14.0847 1.56567 13.7205 1.49195 13.4244 1.65919C13.3785 1.68511 12.3814 2.67012 10.6764 4.37377L8.00041 7.04769L5.32441 4.37377C3.61293 2.66364 2.62245 1.68524 2.57641 1.65931C2.41372 1.56766 2.21439 1.54457 2.04841 1.59812Z"
|
|
316
|
-
/>
|
|
317
|
-
</svg> `,AG=bt`<svg
|
|
318
|
-
width="15"
|
|
319
|
-
height="16"
|
|
320
|
-
viewBox="0 0 15 16"
|
|
321
|
-
fill="none"
|
|
322
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
323
|
-
>
|
|
324
|
-
<path
|
|
325
|
-
fill-rule="evenodd"
|
|
326
|
-
clip-rule="evenodd"
|
|
327
|
-
d="M6.90786 1.05824C6.70479 1.08877 6.91965 0.871204 3.62561 4.38197C0.943351 7.24072 0.593731 7.6189 0.554431 7.70397C0.501166 7.81932 0.480376 7.96424 0.497641 8.09997C0.525721 8.32084 0.315931 8.08477 3.59808 11.5887C5.25324 13.3557 6.6377 14.8229 6.67466 14.8493C6.76715 14.9153 6.88374 14.9481 7.01883 14.9464C7.19993 14.9441 7.32822 14.8862 7.45368 14.7503C7.6404 14.5479 7.68581 14.2362 7.56597 13.9793C7.53443 13.9117 7.06523 13.403 5.08008 11.2841L2.63307 8.67231L8.31776 8.66796C13.6185 8.66392 14.0073 8.6618 14.0739 8.63648C14.173 8.59888 14.3009 8.50512 14.3625 8.425C14.5276 8.21008 14.553 7.89213 14.4239 7.65714C14.3438 7.51138 14.1733 7.38224 14.013 7.34596C13.9549 7.33282 12.4096 7.32797 8.28312 7.32797H2.63276L5.07993 4.71597C7.0652 2.59698 7.53443 2.08824 7.56597 2.02063C7.68584 1.76365 7.6404 1.452 7.45358 1.24956C7.30854 1.09239 7.1201 1.02632 6.90786 1.05824Z"
|
|
328
|
-
fill="currentColor"
|
|
329
|
-
/>
|
|
330
|
-
</svg> `,OG=[To,ga`
|
|
331
|
-
:host {
|
|
332
|
-
display: flex;
|
|
333
|
-
flex-direction: column;
|
|
334
|
-
align-items: center;
|
|
335
|
-
text-align: center;
|
|
336
|
-
flex-grow: 1;
|
|
337
|
-
gap: 40px;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.logo {
|
|
341
|
-
width: 120px;
|
|
342
|
-
height: 120px;
|
|
343
|
-
border-radius: var(--dapp-kit-radius-lg);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.container {
|
|
347
|
-
display: flex;
|
|
348
|
-
flex-direction: column;
|
|
349
|
-
flex-grow: 1;
|
|
350
|
-
gap: 12px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.title {
|
|
354
|
-
font-size: 24px;
|
|
355
|
-
font-weight: var(--dapp-kit-font-weight-medium);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.copy {
|
|
359
|
-
color: var(--dapp-kit-muted-foreground);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
::slotted(*) {
|
|
363
|
-
display: flex;
|
|
364
|
-
flex-direction: column;
|
|
365
|
-
width: 100%;
|
|
366
|
-
}
|
|
367
|
-
`];var Bc,Yp=(Bc=class extends qn{constructor(...t){super(...t),this.title="",this.copy=""}render(){return bt`
|
|
368
|
-
<img class="logo" src=${this.wallet.icon} alt=${`${this.wallet.name} logo`} />
|
|
369
|
-
<div class="container">
|
|
370
|
-
<h3 class="title">${this.title}</h3>
|
|
371
|
-
<p class="copy">${this.copy}</p>
|
|
372
|
-
</div>
|
|
373
|
-
<slot name="call-to-action"></slot>
|
|
374
|
-
`}},Bc.styles=OG,Bc);_t([pn({type:Object})],Yp.prototype,"wallet",void 0);_t([pn({type:String})],Yp.prototype,"title",void 0);_t([pn({type:String})],Yp.prototype,"copy",void 0);const NG=[To,ga`
|
|
375
|
-
dialog {
|
|
376
|
-
width: 360px;
|
|
377
|
-
height: 480px;
|
|
378
|
-
border: 1px solid var(--dapp-kit-border);
|
|
379
|
-
padding: 0;
|
|
380
|
-
background: var(--dapp-kit-background);
|
|
381
|
-
border-radius: var(--dapp-kit-radius-lg);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.content {
|
|
385
|
-
display: flex;
|
|
386
|
-
flex-direction: column;
|
|
387
|
-
height: 100%;
|
|
388
|
-
gap: 32px;
|
|
389
|
-
padding: 24px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.connect-header {
|
|
393
|
-
display: flex;
|
|
394
|
-
justify-content: space-between;
|
|
395
|
-
align-items: center;
|
|
396
|
-
gap: 8px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.title {
|
|
400
|
-
font-size: 18px;
|
|
401
|
-
font-weight: var(--dapp-kit-font-weight-semibold);
|
|
402
|
-
white-space: nowrap;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.close-button {
|
|
406
|
-
margin-left: auto;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.cancel-button {
|
|
410
|
-
margin-top: auto;
|
|
411
|
-
}
|
|
412
|
-
`],r3=ga`
|
|
413
|
-
.icon-button {
|
|
414
|
-
width: 32px;
|
|
415
|
-
height: 32px;
|
|
416
|
-
border-radius: 50%;
|
|
417
|
-
background: inherit;
|
|
418
|
-
color: var(--dapp-kit-foreground);
|
|
419
|
-
display: inline-flex;
|
|
420
|
-
align-items: center;
|
|
421
|
-
justify-content: center;
|
|
422
|
-
cursor: var(--dapp-kit-cursor-button);
|
|
423
|
-
transition:
|
|
424
|
-
background-color 200ms,
|
|
425
|
-
transform 100ms;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.icon-button:hover {
|
|
429
|
-
background-color: var(--dapp-kit-accent);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
.icon-button:active {
|
|
433
|
-
transform: scale(0.9);
|
|
434
|
-
}
|
|
435
|
-
`;var Lc,bs,a3,hv,Ah,i3,io;let pi=(io=class extends $p(Vb){constructor(...s){super(...s);Gn(this,bs);Gn(this,Lc);this._state={view:"wallet-selection"}}render(){const s=this._state.view==="connecting"||this._state.view==="error",r=rn(this,bs,i3).call(this);return bt`<dialog @click=${this.handleDialogClick} @close=${rn(this,bs,Ah)}>
|
|
436
|
-
<div class="content" @click=${this.handleContentClick}>
|
|
437
|
-
<div class="connect-header">
|
|
438
|
-
${s?bt`<button
|
|
439
|
-
class="icon-button back-button"
|
|
440
|
-
aria-label="Go back"
|
|
441
|
-
@click=${rn(this,bs,Ah)}
|
|
442
|
-
>
|
|
443
|
-
${AG}
|
|
444
|
-
</button>`:ln}
|
|
445
|
-
<h2 class="title">${r.length>0?"Connect a wallet":"No wallets installed"}</h2>
|
|
446
|
-
<button
|
|
447
|
-
class="icon-button close-button"
|
|
448
|
-
aria-label="Close"
|
|
449
|
-
@click=${()=>{this.close("cancel")}}
|
|
450
|
-
>
|
|
451
|
-
${kG}
|
|
452
|
-
</button>
|
|
453
|
-
</div>
|
|
454
|
-
${rn(this,bs,a3).call(this,r)}
|
|
455
|
-
</div>
|
|
456
|
-
</dialog>`}},Lc=new WeakMap,bs=new WeakSet,a3=function(s){switch(this._state.view){case"wallet-selection":return bt`<wallet-list
|
|
457
|
-
.wallets=${s}
|
|
458
|
-
@wallet-selected=${async u=>{rn(this,bs,hv).call(this,u.detail.wallet)}}
|
|
459
|
-
></wallet-list>`;case"connecting":return bt`<connection-status
|
|
460
|
-
.title=${"Awaiting connection..."}
|
|
461
|
-
.copy=${`Accept the request from ${this._state.wallet.name} in order to proceed`}
|
|
462
|
-
.wallet=${this._state.wallet}
|
|
463
|
-
>
|
|
464
|
-
<internal-button
|
|
465
|
-
slot="call-to-action"
|
|
466
|
-
.variant=${"secondary"}
|
|
467
|
-
@click=${rn(this,bs,Ah)}
|
|
468
|
-
>
|
|
469
|
-
Cancel
|
|
470
|
-
</internal-button>
|
|
471
|
-
</connection-status>`;case"error":const{wallet:r,error:i}=this._state,c=nj(i,W5);return bt`<connection-status
|
|
472
|
-
.title=${c?"Request canceled":"Connection failed"}
|
|
473
|
-
.copy=${c?"You canceled the request":"Something went wrong. Please try again"}
|
|
474
|
-
.wallet=${r}
|
|
475
|
-
>
|
|
476
|
-
<internal-button
|
|
477
|
-
slot="call-to-action"
|
|
478
|
-
@click=${()=>{rn(this,bs,hv).call(this,r)}}
|
|
479
|
-
>
|
|
480
|
-
Retry
|
|
481
|
-
</internal-button>
|
|
482
|
-
</connection-status>`;default:throw new Error(`Encountered unknown view state: ${this._state}`)}},hv=async function(s){let r;try{const i=new Promise((c,u)=>{Fn(this,Lc,new AbortController),Gt(this,Lc).signal.addEventListener("abort",()=>u(new DOMException("Aborted","AbortError")),{once:!0})});r=setTimeout(()=>{this._state={view:"connecting",wallet:s}},100),await Promise.race([i,this.instance.connectWallet({wallet:s})]),this.close("successful-connection")}catch(i){i instanceof Error&&i.name==="AbortError"?this._state={view:"wallet-selection"}:this._state={view:"error",wallet:s,error:i}}finally{clearTimeout(r)}},Ah=function(){this._state.view==="connecting"?Gt(this,Lc)?.abort("cancelled"):this._state={view:"wallet-selection"}},i3=function(){const s=this.instance.stores.$wallets.get(),r=this.filterFn?s.filter(this.filterFn):s;return this.sortFn?r.toSorted(this.sortFn):r},io.styles=[NG,r3],io.elementDefinitions={"wallet-list":s3,"internal-button":Eo,"connection-status":Yp},io);_t([t3()],pi.prototype,"instance",void 0);_t([Db()],pi.prototype,"_state",void 0);_t([pn({attribute:!1})],pi.prototype,"filterFn",void 0);_t([pn({attribute:!1})],pi.prototype,"sortFn",void 0);pi=_t([GO("mysten-dapp-kit-connect-modal")],pi);const xG=bt`<svg
|
|
483
|
-
width="17"
|
|
484
|
-
height="16"
|
|
485
|
-
viewBox="0 0 17 16"
|
|
486
|
-
fill="currentColor"
|
|
487
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
488
|
-
>
|
|
489
|
-
<path
|
|
490
|
-
fill-rule="evenodd"
|
|
491
|
-
clip-rule="evenodd"
|
|
492
|
-
d="M11.22 0.538749C10.6265 0.598285 10.1912 0.722509 9.66001 0.983949C9.37775 1.12286 9.12319 1.28297 8.87601 1.47704C8.69228 1.62129 6.93319 3.37158 6.85697 3.48597C6.78033 3.60101 6.75383 3.69451 6.75437 3.84801C6.75508 4.04564 6.81122 4.18171 6.94887 4.31936C7.14239 4.51288 7.43207 4.56667 7.68401 4.45585C7.78109 4.41317 7.84866 4.34988 8.70001 3.50432C9.20161 3.00612 9.65881 2.56196 9.71601 2.51731C10.0519 2.25499 10.4706 2.05141 10.892 1.94537C11.2092 1.86557 11.7213 1.84326 12.0514 1.89489C12.9243 2.03139 13.651 2.49584 14.1437 3.23201C14.3077 3.47704 14.4669 3.8423 14.5477 4.15877C14.6587 4.59373 14.6616 5.18297 14.5546 5.60801C14.4471 6.03561 14.2443 6.45003 13.9762 6.79022C13.9268 6.85281 13.489 7.30361 13.0031 7.79201C12.5173 8.28041 12.1015 8.7095 12.0793 8.74557C12.0217 8.83864 11.988 8.96494 11.9882 9.08693C11.9885 9.27032 12.0513 9.42179 12.1808 9.55125C12.3159 9.68635 12.4532 9.74419 12.644 9.74638C12.7905 9.74808 12.9047 9.71592 13.016 9.64171C13.1301 9.56558 14.864 7.82219 15.0147 7.63201C15.502 7.01705 15.8117 6.30936 15.9321 5.53601C15.9672 5.31038 15.9813 4.73297 15.9576 4.48801C15.9054 3.94678 15.7771 3.48822 15.5414 3.00001C15.3126 2.52614 15.0685 2.18312 14.6927 1.80733C13.9789 1.09355 13.1035 0.668781 12.1059 0.552077C11.9206 0.530397 11.3837 0.522333 11.22 0.538749ZM5.2445 1.05827C5.0433 1.08664 4.84421 1.23966 4.75012 1.43825L4.70001 1.54401L4.69549 2.46219C4.69154 3.26985 4.69412 3.39117 4.71692 3.47019C4.76266 3.62872 4.85655 3.75208 5.00476 3.84838C5.20802 3.98045 5.48217 3.98582 5.69402 3.8619C5.77233 3.81611 5.90889 3.67566 5.94727 3.60145C6.01841 3.46387 6.01965 3.44486 6.01983 2.49262C6.02001 1.61425 6.01895 1.58238 5.98692 1.49678C5.87002 1.18435 5.57716 1.01137 5.2445 1.05827ZM2.59673 1.58549C2.4178 1.62057 2.22357 1.77176 2.14122 1.94009C2.08143 2.06232 2.05881 2.21302 2.08055 2.34425C2.11277 2.53877 2.15631 2.60016 2.52401 2.96969C2.81721 3.26435 2.87423 3.31429 2.97162 3.36169C3.07791 3.41342 3.09167 3.41601 3.25962 3.41601C3.4238 3.41601 3.44327 3.41257 3.541 3.36627C3.67756 3.30155 3.80154 3.17757 3.86626 3.04101C3.91257 2.94328 3.91601 2.9238 3.91601 2.75963C3.91601 2.59168 3.91341 2.57792 3.86169 2.47163C3.81428 2.37424 3.76434 2.31721 3.46969 2.02401C3.10991 1.66603 3.04322 1.61725 2.86836 1.58408C2.77031 1.56549 2.69684 1.56587 2.59673 1.58549ZM2.02801 4.21445C1.85482 4.26936 1.69453 4.40416 1.61634 4.56062C1.53162 4.73012 1.5306 4.97821 1.61388 5.14899C1.67375 5.27179 1.8045 5.39857 1.93497 5.46037L2.04401 5.51201L2.96401 5.51667C3.92485 5.52155 3.95385 5.51987 4.09084 5.45173C4.17271 5.41101 4.31301 5.27763 4.36189 5.19403C4.57817 4.82427 4.38473 4.33845 3.97309 4.21753C3.89789 4.19545 3.76553 4.19216 2.98909 4.19309C2.31132 4.19389 2.07636 4.19912 2.02801 4.21445ZM10.4794 5.24865C10.4373 5.25573 10.3545 5.28401 10.2954 5.3115C10.1935 5.35891 10.0767 5.47275 8.02474 7.52475C5.98373 9.56576 5.85868 9.694 5.81218 9.794C5.68556 10.0662 5.73263 10.3648 5.93393 10.5661C6.13521 10.7674 6.4338 10.8145 6.70602 10.6878C6.80602 10.6413 6.93426 10.5163 8.97527 8.47528C11.0163 6.43427 11.1413 6.30603 11.1878 6.20603C11.2829 6.00173 11.2838 5.80633 11.1907 5.61C11.1022 5.42347 10.9104 5.28238 10.6982 5.24763C10.5933 5.23045 10.5875 5.23048 10.4794 5.24865ZM4.25201 6.25709C4.13005 6.27627 4.07709 6.29624 3.98469 6.35787C3.87025 6.43421 2.13679 8.17691 1.98524 8.36801C1.7866 8.61848 1.62597 8.87236 1.48417 9.16001C1.25775 9.61931 1.14644 9.96928 1.0669 10.472C1.03255 10.6891 1.01855 11.2894 1.04242 11.5218C1.13201 12.3938 1.44233 13.1559 1.99106 13.8515C2.11753 14.0118 2.48823 14.3825 2.64853 14.509C3.34417 15.0577 4.10626 15.368 4.9782 15.4576C5.21338 15.4818 5.80996 15.4674 6.03601 15.4322C6.811 15.3113 7.51625 15.0026 8.13201 14.5147C8.32218 14.364 10.0656 12.6301 10.1417 12.516C10.2159 12.4047 10.2481 12.2905 10.2464 12.144C10.2442 11.9532 10.1863 11.8159 10.0512 11.6808C9.92178 11.5513 9.77031 11.4885 9.58692 11.4882C9.46493 11.488 9.33863 11.5217 9.24556 11.5793C9.20949 11.6015 8.78041 12.0173 8.29201 12.5031C7.80361 12.989 7.35281 13.4268 7.29021 13.4762C6.95002 13.7443 6.53561 13.9471 6.10801 14.0547C5.68297 14.1616 5.09372 14.1587 4.65876 14.0477C4.1114 13.9079 3.64604 13.6439 3.25109 13.2489C2.7846 12.7824 2.49877 12.2158 2.39489 11.5514C2.35978 11.3269 2.35981 10.8808 2.39497 10.656C2.47809 10.1242 2.69338 9.62913 3.02385 9.20981C3.07317 9.14721 3.51778 8.68921 4.01186 8.19201C4.85073 7.34785 4.91322 7.28113 4.95589 7.18401C5.06609 6.93325 5.01277 6.6423 4.82162 6.45115C4.66466 6.29419 4.45981 6.2244 4.25201 6.25709ZM13.548 10.5024C13.3666 10.56 13.2147 10.6922 13.1337 10.863C13.0874 10.9607 13.084 10.9802 13.084 11.1444C13.084 11.3106 13.0869 11.3268 13.1354 11.4252C13.2206 11.5981 13.3733 11.7304 13.5493 11.7838C13.6613 11.8178 14.8548 11.819 14.9659 11.7852C15.1861 11.7184 15.3611 11.5473 15.4232 11.3381C15.455 11.2312 15.4542 11.0513 15.4215 10.9388C15.3698 10.7611 15.1977 10.5858 15.0032 10.5131C14.919 10.4816 14.8842 10.4801 14.2634 10.4811C13.7842 10.4819 13.5951 10.4875 13.548 10.5024ZM11.4431 12.5983C11.2533 12.6712 11.1165 12.7929 11.0377 12.959L10.988 13.064L10.9834 13.7377C10.9789 14.3897 10.9798 14.4143 11.0124 14.5015C11.0858 14.6977 11.2604 14.8696 11.4388 14.9215C11.8061 15.0283 12.1748 14.8298 12.2852 14.4659C12.319 14.3548 12.3177 13.1613 12.2838 13.0494C12.2305 12.8735 12.0981 12.7206 11.9257 12.6357C11.8326 12.5899 11.8052 12.5842 11.6609 12.5806C11.5544 12.5779 11.4808 12.5839 11.4431 12.5983ZM13.5391 12.5983C13.3493 12.6712 13.2125 12.7929 13.1337 12.959C13.0874 13.0567 13.084 13.0762 13.084 13.2404C13.084 13.4083 13.0866 13.4221 13.1383 13.5284C13.1857 13.6258 13.2357 13.6828 13.5303 13.976C13.9023 14.3462 13.9559 14.3839 14.1582 14.4172C14.3748 14.453 14.5719 14.3886 14.7303 14.2303C14.8886 14.0719 14.953 13.8748 14.9172 13.6582C14.8838 13.4559 14.8462 13.4023 14.476 13.0303C14.1833 12.7362 14.1257 12.6857 14.0289 12.6386C13.9283 12.5896 13.9028 12.5842 13.7569 12.5806C13.6504 12.5779 13.5768 12.5839 13.5391 12.5983Z"
|
|
493
|
-
/>
|
|
494
|
-
</svg>`,CG=[To,r3,ga`
|
|
495
|
-
:host {
|
|
496
|
-
display: block;
|
|
497
|
-
width: fit-content;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
.menu {
|
|
501
|
-
display: none;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
[aria-expanded='true'] + .menu {
|
|
505
|
-
display: flex;
|
|
506
|
-
flex-direction: column;
|
|
507
|
-
max-width: fit-content;
|
|
508
|
-
min-width: 396px;
|
|
509
|
-
gap: 16px;
|
|
510
|
-
padding: 16px;
|
|
511
|
-
position: absolute;
|
|
512
|
-
outline: none;
|
|
513
|
-
background-color: var(--dapp-kit-popover);
|
|
514
|
-
color: var(--dapp-kit-popover-foreground);
|
|
515
|
-
border-radius: var(--dapp-kit-radius-lg);
|
|
516
|
-
border: 1px solid var(--dapp-kit-border);
|
|
517
|
-
box-shadow:
|
|
518
|
-
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
519
|
-
0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
.header-container {
|
|
523
|
-
display: flex;
|
|
524
|
-
align-items: center;
|
|
525
|
-
justify-content: space-between;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.header-title {
|
|
529
|
-
font-size: 18px;
|
|
530
|
-
font-weight: var(--dapp-kit-font-weight-semibold);
|
|
531
|
-
letter-spacing: -0.18px;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
img {
|
|
535
|
-
width: 24px;
|
|
536
|
-
height: 24px;
|
|
537
|
-
border-radius: 96px;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
[aria-expanded='true'] .chevron {
|
|
541
|
-
transition: transform 0.3s ease;
|
|
542
|
-
transform: rotate(180deg);
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
.chevron {
|
|
546
|
-
display: flex;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
.chevron svg {
|
|
550
|
-
width: 12px;
|
|
551
|
-
height: 12px;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.trigger-content {
|
|
555
|
-
display: flex;
|
|
556
|
-
align-items: center;
|
|
557
|
-
font-weight: var(--dapp-kit-font-weight-semibold);
|
|
558
|
-
gap: 12px;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
.accounts-list {
|
|
562
|
-
display: flex;
|
|
563
|
-
flex-direction: column;
|
|
564
|
-
gap: 12px;
|
|
565
|
-
max-height: 240px;
|
|
566
|
-
overflow-y: auto;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
.disconnect-button {
|
|
570
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
571
|
-
display: inline-flex;
|
|
572
|
-
align-items: center;
|
|
573
|
-
justify-content: center;
|
|
574
|
-
width: 100%;
|
|
575
|
-
background-color: var(--dapp-kit-secondary);
|
|
576
|
-
color: var(--dapp-kit-destructive);
|
|
577
|
-
border-radius: var(--dapp-kit-radius-md);
|
|
578
|
-
font-weight: var(--dapp-kit-font-weight-medium);
|
|
579
|
-
height: 48px;
|
|
580
|
-
padding: 16px;
|
|
581
|
-
gap: 8px;
|
|
582
|
-
cursor: var(--dapp-kit-cursor-button);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.disconnect-button:hover {
|
|
586
|
-
background-color: color-mix(in oklab, var(--dapp-kit-secondary) 80%, transparent);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
.container {
|
|
590
|
-
padding-top: 12px;
|
|
591
|
-
padding-bottom: 12px;
|
|
592
|
-
padding-left: 16px;
|
|
593
|
-
padding-right: 16px;
|
|
594
|
-
display: flex;
|
|
595
|
-
align-items: center;
|
|
596
|
-
justify-content: space-between;
|
|
597
|
-
gap: 8px;
|
|
598
|
-
width: 100%;
|
|
599
|
-
border-radius: var(--dapp-kit-radius-sm);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
.container[data-checked='true'] {
|
|
603
|
-
background-color: var(--dapp-kit-accent);
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
.account-title {
|
|
607
|
-
font-weight: var(--dapp-kit-font-weight-semibold);
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
.account-subtitle {
|
|
611
|
-
color: var(--dapp-kit-muted-foreground);
|
|
612
|
-
font-weight: var(--dapp-kit-font-weight-medium);
|
|
613
|
-
font-size: 14px;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
.account-info {
|
|
617
|
-
display: flex;
|
|
618
|
-
flex-direction: column;
|
|
619
|
-
gap: 4px;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.content {
|
|
623
|
-
display: flex;
|
|
624
|
-
flex-grow: 1;
|
|
625
|
-
gap: 12px;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
.copy-address-button {
|
|
629
|
-
display: inline-flex;
|
|
630
|
-
cursor: var(--dapp-kit-cursor-button);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
.copy-address-button svg {
|
|
634
|
-
width: 16px;
|
|
635
|
-
height: 16px;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
.radio-indicator {
|
|
639
|
-
width: 20px;
|
|
640
|
-
height: 20px;
|
|
641
|
-
border-radius: 100%;
|
|
642
|
-
background-color: var(--dapp-kit-input);
|
|
643
|
-
border: 1px solid var(--dapp-kit-border);
|
|
644
|
-
display: inline-flex;
|
|
645
|
-
justify-content: center;
|
|
646
|
-
align-items: center;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.content:focus-visible .radio-indicator {
|
|
650
|
-
border-color: var(--dapp-kit-ring);
|
|
651
|
-
box-shadow: 0 0 0 3px var(--dapp-kit-ring) / 0.5;
|
|
652
|
-
outline: none;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
[data-checked='true'] .radio-indicator {
|
|
656
|
-
color: var(--dapp-kit-positive);
|
|
657
|
-
border-color: var(--dapp-kit-positive);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
.radio-input {
|
|
661
|
-
appearance: none;
|
|
662
|
-
-webkit-appearance: none;
|
|
663
|
-
width: 20px;
|
|
664
|
-
height: 20px;
|
|
665
|
-
margin: 0;
|
|
666
|
-
border-radius: 50%;
|
|
667
|
-
background-color: var(--dapp-kit-input);
|
|
668
|
-
border: 1px solid var(--dapp-kit-input);
|
|
669
|
-
cursor: var(--dapp-kit-cursor-radio);
|
|
670
|
-
position: relative;
|
|
671
|
-
outline: none;
|
|
672
|
-
transition: box-shadow 0.2s;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
.radio-input::before {
|
|
676
|
-
content: '';
|
|
677
|
-
position: absolute;
|
|
678
|
-
top: 50%;
|
|
679
|
-
left: 50%;
|
|
680
|
-
width: 8px;
|
|
681
|
-
height: 8px;
|
|
682
|
-
background-color: var(--dapp-kit-positive);
|
|
683
|
-
border-radius: 100%;
|
|
684
|
-
transform: translate(-50%, -50%) scale(0);
|
|
685
|
-
transition: transform 0.2s ease;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
.radio-input:checked {
|
|
689
|
-
background-color: transparent;
|
|
690
|
-
border-color: var(--dapp-kit-positive);
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
.radio-input:checked::before {
|
|
694
|
-
transform: translate(-50%, -50%) scale(1);
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
.radio-input:focus-visible {
|
|
698
|
-
border-color: var(--dapp-kit-ring);
|
|
699
|
-
box-shadow: 0 0 0 3px var(--dapp-kit-ring);
|
|
700
|
-
}
|
|
701
|
-
`],IG=bt`<svg
|
|
702
|
-
width="16"
|
|
703
|
-
height="16"
|
|
704
|
-
viewBox="0 0 16 16"
|
|
705
|
-
fill="currentColor"
|
|
706
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
707
|
-
>
|
|
708
|
-
<path
|
|
709
|
-
fill-rule="evenodd"
|
|
710
|
-
clip-rule="evenodd"
|
|
711
|
-
d="M2.57602 1.05841C1.96473 1.12213 1.42869 1.52667 1.18005 2.11198C1.1061 2.28603 1.0777 2.39982 1.05682 2.60568C1.03369 2.83379 1.03361 9.476 1.05673 9.71992C1.12471 10.4367 1.60071 11.0082 2.31202 11.227L2.45602 11.2713L3.58402 11.2796L4.71202 11.288L4.72098 12.416C4.7307 13.6405 4.7262 13.5765 4.82061 13.8331C4.95698 14.2037 5.26674 14.5566 5.62014 14.7439C5.85567 14.8688 6.02999 14.9204 6.29721 14.9443C6.5825 14.9699 13.4137 14.9564 13.544 14.9301C14.2457 14.7881 14.7885 14.2454 14.9301 13.544C14.9564 13.4135 14.9699 6.582 14.9444 6.29717C14.9204 6.02992 14.8688 5.8556 14.744 5.62009C14.5566 5.2667 14.2038 4.95694 13.8332 4.82057C13.5766 4.72616 13.6405 4.73065 12.416 4.72094L11.288 4.71198L11.2797 3.58398L11.2713 2.45598L11.227 2.31198C11.1329 2.00597 10.9791 1.74963 10.7655 1.54273C10.4634 1.25013 10.1311 1.09568 9.71996 1.05669C9.50114 1.03595 2.77607 1.03757 2.57602 1.05841ZM2.64002 2.40489C2.56149 2.42965 2.42756 2.56833 2.40348 2.64984C2.38845 2.70067 2.3841 3.50549 2.38437 6.17784C2.38473 9.62633 2.38485 9.64027 2.41732 9.71198C2.45749 9.80075 2.51625 9.86424 2.60002 9.90945C2.66343 9.94366 2.67351 9.94403 3.69159 9.94843L4.71916 9.95288L4.72359 8.03643L4.72802 6.11998L4.77265 5.97758C4.96105 5.37641 5.37855 4.9584 5.97602 4.77273L6.12002 4.72798L8.03647 4.72355L9.95292 4.71912L9.94847 3.69155C9.94407 2.67347 9.9437 2.66339 9.9095 2.59998C9.86428 2.51621 9.80079 2.45745 9.71202 2.41728C9.64026 2.3848 9.62818 2.38469 6.16802 2.38597C3.68466 2.38688 2.68007 2.39227 2.64002 2.40489ZM6.33593 6.06286C6.22594 6.09651 6.14185 6.16683 6.08585 6.27198C6.05701 6.32613 6.05602 6.44379 6.05602 9.83198V13.336L6.09108 13.4015C6.1358 13.4851 6.21761 13.5568 6.30634 13.5904C6.37039 13.6146 6.65799 13.6164 9.86402 13.6124C13.1284 13.6083 13.3553 13.6062 13.4023 13.5804C13.4667 13.5452 13.5453 13.4666 13.5805 13.4023C13.6063 13.3552 13.6083 13.1283 13.6124 9.86398C13.6164 6.65795 13.6146 6.37035 13.5904 6.3063C13.5569 6.21757 13.4851 6.13576 13.4015 6.09104L13.336 6.05598L9.85602 6.05328C7.94202 6.05181 6.35798 6.05611 6.33593 6.06286Z"
|
|
712
|
-
/>
|
|
713
|
-
</svg> `,nh=new Map;async function o3(e,t){if(nh.has(t))return nh.get(t);try{const s=(await e.core.defaultNameServiceName?.({address:t}))?.data.name;return nh.set(t,s?KC(s,"at"):null),s}catch{return nh.set(t,null),null}}const RG=bt`<svg
|
|
714
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
715
|
-
width="24"
|
|
716
|
-
height="24"
|
|
717
|
-
viewBox="0 0 24 24"
|
|
718
|
-
fill="none"
|
|
719
|
-
stroke="var(--dapp-kit-positive)"
|
|
720
|
-
stroke-width="2"
|
|
721
|
-
stroke-linecap="round"
|
|
722
|
-
stroke-linejoin="round"
|
|
723
|
-
>
|
|
724
|
-
<circle cx="12" cy="12" r="10" />
|
|
725
|
-
<path d="m9 12 2 2 4-4" />
|
|
726
|
-
</svg> `;var ud=class extends qn{constructor(...e){super(...e),this.selected=!1,this._wasCopySuccessful=!1}createRenderRoot(){return this}#e=new e3(this,{args:()=>[this.client,this.account.address],task:async([e,t])=>o3(e,t)});connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.#s)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.#s)}render(){return bt`
|
|
727
|
-
<div class="container" data-checked=${this.selected}>
|
|
728
|
-
<input
|
|
729
|
-
type="radio"
|
|
730
|
-
name="wallet-address"
|
|
731
|
-
tabindex="${this.selected?"0":"-1"}"
|
|
732
|
-
value=${this.account.address}
|
|
733
|
-
?checked=${this.selected}
|
|
734
|
-
@change=${this.#s}
|
|
735
|
-
class="radio-input"
|
|
736
|
-
id=${this.account.address}
|
|
737
|
-
/>
|
|
738
|
-
<label class="content" for=${this.account.address}>
|
|
739
|
-
${fv(this.account.icon,e=>bt`<img src=${e} alt="" />`)}
|
|
740
|
-
${this.#e.render({pending:this.#r,complete:this.#r,error:()=>this.#r()})}
|
|
741
|
-
</label>
|
|
742
|
-
<button
|
|
743
|
-
class="copy-address-button"
|
|
744
|
-
@click=${this.#t}
|
|
745
|
-
aria-label="Copy address"
|
|
746
|
-
>
|
|
747
|
-
${this._wasCopySuccessful?RG:IG}
|
|
748
|
-
</button>
|
|
749
|
-
</div>
|
|
750
|
-
`}async#t(e){e.stopPropagation();try{await navigator.clipboard.writeText(this.account.address),this._wasCopySuccessful=!0,setTimeout(()=>{this._wasCopySuccessful=!1},2e3)}catch{}}#r=e=>{const{address:t,label:s}=this.account,r=Uk(t),i=e||s;return bt`<div class="account-info">
|
|
751
|
-
<div class="account-title">${i||r}</div>
|
|
752
|
-
${fv(i,()=>bt`<div class="account-subtitle">${r}</div>`)}
|
|
753
|
-
</div>`};#s(){this.dispatchEvent(new CustomEvent("account-selected",{detail:{account:this.account},bubbles:!0,composed:!0}))}};_t([pn({type:Object})],ud.prototype,"account",void 0);_t([pn({type:Object})],ud.prototype,"client",void 0);_t([pn({type:Boolean})],ud.prototype,"selected",void 0);_t([Db()],ud.prototype,"_wasCopySuccessful",void 0);const jG=bt`<svg
|
|
754
|
-
width="12"
|
|
755
|
-
height="12"
|
|
756
|
-
viewBox="0 0 12 12"
|
|
757
|
-
fill="currentColor"
|
|
758
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
759
|
-
>
|
|
760
|
-
<path
|
|
761
|
-
fill-rule="evenodd"
|
|
762
|
-
clip-rule="evenodd"
|
|
763
|
-
d="M0.749783 3.16083C0.616367 3.20313 0.499715 3.30493 0.439031 3.432C0.404351 3.50463 0.401783 3.5191 0.401783 3.642C0.401783 3.8842 0.122795 3.58063 2.91474 6.3763C4.25842 7.72175 5.39718 8.85432 5.44534 8.8931C5.61112 9.02664 5.77771 9.084 5.99978 9.084C6.22186 9.084 6.38845 9.02664 6.55423 8.8931C6.60239 8.85432 7.74115 7.72175 9.08483 6.3763C11.8768 3.58063 11.5978 3.8842 11.5978 3.642C11.5978 3.5191 11.5952 3.50463 11.5605 3.432C11.512 3.33045 11.4169 3.23542 11.3163 3.18797C11.2247 3.14475 11.0777 3.13074 10.9826 3.15618C10.8399 3.19439 10.9127 3.12454 8.39678 5.63854L5.99978 8.03374L3.60278 5.6387C1.98712 4.02436 1.18712 3.23308 1.14854 3.21119C1.11707 3.19332 1.06577 3.17095 1.03454 3.16149C0.965327 3.14049 0.815051 3.14014 0.749783 3.16083Z"
|
|
764
|
-
/>
|
|
765
|
-
</svg>`,MG=bt`<svg
|
|
766
|
-
width="16"
|
|
767
|
-
height="16"
|
|
768
|
-
viewBox="0 0 16 16"
|
|
769
|
-
fill="currentColor"
|
|
770
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
771
|
-
>
|
|
772
|
-
<path
|
|
773
|
-
fill-rule="evenodd"
|
|
774
|
-
clip-rule="evenodd"
|
|
775
|
-
d="M7.89082 1.05657C7.62439 1.0948 7.38895 1.33323 7.34347 1.61086C7.33421 1.66737 7.32818 2.80358 7.32813 4.49999L7.32803 7.296H4.4625C1.27722 7.296 1.51488 7.28764 1.34404 7.40553C1.22967 7.48444 1.11213 7.63921 1.07837 7.75534C1.04733 7.86214 1.04613 8.06073 1.07597 8.15199C1.1289 8.3138 1.2622 8.47769 1.39693 8.54657C1.55365 8.62668 1.43055 8.6236 4.47604 8.6238L7.32803 8.62399L7.32813 11.46C7.32818 13.2384 7.33408 14.3318 7.34392 14.392C7.38999 14.6737 7.62421 14.9044 7.90416 14.944C8.26109 14.9945 8.59807 14.7471 8.65615 14.392C8.66599 14.3318 8.67189 13.2384 8.67194 11.46L8.67203 8.62399L11.524 8.6238C14.5695 8.6236 14.4464 8.62668 14.6031 8.54657C14.7379 8.47769 14.8712 8.3138 14.9241 8.15199C14.9539 8.06073 14.9527 7.86214 14.9217 7.75534C14.8879 7.63921 14.7704 7.48444 14.656 7.40553C14.4852 7.28764 14.7229 7.296 11.5376 7.296H8.67203L8.67194 4.49999C8.67189 2.80358 8.66586 1.66737 8.65659 1.61086C8.6172 1.37032 8.44339 1.16228 8.21551 1.08292C8.12912 1.05284 7.99355 1.04184 7.89082 1.05657Z"
|
|
776
|
-
/>
|
|
777
|
-
</svg>`;var to,bp,Tn,c3,l3,zc,Xu,u3,d3,pv,f3,mv,oo,cl=(oo=class extends $p(qn){constructor(...s){super(...s);Gn(this,Tn);Gn(this,to);Gn(this,bp,new e3(this,{args:()=>[this.client,this.connection.account.address],task:async([s,r])=>o3(s,r)}));Gn(this,zc,s=>s||this.connection.account.label||Uk(this.connection.account.address));Gn(this,Xu,s=>{this._open&&(s.composedPath().includes(this)||rn(this,Tn,pv).call(this))});this._open=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",Gt(this,Xu))}disconnectedCallback(){super.disconnectedCallback(),rn(this,Tn,mv).call(this),document.removeEventListener("click",Gt(this,Xu))}render(){return bt`<internal-button
|
|
778
|
-
exportparts="trigger"
|
|
779
|
-
id="menu-button"
|
|
780
|
-
aria-haspopup="true"
|
|
781
|
-
aria-controls="menu"
|
|
782
|
-
aria-expanded="${this._open}"
|
|
783
|
-
@click=${rn(this,Tn,u3)}
|
|
784
|
-
>
|
|
785
|
-
<div class="trigger-content">
|
|
786
|
-
<img src=${this.connection.account.icon??this.connection.wallet.icon} alt="" />
|
|
787
|
-
${Gt(this,bp).render({pending:Gt(this,zc),complete:Gt(this,zc),error:()=>Gt(this,zc)})}
|
|
788
|
-
<div class="chevron">${jG}</div>
|
|
789
|
-
</div>
|
|
790
|
-
</internal-button>
|
|
791
|
-
<div class="menu" id="menu" tabindex="-1" aria-labelledby="menu-button">
|
|
792
|
-
<div class="header-container">
|
|
793
|
-
<h2 class="header-title">Connected accounts</h2>
|
|
794
|
-
${fv(this.connection.wallet.name.startsWith(uV),()=>bt`<button
|
|
795
|
-
class="icon-button"
|
|
796
|
-
aria-label="Add more accounts"
|
|
797
|
-
@click=${rn(this,Tn,l3)}
|
|
798
|
-
>
|
|
799
|
-
${MG}
|
|
800
|
-
</button>`)}
|
|
801
|
-
</div>
|
|
802
|
-
<div class="accounts-container" role="radiogroup">
|
|
803
|
-
<ul class="accounts-list">
|
|
804
|
-
${this.connection.wallet.accounts.map(s=>bt`
|
|
805
|
-
<li>
|
|
806
|
-
<account-menu-item
|
|
807
|
-
.account=${s}
|
|
808
|
-
.client=${this.client}
|
|
809
|
-
.selected=${s.address===this.connection.account.address}
|
|
810
|
-
></account-menu-item>
|
|
811
|
-
</li>
|
|
812
|
-
`)}
|
|
813
|
-
</ul>
|
|
814
|
-
</div>
|
|
815
|
-
<button class="disconnect-button" @click=${rn(this,Tn,c3)}>
|
|
816
|
-
${xG} Disconnect all
|
|
817
|
-
</button>
|
|
818
|
-
</div>`}},to=new WeakMap,bp=new WeakMap,Tn=new WeakSet,c3=function(){this.dispatchEvent(new CustomEvent("disconnect-click",{bubbles:!0,composed:!0}))},l3=function(){this.dispatchEvent(new CustomEvent("manage-connection-click",{bubbles:!0,composed:!0}))},zc=new WeakMap,Xu=new WeakMap,u3=function(){this._open?rn(this,Tn,pv).call(this):rn(this,Tn,d3).call(this)},d3=async function(){this._open=!0,await this.updateComplete,this._menu.focus(),rn(this,Tn,f3).call(this)},pv=function(){this._open=!1,rn(this,Tn,mv).call(this)},f3=function(){Fn(this,to,dG(this._trigger,this._menu,async()=>{const s=await mG(this._trigger,this._menu,{placement:"bottom-end",middleware:[fG(12),pG(),hG({padding:16})]});Object.assign(this._menu.style,{left:`${s.x}px`,top:`${s.y}px`})}))},mv=function(){Gt(this,to)&&(Gt(this,to).call(this),Fn(this,to,void 0))},oo.elementDefinitions={"internal-button":Eo,"account-menu-item":ud},oo.styles=CG,oo);_t([pn({type:Object})],cl.prototype,"connection",void 0);_t([pn({type:Object})],cl.prototype,"client",void 0);_t([zp("#menu-button")],cl.prototype,"_trigger",void 0);_t([zp("#menu")],cl.prototype,"_menu",void 0);_t([Db()],cl.prototype,"_open",void 0);var wp,h3,di;let Zc=(di=class extends $p(qn){constructor(){super(...arguments);Gn(this,wp)}render(){const s=this.instance.stores.$connection.get(),r=this.instance.stores.$currentClient.get();return s.account?bt`<connected-account-menu
|
|
819
|
-
exportparts="trigger"
|
|
820
|
-
.connection=${s}
|
|
821
|
-
.client=${r}
|
|
822
|
-
@account-selected=${i=>{this.instance.switchAccount({account:i.detail.account})}}
|
|
823
|
-
@disconnect-click=${()=>{this.instance.disconnectWallet()}}
|
|
824
|
-
@manage-connection-click=${()=>{this.instance.connectWallet({wallet:s.wallet})}}
|
|
825
|
-
></connected-account-menu>`:bt`<internal-button exportparts="trigger" @click=${rn(this,wp,h3)}>
|
|
826
|
-
<slot>Connect Wallet</slot>
|
|
827
|
-
</internal-button>
|
|
828
|
-
<mysten-dapp-kit-connect-modal
|
|
829
|
-
.instance=${this.instance}
|
|
830
|
-
.filterFn=${this.modalOptions?.filterFn}
|
|
831
|
-
.sortFn=${this.modalOptions?.sortFn}
|
|
832
|
-
></mysten-dapp-kit-connect-modal>`}},wp=new WeakSet,h3=function(){this._modal.show()},di.elementDefinitions={"internal-button":Eo,"mysten-dapp-kit-connect-modal":pi,"connected-account-menu":cl},di.shadowRootOptions={...qn.shadowRootOptions,delegatesFocus:!0},di.styles=To,di);_t([pn({type:Object})],Zc.prototype,"modalOptions",void 0);_t([t3()],Zc.prototype,"instance",void 0);_t([zp("mysten-dapp-kit-connect-modal")],Zc.prototype,"_modal",void 0);Zc=_t([GO("mysten-dapp-kit-connect-button")],Zc);const DG=DO({react:SO,tagName:"mysten-dapp-kit-connect-button",elementClass:Zc});function p3({instance:e,...t}){const s=wo(e);return T.jsx(DG,{...t,instance:s})}DO({react:SO,tagName:"mysten-dapp-kit-connect-modal",elementClass:pi});var yy={exports:{}},vu={},vy={exports:{}},by={};var $_;function UG(){return $_||($_=1,(function(e){function t(k,j){var D=k.length;k.push(j);e:for(;0<D;){var z=D-1>>>1,J=k[z];if(0<i(J,j))k[z]=j,k[D]=J,D=z;else break e}}function s(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var j=k[0],D=k.pop();if(D!==j){k[0]=D;e:for(var z=0,J=k.length,V=J>>>1;z<V;){var re=2*(z+1)-1,ue=k[re],I=re+1,X=k[I];if(0>i(ue,D))I<J&&0>i(X,ue)?(k[z]=X,k[I]=D,z=I):(k[z]=ue,k[re]=D,z=re);else if(I<J&&0>i(X,D))k[z]=X,k[I]=D,z=I;else break e}}return j}function i(k,j){var D=k.sortIndex-j.sortIndex;return D!==0?D:k.id-j.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],g=1,y=null,b=3,S=!1,O=!1,C=!1,R=!1,$=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function ce(k){for(var j=s(m);j!==null;){if(j.callback===null)r(m);else if(j.startTime<=k)r(m),j.sortIndex=j.expirationTime,t(p,j);else break;j=s(m)}}function ge(k){if(C=!1,ce(k),!O)if(s(p)!==null)O=!0,F||(F=!0,U());else{var j=s(m);j!==null&&M(ge,j.startTime-k)}}var F=!1,K=-1,w=5,A=-1;function N(){return R?!0:!(e.unstable_now()-A<w)}function P(){if(R=!1,F){var k=e.unstable_now();A=k;var j=!0;try{e:{O=!1,C&&(C=!1,x(K),K=-1),S=!0;var D=b;try{t:{for(ce(k),y=s(p);y!==null&&!(y.expirationTime>k&&N());){var z=y.callback;if(typeof z=="function"){y.callback=null,b=y.priorityLevel;var J=z(y.expirationTime<=k);if(k=e.unstable_now(),typeof J=="function"){y.callback=J,ce(k),j=!0;break t}y===s(p)&&r(p),ce(k)}else r(p);y=s(p)}if(y!==null)j=!0;else{var V=s(m);V!==null&&M(ge,V.startTime-k),j=!1}}break e}finally{y=null,b=D,S=!1}j=void 0}}finally{j?U():F=!1}}}var U;if(typeof W=="function")U=function(){W(P)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,L=q.port2;q.port1.onmessage=P,U=function(){L.postMessage(null)}}else U=function(){$(P,0)};function M(k,j){K=$(function(){k(e.unstable_now())},j)}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(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(k){switch(b){case 1:case 2:case 3:var j=3;break;default:j=b}var D=b;b=j;try{return k()}finally{b=D}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(k,j){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var D=b;b=k;try{return j()}finally{b=D}},e.unstable_scheduleCallback=function(k,j,D){var z=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?z+D:z):D=z,k){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=D+J,k={id:g++,callback:j,priorityLevel:k,startTime:D,expirationTime:J,sortIndex:-1},D>z?(k.sortIndex=D,t(m,k),s(p)===null&&k===s(m)&&(C?(x(K),K=-1):C=!0,M(ge,D-z))):(k.sortIndex=J,t(p,k),O||S||(O=!0,F||(F=!0,U()))),k},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(k){var j=b;return function(){var D=b;b=j;try{return k.apply(this,arguments)}finally{b=D}}}})(by)),by}var V_;function BG(){return V_||(V_=1,vy.exports=UG()),vy.exports}var wy={exports:{}},xn={};var P_;function LG(){if(P_)return xn;P_=1;var e=kb();function t(g){var y="https://react.dev/errors/"+g;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},i=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function f(g,y,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:S==null?null:S===u?u:""+S,children:g,containerInfo:y,implementation:b}}var p=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,y){if(g==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xn.browser=function(g){return{$$typeof:c,_reason:g}},xn.createPortal=function(g,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(t(299));return f(g,y,null,b)},xn.flushSync=function(g){var y=p.T,b=r.p;try{if(p.T=null,r.p=2,g)return g()}finally{p.T=y,r.p=b,r.d.f()}},xn.preconnect=function(g,y){typeof g=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(g,y))},xn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},xn.preinit=function(g,y){if(typeof g=="string"&&y&&typeof y.as=="string"){var b=y.as,S=m(b,y.crossOrigin),O=typeof y.integrity=="string"?y.integrity:void 0,C=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?r.d.S(g,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:S,integrity:O,fetchPriority:C}):b==="script"&&r.d.X(g,{crossOrigin:S,integrity:O,fetchPriority:C,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},xn.preinitModule=function(g,y){if(typeof g=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=m(y.as,y.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&r.d.M(g)},xn.preload=function(g,y){if(typeof g=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,S=m(b,y.crossOrigin);r.d.L(g,b,{crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},xn.preloadModule=function(g,y){if(typeof g=="string")if(y){var b=m(y.as,y.crossOrigin);r.d.m(g,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else r.d.m(g)},xn.requestFormReset=function(g){r.d.r(g)},xn.unstable_batchedUpdates=function(g,y){return g(y)},xn.useFormState=function(g,y,b){return p.H.useFormState(g,y,b)},xn.useFormStatus=function(){return p.H.useHostTransitionStatus()},xn.version="19.3.0",xn}var G_;function zG(){if(G_)return wy.exports;G_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wy.exports=LG(),wy.exports}var F_;function $G(){if(F_)return vu;F_=1;var e=BG(),t=kb(),s=zG();function r(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){for(var a=n,o=a;o&&!o.alternate;)a=o,(a.flags&4098)!==0&&(n=a.return),o=a.return;for(;a.return;)a=a.return;return a.tag===3?n:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function f(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function p(n){if(c(n)!==n)throw Error(r(188))}function m(n){var a=n.alternate;if(!a){if(a=c(n),a===null)throw Error(r(188));return a!==n?null:n}for(var o=n,l=a;;){var d=o.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===o)return p(d),n;if(h===l)return p(d),a;h=h.sibling}throw Error(r(188))}if(o.return!==l.return)o=d,l=h;else{for(var v=!1,_=d.child;_;){if(_===o){v=!0,o=d,l=h;break}if(_===l){v=!0,l=d,o=h;break}_=_.sibling}if(!v){for(_=h.child;_;){if(_===o){v=!0,o=h,l=d;break}if(_===l){v=!0,l=h,o=d;break}_=_.sibling}if(!v)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?n:a}function g(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=g(n),a!==null)return a;n=n.sibling}return null}function y(n,a,o,l,d,h){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&o(n,l,d,h)||(n.tag!==22||n.memoizedState===null)&&(a||n.tag!==5&&n.tag!==27)&&y(n.child,a,o,l,d,h))return!0;n=n.sibling}return!1}function b(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function S(n){var a=!1;for(n=n.return;n!==null&&(n.tag===4&&(a=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return a}function O(n){var a=[null,null],o=b(n);return o===null||C(a,n,o.child,{foundSelf:!1}),a}function C(n,a,o,l){for(;o!==null;){if(o===a)l.foundSelf=!0;else if(o.tag===5||o.tag===27||o.tag===6){if(l.foundSelf)return n[1]=o,!0;n[0]=o}else if((o.tag!==22||o.memoizedState===null)&&C(n,a,o.child,l))return!0;o=o.sibling}return!1}function R(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(r(559))}}var $=null,x=null;function W(n,a,o){return n===o?!0:n===a?($=n,!0):!1}function ce(n,a,o){return n===o?(x=n,!1):n===a?(x!==null&&($=n),!0):!1}function ge(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function F(n,a,o){for(var l=0,d=n;d;d=o(d))l++;d=0;for(var h=a;h;h=o(h))d++;for(;0<l-d;)n=o(n),l--;for(;0<d-l;)a=o(a),d--;for(;l--;){if(n===a||a!==null&&n===a.alternate)return n;n=o(n),a=o(a)}return null}var K=Object.assign,w=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),re=Symbol.for("react.legacy_hidden"),ue=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),oe=Symbol.iterator;function he(n){return n===null||typeof n!="object"?null:(n=oe&&n[oe]||n["@@iterator"],typeof n=="function"?n:null)}var Te=Symbol.for("react.client.reference");function Oe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Te?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case P:return"Fragment";case q:return"Profiler";case U:return"StrictMode";case j:return"Suspense";case D:return"SuspenseList";case V:return"Activity";case I:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case N:return"Portal";case M:return n.displayName||"Context";case L:return(n._context.displayName||"Context")+".Consumer";case k:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return a=n.displayName||null,a!==null?a:Oe(n.type)||"Memo";case J:a=n._payload,n=n._init;try{return Oe(n(a))}catch{}}return null}var Ae=Array.isArray,be=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ve={pending:!1,data:null,method:null,action:null},at=[],G=-1;function te(n){return{current:n}}function de(n){0>G||(n.current=at[G],at[G]=null,G--)}function fe(n,a){G++,at[G]=n.current,n.current=a}var le=te(null),ze=te(null),Le=te(null),Dt=te(null);function Es(n,a){switch(fe(Le,a),fe(ze,n),fe(le,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?x2(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=x2(a),n=C2(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}de(le),fe(le,n)}function va(){de(le),de(ze),de(Le)}function ul(n){var a=n.memoizedState;a!==null&&(dc._currentValue=a.memoizedState,fe(Dt,n)),a=le.current;var o=C2(a,n.type);a!==o&&(fe(ze,n),fe(le,o))}function bi(n){ze.current===n&&(de(le),de(ze)),Dt.current===n&&(de(Dt),dc._currentValue=Ve)}var So,dl;function ar(n){if(So===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);So=a&&a[1]||"",dl=-1<o.stack.indexOf(`
|
|
833
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
834
|
-
`+So+n+dl}var fl=!1;function hl(n,a){if(!n||fl)return"";fl=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(a){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ke){var Q=ke}Reflect.construct(n,[],me)}else{try{me.call()}catch(ke){Q=ke}me=!1;try{var ae=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),me=!0,new n}finally{me&&(ae!==void 0?Object.defineProperty(n.prototype,"props",ae):delete n.prototype.props)}}}else{try{throw Error()}catch(ke){Q=ke}(me=n())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ke){if(ke&&Q&&typeof ke.stack=="string")return[ke.stack,Q.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),v=h[0],_=h[1];if(v&&_){var B=v.split(`
|
|
835
|
-
`),ne=_.split(`
|
|
836
|
-
`);for(d=l=0;l<B.length&&!B[l].includes("DetermineComponentFrameRoot");)l++;for(;d<ne.length&&!ne[d].includes("DetermineComponentFrameRoot");)d++;if(l===B.length||d===ne.length)for(l=B.length-1,d=ne.length-1;1<=l&&0<=d&&B[l]!==ne[d];)d--;for(;1<=l&&0<=d;l--,d--)if(B[l]!==ne[d]){if(l!==1||d!==1)do if(l--,d--,0>d||B[l]!==ne[d]){var ie=`
|
|
837
|
-
`+B[l].replace(" at new "," at ");return n.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",n.displayName)),ie}while(1<=l&&0<=d);break}}}finally{fl=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?ar(o):""}function Qp(n,a){switch(n.tag){case 26:case 27:case 5:return ar(n.type);case 16:return ar("Lazy");case 13:return n.child!==a&&a!==null?ar("Suspense Fallback"):ar("Suspense");case 19:return ar("SuspenseList");case 0:case 15:return hl(n.type,!1);case 11:return hl(n.type.render,!1);case 1:return hl(n.type,!0);case 31:return ar("Activity");case 30:return ar("ViewTransition");default:return""}}function hd(n){try{var a="",o=null;do a+=Qp(n,o),o=n,n=n.return;while(n);return a}catch(l){return`
|
|
838
|
-
Error generating stack: `+l.message+`
|
|
839
|
-
`+l.stack}}var pl=Object.prototype.hasOwnProperty,ml=e.unstable_scheduleCallback,ba=e.unstable_cancelCallback,em=e.unstable_shouldYield,tm=e.unstable_requestPaint,Ln=e.unstable_now,nm=e.unstable_getCurrentPriorityLevel,pd=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,Ye=e.unstable_NormalPriority,Nt=e.unstable_LowPriority,Ss=e.unstable_IdlePriority,jn=e.log,_o=e.unstable_setDisableYieldValue,gl=null,is=null;function wa(n){if(typeof jn=="function"&&_o(n),is&&typeof is.setStrictMode=="function")try{is.setStrictMode(gl,n)}catch{}}var os=Math.clz32?Math.clz32:aN,sN=Math.log,rN=Math.LN2;function aN(n){return n>>>=0,n===0?32:31-(sN(n)/rN|0)|0}var md=256,gd=262144,yd=4194304;function wi(n){var a=n&42;if(a!==0)return a;switch(n&-n){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:return n&-n;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function vd(n,a,o){var l=n.pendingLanes;if(l===0)return 0;var d=0,h=n.suspendedLanes,v=n.pingedLanes;n=n.warmLanes;var _=l&134217727;return _!==0?(l=_&~h,l!==0?d=wi(l):(v&=_,v!==0?d=wi(v):o||(o=_&~n,o!==0&&(d=wi(o))))):(_=l&~h,_!==0?d=wi(_):v!==0?d=wi(v):o||(o=l&~n,o!==0&&(d=wi(o)))),d===0?0:a!==0&&a!==d&&(a&h)===0&&(h=d&-d,o=a&-a,h>=o||h===32&&(o&4194048)!==0)?a:d}function yl(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function t1(n,a){(a&8)!==0&&(a|=a&32);var o=n.entangledLanes;if(o!==0)for(n=n.entanglements,o&=a;0<o;){var l=31-os(o),d=1<<l;a|=n[l],o&=~d}return a}function iN(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 n1(){var n=yd;return yd<<=1,(yd&62914560)===0&&(yd=4194304),n}function sm(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function vl(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function oN(n,a,o,l,d,h){var v=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var _=n.entanglements,B=n.expirationTimes,ne=n.hiddenUpdates;for(o=v&~o;0<o;){var ie=31-os(o),me=1<<ie;_[ie]=0,B[ie]=-1;var Q=ne[ie];if(Q!==null)for(ne[ie]=null,ie=0;ie<Q.length;ie++){var ae=Q[ie];ae!==null&&(ae.lane&=-536870913)}o&=~me}l!==0&&s1(n,l,0),h!==0&&d===0&&n.tag!==0&&(n.suspendedLanes|=h&~(v&~a))}function s1(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var l=31-os(a);n.entangledLanes|=a,n.entanglements[l]=n.entanglements[l]|1073741824|o&261930}function r1(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var l=31-os(o),d=1<<l;d&a|n[l]&a&&(n[l]|=a),o&=~d}}function a1(n,a){var o=a&-a;return o=(o&42)!==0?1:rm(o),(o&(n.suspendedLanes|a))!==0?0:o}function rm(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function am(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function i1(){var n=_e.p;return n!==0?n:(n=window.event,n===void 0?32:hE(n.type))}function o1(n,a){var o=_e.p;try{return _e.p=n,a()}finally{_e.p=o}}var Mr=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Mr,Wn="__reactProps$"+Mr,ko="__reactContainer$"+Mr,c1="__reactEvents$"+Mr,cN="__reactListeners$"+Mr,lN="__reactHandles$"+Mr,l1="__reactResources$"+Mr,bl="__reactMarker$"+Mr,bd="__reactLoad$"+Mr;function wd(n){delete n[Sn],delete n[Wn],delete n[cN],delete n[lN]}function Ti(n){var a;if(a=n[Sn])return a;for(var o=n.parentNode;o;){if(a=o[ko]||o[Sn]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=Z2(n);n!==null;){if(o=n[Sn])return o;n=Z2(n)}return a}n=o,o=n.parentNode}return null}function Ao(n){if(n=n[Sn]||n[ko]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function wl(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(r(33))}function Oo(n){var a=n[l1];return a||(a=n[l1]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function mn(n){n[bl]=!0}function u1(n){n[bd]=void 0}var d1=new Set,f1={};function Ei(n,a){No(n,a),No(n+"Capture",a)}function No(n,a){for(f1[n]=a,n=0;n<a.length;n++)d1.add(a[n])}var uN=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]*$"),h1={},p1={};function dN(n){return pl.call(p1,n)?!0:pl.call(h1,n)?!1:uN.test(n)?p1[n]=!0:(h1[n]=!0,!1)}var dt=!1;function m1(){var n=dt;return dt=!1,n}function Td(n,a,o){if(dN(a))if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var l=a.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,o)}}function Ed(n,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,o)}}function Dr(n,a,o,l){if(l===null)n.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(a,o,l)}}function cs(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function g1(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function fN(n,a,o){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,h=l.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return d.call(this)},set:function(v){o=""+v,h.call(this,v)}}),Object.defineProperty(n,a,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(v){o=""+v},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function im(n){if(!n._valueTracker){var a=g1(n)?"checked":"value";n._valueTracker=fN(n,a,""+n[a])}}function y1(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),l="";return n&&(l=g1(n)?n.checked?"true":"false":n.value),n=l,n!==o?(a.setValue(n),!0):!1}var hN=/[\n"\\]/g;function _s(n){return n.replace(hN,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function om(n,a,o,l,d,h,v,_){n.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?n.type=v:n.removeAttribute("type"),a!=null?v==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+cs(a)):n.value!==""+cs(a)&&(n.value=""+cs(a)):v!=="submit"&&v!=="reset"||n.removeAttribute("value"),a!=null?v==="number"&&n.value==a?cm(n,cs(n.value)):cm(n,cs(a)):o!=null?cm(n,cs(o)):l!=null&&n.removeAttribute("value"),d==null&&h!=null&&(n.defaultChecked=!!h),d!=null&&(n.checked=d&&typeof d!="function"&&typeof d!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+cs(_):n.removeAttribute("name")}function v1(n,a,o,l,d,h,v,_){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(n.type=h),a!=null||o!=null){if(!(h!=="submit"&&h!=="reset"||a!=null)){im(n);return}o=o!=null?""+cs(o):"",a=a!=null?""+cs(a):o,_||a===n.value||(n.value=a),n.defaultValue=a}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=_?n.checked:!!l,n.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.name=v),im(n)}function cm(n,a){n.defaultValue!==""+a&&(n.defaultValue=""+a)}function xo(n,a,o,l){if(n=n.options,a){a={};for(var d=0;d<o.length;d++)a["$"+o[d]]=!0;for(o=0;o<n.length;o++)d=a.hasOwnProperty("$"+n[o].value),n[o].selected!==d&&(n[o].selected=d),d&&l&&(n[o].defaultSelected=!0)}else{for(o=""+cs(o),a=null,d=0;d<n.length;d++){if(n[d].value===o){n[d].selected=!0,l&&(n[d].defaultSelected=!0);return}a!==null||n[d].disabled||(a=n[d])}a!==null&&(a.selected=!0)}}function b1(n,a,o){if(a!=null&&(a=""+cs(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o!=null?""+cs(o):""}function w1(n,a,o,l){if(a==null){if(l!=null){if(o!=null)throw Error(r(92));if(Ae(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),a=o}o=cs(a),n.defaultValue=o,l=n.textContent,l===o&&l!==""&&l!==null&&(n.value=l),im(n)}function Co(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var pN=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 T1(n,a,o){var l=a.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":l?n.setProperty(a,o):typeof o!="number"||o===0||pN.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function E1(n,a,o){if(a!=null&&typeof a!="object")throw Error(r(62));if(n=n.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||a!=null&&a.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="",dt=!0);for(var d in a)l=a[d],a.hasOwnProperty(d)&&o[d]!==l&&(T1(n,d,l),dt=!0)}else for(var h in a)a.hasOwnProperty(h)&&T1(n,h,a[h])}function lm(n){if(n.indexOf("-")===-1)return!1;switch(n){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 mN=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"],["maskType","mask-type"],["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"]]),gN=/^[\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 Sd(n){return gN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ir(){}var um=null;function dm(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Io=null,Ro=null;function S1(n){var a=Ao(n);if(a&&(n=a.stateNode)){var o=n[Wn]||null;e:switch(n=a.stateNode,a.type){case"input":if(om(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),a=o.name,o.type==="radio"&&a!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+_s(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var l=o[a];if(l!==n&&l.form===n.form){var d=l[Wn]||null;if(!d)throw Error(r(90));om(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(a=0;a<o.length;a++)l=o[a],l.form===n.form&&y1(l)}break e;case"textarea":b1(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&xo(n,!!o.multiple,a,!1)}}}var fm=!1;function _1(n,a,o){if(fm)return n(a,o);fm=!0;try{var l=n(a);return l}finally{if(fm=!1,(Io!==null||Ro!==null)&&(_f(),Io&&(a=Io,n=Ro,Ro=Io=null,S1(a),n)))for(a=0;a<n.length;a++)S1(n[a])}}function Tl(n,a){var o=n.stateNode;if(o===null)return null;var l=o[Wn]||null;if(l===null)return null;o=l[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(r(231,a,typeof o));return o}var Ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hm=!1;if(Ur)try{var El={};Object.defineProperty(El,"passive",{get:function(){hm=!0}}),window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{hm=!1}var Ta=null,pm=null,_d=null;function k1(){if(_d)return _d;var n,a=pm,o=a.length,l,d="value"in Ta?Ta.value:Ta.textContent,h=d.length;for(n=0;n<o&&a[n]===d[n];n++);var v=o-n;for(l=1;l<=v&&a[o-l]===d[h-l];l++);return _d=d.slice(n,1<l?1-l:void 0)}function kd(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function Ad(){return!0}function A1(){return!1}function zn(n){function a(o,l,d,h,v){this._reactName=o,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(o=n[_],this[_]=o?o(h):h[_]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ad:A1,this.isPropagationStopped=A1,this}return K(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ad)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ad)},persist:function(){},isPersistent:Ad}),a}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Od=zn(Ea),Sl=K({},Ea,{view:0,detail:0}),yN=zn(Sl),mm,gm,_l,Nd=K({},Sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vm,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==_l&&(_l&&n.type==="mousemove"?(mm=n.screenX-_l.screenX,gm=n.screenY-_l.screenY):gm=mm=0,_l=n),mm)},movementY:function(n){return"movementY"in n?n.movementY:gm}}),O1=zn(Nd),vN=K({},Nd,{dataTransfer:0}),bN=zn(vN),wN=K({},Sl,{relatedTarget:0}),ym=zn(wN),TN=K({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),EN=zn(TN),SN=K({},Ea,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),_N=zn(SN),kN=K({},Ea,{data:0}),N1=zn(kN),AN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ON={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"},NN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xN(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=NN[n])?!!a[n]:!1}function vm(){return xN}var CN=K({},Sl,{key:function(n){if(n.key){var a=AN[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=kd(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?ON[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vm,charCode:function(n){return n.type==="keypress"?kd(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?kd(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),IN=zn(CN),RN=K({},Nd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x1=zn(RN),jN=K({},Ea,{submitter:0}),MN=zn(jN),DN=K({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vm}),UN=zn(DN),BN=K({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),LN=zn(BN),zN=K({},Nd,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),$N=zn(zN),VN=K({},Ea,{newState:0,oldState:0,source:0}),PN=zn(VN),GN=[9,13,27,32],bm=Ur&&"CompositionEvent"in window,kl=null;Ur&&"documentMode"in document&&(kl=document.documentMode);var FN=Ur&&"TextEvent"in window&&!kl,C1=Ur&&(!bm||kl&&8<kl&&11>=kl),I1=" ",R1=!1;function j1(n,a){switch(n){case"keyup":return GN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M1(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var jo=!1;function HN(n,a){switch(n){case"compositionend":return M1(a);case"keypress":return a.which!==32?null:(R1=!0,I1);case"textInput":return n=a.data,n===I1&&R1?null:n;default:return null}}function qN(n,a){if(jo)return n==="compositionend"||!bm&&j1(n,a)?(n=k1(),_d=pm=Ta=null,jo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return C1&&a.locale!=="ko"?null:a.data;default:return null}}var ZN={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 D1(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!ZN[n.type]:a==="textarea"}function U1(n,a,o,l){Io?Ro?Ro.push(l):Ro=[l]:Io=l,a=Cf(a,"onChange"),0<a.length&&(o=new Od("onChange","change",null,o,l),n.push({event:o,listeners:a}))}var Al=null,Ol=null;function YN(n){S2(n,0)}function xd(n){var a=wl(n);if(y1(a))return n}function B1(n,a){if(n==="change")return a}var L1=!1;if(Ur){var wm;if(Ur){var Tm="oninput"in document;if(!Tm){var z1=document.createElement("div");z1.setAttribute("oninput","return;"),Tm=typeof z1.oninput=="function"}wm=Tm}else wm=!1;L1=wm&&(!document.documentMode||9<document.documentMode)}function $1(){Al&&(Al.detachEvent("onpropertychange",V1),Ol=Al=null)}function V1(n){if(n.propertyName==="value"&&xd(Ol)){var a=[];U1(a,Ol,n,dm(n)),_1(YN,a)}}function WN(n,a,o){n==="focusin"?($1(),Al=a,Ol=o,Al.attachEvent("onpropertychange",V1)):n==="focusout"&&$1()}function XN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return xd(Ol)}function JN(n,a){if(n==="click")return xd(a)}function KN(n,a){if(n==="input"||n==="change")return xd(a)}function QN(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var ls=typeof Object.is=="function"?Object.is:QN;function Nl(n,a){if(ls(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var o=Object.keys(n),l=Object.keys(a);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var d=o[l];if(!pl.call(a,d)||!ls(n[d],a[d]))return!1}return!0}function Em(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function P1(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function G1(n,a){var o=P1(n);n=0;for(var l;o;){if(o.nodeType===3){if(l=n+o.textContent.length,n<=a&&l>=a)return{node:o,offset:a-n};n=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=P1(o)}}function F1(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?F1(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function H1(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Em(n.document);a instanceof n.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)n=a.contentWindow;else break;a=Em(n.document)}return a}function Sm(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var ex=Ur&&"documentMode"in document&&11>=document.documentMode,Mo=null,_m=null,xl=null,km=!1;function q1(n,a,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;km||Mo==null||Mo!==Em(l)||(l=Mo,"selectionStart"in l&&Sm(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),xl&&Nl(xl,l)||(xl=l,l=Cf(_m,"onSelect"),0<l.length&&(a=new Od("onSelect","select",null,a,o),n.push({event:a,listeners:l}),a.target=Mo)))}function Si(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var Do={animationend:Si("Animation","AnimationEnd"),animationiteration:Si("Animation","AnimationIteration"),animationstart:Si("Animation","AnimationStart"),transitionrun:Si("Transition","TransitionRun"),transitionstart:Si("Transition","TransitionStart"),transitioncancel:Si("Transition","TransitionCancel"),transitionend:Si("Transition","TransitionEnd")},Am={},Z1={};Ur&&(Z1=document.createElement("div").style,"AnimationEvent"in window||(delete Do.animationend.animation,delete Do.animationiteration.animation,delete Do.animationstart.animation),"TransitionEvent"in window||delete Do.transitionend.transition);function _i(n){if(Am[n])return Am[n];if(!Do[n])return n;var a=Do[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in Z1)return Am[n]=a[o];return n}var Y1=_i("animationend"),W1=_i("animationiteration"),X1=_i("animationstart"),tx=_i("transitionrun"),nx=_i("transitionstart"),sx=_i("transitioncancel"),J1=_i("transitionend"),K1=new Map,Om="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Om.push("scrollEnd");function Ps(n,a){K1.set(n,a),Ei(a,[n])}var rx=0;function Br(n,a){if(n.name!=null&&n.name!=="auto")return n.name;if(a.autoName!==null)return a.autoName;n=qs.identifierPrefix;var o=rx++;return n="_"+n+"t_"+o.toString(32)+"_",a.autoName=n}function Q1(n){if(n==null||typeof n=="string")return n;var a=null,o=tc;if(o!==null)for(var l=0;l<o.length;l++){var d=n[o[l]];if(d!=null){if(d==="none")return"none";a=a==null?d:a+(" "+d)}}return a??n.default}function Lr(n,a){return n=Q1(n),a=Q1(a),a==null?n==="auto"?null:n:a==="auto"?null:a}var Cd=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},ks=[],Uo=0,Nm=0;function Id(){for(var n=Uo,a=Nm=Uo=0;a<n;){var o=ks[a];ks[a++]=null;var l=ks[a];ks[a++]=null;var d=ks[a];ks[a++]=null;var h=ks[a];if(ks[a++]=null,l!==null&&d!==null){var v=l.pending;v===null?d.next=d:(d.next=v.next,v.next=d),l.pending=d}h!==0&&ew(o,d,h)}}function Rd(n,a,o,l){ks[Uo++]=n,ks[Uo++]=a,ks[Uo++]=o,ks[Uo++]=l,Nm|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function xm(n,a,o,l){return Rd(n,a,o,l),jd(n)}function ki(n,a){return Rd(n,null,null,a),jd(n)}function ew(n,a,o){n.lanes|=o;var l=n.alternate;l!==null&&(l.lanes|=o);for(var d=!1,h=n.return;h!==null;)h.childLanes|=o,l=h.alternate,l!==null&&(l.childLanes|=o),h.tag===22&&(n=h.stateNode,n===null||n._visibility&1||(d=!0)),n=h,h=h.return;return n.tag===3?(h=n.stateNode,d&&a!==null&&(d=31-os(o),n=h.hiddenUpdates,l=n[d],l===null?n[d]=[a]:l.push(a),a.lane=o|536870912),h):null}function jd(n){if(50<Jl)throw Jl=0,Sf=null,Error(r(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var Bo={};function ax(n,a,o,l){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(n,a,o,l){return new ax(n,a,o,l)}function Cm(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zr(n,a){var o=n.alternate;return o===null?(o=Xn(n.tag,a,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=a,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&1206910976,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,a=n.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function tw(n,a){n.flags&=1206910978;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,a=o.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function Md(n,a,o,l,d,h){var v=0;if(l=n,typeof l=="function")Cm(l)&&(v=1);else if(typeof l=="string")v=jC(n,o,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(l){case V:return n=Xn(31,o,a,d),n.elementType=V,n.lanes=h,n;case P:return Ai(o.children,d,h,a);case U:v=8,d|=24;break;case q:return n=Xn(12,o,a,d|2),n.elementType=q,n.lanes=h,n;case j:return n=Xn(13,o,a,d),n.elementType=j,n.lanes=h,n;case D:return n=Xn(19,o,a,d),n.elementType=D,n.lanes=h,n;case re:case I:return n=d|32,n=Xn(30,o,a,n),n.elementType=I,n.lanes=h,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case M:v=10;break e;case L:v=9;break e;case k:v=11;break e;case z:v=14;break e;case J:v=16,l=null;break e}v=29,o=Error(r(130,n===null?"null":typeof n,"")),l=null}return a=Xn(v,o,a,d),a.elementType=n,a.type=l,a.lanes=h,a}function Ai(n,a,o,l){return n=Xn(7,n,l,a),n.lanes=o,n}function Im(n,a,o){return n=Xn(6,n,null,a),n.lanes=o,n}function nw(n){var a=Xn(18,null,null,0);return a.stateNode=n,a}function Rm(n,a,o){return a=Xn(4,n.children!==null?n.children:[],n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var sw=new WeakMap;function As(n,a){if(typeof n=="object"&&n!==null){var o=sw.get(n);return o!==void 0?o:(a={value:n,source:a,stack:hd(a)},sw.set(n,a),a)}return{value:n,source:a,stack:hd(a)}}var Lo=[],zo=0,Dd=null,Cl=0,Os=[],Ns=0,Sa=null,or=1,cr="";function $r(n,a){Lo[zo++]=Cl,Lo[zo++]=Dd,Dd=n,Cl=a}function rw(n,a,o){Os[Ns++]=or,Os[Ns++]=cr,Os[Ns++]=Sa,Sa=n;var l=or;n=cr;var d=32-os(l)-1;l&=~(1<<d),o+=1;var h=32-os(a)+d;if(30<h){var v=d-d%5;h=(l&(1<<v)-1).toString(32),l>>=v,d-=v,or=1<<32-os(a)+d|o<<d|l,cr=h+n}else or=1<<h|o<<d|l,cr=n}function Ud(n){n.return!==null&&($r(n,1),rw(n,1,0))}function jm(n){for(;n===Dd;)Dd=Lo[--zo],Lo[zo]=null,Cl=Lo[--zo],Lo[zo]=null;for(;n===Sa;)Sa=Os[--Ns],Os[Ns]=null,cr=Os[--Ns],Os[Ns]=null,or=Os[--Ns],Os[Ns]=null}function aw(n,a){Os[Ns++]=or,Os[Ns++]=cr,Os[Ns++]=Sa,or=a.id,cr=a.overflow,Sa=n}var gn=null,Rt=null,Ke=!1,_a=null,xs=!1,Mm=Error(r(519));function ka(n){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Il(As(a,n)),Mm}function iw(n){var a=n.stateNode,o=n.type,l=n.memoizedProps;switch(a[Sn]=n,a[Wn]=l,o){case"dialog":tt("cancel",a),tt("close",a);break;case"iframe":case"object":case"embed":tt("load",a);break;case"video":case"audio":for(o=0;o<Ql.length;o++)tt(Ql[o],a);break;case"source":tt("error",a);break;case"img":case"image":case"link":tt("error",a),tt("load",a);break;case"details":tt("toggle",a);break;case"input":tt("invalid",a),v1(a,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",a);break;case"textarea":tt("invalid",a),w1(a,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||a.textContent===""+o||l.suppressHydrationWarning===!0||O2(a.textContent,o)?(l.popover!=null&&(tt("beforetoggle",a),tt("toggle",a)),l.onScroll!=null&&tt("scroll",a),l.onScrollEnd!=null&&tt("scrollend",a),l.onClick!=null&&(a.onclick=ir),a=!0):a=!1,a||ka(n,!0)}function Bd(n){for(gn=n.return;gn;)switch(gn.tag){case 5:case 31:case 13:xs=!1;return;case 27:case 3:xs=!0;return;default:gn=gn.return}}function $o(n){if(n!==gn)return!1;if(!Ke)return Bd(n),Ke=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||u0(n.type,n.memoizedProps)),o=!o),o&&Rt&&ka(n),Bd(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Rt=q2(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));Rt=q2(n)}else a===27?(a=Rt,Va(n.type)?(n=b0,b0=null,Rt=n):Rt=a):Rt=gn?Is(n.stateNode.nextSibling):null;return!0}function Oi(){Rt=gn=null,Ke=!1}function Dm(){var n=_a;return n!==null&&(Qn===null?Qn=n:Qn.push.apply(Qn,n),_a=null),n}function Il(n){_a===null?_a=[n]:_a.push(n)}var Um=te(null),Ni=null,Vr=null;function Aa(n,a,o){fe(Um,a._currentValue),a._currentValue=o}function Pr(n){n._currentValue=Um.current,de(Um)}function Ld(n,a,o){for(;n!==null;){var l=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,l!==null&&(l.childLanes|=a)):l!==null&&(l.childLanes&a)!==a&&(l.childLanes|=a),n===o)break;n=n.return}}function Bm(n,a,o,l){var d=n.child;for(d!==null&&(d.return=n);d!==null;){var h=d.dependencies;if(h!==null){var v=d.child;h=h.firstContext;e:for(;h!==null;){var _=h;h=d;for(var B=0;B<a.length;B++)if(_.context===a[B]){h.lanes|=o,_=h.alternate,_!==null&&(_.lanes|=o),Ld(h.return,o,n),l||(v=null);break e}h=_.next}}else if(d.tag===18){if(v=d.return,v===null)throw Error(r(341));v.lanes|=o,h=v.alternate,h!==null&&(h.lanes|=o),Ld(v,o,n),v=null}else d.tag===13&&d.memoizedState!==null&&d.memoizedState.dehydrated===null?(d.lanes|=o,v=d.alternate,v!==null&&(v.lanes|=o),Ld(d.return,o,n),v=d.child,v=v!==null?v.sibling:null):v=d.child;if(v!==null)v.return=d;else for(v=d;v!==null;){if(v===n){v=null;break}if(d=v.sibling,d!==null){d.return=v.return,v=d;break}v=v.return}d=v}}function xi(n,a,o,l){n=null;for(var d=a,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var v=d.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var _=d.type;ls(d.pendingProps.value,v.value)||(n!==null?n.push(_):n=[_])}}else if(d===Dt.current){if(v=d.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(n!==null?n.push(dc):n=[dc])}d=d.return}return n!==null&&Bm(a,n,o,l),a.flags|=262144,n!==null}function zd(n){for(n=n.firstContext;n!==null;){if(!ls(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ci(n){Ni=n,Vr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function _n(n){return ow(Ni,n)}function $d(n,a){return Ni===null&&Ci(n),ow(n,a)}function ow(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Vr===null){if(n===null)throw Error(r(308));Vr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Vr=Vr.next=a;return o}var ix=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(o,l){n.push(l)}};this.abort=function(){a.aborted=!0,n.forEach(function(o){return o()})}},ox=e.unstable_scheduleCallback,cx=e.unstable_NormalPriority,Jt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lm(){return{controller:new ix,data:new Map,refCount:0}}function Rl(n){n.refCount--,n.refCount===0&&ox(cx,function(){n.controller.abort()})}function cw(n,a){if((n.pendingLanes&4194048)!==0){var o=n.transitionTypes;for(o===null&&(o=n.transitionTypes=[]),n=0;n<a.length;n++){var l=a[n];o.indexOf(l)===-1&&o.push(l)}}}var jl=null;function lx(n){var a=n.transitionTypes;return n.transitionTypes=null,a}var Ml=null,zm=0,Ii=0,Vo=null;function ux(n,a){if(Ml===null){var o=Ml=[];zm=0,Ii=t0(),Vo={status:"pending",value:void 0,then:function(l){o.push(l)}}}return zm++,a.then(lw,lw),a}function lw(){if(--zm===0&&(jl=null,Ml!==null)){Vo!==null&&(Vo.status="fulfilled");var n=Ml;Ml=null,Ii=0,Vo=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function dx(n,a){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return n.then(function(){l.status="fulfilled",l.value=a;for(var d=0;d<o.length;d++)(0,o[d])(a)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var uw=be.S;be.S=function(n,a){if(n2=Ln(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&ux(n,a),jl!==null)for(var o=ac;o!==null;)cw(o,jl),o=o.next;if(o=n.types,o!==null){for(var l=ac;l!==null;)cw(l,o),l=l.next;if(Ii!==0){l=jl,l===null&&(l=jl=[]);for(var d=0;d<o.length;d++){var h=o[d];l.indexOf(h)===-1&&l.push(h)}}}uw!==null&&uw(n,a)};var Ri=te(null);function $m(){var n=Ri.current;return n!==null?n:xt.pooledCache}function Vd(n,a){a===null?fe(Ri,Ri.current):fe(Ri,a.pool)}function dw(){var n=$m();return n===null?null:{parent:Jt._currentValue,pool:n}}var Po=Error(r(460)),Vm=Error(r(474)),Pd=Error(r(542)),Gd={then:function(){}};function fw(n){return n=n.status,n==="fulfilled"||n==="rejected"}function hw(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(ir,ir),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,mw(n),n===void 0&&!("reason"in a)?Error(r(600)):n;default:if(typeof a.status=="string")a.then(ir,ir);else{if(n=xt,n!==null&&100<n.shellSuspendCounter)throw Error(r(482));n=a,n.status="pending",n.then(function(l){if(a.status==="pending"){var d=a;d.status="fulfilled",d.value=l}},function(l){if(a.status==="pending"){var d=a;d.status="rejected",d.reason=l}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,mw(n),n}throw Mi=a,Po}}function ji(n){try{var a=n._init;return a(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Mi=o,Po):o}}var Mi=null;function pw(){if(Mi===null)throw Error(r(459));var n=Mi;return Mi=null,n}function mw(n){if(n===Po||n===Pd)throw Error(r(483))}var Go=null,Dl=0;function Fd(n){var a=Dl;return Dl+=1,Go===null&&(Go=[]),hw(Go,n,a)}function Oa(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function Hd(n,a){throw a.$$typeof===w?Error(r(525)):(n=Object.prototype.toString.call(a),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function gw(n){function a(ee,Z){if(n){var se=ee.deletions;se===null?(ee.deletions=[Z],ee.flags|=16):se.push(Z)}}function o(ee,Z){if(!n)return null;for(;Z!==null;)a(ee,Z),Z=Z.sibling;return null}function l(ee){for(var Z=new Map;ee!==null;)ee.key===null?Z.set(ee.index,ee):Z.set(ee.key,ee),ee=ee.sibling;return Z}function d(ee,Z){return ee=zr(ee,Z),ee.index=0,ee.sibling=null,ee}function h(ee,Z,se){return ee.index=se,n?(se=ee.alternate,se!==null?(se=se.index,se<Z?(ee.flags|=2,Z):se):(ee.flags|=134217730,Z)):(ee.flags|=1048576,Z)}function v(ee){return n&&ee.alternate===null&&(ee.flags|=134217730),ee}function _(ee,Z,se,pe){return Z===null||Z.tag!==6?(Z=Im(se,ee.mode,pe),Z.return=ee,Z):(Z=d(Z,se),Z.return=ee,Z)}function B(ee,Z,se,pe){var Ie=se.type;return Ie===P?(ee=ie(ee,Z,se.props.children,pe,se.key),Oa(ee,se),ee):Z!==null&&(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===J&&ji(Ie)===Z.type)?(Z=d(Z,se.props),Oa(Z,se),Z.return=ee,Z):(Z=Md(se.type,se.key,se.props,null,ee.mode,pe),Oa(Z,se),Z.return=ee,Z)}function ne(ee,Z,se,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==se.containerInfo||Z.stateNode.implementation!==se.implementation?(Z=Rm(se,ee.mode,pe),Z.return=ee,Z):(Z=d(Z,se.children||[]),Z.return=ee,Z)}function ie(ee,Z,se,pe,Ie){return Z===null||Z.tag!==7?(Z=Ai(se,ee.mode,pe,Ie),Z.return=ee,Z):(Z=d(Z,se),Z.return=ee,Z)}function me(ee,Z,se){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Im(""+Z,ee.mode,se),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case A:return se=Md(Z.type,Z.key,Z.props,null,ee.mode,se),Oa(se,Z),se.return=ee,se;case N:return Z=Rm(Z,ee.mode,se),Z.return=ee,Z;case J:return Z=ji(Z),me(ee,Z,se)}if(Ae(Z)||he(Z))return Z=Ai(Z,ee.mode,se,null),Z.return=ee,Z;if(typeof Z.then=="function")return me(ee,Fd(Z),se);if(Z.$$typeof===M)return me(ee,$d(ee,Z),se);Hd(ee,Z)}return null}function Q(ee,Z,se,pe){var Ie=Z!==null?Z.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:_(ee,Z,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return se.key===Ie?B(ee,Z,se,pe):null;case N:return se.key===Ie?ne(ee,Z,se,pe):null;case J:return se=ji(se),Q(ee,Z,se,pe)}if(Ae(se)||he(se))return Ie!==null?null:ie(ee,Z,se,pe,null);if(typeof se.then=="function")return Q(ee,Z,Fd(se),pe);if(se.$$typeof===M)return Q(ee,Z,$d(ee,se),pe);Hd(ee,se)}return null}function ae(ee,Z,se,pe,Ie){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ee=ee.get(se)||null,_(Z,ee,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:return ee=ee.get(pe.key===null?se:pe.key)||null,B(Z,ee,pe,Ie);case N:return ee=ee.get(pe.key===null?se:pe.key)||null,ne(Z,ee,pe,Ie);case J:return pe=ji(pe),ae(ee,Z,se,pe,Ie)}if(Ae(pe)||he(pe))return ee=ee.get(se)||null,ie(Z,ee,pe,Ie,null);if(typeof pe.then=="function")return ae(ee,Z,se,Fd(pe),Ie);if(pe.$$typeof===M)return ae(ee,Z,se,$d(Z,pe),Ie);Hd(Z,pe)}return null}function ke(ee,Z,se,pe){for(var Ie=null,ot=null,Ue=Z,$e=Z=0,en=null;Ue!==null&&$e<se.length;$e++){Ue.index>$e?(en=Ue,Ue=null):en=Ue.sibling;var ut=Q(ee,Ue,se[$e],pe);if(ut===null){Ue===null&&(Ue=en);break}n&&Ue&&ut.alternate===null&&a(ee,Ue),Z=h(ut,Z,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut,Ue=en}if($e===se.length)return o(ee,Ue),Ke&&$r(ee,$e),Ie;if(Ue===null){for(;$e<se.length;$e++)Ue=me(ee,se[$e],pe),Ue!==null&&(Z=h(Ue,Z,$e),ot===null?Ie=Ue:ot.sibling=Ue,ot=Ue);return Ke&&$r(ee,$e),Ie}for(Ue=l(Ue);$e<se.length;$e++)en=ae(Ue,ee,$e,se[$e],pe),en!==null&&(n&&(ut=en.alternate,ut!==null&&Ue.delete(ut.key===null?$e:ut.key)),Z=h(en,Z,$e),ot===null?Ie=en:ot.sibling=en,ot=en);return n&&Ue.forEach(function(qa){return a(ee,qa)}),Ke&&$r(ee,$e),Ie}function Re(ee,Z,se,pe){if(se==null)throw Error(r(151));for(var Ie=null,ot=null,Ue=Z,$e=Z=0,en=null,ut=se.next();Ue!==null&&!ut.done;$e++,ut=se.next()){Ue.index>$e?(en=Ue,Ue=null):en=Ue.sibling;var qa=Q(ee,Ue,ut.value,pe);if(qa===null){Ue===null&&(Ue=en);break}n&&Ue&&qa.alternate===null&&a(ee,Ue),Z=h(qa,Z,$e),ot===null?Ie=qa:ot.sibling=qa,ot=qa,Ue=en}if(ut.done)return o(ee,Ue),Ke&&$r(ee,$e),Ie;if(Ue===null){for(;!ut.done;$e++,ut=se.next())ut=me(ee,ut.value,pe),ut!==null&&(Z=h(ut,Z,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return Ke&&$r(ee,$e),Ie}for(Ue=l(Ue);!ut.done;$e++,ut=se.next())ut=ae(Ue,ee,$e,ut.value,pe),ut!==null&&(n&&(en=ut.alternate,en!==null&&Ue.delete(en.key===null?$e:en.key)),Z=h(ut,Z,$e),ot===null?Ie=ut:ot.sibling=ut,ot=ut);return n&&Ue.forEach(function(HC){return a(ee,HC)}),Ke&&$r(ee,$e),Ie}function Xe(ee,Z,se,pe){if(typeof se=="object"&&se!==null&&se.type===P&&se.key===null&&se.props.ref===void 0&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case A:e:{for(var Ie=se.key;Z!==null;){if(Z.key===Ie){if(Ie=se.type,Ie===P){if(Z.tag===7){o(ee,Z.sibling),pe=d(Z,se.props.children),Oa(pe,se),pe.return=ee,ee=pe;break e}}else if(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===J&&ji(Ie)===Z.type){o(ee,Z.sibling),pe=d(Z,se.props),Oa(pe,se),pe.return=ee,ee=pe;break e}o(ee,Z);break}else a(ee,Z);Z=Z.sibling}se.type===P?(pe=Ai(se.props.children,ee.mode,pe,se.key),Oa(pe,se),pe.return=ee,ee=pe):(pe=Md(se.type,se.key,se.props,null,ee.mode,pe),Oa(pe,se),pe.return=ee,ee=pe)}return v(ee);case N:e:{for(Ie=se.key;Z!==null;){if(Z.key===Ie)if(Z.tag===4&&Z.stateNode.containerInfo===se.containerInfo&&Z.stateNode.implementation===se.implementation){o(ee,Z.sibling),pe=d(Z,se.children||[]),pe.return=ee,ee=pe;break e}else{o(ee,Z);break}else a(ee,Z);Z=Z.sibling}pe=Rm(se,ee.mode,pe),pe.return=ee,ee=pe}return v(ee);case J:return se=ji(se),Xe(ee,Z,se,pe)}if(Ae(se))return ke(ee,Z,se,pe);if(he(se)){if(Ie=he(se),typeof Ie!="function")throw Error(r(150));return se=Ie.call(se),Re(ee,Z,se,pe)}if(typeof se.then=="function")return Xe(ee,Z,Fd(se),pe);if(se.$$typeof===M)return Xe(ee,Z,$d(ee,se),pe);Hd(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Z!==null&&Z.tag===6?(o(ee,Z.sibling),pe=d(Z,se),pe.return=ee,ee=pe):(o(ee,Z),pe=Im(se,ee.mode,pe),pe.return=ee,ee=pe),v(ee)):o(ee,Z)}return function(ee,Z,se,pe){try{Dl=0;var Ie=Xe(ee,Z,se,pe);return Go=null,Ie}catch(Ue){if(Ue===Po||Ue===Pd)throw Ue;var ot=Xn(29,Ue,null,ee.mode);return ot.lanes=pe,ot.return=ee,ot}}}var Di=gw(!0),yw=gw(!1),Na=!1;function Pm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gm(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function xa(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ca(n,a,o){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var d=l.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a,a=jd(n),ew(n,null,o),a}return Rd(n,l,a,o),jd(n)}function Ul(n,a,o){if(a=a.updateQueue,a!==null&&(a=a.shared,(o&4194048)!==0)){var l=a.lanes;l&=n.pendingLanes,o|=l,a.lanes=o,r1(n,o)}}function Fm(n,a){var o=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=null,h=null;if(o=o.firstBaseUpdate,o!==null){do{var v={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};h===null?d=h=v:h=h.next=v,o=o.next}while(o!==null);h===null?d=h=a:h=h.next=a}else d=h=a;o={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=a:n.next=a,o.lastBaseUpdate=a}var Hm=!1;function Bl(){if(Hm){var n=Vo;if(n!==null)throw n}}function Ll(n,a,o,l){Hm=!1;var d=n.updateQueue;Na=!1;var h=d.firstBaseUpdate,v=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var B=_,ne=B.next;B.next=null,v===null?h=ne:v.next=ne,v=B;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,_=ie.lastBaseUpdate,_!==v&&(_===null?ie.firstBaseUpdate=ne:_.next=ne,ie.lastBaseUpdate=B))}if(h!==null){var me=d.baseState;v=0,ie=ne=B=null,_=h;do{var Q=_.lane&-536870913,ae=Q!==_.lane;if(ae?(it&Q)===Q:(l&Q)===Q){Q!==0&&Q===Ii&&(Hm=!0),ie!==null&&(ie=ie.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ke=n,Re=_;Q=a;var Xe=o;switch(Re.tag){case 1:if(ke=Re.payload,typeof ke=="function"){me=ke.call(Xe,me,Q);break e}me=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Re.payload,Q=typeof ke=="function"?ke.call(Xe,me,Q):ke,Q==null)break e;me=K({},me,Q);break e;case 2:Na=!0}}Q=_.callback,Q!==null&&(n.flags|=64,ae&&(n.flags|=8192),ae=d.callbacks,ae===null?d.callbacks=[Q]:ae.push(Q))}else ae={lane:Q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ie===null?(ne=ie=ae,B=me):ie=ie.next=ae,v|=Q;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;ae=_,_=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);ie===null&&(B=me),d.baseState=B,d.firstBaseUpdate=ne,d.lastBaseUpdate=ie,h===null&&(d.shared.lanes=0),Ba|=v,n.lanes=v,n.memoizedState=me}}function vw(n,a){if(typeof n!="function")throw Error(r(191,n));n.call(a)}function bw(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)vw(o[n],a)}var Ia=te(null),qd=te(0);function ww(n,a){n=Zr,fe(qd,n),fe(Ia,a),Zr=n|a.baseLanes}function qm(){fe(qd,Zr),fe(Ia,Ia.current)}function Zm(){Zr=qd.current,de(Ia),de(qd)}var kn=te(null),Mn=null;function Ra(n){var a=n.alternate;fe(An,An.current&1),fe(kn,n),Mn===null&&(a===null||Ia.current!==null||a.memoizedState!==null)&&(Mn=n)}function Ym(n){fe(An,An.current),fe(kn,n),Mn===null&&(Mn=n)}function Tw(n){n.tag===22?(fe(An,An.current),fe(kn,n),Mn===null&&(Mn=n)):ja()}function ja(){fe(An,An.current),fe(kn,kn.current)}function us(n){de(kn),Mn===n&&(Mn=null),de(An)}var An=te(0);function zl(n,a){fe(kn,kn.current),fe(An,a)}function Wm(n){de(An),de(kn),Mn===n&&(Mn=null)}function Zd(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||y0(o)||v0(o)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Gr=0,We=null,kt=null,Kt=null,Yd=!1,Fo=!1,Ui=!1,Wd=0,$l=0,Ho=null,fx=0;function Vt(){throw Error(r(321))}function Xm(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!ls(n[o],a[o]))return!1;return!0}function Jm(n,a,o,l,d,h){return Gr=h,We=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,be.H=n===null||n.memoizedState===null?rT:aT,Ui=!1,h=o(l,d),Ui=!1,Fo&&(h=Sw(a,o,l,d)),Ew(n),h}function Ew(n){be.H=nf;var a=kt!==null&&kt.next!==null;if(Gr=0,Kt=kt=We=null,Yd=!1,$l=0,Ho=null,a)throw Error(r(300));n===null||Qt||(n=n.dependencies,n!==null&&zd(n)&&(Qt=!0))}function Sw(n,a,o,l){We=n;var d=0;do{if(Fo&&(Ho=null),$l=0,Fo=!1,25<=d)throw Error(r(301));if(d+=1,Kt=kt=null,n.updateQueue!=null){var h=n.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}be.H=wx,h=a(o,l)}while(Fo);return h}function hx(){var n=be.H,a=n.useState()[0];return a=typeof a.then=="function"?Vl(a):a,n=n.useState()[0],(kt!==null?kt.memoizedState:null)!==n&&(We.flags|=1024),a}function Km(){var n=Wd!==0;return Wd=0,n}function Qm(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function eg(n){if(Yd){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Yd=!1}Gr=0,Kt=kt=We=null,Fo=!1,$l=Wd=0,Ho=null}function $n(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?We.memoizedState=Kt=n:Kt=Kt.next=n,Kt}function Zt(){if(kt===null){var n=We.alternate;n=n!==null?n.memoizedState:null}else n=kt.next;var a=Kt===null?We.memoizedState:Kt.next;if(a!==null)Kt=a,kt=n;else{if(n===null)throw We.alternate===null?Error(r(467)):Error(r(310));kt=n,n={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Kt===null?We.memoizedState=Kt=n:Kt=Kt.next=n}return Kt}function Xd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vl(n){var a=$l;return $l+=1,Ho===null&&(Ho=[]),n=hw(Ho,n,a),a=We,(Kt===null?a.memoizedState:Kt.next)===null&&(a=a.alternate,be.H=a===null||a.memoizedState===null?rT:aT),n}function Jd(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Vl(n);if(n.$$typeof===X)return;if(n.$$typeof===M)return _n(n)}throw Error(r(438,String(n)))}function tg(n){var a=null,o=We.updateQueue;if(o!==null&&(a=o.memoCache),a==null){var l=We.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(a={data:l.data.map(function(d){return d.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),o===null&&(o=Xd(),We.updateQueue=o),o.memoCache=a,o=a.data[a.index],o===void 0)for(o=a.data[a.index]=Array(n),l=0;l<n;l++)o[l]=ue;return a.index++,o}function Fr(n,a){return typeof a=="function"?a(n):a}function Kd(n){var a=Zt();return ng(a,kt,n)}function ng(n,a,o){var l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=n.baseQueue,h=l.pending;if(h!==null){if(d!==null){var v=d.next;d.next=h.next,h.next=v}a.baseQueue=d=h,l.pending=null}if(h=n.baseState,d===null)n.memoizedState=h;else{a=d.next;var _=v=null,B=null,ne=a,ie=!1;do{var me=ne.lane&-536870913;if(me!==ne.lane?(it&me)===me:(Gr&me)===me){var Q=ne.revertLane;if(Q===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),me===Ii&&(ie=!0);else if((Gr&Q)===Q){ne=ne.next,Q===Ii&&(ie=!0);continue}else me={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(_=B=me,v=h):B=B.next=me,We.lanes|=Q,Ba|=Q;me=ne.action,Ui&&o(h,me),h=ne.hasEagerState?ne.eagerState:o(h,me)}else Q={lane:me,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(_=B=Q,v=h):B=B.next=Q,We.lanes|=me,Ba|=me;ne=ne.next}while(ne!==null&&ne!==a);if(B===null?v=h:B.next=_,!ls(h,n.memoizedState)&&(Qt=!0,ie&&(o=Vo,o!==null)))throw o;n.memoizedState=h,n.baseState=v,n.baseQueue=B,l.lastRenderedState=h}return d===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function sg(n){var a=Zt(),o=a.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=n;var l=o.dispatch,d=o.pending,h=a.memoizedState;if(d!==null){o.pending=null;var v=d=d.next;do h=n(h,v.action),v=v.next;while(v!==d);ls(h,a.memoizedState)||(Qt=!0),a.memoizedState=h,a.baseQueue===null&&(a.baseState=h),o.lastRenderedState=h}return[h,l]}function _w(n,a,o){var l=We,d=Zt(),h=Ke;if(h){if(o===void 0)throw Error(r(407));o=o()}else o=a();var v=!ls((kt||d).memoizedState,o);if(v&&(d.memoizedState=o,Qt=!0),d=d.queue,ig(Ow.bind(null,l,d,n),[n]),n=d.getSnapshot!==a||v||Kt!==null&&(Kt.memoizedState.tag&1)!==0,qo(n?9:8,{destroy:void 0},Aw.bind(null,l,d,o,a),null),n){if(l.flags|=2048,xt===null)throw Error(r(349));h||(Gr&127)!==0||kw(l,a,o)}return o}function kw(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=We.updateQueue,a===null?(a=Xd(),We.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function Aw(n,a,o,l){a.value=o,a.getSnapshot=l,Nw(a)&&xw(n)}function Ow(n,a,o){return o(function(){Nw(a)&&xw(n)})}function Nw(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!ls(n,o)}catch{return!0}}function xw(n){var a=ki(n,2);a!==null&&es(a,n,2)}function rg(n){var a=$n();if(typeof n=="function"){var o=n;if(n=o(),Ui){wa(!0);try{o()}finally{wa(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:n},a}function Cw(n,a,o,l){return n.baseState=o,ng(n,kt,typeof l=="function"?l:Fr)}function px(n,a,o,l,d){if(tf(n))throw Error(r(485));if(n=a.action,n!==null){var h={payload:d,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};be.T!==null?o(!0):h.isTransition=!1,l(h),o=a.pending,o===null?(h.next=a.pending=h,Iw(a,h)):(h.next=o.next,a.pending=o.next=h)}}function Iw(n,a){var o=a.action,l=a.payload,d=n.state;if(a.isTransition){var h=be.T,v={};v.types=h!==null?h.types:null,be.T=v;try{var _=o(d,l),B=be.S;B!==null&&B(v,_),Rw(n,a,_)}catch(ne){ag(n,a,ne)}finally{h!==null&&v.types!==null&&(h.types=v.types),be.T=h}}else try{h=o(d,l),Rw(n,a,h)}catch(ne){ag(n,a,ne)}}function Rw(n,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){jw(n,a,l)},function(l){return ag(n,a,l)}):jw(n,a,o)}function jw(n,a,o){a.status="fulfilled",a.value=o,Mw(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,Iw(n,o)))}function ag(n,a,o){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do a.status="rejected",a.reason=o,Mw(a),a=a.next;while(a!==l)}n.action=null}function Mw(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Dw(n,a){return a}function Uw(n,a){if(Ke){var o=xt.formState;if(o!==null){e:{var l=We;if(Ke){if(Rt){t:{for(var d=Rt,h=xs;d.nodeType!==8;){if(!h){d=null;break t}if(d=Is(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Rt=Is(d.nextSibling),l=d.data==="F!";break e}}ka(l)}l=!1}l&&(a=o[0])}}return o=$n(),o.memoizedState=o.baseState=a,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dw,lastRenderedState:a},o.queue=l,o=tT.bind(null,We,l),l.dispatch=o,l=rg(!1),h=dg.bind(null,We,!1,l.queue),l=$n(),d={state:a,dispatch:null,action:n,pending:null},l.queue=d,o=px.bind(null,We,d,h,o),d.dispatch=o,l.memoizedState=n,[a,o,!1]}function Bw(n){var a=Zt();return Lw(a,kt,n)}function Lw(n,a,o){if(a=ng(n,a,Dw)[0],n=Kd(Fr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var l=Vl(a)}catch(v){throw v===Po?Pd:v}else l=a;a=Zt();var d=a.queue,h=d.dispatch;return o!==a.memoizedState&&(We.flags|=2048,qo(9,{destroy:void 0},mx.bind(null,d,o),null)),[l,h,n]}function mx(n,a){n.action=a}function zw(n){var a=Zt(),o=kt;if(o!==null)return Lw(a,o,n);Zt(),a=a.memoizedState,o=Zt();var l=o.queue.dispatch;return o.memoizedState=n,[a,l,!1]}function qo(n,a,o,l){return n={tag:n,create:o,deps:l,inst:a,next:null},a=We.updateQueue,a===null&&(a=Xd(),We.updateQueue=a),o=a.lastEffect,o===null?a.lastEffect=n.next=n:(l=o.next,o.next=n,n.next=l,a.lastEffect=n),n}function $w(){return Zt().memoizedState}function Qd(n,a,o,l){var d=$n();We.flags|=n,d.memoizedState=qo(1|a,{destroy:void 0},o,l===void 0?null:l)}function ef(n,a,o,l){var d=Zt();l=l===void 0?null:l;var h=d.memoizedState.inst;kt!==null&&l!==null&&Xm(l,kt.memoizedState.deps)?d.memoizedState=qo(a,h,o,l):(We.flags|=n,d.memoizedState=qo(1|a,h,o,l))}function Vw(n,a){Qd(8390656,8,n,a)}function ig(n,a){ef(2048,8,n,a)}function gx(n){We.flags|=4;var a=We.updateQueue;if(a===null)a=Xd(),We.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function Pw(n){var a=Zt().memoizedState;return gx({ref:a,nextImpl:n}),function(){if((ht&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Gw(n,a){return ef(4,2,n,a)}function Fw(n,a){return ef(4,4,n,a)}function Hw(n,a){if(typeof a=="function"){n=n();var o=a(n);return function(){typeof o=="function"?o():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function qw(n,a,o){o=o!=null?o.concat([n]):null,ef(4,4,Hw.bind(null,a,n),o)}function og(){}function Zw(n,a){var o=Zt();a=a===void 0?null:a;var l=o.memoizedState;return a!==null&&Xm(a,l[1])?l[0]:(o.memoizedState=[n,a],n)}function Yw(n,a){var o=Zt();a=a===void 0?null:a;var l=o.memoizedState;if(a!==null&&Xm(a,l[1]))return l[0];if(l=n(),Ui){wa(!0);try{n()}finally{wa(!1)}}return o.memoizedState=[l,a],l}function cg(n,a,o){return o===void 0||(Gr&1073741824)!==0&&(it&261930)===0?n.memoizedState=a:(n.memoizedState=o,n=r2(),We.lanes|=n,Ba|=n,o)}function Ww(n,a,o,l){return ls(o,a)?o:Ia.current!==null?(n=cg(n,o,l),ls(n,a)||(Qt=!0),n):(Gr&106)===0||(Gr&1073741824)!==0&&(it&261930)===0?(Qt=!0,n.memoizedState=o):(n=r2(),We.lanes|=n,Ba|=n,a)}function Xw(n,a,o,l,d){var h=_e.p;_e.p=h!==0&&8>h?h:8;var v=be.T,_={};_.types=v!==null?v.types:null,be.T=_,dg(n,!1,a,o);try{var B=d(),ne=be.S;if(ne!==null&&ne(_,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ie=dx(B,l);Pl(n,a,ie,ps(n))}else Pl(n,a,l,ps(n))}catch(me){Pl(n,a,{then:function(){},status:"rejected",reason:me},ps())}finally{_e.p=h,v!==null&&_.types!==null&&(v.types=_.types),be.T=v}}function yx(){}function lg(n,a,o,l){if(n.tag!==5)throw Error(r(476));var d=Jw(n).queue;Xw(n,d,a,Ve,o===null?yx:function(){return Kw(n),o(l)})}function Jw(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:Ve,baseState:Ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:Ve},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Kw(n){var a=Jw(n);a.next===null&&(a=n.alternate.memoizedState),Pl(n,a.next.queue,{},ps())}function ug(){return _n(dc)}function Qw(){return Zt().memoizedState}function eT(){return Zt().memoizedState}function vx(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=ps();n=xa(o);var l=Ca(a,n,o);l!==null&&(es(l,a,o),Ul(l,a,o)),a={cache:Lm()},n.payload=a;return}a=a.return}}function bx(n,a,o){var l=ps();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},tf(n)?nT(a,o):(o=xm(n,a,o,l),o!==null&&(es(o,n,l),sT(o,a,l)))}function tT(n,a,o){var l=ps();Pl(n,a,o,l)}function Pl(n,a,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(tf(n))nT(a,d);else{var h=n.alternate;if(n.lanes===0&&(h===null||h.lanes===0)&&(h=a.lastRenderedReducer,h!==null))try{var v=a.lastRenderedState,_=h(v,o);if(d.hasEagerState=!0,d.eagerState=_,ls(_,v))return Rd(n,a,d,0),xt===null&&Id(),!1}catch{}if(o=xm(n,a,d,l),o!==null)return es(o,n,l),sT(o,a,l),!0}return!1}function dg(n,a,o,l){if(l={lane:2,revertLane:t0(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},tf(n)){if(a)throw Error(r(479))}else a=xm(n,o,l,2),a!==null&&es(a,n,2)}function tf(n){var a=n.alternate;return n===We||a!==null&&a===We}function nT(n,a){Fo=Yd=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function sT(n,a,o){if((o&4194048)!==0){var l=a.lanes;l&=n.pendingLanes,o|=l,a.lanes=o,r1(n,o)}}var nf={readContext:_n,use:Jd,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt,useEffectEvent:Vt},rT={readContext:_n,use:Jd,useCallback:function(n,a){return $n().memoizedState=[n,a===void 0?null:a],n},useContext:_n,useEffect:Vw,useImperativeHandle:function(n,a,o){o=o!=null?o.concat([n]):null,Qd(4194308,4,Hw.bind(null,a,n),o)},useLayoutEffect:function(n,a){return Qd(4194308,4,n,a)},useInsertionEffect:function(n,a){Qd(4,2,n,a)},useMemo:function(n,a){var o=$n();a=a===void 0?null:a;var l=n();if(Ui){wa(!0);try{n()}finally{wa(!1)}}return o.memoizedState=[l,a],l},useReducer:function(n,a,o){var l=$n();if(o!==void 0){var d=o(a);if(Ui){wa(!0);try{o(a)}finally{wa(!1)}}}else d=a;return l.memoizedState=l.baseState=d,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:d},l.queue=n,n=n.dispatch=bx.bind(null,We,n),[l.memoizedState,n]},useRef:function(n){var a=$n();return n={current:n},a.memoizedState=n},useState:function(n){n=rg(n);var a=n.queue,o=tT.bind(null,We,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:og,useDeferredValue:function(n,a){var o=$n();return cg(o,n,a)},useTransition:function(){var n=rg(!1);return n=Xw.bind(null,We,n.queue,!0,!1),$n().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var l=We,d=$n();if(Ke){if(o===void 0)throw Error(r(407));o=o()}else{if(o=a(),xt===null)throw Error(r(349));(it&127)!==0||kw(l,a,o)}d.memoizedState=o;var h={value:o,getSnapshot:a};return d.queue=h,Vw(Ow.bind(null,l,h,n),[n]),l.flags|=2048,qo(9,{destroy:void 0},Aw.bind(null,l,h,o,a),null),o},useId:function(){var n=$n(),a=xt.identifierPrefix;if(Ke){var o=cr,l=or;o=(l&~(1<<32-os(l)-1)).toString(32)+o,a="_"+a+"R_"+o,o=Wd++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=fx++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:ug,useFormState:Uw,useActionState:Uw,useOptimistic:function(n){var a=$n();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=dg.bind(null,We,!0,o),o.dispatch=a,[n,a]},useMemoCache:tg,useCacheRefresh:function(){return $n().memoizedState=vx.bind(null,We)},useEffectEvent:function(n){var a=$n(),o={impl:n};return a.memoizedState=o,function(){if((ht&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},aT={readContext:_n,use:Jd,useCallback:Zw,useContext:_n,useEffect:ig,useImperativeHandle:qw,useInsertionEffect:Gw,useLayoutEffect:Fw,useMemo:Yw,useReducer:Kd,useRef:$w,useState:function(){return Kd(Fr)},useDebugValue:og,useDeferredValue:function(n,a){var o=Zt();return Ww(o,kt.memoizedState,n,a)},useTransition:function(){var n=Kd(Fr)[0],a=Zt().memoizedState;return[typeof n=="boolean"?n:Vl(n),a]},useSyncExternalStore:_w,useId:Qw,useHostTransitionStatus:ug,useFormState:Bw,useActionState:Bw,useOptimistic:function(n,a){var o=Zt();return Cw(o,kt,n,a)},useMemoCache:tg,useCacheRefresh:eT,useEffectEvent:Pw},wx={readContext:_n,use:Jd,useCallback:Zw,useContext:_n,useEffect:ig,useImperativeHandle:qw,useInsertionEffect:Gw,useLayoutEffect:Fw,useMemo:Yw,useReducer:sg,useRef:$w,useState:function(){return sg(Fr)},useDebugValue:og,useDeferredValue:function(n,a){var o=Zt();return kt===null?cg(o,n,a):Ww(o,kt.memoizedState,n,a)},useTransition:function(){var n=sg(Fr)[0],a=Zt().memoizedState;return[typeof n=="boolean"?n:Vl(n),a]},useSyncExternalStore:_w,useId:Qw,useHostTransitionStatus:ug,useFormState:zw,useActionState:zw,useOptimistic:function(n,a){var o=Zt();return kt!==null?Cw(o,kt,n,a):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:tg,useCacheRefresh:eT,useEffectEvent:Pw};function fg(n,a,o,l){a=n.memoizedState,o=o(l,a),o=o==null?a:K({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var hg={enqueueSetState:function(n,a,o){n=n._reactInternals;var l=ps(),d=xa(l);d.payload=a,o!=null&&(d.callback=o),a=Ca(n,d,l),a!==null&&(es(a,n,l),Ul(a,n,l))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var l=ps(),d=xa(l);d.tag=1,d.payload=a,o!=null&&(d.callback=o),a=Ca(n,d,l),a!==null&&(es(a,n,l),Ul(a,n,l))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=ps(),l=xa(o);l.tag=2,a!=null&&(l.callback=a),a=Ca(n,l,o),a!==null&&(es(a,n,o),Ul(a,n,o))}};function iT(n,a,o,l,d,h,v){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,h,v):a.prototype&&a.prototype.isPureReactComponent?!Nl(o,l)||!Nl(d,h):!0}function oT(n,a,o,l){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(o,l),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(o,l),a.state!==n&&hg.enqueueReplaceState(a,a.state,null)}function Bi(n,a){var o=a;if("ref"in a){o={};for(var l in a)l!=="ref"&&(o[l]=a[l])}if(n=n.defaultProps){o===a&&(o=K({},o));for(var d in n)o[d]===void 0&&(o[d]=n[d])}return o}function cT(n){Cd(n)}function lT(n){console.error(n)}function uT(n){Cd(n)}function sf(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(l){setTimeout(function(){throw l})}}function dT(n,a,o){try{var l=n.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function pg(n,a,o){return o=xa(o),o.tag=3,o.payload={element:null},o.callback=function(){sf(n,a)},o}function fT(n){return n=xa(n),n.tag=3,n}function hT(n,a,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;n.payload=function(){return d(h)},n.callback=function(){dT(a,o,l)}}var v=o.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(n.callback=function(){dT(a,o,l),typeof d!="function"&&(La===null?La=new Set([this]):La.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})})}function Tx(n,a,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(a=o.alternate,a!==null&&xi(a,o,d,!0),o=kn.current,o!==null){switch(o.tag){case 31:case 13:case 19:return Mn===null?kf():o.alternate===null&&Pt===0&&(Pt=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===Gd?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([l]):a.add(l),Kg(n,l,d)),!1;case 22:return o.flags|=65536,l===Gd?o.flags|=16384:(a=o.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=a):(o=a.retryQueue,o===null?a.retryQueue=new Set([l]):o.add(l)),Kg(n,l,d)),!1}throw Error(r(435,o.tag))}return Kg(n,l,d),kf(),!1}if(Ke)return a=kn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=d,l!==Mm&&(n=Error(r(422),{cause:l}),Il(As(n,o)))):(l!==Mm&&(a=Error(r(423),{cause:l}),Il(As(a,o))),n=n.current.alternate,n.flags|=65536,d&=-d,n.lanes|=d,l=As(l,o),d=pg(n.stateNode,l,d),Fm(n,d),Pt!==4&&(Pt=2)),!1;var h=Error(r(520),{cause:l});if(h=As(h,o),Xl===null?Xl=[h]:Xl.push(h),Pt!==4&&(Pt=2),a===null)return!0;l=As(l,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=d&-d,o.lanes|=n,n=pg(o.stateNode,l,n),Fm(o,n),!1;case 1:if(a=o.type,h=o.stateNode,(o.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(La===null||!La.has(h))))return o.flags|=65536,d&=-d,o.lanes|=d,d=fT(d),hT(d,n,o,l),Fm(o,d),!1;break;case 22:if(o.memoizedState!==null)return o.flags|=65536,!1}o=o.return}while(o!==null);return!1}var mg=Error(r(461)),Qt=!1;function sn(n,a,o,l){a.child=n===null?yw(a,null,o,l):Di(a,n.child,o,l)}function pT(n,a,o,l,d){o=o.render;var h=a.ref;if("ref"in l){var v={};for(var _ in l)_!=="ref"&&(v[_]=l[_])}else v=l;return Ci(a),l=Jm(n,a,o,v,h,d),_=Km(),n!==null&&!Qt?(Qm(n,a,d),Hr(n,a,d)):(Ke&&_&&Ud(a),a.flags|=1,sn(n,a,l,d),a.child)}function mT(n,a,o,l,d){if(n===null){var h=o.type;return typeof h=="function"&&!Cm(h)&&h.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=h,gT(n,a,h,l,d)):(n=Md(o.type,null,l,a,a.mode,d),n.ref=a.ref,n.return=a,a.child=n)}if(h=n.child,!Sg(n,d)){var v=h.memoizedProps;if(o=o.compare,o=o!==null?o:Nl,o(v,l)&&n.ref===a.ref)return Hr(n,a,d)}return a.flags|=1,n=zr(h,l),n.ref=a.ref,n.return=a,a.child=n}function gT(n,a,o,l,d){if(n!==null){var h=n.memoizedProps;if(Nl(h,l)&&n.ref===a.ref)if(Qt=!1,a.pendingProps=l=h,Sg(n,d))(n.flags&131072)!==0&&(Qt=!0);else return a.lanes=n.lanes,Hr(n,a,d)}return gg(n,a,o,l,d)}function yT(n,a,o,l){var d=l.children,h=n!==null?n.memoizedState:null;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((a.flags&128)!==0){if(h=h!==null?h.baseLanes|o:o,n!==null){for(l=a.child=n.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,a.child=null;return vT(n,a,h,o,l)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&Vd(a,h!==null?h.cachePool:null),h!==null?ww(a,h):qm(),Tw(a);else return l=a.lanes=536870912,vT(n,a,h!==null?h.baseLanes|o:o,o,l)}else h!==null?(Vd(a,h.cachePool),ww(a,h),ja(),a.memoizedState=null):(n!==null&&Vd(a,null),qm(),ja());return sn(n,a,d,o),a.child}function Gl(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function vT(n,a,o,l,d){var h=$m();return h=h===null?null:{parent:Jt._currentValue,pool:h},a.memoizedState={baseLanes:o,cachePool:h},n!==null&&Vd(a,null),qm(),Tw(a),n!==null&&xi(n,a,l,!0),a.childLanes=d,null}function rf(n,a){return a=af({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function bT(n,a,o){return Di(a,n.child,null,o),n=rf(a,a.pendingProps),n.flags|=2,us(a),a.memoizedState=null,n}function Ex(n,a,o){var l=a.pendingProps,d=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(Ke){if(l.mode==="hidden")return n=rf(a,l),a.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Gl(null,n);if(Ym(a),(n=Rt)?(n=H2(n,xs),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Sa!==null?{id:or,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},o=nw(n),o.return=a,a.child=o,gn=a,Rt=null)):n=null,n===null)throw ka(a);return a.lanes=536870912,null}return rf(a,l)}var h=n.memoizedState;if(h!==null){var v=h.dehydrated;if(Ym(a),d)if(a.flags&256)a.flags&=-257,a=bT(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(r(558));else if(Qt||xi(n,a,o,!1),d=(o&n.childLanes)!==0,Qt||d){if(Ia.current===null){if(l=xt,l!==null&&(v=a1(l,o),v!==0&&v!==h.retryLane))throw h.retryLane=v,ki(n,v),es(l,n,v),mg;kf()}a=bT(n,a,o)}else n=h.treeContext,Rt=Is(v.nextSibling),gn=a,Ke=!0,_a=null,xs=!1,n!==null&&aw(a,n),a=rf(a,l),a.flags|=134221824;return a}return n=zr(n.child,{mode:l.mode,children:l.children}),n.ref=a.ref,a.child=n,n.return=a,n}function Zo(n,a){var o=a.ref;if(o===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(n===null||n.ref!==o)&&(a.flags|=4194816)}}function gg(n,a,o,l,d){return Ci(a),o=Jm(n,a,o,l,void 0,d),l=Km(),n!==null&&!Qt?(Qm(n,a,d),Hr(n,a,d)):(Ke&&l&&Ud(a),a.flags|=1,sn(n,a,o,d),a.child)}function wT(n,a,o,l,d,h){return Ci(a),a.updateQueue=null,o=Sw(a,l,o,d),Ew(n),l=Km(),n!==null&&!Qt?(Qm(n,a,h),Hr(n,a,h)):(Ke&&l&&Ud(a),a.flags|=1,sn(n,a,o,h),a.child)}function TT(n,a,o,l,d){if(Ci(a),a.stateNode===null){var h=Bo,v=o.contextType;typeof v=="object"&&v!==null&&(h=_n(v)),h=new o(l,h),a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=hg,a.stateNode=h,h._reactInternals=a,h=a.stateNode,h.props=l,h.state=a.memoizedState,h.refs={},Pm(a),v=o.contextType,h.context=typeof v=="object"&&v!==null?_n(v):Bo,h.state=a.memoizedState,v=o.getDerivedStateFromProps,typeof v=="function"&&(fg(a,o,v,l),h.state=a.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&hg.enqueueReplaceState(h,h.state,null),Ll(a,l,h,d),Bl(),h.state=a.memoizedState),typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!0}else if(n===null){h=a.stateNode;var _=a.memoizedProps,B=Bi(o,_);h.props=B;var ne=h.context,ie=o.contextType;v=Bo,typeof ie=="object"&&ie!==null&&(v=_n(ie));var me=o.getDerivedStateFromProps;ie=typeof me=="function"||typeof h.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,ie||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_||ne!==v)&&oT(a,h,l,v),Na=!1;var Q=a.memoizedState;h.state=Q,Ll(a,l,h,d),Bl(),ne=a.memoizedState,_||Q!==ne||Na?(typeof me=="function"&&(fg(a,o,me,l),ne=a.memoizedState),(B=Na||iT(a,o,B,l,Q,ne,v))?(ie||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(a.flags|=4194308)):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=l,a.memoizedState=ne),h.props=l,h.state=ne,h.context=v,l=B):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),l=!1)}else{h=a.stateNode,Gm(n,a),v=a.memoizedProps,ie=Bi(o,v),h.props=ie,me=a.pendingProps,Q=h.context,ne=o.contextType,B=Bo,typeof ne=="object"&&ne!==null&&(B=_n(ne)),_=o.getDerivedStateFromProps,(ne=typeof _=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==me||Q!==B)&&oT(a,h,l,B),Na=!1,Q=a.memoizedState,h.state=Q,Ll(a,l,h,d),Bl();var ae=a.memoizedState;v!==me||Q!==ae||Na||n!==null&&n.dependencies!==null&&zd(n.dependencies)?(typeof _=="function"&&(fg(a,o,_,l),ae=a.memoizedState),(ie=Na||iT(a,o,ie,l,Q,ae,B)||n!==null&&n.dependencies!==null&&zd(n.dependencies))?(ne||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,ae,B),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,ae,B)),typeof h.componentDidUpdate=="function"&&(a.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=1024),a.memoizedProps=l,a.memoizedState=ae),h.props=l,h.state=ae,h.context=B,l=ie):(typeof h.componentDidUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===n.memoizedProps&&Q===n.memoizedState||(a.flags|=1024),l=!1)}return h=l,Zo(n,a),l=(a.flags&128)!==0,h||l?(h=a.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:h.render(),a.flags|=1,n!==null&&l?(a.child=Di(a,n.child,null,d),a.child=Di(a,null,o,d)):sn(n,a,o,d),a.memoizedState=h.state,n=a.child):n=Hr(n,a,d),n}function ET(n,a,o,l){return Oi(),a.flags|=256,sn(n,a,o,l),a.child}var yg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vg(n){return{baseLanes:n,cachePool:dw()}}function bg(n,a,o){return n=n!==null?n.childLanes&~o:0,a&&(n|=hs),n}function ST(n,a,o){var l=a.pendingProps,d=!1,h=(a.flags&128)!==0,v;if((v=h)||(v=n!==null&&n.memoizedState===null?!1:(An.current&2)!==0),v&&(d=!0,a.flags&=-129),v=(a.flags&32)!==0,a.flags&=-33,n===null){if(Ke){if(d?Ra(a):ja(),(n=Rt)?(n=H2(n,xs),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Sa!==null?{id:or,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},o=nw(n),o.return=a,a.child=o,gn=a,Rt=null)):n=null,n===null)throw ka(a);return v0(n)?a.lanes=32:a.lanes=536870912,null}return h=l.children,l=l.fallback,d?(ja(),d=a.mode,h=af({mode:"hidden",children:h},d),l=Ai(l,d,o,null),h.return=a,l.return=a,h.sibling=l,a.child=h,l=a.child,l.memoizedState=vg(o),l.childLanes=bg(n,v,o),a.memoizedState=yg,Gl(null,l)):(Ra(a),wg(a,h))}var _=n.memoizedState;if(_!==null){var B=_.dehydrated;if(B!==null)return Sx(n,a,h,v,l,B,_,o)}return d?(ja(),d=l.fallback,h=a.mode,_=n.child,B=_.sibling,l=zr(_,{mode:"hidden",children:l.children}),l.subtreeFlags=_.subtreeFlags&1206910976,B!==null?d=zr(B,d):(d=Ai(d,h,o,null),d.flags|=2),d.return=a,l.return=a,l.sibling=d,a.child=l,Gl(null,l),l=a.child,d=n.child.memoizedState,d===null?d=vg(o):(h=d.cachePool,h!==null?(_=Jt._currentValue,h=h.parent!==_?{parent:_,pool:_}:h):h=dw(),d={baseLanes:d.baseLanes|o,cachePool:h}),l.memoizedState=d,l.childLanes=bg(n,v,o),a.memoizedState=yg,Gl(n.child,l)):(Ra(a),o=n.child,n=o.sibling,o=zr(o,{mode:"visible",children:l.children}),o.return=a,o.sibling=null,n!==null&&(v=a.deletions,v===null?(a.deletions=[n],a.flags|=16):v.push(n)),a.child=o,a.memoizedState=null,o)}function wg(n,a){return a=af({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function af(n,a){return n=Xn(22,n,null,a),n.lanes=0,n}function of(n,a,o){return Di(a,n.child,null,o),n=wg(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function Sx(n,a,o,l,d,h,v,_){if(o)return a.flags&256?(Ra(a),a.flags&=-257,of(n,a,_)):a.memoizedState!==null?(ja(),a.child=n.child,a.flags|=128,null):(ja(),h=d.fallback,v=a.mode,d=af({mode:"visible",children:d.children},v),h=Ai(h,v,_,null),h.flags|=2,d.return=a,h.return=a,d.sibling=h,a.child=d,Di(a,n.child,null,_),d=a.child,d.memoizedState=vg(_),d.childLanes=bg(n,l,_),a.memoizedState=yg,Gl(null,d));if(Ra(a),v0(h)){if(l=h.nextSibling&&h.nextSibling.dataset,l)var B=l.dgst;return l=B,l!==""&&(d=Error(r(419)),d.stack="",d.digest=l,Il({value:d,source:null,stack:null})),of(n,a,_)}if(Qt||xi(n,a,_,!1),l=(_&n.childLanes)!==0,Qt||l){if(Ia.current!==null)return of(n,a,_);if(l=xt,l!==null&&(d=a1(l,_),d!==0&&d!==v.retryLane))throw v.retryLane=d,ki(n,d),es(l,n,d),mg;return y0(h)||kf(),of(n,a,_)}return y0(h)?(a.flags|=192,a.child=n.child,null):(n=v.treeContext,Rt=Is(h.nextSibling),gn=a,Ke=!0,_a=null,xs=!1,n!==null&&aw(a,n),a=wg(a,d.children),a.flags|=134221824,a)}function _T(n,a,o){n.lanes|=a;var l=n.alternate;l!==null&&(l.lanes|=a),Ld(n.return,a,o)}function kT(n){for(var a=null;n!==null;){var o=n.alternate;o!==null&&Zd(o)===null&&(a=n),n=n.sibling}return a}function cf(n,a,o,l,d,h){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:h}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=o,v.tailMode=d,v.treeForkCount=h)}function Tg(n){var a=n.child;for(n.child=null;a!==null;){var o=a.sibling;a.sibling=n.child,n.child=a,a=o}}function Eg(n,a,o){var l=a.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var v=An.current;if(a.flags&128)return zl(a,v),null;var _=(v&2)!==0;if(_?(v=v&1|2,a.flags|=128):v&=1,zl(a,v),d==="backwards"&&n!==null?(Tg(n),sn(n,a,l,o),Tg(n)):sn(n,a,l,o),l=Ke?Cl:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&_T(n,o,a);else if(n.tag===19)_T(n,o,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(d){case"backwards":o=kT(a.child),o===null?(d=a.child,a.child=null):(d=o.sibling,o.sibling=null,Tg(a)),cf(a,!0,d,null,h,l);break;case"unstable_legacy-backwards":for(o=null,d=a.child,a.child=null;d!==null;){if(n=d.alternate,n!==null&&Zd(n)===null){a.child=d;break}n=d.sibling,d.sibling=o,o=d,d=n}cf(a,!0,o,null,h,l);break;case"together":cf(a,!1,null,null,void 0,l);break;case"independent":a.memoizedState=null;break;default:o=kT(a.child),o===null?(d=a.child,a.child=null):(d=o.sibling,o.sibling=null),cf(a,!1,d,o,h,l)}return a.child}function AT(n,a,o){var l=a.pendingProps;return Aa(a,a.type,l.value),sn(n,a,l.children,o),a.child}function Hr(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),Ba|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(xi(n,a,o,!1),(o&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(r(153));if(a.child!==null){for(n=a.child,o=zr(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=zr(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function Sg(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&zd(n)))}function _x(n,a,o){switch(a.tag){case 3:Es(a,a.stateNode.containerInfo),Aa(a,Jt,n.memoizedState.cache),Oi();break;case 27:case 5:ul(a);break;case 4:Es(a,a.stateNode.containerInfo);break;case 10:Aa(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ym(a),null;break;case 13:var l=a.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ra(a),a.flags|=128,null;l=xi(n,a,o,!1);var d=a.child.childLanes;return l||(o&d)!==0?ST(n,a,o):(Ra(a),n=Hr(n,a,o),n!==null?n.sibling:null)}Ra(a);break;case 19:if(a.flags&128)return Eg(n,a,o);if(d=(n.flags&128)!==0,l=(o&a.childLanes)!==0,l||(xi(n,a,o,!1),l=(o&a.childLanes)!==0),d){if(l)return Eg(n,a,o);a.flags|=128}if(d=a.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),zl(a,An.current),l)break;return null;case 22:return a.lanes=0,yT(n,a,o,a.pendingProps);case 24:Aa(a,Jt,n.memoizedState.cache)}return Hr(n,a,o)}function OT(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)Qt=!0;else{if(!Sg(n,o)&&(a.flags&128)===0)return Qt=!1,_x(n,a,o);Qt=(n.flags&131072)!==0}else Qt=!1,Ke&&(a.flags&1048576)!==0&&rw(a,Cl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var l=a.pendingProps;if(n=ji(a.elementType),a.type=n,typeof n=="function")Cm(n)?(l=Bi(n,l),a.tag=1,a=TT(null,a,n,l,o)):(a.tag=0,a=gg(null,a,n,l,o));else{if(n!=null){var d=n.$$typeof;if(d===k){a.tag=11,a=pT(null,a,n,l,o);break e}else if(d===z){a.tag=14,a=mT(null,a,n,l,o);break e}else if(d===M){a.tag=10,a.type=n,a=AT(null,a,o);break e}}throw a=Oe(n)||n,Error(r(306,a,""))}}return a;case 0:return gg(n,a,a.type,a.pendingProps,o);case 1:return l=a.type,d=Bi(l,a.pendingProps),TT(n,a,l,d,o);case 3:e:{if(Es(a,a.stateNode.containerInfo),n===null)throw Error(r(387));l=a.pendingProps;var h=a.memoizedState;d=h.element,Gm(n,a),Ll(a,l,null,o);var v=a.memoizedState;if(l=v.cache,Aa(a,Jt,l),l!==h.cache&&Bm(a,[Jt],o,!0),Bl(),l=v.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:v.cache},a.updateQueue.baseState=h,a.memoizedState=h,a.flags&256){a=ET(n,a,l,o);break e}else if(l!==d){d=As(Error(r(424)),a),Il(d),a=ET(n,a,l,o);break e}else for(n=a.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Rt=Is(n.firstChild),gn=a,Ke=!0,_a=null,xs=!0,o=yw(a,null,l,o),a.child=o;o;)o.flags=o.flags&-3|134221824,o=o.sibling;else{if(Oi(),l===d){a=Hr(n,a,o);break e}sn(n,a,l,o)}a=a.child}return a;case 26:return Zo(n,a),n===null?(o=K2(a.type,null,a.pendingProps,null))?a.memoizedState=o:Ke||(a.stateNode=I2(a.type,a.pendingProps,Le.current,a)):a.memoizedState=K2(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return ul(a),n===null&&Ke&&(l=a.stateNode=Y2(a.type,a.pendingProps,Le.current),gn=a,xs=!0,d=Rt,Va(a.type)?(b0=d,Rt=Is(l.firstChild)):Rt=d),sn(n,a,a.pendingProps.children,o),Zo(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Ke&&((d=l=Rt)&&(l=vC(l,a.type,a.pendingProps,xs),l!==null?(a.stateNode=l,gn=a,Rt=Is(l.firstChild),xs=!1,d=!0):d=!1),d||ka(a)),ul(a),d=a.type,h=a.pendingProps,v=n!==null?n.memoizedProps:null,l=h.children,u0(d,h)?l=null:v!==null&&u0(d,v)&&(a.flags|=32),a.memoizedState!==null&&(d=Jm(n,a,hx,null,null,o),dc._currentValue=d),Zo(n,a),sn(n,a,l,o),a.child;case 6:return n===null&&Ke&&((n=o=Rt)&&(o=bC(o,a.pendingProps,xs),o!==null?(a.stateNode=o,gn=a,Rt=null,n=!0):n=!1),n||ka(a)),null;case 13:return ST(n,a,o);case 4:return Es(a,a.stateNode.containerInfo),l=a.pendingProps,n===null?a.child=Di(a,null,l,o):sn(n,a,l,o),a.child;case 11:return pT(n,a,a.type,a.pendingProps,o);case 7:return l=a.pendingProps,Zo(n,a),sn(n,a,l,o),a.child;case 8:return sn(n,a,a.pendingProps.children,o),a.child;case 12:return sn(n,a,a.pendingProps.children,o),a.child;case 10:return AT(n,a,o);case 9:return d=a.type._context,l=a.pendingProps.children,Ci(a),d=_n(d),l=l(d),a.flags|=1,sn(n,a,l,o),a.child;case 14:return mT(n,a,a.type,a.pendingProps,o);case 15:return gT(n,a,a.type,a.pendingProps,o);case 19:return Eg(n,a,o);case 31:return Ex(n,a,o);case 22:return yT(n,a,o,a.pendingProps);case 24:return Ci(a),l=_n(Jt),n===null?(d=$m(),d===null&&(d=xt,h=Lm(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=o),d=h),a.memoizedState={parent:l,cache:d},Pm(a),Aa(a,Jt,d)):((n.lanes&o)!==0&&(Gm(n,a),Ll(a,null,null,o),Bl()),d=n.memoizedState,h=a.memoizedState,d.parent!==l?(d={parent:l,cache:l},a.memoizedState=d,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=d),Aa(a,Jt,l)):(l=h.cache,Aa(a,Jt,l),l!==d.cache&&Bm(a,[Jt],o,!0))),sn(n,a,a.pendingProps.children,o),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=a.pendingProps,l.name!=null&&l.name!=="auto"?a.flags|=n===null?18882560:18874368:Ke&&Ud(a),n!==null&&n.memoizedProps.name!==l.name?a.flags|=4194816:Zo(n,a),sn(n,a,l.children,o),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function qr(n){n.flags|=4}function _g(n,a,o,l,d){var h;if((h=(n.mode&32)!==0)&&(h=o===null?nE(a,l):nE(a,l)&&(l.src!==o.src||l.srcSet!==o.srcSet)),h){if(n.flags|=16777216,(d&335544128)===d)if(n.stateNode.complete)n.flags|=8192;else if(c2())n.flags|=8192;else throw Mi=Gd,Vm}else n.flags&=-16777217}function NT(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!sE(a))if(c2())n.flags|=8192;else throw Mi=Gd,Vm}function lf(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?n1():536870912,n.lanes|=a,Ko|=a)}function Fl(n,a){if(!Ke)switch(n.tailMode){case"visible":break;case"collapsed":for(var o=n.tail,l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null;break;default:for(a=n.tail,o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n.tail=null:o.sibling=null}}function jt(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,l=0;if(a)for(var d=n.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&1206910976,l|=d.flags&1206910976,d.return=n,d=d.sibling;else for(d=n.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=n,d=d.sibling;return n.subtreeFlags|=l,n.childLanes=o,a}function kx(n,a,o){var l=a.pendingProps;switch(jm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(a),null;case 1:return jt(a),null;case 3:return o=a.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),a.memoizedState.cache!==l&&(a.flags|=2048),Pr(Jt),va(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&($o(a)?qr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Dm())),jt(a),null;case 26:var d=a.type,h=a.memoizedState;return n===null?(qr(a),h!==null?(jt(a),NT(a,h)):(jt(a),_g(a,d,null,l,o))):h?h!==n.memoizedState?(qr(a),jt(a),NT(a,h)):(jt(a),a.flags&=-16777217):(n=n.memoizedProps,n!==l&&qr(a),jt(a),_g(a,d,n,l,o)),null;case 27:if(bi(a),o=Le.current,d=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return jt(a),a.subtreeFlags&=-33554433,null}n=le.current,$o(a)?iw(a):(n=Y2(d,l,o),a.stateNode=n,qr(a))}return jt(a),a.subtreeFlags&=-33554433,null;case 5:if(bi(a),d=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(!l){if(a.stateNode===null)throw Error(r(166));return jt(a),a.subtreeFlags&=-33554433,null}if(h=le.current,$o(a))iw(a);else{var v=tu(Le.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?v.createElement(d,{is:l.is}):v.createElement(d)}}h[Sn]=a,h[Wn]=l;e:for(v=a.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===a)break e;for(;v.sibling===null;){if(v.return===null||v.return===a)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}a.stateNode=h;e:switch(Nn(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&qr(a)}}return jt(a),a.subtreeFlags&=-33554433,_g(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==l&&qr(a);else{if(typeof l!="string"&&a.stateNode===null)throw Error(r(166));if(n=Le.current,$o(a)){if(n=a.stateNode,o=a.memoizedProps,l=null,d=gn,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}n[Sn]=a,n=!!(n.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||O2(n.nodeValue,o)),n||ka(a,!0)}else n=tu(n).createTextNode(l),n[Sn]=a,a.stateNode=n}return jt(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(l=$o(a),o!==null){if(n===null){if(!l)throw Error(r(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(557));n[Sn]=a}else Oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;jt(a),n=!1}else o=Dm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(us(a),a):(us(a),null);if((a.flags&128)!==0)throw Error(r(558))}return jt(a),null;case 13:if(l=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(d=$o(a),l!==null&&l.dehydrated!==null){if(n===null){if(!d)throw Error(r(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[Sn]=a}else Oi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;jt(a),d=!1}else d=Dm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(us(a),a):(us(a),null)}return us(a),(a.flags&128)!==0?(a.lanes=o,a):(o=l!==null,n=n!==null&&n.memoizedState!==null,o&&(l=a.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),lf(a,a.updateQueue),jt(a),null);case 4:return va(),n===null&&a0(a.stateNode.containerInfo),a.flags|=67108864,jt(a),null;case 10:return Pr(a.type),jt(a),null;case 19:if(Wm(a),l=a.memoizedState,l===null)return jt(a),null;if(d=(a.flags&128)!==0,h=l.rendering,h===null)if(d)Fl(l,!1);else{if(Pt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(h=Zd(n),h!==null){for(a.flags|=128,Fl(l,!1),n=h.updateQueue,a.updateQueue=n,lf(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)tw(o,n),o=o.sibling;return zl(a,An.current&1|2),Ke&&$r(a,l.treeForkCount),a.child}n=n.sibling}l.tail!==null&&Ln()>Tf&&(a.flags|=128,d=!0,Fl(l,!1),a.lanes=4194304)}else{if(!d)if(n=Zd(h),n!==null){if(a.flags|=128,d=!0,n=n.updateQueue,a.updateQueue=n,lf(a,n),Fl(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!h.alternate&&!Ke)return jt(a),null}else 2*Ln()-l.renderingStartTime>Tf&&o!==536870912&&(a.flags|=128,d=!0,Fl(l,!1),a.lanes=4194304);l.isBackwards?(h.sibling=a.child,a.child=h):(n=l.last,n!==null?n.sibling=h:a.child=h,l.last=h)}if(l.tail!==null){n=l.tail;e:{for(o=n;o!==null;){if(o.alternate!==null){o=!1;break e}o=o.sibling}o=!0}return l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Ln(),n.sibling=null,h=An.current,h=d?h&1|2:h&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!o||Ke?zl(a,h):(o=h,fe(kn,a),fe(An,o),Mn===null&&(Mn=a)),Ke&&$r(a,l.treeForkCount),n}return jt(a),null;case 22:case 23:return us(a),Zm(),l=a.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(a.flags|=8192):l&&(a.flags|=8192),l?(o&536870912)!==0&&(a.flags&128)===0&&(jt(a),a.subtreeFlags&6&&(a.flags|=8192)):jt(a),o=a.updateQueue,o!==null&&lf(a,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==o&&(a.flags|=2048),n!==null&&de(Ri),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Pr(Jt),jt(a),null;case 25:return null;case 30:return a.flags|=33554432,jt(a),null}throw Error(r(156,a.tag))}function Ax(n,a){switch(jm(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Pr(Jt),va(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return bi(a),null;case 31:if(a.memoizedState!==null){if(us(a),a.alternate===null)throw Error(r(340));Oi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(us(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Oi()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return Wm(a),n=a.flags,n&65536?(a.flags=n&-65537|128,n=a.memoizedState,n!==null&&(n.rendering=null,n.tail=null),a.flags|=4,a):null;case 4:return va(),null;case 10:return Pr(a.type),null;case 22:case 23:return us(a),Zm(),n!==null&&de(Ri),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Pr(Jt),null;case 25:return null;default:return null}}function xT(n,a){switch(jm(a),a.tag){case 3:Pr(Jt),va();break;case 26:case 27:case 5:bi(a);break;case 4:va();break;case 31:a.memoizedState!==null&&us(a);break;case 13:us(a);break;case 19:Wm(a);break;case 10:Pr(a.type);break;case 22:case 23:us(a),Zm(),n!==null&&de(Ri);break;case 24:Pr(Jt)}}function Hl(n,a){try{var o=a.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;do{if((o.tag&n)===n){l=void 0;var h=o.create,v=o.inst;l=h(),v.destroy=l}o=o.next}while(o!==d)}}catch(_){Tt(a,a.return,_)}}function Ma(n,a,o){try{var l=a.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&n)===n){var v=l.inst,_=v.destroy;if(_!==void 0){v.destroy=void 0,d=a;var B=o,ne=_;try{ne()}catch(ie){Tt(d,B,ie)}}}l=l.next}while(l!==h)}}catch(ie){Tt(a,a.return,ie)}}function CT(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{bw(a,o)}catch(l){Tt(n,n.return,l)}}}function IT(n,a,o){o.props=Bi(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(l){Tt(n,a,l)}}function lr(n,a){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:var d=n.stateNode,h=Br(n.memoizedProps,d);(d.ref===null||d.ref.name!==h)&&(d.ref=L2(h)),l=d.ref;break;case 7:if(n.stateNode===null){var v=new ms(n);y(n.child,!1,gC,v,void 0,void 0),n.stateNode=v}l=n.stateNode;break;default:l=n.stateNode}typeof o=="function"?n.refCleanup=o(l):o.current=l}}catch(_){Tt(n,a,_)}}function On(n,a){var o=n.ref,l=n.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Tt(n,a,d)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Tt(n,a,d)}else o.current=null}function uf(n,a){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&a!==null)for(var o=0;o<a.length;o++)F2(n.stateNode,a[o])}function RT(n){for(var a=n.return;a!==null&&(Ag(a)&&F2(n.stateNode,a.stateNode),!kg(a));)a=a.return}function ql(n){for(var a=n.return;a!==null&&(Ag(a)&&yC(n.stateNode,a.stateNode),!kg(a));)a=a.return}function kg(n){return n.tag===5||n.tag===3||n.tag===27}function Ag(n){return n&&n.tag===7&&n.stateNode!==null}function Og(n){var a=n.type,o=n.memoizedProps,l=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(d){Tt(n,n.return,d)}}function Ng(n,a,o){try{var l=n.stateNode;Kx(l,n.type,o,a),l[Wn]=a}catch(d){Tt(n,n.return,d)}}function jT(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Va(n.type)||n.tag===4}function xg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||jT(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Va(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Cg(n,a,o,l){var d=n.tag;if(d===5||d===6)d=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(d,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(d),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=ir)),uf(n,l),dt=!0;else if(d!==4&&(d===27&&(uf(n,l),l=null,Va(n.type)&&(o=n.stateNode,a=null)),n=n.child,n!==null))for(Cg(n,a,o,l),n=n.sibling;n!==null;)Cg(n,a,o,l),n=n.sibling}function df(n,a,o,l){var d=n.tag;if(d===5||d===6)d=n.stateNode,a?o.insertBefore(d,a):o.appendChild(d),uf(n,l),dt=!0;else if(d!==4&&(d===27&&(uf(n,l),l=null,Va(n.type)&&(o=n.stateNode)),n=n.child,n!==null))for(df(n,a,o,l),n=n.sibling;n!==null;)df(n,a,o,l),n=n.sibling}function MT(n){var a=n.stateNode,o=n.memoizedProps;try{for(var l=n.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Nn(a,l,o),a[Sn]=n,a[Wn]=o}catch(h){Tt(n,n.return,h)}}var ff=!1,ds=null;function DT(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(ff=!0)}var ur=null;function UT(){var n=ur;return ur=null,n}var Jn=0;function Yo(n,a,o,l,d){return Jn=0,BT(n.child,a,o,l,d)}function BT(n,a,o,l,d){for(var h=!1;n!==null;){if(n.tag===5){var v=n.stateNode;if(l!==null){var _=h0(v);l.push(_),_.view&&(h=!0)}else h||h0(v).view&&(h=!0);ff=!0,U2(v,Jn===0?a:a+"_"+Jn,o),Jn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&d||BT(n.child,a,o,l,d)&&(h=!0));n=n.sibling}return h}function dr(n,a){for(;n!==null;)n.tag===5?B2(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&a||dr(n.child,a)),n=n.sibling}function hf(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(hf(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var a=n.memoizedProps;if(a.name==null||a.name==="auto")throw Error(r(544));var o=a.name;a=Lr(a.default,a.share),a!=="none"&&(Yo(n,o,a,null,!1)||dr(n.child,!1))}n=n.sibling}}function Ig(n,a){if(n.tag===30){var o=n.stateNode,l=n.memoizedProps,d=Br(l,o),h=Lr(l.default,o.paired?l.share:l.enter);h!=="none"?Yo(n,d,h,null,!1)?(hf(n),o.paired||a||nc(n,l.onEnter)):dr(n.child,!1):hf(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Ig(n,a),n=n.sibling;else hf(n)}function Rg(n){if(ds!==null&&ds.size!==0){var a=ds;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var o=n.memoizedProps,l=o.name;if(l!=null&&l!=="auto"){var d=a.get(l);if(d!==void 0){var h=Lr(o.default,o.share);if(h!=="none"&&(Yo(n,l,h,null,!1)?(h=n.stateNode,d.paired=h,h.paired=d,nc(n,o.onShare)):dr(n.child,!1)),a.delete(l),a.size===0)break}}}Rg(n)}n=n.sibling}}}function jg(n){if(n.tag===30){var a=n.memoizedProps,o=Br(a,n.stateNode),l=ds!==null?ds.get(o):void 0,d=Lr(a.default,l!==void 0?a.share:a.exit);d!=="none"&&(Yo(n,o,d,null,!1)?l!==void 0?(d=n.stateNode,l.paired=d,d.paired=l,ds.delete(o),nc(n,a.onShare)):nc(n,a.onExit):dr(n.child,!1)),ds!==null&&Rg(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)jg(n),n=n.sibling;else ds!==null&&Rg(n)}function LT(n){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,o=Br(a,n.stateNode);a=Lr(a.default,a.update),n.flags&=-5,a!=="none"&&Yo(n,o,a,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&<(n);n=n.sibling}}function Mg(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var a=n.stateNode;a.paired!==null&&(a.paired=null,dr(n.child,!1))}Mg(n)}n=n.sibling}}function pf(n){if(n.tag===30)n.stateNode.paired=null,dr(n.child,!1),Mg(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)pf(n),n=n.sibling;else Mg(n)}function zT(n){for(n=n.child;n!==null;)n.tag===30?dr(n.child,!1):(n.subtreeFlags&33554432)!==0&&zT(n),n=n.sibling}function Dg(n,a,o,l,d,h,v){for(var _=!1;a!==null;){if(a.tag===5){var B=a.stateNode;if(h!==null&&Jn<h.length){var ne=h[Jn],ie=h0(B);(ne.view||ie.view)&&(_=!0);var me;if(me=(n.flags&4)===0)if(ie.clip)me=!0;else{me=ne.rect;var Q=ie.rect;me=me.y!==Q.y||me.x!==Q.x||me.height!==Q.height||me.width!==Q.width}me&&(n.flags|=4),ie.abs?ie=!ne.abs:(ne=ne.rect,ie=ie.rect,ie=ne.height!==ie.height||ne.width!==ie.width),ie&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&U2(B,Jn===0?o:o+"_"+Jn,d),_&&(n.flags&4)!==0||(ur===null&&(ur=[]),ur.push(B,Jn===0?l:l+"_"+Jn,a.memoizedProps)),Jn++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&v?n.flags|=a.flags&32:Dg(n,a.child,o,l,d,h,v)&&(_=!0));a=a.sibling}return _}function $T(n,a){for(n=n.child;n!==null;){if(n.tag===30){var o=n.memoizedProps,l=n.stateNode,d=Br(o,l),h=Lr(o.default,o.update),v;v=n.memoizedState,n.memoizedState=null,l=n;var _=n.child;Jn=0,d=Dg(l,_,d,d,h,v,!1),(n.flags&4)!==0&&d&&nc(n,o.onUpdate)}else(n.subtreeFlags&33554432)!==0&&$T(n);n=n.sibling}}var yn=!1,mt=!1,fr=!1,Ug=!1,VT=typeof WeakSet=="function"?WeakSet:Set,vn=null,hr=!1,Zl=!1,mf=!1,Bg=!1;function Ox(n,a,o){if(n=n.containerInfo,c0=fc,n=H1(n),Sm(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,B=-1,ne=-1,ie=0,me=0,Q=n,ae=null;t:for(;;){for(var ke;Q!==l||h!==0&&Q.nodeType!==3||(B=_+h),Q!==v||d!==0&&Q.nodeType!==3||(ne=_+d),Q.nodeType===3&&(_+=Q.nodeValue.length),(ke=Q.firstChild)!==null;)ae=Q,Q=ke;for(;;){if(Q===n)break t;if(ae===l&&++ie===h&&(B=_),ae===v&&++me===d&&(ne=_),(ke=Q.nextSibling)!==null)break;Q=ae,ae=Q.parentNode}Q=ke}l=B===-1||ne===-1?null:{start:B,end:ne}}else l=null}l=l||{start:0,end:0}}else l=null;for(l0={focusedElem:n,selectionRange:l},fc=!1,o=(o&335544064)===o,vn=a,a=o?9270:1024;vn!==null;){if(n=vn,o&&(l=n.deletions,l!==null))for(h=0;h<l.length;h++)o&&jg(l[h]);if(n.alternate===null&&(n.flags&2)!==0)o&&DT(n),gf(o);else{if(n.tag===22){if(l=n.alternate,n.memoizedState!==null){l!==null&&l.memoizedState===null&&o&&jg(l),gf(o);continue}else if(l!==null&&l.memoizedState!==null){o&&DT(n),gf(o);continue}}l=n.child,(n.subtreeFlags&a)!==0&&l!==null?(l.return=n,vn=l):(o&<(n),gf(o))}}ds=null}function gf(n){for(;vn!==null;){var a=vn,o=n,l=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((d&1024)!==0&&l!==null){o=void 0,d=l.memoizedProps,l=l.memoizedState;var h=a.stateNode;try{var v=Bi(a.type,d);o=h.getSnapshotBeforeUpdate(v,l),h.__reactInternalSnapshotBeforeUpdate=o}catch(_){Tt(a,a.return,_)}}break;case 3:if((d&1024)!==0){if(l=a.stateNode.containerInfo,o=l.nodeType,o===9)g0(l);else if(o===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":g0(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:o&&l!==null&&(o=Br(l.memoizedProps,l.stateNode),d=a.memoizedProps,d=Lr(d.default,d.update),d!=="none"&&Yo(l,o,d,l.memoizedState=[],!0));break;default:if((d&1024)!==0)throw Error(r(163))}if(l=a.sibling,l!==null){l.return=a.return,vn=l;break}vn=a.return}}function PT(n,a,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:pr(n,o),l&4&&Hl(5,o);break;case 1:if(pr(n,o),l&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(v){Tt(o,o.return,v)}else{var d=Bi(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(d,a,n.__reactInternalSnapshotBeforeUpdate)}catch(v){Tt(o,o.return,v)}}l&64&&CT(o),l&512&&lr(o,o.return);break;case 3:if(pr(n,o),l&64&&(n=o.updateQueue,n!==null)){if(a=null,o.child!==null)switch(o.child.tag){case 27:case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}try{bw(n,a)}catch(v){Tt(o,o.return,v)}}break;case 27:a===null&&l&4&&MT(o);case 26:case 5:pr(n,o),a===null&&l&4&&Og(o),l&512&&lr(o,o.return);break;case 12:pr(n,o);break;case 31:pr(n,o),l&4&&qT(n,o);break;case 13:pr(n,o),l&4&&ZT(n,o),l&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=zx.bind(null,o),wC(n,o))));break;case 22:if(l=o.memoizedState!==null||yn,!l){var h=a!==null&&a.memoizedState!==null||mt;a=yn,d=mt,yn=l,(mt=h)&&!d?(l=2,(o.subtreeFlags&8772)!==0&&(l|=1),Hs(n,o,l)):pr(n,o),yn=a,mt=d}break;case 30:pr(n,o),l&512&&lr(o,o.return);break;case 7:l&512&&lr(o,o.return);default:pr(n,o)}}function Lg(n,a){for(n=n.child;n!==null;)GT(n,a),n=n.sibling}function GT(n,a){switch(n.tag){case 5:case 26:try{var o=n.stateNode;if(a){var l=o.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var d=n.stateNode,h=n.memoizedProps.style,v=h!=null&&h.hasOwnProperty("display")?h.display:null;d.style.display=v==null||typeof v=="boolean"?"":(""+v).trim()}}catch(B){Tt(n,n.return,B)}zg(n,a);break;case 6:try{n.stateNode.nodeValue=a?"":n.memoizedProps,dt=!0}catch(B){Tt(n,n.return,B)}break;case 18:try{var _=n.stateNode;a?D2(_,!0):D2(n.stateNode,!1)}catch(B){Tt(n,n.return,B)}break;case 22:case 23:n.memoizedState===null&&Lg(n,a);break;default:Lg(n,a)}}function zg(n,a){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var o=n,l=a;switch(o.tag){case 4:GT(o,l);break e;case 22:o.memoizedState===null&&zg(o,l);break e;default:zg(o,l)}}n=n.sibling}}function FT(n){var a=n.alternate;a!==null&&(n.alternate=null,FT(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&wd(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Bt=null,Kn=!1;function Gs(n,a,o){for(o=o.child;o!==null;)HT(n,a,o),o=o.sibling}function HT(n,a,o){if(is&&typeof is.onCommitFiberUnmount=="function")try{is.onCommitFiberUnmount(gl,o)}catch{}switch(o.tag){case 26:mt||On(o,a),Gs(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&!mt&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:mt||On(o,a),ql(o);var l=Bt,d=Kn;Va(o.type)&&(Bt=o.stateNode,Kn=!1),Gs(n,a,o),W2(o.stateNode,o.type,o.memoizedProps),Bt=l,Kn=d;break;case 5:mt||On(o,a),ql(o);case 6:if(o.tag===6&&ql(o),l=Bt,d=Kn,Bt=null,Gs(n,a,o),Bt=l,Kn=d,Bt!==null)if(Kn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(o.stateNode),dt=!0}catch(h){Tt(o,a,h)}else try{Bt.removeChild(o.stateNode),dt=!0}catch(h){Tt(o,a,h)}break;case 18:Bt!==null&&(Kn?(n=Bt,M2(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),hc(n)):M2(Bt,o.stateNode));break;case 4:l=Bt,d=Kn,Bt=o.stateNode.containerInfo,Kn=!0,Gs(n,a,o),Bt=l,Kn=d;break;case 0:case 11:case 14:case 15:Ma(2,o,a),mt||Ma(4,o,a),Gs(n,a,o);break;case 1:mt||(On(o,a),l=o.stateNode,typeof l.componentWillUnmount=="function"&&IT(o,a,l)),Gs(n,a,o);break;case 21:Gs(n,a,o);break;case 22:mt=(l=mt)||o.memoizedState!==null,Gs(n,a,o),mt=l;break;case 30:On(o,a),Gs(n,a,o);break;case 7:mt||On(o,a),Gs(n,a,o);break;default:Gs(n,a,o)}}function qT(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{hc(n)}catch(o){Tt(a,a.return,o)}}}function ZT(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{hc(n)}catch(o){Tt(a,a.return,o)}}function Nx(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new VT),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new VT),a;default:throw Error(r(435,n.tag))}}function yf(n,a){var o=Nx(n);a.forEach(function(l){if(!o.has(l)){o.add(l);var d=$x.bind(null,n,l);l.then(d,d)}})}function Vn(n,a,o){var l=a.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],v=n,_=a,B=_;e:for(;B!==null;){switch(B.tag){case 27:if(Va(B.type)){Bt=B.stateNode,Kn=!1;break e}break;case 5:Bt=B.stateNode,Kn=!1;break e;case 3:case 4:Bt=B.stateNode.containerInfo,Kn=!0;break e}B=B.return}if(Bt===null)throw Error(r(160));HT(v,_,h),Bt=null,Kn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)YT(a,n,o),a=a.sibling}var Fs=null;function YT(n,a,o){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(d&4&&(l=n.updateQueue,l=l!==null?l.events:null,l!==null))for(var h=0;h<l.length;h++){var v=l[h];v.ref.impl=v.nextImpl}Vn(a,n,o),Pn(n),d&4&&(Ma(3,n,n.return),Hl(3,n),Ma(5,n,n.return));break;case 1:Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),d&64&&yn&&(n=n.updateQueue,n!==null&&(a=n.callbacks,a!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?a:o.concat(a))));break;case 26:if(h=Fs,Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),d&4)if(d=l!==null?l.memoizedState:null,o=n.memoizedState,l===null)if(o===null)if(n.stateNode===null)if(yn)n.stateNode=I2(n.type,n.memoizedProps,a.containerInfo,n);else{e:{a=n.type,o=n.memoizedProps,d=h.ownerDocument||h;t:switch(a){case"title":l=d.getElementsByTagName("title")[0],(!l||l[bl]||l[Sn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=d.createElement(a),d.head.insertBefore(l,d.querySelector("head > title"))),Nn(l,a,o),l[Sn]=n,mn(l),a=l;break e;case"link":if(h=tE("link","href",d).get(a+(o.href||""))){for(v=0;v<h.length;v++)if(l=h[v],l.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&l.getAttribute("rel")===(o.rel==null?null:o.rel)&&l.getAttribute("title")===(o.title==null?null:o.title)&&l.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){h.splice(v,1);break t}}l=d.createElement(a),Nn(l,a,o),d.head.appendChild(l);break;case"meta":if(h=tE("meta","content",d).get(a+(o.content||""))){for(v=0;v<h.length;v++)if(l=h[v],l.getAttribute("content")===(o.content==null?null:""+o.content)&&l.getAttribute("name")===(o.name==null?null:o.name)&&l.getAttribute("property")===(o.property==null?null:o.property)&&l.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&l.getAttribute("charset")===(o.charSet==null?null:o.charSet)){h.splice(v,1);break t}}l=d.createElement(a),Nn(l,a,o),d.head.appendChild(l);break;default:throw Error(r(468,a))}l[Sn]=n,mn(l),a=l}n.stateNode=a}else yn||S0(h,n.type,n.stateNode);else n.stateNode=eE(h,o,n.memoizedProps);else d!==o?(d===null?(a=l.stateNode,a===null||mt||a.parentNode.removeChild(a)):d.count--,o===null?yn||S0(h,n.type,n.stateNode):eE(h,o,n.memoizedProps)):o===null&&n.stateNode!==null&&Ng(n,n.memoizedProps,l.memoizedProps);break;case 27:Vn(a,n,o),Pn(n),d&512&&(mt||l===null||On(l,l.return)),l!==null&&d&4&&Ng(n,n.memoizedProps,l.memoizedProps);break;case 5:if(h=fr,fr=!1,Vn(a,n,o),fr=h,Pn(n),d&512&&(mt||l===null||On(l,l.return)),n.flags&32){a=n.stateNode;try{Co(a,""),dt=!0}catch(ie){Tt(n,n.return,ie)}}d&4&&n.stateNode!=null&&(a=n.memoizedProps,Ng(n,a,l!==null?l.memoizedProps:a)),d&1024&&(Ug=!0);break;case 6:if(Vn(a,n,o),Pn(n),d&4){if(n.stateNode===null)throw Error(r(162));a=n.memoizedProps,o=n.stateNode;try{o.nodeValue=a,dt=!0}catch(ie){Tt(n,n.return,ie)}}break;case 3:if(dt=!1,Rf=null,h=Fs,Fs=nu(a.containerInfo),Vn(a,n,o),Fs=h,Pn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{hc(a.containerInfo)}catch(ie){Tt(n,n.return,ie)}Ug&&(Ug=!1,WT(n)),dt=!1;break;case 4:d=fr,fr=yn,l=m1(),h=Fs,Fs=nu(n.stateNode.containerInfo),Vn(a,n,o),Pn(n),Fs=h,dt&&Zl&&(mf=!0),dt=l,fr=d;break;case 12:Vn(a,n,o),Pn(n);break;case 31:Vn(a,n,o),Pn(n),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,yf(n,a)));break;case 13:Vn(a,n,o),Pn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(wf=Ln()),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,yf(n,a)));break;case 22:h=n.memoizedState!==null,v=l!==null&&l.memoizedState!==null;var _=yn,B=mt,ne=fr;yn=_||h,fr=ne||h,mt=B||v,Vn(a,n,o),mt=B,fr=ne,yn=_,Pn(n),d&8192&&(a=n.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,!h||l===null||v||yn||mt||(a=v||mt,o=yn,l=mt,yn=h||yn,mt=a,Da(n,2),yn=o,mt=l),!h&&fr||Lg(n,h)),d&4&&(a=n.updateQueue,a!==null&&(o=a.retryQueue,o!==null&&(a.retryQueue=null,yf(n,o))));break;case 19:Vn(a,n,o),Pn(n),d&4&&(a=n.updateQueue,a!==null&&(n.updateQueue=null,yf(n,a)));break;case 30:d&512&&(mt||l===null||On(l,l.return)),d=m1(),h=Zl,v=(o&335544064)===o,_=n.memoizedProps,Zl=v&&Lr(_.default,_.update)!=="none",Vn(a,n,o),Pn(n),v&&l!==null&&dt&&(n.flags|=4),Zl=h,dt=d;break;case 21:break;case 7:d&512&&(mt||l===null||On(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=n);default:Vn(a,n,o),Pn(n)}}function Pn(n){var a=n.flags;if(a&2){try{for(var o,l=n.return;l!==null;){if(jT(l)){o=l;break}l=l.return}l=null;for(var d=n.return;d!==null;){if(Ag(d)){var h=d.stateNode;l===null?l=[h]:l.push(h)}if(kg(d))break;d=d.return}var v=l;if(o==null)throw Error(r(160));switch(o.tag){case 27:var _=o.stateNode,B=xg(n);df(n,B,_,v);break;case 5:var ne=o.stateNode;o.flags&32&&(Co(ne,""),o.flags&=-33);var ie=xg(n);df(n,ie,ne,v);break;case 3:case 4:var me=o.stateNode.containerInfo,Q=xg(n);Cg(n,Q,me,v);break;default:throw Error(r(161))}}catch(ae){Tt(n,n.return,ae)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function WT(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;WT(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,fc=!0,a.reset(),fc=!1),n=n.sibling}}function Wo(n,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)XT(a,n),a=a.sibling;else $T(a)}function XT(n,a){var o=n.alternate;if(o===null)Ig(n,!1);else switch(n.tag){case 3:if(Bg=hr=!1,UT(),Wo(a,n),!hr&&!mf){if(n=ur,n!==null)for(var l=0;l<n.length;l+=3){o=n[l];var d=n[l+1];B2(o,n[l+2]),o=o.ownerDocument.documentElement,o!==null&&o.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+d+")"})}n=a.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Bg=!0}ur=null;break;case 5:Wo(a,n);break;case 4:l=hr,hr=!1,Wo(a,n),hr&&(mf=!0),hr=l;break;case 22:n.memoizedState===null&&(o.memoizedState!==null?Ig(n,!1):Wo(a,n));break;case 30:l=hr,d=UT(),hr=!1,Wo(a,n),hr&&(n.flags|=4);var h=n.memoizedProps,v=n.stateNode;a=Br(h,v),v=Br(o.memoizedProps,v);var _=Lr(h.default,h.update);_==="none"?a=!1:(h=o.memoizedState,o.memoizedState=null,o=n.child,Jn=0,a=Dg(n,o,a,v,_,h,!0),Jn!==(h===null?0:h.length)&&(n.flags|=32)),(n.flags&4)!==0&&a?(nc(n,n.memoizedProps.onUpdate),ur=d):d!==null&&(d.push.apply(d,ur),ur=d),hr=(n.flags&32)!==0?!0:l;break;default:Wo(a,n)}}function pr(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)PT(n,a.alternate,a),a=a.sibling}function Da(n,a){for(n=n.child;n!==null;){var o=n,l=a;switch(o.tag){case 0:case 11:case 14:case 15:Ma(4,o,o.return),Da(o,l);break;case 1:On(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&IT(o,o.return,d),Da(o,l);break;case 27:(l&2)!==0&&W2(o.stateNode,o.type,o.memoizedProps);case 5:On(o,o.return),o.tag!==5&&o.tag!==27||ql(o),Da(o,l);break;case 6:ql(o);break;case 26:On(o,o.return),d=o.stateNode,o.memoizedState!==null||d===null||mt||d.parentNode.removeChild(d),Da(o,l);break;case 22:o.memoizedState===null&&Da(o,l);break;case 30:On(o,o.return),Da(o,l);break;case 7:On(o,o.return);default:Da(o,l)}n=n.sibling}}function Hs(n,a,o){for(o=(a.subtreeFlags&8772)!==0?o:o&-2,a=a.child;a!==null;){var l=a.alternate,d=n,h=a,v=h.flags,_=(o&1)!==0;switch(h.tag){case 0:case 11:case 15:Hs(d,h,o),Hl(4,h);break;case 1:if(Hs(d,h,o),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(ie){Tt(l,l.return,ie)}if(l=h,d=l.updateQueue,d!==null){var B=l.stateNode;try{var ne=d.shared.hiddenCallbacks;if(ne!==null)for(d.shared.hiddenCallbacks=null,d=0;d<ne.length;d++)vw(ne[d],B)}catch(ie){Tt(l,l.return,ie)}}_&&v&64&&CT(h),lr(h,h.return);break;case 27:(o&2)!==0&&MT(h);case 5:h.tag!==5&&h.tag!==27||RT(h),Hs(d,h,o),_&&l===null&&v&4&&Og(h),lr(h,h.return);break;case 6:RT(h);break;case 26:B=h.stateNode,h.memoizedState!==null||B===null||yn||S0(nu(B.ownerDocument),h.type,B),Hs(d,h,o),_&&l===null&&v&4&&Og(h),lr(h,h.return);break;case 12:Hs(d,h,o);break;case 31:Hs(d,h,o),_&&v&4&&qT(d,h);break;case 13:Hs(d,h,o),_&&v&4&&ZT(d,h);break;case 22:h.memoizedState===null&&Hs(d,h,o),lr(h,h.return);break;case 30:Hs(d,h,o),lr(h,h.return);break;case 7:lr(h,h.return);default:Hs(d,h,o)}a=a.sibling}}function $g(n,a){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&Rl(o))}function Vg(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&Rl(n))}function Cs(n,a,o,l){var d=(o&335544064)===o;if(a.subtreeFlags&(d?10262:10256))for(a=a.child;a!==null;)JT(n,a,o,l),a=a.sibling;else d&&zT(a)}function JT(n,a,o,l){var d=(o&335544064)===o;d&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&pf(a);var h=a.flags;switch(a.tag){case 0:case 11:case 15:Cs(n,a,o,l),h&2048&&Hl(9,a);break;case 1:Cs(n,a,o,l);break;case 3:Cs(n,a,o,l),d&&Bg&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),h&2048&&(h=null,a.alternate!==null&&(h=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==h&&(a.refCount++,h!=null&&Rl(h)));break;case 12:if(h&2048){Cs(n,a,o,l),h=a.stateNode;try{var v=a.memoizedProps,_=v.id,B=v.onPostCommit;typeof B=="function"&&B(_,a.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(ne){Tt(a,a.return,ne)}}else Cs(n,a,o,l);break;case 31:Cs(n,a,o,l);break;case 13:Cs(n,a,o,l);break;case 23:break;case 22:v=a.stateNode,_=a.alternate,a.memoizedState!==null?(d&&_!==null&&_.memoizedState===null&&pf(_),v._visibility&2?Cs(n,a,o,l):Yl(n,a)):(d&&_!==null&&_.memoizedState!==null&&pf(a),v._visibility&2?Cs(n,a,o,l):(v._visibility|=2,Xo(n,a,o,l,(a.subtreeFlags&10256)!==0||!1))),h&2048&&$g(_,a);break;case 24:Cs(n,a,o,l),h&2048&&Vg(a.alternate,a);break;case 30:d&&(h=a.alternate,h!==null&&(dr(h.child,!0),dr(a.child,!0))),Cs(n,a,o,l);break;default:Cs(n,a,o,l)}}function Xo(n,a,o,l,d){for(d=d&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var h=n,v=a,_=o,B=l,ne=v.flags;switch(v.tag){case 0:case 11:case 15:Xo(h,v,_,B,d),Hl(8,v);break;case 23:break;case 22:var ie=v.stateNode;v.memoizedState!==null?ie._visibility&2?Xo(h,v,_,B,d):Yl(h,v):(ie._visibility|=2,Xo(h,v,_,B,d)),d&&ne&2048&&$g(v.alternate,v);break;case 24:Xo(h,v,_,B,d),d&&ne&2048&&Vg(v.alternate,v);break;default:Xo(h,v,_,B,d)}a=a.sibling}}function Yl(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,l=a,d=l.flags;switch(l.tag){case 22:Yl(o,l),d&2048&&$g(l.alternate,l);break;case 24:Yl(o,l),d&2048&&Vg(l.alternate,l);break;default:Yl(o,l)}a=a.sibling}}var Li=8192;function zi(n,a,o){if(n.subtreeFlags&Li)for(n=n.child;n!==null;)KT(n,a,o),n=n.sibling}function KT(n,a,o){switch(n.tag){case 26:zi(n,a,o),n.flags&Li&&(n.memoizedState!==null?MC(o,Fs,n.memoizedState,n.memoizedProps):(n=n.stateNode,(a&335544128)===a&&aE(o,n)));break;case 5:zi(n,a,o),n.flags&Li&&(n=n.stateNode,(a&335544128)===a&&aE(o,n));break;case 3:case 4:var l=Fs;Fs=nu(n.stateNode.containerInfo),zi(n,a,o),Fs=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Li,Li=16777216,zi(n,a,o),Li=l):zi(n,a,o));break;case 30:if((n.flags&Li)!==0&&(l=n.memoizedProps.name,l!=null&&l!=="auto")){var d=n.stateNode;d.paired=null,ds===null&&(ds=new Map),ds.set(l,d)}zi(n,a,o);break;default:zi(n,a,o)}}function QT(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Wl(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var l=a[o];vn=l,t2(l,n)}QT(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)e2(n),n=n.sibling}function e2(n){switch(n.tag){case 0:case 11:case 15:Wl(n),n.flags&2048&&Ma(9,n,n.return);break;case 3:Wl(n);break;case 12:Wl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,vf(n)):Wl(n);break;default:Wl(n)}}function vf(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var l=a[o];vn=l,t2(l,n)}QT(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ma(8,a,a.return),vf(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,vf(a));break;default:vf(a)}n=n.sibling}}function t2(n,a){for(;vn!==null;){var o=vn;switch(o.tag){case 0:case 11:case 15:Ma(8,o,a);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Rl(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,vn=l;else e:for(o=n;vn!==null;){l=vn;var d=l.sibling,h=l.return;if(FT(l),l===o){vn=null;break e}if(d!==null){d.return=h,vn=d;break e}vn=h}}}var xx={getCacheForType:function(n){var a=_n(Jt),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return _n(Jt).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,ht=0,xt=null,et=null,it=0,wt=0,fs=null,Ua=!1,Jo=!1,Pg=!1,Zr=0,Pt=0,Ba=0,$i=0,bf=0,hs=0,Ko=0,Xl=null,Qn=null,Gg=!1,wf=0,n2=0,Tf=1/0,Ef=null,La=null,zt=0,qs=null,Vi=null,mr=0,Fg=0,Hg=null,s2=null,Qo=null,ec=null,tc=null,Jl=0,Sf=null;function ps(){return(ht&2)!==0&&it!==0?it&-it:be.T!==null?t0():i1()}function r2(){if(hs===0)if((it&536870912)===0||Ke){var n=gd;gd<<=1,(gd&3932160)===0&&(gd=262144),hs=n}else hs=536870912;return n=kn.current,n!==null&&(n.flags|=32),hs}function nc(n,a){if(a!=null){var o=n.stateNode,l=o.ref;l===null&&(l=o.ref=L2(Br(n.memoizedProps,o))),ec===null&&(ec=[]),ec.push(a.bind(null,l))}}function es(n,a,o){(n===xt&&(wt===2||wt===9)||n.cancelPendingCommit!==null)&&(sc(n,0),za(n,it,hs,!1)),vl(n,o),((ht&2)===0||n!==xt)&&(n===xt&&((ht&2)===0&&($i|=o),Pt===4&&za(n,it,hs,!1)),gr(n))}function a2(n,a,o){if((ht&6)!==0)throw Error(r(327));var l=!o&&(a&127)===0&&(a&n.expiredLanes)===0||yl(n,a),d=l?jx(n,a):Zg(n,a,!0),h=l;do{if(d===0){Jo&&!l&&za(n,a,0,!1);break}else{if(o=n.current.alternate,h&&!Ix(o)){d=Zg(n,a,!1),h=!1;continue}if(d===2){if(h=a,n.errorRecoveryDisabledLanes&h)var v=0;else v=n.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){a=v;e:{var _=n;d=Xl;var B=_.current.memoizedState.isDehydrated;if(B&&(sc(_,v).flags|=256),v=Zg(_,v,!1),v!==2&&v!==6){if(Pg&&!B){_.errorRecoveryDisabledLanes|=h,$i|=h,d=4;break e}h=Qn,Qn=d,h!==null&&(Qn===null?Qn=h:Qn.push.apply(Qn,h))}d=v}if(h=!1,d!==2)continue}}if(d===1){sc(n,0),za(n,a,0,!0);break}e:{switch(l=n,h=d,h){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:za(l,a,hs,!Ua);break e;case 2:Qn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(d=wf+300-Ln(),10<d)){if(za(l,a,hs,!Ua),vd(l,0,!0)!==0)break e;mr=a,l.timeoutHandle=f0(i2.bind(null,l,o,Qn,Ef,Gg,a,hs,$i,Ko,Ua,h,"Throttled",-0,0),d);break e}i2(l,o,Qn,Ef,Gg,a,hs,$i,Ko,Ua,h,null,-0,0)}}break}while(!0);gr(n)}function i2(n,a,o,l,d,h,v,_,B,ne,ie,me,Q,ae){n.timeoutHandle=-1;var ke=a.subtreeFlags,Re=(h&335544064)===h;if(me=null,(Re||ke&8192||(ke&16785408)===16785408)&&(me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ir},ds=null,KT(a,h,me),Re&&(ke=me,Re=n.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(ke.count++,ke.waitingForViewTransition=!0,ke=au.bind(ke),Re.finished.then(ke,ke))),ke=(h&62914560)===h?wf-Ln():(h&4194048)===h?n2-Ln():0,ke=DC(me,ke),ke!==null)){mr=h,n.cancelPendingCommit=ke(p2.bind(null,n,a,h,o,l,d,v,_,B,ne,ie,me,null,Q,ae)),za(n,h,v,!ne);return}p2(n,a,h,o,l,d,v,_,B,ne,ie,me)}function Ix(n){for(var a=n;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var d=o[l],h=d.getSnapshot;d=d.value;try{if(!ls(h(),d))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function za(n,a,o,l){a=t1(n,a),a&=~bf,a&=~$i,n.suspendedLanes|=a,n.pingedLanes&=~a,l&&(n.warmLanes|=a),l=n.expirationTimes;for(var d=a;0<d;){var h=31-os(d),v=1<<h;l[h]=-1,d&=~v}o!==0&&s1(n,o,a)}function _f(){return(ht&6)===0?(Kl(0),!1):!0}function qg(){if(et!==null){if(wt===0)var n=et.return;else n=et,Vr=Ni=null,eg(n),Go=null,Dl=0,n=et;for(;n!==null;)xT(n.alternate,n),n=n.return;et=null}}function sc(n,a){var o=n.timeoutHandle;return o!==-1&&(n.timeoutHandle=-1,tC(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),mr=0,qg(),xt=n,et=o=zr(n.current,null),it=a,wt=0,fs=null,Ua=!1,Jo=yl(n,a),Pg=!1,Ko=hs=bf=$i=Ba=Pt=0,Qn=Xl=null,Gg=!1,Zr=t1(n,a),Id(),o}function o2(n,a){We=null,be.H=nf,a===Po||a===Pd?(a=pw(),wt=3):a===Vm?(a=pw(),wt=4):wt=a===mg?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,fs=a,et===null&&(Pt=1,sf(n,As(a,n.current)))}function c2(){var n=kn.current;return n===null?!0:(it&4194048)===it?Mn===null:(it&62914560)===it||(it&536870912)!==0?n===Mn:!1}function l2(){var n=be.H;return be.H=nf,n===null?nf:n}function u2(){var n=be.A;return be.A=xx,n}function kf(){Pt=4,Ua||(it&4194048)!==it&&kn.current!==null||(Jo=!0),(Ba&134217727)===0&&($i&134217727)===0||xt===null||za(xt,it,hs,!1)}function Zg(n,a,o){var l=ht;ht|=2;var d=l2(),h=u2();(xt!==n||it!==a)&&(Ef=null,sc(n,a)),a=!1;var v=Pt;e:do try{if(wt!==0&&et!==null){var _=et,B=fs;switch(wt){case 8:qg(),v=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(a=!0);var ne=wt;if(wt=0,fs=null,rc(n,_,B,ne),o&&Jo){v=0;break e}break;default:ne=wt,wt=0,fs=null,rc(n,_,B,ne)}}Rx(),v=Pt;break}catch(ie){o2(n,ie)}while(!0);return a&&n.shellSuspendCounter++,Vr=Ni=null,ht=l,be.H=d,be.A=h,et===null&&(xt=null,it=0,Id()),v}function Rx(){for(;et!==null;)d2(et)}function jx(n,a){var o=ht;ht|=2;var l=l2(),d=u2();xt!==n||it!==a?(Ef=null,Tf=Ln()+500,sc(n,a)):Jo=yl(n,a);e:do try{if(wt!==0&&et!==null){a=et;var h=fs;t:switch(wt){case 1:wt=0,fs=null,rc(n,a,h,1);break;case 2:case 9:if(fw(h)){wt=0,fs=null,f2(a);break}a=function(){wt!==2&&wt!==9||xt!==n||(wt=7),gr(n)},h.then(a,a);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:fw(h)?(wt=0,fs=null,f2(a)):(wt=0,fs=null,rc(n,a,h,7));break;case 5:var v=null;switch(et.tag){case 26:v=et.memoizedState;case 5:case 27:var _=et;if(v?sE(v):_.stateNode.complete){wt=0,fs=null;var B=_.sibling;if(B!==null)et=B;else{var ne=_.return;ne!==null?(et=ne,Af(ne)):et=null}break t}}wt=0,fs=null,rc(n,a,h,5);break;case 6:wt=0,fs=null,rc(n,a,h,6);break;case 8:qg(),Pt=6;break e;default:throw Error(r(462))}}Mx();break}catch(ie){o2(n,ie)}while(!0);return Vr=Ni=null,be.H=l,be.A=d,ht=o,et!==null?0:(xt=null,it=0,Id(),Pt)}function Mx(){for(;et!==null&&!em();)d2(et)}function d2(n){var a=OT(n.alternate,n,Zr);n.memoizedProps=n.pendingProps,a===null?Af(n):et=a}function f2(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=wT(o,a,a.pendingProps,a.type,void 0,it);break;case 11:a=wT(o,a,a.pendingProps,a.type.render,a.ref,it);break;case 5:eg(a);var l=a;l===gn&&(Ke?(Bd(l),l.tag===5&&l.stateNode!=null&&(Rt=l.stateNode)):(Bd(l),Ke=!0));default:xT(o,a),a=et=tw(a,Zr),a=OT(o,a,Zr)}n.memoizedProps=n.pendingProps,a===null?Af(n):et=a}function rc(n,a,o,l){Vr=Ni=null,eg(a),Go=null,Dl=0;var d=a.return;try{if(Tx(n,d,a,o,it)){Pt=1,sf(n,As(o,n.current)),et=null;return}}catch(h){if(d!==null)throw et=d,h;Pt=1,sf(n,As(o,n.current)),et=null;return}a.flags&32768?(Ke||l===1?n=!0:Jo||(it&536870912)!==0?n=!1:(Ua=n=!0,(l===2||l===9||l===3||l===6)&&(l=kn.current,l!==null&&l.tag===13&&(l.flags|=16384))),h2(a,n)):Af(a)}function Af(n){var a=n;do{if((a.flags&32768)!==0){h2(a,Ua);return}n=a.return;var o=kx(a.alternate,a,Zr);if(o!==null){et=o;return}if(a=a.sibling,a!==null){et=a;return}et=a=n}while(a!==null);Pt===0&&(Pt=5)}function h2(n,a){do{var o=Ax(n.alternate,n);if(o!==null){o.flags&=32767,et=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){et=n;return}et=n=o}while(n!==null);Pt=6,et=null}function p2(n,a,o,l,d,h,v,_,B,ne,ie,me){n.cancelPendingCommit=null;do Of();while(zt!==0);if((ht&6)!==0)throw Error(r(327));if(a!==null){if(a===n.current)throw Error(r(177));n===xt&&(et=xt=null,it=0),Vi=a,qs=n,mr=o,Hg=d,s2=l,Dx(n,a,o,v,_,B,me)}}function Dx(n,a,o,l,d,h,v){var _=a.lanes|a.childLanes;if(Fg=_,_|=Nm,oN(n,o,_,l,d,h),ec=null,(o&335544064)===o?(tc=lx(n),l=10262):(tc=null,l=10256),(a.subtreeFlags&l)!==0||(a.flags&l)!==0?(n.callbackNode=null,n.callbackPriority=0,Vx(Ye,function(){return Jg(),null})):(n.callbackNode=null,n.callbackPriority=0),ff=!1,l=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null,d=_e.p,_e.p=2,h=ht,ht|=4;try{Ox(n,a,o)}finally{ht=h,_e.p=d,be.T=l}}zt=1,ff?Qo=oC(v,n.containerInfo,tc,Yg,Wg,Bx,Xg,Jg,Ux):(Yg(),Wg(),Xg())}function Ux(n){if(zt!==0){var a=qs.onRecoverableError;a(n,{componentStack:null})}}function Bx(){zt===3&&(zt=0,XT(Vi,qs),zt=4)}function Yg(){if(zt===1){zt=0;var n=qs,a=Vi,o=mr,l=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||l){l=be.T,be.T=null;var d=_e.p;_e.p=2;var h=ht;ht|=4;try{Zl=mf=!1,YT(a,n,o),o=l0;var v=H1(n.containerInfo),_=o.focusedElem,B=o.selectionRange;if(v!==_&&_&&_.ownerDocument&&F1(_.ownerDocument.documentElement,_)){if(B!==null&&Sm(_)){var ne=B.start,ie=B.end;if(ie===void 0&&(ie=ne),"selectionStart"in _)_.selectionStart=ne,_.selectionEnd=Math.min(ie,_.value.length);else{var me=_.ownerDocument||document,Q=me&&me.defaultView||window;if(Q.getSelection){var ae=Q.getSelection(),ke=_.textContent.length,Re=Math.min(B.start,ke),Xe=B.end===void 0?Re:Math.min(B.end,ke);!ae.extend&&Re>Xe&&(v=Xe,Xe=Re,Re=v);var ee=G1(_,Re),Z=G1(_,Xe);if(ee&&Z&&(ae.rangeCount!==1||ae.anchorNode!==ee.node||ae.anchorOffset!==ee.offset||ae.focusNode!==Z.node||ae.focusOffset!==Z.offset)){var se=me.createRange();se.setStart(ee.node,ee.offset),ae.removeAllRanges(),Re>Xe?(ae.addRange(se),ae.extend(Z.node,Z.offset)):(se.setEnd(Z.node,Z.offset),ae.addRange(se))}}}}for(me=[],ae=_;ae=ae.parentNode;)ae.nodeType===1&&me.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<me.length;_++){var pe=me[_];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}fc=!!c0,l0=c0=null}finally{ht=h,_e.p=d,be.T=l}}n.current=a,zt=2}}function Wg(){if(zt===2){zt=0;var n=qs,a=Vi,o=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||o){o=be.T,be.T=null;var l=_e.p;_e.p=2;var d=ht;ht|=4;try{PT(n,a.alternate,a)}finally{ht=d,_e.p=l,be.T=o}}zt=3}}function Xg(){if(zt===4||zt===3){zt=0;var n=Qo;Qo=null,tm();var a=qs,o=Vi,l=mr,d=s2,h=(l&335544064)===l?10262:10256;if((o.subtreeFlags&h)!==0||(o.flags&h)!==0?zt=5:(zt=0,Vi=qs=null,m2(a,a.pendingLanes)),h=a.pendingLanes,h===0&&(La=null),am(l),o=o.stateNode,is&&typeof is.onCommitFiberRoot=="function")try{is.onCommitFiberRoot(gl,o,void 0,(o.current.flags&128)===128)}catch{}if(d!==null){o=be.T,h=_e.p,_e.p=2,be.T=null;try{for(var v=a.onRecoverableError,_=0;_<d.length;_++){var B=d[_];v(B.value,{componentStack:B.stack})}}finally{be.T=o,_e.p=h}}if(d=ec,v=tc,tc=null,d!==null&&(ec=null,v===null&&(v=[]),n!==null))for(B=0;B<d.length;B++)o=(0,d[B])(v),o!==void 0&&n.finished.finally(o);(mr&3)!==0&&Of(),gr(a),h=a.pendingLanes,(l&261930)!==0&&(h&42)!==0?a===Sf?Jl++:(Jl=0,Sf=a):(Jl=0,Sf=null),Kl(0)}}function m2(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,Rl(a)))}function Of(){return Qo!==null&&(Qo.skipTransition(),Qo=null),Yg(),Wg(),Xg(),Jg()}function Jg(){if(zt!==5)return!1;var n=qs,a=Fg;Fg=0;var o=am(mr),l=be.T,d=_e.p;try{_e.p=32>o?32:o,be.T=null,o=Hg,Hg=null;var h=qs,v=mr;if(zt=0,Vi=qs=null,mr=0,(ht&6)!==0)throw Error(r(331));var _=ht;if(ht|=4,e2(h.current),JT(h,h.current,v,o),ht=_,Kl(0,!1),is&&typeof is.onPostCommitFiberRoot=="function")try{is.onPostCommitFiberRoot(gl,h)}catch{}return!0}finally{_e.p=d,be.T=l,m2(n,a)}}function g2(n,a,o){a=As(o,a),a=pg(n.stateNode,a,2),n=Ca(n,a,2),n!==null&&(vl(n,2),gr(n))}function Tt(n,a,o){if(n.tag===3)g2(n,n,o);else for(;a!==null;){if(a.tag===3){g2(a,n,o);break}else if(a.tag===1){var l=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(La===null||!La.has(l))){n=As(o,n),o=fT(2),l=Ca(a,o,2),l!==null&&(hT(o,l,a,n),vl(l,2),gr(l));break}}a=a.return}}function Kg(n,a,o){var l=n.pingCache;if(l===null){l=n.pingCache=new Cx;var d=new Set;l.set(a,d)}else d=l.get(a),d===void 0&&(d=new Set,l.set(a,d));d.has(o)||(Pg=!0,d.add(o),n=Lx.bind(null,n,a,o),a.then(n,n))}function Lx(n,a,o){var l=n.pingCache;l!==null&&l.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,xt===n&&(it&o)===o&&((Pt===4||Pt===3&&(it&62914560)===it&&300>Ln()-wf)&&(ht&2)===0?sc(n,0):bf|=o,Ko===it&&(Ko=0)),gr(n)}function y2(n,a){a===0&&(a=n1()),n=ki(n,a),n!==null&&(vl(n,a),gr(n))}function zx(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),y2(n,o)}function $x(n,a){var o=0;switch(n.tag){case 31:case 13:var l=n.stateNode,d=n.memoizedState;d!==null&&(o=d.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(a),y2(n,o)}function Vx(n,a){return ml(n,a)}var ac=null,ic=null,Qg=!1,Nf=!1,e0=!1,$a=0;function gr(n){n!==ic&&n.next===null&&(ic===null?ac=ic=n:ic=ic.next=n),Nf=!0,Qg||(Qg=!0,Gx())}function Kl(n,a){if(!e0&&Nf){e0=!0;do for(var o=!1,l=ac;l!==null;){if(n!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var v=l.suspendedLanes,_=l.pingedLanes;h=(1<<31-os(42|n)+1)-1,h&=d&~(v&~_),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(o=!0,T2(l,h))}else h=it,h=vd(l,l===xt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||yl(l,h)||(o=!0,T2(l,h));l=l.next}while(o);e0=!1}}function Px(){v2()}function v2(){Nf=Qg=!1;var n=0;$a!==0&&eC()&&(n=$a);for(var a=Ln(),o=null,l=ac;l!==null;){var d=l.next,h=b2(l,a);h===0?(l.next=null,o===null?ac=d:o.next=d,d===null&&(ic=o)):(o=l,(n!==0||(h&3)!==0)&&(Nf=!0)),l=d}zt!==0&&zt!==5||Kl(n),$a!==0&&($a=0)}function b2(n,a){for(var o=n.suspendedLanes,l=n.pingedLanes,d=n.expirationTimes,h=n.pendingLanes&-62914561;0<h;){var v=31-os(h),_=1<<v,B=d[v];B===-1?((_&o)===0||(_&l)!==0)&&(d[v]=iN(_,a)):B<=a&&(n.expiredLanes|=_),h&=~_}if(a=xt,o=it,o=vd(n,n===a?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,o===0||n===a&&(wt===2||wt===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&ba(l),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||yl(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(l!==null&&ba(l),am(o)){case 2:case 8:o=Ce;break;case 32:o=Ye;break;case 268435456:o=Ss;break;default:o=Ye}return l=w2.bind(null,n),o=ml(o,l),n.callbackPriority=a,n.callbackNode=o,a}return l!==null&&l!==null&&ba(l),n.callbackPriority=2,n.callbackNode=null,2}function w2(n,a){if(zt!==0&&zt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Of()&&n.callbackNode!==o)return null;var l=it;return l=vd(n,n===xt?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(a2(n,l,a),b2(n,Ln()),n.callbackNode!=null&&n.callbackNode===o?w2.bind(null,n):null)}function T2(n,a){if(Of())return null;a2(n,a,!0)}function Gx(){nC(function(){(ht&6)!==0?ml(pd,Px):v2()})}function t0(){if($a===0){var n=Ii;n===0&&(n=md,md<<=1,(md&261888)===0&&(md=256)),$a=n}return $a}function E2(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Sd(n)}function Fx(n,a,o,l,d){if(a==="submit"&&o&&o.stateNode===d){var h=E2((d[Wn]||null).action),v=l.submitter;v&&(a=(a=v[Wn]||null)?E2(a.formAction):v.getAttribute("formAction"),a!==null&&(h=a,v=null));var _=new Od("action","action",null,l,d);n.push({event:_,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if($a!==0){var B=new FormData(d,v);lg(o,{pending:!0,data:B,method:d.method,action:h},null,B)}}else typeof h=="function"&&(_.preventDefault(),B=new FormData(d,v),lg(o,{pending:!0,data:B,method:d.method,action:h},h,B))},currentTarget:d}]})}}for(var n0=0;n0<Om.length;n0++){var s0=Om[n0],Hx=s0.toLowerCase(),qx=s0[0].toUpperCase()+s0.slice(1);Ps(Hx,"on"+qx)}Ps(Y1,"onAnimationEnd"),Ps(W1,"onAnimationIteration"),Ps(X1,"onAnimationStart"),Ps("dblclick","onDoubleClick"),Ps("focusin","onFocus"),Ps("focusout","onBlur"),Ps(tx,"onTransitionRun"),Ps(nx,"onTransitionStart"),Ps(sx,"onTransitionCancel"),Ps(J1,"onTransitionEnd"),No("onMouseEnter",["mouseout","mouseover"]),No("onMouseLeave",["mouseout","mouseover"]),No("onPointerEnter",["pointerout","pointerover"]),No("onPointerLeave",["pointerout","pointerover"]),Ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="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(" "),Zx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ql));function S2(n,a){a=(a&4)!==0;for(var o=0;o<n.length;o++){var l=n[o],d=l.event;l=l.listeners;e:{var h=void 0;if(a)for(var v=l.length-1;0<=v;v--){var _=l[v],B=_.instance,ne=_.currentTarget;if(_=_.listener,B!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=ne;try{h(d)}catch(ie){Cd(ie)}d.currentTarget=null,h=B}else for(v=0;v<l.length;v++){if(_=l[v],B=_.instance,ne=_.currentTarget,_=_.listener,B!==h&&d.isPropagationStopped())break e;h=_,d.currentTarget=ne;try{h(d)}catch(ie){Cd(ie)}d.currentTarget=null,h=B}}}}function tt(n,a){var o=a[c1];o===void 0&&(o=a[c1]=new Set);var l=n+"__bubble";o.has(l)||(_2(a,n,2,!1),o.add(l))}function r0(n,a,o){var l=0;a&&(l|=4),_2(o,n,l,a)}var xf="_reactListening"+Math.random().toString(36).slice(2);function a0(n){if(!n[xf]){n[xf]=!0,d1.forEach(function(o){o!=="selectionchange"&&(Zx.has(o)||r0(o,!1,n),r0(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[xf]||(a[xf]=!0,r0("selectionchange",!1,a))}}function _2(n,a,o,l){switch(hE(a)){case 2:var d=zC;break;case 8:d=$C;break;default:d=k0}o=d.bind(null,a,o,n),d=void 0,!hm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(d=!0),l?d!==void 0?n.addEventListener(a,o,{capture:!0,passive:d}):n.addEventListener(a,o,!0):d!==void 0?n.addEventListener(a,o,{passive:d}):n.addEventListener(a,o,!1)}function i0(n,a,o,l,d){var h=l;if((a&1)===0&&(a&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var _=l.stateNode.containerInfo;if(_===d)break;if(v===4)for(v=l.return;v!==null;){var B=v.tag;if((B===3||B===4)&&v.stateNode.containerInfo===d)return;v=v.return}for(;_!==null;){if(v=Ti(_),v===null)return;if(B=v.tag,B===5||B===6||B===26||B===27){l=h=v;continue e}_=_.parentNode}}l=l.return}_1(function(){var ne=h,ie=dm(o),me=[];e:{var Q=K1.get(n);if(Q!==void 0){var ae=Od,ke=n;switch(n){case"keypress":if(kd(o)===0)break e;case"keydown":case"keyup":ae=IN;break;case"focusin":ke="focus",ae=ym;break;case"focusout":ke="blur",ae=ym;break;case"beforeblur":case"afterblur":ae=ym;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=O1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=bN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=UN;break;case Y1:case W1:case X1:ae=EN;break;case J1:ae=LN;break;case"scroll":case"scrollend":ae=yN;break;case"wheel":ae=$N;break;case"copy":case"cut":case"paste":ae=_N;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=x1;break;case"submit":ae=MN;break;case"toggle":case"beforetoggle":ae=PN}var Re=(a&4)!==0,Xe=!Re&&(n==="scroll"||n==="scrollend"),ee=Re?Q!==null?Q+"Capture":null:Q;Re=[];for(var Z=ne,se;Z!==null;){var pe=Z;if(se=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||se===null||ee===null||(pe=Tl(Z,ee),pe!=null&&Re.push(eu(Z,pe,se))),Xe)break;Z=Z.return}0<Re.length&&(Q=new ae(Q,ke,null,o,ie),me.push({event:Q,listeners:Re}))}}if((a&7)===0){e:{if(ae=n==="mouseover"||n==="pointerover",Q=n==="mouseout"||n==="pointerout",ae&&o!==um&&(ke=o.relatedTarget||o.fromElement)&&(Ti(ke)||ke[ko]))break e;(Q||ae)&&(ke=ie.window===ie?ie:(ae=ie.ownerDocument)?ae.defaultView||ae.parentWindow:window,Q?(ae=o.relatedTarget||o.toElement,Q=ne,ae=ae?Ti(ae):null,ae!==null&&(Xe=c(ae),Re=ae.tag,ae!==Xe||Re!==5&&Re!==27&&Re!==6)&&(ae=null)):(Q=null,ae=ne),Q!==ae&&(Re=O1,pe="onMouseLeave",ee="onMouseEnter",Z="mouse",(n==="pointerout"||n==="pointerover")&&(Re=x1,pe="onPointerLeave",ee="onPointerEnter",Z="pointer"),Xe=Q==null?ke:wl(Q),se=ae==null?ke:wl(ae),ke=new Re(pe,Z+"leave",Q,o,ie),ke.target=Xe,ke.relatedTarget=se,pe=null,Ti(ie)===ne&&(Re=new Re(ee,Z+"enter",ae,o,ie),Re.target=se,Re.relatedTarget=Xe,pe=Re),Xe=pe,Re=Q&&ae?F(Q,ae,Yx):null,Q!==null&&k2(me,ke,Q,Re,!1),ae!==null&&Xe!==null&&k2(me,Xe,ae,Re,!0)))}e:{if(Q=ne?wl(ne):window,ae=Q.nodeName&&Q.nodeName.toLowerCase(),ae==="select"||ae==="input"&&Q.type==="file")var Ie=B1;else if(D1(Q))if(L1)Ie=KN;else{Ie=XN;var ot=WN}else ae=Q.nodeName,!ae||ae.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?ne&&lm(ne.elementType)&&(Ie=B1):Ie=JN;if(Ie&&(Ie=Ie(n,ne))){U1(me,Ie,o,ie);break e}ot&&ot(n,Q,ne)}switch(ot=ne?wl(ne):window,n){case"focusin":(D1(ot)||ot.contentEditable==="true")&&(Mo=ot,_m=ne,xl=null);break;case"focusout":xl=_m=Mo=null;break;case"mousedown":km=!0;break;case"contextmenu":case"mouseup":case"dragend":km=!1,q1(me,o,ie);break;case"selectionchange":if(ex)break;case"keydown":case"keyup":q1(me,o,ie)}var Ue;if(bm)e:{switch(n){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else jo?j1(n,o)&&($e="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&($e="onCompositionStart");$e&&(C1&&o.locale!=="ko"&&(jo||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&jo&&(Ue=k1()):(Ta=ie,pm="value"in Ta?Ta.value:Ta.textContent,jo=!0)),ot=Cf(ne,$e),0<ot.length&&($e=new N1($e,n,null,o,ie),me.push({event:$e,listeners:ot}),Ue?$e.data=Ue:(Ue=M1(o),Ue!==null&&($e.data=Ue)))),(Ue=FN?HN(n,o):qN(n,o))&&($e=Cf(ne,"onBeforeInput"),0<$e.length&&(ot=new N1("onBeforeInput","beforeinput",null,o,ie),me.push({event:ot,listeners:$e}),ot.data=Ue)),Fx(me,n,ne,o,ie)}S2(me,a)})}function eu(n,a,o){return{instance:n,listener:a,currentTarget:o}}function Cf(n,a){for(var o=a+"Capture",l=[];n!==null;){var d=n,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Tl(n,o),d!=null&&l.unshift(eu(n,d,h)),d=Tl(n,a),d!=null&&l.push(eu(n,d,h))),n.tag===3)return l;n=n.return}return[]}function Yx(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function k2(n,a,o,l,d){for(var h=a._reactName,v=[];o!==null&&o!==l;){var _=o,B=_.alternate,ne=_.stateNode;if(_=_.tag,B!==null&&B===l)break;_!==5&&_!==26&&_!==27||ne===null||(B=ne,d?(ne=Tl(o,h),ne!=null&&v.unshift(eu(o,ne,B))):d||(ne=Tl(o,h),ne!=null&&v.push(eu(o,ne,B)))),o=o.return}v.length!==0&&n.push({event:a,listeners:v})}var Wx=/\r\n?/g,Xx=/\u0000|\uFFFD/g;function A2(n){return(typeof n=="string"?n:""+n).replace(Wx,`
|
|
840
|
-
`).replace(Xx,"")}function O2(n,a){return a=A2(a),A2(n)===a}function Et(n,a,o,l,d,h){switch(o){case"children":if(typeof l=="string")a==="body"||a==="textarea"&&l===""||Co(n,l);else if(typeof l=="number"||typeof l=="bigint")a!=="body"&&Co(n,""+l);else return;break;case"className":Ed(n,"class",l);break;case"tabIndex":Ed(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ed(n,o,l);break;case"style":E1(n,l,h);return;case"data":if(a!=="object"){Ed(n,"data",l);break}case"src":case"href":if(l===""&&(a!=="a"||o!=="href")){n.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(o);break}l=Sd(l),n.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(o,"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 h=="function"&&(o==="formAction"?(a!=="input"&&Et(n,a,"name",d.name,d,null),Et(n,a,"formEncType",d.formEncType,d,null),Et(n,a,"formMethod",d.formMethod,d,null),Et(n,a,"formTarget",d.formTarget,d,null)):(Et(n,a,"encType",d.encType,d,null),Et(n,a,"method",d.method,d,null),Et(n,a,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(o);break}l=Sd(l),n.setAttribute(o,l);break;case"onClick":l!=null&&(n.onclick=ir);return;case"onScroll":l!=null&&tt("scroll",n);return;case"onScrollEnd":l!=null&&tt("scrollend",n);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));h?.__html!==o&&(n.innerHTML=o)}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}o=Sd(l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(o,l):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":l===!0?n.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(o,l):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(o,l):n.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(o):n.setAttribute(o,l);break;case"popover":tt("beforetoggle",n),tt("toggle",n),Td(n,"popover",l);break;case"xlinkActuate":Dr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Dr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Dr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Dr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Dr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Dr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Dr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Td(n,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")o=mN.get(o)||o,Td(n,o,l);else return}dt=!0}function o0(n,a,o,l,d,h){switch(o){case"style":E1(n,l,h);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));h?.__html!==o&&(n.innerHTML=o)}}break;case"children":if(typeof l=="string")Co(n,l);else if(typeof l=="number"||typeof l=="bigint")Co(n,""+l);else return;break;case"onScroll":l!=null&&tt("scroll",n);return;case"onScrollEnd":l!=null&&tt("scrollend",n);return;case"onClick":l!=null&&(n.onclick=ir);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!f1.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),h=o.slice(2,d?o.length-7:void 0),a=n[Wn]||null,a=a!=null?a[o]:null,typeof a=="function"&&n.removeEventListener(h,a,d),typeof l=="function")){typeof a!="function"&&a!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(h,l,d);break e}dt=!0,o in n?n[o]=l:l===!0?n.setAttribute(o,""):Td(n,o,l)}return}dt=!0}function Nn(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",n),tt("load",n);var l=!1,d=!1,h;for(h in o)if(o.hasOwnProperty(h)){var v=o[h];if(v!=null)switch(h){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Et(n,a,h,v,o,null)}}d&&Et(n,a,"srcSet",o.srcSet,o,null),l&&Et(n,a,"src",o.src,o,null);return;case"input":tt("invalid",n);var _=h=v=d=null,B=null,ne=null;for(l in o)if(o.hasOwnProperty(l)){var ie=o[l];if(ie!=null)switch(l){case"name":d=ie;break;case"type":v=ie;break;case"checked":B=ie;break;case"defaultChecked":ne=ie;break;case"value":h=ie;break;case"defaultValue":_=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:Et(n,a,l,ie,o,null)}}v1(n,h,_,B,ne,v,d,!1);return;case"select":tt("invalid",n),l=v=h=null;for(d in o)if(o.hasOwnProperty(d)&&(_=o[d],_!=null))switch(d){case"value":h=_;break;case"defaultValue":v=_;break;case"multiple":l=_;default:Et(n,a,d,_,o,null)}a=h,o=v,n.multiple=!!l,a!=null?xo(n,!!l,a,!1):o!=null&&xo(n,!!l,o,!0);return;case"textarea":tt("invalid",n),h=d=l=null;for(v in o)if(o.hasOwnProperty(v)&&(_=o[v],_!=null))switch(v){case"value":l=_;break;case"defaultValue":d=_;break;case"children":h=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:Et(n,a,v,_,o,null)}w1(n,l,d,h);return;case"option":for(B in o)o.hasOwnProperty(B)&&(l=o[B],l!=null)&&(B==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":Et(n,a,B,l,o,null));return;case"dialog":tt("beforetoggle",n),tt("toggle",n),tt("cancel",n),tt("close",n);break;case"iframe":case"object":tt("load",n);break;case"video":case"audio":for(l=0;l<Ql.length;l++)tt(Ql[l],n);break;case"image":tt("error",n),tt("load",n);break;case"details":tt("toggle",n);break;case"embed":case"source":case"link":tt("error",n),tt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in o)if(o.hasOwnProperty(ne)&&(l=o[ne],l!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Et(n,a,ne,l,o,null)}return;default:if(lm(a)){for(ie in o)o.hasOwnProperty(ie)&&(l=o[ie],l!==void 0&&o0(n,a,ie,l,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(l=o[_],l!=null&&Et(n,a,_,l,o,null))}var Jx={};function Kx(n,a,o,l){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,v=null,_=null,B=null,ne=null,ie=null;for(ae in o){var me=o[ae];if(o.hasOwnProperty(ae)&&me!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":B=me;default:l.hasOwnProperty(ae)||Et(n,a,ae,null,l,me)}}for(var Q in l){var ae=l[Q];if(me=o[Q],l.hasOwnProperty(Q)&&(ae!=null||me!=null))switch(Q){case"type":ae!==me&&(dt=!0),h=ae;break;case"name":ae!==me&&(dt=!0),d=ae;break;case"checked":ae!==me&&(dt=!0),ne=ae;break;case"defaultChecked":ae!==me&&(dt=!0),ie=ae;break;case"value":ae!==me&&(dt=!0),v=ae;break;case"defaultValue":ae!==me&&(dt=!0),_=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,a));break;default:ae!==me&&Et(n,a,Q,ae,l,me)}}om(n,v,_,B,ne,ie,h,d);return;case"select":ae=v=_=Q=null;for(h in o)if(B=o[h],o.hasOwnProperty(h)&&B!=null)switch(h){case"value":break;case"multiple":ae=B;default:l.hasOwnProperty(h)||Et(n,a,h,null,l,B)}for(d in l)if(h=l[d],B=o[d],l.hasOwnProperty(d)&&(h!=null||B!=null))switch(d){case"value":h!==B&&(dt=!0),Q=h;break;case"defaultValue":h!==B&&(dt=!0),_=h;break;case"multiple":h!==B&&(dt=!0),v=h;default:h!==B&&Et(n,a,d,h,l,B)}a=_,o=v,l=ae,Q!=null?xo(n,!!o,Q,!1):!!l!=!!o&&(a!=null?xo(n,!!o,a,!0):xo(n,!!o,o?[]:"",!1));return;case"textarea":ae=Q=null;for(_ in o)if(d=o[_],o.hasOwnProperty(_)&&d!=null&&!l.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Et(n,a,_,null,l,d)}for(v in l)if(d=l[v],h=o[v],l.hasOwnProperty(v)&&(d!=null||h!=null))switch(v){case"value":d!==h&&(dt=!0),Q=d;break;case"defaultValue":d!==h&&(dt=!0),ae=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==h&&Et(n,a,v,d,l,h)}b1(n,Q,ae);return;case"option":for(var ke in o)Q=o[ke],o.hasOwnProperty(ke)&&Q!=null&&!l.hasOwnProperty(ke)&&(ke==="selected"?n.selected=!1:Et(n,a,ke,null,l,Q));for(B in l)Q=l[B],ae=o[B],l.hasOwnProperty(B)&&Q!==ae&&(Q!=null||ae!=null)&&(B==="selected"?(Q!==ae&&(dt=!0),n.selected=Q&&typeof Q!="function"&&typeof Q!="symbol"):Et(n,a,B,Q,l,ae));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 Re in o)Q=o[Re],o.hasOwnProperty(Re)&&Q!=null&&!l.hasOwnProperty(Re)&&Et(n,a,Re,null,l,Q);for(ne in l)if(Q=l[ne],ae=o[ne],l.hasOwnProperty(ne)&&Q!==ae&&(Q!=null||ae!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,a));break;default:Et(n,a,ne,Q,l,ae)}return;default:if(lm(a)){for(var Xe in o)Q=o[Xe],o.hasOwnProperty(Xe)&&Q!==void 0&&!l.hasOwnProperty(Xe)&&o0(n,a,Xe,void 0,l,Q);for(ie in l)Q=l[ie],ae=o[ie],!l.hasOwnProperty(ie)||Q===ae||Q===void 0&&ae===void 0||o0(n,a,ie,Q,l,ae);return}}for(var ee in o)Q=o[ee],o.hasOwnProperty(ee)&&Q!=null&&!l.hasOwnProperty(ee)&&Et(n,a,ee,null,l,Q);for(me in l)Q=l[me],ae=o[me],!l.hasOwnProperty(me)||Q===ae||Q==null&&ae==null||Et(n,a,me,Q,l,ae)}function N2(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qx(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],h=d.transferSize,v=d.initiatorType,_=d.duration;if(h&&_&&N2(v)){for(v=0,_=d.responseEnd,l+=1;l<o.length;l++){var B=o[l],ne=B.startTime;if(ne>_)break;var ie=B.transferSize,me=B.initiatorType;ie&&N2(me)&&(B=B.responseEnd,v+=ie*(B<_?1:(_-ne)/(B-ne)))}if(--l,a+=8*(h+v)/(d.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var c0=null,l0=null;function tu(n){return n.nodeType===9?n:n.ownerDocument}function x2(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function C2(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function I2(n,a,o,l){return o=tu(o).createElement(n),o[Sn]=l,o[Wn]=a,Nn(o,n,a),mn(o),o}function u0(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var d0=null;function eC(){var n=window.event;return n&&n.type==="popstate"?n===d0?!1:(d0=n,!0):(d0=null,!1)}var f0=typeof setTimeout=="function"?setTimeout:void 0,tC=typeof clearTimeout=="function"?clearTimeout:void 0,R2=typeof Promise=="function"?Promise:void 0,j2=typeof requestAnimationFrame=="function"?requestAnimationFrame:f0,nC=typeof queueMicrotask=="function"?queueMicrotask:typeof R2<"u"?function(n){return R2.resolve(null).then(n).catch(sC)}:f0;function sC(n){setTimeout(function(){throw n})}function Va(n){return n==="head"}function M2(n,a){var o=a,l=0;do{var d=o.nextSibling;if(n.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){n.removeChild(d),hc(a);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")w0(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,w0(o);for(var h=o.firstChild;h;){var v=h.nextSibling,_=h.nodeName;h[bl]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&h.rel.toLowerCase()==="stylesheet"||o.removeChild(h),h=v}}else o==="body"&&w0(n.ownerDocument.body);o=d}while(o);hc(a)}function D2(n,a){var o=n;n=0;do{var l=o.nextSibling;if(o.nodeType===1?a?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(a?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=l}while(o)}function U2(n,a,o){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,n.style.viewTransitionName=a,o!=null&&(n.style.viewTransitionClass=o),o=getComputedStyle(n),o.display==="inline"){if(a=n.getClientRects(),a.length===1)var l=1;else for(var d=l=0;d<a.length;d++){var h=a[d];0<h.width&&0<h.height&&l++}l===1&&(n=n.style,n.display=a.length===1?"inline-block":"block",n.marginTop="-"+o.paddingTop,n.marginBottom="-"+o.paddingBottom)}}function B2(n,a){n=n.style,a=a.style;var o=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;n.viewTransitionName=o==null||typeof o=="boolean"?"":(""+o).trim(),o=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,n.viewTransitionClass=o==null||typeof o=="boolean"?"":(""+o).trim(),n.display==="inline-block"&&(a==null?n.display=n.margin="":(o=a.display,n.display=o==null||typeof o=="boolean"?"":o,o=a.margin,o!=null?n.margin=o:(o=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],n.marginTop=o==null||typeof o=="boolean"?"":o,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],n.marginBottom=a==null||typeof a=="boolean"?"":a)))}function rC(n,a,o){return o=o.ownerDocument.defaultView,{rect:n,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=n.bottom&&0<=n.right&&n.top<=o.innerHeight&&n.left<=o.innerWidth}}function h0(n){var a=n.getBoundingClientRect(),o=getComputedStyle(n);return rC(a,o,n)}function aC(n){return n.documentElement.clientHeight}function iC(n){this.addEventListener("load",n),this.addEventListener("error",n)}function oC(n,a,o,l,d,h,v,_,B){var ne=a.nodeType===9?a:a.ownerDocument;try{var ie=ne.startViewTransition({update:function(){var Q=ne.defaultView,ae=Q.navigation&&Q.navigation.transition,ke=ne.fonts.status;l();var Re=[];if(ke==="loaded"&&(aC(ne),ne.fonts.status==="loading"&&Re.push(ne.fonts.ready)),ke=Re.length,n!==null)for(var Xe=n.suspenseyImages,ee=0,Z=0;Z<Xe.length;Z++){var se=Xe[Z];if(!se.complete){var pe=se.getBoundingClientRect();if(0<pe.bottom&&0<pe.right&&pe.top<Q.innerHeight&&pe.left<Q.innerWidth){if(ee+=rE(se),ee>jf){Re.length=ke;break}se=new Promise(iC.bind(se)),Re.push(se)}}}if(0<Re.length)return Q=Promise.race([Promise.all(Re),new Promise(function(Ie){return setTimeout(Ie,500)})]).then(d,d),(ae?Promise.allSettled([ae.finished,Q]):Q).then(h,h);if(d(),ae)return ae.finished.then(h,h);h()},types:o});ne.__reactViewTransition=ie;var me=[];return ie.ready.then(function(){for(var Q=ne.documentElement.getAnimations({subtree:!0}),ae=0;ae<Q.length;ae++){var ke=Q[ae],Re=ke.effect,Xe=Re.pseudoElement;if(Xe!=null&&Xe.startsWith("::view-transition")){me.push(ke),ke=Re.getKeyframes();for(var ee=Xe=void 0,Z=!0,se=0;se<ke.length;se++){var pe=ke[se],Ie=pe.width;if(Xe===void 0)Xe=Ie;else if(Xe!==Ie){Z=!1;break}if(Ie=pe.height,ee===void 0)ee=Ie;else if(ee!==Ie){Z=!1;break}delete pe.width,delete pe.height,pe.transform==="none"&&delete pe.transform}Z&&Xe!==void 0&&ee!==void 0&&(Re.setKeyframes(ke),Z=getComputedStyle(Re.target,Re.pseudoElement),Z.width!==Xe||Z.height!==ee)&&(Z=ke[0],Z.width=Xe,Z.height=ee,Z=ke[ke.length-1],Z.width=Xe,Z.height=ee,Re.setKeyframes(ke))}}v()},function(Q){ne.__reactViewTransition===ie&&(ne.__reactViewTransition=null);try{typeof Q=="object"&&Q!==null&&Q.name==="InvalidStateError"&&(Q.message==="View transition was skipped because document visibility state is hidden."||Q.message==="Skipping view transition because document visibility state has become hidden."||Q.message==="Skipping view transition because viewport size changed."||Q.message==="Transition was aborted because of invalid state")&&(Q=null),Q!==null&&B(Q)}finally{l(),d(),v()}}),ie.finished.finally(function(){for(var Q=0;Q<me.length;Q++)me[Q].cancel();ne.__reactViewTransition===ie&&(ne.__reactViewTransition=null),_()}),ie}catch{return l(),d(),v(),null}}function Pi(n,a){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+a+")"}Pi.prototype.animate=function(n,a){return a=typeof a=="number"?{duration:a}:K({},a),a.pseudoElement=this._selector,this._scope.animate(n,a)},Pi.prototype.getAnimations=function(){for(var n=this._scope,a=this._selector,o=n.getAnimations({subtree:!0}),l=[],d=0;d<o.length;d++){var h=o[d].effect;h!==null&&h.target===n&&h.pseudoElement===a&&l.push(o[d])}return l},Pi.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function L2(n){return{name:n,group:new Pi("group",n),imagePair:new Pi("image-pair",n),old:new Pi("old",n),new:new Pi("new",n)}}function ms(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}ms.prototype.addEventListener=function(n,a,o){var l=null,d=null;if(!(o!=null&&typeof o!="boolean"&&(l=o.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var h=this._eventListeners;if($2(h,n,a,o)===-1){var v=this,_=a;o!=null&&typeof o!="boolean"&&o.once===!0&&(_=function(B){v.removeEventListener(n,a,o),typeof a=="function"?a.call(this,B):a.handleEvent(B)}),l!==null&&(d=v.removeEventListener.bind(v,n,a,o),l.addEventListener("abort",d,{once:!0}),d=l.removeEventListener.bind(l,"abort",d)),l=oc(o),h.push({type:n,listener:a,optionsOrUseCapture:o,attachedListener:_,cleanup:d}),y(this._fragmentFiber.child,!1,cC,n,_,l)}this._eventListeners=h}};function cC(n,a,o,l){return R(n).addEventListener(a,o,l),!1}ms.prototype.removeEventListener=function(n,a,o){var l=this._eventListeners;if(l!==null&&(a=$2(l,n,a,o),a!==-1)){var d=l[a];o=d.attachedListener;var h=d.cleanup;d=oc(d.optionsOrUseCapture),y(this._fragmentFiber.child,!1,lC,n,o,d),l.splice(a,1),h!==null&&h()}};function lC(n,a,o,l){return R(n).removeEventListener(a,o,l),!1}function oc(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function z2(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function $2(n,a,o,l){if(n.length===0)return-1;l=z2(l);for(var d=0;d<n.length;d++){var h=n[d];if(h.type===a&&h.listener===o&&z2(h.optionsOrUseCapture)===l)return d}return-1}ms.prototype.dispatchEvent=function(n){var a=b(this._fragmentFiber);if(a===null)return!0;a=R(a);var o=this._eventListeners;if(o!==null&&0<o.length||!n.bubbles){var l=a.nodeType===9?a.createComment(""):document.createTextNode("");if(o)for(var d=0;d<o.length;d++){var h=o[d];l.addEventListener(h.type,h.attachedListener,oc(h.optionsOrUseCapture))}if(a.appendChild(l),n=l.dispatchEvent(n),o)for(d=0;d<o.length;d++)h=o[d],l.removeEventListener(h.type,h.attachedListener,oc(h.optionsOrUseCapture));return a.removeChild(l),n}return a.dispatchEvent(n)},ms.prototype.focus=function(n){y(this._fragmentFiber.child,!0,V2,n,void 0,void 0)};function V2(n,a){return n.tag===6?!1:(n=R(n),TC(n,a))}ms.prototype.focusLast=function(n){var a=[];y(this._fragmentFiber.child,!0,p0,a,void 0,void 0);for(var o=a.length-1;0<=o&&!V2(a[o],n);o--);};function p0(n,a){return a.push(n),!1}ms.prototype.blur=function(){var n=b(this._fragmentFiber);n!==null&&(n=R(n),n=tu(n).activeElement,n!==null&&y(this._fragmentFiber.child,!1,uC,n,void 0,void 0))};function uC(n,a){return n.tag===6?!1:(n=R(n),n===a||n.contains(a)?(a.blur(),!0):!1)}ms.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),y(this._fragmentFiber.child,!1,dC,n,void 0,void 0)};function dC(n,a){return n.tag===6||(n=R(n),a.observe(n)),!1}ms.prototype.unobserveUsing=function(n){var a=this._observers;if(a!==null&&a.has(n)){a.delete(n),y(this._fragmentFiber.child,!1,fC,n,void 0,void 0);for(var o=a=0;o<Zs.length;o++){var l=Zs[o];l.fragmentInstance===this&&l.observer===n?n.unobserve(l.instance):Zs[a++]=l}Zs.length=a}};function fC(n,a){return n.tag===6||(n=R(n),a.unobserve(n)),!1}var Zs=[],m0=!1;function hC(n,a,o){Zs.push({fragmentInstance:n,observer:a,instance:o}),m0||(m0=!0,EC(function(){m0=!1;var l=Zs;Zs=[];for(var d=0;d<l.length;d++){var h=l[d];h.observer.unobserve(h.instance)}}))}ms.prototype.getClientRects=function(){var n=[];return y(this._fragmentFiber.child,!1,pC,n,void 0,void 0),n};function pC(n,a){if(n.tag===6){n=n.stateNode;var o=n.ownerDocument.createRange();o.selectNodeContents(n),a.push.apply(a,o.getClientRects())}else n=R(n),a.push.apply(a,n.getClientRects());return!1}ms.prototype.getRootNode=function(n){var a=b(this._fragmentFiber);return a===null?this:R(a).getRootNode(n)},ms.prototype.compareDocumentPosition=function(n){var a=b(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var o=[];y(this._fragmentFiber.child,!1,p0,o,void 0,void 0);var l=R(a);if(o.length===0){if(o=l,S(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(o=a)}a=this._fragmentFiber;var d=l=o.compareDocumentPosition(n);return o===n?d=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(o=O(a)[1],o===null?d=Node.DOCUMENT_POSITION_PRECEDING:(n=R(o).compareDocumentPosition(n),d=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),d|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=R(o[0]),d=R(o[o.length-1]);var h=S(this._fragmentFiber)?a.parentElement:l;if(h==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=h.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,h=h.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_CONTAINED_BY;var v=a.compareDocumentPosition(n),_=d.compareDocumentPosition(n),B=v&Node.DOCUMENT_POSITION_CONTAINED_BY||_&Node.DOCUMENT_POSITION_CONTAINED_BY;return _=l&&h&&v&Node.DOCUMENT_POSITION_FOLLOWING&&_&Node.DOCUMENT_POSITION_PRECEDING,a=l&&a===n||h&&d===n||B||_?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&a===n||!h&&d===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:v,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||mC(a,this._fragmentFiber,o[0],o[o.length-1],n)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function mC(n,a,o,l,d){var h=Ti(d);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(o=!!h)e:{for(;h!==null;){if(h.tag===7&&(h===a||h.alternate===a)){o=!0;break e}h=h.return}o=!1}return o}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(h===null)return h=d.ownerDocument,d===h||d===h.documentElement||d===h.body;e:{for(h=a,a=b(a);h!==null;){if(!(h.tag!==5&&h.tag!==3&&h.tag!==27||h!==a&&h.alternate!==a)){h=!0;break e}h=h.return}h=!1}return h}return n&Node.DOCUMENT_POSITION_PRECEDING?((a=!!h)&&!(a=h===o)&&(a=F(o,h,ge),a===null?a=!1:(y(a,!0,W,h,o),h=$,$=null,a=h!==null)),a):n&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!h)&&!(a=h===l)&&(a=F(l,h,ge),a===null?a=!1:(y(a,!0,ce,h,l),h=$,x=$=null,a=h!==null)),a):!1}function P2(n,a){var o=n.ownerDocument.createRange();o.selectNodeContents(n),n=o.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,a?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}ms.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(r(566));var a=[];y(this._fragmentFiber.child,!1,p0,a,void 0,void 0);var o=n!==!1;if(a.length===0){var l=O(this._fragmentFiber);if(l=o?l[1]||l[0]||b(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){n=R(l),P2(n,o);return}if(l=R(l),l.nodeType!==9){if(l.nodeType===11){o="host"in l?l.host:null,o!==null&&o.scrollIntoView(n);return}l.scrollIntoView(n)}}for(l=o?a.length-1:0;l!==(o?-1:a.length);){var d=a[l];d.tag===6?(d=R(d),P2(d,o)):R(d).scrollIntoView(n),l+=o?-1:1}};function gC(n,a){return n=R(n),G2(n,a),!1}function G2(n,a){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(a)}function F2(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l];n.addEventListener(d.type,d.attachedListener,oc(d.optionsOrUseCapture))}n.nodeType!==3&&(o=a._observers,o!==null&&o.forEach(function(h){for(var v=0,_=0;_<Zs.length;_++){var B=Zs[_];(B.fragmentInstance!==a||B.observer!==h||B.instance!==n)&&(Zs[v++]=B)}Zs.length=v,h.observe(n)}),G2(n,a))}function yC(n,a){var o=a._eventListeners;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l];n.removeEventListener(d.type,d.attachedListener,oc(d.optionsOrUseCapture))}n.nodeType!==3&&(o=a._observers,o!==null&&o.forEach(function(h){typeof h.rootMargin=="string"?hC(a,h,n):h.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(a))}function g0(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var o=a;switch(a=a.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":g0(o),wd(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function vC(n,a,o,l){for(;n.nodeType===1;){var d=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[bl])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(h=n.getAttribute("rel"),h==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(h!==d.rel||n.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||n.getAttribute("title")!==(d.title==null?null:d.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(h=n.getAttribute("src"),(h!==(d.src==null?null:d.src)||n.getAttribute("type")!==(d.type==null?null:d.type)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&n.getAttribute("name")===h)return n}else return n;if(n=Is(n.nextSibling),n===null)break}return null}function bC(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Is(n.nextSibling),n===null))return null;return n}function H2(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Is(n.nextSibling),n===null))return null;return n}function y0(n){return n.data==="$?"||n.data==="$~"}function v0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function wC(n,a){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||o.readyState!=="loading")a();else{var l=function(){a(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function Is(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var b0=null;function q2(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return Is(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function Z2(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(a===0)return n;a--}else o!=="/$"&&o!=="/&"||a++}n=n.previousSibling}return null}function TC(n,a){function o(){l=!0}if(n.ownerDocument.activeElement===n)return!0;var l=!1;try{n.ownerDocument.addEventListener("focus",o,!0),(n.focus||HTMLElement.prototype.focus).call(n,a)}finally{n.ownerDocument.removeEventListener("focus",o,!0)}return l}function EC(n){j2(function(){j2(function(a){return n(a)})})}function Y2(n,a,o){switch(a=tu(o),n){case"html":if(n=a.documentElement,!n)throw Error(r(452));return n;case"head":if(n=a.head,!n)throw Error(r(453));return n;case"body":if(n=a.body,!n)throw Error(r(454));return n;default:throw Error(r(451))}}function W2(n,a,o){for(var l in o){var d=o[l];o.hasOwnProperty(l)&&d!=null&&Et(n,a,l,null,Jx,d)}o.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===ir&&(n.onclick=null),wd(n)}function w0(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);wd(n)}var Rs=new Map,X2=new Set;function nu(n){if(typeof n.getRootNode=="function"){var a=n.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return n.nodeType===9?n:n.ownerDocument}var Yr=_e.d;_e.d={f:SC,r:_C,D:kC,C:AC,L:OC,m:NC,X:CC,S:xC,M:IC};function SC(){var n=Yr.f(),a=_f();return n||a}function _C(n){var a=Ao(n);a!==null&&a.tag===5&&a.type==="form"?Kw(a):Yr.r(n)}var cc=typeof document>"u"?null:document;function J2(n,a,o){var l=cc;if(l&&typeof a=="string"&&a){var d=_s(a);d='link[rel="'+n+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),X2.has(d)||(X2.add(d),n={rel:n,crossOrigin:o,href:a},l.querySelector(d)===null&&(a=l.createElement("link"),Nn(a,"link",n),mn(a),l.head.appendChild(a)))}}function kC(n){Yr.D(n),J2("dns-prefetch",n,null)}function AC(n,a){Yr.C(n,a),J2("preconnect",n,a)}function OC(n,a,o){Yr.L(n,a,o);var l=cc;if(l&&n&&a){var d='link[rel="preload"][as="'+_s(a)+'"]';a==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+_s(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+_s(o.imageSizes)+'"]')):d+='[href="'+_s(n)+'"]';var h=d;switch(a){case"style":h=lc(n);break;case"script":h=uc(n)}if(!(Rs.has(h)||(n=K({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),Rs.set(h,n),l.querySelector(d)!==null||a==="style"&&l.querySelector(su(h))||a==="script"&&l.querySelector(ru(h))))){var v=l.createElement("link");Nn(v,"link",n),a==="style"&&(v[bd]=!0,v.onload=v.onerror=function(){u1(v)}),mn(v),l.head.appendChild(v)}}}function NC(n,a){Yr.m(n,a);var o=cc;if(o&&n){var l=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+_s(l)+'"][href="'+_s(n)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=uc(n)}if(!Rs.has(h)&&(n=K({rel:"modulepreload",href:n},a),Rs.set(h,n),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ru(h)))return}l=o.createElement("link"),Nn(l,"link",n),mn(l),o.head.appendChild(l)}}}function xC(n,a,o){Yr.S(n,a,o);var l=cc;if(l&&n){var d=Oo(l).hoistableStyles,h=lc(n);a=a||"default";var v=d.get(h);if(!v){var _={loading:0,preload:null};if(v=l.querySelector(su(h)))_.loading=5;else{n=K({rel:"stylesheet",href:n,"data-precedence":a},o),(o=Rs.get(h))&&T0(n,o);var B=v=l.createElement("link");mn(B),Nn(B,"link",n),B._p=new Promise(function(ne,ie){B.onload=ne,B.onerror=ie}),B.addEventListener("load",function(){_.loading|=1}),B.addEventListener("error",function(){_.loading|=2}),_.loading|=4,If(v,a,l)}v={type:"stylesheet",instance:v,count:1,state:_},d.set(h,v)}}}function CC(n,a){Yr.X(n,a);var o=cc;if(o&&n){var l=Oo(o).hoistableScripts,d=uc(n),h=l.get(d);h||(h=o.querySelector(ru(d)),h||(n=K({src:n,async:!0},a),(a=Rs.get(d))&&E0(n,a),h=o.createElement("script"),mn(h),Nn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function IC(n,a){Yr.M(n,a);var o=cc;if(o&&n){var l=Oo(o).hoistableScripts,d=uc(n),h=l.get(d);h||(h=o.querySelector(ru(d)),h||(n=K({src:n,async:!0,type:"module"},a),(a=Rs.get(d))&&E0(n,a),h=o.createElement("script"),mn(h),Nn(h,"link",n),o.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function K2(n,a,o,l){var d=(d=Le.current)?nu(d):null;if(!d)throw Error(r(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(o=lc(o.href),a=Oo(d).hoistableStyles,l=a.get(o),l||(l={type:"style",instance:null,count:0,state:null},a.set(o,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=lc(o.href);var h=Oo(d).hoistableStyles,v=h.get(n);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(n,v),(h=d.querySelector(su(n)))?h._p||(v.instance=h,v.state.loading=5):(h=Rs.get(n),h||(h={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Rs.set(n,h)),RC(d,n,h,v.state))),a&&l===null)throw Error(r(528,""));return v}if(a&&l!==null)throw Error(r(529,""));return null;case"script":return a=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(o=uc(o),a=Oo(d).hoistableScripts,l=a.get(o),l||(l={type:"script",instance:null,count:0,state:null},a.set(o,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,n))}}function lc(n){return'href="'+_s(n)+'"'}function su(n){return'link[rel="stylesheet"]['+n+"]"}function Q2(n){return K({},n,{"data-precedence":n.precedence,precedence:null})}function RC(n,a,o,l){if(a=n.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[bd]!==!0){l.loading=1;return}}else a=n.createElement("link"),a[bd]=!0,a.onload=a.onerror=u1.bind(null,a),Nn(a,"link",o),mn(a),n.head.appendChild(a);l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2})}function uc(n){return'[src="'+_s(n)+'"]'}function ru(n){return"script[async]"+n}function eE(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var l=n.querySelector('style[data-href~="'+_s(o.href)+'"]');if(l)return a.instance=l,mn(l),l;var d=K({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),mn(l),Nn(l,"style",d),If(l,o.precedence,n),a.instance=l;case"stylesheet":d=lc(o.href);var h=n.querySelector(su(d));if(h)return a.state.loading|=4,a.instance=h,mn(h),h;l=Q2(o),(d=Rs.get(d))&&T0(l,d),h=(n.ownerDocument||n).createElement("link"),mn(h);var v=h;return v._p=new Promise(function(_,B){v.onload=_,v.onerror=B}),Nn(h,"link",l),a.state.loading|=4,If(h,o.precedence,n),a.instance=h;case"script":return h=uc(o.src),(d=n.querySelector(ru(h)))?(a.instance=d,mn(d),d):(l=o,(d=Rs.get(h))&&(l=K({},o),E0(l,d)),n=n.ownerDocument||n,d=n.createElement("script"),mn(d),Nn(d,"link",l),n.head.appendChild(d),a.instance=d);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(l=a.instance,a.state.loading|=4,If(l,o.precedence,n));return a.instance}function If(n,a,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,v=0;v<l.length;v++){var _=l[v];if(_.dataset.precedence===a)h=_;else if(h!==d)break}h?h.parentNode.insertBefore(n,h.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function T0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function E0(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var Rf=null;function tE(n,a,o){if(Rf===null){var l=new Map,d=Rf=new Map;d.set(o,l)}else d=Rf,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(n))return l;for(l.set(n,null),o=o.getElementsByTagName(n),d=0;d<o.length;d++){var h=o[d];if(!(h[bl]||h[Sn]||n==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(a)||"";v=n+v;var _=l.get(v);_?_.push(h):l.set(v,[h])}}return l}function S0(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function jC(n,a,o){if(o===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(n=a.disabled,typeof a.precedence=="string"&&n==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function nE(n,a){return n==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function sE(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function rE(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function aE(n,a){typeof a.decode=="function"&&(n.imgCount++,a.complete||(n.imgBytes+=rE(a),n.suspenseyImages.push(a)),n=UC.bind(n),a.decode().then(n,n))}function MC(n,a,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var d=lc(l.href),h=a.querySelector(su(d));if(h){a=h._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=au.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=h,mn(h);return}h=a.ownerDocument||a,l=Q2(l),(d=Rs.get(d))&&T0(l,d),h=h.createElement("link"),mn(h);var v=h;v._p=new Promise(function(_,B){v.onload=_,v.onerror=B}),Nn(h,"link",l),o.instance=h}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,a),(a=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=au.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var jf=0;function DC(n,a){return n.stylesheets&&n.count===0&&Df(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var l=setTimeout(function(){if(n.stylesheets&&Df(n,n.stylesheets),n.unsuspend){var h=n.unsuspend;n.unsuspend=null,h()}},6e4+a);0<n.imgBytes&&jf===0&&(jf=62500*Qx());var d=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Df(n,n.stylesheets),n.unsuspend)){var h=n.unsuspend;n.unsuspend=null,h()}},(n.imgBytes>jf?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function iE(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Df(n,n.stylesheets);else if(n.unsuspend){var a=n.unsuspend;n.unsuspend=null,a()}}}function au(){this.count--,iE(this)}function UC(){this.imgCount--,iE(this)}var Mf=null;function Df(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Mf=new Map,a.forEach(BC,n),Mf=null,au.call(n))}function BC(n,a){if(!(a.state.loading&4)){var o=Mf.get(n);if(o)var l=o.get(null);else{o=new Map,Mf.set(n,o);for(var d=n.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var v=d[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(o.set(v.dataset.precedence,v),l=v)}l&&o.set(null,l)}d=a.instance,v=d.getAttribute("data-precedence"),h=o.get(v)||l,h===l&&o.set(null,d),o.set(v,d),this.count++,l=au.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(d,n.firstChild)),a.state.loading|=4}}var dc={$$typeof:M,Provider:null,Consumer:null,_currentValue:Ve,_currentValue2:Ve,_threadCount:0};function LC(n,a,o,l,d,h,v,_,B){this.tag=1,this.containerInfo=n,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=sm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sm(0),this.hiddenUpdates=sm(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.transitionTypes=null,this.incompleteTransitions=new Map}function oE(n,a,o,l,d,h,v,_,B,ne,ie,me){return n=new LC(n,a,o,v,B,ne,ie,me,_),a=1,h===!0&&(a|=24),h=Xn(3,null,null,a),n.current=h,h.stateNode=n,a=Lm(),a.refCount++,n.pooledCache=a,a.refCount++,h.memoizedState={element:l,isDehydrated:o,cache:a},Pm(h),n}function cE(n){return n?(n=Bo,n):Bo}function lE(n,a,o,l,d,h){d=cE(d),l.context===null?l.context=d:l.pendingContext=d,l=xa(a),l.payload={element:o},h=h===void 0?null:h,h!==null&&(l.callback=h),o=Ca(n,l,a),o!==null&&(es(o,n,a),Ul(o,n,a))}function uE(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function _0(n,a){uE(n,a),(n=n.alternate)&&uE(n,a)}function dE(n){if(n.tag===13||n.tag===31){var a=ki(n,67108864);a!==null&&es(a,n,67108864),_0(n,67108864)}}function fE(n){if(n.tag===13||n.tag===31){var a=ps();a=rm(a);var o=ki(n,a);o!==null&&es(o,n,a),_0(n,a)}}var fc=!0;function zC(n,a,o,l){var d=be.T;be.T=null;var h=_e.p;try{_e.p=2,k0(n,a,o,l)}finally{_e.p=h,be.T=d}}function $C(n,a,o,l){var d=be.T;be.T=null;var h=_e.p;try{_e.p=8,k0(n,a,o,l)}finally{_e.p=h,be.T=d}}function k0(n,a,o,l){if(fc){var d=A0(l);if(d===null)i0(n,a,l,Uf,o),pE(n,l);else if(PC(d,n,a,o,l))l.stopPropagation();else if(pE(n,l),a&4&&-1<VC.indexOf(n)){for(;d!==null;){var h=Ao(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=wi(h.pendingLanes);if(v!==0){var _=h;for(_.pendingLanes|=2,_.entangledLanes|=2;v;){var B=1<<31-os(v);_.entanglements[1]|=B,v&=~B}gr(h),(ht&6)===0&&(Tf=Ln()+500,Kl(0))}}break;case 31:case 13:_=ki(h,2),_!==null&&es(_,h,2),_f(),_0(h,2)}if(h=A0(l),h===null&&i0(n,a,l,Uf,o),h===d)break;d=h}d!==null&&l.stopPropagation()}else i0(n,a,l,null,o)}}function A0(n){return n=dm(n),O0(n)}var Uf=null;function O0(n){if(Uf=null,n=Ti(n),n!==null){var a=c(n);if(a===null)n=null;else{var o=a.tag;if(o===13){if(n=u(a),n!==null)return n;n=null}else if(o===31){if(n=f(a),n!==null)return n;n=null}else if(o===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return Uf=n,null}function hE(n){switch(n){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nm()){case pd:return 2;case Ce:return 8;case Ye:case Nt:return 32;case Ss:return 268435456;default:return 32}default:return 32}}var N0=!1,Pa=null,Ga=null,Fa=null,iu=new Map,ou=new Map,Ha=[],VC="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 pE(n,a){switch(n){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":iu.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ou.delete(a.pointerId)}}function cu(n,a,o,l,d,h){return n===null||n.nativeEvent!==h?(n={blockedOn:a,domEventName:o,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},a!==null&&(a=Ao(a),a!==null&&dE(a)),n):(n.eventSystemFlags|=l,a=n.targetContainers,d!==null&&a.indexOf(d)===-1&&a.push(d),n)}function PC(n,a,o,l,d){switch(a){case"focusin":return Pa=cu(Pa,n,a,o,l,d),!0;case"dragenter":return Ga=cu(Ga,n,a,o,l,d),!0;case"mouseover":return Fa=cu(Fa,n,a,o,l,d),!0;case"pointerover":var h=d.pointerId;return iu.set(h,cu(iu.get(h)||null,n,a,o,l,d)),!0;case"gotpointercapture":return h=d.pointerId,ou.set(h,cu(ou.get(h)||null,n,a,o,l,d)),!0}return!1}function mE(n){var a=Ti(n.target);if(a!==null){var o=c(a);if(o!==null){if(a=o.tag,a===13){if(a=u(o),a!==null){n.blockedOn=a,o1(n.priority,function(){fE(o)});return}}else if(a===31){if(a=f(o),a!==null){n.blockedOn=a,o1(n.priority,function(){fE(o)});return}}else if(a===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Bf(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=A0(n.nativeEvent);if(o===null){o=n.nativeEvent;var l=new o.constructor(o.type,o);um=l,o.target.dispatchEvent(l),um=null}else return a=Ao(o),a!==null&&dE(a),n.blockedOn=o,!1;a.shift()}return!0}function gE(n,a,o){Bf(n)&&o.delete(a)}function GC(){N0=!1,Pa!==null&&Bf(Pa)&&(Pa=null),Ga!==null&&Bf(Ga)&&(Ga=null),Fa!==null&&Bf(Fa)&&(Fa=null),iu.forEach(gE),ou.forEach(gE)}function Lf(n,a){n.blockedOn===a&&(n.blockedOn=null,N0||(N0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,GC)))}var zf=null;function yE(n){zf!==n&&(zf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){zf===n&&(zf=null);for(var a=0;a<n.length;a+=3){var o=n[a],l=n[a+1],d=n[a+2];if(typeof l!="function"){if(O0(l||o)===null)continue;break}var h=Ao(o);h!==null&&(n.splice(a,3),a-=3,lg(h,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function hc(n){function a(B){return Lf(B,n)}Pa!==null&&Lf(Pa,n),Ga!==null&&Lf(Ga,n),Fa!==null&&Lf(Fa,n),iu.forEach(a),ou.forEach(a);for(var o=0;o<Ha.length;o++){var l=Ha[o];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Ha.length&&(o=Ha[0],o.blockedOn===null);)mE(o),o.blockedOn===null&&Ha.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],h=o[l+1],v=d[Wn]||null;if(typeof h=="function")v||yE(o);else if(v){var _=null;if(h&&h.hasAttribute("formAction")){if(d=h,v=h[Wn]||null)_=v.formAction;else if(O0(d)!==null)continue}else _=v.action;typeof _=="function"?o[l+1]=_:(o.splice(l,3),l-=3),yE(o)}}}function vE(){function n(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return d=v})},focusReset:"manual",scroll:"manual"})}function a(){d!==null&&(d(),d=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),d!==null&&(d(),d=null)}}}function x0(n){this._internalRoot=n}$f.prototype.render=x0.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(r(409));var o=a.current,l=ps();lE(o,l,n,a,null,null)},$f.prototype.unmount=x0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;lE(n.current,2,null,n,null,null),_f(),a[ko]=null}};function $f(n){this._internalRoot=n}$f.prototype.unstable_scheduleHydration=function(n){if(n){var a=i1();n={blockedOn:null,target:n,priority:a};for(var o=0;o<Ha.length&&a!==0&&a<Ha[o].priority;o++);Ha.splice(o,0,n),o===0&&mE(n)}};var bE=t.version;if(bE!=="19.3.0")throw Error(r(527,bE,"19.3.0"));_e.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=m(a),n=n!==null?g(n):null,n=n===null?null:n.stateNode,n};var FC={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:be,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vf.isDisabled&&Vf.supportsFiber)try{gl=Vf.inject(FC),is=Vf}catch{}}return vu.createRoot=function(n,a){if(!i(n))throw Error(r(299));var o=!1,l="",d=cT,h=lT,v=uT;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(l=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=oE(n,1,!1,null,null,o,l,null,d,h,v,vE),n[ko]=a.current,a0(n),new x0(a)},vu.hydrateRoot=function(n,a,o){if(!i(n))throw Error(r(299));var l=!1,d="",h=cT,v=lT,_=uT,B=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(h=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(B=o.formState)),a=oE(n,1,!0,a,o??null,l,d,B,h,v,_,vE),a.context=cE(null),o=a.current,l=ps(),l=rm(l),d=xa(l),d.callback=null,Ca(o,d,l),o=l,a.current.lanes=o,vl(a,o),gr(a),n[ko]=a.current,a0(n),new $f(a)},vu.version="19.3.0",vu}var H_;function VG(){if(H_)return yy.exports;H_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),yy.exports=$G(),yy.exports}var q_=VG(),ft;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function s(i){throw new Error}e.assertNever=s,e.arrayToEnum=i=>{const c={};for(const u of i)c[u]=u;return c},e.getValidEnumValues=i=>{const c=e.objectKeys(i).filter(f=>typeof i[i[f]]!="number"),u={};for(const f of c)u[f]=i[f];return e.objectValues(u)},e.objectValues=i=>e.objectKeys(i).map(function(c){return i[c]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const c=[];for(const u in i)Object.prototype.hasOwnProperty.call(i,u)&&c.push(u);return c},e.find=(i,c)=>{for(const u of i)if(c(u))return u},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,c=" | "){return i.map(u=>typeof u=="string"?`'${u}'`:u).join(c)}e.joinValues=r,e.jsonStringifyReplacer=(i,c)=>typeof c=="bigint"?c.toString():c})(ft||(ft={}));var Z_;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(Z_||(Z_={}));const je=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=e=>{switch(typeof e){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(e)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(e)?je.array:e===null?je.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?je.promise:typeof Map<"u"&&e instanceof Map?je.map:typeof Set<"u"&&e instanceof Set?je.set:typeof Date<"u"&&e instanceof Date?je.date:je.object;default:return je.unknown}},Ee=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class pa extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(c){return c.message},r={_errors:[]},i=c=>{for(const u of c.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)r._errors.push(s(u));else{let f=r,p=0;for(;p<u.path.length;){const m=u.path[p];p===u.path.length-1?(f[m]=f[m]||{_errors:[]},f[m]._errors.push(s(u))):f[m]=f[m]||{_errors:[]},f=f[m],p++}}};return i(this),r}static assert(t){if(!(t instanceof pa))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s={},r=[];for(const i of this.issues)if(i.path.length>0){const c=i.path[0];s[c]=s[c]||[],s[c].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:s}}get formErrors(){return this.flatten()}}pa.create=e=>new pa(e);const gv=(e,t)=>{let s;switch(e.code){case Ee.invalid_type:e.received===je.undefined?s="Required":s=`Expected ${e.expected}, received ${e.received}`;break;case Ee.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case Ee.unrecognized_keys:s=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case Ee.invalid_union:s="Invalid input";break;case Ee.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case Ee.invalid_enum_value:s=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case Ee.invalid_arguments:s="Invalid function arguments";break;case Ee.invalid_return_type:s="Invalid function return type";break;case Ee.invalid_date:s="Invalid date";break;case Ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:ft.assertNever(e.validation):e.validation!=="regex"?s=`Invalid ${e.validation}`:s="Invalid";break;case Ee.too_small:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?s=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:s="Invalid input";break;case Ee.too_big:e.type==="array"?s=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?s=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?s=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?s=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?s=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:s="Invalid input";break;case Ee.custom:s="Invalid input";break;case Ee.invalid_intersection_types:s="Intersection results could not be merged";break;case Ee.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case Ee.not_finite:s="Number must be finite";break;default:s=t.defaultError,ft.assertNever(e)}return{message:s}};let PG=gv;function GG(){return PG}const FG=e=>{const{data:t,path:s,errorMaps:r,issueData:i}=e,c=[...s,...i.path||[]],u={...i,path:c};if(i.message!==void 0)return{...i,path:c,message:i.message};let f="";const p=r.filter(m=>!!m).slice().reverse();for(const m of p)f=m(u,{data:t,defaultError:f}).message;return{...i,path:c,message:f}};function xe(e,t){const s=GG(),r=FG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===gv?void 0:gv].filter(i=>!!i)});e.common.issues.push(r)}class Yn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){const r=[];for(const i of s){if(i.status==="aborted")return He;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,s){const r=[];for(const i of s){const c=await i.key,u=await i.value;r.push({key:c,value:u})}return Yn.mergeObjectSync(t,r)}static mergeObjectSync(t,s){const r={};for(const i of s){const{key:c,value:u}=i;if(c.status==="aborted"||u.status==="aborted")return He;c.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),c.value!=="__proto__"&&(typeof u.value<"u"||i.alwaysSet)&&(r[c.value]=u.value)}return{status:t.value,value:r}}}const He=Object.freeze({status:"aborted"}),Au=e=>({status:"dirty",value:e}),Vs=e=>({status:"valid",value:e}),Y_=e=>e.status==="aborted",W_=e=>e.status==="dirty",Yc=e=>e.status==="valid",lp=e=>typeof Promise<"u"&&e instanceof Promise;var Me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Me||(Me={}));class Rr{constructor(t,s,r,i){this._cachedPath=[],this.parent=t,this.data=s,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const X_=(e,t)=>{if(Yc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new pa(e.common.issues);return this._error=s,this._error}}};function Je(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:r,description:i}=e;if(t&&(s||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(u,f)=>{const{message:p}=e;return u.code==="invalid_enum_value"?{message:p??f.defaultError}:typeof f.data>"u"?{message:p??r??f.defaultError}:u.code!=="invalid_type"?{message:f.defaultError}:{message:p??s??f.defaultError}},description:i}}class lt{get description(){return this._def.description}_getType(t){return si(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yn,ctx:{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const s=this._parse(t);if(lp(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){const s=this._parse(t);return Promise.resolve(s)}parse(t,s){const r=this.safeParse(t,s);if(r.success)return r.data;throw r.error}safeParse(t,s){const r={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)},i=this._parseSync({data:t,path:r.path,parent:r});return X_(r,i)}"~validate"(t){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:s});return Yc(r)?{value:r.value}:{issues:s.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(r=>Yc(r)?{value:r.value}:{issues:s.common.issues})}async parseAsync(t,s){const r=await this.safeParseAsync(t,s);if(r.success)return r.data;throw r.error}async safeParseAsync(t,s){const r={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)},i=this._parse({data:t,path:r.path,parent:r}),c=await(lp(i)?i:Promise.resolve(i));return X_(r,c)}refine(t,s){const r=i=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(i):s;return this._refinement((i,c)=>{const u=t(i),f=()=>c.addIssue({code:Ee.custom,...r(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(p=>p?!0:(f(),!1)):u?!0:(f(),!1)})}refinement(t,s){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof s=="function"?s(r,i):s),!1))}_refinement(t){return new Jc({schema:this,typeName:Fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return li.create(this,this._def)}nullable(){return Kc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _r.create(this)}promise(){return pp.create(this,this._def)}or(t){return dp.create([this,t],this._def)}and(t){return fp.create(this,t,this._def)}transform(t){return new Jc({...Je(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const s=typeof t=="function"?t:()=>t;return new Tv({...Je(this._def),innerType:this,defaultValue:s,typeName:Fe.ZodDefault})}brand(){return new hF({typeName:Fe.ZodBranded,type:this,...Je(this._def)})}catch(t){const s=typeof t=="function"?t:()=>t;return new Ev({...Je(this._def),innerType:this,catchValue:s,typeName:Fe.ZodCatch})}describe(t){const s=this.constructor;return new s({...this._def,description:t})}pipe(t){return Pb.create(this,t)}readonly(){return Sv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const HG=/^c[^\s-]{8,}$/i,qG=/^[0-9a-z]+$/,ZG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,WG=/^[a-z0-9_-]{21}$/i,XG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,KG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,QG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ty;const eF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,m3="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",iF=new RegExp(`^${m3}$`);function g3(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const s=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function oF(e){return new RegExp(`^${g3(e)}$`)}function cF(e){let t=`${m3}T${g3(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function lF(e,t){return!!((t==="v4"||!t)&&eF.test(e)||(t==="v6"||!t)&&nF.test(e))}function uF(e,t){if(!XG.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const r=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function dF(e,t){return!!((t==="v4"||!t)&&tF.test(e)||(t==="v6"||!t)&&sF.test(e))}class la extends lt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==je.string){const c=this._getOrReturnCtx(t);return xe(c,{code:Ee.invalid_type,expected:je.string,received:c.parsedType}),He}const r=new Yn;let i;for(const c of this._def.checks)if(c.kind==="min")t.data.length<c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="max")t.data.length>c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),r.dirty());else if(c.kind==="length"){const u=t.data.length>c.value,f=t.data.length<c.value;(u||f)&&(i=this._getOrReturnCtx(t,i),u?xe(i,{code:Ee.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):f&&xe(i,{code:Ee.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),r.dirty())}else if(c.kind==="email")KG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"email",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="emoji")Ty||(Ty=new RegExp(QG,"u")),Ty.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"emoji",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="uuid")YG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"uuid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="nanoid")WG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"nanoid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid")HG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="cuid2")qG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cuid2",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="ulid")ZG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ulid",code:Ee.invalid_string,message:c.message}),r.dirty());else if(c.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),xe(i,{validation:"url",code:Ee.invalid_string,message:c.message}),r.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"regex",code:Ee.invalid_string,message:c.message}),r.dirty())):c.kind==="trim"?t.data=t.data.trim():c.kind==="includes"?t.data.includes(c.value,c.position)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),r.dirty()):c.kind==="toLowerCase"?t.data=t.data.toLowerCase():c.kind==="toUpperCase"?t.data=t.data.toUpperCase():c.kind==="startsWith"?t.data.startsWith(c.value)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:{startsWith:c.value},message:c.message}),r.dirty()):c.kind==="endsWith"?t.data.endsWith(c.value)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:{endsWith:c.value},message:c.message}),r.dirty()):c.kind==="datetime"?cF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"datetime",message:c.message}),r.dirty()):c.kind==="date"?iF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"date",message:c.message}),r.dirty()):c.kind==="time"?oF(c).test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.invalid_string,validation:"time",message:c.message}),r.dirty()):c.kind==="duration"?JG.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"duration",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="ip"?lF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"ip",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="jwt"?uF(t.data,c.alg)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"jwt",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="cidr"?dF(t.data,c.version)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"cidr",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="base64"?rF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64",code:Ee.invalid_string,message:c.message}),r.dirty()):c.kind==="base64url"?aF.test(t.data)||(i=this._getOrReturnCtx(t,i),xe(i,{validation:"base64url",code:Ee.invalid_string,message:c.message}),r.dirty()):ft.assertNever(c);return{status:r.value,value:t.data}}_regex(t,s,r){return this.refinement(i=>t.test(i),{validation:s,code:Ee.invalid_string,...Me.errToObj(r)})}_addCheck(t){return new la({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Me.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Me.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Me.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Me.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...Me.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...Me.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...Me.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...Me.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...Me.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...Me.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...Me.errToObj(s)})}nonempty(t){return this.min(1,Me.errToObj(t))}trim(){return new la({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new la({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new la({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}la.create=e=>new la({checks:[],typeName:Fe.ZodString,coerce:e?.coerce??!1,...Je(e)});function fF(e,t){const s=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=s>r?s:r,c=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return c%u/10**i}class Wc extends lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==je.number){const c=this._getOrReturnCtx(t);return xe(c,{code:Ee.invalid_type,expected:je.number,received:c.parsedType}),He}let r;const i=new Yn;for(const c of this._def.checks)c.kind==="int"?ft.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.invalid_type,expected:"integer",received:"float",message:c.message}),i.dirty()):c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="multipleOf"?fF(t.data,c.value)!==0&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.not_multiple_of,multipleOf:c.value,message:c.message}),i.dirty()):c.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.not_finite,message:c.message}),i.dirty()):ft.assertNever(c);return{status:i.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,Me.toString(s))}gt(t,s){return this.setLimit("min",t,!1,Me.toString(s))}lte(t,s){return this.setLimit("max",t,!0,Me.toString(s))}lt(t,s){return this.setLimit("max",t,!1,Me.toString(s))}setLimit(t,s,r,i){return new Wc({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Wc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:Me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(t)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ft.isInteger(t.value))}get isFinite(){let t=null,s=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(s===null||r.value>s)&&(s=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(s)&&Number.isFinite(t)}}Wc.create=e=>new Wc({checks:[],typeName:Fe.ZodNumber,coerce:e?.coerce||!1,...Je(e)});class Zu extends lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==je.bigint)return this._getInvalidInput(t);let r;const i=new Yn;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?t.data<c.value:t.data<=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),i.dirty()):c.kind==="max"?(c.inclusive?t.data>c.value:t.data>=c.value)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),i.dirty()):c.kind==="multipleOf"?t.data%c.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),xe(r,{code:Ee.not_multiple_of,multipleOf:c.value,message:c.message}),i.dirty()):ft.assertNever(c);return{status:i.value,value:t.data}}_getInvalidInput(t){const s=this._getOrReturnCtx(t);return xe(s,{code:Ee.invalid_type,expected:je.bigint,received:s.parsedType}),He}gte(t,s){return this.setLimit("min",t,!0,Me.toString(s))}gt(t,s){return this.setLimit("min",t,!1,Me.toString(s))}lte(t,s){return this.setLimit("max",t,!0,Me.toString(s))}lt(t,s){return this.setLimit("max",t,!1,Me.toString(s))}setLimit(t,s,r,i){return new Zu({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:r,message:Me.toString(i)}]})}_addCheck(t){return new Zu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:Me.toString(s)})}get minValue(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}}Zu.create=e=>new Zu({checks:[],typeName:Fe.ZodBigInt,coerce:e?.coerce??!1,...Je(e)});class yv extends lt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==je.boolean){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.boolean,received:r.parsedType}),He}return Vs(t.data)}}yv.create=e=>new yv({typeName:Fe.ZodBoolean,coerce:e?.coerce||!1,...Je(e)});class up extends lt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==je.date){const c=this._getOrReturnCtx(t);return xe(c,{code:Ee.invalid_type,expected:je.date,received:c.parsedType}),He}if(Number.isNaN(t.data.getTime())){const c=this._getOrReturnCtx(t);return xe(c,{code:Ee.invalid_date}),He}const r=new Yn;let i;for(const c of this._def.checks)c.kind==="min"?t.data.getTime()<c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),r.dirty()):c.kind==="max"?t.data.getTime()>c.value&&(i=this._getOrReturnCtx(t,i),xe(i,{code:Ee.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),r.dirty()):ft.assertNever(c);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new up({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:Me.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:Me.toString(s)})}get minDate(){let t=null;for(const s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}}up.create=e=>new up({checks:[],coerce:e?.coerce||!1,typeName:Fe.ZodDate,...Je(e)});class J_ extends lt{_parse(t){if(this._getType(t)!==je.symbol){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.symbol,received:r.parsedType}),He}return Vs(t.data)}}J_.create=e=>new J_({typeName:Fe.ZodSymbol,...Je(e)});class K_ extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.undefined,received:r.parsedType}),He}return Vs(t.data)}}K_.create=e=>new K_({typeName:Fe.ZodUndefined,...Je(e)});class Q_ extends lt{_parse(t){if(this._getType(t)!==je.null){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.null,received:r.parsedType}),He}return Vs(t.data)}}Q_.create=e=>new Q_({typeName:Fe.ZodNull,...Je(e)});class e4 extends lt{constructor(){super(...arguments),this._any=!0}_parse(t){return Vs(t.data)}}e4.create=e=>new e4({typeName:Fe.ZodAny,...Je(e)});class t4 extends lt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vs(t.data)}}t4.create=e=>new t4({typeName:Fe.ZodUnknown,...Je(e)});class mi extends lt{_parse(t){const s=this._getOrReturnCtx(t);return xe(s,{code:Ee.invalid_type,expected:je.never,received:s.parsedType}),He}}mi.create=e=>new mi({typeName:Fe.ZodNever,...Je(e)});class n4 extends lt{_parse(t){if(this._getType(t)!==je.undefined){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.void,received:r.parsedType}),He}return Vs(t.data)}}n4.create=e=>new n4({typeName:Fe.ZodVoid,...Je(e)});class _r extends lt{_parse(t){const{ctx:s,status:r}=this._processInputParams(t),i=this._def;if(s.parsedType!==je.array)return xe(s,{code:Ee.invalid_type,expected:je.array,received:s.parsedType}),He;if(i.exactLength!==null){const u=s.data.length>i.exactLength.value,f=s.data.length<i.exactLength.value;(u||f)&&(xe(s,{code:u?Ee.too_big:Ee.too_small,minimum:f?i.exactLength.value:void 0,maximum:u?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&s.data.length<i.minLength.value&&(xe(s,{code:Ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&s.data.length>i.maxLength.value&&(xe(s,{code:Ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),s.common.async)return Promise.all([...s.data].map((u,f)=>i.type._parseAsync(new Rr(s,u,s.path,f)))).then(u=>Yn.mergeArray(r,u));const c=[...s.data].map((u,f)=>i.type._parseSync(new Rr(s,u,s.path,f)));return Yn.mergeArray(r,c)}get element(){return this._def.type}min(t,s){return new _r({...this._def,minLength:{value:t,message:Me.toString(s)}})}max(t,s){return new _r({...this._def,maxLength:{value:t,message:Me.toString(s)}})}length(t,s){return new _r({...this._def,exactLength:{value:t,message:Me.toString(s)}})}nonempty(t){return this.min(1,t)}}_r.create=(e,t)=>new _r({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...Je(t)});function Ec(e){if(e instanceof tn){const t={};for(const s in e.shape){const r=e.shape[s];t[s]=li.create(Ec(r))}return new tn({...e._def,shape:()=>t})}else return e instanceof _r?new _r({...e._def,type:Ec(e.element)}):e instanceof li?li.create(Ec(e.unwrap())):e instanceof Kc?Kc.create(Ec(e.unwrap())):e instanceof yo?yo.create(e.items.map(t=>Ec(t))):e}class tn extends lt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),s=ft.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==je.object){const m=this._getOrReturnCtx(t);return xe(m,{code:Ee.invalid_type,expected:je.object,received:m.parsedType}),He}const{status:r,ctx:i}=this._processInputParams(t),{shape:c,keys:u}=this._getCached(),f=[];if(!(this._def.catchall instanceof mi&&this._def.unknownKeys==="strip"))for(const m in i.data)u.includes(m)||f.push(m);const p=[];for(const m of u){const g=c[m],y=i.data[m];p.push({key:{status:"valid",value:m},value:g._parse(new Rr(i,y,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof mi){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of f)p.push({key:{status:"valid",value:g},value:{status:"valid",value:i.data[g]}});else if(m==="strict")f.length>0&&(xe(i,{code:Ee.unrecognized_keys,keys:f}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const g of f){const y=i.data[g];p.push({key:{status:"valid",value:g},value:m._parse(new Rr(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of p){const y=await g.key,b=await g.value;m.push({key:y,value:b,alwaysSet:g.alwaysSet})}return m}).then(m=>Yn.mergeObjectSync(r,m)):Yn.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(t){return Me.errToObj,new tn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,r)=>{const i=this._def.errorMap?.(s,r).message??r.defaultError;return s.code==="unrecognized_keys"?{message:Me.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new tn({...this._def,unknownKeys:"strip"})}passthrough(){return new tn({...this._def,unknownKeys:"passthrough"})}extend(t){return new tn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Fe.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new tn({...this._def,catchall:t})}pick(t){const s={};for(const r of ft.objectKeys(t))t[r]&&this.shape[r]&&(s[r]=this.shape[r]);return new tn({...this._def,shape:()=>s})}omit(t){const s={};for(const r of ft.objectKeys(this.shape))t[r]||(s[r]=this.shape[r]);return new tn({...this._def,shape:()=>s})}deepPartial(){return Ec(this)}partial(t){const s={};for(const r of ft.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?s[r]=i:s[r]=i.optional()}return new tn({...this._def,shape:()=>s})}required(t){const s={};for(const r of ft.objectKeys(this.shape))if(t&&!t[r])s[r]=this.shape[r];else{let c=this.shape[r];for(;c instanceof li;)c=c._def.innerType;s[r]=c}return new tn({...this._def,shape:()=>s})}keyof(){return y3(ft.objectKeys(this.shape))}}tn.create=(e,t)=>new tn({shape:()=>e,unknownKeys:"strip",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});tn.strictCreate=(e,t)=>new tn({shape:()=>e,unknownKeys:"strict",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});tn.lazycreate=(e,t)=>new tn({shape:e,unknownKeys:"strip",catchall:mi.create(),typeName:Fe.ZodObject,...Je(t)});class dp extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r=this._def.options;function i(c){for(const f of c)if(f.result.status==="valid")return f.result;for(const f of c)if(f.result.status==="dirty")return s.common.issues.push(...f.ctx.common.issues),f.result;const u=c.map(f=>new pa(f.ctx.common.issues));return xe(s,{code:Ee.invalid_union,unionErrors:u}),He}if(s.common.async)return Promise.all(r.map(async c=>{const u={...s,common:{...s.common,issues:[]},parent:null};return{result:await c._parseAsync({data:s.data,path:s.path,parent:u}),ctx:u}})).then(i);{let c;const u=[];for(const p of r){const m={...s,common:{...s.common,issues:[]},parent:null},g=p._parseSync({data:s.data,path:s.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!c&&(c={result:g,ctx:m}),m.common.issues.length&&u.push(m.common.issues)}if(c)return s.common.issues.push(...c.ctx.common.issues),c.result;const f=u.map(p=>new pa(p));return xe(s,{code:Ee.invalid_union,unionErrors:f}),He}}get options(){return this._def.options}}dp.create=(e,t)=>new dp({options:e,typeName:Fe.ZodUnion,...Je(t)});function vv(e,t){const s=si(e),r=si(t);if(e===t)return{valid:!0,data:e};if(s===je.object&&r===je.object){const i=ft.objectKeys(t),c=ft.objectKeys(e).filter(f=>i.indexOf(f)!==-1),u={...e,...t};for(const f of c){const p=vv(e[f],t[f]);if(!p.valid)return{valid:!1};u[f]=p.data}return{valid:!0,data:u}}else if(s===je.array&&r===je.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let c=0;c<e.length;c++){const u=e[c],f=t[c],p=vv(u,f);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return s===je.date&&r===je.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class fp extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=(c,u)=>{if(Y_(c)||Y_(u))return He;const f=vv(c.value,u.value);return f.valid?((W_(c)||W_(u))&&s.dirty(),{status:s.value,value:f.data}):(xe(r,{code:Ee.invalid_intersection_types}),He)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([c,u])=>i(c,u)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}fp.create=(e,t,s)=>new fp({left:e,right:t,typeName:Fe.ZodIntersection,...Je(s)});class yo extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.array)return xe(r,{code:Ee.invalid_type,expected:je.array,received:r.parsedType}),He;if(r.data.length<this._def.items.length)return xe(r,{code:Ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),He;!this._def.rest&&r.data.length>this._def.items.length&&(xe(r,{code:Ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...r.data].map((u,f)=>{const p=this._def.items[f]||this._def.rest;return p?p._parse(new Rr(r,u,r.path,f)):null}).filter(u=>!!u);return r.common.async?Promise.all(c).then(u=>Yn.mergeArray(s,u)):Yn.mergeArray(s,c)}get items(){return this._def.items}rest(t){return new yo({...this._def,rest:t})}}yo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yo({items:e,typeName:Fe.ZodTuple,rest:null,...Je(t)})};class hp extends lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.object)return xe(r,{code:Ee.invalid_type,expected:je.object,received:r.parsedType}),He;const i=[],c=this._def.keyType,u=this._def.valueType;for(const f in r.data)i.push({key:c._parse(new Rr(r,f,r.path,f)),value:u._parse(new Rr(r,r.data[f],r.path,f)),alwaysSet:f in r.data});return r.common.async?Yn.mergeObjectAsync(s,i):Yn.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(t,s,r){return s instanceof lt?new hp({keyType:t,valueType:s,typeName:Fe.ZodRecord,...Je(r)}):new hp({keyType:la.create(),valueType:t,typeName:Fe.ZodRecord,...Je(s)})}}class s4 extends lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.map)return xe(r,{code:Ee.invalid_type,expected:je.map,received:r.parsedType}),He;const i=this._def.keyType,c=this._def.valueType,u=[...r.data.entries()].map(([f,p],m)=>({key:i._parse(new Rr(r,f,r.path,[m,"key"])),value:c._parse(new Rr(r,p,r.path,[m,"value"]))}));if(r.common.async){const f=new Map;return Promise.resolve().then(async()=>{for(const p of u){const m=await p.key,g=await p.value;if(m.status==="aborted"||g.status==="aborted")return He;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),f.set(m.value,g.value)}return{status:s.value,value:f}})}else{const f=new Map;for(const p of u){const m=p.key,g=p.value;if(m.status==="aborted"||g.status==="aborted")return He;(m.status==="dirty"||g.status==="dirty")&&s.dirty(),f.set(m.value,g.value)}return{status:s.value,value:f}}}}s4.create=(e,t,s)=>new s4({valueType:t,keyType:e,typeName:Fe.ZodMap,...Je(s)});class Yu extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.parsedType!==je.set)return xe(r,{code:Ee.invalid_type,expected:je.set,received:r.parsedType}),He;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(xe(r,{code:Ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),s.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(xe(r,{code:Ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),s.dirty());const c=this._def.valueType;function u(p){const m=new Set;for(const g of p){if(g.status==="aborted")return He;g.status==="dirty"&&s.dirty(),m.add(g.value)}return{status:s.value,value:m}}const f=[...r.data.values()].map((p,m)=>c._parse(new Rr(r,p,r.path,m)));return r.common.async?Promise.all(f).then(p=>u(p)):u(f)}min(t,s){return new Yu({...this._def,minSize:{value:t,message:Me.toString(s)}})}max(t,s){return new Yu({...this._def,maxSize:{value:t,message:Me.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}}Yu.create=(e,t)=>new Yu({valueType:e,minSize:null,maxSize:null,typeName:Fe.ZodSet,...Je(t)});class bv extends lt{get schema(){return this._def.getter()}_parse(t){const{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}bv.create=(e,t)=>new bv({getter:e,typeName:Fe.ZodLazy,...Je(t)});class wv extends lt{_parse(t){if(t.data!==this._def.value){const s=this._getOrReturnCtx(t);return xe(s,{received:s.data,code:Ee.invalid_literal,expected:this._def.value}),He}return{status:"valid",value:t.data}}get value(){return this._def.value}}wv.create=(e,t)=>new wv({value:e,typeName:Fe.ZodLiteral,...Je(t)});function y3(e,t){return new Xc({values:e,typeName:Fe.ZodEnum,...Je(t)})}class Xc extends lt{_parse(t){if(typeof t.data!="string"){const s=this._getOrReturnCtx(t),r=this._def.values;return xe(s,{expected:ft.joinValues(r),received:s.parsedType,code:Ee.invalid_type}),He}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const s=this._getOrReturnCtx(t),r=this._def.values;return xe(s,{received:s.data,code:Ee.invalid_enum_value,options:r}),He}return Vs(t.data)}get options(){return this._def.values}get enum(){const t={};for(const s of this._def.values)t[s]=s;return t}get Values(){const t={};for(const s of this._def.values)t[s]=s;return t}get Enum(){const t={};for(const s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return Xc.create(t,{...this._def,...s})}exclude(t,s=this._def){return Xc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...s})}}Xc.create=y3;class r4 extends lt{_parse(t){const s=ft.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==je.string&&r.parsedType!==je.number){const i=ft.objectValues(s);return xe(r,{expected:ft.joinValues(i),received:r.parsedType,code:Ee.invalid_type}),He}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=ft.objectValues(s);return xe(r,{received:r.data,code:Ee.invalid_enum_value,options:i}),He}return Vs(t.data)}get enum(){return this._def.values}}r4.create=(e,t)=>new r4({values:e,typeName:Fe.ZodNativeEnum,...Je(t)});class pp extends lt{unwrap(){return this._def.type}_parse(t){const{ctx:s}=this._processInputParams(t);if(s.parsedType!==je.promise&&s.common.async===!1)return xe(s,{code:Ee.invalid_type,expected:je.promise,received:s.parsedType}),He;const r=s.parsedType===je.promise?s.data:Promise.resolve(s.data);return Vs(r.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}}pp.create=(e,t)=>new pp({type:e,typeName:Fe.ZodPromise,...Je(t)});class Jc extends lt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:s,ctx:r}=this._processInputParams(t),i=this._def.effect||null,c={addIssue:u=>{xe(r,u),u.fatal?s.abort():s.dirty()},get path(){return r.path}};if(c.addIssue=c.addIssue.bind(c),i.type==="preprocess"){const u=i.transform(r.data,c);if(r.common.async)return Promise.resolve(u).then(async f=>{if(s.value==="aborted")return He;const p=await this._def.schema._parseAsync({data:f,path:r.path,parent:r});return p.status==="aborted"?He:p.status==="dirty"||s.value==="dirty"?Au(p.value):p});{if(s.value==="aborted")return He;const f=this._def.schema._parseSync({data:u,path:r.path,parent:r});return f.status==="aborted"?He:f.status==="dirty"||s.value==="dirty"?Au(f.value):f}}if(i.type==="refinement"){const u=f=>{const p=i.refinement(f,c);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(r.common.async===!1){const f=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return f.status==="aborted"?He:(f.status==="dirty"&&s.dirty(),u(f.value),{status:s.value,value:f.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(f=>f.status==="aborted"?He:(f.status==="dirty"&&s.dirty(),u(f.value).then(()=>({status:s.value,value:f.value}))))}if(i.type==="transform")if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Yc(u))return He;const f=i.transform(u.value,c);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:f}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Yc(u)?Promise.resolve(i.transform(u.value,c)).then(f=>({status:s.value,value:f})):He);ft.assertNever(i)}}Jc.create=(e,t,s)=>new Jc({schema:e,typeName:Fe.ZodEffects,effect:t,...Je(s)});Jc.createWithPreprocess=(e,t,s)=>new Jc({schema:t,effect:{type:"preprocess",transform:e},typeName:Fe.ZodEffects,...Je(s)});class li extends lt{_parse(t){return this._getType(t)===je.undefined?Vs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}li.create=(e,t)=>new li({innerType:e,typeName:Fe.ZodOptional,...Je(t)});class Kc extends lt{_parse(t){return this._getType(t)===je.null?Vs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kc.create=(e,t)=>new Kc({innerType:e,typeName:Fe.ZodNullable,...Je(t)});class Tv extends lt{_parse(t){const{ctx:s}=this._processInputParams(t);let r=s.data;return s.parsedType===je.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}Tv.create=(e,t)=>new Tv({innerType:e,typeName:Fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Je(t)});class Ev extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r={...s,common:{...s.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return lp(i)?i.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new pa(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pa(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ev.create=(e,t)=>new Ev({innerType:e,typeName:Fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Je(t)});class a4 extends lt{_parse(t){if(this._getType(t)!==je.nan){const r=this._getOrReturnCtx(t);return xe(r,{code:Ee.invalid_type,expected:je.nan,received:r.parsedType}),He}return{status:"valid",value:t.data}}}a4.create=e=>new a4({typeName:Fe.ZodNaN,...Je(e)});class hF extends lt{_parse(t){const{ctx:s}=this._processInputParams(t),r=s.data;return this._def.type._parse({data:r,path:s.path,parent:s})}unwrap(){return this._def.type}}class Pb extends lt{_parse(t){const{status:s,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?He:c.status==="dirty"?(s.dirty(),Au(c.value)):this._def.out._parseAsync({data:c.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?He:i.status==="dirty"?(s.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,s){return new Pb({in:t,out:s,typeName:Fe.ZodPipeline})}}class Sv extends lt{_parse(t){const s=this._def.innerType._parse(t),r=i=>(Yc(i)&&(i.value=Object.freeze(i.value)),i);return lp(s)?s.then(i=>r(i)):r(s)}unwrap(){return this._def.innerType}}Sv.create=(e,t)=>new Sv({innerType:e,typeName:Fe.ZodReadonly,...Je(t)});var Fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Fe||(Fe={}));const zs=la.create,ll=Wc.create,v3=yv.create;mi.create;const ui=_r.create,on=tn.create;dp.create;fp.create;yo.create;const Gb=hp.create,pF=bv.create,mF=wv.create,b3=Xc.create;pp.create;li.create;Kc.create;const Lt=De("0x2::sui::SUI"),mp=864e5,w3=365,gF=10n**27n,pt=zs().refine(da,"Invalid Sui address").transform(e=>ye(e)),sr=zs().regex(/^0x[0-9a-fA-F]+::[A-Za-z_][A-Za-z0-9_]*::[A-Za-z_][A-Za-z0-9_]*(<.*>)?$/,"Not a coin type").transform(e=>De(e)),T3=zs().regex(/^(0|[1-9][0-9]*)$/).refine(e=>BigInt(e)<=18446744073709551615n,"Amount exceeds u64"),vs=T3.refine(e=>BigInt(e)>0n,"Must be positive"),E3="agent gas",At=(e,t)=>De(e)===De(t),yF=zs().regex(/^[a-z0-9_-]{1,32}$/),Wp=e=>BigInt(e.perX)<=BigInt(e.daily),vF=on({coin:sr,recipients:ui(on({name:yF,address:pt}).strict()).min(1),perTransfer:vs,daily:vs}).strict().refine(e=>Wp({perX:e.perTransfer,daily:e.daily})&&new Set(e.recipients.map(t=>t.name)).size===e.recipients.length,"Per-transfer limit must not exceed the daily limit; recipient names must be unique"),bF=b3(["deepbook","cetus"]),wF=on({coinIn:sr,coinOut:sr,pools:ui(pt).min(1),perTrade:vs,daily:vs,minPrice:vs}).strict().refine(e=>Wp({perX:e.perTrade,daily:e.daily})&&!At(e.coinIn,e.coinOut)&&new Set(e.pools).size===e.pools.length,"Per-trade limit must not exceed the daily limit; the pair must differ; pools must be unique"),TF=on({coin:sr,allowBorrow:v3(),perAction:vs,daily:vs,minHealthFactor:ll().min(1).max(100).nullable()}).strict().refine(e=>Wp({perX:e.perAction,daily:e.daily}),"Per-action limit must not exceed the daily limit"),EF=on({validators:ui(pt),perStake:vs,daily:vs}).strict().refine(e=>Wp({perX:e.perStake,daily:e.daily})&&new Set(e.validators).size===e.validators.length,"Per-stake limit must not exceed the daily limit; validators must be unique"),Oh=e=>new Set(e).size===e.length,SF=on({transfers:ui(vF).default([]),swaps:ui(wF).default([]),lending:ui(TF).default([]),staking:EF.nullable().default(null)}).strict().refine(e=>e.transfers.length||e.swaps.length||e.lending.length||e.staking,"Allow at least one kind of action").refine(e=>Oh(e.transfers.map(t=>t.coin))&&Oh(e.swaps.map(t=>`${t.coinIn}>${t.coinOut}`))&&Oh(e.lending.map(t=>t.coin)),"One transfer rule per coin, one swap rule per direction, one lending rule per coin");function _F(e){const t=[...e.transfers.map(s=>s.coin),...e.swaps.map(s=>s.coinIn),...e.lending.map(s=>s.coin),...e.staking?[Lt]:[]];return[...new Set(t.map(s=>De(s)))]}const kF=on({type:sr,symbol:zs().min(1).max(16),decimals:ll().int().min(0).max(18),unlisted:v3().optional()}).strict(),AF=on({venue:bF,poolId:pt,coinA:sr,coinB:sr}).strict(),OF=ll().int().min(0).max(255),NF=on({network:b3(["localnet","testnet","devnet","mainnet"]),grpcUrl:zs().url(),chainIdentifier:zs().min(1),packageId:pt,publishedAt:pt,configId:pt,siteUrl:zs().url().optional(),coins:ui(kF).min(1),pools:ui(AF),maxTermDays:ll().int().min(1).max(w3),demoFaucet:on({packageId:pt,faucetId:pt,coin:sr}).strict().optional(),protocols:on({deepbook:on({packageId:pt,publishedAt:pt,indexerUrl:zs().url().optional()}).strict(),cetus:on({packageId:pt,publishedAt:pt,configId:pt,apiUrl:zs().url().optional()}).strict(),navi:on({packageId:pt,publishedAt:pt,oraclePackageId:pt,storageId:pt,oracleId:pt,incentiveV2Id:pt,incentiveV3Id:pt,reserves:Gb(sr,on({poolId:pt,assetId:OF}).strict())}).strict()}).strict()}).strict().refine(e=>At(e.coins[0].type,Lt),"The first coin must be SUI, the gas coin").refine(e=>Oh(e.coins.map(t=>t.type)),"Each coin once").refine(e=>e.pools.every(t=>e.coins.some(s=>At(s.type,t.coinA))&&e.coins.some(s=>At(s.type,t.coinB)))&&Object.keys(e.protocols.navi.reserves).every(t=>e.coins.some(s=>At(s.type,t)))&&(!e.demoFaucet||e.coins.some(t=>At(t.type,e.demoFaucet.coin))),"Pools, reserves and the demo faucet may only name listed coins");function Qc(e,t){const s=e.coins.find(r=>At(r.type,t));if(!s)throw new Error(`${t} is not a coin this deployment lists`);return s}const xF=on({v:mF(1),sessionAddress:pt,setup:pF(()=>DF),passId:pt.optional()}).strict(),CF=e=>xF.parse(JSON.parse(new TextDecoder().decode(qe(e.replaceAll("-","+").replaceAll("_","/"))))),IF=ll().int().positive().max(w3*mp),RF=vs,jF=ll().int().positive(),MF=zs().regex(/^[\x20-\x7e]{1,64}$/),DF=on({name:MF,policy:SF,ttlMs:IF,expiresMs:jF,allowances:Gb(sr,vs),gasAmount:RF,gasCap:vs,gasDaily:vs}).strict().refine(e=>BigInt(e.gasDaily)<=BigInt(e.gasCap),"The 24-hour gas limit must not exceed the gas lifetime cap").refine(e=>{const t=new Set(Object.keys(e.allowances).map(r=>De(r))),s=_F(e.policy);return s.every(r=>t.has(r))&&t.size===s.length},"Exactly the coins the rules spend need an allowance").refine(({policy:e,allowances:t})=>{const s=r=>BigInt(t[De(r)]??"0");return e.transfers.every(r=>BigInt(r.daily)<=s(r.coin))&&e.swaps.every(r=>BigInt(r.daily)<=s(r.coinIn))&&e.lending.every(r=>BigInt(r.daily)<=s(r.coin))&&(!e.staking||BigInt(e.staking.daily)<=s(Lt))},"A daily limit must not exceed the lifetime cap of its coin");on({passId:pt,receiptId:pt,allowances:Gb(sr,on({allowance:pt,revokeCap:pt}).strict()),gasAllowance:pt,gasRevokeCap:pt,owner:pt,authorizationDigest:zs().min(1)}).strict();function UF(e,t){if(!new RegExp(`^(0|[1-9][0-9]*)(\\.[0-9]{1,${t}})?$`).test(e))throw new Error(`Enter a non-negative number with at most ${t} decimals`);const[s,r=""]=e.split(".");return T3.parse((BigInt(s)*10n**BigInt(t)+BigInt(r.padEnd(t,"0"))).toString())}function dd(e,t){const s=BigInt(e),r=10n**BigInt(t),i=(s%r).toString().padStart(t,"0").replace(/0+$/,"");return`${s/r}${i?`.${i}`:""}`}function i4(e){const[t,,s]=De(e).split("::");return`${t.slice(0,6)}…${t.slice(-4)}::${s}`}function tr(e,t){const s=e.coins.find(r=>At(r.type,t));return s?s.unlisted?`${s.symbol} (${i4(t)})`:s.symbol:i4(t)}function fn(e,t,s){const r=e.coins.find(i=>At(i.type,t));return r?`${dd(s,r.decimals)} ${tr(e,t)}`:`${s} base units of ${t}`}function gp(e){const t=new Set,s=new Set;for(const r of e.transfers)t.add(De(r.coin));for(const r of e.swaps){t.add(De(r.coinIn)),t.add(De(r.coinOut));for(const i of r.pools)s.add(i)}for(const r of e.lending)t.add(De(r.coin));return e.staking&&t.add(Lt),{coins:[...t],pools:[...s]}}function BF(e,t,s,r){const i=Qc(e,s).decimals+9-Qc(e,t).decimals;return i>=0?dd(r,i):(BigInt(r)*10n**BigInt(-i)).toString()}const o4=e=>/^(USD|AUSD$|FDUSD$|BUCK$)/i.test(e);function Fb(e,t,s){const r=o4(Qc(e,t).symbol),i=o4(Qc(e,s).symbol);return r&&!i?{base:s,quote:t,limit:"max"}:{base:t,quote:s,limit:"min"}}function LF(e,t,s,r){if(Fb(e,t,s).limit==="min")return BF(e,t,s,r);const i=BigInt(r),c=10n**BigInt(Qc(e,s).decimals)*10n**9n;return dd(((c*2n+i)/(i*2n)).toString(),Qc(e,t).decimals)}const zF=e=>e===null?"0":(BigInt(UF(e.toFixed(2),2))*gF/100n).toString();function Hb(e){const t={};for(const[s,r]of Object.entries(e.allowances))t[De(s)]=(t[De(s)]??0n)+BigInt(r);return t[Lt]=(t[Lt]??0n)+BigInt(e.gasCap),Object.fromEntries(Object.entries(t).map(([s,r])=>[s,r.toString()]))}function S3(e,t,s=null){const r=i=>t[De(i)];return Object.fromEntries(Object.entries(Hb(e)).map(([i,c])=>{const u=BigInt(c)-BigInt(r(i)?.addressBalance??"0");if(u<=0n)return[i,"0"];if(s&&At(s,i))return[i,u.toString()];let f=BigInt(r(i)?.coinBalance??"0");return At(i,Lt)&&(f-=BigInt(e.gasAmount)+_3),[i,(f<=0n?0n:u<f?u:f).toString()]}))}function $F(e,t,s=null){const r=S3(e,t,s);return Object.fromEntries(Object.entries(Hb(e)).flatMap(([i,c])=>{const u=BigInt(t[De(i)]?.addressBalance??"0")+BigInt(r[i]??"0");return u>=BigInt(c)?[]:[[i,{drawable:c,covered:u.toString()}]]}))}function VF(e){return(BigInt(e.gasAmount)+_3).toString()}const _3=50000000n,Rn=H.Address,_v=H.struct("Bag",{id:Rn,size:H.u64()}),PF=H.struct("Control",{controller:Rn,name:H.string(),owner:H.Address,agent:H.Address,agent_expires_ms:H.u64(),policies:H.struct("Policies",{bag:_v}),positions:_v}),GF=H.struct("Pass",{id:Rn,control:PF}),Xp=H.struct("Meter",{day:H.u64(),used:H.u64()}),FF=H.struct("TransferPolicy",{recipients:_v,per_transfer:H.u64(),daily:H.u64(),meter:Xp}),HF=H.struct("SwapPolicy",{venues:H.vector(Rn),per_trade:H.u64(),daily:H.u64(),min_price:H.u64(),meter:Xp}),qF=H.struct("LendingPolicy",{pool:Rn,asset:H.u8(),allow_borrow:H.bool(),per_action:H.u64(),daily:H.u64(),min_health_factor:H.u256(),meter:Xp}),ZF=H.struct("StakingPolicy",{validators:H.vector(H.Address),per_stake:H.u64(),daily:H.u64(),meter:Xp}),k3=H.struct("AccountCap",{id:Rn,owner:H.Address}),YF=e=>ye(k3.parse(e).owner),WF=H.struct("StakedSui",{id:Rn,pool_id:Rn,stake_activation_epoch:H.u64(),principal:H.u64()}),XF=De("0x3::staking_pool::StakedSui"),JF=H.enum("RateLimit",{Windowed:H.struct("Windowed",{limit:H.u256(),spent:H.u256(),anchor_ms:H.option(H.u64()),index:H.u64(),window:H.enum("Window",{PeriodicMs:H.u64(),CalendarMonths:H.u8()})})}),KF=H.struct("Allowance",{id:Rn,settings:H.struct("Settings",{funder:H.Address,spender:H.option(H.Address),app:H.option(H.struct("TypeName",{name:H.string()})),lifetime_cap:H.option(H.u256()),start_timestamp_ms:H.option(H.u64()),expiration_timestamp_ms:H.option(H.u64()),rate_limit:H.option(JF),name:H.string()}),current_spend:H.u256()}),QF=H.struct("AllowanceCap",{id:Rn,allowance:Rn}),eH=H.struct("Clock",{id:Rn,timestamp_ms:H.u64()}),tH=H.struct("Created",{pass:Rn,receipt:Rn,name:H.string(),owner:H.Address,agent:H.Address,agent_expires_ms:H.u64()}),nH=H.struct("Issued",{pass:Rn,coin_type:H.struct("TypeName",{name:H.string()}),lifetime_cap:H.option(H.u256()),expires_ms:H.option(H.u64())}),sH=H.struct("Receipt",{id:Rn,pass:Rn,name:H.string()}),A3=e=>`${e.packageId}::pass::PASS`,O3=e=>`${e.packageId}::pass::Created`;function N3(e){const t=tH.parse(e);return{id:ye(t.pass),receiptId:ye(t.receipt),name:t.name,owner:ye(t.owner),agent:ye(t.agent),agentExpiresMs:t.agent_expires_ms}}async function x3(e,t,s){const r=[];let i=null;do{const c=await e.listOwnedObjects({owner:s,type:rH(t),cursor:i,include:{content:!0}});for(const u of c.objects){const f=sH.parse(u.content);r.push({id:ye(f.id),pass:ye(f.pass),name:f.name})}i=c.hasNextPage?c.cursor:null}while(i);return r}const rH=e=>`${e.packageId}::pass::Receipt`,aH=e=>`0x2::allowance::Allowance<0x2::balance::Balance<${e}>>`,C3=e=>De(`0x${e}`);async function iH(e,t,s){const r=await e.waitForTransaction({digest:s,include:{events:!0,transaction:!0,effects:!0,objectTypes:!0,balanceChanges:!0}});if(r.$kind!=="Transaction")throw new Error("Authorization transaction failed on chain");const i=r.Transaction;if(!i.transaction?.sender)throw new Error("Authorization has no sender");const c=u=>i.events.filter(f=>f.eventType===u);return{sender:ye(i.transaction.sender),passes:c(O3(t)).map(u=>N3(u.bcs)),issued:c(`${t.packageId}::pass::Issued`).map(u=>{const f=nH.parse(u.bcs);return{passId:ye(f.pass),coinType:C3(f.coin_type.name),lifetimeCap:f.lifetime_cap,expiresMs:f.expires_ms}}),balanceChanges:(i.balanceChanges??[]).map(u=>({address:ye(u.address),coinType:De(u.coinType),amount:u.amount})),objects:i.effects.changedObjects.filter(u=>u.idOperation==="Created"&&i.objectTypes[u.objectId]).map(u=>({id:ye(u.objectId),type:De(i.objectTypes[u.objectId]),owner:u.outputOwner?.$kind==="AddressOwner"?ye(u.outputOwner.AddressOwner):null,shared:u.outputOwner?.$kind==="Shared"}))}}const c4=[500,1e3,2e3,4e3],oH=e=>e instanceof gt&&e.code==="RESOURCE_EXHAUSTED";class cH extends Qv{unary(t,s,r){const i=(async()=>{for(let c=0;;c++){const u=super.unary(t,s,r);try{return await u.response,u}catch(f){if(!oH(f)||c>=c4.length)throw f;for(const p of[u.headers,u.status,u.trailers])p.catch(()=>{});await new Promise(p=>setTimeout(p,c4[c]))}}})();return new Kk(t,r.meta??{},s,i.then(c=>c.headers),i.then(c=>c.response),i.then(c=>c.status),i.then(c=>c.trailers))}}function Ht(e){return new lb({network:e.network,transport:new cH({baseUrl:e.grpcUrl})})}async function I3(e){const{object:t}=await e.getObject({objectId:"0x6",include:{content:!0}});return Number(eH.parse(t.content).timestamp_ms)}function sh(e,t){const s=Math.floor(t/mp);return{usedToday:s>Number(e.day)?"0":e.used,resetsAtMs:(s+1)*mp}}async function kv(e,t){const s=[];let r=null;do{const i=await e.listDynamicFields({parentId:t,cursor:r,include:{value:!0}});s.push(...i.dynamicFields),r=i.hasNextPage?i.cursor:null}while(r);return s}async function lH(e,t,s,r){const i={transfers:[],swaps:[],lending:[],staking:[]};for(const u of await kv(e,s)){const f=ws(u.valueType);if(ye(f.address)!==t.packageId)continue;const p=f.typeParams.map(m=>De(m));if(f.module==="transfer_policy"){const m=FF.parse(u.value.bcs),g=(await kv(e,ye(m.recipients.id))).map(y=>({name:H.string().parse(y.name.bcs),address:ye(H.Address.parse(y.value.bcs))}));g.sort((y,b)=>y.name.localeCompare(b.name)),i.transfers.push({coinType:p[0],recipients:g,perTransfer:m.per_transfer,daily:m.daily,usage:sh(m.meter,r)})}else if(f.module==="swap_policy"){const m=HF.parse(u.value.bcs);i.swaps.push({coinIn:p[0],coinOut:p[1],venues:m.venues.map(g=>ye(g)),perTrade:m.per_trade,daily:m.daily,minPrice:m.min_price,usage:sh(m.meter,r)})}else if(f.module==="lending_policy"){const m=qF.parse(u.value.bcs);i.lending.push({coinType:p[0],poolId:ye(m.pool),asset:m.asset,allowBorrow:m.allow_borrow,perAction:m.per_action,daily:m.daily,minHealthFactor:m.min_health_factor,usage:sh(m.meter,r)})}else if(f.module==="staking_policy"){const m=ZF.parse(u.value.bcs);i.staking.push({validators:m.validators.map(g=>ye(g)),perStake:m.per_stake,daily:m.daily,usage:sh(m.meter,r)})}}const c=(u,f)=>u.coinType.localeCompare(f.coinType);return i.transfers.sort(c),i.lending.sort(c),i.swaps.sort((u,f)=>(u.coinIn+u.coinOut).localeCompare(f.coinIn+f.coinOut)),i}async function fd(e,t,s){const[{object:r},i]=await Promise.all([e.getObject({objectId:s,include:{content:!0}}),I3(e)]);if(De(r.type)!==De(`${t.packageId}::pass::AgentPass`)||r.owner.$kind!=="Shared")throw new Error("Unexpected pass type or ownership");const{control:c}=GF.parse(r.content),[u,f]=await Promise.all([lH(e,t,ye(c.policies.bag.id),i),kv(e,ye(c.positions.id))]),p=f.find(g=>De(g.valueType)===De(`${t.protocols.navi.packageId}::account::AccountCap`)),m=f.filter(g=>De(g.valueType)===XF).map(g=>{const y=WF.parse(g.value.bcs);return{id:ye(y.id),poolId:ye(y.pool_id),activationEpoch:y.stake_activation_epoch,principal:y.principal}}).sort((g,y)=>g.id.localeCompare(y.id));return{id:ye(c.controller),name:c.name,owner:ye(c.owner),agent:ye(c.agent),agentExpiresMs:c.agent_expires_ms,revoked:c.agent_expires_ms==="0",policies:u,naviPosition:p?ye(k3.parse(p.value.bcs).owner):null,stakes:m,chainTimeMs:i}}async function uH(e,t,s){const r=await dH(e,t,s);return Object.fromEntries(Object.entries(r).map(([i,c])=>[i,c.addressBalance]))}async function dH(e,t,s){const r=await Promise.all(t.coins.map(async i=>{const{balance:c}=await e.getBalance({owner:s,coinType:i.type});return[De(i.type),{addressBalance:c.addressBalance,coinBalance:c.coinBalance}]}));return Object.fromEntries(r)}function fH(e){const t=ws(e);if(ye(t.address)!==ye("0x2")||t.module!=="allowance"||t.name!=="Allowance")return null;const s=t.typeParams[0];if(!s||typeof s=="string")return null;const r=s.typeParams[0];return r?De(r):null}async function qb(e,t,s){let r;try{({object:r}=await e.getObject({objectId:t,include:{content:!0}}))}catch(m){if(m instanceof uh&&(m.reason==="deleted"||m.reason==="notFound"))return null;throw m}if(De(r.type)!==De(aH(s))||r.owner.$kind!=="Shared")throw new Error("Unexpected allowance type or ownership");const i=await I3(e),c=KF.parse(r.content),u=c.settings,f=u.rate_limit?.Windowed;let p=null;if(f){const m=f.window.PeriodicMs??null;let g=f.spent;f.anchor_ms!==null&&m!==null&&Math.floor((i-Number(f.anchor_ms))/Number(m))>Number(f.index)&&(g="0"),p={limit:f.limit,spent:f.spent,spentNow:g,anchorMs:f.anchor_ms,index:f.index,periodMs:m,months:f.window.CalendarMonths??null}}return{id:ye(c.id),coinType:s,funder:ye(u.funder),spender:u.spender?ye(u.spender):null,app:u.app?C3(u.app.name):null,name:u.name,lifetimeCap:u.lifetime_cap,startMs:u.start_timestamp_ms,expirationMs:u.expiration_timestamp_ms,rateLimit:p,currentSpend:c.current_spend,chainTimeMs:i}}async function hH(e,t){const{object:s}=await e.getObject({objectId:t,include:{content:!0}});return ye(QF.parse(s.content).allowance)}async function pH(e,t,s){const r=De(A3(t)),i=ye(s.owner),c=ye(s.agent),u=[];let f=null;do{const g=await e.listOwnedObjects({owner:i,cursor:f,limit:50});for(const y of g.objects){const b=ws(y.type);ye(b.address)===ye("0x2")&&b.module==="allowance"&&b.name==="AllowanceCap"&&u.push(y.objectId)}f=g.hasNextPage?g.cursor:null}while(f&&u.length<1e3);const p={};let m=null;return await Promise.all(u.map(async g=>{const y=await hH(e,g).catch(()=>null);if(!y)return;const{object:b}=await e.getObject({objectId:y}).catch(()=>({object:null})),S=b?fH(b.type):null;if(!S)return;const O=await qb(e,y,S);!O||O.funder!==i||O.spender!==c||(O.app===r?p[S]={allowance:y,revokeCap:g}:O.app===null&&O.name===E3&&S===Lt&&(m={allowance:y,revokeCap:g}))})),{allowances:p,gas:m}}async function R3(e,t){const s=await Promise.all(Object.entries(t.allowances).map(async([r,i])=>[r,await qb(e,i.allowance,r)]));return Object.fromEntries(s)}async function Zb(e,t,s){const r=[...t.coins],i=[...t.pools],c=[["deepbook",t.protocols.deepbook.packageId],["cetus",t.protocols.cetus.packageId]];for(const f of s.pools){if(i.some(O=>ye(O.poolId)===ye(f)))continue;const{object:p}=await e.getObject({objectId:f}),m=ws(p.type),g=c.find(([,O])=>ye(m.address)===ye(O))?.[0],[y,b]=m.typeParams;if(!g||m.module!=="pool"||m.name!=="Pool"||!y||!b)throw new Error(`${f} is not a DeepBook or Cetus pool on this network`);const S=O=>De(typeof O=="string"?O:j3(O));i.push({venue:g,poolId:ye(f),coinA:S(y),coinB:S(b)})}const u=new Set(s.coins.map(f=>De(f)));for(const f of i)u.add(f.coinA),u.add(f.coinB);for(const f of u){if(r.some(m=>At(m.type,f)))continue;const{coinMetadata:p}=await e.getCoinMetadata({coinType:f});if(!p)throw new Error(`${f} has no coin metadata on this network`);r.push({type:f,symbol:p.symbol.slice(0,16)||"COIN",decimals:p.decimals,unlisted:!0})}return{...t,coins:r,pools:i}}function j3(e){const t=e.typeParams.map(s=>typeof s=="string"?s:j3(s));return`${e.address}::${e.module}::${e.name}${t.length?`<${t.join(",")}>`:""}`}function mH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/tx/${encodeURIComponent(t)}`}function gH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/object/${t}`}function yH(e,t){return e.network==="localnet"?null:`https://suiscan.xyz/${e.network}/account/${t}`}const vH=e=>(Number(BigInt(e)/10n**25n)/100).toFixed(2);function M3(e,t,s=null){const r=(f,p)=>fn(e,f,p),i=f=>e.coins.find(p=>At(p.type,f))?.symbol??f,c=(f,p)=>{const m=e.pools.find(b=>b.poolId===f);if(!m)return f;const g=m.venue==="deepbook"?"DeepBook":"Cetus";return p&&(At(m.coinA,p[0])&&At(m.coinB,p[1])||At(m.coinA,p[1])&&At(m.coinB,p[0]))?g:`${g} ${i(m.coinA)}/${i(m.coinB)}`},u=[{label:"Allowed actions",value:[t.transfers.length&&"Transfers",t.swaps.length&&"Swaps",t.lending.length&&(t.lending.some(f=>f.allowBorrow)?"Lending and borrowing":"Lending"),t.staking&&"Staking"].filter(Boolean).join(" + ")}];for(const f of t.transfers){const p=s?.transfers.find(m=>At(m.coinType,f.coin));u.push({starts:!0,label:`Pay ${i(f.coin)} to`,value:(p?.recipients??f.recipients).map(m=>`${m.name} → ${m.address}`).join(`
|
|
841
|
-
`)},{label:`Max ${i(f.coin)} per transfer / per UTC day`,value:`${r(f.coin,p?.perTransfer??f.perTransfer)} / ${r(f.coin,p?.daily??f.daily)}`})}for(const f of t.swaps){const p=s?.swaps.find(y=>At(y.coinIn,f.coinIn)&&At(y.coinOut,f.coinOut)),m=p?.minPrice??f.minPrice,g=Fb(e,f.coinIn,f.coinOut);u.push({starts:!0,label:g.limit==="max"?`Buy ${i(f.coinOut)} with ${i(f.coinIn)} on`:`Sell ${i(f.coinIn)} for ${i(f.coinOut)} on`,value:(p?.venues??f.pools).map(y=>c(y,[f.coinIn,f.coinOut])).join(", ")},{label:`Max ${i(f.coinIn)} ${g.limit==="max"?"spent":"sold"} per trade / per UTC day`,value:`${r(f.coinIn,p?.perTrade??f.perTrade)} / ${r(f.coinIn,p?.daily??f.daily)}`},{label:g.limit==="max"?"Highest price paid":"Lowest price accepted",value:`${LF(e,f.coinIn,f.coinOut,m)} ${i(g.quote)} per ${i(g.base)}`})}for(const f of t.lending){const p=s?.lending.find(g=>At(g.coinType,f.coin));u.push({starts:!0,label:`Max NAVI ${f.allowBorrow?"borrowing":"collateral"} in ${i(f.coin)} per action / per UTC day`,value:`${r(f.coin,p?.perAction??f.perAction)} / ${r(f.coin,p?.daily??f.daily)}`});const m=p?vH(p.minHealthFactor):f.minHealthFactor?.toFixed(2);m&&m!=="0.00"&&u.push({label:`Health factor kept above (${i(f.coin)})`,value:m})}if(t.staking){const f=s?.staking[0],p=f?.validators??t.staking.validators;u.push({starts:!0,label:"Stake SUI with",value:p.length?p.join(`
|
|
842
|
-
`):"Any active validator"},{label:"Max SUI per stake / per UTC day",value:`${r(Lt,f?.perStake??t.staking.perStake)} / ${r(Lt,f?.daily??t.staking.daily)}`})}return u}const bH=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"});function Av(e,t){return[...M3(e,t.policy),{starts:!0,label:"Authorization ends",value:`${bH.format(t.expiresMs)} UTC (${t.ttlMs/864e5} ${t.ttlMs===864e5?"day":"days"}); you can revoke earlier`},{label:"Agent may ever withdraw (lifetime caps)",value:Object.entries(t.allowances).map(([s,r])=>fn(e,s,r)).join(", ")},{label:"Max gas allowance, lifetime / per 24 hours from first top-up",value:`${fn(e,Lt,t.gasCap)} / ${fn(e,Lt,t.gasDaily)}`},{label:"Agent gas stipend (outside the rules)",value:fn(e,Lt,t.gasAmount)}]}const wH=new Set(["deposit_object","withdraw_object","navi_open","destroy","issue","add_policy","remove_policy","set_term","revoke_agent"]);function D3(e,t,s,r){const{inputs:i,commands:c}=r.transaction,u=(F,K)=>F?fn(e,l4(F),K):`${K} base units of an unknown coin`,f=F=>F?tr(e,l4(F)):"an unknown coin",p=F=>F&&typeof F=="object"&&"Input"in F?i[F.Input]:void 0,m=(F,K)=>{const w=p(F);if(!w||!("Pure"in w)||!w.Pure)return null;try{const A=qe(w.Pure.bytes);return K==="u64"?H.u64().parse(A):K==="address"?ye(H.Address.parse(A)):H.string().parse(A)}catch{return null}},g=F=>{const K=p(F);if(!K||!("Object"in K)||!K.Object)return null;const w=K.Object,A="SharedObject"in w?w.SharedObject?.objectId:"ImmOrOwnedObject"in w?w.ImmOrOwnedObject?.objectId:void 0;return A?ye(A):null},y=F=>{const K=p(F);return!K||!("FundsWithdrawal"in K)||!K.FundsWithdrawal?null:K.FundsWithdrawal.reservation?.MaxAmountU64??null},b=F=>{const K=y(F.arguments[1]);return K===null?"SUI":u(Lt,K)},S=F=>{const K=e.pools.find(w=>w.poolId===F);return K?K.venue==="deepbook"?"DeepBook":"Cetus":"a pool you did not list"},O=F=>[e.packageId,e.publishedAt].some(K=>ye(K)===ye(F)),C=c.flatMap(F=>"MoveCall"in F&&F.MoveCall?[F.MoveCall]:[]),R=C.find(F=>O(F.package)&&F.module==="pass")??C.find(F=>O(F.package))??C[0];let $="Custom transaction",x=null;if(R&&O(R.package)){const[F,K]=R.typeArguments,w=R.arguments,A=(N,P=F)=>{const U=m(w[N],"u64")??y(w[N]);return U===null?"an amount":u(P,U)};switch(R.function){case"transfer":x=m(w[w.length-2],"string"),$=`Pay ${A(3)} to ${x?`"${x}"`:"a recipient"}`;break;case"begin_swap":{const P=C.filter(L=>["deepbook_base_to_quote","deepbook_quote_to_base","cetus_a_to_b","cetus_b_to_a"].includes(L.function)).map(L=>S(g(L.arguments[L.function.startsWith("cetus")?3:2]))),U=C.find(L=>L.function==="finish_swap"),q=U?m(U.arguments[2],"u64"):null;$=`Sell ${A(3)} for ${f(K)} on ${P.join(", then ")||"no pool"}, accepting at least ${q===null?"an amount":u(K,q)}`;break}case"navi_supply":$=`Supply ${A(3)} to NAVI`;break;case"navi_repay":$=`Repay ${A(3)} to NAVI`;break;case"navi_withdraw":$=`Withdraw ${A(7)} from NAVI`;break;case"navi_borrow":$=`Borrow ${A(7)} from NAVI`;break;case"stake":{const N=m(w[5],"address");$=`Stake ${A(3,Lt)} with ${N?`validator ${Ey(N)}`:"a validator"}`;break}case"unstake":{const N=m(w[3],"address");$=`Unstake ${N?Ey(N):"a stake"} back to your balance`;break}default:$=wH.has(R.function)?`Call the owner-only ${R.module}::${R.function}`:`Call ${R.module}::${R.function}`}}else R&&ye(R.package)===ye("0x2")&&R.module==="allowance"&&R.function==="balance_spend"?$=`Top up the agent's gas with ${b(R)}`:R&&($=`Call ${R.module}::${R.function}`);const W=new Map(s.map(F=>[ye(F.address),F.name])),ce=ye(t),ge=r.status.success?r.balanceChanges.filter(F=>BigInt(F.amount)>0n&&ye(F.address)!==ce).map(F=>`${u(F.coinType,F.amount)} → ${W.get(ye(F.address))??Ey(F.address)}`):[];return{digest:r.digest,timestampMs:r.timestampMs,success:r.status.success,what:$,why:r.status.success?null:TH(e,r.status.error,x),moved:ge}}const Ey=e=>`${e.slice(0,8)}…${e.slice(-6)}`,l4=e=>e.replace(/^0x0*([0-9a-f]+)::/i,(t,s)=>`${ye(s)}::`);function TH(e,t,s){const r=t.MoveAbort;if(t.message==="InsufficientBalanceForWithdraw")return"The owner's address balance does not hold enough of this coin right now. This is not one of the owner's rules: the action can run once the balance covers it (InsufficientBalanceForWithdraw)";if(!r?.location?.module)return t.message;const i=Number(r.cleverError?.errorCode??r.abortCode),c=`${r.location.module} abort ${i}`,u=ye(r.location.package??"0x0"),f={allowance:{3:"Over the lifetime cap of the owner's allowance for this coin (checked before the daily limit, so when the two are equal the day is used up as well)",4:"Over the gas allowance's limit per 24 hours from first top-up"},validator_set:{10:"Below the 1 SUI minimum stake",0:"Not an active validator"}};if(u===ye("0x2")||u===ye("0x3")){const g=f[r.location.module]?.[i];return g?`${g} (${c})`:`Refused in ${c}`}if(u!==ye(e.packageId)){const y={1500:"NAVI is paused",1502:"NAVI has no fresh oracle price for this asset; the price must be refreshed in the same transaction",1503:"NAVI rejected the amount",1506:"NAVI pool has insufficient balance",1508:"NAVI no longer accepts this entry point; the pass must call its current one",1600:"NAVI finds the position unhealthy",1601:"the position holds no collateral",1602:"the position has no debt to repay",1603:"the collateral does not cover that borrow (loan-to-value)",1604:"NAVI's deposit cap for this asset is reached",1605:"NAVI's borrow cap for this asset is reached"}[i];return y?`Refused by NAVI, not by your rules: ${y} (${c})`:`Refused inside the protocol, not by your rules (${c}): ${t.message}`}const m={transfer_policy:{0:`${s?`"${s}"`:"That recipient"} is not a recipient you named`,1:"Over your per-transfer limit",2:"Zero amount"},meter:{0:"Over your daily limit"},swap_policy:{0:"Not a pool you listed",1:"Over your per-trade limit",3:"Below the agent's own minimum output",4:"Worse than your price limit",8:"The venue filled nothing (order under its minimum size)"},lending_policy:{0:"Not the NAVI pool or asset you chose",1:"Borrowing is not allowed",3:"Over your per-action limit"},navi:{0:"Your health-factor floor would be breached",2:"The NAVI account is not in the pass; you reclaimed it"},staking_policy:{0:"Not a validator you listed",1:"Over your per-stake limit",2:"Zero amount"},staking:{0:"No such stake is held by the pass"},pass:{1:"Not an allowance issued for this pass",2:"No such object is held by the pass",7:"A swap begun on one pass cannot end on another"},control:{0:"Only your wallet can do this",1:"This key is not your agent",2:"Your agent's access was revoked or has expired"},policies:{0:"No rule allows this coin or action"}}[r.location.module]?.[i];return m?`${m} (${c})`:`Refused in ${c}`}async function U3(e,t,s,r=null){const i=await e.listEvents({filter:{eventType:O3(t)},order:"descending",limit:s,...r?{before:r}:{}});return{summaries:await Promise.all(i.events.map(async u=>{const f=await e.getTransaction({digest:u.transactionDigest}).catch(()=>null),p=f?.Transaction??f?.FailedTransaction;return{...N3(u.bcs),digest:u.transactionDigest,timestampMs:p?.timestampMs??null}})),hasNextPage:i.hasNextPage,endCursor:i.endCursor}}const EH=(e,t)=>L5(e.configId,`${e.packageId}::pass::AgentKey`,H.Address.serialize(ye(t)).toBytes());async function SH(e,t,s){const r=EH(t,s),i=await e.getObject({objectId:r,include:{previousTransaction:!0}}).catch(()=>null);if(!i?.object.previousTransaction)return null;const{owner:c}=await fd(e,t,r);return{id:r,owner:c,digest:i.object.previousTransaction}}async function _H(e,t,s=50){return(await U3(e,t,s)).summaries}async function Jp(e,t,s){const r=ye(s);let i=null;for(let c=0;c<40;c++){const{summaries:u,hasNextPage:f,endCursor:p}=await U3(e,t,50,i),m=u.find(g=>g.id===r);if(m)return m;if(!f||!p)return null;i=p}return null}async function Yb(e,t,s){const r=await fd(e,t,s.id),{allowances:i,gas:c}=await pH(e,t,{owner:s.owner,agent:r.agent});return!c||Object.keys(i).length===0?null:{passId:s.id,receiptId:s.receiptId,allowances:i,gasAllowance:c.allowance,gasRevokeCap:c.revokeCap,owner:s.owner,authorizationDigest:s.digest}}const B3={transaction:!0,balanceChanges:!0};async function kH(e,t,s,r,i=30){return(await e.listTransactions({filter:{sender:s},order:"descending",limit:i,include:B3})).transactions.map(u=>D3(t,s,r,u.Transaction??u.FailedTransaction))}async function AH(e,t,s=40){return(await e.listTransactions({filter:{function:`${t.publishedAt}::pass`},order:"descending",limit:s,include:B3})).transactions.map(i=>{const c=i.Transaction??i.FailedTransaction,u=ye(c.transaction?.sender??"0x0");return{...D3(t,u,[],c),sender:u}})}const u4=H.bytes(32).transform({input:e=>Qu(e),output:e=>kr(e)});H.struct("IncentiveAPYInfo",{asset_id:H.u8(),apy:H.u256(),coin_types:H.vector(H.string())});const OH=H.struct("IncentivePoolInfo",{pool_id:u4,funds:u4,phase:H.u64(),start_at:H.u64(),end_at:H.u64(),closed_at:H.u64(),total_supply:H.u64(),asset_id:H.u8(),option:H.u8(),factor:H.u256(),distributed:H.u64(),available:H.u256(),total:H.u256()});H.struct("IncentivePoolInfoByPhase",{phase:H.u64(),pools:H.vector(OH)});H.struct("OracleInfo",{oracle_id:H.u8(),price:H.u256(),decimals:H.u8(),valid:H.bool()});H.struct("FlashLoanAssetConfig",{id:H.string(),asset_id:H.u8(),coin_type:H.string(),pool_id:H.string(),rate_to_supplier:H.u64(),rate_to_treasury:H.u64(),max:H.u64(),min:H.u64()});H.struct("ReserveDataInfo",{id:H.u8(),oracle_id:H.u8(),coin_type:H.string(),supply_cap:H.u256(),borrow_cap:H.u256(),supply_rate:H.u256(),borrow_rate:H.u256(),supply_index:H.u256(),borrow_index:H.u256(),total_supply:H.u256(),total_borrow:H.u256(),last_update_at:H.u64(),ltv:H.u256(),treasury_factor:H.u256(),treasury_balance:H.u256(),base_rate:H.u256(),multiplier:H.u256(),jump_rate_multiplier:H.u256(),reserve_factor:H.u256(),optimal_utilization:H.u256(),liquidation_ratio:H.u256(),liquidation_bonus:H.u256(),liquidation_threshold:H.u256()});H.struct("UserStateInfo",{asset_id:H.u8(),borrow_balance:H.u256(),supply_balance:H.u256()});var Sy,d4;function NH(){if(d4)return Sy;d4=1;var e="[object Symbol]",t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,r="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",c="\\u20d0-\\u20f0",u="\\u2700-\\u27bf",f="a-z\\xdf-\\xf6\\xf8-\\xff",p="\\xac\\xb1\\xd7\\xf7",m="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",g="\\u2000-\\u206f",y=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",b="A-Z\\xc0-\\xd6\\xd8-\\xde",S="\\ufe0e\\ufe0f",O=p+m+g+y,C="['’]",R="["+r+"]",$="["+O+"]",x="["+i+c+"]",W="\\d+",ce="["+u+"]",ge="["+f+"]",F="[^"+r+O+W+u+f+b+"]",K="\\ud83c[\\udffb-\\udfff]",w="(?:"+x+"|"+K+")",A="[^"+r+"]",N="(?:\\ud83c[\\udde6-\\uddff]){2}",P="[\\ud800-\\udbff][\\udc00-\\udfff]",U="["+b+"]",q="\\u200d",L="(?:"+ge+"|"+F+")",M="(?:"+U+"|"+F+")",k="(?:"+C+"(?:d|ll|m|re|s|t|ve))?",j="(?:"+C+"(?:D|LL|M|RE|S|T|VE))?",D=w+"?",z="["+S+"]?",J="(?:"+q+"(?:"+[A,N,P].join("|")+")"+z+D+")*",V=z+D+J,re="(?:"+[ce,N,P].join("|")+")"+V,ue="(?:"+[A+x+"?",x,N,P,R].join("|")+")",I=RegExp(C,"g"),X=RegExp(x,"g"),oe=RegExp(K+"(?="+K+")|"+ue+V,"g"),he=RegExp([U+"?"+ge+"+"+k+"(?="+[$,U,"$"].join("|")+")",M+"+"+j+"(?="+[$,U+L,"$"].join("|")+")",U+"?"+L+"+"+k,U+"+"+j,W,re].join("|"),"g"),Te=RegExp("["+q+r+i+c+S+"]"),Oe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ae={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},be=typeof Sc=="object"&&Sc&&Sc.Object===Object&&Sc,_e=typeof self=="object"&&self&&self.Object===Object&&self,Ve=be||_e||Function("return this")();function at(Ce,Ye,Nt,Ss){for(var jn=-1,_o=Ce?Ce.length:0;++jn<_o;)Nt=Ye(Nt,Ce[jn],jn,Ce);return Nt}function G(Ce){return Ce.split("")}function te(Ce){return Ce.match(t)||[]}function de(Ce){return function(Ye){return Ce?.[Ye]}}var fe=de(Ae);function le(Ce){return Te.test(Ce)}function ze(Ce){return Oe.test(Ce)}function Le(Ce){return le(Ce)?Dt(Ce):G(Ce)}function Dt(Ce){return Ce.match(oe)||[]}function Es(Ce){return Ce.match(he)||[]}var va=Object.prototype,ul=va.toString,bi=Ve.Symbol,So=bi?bi.prototype:void 0,dl=So?So.toString:void 0;function ar(Ce,Ye,Nt){var Ss=-1,jn=Ce.length;Ye<0&&(Ye=-Ye>jn?0:jn+Ye),Nt=Nt>jn?jn:Nt,Nt<0&&(Nt+=jn),jn=Ye>Nt?0:Nt-Ye>>>0,Ye>>>=0;for(var _o=Array(jn);++Ss<jn;)_o[Ss]=Ce[Ss+Ye];return _o}function fl(Ce){if(typeof Ce=="string")return Ce;if(ml(Ce))return dl?dl.call(Ce):"";var Ye=Ce+"";return Ye=="0"&&1/Ce==-1/0?"-0":Ye}function hl(Ce,Ye,Nt){var Ss=Ce.length;return Nt=Nt===void 0?Ss:Nt,!Ye&&Nt>=Ss?Ce:ar(Ce,Ye,Nt)}function Qp(Ce){return function(Ye){Ye=ba(Ye);var Nt=le(Ye)?Le(Ye):void 0,Ss=Nt?Nt[0]:Ye.charAt(0),jn=Nt?hl(Nt,1).join(""):Ye.slice(1);return Ss[Ce]()+jn}}function hd(Ce){return function(Ye){return at(pd(Ln(Ye).replace(I,"")),Ce,"")}}function pl(Ce){return!!Ce&&typeof Ce=="object"}function ml(Ce){return typeof Ce=="symbol"||pl(Ce)&&ul.call(Ce)==e}function ba(Ce){return Ce==null?"":fl(Ce)}var em=hd(function(Ce,Ye,Nt){return Ye=Ye.toLowerCase(),Ce+(Nt?tm(Ye):Ye)});function tm(Ce){return nm(ba(Ce).toLowerCase())}function Ln(Ce){return Ce=ba(Ce),Ce&&Ce.replace(s,fe).replace(X,"")}var nm=Qp("toUpperCase");function pd(Ce,Ye,Nt){return Ce=ba(Ce),Ye=Ye,Ye===void 0?ze(Ce)?Es(Ce):te(Ce):Ce.match(Ye)||[]}return Sy=em,Sy}NH();var xH=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,_y=Math.ceil,Ms=Math.floor,ns="[BigNumber Error] ",f4=ns+"Number primitive has more than 15 significant digits: ",Ys=1e14,Ze=14,ky=9007199254740991,Ay=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ka=1e7,bn=1e9;function L3(e){var t,s,r,i=x.prototype={constructor:x,toString:null,valueOf:null},c=new x(1),u=20,f=4,p=-7,m=21,g=-1e7,y=1e7,b=!1,S=1,O=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function x(w,A){var N,P,U,q,L,M,k,j,D=this;if(!(D instanceof x))return new x(w,A);if(A==null){if(w&&w._isBigNumber===!0){D.s=w.s,!w.c||w.e>y?D.c=D.e=null:w.e<g?D.c=[D.e=0]:(D.e=w.e,D.c=w.c.slice());return}if((M=typeof w=="number")&&w*0==0){if(D.s=1/w<0?(w=-w,-1):1,w===~~w){for(q=0,L=w;L>=10;L/=10,q++);q>y?D.c=D.e=null:(D.e=q,D.c=[w]);return}j=String(w)}else{if(!xH.test(j=String(w)))return r(D,j,M);D.s=j.charCodeAt(0)==45?(j=j.slice(1),-1):1}(q=j.indexOf("."))>-1&&(j=j.replace(".","")),(L=j.search(/e/i))>0?(q<0&&(q=L),q+=+j.slice(L+1),j=j.substring(0,L)):q<0&&(q=j.length)}else{if($t(A,2,R.length,"Base"),A==10&&$)return D=new x(w),F(D,u+D.e+1,f);if(j=String(w),M=typeof w=="number"){if(w*0!=0)return r(D,j,M,A);if(D.s=1/w<0?(j=j.slice(1),-1):1,x.DEBUG&&j.replace(/^0\.0*|\./,"").length>15)throw Error(f4+w)}else D.s=j.charCodeAt(0)===45?(j=j.slice(1),-1):1;for(N=R.slice(0,A),q=L=0,k=j.length;L<k;L++)if(N.indexOf(P=j.charAt(L))<0){if(P=="."){if(L>q){q=k;continue}}else if(!U&&(j==j.toUpperCase()&&(j=j.toLowerCase())||j==j.toLowerCase()&&(j=j.toUpperCase()))){U=!0,L=-1,q=0;continue}return r(D,String(w),M,A)}M=!1,j=s(j,A,10,D.s),(q=j.indexOf("."))>-1?j=j.replace(".",""):q=j.length}for(L=0;j.charCodeAt(L)===48;L++);for(k=j.length;j.charCodeAt(--k)===48;);if(j=j.slice(L,++k)){if(k-=L,M&&x.DEBUG&&k>15&&(w>ky||w!==Ms(w)))throw Error(f4+D.s*w);if((q=q-L-1)>y)D.c=D.e=null;else if(q<g)D.c=[D.e=0];else{if(D.e=q,D.c=[],L=(q+1)%Ze,q<0&&(L+=Ze),L<k){for(L&&D.c.push(+j.slice(0,L)),k-=Ze;L<k;)D.c.push(+j.slice(L,L+=Ze));L=Ze-(j=j.slice(L)).length}else L-=k;for(;L--;j+="0");D.c.push(+j)}}else D.c=[D.e=0]}x.clone=L3,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(w){var A,N;if(w!=null)if(typeof w=="object"){if(w.hasOwnProperty(A="DECIMAL_PLACES")&&(N=w[A],$t(N,0,bn,A),u=N),w.hasOwnProperty(A="ROUNDING_MODE")&&(N=w[A],$t(N,0,8,A),f=N),w.hasOwnProperty(A="EXPONENTIAL_AT")&&(N=w[A],N&&N.pop?($t(N[0],-bn,0,A),$t(N[1],0,bn,A),p=N[0],m=N[1]):($t(N,-bn,bn,A),p=-(m=N<0?-N:N))),w.hasOwnProperty(A="RANGE"))if(N=w[A],N&&N.pop)$t(N[0],-bn,-1,A),$t(N[1],1,bn,A),g=N[0],y=N[1];else if($t(N,-bn,bn,A),N)g=-(y=N<0?-N:N);else throw Error(ns+A+" cannot be zero: "+N);if(w.hasOwnProperty(A="CRYPTO"))if(N=w[A],N===!!N)if(N)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))b=N;else throw b=!N,Error(ns+"crypto unavailable");else b=N;else throw Error(ns+A+" not true or false: "+N);if(w.hasOwnProperty(A="MODULO_MODE")&&(N=w[A],$t(N,0,9,A),S=N),w.hasOwnProperty(A="POW_PRECISION")&&(N=w[A],$t(N,0,bn,A),O=N),w.hasOwnProperty(A="FORMAT"))if(N=w[A],typeof N=="object")C=N;else throw Error(ns+A+" not an object: "+N);if(w.hasOwnProperty(A="ALPHABET"))if(N=w[A],typeof N=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(N))$=N.slice(0,10)=="0123456789",R=N;else throw Error(ns+A+" invalid: "+N)}else throw Error(ns+"Object expected: "+w);return{DECIMAL_PLACES:u,ROUNDING_MODE:f,EXPONENTIAL_AT:[p,m],RANGE:[g,y],CRYPTO:b,MODULO_MODE:S,POW_PRECISION:O,FORMAT:C,ALPHABET:R}},x.isBigNumber=function(w){if(!w||w._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var A,N,P=w.c,U=w.e,q=w.s;e:if({}.toString.call(P)=="[object Array]"){if((q===1||q===-1)&&U>=-bn&&U<=bn&&U===Ms(U)){if(P[0]===0){if(U===0&&P.length===1)return!0;break e}if(A=(U+1)%Ze,A<1&&(A+=Ze),String(P[0]).length==A){for(A=0;A<P.length;A++)if(N=P[A],N<0||N>=Ys||N!==Ms(N))break e;if(N!==0)return!0}}}else if(P===null&&U===null&&(q===null||q===1||q===-1))return!0;throw Error(ns+"Invalid BigNumber: "+w)},x.maximum=x.max=function(){return ce(arguments,-1)},x.minimum=x.min=function(){return ce(arguments,1)},x.random=(function(){var w=9007199254740992,A=Math.random()*w&2097151?function(){return Ms(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(N){var P,U,q,L,M,k=0,j=[],D=new x(c);if(N==null?N=u:$t(N,0,bn),L=_y(N/Ze),b)if(crypto.getRandomValues){for(P=crypto.getRandomValues(new Uint32Array(L*=2));k<L;)M=P[k]*131072+(P[k+1]>>>11),M>=9e15?(U=crypto.getRandomValues(new Uint32Array(2)),P[k]=U[0],P[k+1]=U[1]):(j.push(M%1e14),k+=2);k=L/2}else if(crypto.randomBytes){for(P=crypto.randomBytes(L*=7);k<L;)M=(P[k]&31)*281474976710656+P[k+1]*1099511627776+P[k+2]*4294967296+P[k+3]*16777216+(P[k+4]<<16)+(P[k+5]<<8)+P[k+6],M>=9e15?crypto.randomBytes(7).copy(P,k):(j.push(M%1e14),k+=7);k=L/7}else throw b=!1,Error(ns+"crypto unavailable");if(!b)for(;k<L;)M=A(),M<9e15&&(j[k++]=M%1e14);for(L=j[--k],N%=Ze,L&&N&&(M=Ay[Ze-N],j[k]=Ms(L/M)*M);j[k]===0;j.pop(),k--);if(k<0)j=[q=0];else{for(q=-1;j[0]===0;j.splice(0,1),q-=Ze);for(k=1,M=j[0];M>=10;M/=10,k++);k<Ze&&(q-=Ze-k)}return D.e=q,D.c=j,D}})(),x.sum=function(){for(var w=1,A=arguments,N=new x(A[0]);w<A.length;)N=N.plus(A[w++]);return N},s=(function(){var w="0123456789";function A(N,P,U,q){for(var L,M=[0],k,j=0,D=N.length;j<D;){for(k=M.length;k--;M[k]*=P);for(M[0]+=q.indexOf(N.charAt(j++)),L=0;L<M.length;L++)M[L]>U-1&&(M[L+1]==null&&(M[L+1]=0),M[L+1]+=M[L]/U|0,M[L]%=U)}return M.reverse()}return function(N,P,U,q,L){var M,k,j,D,z,J,V,re,ue=N.indexOf("."),I=u,X=f;for(ue>=0&&(D=O,O=0,N=N.replace(".",""),re=new x(P),J=re.pow(N.length-ue),O=D,re.c=A(Qr(js(J.c),J.e,"0"),10,U,w),re.e=re.c.length),V=A(N,P,U,L?(M=R,w):(M=w,R)),j=D=V.length;V[--D]==0;V.pop());if(!V[0])return M.charAt(0);if(ue<0?--j:(J.c=V,J.e=j,J.s=q,J=t(J,re,I,X,U),V=J.c,z=J.r,j=J.e),k=j+I+1,ue=V[k],D=U/2,z=z||k<0||V[k+1]!=null,z=X<4?(ue!=null||z)&&(X==0||X==(J.s<0?3:2)):ue>D||ue==D&&(X==4||z||X==6&&V[k-1]&1||X==(J.s<0?8:7)),k<1||!V[0])N=z?Qr(M.charAt(1),-I,M.charAt(0)):M.charAt(0);else{if(V.length=k,z)for(--U;++V[--k]>U;)V[k]=0,k||(++j,V=[1].concat(V));for(D=V.length;!V[--D];);for(ue=0,N="";ue<=D;N+=M.charAt(V[ue++]));N=Qr(N,j,M.charAt(0))}return N}})(),t=(function(){function w(P,U,q){var L,M,k,j,D=0,z=P.length,J=U%Ka,V=U/Ka|0;for(P=P.slice();z--;)k=P[z]%Ka,j=P[z]/Ka|0,L=V*k+j*J,M=J*k+L%Ka*Ka+D,D=(M/q|0)+(L/Ka|0)+V*j,P[z]=M%q;return D&&(P=[D].concat(P)),P}function A(P,U,q,L){var M,k;if(q!=L)k=q>L?1:-1;else for(M=k=0;M<q;M++)if(P[M]!=U[M]){k=P[M]>U[M]?1:-1;break}return k}function N(P,U,q,L){for(var M=0;q--;)P[q]-=M,M=P[q]<U[q]?1:0,P[q]=M*L+P[q]-U[q];for(;!P[0]&&P.length>1;P.splice(0,1));}return function(P,U,q,L,M){var k,j,D,z,J,V,re,ue,I,X,oe,he,Te,Oe,Ae,be,_e,Ve=P.s==U.s?1:-1,at=P.c,G=U.c;if(!at||!at[0]||!G||!G[0])return new x(!P.s||!U.s||(at?G&&at[0]==G[0]:!G)?NaN:at&&at[0]==0||!G?Ve*0:Ve/0);for(ue=new x(Ve),I=ue.c=[],j=P.e-U.e,Ve=q+j+1,M||(M=Ys,j=Ds(P.e/Ze)-Ds(U.e/Ze),Ve=Ve/Ze|0),D=0;G[D]==(at[D]||0);D++);if(G[D]>(at[D]||0)&&j--,Ve<0)I.push(1),z=!0;else{for(Oe=at.length,be=G.length,D=0,Ve+=2,J=Ms(M/(G[0]+1)),J>1&&(G=w(G,J,M),at=w(at,J,M),be=G.length,Oe=at.length),Te=be,X=at.slice(0,be),oe=X.length;oe<be;X[oe++]=0);_e=G.slice(),_e=[0].concat(_e),Ae=G[0],G[1]>=M/2&&Ae++;do{if(J=0,k=A(G,X,be,oe),k<0){if(he=X[0],be!=oe&&(he=he*M+(X[1]||0)),J=Ms(he/Ae),J>1)for(J>=M&&(J=M-1),V=w(G,J,M),re=V.length,oe=X.length;A(V,X,re,oe)==1;)J--,N(V,be<re?_e:G,re,M),re=V.length,k=1;else J==0&&(k=J=1),V=G.slice(),re=V.length;if(re<oe&&(V=[0].concat(V)),N(X,V,oe,M),oe=X.length,k==-1)for(;A(G,X,be,oe)<1;)J++,N(X,be<oe?_e:G,oe,M),oe=X.length}else k===0&&(J++,X=[0]);I[D++]=J,X[0]?X[oe++]=at[Te]||0:(X=[at[Te]],oe=1)}while((Te++<Oe||X[0]!=null)&&Ve--);z=X[0]!=null,I[0]||I.splice(0,1)}if(M==Ys){for(D=1,Ve=I[0];Ve>=10;Ve/=10,D++);F(ue,q+(ue.e=D+j*Ze-1)+1,L,z)}else ue.e=j,ue.r=+z;return ue}})();function W(w,A,N,P){var U,q,L,M,k;if(N==null?N=f:$t(N,0,8),!w.c)return w.toString();if(U=w.c[0],L=w.e,A==null)k=js(w.c),k=P==1||P==2&&(L<=p||L>=m)?ah(k,L):Qr(k,L,"0");else if(w=F(new x(w),A,N),q=w.e,k=js(w.c),M=k.length,P==1||P==2&&(A<=q||q<=p)){for(;M<A;k+="0",M++);k=ah(k,q)}else if(A-=L,k=Qr(k,q,"0"),q+1>M){if(--A>0)for(k+=".";A--;k+="0");}else if(A+=q-M,A>0)for(q+1==M&&(k+=".");A--;k+="0");return w.s<0&&U?"-"+k:k}function ce(w,A){for(var N,P,U=1,q=new x(w[0]);U<w.length;U++)P=new x(w[U]),(!P.s||(N=Zi(q,P))===A||N===0&&q.s===A)&&(q=P);return q}function ge(w,A,N){for(var P=1,U=A.length;!A[--U];A.pop());for(U=A[0];U>=10;U/=10,P++);return(N=P+N*Ze-1)>y?w.c=w.e=null:N<g?w.c=[w.e=0]:(w.e=N,w.c=A),w}r=(function(){var w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,A=/^([^.]+)\.$/,N=/^\.([^.]+)$/,P=/^-?(Infinity|NaN)$/,U=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(q,L,M,k){var j,D=M?L:L.replace(U,"");if(P.test(D))q.s=isNaN(D)?null:D<0?-1:1;else{if(!M&&(D=D.replace(w,function(z,J,V){return j=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!k||k==j?J:z}),k&&(j=k,D=D.replace(A,"$1").replace(N,"0.$1")),L!=D))return new x(D,j);if(x.DEBUG)throw Error(ns+"Not a"+(k?" base "+k:"")+" number: "+L);q.s=null}q.c=q.e=null}})();function F(w,A,N,P){var U,q,L,M,k,j,D,z=w.c,J=Ay;if(z){e:{for(U=1,M=z[0];M>=10;M/=10,U++);if(q=A-U,q<0)q+=Ze,L=A,k=z[j=0],D=Ms(k/J[U-L-1]%10);else if(j=_y((q+1)/Ze),j>=z.length)if(P){for(;z.length<=j;z.push(0));k=D=0,U=1,q%=Ze,L=q-Ze+1}else break e;else{for(k=M=z[j],U=1;M>=10;M/=10,U++);q%=Ze,L=q-Ze+U,D=L<0?0:Ms(k/J[U-L-1]%10)}if(P=P||A<0||z[j+1]!=null||(L<0?k:k%J[U-L-1]),P=N<4?(D||P)&&(N==0||N==(w.s<0?3:2)):D>5||D==5&&(N==4||P||N==6&&(q>0?L>0?k/J[U-L]:0:z[j-1])%10&1||N==(w.s<0?8:7)),A<1||!z[0])return z.length=0,P?(A-=w.e+1,z[0]=J[(Ze-A%Ze)%Ze],w.e=-A||0):z[0]=w.e=0,w;if(q==0?(z.length=j,M=1,j--):(z.length=j+1,M=J[Ze-q],z[j]=L>0?Ms(k/J[U-L]%J[L])*M:0),P)for(;;)if(j==0){for(q=1,L=z[0];L>=10;L/=10,q++);for(L=z[0]+=M,M=1;L>=10;L/=10,M++);q!=M&&(w.e++,z[0]==Ys&&(z[0]=1));break}else{if(z[j]+=M,z[j]!=Ys)break;z[j--]=0,M=1}for(q=z.length;z[--q]===0;z.pop());}w.e>y?w.c=w.e=null:w.e<g&&(w.c=[w.e=0])}return w}function K(w){var A,N=w.e;return N===null?w.toString():(A=js(w.c),A=N<=p||N>=m?ah(A,N):Qr(A,N,"0"),w.s<0?"-"+A:A)}return i.absoluteValue=i.abs=function(){var w=new x(this);return w.s<0&&(w.s=1),w},i.comparedTo=function(w,A){return Zi(this,new x(w,A))},i.decimalPlaces=i.dp=function(w,A){var N,P,U,q=this;if(w!=null)return $t(w,0,bn),A==null?A=f:$t(A,0,8),F(new x(q),w+q.e+1,A);if(!(N=q.c))return null;if(P=((U=N.length-1)-Ds(this.e/Ze))*Ze,U=N[U])for(;U%10==0;U/=10,P--);return P<0&&(P=0),P},i.dividedBy=i.div=function(w,A){return t(this,new x(w,A),u,f)},i.dividedToIntegerBy=i.idiv=function(w,A){return t(this,new x(w,A),0,1)},i.exponentiatedBy=i.pow=function(w,A){var N,P,U,q,L,M,k,j,D,z=this;if(w=new x(w),w.c&&!w.isInteger())throw Error(ns+"Exponent not an integer: "+K(w));if(A!=null&&(A=new x(A)),M=w.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!w.c||!w.c[0])return D=new x(Math.pow(+K(z),M?w.s*(2-rh(w)):+K(w))),A?D.mod(A):D;if(k=w.s<0,A){if(A.c?!A.c[0]:!A.s)return new x(NaN);P=!k&&z.isInteger()&&A.isInteger(),P&&(z=z.mod(A))}else{if(w.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||M&&z.c[1]>=24e7:z.c[0]<8e13||M&&z.c[0]<=9999975e7)))return q=z.s<0&&rh(w)?-0:0,z.e>-1&&(q=1/q),new x(k?1/q:q);O&&(q=_y(O/Ze+2))}for(M?(N=new x(.5),k&&(w.s=1),j=rh(w)):(U=Math.abs(+K(w)),j=U%2),D=new x(c);;){if(j){if(D=D.times(z),!D.c)break;q?D.c.length>q&&(D.c.length=q):P&&(D=D.mod(A))}if(U){if(U=Ms(U/2),U===0)break;j=U%2}else if(w=w.times(N),F(w,w.e+1,1),w.e>14)j=rh(w);else{if(U=+K(w),U===0)break;j=U%2}z=z.times(z),q?z.c&&z.c.length>q&&(z.c.length=q):P&&(z=z.mod(A))}return P?D:(k&&(D=c.div(D)),A?D.mod(A):q?F(D,O,f,L):D)},i.integerValue=function(w){var A=new x(this);return w==null?w=f:$t(w,0,8),F(A,A.e+1,w)},i.isEqualTo=i.eq=function(w,A){return Zi(this,new x(w,A))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(w,A){return Zi(this,new x(w,A))>0},i.isGreaterThanOrEqualTo=i.gte=function(w,A){return(A=Zi(this,new x(w,A)))===1||A===0},i.isInteger=function(){return!!this.c&&Ds(this.e/Ze)>this.c.length-2},i.isLessThan=i.lt=function(w,A){return Zi(this,new x(w,A))<0},i.isLessThanOrEqualTo=i.lte=function(w,A){return(A=Zi(this,new x(w,A)))===-1||A===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(w,A){var N,P,U,q,L=this,M=L.s;if(w=new x(w,A),A=w.s,!M||!A)return new x(NaN);if(M!=A)return w.s=-A,L.plus(w);var k=L.e/Ze,j=w.e/Ze,D=L.c,z=w.c;if(!k||!j){if(!D||!z)return D?(w.s=-A,w):new x(z?L:NaN);if(!D[0]||!z[0])return z[0]?(w.s=-A,w):new x(D[0]?L:f==3?-0:0)}if(k=Ds(k),j=Ds(j),D=D.slice(),M=k-j){for((q=M<0)?(M=-M,U=D):(j=k,U=z),U.reverse(),A=M;A--;U.push(0));U.reverse()}else for(P=(q=(M=D.length)<(A=z.length))?M:A,M=A=0;A<P;A++)if(D[A]!=z[A]){q=D[A]<z[A];break}if(q&&(U=D,D=z,z=U,w.s=-w.s),A=(P=z.length)-(N=D.length),A>0)for(;A--;D[N++]=0);for(A=Ys-1;P>M;){if(D[--P]<z[P]){for(N=P;N&&!D[--N];D[N]=A);--D[N],D[P]+=Ys}D[P]-=z[P]}for(;D[0]==0;D.splice(0,1),--j);return D[0]?ge(w,D,j):(w.s=f==3?-1:1,w.c=[w.e=0],w)},i.modulo=i.mod=function(w,A){var N,P,U=this;return w=new x(w,A),!U.c||!w.s||w.c&&!w.c[0]?new x(NaN):!w.c||U.c&&!U.c[0]?new x(U):(S==9?(P=w.s,w.s=1,N=t(U,w,0,3),w.s=P,N.s*=P):N=t(U,w,0,S),w=U.minus(N.times(w)),!w.c[0]&&S==1&&(w.s=U.s),w)},i.multipliedBy=i.times=function(w,A){var N,P,U,q,L,M,k,j,D,z,J,V,re,ue,I,X=this,oe=X.c,he=(w=new x(w,A)).c;if(!oe||!he||!oe[0]||!he[0])return!X.s||!w.s||oe&&!oe[0]&&!he||he&&!he[0]&&!oe?w.c=w.e=w.s=null:(w.s*=X.s,!oe||!he?w.c=w.e=null:(w.c=[0],w.e=0)),w;for(P=Ds(X.e/Ze)+Ds(w.e/Ze),w.s*=X.s,k=oe.length,z=he.length,k<z&&(re=oe,oe=he,he=re,U=k,k=z,z=U),U=k+z,re=[];U--;re.push(0));for(ue=Ys,I=Ka,U=z;--U>=0;){for(N=0,J=he[U]%I,V=he[U]/I|0,L=k,q=U+L;q>U;)j=oe[--L]%I,D=oe[L]/I|0,M=V*j+D*J,j=J*j+M%I*I+re[q]+N,N=(j/ue|0)+(M/I|0)+V*D,re[q--]=j%ue;re[q]=N}return N?++P:re.splice(0,1),ge(w,re,P)},i.negated=function(){var w=new x(this);return w.s=-w.s||null,w},i.plus=function(w,A){var N,P=this,U=P.s;if(w=new x(w,A),A=w.s,!U||!A)return new x(NaN);if(U!=A)return w.s=-A,P.minus(w);var q=P.e/Ze,L=w.e/Ze,M=P.c,k=w.c;if(!q||!L){if(!M||!k)return new x(U/0);if(!M[0]||!k[0])return k[0]?w:new x(M[0]?P:U*0)}if(q=Ds(q),L=Ds(L),M=M.slice(),U=q-L){for(U>0?(L=q,N=k):(U=-U,N=M),N.reverse();U--;N.push(0));N.reverse()}for(U=M.length,A=k.length,U-A<0&&(N=k,k=M,M=N,A=U),U=0;A;)U=(M[--A]=M[A]+k[A]+U)/Ys|0,M[A]=Ys===M[A]?0:M[A]%Ys;return U&&(M=[U].concat(M),++L),ge(w,M,L)},i.precision=i.sd=function(w,A){var N,P,U,q=this;if(w!=null&&w!==!!w)return $t(w,1,bn),A==null?A=f:$t(A,0,8),F(new x(q),w,A);if(!(N=q.c))return null;if(U=N.length-1,P=U*Ze+1,U=N[U]){for(;U%10==0;U/=10,P--);for(U=N[0];U>=10;U/=10,P++);}return w&&q.e+1>P&&(P=q.e+1),P},i.shiftedBy=function(w){return $t(w,-ky,ky),this.times("1e"+w)},i.squareRoot=i.sqrt=function(){var w,A,N,P,U,q=this,L=q.c,M=q.s,k=q.e,j=u+4,D=new x("0.5");if(M!==1||!L||!L[0])return new x(!M||M<0&&(!L||L[0])?NaN:L?q:1/0);if(M=Math.sqrt(+K(q)),M==0||M==1/0?(A=js(L),(A.length+k)%2==0&&(A+="0"),M=Math.sqrt(+A),k=Ds((k+1)/2)-(k<0||k%2),M==1/0?A="5e"+k:(A=M.toExponential(),A=A.slice(0,A.indexOf("e")+1)+k),N=new x(A)):N=new x(M+""),N.c[0]){for(k=N.e,M=k+j,M<3&&(M=0);;)if(U=N,N=D.times(U.plus(t(q,U,j,1))),js(U.c).slice(0,M)===(A=js(N.c)).slice(0,M))if(N.e<k&&--M,A=A.slice(M-3,M+1),A=="9999"||!P&&A=="4999"){if(!P&&(F(U,U.e+u+2,0),U.times(U).eq(q))){N=U;break}j+=4,M+=4,P=1}else{(!+A||!+A.slice(1)&&A.charAt(0)=="5")&&(F(N,N.e+u+2,1),w=!N.times(N).eq(q));break}}return F(N,N.e+u+1,f,w)},i.toExponential=function(w,A){return w!=null&&($t(w,0,bn),w++),W(this,w,A,1)},i.toFixed=function(w,A){return w!=null&&($t(w,0,bn),w=w+this.e+1),W(this,w,A)},i.toFormat=function(w,A,N){var P,U=this;if(N==null)w!=null&&A&&typeof A=="object"?(N=A,A=null):w&&typeof w=="object"?(N=w,w=A=null):N=C;else if(typeof N!="object")throw Error(ns+"Argument not an object: "+N);if(P=U.toFixed(w,A),U.c){var q,L=P.split("."),M=+N.groupSize,k=+N.secondaryGroupSize,j=N.groupSeparator||"",D=L[0],z=L[1],J=U.s<0,V=J?D.slice(1):D,re=V.length;if(k&&(q=M,M=k,k=q,re-=q),M>0&&re>0){for(q=re%M||M,D=V.substr(0,q);q<re;q+=M)D+=j+V.substr(q,M);k>0&&(D+=j+V.slice(q)),J&&(D="-"+D)}P=z?D+(N.decimalSeparator||"")+((k=+N.fractionGroupSize)?z.replace(new RegExp("\\d{"+k+"}\\B","g"),"$&"+(N.fractionGroupSeparator||"")):z):D}return(N.prefix||"")+P+(N.suffix||"")},i.toFraction=function(w){var A,N,P,U,q,L,M,k,j,D,z,J,V=this,re=V.c;if(w!=null&&(M=new x(w),!M.isInteger()&&(M.c||M.s!==1)||M.lt(c)))throw Error(ns+"Argument "+(M.isInteger()?"out of range: ":"not an integer: ")+K(M));if(!re)return new x(V);for(A=new x(c),j=N=new x(c),P=k=new x(c),J=js(re),q=A.e=J.length-V.e-1,A.c[0]=Ay[(L=q%Ze)<0?Ze+L:L],w=!w||M.comparedTo(A)>0?q>0?A:j:M,L=y,y=1/0,M=new x(J),k.c[0]=0;D=t(M,A,0,1),U=N.plus(D.times(P)),U.comparedTo(w)!=1;)N=P,P=U,j=k.plus(D.times(U=j)),k=U,A=M.minus(D.times(U=A)),M=U;return U=t(w.minus(N),P,0,1),k=k.plus(U.times(j)),N=N.plus(U.times(P)),k.s=j.s=V.s,q=q*2,z=t(j,P,q,f).minus(V).abs().comparedTo(t(k,N,q,f).minus(V).abs())<1?[j,P]:[k,N],y=L,z},i.toNumber=function(){return+K(this)},i.toPrecision=function(w,A){return w!=null&&$t(w,1,bn),W(this,w,A,2)},i.toString=function(w){var A,N=this,P=N.s,U=N.e;return U===null?P?(A="Infinity",P<0&&(A="-"+A)):A="NaN":(w==null?A=U<=p||U>=m?ah(js(N.c),U):Qr(js(N.c),U,"0"):w===10&&$?(N=F(new x(N),u+U+1,f),A=Qr(js(N.c),N.e,"0")):($t(w,2,R.length,"Base"),A=s(Qr(js(N.c),U,"0"),10,w,P,!0)),P<0&&N.c[0]&&(A="-"+A)),A},i.valueOf=i.toJSON=function(){return K(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&x.set(e),x}function Ds(e){var t=e|0;return e>0||e===t?t:t-1}function js(e){for(var t,s,r=1,i=e.length,c=e[0]+"";r<i;){for(t=e[r++]+"",s=Ze-t.length;s--;t="0"+t);c+=t}for(i=c.length;c.charCodeAt(--i)===48;);return c.slice(0,i+1||1)}function Zi(e,t){var s,r,i=e.c,c=t.c,u=e.s,f=t.s,p=e.e,m=t.e;if(!u||!f)return null;if(s=i&&!i[0],r=c&&!c[0],s||r)return s?r?0:-f:u;if(u!=f)return u;if(s=u<0,r=p==m,!i||!c)return r?0:!i^s?1:-1;if(!r)return p>m^s?1:-1;for(f=(p=i.length)<(m=c.length)?p:m,u=0;u<f;u++)if(i[u]!=c[u])return i[u]>c[u]^s?1:-1;return p==m?0:p>m^s?1:-1}function $t(e,t,s,r){if(e<t||e>s||e!==Ms(e))throw Error(ns+(r||"Argument")+(typeof e=="number"?e<t||e>s?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function rh(e){var t=e.c.length-1;return Ds(e.e/Ze)==t&&e.c[t]%2!=0}function ah(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Qr(e,t,s){var r,i;if(t<0){for(i=s+".";++t;i+=s);e=i+e}else if(r=e.length,++t>r){for(i=s,t-=r;--t;i+=s);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}L3();const CH="2.0.12",z3={version:CH},IH=z3.version,RH=()=>{if(typeof process<"u"&&process.versions&&process.versions.node){const e=process.version;return`Node.js ${e.startsWith("v")?e.substring(1):e}`}return"Node/Unknown"},jH=()=>{let e="";return typeof process<"u"&&process.versions&&process.versions.node&&(e=`lending/${IH} (${RH()})`),e},h4=jH(),MH="https://fullnode.mainnet.sui.io:443";let Oy;function DH(){return Oy||(Oy=new lb({network:"mainnet",transport:new Qv({baseUrl:MH})})),Oy}function UH(e,t="mainnet"){return DH()}const BH=16*1024;function Wb(e){return e.replace(/^0x/i,"")}function p4(e){const t=Wb(e),s=new Uint8Array(t.length/2);for(let r=0;r<s.length;r+=1)s[r]=parseInt(t.slice(r*2,r*2+2),16);return s}function LH(e,t){return(e[t]<<8)+e[t+1]}function m4(e){return H.vector(H.U8).serialize(Array.from(e),{maxSize:BH})}function g4(e,t){return{type:e,bcs:t}}function zH(e){return H.vector(H.U8).serialize(Array.from(new TextEncoder().encode(e))).toBytes()}function $H(e){return H.struct("PriceIdentifier",{bytes:H.vector(H.U8)}).serialize({bytes:Array.from(e)}).toBytes()}function VH(e){const t=[];let s=0,r=0;for(let i=0;i<e.length;i+=1){const c=e[i];c==="<"?s+=1:c===">"?s-=1:c===","&&s===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}function PH(e){const t=e.indexOf("::table::Table"),s=e.indexOf("<",t),r=e.lastIndexOf(">"),i="::price_identifier::PriceIdentifier";if(t<0||s<0||r<=s)throw new Error(`Unexpected Pyth price table type: ${e}`);const[c,u]=VH(e.slice(s+1,r));if(!c?.endsWith(i)||!u?.endsWith("::object::ID"))throw new Error(`Unexpected Pyth price table type arguments: ${e}`);return c.slice(0,-i.length)}function GH(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}class $3{constructor(t,s){this.endpoint=t.replace(/\/$/,""),this.timeout=s?.timeout??1e4}async getLatestPriceFeeds(t){return(await this.get("/api/latest_price_feeds",t)).map(s=>({id:s.id,getPriceUnchecked:()=>({price:s.price.price,conf:s.price.conf,expo:s.price.expo,publishTime:s.price.publish_time})}))}async getPriceFeedsUpdateData(t){const s=await this.get("/v2/updates/price/latest",t,{encoding:"base64",parsed:"false"}),r=s.binary?.encoding,i=s.binary?.data??[];if(r&&r!=="base64")throw new Error(`Unsupported Hermes price update encoding: ${r}`);if(i.length===0)throw new Error("Hermes price update response did not include binary update data");return i.map(GH)}async get(t,s,r){const i=new AbortController,c=setTimeout(()=>i.abort(),this.timeout),u=new URL(`${this.endpoint}${t}`);for(const[f,p]of Object.entries(r??{}))u.searchParams.set(f,p);for(const f of s)u.searchParams.append("ids[]",Wb(f));try{const f=await fetch(u,{signal:i.signal});if(!f.ok)throw new Error(`Hermes request failed: ${f.status} ${f.statusText}`);return await f.json()}finally{clearTimeout(c)}}}class FH{constructor(t,s,r){this.provider=t,this.pythStateId=s,this.wormholeStateId=r,this.priceFeedObjectIdCache=new Map}getCoreProvider(){const t=this.provider.core;return t&&typeof t.getObject=="function"&&typeof t.getDynamicObjectField=="function"&&typeof t.getDynamicField=="function"?t:null}async getMoveObjectJson(t){const s=this.getCoreProvider();if(s){const i=await s.getObject({objectId:t,include:{json:!0}});return i.object?{objectId:i.object.objectId,type:i.object.type,fields:i.object.json}:null}if(!this.provider.getObject)throw new Error("Sui Pyth provider does not support getObject");const r=await this.provider.getObject({id:t,options:{showContent:!0}});return!r.data||!r.data.content||r.data.content.dataType!=="moveObject"?null:{objectId:r.data.objectId,type:r.data.type,fields:r.data.content.fields}}async getDynamicMoveObjectJson(t,s){const r=this.getCoreProvider();if(r){const c=await r.getDynamicObjectField({parentId:t,name:s,include:{json:!0}});return c.object?{objectId:c.object.objectId,type:c.object.type,fields:c.object.json}:null}if(!this.provider.getDynamicFieldObject)throw new Error("Sui Pyth provider does not support getDynamicFieldObject");const i=await this.provider.getDynamicFieldObject({parentId:t,name:s});return i.data?i.data.content?i.data.content.dataType!=="moveObject"?null:{objectId:i.data.objectId,type:i.data.type,fields:i.data.content.fields}:{objectId:i.data.objectId,type:i.data.type,fields:void 0}:null}async updatePriceFeeds(t,s,r,i){const c=await this.getPythPackageId(),u=await this.verifyVaasAndGetHotPotato(t,s,c),f=await this.getBaseUpdateFee(),p=t.splitCoins(i?.feeCoin??t.gas,r.map(()=>t.pure.u64(f)));return this.executePriceFeedUpdates(t,c,r,u,p)}async getBaseUpdateFee(){if(this.baseUpdateFee===void 0){const t=await this.getMoveObjectJson(this.pythStateId);if(!t?.fields)throw new Error("Unable to fetch pyth state object");this.baseUpdateFee=Number(t.fields.base_update_fee)}return this.baseUpdateFee}async getPackageId(t){const s=await this.getMoveObjectJson(t);if(s?.fields){const r=s.fields;if("upgrade_cap"in r){const i=r.upgrade_cap,c=i?.package??i?.fields?.package;if(c)return c}}throw new Error(`Cannot fetch package id for object ${t}`)}async verifyVaas(t,s){const r=await this.getWormholePackageId();return t.map(i=>{const[c]=s.moveCall({target:`${r}::vaa::parse_and_verify`,arguments:[s.object(this.wormholeStateId),s.pure(m4(i)),s.object(ch)]});return c})}async verifyVaasAndGetHotPotato(t,s,r){if(s.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const i=this.extractVaaBytesFromAccumulatorMessage(s[0]),[c]=await this.verifyVaas([i],t),[u]=t.moveCall({target:`${r}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(m4(s[0])),c,t.object(ch)]});return u}async executePriceFeedUpdates(t,s,r,i,c){const u=[];for(const[f,p]of r.entries()){const m=await this.getPriceFeedObjectId(p);if(!m)throw new Error(`Price feed ${p} not found, please create it first`);u.push(m),[i]=t.moveCall({target:`${s}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),i,t.object(m),c[f],t.object(ch)]})}return t.moveCall({target:`${s}::hot_potato_vector::destroy`,arguments:[i],typeArguments:[`${s}::price_info::PriceInfo`]}),u}async getWormholePackageId(){return this.wormholePackageId||(this.wormholePackageId=await this.getPackageId(this.wormholeStateId)),this.wormholePackageId}async getPythPackageId(){return this.pythPackageId||(this.pythPackageId=await this.getPackageId(this.pythStateId)),this.pythPackageId}async getPriceFeedObjectId(t){const s=Wb(t);if(!this.priceFeedObjectIdCache.has(s)){const{id:r,fieldType:i}=await this.getPriceTableInfo(),c=`${i}::price_identifier::PriceIdentifier`,u=this.getCoreProvider();if(u){const{dynamicField:f}=await u.getDynamicField({parentId:r,name:g4(c,$H(p4(s)))}),p=f?.value?.bcs;this.priceFeedObjectIdCache.set(s,p&&p.length===32?H.Address.parse(Uint8Array.from(p)):void 0)}else{const f=await this.getDynamicMoveObjectJson(r,{type:c,value:{bytes:Array.from(p4(s))}});f?.fields?this.priceFeedObjectIdCache.set(s,f.fields.value):this.priceFeedObjectIdCache.set(s,void 0)}}return this.priceFeedObjectIdCache.get(s)}async getPriceTableInfo(){if(!this.priceTableInfo){const t=this.getCoreProvider()?g4("vector<u8>",zH("price_info")):{type:"vector<u8>",value:"price_info"},s=await this.getDynamicMoveObjectJson(this.pythStateId,t);if(!s?.type)throw new Error("Price Table not found, contract may not be initialized");this.priceTableInfo={id:s.objectId,fieldType:PH(s.type)}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const s=7+t[6]+1,r=LH(t,s),i=s+2;return t.subarray(i,i+r)}}const HH="https://open-api.naviprotocol.io/api";let qH={},ZH=0;function YH(e){return e.replace(/\/+$/,"")}function y4(){return ZH}function V3(e){const t=e?.services?.naviOpenApi??qH.services?.naviOpenApi;return{baseUrl:YH(t?.baseUrl??HH),headers:t?.headers}}function WH(e,t){const s=V3(t),r=e.startsWith("/")?e:`/${e}`;return`${s.baseUrl}${r}`}function XH(e){if(e instanceof Headers){const t={};return e.forEach((s,r)=>{t[r]=s}),t}return Array.isArray(e)?Object.fromEntries(e):e}function JH(e,t){return{...XH(e),...t?.headers??{}}}const P3=UH();function KH(e){return{json:!!e?.showContent,display:!!e?.showDisplay,previousTransaction:!!e?.showPreviousTransaction,objectBcs:!!e?.showBcs}}function QH(e){return!e||e instanceof Error?{error:e instanceof Error?{code:"notFound",error:e.message}:void 0}:{data:{objectId:e.objectId,version:e.version,digest:e.digest,type:e.type,owner:e.owner,previousTransaction:e.previousTransaction,content:e.json===void 0?void 0:{dataType:"moveObject",type:e.type,fields:e.json},display:e.display}}}async function eq(e,t){const s=e?.core;if(typeof s?.getObjects!="function")throw new Error("multiGetSuiObjects requires a Sui v2 Core-capable client");const{objects:r}=await s.getObjects({objectIds:t.ids,include:KH(t.options)});return r.map(QH)}function G3(e){const t=[];let s=!1;return e.forEach((r,i)=>{const c=i===e.length-1;if(typeof r=="object"&&r!==null&&c){const{client:u,disableCache:f,cacheTime:p,...m}=r;m.__naviSdkServiceConfigVersion=y4(),t.push(m),s=!0}else t.push(r)}),s||t.push({__naviSdkServiceConfigVersion:y4()}),JSON.stringify(t)}function tq(e){const t={};return(...s)=>{const r=G3(s);return t[r]||(t[r]=e(...s).finally(()=>{delete t[r]})),t[r]}}function nq(e){let t={};return(...s)=>{const r=s[s.length-1],i=G3(s),c=t[i];return!r?.disableCache&&typeof c?.data<"u"&&(typeof r?.cacheTime>"u"||r.cacheTime>Date.now()-c.cacheAt)?Promise.resolve(c.data):e(...s).then(u=>(t[i]={data:u,cacheAt:Date.now()},u))}}new $3("https://hermes.pyth.network",{timeout:2e4});const sq=h4?{"User-Agent":h4}:{},rq="main",aq={main:{id:0,key:"main",name:"Main Market"},ember:{id:1,key:"ember",name:"eACRED / USDC Market"},rwa:{id:2,key:"rwa",name:"Matrixdock Market"},"sui-eco":{id:3,key:"sui-eco",name:"Sui Eco Market"},"sui-usdc":{id:4,key:"sui-usdc",name:"SUI / USDC Market"},"wbtc-usdc":{id:5,key:"wbtc-usdc",name:"WBTC / USDC Market"},"xbtc-usdc":{id:6,key:"xbtc-usdc",name:"xBTC / USDC Market"},"vsui-usdc":{id:7,key:"vsui-usdc",name:"vSUI / USDC Market"},"vsui-sui":{id:8,key:"vsui-sui",name:"vSUI / SUI Market"},"hasui-sui":{id:9,key:"hasui-sui",name:"haSUI / SUI Market"},"high-usdc":{id:10,key:"high-usdc",name:"HIGH / USDC Market"}},iq=e=>{const t=Object.values(aq).find(s=>typeof e=="number"?s.id===e:typeof e=="string"?s.key===e:s.id===e.id);if(!t)throw new Error("Market not found");return t},Xb=nq(tq(async e=>{const t=iq(e?.market||rq),s=V3(e),r=WH(`/navi/config?env=${e?.env||"prod"}&sdk=${z3.version}&market=${t.key}`,e);return(await fetch(r,{headers:JH(sq,s)}).then(i=>i.json())).data})),Jb=1e3*60*5,v4=new Map,oq=e=>{const t=e??"https://hermes.pyth.network";let s=v4.get(t);return s||(s=new $3(t,{timeout:1e4}),v4.set(t,s)),s};async function cq(e,t){const s=[],r=t?.client??P3,i=e.map(u=>u.priceInfoObject),c=await eq(r,{ids:Array.from(new Set(i)),options:{showContent:!0}});for(const u of c){const f=u.data;if(!f||!f.content||f.content.dataType!=="moveObject"){console.warn(`fetched object ${f?.objectId} datatype should be moveObject`);continue}const p=e.find(C=>C.priceInfoObject==f.objectId);if(!p){console.warn(`unable to find pyth info from array, priceInfoObject: ${f.objectId}`);continue}const m=f.content.fields?.price_info?.price_feed?.price,g=m?.price;if(!g){console.warn(`unexpected pyth price struct, priceInfoObject: ${f.objectId}`);continue}const{magnitude:y,negative:b}=g,S=m.conf,O=m.timestamp;s.push({priceFeedId:p.priceFeedId,priceInfoObject:p.priceInfoObject,price:b?"-"+y:y,conf:S,publishTime:Number(O),expiration:p.expiration})}return s}async function lq(e,t){try{const s=[],r=await cq(e,t);if(!r)return s;const i=Math.floor(new Date().valueOf()/1e3);for(const c of r){if(c.publishTime>i){console.warn(`pyth price feed is invalid, id: ${c.priceFeedId}, publish time: ${c.publishTime}, current timestamp: ${i}`);continue}const u=c.expiration||60;i-c.publishTime>u&&(console.info(`stale price feed, id: ${c.priceFeedId}, publish time: ${c.publishTime}, current timestamp: ${i}`),s.push(c.priceFeedId))}return s}catch(s){throw new Error(`failed to get pyth stale price feed id, msg: ${s.message}`)}}async function uq(e,t,s){const r=s?.client??P3,i=await Xb({...s,cacheTime:Jb});try{const c=await oq(i.oracle.hermesEndpoint).getPriceFeedsUpdateData(t);return await new FH(r,i.oracle.pythStateId,i.oracle.wormholeStateId).updatePriceFeeds(e,c,t,{feeCoin:s?.pythFeeCoin})}catch(c){throw new Error(`failed to update pyth price feeds, msg: ${c.message}`)}}async function dq(e,t,s){const r=await Xb({...s,cacheTime:Jb});if(s?.updatePythPriceFeeds){const i=t.filter(u=>!!u.pythPriceFeedId&&!!u.pythPriceInfoObject).map(u=>({priceFeedId:u.pythPriceFeedId,priceInfoObject:u.pythPriceInfoObject,expiration:30})),c=await lq(i,s);c.length>0&&await uq(e,c,s)}for(const i of t)e.moveCall({target:`${r.oracle.packageId}::oracle_pro::${r.oracle.updateFunction??"update_single_price_v2"}`,arguments:[e.object("0x6"),e.object(r.oracle.oracleConfig),e.object(r.oracle.priceOracle),e.object(r.oracle.supraOracleHolder),e.object(i.pythPriceInfoObject),e.object(r.oracle.switchboardAggregator),e.pure.address(i.feedId)]});return e}async function fq(e){return(await Xb({...e,cacheTime:Jb})).oracle.feeds}const hq="0x6",pq="0x5";async function Kb(e,t){if(t.network!=="mainnet")return;const s=Object.keys(t.protocols.navi.reserves),r=(await fq({env:"prod"})).filter(i=>s.some(c=>At(c,i.coinType)));await dq(e,r,{env:"prod",client:Ht(t),updatePythPriceFeeds:!0})}async function yp(e,t,s){const r=t.protocols.navi,i=Object.entries(r.reserves),c=new Zn;c.setSender(ye("0x1"));for(const[,g]of i)for(const y of["user_collateral_balance","user_loan_balance"])c.moveCall({target:`${r.publishedAt}::logic::${y}`,arguments:[c.object(r.storageId),c.pure.u8(g.assetId),c.pure.address(s)]});const u=await e.simulateTransaction({transaction:c,include:{commandResults:!0}}),f=u.$kind==="Transaction"?u.Transaction:u.FailedTransaction;if(!f?.status.success)throw new Error(f?.status.error?.message??"Could not read the NAVI position");const p=g=>{const y=u.commandResults?.[g]?.returnValues?.[0]?.bcs;return y?H.u256().parse(y):"0"},m={collateral:{},debt:{}};return i.forEach(([g],y)=>{const b=p(2*y),S=p(2*y+1);b!=="0"&&(m.collateral[De(g)]=b),S!=="0"&&(m.debt[De(g)]=S)}),m}function Qb(e,t,s,r,i){const c=t.protocols.navi,u=[];for(const[f,p]of Object.entries(c.reserves)){const m=r.collateral[De(f)];if(!m)continue;const g=(BigInt(m)+BigInt(m)/1000n+1n).toString(),y=e.moveCall({target:`${c.publishedAt}::incentive_v3::withdraw_with_account_cap_v2`,typeArguments:[f],arguments:[e.object(hq),e.object(c.oracleId),e.object(c.storageId),e.object(p.poolId),e.pure.u8(p.assetId),e.pure.u64(g),e.object(c.incentiveV2Id),e.object(c.incentiveV3Id),s,e.object(pq)]});u.push(e.moveCall({target:"0x2::coin::from_balance",typeArguments:[f],arguments:[y]}))}u.length&&e.transferObjects(u,i)}const Wu=e=>!!e&&Object.keys(e.collateral).length>0&&Object.keys(e.debt).length===0;async function mq(e,t,s){const r=`${ye(t.protocols.navi.packageId)}::account::AccountCap`,i=[];let c=null;do{const u=await e.listOwnedObjects({owner:s,cursor:c,limit:50,include:{content:!0}});for(const f of u.objects){const p=ws(f.type);`${ye(p.address)}::${p.module}::${p.name}`===r&&f.content&&i.push({capId:f.objectId,user:YF(f.content)})}c=u.hasNextPage?u.cursor:null}while(c&&i.length<200);return i}const F3="0x2::allowance::RateLimit",e1="0x6",H3="0x3::staking_pool::StakedSui",Kp=e=>`0x2::balance::Balance<${e}>`;function q3(e,t,s,r,i){const c=t.publishedAt,u=t.packageId,f=e.object(e1),p=e.object(t.configId),m=(g,y)=>e.moveCall({target:`${c}::pass::add_policy`,typeArguments:[g],arguments:[s,p,y]});for(const g of r.transfers){const y=e.moveCall({target:`${c}::transfer_policy::new`,typeArguments:[g.coin],arguments:[e.pure.u64(g.perTransfer),e.pure.u64(g.daily),f]});for(const b of g.recipients)e.moveCall({target:`${c}::transfer_policy::add_recipient`,typeArguments:[g.coin],arguments:[y,e.pure.string(b.name),e.pure.address(b.address)]});m(`${u}::transfer_policy::TransferPolicy<${g.coin}>`,y)}for(const g of r.swaps)m(`${u}::swap_policy::SwapPolicy<${g.coinIn},${g.coinOut}>`,e.moveCall({target:`${c}::swap_policy::new`,typeArguments:[g.coinIn,g.coinOut],arguments:[e.pure.vector("address",g.pools),e.pure.u64(g.perTrade),e.pure.u64(g.daily),e.pure.u64(g.minPrice),f]}));for(const g of r.lending){const y=t.protocols.navi.reserves[g.coin];if(!y)throw new Error(`NAVI has no reserve for ${g.coin} in this deployment`);m(`${u}::lending_policy::LendingPolicy<${g.coin}>`,e.moveCall({target:`${c}::lending_policy::new`,typeArguments:[g.coin],arguments:[e.pure.id(y.poolId),e.pure.u8(y.assetId),e.pure.bool(g.allowBorrow),e.pure.u64(g.perAction),e.pure.u64(g.daily),e.pure.u256(zF(g.minHealthFactor)),f]}))}r.lending.length&&i&&e.moveCall({target:`${c}::pass::navi_open`,arguments:[s,p]}),r.staking&&m(`${u}::staking_policy::StakingPolicy`,e.moveCall({target:`${c}::staking_policy::new`,arguments:[e.pure.vector("address",r.staking.validators),e.pure.u64(r.staking.perStake),e.pure.u64(r.staking.daily),f]}))}function gq(e,t,s){e.moveCall({target:"0x2::balance::send_funds",typeArguments:[Lt],arguments:[e.balance({balance:t}),e.pure.address(s)]})}function yq(e,t,s,r,i){for(const[c,u]of Object.entries(s)){if(BigInt(u)<=0n)continue;const f=t.demoFaucet&&At(t.demoFaucet.coin,c)?t.demoFaucet:null;let p;if(f)p=e.moveCall({target:`${f.packageId}::usdc::mint`,arguments:[e.object(f.faucetId),e.pure.u64(u)]});else if(At(c,Lt))p=e.splitCoins(e.gas,[u])[0];else{const m=r[De(c)]??[];if(!m.length)throw new Error(`No ${c} coin objects to convert`);const[g,...y]=m.map(b=>e.objectRef(b));y.length&&e.mergeCoins(g,y),p=e.splitCoins(g,[u])[0]}e.moveCall({target:"0x2::coin::send_funds",typeArguments:[c],arguments:[p,e.pure.address(i)]})}}function vq(e,t){const s=e.moveCall({target:"0x2::allowance::periodic_rate_limit",arguments:[e.pure.u64(mp),e.pure.u256(t)]});return e.moveCall({target:"0x1::option::some",typeArguments:[F3],arguments:[s]})}function Z3(e,t,s){e.moveCall({target:"0x2::allowance::new",typeArguments:[Kp(Lt)],arguments:[e.pure.string(E3),e.pure.address(s),e.pure.option("u256",t.gasCap),e.pure.option("u64",null),e.pure.option("u64",t.expiresMs),vq(e,t.gasDaily)]})}function bq(e,t,s,r,i,c={}){const u=new Zn;u.setSender(s);const f=u.moveCall({target:`${e.publishedAt}::pass::create`,arguments:[u.object(e.configId),u.pure.string(t.name),u.pure.address(r),u.pure.u64(t.expiresMs),u.object(e1)]}),p=(m,g)=>Y3(u,e,f,t,r,m,g);for(const[m,g]of Object.entries(t.allowances))p(m,g);return Z3(u,t,r),q3(u,e,f,t.policy,!0),u.moveCall({target:`${e.publishedAt}::pass::share`,arguments:[f]}),yq(u,e,i,c,s),gq(u,t.gasAmount,r),u}function Y3(e,t,s,r,i,c,u){e.moveCall({target:`${t.publishedAt}::pass::issue`,typeArguments:[c],arguments:[s,e.object(t.configId),e.moveCall({target:"0x2::allowance::propose_for_app",typeArguments:[Kp(c),A3(t)],arguments:[e.pure.string(r.name),e.pure.address(i),e.pure.option("u256",u),e.pure.option("u64",null),e.pure.option("u64",r.expiresMs),e.moveCall({target:"0x1::option::none",typeArguments:[F3]})]})]})}function Nh(e,t,s,r){e.moveCall({target:"0x2::allowance::revoke",typeArguments:[Kp(t)],arguments:[e.object(s),e.object(r)]})}function W3(e,t,s,r){const i=t.publishedAt,c=t.packageId,u=f=>e.moveCall({target:`${i}::pass::remove_policy`,typeArguments:[f],arguments:[s]});for(const f of r.transfers)e.moveCall({target:`${i}::transfer_policy::destroy`,typeArguments:[f.coinType],arguments:[u(`${c}::transfer_policy::TransferPolicy<${f.coinType}>`)]});for(const f of r.swaps)u(`${c}::swap_policy::SwapPolicy<${f.coinIn},${f.coinOut}>`);for(const f of r.lending)u(`${c}::lending_policy::LendingPolicy<${f.coinType}>`);r.staking.length&&u(`${c}::staking_policy::StakingPolicy`)}function wq(e,t,s,r){const i=new Zn;i.setSender(r);const{active:c,control:u}=t,f=i.object(c.passId),p=u.agent;String(s.expiresMs)!==u.agentExpiresMs&&i.moveCall({target:`${e.publishedAt}::pass::set_term`,arguments:[f,i.object(e.configId),i.pure.u64(s.expiresMs),i.object(e1)]}),W3(i,e,f,u.policies),q3(i,e,f,s.policy,s.policy.lending.length>0&&!u.naviPosition);const m=(g,y,b)=>!!g&&g.lifetimeCap===y&&g.expirationMs===String(s.expiresMs)&&(b===null?g.rateLimit===null:g.rateLimit?.limit===b);for(const[g,y]of Object.entries(s.allowances)){const b=De(g),S=c.allowances[b];S&&m(t.allowances[b]??null,y,null)||(S&&Nh(i,b,S.revokeCap,S.allowance),Y3(i,e,f,s,p,b,y))}for(const[g,y]of Object.entries(c.allowances))!(De(g)in s.allowances)&&!Object.keys(s.allowances).some(b=>At(b,g))&&Nh(i,g,y.revokeCap,y.allowance);return m(t.gas,s.gasCap,s.gasDaily)||(Nh(i,Lt,c.gasRevokeCap,c.gasAllowance),Z3(i,s,p)),i}function Tq(e,t,s){const r=new Zn;r.setSender(s),r.moveCall({target:`${e.publishedAt}::pass::revoke_agent`,arguments:[r.object(t.passId)]});for(const[i,c,u]of X3(t))r.moveCall({target:"0x2::allowance::revoke",typeArguments:[Kp(i)],arguments:[r.object(c),r.object(u)]});return r}function X3(e){return[...Object.entries(e.allowances).map(([t,s])=>[t,s.revokeCap,s.allowance]),[Lt,e.gasRevokeCap,e.gasAllowance]]}function J3(e,t,s){const r=e.moveCall({target:`${t.publishedAt}::navi::account_key`});return e.moveCall({target:`${t.publishedAt}::pass::withdraw_object`,typeArguments:[`${t.packageId}::navi::AccountKey`,`${t.protocols.navi.packageId}::account::AccountCap`],arguments:[s,r]})}async function Eq(e,t,s,r=null){const i=new Zn;i.setSender(s),Wu(r)&&await Kb(i,e);const c=J3(i,e,i.object(t.passId));return Wu(r)&&Qb(i,e,c,r,s),i.transferObjects([c],s),i}function Sq(e,t,s,r,i,c=null){return K3(e,[{pass:t,active:s,control:r,position:c}],i)}async function K3(e,t,s){const r=new Zn;r.setSender(s),t.some(i=>i.control.naviPosition&&Wu(i.position))&&await Kb(r,e);for(const i of t)_q(r,e,i,s);return r}function _q(e,t,{pass:s,active:r,control:i,position:c},u){const f=t.publishedAt,p=t.packageId,m=e.object(s.passId);if(i.revoked||e.moveCall({target:`${f}::pass::revoke_agent`,arguments:[m]}),r)for(const[y,b,S]of X3(r))Nh(e,y,b,S);W3(e,t,m,i.policies);const g=[];if(i.naviPosition){const y=J3(e,t,m);Wu(c)&&Qb(e,t,y,c,u),g.push(y)}for(const y of i.stakes){const b=e.moveCall({target:`${f}::staking::stake_key`,arguments:[e.pure.id(y.id)]});g.push(e.moveCall({target:`${f}::pass::withdraw_object`,typeArguments:[`${p}::staking::StakeKey`,H3],arguments:[m,b]}))}g.length&&e.transferObjects(g,u),e.moveCall({target:`${f}::pass::destroy`,arguments:[m]}),e.moveCall({target:`${f}::pass::burn_receipt`,arguments:[e.object(s.receiptId)]})}function kq(e,t,s,r){const i=new Zn;i.setSender(s);const c=i.moveCall({target:`${e.packageId}::staking::stake_key`,arguments:[i.pure.id(r)]}),u=i.moveCall({target:`${e.publishedAt}::pass::withdraw_object`,typeArguments:[`${e.packageId}::staking::StakeKey`,H3],arguments:[i.object(t.passId),c]});return i.transferObjects([u],s),i}const In=e=>`${e.slice(0,8)}…${e.slice(-6)}`,xc=e=>`${dd(e,9)} SUI`,Aq=new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"medium",timeZone:"UTC"}),Oq=e=>`${Aq.format(Number(e))} UTC`,Q3=(e,t)=>{if(e===null)return"pending";const s=Math.max(0,Math.floor((t-e)/1e3));return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`},eN=new URLSearchParams(location.search),Nq=eN.has("embed"),b4=eN.has("expose-wallet");function xq(){const[e,t]=Pe.useState(location.hash);Pe.useEffect(()=>{const c=()=>t(location.hash);return addEventListener("hashchange",c),()=>removeEventListener("hashchange",c)},[]);const[s="",r="",i=""]=e.replace(/^#\/?/,"").split("/");return{kind:s,value:r,extra:i}}function na({d:e,kind:t,id:s,children:r}){const i=t==="tx"?mH(e,s):t==="object"?gH(e,s):yH(e,s),c=r??In(s);return i?T.jsx("a",{href:i,target:"_blank",rel:"noreferrer",title:s,children:c}):T.jsx("span",{title:s,children:c})}function tN({d:e,attempts:t,now:s,showSender:r}){return t.length===0?T.jsx("p",{className:"empty",children:"Nothing yet."}):T.jsx(T.Fragment,{children:t.map(i=>T.jsxs("div",{className:`attempt ${i.success?"ok":"refused"}`,children:[T.jsx("span",{className:"mark",children:i.success?"✓":"✕"}),T.jsxs("div",{children:[T.jsx("strong",{children:i.what}),i.why&&T.jsxs("p",{className:"why",children:["Refused on chain: ",i.why]}),i.moved.length>0&&T.jsx("p",{className:"moved",children:i.moved.join(" · ")}),T.jsxs("p",{className:"meta",children:[Q3(i.timestampMs,s)," · ",T.jsx(na,{d:e,kind:"tx",id:i.digest}),r&&i.sender&&T.jsxs(T.Fragment,{children:[" ","· agent ",T.jsx(na,{d:e,kind:"address",id:i.sender})]})]})]})]},i.digest))})}function Cq({d:e,passes:t,now:s}){return t.length===0?T.jsx("p",{className:"empty",children:"No passes yet."}):T.jsx("div",{className:"grid",children:t.map(r=>T.jsxs("a",{className:"card",href:`#/pass/${r.id}`,children:[T.jsx("h3",{children:r.name}),T.jsxs("p",{children:["Pass ",In(r.id)]}),T.jsxs("p",{children:["Owner ",In(r.owner)]}),T.jsxs("p",{children:["Agent ",In(r.agent)]}),T.jsxs("p",{children:["Created ",Q3(r.timestampMs,s)]})]},r.id))})}const w4=`npm install -g @mysten-incubation/sui-agent-pass
|
|
843
|
-
agent-pass connect`,Iq="Set up a pass that spends up to 0.5 USDC a day buying SUI, max price 1 USDC, for a week.";function Rq({d:e}){const[t,s]=Pe.useState(!1),r=()=>{navigator.clipboard?.writeText(w4).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})};return T.jsxs("div",{className:"home",children:[T.jsxs("section",{className:"home-hero",children:[T.jsxs("h1",{children:["Your money. Your rules.",T.jsx("br",{}),T.jsx("span",{children:"AI at work."})]}),T.jsx("p",{className:"intro",children:"A pass lets an AI agent act on your Sui assets within rules you sign once. Your coins stay in your wallet; the chain enforces the rules."})]}),T.jsxs("div",{className:"command",role:"group","aria-label":"Install command",children:[T.jsx("code",{children:w4.split(`
|
|
844
|
-
`).map(i=>T.jsxs("span",{children:[T.jsx("i",{children:"$"})," ",i]},i))}),T.jsx("button",{type:"button",onClick:r,children:t?"Copied":"Copy"})]}),T.jsxs("ol",{className:"three",children:[T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"01"}),T.jsx("h3",{children:"Install"}),T.jsx("p",{children:"Run the two commands above. The second one registers the agents on your machine."})]}),T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"02"}),T.jsx("h3",{children:"Ask your agent"}),T.jsxs("p",{children:['"',Iq,'"']})]}),T.jsxs("li",{children:[T.jsx("span",{className:"n",children:"03"}),T.jsx("h3",{children:"Sign once"}),T.jsx("p",{children:"The agent opens the review page here. Connect your wallet, read the rules, sign."})]})]}),T.jsxs("p",{className:"home-links",children:[T.jsx("a",{href:"#/guide",children:"What a pass can and cannot do"}),T.jsx("a",{href:"#/explorer",children:"Explorer"}),T.jsx("span",{children:e.network==="mainnet"?"Mainnet test build. Use small amounts while we dogfood.":`${e.network}: test coins only.`})]})]})}function jq({d:e}){const t=e.coins.map(i=>i.symbol).join(", "),s=e.pools.map(i=>`${tr(e,i.coinA)}/${tr(e,i.coinB)} on ${i.venue==="deepbook"?"DeepBook":"Cetus"}`).join(", "),r=Object.keys(e.protocols.navi.reserves).map(i=>tr(e,i)).join(", ");return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Home"})," › Guide"]}),T.jsxs("section",{className:"hero",style:{padding:"28px 0 20px"},children:[T.jsx("h1",{style:{fontSize:44},children:"How a pass works"}),T.jsx("p",{className:"intro",children:"A pass is an on-chain object that says what one agent key may do with your assets, for how long. You create it with one signature, the agent uses it without you, and you end it with one signature."})]}),T.jsxs("div",{className:"guide",children:[T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"What the agent can do"}),T.jsx("p",{children:"Each kind of action needs its own rule, and a coin without a rule cannot be touched."}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Pay"}),T.jsx("strong",{children:"Send a coin to recipients you named, up to an amount per transfer and per UTC day. The agent uses the names; it never gets to choose an address."})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Trade"}),T.jsxs("strong",{children:["Buy or sell on the pools you listed (",s||"none on this network","), up to an amount per trade and per day, and only at your price: never paying more than your limit when buying, never taking less when selling. Proceeds go back to your address."]})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Lend"}),T.jsxs("strong",{children:["Supply and withdraw a coin on NAVI (",r||"none on this network","), and borrow or repay it only if you allowed borrowing, keeping the health factor above your floor."]})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Stake"}),T.jsx("strong",{children:"Stake SUI with validators you listed, or any active one, at least 1 SUI at a time. The stake sits in the pass and comes back to you when the pass ends."})]}),T.jsxs("p",{className:"fine",children:["Coins this network lists: ",t,". The agent can propose rules for other coins you hold by naming their type and a pool."]})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"What it can never do"}),T.jsx("p",{children:"The rules are checked by the Move package on every transaction, not by the agent. There is no way for the agent to move coins to an address you did not name, exceed a limit, act on a coin without a rule, change the rules, or take a held object out of the pass. Your coins never enter the pass or the agent's address: every spend is a withdrawal from your own address balance through an allowance bound to the pass, and whatever comes back lands in your address."}),T.jsx("p",{children:"The one thing outside the rules is gas. The agent key gets a small SUI stipend and a separate gas allowance with its own lifetime limit and a limit per 24 hours, counted from its first top-up rather than per UTC day, so it can pay fees. A stolen agent key could drain that gas allowance at that rate, and nothing else. Keep it small; the default is a fifth of the gas cap per 24 hours."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Where your money sits"}),T.jsx("p",{children:"Allowances draw from your address balance, not from the coin objects in your wallet. When you sign a pass, the page converts just enough of your coins into your address balance to cover the caps, and shows you the amount first. Converted coins stay yours to spend at any time, and the agent can only ever reach what the caps allow."}),T.jsx("p",{children:"Lifetime caps count what leaves, not net exposure: a stake and unstake, or a supply and withdraw, uses the allowance once. Size the caps for the cycles the agent will run."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Changing the rules"}),T.jsx("p",{children:"Ask the agent. It proposes the complete new rule set and opens a page that shows the current rules beside the new ones. One signature replaces the rules; the agent key, its gas and anything the pass holds stay. Changed limits start the day's counters at zero."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Ending it"}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Stop the agent now"}),T.jsx("strong",{children:"Instant. The key is cut off and the allowances deleted; the pass and its history stay on chain. Use it when something is wrong."})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Close the pass"}),T.jsx("strong",{children:"Also hands back everything the pass holds, withdrawing a NAVI position into your wallet first, deletes the pass and refunds its storage deposit. The agent key returns its leftover gas to you by itself."})]}),T.jsx("p",{className:"fine",children:"Both are on the pass page. Your owner page lists every pass you have and closes any number of them in one signature."})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Reading this site"}),T.jsx("p",{children:"Everything here is read live from Sui, nothing from the agent. A pass page shows the rules with today's usage, your balances, what the pass holds, and the agent's activity with each refusal decoded into the rule that caused it. The explorer looks up any pass or owner address."}),T.jsxs("p",{className:"fine",children:["During the dogfood on ",e.network,", the package is the test build; the launch will be a fresh package, and passes on this one are closed at that point. Use small amounts and report anything odd to the team."]})]})]})]})}function Mq({d:e}){const t=il(),[s,r]=Pe.useState(""),[i,c]=Pe.useState(null),[u,f]=Pe.useState(""),[p,m]=Pe.useState("");Pe.useEffect(()=>{if(c(null),m(""),!t)return;let y=!1;return x3(Ht(e),e,t.address).then(b=>{y||c(b)}).catch(b=>{y||m(b.message)}),()=>{y=!0}},[t?.address,e]);const g=()=>{const y=s.trim();if(!da(y))return f("Enter a pass id or an owner address");f(""),Jp(Ht(e),e,y).then(b=>{location.hash=b?`#/pass/${b.id}`:`#/owner/${ye(y)}`})};return T.jsxs(T.Fragment,{children:[T.jsxs("section",{className:"hero",children:[T.jsxs("p",{className:"eyebrow",children:["AGENT PASS EXPLORER · ",e.network.toUpperCase()]}),T.jsxs("h1",{children:["Every rule.",T.jsx("br",{}),"Every refusal.",T.jsx("br",{}),T.jsx("span",{children:"On chain."})]}),T.jsx("p",{className:"intro",children:"Paste a pass id or an owner address, or connect your wallet to see your own passes, their rules, what the agent did, and what the chain refused."})]}),T.jsxs("div",{className:"search",children:[T.jsx("input",{"aria-label":"Pass id or owner address",placeholder:"0x… pass id or owner address",value:s,onChange:y=>r(y.target.value),onKeyDown:y=>y.key==="Enter"&&g()}),T.jsx("button",{className:"primary",style:{width:"auto",marginTop:0},onClick:g,children:"Open"})]}),u&&T.jsx("div",{role:"alert",className:"message error",children:u}),T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Your passes"}),t&&T.jsxs("span",{className:"badge",children:["Receipts in ",In(t.address)]})]}),t?p?T.jsx("div",{role:"alert",className:"message error",children:p}):i===null?T.jsx("p",{className:"empty",children:"Reading your wallet…"}):i.length===0?T.jsx("p",{className:"empty",children:"No pass receipts in this wallet."}):T.jsx("div",{className:"grid",children:i.map(y=>T.jsxs("a",{className:"card",href:`#/pass/${y.pass}`,children:[T.jsx("h3",{children:y.name}),T.jsxs("p",{children:["Pass ",In(y.pass)]}),T.jsxs("p",{children:["Receipt ",In(y.id)]})]},y.id))}):T.jsxs("div",{className:"empty",children:[T.jsx("p",{children:"Connect your wallet to see your passes."}),T.jsx(p3,{})]})]})]})}function Dq({d:e,owner:t}){const s=wo(),r=il(),[i,c]=Pe.useState(null),[u,f]=Pe.useState(""),[p,m]=Pe.useState(""),g=!!r&&ye(r.address)===ye(t);async function y(){const O=Ht(e),C=await mq(O,e,t);c(await Promise.all(C.map(async R=>({...R,position:await yp(O,e,R.user)}))))}Pe.useEffect(()=>{c(null),y().catch(O=>f(O.message))},[t]);async function b(O){if(r){m(O.capId),f("");try{const C=Ht(e),R=new Zn;R.setSender(r.address),await Kb(R,e),Qb(R,e,R.object(O.capId),O.position,r.address);const $=await s.signTransaction({transaction:R}),x=await C.executeTransaction({transaction:qe($.bytes),signatures:[$.signature]});if(x.$kind==="FailedTransaction")throw new Error(`Chain refused: ${x.FailedTransaction.status.error?.message}`);await C.waitForTransaction({result:x}),await y()}catch(C){f(C.message)}finally{m("")}}}const S=i?.filter(O=>Object.keys(O.position.collateral).length||Object.keys(O.position.debt).length);return S?.length?T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"NAVI positions in this wallet"}),T.jsx("p",{className:"fine",children:"Reclaimed from passes. NAVI's app does not see account-based positions, so withdraw them here: one signature returns the collateral to your wallet."}),u&&T.jsx("div",{className:"message error",children:u}),S.map(O=>T.jsxs("div",{className:"rule",children:[T.jsxs("span",{children:["Account ",T.jsx("span",{className:"mono",children:In(O.capId)})]}),T.jsxs("strong",{children:[Object.entries(O.position.collateral).map(([C,R])=>fn(e,C,R)).join(" · ")||"nothing supplied",Object.keys(O.position.debt).length?` · owes ${Object.entries(O.position.debt).map(([C,R])=>fn(e,C,R)).join(" · ")}`:"",g&&Wu(O.position)&&T.jsx("button",{className:"inline",disabled:!!p,onClick:()=>{b(O)},children:p===O.capId?"Confirming…":"Withdraw to my wallet"}),Object.keys(O.position.debt).length>0&&T.jsx("span",{className:"fine",children:" (repay the debt before withdrawing)"})]})]},O.capId))]}):null}function Uq({d:e,owner:t}){const s=wo(),r=il(),[i,c]=Pe.useState(null),[u,f]=Pe.useState(""),[p,m]=Pe.useState(""),[g,y]=Pe.useState(!1),[b,S]=Pe.useState(new Set),O=!!r&&ye(r.address)===ye(t);function C(){return x3(Ht(e),e,t).then(x=>{c(x),S(new Set)}).catch(x=>f(x.message))}Pe.useEffect(()=>{C()},[t]);async function R(){if(!(!r||!i)){y(!0),f(""),m("");try{const x=Ht(e),W=await Promise.all(i.filter(F=>b.has(F.pass)).map(async F=>{const K=await Jp(x,e,F.pass);if(!K)throw new Error(`No pass ${In(F.pass)} was created on this package`);const[w,A]=await Promise.all([fd(x,e,F.pass),Yb(x,e,K)]),N=w.naviPosition?await yp(x,e,w.naviPosition):null;return{pass:{passId:F.pass,receiptId:F.id},active:A,control:w,position:N}})),ce=await s.signTransaction({transaction:await K3(e,W,r.address)}),ge=await x.executeTransaction({transaction:qe(ce.bytes),signatures:[ce.signature]});if(ge.$kind==="FailedTransaction")throw new Error(`Chain refused: ${ge.FailedTransaction.status.error?.message}`);await x.waitForTransaction({result:ge}),m(`${W.length} ${W.length===1?"pass":"passes"} closed in one transaction; the storage deposits came back with the gas.`),await C()}catch(x){f(x.message)}finally{y(!1)}}}const $=x=>S(W=>{const ce=new Set(W);return ce.has(x)?ce.delete(x):ce.add(x),ce});return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," › Owner ",T.jsx("span",{className:"mono",children:t})]}),T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Passes this wallet holds receipts for"}),u&&T.jsx("div",{className:"message error",children:u}),p&&T.jsx("div",{role:"status",className:"message",children:p}),i===null?T.jsx("p",{className:"empty",children:"Reading…"}):i.length===0?T.jsx("p",{className:"empty",children:"No pass receipts at this address."}):T.jsxs(T.Fragment,{children:[O&&T.jsxs("p",{className:"fine",children:["Pick the passes to close, then close them all with one signature. Closing stops the agent, hands back anything the pass holds, deletes it and refunds its storage."," ",T.jsx("button",{className:"inline",disabled:g,onClick:()=>S(b.size===i.length?new Set:new Set(i.map(x=>x.pass))),children:b.size===i.length?"Clear":"Select all"})]}),T.jsx("div",{className:"grid",children:i.map(x=>T.jsxs("div",{className:"card",children:[O&&T.jsxs("label",{className:"pick",children:[T.jsx("input",{type:"checkbox",checked:b.has(x.pass),disabled:g,onChange:()=>$(x.pass)})," ","Close"]}),T.jsxs("a",{href:`#/pass/${x.pass}`,children:[T.jsx("h3",{children:x.name}),T.jsxs("p",{children:["Pass ",In(x.pass)]})]})]},x.id))}),O&&T.jsx("button",{className:"primary",disabled:g||b.size===0,onClick:()=>{R()},children:g?"Confirming…":b.size?`Close ${b.size} ${b.size===1?"pass":"passes"} in one signature`:"Close selected"}),!r&&T.jsx("p",{className:"fine",children:"Connect this wallet to close passes from here."})]})]}),T.jsx(Dq,{d:e,owner:t})]})}function nN({rows:e}){return T.jsx(T.Fragment,{children:e.map(t=>T.jsxs("div",{className:t.starts?"rule starts":"rule",children:[T.jsx("span",{children:t.label}),t.label==="Named recipients"||t.value.startsWith("0x")?T.jsx("div",{children:t.value.split(`
|
|
845
|
-
`).map(s=>T.jsx("code",{children:s},s))}):T.jsx("strong",{children:t.value})]},t.label))})}function Bq({d:e,passId:t,ready:s}){const r=wo(),i=il(),[c,u]=Pe.useState(null),[f,p]=Pe.useState(!1),[m,g]=Pe.useState(""),[y,b]=Pe.useState(""),[S,O]=Pe.useState(!1),C=Date.now();async function R(k=!1){const j=Ht(e),D=k||!c?await Jp(j,e,t):c.summary;if(!D)return void p(!0);const z=await fd(j,e,D.id),J=k||!c?await Zb(j,e,gp(Ov(e,z))):c.dx,V=k||!c?await Yb(j,J,D):c.active,[re,ue,I]=await Promise.all([V?R3(j,V):null,uH(j,J,D.owner),kH(j,J,z.agent,z.policies.transfers[0]?.recipients??[])]);u({summary:D,control:z,active:V,allowances:re,balances:ue,attempts:I,dx:J})}Pe.useEffect(()=>{u(null),p(!1),R(!0).catch(j=>g(j.message));const k=setInterval(()=>{R().catch(()=>{})},5e3);return()=>clearInterval(k)},[t]);async function $(k,j,D){if(i){O(!0),g(""),b("");try{const z=await r.signTransaction({transaction:await k()}),J=Ht(e),V=await J.executeTransaction({transaction:qe(z.bytes),signatures:[z.signature]});if(V.$kind==="FailedTransaction")throw new Error(`Chain refused: ${V.FailedTransaction.status.error?.message}`);if(await J.waitForTransaction({result:V}),b(j),D)return D();await R(!0)}catch(z){g(z.message)}finally{O(!1)}}}if(f)return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," › Pass"]}),T.jsxs("div",{className:"message error",children:["No pass ",In(t)," was created on this package."]})]});if(!c)return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," › Pass ",In(t)]}),m?T.jsx("div",{className:"message error",children:m}):T.jsx("p",{className:"empty",children:"Reading the chain…"})]});const{summary:x,control:W,active:ce,allowances:ge,balances:F,attempts:K,dx:w}=c,A=W.revoked||!ce,N=!A&&Number(W.agentExpiresMs)<=W.chainTimeMs,P=!!i&&ye(i.address)===W.owner,U=k=>tr(w,k),q=k=>k?(BigInt(k.lifetimeCap??"0")-BigInt(k.currentSpend)).toString():null,L=ge?Object.entries(ge).map(([k,j])=>[k,q(j)]):[],M=[...W.policies.transfers.map(k=>({label:`${U(k.coinType)} paid today`,value:fn(w,k.coinType,k.usage.usedToday)})),...W.policies.swaps.map(k=>({label:`${U(k.coinIn)} sold for ${U(k.coinOut)} today`,value:fn(w,k.coinIn,k.usage.usedToday)})),...W.policies.lending.map(k=>({label:`${U(k.coinType)} ${k.allowBorrow?"lent, borrowed or repaid":"supplied or withdrawn"} today`,value:fn(w,k.coinType,k.usage.usedToday)})),...W.policies.staking.map(k=>({label:"SUI staked today",value:xc(k.usage.usedToday)}))];return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," ›"," ",T.jsxs("a",{href:`#/owner/${W.owner}`,children:["Owner ",In(W.owner)]})," › ",x.name]}),T.jsxs("section",{className:"hero",style:{padding:"28px 0 20px"},children:[T.jsx("h1",{style:{fontSize:44},children:x.name}),T.jsxs("p",{className:"intro",children:["Pass"," ",T.jsx(na,{d:e,kind:"object",id:x.id,children:x.id})]})]}),m&&T.jsx("div",{role:"alert",className:"message error",children:m}),y&&T.jsx("div",{role:"status",className:"message",children:y}),T.jsxs("div",{className:"layout",children:[T.jsxs("div",{children:[T.jsxs("section",{className:"panel activity",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Agent activity"}),T.jsx("span",{className:"badge",children:"Live from Sui"})]}),T.jsx(tN,{d:e,attempts:K,now:C})]}),T.jsxs("section",{className:"panel rules",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Policies"}),T.jsx("span",{className:`badge ${A||N?"muted":""}`,children:A?"Revoked":N?"Expired":"Authorized"})]}),T.jsx(nN,{rows:M3(w,Ov(w,W),W.policies)}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Agent term ends"}),T.jsx("strong",{children:W.revoked?"Revoked":Oq(W.agentExpiresMs)})]})]})]}),T.jsxs("aside",{children:[T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Owner's address balance"}),w.coins.map(k=>T.jsxs("div",{className:"balance",children:[dd(F[k.type]??"0",k.decimals)," ",T.jsx("span",{children:tr(w,k.type)})]},k.type)),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"Key may still withdraw"}),T.jsx("strong",{children:L.length&&L.every(([,k])=>k!==null)?L.map(([k,j])=>fn(w,k,j)).join(" · "):"Nothing; allowances deleted"})]}),M.map(k=>T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:k.label}),T.jsx("strong",{children:k.value})]},k.label)),T.jsx("hr",{}),T.jsx("h2",{children:"Held by the pass"}),W.naviPosition&&T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"NAVI position"}),T.jsxs("strong",{children:[T.jsx(na,{d:e,kind:"address",id:W.naviPosition}),P&&T.jsx("button",{className:"inline",disabled:S,onClick:()=>{$(async()=>Eq(w,{passId:x.id},i.address,await yp(Ht(e),w,W.naviPosition)),"The NAVI position was withdrawn to your wallet, and its account with it.")},children:"Reclaim"})]})]}),W.stakes.map(k=>T.jsxs("div",{className:"rule",children:[T.jsxs("span",{children:["Stake ",T.jsx(na,{d:e,kind:"object",id:k.id})]}),T.jsxs("strong",{children:[xc(k.principal),P&&T.jsx("button",{className:"inline",disabled:S,onClick:()=>{$(()=>kq(e,{passId:x.id},i.address,k.id),"The stake is in your wallet now.")},children:"Reclaim"})]})]},k.id)),!W.naviPosition&&W.stakes.length===0&&T.jsx("p",{className:"empty",children:"No objects held."}),T.jsx("p",{className:"fine",children:"Coins never rest in the pass. What it holds is what the agent operates: a lending account, stakes. Only the owner takes them out."}),P&&!A&&!N&&ce&&T.jsxs("div",{className:"owner-actions",children:[T.jsx("button",{className:"revoke",disabled:S,onClick:()=>{$(()=>Tq(e,ce,i.address),"Stopped on chain. This key can no longer withdraw from your balance. The pass and its history stay; close it when you are done.")},children:"Stop the agent now"}),T.jsx("p",{className:"fine",children:"Instant and small: the key is cut off and the allowances deleted. The pass and its history stay on chain; a pass belongs to one key, so a new agent needs a new pass."})]}),P&&T.jsxs("div",{className:"owner-actions",children:[T.jsx("button",{className:"revoke",disabled:S,onClick:()=>{$(async()=>Sq(w,{passId:x.id,receiptId:x.receiptId},ce,W,i.address,W.naviPosition?await yp(Ht(e),w,W.naviPosition):null),"Pass closed; its storage deposits came back with the gas.",()=>{location.hash=`#/owner/${W.owner}`})},children:A?"Close the pass and get its storage back":"Stop the agent and close the pass"}),T.jsx("p",{className:"fine",children:"Deletes the pass, its policies, its receipt and any remaining allowances, and hands you anything it still holds; a NAVI position with no debt is withdrawn to your wallet first, since NAVI's app cannot operate it. The storage deposits of everything deleted return to your wallet with this transaction's gas."})]}),!i&&T.jsx("p",{className:"fine",children:"Connect the owner wallet to revoke or reclaim."})]}),T.jsxs("details",{children:[T.jsx("summary",{children:"On-chain details"}),T.jsxs("dl",{children:[T.jsx("dt",{children:"Owner"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"address",id:W.owner,children:W.owner})}),T.jsx("dt",{children:"Agent"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"address",id:W.agent,children:W.agent})}),T.jsx("dt",{children:"Receipt"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"object",id:x.receiptId,children:x.receiptId})}),T.jsx("dt",{children:"Authorization"}),T.jsx("dd",{children:T.jsx(na,{d:e,kind:"tx",id:x.digest,children:x.digest})}),ce&&T.jsxs(T.Fragment,{children:[Object.entries(ce.allowances).map(([k,j])=>T.jsxs(Ab.Fragment,{children:[T.jsxs("dt",{children:[U(k)," allowance"]}),T.jsx("dd",{children:j.allowance})]},k)),T.jsx("dt",{children:"Gas allowance"}),T.jsx("dd",{children:ce.gasAllowance})]})]})]})]})]}),s&&T.jsxs("section",{className:"panel next",children:[T.jsx("h2",{children:"Your agent is ready"}),T.jsx("p",{children:"Your signature is on chain. The process that proposed this pass finds it there by itself; there is nothing to copy back. Ask your agent to read its rules and make its first transaction."}),T.jsxs("blockquote",{children:['"',Lq(w,W),'"']})]})]})}function Lq(e,t){const s=t.policies,r=s.transfers[0],i=s.swaps[0],c=s.lending[0],u=s.staking[0];return`${r?`Pay ${fn(e,r.coinType,r.perTransfer)} to ${r.recipients[0]?.name??"the recipient in my rules"}`:i?Fb(e,i.coinIn,i.coinOut).limit==="max"?`Buy ${tr(e,i.coinOut)} with ${fn(e,i.coinIn,i.perTrade)}`:`Sell ${fn(e,i.coinIn,i.perTrade)} for ${tr(e,i.coinOut)}`:c?`Supply ${fn(e,c.coinType,c.perAction)} to NAVI`:u?`Stake ${xc(u.perStake)}`:"Make the first action my rules allow"}, then show me the transaction and what you may still do today.`}function Ov(e,t){const s=t.policies;return{transfers:s.transfers.map(r=>({coin:r.coinType,recipients:r.recipients,perTransfer:r.perTransfer,daily:r.daily})),swaps:s.swaps.map(r=>({coinIn:r.coinIn,coinOut:r.coinOut,pools:r.venues,perTrade:r.perTrade,daily:r.daily,minPrice:r.minPrice})),lending:s.lending.map(r=>({coin:r.coinType,allowBorrow:r.allowBorrow,perAction:r.perAction,daily:r.daily,minHealthFactor:BigInt(r.minHealthFactor)===0n?null:Number(BigInt(r.minHealthFactor)/10n**25n)/100})),staking:s.staking[0]?{validators:s.staking[0].validators,perStake:s.staking[0].perStake,daily:s.staking[0].daily}:null}}function zq({d:e}){const[t,s]=Pe.useState([]),[r,i]=Pe.useState([]),[c,u]=Pe.useState(""),f=Date.now();Pe.useEffect(()=>{const m=Ht(e),g=()=>{Promise.all([_H(m,e,12),AH(m,e,40)]).then(([b,S])=>{s(b),i(S),u("")}).catch(b=>u(b.message))};g();const y=setInterval(g,4e3);return()=>clearInterval(y)},[e.packageId]);const p=r.filter(m=>!m.success).length;return T.jsxs("div",{className:"booth",children:[T.jsxs("section",{className:"hero",style:{padding:"40px 0 24px"},children:[T.jsxs("p",{className:"eyebrow",children:["LIVE ON SUI ",e.network.toUpperCase()]}),T.jsxs("h1",{children:["Your money. Your rules.",T.jsx("br",{}),T.jsx("span",{children:"AI at work."})]})]}),c&&T.jsx("div",{className:"message error",children:c}),T.jsxs("div",{className:"stats",children:[T.jsxs("div",{className:"stat",children:[T.jsx("span",{children:"Passes"}),T.jsx("strong",{children:t.length})]}),T.jsxs("div",{className:"stat",children:[T.jsx("span",{children:"Recent actions"}),T.jsx("strong",{children:r.length})]}),T.jsxs("div",{className:"stat refused",children:[T.jsx("span",{children:"Refused by the chain"}),T.jsx("strong",{children:p})]})]}),T.jsxs("div",{className:"layout",children:[T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"What agents are doing"}),T.jsx("span",{className:"badge",children:"Refreshes every 4s"})]}),T.jsx(tN,{d:e,attempts:r,now:f,showSender:!0})]}),T.jsxs("section",{className:"panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Latest passes"}),T.jsx("a",{className:"badge",href:"#/",children:"Explorer →"})]}),T.jsx(Cq,{d:e,passes:t,now:f})]})]})]})}function $q({d:e,proposal:t}){const s=wo(),r=il(),[i,c]=Pe.useState(null),[u,f]=Pe.useState(""),[p,m]=Pe.useState(!1),g=t.setup;async function y(){const C=Ht(e),R=await Jp(C,e,t.passId);if(!R)throw new Error(`No pass ${In(t.passId)} was created on this package`);const $=await fd(C,e,R.id);if($.agent!==ye(t.sessionAddress))throw new Error("This proposal names a different agent key than the pass has");const x=Ov(e,$),W=gp(g.policy),ce=gp(x),ge=await Zb(C,e,{coins:[...W.coins,...ce.coins],pools:[...W.pools,...ce.pools]}),F=await Yb(C,ge,R);if(!F)throw new Error("This pass has no live allowances; it was stopped or closed");const[K,w]=await Promise.all([R3(C,F),qb(C,F.gasAllowance,Lt)]),A={name:$.name,policy:x,ttlMs:g.ttlMs,expiresMs:Number($.agentExpiresMs),allowances:Object.fromEntries(Object.entries(K).map(([q,L])=>[q,L?.lifetimeCap??"0"])),gasAmount:g.gasAmount,gasCap:w?.lifetimeCap??"0",gasDaily:w?.rateLimit?.limit??"0"},N=Av(ge,A),P=Av(ge,g),U=q=>q.filter(L=>!/^Authorization ends|^Gas to the agent/.test(L.label)).map(L=>`${L.label}=${L.value}`).sort().join(`
|
|
846
|
-
`);c({dx:ge,current:{active:F,control:$,allowances:K,gas:w},currentRows:N,nextRows:P,applied:U(N)===U(P)&&String(g.expiresMs)===$.agentExpiresMs})}Pe.useEffect(()=>{c(null),y().catch(C=>f(C.message))},[t.passId]);async function b(){if(!(!r||!i)){m(!0),f("");try{const C=Ht(e),R=await s.signTransaction({transaction:wq(i.dx,i.current,g,r.address)}),$=await C.executeTransaction({transaction:qe(R.bytes),signatures:[R.signature]});if($.$kind==="FailedTransaction")throw new Error(`Chain refused: ${$.FailedTransaction.status.error?.message}`);await C.waitForTransaction({result:$}),location.hash=`#/pass/${t.passId}`}catch(C){f(C.message)}finally{m(!1)}}}const S=new Map(i?.currentRows.map(C=>[C.label,C.value])),O=!!r&&!!i&&ye(r.address)===i.current.active.owner;return T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"crumbs",children:[T.jsx("a",{href:"#/",children:"Explorer"})," ›"," ",T.jsxs("a",{href:`#/pass/${t.passId}`,children:["Pass ",In(t.passId)]})," › Change the rules"]}),u&&T.jsx("div",{role:"alert",className:"message error",children:u}),T.jsxs("div",{className:"layout",children:[T.jsx("div",{children:T.jsxs("section",{className:"panel rules",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Review the new rules"}),T.jsx("span",{className:"badge",children:i?.applied?"Already in force":"Awaiting signature"})]}),i?T.jsxs(T.Fragment,{children:[i.nextRows.map(C=>{const R=S.get(C.label),$=R!==void 0&&R!==C.value;return T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:C.label}),T.jsxs("strong",{children:[C.value,$&&T.jsxs(T.Fragment,{children:[T.jsx("br",{}),T.jsxs("s",{className:"fine",children:["was: ",R]})]}),R===void 0&&T.jsx("span",{className:"fine",children:" (new)"})]})]},C.label)}),i.currentRows.filter(C=>!i.nextRows.some(R=>R.label===C.label)).map(C=>T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:C.label}),T.jsx("strong",{children:T.jsxs("s",{className:"fine",children:["removed: ",C.value]})})]},C.label)),T.jsx("p",{className:"fine",children:"The agent key stays the same and nothing is sent to it. Changed policies start with empty daily counters; an allowance keeps its lifetime spend when its cap and term did not change and is reissued otherwise. Anything the pass holds stays in it."})]}):T.jsx("p",{className:"empty",children:"Reading the pass…"})]})}),T.jsx("aside",{children:T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Sign once"}),T.jsx("p",{className:"fine",children:"One transaction replaces the rules. Your coins stay in your address; only what the key may do with them changes."}),T.jsx("button",{className:"primary",disabled:!O||p||!i||i.applied,onClick:()=>{b()},children:p?"Confirming…":i?.applied?"Already in force":r?O?"Apply the change in wallet":"Connect the wallet that owns this pass":"Connect your wallet to continue"})]})})]})]})}function Vq({d:e,payload:t}){const s=wo(),r=il(),[i,c]=(()=>{try{return[CF(t),""]}catch(z){return[null,z.message]}})(),u=i?.sessionAddress??"",f=`pending-${u}`,[p,m]=Pe.useState(()=>JSON.parse(sessionStorage.getItem(f)??"null")),[g,y]=Pe.useState(!1),[b,S]=Pe.useState(""),[O,C]=Pe.useState(null);Pe.useEffect(()=>{if(!i)return;let z=!0;return Zb(Ht(e),e,gp(i.setup.policy)).then(J=>z&&C(J)).catch(J=>z&&S(J.message)),()=>{z=!1}},[t]);const[R,$]=Pe.useState(void 0);Pe.useEffect(()=>{if(!u)return;let z=!0;return SH(Ht(e),e,u).then(J=>z&&$(J?{id:J.id}:null)).catch(()=>z&&$(null)),()=>{z=!1}},[u]);const[x,W]=Pe.useState(null);if(Pe.useEffect(()=>{if(!r||!O)return void W(null);let z=!0;const J=Ht(e),V=()=>{Promise.all(O.coins.map(async ue=>{const{balance:I}=await J.getBalance({owner:r.address,coinType:ue.type});return[ue.type,{balance:I.addressBalance,coins:I.coinBalance}]})).then(ue=>z&&W(Object.fromEntries(ue))).catch(()=>{})};V();const re=setInterval(V,4e3);return()=>{z=!1,clearInterval(re)}},[r?.address,O]),!i)return T.jsxs("div",{role:"alert",className:"message error",children:["This link does not carry a valid proposal: ",c]});if(i.passId)return T.jsx($q,{d:e,proposal:{...i,passId:i.passId}});const{setup:ce}=i;function ge(z){m(z),z?sessionStorage.setItem(f,JSON.stringify(z)):sessionStorage.removeItem(f)}async function F(z){const J=Ht(e),V=await J.executeTransaction({transaction:qe(z.bytes),signatures:[z.signature]});if(V.$kind==="FailedTransaction")throw ge(null),new Error(`Chain refused transaction ${z.digest}: ${V.FailedTransaction.status.error?.message}`);await J.waitForTransaction({result:V}),await K(z.digest)}async function K(z){const V=(await iH(Ht(e),e,z)).passes.find(re=>re.agent===ye(u));if(ge(null),!V)throw new Error(`Transaction ${z} created no pass for this agent`);location.hash=`#/pass/${V.id}/ready`}async function w(){if(r){y(!0),S("");try{const z={};for(const[ue,I]of Object.entries(U)){if(BigInt(I)<=0n||At(ue,Lt)||e.demoFaucet&&At(e.demoFaucet.coin,ue))continue;const{objects:X}=await Ht(e).core.listCoins({owner:r.address,coinType:ue});z[ue]=X.map(oe=>({objectId:oe.objectId,version:oe.version,digest:oe.digest}))}const J=bq(O??e,ce,r.address,u,U,z),V=await s.signTransaction({transaction:J}),re={...V,digest:await Zn.from(V.bytes).getDigest(),owner:r.address};ge(re),await F(re)}catch(z){S(z.message)}finally{y(!1)}}}async function A(){if(p){y(!0),S("");try{const z=await Ht(e).getTransaction({digest:p.digest}).catch(()=>null);if(z?.$kind==="FailedTransaction")throw ge(null),new Error(`Chain refused ${p.digest}: ${z.FailedTransaction.status.error?.message}`);z?.$kind==="Transaction"?await K(p.digest):await F(p)}catch(z){S(z.message)}finally{y(!1)}}}const N=x?Object.fromEntries(Object.entries(x).map(([z,J])=>[z,{addressBalance:J.balance,coinBalance:J.coins}])):null,P=e.demoFaucet?.coin??null,U=N?S3(ce,N,P):null,q=N?$F(ce,N,P):{},L=VF(ce),M=x?(BigInt(x[Lt]?.balance??"0")+BigInt(x[Lt]?.coins??"0")).toString():null,k=M!==null&&BigInt(M)<BigInt(L),j=!!U&&Object.values(U).some(z=>BigInt(z)>0n),D=e.network==="testnet"||e.network==="devnet"?`https://faucet.sui.io/?network=${e.network}`:null;return T.jsxs(T.Fragment,{children:[!Nq&&T.jsxs("section",{className:"hero",children:[T.jsx("p",{className:"eyebrow",children:"YOUR COINS STAY IN YOUR WALLET"}),T.jsxs("h1",{children:["Your money.",T.jsx("br",{}),"Your rules.",T.jsx("br",{}),T.jsx("span",{children:"AI at work."})]}),T.jsx("p",{className:"intro",children:"Your coins never leave your own address. Allowances bound to your pass release them, and the pass's policies decide every action. The pass holds anything the agent operates, like a lending position or a stake, and only you can take it out."})]}),b&&T.jsx("div",{role:"alert",className:"message error",children:b}),T.jsxs("div",{className:"layout",children:[T.jsx("div",{children:T.jsxs("section",{className:"panel rules",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Review your authorization"}),T.jsx("span",{className:"badge",children:"Awaiting signature"})]}),O?T.jsx(nN,{rows:Av(O,ce)}):T.jsx("p",{className:"empty",children:"Reading the coins and pools these rules name…"}),T.jsx("p",{className:"fine",children:"Each action needs a policy for its coin; anything without one is refused. Daily limits reset at 00:00 UTC. Every withdrawal passes through both the framework allowance and the policy. Swap and lending proceeds return to your address balance. Lifetime caps are the framework's own backstop. This page was built with the package it names and reads nothing from the machine that proposed these rules."})]})}),T.jsxs("aside",{children:[T.jsxs("section",{className:"panel",children:[T.jsx("h2",{children:"Sign once"}),T.jsx("p",{className:"fine",children:"One transaction creates the pass, issues the allowances over your own balance, installs these policies and gives the agent key its gas. Your coins stay in your address; the agent key never holds them."}),r&&T.jsxs(T.Fragment,{children:[Object.entries(Hb(ce)).map(([z,J],V)=>{const re=x?.[z],ue=oe=>fn(O??e,z,oe),I=BigInt(U?.[z]??"0"),X=!!e.demoFaucet&&At(e.demoFaucet.coin,z);return T.jsxs(Ab.Fragment,{children:[T.jsxs("div",{className:V?"rule starts":"rule",children:[T.jsx("span",{children:"You hold"}),T.jsx("strong",{children:re?ue((BigInt(re.balance)+BigInt(re.coins)).toString()):"—"})]}),T.jsxs("div",{className:"rule sub",children:[T.jsx("span",{children:"In your address balance"}),T.jsx("strong",{children:re?ue(re.balance):"—"})]}),T.jsxs("div",{className:"rule sub",children:[T.jsx("span",{children:"In coin objects"}),T.jsx("strong",{children:re?ue(re.coins):"—"})]}),I>0n&&T.jsxs("div",{className:"rule sub",children:[T.jsx("span",{children:X?"Minted into your address balance when you sign":"Moved into your address balance when you sign"}),T.jsx("strong",{children:ue(I.toString())})]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"The rules may draw up to"}),T.jsx("strong",{children:ue(J)})]})]},z)}),j&&T.jsxs("p",{className:"fine",children:["Allowances draw only from your address balance, so the coin objects they need are moved into it when you sign. They stay yours to spend at any time.",e.demoFaucet&&BigInt(U?.[e.demoFaucet.coin]??"0")>0n?` The ${tr(e,e.demoFaucet.coin)} is a test token the demo faucet mints.`:""]}),T.jsxs("div",{className:"rule",children:[T.jsx("span",{children:"SUI needed to sign / in your wallet"}),T.jsx("strong",{className:k?"warn":"",children:M!==null?`${xc(L)} / ${xc(M)}`:"—"})]})]}),Object.entries(q).map(([z,{drawable:J,covered:V}])=>T.jsxs("p",{className:"fine",children:["The rules can draw up to ",fn(O??e,z,J),". Your address balance will hold ",fn(O??e,z,V)," after you sign. An action only works while that balance covers it: swap proceeds land there and count right away, while"," ",tr(O??e,z)," sent to you later as coin objects needs moving in first."]},z)),k&&T.jsxs("p",{className:"fine warn",children:["Not enough SUI to sign: the agent's gas stipend and the fee need ",xc(L),"."," ",D?T.jsxs(T.Fragment,{children:["Get ",e.network," SUI from the"," ",T.jsx("a",{href:D,target:"_blank",rel:"noreferrer",children:"faucet"})," ","and this page will notice."]}):"Fund this address and this page will notice."]}),R&&T.jsxs("p",{className:"fine warn",children:["This agent key already has a pass:"," ",T.jsx("a",{href:`#/pass/${R.id}`,children:In(R.id)}),". A key has one pass, and the chain refuses a second. To change the rules or start over, ask the agent for a new proposal; to end the pass, use its page."]}),T.jsx("button",{className:"primary",disabled:!r||!O||!U||g||!!p||k||R!==null,onClick:()=>{w()},children:g?"Confirming…":R?"Already authorized":r?k?"Fund your wallet first":"Authorize in wallet":e.network==="localnet"?"Connect your wallet to continue":"Connect Slush to continue"}),p&&T.jsxs("div",{className:"message",children:[T.jsxs("p",{children:["Transaction ",In(p.digest)," is awaiting confirmation. Check it before creating another authorization."]}),T.jsx("button",{disabled:g,onClick:()=>{A()},children:"Check / submit the same transaction"})]})]}),T.jsxs("details",{children:[T.jsx("summary",{children:"On-chain details"}),T.jsxs("dl",{children:[T.jsx("dt",{children:"Agent address"}),T.jsx("dd",{children:u}),T.jsx("dt",{children:"Package"}),T.jsx("dd",{children:e.packageId}),T.jsx("dt",{children:"Network chain ID"}),T.jsx("dd",{children:e.chainIdentifier})]})]})]})]})]})}function Pq({d:e,networks:t}){const s=xq(),r=i=>{const c=new URL(location.href);c.searchParams.set("network",i),location.href=c.toString()};return T.jsxs("main",{children:[T.jsxs("header",{children:[T.jsx("a",{className:"brand",href:"#/",children:"◈ Sui Agent Pass"}),T.jsxs("nav",{className:"nav",children:[T.jsx("a",{href:"#/guide",children:"Guide"}),T.jsx("a",{href:"#/explorer",children:"Explorer"})]}),T.jsxs("div",{className:"wallet",children:[t.length>1?T.jsx("select",{className:"network","aria-label":"Network",value:e.network,onChange:i=>r(i.target.value),children:t.map(i=>T.jsx("option",{value:i,children:i},i))}):T.jsx("span",{className:"network",children:e.network}),T.jsx(p3,{})]})]}),s.kind==="authorize"&&s.value?T.jsx(Vq,{d:e,payload:s.value}):s.kind==="pass"&&da(s.value)?T.jsx(Bq,{d:e,passId:ye(s.value),ready:s.extra==="ready"}):s.kind==="owner"&&da(s.value)?T.jsx(Uq,{d:e,owner:ye(s.value)}):s.kind==="booth"?T.jsx(zq,{d:e}):s.kind==="explorer"?T.jsx(Mq,{d:e}):s.kind==="guide"?T.jsx(jq,{d:e}):T.jsx(Rq,{d:e}),s.kind!==""&&T.jsx("footer",{children:"AI chooses the transaction. The pass decides what can leave. Read live from Sui."})]})}async function Gq(){const e=new URLSearchParams(location.search).get("network"),t=["mainnet","testnet","devnet","localnet"],r=(await Promise.all(t.map(async c=>{const u=await fetch(`./deployments/${c}.json`,{cache:"no-store"});return u.ok?{network:c,raw:await u.json()}:null}))).filter(c=>!!c),i=e?r.find(c=>c.network===e):r[0];if(!i)throw new Error(`No deployment found for ${e??t.join(", ")}`);return{d:NF.parse(i.raw),networks:r.map(c=>c.network)}}Gq().then(({d:e,networks:t})=>{const s=HV({networks:[e.network],createClient:()=>Ht(e),slushWalletConfig:e.network==="localnet"?null:{appName:"Sui Agent Pass"},walletInitializers:e.network==="localnet"||b4?[WL({adapters:[new C$],mountUI:!0,onWalletCreated:b4?r=>window.__devWallet=r:void 0})]:[]});q_.createRoot(document.getElementById("root")).render(T.jsx(R$,{dAppKit:s,children:T.jsx(Pq,{d:e,networks:t})}))}).catch(e=>{q_.createRoot(document.getElementById("root")).render(T.jsxs("main",{children:[T.jsx("h1",{children:"Sui Agent Pass"}),T.jsx("p",{children:e.message})]}))});export{ln as A,Zn as T,qn as a,bt as b,pn as c,Xi as d,Qu as e,Rh as f,kr as g,ye as h,ga as i,lj as j,De as n,ws as p,Db as r,H as s,GO as t};
|